monomind 1.10.57 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/core/coordinator.md +71 -0
- package/.claude/agents/generated/case-analyst.md +50 -0
- package/.claude/agents/generated/copy-editor.md +45 -0
- package/.claude/agents/generated/court-reporter.md +50 -0
- package/.claude/agents/generated/defender.md +51 -0
- package/.claude/agents/generated/editor-in-chief.md +45 -0
- package/.claude/agents/generated/fact-checker.md +45 -0
- package/.claude/agents/generated/judge.md +51 -0
- package/.claude/agents/generated/prosecutor.md +51 -0
- package/.claude/agents/generated/reporter.md +45 -0
- package/.claude/commands/hooks/README.md +1 -1
- package/.claude/commands/hooks/overview.md +1 -1
- package/.claude/commands/mastermind/_repeat.md +1 -1
- package/.claude/commands/mastermind/do.md +3 -1
- package/.claude/commands/mastermind/help.md +2 -2
- package/.claude/commands/mastermind/master.md +39 -6
- package/.claude/commands/mastermind/memory.md +1 -1
- package/.claude/commands/memory/memory-search.md +2 -2
- package/.claude/commands/monitoring/status.md +1 -1
- package/.claude/commands/{browse.md → monobrowse.md} +2 -2
- package/.claude/commands/sparc.md +1 -1
- package/.claude/helpers/handlers/graph-status-handler.cjs +1 -1
- package/.claude/helpers/loop-tracker.cjs +1 -1
- package/.claude/scheduled_tasks.lock +1 -1
- package/.claude/skills/agent-browser-testing/SKILL.md +1 -1
- package/.claude/skills/hooks-automation/SKILL.md +0 -3
- package/.claude/skills/mastermind/build.md +1 -1
- package/.claude/skills/mastermind/code-quality-reviewer-prompt.md +60 -0
- package/.claude/skills/mastermind/content.md +1 -1
- package/.claude/skills/mastermind/createorg.md +79 -2
- package/.claude/skills/mastermind/design.md +3 -1
- package/.claude/skills/mastermind/finance.md +1 -1
- package/.claude/skills/mastermind/implementer-prompt.md +109 -0
- package/.claude/skills/mastermind/marketing.md +1 -1
- package/.claude/skills/mastermind/ops.md +1 -1
- package/.claude/skills/mastermind/plan.md +20 -2
- package/.claude/skills/mastermind/release.md +1 -1
- package/.claude/skills/mastermind/research.md +1 -1
- package/.claude/skills/mastermind/review.md +1 -1
- package/.claude/skills/mastermind/sales.md +1 -1
- package/.claude/skills/mastermind/spec-reviewer-prompt.md +63 -0
- package/.claude/skills/sparc-methodology/SKILL.md +3 -3
- package/.claude/skills/swarm-advanced/SKILL.md +1 -4
- package/.claude-plugin/README.md +1 -2
- package/.claude-plugin/docs/PLUGIN_SUMMARY.md +0 -1
- package/README.md +18 -32
- package/package.json +1 -1
- package/packages/@monomind/cli/README.md +18 -32
- package/packages/@monomind/cli/dist/src/agents/registry-builder.d.ts +1 -7
- package/packages/@monomind/cli/dist/src/agents/registry-builder.js +10 -6
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.d.ts +59 -12
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +67 -13
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +5 -5
- package/packages/@monomind/cli/dist/src/commands/agent.js +1 -6
- package/packages/@monomind/cli/dist/src/commands/analyze.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/analyze.js +8 -18
- package/packages/@monomind/cli/dist/src/commands/doctor.js +53 -3
- package/packages/@monomind/cli/dist/src/commands/embeddings.js +9 -33
- package/packages/@monomind/cli/dist/src/commands/hooks.js +24 -76
- package/packages/@monomind/cli/dist/src/commands/index.d.ts +4 -6
- package/packages/@monomind/cli/dist/src/commands/index.js +8 -15
- package/packages/@monomind/cli/dist/src/commands/init.js +2 -2
- package/packages/@monomind/cli/dist/src/commands/issues.js +16 -11
- package/packages/@monomind/cli/dist/src/commands/memory.js +6 -6
- package/packages/@monomind/cli/dist/src/commands/migrate.js +1 -2
- package/packages/@monomind/cli/dist/src/commands/monograph.js +18 -11
- package/packages/@monomind/cli/dist/src/commands/monovector/backup.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/backup.js +25 -25
- package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/benchmark.js +14 -14
- package/packages/@monomind/cli/dist/src/commands/monovector/import.d.ts +18 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/import.js +21 -21
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/index.d.ts +6 -6
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/index.js +22 -22
- package/packages/@monomind/cli/dist/src/commands/monovector/init.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/init.js +36 -36
- package/packages/@monomind/cli/dist/src/commands/monovector/migrate.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/migrate.js +16 -16
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/optimize.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/optimize.js +10 -10
- package/packages/@monomind/cli/dist/src/commands/monovector/setup.d.ts +18 -0
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/setup.js +77 -77
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/status.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/commands/{ruvector → monovector}/status.js +34 -34
- package/packages/@monomind/cli/dist/src/commands/neural.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/commands/neural.js +31 -608
- package/packages/@monomind/cli/dist/src/commands/performance.js +7 -10
- package/packages/@monomind/cli/dist/src/commands/plugins.js +3 -4
- package/packages/@monomind/cli/dist/src/commands/process.js +5 -12
- package/packages/@monomind/cli/dist/src/commands/progress.js +16 -16
- package/packages/@monomind/cli/dist/src/commands/route.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/commands/route.js +23 -23
- package/packages/@monomind/cli/dist/src/commands/status.js +0 -3
- package/packages/@monomind/cli/dist/src/commands/swarm.js +2 -3
- package/packages/@monomind/cli/dist/src/config-adapter.js +27 -0
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.d.ts +44 -17
- package/packages/@monomind/cli/dist/src/dlq/dlq-replayer.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/index.js +5 -5
- package/packages/@monomind/cli/dist/src/init/claudemd-generator.js +10 -14
- package/packages/@monomind/cli/dist/src/init/executor.js +17 -27
- package/packages/@monomind/cli/dist/src/init/helpers-generator.js +2 -2
- package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-client.js +1 -7
- package/packages/@monomind/cli/dist/src/mcp-server.js +9 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +1 -52
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.js +5 -5
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +6 -5
- package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.js +51 -54
- package/packages/@monomind/cli/dist/src/mcp-tools/daa-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +10 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +0 -24
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +189 -480
- package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.d.ts +334 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.js +1108 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +76 -34
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +2 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/ruvllm-tools.js +3 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.js +29 -19
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +2 -2
- package/packages/@monomind/cli/dist/src/memory/intelligence.js +14 -8
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +17 -2
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +76 -23
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +37 -39
- package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +34 -0
- package/packages/@monomind/cli/dist/src/monovector/capabilities.js +37 -0
- package/packages/@monomind/cli/dist/src/monovector/command-outcomes.d.ts +37 -0
- package/packages/@monomind/cli/dist/src/monovector/command-outcomes.js +87 -0
- package/packages/@monomind/cli/dist/src/monovector/coverage-router.d.ts +103 -0
- package/packages/@monomind/cli/dist/src/monovector/coverage-router.js +337 -0
- package/packages/@monomind/cli/dist/src/monovector/coverage-tools.d.ts +14 -0
- package/packages/@monomind/cli/dist/src/monovector/coverage-tools.js +112 -0
- package/packages/@monomind/cli/dist/src/{ruvector → monovector}/diff-classifier.d.ts +2 -2
- package/packages/@monomind/cli/dist/src/monovector/index.d.ts +61 -0
- package/packages/@monomind/cli/dist/src/monovector/index.js +67 -0
- package/packages/@monomind/cli/dist/src/monovector/init-state.d.ts +35 -0
- package/packages/@monomind/cli/dist/src/monovector/init-state.js +36 -0
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.d.ts +55 -0
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.js +137 -0
- package/packages/@monomind/cli/dist/src/parser.js +3 -3
- package/packages/@monomind/cli/dist/src/plugins/store/discovery.js +0 -31
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.d.ts +26 -6
- package/packages/@monomind/cli/dist/src/production/error-handler.d.ts +55 -30
- package/packages/@monomind/cli/dist/src/production/index.d.ts +3 -20
- package/packages/@monomind/cli/dist/src/production/index.js +3 -15
- package/packages/@monomind/cli/dist/src/production/monitoring.d.ts +54 -34
- package/packages/@monomind/cli/dist/src/production/monitoring.js +12 -14
- package/packages/@monomind/cli/dist/src/production/rate-limiter.d.ts +64 -19
- package/packages/@monomind/cli/dist/src/production/rate-limiter.js +5 -5
- package/packages/@monomind/cli/dist/src/production/retry.js +4 -2
- package/packages/@monomind/cli/dist/src/services/claim-service.d.ts +50 -59
- package/packages/@monomind/cli/dist/src/services/claim-service.js +83 -50
- package/packages/@monomind/cli/dist/src/services/config-file-manager.js +8 -1
- package/packages/@monomind/cli/dist/src/services/worker-daemon.js +4 -0
- package/packages/@monomind/cli/dist/src/types.d.ts +13 -0
- package/packages/@monomind/cli/package.json +13 -13
- package/packages/@monomind/guidance/dist/index.d.ts +1 -1
- package/packages/@monomind/guidance/dist/index.js +1 -1
- package/packages/@monomind/guidance/package.json +1 -2
- package/scripts/build-monovector.sh +10 -0
- package/scripts/publish-monovector.sh +20 -0
- package/.claude/commands/monomind/adr.md +0 -11
- package/.claude/commands/monomind/budget.md +0 -7
- package/.claude/commands/monomind/createtask.md +0 -277
- package/.claude/commands/monomind/do.md +0 -498
- package/.claude/commands/monomind/graph-status.md +0 -7
- package/.claude/commands/monomind/help.md +0 -118
- package/.claude/commands/monomind/idea.md +0 -273
- package/.claude/commands/monomind/improve.md +0 -352
- package/.claude/commands/monomind/loops.md +0 -7
- package/.claude/commands/monomind/memory.md +0 -230
- package/.claude/commands/monomind/repeat.md +0 -257
- package/.claude/commands/monomind/review.md +0 -317
- package/.claude/commands/monomind/specialagents.md +0 -125
- package/.claude/commands/monomind/swarm.md +0 -161
- package/.claude/commands/monomind/understand.md +0 -139
- package/.claude/commands/training/README.md +0 -39
- package/.claude/commands/training/neural-patterns.md +0 -73
- package/.claude/commands/training/neural-train.md +0 -79
- package/packages/@monomind/cli/dist/src/commands/appliance-advanced.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/commands/appliance-advanced.js +0 -238
- package/packages/@monomind/cli/dist/src/commands/appliance.d.ts +0 -8
- package/packages/@monomind/cli/dist/src/commands/appliance.js +0 -406
- package/packages/@monomind/cli/dist/src/commands/ruvector/backup.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/benchmark.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/import.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/commands/ruvector/init.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/migrate.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/commands/ruvector/setup.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.d.ts +0 -182
- package/packages/@monomind/cli/dist/src/ruvector/agent-wasm.js +0 -316
- package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.d.ts +0 -67
- package/packages/@monomind/cli/dist/src/ruvector/ast-analyzer.js +0 -277
- package/packages/@monomind/cli/dist/src/ruvector/coverage-router.d.ts +0 -160
- package/packages/@monomind/cli/dist/src/ruvector/coverage-router.js +0 -539
- package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/ruvector/coverage-tools.js +0 -157
- package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
- package/packages/@monomind/cli/dist/src/ruvector/enhanced-model-router.js +0 -551
- package/packages/@monomind/cli/dist/src/ruvector/flash-attention.d.ts +0 -195
- package/packages/@monomind/cli/dist/src/ruvector/flash-attention.js +0 -643
- package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.d.ts +0 -187
- package/packages/@monomind/cli/dist/src/ruvector/graph-analyzer.js +0 -929
- package/packages/@monomind/cli/dist/src/ruvector/index.d.ts +0 -67
- package/packages/@monomind/cli/dist/src/ruvector/index.js +0 -88
- package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.d.ts +0 -218
- package/packages/@monomind/cli/dist/src/ruvector/lora-adapter.js +0 -455
- package/packages/@monomind/cli/dist/src/ruvector/model-router.d.ts +0 -222
- package/packages/@monomind/cli/dist/src/ruvector/model-router.js +0 -512
- package/packages/@monomind/cli/dist/src/ruvector/moe-router.d.ts +0 -213
- package/packages/@monomind/cli/dist/src/ruvector/moe-router.js +0 -649
- package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.d.ts +0 -217
- package/packages/@monomind/cli/dist/src/ruvector/q-learning-router.js +0 -712
- package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
- package/packages/@monomind/cli/dist/src/ruvector/ruvllm-wasm.js +0 -363
- package/packages/@monomind/cli/dist/src/ruvector/semantic-router.d.ts +0 -77
- package/packages/@monomind/cli/dist/src/ruvector/semantic-router.js +0 -178
- package/packages/@monomind/cli/dist/src/ruvector/vector-db.d.ts +0 -69
- package/packages/@monomind/cli/dist/src/ruvector/vector-db.js +0 -243
- package/packages/@monomind/cli/dist/src/services/ruvector-training.d.ts +0 -222
- package/packages/@monomind/cli/dist/src/services/ruvector-training.js +0 -696
- /package/packages/@monomind/cli/dist/src/{ruvector → monovector}/diff-classifier.js +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Native TypeScript code intelligence — replaces Python graphify.
|
|
5
5
|
* All monograph_* tools are backed by @monoes/monograph package.
|
|
6
6
|
*/
|
|
7
|
-
import { join } from 'path';
|
|
7
|
+
import { join, resolve, sep } from 'path';
|
|
8
8
|
import { getProjectCwd } from './types.js';
|
|
9
9
|
function getDbPath() {
|
|
10
10
|
return join(getProjectCwd(), '.monomind', 'monograph.db');
|
|
@@ -50,7 +50,8 @@ const monographQueryTool = {
|
|
|
50
50
|
required: ['query'],
|
|
51
51
|
},
|
|
52
52
|
handler: async (input) => {
|
|
53
|
-
const { openDb, closeDb, ftsSearch
|
|
53
|
+
const { openDb, closeDb, ftsSearch } = await import('@monoes/monograph');
|
|
54
|
+
const { hybridQuery } = await import('./monograph-compat.js');
|
|
54
55
|
const db = openDb(getDbPath());
|
|
55
56
|
try {
|
|
56
57
|
const limit = input.limit ?? 20;
|
|
@@ -107,6 +108,9 @@ const monographHealthTool = {
|
|
|
107
108
|
const lastCommit = meta?.value ?? null;
|
|
108
109
|
if (!lastCommit)
|
|
109
110
|
return text('Index has never been built. Run monograph_build first.');
|
|
111
|
+
if (!/^[0-9a-f]{7,40}$/i.test(lastCommit)) {
|
|
112
|
+
return text('Index metadata is corrupt: invalid commit SHA. Run monograph_build to re-index.');
|
|
113
|
+
}
|
|
110
114
|
let commitsBehind = 0;
|
|
111
115
|
try {
|
|
112
116
|
const out = execSync(`git rev-list --count ${lastCommit}..HEAD`, {
|
|
@@ -221,11 +225,11 @@ const monographShortestPathTool = {
|
|
|
221
225
|
// ── monograph_community ───────────────────────────────────────────────────────
|
|
222
226
|
const monographCommunityTool = {
|
|
223
227
|
name: 'monograph_community',
|
|
224
|
-
description: 'Get all nodes belonging to a community (by numeric ID
|
|
228
|
+
description: 'Get all nodes belonging to a community (by numeric community ID).',
|
|
225
229
|
inputSchema: {
|
|
226
230
|
type: 'object',
|
|
227
231
|
properties: {
|
|
228
|
-
id: { type: 'string', description: 'Community ID (number)
|
|
232
|
+
id: { type: 'string', description: 'Community ID (number)' },
|
|
229
233
|
},
|
|
230
234
|
required: ['id'],
|
|
231
235
|
},
|
|
@@ -285,7 +289,8 @@ const monographSuggestTool = {
|
|
|
285
289
|
},
|
|
286
290
|
},
|
|
287
291
|
handler: async (input) => {
|
|
288
|
-
const { openDb, closeDb
|
|
292
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
293
|
+
const { hybridQuery } = await import('./monograph-compat.js');
|
|
289
294
|
const db = openDb(getDbPath());
|
|
290
295
|
try {
|
|
291
296
|
const limit = input.limit ?? 10;
|
|
@@ -295,6 +300,9 @@ const monographSuggestTool = {
|
|
|
295
300
|
if (task && process.env['MONOGRAPH_EMBEDDINGS'] === 'true') {
|
|
296
301
|
const hits = await hybridQuery(db, task, { limit: 20 });
|
|
297
302
|
const hitIds = new Set(hits.map(h => h.id));
|
|
303
|
+
if (hitIds.size === 0) {
|
|
304
|
+
return text('No suggestions for this task. Run monograph_build first or try a different query.');
|
|
305
|
+
}
|
|
298
306
|
const rows = db.prepare(`
|
|
299
307
|
SELECT e.relation, e.confidence, n1.name as src, n2.name as tgt, n1.file_path as src_file
|
|
300
308
|
FROM edges e
|
|
@@ -427,7 +435,11 @@ const monographReportTool = {
|
|
|
427
435
|
'## Top 10 Most Connected Entities\n',
|
|
428
436
|
...topNodes.map((n, i) => `${i + 1}. **${n.name}** (${n.label}) — degree ${n.degree} \`${n.file_path ?? ''}\``),
|
|
429
437
|
].join('\n');
|
|
430
|
-
const outPath = input.path ?? join(getProjectCwd(), '.monomind', 'GRAPH_REPORT.md');
|
|
438
|
+
const outPath = resolve(input.path ?? join(getProjectCwd(), '.monomind', 'GRAPH_REPORT.md'));
|
|
439
|
+
const allowedRoot = resolve(getProjectCwd());
|
|
440
|
+
if (outPath !== allowedRoot && !outPath.startsWith(allowedRoot + sep)) {
|
|
441
|
+
return text(`Error: path must be within the project directory (${allowedRoot})`);
|
|
442
|
+
}
|
|
431
443
|
mkdirSync(join(outPath, '..'), { recursive: true });
|
|
432
444
|
writeFileSync(outPath, report);
|
|
433
445
|
return text(`Report written to ${outPath}`);
|
|
@@ -448,7 +460,7 @@ const monographStalenessTool = {
|
|
|
448
460
|
},
|
|
449
461
|
},
|
|
450
462
|
handler: async (input) => {
|
|
451
|
-
const { getMonographStaleness } = await import('
|
|
463
|
+
const { getMonographStaleness } = await import('./monograph-compat.js');
|
|
452
464
|
const repoPath = input.path ?? getProjectCwd();
|
|
453
465
|
const report = await getMonographStaleness(repoPath);
|
|
454
466
|
return text(JSON.stringify(report, null, 2));
|
|
@@ -488,7 +500,12 @@ const monographExportTool = {
|
|
|
488
500
|
const nodes = db.prepare('SELECT * FROM nodes').all();
|
|
489
501
|
const edges = db.prepare('SELECT * FROM edges').all();
|
|
490
502
|
const fmt = input.format;
|
|
491
|
-
const
|
|
503
|
+
const requestedOut = input.outputPath ?? join(getProjectCwd(), '.monomind', 'export');
|
|
504
|
+
const outDir = resolve(requestedOut);
|
|
505
|
+
const allowedRoot = resolve(getProjectCwd());
|
|
506
|
+
if (outDir !== allowedRoot && !outDir.startsWith(allowedRoot + sep)) {
|
|
507
|
+
return text(`Error: outputPath must be within the project directory (${allowedRoot})`);
|
|
508
|
+
}
|
|
492
509
|
mkdirSync(outDir, { recursive: true });
|
|
493
510
|
if (fmt === 'json') {
|
|
494
511
|
const p = join(outDir, 'graph.json');
|
|
@@ -530,7 +547,8 @@ const monographContextTool = {
|
|
|
530
547
|
required: ['name'],
|
|
531
548
|
},
|
|
532
549
|
handler: async (input) => {
|
|
533
|
-
const { openDb, closeDb
|
|
550
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
551
|
+
const { getMonographContext } = await import('./monograph-compat.js');
|
|
534
552
|
const db = openDb(getDbPath());
|
|
535
553
|
try {
|
|
536
554
|
const result = getMonographContext(db, {
|
|
@@ -558,7 +576,8 @@ const monographImpactTool = {
|
|
|
558
576
|
required: ['name'],
|
|
559
577
|
},
|
|
560
578
|
handler: async (input) => {
|
|
561
|
-
const { openDb, closeDb
|
|
579
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
580
|
+
const { getMonographImpact } = await import('./monograph-compat.js');
|
|
562
581
|
const db = openDb(getDbPath());
|
|
563
582
|
try {
|
|
564
583
|
const result = getMonographImpact(db, {
|
|
@@ -585,7 +604,8 @@ const monographDetectChangesTool = {
|
|
|
585
604
|
},
|
|
586
605
|
},
|
|
587
606
|
handler: async (input) => {
|
|
588
|
-
const { openDb, closeDb
|
|
607
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
608
|
+
const { detectMonographChanges } = await import('./monograph-compat.js');
|
|
589
609
|
const db = openDb(getDbPath());
|
|
590
610
|
try {
|
|
591
611
|
const result = detectMonographChanges(db, {
|
|
@@ -614,7 +634,8 @@ const monographRenameTool = {
|
|
|
614
634
|
required: ['oldName', 'newName'],
|
|
615
635
|
},
|
|
616
636
|
handler: async (input) => {
|
|
617
|
-
const { openDb, closeDb
|
|
637
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
638
|
+
const { getMonographRename } = await import('./monograph-compat.js');
|
|
618
639
|
const db = openDb(getDbPath());
|
|
619
640
|
try {
|
|
620
641
|
const result = getMonographRename(db, {
|
|
@@ -643,7 +664,8 @@ const monographRouteMapTool = {
|
|
|
643
664
|
},
|
|
644
665
|
},
|
|
645
666
|
handler: async (input) => {
|
|
646
|
-
const { openDb, closeDb
|
|
667
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
668
|
+
const { getMonographRouteMap } = await import('./monograph-compat.js');
|
|
647
669
|
const db = openDb(getDbPath());
|
|
648
670
|
try {
|
|
649
671
|
const result = getMonographRouteMap(db, {
|
|
@@ -671,7 +693,8 @@ const monographApiImpactTool = {
|
|
|
671
693
|
required: ['routePath'],
|
|
672
694
|
},
|
|
673
695
|
handler: async (input) => {
|
|
674
|
-
const { openDb, closeDb
|
|
696
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
697
|
+
const { getMonographApiImpact } = await import('./monograph-compat.js');
|
|
675
698
|
const db = openDb(getDbPath());
|
|
676
699
|
try {
|
|
677
700
|
const result = getMonographApiImpact(db, {
|
|
@@ -697,7 +720,8 @@ const monographEmbedTool = {
|
|
|
697
720
|
},
|
|
698
721
|
},
|
|
699
722
|
handler: async (input) => {
|
|
700
|
-
const { openDb, closeDb
|
|
723
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
724
|
+
const { runEmbed } = await import('./monograph-compat.js');
|
|
701
725
|
const db = openDb(getDbPath());
|
|
702
726
|
try {
|
|
703
727
|
const result = await runEmbed(db, { codeOnly: input.codeOnly ?? false, force: input.force ?? false });
|
|
@@ -727,7 +751,8 @@ const monographCypherTool = {
|
|
|
727
751
|
required: ['query'],
|
|
728
752
|
},
|
|
729
753
|
handler: async (input) => {
|
|
730
|
-
const { openDb, closeDb
|
|
754
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
755
|
+
const { getMonographCypher } = await import('./monograph-compat.js');
|
|
731
756
|
const db = openDb(getDbPath());
|
|
732
757
|
try {
|
|
733
758
|
const result = getMonographCypher(db, input.query);
|
|
@@ -755,7 +780,7 @@ const monographGroupListTool = {
|
|
|
755
780
|
},
|
|
756
781
|
},
|
|
757
782
|
handler: async (input) => {
|
|
758
|
-
const { getGroupList } = await import('
|
|
783
|
+
const { getGroupList } = await import('./monograph-compat.js');
|
|
759
784
|
const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
|
|
760
785
|
const result = await getGroupList(configPath);
|
|
761
786
|
return text(JSON.stringify(result, null, 2));
|
|
@@ -775,7 +800,7 @@ const monographGroupQueryTool = {
|
|
|
775
800
|
required: ['query'],
|
|
776
801
|
},
|
|
777
802
|
handler: async (input) => {
|
|
778
|
-
const { runGroupQuery } = await import('
|
|
803
|
+
const { runGroupQuery } = await import('./monograph-compat.js');
|
|
779
804
|
const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
|
|
780
805
|
const results = await runGroupQuery(configPath, input.query, input.limit);
|
|
781
806
|
if (results.length === 0)
|
|
@@ -795,7 +820,8 @@ const monographWikiTool = {
|
|
|
795
820
|
},
|
|
796
821
|
},
|
|
797
822
|
handler: async (input) => {
|
|
798
|
-
const { openDb, closeDb
|
|
823
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
824
|
+
const { getWikiToolResult } = await import('./monograph-compat.js');
|
|
799
825
|
const db = openDb(getDbPath());
|
|
800
826
|
try {
|
|
801
827
|
const result = getWikiToolResult(db, { communityId: input.communityId });
|
|
@@ -819,7 +845,8 @@ const monographWikiBuildTool = {
|
|
|
819
845
|
},
|
|
820
846
|
},
|
|
821
847
|
handler: async (input) => {
|
|
822
|
-
const { openDb, closeDb
|
|
848
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
849
|
+
const { runWikiBuildTool } = await import('./monograph-compat.js');
|
|
823
850
|
const db = openDb(getDbPath());
|
|
824
851
|
try {
|
|
825
852
|
const result = await runWikiBuildTool(db, {
|
|
@@ -846,7 +873,8 @@ const monographServeTool = {
|
|
|
846
873
|
},
|
|
847
874
|
},
|
|
848
875
|
handler: async (input) => {
|
|
849
|
-
const { openDb
|
|
876
|
+
const { openDb } = await import('@monoes/monograph');
|
|
877
|
+
const { serveMonograph } = await import('./monograph-compat.js');
|
|
850
878
|
const db = openDb(getDbPath());
|
|
851
879
|
const result = await serveMonograph({
|
|
852
880
|
port: input.port ?? 7374,
|
|
@@ -867,7 +895,8 @@ const monographToolMapTool = {
|
|
|
867
895
|
},
|
|
868
896
|
},
|
|
869
897
|
handler: async (input) => {
|
|
870
|
-
const { openDb, closeDb
|
|
898
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
899
|
+
const { getToolMap } = await import('./monograph-compat.js');
|
|
871
900
|
const db = openDb(getDbPath());
|
|
872
901
|
try {
|
|
873
902
|
const results = getToolMap(db, { tool: input.tool });
|
|
@@ -892,7 +921,8 @@ const monographShapeCheckTool = {
|
|
|
892
921
|
},
|
|
893
922
|
},
|
|
894
923
|
handler: async (input) => {
|
|
895
|
-
const { openDb, closeDb
|
|
924
|
+
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
925
|
+
const { getShapeCheck } = await import('./monograph-compat.js');
|
|
896
926
|
const db = openDb(getDbPath());
|
|
897
927
|
const repoPath = getProjectCwd();
|
|
898
928
|
try {
|
|
@@ -918,7 +948,7 @@ const monographGroupSyncTool = {
|
|
|
918
948
|
},
|
|
919
949
|
},
|
|
920
950
|
handler: async (input) => {
|
|
921
|
-
const { runGroupSync } = await import('
|
|
951
|
+
const { runGroupSync } = await import('./monograph-compat.js');
|
|
922
952
|
const configPath = input.configPath ?? join(getProjectCwd(), 'group.yaml');
|
|
923
953
|
try {
|
|
924
954
|
const result = await runGroupSync(configPath);
|
|
@@ -944,7 +974,7 @@ const monographAugmentTool = {
|
|
|
944
974
|
required: ['query'],
|
|
945
975
|
},
|
|
946
976
|
handler: async (input) => {
|
|
947
|
-
const { augmentContext } = await import('
|
|
977
|
+
const { augmentContext } = await import('./monograph-compat.js');
|
|
948
978
|
const repoPath = getProjectCwd();
|
|
949
979
|
const result = await augmentContext({
|
|
950
980
|
query: input.query,
|
|
@@ -970,7 +1000,7 @@ const monographInjectContextTool = {
|
|
|
970
1000
|
},
|
|
971
1001
|
},
|
|
972
1002
|
handler: async (input) => {
|
|
973
|
-
const { injectAiContext } = await import('
|
|
1003
|
+
const { injectAiContext } = await import('./monograph-compat.js');
|
|
974
1004
|
const repoPath = getProjectCwd();
|
|
975
1005
|
const result = await injectAiContext({
|
|
976
1006
|
repoPath,
|
|
@@ -990,9 +1020,16 @@ const monographSkillGenTool = {
|
|
|
990
1020
|
},
|
|
991
1021
|
},
|
|
992
1022
|
handler: async (input) => {
|
|
993
|
-
const { generateSkillFiles } = await import('
|
|
1023
|
+
const { generateSkillFiles } = await import('./monograph-compat.js');
|
|
994
1024
|
const repoPath = getProjectCwd();
|
|
995
|
-
const
|
|
1025
|
+
const allowedRoot = resolve(repoPath);
|
|
1026
|
+
if (input.outputDir) {
|
|
1027
|
+
const outDir = resolve(input.outputDir);
|
|
1028
|
+
if (outDir !== allowedRoot && !outDir.startsWith(allowedRoot + sep)) {
|
|
1029
|
+
return text(`Error: outputDir must be within the project directory (${allowedRoot})`);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
const result = await generateSkillFiles(repoPath, input.outputDir ? resolve(input.outputDir) : undefined);
|
|
996
1033
|
const dir = result.filesWritten.length > 0
|
|
997
1034
|
? result.filesWritten[0].replace(/\/[^/]+$/, '/')
|
|
998
1035
|
: join(repoPath, '.monomind', 'skills') + '/';
|
|
@@ -1019,8 +1056,13 @@ const monographInstallSkillsTool = {
|
|
|
1019
1056
|
},
|
|
1020
1057
|
handler: async (input) => {
|
|
1021
1058
|
const { openDb, closeDb } = await import('@monoes/monograph');
|
|
1022
|
-
const { installSkillsForPlatform } = await import('
|
|
1023
|
-
const
|
|
1059
|
+
const { installSkillsForPlatform } = await import('./monograph-compat.js');
|
|
1060
|
+
const rawRepoPath = input.repoPath ?? getProjectCwd();
|
|
1061
|
+
const repoPath = resolve(rawRepoPath);
|
|
1062
|
+
const allowedRoot = resolve(getProjectCwd());
|
|
1063
|
+
if (repoPath !== allowedRoot && !repoPath.startsWith(allowedRoot + sep)) {
|
|
1064
|
+
return text(`Error: repoPath must be within the project directory (${allowedRoot})`);
|
|
1065
|
+
}
|
|
1024
1066
|
const platform = input.platform;
|
|
1025
1067
|
const validPlatforms = ['claude', 'cursor', 'vscode', 'zed'];
|
|
1026
1068
|
if (!validPlatforms.includes(platform)) {
|
|
@@ -1107,7 +1149,7 @@ const monographDoctorTool = {
|
|
|
1107
1149
|
properties: {},
|
|
1108
1150
|
},
|
|
1109
1151
|
handler: async (_input) => {
|
|
1110
|
-
const { runDoctor } = await import('
|
|
1152
|
+
const { runDoctor } = await import('./monograph-compat.js');
|
|
1111
1153
|
const repoPath = getProjectCwd();
|
|
1112
1154
|
const result = await runDoctor(repoPath);
|
|
1113
1155
|
const lines = result.checks.map(c => `${c.status === 'ok' ? '✅' : c.status === 'warn' ? '⚠️' : '❌'} ${c.name}: ${c.message}`);
|
|
@@ -1125,7 +1167,7 @@ const monographListReposTool = {
|
|
|
1125
1167
|
properties: {},
|
|
1126
1168
|
},
|
|
1127
1169
|
handler: async (_input) => {
|
|
1128
|
-
const { listRepos } = await import('
|
|
1170
|
+
const { listRepos } = await import('./monograph-compat.js');
|
|
1129
1171
|
const repos = listRepos();
|
|
1130
1172
|
if (repos.length === 0)
|
|
1131
1173
|
return text('No repositories registered. Run monograph build in a repo to register it.');
|
|
@@ -1144,7 +1186,7 @@ const monographGroupContractsTool = {
|
|
|
1144
1186
|
},
|
|
1145
1187
|
},
|
|
1146
1188
|
handler: async (input) => {
|
|
1147
|
-
const { getGroupContracts } = await import('
|
|
1189
|
+
const { getGroupContracts } = await import('./monograph-compat.js');
|
|
1148
1190
|
const { join } = await import('path');
|
|
1149
1191
|
const repoPath = input.repoPath ?? getProjectCwd();
|
|
1150
1192
|
const configPath = join(repoPath, '.monograph', 'groups.json');
|
|
@@ -1166,7 +1208,7 @@ const monographGroupStatusTool = {
|
|
|
1166
1208
|
},
|
|
1167
1209
|
},
|
|
1168
1210
|
handler: async (input) => {
|
|
1169
|
-
const { getGroupStatus } = await import('
|
|
1211
|
+
const { getGroupStatus } = await import('./monograph-compat.js');
|
|
1170
1212
|
const { join } = await import('path');
|
|
1171
1213
|
const repoPath = input.repoPath ?? getProjectCwd();
|
|
1172
1214
|
const configPath = join(repoPath, '.monograph', 'groups.json');
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Pattern storage and search with cosine similarity (real math in all tiers)
|
|
10
10
|
* - Training stores patterns as searchable embeddings (not simulated)
|
|
11
11
|
*
|
|
12
|
-
* Note:
|
|
12
|
+
* Note: The lean build has no neural training. The full loop lives on monoes-full-loop.
|
|
13
13
|
*/
|
|
14
14
|
import { type MCPTool } from './types.js';
|
|
15
15
|
export declare const neuralTools: MCPTool[];
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Pattern storage and search with cosine similarity (real math in all tiers)
|
|
10
10
|
* - Training stores patterns as searchable embeddings (not simulated)
|
|
11
11
|
*
|
|
12
|
-
* Note:
|
|
12
|
+
* Note: The lean build has no neural training. The full loop lives on monoes-full-loop.
|
|
13
13
|
*/
|
|
14
14
|
import { getProjectCwd } from './types.js';
|
|
15
15
|
import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync, statSync } from 'node:fs';
|
|
@@ -23,7 +23,7 @@ try {
|
|
|
23
23
|
// Tier 1: agentic-flow v1 ReasoningBank (fastest — WASM-accelerated)
|
|
24
24
|
const rb = await import('agentic-flow/reasoningbank').catch(() => null);
|
|
25
25
|
if (rb?.computeEmbedding) {
|
|
26
|
-
realEmbeddings = { embed: (text) => rb.computeEmbedding(text) };
|
|
26
|
+
realEmbeddings = { embed: async (text) => Array.from(await rb.computeEmbedding(text)) };
|
|
27
27
|
embeddingServiceName = 'agentic-flow/reasoningbank';
|
|
28
28
|
}
|
|
29
29
|
// Tier 2: @monomind/embeddings
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* MonoVector LLM WASM MCP Tools
|
|
3
3
|
*
|
|
4
|
-
* Exposes @
|
|
4
|
+
* Exposes @monoes/ruvllm-wasm operations via MCP protocol.
|
|
5
5
|
* All tools gracefully degrade when the WASM package is not installed.
|
|
6
6
|
*/
|
|
7
7
|
import type { MCPTool } from './types.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* MonoVector LLM WASM MCP Tools
|
|
3
3
|
*
|
|
4
|
-
* Exposes @
|
|
4
|
+
* Exposes @monoes/ruvllm-wasm operations via MCP protocol.
|
|
5
5
|
* All tools gracefully degrade when the WASM package is not installed.
|
|
6
6
|
*/
|
|
7
7
|
async function loadRuvllmWasm() {
|
|
8
|
-
return import('../
|
|
8
|
+
return import('../monovector/ruvllm-wasm.js');
|
|
9
9
|
}
|
|
10
10
|
// ── Instance Registries ──────────────────────────────────────
|
|
11
11
|
const hnswRouters = new Map();
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminal MCP Tools for CLI
|
|
3
|
-
*
|
|
4
|
-
* Terminal session management with real command execution.
|
|
5
|
-
*/
|
|
6
1
|
import { getProjectCwd } from './types.js';
|
|
7
2
|
import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync } from 'node:fs';
|
|
8
3
|
import { join } from 'node:path';
|
|
@@ -63,7 +58,15 @@ export const terminalTools = [
|
|
|
63
58
|
if (Object.keys(store.sessions).length >= MAX_SESSIONS) {
|
|
64
59
|
return { success: false, error: 'Session limit reached' };
|
|
65
60
|
}
|
|
66
|
-
const FORBIDDEN_ENV_KEYS = new Set([
|
|
61
|
+
const FORBIDDEN_ENV_KEYS = new Set([
|
|
62
|
+
'PATH',
|
|
63
|
+
'LD_PRELOAD',
|
|
64
|
+
'LD_LIBRARY_PATH',
|
|
65
|
+
'NODE_OPTIONS',
|
|
66
|
+
'NODE_PATH',
|
|
67
|
+
'DYLD_INSERT_LIBRARIES',
|
|
68
|
+
'DYLD_LIBRARY_PATH',
|
|
69
|
+
]);
|
|
67
70
|
const rawEnv = input.env || {};
|
|
68
71
|
const safeEnv = {};
|
|
69
72
|
for (const [k, v] of Object.entries(rawEnv)) {
|
|
@@ -115,11 +118,14 @@ export const terminalTools = [
|
|
|
115
118
|
const FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
116
119
|
// Reject inherited keys (incl. toString/hasOwnProperty/etc.) so a tampered
|
|
117
120
|
// store.json can't redirect bracket access into Object.prototype.
|
|
118
|
-
if (sessionId &&
|
|
121
|
+
if (sessionId &&
|
|
122
|
+
(typeof sessionId !== 'string' || FORBIDDEN_KEYS.has(sessionId) || !Object.hasOwn(store.sessions, sessionId))) {
|
|
119
123
|
return { success: false, error: 'Invalid sessionId' };
|
|
120
124
|
}
|
|
121
125
|
// Find or create default session
|
|
122
|
-
let session = sessionId
|
|
126
|
+
let session = sessionId
|
|
127
|
+
? store.sessions[sessionId]
|
|
128
|
+
: Object.values(store.sessions).find((s) => s.status === 'active');
|
|
123
129
|
if (!session) {
|
|
124
130
|
// Create default session
|
|
125
131
|
const id = `term-${Date.now()}-${randomBytes(4).toString('hex')}`;
|
|
@@ -148,9 +154,7 @@ export const terminalTools = [
|
|
|
148
154
|
return { error: 'Command must not start with "-"', allowed: false };
|
|
149
155
|
}
|
|
150
156
|
const rawTimeout = Number(input.timeout);
|
|
151
|
-
const timeout = Number.isFinite(rawTimeout) && rawTimeout > 0
|
|
152
|
-
? Math.min(rawTimeout, 5 * 60_000)
|
|
153
|
-
: 30_000;
|
|
157
|
+
const timeout = Number.isFinite(rawTimeout) && rawTimeout > 0 ? Math.min(rawTimeout, 5 * 60_000) : 30_000;
|
|
154
158
|
const cwd = session.workingDir || getProjectCwd();
|
|
155
159
|
const startTime = Date.now();
|
|
156
160
|
let output;
|
|
@@ -167,8 +171,9 @@ export const terminalTools = [
|
|
|
167
171
|
exitCode = 0;
|
|
168
172
|
}
|
|
169
173
|
catch (err) {
|
|
170
|
-
|
|
171
|
-
|
|
174
|
+
const e = err;
|
|
175
|
+
output = (e.stdout?.toString() || '') + (e.stderr ? `\n[stderr] ${e.stderr.toString()}` : '');
|
|
176
|
+
exitCode = e.status ?? 1;
|
|
172
177
|
}
|
|
173
178
|
const duration = Date.now() - startTime;
|
|
174
179
|
const timestamp = new Date().toISOString();
|
|
@@ -203,18 +208,23 @@ export const terminalTools = [
|
|
|
203
208
|
inputSchema: {
|
|
204
209
|
type: 'object',
|
|
205
210
|
properties: {
|
|
206
|
-
status: {
|
|
211
|
+
status: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
enum: ['all', 'active', 'idle', 'closed'],
|
|
214
|
+
description: 'Filter by status',
|
|
215
|
+
},
|
|
207
216
|
includeHistory: { type: 'boolean', description: 'Include command history' },
|
|
208
217
|
},
|
|
209
218
|
},
|
|
210
219
|
handler: async (input) => {
|
|
211
220
|
const store = loadTerminalStore();
|
|
212
221
|
let sessions = Object.values(store.sessions);
|
|
213
|
-
|
|
214
|
-
|
|
222
|
+
const status = input.status;
|
|
223
|
+
if (status && status !== 'all') {
|
|
224
|
+
sessions = sessions.filter((s) => s.status === status);
|
|
215
225
|
}
|
|
216
226
|
return {
|
|
217
|
-
sessions: sessions.map(s => ({
|
|
227
|
+
sessions: sessions.map((s) => ({
|
|
218
228
|
id: s.id,
|
|
219
229
|
name: s.name,
|
|
220
230
|
status: s.status,
|
|
@@ -225,7 +235,7 @@ export const terminalTools = [
|
|
|
225
235
|
...(input.includeHistory ? { history: s.history.slice(-10) } : {}),
|
|
226
236
|
})),
|
|
227
237
|
total: sessions.length,
|
|
228
|
-
active: sessions.filter(s => s.status === 'active').length,
|
|
238
|
+
active: sessions.filter((s) => s.status === 'active').length,
|
|
229
239
|
};
|
|
230
240
|
},
|
|
231
241
|
},
|
|
@@ -296,7 +306,7 @@ export const terminalTools = [
|
|
|
296
306
|
}
|
|
297
307
|
// Return combined history from all sessions
|
|
298
308
|
const allHistory = Object.values(store.sessions)
|
|
299
|
-
.flatMap(s => s.history.map(h => ({ ...h, sessionId: s.id })))
|
|
309
|
+
.flatMap((s) => s.history.map((h) => ({ ...h, sessionId: s.id })))
|
|
300
310
|
.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime())
|
|
301
311
|
.slice(offset, offset + limit);
|
|
302
312
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM Agent MCP Tools
|
|
3
3
|
*
|
|
4
|
-
* Exposes @
|
|
4
|
+
* Exposes @monoes/rvagent-wasm operations via MCP protocol.
|
|
5
5
|
* All tools gracefully degrade when the WASM package is not installed.
|
|
6
6
|
*/
|
|
7
7
|
import type { MCPTool } from './types.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WASM Agent MCP Tools
|
|
3
3
|
*
|
|
4
|
-
* Exposes @
|
|
4
|
+
* Exposes @monoes/rvagent-wasm operations via MCP protocol.
|
|
5
5
|
* All tools gracefully degrade when the WASM package is not installed.
|
|
6
6
|
*/
|
|
7
7
|
async function loadAgentWasm() {
|
|
8
|
-
const mod = await import('../
|
|
8
|
+
const mod = await import('../monovector/agent-wasm.js');
|
|
9
9
|
return mod;
|
|
10
10
|
}
|
|
11
11
|
export const wasmAgentTools = [
|
|
@@ -619,14 +619,20 @@ async function _doInitializeIntelligence(config) {
|
|
|
619
619
|
: (genEmb ? (await genEmb(p.content))?.embedding ?? [] : []);
|
|
620
620
|
if (embedding.some((v) => !Number.isFinite(v)))
|
|
621
621
|
continue;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
622
|
+
// Only store if not already present, or if we now have an embedding
|
|
623
|
+
// where the existing entry has none — avoids inflating usageCount on
|
|
624
|
+
// every cold-start re-seed.
|
|
625
|
+
const existing = reasoningBank.get(p.id);
|
|
626
|
+
if (!existing || (existing.embedding.length === 0 && embedding.length > 0)) {
|
|
627
|
+
reasoningBank.store({
|
|
628
|
+
id: p.id,
|
|
629
|
+
type: p.type ?? 'general',
|
|
630
|
+
content: p.content,
|
|
631
|
+
confidence: conf,
|
|
632
|
+
embedding,
|
|
633
|
+
usageCount: p.usageCount ?? 0,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
630
636
|
}
|
|
631
637
|
catch { /* skip invalid entries */ }
|
|
632
638
|
}
|
|
@@ -261,6 +261,20 @@ export declare function bridgeRecordFeedback(options: {
|
|
|
261
261
|
agent?: string;
|
|
262
262
|
duration?: number;
|
|
263
263
|
patterns?: string[];
|
|
264
|
+
/**
|
|
265
|
+
* Real task description text. When present it is embedded into the SONA
|
|
266
|
+
* trajectory instead of the opaque `task:${taskId}` ID, so the MiniLM embedder
|
|
267
|
+
* encodes meaningful semantics rather than a meaningless identifier.
|
|
268
|
+
*/
|
|
269
|
+
task?: string;
|
|
270
|
+
description?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the success/quality reflects a real, measured outcome rather than an
|
|
273
|
+
* unverified caller assertion. When false, the SONA LoRA update is skipped so the
|
|
274
|
+
* learning engine is never fed a fabricated label. Defaults to true to preserve
|
|
275
|
+
* existing callers that pass an explicit, intentional success flag.
|
|
276
|
+
*/
|
|
277
|
+
outcomeKnown?: boolean;
|
|
264
278
|
dbPath?: string;
|
|
265
279
|
}): Promise<{
|
|
266
280
|
success: boolean;
|
|
@@ -310,7 +324,7 @@ export declare function bridgeSessionEnd(options: {
|
|
|
310
324
|
} | null>;
|
|
311
325
|
/**
|
|
312
326
|
* Route a task via AgentDB's SemanticRouter.
|
|
313
|
-
* Returns null to fall back to local
|
|
327
|
+
* Returns null to fall back to local monovector router.
|
|
314
328
|
*/
|
|
315
329
|
export declare function bridgeRouteTask(options: {
|
|
316
330
|
task: string;
|
|
@@ -338,6 +352,7 @@ export declare function bridgeHealthCheck(dbPath?: string): Promise<{
|
|
|
338
352
|
hits: number;
|
|
339
353
|
misses: number;
|
|
340
354
|
};
|
|
355
|
+
sonaErrorCount?: number;
|
|
341
356
|
} | null>;
|
|
342
357
|
/**
|
|
343
358
|
* Store to hierarchical memory with tier.
|
|
@@ -401,7 +416,7 @@ export declare function bridgeContextSynthesize(params: {
|
|
|
401
416
|
}): Promise<any>;
|
|
402
417
|
/**
|
|
403
418
|
* Route via SemanticRouter.
|
|
404
|
-
* Available since agentdb 3.0.0-alpha.10 — uses @
|
|
419
|
+
* Available since agentdb 3.0.0-alpha.10 — uses @monoes/router for
|
|
405
420
|
* semantic matching with keyword fallback.
|
|
406
421
|
*/
|
|
407
422
|
export declare function bridgeSemanticRoute(params: {
|