diff options
Diffstat (limited to 'modules/core/module-aiassist.js')
| -rw-r--r-- | modules/core/module-aiassist.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/core/module-aiassist.js b/modules/core/module-aiassist.js index f69494e..a8c0ae1 100644 --- a/modules/core/module-aiassist.js +++ b/modules/core/module-aiassist.js @@ -98,7 +98,7 @@ buildSystemPrompt() { + 'FS: list/read/write/delete | NVFS: nvfs-resolve | Web: search/fetch [POST=method+body] | Mod: view/edit/test/reload | Config | Skills | VaultMind | wallet-lookup | get_usage_stats\\n' + 'web_fetch: GET for pages, POST with method+body for JSON APIs. JS: node <file.js> or node -e "expr" (browser JS only).\n' + 'Other: floating, webdav, cron, vault, sandbox, agents, wpm, mindmap, memgraph, world-model, predict, guardrail, tar, secret-* — via help.\n' - + 'predict_task: estimate duration before complex tasks. world_model_query: ask about system state, changes, health.'; + + 'predict_task: estimate duration before complex tasks. world_model_query: read the system snapshot (modules, files, agents, telemetry, recent errors) and answer from it.'; if (profilePrompt) { base = profilePrompt + '\n\n' + base; } @@ -649,11 +649,12 @@ buildSystemPrompt() { type: 'function', function: { name: 'world_model_query', - description: 'Query the system world model for self-awareness: modules, skills, files, agents, health, memory graph, recent changes, active projects, telemetry. Ask questions like "what changed" or "how many modules".', + description: 'Read the synthesized system world model (modules, files, skills, agents, memory graph, telemetry, recent changes). Returns a JSON snapshot you can reason over; `facts` additionally carries the instant keyword answer. Ask detail:"full" for the complete model (~3 KB).', parameters: { type: 'object', properties: { - question: { type: 'string', description: 'What to ask: modules, skills, files, agents, health, memory, changes, projects, telemetry, summary' } + question: { type: 'string', description: 'What you want to know (used for the fast facts line)' }, + detail: { type: 'string', description: '"digest" (default) or "full"' } }, required: ['question'] } @@ -3035,8 +3036,14 @@ buildSystemPrompt() { var wm = this.terminal.moduleManager.modules['WorldModelModule']; if (!wm) return JSON.stringify({ error: 'WorldModelModule not loaded' }); if (!wm._model) return JSON.stringify({ error: 'World model not synthesized yet — run world-model-refresh' }); - var wmAnswer = wm._answerQuery(a.question || ''); - return JSON.stringify({ question: a.question, answer: wmAnswer, version: wm._model.version, synthesized: wm._model.synthesized }); + var wmOut = { + question: a.question, + facts: wm._answerQuery(a.question || ''), + version: wm._model.version, + synthesized: wm._model.synthesized, + snapshot: (a.detail === 'full') ? wm._model : JSON.parse(wm._modelDigest()) + }; + return JSON.stringify(wmOut); } case 'health_check': case 'diff_module': |