FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
auto update
tilakpatel224d64c6de5467
diff --git a/fincept-terminal-desktop/.github/workflows/build-with-updater.yml b/fincept-terminal-desktop/.github/workflows/build-with-updater.ymlnew file mode 100644index 000000000..81f9b42ff--- /dev/null+++ b/fincept-terminal-desktop/.github/workflows/build-with-updater.yml@@ -0,0 +1,98 @@+name: Build FinceptTerminal with Auto-Updater++on:+ workflow_dispatch:+ push:+ tags:+ - 'v*'++jobs:+ build:+ strategy:+ fail-fast: false+ matrix:+ include:+ - platform: 'macos-latest'+ args: '--target aarch64-apple-darwin'+ os_name: 'macOS'+ arch: 'arm64'+ target: 'aarch64-apple-darwin'+ - platform: 'macos-latest'+ args: '--target x86_64-apple-darwin'+ os_name: 'macOS'+ arch: 'x64'+ target: 'x86_64-apple-darwin'+ - platform: 'ubuntu-22.04'+ args: '--target x86_64-unknown-linux-gnu'+ os_name: 'Linux'+ arch: 'x64'+ target: 'x86_64-unknown-linux-gnu'+ - platform: 'windows-latest'+ args: '--target x86_64-pc-windows-msvc'+ os_name: 'Windows'+ arch: 'x64'+ target: 'x86_64-pc-windows-msvc'++ runs-on: ${{ matrix.platform }}++ steps:+ - name: Checkout repository+ uses: actions/checkout@v4++ - name: Install dependencies (ubuntu only)+ if: matrix.platform == 'ubuntu-22.04'+ run: |+ sudo apt-get update+ sudo apt-get install -y \+ libwebkit2gtk-4.1-dev \+ libwebkit2gtk-4.0-dev \+ libjavascriptcoregtk-4.1-dev \+ libjavascriptcoregtk-4.0-dev \+ libsoup-3.0-dev \+ libsoup2.4-dev \+ build-essential \+ curl \+ wget \+ file \+ libssl-dev \+ libgtk-3-dev \+ libayatana-appindicator3-dev \+ librsvg2-dev \+ patchelf \+ libnss3-dev \+ libxss1 \+ libasound2-dev++ - name: Rust setup+ uses: dtolnay/rust-toolchain@stable+ with:+ targets: ${{ matrix.target }}++ - name: Rust cache+ uses: swatinem/rust-cache@v2+ with:+ workspaces: './src-tauri -> target'++ - name: Sync node version and setup cache+ uses: actions/setup-node@v4+ with:+ node-version: 'lts/*'+ cache: 'npm'++ - name: Install frontend dependencies+ run: npm install++ - name: Build the app with updater+ uses: tauri-apps/tauri-action@v0+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}+ with:+ tagName: ${{ github.ref_name }}+ releaseName: 'FinceptTerminal ${{ github.ref_name }}'+ releaseBody: 'See the assets to download this version and install.'+ releaseDraft: false+ prerelease: false+ args: ${{ matrix.args }}+ includeUpdaterJson: truediff --git a/fincept-terminal-desktop/package-lock.json b/fincept-terminal-desktop/package-lock.jsonindex 79e0b9634..a5bde252a 100644--- a/fincept-terminal-desktop/package-lock.json+++ b/fincept-terminal-desktop/package-lock.json@@ -40,8 +40,10 @@"@tauri-apps/plugin-dialog": "^2.4.2","@tauri-apps/plugin-http": "^2.5.2","@tauri-apps/plugin-opener": "^2",+ "@tauri-apps/plugin-process": "^2.3.1","@tauri-apps/plugin-shell": "^2.3.3","@tauri-apps/plugin-sql": "^2.3.0",+ "@tauri-apps/plugin-updater": "^2.9.0","@types/react-grid-layout": "^1.3.5","axios": "^1.12.2","cheerio": "^1.1.2",@@ -4086,6 +4088,15 @@"@tauri-apps/api": "^2.8.0"}},+ "node_modules/@tauri-apps/plugin-process": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-process/-/plugin-process-2.3.1.tgz",+ "integrity": "sha512-nCa4fGVaDL/B9ai03VyPOjfAHRHSBz5v6F/ObsB73r/dA3MHHhZtldaDMIc0V/pnUw9ehzr2iEG+XkSEyC0JJA==",+ "license": "MIT OR Apache-2.0",+ "dependencies": {+ "@tauri-apps/api": "^2.8.0"+ }+ },"node_modules/@tauri-apps/plugin-shell": {"version": "2.3.3","resolved": "https://registry.npmjs.org/@tauri-apps/plugin-shell/-/plugin-shell-2.3.3.tgz",@@ -4104,6 +4115,15 @@"@tauri-apps/api": "^2.6.0"}},+ "node_modules/@tauri-apps/plugin-updater": {+ "version": "2.9.0",+ "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-updater/-/plugin-updater-2.9.0.tgz",+ "integrity": "sha512-j++sgY8XpeDvzImTrzWA08OqqGqgkNyxczLD7FjNJJx/uXxMZFz5nDcfkyoI/rCjYuj2101Tci/r/HFmOmoxCg==",+ "license": "MIT OR Apache-2.0",+ "dependencies": {+ "@tauri-apps/api": "^2.6.0"+ }+ },"node_modules/@tokenizer/token": {"version": "0.3.0","resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",diff --git a/fincept-terminal-desktop/package.json b/fincept-terminal-desktop/package.jsonindex 8284bf9b2..9f7434393 100644--- a/fincept-terminal-desktop/package.json+++ b/fincept-terminal-desktop/package.json@@ -42,8 +42,10 @@"@tauri-apps/plugin-dialog": "^2.4.2","@tauri-apps/plugin-http": "^2.5.2","@tauri-apps/plugin-opener": "^2",+ "@tauri-apps/plugin-process": "^2.3.1","@tauri-apps/plugin-shell": "^2.3.3","@tauri-apps/plugin-sql": "^2.3.0",+ "@tauri-apps/plugin-updater": "^2.9.0","@types/react-grid-layout": "^1.3.5","axios": "^1.12.2","cheerio": "^1.1.2",diff --git a/fincept-terminal-desktop/src-tauri/Cargo.toml b/fincept-terminal-desktop/src-tauri/Cargo.tomlindex c71cdbde9..8ec0e158f 100644--- a/fincept-terminal-desktop/src-tauri/Cargo.toml+++ b/fincept-terminal-desktop/src-tauri/Cargo.toml@@ -26,6 +26,8 @@ tauri-plugin-opener = "2"tauri-plugin-cors-fetch = "4"tauri-plugin-sql = { version = "2", features = ["sqlite"] }tauri-plugin-dialog = "2"+tauri-plugin-updater = "2"+tauri-plugin-process = "2"serde = { version = "1", features = ["derive"] }serde_json = "1"sha2 = "0.10"diff --git a/fincept-terminal-desktop/src-tauri/capabilities/default.json b/fincept-terminal-desktop/src-tauri/capabilities/default.jsonindex b715dda4d..5ce8651dd 100644--- a/fincept-terminal-desktop/src-tauri/capabilities/default.json+++ b/fincept-terminal-desktop/src-tauri/capabilities/default.json@@ -11,6 +11,14 @@"sql:allow-load","sql:allow-execute","sql:allow-select",- "sql:allow-close"+ "sql:allow-close",+ "dialog:default",+ "dialog:allow-ask",+ "dialog:allow-message",+ "updater:default",+ "updater:allow-check",+ "updater:allow-download-and-install",+ "process:default",+ "process:allow-restart"]}diff --git a/fincept-terminal-desktop/src-tauri/src/lib.rs b/fincept-terminal-desktop/src-tauri/src/lib.rsindex dc0738c52..5d6dd450f 100644--- a/fincept-terminal-desktop/src-tauri/src/lib.rs+++ b/fincept-terminal-desktop/src-tauri/src/lib.rs@@ -372,6 +372,8 @@ pub fn run() {.plugin(tauri_plugin_cors_fetch::init()).plugin(tauri_plugin_sql::Builder::default().build()).plugin(tauri_plugin_dialog::init())+ .plugin(tauri_plugin_updater::Builder::new().build())+ .plugin(tauri_plugin_process::init()).manage(MCPState {processes: Mutex::new(HashMap::new()),})diff --git a/fincept-terminal-desktop/src-tauri/tauri.conf.json b/fincept-terminal-desktop/src-tauri/tauri.conf.jsonindex c743b6c50..da7dcca1c 100644--- a/fincept-terminal-desktop/src-tauri/tauri.conf.json+++ b/fincept-terminal-desktop/src-tauri/tauri.conf.json@@ -30,6 +30,7 @@"bundle": {"active": true,"targets": "all",+ "createUpdaterArtifacts": true,"icon": ["icons/32x32.png","icons/64x64.png",@@ -64,5 +65,16 @@"installMode": "currentUser"}}+ },+ "plugins": {+ "updater": {+ "endpoints": [+ "https://github.com/Fincept-Corporation/FinceptTerminal/releases/latest/download/latest.json"+ ],+ "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU2QzgwNzA1NzYzMTRBMzcKUldRM1NqRjJCUWZJNXNWWHU1ZzR2ZjFzamp3TnlsanhsT0VmaGZ6SUZEWTdwNEJLNkdEQjBGblYK",+ "windows": {+ "installMode": "passive"+ }+ }}}\ No newline at end of filediff --git a/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.key b/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.keynew file mode 100644index 000000000..7ae4c242f--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.key@@ -0,0 +1 @@+dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5M3JhSERBZmd6TFFRMDhpc0xObDl3bzBPSTRMdGxJL1RXNWNYVXI2dkltOEFBQkFBQUFBQUFBQUFBQUlBQUFBQVNqL0UvK1JOWjBxbHVuR04wRzRKZ0hzb2F4R29scVdiZ05vMzkwMFNVakQ0M2ZNWHN1U0gvemczakhXQnkyTFF3UnphOVpDcWd4SDY3dkg3Uklncjl3VWNrZDZUNjhzeUl4VG9hQ2tmS0dxMlpXalc2eTNLTmhwUDcxL3h3Y05BVFJSRFYwYnh0QzQ9Cg==\ No newline at end of filediff --git a/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.key.pub b/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.key.pubnew file mode 100644index 000000000..c623ed869--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/~/.tauri/fincept-terminal.key.pub@@ -0,0 +1 @@+dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU2QzgwNzA1NzYzMTRBMzcKUldRM1NqRjJCUWZJNXNWWHU1ZzR2ZjFzamp3TnlsanhsT0VmaGZ6SUZEWTdwNEJLNkdEQjBGblYK\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsxindex 3f1ed95ba..418f2dddd 100644--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx@@ -4,6 +4,9 @@ import { Maximize, Minimize, Download, Settings, RefreshCw, User, Database, Eye,import { useAuth } from '@/contexts/AuthContext';import { useNavigation } from '@/contexts/NavigationContext';import { APP_VERSION } from '@/constants/version';+import { useAutoUpdater } from '@/hooks/useAutoUpdater';+import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';+import { Button } from '@/components/ui/button';import ForumTab from '@/components/tabs/ForumTab';import DashboardTab from '@/components/tabs/DashboardTab';import MarketsTab from '@/components/tabs/MarketsTab';@@ -120,6 +123,7 @@ export default function FinxeptTerminal() {const [activeTab, setActiveTab] = useState("dashboard");const [isFullscreen, setIsFullscreen] = useState(false);const [statusMessage, setStatusMessage] = useState("");+ const { updateAvailable, updateInfo, installUpdate, dismissUpdate } = useAutoUpdater();React.useEffect(() => {document.body.style.margin = '0';@@ -851,6 +855,42 @@ export default function FinxeptTerminal() {</TabsContent></Tabs></div>++ {/* Update Available Dialog */}+ <Dialog open={updateAvailable} onOpenChange={(open) => !open && dismissUpdate()}>+ <DialogContent className="sm:max-w-[425px]">+ <DialogHeader>+ <DialogTitle>Update Available</DialogTitle>+ <DialogDescription>+ A new version of FinceptTerminal is available.+ </DialogDescription>+ </DialogHeader>+ <div className="py-4">+ <div className="mb-4">+ <p className="text-sm font-semibold mb-2">Version: {updateInfo?.version}</p>+ {updateInfo?.body && (+ <div className="text-sm text-muted-foreground">+ <p className="font-semibold mb-1">Release Notes:</p>+ <div className="max-h-48 overflow-y-auto bg-muted p-3 rounded-md">+ <pre className="whitespace-pre-wrap text-xs">{updateInfo.body}</pre>+ </div>+ </div>+ )}+ </div>+ <p className="text-xs text-muted-foreground">+ The update will download and install automatically. Your app will restart after installation.+ </p>+ </div>+ <DialogFooter>+ <Button variant="outline" onClick={dismissUpdate}>+ Later+ </Button>+ <Button onClick={installUpdate}>+ Update Now+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog></div>);}\ No newline at end of filediff --git a/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts b/fincept-terminal-desktop/src/hooks/useAutoUpdater.tsnew file mode 100644index 000000000..adad69c2a--- /dev/null+++ b/fincept-terminal-desktop/src/hooks/useAutoUpdater.ts@@ -0,0 +1,111 @@+import { useEffect, useState } from 'react';+import { check, type Update } from '@tauri-apps/plugin-updater';+import { relaunch } from '@tauri-apps/plugin-process';++const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000; // 7 days in milliseconds+const LAST_CHECK_KEY = 'updater_last_check';++interface UseAutoUpdaterReturn {+ updateAvailable: boolean;+ updateInfo: Update | null;+ isChecking: boolean;+ checkForUpdate: () => Promise<void>;+ installUpdate: () => Promise<void>;+ dismissUpdate: () => void;+}++export function useAutoUpdater(): UseAutoUpdaterReturn {+ const [updateAvailable, setUpdateAvailable] = useState(false);+ const [updateInfo, setUpdateInfo] = useState<Update | null>(null);+ const [isChecking, setIsChecking] = useState(false);++ const checkForUpdate = async (silent = false) => {+ try {+ setIsChecking(true);++ const update = await check();++ if (update?.available) {+ console.log(`[Updater] Update available: v${update.version}`);+ console.log(`[Updater] Release notes: ${update.body}`);++ setUpdateInfo(update);+ setUpdateAvailable(true);++ // Update last check timestamp+ localStorage.setItem(LAST_CHECK_KEY, Date.now().toString());+ } else {+ if (!silent) {+ console.log('[Updater] No updates available');+ }+ }+ } catch (error) {+ console.error('[Updater] Error checking for updates:', error);+ } finally {+ setIsChecking(false);+ }+ };++ const installUpdate = async () => {+ if (!updateInfo) {+ console.error('[Updater] No update info available');+ return;+ }++ try {+ console.log('[Updater] Downloading and installing update...');+ await updateInfo.downloadAndInstall();++ console.log('[Updater] Update installed, relaunching app...');+ await relaunch();+ } catch (error) {+ console.error('[Updater] Error installing update:', error);+ }+ };++ const dismissUpdate = () => {+ setUpdateAvailable(false);+ setUpdateInfo(null);+ };++ useEffect(() => {+ // Check if we should run an update check+ const shouldCheckForUpdate = () => {+ const lastCheck = localStorage.getItem(LAST_CHECK_KEY);++ if (!lastCheck) {+ return true; // First time, check immediately+ }++ const lastCheckTime = parseInt(lastCheck, 10);+ const timeSinceLastCheck = Date.now() - lastCheckTime;++ return timeSinceLastCheck >= SEVEN_DAYS_MS;+ };++ // Perform initial check on mount if needed+ if (shouldCheckForUpdate()) {+ console.log('[Updater] Performing background update check...');+ checkForUpdate(true);+ }++ // Set up periodic checks every 7 days+ const interval = setInterval(() => {+ if (shouldCheckForUpdate()) {+ console.log('[Updater] Performing scheduled update check...');+ checkForUpdate(true);+ }+ }, SEVEN_DAYS_MS);++ return () => clearInterval(interval);+ }, []);++ return {+ updateAvailable,+ updateInfo,+ isChecking,+ checkForUpdate: () => checkForUpdate(false),+ installUpdate,+ dismissUpdate,+ };+}diff --git a/fincept-terminal-desktop/test-agent-commands.html b/fincept-terminal-desktop/test-agent-commands.htmldeleted file mode 100644index 01d363723..000000000--- a/fincept-terminal-desktop/test-agent-commands.html+++ /dev/null@@ -1,110 +0,0 @@-<!DOCTYPE html>-<html>-<head>- <title>Test Agent Commands</title>- <script type="module">- // This will only work when running inside Tauri- import { invoke } from '@tauri-apps/api/core';-- async function testListAgents() {- console.log('Testing list_available_agents...');- try {- const result = await invoke('list_available_agents');- console.log('✅ list_available_agents SUCCESS:', result);- document.getElementById('list-result').innerText = JSON.stringify(result, null, 2);- } catch (error) {- console.error('❌ list_available_agents FAILED:', error);- document.getElementById('list-result').innerText = 'ERROR: ' + error;- }- }-- async function testExecuteAgent() {- console.log('Testing execute_python_agent...');- try {- const result = await invoke('execute_python_agent', {- agentType: 'warren_buffett',- parameters: {- tickers: ['AAPL'],- end_date: '2024-12-31'- },- inputs: {}- });- console.log('✅ execute_python_agent SUCCESS:', result);- document.getElementById('execute-result').innerText = JSON.stringify(result, null, 2);- } catch (error) {- console.error('❌ execute_python_agent FAILED:', error);- document.getElementById('execute-result').innerText = 'ERROR: ' + error;- }- }-- async function testGetMetadata() {- console.log('Testing get_agent_metadata...');- try {- const result = await invoke('get_agent_metadata', {- agentType: 'warren_buffett'- });- console.log('✅ get_agent_metadata SUCCESS:', result);- document.getElementById('metadata-result').innerText = JSON.stringify(result, null, 2);- } catch (error) {- console.error('❌ get_agent_metadata FAILED:', error);- document.getElementById('metadata-result').innerText = 'ERROR: ' + error;- }- }-- // Expose functions to window- window.testListAgents = testListAgents;- window.testExecuteAgent = testExecuteAgent;- window.testGetMetadata = testGetMetadata;- </script>- <style>- body {- font-family: 'Consolas', monospace;- background: #0a0a0a;- color: #d4d4d4;- padding: 20px;- }- button {- background: #ea580c;- color: white;- border: none;- padding: 10px 20px;- margin: 10px 5px;- cursor: pointer;- font-size: 14px;- font-weight: bold;- }- button:hover {- background: #dc2626;- }- pre {- background: #1a1a1a;- border: 1px solid #2d2d2d;- padding: 15px;- border-radius: 5px;- overflow: auto;- max-height: 400px;- }- h2 {- color: #ea580c;- }- </style>-</head>-<body>- <h1>🧪 Agent Commands Test</h1>-- <div>- <button onclick="testListAgents()">1. Test List Agents</button>- <button onclick="testGetMetadata()">2. Test Get Metadata</button>- <button onclick="testExecuteAgent()">3. Test Execute Agent</button>- </div>-- <h2>List Agents Result:</h2>- <pre id="list-result">Click "Test List Agents" button</pre>-- <h2>Get Metadata Result:</h2>- <pre id="metadata-result">Click "Test Get Metadata" button</pre>-- <h2>Execute Agent Result:</h2>- <pre id="execute-result">Click "Test Execute Agent" button</pre>-</body>-</html>