muonroi-cli 1.2.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/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/__test-stubs__/ee-server.d.ts +27 -0
- package/dist/__test-stubs__/ee-server.js +138 -0
- package/dist/__test-stubs__/ee-server.js.map +1 -0
- package/dist/billing/index.d.ts +5 -0
- package/dist/billing/index.js +2 -0
- package/dist/billing/index.js.map +1 -0
- package/dist/cloud/index.d.ts +5 -0
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/daemon/scheduler.d.ts +15 -0
- package/dist/daemon/scheduler.js +126 -0
- package/dist/daemon/scheduler.js.map +1 -0
- package/dist/daemon/scheduler.test.d.ts +1 -0
- package/dist/daemon/scheduler.test.js +103 -0
- package/dist/daemon/scheduler.test.js.map +1 -0
- package/dist/ee/__tests__/pipeline.integration.test.d.ts +14 -0
- package/dist/ee/__tests__/pipeline.integration.test.js +151 -0
- package/dist/ee/__tests__/pipeline.integration.test.js.map +1 -0
- package/dist/ee/auth.d.ts +19 -0
- package/dist/ee/auth.js +48 -0
- package/dist/ee/auth.js.map +1 -0
- package/dist/ee/auth.test.d.ts +1 -0
- package/dist/ee/auth.test.js +59 -0
- package/dist/ee/auth.test.js.map +1 -0
- package/dist/ee/bridge.d.ts +68 -0
- package/dist/ee/bridge.js +177 -0
- package/dist/ee/bridge.js.map +1 -0
- package/dist/ee/bridge.test.d.ts +1 -0
- package/dist/ee/bridge.test.js +231 -0
- package/dist/ee/bridge.test.js.map +1 -0
- package/dist/ee/client.d.ts +22 -0
- package/dist/ee/client.js +464 -0
- package/dist/ee/client.js.map +1 -0
- package/dist/ee/client.test.d.ts +1 -0
- package/dist/ee/client.test.js +151 -0
- package/dist/ee/client.test.js.map +1 -0
- package/dist/ee/embedding-cache.d.ts +7 -0
- package/dist/ee/embedding-cache.js +33 -0
- package/dist/ee/embedding-cache.js.map +1 -0
- package/dist/ee/extract-session.d.ts +17 -0
- package/dist/ee/extract-session.js +53 -0
- package/dist/ee/extract-session.js.map +1 -0
- package/dist/ee/extract-session.test.d.ts +1 -0
- package/dist/ee/extract-session.test.js +197 -0
- package/dist/ee/extract-session.test.js.map +1 -0
- package/dist/ee/health.d.ts +29 -0
- package/dist/ee/health.js +64 -0
- package/dist/ee/health.js.map +1 -0
- package/dist/ee/index.d.ts +10 -0
- package/dist/ee/index.js +9 -0
- package/dist/ee/index.js.map +1 -0
- package/dist/ee/intercept.d.ts +46 -0
- package/dist/ee/intercept.js +117 -0
- package/dist/ee/intercept.js.map +1 -0
- package/dist/ee/intercept.test.d.ts +1 -0
- package/dist/ee/intercept.test.js +170 -0
- package/dist/ee/intercept.test.js.map +1 -0
- package/dist/ee/judge.d.ts +36 -0
- package/dist/ee/judge.js +56 -0
- package/dist/ee/judge.js.map +1 -0
- package/dist/ee/judge.test.d.ts +1 -0
- package/dist/ee/judge.test.js +139 -0
- package/dist/ee/judge.test.js.map +1 -0
- package/dist/ee/offline-queue.d.ts +37 -0
- package/dist/ee/offline-queue.js +163 -0
- package/dist/ee/offline-queue.js.map +1 -0
- package/dist/ee/offline-queue.test.d.ts +1 -0
- package/dist/ee/offline-queue.test.js +246 -0
- package/dist/ee/offline-queue.test.js.map +1 -0
- package/dist/ee/posttool.d.ts +11 -0
- package/dist/ee/posttool.js +16 -0
- package/dist/ee/posttool.js.map +1 -0
- package/dist/ee/posttool.test.d.ts +1 -0
- package/dist/ee/posttool.test.js +70 -0
- package/dist/ee/posttool.test.js.map +1 -0
- package/dist/ee/prompt-stale.d.ts +20 -0
- package/dist/ee/prompt-stale.js +37 -0
- package/dist/ee/prompt-stale.js.map +1 -0
- package/dist/ee/prompt-stale.test.d.ts +8 -0
- package/dist/ee/prompt-stale.test.js +76 -0
- package/dist/ee/prompt-stale.test.js.map +1 -0
- package/dist/ee/render.d.ts +20 -0
- package/dist/ee/render.js +30 -0
- package/dist/ee/render.js.map +1 -0
- package/dist/ee/render.test.d.ts +1 -0
- package/dist/ee/render.test.js +61 -0
- package/dist/ee/render.test.js.map +1 -0
- package/dist/ee/scope.d.ts +6 -0
- package/dist/ee/scope.js +92 -0
- package/dist/ee/scope.js.map +1 -0
- package/dist/ee/scope.test.d.ts +1 -0
- package/dist/ee/scope.test.js +97 -0
- package/dist/ee/scope.test.js.map +1 -0
- package/dist/ee/tenant.d.ts +2 -0
- package/dist/ee/tenant.js +13 -0
- package/dist/ee/tenant.js.map +1 -0
- package/dist/ee/touch.test.d.ts +1 -0
- package/dist/ee/touch.test.js +60 -0
- package/dist/ee/touch.test.js.map +1 -0
- package/dist/ee/types.d.ts +300 -0
- package/dist/ee/types.js +14 -0
- package/dist/ee/types.js.map +1 -0
- package/dist/flow/__tests__/migration.test.d.ts +1 -0
- package/dist/flow/__tests__/migration.test.js +105 -0
- package/dist/flow/__tests__/migration.test.js.map +1 -0
- package/dist/flow/__tests__/parser.test.d.ts +1 -0
- package/dist/flow/__tests__/parser.test.js +68 -0
- package/dist/flow/__tests__/parser.test.js.map +1 -0
- package/dist/flow/__tests__/run-manager.test.d.ts +1 -0
- package/dist/flow/__tests__/run-manager.test.js +83 -0
- package/dist/flow/__tests__/run-manager.test.js.map +1 -0
- package/dist/flow/__tests__/scaffold.test.d.ts +1 -0
- package/dist/flow/__tests__/scaffold.test.js +47 -0
- package/dist/flow/__tests__/scaffold.test.js.map +1 -0
- package/dist/flow/__tests__/warning-persist.test.d.ts +5 -0
- package/dist/flow/__tests__/warning-persist.test.js +96 -0
- package/dist/flow/__tests__/warning-persist.test.js.map +1 -0
- package/dist/flow/artifact-io.d.ts +16 -0
- package/dist/flow/artifact-io.js +35 -0
- package/dist/flow/artifact-io.js.map +1 -0
- package/dist/flow/compaction/__tests__/compress.test.d.ts +1 -0
- package/dist/flow/compaction/__tests__/compress.test.js +63 -0
- package/dist/flow/compaction/__tests__/compress.test.js.map +1 -0
- package/dist/flow/compaction/__tests__/extract.test.d.ts +1 -0
- package/dist/flow/compaction/__tests__/extract.test.js +66 -0
- package/dist/flow/compaction/__tests__/extract.test.js.map +1 -0
- package/dist/flow/compaction/__tests__/preserve.test.d.ts +1 -0
- package/dist/flow/compaction/__tests__/preserve.test.js +62 -0
- package/dist/flow/compaction/__tests__/preserve.test.js.map +1 -0
- package/dist/flow/compaction/compress.d.ts +22 -0
- package/dist/flow/compaction/compress.js +47 -0
- package/dist/flow/compaction/compress.js.map +1 -0
- package/dist/flow/compaction/extract.d.ts +23 -0
- package/dist/flow/compaction/extract.js +46 -0
- package/dist/flow/compaction/extract.js.map +1 -0
- package/dist/flow/compaction/index.d.ts +23 -0
- package/dist/flow/compaction/index.js +63 -0
- package/dist/flow/compaction/index.js.map +1 -0
- package/dist/flow/compaction/preserve.d.ts +24 -0
- package/dist/flow/compaction/preserve.js +35 -0
- package/dist/flow/compaction/preserve.js.map +1 -0
- package/dist/flow/index.d.ts +12 -0
- package/dist/flow/index.js +16 -0
- package/dist/flow/index.js.map +1 -0
- package/dist/flow/migration.d.ts +23 -0
- package/dist/flow/migration.js +126 -0
- package/dist/flow/migration.js.map +1 -0
- package/dist/flow/parser.d.ts +27 -0
- package/dist/flow/parser.js +68 -0
- package/dist/flow/parser.js.map +1 -0
- package/dist/flow/run-manager.d.ts +36 -0
- package/dist/flow/run-manager.js +110 -0
- package/dist/flow/run-manager.js.map +1 -0
- package/dist/flow/scaffold.d.ts +22 -0
- package/dist/flow/scaffold.js +47 -0
- package/dist/flow/scaffold.js.map +1 -0
- package/dist/flow/warning-persist.d.ts +9 -0
- package/dist/flow/warning-persist.js +75 -0
- package/dist/flow/warning-persist.js.map +1 -0
- package/dist/gsd/__tests__/types.test.d.ts +1 -0
- package/dist/gsd/__tests__/types.test.js +65 -0
- package/dist/gsd/__tests__/types.test.js.map +1 -0
- package/dist/gsd/index.d.ts +1 -0
- package/dist/gsd/index.js +2 -0
- package/dist/gsd/index.js.map +1 -0
- package/dist/gsd/types.d.ts +4 -0
- package/dist/gsd/types.js +39 -0
- package/dist/gsd/types.js.map +1 -0
- package/dist/headless/output.d.ts +68 -0
- package/dist/headless/output.js +206 -0
- package/dist/headless/output.js.map +1 -0
- package/dist/headless/output.test.d.ts +1 -0
- package/dist/headless/output.test.js +178 -0
- package/dist/headless/output.test.js.map +1 -0
- package/dist/hooks/config.d.ts +18 -0
- package/dist/hooks/config.js +39 -0
- package/dist/hooks/config.js.map +1 -0
- package/dist/hooks/index.d.ts +44 -0
- package/dist/hooks/index.js +187 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.d.ts +130 -0
- package/dist/hooks/types.js +47 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +512 -0
- package/dist/index.js.map +1 -0
- package/dist/lsp/builtins.d.ts +9 -0
- package/dist/lsp/builtins.js +351 -0
- package/dist/lsp/builtins.js.map +1 -0
- package/dist/lsp/builtins.test.d.ts +1 -0
- package/dist/lsp/builtins.test.js +91 -0
- package/dist/lsp/builtins.test.js.map +1 -0
- package/dist/lsp/client.d.ts +20 -0
- package/dist/lsp/client.js +290 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/manager.d.ts +20 -0
- package/dist/lsp/manager.js +235 -0
- package/dist/lsp/manager.js.map +1 -0
- package/dist/lsp/manager.test.d.ts +1 -0
- package/dist/lsp/manager.test.js +133 -0
- package/dist/lsp/manager.test.js.map +1 -0
- package/dist/lsp/npm-cache.d.ts +2 -0
- package/dist/lsp/npm-cache.js +105 -0
- package/dist/lsp/npm-cache.js.map +1 -0
- package/dist/lsp/npm-cache.test.d.ts +1 -0
- package/dist/lsp/npm-cache.test.js +53 -0
- package/dist/lsp/npm-cache.test.js.map +1 -0
- package/dist/lsp/runtime.d.ts +6 -0
- package/dist/lsp/runtime.js +53 -0
- package/dist/lsp/runtime.js.map +1 -0
- package/dist/lsp/smoke.test.d.ts +1 -0
- package/dist/lsp/smoke.test.js +56 -0
- package/dist/lsp/smoke.test.js.map +1 -0
- package/dist/lsp/types.d.ts +83 -0
- package/dist/lsp/types.js +12 -0
- package/dist/lsp/types.js.map +1 -0
- package/dist/mcp/auto-setup.d.ts +2 -0
- package/dist/mcp/auto-setup.js +76 -0
- package/dist/mcp/auto-setup.js.map +1 -0
- package/dist/mcp/catalog.d.ts +10 -0
- package/dist/mcp/catalog.js +121 -0
- package/dist/mcp/catalog.js.map +1 -0
- package/dist/mcp/oauth-callback.d.ts +9 -0
- package/dist/mcp/oauth-callback.js +49 -0
- package/dist/mcp/oauth-callback.js.map +1 -0
- package/dist/mcp/oauth-provider.d.ts +33 -0
- package/dist/mcp/oauth-provider.js +94 -0
- package/dist/mcp/oauth-provider.js.map +1 -0
- package/dist/mcp/parse-headers.d.ts +2 -0
- package/dist/mcp/parse-headers.js +33 -0
- package/dist/mcp/parse-headers.js.map +1 -0
- package/dist/mcp/parse-headers.test.d.ts +1 -0
- package/dist/mcp/parse-headers.test.js +43 -0
- package/dist/mcp/parse-headers.test.js.map +1 -0
- package/dist/mcp/runtime.d.ts +11 -0
- package/dist/mcp/runtime.js +81 -0
- package/dist/mcp/runtime.js.map +1 -0
- package/dist/mcp/smoke.test.d.ts +1 -0
- package/dist/mcp/smoke.test.js +159 -0
- package/dist/mcp/smoke.test.js.map +1 -0
- package/dist/mcp/validate.d.ts +9 -0
- package/dist/mcp/validate.js +39 -0
- package/dist/mcp/validate.js.map +1 -0
- package/dist/models/__tests__/registry.test.d.ts +1 -0
- package/dist/models/__tests__/registry.test.js +74 -0
- package/dist/models/__tests__/registry.test.js.map +1 -0
- package/dist/models/catalog-client.d.ts +21 -0
- package/dist/models/catalog-client.js +53 -0
- package/dist/models/catalog-client.js.map +1 -0
- package/dist/models/classify-tier.d.ts +2 -0
- package/dist/models/classify-tier.js +34 -0
- package/dist/models/classify-tier.js.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/registry.d.ts +19 -0
- package/dist/models/registry.js +65 -0
- package/dist/models/registry.js.map +1 -0
- package/dist/ops/bug-report.d.ts +28 -0
- package/dist/ops/bug-report.js +67 -0
- package/dist/ops/bug-report.js.map +1 -0
- package/dist/ops/bug-report.test.d.ts +1 -0
- package/dist/ops/bug-report.test.js +148 -0
- package/dist/ops/bug-report.test.js.map +1 -0
- package/dist/ops/doctor.d.ts +16 -0
- package/dist/ops/doctor.js +162 -0
- package/dist/ops/doctor.js.map +1 -0
- package/dist/ops/doctor.test.d.ts +1 -0
- package/dist/ops/doctor.test.js +95 -0
- package/dist/ops/doctor.test.js.map +1 -0
- package/dist/orchestrator/__tests__/flow-resume.test.d.ts +5 -0
- package/dist/orchestrator/__tests__/flow-resume.test.js +61 -0
- package/dist/orchestrator/__tests__/flow-resume.test.js.map +1 -0
- package/dist/orchestrator/__tests__/route-feedback.test.d.ts +1 -0
- package/dist/orchestrator/__tests__/route-feedback.test.js +47 -0
- package/dist/orchestrator/__tests__/route-feedback.test.js.map +1 -0
- package/dist/orchestrator/abort.d.ts +29 -0
- package/dist/orchestrator/abort.js +31 -0
- package/dist/orchestrator/abort.js.map +1 -0
- package/dist/orchestrator/abort.test.d.ts +1 -0
- package/dist/orchestrator/abort.test.js +34 -0
- package/dist/orchestrator/abort.test.js.map +1 -0
- package/dist/orchestrator/agent.test.d.ts +1 -0
- package/dist/orchestrator/agent.test.js +126 -0
- package/dist/orchestrator/agent.test.js.map +1 -0
- package/dist/orchestrator/cleanup.test.d.ts +1 -0
- package/dist/orchestrator/cleanup.test.js +67 -0
- package/dist/orchestrator/cleanup.test.js.map +1 -0
- package/dist/orchestrator/compaction.d.ts +36 -0
- package/dist/orchestrator/compaction.js +375 -0
- package/dist/orchestrator/compaction.js.map +1 -0
- package/dist/orchestrator/compaction.test.d.ts +1 -0
- package/dist/orchestrator/compaction.test.js +105 -0
- package/dist/orchestrator/compaction.test.js.map +1 -0
- package/dist/orchestrator/delegations.d.ts +49 -0
- package/dist/orchestrator/delegations.js +283 -0
- package/dist/orchestrator/delegations.js.map +1 -0
- package/dist/orchestrator/delegations.test.d.ts +1 -0
- package/dist/orchestrator/delegations.test.js +107 -0
- package/dist/orchestrator/delegations.test.js.map +1 -0
- package/dist/orchestrator/flow-resume.d.ts +25 -0
- package/dist/orchestrator/flow-resume.js +53 -0
- package/dist/orchestrator/flow-resume.js.map +1 -0
- package/dist/orchestrator/orchestrator.d.ts +239 -0
- package/dist/orchestrator/orchestrator.js +3209 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/pending-calls.d.ts +75 -0
- package/dist/orchestrator/pending-calls.js +178 -0
- package/dist/orchestrator/pending-calls.js.map +1 -0
- package/dist/orchestrator/pending-calls.test.d.ts +1 -0
- package/dist/orchestrator/pending-calls.test.js +188 -0
- package/dist/orchestrator/pending-calls.test.js.map +1 -0
- package/dist/orchestrator/reasoning.d.ts +3 -0
- package/dist/orchestrator/reasoning.js +53 -0
- package/dist/orchestrator/reasoning.js.map +1 -0
- package/dist/orchestrator/reasoning.test.d.ts +1 -0
- package/dist/orchestrator/reasoning.test.js +26 -0
- package/dist/orchestrator/reasoning.test.js.map +1 -0
- package/dist/orchestrator/sandbox.test.d.ts +1 -0
- package/dist/orchestrator/sandbox.test.js +94 -0
- package/dist/orchestrator/sandbox.test.js.map +1 -0
- package/dist/pil/__tests__/budget.test.d.ts +1 -0
- package/dist/pil/__tests__/budget.test.js +33 -0
- package/dist/pil/__tests__/budget.test.js.map +1 -0
- package/dist/pil/__tests__/layer1-intent.test.d.ts +1 -0
- package/dist/pil/__tests__/layer1-intent.test.js +199 -0
- package/dist/pil/__tests__/layer1-intent.test.js.map +1 -0
- package/dist/pil/__tests__/layer2-personality.test.d.ts +1 -0
- package/dist/pil/__tests__/layer2-personality.test.js +57 -0
- package/dist/pil/__tests__/layer2-personality.test.js.map +1 -0
- package/dist/pil/__tests__/layer3-ee-injection.test.d.ts +1 -0
- package/dist/pil/__tests__/layer3-ee-injection.test.js +96 -0
- package/dist/pil/__tests__/layer3-ee-injection.test.js.map +1 -0
- package/dist/pil/__tests__/layer4-gsd.test.d.ts +1 -0
- package/dist/pil/__tests__/layer4-gsd.test.js +68 -0
- package/dist/pil/__tests__/layer4-gsd.test.js.map +1 -0
- package/dist/pil/__tests__/layer5-context.test.d.ts +1 -0
- package/dist/pil/__tests__/layer5-context.test.js +100 -0
- package/dist/pil/__tests__/layer5-context.test.js.map +1 -0
- package/dist/pil/__tests__/layer6-output.test.d.ts +1 -0
- package/dist/pil/__tests__/layer6-output.test.js +115 -0
- package/dist/pil/__tests__/layer6-output.test.js.map +1 -0
- package/dist/pil/__tests__/ollama-classify.test.d.ts +1 -0
- package/dist/pil/__tests__/ollama-classify.test.js +68 -0
- package/dist/pil/__tests__/ollama-classify.test.js.map +1 -0
- package/dist/pil/__tests__/orchestrator-integration.test.d.ts +10 -0
- package/dist/pil/__tests__/orchestrator-integration.test.js +98 -0
- package/dist/pil/__tests__/orchestrator-integration.test.js.map +1 -0
- package/dist/pil/__tests__/pipeline.test.d.ts +1 -0
- package/dist/pil/__tests__/pipeline.test.js +150 -0
- package/dist/pil/__tests__/pipeline.test.js.map +1 -0
- package/dist/pil/__tests__/response-tools.test.d.ts +1 -0
- package/dist/pil/__tests__/response-tools.test.js +133 -0
- package/dist/pil/__tests__/response-tools.test.js.map +1 -0
- package/dist/pil/__tests__/schema.test.d.ts +1 -0
- package/dist/pil/__tests__/schema.test.js +112 -0
- package/dist/pil/__tests__/schema.test.js.map +1 -0
- package/dist/pil/__tests__/store.test.d.ts +1 -0
- package/dist/pil/__tests__/store.test.js +44 -0
- package/dist/pil/__tests__/store.test.js.map +1 -0
- package/dist/pil/__tests__/task-tier-map.test.d.ts +1 -0
- package/dist/pil/__tests__/task-tier-map.test.js +33 -0
- package/dist/pil/__tests__/task-tier-map.test.js.map +1 -0
- package/dist/pil/budget.d.ts +8 -0
- package/dist/pil/budget.js +17 -0
- package/dist/pil/budget.js.map +1 -0
- package/dist/pil/index.d.ts +11 -0
- package/dist/pil/index.js +11 -0
- package/dist/pil/index.js.map +1 -0
- package/dist/pil/layer1-intent.d.ts +13 -0
- package/dist/pil/layer1-intent.js +142 -0
- package/dist/pil/layer1-intent.js.map +1 -0
- package/dist/pil/layer2-personality.d.ts +2 -0
- package/dist/pil/layer2-personality.js +29 -0
- package/dist/pil/layer2-personality.js.map +1 -0
- package/dist/pil/layer3-ee-injection.d.ts +10 -0
- package/dist/pil/layer3-ee-injection.js +72 -0
- package/dist/pil/layer3-ee-injection.js.map +1 -0
- package/dist/pil/layer4-gsd.d.ts +2 -0
- package/dist/pil/layer4-gsd.js +64 -0
- package/dist/pil/layer4-gsd.js.map +1 -0
- package/dist/pil/layer5-context.d.ts +2 -0
- package/dist/pil/layer5-context.js +124 -0
- package/dist/pil/layer5-context.js.map +1 -0
- package/dist/pil/layer6-output.d.ts +18 -0
- package/dist/pil/layer6-output.js +105 -0
- package/dist/pil/layer6-output.js.map +1 -0
- package/dist/pil/ollama-classify.d.ts +13 -0
- package/dist/pil/ollama-classify.js +38 -0
- package/dist/pil/ollama-classify.js.map +1 -0
- package/dist/pil/pipeline.d.ts +16 -0
- package/dist/pil/pipeline.js +96 -0
- package/dist/pil/pipeline.js.map +1 -0
- package/dist/pil/response-tools.d.ts +63 -0
- package/dist/pil/response-tools.js +87 -0
- package/dist/pil/response-tools.js.map +1 -0
- package/dist/pil/schema.d.ts +80 -0
- package/dist/pil/schema.js +43 -0
- package/dist/pil/schema.js.map +1 -0
- package/dist/pil/store.d.ts +12 -0
- package/dist/pil/store.js +21 -0
- package/dist/pil/store.js.map +1 -0
- package/dist/pil/task-tier-map.d.ts +30 -0
- package/dist/pil/task-tier-map.js +83 -0
- package/dist/pil/task-tier-map.js.map +1 -0
- package/dist/pil/timeout.d.ts +7 -0
- package/dist/pil/timeout.js +10 -0
- package/dist/pil/timeout.js.map +1 -0
- package/dist/pil/types.d.ts +39 -0
- package/dist/pil/types.js +7 -0
- package/dist/pil/types.js.map +1 -0
- package/dist/providers/__test-utils__/load-fixture.d.ts +9 -0
- package/dist/providers/__test-utils__/load-fixture.js +34 -0
- package/dist/providers/__test-utils__/load-fixture.js.map +1 -0
- package/dist/providers/__tests__/runtime-integration.test.d.ts +1 -0
- package/dist/providers/__tests__/runtime-integration.test.js +71 -0
- package/dist/providers/__tests__/runtime-integration.test.js.map +1 -0
- package/dist/providers/__tests__/runtime.test.d.ts +1 -0
- package/dist/providers/__tests__/runtime.test.js +76 -0
- package/dist/providers/__tests__/runtime.test.js.map +1 -0
- package/dist/providers/adapter.d.ts +15 -0
- package/dist/providers/adapter.js +45 -0
- package/dist/providers/adapter.js.map +1 -0
- package/dist/providers/adapter.test.d.ts +1 -0
- package/dist/providers/adapter.test.js +19 -0
- package/dist/providers/adapter.test.js.map +1 -0
- package/dist/providers/anthropic.d.ts +53 -0
- package/dist/providers/anthropic.js +141 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/errors.d.ts +18 -0
- package/dist/providers/errors.js +36 -0
- package/dist/providers/errors.js.map +1 -0
- package/dist/providers/errors.test.d.ts +1 -0
- package/dist/providers/errors.test.js +66 -0
- package/dist/providers/errors.test.js.map +1 -0
- package/dist/providers/gemini.d.ts +11 -0
- package/dist/providers/gemini.js +33 -0
- package/dist/providers/gemini.js.map +1 -0
- package/dist/providers/gemini.test.d.ts +1 -0
- package/dist/providers/gemini.test.js +37 -0
- package/dist/providers/gemini.test.js.map +1 -0
- package/dist/providers/index.d.ts +11 -0
- package/dist/providers/index.js +15 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/keychain.d.ts +32 -0
- package/dist/providers/keychain.js +127 -0
- package/dist/providers/keychain.js.map +1 -0
- package/dist/providers/keychain.test.d.ts +1 -0
- package/dist/providers/keychain.test.js +80 -0
- package/dist/providers/keychain.test.js.map +1 -0
- package/dist/providers/ollama.d.ts +13 -0
- package/dist/providers/ollama.js +33 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/ollama.test.d.ts +1 -0
- package/dist/providers/ollama.test.js +37 -0
- package/dist/providers/ollama.test.js.map +1 -0
- package/dist/providers/openai-compatible.d.ts +15 -0
- package/dist/providers/openai-compatible.js +45 -0
- package/dist/providers/openai-compatible.js.map +1 -0
- package/dist/providers/openai-compatible.test.d.ts +1 -0
- package/dist/providers/openai-compatible.test.js +53 -0
- package/dist/providers/openai-compatible.test.js.map +1 -0
- package/dist/providers/openai.d.ts +11 -0
- package/dist/providers/openai.js +33 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/openai.test.d.ts +1 -0
- package/dist/providers/openai.test.js +53 -0
- package/dist/providers/openai.test.js.map +1 -0
- package/dist/providers/patch-zod-schema.d.ts +24 -0
- package/dist/providers/patch-zod-schema.js +121 -0
- package/dist/providers/patch-zod-schema.js.map +1 -0
- package/dist/providers/pricing.d.ts +21 -0
- package/dist/providers/pricing.js +50 -0
- package/dist/providers/pricing.js.map +1 -0
- package/dist/providers/pricing.test.d.ts +1 -0
- package/dist/providers/pricing.test.js +47 -0
- package/dist/providers/pricing.test.js.map +1 -0
- package/dist/providers/runtime.d.ts +21 -0
- package/dist/providers/runtime.js +83 -0
- package/dist/providers/runtime.js.map +1 -0
- package/dist/providers/stream-loop.d.ts +16 -0
- package/dist/providers/stream-loop.js +63 -0
- package/dist/providers/stream-loop.js.map +1 -0
- package/dist/providers/types.d.ts +106 -0
- package/dist/providers/types.js +12 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/providers/vision-proxy.d.ts +23 -0
- package/dist/providers/vision-proxy.js +152 -0
- package/dist/providers/vision-proxy.js.map +1 -0
- package/dist/providers/vision-proxy.test.d.ts +1 -0
- package/dist/providers/vision-proxy.test.js +136 -0
- package/dist/providers/vision-proxy.test.js.map +1 -0
- package/dist/router/classifier/grammars.d.ts +3 -0
- package/dist/router/classifier/grammars.js +14 -0
- package/dist/router/classifier/grammars.js.map +1 -0
- package/dist/router/classifier/index.d.ts +3 -0
- package/dist/router/classifier/index.js +19 -0
- package/dist/router/classifier/index.js.map +1 -0
- package/dist/router/classifier/index.test.d.ts +1 -0
- package/dist/router/classifier/index.test.js +29 -0
- package/dist/router/classifier/index.test.js.map +1 -0
- package/dist/router/classifier/regex.d.ts +2 -0
- package/dist/router/classifier/regex.js +45 -0
- package/dist/router/classifier/regex.js.map +1 -0
- package/dist/router/classifier/regex.test.d.ts +1 -0
- package/dist/router/classifier/regex.test.js +42 -0
- package/dist/router/classifier/regex.test.js.map +1 -0
- package/dist/router/classifier/tree-sitter.d.ts +5 -0
- package/dist/router/classifier/tree-sitter.js +84 -0
- package/dist/router/classifier/tree-sitter.js.map +1 -0
- package/dist/router/classifier/tree-sitter.test.d.ts +1 -0
- package/dist/router/classifier/tree-sitter.test.js +23 -0
- package/dist/router/classifier/tree-sitter.test.js.map +1 -0
- package/dist/router/cold.d.ts +7 -0
- package/dist/router/cold.js +21 -0
- package/dist/router/cold.js.map +1 -0
- package/dist/router/cold.test.d.ts +1 -0
- package/dist/router/cold.test.js +56 -0
- package/dist/router/cold.test.js.map +1 -0
- package/dist/router/decide.d.ts +42 -0
- package/dist/router/decide.js +300 -0
- package/dist/router/decide.js.map +1 -0
- package/dist/router/decide.test.d.ts +1 -0
- package/dist/router/decide.test.js +116 -0
- package/dist/router/decide.test.js.map +1 -0
- package/dist/router/health.d.ts +10 -0
- package/dist/router/health.js +44 -0
- package/dist/router/health.js.map +1 -0
- package/dist/router/health.test.d.ts +1 -0
- package/dist/router/health.test.js +52 -0
- package/dist/router/health.test.js.map +1 -0
- package/dist/router/store.d.ts +24 -0
- package/dist/router/store.js +27 -0
- package/dist/router/store.js.map +1 -0
- package/dist/router/types.d.ts +18 -0
- package/dist/router/types.js +2 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router/warm.d.ts +7 -0
- package/dist/router/warm.js +40 -0
- package/dist/router/warm.js.map +1 -0
- package/dist/router/warm.test.d.ts +1 -0
- package/dist/router/warm.test.js +144 -0
- package/dist/router/warm.test.js.map +1 -0
- package/dist/storage/__tests__/migrations.test.d.ts +12 -0
- package/dist/storage/__tests__/migrations.test.js +357 -0
- package/dist/storage/__tests__/migrations.test.js.map +1 -0
- package/dist/storage/atomic-io.d.ts +18 -0
- package/dist/storage/atomic-io.js +65 -0
- package/dist/storage/atomic-io.js.map +1 -0
- package/dist/storage/atomic-io.test.d.ts +1 -0
- package/dist/storage/atomic-io.test.js +49 -0
- package/dist/storage/atomic-io.test.js.map +1 -0
- package/dist/storage/config.d.ts +22 -0
- package/dist/storage/config.js +35 -0
- package/dist/storage/config.js.map +1 -0
- package/dist/storage/config.test.d.ts +1 -0
- package/dist/storage/config.test.js +29 -0
- package/dist/storage/config.test.js.map +1 -0
- package/dist/storage/db.d.ts +18 -0
- package/dist/storage/db.js +71 -0
- package/dist/storage/db.js.map +1 -0
- package/dist/storage/index.d.ts +8 -0
- package/dist/storage/index.js +10 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/migrations.d.ts +2 -0
- package/dist/storage/migrations.js +138 -0
- package/dist/storage/migrations.js.map +1 -0
- package/dist/storage/session-dir.d.ts +27 -0
- package/dist/storage/session-dir.js +36 -0
- package/dist/storage/session-dir.js.map +1 -0
- package/dist/storage/sessions.d.ts +16 -0
- package/dist/storage/sessions.js +142 -0
- package/dist/storage/sessions.js.map +1 -0
- package/dist/storage/tool-results.d.ts +4 -0
- package/dist/storage/tool-results.js +50 -0
- package/dist/storage/tool-results.js.map +1 -0
- package/dist/storage/transcript-view.d.ts +14 -0
- package/dist/storage/transcript-view.js +23 -0
- package/dist/storage/transcript-view.js.map +1 -0
- package/dist/storage/transcript.d.ts +12 -0
- package/dist/storage/transcript.js +269 -0
- package/dist/storage/transcript.js.map +1 -0
- package/dist/storage/transcript.test.d.ts +1 -0
- package/dist/storage/transcript.test.js +22 -0
- package/dist/storage/transcript.test.js.map +1 -0
- package/dist/storage/usage-cap.d.ts +34 -0
- package/dist/storage/usage-cap.js +54 -0
- package/dist/storage/usage-cap.js.map +1 -0
- package/dist/storage/usage-cap.test.d.ts +1 -0
- package/dist/storage/usage-cap.test.js +51 -0
- package/dist/storage/usage-cap.test.js.map +1 -0
- package/dist/storage/usage.d.ts +11 -0
- package/dist/storage/usage.js +65 -0
- package/dist/storage/usage.js.map +1 -0
- package/dist/storage/workspaces.d.ts +9 -0
- package/dist/storage/workspaces.js +60 -0
- package/dist/storage/workspaces.js.map +1 -0
- package/dist/tools/bash.d.ts +46 -0
- package/dist/tools/bash.js +541 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/bash.test.d.ts +1 -0
- package/dist/tools/bash.test.js +240 -0
- package/dist/tools/bash.test.js.map +1 -0
- package/dist/tools/computer.d.ts +88 -0
- package/dist/tools/computer.js +443 -0
- package/dist/tools/computer.js.map +1 -0
- package/dist/tools/computer.test.d.ts +1 -0
- package/dist/tools/computer.test.js +142 -0
- package/dist/tools/computer.test.js.map +1 -0
- package/dist/tools/file.d.ts +17 -0
- package/dist/tools/file.js +101 -0
- package/dist/tools/file.js.map +1 -0
- package/dist/tools/file.test.d.ts +1 -0
- package/dist/tools/file.test.js +58 -0
- package/dist/tools/file.test.js.map +1 -0
- package/dist/tools/grep.d.ts +8 -0
- package/dist/tools/grep.js +144 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/registry.d.ts +19 -0
- package/dist/tools/registry.js +245 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/schedule.d.ts +85 -0
- package/dist/tools/schedule.js +498 -0
- package/dist/tools/schedule.js.map +1 -0
- package/dist/tools/schedule.test.d.ts +1 -0
- package/dist/tools/schedule.test.js +118 -0
- package/dist/tools/schedule.test.js.map +1 -0
- package/dist/types/index.d.ts +279 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/agents-modal.d.ts +36 -0
- package/dist/ui/agents-modal.js +54 -0
- package/dist/ui/agents-modal.js.map +1 -0
- package/dist/ui/app.d.ts +31 -0
- package/dist/ui/app.js +3957 -0
- package/dist/ui/app.js.map +1 -0
- package/dist/ui/components/SuggestionOverlay.d.ts +6 -0
- package/dist/ui/components/SuggestionOverlay.js +12 -0
- package/dist/ui/components/SuggestionOverlay.js.map +1 -0
- package/dist/ui/components/btw-overlay.d.ts +11 -0
- package/dist/ui/components/btw-overlay.js +16 -0
- package/dist/ui/components/btw-overlay.js.map +1 -0
- package/dist/ui/hooks/useTypeahead.d.ts +18 -0
- package/dist/ui/hooks/useTypeahead.js +111 -0
- package/dist/ui/hooks/useTypeahead.js.map +1 -0
- package/dist/ui/markdown.d.ts +5 -0
- package/dist/ui/markdown.js +38 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/mcp-modal-types.d.ts +24 -0
- package/dist/ui/mcp-modal-types.js +13 -0
- package/dist/ui/mcp-modal-types.js.map +1 -0
- package/dist/ui/mcp-modal.d.ts +33 -0
- package/dist/ui/mcp-modal.js +94 -0
- package/dist/ui/mcp-modal.js.map +1 -0
- package/dist/ui/plan.d.ts +24 -0
- package/dist/ui/plan.js +122 -0
- package/dist/ui/plan.js.map +1 -0
- package/dist/ui/schedule-modal.d.ts +15 -0
- package/dist/ui/schedule-modal.js +36 -0
- package/dist/ui/schedule-modal.js.map +1 -0
- package/dist/ui/slash/__tests__/clear.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/clear.test.js +58 -0
- package/dist/ui/slash/__tests__/clear.test.js.map +1 -0
- package/dist/ui/slash/__tests__/compact.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/compact.test.js +43 -0
- package/dist/ui/slash/__tests__/compact.test.js.map +1 -0
- package/dist/ui/slash/__tests__/cost.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/cost.test.js +54 -0
- package/dist/ui/slash/__tests__/cost.test.js.map +1 -0
- package/dist/ui/slash/__tests__/discuss.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/discuss.test.js +83 -0
- package/dist/ui/slash/__tests__/discuss.test.js.map +1 -0
- package/dist/ui/slash/__tests__/execute.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/execute.test.js +71 -0
- package/dist/ui/slash/__tests__/execute.test.js.map +1 -0
- package/dist/ui/slash/__tests__/expand.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/expand.test.js +67 -0
- package/dist/ui/slash/__tests__/expand.test.js.map +1 -0
- package/dist/ui/slash/__tests__/optimize.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/optimize.test.js +130 -0
- package/dist/ui/slash/__tests__/optimize.test.js.map +1 -0
- package/dist/ui/slash/__tests__/plan.test.d.ts +1 -0
- package/dist/ui/slash/__tests__/plan.test.js +79 -0
- package/dist/ui/slash/__tests__/plan.test.js.map +1 -0
- package/dist/ui/slash/clear.d.ts +11 -0
- package/dist/ui/slash/clear.js +77 -0
- package/dist/ui/slash/clear.js.map +1 -0
- package/dist/ui/slash/compact.d.ts +11 -0
- package/dist/ui/slash/compact.js +40 -0
- package/dist/ui/slash/compact.js.map +1 -0
- package/dist/ui/slash/cost.d.ts +11 -0
- package/dist/ui/slash/cost.js +55 -0
- package/dist/ui/slash/cost.js.map +1 -0
- package/dist/ui/slash/council.d.ts +2 -0
- package/dist/ui/slash/council.js +22 -0
- package/dist/ui/slash/council.js.map +1 -0
- package/dist/ui/slash/debug.d.ts +45 -0
- package/dist/ui/slash/debug.js +111 -0
- package/dist/ui/slash/debug.js.map +1 -0
- package/dist/ui/slash/discuss.d.ts +11 -0
- package/dist/ui/slash/discuss.js +59 -0
- package/dist/ui/slash/discuss.js.map +1 -0
- package/dist/ui/slash/ee.d.ts +10 -0
- package/dist/ui/slash/ee.js +247 -0
- package/dist/ui/slash/ee.js.map +1 -0
- package/dist/ui/slash/execute.d.ts +12 -0
- package/dist/ui/slash/execute.js +36 -0
- package/dist/ui/slash/execute.js.map +1 -0
- package/dist/ui/slash/expand.d.ts +11 -0
- package/dist/ui/slash/expand.js +42 -0
- package/dist/ui/slash/expand.js.map +1 -0
- package/dist/ui/slash/optimize.d.ts +12 -0
- package/dist/ui/slash/optimize.js +37 -0
- package/dist/ui/slash/optimize.js.map +1 -0
- package/dist/ui/slash/plan.d.ts +11 -0
- package/dist/ui/slash/plan.js +48 -0
- package/dist/ui/slash/plan.js.map +1 -0
- package/dist/ui/slash/registry.d.ts +23 -0
- package/dist/ui/slash/registry.js +26 -0
- package/dist/ui/slash/registry.js.map +1 -0
- package/dist/ui/slash/route.d.ts +12 -0
- package/dist/ui/slash/route.js +35 -0
- package/dist/ui/slash/route.js.map +1 -0
- package/dist/ui/slash/route.test.d.ts +1 -0
- package/dist/ui/slash/route.test.js +70 -0
- package/dist/ui/slash/route.test.js.map +1 -0
- package/dist/ui/status-bar/index.d.ts +14 -0
- package/dist/ui/status-bar/index.js +74 -0
- package/dist/ui/status-bar/index.js.map +1 -0
- package/dist/ui/status-bar/index.test.d.ts +1 -0
- package/dist/ui/status-bar/index.test.js +80 -0
- package/dist/ui/status-bar/index.test.js.map +1 -0
- package/dist/ui/status-bar/store.d.ts +38 -0
- package/dist/ui/status-bar/store.js +144 -0
- package/dist/ui/status-bar/store.js.map +1 -0
- package/dist/ui/status-bar/store.test.d.ts +1 -0
- package/dist/ui/status-bar/store.test.js +116 -0
- package/dist/ui/status-bar/store.test.js.map +1 -0
- package/dist/ui/status-bar/tier-badge.d.ts +11 -0
- package/dist/ui/status-bar/tier-badge.js +19 -0
- package/dist/ui/status-bar/tier-badge.js.map +1 -0
- package/dist/ui/status-bar/tier-badge.test.d.ts +1 -0
- package/dist/ui/status-bar/tier-badge.test.js +34 -0
- package/dist/ui/status-bar/tier-badge.test.js.map +1 -0
- package/dist/ui/status-bar/usd-meter.d.ts +13 -0
- package/dist/ui/status-bar/usd-meter.js +13 -0
- package/dist/ui/status-bar/usd-meter.js.map +1 -0
- package/dist/ui/status-bar/usd-meter.test.d.ts +1 -0
- package/dist/ui/status-bar/usd-meter.test.js +32 -0
- package/dist/ui/status-bar/usd-meter.test.js.map +1 -0
- package/dist/ui/terminal-selection-text.d.ts +23 -0
- package/dist/ui/terminal-selection-text.js +59 -0
- package/dist/ui/terminal-selection-text.js.map +1 -0
- package/dist/ui/theme.d.ts +53 -0
- package/dist/ui/theme.js +53 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/usage/downgrade.d.ts +37 -0
- package/dist/usage/downgrade.js +49 -0
- package/dist/usage/downgrade.js.map +1 -0
- package/dist/usage/downgrade.test.d.ts +1 -0
- package/dist/usage/downgrade.test.js +67 -0
- package/dist/usage/downgrade.test.js.map +1 -0
- package/dist/usage/estimator.d.ts +17 -0
- package/dist/usage/estimator.js +28 -0
- package/dist/usage/estimator.js.map +1 -0
- package/dist/usage/estimator.test.d.ts +1 -0
- package/dist/usage/estimator.test.js +38 -0
- package/dist/usage/estimator.test.js.map +1 -0
- package/dist/usage/ledger.d.ts +42 -0
- package/dist/usage/ledger.js +181 -0
- package/dist/usage/ledger.js.map +1 -0
- package/dist/usage/ledger.test.d.ts +1 -0
- package/dist/usage/ledger.test.js +171 -0
- package/dist/usage/ledger.test.js.map +1 -0
- package/dist/usage/midstream.d.ts +24 -0
- package/dist/usage/midstream.js +45 -0
- package/dist/usage/midstream.js.map +1 -0
- package/dist/usage/midstream.test.d.ts +1 -0
- package/dist/usage/midstream.test.js +47 -0
- package/dist/usage/midstream.test.js.map +1 -0
- package/dist/usage/thresholds.d.ts +38 -0
- package/dist/usage/thresholds.js +54 -0
- package/dist/usage/thresholds.js.map +1 -0
- package/dist/usage/thresholds.test.d.ts +1 -0
- package/dist/usage/thresholds.test.js +77 -0
- package/dist/usage/thresholds.test.js.map +1 -0
- package/dist/usage/types.d.ts +30 -0
- package/dist/usage/types.js +21 -0
- package/dist/usage/types.js.map +1 -0
- package/dist/utils/at-mentions.d.ts +12 -0
- package/dist/utils/at-mentions.js +92 -0
- package/dist/utils/at-mentions.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +13 -0
- package/dist/utils/clipboard-image.js +121 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/file-index.d.ts +13 -0
- package/dist/utils/file-index.js +143 -0
- package/dist/utils/file-index.js.map +1 -0
- package/dist/utils/git-root.d.ts +1 -0
- package/dist/utils/git-root.js +16 -0
- package/dist/utils/git-root.js.map +1 -0
- package/dist/utils/host-clipboard.d.ts +4 -0
- package/dist/utils/host-clipboard.js +32 -0
- package/dist/utils/host-clipboard.js.map +1 -0
- package/dist/utils/install-manager.d.ts +56 -0
- package/dist/utils/install-manager.js +340 -0
- package/dist/utils/install-manager.js.map +1 -0
- package/dist/utils/install-manager.test.d.ts +1 -0
- package/dist/utils/install-manager.test.js +127 -0
- package/dist/utils/install-manager.test.js.map +1 -0
- package/dist/utils/instructions.d.ts +3 -0
- package/dist/utils/instructions.js +107 -0
- package/dist/utils/instructions.js.map +1 -0
- package/dist/utils/instructions.test.d.ts +1 -0
- package/dist/utils/instructions.test.js +68 -0
- package/dist/utils/instructions.test.js.map +1 -0
- package/dist/utils/permission-mode.d.ts +24 -0
- package/dist/utils/permission-mode.js +29 -0
- package/dist/utils/permission-mode.js.map +1 -0
- package/dist/utils/permission-mode.test.d.ts +1 -0
- package/dist/utils/permission-mode.test.js +97 -0
- package/dist/utils/permission-mode.test.js.map +1 -0
- package/dist/utils/redactor.d.ts +57 -0
- package/dist/utils/redactor.js +179 -0
- package/dist/utils/redactor.js.map +1 -0
- package/dist/utils/redactor.test.d.ts +1 -0
- package/dist/utils/redactor.test.js +84 -0
- package/dist/utils/redactor.test.js.map +1 -0
- package/dist/utils/settings.d.ts +179 -0
- package/dist/utils/settings.js +579 -0
- package/dist/utils/settings.js.map +1 -0
- package/dist/utils/settings.test.d.ts +1 -0
- package/dist/utils/settings.test.js +160 -0
- package/dist/utils/settings.test.js.map +1 -0
- package/dist/utils/side-question.d.ts +10 -0
- package/dist/utils/side-question.js +24 -0
- package/dist/utils/side-question.js.map +1 -0
- package/dist/utils/skills.d.ts +20 -0
- package/dist/utils/skills.js +194 -0
- package/dist/utils/skills.js.map +1 -0
- package/dist/utils/skills.test.d.ts +1 -0
- package/dist/utils/skills.test.js +45 -0
- package/dist/utils/skills.test.js.map +1 -0
- package/dist/utils/subagent-display.d.ts +1 -0
- package/dist/utils/subagent-display.js +20 -0
- package/dist/utils/subagent-display.js.map +1 -0
- package/dist/utils/subagent-display.test.d.ts +1 -0
- package/dist/utils/subagent-display.test.js +21 -0
- package/dist/utils/subagent-display.test.js.map +1 -0
- package/dist/utils/subagents-settings.test.d.ts +1 -0
- package/dist/utils/subagents-settings.test.js +58 -0
- package/dist/utils/subagents-settings.test.js.map +1 -0
- package/dist/utils/telegram-audio-settings.test.d.ts +1 -0
- package/dist/utils/telegram-audio-settings.test.js +39 -0
- package/dist/utils/telegram-audio-settings.test.js.map +1 -0
- package/dist/utils/update-checker.d.ts +11 -0
- package/dist/utils/update-checker.js +22 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/dist/utils/update-checker.test.d.ts +1 -0
- package/dist/utils/update-checker.test.js +125 -0
- package/dist/utils/update-checker.test.js.map +1 -0
- package/dist/verify/checkpoint.d.ts +11 -0
- package/dist/verify/checkpoint.js +202 -0
- package/dist/verify/checkpoint.js.map +1 -0
- package/dist/verify/checkpoint.test.d.ts +1 -0
- package/dist/verify/checkpoint.test.js +160 -0
- package/dist/verify/checkpoint.test.js.map +1 -0
- package/dist/verify/entrypoint.d.ts +30 -0
- package/dist/verify/entrypoint.js +349 -0
- package/dist/verify/entrypoint.js.map +1 -0
- package/dist/verify/entrypoint.test.d.ts +1 -0
- package/dist/verify/entrypoint.test.js +233 -0
- package/dist/verify/entrypoint.test.js.map +1 -0
- package/dist/verify/environment.d.ts +9 -0
- package/dist/verify/environment.js +116 -0
- package/dist/verify/environment.js.map +1 -0
- package/dist/verify/environment.test.d.ts +1 -0
- package/dist/verify/environment.test.js +94 -0
- package/dist/verify/environment.test.js.map +1 -0
- package/dist/verify/evidence.d.ts +10 -0
- package/dist/verify/evidence.js +94 -0
- package/dist/verify/evidence.js.map +1 -0
- package/dist/verify/orchestrator.d.ts +25 -0
- package/dist/verify/orchestrator.js +87 -0
- package/dist/verify/orchestrator.js.map +1 -0
- package/dist/verify/orchestrator.test.d.ts +1 -0
- package/dist/verify/orchestrator.test.js +126 -0
- package/dist/verify/orchestrator.test.js.map +1 -0
- package/dist/verify/recipes.d.ts +20 -0
- package/dist/verify/recipes.js +451 -0
- package/dist/verify/recipes.js.map +1 -0
- package/dist/verify/retry.d.ts +4 -0
- package/dist/verify/retry.js +50 -0
- package/dist/verify/retry.js.map +1 -0
- package/dist/verify/runtime-prep.test.d.ts +1 -0
- package/dist/verify/runtime-prep.test.js +38 -0
- package/dist/verify/runtime-prep.test.js.map +1 -0
- package/package.json +93 -0
- package/src/__test-stubs__/ee-server.ts +173 -0
- package/src/billing/index.ts +5 -0
- package/src/bun-sqlite.d.ts +15 -0
- package/src/cloud/index.ts +5 -0
- package/src/daemon/scheduler.test.ts +128 -0
- package/src/daemon/scheduler.ts +152 -0
- package/src/ee/.gitkeep +0 -0
- package/src/ee/__tests__/pipeline.integration.test.ts +193 -0
- package/src/ee/auth.test.ts +76 -0
- package/src/ee/auth.ts +59 -0
- package/src/ee/bridge.test.ts +290 -0
- package/src/ee/bridge.ts +254 -0
- package/src/ee/client.test.ts +171 -0
- package/src/ee/client.ts +512 -0
- package/src/ee/embedding-cache.ts +42 -0
- package/src/ee/extract-session.test.ts +236 -0
- package/src/ee/extract-session.ts +69 -0
- package/src/ee/health.ts +83 -0
- package/src/ee/index.ts +32 -0
- package/src/ee/intercept.test.ts +191 -0
- package/src/ee/intercept.ts +132 -0
- package/src/ee/judge.test.ts +157 -0
- package/src/ee/judge.ts +68 -0
- package/src/ee/offline-queue.test.ts +351 -0
- package/src/ee/offline-queue.ts +212 -0
- package/src/ee/posttool.test.ts +81 -0
- package/src/ee/posttool.ts +16 -0
- package/src/ee/prompt-stale.test.ts +87 -0
- package/src/ee/prompt-stale.ts +39 -0
- package/src/ee/render.test.ts +71 -0
- package/src/ee/render.ts +47 -0
- package/src/ee/scope.test.ts +112 -0
- package/src/ee/scope.ts +93 -0
- package/src/ee/tenant.ts +14 -0
- package/src/ee/touch.test.ts +71 -0
- package/src/ee/types.ts +322 -0
- package/src/flow/.gitkeep +0 -0
- package/src/flow/__tests__/migration.test.ts +133 -0
- package/src/flow/__tests__/parser.test.ts +77 -0
- package/src/flow/__tests__/run-manager.test.ts +95 -0
- package/src/flow/__tests__/scaffold.test.ts +57 -0
- package/src/flow/__tests__/warning-persist.test.ts +112 -0
- package/src/flow/artifact-io.ts +41 -0
- package/src/flow/compaction/__tests__/compress.test.ts +69 -0
- package/src/flow/compaction/__tests__/extract.test.ts +74 -0
- package/src/flow/compaction/__tests__/preserve.test.ts +69 -0
- package/src/flow/compaction/compress.ts +67 -0
- package/src/flow/compaction/extract.ts +60 -0
- package/src/flow/compaction/index.ts +86 -0
- package/src/flow/compaction/preserve.ts +48 -0
- package/src/flow/index.ts +18 -0
- package/src/flow/migration.ts +139 -0
- package/src/flow/parser.ts +78 -0
- package/src/flow/run-manager.ts +129 -0
- package/src/flow/scaffold.ts +52 -0
- package/src/flow/warning-persist.ts +84 -0
- package/src/gsd/.gitkeep +0 -0
- package/src/gsd/__tests__/types.test.ts +77 -0
- package/src/gsd/index.ts +1 -0
- package/src/gsd/types.ts +47 -0
- package/src/headless/output.test.ts +201 -0
- package/src/headless/output.ts +312 -0
- package/src/hooks/config.ts +41 -0
- package/src/hooks/index.ts +250 -0
- package/src/hooks/types.ts +221 -0
- package/src/index.ts +655 -0
- package/src/lsp/builtins.test.ts +104 -0
- package/src/lsp/builtins.ts +409 -0
- package/src/lsp/client.ts +342 -0
- package/src/lsp/manager.test.ts +164 -0
- package/src/lsp/manager.ts +293 -0
- package/src/lsp/npm-cache.test.ts +68 -0
- package/src/lsp/npm-cache.ts +108 -0
- package/src/lsp/runtime.ts +70 -0
- package/src/lsp/smoke.test.ts +72 -0
- package/src/lsp/types.ts +116 -0
- package/src/mcp/auto-setup.ts +80 -0
- package/src/mcp/catalog.ts +138 -0
- package/src/mcp/oauth-callback.ts +63 -0
- package/src/mcp/oauth-provider.ts +130 -0
- package/src/mcp/parse-headers.test.ts +54 -0
- package/src/mcp/parse-headers.ts +35 -0
- package/src/mcp/runtime.ts +113 -0
- package/src/mcp/smoke.test.ts +170 -0
- package/src/mcp/validate.ts +48 -0
- package/src/models/__tests__/registry.test.ts +95 -0
- package/src/models/catalog-client.ts +83 -0
- package/src/models/catalog.json +314 -0
- package/src/models/classify-tier.ts +37 -0
- package/src/models/index.ts +9 -0
- package/src/models/registry.ts +73 -0
- package/src/ops/bug-report.test.ts +172 -0
- package/src/ops/bug-report.ts +80 -0
- package/src/ops/doctor.test.ts +107 -0
- package/src/ops/doctor.ts +172 -0
- package/src/orchestrator/__tests__/flow-resume.test.ts +71 -0
- package/src/orchestrator/__tests__/route-feedback.test.ts +55 -0
- package/src/orchestrator/abort.test.ts +37 -0
- package/src/orchestrator/abort.ts +51 -0
- package/src/orchestrator/agent.test.ts +138 -0
- package/src/orchestrator/cleanup.test.ts +88 -0
- package/src/orchestrator/compaction.test.ts +134 -0
- package/src/orchestrator/compaction.ts +487 -0
- package/src/orchestrator/delegations.test.ts +145 -0
- package/src/orchestrator/delegations.ts +364 -0
- package/src/orchestrator/flow-resume.ts +55 -0
- package/src/orchestrator/orchestrator.ts +3965 -0
- package/src/orchestrator/pending-calls.test.ts +226 -0
- package/src/orchestrator/pending-calls.ts +240 -0
- package/src/orchestrator/reasoning.test.ts +29 -0
- package/src/orchestrator/reasoning.ts +64 -0
- package/src/orchestrator/sandbox.test.ts +115 -0
- package/src/pil/__tests__/budget.test.ts +39 -0
- package/src/pil/__tests__/layer1-intent.test.ts +243 -0
- package/src/pil/__tests__/layer2-personality.test.ts +63 -0
- package/src/pil/__tests__/layer3-ee-injection.test.ts +117 -0
- package/src/pil/__tests__/layer4-gsd.test.ts +76 -0
- package/src/pil/__tests__/layer5-context.test.ts +116 -0
- package/src/pil/__tests__/layer6-output.test.ts +139 -0
- package/src/pil/__tests__/ollama-classify.test.ts +81 -0
- package/src/pil/__tests__/orchestrator-integration.test.ts +107 -0
- package/src/pil/__tests__/pipeline.test.ts +173 -0
- package/src/pil/__tests__/response-tools.test.ts +165 -0
- package/src/pil/__tests__/schema.test.ts +128 -0
- package/src/pil/__tests__/store.test.ts +49 -0
- package/src/pil/__tests__/task-tier-map.test.ts +41 -0
- package/src/pil/budget.ts +18 -0
- package/src/pil/index.ts +12 -0
- package/src/pil/layer1-intent.ts +155 -0
- package/src/pil/layer2-personality.ts +37 -0
- package/src/pil/layer3-ee-injection.ts +79 -0
- package/src/pil/layer4-gsd.ts +77 -0
- package/src/pil/layer5-context.ts +125 -0
- package/src/pil/layer6-output.ts +113 -0
- package/src/pil/ollama-classify.ts +49 -0
- package/src/pil/pipeline.ts +112 -0
- package/src/pil/response-tools.ts +110 -0
- package/src/pil/schema.ts +49 -0
- package/src/pil/store.ts +29 -0
- package/src/pil/task-tier-map.ts +90 -0
- package/src/pil/timeout.ts +10 -0
- package/src/pil/types.ts +42 -0
- package/src/providers/.gitkeep +0 -0
- package/src/providers/__test-utils__/load-fixture.ts +36 -0
- package/src/providers/__tests__/runtime-integration.test.ts +80 -0
- package/src/providers/__tests__/runtime.test.ts +86 -0
- package/src/providers/adapter.test.ts +21 -0
- package/src/providers/adapter.ts +48 -0
- package/src/providers/anthropic.ts +169 -0
- package/src/providers/errors.test.ts +76 -0
- package/src/providers/errors.ts +46 -0
- package/src/providers/gemini.test.ts +46 -0
- package/src/providers/gemini.ts +37 -0
- package/src/providers/index.ts +32 -0
- package/src/providers/keychain.test.ts +95 -0
- package/src/providers/keychain.ts +133 -0
- package/src/providers/ollama.test.ts +46 -0
- package/src/providers/ollama.ts +36 -0
- package/src/providers/openai-compatible.test.ts +63 -0
- package/src/providers/openai-compatible.ts +50 -0
- package/src/providers/openai.test.ts +65 -0
- package/src/providers/openai.ts +37 -0
- package/src/providers/patch-zod-schema.ts +129 -0
- package/src/providers/pricing.test.ts +56 -0
- package/src/providers/pricing.ts +55 -0
- package/src/providers/runtime.ts +111 -0
- package/src/providers/stream-loop.ts +69 -0
- package/src/providers/types.ts +111 -0
- package/src/providers/vision-proxy.test.ts +167 -0
- package/src/providers/vision-proxy.ts +209 -0
- package/src/router/.gitkeep +0 -0
- package/src/router/classifier/grammars.ts +17 -0
- package/src/router/classifier/index.test.ts +33 -0
- package/src/router/classifier/index.ts +21 -0
- package/src/router/classifier/regex.test.ts +47 -0
- package/src/router/classifier/regex.ts +54 -0
- package/src/router/classifier/tree-sitter.test.ts +26 -0
- package/src/router/classifier/tree-sitter.ts +87 -0
- package/src/router/cold.test.ts +62 -0
- package/src/router/cold.ts +27 -0
- package/src/router/decide.test.ts +135 -0
- package/src/router/decide.ts +354 -0
- package/src/router/health.test.ts +59 -0
- package/src/router/health.ts +49 -0
- package/src/router/store.ts +47 -0
- package/src/router/types.ts +20 -0
- package/src/router/warm.test.ts +167 -0
- package/src/router/warm.ts +47 -0
- package/src/storage/__tests__/migrations.test.ts +395 -0
- package/src/storage/atomic-io.test.ts +61 -0
- package/src/storage/atomic-io.ts +62 -0
- package/src/storage/config.test.ts +33 -0
- package/src/storage/config.ts +49 -0
- package/src/storage/db.ts +95 -0
- package/src/storage/index.ts +19 -0
- package/src/storage/migrations.ts +143 -0
- package/src/storage/session-dir.ts +37 -0
- package/src/storage/sessions.ts +178 -0
- package/src/storage/tool-results.ts +56 -0
- package/src/storage/transcript-view.ts +45 -0
- package/src/storage/transcript.test.ts +24 -0
- package/src/storage/transcript.ts +358 -0
- package/src/storage/usage-cap.test.ts +59 -0
- package/src/storage/usage-cap.ts +81 -0
- package/src/storage/usage.ts +115 -0
- package/src/storage/workspaces.ts +84 -0
- package/src/tools/bash.test.ts +336 -0
- package/src/tools/bash.ts +612 -0
- package/src/tools/computer.test.ts +187 -0
- package/src/tools/computer.ts +632 -0
- package/src/tools/file.test.ts +95 -0
- package/src/tools/file.ts +128 -0
- package/src/tools/grep.ts +187 -0
- package/src/tools/registry.ts +282 -0
- package/src/tools/schedule.test.ts +143 -0
- package/src/tools/schedule.ts +610 -0
- package/src/types/index.ts +311 -0
- package/src/ui/agents-modal.tsx +272 -0
- package/src/ui/app.tsx +6277 -0
- package/src/ui/components/SuggestionOverlay.tsx +38 -0
- package/src/ui/components/btw-overlay.tsx +66 -0
- package/src/ui/hooks/useTypeahead.ts +146 -0
- package/src/ui/markdown.tsx +49 -0
- package/src/ui/mcp-modal-types.ts +33 -0
- package/src/ui/mcp-modal.tsx +456 -0
- package/src/ui/plan.tsx +346 -0
- package/src/ui/schedule-modal.tsx +126 -0
- package/src/ui/slash/__tests__/clear.test.ts +86 -0
- package/src/ui/slash/__tests__/compact.test.ts +56 -0
- package/src/ui/slash/__tests__/cost.test.ts +62 -0
- package/src/ui/slash/__tests__/discuss.test.ts +101 -0
- package/src/ui/slash/__tests__/execute.test.ts +86 -0
- package/src/ui/slash/__tests__/expand.test.ts +86 -0
- package/src/ui/slash/__tests__/optimize.test.ts +155 -0
- package/src/ui/slash/__tests__/plan.test.ts +95 -0
- package/src/ui/slash/clear.ts +89 -0
- package/src/ui/slash/compact.ts +46 -0
- package/src/ui/slash/cost.ts +59 -0
- package/src/ui/slash/council.ts +27 -0
- package/src/ui/slash/debug.ts +153 -0
- package/src/ui/slash/discuss.ts +71 -0
- package/src/ui/slash/ee.ts +271 -0
- package/src/ui/slash/execute.ts +44 -0
- package/src/ui/slash/expand.ts +51 -0
- package/src/ui/slash/optimize.ts +47 -0
- package/src/ui/slash/plan.ts +62 -0
- package/src/ui/slash/registry.ts +38 -0
- package/src/ui/slash/route.test.ts +82 -0
- package/src/ui/slash/route.ts +43 -0
- package/src/ui/status-bar/index.test.tsx +90 -0
- package/src/ui/status-bar/index.tsx +94 -0
- package/src/ui/status-bar/store.test.ts +131 -0
- package/src/ui/status-bar/store.ts +166 -0
- package/src/ui/status-bar/tier-badge.test.tsx +38 -0
- package/src/ui/status-bar/tier-badge.tsx +29 -0
- package/src/ui/status-bar/usd-meter.test.tsx +37 -0
- package/src/ui/status-bar/usd-meter.tsx +22 -0
- package/src/ui/terminal-selection-text.ts +72 -0
- package/src/ui/theme.ts +54 -0
- package/src/usage/.gitkeep +0 -0
- package/src/usage/downgrade.test.ts +82 -0
- package/src/usage/downgrade.ts +70 -0
- package/src/usage/estimator.test.ts +43 -0
- package/src/usage/estimator.ts +34 -0
- package/src/usage/ledger.test.ts +200 -0
- package/src/usage/ledger.ts +213 -0
- package/src/usage/midstream.test.ts +55 -0
- package/src/usage/midstream.ts +51 -0
- package/src/usage/thresholds.test.ts +83 -0
- package/src/usage/thresholds.ts +74 -0
- package/src/usage/types.ts +40 -0
- package/src/utils/at-mentions.ts +120 -0
- package/src/utils/clipboard-image.ts +114 -0
- package/src/utils/file-index.ts +152 -0
- package/src/utils/git-root.ts +17 -0
- package/src/utils/host-clipboard.ts +30 -0
- package/src/utils/install-manager.test.ts +167 -0
- package/src/utils/install-manager.ts +429 -0
- package/src/utils/instructions.test.ts +84 -0
- package/src/utils/instructions.ts +116 -0
- package/src/utils/permission-mode.test.ts +121 -0
- package/src/utils/permission-mode.ts +37 -0
- package/src/utils/redactor.test.ts +100 -0
- package/src/utils/redactor.ts +223 -0
- package/src/utils/settings.test.ts +181 -0
- package/src/utils/settings.ts +787 -0
- package/src/utils/side-question.ts +39 -0
- package/src/utils/skills.test.ts +58 -0
- package/src/utils/skills.ts +207 -0
- package/src/utils/subagent-display.test.ts +23 -0
- package/src/utils/subagent-display.ts +11 -0
- package/src/utils/subagents-settings.test.ts +77 -0
- package/src/utils/telegram-audio-settings.test.ts +44 -0
- package/src/utils/update-checker.test.ts +182 -0
- package/src/utils/update-checker.ts +33 -0
- package/src/verify/checkpoint.test.ts +186 -0
- package/src/verify/checkpoint.ts +239 -0
- package/src/verify/entrypoint.test.ts +293 -0
- package/src/verify/entrypoint.ts +439 -0
- package/src/verify/environment.test.ts +119 -0
- package/src/verify/environment.ts +115 -0
- package/src/verify/evidence.ts +104 -0
- package/src/verify/orchestrator.test.ts +159 -0
- package/src/verify/orchestrator.ts +129 -0
- package/src/verify/recipes.ts +516 -0
- package/src/verify/retry.ts +62 -0
- package/src/verify/runtime-prep.test.ts +47 -0
package/src/ui/plan.tsx
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import type { Plan, PlanQuestion } from "../types/index";
|
|
2
|
+
import type { Theme } from "./theme";
|
|
3
|
+
|
|
4
|
+
export type PlanAnswers = Record<string, string | string[]>;
|
|
5
|
+
|
|
6
|
+
/* ── Plan Steps (inline in chat) ───────────────────────────── */
|
|
7
|
+
|
|
8
|
+
interface PlanViewProps {
|
|
9
|
+
plan: Plan;
|
|
10
|
+
t: Theme;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function PlanView({ plan, t }: PlanViewProps) {
|
|
14
|
+
return (
|
|
15
|
+
<box paddingLeft={3} marginTop={1} flexShrink={0} flexDirection="column">
|
|
16
|
+
<box marginBottom={1}>
|
|
17
|
+
<text>
|
|
18
|
+
<span style={{ fg: t.planTitle }}>
|
|
19
|
+
<b>
|
|
20
|
+
{"◆ "}
|
|
21
|
+
{plan.title}
|
|
22
|
+
</b>
|
|
23
|
+
</span>
|
|
24
|
+
</text>
|
|
25
|
+
</box>
|
|
26
|
+
<box paddingLeft={2} marginBottom={1}>
|
|
27
|
+
<text fg={t.textMuted}>{plan.summary}</text>
|
|
28
|
+
</box>
|
|
29
|
+
{plan.steps.map((step, i) => (
|
|
30
|
+
<box key={`step-${step.title}`} paddingLeft={2} marginBottom={0} flexDirection="column">
|
|
31
|
+
<text>
|
|
32
|
+
<span style={{ fg: t.planStepNum }}>{`${i + 1}. `}</span>
|
|
33
|
+
<span style={{ fg: t.planStepTitle }}>
|
|
34
|
+
<b>{step.title}</b>
|
|
35
|
+
</span>
|
|
36
|
+
</text>
|
|
37
|
+
<box paddingLeft={3}>
|
|
38
|
+
<text fg={t.planStepDesc}>{step.description}</text>
|
|
39
|
+
</box>
|
|
40
|
+
{step.filePaths && step.filePaths.length > 0 && (
|
|
41
|
+
<box paddingLeft={3}>
|
|
42
|
+
<text>
|
|
43
|
+
{step.filePaths.map((fp, j) => (
|
|
44
|
+
<span key={fp} style={{ fg: t.planStepFile }}>
|
|
45
|
+
{j > 0 ? ", " : ""}
|
|
46
|
+
{fp}
|
|
47
|
+
</span>
|
|
48
|
+
))}
|
|
49
|
+
</text>
|
|
50
|
+
</box>
|
|
51
|
+
)}
|
|
52
|
+
</box>
|
|
53
|
+
))}
|
|
54
|
+
</box>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ── Plan Questions Panel (OpenCode-style tabbed inline) ──── */
|
|
59
|
+
|
|
60
|
+
const SPLIT = {
|
|
61
|
+
topLeft: "",
|
|
62
|
+
bottomLeft: "",
|
|
63
|
+
vertical: "┃",
|
|
64
|
+
topRight: "",
|
|
65
|
+
bottomRight: "",
|
|
66
|
+
horizontal: " ",
|
|
67
|
+
bottomT: "",
|
|
68
|
+
topT: "",
|
|
69
|
+
cross: "",
|
|
70
|
+
leftT: "",
|
|
71
|
+
rightT: "",
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export interface PlanQuestionsState {
|
|
75
|
+
tab: number;
|
|
76
|
+
selected: number;
|
|
77
|
+
answers: PlanAnswers;
|
|
78
|
+
customInputs: Record<string, string>;
|
|
79
|
+
editing: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function initialPlanQuestionsState(): PlanQuestionsState {
|
|
83
|
+
return {
|
|
84
|
+
tab: 0,
|
|
85
|
+
selected: 0,
|
|
86
|
+
answers: {},
|
|
87
|
+
customInputs: {},
|
|
88
|
+
editing: false,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface PlanQuestionsPanelProps {
|
|
93
|
+
t: Theme;
|
|
94
|
+
questions: PlanQuestion[];
|
|
95
|
+
state: PlanQuestionsState;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function PlanQuestionsPanel({ t, questions, state }: PlanQuestionsPanelProps) {
|
|
99
|
+
const isSingle = questions.length === 1 && questions[0]?.type !== "multiselect";
|
|
100
|
+
const isConfirmTab = !isSingle && state.tab === questions.length;
|
|
101
|
+
const q = questions[state.tab];
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<box
|
|
105
|
+
flexDirection="column"
|
|
106
|
+
border={["left"]}
|
|
107
|
+
customBorderChars={SPLIT}
|
|
108
|
+
borderColor={t.planBorder}
|
|
109
|
+
marginTop={1}
|
|
110
|
+
paddingLeft={2}
|
|
111
|
+
paddingRight={2}
|
|
112
|
+
paddingTop={1}
|
|
113
|
+
paddingBottom={1}
|
|
114
|
+
backgroundColor={t.backgroundPanel}
|
|
115
|
+
>
|
|
116
|
+
{/* Tabs */}
|
|
117
|
+
{!isSingle && (
|
|
118
|
+
<box flexDirection="row" gap={2} marginBottom={1} flexShrink={0}>
|
|
119
|
+
{questions.map((q, i) => {
|
|
120
|
+
const isActive = i === state.tab;
|
|
121
|
+
const isAnswered = hasAnswer(state.answers, q);
|
|
122
|
+
const label = tabLabel(q);
|
|
123
|
+
return (
|
|
124
|
+
<text key={q.id}>
|
|
125
|
+
<span
|
|
126
|
+
style={{
|
|
127
|
+
fg: isActive ? t.planTitle : isAnswered ? t.planOptionCheck : t.textMuted,
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{isActive ? <b>{label}</b> : label}
|
|
131
|
+
{isAnswered && !isActive ? " ✓" : ""}
|
|
132
|
+
</span>
|
|
133
|
+
</text>
|
|
134
|
+
);
|
|
135
|
+
})}
|
|
136
|
+
<text>
|
|
137
|
+
<span
|
|
138
|
+
style={{
|
|
139
|
+
fg: isConfirmTab ? t.planTitle : t.textMuted,
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{isConfirmTab ? <b>{"Confirm"}</b> : "Confirm"}
|
|
143
|
+
</span>
|
|
144
|
+
</text>
|
|
145
|
+
</box>
|
|
146
|
+
)}
|
|
147
|
+
|
|
148
|
+
{/* Question body */}
|
|
149
|
+
{isConfirmTab ? (
|
|
150
|
+
<ConfirmView t={t} questions={questions} answers={state.answers} />
|
|
151
|
+
) : q ? (
|
|
152
|
+
<QuestionBody t={t} question={q} state={state} />
|
|
153
|
+
) : null}
|
|
154
|
+
|
|
155
|
+
{/* Footer hints */}
|
|
156
|
+
<box flexDirection="row" gap={3} marginTop={1} flexShrink={0}>
|
|
157
|
+
{!isSingle && (
|
|
158
|
+
<text>
|
|
159
|
+
<span style={{ fg: t.text }}>{"⇆"}</span>
|
|
160
|
+
<span style={{ fg: t.planHint }}>{" tab"}</span>
|
|
161
|
+
</text>
|
|
162
|
+
)}
|
|
163
|
+
<text>
|
|
164
|
+
<span style={{ fg: t.text }}>{"↑↓"}</span>
|
|
165
|
+
<span style={{ fg: t.planHint }}>{" select"}</span>
|
|
166
|
+
</text>
|
|
167
|
+
<text>
|
|
168
|
+
<span style={{ fg: t.text }}>{"enter"}</span>
|
|
169
|
+
<span style={{ fg: t.planHint }}>
|
|
170
|
+
{isConfirmTab ? " submit" : q?.type === "multiselect" ? " toggle" : isSingle ? " submit" : " confirm"}
|
|
171
|
+
</span>
|
|
172
|
+
</text>
|
|
173
|
+
<text>
|
|
174
|
+
<span style={{ fg: t.text }}>{"esc"}</span>
|
|
175
|
+
<span style={{ fg: t.planHint }}>{" dismiss"}</span>
|
|
176
|
+
</text>
|
|
177
|
+
</box>
|
|
178
|
+
</box>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ── Question Body ────────────────────────────────────────── */
|
|
183
|
+
|
|
184
|
+
function QuestionBody({ t, question: q, state }: { t: Theme; question: PlanQuestion; state: PlanQuestionsState }) {
|
|
185
|
+
const isMulti = q.type === "multiselect";
|
|
186
|
+
const options = q.options ?? [];
|
|
187
|
+
const showCustom = q.type !== "text";
|
|
188
|
+
const totalItems = options.length + (showCustom ? 1 : 0);
|
|
189
|
+
const isOnCustom = showCustom && state.selected === options.length;
|
|
190
|
+
const customText = state.customInputs[q.id] ?? "";
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<box flexDirection="column">
|
|
194
|
+
{/* Question text */}
|
|
195
|
+
<box marginBottom={1}>
|
|
196
|
+
<text fg={t.planQuestionText}>
|
|
197
|
+
<b>{q.question}</b>
|
|
198
|
+
{isMulti ? <span style={{ fg: t.textMuted }}>{" (select all that apply)"}</span> : null}
|
|
199
|
+
</text>
|
|
200
|
+
</box>
|
|
201
|
+
|
|
202
|
+
{q.type === "text" ? (
|
|
203
|
+
/* Free-form text input */
|
|
204
|
+
<box backgroundColor={t.planInputBg} paddingLeft={1} paddingRight={1}>
|
|
205
|
+
<text fg={t.planInputText}>
|
|
206
|
+
{state.editing || customText ? (
|
|
207
|
+
customText + (state.editing ? "▌" : "")
|
|
208
|
+
) : (
|
|
209
|
+
<span style={{ fg: t.textMuted }}>{"Type your answer..."}</span>
|
|
210
|
+
)}
|
|
211
|
+
</text>
|
|
212
|
+
</box>
|
|
213
|
+
) : (
|
|
214
|
+
/* Options list */
|
|
215
|
+
<box flexDirection="column">
|
|
216
|
+
{options.map((opt, i) => {
|
|
217
|
+
const isFocused = i === state.selected;
|
|
218
|
+
const isPicked = isOptionPicked(state.answers, q, opt.id);
|
|
219
|
+
return (
|
|
220
|
+
<box
|
|
221
|
+
key={opt.id}
|
|
222
|
+
backgroundColor={isFocused ? t.selectedBg : undefined}
|
|
223
|
+
paddingLeft={1}
|
|
224
|
+
flexDirection="row"
|
|
225
|
+
>
|
|
226
|
+
<text>
|
|
227
|
+
<span style={{ fg: t.textMuted }}>{`${i + 1}. `}</span>
|
|
228
|
+
<span
|
|
229
|
+
style={{
|
|
230
|
+
fg: isFocused ? t.selected : isPicked ? t.planOptionCheck : t.text,
|
|
231
|
+
}}
|
|
232
|
+
>
|
|
233
|
+
{isMulti ? `[${isPicked ? "✓" : " "}] ${opt.label}` : opt.label}
|
|
234
|
+
</span>
|
|
235
|
+
{isPicked && !isMulti ? <span style={{ fg: t.planOptionCheck }}>{" ✓"}</span> : null}
|
|
236
|
+
</text>
|
|
237
|
+
</box>
|
|
238
|
+
);
|
|
239
|
+
})}
|
|
240
|
+
|
|
241
|
+
{/* "Type your own answer" option */}
|
|
242
|
+
{showCustom && (
|
|
243
|
+
<box backgroundColor={isOnCustom ? t.selectedBg : undefined} paddingLeft={1}>
|
|
244
|
+
{state.editing && isOnCustom ? (
|
|
245
|
+
<box backgroundColor={t.planInputBg} paddingLeft={1} paddingRight={1} flexGrow={1}>
|
|
246
|
+
<text fg={t.planInputText}>{`${customText}▌`}</text>
|
|
247
|
+
</box>
|
|
248
|
+
) : (
|
|
249
|
+
<text>
|
|
250
|
+
<span style={{ fg: t.textMuted }}>{`${totalItems}. `}</span>
|
|
251
|
+
<span
|
|
252
|
+
style={{
|
|
253
|
+
fg: isOnCustom ? t.planOptionSelected : t.textMuted,
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
{isMulti
|
|
257
|
+
? `[${customText && isOptionPicked(state.answers, q, customText) ? "✓" : " "}] Type your own answer`
|
|
258
|
+
: "Type your own answer"}
|
|
259
|
+
</span>
|
|
260
|
+
{customText ? <span style={{ fg: t.textDim }}>{` (${customText})`}</span> : null}
|
|
261
|
+
</text>
|
|
262
|
+
)}
|
|
263
|
+
</box>
|
|
264
|
+
)}
|
|
265
|
+
</box>
|
|
266
|
+
)}
|
|
267
|
+
</box>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/* ── Confirm/Review Tab ───────────────────────────────────── */
|
|
272
|
+
|
|
273
|
+
function ConfirmView({ t, questions, answers }: { t: Theme; questions: PlanQuestion[]; answers: PlanAnswers }) {
|
|
274
|
+
return (
|
|
275
|
+
<box flexDirection="column">
|
|
276
|
+
<box marginBottom={1}>
|
|
277
|
+
<text fg={t.planQuestionText}>
|
|
278
|
+
<b>{"Review"}</b>
|
|
279
|
+
</text>
|
|
280
|
+
</box>
|
|
281
|
+
{questions.map((q) => {
|
|
282
|
+
const val = formatAnswer(q, answers);
|
|
283
|
+
const answered = val !== "(not answered)";
|
|
284
|
+
return (
|
|
285
|
+
<box key={q.id} paddingLeft={1}>
|
|
286
|
+
<text>
|
|
287
|
+
<span style={{ fg: t.text }}>
|
|
288
|
+
<b>{tabLabel(q)}:</b>
|
|
289
|
+
</span>
|
|
290
|
+
<span style={{ fg: answered ? t.planOptionCheck : t.textMuted }}> {val}</span>
|
|
291
|
+
</text>
|
|
292
|
+
</box>
|
|
293
|
+
);
|
|
294
|
+
})}
|
|
295
|
+
</box>
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* ── Helpers ───────────────────────────────────────────────── */
|
|
300
|
+
|
|
301
|
+
function tabLabel(q: PlanQuestion): string {
|
|
302
|
+
if (q.header) return q.header;
|
|
303
|
+
const words = q.question.replace(/[?.,!:]+$/, "").split(/\s+/);
|
|
304
|
+
const key = words.find(
|
|
305
|
+
(w) => w.length > 2 && !/^(what|how|should|which|does|the|and|for|are|can|will|you|this|that|with|from)$/i.test(w),
|
|
306
|
+
);
|
|
307
|
+
return key ?? words[0] ?? "Question";
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function hasAnswer(answers: PlanAnswers, q: PlanQuestion): boolean {
|
|
311
|
+
const a = answers[q.id];
|
|
312
|
+
if (!a) return false;
|
|
313
|
+
if (Array.isArray(a)) return a.length > 0;
|
|
314
|
+
return a.trim().length > 0;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function isOptionPicked(answers: PlanAnswers, q: PlanQuestion, optionId: string): boolean {
|
|
318
|
+
const a = answers[q.id];
|
|
319
|
+
if (!a) return false;
|
|
320
|
+
if (Array.isArray(a)) return a.includes(optionId);
|
|
321
|
+
return a === optionId;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function formatAnswer(q: PlanQuestion, answers: PlanAnswers): string {
|
|
325
|
+
const a = answers[q.id];
|
|
326
|
+
if (!a) return "(not answered)";
|
|
327
|
+
if (q.type === "text") return (a as string) || "(not answered)";
|
|
328
|
+
if (q.type === "select") {
|
|
329
|
+
const opt = q.options?.find((o) => o.id === a);
|
|
330
|
+
return (opt?.label ?? (a as string)) || "(not answered)";
|
|
331
|
+
}
|
|
332
|
+
const arr = a as string[];
|
|
333
|
+
if (arr.length === 0) return "(not answered)";
|
|
334
|
+
return arr.map((id) => q.options?.find((o) => o.id === id)?.label ?? id).join(", ");
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export function formatPlanAnswers(questions: PlanQuestion[], answers: PlanAnswers): string {
|
|
338
|
+
const parts: string[] = ["Here are my answers to the plan questions:\n"];
|
|
339
|
+
|
|
340
|
+
for (const q of questions) {
|
|
341
|
+
const val = formatAnswer(q, answers);
|
|
342
|
+
parts.push(`- ${q.question}: ${val}`);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return parts.join("\n");
|
|
346
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { ScrollBoxRenderable } from "@opentui/core";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import type { StoredSchedule } from "../tools/schedule";
|
|
4
|
+
import type { Theme } from "./theme";
|
|
5
|
+
|
|
6
|
+
export type ScheduleBrowseRow = { kind: "schedule"; schedule: StoredSchedule };
|
|
7
|
+
|
|
8
|
+
export function buildScheduleBrowseRows(schedules: StoredSchedule[], query: string): ScheduleBrowseRow[] {
|
|
9
|
+
const q = query.trim().toLowerCase();
|
|
10
|
+
const filtered = q
|
|
11
|
+
? schedules.filter(
|
|
12
|
+
(schedule) =>
|
|
13
|
+
schedule.name.toLowerCase().includes(q) ||
|
|
14
|
+
schedule.id.toLowerCase().includes(q) ||
|
|
15
|
+
schedule.instruction.toLowerCase().includes(q) ||
|
|
16
|
+
(schedule.cron ?? "").toLowerCase().includes(q),
|
|
17
|
+
)
|
|
18
|
+
: schedules;
|
|
19
|
+
|
|
20
|
+
return filtered.map((schedule) => ({ kind: "schedule" as const, schedule }));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function bottomAlignedModalTop(height: number, panelHeight: number): number {
|
|
24
|
+
return Math.max(2, Math.floor((height - panelHeight) / 2));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function ScheduleBrowserModal({
|
|
28
|
+
t,
|
|
29
|
+
width,
|
|
30
|
+
height,
|
|
31
|
+
selectedIndex,
|
|
32
|
+
searchQuery,
|
|
33
|
+
rows,
|
|
34
|
+
}: {
|
|
35
|
+
t: Theme;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
selectedIndex: number;
|
|
39
|
+
searchQuery: string;
|
|
40
|
+
rows: ScheduleBrowseRow[];
|
|
41
|
+
}) {
|
|
42
|
+
const listRef = useRef<ScrollBoxRenderable>(null);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const selected = rows[selectedIndex];
|
|
46
|
+
if (!selected) return;
|
|
47
|
+
listRef.current?.scrollChildIntoView(`schedule-${selected.schedule.id}`);
|
|
48
|
+
}, [rows, selectedIndex]);
|
|
49
|
+
|
|
50
|
+
const itemCount = Math.max(rows.length, 1);
|
|
51
|
+
const contentHeight = itemCount + 10;
|
|
52
|
+
const panelHeight = Math.min(contentHeight, Math.floor(height * 0.6));
|
|
53
|
+
const panelWidth = Math.min(60, width - 6);
|
|
54
|
+
const overlayBg = "#000000cc" as string;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<box
|
|
58
|
+
position="absolute"
|
|
59
|
+
left={0}
|
|
60
|
+
top={0}
|
|
61
|
+
width={width}
|
|
62
|
+
height={height}
|
|
63
|
+
alignItems="center"
|
|
64
|
+
paddingTop={bottomAlignedModalTop(height, panelHeight)}
|
|
65
|
+
backgroundColor={overlayBg}
|
|
66
|
+
>
|
|
67
|
+
<box
|
|
68
|
+
width={panelWidth}
|
|
69
|
+
height={panelHeight}
|
|
70
|
+
backgroundColor={t.backgroundPanel}
|
|
71
|
+
paddingTop={1}
|
|
72
|
+
paddingBottom={1}
|
|
73
|
+
flexDirection="column"
|
|
74
|
+
>
|
|
75
|
+
<box flexShrink={0} flexDirection="row" justifyContent="space-between" paddingLeft={2} paddingRight={2}>
|
|
76
|
+
<text fg={t.primary}>
|
|
77
|
+
<b>{"Schedules"}</b>
|
|
78
|
+
</text>
|
|
79
|
+
<text fg={t.textMuted}>{"esc"}</text>
|
|
80
|
+
</box>
|
|
81
|
+
<box flexShrink={0} paddingLeft={2} paddingRight={2} paddingTop={1} paddingBottom={1}>
|
|
82
|
+
<text fg={t.text}>
|
|
83
|
+
{searchQuery || <span style={{ fg: t.textMuted }}>{"Search by name, cron, instruction..."}</span>}
|
|
84
|
+
</text>
|
|
85
|
+
</box>
|
|
86
|
+
<scrollbox ref={listRef} flexGrow={1} minHeight={0}>
|
|
87
|
+
{rows.map((row, idx) => {
|
|
88
|
+
const selected = idx === selectedIndex;
|
|
89
|
+
const schedule = row.schedule;
|
|
90
|
+
const scheduleText = schedule.cron ?? "runs once immediately";
|
|
91
|
+
return (
|
|
92
|
+
<box
|
|
93
|
+
key={`schedule-${schedule.id}`}
|
|
94
|
+
id={`schedule-${schedule.id}`}
|
|
95
|
+
width="100%"
|
|
96
|
+
backgroundColor={selected ? t.selectedBg : undefined}
|
|
97
|
+
paddingLeft={2}
|
|
98
|
+
paddingRight={2}
|
|
99
|
+
>
|
|
100
|
+
<box width="100%" flexDirection="row">
|
|
101
|
+
<text fg={selected ? t.primary : t.text}>
|
|
102
|
+
<b>{schedule.name}</b>
|
|
103
|
+
</text>
|
|
104
|
+
<text fg={t.textMuted}>{` - ${scheduleText}`}</text>
|
|
105
|
+
</box>
|
|
106
|
+
</box>
|
|
107
|
+
);
|
|
108
|
+
})}
|
|
109
|
+
{rows.length === 0 ? (
|
|
110
|
+
<box paddingLeft={2} paddingRight={2}>
|
|
111
|
+
<text fg={t.textMuted}>{"No schedules yet"}</text>
|
|
112
|
+
</box>
|
|
113
|
+
) : null}
|
|
114
|
+
</scrollbox>
|
|
115
|
+
<box flexShrink={0} paddingLeft={2} paddingRight={2} paddingTop={2} paddingBottom={1}>
|
|
116
|
+
<text>
|
|
117
|
+
<span style={{ fg: t.primary }}>{"enter "}</span>
|
|
118
|
+
<span style={{ fg: t.textMuted }}>{"details · "}</span>
|
|
119
|
+
<span style={{ fg: t.primary }}>{"ctrl+x "}</span>
|
|
120
|
+
<span style={{ fg: t.textMuted }}>{"remove"}</span>
|
|
121
|
+
</text>
|
|
122
|
+
</box>
|
|
123
|
+
</box>
|
|
124
|
+
</box>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
+
import type { SlashContext } from "../registry.js";
|
|
6
|
+
|
|
7
|
+
// Import to trigger self-registration
|
|
8
|
+
import "../clear.js";
|
|
9
|
+
|
|
10
|
+
import { dispatchSlash } from "../registry.js";
|
|
11
|
+
|
|
12
|
+
let tmpDir: string;
|
|
13
|
+
|
|
14
|
+
const makeCtx = (cwd: string): SlashContext => ({
|
|
15
|
+
cwd,
|
|
16
|
+
tenantId: "local",
|
|
17
|
+
defaultProvider: "anthropic",
|
|
18
|
+
defaultModel: "claude-3-5-sonnet-latest",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe("handleClearSlash", () => {
|
|
22
|
+
beforeEach(async () => {
|
|
23
|
+
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "clear-test-"));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
afterEach(async () => {
|
|
27
|
+
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("returns helpful message with no active run", async () => {
|
|
31
|
+
const result = await dispatchSlash("clear", [], makeCtx(tmpDir));
|
|
32
|
+
expect(result).toBeTypeOf("string");
|
|
33
|
+
expect(result!.toLowerCase()).toMatch(/no active run/i);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("returns __CLEAR__ signal with relock summary when run exists", async () => {
|
|
37
|
+
const flowDir = path.join(tmpDir, ".muonroi-flow");
|
|
38
|
+
const runId = "test-run-01";
|
|
39
|
+
const runDir = path.join(flowDir, "runs", runId);
|
|
40
|
+
await fs.mkdir(runDir, { recursive: true });
|
|
41
|
+
|
|
42
|
+
// Set up state.md with active run
|
|
43
|
+
await fs.writeFile(path.join(flowDir, "state.md"), "## Active Run\n\ntest-run-01\n", "utf8");
|
|
44
|
+
|
|
45
|
+
// Set up run state.md with some content
|
|
46
|
+
await fs.writeFile(
|
|
47
|
+
path.join(runDir, "state.md"),
|
|
48
|
+
"## Resume Digest\n\nWorking on feature X\n\n## Experience Snapshot\n\nSome warnings\n",
|
|
49
|
+
"utf8",
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
// Set up decisions.md with some entries
|
|
53
|
+
await fs.writeFile(
|
|
54
|
+
path.join(flowDir, "decisions.md"),
|
|
55
|
+
"## Decisions\n\n- Use JWT\n- Use PostgreSQL\n\n## Facts\n\n- API limit 100/min\n",
|
|
56
|
+
"utf8",
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// Set up gray-areas.md
|
|
60
|
+
await fs.writeFile(
|
|
61
|
+
path.join(runDir, "gray-areas.md"),
|
|
62
|
+
"## Open\n\nG1: Should we use X?\n\n## Resolved\n\nG2: Used Y\n",
|
|
63
|
+
"utf8",
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const result = await dispatchSlash("clear", [], makeCtx(tmpDir));
|
|
67
|
+
expect(result).toBeTypeOf("string");
|
|
68
|
+
expect(result).toContain("__CLEAR__");
|
|
69
|
+
expect(result).toContain("Relocked from");
|
|
70
|
+
expect(result).toContain("test-run-01");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("includes decisions count in summary", async () => {
|
|
74
|
+
const flowDir = path.join(tmpDir, ".muonroi-flow");
|
|
75
|
+
const runId = "run-02";
|
|
76
|
+
const runDir = path.join(flowDir, "runs", runId);
|
|
77
|
+
await fs.mkdir(runDir, { recursive: true });
|
|
78
|
+
|
|
79
|
+
await fs.writeFile(path.join(flowDir, "state.md"), "## Active Run\n\nrun-02\n", "utf8");
|
|
80
|
+
await fs.writeFile(path.join(runDir, "state.md"), "## Resume Digest\n\nSome state\n", "utf8");
|
|
81
|
+
await fs.writeFile(path.join(flowDir, "decisions.md"), "## Decisions\n\n- D1\n- D2\n- D3\n", "utf8");
|
|
82
|
+
|
|
83
|
+
const result = await dispatchSlash("clear", [], makeCtx(tmpDir));
|
|
84
|
+
expect(result).toContain("Decisions:");
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
+
import type { SlashContext } from "../registry.js";
|
|
6
|
+
|
|
7
|
+
// Import to trigger self-registration
|
|
8
|
+
import "../compact.js";
|
|
9
|
+
|
|
10
|
+
import { dispatchSlash } from "../registry.js";
|
|
11
|
+
|
|
12
|
+
let tmpDir: string;
|
|
13
|
+
|
|
14
|
+
const makeCtx = (cwd: string): SlashContext => ({
|
|
15
|
+
cwd,
|
|
16
|
+
tenantId: "local",
|
|
17
|
+
defaultProvider: "anthropic",
|
|
18
|
+
defaultModel: "claude-3-5-sonnet-latest",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe("handleCompactSlash", () => {
|
|
22
|
+
beforeEach(async () => {
|
|
23
|
+
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "compact-test-"));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
afterEach(async () => {
|
|
27
|
+
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("returns helpful message with no active run", async () => {
|
|
31
|
+
// No .muonroi-flow/ directory at all
|
|
32
|
+
const result = await dispatchSlash("compact", [], makeCtx(tmpDir));
|
|
33
|
+
expect(result).toBeTypeOf("string");
|
|
34
|
+
expect(result!.toLowerCase()).toMatch(/no active run|nothing to compact/i);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("returns signal string __COMPACT__ when preconditions met", async () => {
|
|
38
|
+
// Set up flow dir with active run
|
|
39
|
+
const flowDir = path.join(tmpDir, ".muonroi-flow");
|
|
40
|
+
await fs.mkdir(path.join(flowDir, "runs", "test-run-01"), {
|
|
41
|
+
recursive: true,
|
|
42
|
+
});
|
|
43
|
+
await fs.mkdir(path.join(flowDir, "history"), { recursive: true });
|
|
44
|
+
await fs.writeFile(path.join(flowDir, "state.md"), "## Active Run\n\ntest-run-01\n", "utf8");
|
|
45
|
+
// Create run state.md
|
|
46
|
+
await fs.writeFile(
|
|
47
|
+
path.join(flowDir, "runs", "test-run-01", "state.md"),
|
|
48
|
+
"## Resume Digest\n\nActive run state\n",
|
|
49
|
+
"utf8",
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const result = await dispatchSlash("compact", [], makeCtx(tmpDir));
|
|
53
|
+
expect(result).toBeTypeOf("string");
|
|
54
|
+
expect(result).toContain("__COMPACT__");
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
import { __resetStatusBarStoreForTests, statusBarStore } from "../../status-bar/store.js";
|
|
3
|
+
import type { SlashContext } from "../registry.js";
|
|
4
|
+
|
|
5
|
+
// Import to trigger self-registration
|
|
6
|
+
import "../cost.js";
|
|
7
|
+
|
|
8
|
+
import { dispatchSlash } from "../registry.js";
|
|
9
|
+
|
|
10
|
+
const makeCtx = (): SlashContext => ({
|
|
11
|
+
cwd: "/tmp",
|
|
12
|
+
tenantId: "local",
|
|
13
|
+
defaultProvider: "anthropic",
|
|
14
|
+
defaultModel: "claude-sonnet-4-20250514",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe("handleCostSlash", () => {
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
__resetStatusBarStoreForTests();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("returns formatted output with default (zeroed) store state", async () => {
|
|
23
|
+
const result = await dispatchSlash("cost", [], makeCtx());
|
|
24
|
+
expect(result).toBeTypeOf("string");
|
|
25
|
+
expect(result).toContain("Provider: (none)");
|
|
26
|
+
expect(result).toContain("Model: (none)");
|
|
27
|
+
expect(result).toContain("Tier: hot");
|
|
28
|
+
expect(result).toContain("0 in / 0 out");
|
|
29
|
+
expect(result).toContain("$0.0000");
|
|
30
|
+
expect(result).toContain("$0.00");
|
|
31
|
+
expect(result).toContain("0.0%");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("returns formatted output with populated store state", async () => {
|
|
35
|
+
statusBarStore.setState({
|
|
36
|
+
provider: "anthropic",
|
|
37
|
+
model: "claude-sonnet-4-20250514",
|
|
38
|
+
tier: "hot",
|
|
39
|
+
in_tokens: 5000,
|
|
40
|
+
out_tokens: 1200,
|
|
41
|
+
session_usd: 0.034,
|
|
42
|
+
month_usd: 2.5,
|
|
43
|
+
cap_usd: 15,
|
|
44
|
+
current_pct: 16.7,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const result = await dispatchSlash("cost", [], makeCtx());
|
|
48
|
+
expect(result).toBeTypeOf("string");
|
|
49
|
+
expect(result).toContain("Provider: anthropic");
|
|
50
|
+
expect(result).toContain("Model: claude-sonnet-4-20250514");
|
|
51
|
+
expect(result).toContain("Tier: hot");
|
|
52
|
+
expect(result).toContain("5000 in / 1200 out");
|
|
53
|
+
expect(result).toContain("Session: $0.0340");
|
|
54
|
+
expect(result).toContain("Month: $2.5000 / $15.00 (16.7%)");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("handleCostSlash returns a string (may be async for EE stats)", async () => {
|
|
58
|
+
const { handleCostSlash } = await import("../cost.js");
|
|
59
|
+
const result = await handleCostSlash([], makeCtx());
|
|
60
|
+
expect(typeof result).toBe("string");
|
|
61
|
+
});
|
|
62
|
+
});
|