monomind 1.11.12 → 1.11.13

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.
Files changed (222) hide show
  1. package/.claude/commands/mastermind/idea.md +1 -1
  2. package/.claude/commands/mastermind/master.md +1 -1
  3. package/.claude/skills/mastermind/_protocol.md +4 -4
  4. package/.claude/skills/mastermind/build.md +3 -3
  5. package/.claude/skills/mastermind/content.md +3 -3
  6. package/.claude/skills/mastermind/createorg.md +2 -2
  7. package/.claude/skills/mastermind/finance.md +3 -3
  8. package/.claude/skills/mastermind/marketing.md +3 -3
  9. package/.claude/skills/mastermind/ops.md +3 -3
  10. package/.claude/skills/mastermind/release.md +3 -3
  11. package/.claude/skills/mastermind/research.md +3 -3
  12. package/.claude/skills/mastermind/review.md +3 -3
  13. package/.claude/skills/mastermind/sales.md +3 -3
  14. package/package.json +1 -1
  15. package/packages/@monomind/cli/dist/src/init/statusline-generator.js +3 -3
  16. package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
  17. package/packages/@monomind/cli/dist/src/update/checker.js +24 -7
  18. package/packages/@monomind/cli/dist/src/update/index.js +3 -6
  19. package/packages/@monomind/cli/package.json +1 -1
  20. package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
  21. package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -76
  22. package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
  23. package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
  24. package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
  25. package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -69
  26. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -23
  27. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
  28. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -22
  29. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -80
  30. package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
  31. package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
  32. package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
  33. package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
  34. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
  35. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
  36. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
  37. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -212
  38. package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
  39. package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
  40. package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
  41. package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
  42. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -64
  43. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -308
  44. package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
  45. package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
  46. package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -60
  47. package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -235
  48. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -45
  49. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
  50. package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
  51. package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
  52. package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
  53. package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
  54. package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
  55. package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
  56. package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
  57. package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
  58. package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
  59. package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
  60. package/packages/@monomind/cli/dist/src/context/index.js +0 -12
  61. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
  62. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
  63. package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
  64. package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
  65. package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
  66. package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
  67. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
  68. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
  69. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -31
  70. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -81
  71. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
  72. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -65
  73. package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
  74. package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
  75. package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
  76. package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -107
  77. package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
  78. package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
  79. package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
  80. package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
  81. package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
  82. package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -102
  83. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
  84. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
  85. package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
  86. package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -71
  87. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
  88. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
  89. package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
  90. package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -246
  91. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
  92. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
  93. package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
  94. package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
  95. package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
  96. package/packages/@monomind/cli/dist/src/model/index.js +0 -4
  97. package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
  98. package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
  99. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
  100. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
  101. package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +0 -34
  102. package/packages/@monomind/cli/dist/src/monovector/capabilities.js +0 -37
  103. package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
  104. package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
  105. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
  106. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
  107. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
  108. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -180
  109. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
  110. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
  111. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
  112. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
  113. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
  114. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
  115. package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
  116. package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
  117. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
  118. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
  119. package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
  120. package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -623
  121. package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
  122. package/packages/@monomind/cli/dist/src/services/index.js +0 -11
  123. package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -201
  124. package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -594
  125. package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
  126. package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
  127. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -31
  128. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -61
  129. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -19
  130. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -68
  131. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
  132. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
  133. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
  134. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
  135. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
  136. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
  137. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
  138. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
  139. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
  140. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -82
  141. package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
  142. package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
  143. package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
  144. package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -129
  145. package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
  146. package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -116
  147. package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
  148. package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
  149. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
  150. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
  151. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -165
  152. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -82
  153. package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
  154. package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
  155. package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
  156. package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -40
  157. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
  158. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -227
  159. package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
  160. package/packages/@monomind/guidance/dist/adversarial.js +0 -572
  161. package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
  162. package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
  163. package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
  164. package/packages/@monomind/guidance/dist/artifacts.js +0 -356
  165. package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
  166. package/packages/@monomind/guidance/dist/authority.js +0 -558
  167. package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
  168. package/packages/@monomind/guidance/dist/capabilities.js +0 -485
  169. package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
  170. package/packages/@monomind/guidance/dist/coherence.js +0 -372
  171. package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
  172. package/packages/@monomind/guidance/dist/compiler.js +0 -419
  173. package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
  174. package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
  175. package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
  176. package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
  177. package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
  178. package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
  179. package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
  180. package/packages/@monomind/guidance/dist/evolution.js +0 -500
  181. package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
  182. package/packages/@monomind/guidance/dist/gates.js +0 -302
  183. package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
  184. package/packages/@monomind/guidance/dist/gateway.js +0 -452
  185. package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
  186. package/packages/@monomind/guidance/dist/generators.js +0 -682
  187. package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
  188. package/packages/@monomind/guidance/dist/headless.js +0 -342
  189. package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
  190. package/packages/@monomind/guidance/dist/hooks.js +0 -347
  191. package/packages/@monomind/guidance/dist/index.d.ts +0 -205
  192. package/packages/@monomind/guidance/dist/index.js +0 -321
  193. package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
  194. package/packages/@monomind/guidance/dist/ledger.js +0 -375
  195. package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
  196. package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
  197. package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
  198. package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
  199. package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
  200. package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
  201. package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
  202. package/packages/@monomind/guidance/dist/optimizer.js +0 -329
  203. package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
  204. package/packages/@monomind/guidance/dist/persistence.js +0 -464
  205. package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
  206. package/packages/@monomind/guidance/dist/proof.js +0 -238
  207. package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
  208. package/packages/@monomind/guidance/dist/retriever.js +0 -394
  209. package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
  210. package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
  211. package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
  212. package/packages/@monomind/guidance/dist/temporal.js +0 -658
  213. package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
  214. package/packages/@monomind/guidance/dist/trust.js +0 -473
  215. package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
  216. package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
  217. package/packages/@monomind/guidance/dist/types.d.ts +0 -378
  218. package/packages/@monomind/guidance/dist/types.js +0 -10
  219. package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
  220. package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
  221. package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
  222. package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
