From 0eca39021874a673933ebb82b973002b682e7a4b Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 18 Jun 2026 18:00:54 +0200 Subject: auto: 2026-06-18_18:00 changes --- modules/core/module-aiassist.js | 46 +++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'modules/core/module-aiassist.js') diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index ee36789..c58bab3 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -82,7 +82,8 @@ buildSystemPrompt() { + 'VFS→Modules→AI. nvfs-index for commands. Tool→Observe→Answer. nvfs-resolve. Destructive cmds need confirm.\n' + 'FS: list/read/write/delete | NVFS: nvfs-resolve | Web: search/fetch [POST=method+body] | Mod: view/edit/test/reload | Config | Skills | VaultMind: vaultmind_connect(network) — connect wallet, vaultmind_status — check session, vaultmind_query(ep,msg,agent) — Hyperliquid prices/portfolio/chat | wallet_lookup(address) — read-only portfolio for any wallet\n' + 'web_fetch tool: GET for normal pages (returns title+content+word_count), POST for JSON APIs like Hyperliquid /info (pass method="POST" and body as JSON string).\n' - + 'Other: floating, webdav, cron, vault, sandbox, agents, wpm, mindmap, memgraph, guardrail, wget, tar, secret-* — discoverable via help'; + + 'Other: floating, webdav, cron, vault, sandbox, agents, wpm, mindmap, memgraph, guardrail, wget, tar, secret-* — discoverable via help. ' + + 'JS: node executes JS from VFS (alias for js-run), node -e "expr" for inline eval. No real Node.js runtime — browser JS only.'; if (profilePrompt) { base = profilePrompt + '\n\n' + base; } @@ -507,6 +508,8 @@ buildSystemPrompt() { 'ai-stop': 'ai-stop — Cancel current AI operation', 'ai-model': 'ai-model [model] — Show or set AI model', 'ai-config': 'ai-config [key] [value] — View or set AI loop config (max-turns, max-context, confirm-timeout(0=disabled))', + 'debug': 'debug — Toggle system debug console (logs, fetch, errors)', + 'debug-ai': 'debug-ai — Toggle AI tool-call debug panel', 'mem-debug': 'mem-debug — Show memory breakdown by component', 'reset-mem': 'reset-mem — Reset AI memory (logs, context, profile, guardrails) without losing VFS or config', 'vaultmind-connect': 'vaultmind-connect [testnet|mainnet] — Connect VaultMind wallet using hyperliquid_key from SecretVault', @@ -526,7 +529,8 @@ buildSystemPrompt() { this.commands['ai-model'] = (args) => this.showModel(args); this.commands['ai-compress'] = () => this._manualCompress(); this.commands['ai-config'] = (args) => this.aiConfig(args); - this.commands['debug'] = () => this.toggleDebug(); + this.commands['debug'] = () => this.toggleDebugPanel(); + this.commands['debug-ai'] = () => this.toggleDebug(); this.commands['guardrail'] = (args) => this.guardrailCmd(args); this.commands['guardrail-add'] = (args) => this.guardrailCmd(['add', ...args]); this.commands['guardrail-remove'] = (args) => this.guardrailCmd(['remove', ...args]); @@ -692,7 +696,7 @@ buildSystemPrompt() { } _updateDebugPanel() { if (!this._debugPanelEnabled) return; - const panel = document.getElementById('debug-panel'); + const panel = document.getElementById('debug-ai-panel'); if (!panel) return; const recent = this._toolCallLog.slice(-20); let html = ''; @@ -713,7 +717,7 @@ buildSystemPrompt() { '' + '' + '' + - '✕' + + '✕' + '' + html; } _isToolError(result) { @@ -1145,24 +1149,32 @@ buildSystemPrompt() { // Immediately reset UI so user knows it stopped this.terminal.setAiBusy(false); } + toggleDebugPanel() { + const mod = this.terminal.moduleManager.modules['DebugPanel']; + if (mod) { + mod.terminal = this.terminal; + if (!mod._seeded) { + mod._seeded = true; + mod.seed(); + } + mod.toggle(); + } else { + this.terminal.print('Debug panel not loaded. Run: module load debug-panel', 'warning'); + } + } toggleDebug() { this._debugPanelEnabled = !this._debugPanelEnabled; - let panel = document.getElementById('debug-panel'); + let panel = document.getElementById('debug-ai-panel'); if (!panel) { - // Create the debug panel panel = document.createElement('div'); - panel.id = 'debug-panel'; + panel.id = 'debug-ai-panel'; panel.style.cssText = 'position:fixed;right:10px;top:50px;width:340px;max-height:350px;overflow-y:auto;background:#0a0a0a;border:1px solid #333;border-radius:6px;z-index:100;font-family:monospace;font-size:0.75em;display:none;'; document.body.appendChild(panel); - // Add close button handler - panel.addEventListener('click', function() { - // Toggle collapsed/expanded state - }); } panel.style.display = this._debugPanelEnabled ? 'block' : 'none'; if (this._debugPanelEnabled) { this._updateDebugPanel(); - this.terminal.print('🔧 Debug panel enabled — shows tool call log in bottom-right corner. Close with: debug', 'info'); + this.terminal.print('🔧 AI debug panel enabled — shows tool call log. Close with: debug-ai', 'info'); } else { this.terminal.print('🔧 Debug panel disabled', 'info'); } @@ -1444,7 +1456,15 @@ buildSystemPrompt() { 'system-health','modules','listmods','modules-list','get-help-info','alias', 'nvfs-index','nvfs-status','nvfs-resolve','nvfs-tree','nvfs-config','nvfs-alias','nvfs-sync', 'floating-add','floating-remove','floating-list','floating-pos','floating-clear','floating-toggle', - 'mem-debug','reset-mem']); + 'debug','debug-ai','session-new','mem-debug','reset-mem', + // Node bridge — alias for js-run + 'node', + // Synced from terminal whitelist — read-only orchestration/A2A/agent commands + 'orchestrate','orchestrate-parallel','orchestrate-decompose','orchestrate-result', + 'orchestrator-status','orchestrator-list','orchestrator-config','orchestrator-restart-policy', + 'a2a-list','a2a-status','a2a-poll', + 'consensus','consensus-status','consensus-history', + 'pipeline','agent-list','agent-status','contract-list']); return !safeRead.has(cmd); } return ['write_file','delete_file','make_directory','edit_module','delegate_task','spawn_agent','create_skill','patch_skill','wpm_install','user_set','session_save'].includes(name); -- cgit v1.2.3