monomind 1.11.11 → 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 (227) 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/architect.md +7 -4
  5. package/.claude/skills/mastermind/autodev.md +4 -2
  6. package/.claude/skills/mastermind/build.md +3 -3
  7. package/.claude/skills/mastermind/content.md +3 -3
  8. package/.claude/skills/mastermind/createorg.md +2 -2
  9. package/.claude/skills/mastermind/finance.md +3 -3
  10. package/.claude/skills/mastermind/idea.md +8 -0
  11. package/.claude/skills/mastermind/marketing.md +3 -3
  12. package/.claude/skills/mastermind/ops.md +3 -3
  13. package/.claude/skills/mastermind/release.md +3 -3
  14. package/.claude/skills/mastermind/research.md +3 -3
  15. package/.claude/skills/mastermind/review.md +3 -3
  16. package/.claude/skills/mastermind/sales.md +3 -3
  17. package/package.json +1 -1
  18. package/packages/@monomind/cli/dist/src/index.js +19 -14
  19. package/packages/@monomind/cli/dist/src/init/statusline-generator.js +3 -3
  20. package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
  21. package/packages/@monomind/cli/dist/src/update/checker.js +24 -7
  22. package/packages/@monomind/cli/dist/src/update/index.d.ts +10 -0
  23. package/packages/@monomind/cli/dist/src/update/index.js +29 -2
  24. package/packages/@monomind/cli/package.json +1 -1
  25. package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
  26. package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -76
  27. package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
  28. package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
  29. package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
  30. package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -69
  31. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -23
  32. package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
  33. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -22
  34. package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -80
  35. package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
  36. package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
  37. package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
  38. package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
  39. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
  40. package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
  41. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
  42. package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -212
  43. package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
  44. package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
  45. package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
  46. package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
  47. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -64
  48. package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -308
  49. package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
  50. package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
  51. package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -60
  52. package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -235
  53. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -45
  54. package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
  55. package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
  56. package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
  57. package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
  58. package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
  59. package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
  60. package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
  61. package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
  62. package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
  63. package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
  64. package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
  65. package/packages/@monomind/cli/dist/src/context/index.js +0 -12
  66. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
  67. package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
  68. package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
  69. package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
  70. package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
  71. package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
  72. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
  73. package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
  74. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -31
  75. package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -81
  76. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
  77. package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -65
  78. package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
  79. package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
  80. package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
  81. package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -107
  82. package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
  83. package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
  84. package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
  85. package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
  86. package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
  87. package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -102
  88. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
  89. package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
  90. package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
  91. package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -71
  92. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
  93. package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
  94. package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
  95. package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -246
  96. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
  97. package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
  98. package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
  99. package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
  100. package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
  101. package/packages/@monomind/cli/dist/src/model/index.js +0 -4
  102. package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
  103. package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
  104. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
  105. package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
  106. package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +0 -34
  107. package/packages/@monomind/cli/dist/src/monovector/capabilities.js +0 -37
  108. package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
  109. package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
  110. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
  111. package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
  112. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
  113. package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -180
  114. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
  115. package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
  116. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
  117. package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
  118. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
  119. package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
  120. package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
  121. package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
  122. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
  123. package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
  124. package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
  125. package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -623
  126. package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
  127. package/packages/@monomind/cli/dist/src/services/index.js +0 -11
  128. package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -201
  129. package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -594
  130. package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
  131. package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
  132. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -31
  133. package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -61
  134. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -19
  135. package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -68
  136. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
  137. package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
  138. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
  139. package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
  140. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
  141. package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
  142. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
  143. package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
  144. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
  145. package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -82
  146. package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
  147. package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
  148. package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
  149. package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -129
  150. package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
  151. package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -116
  152. package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
  153. package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
  154. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
  155. package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
  156. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -165
  157. package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -82
  158. package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
  159. package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
  160. package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
  161. package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -40
  162. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
  163. package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -227
  164. package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
  165. package/packages/@monomind/guidance/dist/adversarial.js +0 -572
  166. package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
  167. package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
  168. package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
  169. package/packages/@monomind/guidance/dist/artifacts.js +0 -356
  170. package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
  171. package/packages/@monomind/guidance/dist/authority.js +0 -558
  172. package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
  173. package/packages/@monomind/guidance/dist/capabilities.js +0 -485
  174. package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
  175. package/packages/@monomind/guidance/dist/coherence.js +0 -372
  176. package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
  177. package/packages/@monomind/guidance/dist/compiler.js +0 -419
  178. package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
  179. package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
  180. package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
  181. package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
  182. package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
  183. package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
  184. package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
  185. package/packages/@monomind/guidance/dist/evolution.js +0 -500
  186. package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
  187. package/packages/@monomind/guidance/dist/gates.js +0 -302
  188. package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
  189. package/packages/@monomind/guidance/dist/gateway.js +0 -452
  190. package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
  191. package/packages/@monomind/guidance/dist/generators.js +0 -682
  192. package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
  193. package/packages/@monomind/guidance/dist/headless.js +0 -342
  194. package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
  195. package/packages/@monomind/guidance/dist/hooks.js +0 -347
  196. package/packages/@monomind/guidance/dist/index.d.ts +0 -205
  197. package/packages/@monomind/guidance/dist/index.js +0 -321
  198. package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
  199. package/packages/@monomind/guidance/dist/ledger.js +0 -375
  200. package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
  201. package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
  202. package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
  203. package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
  204. package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
  205. package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
  206. package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
  207. package/packages/@monomind/guidance/dist/optimizer.js +0 -329
  208. package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
  209. package/packages/@monomind/guidance/dist/persistence.js +0 -464
  210. package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
  211. package/packages/@monomind/guidance/dist/proof.js +0 -238
  212. package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
  213. package/packages/@monomind/guidance/dist/retriever.js +0 -394
  214. package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
  215. package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
  216. package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
  217. package/packages/@monomind/guidance/dist/temporal.js +0 -658
  218. package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
  219. package/packages/@monomind/guidance/dist/trust.js +0 -473
  220. package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
  221. package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
  222. package/packages/@monomind/guidance/dist/types.d.ts +0 -378
  223. package/packages/@monomind/guidance/dist/types.js +0 -10
  224. package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
  225. package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
  226. package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
  227. package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