@@ -1,61 +0,0 @@
1
- /**
2
- * Tool Registry (Task 31)
3
- *
4
- * Manages semver versioning for MCP tools with deprecation tracking
5
- * and tool-to-agent impact analysis. Uses JSONL file storage.
6
- */
7
- import type { VersionedMCPTool, ToolVersionEntry } from '../../../shared/src/types/tool-version.js';
8
- /**
9
- * Registry for versioned MCP tools.
10
- *
11
- * Stores tool metadata and version history in a JSONL file.
12
- * Supports deprecation marking and agent impact analysis.
13
- */
14
- export declare class ToolRegistry {
15
- private tools;
16
- private history;
17
- private readonly storagePath;
18
- constructor(storagePath?: string);
19
- /**
20
- * Register a new tool or update an existing one.
21
- */
22
- register(tool: VersionedMCPTool): void;
23
- /**
24
- * Mark a tool as deprecated with an optional successor.
25
- */
26
- deprecate(toolName: string, message: string, successor?: string): void;
27
- /**
28
- * Get the current version info for a tool.
29
- * Returns null if the tool is not registered.
30
- */
31
- getVersion(toolName: string): VersionedMCPTool | null;
32
- /**
33
- * List all deprecated tools.
34
- */
35
- listDeprecated(): VersionedMCPTool[];
36
- /**
37
- * Find agents that reference the given tool.
38
- *
39
- * Scans agent markdown files under the provided agents directory
40
- * and returns slugs of agents whose `tools:` frontmatter or body
41
- * mention the tool name.
42
- */
43
- getImpactedAgents(toolName: string, agentsDir?: string): string[];
44
- /**
45
- * Get the full version history for a tool, or all tools if no name given.
46
- */
47
- getHistory(toolName?: string): ToolVersionEntry[];
48
- /**
49
- * Get all registered tools.
50
- */
51
- listAll(): VersionedMCPTool[];
52
- /**
53
- * Load existing entries from the JSONL file on disk.
54
- */
55
- private loadFromDisk;
56
- /**
57
- * Append a version history entry and the current tool state to disk.
58
- */
59
- private appendEntry;
60
- }
61
- //# sourceMappingURL=tool-registry.d.ts.map
@@ -1,246 +0,0 @@
1
- /**
2
- * Tool Registry (Task 31)
3
- *
4
- * Manages semver versioning for MCP tools with deprecation tracking
5
- * and tool-to-agent impact analysis. Uses JSONL file storage.
6
- */
7
- import { appendFileSync, readFileSync, existsSync, mkdirSync, readdirSync, lstatSync, } from 'fs';
8
- import { join, dirname, extname, resolve, sep } from 'path';
9
- /** Default JSONL storage path relative to project root. */
10
- const DEFAULT_STORAGE_PATH = '.monomind/tool-versions.jsonl';
11
- /**
12
- * Registry for versioned MCP tools.
13
- *
14
- * Stores tool metadata and version history in a JSONL file.
15
- * Supports deprecation marking and agent impact analysis.
16
- */
17
- export class ToolRegistry {
18
- tools = new Map();
19
- history = [];
20
- storagePath;
21
- constructor(storagePath = DEFAULT_STORAGE_PATH) {
22
- const resolvedPath = resolve(storagePath);
23
- const allowedRoot = process.env.MONOMIND_DATA_DIR
24
- ? resolve(process.env.MONOMIND_DATA_DIR)
25
- : resolve(process.cwd());
26
- if (resolvedPath !== allowedRoot && !resolvedPath.startsWith(allowedRoot + sep)) {
27
- throw new Error(`Tool registry storagePath escapes allowed root: ${resolvedPath}`);
28
- }
29
- this.storagePath = resolvedPath;
30
- this.loadFromDisk();
31
- }
32
- /**
33
- * Register a new tool or update an existing one.
34
- */
35
- register(tool) {
36
- const existing = this.tools.get(tool.toolName);
37
- const changeType = existing
38
- ? 'updated'
39
- : 'added';
40
- this.tools.set(tool.toolName, { ...tool });
41
- const entry = {
42
- toolName: tool.toolName,
43
- version: tool.version,
44
- changeType,
45
- changedAt: new Date().toISOString(),
46
- description: changeType === 'added'
47
- ? `Registered tool ${tool.toolName} v${tool.version}`
48
- : `Updated tool ${tool.toolName} to v${tool.version}`,
49
- };
50
- this.history.push(entry);
51
- this.appendEntry(entry);
52
- }
53
- /**
54
- * Mark a tool as deprecated with an optional successor.
55
- */
56
- deprecate(toolName, message, successor) {
57
- const tool = this.tools.get(toolName);
58
- if (!tool) {
59
- throw new Error(`Tool "${toolName}" not found in registry`);
60
- }
61
- tool.deprecated = true;
62
- tool.deprecationMessage = message;
63
- tool.deprecatedAt = new Date().toISOString();
64
- if (successor) {
65
- tool.successor = successor;
66
- }
67
- const entry = {
68
- toolName,
69
- version: tool.version,
70
- changeType: 'deprecated',
71
- changedAt: tool.deprecatedAt,
72
- description: message,
73
- };
74
- this.history.push(entry);
75
- this.appendEntry(entry);
76
- }
77
- /**
78
- * Get the current version info for a tool.
79
- * Returns null if the tool is not registered.
80
- */
81
- getVersion(toolName) {
82
- return this.tools.get(toolName) ?? null;
83
- }
84
- /**
85
- * List all deprecated tools.
86
- */
87
- listDeprecated() {
88
- const result = [];
89
- for (const tool of this.tools.values()) {
90
- if (tool.deprecated) {
91
- result.push({ ...tool });
92
- }
93
- }
94
- return result;
95
- }
96
- /**
97
- * Find agents that reference the given tool.
98
- *
99
- * Scans agent markdown files under the provided agents directory
100
- * and returns slugs of agents whose `tools:` frontmatter or body
101
- * mention the tool name.
102
- */
103
- getImpactedAgents(toolName, agentsDir = 'agents') {
104
- // Reject empty or short tool names — `content.includes('')` returns true
105
- // for every file, turning the registry into a directory enumerator.
106
- if (typeof toolName !== 'string' || toolName.length < 2 || !/^[a-zA-Z0-9_.-]+$/.test(toolName)) {
107
- return [];
108
- }
109
- const impacted = [];
110
- const mdFiles = collectMdFiles(agentsDir);
111
- for (const filePath of mdFiles) {
112
- let content;
113
- try {
114
- content = readFileSync(filePath, 'utf-8');
115
- }
116
- catch {
117
- continue;
118
- }
119
- if (content.includes(toolName)) {
120
- // Derive slug from filename (strip .md extension)
121
- const parts = filePath.split('/');
122
- const filename = parts[parts.length - 1];
123
- const slug = filename.replace(/\.md$/, '');
124
- impacted.push(slug);
125
- }
126
- }
127
- return impacted;
128
- }
129
- /**
130
- * Get the full version history for a tool, or all tools if no name given.
131
- */
132
- getHistory(toolName) {
133
- if (!toolName) {
134
- return [...this.history];
135
- }
136
- return this.history.filter((e) => e.toolName === toolName);
137
- }
138
- /**
139
- * Get all registered tools.
140
- */
141
- listAll() {
142
- return Array.from(this.tools.values()).map((t) => ({ ...t }));
143
- }
144
- // ---- Private helpers ----
145
- /**
146
- * Load existing entries from the JSONL file on disk.
147
- */
148
- loadFromDisk() {
149
- if (!existsSync(this.storagePath)) {
150
- return;
151
- }
152
- let raw;
153
- try {
154
- raw = readFileSync(this.storagePath, 'utf-8');
155
- }
156
- catch {
157
- return;
158
- }
159
- const NAME_RE = /^[a-zA-Z0-9_.-]{1,128}$/;
160
- const STR_MAX = 500;
161
- for (const line of raw.split('\n')) {
162
- const trimmed = line.trim();
163
- if (!trimmed)
164
- continue;
165
- try {
166
- const record = JSON.parse(trimmed);
167
- if (!record || typeof record !== 'object')
168
- continue;
169
- // Validate fields before storage. The JSONL file lives on disk; an
170
- // attacker with local write access could otherwise plant attacker-controlled
171
- // strings (e.g. malicious deprecationMessage with markup) that reach
172
- // downstream renderers (DOT visualizer, deprecation-injector warnings).
173
- if (record._type === 'tool') {
174
- if (typeof record.toolName !== 'string' || !NAME_RE.test(record.toolName))
175
- continue;
176
- if (record.successor !== undefined && (typeof record.successor !== 'string' || !NAME_RE.test(record.successor)))
177
- continue;
178
- if (record.deprecationMessage !== undefined && (typeof record.deprecationMessage !== 'string' || record.deprecationMessage.length > STR_MAX))
179
- continue;
180
- this.tools.set(record.toolName, record);
181
- }
182
- else if (record._type === 'history') {
183
- if (typeof record.toolName !== 'string' || !NAME_RE.test(record.toolName))
184
- continue;
185
- this.history.push(record);
186
- }
187
- }
188
- catch {
189
- // Skip malformed lines
190
- }
191
- }
192
- }
193
- /**
194
- * Append a version history entry and the current tool state to disk.
195
- */
196
- appendEntry(entry) {
197
- const dir = dirname(this.storagePath);
198
- if (!existsSync(dir)) {
199
- mkdirSync(dir, { recursive: true });
200
- }
201
- const tool = this.tools.get(entry.toolName);
202
- const lines = [];
203
- if (tool) {
204
- lines.push(JSON.stringify({ _type: 'tool', ...tool }));
205
- }
206
- lines.push(JSON.stringify({ _type: 'history', ...entry }));
207
- appendFileSync(this.storagePath, lines.join('\n') + '\n', 'utf-8');
208
- }
209
- }
210
- /**
211
- * Recursively collect all `.md` files under a directory.
212
- */
213
- function collectMdFiles(root) {
214
- const results = [];
215
- let entries;
216
- try {
217
- entries = readdirSync(root);
218
- }
219
- catch {
220
- return results;
221
- }
222
- for (const entry of entries) {
223
- const full = join(root, entry);
224
- let stat;
225
- try {
226
- // Use lstatSync so symlinks aren't followed — otherwise a symlink under
227
- // `agentsDir` could redirect this scan into arbitrary filesystem
228
- // locations, which combined with `getImpactedAgents` becomes a content
229
- // oracle that fingerprints arbitrary text files outside the project.
230
- stat = lstatSync(full);
231
- }
232
- catch {
233
- continue;
234
- }
235
- if (stat.isSymbolicLink())
236
- continue;
237
- if (stat.isDirectory()) {
238
- results.push(...collectMdFiles(full));
239
- }
240
- else if (stat.isFile() && extname(entry) === '.md') {
241
- results.push(full);
242
- }
243
- }
244
- return results;
245
- }
246
- //# sourceMappingURL=tool-registry.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * WASM Agent MCP Tools
3
- *
4
- * Exposes @monoes/rvagent-wasm operations via MCP protocol.
5
- * All tools gracefully degrade when the WASM package is not installed.
6
- */
7
- import type { MCPTool } from './types.js';
8
- export declare const wasmAgentTools: MCPTool[];
9
- //# sourceMappingURL=wasm-agent-tools.d.ts.map
@@ -1,230 +0,0 @@
1
- /**
2
- * WASM Agent MCP Tools
3
- *
4
- * Exposes @monoes/rvagent-wasm operations via MCP protocol.
5
- * All tools gracefully degrade when the WASM package is not installed.
6
- */
7
- async function loadAgentWasm() {
8
- const mod = await import('../monovector/agent-wasm.js');
9
- return mod;
10
- }
11
- export const wasmAgentTools = [
12
- {
13
- name: 'wasm_agent_create',
14
- description: 'Create a sandboxed WASM agent with virtual filesystem (no OS access). Optionally use a gallery template.',
15
- inputSchema: {
16
- type: 'object',
17
- properties: {
18
- template: { type: 'string', description: 'Gallery template name (coder, researcher, tester, reviewer, security, swarm)' },
19
- model: { type: 'string', description: 'Model identifier (default: anthropic:claude-sonnet-4-20250514)' },
20
- instructions: { type: 'string', description: 'System instructions for the agent' },
21
- maxTurns: { type: 'number', description: 'Max conversation turns (default: 50)' },
22
- },
23
- },
24
- handler: async (args) => {
25
- try {
26
- const wasm = await loadAgentWasm();
27
- if (args.template) {
28
- const info = await wasm.createAgentFromTemplate(args.template);
29
- return { content: [{ type: 'text', text: JSON.stringify({ success: true, agent: info, source: 'gallery' }, null, 2) }] };
30
- }
31
- const info = await wasm.createWasmAgent({
32
- model: args.model,
33
- instructions: args.instructions,
34
- maxTurns: args.maxTurns,
35
- });
36
- return { content: [{ type: 'text', text: JSON.stringify({ success: true, agent: info }, null, 2) }] };
37
- }
38
- catch (err) {
39
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
40
- }
41
- },
42
- },
43
- {
44
- name: 'wasm_agent_prompt',
45
- description: 'Send a prompt to a WASM agent and get a response.',
46
- inputSchema: {
47
- type: 'object',
48
- properties: {
49
- agentId: { type: 'string', description: 'WASM agent ID' },
50
- input: { type: 'string', description: 'User prompt to send' },
51
- },
52
- required: ['agentId', 'input'],
53
- },
54
- handler: async (args) => {
55
- try {
56
- const wasm = await loadAgentWasm();
57
- const result = await wasm.promptWasmAgent(args.agentId, args.input);
58
- return { content: [{ type: 'text', text: result }] };
59
- }
60
- catch (err) {
61
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
62
- }
63
- },
64
- },
65
- {
66
- name: 'wasm_agent_tool',
67
- description: 'Execute a tool on a WASM agent sandbox. Tools: read_file, write_file, edit_file, write_todos, list_files. Use flat format: {tool, path, content, ...}.',
68
- inputSchema: {
69
- type: 'object',
70
- properties: {
71
- agentId: { type: 'string', description: 'WASM agent ID' },
72
- toolName: { type: 'string', description: 'Tool name (read_file, write_file, edit_file, write_todos, list_files)' },
73
- toolInput: { type: 'object', description: 'Tool parameters (flat: {path, content, old_string, new_string, todos})' },
74
- },
75
- required: ['agentId', 'toolName'],
76
- },
77
- handler: async (args) => {
78
- try {
79
- const wasm = await loadAgentWasm();
80
- // Flat format: {tool: 'write_file', path: '...', content: '...'}
81
- const toolCall = {
82
- tool: args.toolName,
83
- ...(args.toolInput ?? {}),
84
- };
85
- const result = await wasm.executeWasmTool(args.agentId, toolCall);
86
- return { content: [{ type: 'text', text: JSON.stringify(result) }] };
87
- }
88
- catch (err) {
89
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
90
- }
91
- },
92
- },
93
- {
94
- name: 'wasm_agent_list',
95
- description: 'List all active WASM agents.',
96
- inputSchema: { type: 'object', properties: {} },
97
- handler: async () => {
98
- try {
99
- const wasm = await loadAgentWasm();
100
- const agents = wasm.listWasmAgents();
101
- return { content: [{ type: 'text', text: JSON.stringify({ agents, count: agents.length }, null, 2) }] };
102
- }
103
- catch (err) {
104
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
105
- }
106
- },
107
- },
108
- {
109
- name: 'wasm_agent_terminate',
110
- description: 'Terminate a WASM agent and free resources.',
111
- inputSchema: {
112
- type: 'object',
113
- properties: {
114
- agentId: { type: 'string', description: 'WASM agent ID' },
115
- },
116
- required: ['agentId'],
117
- },
118
- handler: async (args) => {
119
- try {
120
- const wasm = await loadAgentWasm();
121
- const ok = wasm.terminateWasmAgent(args.agentId);
122
- return { content: [{ type: 'text', text: JSON.stringify({ success: ok }) }] };
123
- }
124
- catch (err) {
125
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
126
- }
127
- },
128
- },
129
- {
130
- name: 'wasm_agent_files',
131
- description: 'Get a WASM agent\'s available tools and info.',
132
- inputSchema: {
133
- type: 'object',
134
- properties: {
135
- agentId: { type: 'string', description: 'WASM agent ID' },
136
- },
137
- required: ['agentId'],
138
- },
139
- handler: async (args) => {
140
- try {
141
- const wasm = await loadAgentWasm();
142
- const tools = wasm.getWasmAgentTools(args.agentId);
143
- const info = wasm.getWasmAgent(args.agentId);
144
- return { content: [{ type: 'text', text: JSON.stringify({ tools, fileCount: info?.fileCount ?? 0, turnCount: info?.turnCount ?? 0 }, null, 2) }] };
145
- }
146
- catch (err) {
147
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
148
- }
149
- },
150
- },
151
- {
152
- name: 'wasm_agent_export',
153
- description: 'Export a WASM agent\'s full state (config, filesystem, conversation) as JSON.',
154
- inputSchema: {
155
- type: 'object',
156
- properties: {
157
- agentId: { type: 'string', description: 'WASM agent ID' },
158
- },
159
- required: ['agentId'],
160
- },
161
- handler: async (args) => {
162
- try {
163
- const wasm = await loadAgentWasm();
164
- const state = wasm.exportWasmState(args.agentId);
165
- return { content: [{ type: 'text', text: state }] };
166
- }
167
- catch (err) {
168
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
169
- }
170
- },
171
- },
172
- {
173
- name: 'wasm_gallery_list',
174
- description: 'List all available WASM agent gallery templates (Coder, Researcher, Tester, Reviewer, Security, Swarm).',
175
- inputSchema: { type: 'object', properties: {} },
176
- handler: async () => {
177
- try {
178
- const wasm = await loadAgentWasm();
179
- const templates = await wasm.listGalleryTemplates();
180
- return { content: [{ type: 'text', text: JSON.stringify({ templates, count: templates.length }, null, 2) }] };
181
- }
182
- catch (err) {
183
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
184
- }
185
- },
186
- },
187
- {
188
- name: 'wasm_gallery_search',
189
- description: 'Search WASM agent gallery templates by query.',
190
- inputSchema: {
191
- type: 'object',
192
- properties: {
193
- query: { type: 'string', description: 'Search query' },
194
- },
195
- required: ['query'],
196
- },
197
- handler: async (args) => {
198
- try {
199
- const wasm = await loadAgentWasm();
200
- const results = await wasm.searchGalleryTemplates(args.query);
201
- return { content: [{ type: 'text', text: JSON.stringify({ results, count: results.length }, null, 2) }] };
202
- }
203
- catch (err) {
204
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
205
- }
206
- },
207
- },
208
- {
209
- name: 'wasm_gallery_create',
210
- description: 'Create a WASM agent from a gallery template.',
211
- inputSchema: {
212
- type: 'object',
213
- properties: {
214
- template: { type: 'string', description: 'Template name (coder, researcher, tester, reviewer, security, swarm)' },
215
- },
216
- required: ['template'],
217
- },
218
- handler: async (args) => {
219
- try {
220
- const wasm = await loadAgentWasm();
221
- const info = await wasm.createAgentFromTemplate(args.template);
222
- return { content: [{ type: 'text', text: JSON.stringify({ success: true, agent: info, template: args.template }, null, 2) }] };
223
- }
224
- catch (err) {
225
- return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
226
- }
227
- },
228
- },
229
- ];
230
- //# sourceMappingURL=wasm-agent-tools.js.map
@@ -1,21 +0,0 @@
1
- /**
2
- * Heuristic complexity scorer for task descriptions.
3
- *
4
- * Returns a score in [0, 100] that drives automatic model-tier selection.
5
- * Higher scores indicate tasks that benefit from more capable (and costly)
6
- * models.
7
- */
8
- /**
9
- * Agent slugs that inherently deal with high-complexity work.
10
- * When one of these agents is involved the score gets a +20 bonus.
11
- */
12
- export declare const HIGH_COMPLEXITY_AGENTS: ReadonlySet<string>;
13
- /**
14
- * Score the complexity of a task description.
15
- *
16
- * @param taskDescription - Free-text description of the task.
17
- * @param agentSlug - Optional agent identifier; certain agents boost the score.
18
- * @returns A number in [0, 100].
19
- */
20
- export declare function scoreComplexity(taskDescription: string, agentSlug?: string): number;
21
- //# sourceMappingURL=complexity-scorer.d.ts.map
@@ -1,106 +0,0 @@
1
- /**
2
- * Heuristic complexity scorer for task descriptions.
3
- *
4
- * Returns a score in [0, 100] that drives automatic model-tier selection.
5
- * Higher scores indicate tasks that benefit from more capable (and costly)
6
- * models.
7
- */
8
- // ---------------------------------------------------------------------------
9
- // Keyword sets
10
- // ---------------------------------------------------------------------------
11
- const HIGH_COMPLEXITY_KEYWORDS = [
12
- 'architecture',
13
- 'distributed',
14
- 'security audit',
15
- 'cve',
16
- 'consensus',
17
- 'fault-tolerant',
18
- 'migrate',
19
- 'refactor across',
20
- 'orchestrat',
21
- 'design system',
22
- 'database schema',
23
- 'performance optim',
24
- 'threat model',
25
- 'encryption',
26
- 'zero-knowledge',
27
- ];
28
- const LOW_COMPLEXITY_KEYWORDS = [
29
- 'format',
30
- 'list',
31
- 'rename',
32
- 'sort',
33
- 'typo',
34
- 'lint',
35
- 'log',
36
- 'comment',
37
- 'print',
38
- 'echo',
39
- 'delete unused',
40
- 'remove import',
41
- ];
42
- /**
43
- * Agent slugs that inherently deal with high-complexity work.
44
- * When one of these agents is involved the score gets a +20 bonus.
45
- */
46
- export const HIGH_COMPLEXITY_AGENTS = new Set([
47
- 'engineering-software-architect',
48
- 'security-architect',
49
- 'security-auditor',
50
- 'system-architect',
51
- 'performance-engineer',
52
- 'byzantine-coordinator',
53
- 'collective-intelligence-coordinator',
54
- ]);
55
- // ---------------------------------------------------------------------------
56
- // Patterns
57
- // ---------------------------------------------------------------------------
58
- const STEP_INDICATOR_RE = /(?:step\s*\d|first[\s,].*then[\s,]|phase\s*\d)/i;
59
- const CODE_BLOCK_RE = /```[\s\S]*?```/;
60
- const FILE_REF_RE = /\b[\w./-]+\.\w{1,5}\b/;
61
- // ---------------------------------------------------------------------------
62
- // Scorer
63
- // ---------------------------------------------------------------------------
64
- /**
65
- * Score the complexity of a task description.
66
- *
67
- * @param taskDescription - Free-text description of the task.
68
- * @param agentSlug - Optional agent identifier; certain agents boost the score.
69
- * @returns A number in [0, 100].
70
- */
71
- export function scoreComplexity(taskDescription, agentSlug) {
72
- let score = 50;
73
- const lower = taskDescription.toLowerCase();
74
- const wordCount = taskDescription.trim().split(/\s+/).length;
75
- // -- Word-count adjustments ------------------------------------------------
76
- if (wordCount < 20) {
77
- score -= 20;
78
- }
79
- if (wordCount > 100) {
80
- score += 20;
81
- }
82
- if (wordCount > 200) {
83
- score += 10;
84
- }
85
- // -- Keyword adjustments (first match only) --------------------------------
86
- if (HIGH_COMPLEXITY_KEYWORDS.some((kw) => lower.includes(kw))) {
87
- score += 10;
88
- }
89
- if (LOW_COMPLEXITY_KEYWORDS.some((kw) => lower.includes(kw))) {
90
- score -= 10;
91
- }
92
- // -- Structural indicators -------------------------------------------------
93
- if (STEP_INDICATOR_RE.test(taskDescription)) {
94
- score += 10;
95
- }
96
- if (CODE_BLOCK_RE.test(taskDescription) || FILE_REF_RE.test(taskDescription)) {
97
- score += 5;
98
- }
99
- // -- Agent bonus -----------------------------------------------------------
100
- if (agentSlug && HIGH_COMPLEXITY_AGENTS.has(agentSlug)) {
101
- score += 20;
102
- }
103
- // -- Clamp -----------------------------------------------------------------
104
- return Math.max(0, Math.min(100, score));
105
- }
106
- //# sourceMappingURL=complexity-scorer.js.map
@@ -1,4 +0,0 @@
1
- export { type ModelTier, type ModelSettings, type ModelPreference, TIER_DEFAULTS, MODEL_IDS, } from './model-settings.js';
2
- export { scoreComplexity, HIGH_COMPLEXITY_AGENTS, } from './complexity-scorer.js';
3
- export { type ResolvedModelSettings, resolveModelTier, } from './model-tier-resolver.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- export { TIER_DEFAULTS, MODEL_IDS, } from './model-settings.js';
2
- export { scoreComplexity, HIGH_COMPLEXITY_AGENTS, } from './complexity-scorer.js';
3
- export { resolveModelTier, } from './model-tier-resolver.js';
4
- //# sourceMappingURL=index.js.map