monomind 1.11.13 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/generated/channel-intelligence-director.md +87 -0
- package/.claude/agents/generated/chief-growth-officer.md +88 -0
- package/.claude/agents/generated/content-seo-strategist.md +90 -0
- package/.claude/agents/generated/developer-community-strategist.md +91 -0
- package/.claude/agents/generated/outreach-partnership-strategist.md +90 -0
- package/.claude/agents/generated/social-media-strategist.md +91 -0
- package/.claude/agents/generated/video-visual-strategist.md +90 -0
- package/.claude/commands/mastermind/idea.md +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +13 -4
- package/.claude/helpers/control-start.cjs +5 -0
- package/.claude/helpers/event-logger.cjs +114 -0
- package/.claude/helpers/handlers/adr-draft-handler.cjs +19 -5
- package/.claude/helpers/handlers/agent-start-handler.cjs +13 -4
- package/.claude/helpers/handlers/compact-handler.cjs +2 -0
- package/.claude/helpers/handlers/edit-handler.cjs +1 -1
- package/.claude/helpers/handlers/gates-handler.cjs +3 -0
- package/.claude/helpers/handlers/graph-status-handler.cjs +14 -8
- package/.claude/helpers/handlers/loops-status-handler.cjs +5 -2
- package/.claude/helpers/handlers/route-handler.cjs +13 -6
- package/.claude/helpers/handlers/session-handler.cjs +11 -4
- package/.claude/helpers/handlers/session-restore-handler.cjs +21 -11
- package/.claude/helpers/handlers/task-handler.cjs +13 -5
- package/.claude/helpers/intelligence.cjs +7 -2
- package/.claude/helpers/loop-tracker.cjs +15 -3
- package/.claude/helpers/memory.cjs +6 -1
- package/.claude/helpers/router.cjs +5 -2
- package/.claude/helpers/session.cjs +2 -0
- package/.claude/helpers/statusline.cjs +10 -2
- package/.claude/helpers/utils/micro-agents.cjs +20 -4
- package/.claude/scheduled_tasks.lock +1 -1
- package/.claude/settings.json +92 -1
- package/.claude/skills/mastermind/_protocol.md +23 -13
- package/.claude/skills/mastermind/architect.md +6 -9
- package/.claude/skills/mastermind/build.md +3 -3
- package/.claude/skills/mastermind/content.md +3 -3
- package/.claude/skills/mastermind/createorg.md +2 -2
- package/.claude/skills/mastermind/finance.md +3 -3
- package/.claude/skills/mastermind/idea.md +5 -3
- package/.claude/skills/mastermind/marketing.md +3 -3
- package/.claude/skills/mastermind/monitor.md +2 -2
- package/.claude/skills/mastermind/release.md +3 -3
- package/.claude/skills/mastermind/research.md +3 -3
- package/.claude/skills/mastermind/review.md +3 -3
- package/.claude/skills/mastermind/runorg.md +153 -86
- package/.claude/skills/mastermind/sales.md +3 -3
- package/README.md +286 -129
- package/package.json +19 -2
- package/packages/@monomind/cli/README.md +286 -129
- package/packages/@monomind/cli/bundled-graph/dist/src/build.js +73 -0
- package/packages/@monomind/cli/bundled-graph/dist/src/cluster.js +120 -0
- package/packages/@monomind/cli/bundled-graph/package.json +57 -0
- package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +25 -0
- package/packages/@monomind/cli/dist/src/agents/halt-signal.js +76 -0
- package/packages/@monomind/cli/dist/src/agents/index.d.ts +18 -0
- package/packages/@monomind/cli/dist/src/agents/index.js +13 -0
- package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +41 -0
- package/packages/@monomind/cli/dist/src/agents/managed-agent.js +69 -0
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +23 -0
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +49 -0
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +22 -0
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +80 -0
- package/packages/@monomind/cli/dist/src/agents/registry-builder.js +2 -0
- package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +71 -0
- package/packages/@monomind/cli/dist/src/agents/registry-query.js +125 -0
- package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +19 -0
- package/packages/@monomind/cli/dist/src/agents/score-decay.js +22 -0
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +13 -0
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +40 -0
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +54 -0
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +212 -0
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +30 -0
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +84 -0
- package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +20 -0
- package/packages/@monomind/cli/dist/src/agents/trigger-index.js +38 -0
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +64 -0
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +308 -0
- package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +18 -0
- package/packages/@monomind/cli/dist/src/agents/version-diff.js +64 -0
- package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +60 -0
- package/packages/@monomind/cli/dist/src/agents/version-store.js +235 -0
- package/packages/@monomind/cli/dist/src/autopilot-state.js +10 -5
- package/packages/@monomind/cli/dist/src/benchmarks/benchmark-runner.js +13 -0
- package/packages/@monomind/cli/dist/src/benchmarks/metric-evaluators.js +20 -9
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +45 -0
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +404 -0
- package/packages/@monomind/cli/dist/src/browser/actions.js +10 -3
- package/packages/@monomind/cli/dist/src/browser/browser.js +12 -2
- package/packages/@monomind/cli/dist/src/browser/cdp.js +21 -3
- package/packages/@monomind/cli/dist/src/browser/har.js +27 -5
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +14 -0
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +333 -0
- package/packages/@monomind/cli/dist/src/commands/agent.js +11 -8
- package/packages/@monomind/cli/dist/src/commands/analyze.js +36 -21
- package/packages/@monomind/cli/dist/src/commands/autopilot.js +12 -4
- package/packages/@monomind/cli/dist/src/commands/benchmark.js +51 -8
- package/packages/@monomind/cli/dist/src/commands/browse.js +5 -2
- package/packages/@monomind/cli/dist/src/commands/claims.js +29 -11
- package/packages/@monomind/cli/dist/src/commands/cleanup.js +25 -5
- package/packages/@monomind/cli/dist/src/commands/config.js +15 -7
- package/packages/@monomind/cli/dist/src/commands/daemon.js +6 -0
- package/packages/@monomind/cli/dist/src/commands/deployment.js +34 -19
- package/packages/@monomind/cli/dist/src/commands/doctor.js +151 -20
- package/packages/@monomind/cli/dist/src/commands/guidance.js +15 -2
- package/packages/@monomind/cli/dist/src/commands/hive-mind.js +37 -14
- package/packages/@monomind/cli/dist/src/commands/hooks.js +42 -25
- package/packages/@monomind/cli/dist/src/commands/init.js +9 -4
- package/packages/@monomind/cli/dist/src/commands/issues.js +29 -26
- package/packages/@monomind/cli/dist/src/commands/mcp.js +11 -5
- package/packages/@monomind/cli/dist/src/commands/memory.js +10 -0
- package/packages/@monomind/cli/dist/src/commands/migrate.js +5 -5
- package/packages/@monomind/cli/dist/src/commands/monograph.js +18 -5
- package/packages/@monomind/cli/dist/src/commands/monovector/backup.js +8 -2
- package/packages/@monomind/cli/dist/src/commands/monovector/benchmark.js +20 -7
- package/packages/@monomind/cli/dist/src/commands/monovector/import.js +15 -0
- package/packages/@monomind/cli/dist/src/commands/monovector/migrate.js +4 -1
- package/packages/@monomind/cli/dist/src/commands/monovector/optimize.js +11 -0
- package/packages/@monomind/cli/dist/src/commands/monovector/setup.js +11 -1
- package/packages/@monomind/cli/dist/src/commands/neural.js +1 -1
- package/packages/@monomind/cli/dist/src/commands/performance.js +20 -7
- package/packages/@monomind/cli/dist/src/commands/platforms.js +90 -8
- package/packages/@monomind/cli/dist/src/commands/plugins.js +12 -5
- package/packages/@monomind/cli/dist/src/commands/process.js +33 -10
- package/packages/@monomind/cli/dist/src/commands/progress.js +5 -3
- package/packages/@monomind/cli/dist/src/commands/providers.js +5 -5
- package/packages/@monomind/cli/dist/src/commands/replay.js +8 -2
- package/packages/@monomind/cli/dist/src/commands/route.js +27 -7
- package/packages/@monomind/cli/dist/src/commands/security.js +4 -0
- package/packages/@monomind/cli/dist/src/commands/session.js +12 -1
- package/packages/@monomind/cli/dist/src/commands/start.js +11 -4
- package/packages/@monomind/cli/dist/src/commands/status.js +7 -4
- package/packages/@monomind/cli/dist/src/commands/swarm.js +27 -13
- package/packages/@monomind/cli/dist/src/commands/task.js +26 -11
- package/packages/@monomind/cli/dist/src/commands/tokens.js +7 -2
- package/packages/@monomind/cli/dist/src/commands/transfer-store.js +36 -22
- package/packages/@monomind/cli/dist/src/commands/ui.js +68 -0
- package/packages/@monomind/cli/dist/src/commands/update.js +15 -3
- package/packages/@monomind/cli/dist/src/commands/workflow.js +39 -6
- package/packages/@monomind/cli/dist/src/consensus/audit-writer.js +18 -7
- package/packages/@monomind/cli/dist/src/consensus/index.d.ts +7 -0
- package/packages/@monomind/cli/dist/src/consensus/index.js +6 -0
- package/packages/@monomind/cli/dist/src/consensus/vote-signer.js +25 -8
- package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +44 -0
- package/packages/@monomind/cli/dist/src/context/context-provider.js +25 -0
- package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/context/git-state-provider.js +34 -0
- package/packages/@monomind/cli/dist/src/context/index.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/context/index.js +12 -0
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +15 -0
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +19 -0
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +26 -0
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +93 -0
- package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +24 -0
- package/packages/@monomind/cli/dist/src/context/task-history-provider.js +32 -0
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +14 -0
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +27 -0
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +31 -0
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +81 -0
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +24 -0
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +65 -0
- package/packages/@monomind/cli/dist/src/dlq/index.d.ts +10 -0
- package/packages/@monomind/cli/dist/src/dlq/index.js +7 -0
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +33 -0
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +107 -0
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +23 -0
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +59 -0
- package/packages/@monomind/cli/dist/src/eval/index.d.ts +10 -0
- package/packages/@monomind/cli/dist/src/eval/index.js +7 -0
- package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +40 -0
- package/packages/@monomind/cli/dist/src/eval/trace-collector.js +102 -0
- package/packages/@monomind/cli/dist/src/index.js +7 -3
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +264 -0
- package/packages/@monomind/cli/dist/src/init/executor.js +14 -11
- package/packages/@monomind/cli/dist/src/init/shared-instructions-generator.js +20 -4
- package/packages/@monomind/cli/dist/src/init/statusline-generator.js +33 -12
- package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +22 -0
- package/packages/@monomind/cli/dist/src/interactive/interrupt.js +71 -0
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +25 -0
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +48 -0
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +61 -0
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +246 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/a2a-tools.js +98 -13
- package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +16 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/analyze-tools.js +80 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/browser-tools.js +84 -22
- package/packages/@monomind/cli/dist/src/mcp-tools/claims-tools.js +35 -7
- package/packages/@monomind/cli/dist/src/mcp-tools/config-tools.js +82 -17
- package/packages/@monomind/cli/dist/src/mcp-tools/coordination-tools.js +37 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/daa-tools.js +49 -7
- package/packages/@monomind/cli/dist/src/mcp-tools/embeddings-tools.js +45 -18
- package/packages/@monomind/cli/dist/src/mcp-tools/github-tools.js +75 -25
- package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +32 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +91 -20
- package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +188 -29
- package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +25 -7
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-compat.js +11 -2
- package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +148 -26
- package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +44 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +45 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/progress-tools.js +7 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/request-tracker.js +15 -1
- package/packages/@monomind/cli/dist/src/mcp-tools/security-tools.js +61 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/session-tools.js +45 -14
- package/packages/@monomind/cli/dist/src/mcp-tools/swarm-tools.js +15 -3
- package/packages/@monomind/cli/dist/src/mcp-tools/system-tools.js +14 -7
- package/packages/@monomind/cli/dist/src/mcp-tools/task-tools.js +52 -10
- package/packages/@monomind/cli/dist/src/mcp-tools/terminal-tools.js +40 -6
- package/packages/@monomind/cli/dist/src/mcp-tools/transfer-tools.js +37 -4
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +9 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +230 -0
- package/packages/@monomind/cli/dist/src/mcp-tools/workflow-tools.js +29 -6
- package/packages/@monomind/cli/dist/src/memory/ewc-consolidation.js +26 -10
- package/packages/@monomind/cli/dist/src/memory/intelligence.js +80 -19
- package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +21 -2
- package/packages/@monomind/cli/dist/src/memory/memory-initializer.js +67 -3
- package/packages/@monomind/cli/dist/src/memory/sona-optimizer.js +14 -4
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +21 -0
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +106 -0
- package/packages/@monomind/cli/dist/src/model/index.d.ts +4 -0
- package/packages/@monomind/cli/dist/src/model/index.js +4 -0
- package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +22 -0
- package/packages/@monomind/cli/dist/src/model/model-settings.js +33 -0
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +24 -0
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +65 -0
- package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +34 -0
- package/packages/@monomind/cli/dist/src/monovector/capabilities.js +37 -0
- package/packages/@monomind/cli/dist/src/monovector/command-outcomes.js +43 -7
- package/packages/@monomind/cli/dist/src/monovector/coverage-router.js +8 -4
- package/packages/@monomind/cli/dist/src/monovector/coverage-tools.js +6 -3
- package/packages/@monomind/cli/dist/src/monovector/diff-classifier.js +13 -0
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.d.ts +2 -1
- package/packages/@monomind/cli/dist/src/monovector/route-outcomes.js +46 -4
- package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +7 -0
- package/packages/@monomind/cli/dist/src/orchestration/index.js +6 -0
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +31 -0
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +68 -0
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +180 -0
- package/packages/@monomind/cli/dist/src/plugins/manager.js +8 -3
- package/packages/@monomind/cli/dist/src/plugins/store/discovery.js +46 -2
- package/packages/@monomind/cli/dist/src/plugins/store/search.js +5 -4
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +126 -0
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +188 -0
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +206 -0
- package/packages/@monomind/cli/dist/src/production/circuit-breaker.js +17 -3
- package/packages/@monomind/cli/dist/src/production/error-handler.js +3 -0
- package/packages/@monomind/cli/dist/src/production/monitoring.js +20 -3
- package/packages/@monomind/cli/dist/src/production/rate-limiter.js +13 -4
- package/packages/@monomind/cli/dist/src/production/retry.js +17 -9
- package/packages/@monomind/cli/dist/src/routing/embed-worker.js +6 -2
- package/packages/@monomind/cli/dist/src/routing/embedder.js +0 -0
- package/packages/@monomind/cli/dist/src/routing/llm-caller.js +13 -2
- package/packages/@monomind/cli/dist/src/routing/route-layer-factory.js +18 -3
- package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +60 -0
- package/packages/@monomind/cli/dist/src/runtime/headless.js +284 -0
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +95 -0
- package/packages/@monomind/cli/dist/src/services/claim-service.d.ts +1 -0
- package/packages/@monomind/cli/dist/src/services/claim-service.js +8 -0
- package/packages/@monomind/cli/dist/src/services/config-file-manager.js +14 -2
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +197 -0
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +623 -0
- package/packages/@monomind/cli/dist/src/services/headless-worker-executor.js +18 -2
- package/packages/@monomind/cli/dist/src/services/index.d.ts +13 -0
- package/packages/@monomind/cli/dist/src/services/index.js +11 -0
- package/packages/@monomind/cli/dist/src/services/worker-daemon.js +53 -12
- package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +201 -0
- package/packages/@monomind/cli/dist/src/services/worker-queue.js +594 -0
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +25 -0
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +77 -0
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +31 -0
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +61 -0
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +19 -0
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +68 -0
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.d.ts +0 -3
- package/packages/@monomind/cli/dist/src/transfer/anonymization/index.js +16 -1
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +13 -0
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +205 -0
- package/packages/@monomind/cli/dist/src/transfer/export.js +8 -0
- package/packages/@monomind/cli/dist/src/transfer/ipfs/upload.js +33 -3
- package/packages/@monomind/cli/dist/src/transfer/serialization/cfp.js +9 -3
- package/packages/@monomind/cli/dist/src/transfer/storage/gcs.js +37 -3
- package/packages/@monomind/cli/dist/src/transfer/store/discovery.js +45 -3
- package/packages/@monomind/cli/dist/src/transfer/store/download.js +5 -0
- package/packages/@monomind/cli/dist/src/transfer/store/publish.js +13 -1
- package/packages/@monomind/cli/dist/src/transfer/store/registry.d.ts +8 -0
- package/packages/@monomind/cli/dist/src/transfer/store/registry.js +30 -5
- package/packages/@monomind/cli/dist/src/transfer/store/search.js +20 -5
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +190 -0
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +6 -0
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +105 -0
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +7 -0
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +214 -0
- package/packages/@monomind/cli/dist/src/update/checker.js +59 -7
- package/packages/@monomind/cli/dist/src/update/executor.js +50 -3
- package/packages/@monomind/cli/dist/src/update/index.js +18 -1
- package/packages/@monomind/cli/dist/src/update/rate-limiter.d.ts +6 -0
- package/packages/@monomind/cli/dist/src/update/rate-limiter.js +79 -7
- package/packages/@monomind/cli/dist/src/update/validator.js +52 -1
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +10 -0
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +82 -0
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +23 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +17 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +129 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +9 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +116 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +41 -0
- package/packages/@monomind/cli/dist/src/workflow/dag-types.js +8 -0
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +12 -0
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +20 -0
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +165 -0
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +82 -0
- package/packages/@monomind/cli/dist/src/workflow/index.d.ts +13 -0
- package/packages/@monomind/cli/dist/src/workflow/index.js +11 -0
- package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +11 -0
- package/packages/@monomind/cli/dist/src/workflow/template-engine.js +40 -0
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +29 -0
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +227 -0
- package/packages/@monomind/cli/package.json +9 -10
- package/packages/@monomind/guidance/dist/adversarial.d.ts +284 -0
- package/packages/@monomind/guidance/dist/adversarial.js +572 -0
- package/packages/@monomind/guidance/dist/analyzer.d.ts +530 -0
- package/packages/@monomind/guidance/dist/analyzer.js +2518 -0
- package/packages/@monomind/guidance/dist/artifacts.d.ts +283 -0
- package/packages/@monomind/guidance/dist/artifacts.js +356 -0
- package/packages/@monomind/guidance/dist/authority.d.ts +290 -0
- package/packages/@monomind/guidance/dist/authority.js +558 -0
- package/packages/@monomind/guidance/dist/capabilities.d.ts +209 -0
- package/packages/@monomind/guidance/dist/capabilities.js +485 -0
- package/packages/@monomind/guidance/dist/coherence.d.ts +233 -0
- package/packages/@monomind/guidance/dist/coherence.js +372 -0
- package/packages/@monomind/guidance/dist/compiler.d.ts +87 -0
- package/packages/@monomind/guidance/dist/compiler.js +419 -0
- package/packages/@monomind/guidance/dist/conformance-kit.d.ts +225 -0
- package/packages/@monomind/guidance/dist/conformance-kit.js +629 -0
- package/packages/@monomind/guidance/dist/continue-gate.d.ts +214 -0
- package/packages/@monomind/guidance/dist/continue-gate.js +353 -0
- package/packages/@monomind/guidance/dist/crypto-utils.d.ts +17 -0
- package/packages/@monomind/guidance/dist/crypto-utils.js +24 -0
- package/packages/@monomind/guidance/dist/evolution.d.ts +282 -0
- package/packages/@monomind/guidance/dist/evolution.js +500 -0
- package/packages/@monomind/guidance/dist/gates.d.ts +79 -0
- package/packages/@monomind/guidance/dist/gates.js +302 -0
- package/packages/@monomind/guidance/dist/gateway.d.ts +206 -0
- package/packages/@monomind/guidance/dist/gateway.js +452 -0
- package/packages/@monomind/guidance/dist/generators.d.ts +153 -0
- package/packages/@monomind/guidance/dist/generators.js +682 -0
- package/packages/@monomind/guidance/dist/headless.d.ts +177 -0
- package/packages/@monomind/guidance/dist/headless.js +342 -0
- package/packages/@monomind/guidance/dist/hooks.d.ts +109 -0
- package/packages/@monomind/guidance/dist/hooks.js +347 -0
- package/packages/@monomind/guidance/dist/index.d.ts +205 -0
- package/packages/@monomind/guidance/dist/index.js +321 -0
- package/packages/@monomind/guidance/dist/ledger.d.ts +162 -0
- package/packages/@monomind/guidance/dist/ledger.js +375 -0
- package/packages/@monomind/guidance/dist/manifest-validator.d.ts +289 -0
- package/packages/@monomind/guidance/dist/manifest-validator.js +838 -0
- package/packages/@monomind/guidance/dist/memory-gate.d.ts +222 -0
- package/packages/@monomind/guidance/dist/memory-gate.js +382 -0
- package/packages/@monomind/guidance/dist/meta-governance.d.ts +265 -0
- package/packages/@monomind/guidance/dist/meta-governance.js +348 -0
- package/packages/@monomind/guidance/dist/optimizer.d.ts +104 -0
- package/packages/@monomind/guidance/dist/optimizer.js +329 -0
- package/packages/@monomind/guidance/dist/persistence.d.ts +189 -0
- package/packages/@monomind/guidance/dist/persistence.js +464 -0
- package/packages/@monomind/guidance/dist/proof.d.ts +185 -0
- package/packages/@monomind/guidance/dist/proof.js +238 -0
- package/packages/@monomind/guidance/dist/retriever.d.ts +116 -0
- package/packages/@monomind/guidance/dist/retriever.js +394 -0
- package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +370 -0
- package/packages/@monomind/guidance/dist/ruvbot-integration.js +738 -0
- package/packages/@monomind/guidance/dist/temporal.d.ts +426 -0
- package/packages/@monomind/guidance/dist/temporal.js +658 -0
- package/packages/@monomind/guidance/dist/trust.d.ts +283 -0
- package/packages/@monomind/guidance/dist/trust.js +473 -0
- package/packages/@monomind/guidance/dist/truth-anchors.d.ts +276 -0
- package/packages/@monomind/guidance/dist/truth-anchors.js +488 -0
- package/packages/@monomind/guidance/dist/types.d.ts +378 -0
- package/packages/@monomind/guidance/dist/types.js +10 -0
- package/packages/@monomind/guidance/dist/uncertainty.d.ts +372 -0
- package/packages/@monomind/guidance/dist/uncertainty.js +619 -0
- package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +48 -0
- package/packages/@monomind/guidance/dist/wasm-kernel.js +158 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WASM Agent CLI Subcommands
|
|
3
|
+
*
|
|
4
|
+
* Exposes @monoes/rvagent-wasm operations via the `agent` CLI command.
|
|
5
|
+
* Wraps functions from monovector/agent-wasm.ts for CLI usage.
|
|
6
|
+
*/
|
|
7
|
+
import { output } from '../output.js';
|
|
8
|
+
const WASM_NOT_AVAILABLE_MSG = '@monoes/rvagent-wasm is not installed.\n' +
|
|
9
|
+
'Install it with: npm install @monoes/rvagent-wasm';
|
|
10
|
+
async function loadWasm() {
|
|
11
|
+
const mod = await import('../monovector/agent-wasm.js');
|
|
12
|
+
return mod;
|
|
13
|
+
}
|
|
14
|
+
// agent wasm-status
|
|
15
|
+
export const wasmStatusCommand = {
|
|
16
|
+
name: 'wasm-status',
|
|
17
|
+
description: 'Check rvagent-wasm availability, version, and capabilities',
|
|
18
|
+
options: [],
|
|
19
|
+
examples: [
|
|
20
|
+
{ command: 'monomind agent wasm-status', description: 'Check WASM agent runtime status' },
|
|
21
|
+
],
|
|
22
|
+
action: async (ctx) => {
|
|
23
|
+
try {
|
|
24
|
+
const wasm = await loadWasm();
|
|
25
|
+
const available = await wasm.isAgentWasmAvailable();
|
|
26
|
+
if (!available) {
|
|
27
|
+
output.writeln();
|
|
28
|
+
output.printWarning(WASM_NOT_AVAILABLE_MSG);
|
|
29
|
+
if (ctx.flags.format === 'json') {
|
|
30
|
+
output.printJson({ available: false });
|
|
31
|
+
}
|
|
32
|
+
return { success: true, data: { available: false } };
|
|
33
|
+
}
|
|
34
|
+
// Init to get full status
|
|
35
|
+
await wasm.initAgentWasm();
|
|
36
|
+
const agents = wasm.listWasmAgents();
|
|
37
|
+
let galleryCount = 0;
|
|
38
|
+
let categories = {};
|
|
39
|
+
try {
|
|
40
|
+
galleryCount = await wasm.getGalleryCount();
|
|
41
|
+
categories = await wasm.getGalleryCategories();
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Gallery may not be available in all builds
|
|
45
|
+
}
|
|
46
|
+
const statusData = {
|
|
47
|
+
available: true,
|
|
48
|
+
activeAgents: agents.length,
|
|
49
|
+
gallery: {
|
|
50
|
+
templates: galleryCount,
|
|
51
|
+
categories,
|
|
52
|
+
},
|
|
53
|
+
tools: ['read_file', 'write_file', 'edit_file', 'write_todos', 'list_files'],
|
|
54
|
+
features: ['sandboxed-execution', 'virtual-filesystem', 'gallery-templates', 'rvf-containers', 'mcp-bridge'],
|
|
55
|
+
};
|
|
56
|
+
if (ctx.flags.format === 'json') {
|
|
57
|
+
output.printJson(statusData);
|
|
58
|
+
return { success: true, data: statusData };
|
|
59
|
+
}
|
|
60
|
+
output.writeln();
|
|
61
|
+
output.writeln(output.bold('WASM Agent Runtime'));
|
|
62
|
+
output.writeln();
|
|
63
|
+
output.printTable({
|
|
64
|
+
columns: [
|
|
65
|
+
{ key: 'property', header: 'Property', width: 20 },
|
|
66
|
+
{ key: 'value', header: 'Value', width: 40 },
|
|
67
|
+
],
|
|
68
|
+
data: [
|
|
69
|
+
{ property: 'Available', value: output.success('yes') },
|
|
70
|
+
{ property: 'Active Agents', value: String(agents.length) },
|
|
71
|
+
{ property: 'Gallery Templates', value: String(galleryCount) },
|
|
72
|
+
{ property: 'Sandbox Tools', value: statusData.tools.join(', ') },
|
|
73
|
+
{ property: 'Features', value: statusData.features.join(', ') },
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
if (Object.keys(categories).length > 0) {
|
|
77
|
+
output.writeln();
|
|
78
|
+
output.writeln(output.bold('Gallery Categories'));
|
|
79
|
+
output.printTable({
|
|
80
|
+
columns: [
|
|
81
|
+
{ key: 'category', header: 'Category', width: 20 },
|
|
82
|
+
{ key: 'count', header: 'Templates', width: 10, align: 'right' },
|
|
83
|
+
],
|
|
84
|
+
data: Object.entries(categories).map(([category, count]) => ({ category, count })),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return { success: true, data: statusData };
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
output.printError(`WASM status check failed: ${String(error)}`);
|
|
91
|
+
return { success: false, exitCode: 1 };
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
// agent wasm-create
|
|
96
|
+
export const wasmCreateCommand = {
|
|
97
|
+
name: 'wasm-create',
|
|
98
|
+
description: 'Create a WASM-sandboxed agent',
|
|
99
|
+
options: [
|
|
100
|
+
{
|
|
101
|
+
name: 'template',
|
|
102
|
+
short: 't',
|
|
103
|
+
description: 'Gallery template (coder, researcher, tester, reviewer, security, swarm)',
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'model',
|
|
108
|
+
short: 'm',
|
|
109
|
+
description: 'Model identifier (default: anthropic:claude-sonnet-4-20250514)',
|
|
110
|
+
type: 'string',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'instructions',
|
|
114
|
+
short: 'i',
|
|
115
|
+
description: 'System instructions for the agent',
|
|
116
|
+
type: 'string',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'max-turns',
|
|
120
|
+
description: 'Maximum conversation turns (default: 50)',
|
|
121
|
+
type: 'number',
|
|
122
|
+
default: 50,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
examples: [
|
|
126
|
+
{ command: 'monomind agent wasm-create', description: 'Create a default WASM agent' },
|
|
127
|
+
{ command: 'monomind agent wasm-create -t coder', description: 'Create from gallery template' },
|
|
128
|
+
{ command: 'monomind agent wasm-create -m "anthropic:claude-sonnet-4-20250514" -i "You are a security auditor"', description: 'Create with custom config' },
|
|
129
|
+
],
|
|
130
|
+
action: async (ctx) => {
|
|
131
|
+
try {
|
|
132
|
+
const wasm = await loadWasm();
|
|
133
|
+
const available = await wasm.isAgentWasmAvailable();
|
|
134
|
+
if (!available) {
|
|
135
|
+
output.printError(WASM_NOT_AVAILABLE_MSG);
|
|
136
|
+
return { success: false, exitCode: 1 };
|
|
137
|
+
}
|
|
138
|
+
const template = ctx.flags.template;
|
|
139
|
+
let info;
|
|
140
|
+
if (template) {
|
|
141
|
+
output.printInfo(`Creating WASM agent from template: ${output.highlight(template)}`);
|
|
142
|
+
info = await wasm.createAgentFromTemplate(template);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
output.printInfo('Creating WASM agent...');
|
|
146
|
+
info = await wasm.createWasmAgent({
|
|
147
|
+
model: ctx.flags.model,
|
|
148
|
+
instructions: ctx.flags.instructions,
|
|
149
|
+
maxTurns: ctx.flags['max-turns'],
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (ctx.flags.format === 'json') {
|
|
153
|
+
output.printJson({ success: true, agent: info, source: template ? 'gallery' : 'custom' });
|
|
154
|
+
return { success: true, data: info };
|
|
155
|
+
}
|
|
156
|
+
output.writeln();
|
|
157
|
+
output.printTable({
|
|
158
|
+
columns: [
|
|
159
|
+
{ key: 'property', header: 'Property', width: 15 },
|
|
160
|
+
{ key: 'value', header: 'Value', width: 45 },
|
|
161
|
+
],
|
|
162
|
+
data: [
|
|
163
|
+
{ property: 'ID', value: info.id },
|
|
164
|
+
{ property: 'State', value: info.state },
|
|
165
|
+
{ property: 'Model', value: info.model },
|
|
166
|
+
{ property: 'Turn Count', value: String(info.turnCount) },
|
|
167
|
+
{ property: 'File Count', value: String(info.fileCount) },
|
|
168
|
+
{ property: 'Created', value: info.createdAt },
|
|
169
|
+
...(template ? [{ property: 'Template', value: template }] : []),
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
output.writeln();
|
|
173
|
+
output.printSuccess(`WASM agent created: ${info.id}`);
|
|
174
|
+
return { success: true, data: info };
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
output.printError(`Failed to create WASM agent: ${String(error)}`);
|
|
178
|
+
return { success: false, exitCode: 1 };
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
// agent wasm-prompt
|
|
183
|
+
export const wasmPromptCommand = {
|
|
184
|
+
name: 'wasm-prompt',
|
|
185
|
+
description: 'Send a prompt to a WASM agent',
|
|
186
|
+
options: [
|
|
187
|
+
{
|
|
188
|
+
name: 'agent-id',
|
|
189
|
+
short: 'a',
|
|
190
|
+
description: 'WASM agent ID (required)',
|
|
191
|
+
type: 'string',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'input',
|
|
195
|
+
short: 'i',
|
|
196
|
+
description: 'Prompt text to send',
|
|
197
|
+
type: 'string',
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
examples: [
|
|
201
|
+
{ command: 'monomind agent wasm-prompt -a wasm-agent-1-abc -i "Write a hello world"', description: 'Send prompt to WASM agent' },
|
|
202
|
+
],
|
|
203
|
+
action: async (ctx) => {
|
|
204
|
+
const agentId = ctx.flags['agent-id'] || ctx.args[0];
|
|
205
|
+
const promptInput = ctx.flags.input || ctx.args[1];
|
|
206
|
+
if (!agentId) {
|
|
207
|
+
output.printError('Agent ID is required. Use --agent-id or -a');
|
|
208
|
+
return { success: false, exitCode: 1 };
|
|
209
|
+
}
|
|
210
|
+
if (!promptInput) {
|
|
211
|
+
output.printError('Prompt input is required. Use --input or -i');
|
|
212
|
+
return { success: false, exitCode: 1 };
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
const wasm = await loadWasm();
|
|
216
|
+
const available = await wasm.isAgentWasmAvailable();
|
|
217
|
+
if (!available) {
|
|
218
|
+
output.printError(WASM_NOT_AVAILABLE_MSG);
|
|
219
|
+
return { success: false, exitCode: 1 };
|
|
220
|
+
}
|
|
221
|
+
output.printInfo(`Sending prompt to ${output.highlight(agentId)}...`);
|
|
222
|
+
const result = await wasm.promptWasmAgent(agentId, promptInput);
|
|
223
|
+
if (ctx.flags.format === 'json') {
|
|
224
|
+
output.printJson({ agentId, response: result });
|
|
225
|
+
return { success: true, data: { agentId, response: result } };
|
|
226
|
+
}
|
|
227
|
+
output.writeln();
|
|
228
|
+
output.writeln(output.bold('Response'));
|
|
229
|
+
output.writeln();
|
|
230
|
+
output.writeln(result);
|
|
231
|
+
// Show updated agent info
|
|
232
|
+
const info = wasm.getWasmAgent(agentId);
|
|
233
|
+
if (info) {
|
|
234
|
+
output.writeln();
|
|
235
|
+
output.writeln(output.dim(`[turns: ${info.turnCount}, files: ${info.fileCount}, state: ${info.state}]`));
|
|
236
|
+
}
|
|
237
|
+
return { success: true, data: { agentId, response: result } };
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
output.printError(`Prompt failed: ${String(error)}`);
|
|
241
|
+
return { success: false, exitCode: 1 };
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
// agent wasm-gallery
|
|
246
|
+
export const wasmGalleryCommand = {
|
|
247
|
+
name: 'wasm-gallery',
|
|
248
|
+
description: 'List available WASM agent gallery templates',
|
|
249
|
+
options: [
|
|
250
|
+
{
|
|
251
|
+
name: 'search',
|
|
252
|
+
short: 's',
|
|
253
|
+
description: 'Search templates by query',
|
|
254
|
+
type: 'string',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'category',
|
|
258
|
+
short: 'c',
|
|
259
|
+
description: 'Filter by category',
|
|
260
|
+
type: 'string',
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
examples: [
|
|
264
|
+
{ command: 'monomind agent wasm-gallery', description: 'List all gallery templates' },
|
|
265
|
+
{ command: 'monomind agent wasm-gallery -s coder', description: 'Search gallery templates' },
|
|
266
|
+
],
|
|
267
|
+
action: async (ctx) => {
|
|
268
|
+
try {
|
|
269
|
+
const wasm = await loadWasm();
|
|
270
|
+
const available = await wasm.isAgentWasmAvailable();
|
|
271
|
+
if (!available) {
|
|
272
|
+
output.printError(WASM_NOT_AVAILABLE_MSG);
|
|
273
|
+
return { success: false, exitCode: 1 };
|
|
274
|
+
}
|
|
275
|
+
const searchQuery = ctx.flags.search;
|
|
276
|
+
const category = ctx.flags.category;
|
|
277
|
+
let templates;
|
|
278
|
+
if (searchQuery) {
|
|
279
|
+
output.printInfo(`Searching gallery for: ${output.highlight(searchQuery)}`);
|
|
280
|
+
templates = await wasm.searchGalleryTemplates(searchQuery);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
templates = await wasm.listGalleryTemplates();
|
|
284
|
+
}
|
|
285
|
+
// Filter by category if specified
|
|
286
|
+
if (category) {
|
|
287
|
+
templates = templates.filter((t) => t.category.toLowerCase() === category.toLowerCase());
|
|
288
|
+
}
|
|
289
|
+
if (ctx.flags.format === 'json') {
|
|
290
|
+
output.printJson({ templates, count: templates.length });
|
|
291
|
+
return { success: true, data: { templates, count: templates.length } };
|
|
292
|
+
}
|
|
293
|
+
output.writeln();
|
|
294
|
+
output.writeln(output.bold('WASM Agent Gallery'));
|
|
295
|
+
output.writeln();
|
|
296
|
+
if (templates.length === 0) {
|
|
297
|
+
output.printInfo('No templates found matching criteria');
|
|
298
|
+
return { success: true, data: { templates: [], count: 0 } };
|
|
299
|
+
}
|
|
300
|
+
output.printTable({
|
|
301
|
+
columns: [
|
|
302
|
+
{ key: 'id', header: 'ID', width: 20 },
|
|
303
|
+
{ key: 'name', header: 'Name', width: 18 },
|
|
304
|
+
{ key: 'category', header: 'Category', width: 12 },
|
|
305
|
+
{ key: 'description', header: 'Description', width: 35 },
|
|
306
|
+
{ key: 'version', header: 'Version', width: 10 },
|
|
307
|
+
],
|
|
308
|
+
data: templates.map((t) => ({
|
|
309
|
+
id: t.id,
|
|
310
|
+
name: t.name,
|
|
311
|
+
category: t.category,
|
|
312
|
+
description: t.description.length > 35 ? t.description.slice(0, 32) + '...' : t.description,
|
|
313
|
+
version: t.version,
|
|
314
|
+
})),
|
|
315
|
+
});
|
|
316
|
+
output.writeln();
|
|
317
|
+
output.printInfo(`${templates.length} template(s) found. Create with: agent wasm-create -t <id>`);
|
|
318
|
+
return { success: true, data: { templates, count: templates.length } };
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
output.printError(`Gallery listing failed: ${String(error)}`);
|
|
322
|
+
return { success: false, exitCode: 1 };
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
/** All WASM subcommands for the agent command */
|
|
327
|
+
export const wasmSubcommands = [
|
|
328
|
+
wasmStatusCommand,
|
|
329
|
+
wasmCreateCommand,
|
|
330
|
+
wasmPromptCommand,
|
|
331
|
+
wasmGalleryCommand,
|
|
332
|
+
];
|
|
333
|
+
//# sourceMappingURL=agent-wasm.js.map
|
|
@@ -19,7 +19,7 @@ function updateSwarmActivityMetrics(agentCountDelta) {
|
|
|
19
19
|
timestamp: new Date().toISOString(),
|
|
20
20
|
swarm: { active: false, agent_count: 0, coordination_active: false },
|
|
21
21
|
};
|
|
22
|
-
if (fs.existsSync(activityPath)) {
|
|
22
|
+
if (fs.existsSync(activityPath) && fs.statSync(activityPath).size <= 10 * 1024 * 1024) {
|
|
23
23
|
data = JSON.parse(fs.readFileSync(activityPath, 'utf-8'));
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
@@ -113,8 +113,8 @@ const spawnCommand = {
|
|
|
113
113
|
{ command: 'monomind agent spawn -t researcher --task "Research React 19"', description: 'Spawn researcher with task' }
|
|
114
114
|
],
|
|
115
115
|
action: async (ctx) => {
|
|
116
|
-
let agentType = ctx.flags.type;
|
|
117
|
-
let agentName = ctx.flags.name;
|
|
116
|
+
let agentType = ctx.flags.type?.slice(0, 64) ?? '';
|
|
117
|
+
let agentName = ctx.flags.name?.slice(0, 128) ?? '';
|
|
118
118
|
// Interactive mode if type not specified
|
|
119
119
|
if (!agentType && ctx.interactive) {
|
|
120
120
|
agentType = await select({
|
|
@@ -123,7 +123,7 @@ const spawnCommand = {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
// Semantic routing: if --type absent but --task provided, use RouteLayer
|
|
126
|
-
const taskDescription = ctx.flags.task;
|
|
126
|
+
const taskDescription = ctx.flags.task?.slice(0, 2048);
|
|
127
127
|
if (!agentType && taskDescription) {
|
|
128
128
|
try {
|
|
129
129
|
// Builds a RouteLayer with a real local embedding model + headless
|
|
@@ -453,7 +453,10 @@ const metricsCommand = {
|
|
|
453
453
|
const files = readdirSync(agentsDir).filter(f => f.endsWith('.json'));
|
|
454
454
|
for (const file of files) {
|
|
455
455
|
try {
|
|
456
|
-
const
|
|
456
|
+
const agentFilePath = join(agentsDir, file);
|
|
457
|
+
if (statSync(agentFilePath).size > 512 * 1024)
|
|
458
|
+
continue; // skip files > 512 KB
|
|
459
|
+
const data = JSON.parse(readFileSync(agentFilePath, 'utf-8'));
|
|
457
460
|
totalAgents++;
|
|
458
461
|
const agType = data.type || 'unknown';
|
|
459
462
|
if (!typeCounts[agType])
|
|
@@ -475,7 +478,7 @@ const metricsCommand = {
|
|
|
475
478
|
}
|
|
476
479
|
// Read swarm activity for additional state
|
|
477
480
|
const activityFile = join(swarmDir, 'swarm-activity.json');
|
|
478
|
-
if (existsSync(activityFile)) {
|
|
481
|
+
if (existsSync(activityFile) && statSync(activityFile).size <= 10 * 1024 * 1024) {
|
|
479
482
|
try {
|
|
480
483
|
const activity = JSON.parse(readFileSync(activityFile, 'utf-8'));
|
|
481
484
|
if (activity.totalAgents && totalAgents === 0)
|
|
@@ -801,9 +804,9 @@ const logsCommand = {
|
|
|
801
804
|
{ command: 'monomind agent logs -l error --since 1h', description: 'Show errors from last hour' }
|
|
802
805
|
],
|
|
803
806
|
action: async (ctx) => {
|
|
804
|
-
const agentId = ctx.args[0] || ctx.flags.id;
|
|
807
|
+
const agentId = ((ctx.args[0] || ctx.flags.id) ?? '').slice(0, 128);
|
|
805
808
|
const tail = ctx.flags.tail;
|
|
806
|
-
const level = ctx.flags.level;
|
|
809
|
+
const level = ctx.flags.level?.slice(0, 32);
|
|
807
810
|
if (!agentId) {
|
|
808
811
|
output.printError('Agent ID is required. Use --id or -i');
|
|
809
812
|
return { success: false, exitCode: 1 };
|
|
@@ -28,6 +28,19 @@ async function getASTAnalyzer() {
|
|
|
28
28
|
async function getGraphAnalyzer() {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Write analysis output to a file, constraining the path to the current working
|
|
33
|
+
* directory to prevent path traversal attacks via --output /etc/cron.d/x or
|
|
34
|
+
* similar. Throws if the resolved path escapes cwd.
|
|
35
|
+
*/
|
|
36
|
+
async function safeWriteOutputFile(outputFile, data) {
|
|
37
|
+
const projectRoot = path.resolve(process.cwd());
|
|
38
|
+
const fullPath = path.resolve(process.cwd(), outputFile);
|
|
39
|
+
if (!fullPath.startsWith(projectRoot + path.sep) && fullPath !== projectRoot) {
|
|
40
|
+
throw new Error(`Output path must resolve within the project directory: ${projectRoot}`);
|
|
41
|
+
}
|
|
42
|
+
await writeFile(fullPath, data);
|
|
43
|
+
}
|
|
31
44
|
// Diff subcommand
|
|
32
45
|
const diffCommand = {
|
|
33
46
|
name: 'diff',
|
|
@@ -557,7 +570,7 @@ const astCommand = {
|
|
|
557
570
|
if (formatType === 'json') {
|
|
558
571
|
const jsonOutput = { files: results, totals };
|
|
559
572
|
if (outputFile) {
|
|
560
|
-
await
|
|
573
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
561
574
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
562
575
|
}
|
|
563
576
|
else {
|
|
@@ -649,7 +662,7 @@ const astCommand = {
|
|
|
649
662
|
}
|
|
650
663
|
}
|
|
651
664
|
if (outputFile) {
|
|
652
|
-
await
|
|
665
|
+
await safeWriteOutputFile(outputFile, JSON.stringify({ files: results, totals }, null, 2));
|
|
653
666
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
654
667
|
}
|
|
655
668
|
return { success: true, data: { files: results, totals } };
|
|
@@ -750,7 +763,7 @@ const complexityAstCommand = {
|
|
|
750
763
|
if (formatType === 'json') {
|
|
751
764
|
const jsonOutput = { files: results, summary: { total: results.length, flagged: flaggedCount, avgComplexity, threshold } };
|
|
752
765
|
if (outputFile) {
|
|
753
|
-
await
|
|
766
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
754
767
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
755
768
|
}
|
|
756
769
|
else {
|
|
@@ -800,7 +813,7 @@ const complexityAstCommand = {
|
|
|
800
813
|
output.writeln(output.dim(` ... and ${results.length - 15} more files`));
|
|
801
814
|
}
|
|
802
815
|
if (outputFile) {
|
|
803
|
-
await
|
|
816
|
+
await safeWriteOutputFile(outputFile, JSON.stringify({ files: results, summary: { total: results.length, flagged: flaggedCount, avgComplexity, threshold } }, null, 2));
|
|
804
817
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
805
818
|
}
|
|
806
819
|
return { success: true, data: { files: results, flaggedCount } };
|
|
@@ -907,7 +920,7 @@ const symbolsCommand = {
|
|
|
907
920
|
symbols.sort((a, b) => a.file.localeCompare(b.file) || a.name.localeCompare(b.name));
|
|
908
921
|
if (formatType === 'json') {
|
|
909
922
|
if (outputFile) {
|
|
910
|
-
await
|
|
923
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(symbols, null, 2));
|
|
911
924
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
912
925
|
}
|
|
913
926
|
else {
|
|
@@ -941,7 +954,7 @@ const symbolsCommand = {
|
|
|
941
954
|
output.writeln(output.dim(` ... and ${symbols.length - 30} more symbols`));
|
|
942
955
|
}
|
|
943
956
|
if (outputFile) {
|
|
944
|
-
await
|
|
957
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(symbols, null, 2));
|
|
945
958
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
946
959
|
}
|
|
947
960
|
return { success: true, data: symbols };
|
|
@@ -1043,7 +1056,7 @@ const importsCommand = {
|
|
|
1043
1056
|
fileImports: Object.fromEntries(fileImports),
|
|
1044
1057
|
};
|
|
1045
1058
|
if (outputFile) {
|
|
1046
|
-
await
|
|
1059
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1047
1060
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
1048
1061
|
}
|
|
1049
1062
|
else {
|
|
@@ -1081,7 +1094,7 @@ const importsCommand = {
|
|
|
1081
1094
|
output.writeln(output.dim(` ... and ${sortedImports.length - 20} more imports`));
|
|
1082
1095
|
}
|
|
1083
1096
|
if (outputFile) {
|
|
1084
|
-
await
|
|
1097
|
+
await safeWriteOutputFile(outputFile, JSON.stringify({
|
|
1085
1098
|
imports: Object.fromEntries(sortedImports),
|
|
1086
1099
|
fileImports: Object.fromEntries(fileImports),
|
|
1087
1100
|
}, null, 2));
|
|
@@ -1378,7 +1391,8 @@ const boundariesCommand = {
|
|
|
1378
1391
|
],
|
|
1379
1392
|
action: async (ctx) => {
|
|
1380
1393
|
const targetDir = ctx.args[0] || ctx.cwd;
|
|
1381
|
-
const
|
|
1394
|
+
const rawPartitions = ctx.flags.partitions || 2;
|
|
1395
|
+
const numPartitions = Number.isFinite(rawPartitions) ? Math.max(1, Math.min(rawPartitions, 100)) : 2;
|
|
1382
1396
|
const outputFile = ctx.flags.output;
|
|
1383
1397
|
const format = ctx.flags.format || 'text';
|
|
1384
1398
|
output.printInfo(`Analyzing code boundaries in: ${output.highlight(targetDir)}`);
|
|
@@ -1406,7 +1420,7 @@ const boundariesCommand = {
|
|
|
1406
1420
|
circularDependencies: result.circularDependencies,
|
|
1407
1421
|
};
|
|
1408
1422
|
if (outputFile) {
|
|
1409
|
-
await
|
|
1423
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1410
1424
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
1411
1425
|
}
|
|
1412
1426
|
else {
|
|
@@ -1420,7 +1434,7 @@ const boundariesCommand = {
|
|
|
1420
1434
|
highlightCycles: true,
|
|
1421
1435
|
});
|
|
1422
1436
|
if (outputFile) {
|
|
1423
|
-
await
|
|
1437
|
+
await safeWriteOutputFile(outputFile, dotOutput);
|
|
1424
1438
|
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1425
1439
|
output.writeln(output.dim('Visualize with: dot -Tpng -o graph.png ' + outputFile));
|
|
1426
1440
|
}
|
|
@@ -1480,7 +1494,7 @@ const boundariesCommand = {
|
|
|
1480
1494
|
}
|
|
1481
1495
|
}
|
|
1482
1496
|
if (outputFile) {
|
|
1483
|
-
await
|
|
1497
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(result, null, 2));
|
|
1484
1498
|
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1485
1499
|
}
|
|
1486
1500
|
return { success: true, data: result };
|
|
@@ -1558,7 +1572,7 @@ const modulesCommand = {
|
|
|
1558
1572
|
statistics: result.statistics,
|
|
1559
1573
|
};
|
|
1560
1574
|
if (outputFile) {
|
|
1561
|
-
await
|
|
1575
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1562
1576
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
1563
1577
|
}
|
|
1564
1578
|
else {
|
|
@@ -1573,7 +1587,7 @@ const modulesCommand = {
|
|
|
1573
1587
|
highlightCycles: true,
|
|
1574
1588
|
});
|
|
1575
1589
|
if (outputFile) {
|
|
1576
|
-
await
|
|
1590
|
+
await safeWriteOutputFile(outputFile, dotOutput);
|
|
1577
1591
|
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1578
1592
|
output.writeln(output.dim('Visualize with: dot -Tpng -o modules.png ' + outputFile));
|
|
1579
1593
|
}
|
|
@@ -1614,7 +1628,7 @@ const modulesCommand = {
|
|
|
1614
1628
|
}
|
|
1615
1629
|
}
|
|
1616
1630
|
if (outputFile) {
|
|
1617
|
-
await
|
|
1631
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(result, null, 2));
|
|
1618
1632
|
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1619
1633
|
}
|
|
1620
1634
|
return { success: true, data: result };
|
|
@@ -1682,7 +1696,8 @@ const dependenciesCommand = {
|
|
|
1682
1696
|
const format = ctx.flags.format || 'text';
|
|
1683
1697
|
const include = (ctx.flags.include || '.ts,.tsx,.js,.jsx,.mjs,.cjs').split(',');
|
|
1684
1698
|
const exclude = (ctx.flags.exclude || 'node_modules,dist,build,.git').split(',');
|
|
1685
|
-
const
|
|
1699
|
+
const rawDepth = ctx.flags.depth || 10;
|
|
1700
|
+
const maxDepth = Number.isFinite(rawDepth) ? Math.max(1, Math.min(rawDepth, 50)) : 10;
|
|
1686
1701
|
output.printInfo(`Building dependency graph for: ${output.highlight(targetDir)}`);
|
|
1687
1702
|
output.writeln();
|
|
1688
1703
|
const spinner = output.createSpinner({ text: 'Scanning files...', spinner: 'dots' });
|
|
@@ -1711,7 +1726,7 @@ const dependenciesCommand = {
|
|
|
1711
1726
|
circularDependencies: circularDeps,
|
|
1712
1727
|
};
|
|
1713
1728
|
if (outputFile) {
|
|
1714
|
-
await
|
|
1729
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1715
1730
|
output.printSuccess(`Graph written to ${outputFile}`);
|
|
1716
1731
|
}
|
|
1717
1732
|
else {
|
|
@@ -1733,7 +1748,7 @@ const dependenciesCommand = {
|
|
|
1733
1748
|
highlightCycles: true,
|
|
1734
1749
|
});
|
|
1735
1750
|
if (outputFile) {
|
|
1736
|
-
await
|
|
1751
|
+
await safeWriteOutputFile(outputFile, dotOutput);
|
|
1737
1752
|
output.printSuccess(`DOT graph written to ${outputFile}`);
|
|
1738
1753
|
output.writeln(output.dim('Visualize with: dot -Tpng -o deps.png ' + outputFile));
|
|
1739
1754
|
}
|
|
@@ -1791,7 +1806,7 @@ const dependenciesCommand = {
|
|
|
1791
1806
|
metadata: graph.metadata,
|
|
1792
1807
|
circularDependencies: circularDeps,
|
|
1793
1808
|
};
|
|
1794
|
-
await
|
|
1809
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(fullOutput, null, 2));
|
|
1795
1810
|
output.printSuccess(`Full results written to ${outputFile}`);
|
|
1796
1811
|
}
|
|
1797
1812
|
return { success: true };
|
|
@@ -1865,7 +1880,7 @@ const circularCommand = {
|
|
|
1865
1880
|
if (format === 'json') {
|
|
1866
1881
|
const jsonOutput = { cycles: filtered, total: cycles.length, filtered: filtered.length };
|
|
1867
1882
|
if (outputFile) {
|
|
1868
|
-
await
|
|
1883
|
+
await safeWriteOutputFile(outputFile, JSON.stringify(jsonOutput, null, 2));
|
|
1869
1884
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
1870
1885
|
}
|
|
1871
1886
|
else {
|
|
@@ -1909,7 +1924,7 @@ const circularCommand = {
|
|
|
1909
1924
|
}
|
|
1910
1925
|
}
|
|
1911
1926
|
if (outputFile) {
|
|
1912
|
-
await
|
|
1927
|
+
await safeWriteOutputFile(outputFile, JSON.stringify({ cycles: filtered }, null, 2));
|
|
1913
1928
|
output.printSuccess(`Results written to ${outputFile}`);
|
|
1914
1929
|
}
|
|
1915
1930
|
return { success: true, data: { cycles: filtered } };
|
|
@@ -151,8 +151,11 @@ const configCommand = {
|
|
|
151
151
|
state.maxIterations = validateNumber(maxIter, 1, 1000, state.maxIterations);
|
|
152
152
|
if (timeout)
|
|
153
153
|
state.timeoutMinutes = validateNumber(timeout, 1, 1440, state.timeoutMinutes);
|
|
154
|
-
if (sources)
|
|
155
|
-
|
|
154
|
+
if (sources) {
|
|
155
|
+
// Cap total sources string length before splitting to prevent O(n) split on huge input
|
|
156
|
+
const cappedSources = sources.length > 512 ? sources.slice(0, 512) : sources;
|
|
157
|
+
state.taskSources = validateTaskSources(cappedSources.split(',').map(s => s.trim()).filter(Boolean));
|
|
158
|
+
}
|
|
156
159
|
saveState(state);
|
|
157
160
|
appendLog({ ts: Date.now(), event: 'config-updated', maxIterations: state.maxIterations, timeoutMinutes: state.timeoutMinutes, taskSources: state.taskSources });
|
|
158
161
|
output.writeln(`Config updated: maxIterations=${state.maxIterations}, timeout=${state.timeoutMinutes}min, sources=${state.taskSources.join(',')}`);
|
|
@@ -248,12 +251,17 @@ const historyCommand = {
|
|
|
248
251
|
{ name: 'json', type: 'boolean', description: 'Output as JSON' },
|
|
249
252
|
],
|
|
250
253
|
action: async (ctx) => {
|
|
251
|
-
const
|
|
254
|
+
const rawQuery = (ctx.flags?.query || '');
|
|
252
255
|
const limit = validateNumber(ctx.flags?.limit, 1, 100, 10);
|
|
253
|
-
if (!
|
|
256
|
+
if (!rawQuery) {
|
|
254
257
|
output.writeln('Usage: autopilot history --query "search terms" [--limit N]');
|
|
255
258
|
return { success: false, message: 'Missing --query' };
|
|
256
259
|
}
|
|
260
|
+
if (rawQuery.length > 1024) {
|
|
261
|
+
output.writeln('Error: --query too long (max 1024 characters)');
|
|
262
|
+
return { success: false, message: 'Query too long' };
|
|
263
|
+
}
|
|
264
|
+
const query = rawQuery;
|
|
257
265
|
const learning = await tryLoadLearning();
|
|
258
266
|
if (!learning) {
|
|
259
267
|
output.writeln('Learning not available. No history to search.');
|