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,69 +0,0 @@
1
- import { randomBytes } from 'node:crypto';
2
- /**
3
- * Simulates spawn-and-await by creating a taskId, delegating to a runner function,
4
- * and applying timeout.
5
- */
6
- export async function spawnAndAwait(agentSlug, task, runner, options = {}) {
7
- const { timeoutMs = 120_000 } = options;
8
- const startedAt = Date.now();
9
- const taskId = `managed-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`;
10
- try {
11
- let timeoutHandle;
12
- const output = await Promise.race([
13
- runner(agentSlug, taskId, task),
14
- new Promise((_, reject) => {
15
- timeoutHandle = setTimeout(() => reject(new Error(`Timeout after ${timeoutMs}ms`)), timeoutMs);
16
- }),
17
- ]).finally(() => clearTimeout(timeoutHandle));
18
- return {
19
- agentSlug, taskId, output, status: 'success',
20
- durationMs: Date.now() - startedAt,
21
- };
22
- }
23
- catch (err) {
24
- const isTimeout = String(err).includes('Timeout');
25
- return {
26
- agentSlug, taskId, output: '',
27
- status: isTimeout ? 'timeout' : 'error',
28
- durationMs: Date.now() - startedAt,
29
- error: String(err),
30
- };
31
- }
32
- }
33
- export class ManagedAgent {
34
- agentSlug;
35
- runner;
36
- options;
37
- constructor(agentSlug, runner, options = {}) {
38
- this.agentSlug = agentSlug;
39
- this.runner = runner;
40
- this.options = options;
41
- }
42
- async run(task) {
43
- return spawnAndAwait(this.agentSlug, task, this.runner, this.options);
44
- }
45
- /** Generate an MCP-style tool descriptor for this agent */
46
- toToolDescriptor() {
47
- const toolName = `agent_${this.agentSlug.replace(/-/g, '_')}`;
48
- return {
49
- name: toolName,
50
- description: `Delegate a task to the ${this.agentSlug} specialist agent`,
51
- inputSchema: {
52
- type: 'object',
53
- properties: {
54
- task: { type: 'string', description: 'Task description' },
55
- timeoutMs: { type: 'number', description: 'Timeout in ms (default 120000)' },
56
- },
57
- required: ['task'],
58
- },
59
- };
60
- }
61
- static create(agentSlug, runner, options) {
62
- return new ManagedAgent(agentSlug, runner, options);
63
- }
64
- }
65
- /** Run multiple agents in parallel */
66
- export async function runBatch(agents, runner, options = {}) {
67
- return Promise.all(agents.map(({ agentSlug, task }) => spawnAndAwait(agentSlug, task, runner, options)));
68
- }
69
- //# sourceMappingURL=managed-agent.js.map
@@ -1,23 +0,0 @@
1
- /**
2
- * PromptExperimentRouter - A/B traffic splitting for prompt versions
3
- *
4
- * Checks for an active experiment on the given agent slug and probabilistically
5
- * routes to the candidate or control version. Falls back to the active version
6
- * when no experiment is running.
7
- *
8
- * @module @monomind/cli/agents/prompt-experiment
9
- */
10
- type PromptVersionStore = any;
11
- export interface ResolvedPrompt {
12
- prompt: string;
13
- version: string;
14
- isCandidate: boolean;
15
- agentSlug: string;
16
- }
17
- export declare class PromptExperimentRouter {
18
- private readonly store;
19
- constructor(store: PromptVersionStore);
20
- resolvePromptForSpawn(agentSlug: string): ResolvedPrompt;
21
- }
22
- export {};
23
- //# sourceMappingURL=prompt-experiment.d.ts.map
@@ -1,49 +0,0 @@
1
- /**
2
- * PromptExperimentRouter - A/B traffic splitting for prompt versions
3
- *
4
- * Checks for an active experiment on the given agent slug and probabilistically
5
- * routes to the candidate or control version. Falls back to the active version
6
- * when no experiment is running.
7
- *
8
- * @module @monomind/cli/agents/prompt-experiment
9
- */
10
- export class PromptExperimentRouter {
11
- store;
12
- constructor(store) {
13
- this.store = store;
14
- }
15
- resolvePromptForSpawn(agentSlug) {
16
- const experiment = this.store.getExperiment(agentSlug);
17
- if (experiment) {
18
- const useCandidate = Math.random() < experiment.trafficPct;
19
- const targetVersion = useCandidate ? experiment.candidate : experiment.control;
20
- const versions = this.store.listVersions(agentSlug);
21
- const found = versions.find((v) => v.version === targetVersion);
22
- if (found) {
23
- return {
24
- prompt: found.prompt,
25
- version: found.version,
26
- isCandidate: useCandidate,
27
- agentSlug,
28
- };
29
- }
30
- }
31
- // Fallback to active version
32
- const active = this.store.getActive(agentSlug);
33
- if (active) {
34
- return {
35
- prompt: active.prompt,
36
- version: active.version,
37
- isCandidate: false,
38
- agentSlug,
39
- };
40
- }
41
- return {
42
- prompt: '',
43
- version: '',
44
- isCandidate: false,
45
- agentSlug,
46
- };
47
- }
48
- }
49
- //# sourceMappingURL=prompt-experiment.js.map
@@ -1,22 +0,0 @@
1
- /**
2
- * PromptVersionManager - High-level prompt version lifecycle operations
3
- *
4
- * Provides publish-from-file, promote, rollback, and experiment
5
- * start/stop workflows on top of PromptVersionStore.
6
- *
7
- * @module @monomind/cli/agents/prompt-version-manager
8
- */
9
- type PromptVersionStore = any;
10
- type PromptVersion = any;
11
- type PromptExperiment = any;
12
- export declare class PromptVersionManager {
13
- private readonly store;
14
- constructor(store: PromptVersionStore);
15
- publishFromFile(agentSlug: string, filePath: string, newVersion: string, changelog: string): PromptVersion;
16
- promote(agentSlug: string, version: string): void;
17
- rollback(agentSlug: string, stepsBack?: number): void;
18
- startExperiment(experiment: PromptExperiment): void;
19
- stopExperiment(agentSlug: string, promoteWinner?: boolean): void;
20
- }
21
- export {};
22
- //# sourceMappingURL=prompt-version-manager.d.ts.map
@@ -1,80 +0,0 @@
1
- /**
2
- * PromptVersionManager - High-level prompt version lifecycle operations
3
- *
4
- * Provides publish-from-file, promote, rollback, and experiment
5
- * start/stop workflows on top of PromptVersionStore.
6
- *
7
- * @module @monomind/cli/agents/prompt-version-manager
8
- */
9
- import * as fs from 'node:fs';
10
- import * as path from 'node:path';
11
- export class PromptVersionManager {
12
- store;
13
- constructor(store) {
14
- this.store = store;
15
- }
16
- publishFromFile(agentSlug, filePath, newVersion, changelog) {
17
- // Symlink-aware containment: path.resolve does NOT follow symlinks, so
18
- // a symlink under cwd pointing at /etc/shadow would have passed the
19
- // prefix-check below. Use realpathSync on both sides and reject symlinks
20
- // at the leaf so the resolved file is provably inside the project.
21
- const allowedRoot = fs.realpathSync(process.cwd());
22
- const requested = path.resolve(filePath);
23
- if (!fs.existsSync(requested)) {
24
- throw new Error(`filePath does not exist: ${requested}`);
25
- }
26
- if (fs.lstatSync(requested).isSymbolicLink()) {
27
- throw new Error('filePath must not be a symlink');
28
- }
29
- const resolved = fs.realpathSync(requested);
30
- const rel = path.relative(allowedRoot, resolved);
31
- if (rel.startsWith('..') || path.isAbsolute(rel)) {
32
- throw new Error(`filePath must be inside the project directory: ${allowedRoot}`);
33
- }
34
- const MAX_PROMPT_BYTES = 1 * 1024 * 1024;
35
- const fileSize = fs.statSync(resolved).size;
36
- if (fileSize > MAX_PROMPT_BYTES) {
37
- throw new Error(`filePath exceeds maximum allowed size (${MAX_PROMPT_BYTES} bytes): ${resolved}`);
38
- }
39
- const prompt = fs.readFileSync(resolved, 'utf-8');
40
- const version = {
41
- agentSlug,
42
- version: newVersion,
43
- prompt,
44
- changelog,
45
- activeFrom: new Date(),
46
- traceCount: 0,
47
- publishedBy: 'prompt-version-manager',
48
- createdAt: new Date(),
49
- };
50
- this.store.save(version);
51
- return version;
52
- }
53
- promote(agentSlug, version) {
54
- this.store.setActive(agentSlug, version);
55
- }
56
- rollback(agentSlug, stepsBack = 1) {
57
- const versions = this.store.listVersions(agentSlug);
58
- if (versions.length < stepsBack + 1) {
59
- throw new Error(`Cannot rollback ${stepsBack} step(s): only ${versions.length} version(s) exist for "${agentSlug}"`);
60
- }
61
- // versions are sorted DESC by createdAt, so index 0 = newest
62
- const target = versions[stepsBack];
63
- this.store.setActive(agentSlug, target.version);
64
- }
65
- startExperiment(experiment) {
66
- this.store.saveExperiment(experiment);
67
- }
68
- stopExperiment(agentSlug, promoteWinner) {
69
- const experiment = this.store.getExperiment(agentSlug);
70
- if (!experiment) {
71
- throw new Error(`No active experiment for "${agentSlug}"`);
72
- }
73
- const winnerId = (experiment.winner ?? experiment.control);
74
- this.store.concludeExperiment(agentSlug, winnerId);
75
- if (promoteWinner) {
76
- this.store.setActive(agentSlug, winnerId);
77
- }
78
- }
79
- }
80
- //# sourceMappingURL=prompt-version-manager.js.map
@@ -1,71 +0,0 @@
1
- /**
2
- * Registry Query (Task 30)
3
- *
4
- * Provides query and validation utilities over an AgentRegistry.
5
- * Supports loading from an in-memory object or a JSON file on disk.
6
- */
7
- import type { AgentRegistry, AgentRegistryEntry } from '../../../shared/src/types/agent-registry.js';
8
- /** Validation issue found during registry validation. */
9
- export interface RegistryValidationResult {
10
- slug: string;
11
- field: string;
12
- message: string;
13
- severity: 'error' | 'warning';
14
- }
15
- /** Conflict entry for duplicate slug detection. */
16
- export interface RegistryConflict {
17
- slug: string;
18
- entries: AgentRegistryEntry[];
19
- }
20
- /**
21
- * Query engine for the Central Agent Registry.
22
- */
23
- export declare class RegistryQuery {
24
- private agents;
25
- private constructor();
26
- /**
27
- * Create a RegistryQuery from an in-memory AgentRegistry object.
28
- */
29
- static loadFromJSON(registry: AgentRegistry): RegistryQuery;
30
- /**
31
- * Create a RegistryQuery by reading a registry JSON file from disk.
32
- */
33
- static loadFromFile(path: string): RegistryQuery;
34
- /**
35
- * Find all agents that list the given capability.
36
- */
37
- findByCapability(capability: string): AgentRegistryEntry[];
38
- /**
39
- * Find all agents that handle the given task type.
40
- */
41
- findByTaskType(taskType: string): AgentRegistryEntry[];
42
- /**
43
- * Find an agent by its unique slug. Returns undefined if not found.
44
- */
45
- findBySlug(slug: string): AgentRegistryEntry | undefined;
46
- /**
47
- * Find all agents that list the given tool.
48
- */
49
- findByTool(tool: string): AgentRegistryEntry[];
50
- /**
51
- * Find micro-agents — agents that have at least one trigger pattern.
52
- */
53
- findMicroAgents(): AgentRegistryEntry[];
54
- /**
55
- * Return all agent slugs in the registry.
56
- */
57
- allSlugs(): string[];
58
- /**
59
- * Validate the registry, returning a list of validation issues.
60
- * Checks:
61
- * - version must be valid semver (X.Y.Z pattern)
62
- * - slug must be non-empty
63
- * - name must be non-empty
64
- */
65
- validate(): RegistryValidationResult[];
66
- /**
67
- * Detect duplicate slugs across registry entries.
68
- */
69
- conflicts(): RegistryConflict[];
70
- }
71
- //# sourceMappingURL=registry-query.d.ts.map
@@ -1,125 +0,0 @@
1
- /**
2
- * Registry Query (Task 30)
3
- *
4
- * Provides query and validation utilities over an AgentRegistry.
5
- * Supports loading from an in-memory object or a JSON file on disk.
6
- */
7
- import { readFileSync } from 'fs';
8
- /**
9
- * Query engine for the Central Agent Registry.
10
- */
11
- export class RegistryQuery {
12
- agents;
13
- constructor(agents) {
14
- this.agents = agents;
15
- }
16
- /**
17
- * Create a RegistryQuery from an in-memory AgentRegistry object.
18
- */
19
- static loadFromJSON(registry) {
20
- return new RegistryQuery(registry.agents ?? []);
21
- }
22
- /**
23
- * Create a RegistryQuery by reading a registry JSON file from disk.
24
- */
25
- static loadFromFile(path) {
26
- const raw = readFileSync(path, 'utf-8');
27
- const registry = JSON.parse(raw);
28
- return RegistryQuery.loadFromJSON(registry);
29
- }
30
- /**
31
- * Find all agents that list the given capability.
32
- */
33
- findByCapability(capability) {
34
- return this.agents.filter((a) => a.capabilities.includes(capability));
35
- }
36
- /**
37
- * Find all agents that handle the given task type.
38
- */
39
- findByTaskType(taskType) {
40
- return this.agents.filter((a) => a.taskTypes.includes(taskType));
41
- }
42
- /**
43
- * Find an agent by its unique slug. Returns undefined if not found.
44
- */
45
- findBySlug(slug) {
46
- return this.agents.find((a) => a.slug === slug);
47
- }
48
- /**
49
- * Find all agents that list the given tool.
50
- */
51
- findByTool(tool) {
52
- return this.agents.filter((a) => a.tools.includes(tool));
53
- }
54
- /**
55
- * Find micro-agents — agents that have at least one trigger pattern.
56
- */
57
- findMicroAgents() {
58
- return this.agents.filter((a) => a.triggers.length > 0);
59
- }
60
- /**
61
- * Return all agent slugs in the registry.
62
- */
63
- allSlugs() {
64
- return this.agents.map((a) => a.slug);
65
- }
66
- /**
67
- * Validate the registry, returning a list of validation issues.
68
- * Checks:
69
- * - version must be valid semver (X.Y.Z pattern)
70
- * - slug must be non-empty
71
- * - name must be non-empty
72
- */
73
- validate() {
74
- const results = [];
75
- const semverRe = /^\d+\.\d+\.\d+/;
76
- for (const agent of this.agents) {
77
- if (!agent.slug) {
78
- results.push({ slug: agent.slug ?? '(empty)', field: 'slug', message: 'Slug is empty', severity: 'error' });
79
- }
80
- if (!agent.name) {
81
- results.push({ slug: agent.slug, field: 'name', message: 'Name is empty', severity: 'error' });
82
- }
83
- if (!semverRe.test(agent.version)) {
84
- results.push({
85
- slug: agent.slug,
86
- field: 'version',
87
- message: `Invalid semver: "${agent.version}"`,
88
- severity: 'error',
89
- });
90
- }
91
- if (agent.deprecated && !agent.deprecatedBy) {
92
- results.push({
93
- slug: agent.slug,
94
- field: 'deprecatedBy',
95
- message: 'Agent is deprecated but deprecatedBy is not set',
96
- severity: 'warning',
97
- });
98
- }
99
- }
100
- return results;
101
- }
102
- /**
103
- * Detect duplicate slugs across registry entries.
104
- */
105
- conflicts() {
106
- const map = new Map();
107
- for (const agent of this.agents) {
108
- const existing = map.get(agent.slug);
109
- if (existing) {
110
- existing.push(agent);
111
- }
112
- else {
113
- map.set(agent.slug, [agent]);
114
- }
115
- }
116
- const result = [];
117
- for (const [slug, entries] of map) {
118
- if (entries.length > 1) {
119
- result.push({ slug, entries });
120
- }
121
- }
122
- return result;
123
- }
124
- }
125
- //# sourceMappingURL=registry-query.js.map
@@ -1,19 +0,0 @@
1
- /**
2
- * Score Decay (Task 39)
3
- *
4
- * Time-based decay for agent specialization scores.
5
- * Scores from 90 days ago have 50% weight (half-life model).
6
- */
7
- /** Half-life in days: after this many days, score weight is halved. */
8
- export declare const SCORE_HALF_LIFE_DAYS = 90;
9
- /**
10
- * Calculate the decay factor for a score based on how old it is.
11
- *
12
- * decay(t) = 0.5^(days_since_update / 90)
13
- *
14
- * - Returns 1.0 for scores updated right now
15
- * - Returns ~0.5 for scores updated 90 days ago
16
- * - Returns ~0.25 for scores updated 180 days ago
17
- */
18
- export declare function calculateDecayFactor(lastUpdatedIso: string): number;
19
- //# sourceMappingURL=score-decay.d.ts.map
@@ -1,22 +0,0 @@
1
- /**
2
- * Score Decay (Task 39)
3
- *
4
- * Time-based decay for agent specialization scores.
5
- * Scores from 90 days ago have 50% weight (half-life model).
6
- */
7
- /** Half-life in days: after this many days, score weight is halved. */
8
- export const SCORE_HALF_LIFE_DAYS = 90;
9
- /**
10
- * Calculate the decay factor for a score based on how old it is.
11
- *
12
- * decay(t) = 0.5^(days_since_update / 90)
13
- *
14
- * - Returns 1.0 for scores updated right now
15
- * - Returns ~0.5 for scores updated 90 days ago
16
- * - Returns ~0.25 for scores updated 180 days ago
17
- */
18
- export function calculateDecayFactor(lastUpdatedIso) {
19
- const daysSince = (Date.now() - new Date(lastUpdatedIso).getTime()) / 86_400_000;
20
- return Math.pow(0.5, daysSince / SCORE_HALF_LIFE_DAYS);
21
- }
22
- //# sourceMappingURL=score-decay.js.map
@@ -1,13 +0,0 @@
1
- export declare class SharedInstructionsLoader {
2
- private cache;
3
- private filePath;
4
- constructor(filePath?: string);
5
- load(basePath?: string): string;
6
- getSharedInstructions(basePath?: string): string;
7
- reload(basePath?: string): string;
8
- isLoaded(): boolean;
9
- /** Prepend shared instructions to an agent prompt with separator */
10
- prependToPrompt(agentPrompt: string, basePath?: string): string;
11
- }
12
- export declare const sharedInstructionsLoader: SharedInstructionsLoader;
13
- //# sourceMappingURL=shared-instructions-loader.d.ts.map
@@ -1,40 +0,0 @@
1
- import { readFileSync, existsSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
- const DEFAULT_PATH = '.agents/shared_instructions.md';
4
- export class SharedInstructionsLoader {
5
- cache = null;
6
- filePath;
7
- constructor(filePath) {
8
- this.filePath = filePath ?? DEFAULT_PATH;
9
- }
10
- load(basePath) {
11
- const fullPath = basePath ? resolve(basePath, this.filePath) : this.filePath;
12
- if (!existsSync(fullPath)) {
13
- this.cache = '';
14
- return '';
15
- }
16
- this.cache = readFileSync(fullPath, 'utf-8');
17
- return this.cache;
18
- }
19
- getSharedInstructions(basePath) {
20
- if (this.cache !== null)
21
- return this.cache;
22
- return this.load(basePath);
23
- }
24
- reload(basePath) {
25
- this.cache = null;
26
- return this.load(basePath);
27
- }
28
- isLoaded() {
29
- return this.cache !== null;
30
- }
31
- /** Prepend shared instructions to an agent prompt with separator */
32
- prependToPrompt(agentPrompt, basePath) {
33
- const shared = this.getSharedInstructions(basePath);
34
- if (!shared)
35
- return agentPrompt;
36
- return `${shared}\n\n---\n\n${agentPrompt}`;
37
- }
38
- }
39
- export const sharedInstructionsLoader = new SharedInstructionsLoader();
40
- //# sourceMappingURL=shared-instructions-loader.js.map
@@ -1,54 +0,0 @@
1
- /**
2
- * Agent Specialization Scorer (Task 39)
3
- *
4
- * JSONL-based per-agent-per-task-type scoring with time-decay.
5
- * Enables monomind to prefer historically successful agents for specific task types.
6
- */
7
- import type { SpecializationScore, ScoreUpdate } from '../../../shared/src/types/specialization.js';
8
- /**
9
- * JSONL-based specialization scorer.
10
- *
11
- * Stores one JSON object per line in the configured file path.
12
- * Each line represents a SpecializationScore for a unique agent+taskType pair.
13
- * On update, the entire file is rewritten to maintain a single record per pair.
14
- */
15
- export declare class SpecializationScorer {
16
- private readonly filePath;
17
- constructor(filePath: string);
18
- private readAll;
19
- private writeAll;
20
- /**
21
- * Record an outcome for a given agent+taskType pair.
22
- *
23
- * Updates running averages for latency and quality, recalculates
24
- * successRate, applies time-decay, and persists the result.
25
- */
26
- recordOutcome(update: ScoreUpdate): SpecializationScore;
27
- /**
28
- * Get the score for a specific agent+taskType pair, or null if not found.
29
- * Recalculates decay on read.
30
- */
31
- getScore(agentSlug: string, taskType: string): SpecializationScore | null;
32
- /**
33
- * Get top N candidates for a task type from the given list of slugs,
34
- * sorted by effectiveScore descending.
35
- */
36
- getTopCandidates(taskType: string, slugs: string[], topN?: number): SpecializationScore[];
37
- /**
38
- * Return the best candidate slug for a task type.
39
- * Falls back to the first candidate if no scores exist.
40
- */
41
- topCandidate(taskType: string, candidates: string[]): string;
42
- /**
43
- * Get all scores for a given agent across all task types.
44
- */
45
- getAllScores(agentSlug: string): SpecializationScore[];
46
- /**
47
- * Reset scores for an agent. If taskType is provided, only that
48
- * pair is removed; otherwise all scores for the agent are removed.
49
- *
50
- * @returns The number of records deleted.
51
- */
52
- resetScores(agentSlug: string, taskType?: string): number;
53
- }
54
- //# sourceMappingURL=specialization-scorer.d.ts.map