@@ -1,76 +0,0 @@
1
- /**
2
- * Halt Signal (Task 35)
3
- *
4
- * JSONL-based broadcast/check for swarm-level halt signals.
5
- * When an agent triggers a cascade halt, other agents in the same swarm
6
- * can query whether a halt has been issued.
7
- */
8
- import { randomUUID } from 'crypto';
9
- import { existsSync, mkdirSync, appendFileSync, readFileSync, statSync } from 'fs';
10
- import { join, dirname, resolve, sep } from 'path';
11
- const ALLOWED_ROOT = () => resolve(process.env.MONOMIND_DATA_DIR ?? process.cwd());
12
- const DEFAULT_FILE = () => join(ALLOWED_ROOT(), 'data', 'halt-signals.jsonl');
13
- function safeHaltFilePath(filePath) {
14
- const allowedRoot = ALLOWED_ROOT();
15
- const resolved = resolve(filePath);
16
- if (resolved !== allowedRoot && !resolved.startsWith(allowedRoot + sep)) {
17
- throw new Error(`Halt signal file path escapes allowed directory: ${filePath}`);
18
- }
19
- return resolved;
20
- }
21
- /**
22
- * Broadcast a halt signal for a swarm.
23
- */
24
- export function broadcast(swarmId, sourceAgentId, reason, filePath) {
25
- const target = filePath ? safeHaltFilePath(filePath) : DEFAULT_FILE();
26
- const dir = dirname(target);
27
- if (!existsSync(dir)) {
28
- mkdirSync(dir, { recursive: true });
29
- }
30
- const record = {
31
- id: randomUUID(),
32
- swarmId,
33
- sourceAgentId,
34
- reason,
35
- haltedAt: new Date().toISOString(),
36
- };
37
- appendFileSync(target, JSON.stringify(record) + '\n', 'utf-8');
38
- return record;
39
- }
40
- /**
41
- * Check whether any halt signal exists for the given swarm.
42
- */
43
- export function isHalted(swarmId, filePath) {
44
- const target = filePath ? safeHaltFilePath(filePath) : DEFAULT_FILE();
45
- if (!existsSync(target)) {
46
- return false;
47
- }
48
- // Size cap. isHalted is on the swarm-coordination hot path; without this
49
- // cap a planted multi-GB file (or unbounded broadcast accumulation over
50
- // weeks) reliably OOMs the CLI on the next call. Treat oversized halt
51
- // logs as "no halt" — fail-safe in the swarm-termination flow.
52
- try {
53
- const stat = statSync(target);
54
- if (stat.size > 10 * 1024 * 1024)
55
- return false;
56
- }
57
- catch {
58
- return false;
59
- }
60
- const raw = readFileSync(target, 'utf-8').trim();
61
- if (!raw)
62
- return false;
63
- return raw
64
- .split('\n')
65
- .filter(Boolean)
66
- .some((line) => {
67
- try {
68
- const rec = JSON.parse(line);
69
- return rec.swarmId === swarmId;
70
- }
71
- catch {
72
- return false;
73
- }
74
- });
75
- }
76
- //# sourceMappingURL=halt-signal.js.map
@@ -1,18 +0,0 @@
1
- /**
2
- * Agent utilities — prompt versioning, experiment routing, managed agents.
3
- *
4
- * @module @monoes/cli/agents
5
- */
6
- export { PromptExperimentRouter } from './prompt-experiment.js';
7
- export type { ResolvedPrompt } from './prompt-experiment.js';
8
- export { PromptVersionManager } from './prompt-version-manager.js';
9
- export { spawnAndAwait } from './managed-agent.js';
10
- export type { AgentRunResult, ManagedAgentOptions } from './managed-agent.js';
11
- export { check as checkTermination, persistEvent } from './termination-watcher.js';
12
- export type { AgentRunState } from './termination-watcher.js';
13
- export { broadcast as broadcastHalt, isHalted } from './halt-signal.js';
14
- export type { HaltRecord } from './halt-signal.js';
15
- export { buildRegistry } from './registry-builder.js';
16
- export { RegistryQuery } from './registry-query.js';
17
- export type { RegistryValidationResult, RegistryConflict } from './registry-query.js';
18
- //# sourceMappingURL=index.d.ts.map
@@ -1,13 +0,0 @@
1
- /**
2
- * Agent utilities — prompt versioning, experiment routing, managed agents.
3
- *
4
- * @module @monoes/cli/agents
5
- */
6
- export { PromptExperimentRouter } from './prompt-experiment.js';
7
- export { PromptVersionManager } from './prompt-version-manager.js';
8
- export { spawnAndAwait } from './managed-agent.js';
9
- export { check as checkTermination, persistEvent } from './termination-watcher.js';
10
- export { broadcast as broadcastHalt, isHalted } from './halt-signal.js';
11
- export { buildRegistry } from './registry-builder.js';
12
- export { RegistryQuery } from './registry-query.js';
13
- //# sourceMappingURL=index.js.map
@@ -1,41 +0,0 @@
1
- export interface AgentRunResult {
2
- agentSlug: string;
3
- taskId: string;
4
- output: string;
5
- status: 'success' | 'error' | 'timeout';
6
- durationMs: number;
7
- tokens?: {
8
- inputTokens: number;
9
- outputTokens: number;
10
- };
11
- error?: string;
12
- }
13
- export interface ManagedAgentOptions {
14
- timeoutMs?: number;
15
- pollIntervalMs?: number;
16
- }
17
- /**
18
- * Simulates spawn-and-await by creating a taskId, delegating to a runner function,
19
- * and applying timeout.
20
- */
21
- export declare function spawnAndAwait(agentSlug: string, task: string, runner: (agentSlug: string, taskId: string, task: string) => Promise<string>, options?: ManagedAgentOptions): Promise<AgentRunResult>;
22
- export declare class ManagedAgent {
23
- private readonly agentSlug;
24
- private readonly runner;
25
- private readonly options;
26
- constructor(agentSlug: string, runner: (agentSlug: string, taskId: string, task: string) => Promise<string>, options?: ManagedAgentOptions);
27
- run(task: string): Promise<AgentRunResult>;
28
- /** Generate an MCP-style tool descriptor for this agent */
29
- toToolDescriptor(): {
30
- name: string;
31
- description: string;
32
- inputSchema: Record<string, unknown>;
33
- };
34
- static create(agentSlug: string, runner: (slug: string, id: string, task: string) => Promise<string>, options?: ManagedAgentOptions): ManagedAgent;
35
- }
36
- /** Run multiple agents in parallel */
37
- export declare function runBatch(agents: Array<{
38
- agentSlug: string;
39
- task: string;
40
- }>, runner: (agentSlug: string, taskId: string, task: string) => Promise<string>, options?: ManagedAgentOptions): Promise<AgentRunResult[]>;
41
- //# sourceMappingURL=managed-agent.d.ts.map
@@ -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