muonroi-cli 1.8.4 → 1.9.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 +17 -5
- package/dist/packages/agent-harness-core/src/driver.d.ts +27 -1
- package/dist/packages/agent-harness-core/src/driver.js +46 -0
- package/dist/packages/agent-harness-core/src/event-filter.js +11 -0
- package/dist/packages/agent-harness-core/src/event-redact.js +7 -0
- package/dist/packages/agent-harness-core/src/event-tee.d.ts +64 -0
- package/dist/packages/agent-harness-core/src/event-tee.js +104 -0
- package/dist/packages/agent-harness-core/src/mcp-server.d.ts +25 -0
- package/dist/packages/agent-harness-core/src/mcp-server.js +169 -21
- package/dist/packages/agent-harness-core/src/predicate.d.ts +1 -1
- package/dist/packages/agent-harness-core/src/protocol.d.ts +90 -4
- package/dist/packages/agent-harness-core/src/protocol.js +15 -0
- package/dist/packages/agent-harness-core/src/visual-quality.d.ts +58 -0
- package/dist/packages/agent-harness-core/src/visual-quality.js +141 -0
- package/dist/packages/agent-harness-opentui/src/agent-mode.d.ts +6 -0
- package/dist/packages/agent-harness-opentui/src/agent-mode.js +14 -1
- package/dist/packages/agent-harness-opentui/src/input-bridge.d.ts +2 -10
- package/dist/packages/agent-harness-opentui/src/input-bridge.js +103 -16
- package/dist/packages/agent-harness-opentui/src/install.d.ts +8 -0
- package/dist/packages/agent-harness-opentui/src/install.js +10 -0
- package/dist/packages/agent-harness-opentui/src/semantic.js +12 -10
- package/dist/packages/agent-harness-opentui/src/visual-capture.d.ts +56 -0
- package/dist/packages/agent-harness-opentui/src/visual-capture.js +103 -0
- package/dist/src/agent-harness/mock-model.d.ts +38 -0
- package/dist/src/agent-harness/mock-model.js +69 -3
- package/dist/src/agent-harness/test-spawn.js +31 -0
- package/dist/src/chat/chat-keychain.d.ts +7 -12
- package/dist/src/chat/chat-keychain.js +19 -86
- package/dist/src/cli/config/screen-providers.js +1 -1
- package/dist/src/cli/cost-forensics.d.ts +10 -0
- package/dist/src/cli/cost-forensics.js +18 -3
- package/dist/src/cli/keys-bundle.d.ts +1 -1
- package/dist/src/cli/keys-bundle.js +1 -1
- package/dist/src/cli/keys.d.ts +10 -47
- package/dist/src/cli/keys.js +31 -399
- package/dist/src/council/clarifier.d.ts +31 -3
- package/dist/src/council/clarifier.js +220 -32
- package/dist/src/council/context.js +49 -15
- package/dist/src/council/debate-checkpoint.d.ts +129 -0
- package/dist/src/council/debate-checkpoint.js +176 -0
- package/dist/src/council/debate-planner.js +54 -5
- package/dist/src/council/debate-summary.d.ts +25 -0
- package/dist/src/council/debate-summary.js +85 -0
- package/dist/src/council/debate.d.ts +169 -2
- package/dist/src/council/debate.js +1265 -135
- package/dist/src/council/index.d.ts +108 -1
- package/dist/src/council/index.js +670 -197
- package/dist/src/council/leader.d.ts +26 -0
- package/dist/src/council/leader.js +150 -9
- package/dist/src/council/llm.d.ts +94 -0
- package/dist/src/council/llm.js +348 -55
- package/dist/src/council/panel-select.d.ts +30 -0
- package/dist/src/council/panel-select.js +82 -0
- package/dist/src/council/planner.js +40 -0
- package/dist/src/council/preflight.d.ts +17 -0
- package/dist/src/council/preflight.js +50 -2
- package/dist/src/council/prompts.d.ts +39 -4
- package/dist/src/council/prompts.js +256 -69
- package/dist/src/council/stance-recall.d.ts +42 -0
- package/dist/src/council/stance-recall.js +57 -0
- package/dist/src/council/strip-think.d.ts +17 -0
- package/dist/src/council/strip-think.js +33 -0
- package/dist/src/council/types.d.ts +138 -0
- package/dist/src/ee/artifact-cache.d.ts +16 -0
- package/dist/src/ee/artifact-cache.js +32 -0
- package/dist/src/ee/auth.d.ts +20 -0
- package/dist/src/ee/auth.js +54 -2
- package/dist/src/ee/bridge.d.ts +10 -0
- package/dist/src/ee/bridge.js +58 -0
- package/dist/src/ee/client.js +109 -21
- package/dist/src/ee/ee-onboarding.js +6 -26
- package/dist/src/ee/export-transcripts.d.ts +1 -0
- package/dist/src/ee/export-transcripts.js +8 -10
- package/dist/src/ee/extract-session.js +29 -0
- package/dist/src/ee/extract-style.d.ts +58 -0
- package/dist/src/ee/extract-style.js +270 -0
- package/dist/src/ee/recall-ledger.d.ts +9 -0
- package/dist/src/ee/recall-ledger.js +3 -0
- package/dist/src/ee/scope.d.ts +1 -0
- package/dist/src/ee/scope.js +26 -1
- package/dist/src/ee/search.d.ts +7 -0
- package/dist/src/ee/search.js +24 -0
- package/dist/src/ee/transcript-emit.js +2 -0
- package/dist/src/ee/types.d.ts +22 -0
- package/dist/src/ee/who-am-i-brain.d.ts +35 -0
- package/dist/src/ee/who-am-i-brain.js +220 -0
- package/dist/src/ee/who-am-i.d.ts +10 -3
- package/dist/src/ee/who-am-i.js +12 -0
- package/dist/src/ee/workflow-event.d.ts +48 -0
- package/dist/src/ee/workflow-event.js +81 -0
- package/dist/src/flow/compaction/compress.d.ts +3 -3
- package/dist/src/flow/compaction/compress.js +58 -8
- package/dist/src/flow/compaction/extract.d.ts +4 -7
- package/dist/src/flow/compaction/extract.js +50 -10
- package/dist/src/flow/compaction/index.d.ts +14 -1
- package/dist/src/flow/compaction/index.js +96 -3
- package/dist/src/flow/compaction/input-guard.d.ts +24 -0
- package/dist/src/flow/compaction/input-guard.js +43 -0
- package/dist/src/flow/compaction/progress.d.ts +35 -0
- package/dist/src/flow/compaction/progress.js +35 -0
- package/dist/src/flow/fold-planning.d.ts +36 -0
- package/dist/src/flow/fold-planning.js +83 -0
- package/dist/src/flow/hierarchy.d.ts +146 -0
- package/dist/src/flow/hierarchy.js +427 -0
- package/dist/src/flow/index.d.ts +1 -0
- package/dist/src/flow/index.js +2 -0
- package/dist/src/flow/run-artifacts.d.ts +102 -0
- package/dist/src/flow/run-artifacts.js +208 -0
- package/dist/src/generated/version.d.ts +1 -1
- package/dist/src/generated/version.js +1 -1
- package/dist/src/gsd/assessment-schema.d.ts +44 -0
- package/dist/src/gsd/assessment-schema.js +134 -0
- package/dist/src/gsd/capability-registry.d.ts +45 -0
- package/dist/src/gsd/capability-registry.js +337 -0
- package/dist/src/gsd/complexity-assessor.d.ts +39 -0
- package/dist/src/gsd/complexity-assessor.js +152 -0
- package/dist/src/gsd/config-bridge.d.ts +7 -0
- package/dist/src/gsd/config-bridge.js +114 -0
- package/dist/src/gsd/config-loader.d.ts +27 -0
- package/dist/src/gsd/config-loader.js +50 -0
- package/dist/src/gsd/council-context.d.ts +44 -0
- package/dist/src/gsd/council-context.js +114 -0
- package/dist/src/gsd/ee-closure.d.ts +28 -0
- package/dist/src/gsd/ee-closure.js +49 -0
- package/dist/src/gsd/flags.d.ts +66 -0
- package/dist/src/gsd/flags.js +102 -0
- package/dist/src/gsd/gsd-dispatch.d.ts +58 -0
- package/dist/src/gsd/gsd-dispatch.js +131 -0
- package/dist/src/gsd/gsd-runtime.d.ts +22 -0
- package/dist/src/gsd/gsd-runtime.js +37 -0
- package/dist/src/gsd/host-adapter.d.ts +11 -0
- package/dist/src/gsd/host-adapter.js +29 -0
- package/dist/src/gsd/index.d.ts +24 -1
- package/dist/src/gsd/index.js +27 -0
- package/dist/src/gsd/loop-host-contract.d.ts +21 -0
- package/dist/src/gsd/loop-host-contract.js +39 -0
- package/dist/src/gsd/loop-host.d.ts +69 -0
- package/dist/src/gsd/loop-host.js +245 -0
- package/dist/src/gsd/loop-resolver.d.ts +36 -0
- package/dist/src/gsd/loop-resolver.js +79 -0
- package/dist/src/gsd/model-tier.d.ts +13 -0
- package/dist/src/gsd/model-tier.js +45 -0
- package/dist/src/gsd/mutation-gate.d.ts +16 -0
- package/dist/src/gsd/mutation-gate.js +41 -0
- package/dist/src/gsd/native-roadmap.d.ts +89 -0
- package/dist/src/gsd/native-roadmap.js +343 -0
- package/dist/src/gsd/native-state.d.ts +47 -0
- package/dist/src/gsd/native-state.js +220 -0
- package/dist/src/gsd/paths.d.ts +23 -0
- package/dist/src/gsd/paths.js +66 -0
- package/dist/src/gsd/phase-dag.d.ts +12 -0
- package/dist/src/gsd/phase-dag.js +94 -0
- package/dist/src/gsd/phase-sync.d.ts +42 -0
- package/dist/src/gsd/phase-sync.js +321 -0
- package/dist/src/gsd/pil-gate-context.d.ts +13 -0
- package/dist/src/gsd/pil-gate-context.js +64 -0
- package/dist/src/gsd/pil-gate-critic.d.ts +19 -0
- package/dist/src/gsd/pil-gate-critic.js +74 -0
- package/dist/src/gsd/plan-council-prompts.d.ts +25 -0
- package/dist/src/gsd/plan-council-prompts.js +79 -0
- package/dist/src/gsd/plan-council.d.ts +44 -0
- package/dist/src/gsd/plan-council.js +283 -0
- package/dist/src/gsd/plan-gate-vocabulary.d.ts +40 -0
- package/dist/src/gsd/plan-gate-vocabulary.js +64 -0
- package/dist/src/gsd/product-workspace.d.ts +13 -0
- package/dist/src/gsd/product-workspace.js +124 -0
- package/dist/src/gsd/ship-bridge.d.ts +25 -0
- package/dist/src/gsd/ship-bridge.js +65 -0
- package/dist/src/gsd/state-document.d.ts +40 -0
- package/dist/src/gsd/state-document.js +163 -0
- package/dist/src/gsd/verdict-schema.d.ts +39 -0
- package/dist/src/gsd/verdict-schema.js +144 -0
- package/dist/src/gsd/verify-context.d.ts +22 -0
- package/dist/src/gsd/verify-context.js +27 -0
- package/dist/src/gsd/verify-council-prompts.d.ts +19 -0
- package/dist/src/gsd/verify-council-prompts.js +85 -0
- package/dist/src/gsd/verify-council.d.ts +25 -0
- package/dist/src/gsd/verify-council.js +119 -0
- package/dist/src/gsd/verify-gate-vocabulary.d.ts +25 -0
- package/dist/src/gsd/verify-gate-vocabulary.js +46 -0
- package/dist/src/gsd/workflow-engine.d.ts +60 -0
- package/dist/src/gsd/workflow-engine.js +207 -0
- package/dist/src/gsd/workflow-tools.d.ts +13 -0
- package/dist/src/gsd/workflow-tools.js +277 -0
- package/dist/src/headless/council-answers.js +4 -0
- package/dist/src/hooks/index.js +1 -1
- package/dist/src/index.js +172 -270
- package/dist/src/lsp/builtins.js +3 -1
- package/dist/src/lsp/manager.d.ts +5 -1
- package/dist/src/lsp/manager.js +249 -3
- package/dist/src/lsp/npm-cache.d.ts +11 -1
- package/dist/src/lsp/npm-cache.js +17 -1
- package/dist/src/lsp/runtime.d.ts +6 -1
- package/dist/src/lsp/runtime.js +17 -1
- package/dist/src/lsp/types.d.ts +83 -1
- package/dist/src/lsp/types.js +10 -0
- package/dist/src/maintain/pr-builder.js +23 -13
- package/dist/src/mcp/auto-setup.js +57 -32
- package/dist/src/mcp/client-pool.js +44 -16
- package/dist/src/mcp/lsp-tools.d.ts +5 -1
- package/dist/src/mcp/lsp-tools.js +93 -2
- package/dist/src/mcp/mcp-keychain.d.ts +3 -5
- package/dist/src/mcp/mcp-keychain.js +9 -49
- package/dist/src/mcp/research-onboarding.js +8 -7
- package/dist/src/mcp/runtime.js +34 -2
- package/dist/src/mcp/setup-guide-text.d.ts +1 -1
- package/dist/src/mcp/setup-guide-text.js +22 -2
- package/dist/src/mcp/tools-server.d.ts +10 -0
- package/dist/src/mcp/tools-server.js +10 -2
- package/dist/src/models/catalog-client.d.ts +87 -0
- package/dist/src/models/catalog-client.js +105 -38
- package/dist/src/models/catalog.json +528 -265
- package/dist/src/models/registry.d.ts +22 -7
- package/dist/src/models/registry.js +73 -10
- package/dist/src/ops/doctor.js +1 -1
- package/dist/src/orchestrator/ask-user.d.ts +61 -0
- package/dist/src/orchestrator/ask-user.js +65 -0
- package/dist/src/orchestrator/auto-commit.js +1 -1
- package/dist/src/orchestrator/batch-turn-runner.js +2 -2
- package/dist/src/orchestrator/cache-prefix.d.ts +67 -0
- package/dist/src/orchestrator/cache-prefix.js +83 -0
- package/dist/src/orchestrator/compact-request.d.ts +32 -0
- package/dist/src/orchestrator/compact-request.js +41 -0
- package/dist/src/orchestrator/compaction.d.ts +12 -3
- package/dist/src/orchestrator/compaction.js +35 -15
- package/dist/src/orchestrator/council-manager.d.ts +12 -3
- package/dist/src/orchestrator/council-manager.js +74 -32
- package/dist/src/orchestrator/council-request.d.ts +49 -0
- package/dist/src/orchestrator/council-request.js +62 -0
- package/dist/src/orchestrator/cross-turn-dedup.d.ts +6 -0
- package/dist/src/orchestrator/cross-turn-dedup.js +22 -1
- package/dist/src/orchestrator/error-utils.d.ts +29 -0
- package/dist/src/orchestrator/error-utils.js +132 -24
- package/dist/src/orchestrator/grounding-check.js +39 -1
- package/dist/src/orchestrator/interactive-pause.d.ts +26 -0
- package/dist/src/orchestrator/interactive-pause.js +36 -0
- package/dist/src/orchestrator/message-processor.d.ts +4 -0
- package/dist/src/orchestrator/message-processor.js +268 -41
- package/dist/src/orchestrator/orchestrator.d.ts +64 -3
- package/dist/src/orchestrator/orchestrator.js +823 -120
- package/dist/src/orchestrator/preprocessor.js +3 -3
- package/dist/src/orchestrator/proactive-compact-detector.d.ts +26 -0
- package/dist/src/orchestrator/proactive-compact-detector.js +36 -0
- package/dist/src/orchestrator/prompts.js +17 -17
- package/dist/src/orchestrator/reactive-delegation.d.ts +39 -0
- package/dist/src/orchestrator/reactive-delegation.js +59 -0
- package/dist/src/orchestrator/retry-classifier.d.ts +2 -1
- package/dist/src/orchestrator/retry-classifier.js +46 -2
- package/dist/src/orchestrator/safety-askcard.d.ts +1 -1
- package/dist/src/orchestrator/safety-askcard.js +5 -2
- package/dist/src/orchestrator/safety-intercept.d.ts +50 -0
- package/dist/src/orchestrator/safety-intercept.js +62 -0
- package/dist/src/orchestrator/scope-reminder.js +1 -1
- package/dist/src/orchestrator/session-experience.d.ts +2 -1
- package/dist/src/orchestrator/session-experience.js +2 -1
- package/dist/src/orchestrator/should-run-gate.d.ts +5 -0
- package/dist/src/orchestrator/should-run-gate.js +18 -0
- package/dist/src/orchestrator/stall-watchdog.d.ts +31 -3
- package/dist/src/orchestrator/stall-watchdog.js +65 -10
- package/dist/src/orchestrator/stream-runner.d.ts +13 -3
- package/dist/src/orchestrator/stream-runner.js +115 -49
- package/dist/src/orchestrator/sub-agent-cap.d.ts +13 -1
- package/dist/src/orchestrator/sub-agent-cap.js +16 -1
- package/dist/src/orchestrator/sub-agent-model-tier.d.ts +13 -1
- package/dist/src/orchestrator/sub-agent-model-tier.js +16 -2
- package/dist/src/orchestrator/subagent-compactor.d.ts +53 -1
- package/dist/src/orchestrator/subagent-compactor.js +126 -15
- package/dist/src/orchestrator/tool-engine.d.ts +41 -0
- package/dist/src/orchestrator/tool-engine.js +846 -66
- package/dist/src/orchestrator/tool-limit-auto-recover.d.ts +22 -0
- package/dist/src/orchestrator/tool-limit-auto-recover.js +30 -0
- package/dist/src/orchestrator/turn-runner-deps.d.ts +19 -0
- package/dist/src/orchestrator/turn-watchdog.d.ts +44 -0
- package/dist/src/orchestrator/turn-watchdog.js +84 -0
- package/dist/src/pil/agent-operating-contract.d.ts +1 -1
- package/dist/src/pil/agent-operating-contract.js +6 -4
- package/dist/src/pil/cheap-model-playbook.d.ts +1 -1
- package/dist/src/pil/cheap-model-playbook.js +5 -1
- package/dist/src/pil/cheap-model-workbooks.d.ts +1 -1
- package/dist/src/pil/cheap-model-workbooks.js +1 -1
- package/dist/src/pil/discovery-types.d.ts +1 -0
- package/dist/src/pil/discovery.d.ts +1 -1
- package/dist/src/pil/discovery.js +18 -13
- package/dist/src/pil/layer1-intent.d.ts +18 -6
- package/dist/src/pil/layer1-intent.js +66 -757
- package/dist/src/pil/layer15-context-scan.js +15 -1
- package/dist/src/pil/layer1_5-complexity-size.d.ts +7 -0
- package/dist/src/pil/layer1_5-complexity-size.js +31 -5
- package/dist/src/pil/layer3-ee-injection.js +23 -8
- package/dist/src/pil/layer4-gsd.js +69 -16
- package/dist/src/pil/layer5-context.js +7 -3
- package/dist/src/pil/layer6-output.d.ts +23 -0
- package/dist/src/pil/layer6-output.js +5 -1
- package/dist/src/pil/llm-classify.d.ts +111 -5
- package/dist/src/pil/llm-classify.js +421 -189
- package/dist/src/pil/native-capabilities-workbook.d.ts +1 -1
- package/dist/src/pil/native-capabilities-workbook.js +8 -0
- package/dist/src/pil/pipeline.js +36 -2
- package/dist/src/pil/repo-grounding-probe.d.ts +15 -0
- package/dist/src/pil/repo-grounding-probe.js +136 -0
- package/dist/src/pil/repo-structure-hints.d.ts +7 -0
- package/dist/src/pil/repo-structure-hints.js +45 -0
- package/dist/src/pil/response-tools.js +5 -3
- package/dist/src/pil/schema.d.ts +1 -0
- package/dist/src/pil/schema.js +2 -0
- package/dist/src/pil/types.d.ts +18 -0
- package/dist/src/playbook/directives.d.ts +4 -0
- package/dist/src/playbook/directives.js +17 -5
- package/dist/src/product-loop/artifact-io.js +4 -0
- package/dist/src/product-loop/backlog-builder.d.ts +14 -1
- package/dist/src/product-loop/backlog-builder.js +30 -6
- package/dist/src/product-loop/criteria-seed.d.ts +51 -0
- package/dist/src/product-loop/criteria-seed.js +200 -0
- package/dist/src/product-loop/discovery-context-format.js +3 -1
- package/dist/src/product-loop/discovery-ecosystem.js +4 -1
- package/dist/src/product-loop/discovery-interview.d.ts +9 -0
- package/dist/src/product-loop/discovery-interview.js +60 -12
- package/dist/src/product-loop/discovery-recommender.js +2 -1
- package/dist/src/product-loop/discovery-schema.js +19 -2
- package/dist/src/product-loop/discovery-triage.d.ts +23 -0
- package/dist/src/product-loop/discovery-triage.js +109 -0
- package/dist/src/product-loop/gather.js +150 -2
- package/dist/src/product-loop/ideal-trace.d.ts +7 -0
- package/dist/src/product-loop/ideal-trace.js +64 -0
- package/dist/src/product-loop/index.d.ts +13 -1
- package/dist/src/product-loop/index.js +340 -52
- package/dist/src/product-loop/loop-driver.d.ts +7 -0
- package/dist/src/product-loop/loop-driver.js +330 -106
- package/dist/src/product-loop/phase-plan.d.ts +21 -0
- package/dist/src/product-loop/phase-plan.js +81 -6
- package/dist/src/product-loop/phase-rituals.d.ts +3 -0
- package/dist/src/product-loop/phase-rituals.js +8 -3
- package/dist/src/product-loop/phase-runner.js +39 -12
- package/dist/src/product-loop/plan-adherence-review.d.ts +26 -0
- package/dist/src/product-loop/plan-adherence-review.js +144 -0
- package/dist/src/product-loop/sprint-runner.d.ts +173 -0
- package/dist/src/product-loop/sprint-runner.js +863 -19
- package/dist/src/product-loop/types.d.ts +61 -5
- package/dist/src/providers/adapter.d.ts +1 -1
- package/dist/src/providers/adapter.js +3 -4
- package/dist/src/providers/anthropic.d.ts +9 -8
- package/dist/src/providers/anthropic.js +13 -47
- package/dist/src/providers/auth/browser-flow.d.ts +1 -1
- package/dist/src/providers/auth/browser-flow.js +1 -1
- package/dist/src/providers/auth/grok-oauth.d.ts +1 -0
- package/dist/src/providers/auth/grok-oauth.js +30 -5
- package/dist/src/providers/auth/openai-oauth.d.ts +1 -0
- package/dist/src/providers/auth/openai-oauth.js +15 -1
- package/dist/src/providers/auth/registry.js +0 -34
- package/dist/src/providers/auth/token-store.d.ts +9 -9
- package/dist/src/providers/auth/token-store.js +8 -67
- package/dist/src/providers/auth/types.d.ts +9 -1
- package/dist/src/providers/auth/types.js +1 -1
- package/dist/src/providers/capabilities.d.ts +24 -5
- package/dist/src/providers/capabilities.js +42 -24
- package/dist/src/providers/endpoints.d.ts +2 -2
- package/dist/src/providers/endpoints.js +11 -10
- package/dist/src/providers/env-store.d.ts +17 -0
- package/dist/src/providers/env-store.js +228 -0
- package/dist/src/providers/keychain.d.ts +22 -18
- package/dist/src/providers/keychain.js +127 -140
- package/dist/src/providers/mcp-vision-bridge.js +56 -146
- package/dist/src/providers/openai-compatible.js +8 -1
- package/dist/src/providers/pricing.d.ts +2 -2
- package/dist/src/providers/pricing.js +3 -13
- package/dist/src/providers/runtime.d.ts +43 -3
- package/dist/src/providers/runtime.js +88 -14
- package/dist/src/providers/strategies/base.strategy.d.ts +16 -0
- package/dist/src/providers/strategies/base.strategy.js +24 -1
- package/dist/src/providers/strategies/{siliconflow.strategy.d.ts → opencode-go.strategy.d.ts} +3 -3
- package/dist/src/providers/strategies/opencode-go.strategy.js +83 -0
- package/dist/src/providers/strategies/registry.js +4 -4
- package/dist/src/providers/strategies/thinking-mode.d.ts +109 -0
- package/dist/src/providers/strategies/thinking-mode.js +288 -1
- package/dist/src/providers/strategies/xai.strategy.js +27 -0
- package/dist/src/providers/strategies/zai.strategy.d.ts +14 -0
- package/dist/src/providers/strategies/zai.strategy.js +44 -0
- package/dist/src/providers/types.d.ts +5 -6
- package/dist/src/providers/types.js +2 -2
- package/dist/src/providers/vision-backend.d.ts +47 -0
- package/dist/src/providers/vision-backend.js +258 -0
- package/dist/src/providers/vision-proxy.d.ts +22 -9
- package/dist/src/providers/vision-proxy.js +63 -132
- package/dist/src/providers/warm.d.ts +65 -0
- package/dist/src/providers/warm.js +145 -0
- package/dist/src/providers/wire-debug.js +95 -0
- package/dist/src/router/decide.d.ts +13 -0
- package/dist/src/router/decide.js +138 -36
- package/dist/src/router/peak-hour.d.ts +38 -0
- package/dist/src/router/peak-hour.js +107 -0
- package/dist/src/router/step-router.js +3 -2
- package/dist/src/router/warm.js +4 -5
- package/dist/src/scaffold/continuation-prompt.d.ts +11 -0
- package/dist/src/scaffold/continuation-prompt.js +26 -0
- package/dist/src/scaffold/point-to-existing.d.ts +21 -0
- package/dist/src/scaffold/point-to-existing.js +25 -0
- package/dist/src/self-qa/agentic-loop.js +6 -5
- package/dist/src/{ui/state → state}/active-run.d.ts +19 -0
- package/dist/src/{ui/state → state}/active-run.js +21 -0
- package/dist/src/{ui/status-bar/store.d.ts → state/status-bar-store.d.ts} +4 -1
- package/dist/src/{ui/status-bar/store.js → state/status-bar-store.js} +12 -9
- package/dist/src/state/turn-trace.d.ts +43 -0
- package/dist/src/state/turn-trace.js +32 -0
- package/dist/src/storage/db.js +2 -1
- package/dist/src/storage/index.d.ts +1 -1
- package/dist/src/storage/index.js +1 -1
- package/dist/src/storage/interaction-log.d.ts +1 -1
- package/dist/src/storage/migrations.js +71 -1
- package/dist/src/storage/sessions.d.ts +28 -10
- package/dist/src/storage/sessions.js +78 -21
- package/dist/src/storage/transcript-view.js +1 -1
- package/dist/src/storage/transcript.d.ts +51 -0
- package/dist/src/storage/transcript.js +340 -15
- package/dist/src/tools/file.d.ts +15 -0
- package/dist/src/tools/file.js +32 -0
- package/dist/src/tools/git-safety.d.ts +19 -0
- package/dist/src/tools/git-safety.js +168 -0
- package/dist/src/tools/native-tools.d.ts +1 -1
- package/dist/src/tools/native-tools.js +81 -1
- package/dist/src/tools/registry.d.ts +20 -0
- package/dist/src/tools/registry.js +576 -23
- package/dist/src/tools/research.d.ts +29 -0
- package/dist/src/tools/research.js +233 -0
- package/dist/src/types/index.d.ts +147 -4
- package/dist/src/ui/app.js +0 -0
- package/dist/src/ui/cards/product-status-card.js +1 -1
- package/dist/src/ui/components/agent-rail-activities.d.ts +26 -0
- package/dist/src/ui/components/agent-rail-activities.js +47 -0
- package/dist/src/ui/components/bubble-body-guard.d.ts +27 -0
- package/dist/src/ui/components/bubble-body-guard.js +50 -0
- package/dist/src/ui/components/compact-progress-card.d.ts +24 -0
- package/dist/src/ui/components/compact-progress-card.js +42 -0
- package/dist/src/ui/components/context-rail.d.ts +26 -0
- package/dist/src/ui/components/context-rail.js +33 -0
- package/dist/src/ui/components/council-conclusion-card.d.ts +73 -0
- package/dist/src/ui/components/council-conclusion-card.js +420 -0
- package/dist/src/ui/components/council-debate-pill.d.ts +36 -0
- package/dist/src/ui/components/council-debate-pill.js +34 -0
- package/dist/src/ui/components/council-info-card.js +2 -2
- package/dist/src/ui/components/council-leader-bubble.d.ts +10 -3
- package/dist/src/ui/components/council-leader-bubble.js +21 -11
- package/dist/src/ui/components/council-message-bubble.d.ts +15 -2
- package/dist/src/ui/components/council-message-bubble.js +16 -15
- package/dist/src/ui/components/council-phase-timeline.d.ts +9 -1
- package/dist/src/ui/components/council-phase-timeline.js +66 -17
- package/dist/src/ui/components/council-placeholder-bubble.d.ts +16 -9
- package/dist/src/ui/components/council-placeholder-bubble.js +32 -29
- package/dist/src/ui/components/council-question-card.js +13 -12
- package/dist/src/ui/components/council-rail-rounds.d.ts +26 -0
- package/dist/src/ui/components/council-rail-rounds.js +57 -0
- package/dist/src/ui/components/council-round-group.d.ts +38 -0
- package/dist/src/ui/components/council-round-group.js +88 -0
- package/dist/src/ui/components/council-status-list.d.ts +3 -1
- package/dist/src/ui/components/council-status-list.js +36 -24
- package/dist/src/ui/components/council-synthesis-banner.d.ts +7 -2
- package/dist/src/ui/components/council-synthesis-banner.js +20 -5
- package/dist/src/ui/components/halt-recovery-card.js +9 -5
- package/dist/src/ui/components/jump-to-latest-pill.d.ts +11 -0
- package/dist/src/ui/components/jump-to-latest-pill.js +14 -0
- package/dist/src/ui/components/message-view.d.ts +15 -0
- package/dist/src/ui/components/message-view.js +50 -1
- package/dist/src/ui/components/prompt-box.js +18 -16
- package/dist/src/ui/components/session-tree-card.d.ts +14 -0
- package/dist/src/ui/components/session-tree-card.js +46 -0
- package/dist/src/ui/components/slash-inline-menu.d.ts +12 -0
- package/dist/src/ui/components/slash-inline-menu.js +26 -5
- package/dist/src/ui/components/task-list-panel.d.ts +14 -1
- package/dist/src/ui/components/task-list-panel.js +22 -2
- package/dist/src/ui/components/tool-group.d.ts +15 -3
- package/dist/src/ui/components/tool-group.js +69 -11
- package/dist/src/ui/containers/modals-layer.d.ts +4 -2
- package/dist/src/ui/containers/modals-layer.js +2 -2
- package/dist/src/ui/council-harness-event.d.ts +57 -0
- package/dist/src/ui/council-harness-event.js +46 -0
- package/dist/src/ui/heartbeat-debug.d.ts +29 -0
- package/dist/src/ui/heartbeat-debug.js +45 -0
- package/dist/src/ui/hooks/use-session-picker.d.ts +3 -3
- package/dist/src/ui/mcp-modal.js +2 -4
- package/dist/src/ui/modals/api-key-modal.js +1 -1
- package/dist/src/ui/modals/connect-modal.js +4 -3
- package/dist/src/ui/modals/model-picker-modal.d.ts +8 -18
- package/dist/src/ui/modals/model-picker-modal.js +8 -10
- package/dist/src/ui/modals/session-picker-modal.d.ts +2 -2
- package/dist/src/ui/modals/session-picker-modal.js +3 -5
- package/dist/src/ui/picker-providers.d.ts +1 -1
- package/dist/src/ui/picker-providers.js +1 -1
- package/dist/src/ui/primitives/index.d.ts +1 -0
- package/dist/src/ui/primitives/index.js +2 -0
- package/dist/src/ui/primitives/semantic-primitives.d.ts +76 -0
- package/dist/src/ui/primitives/semantic-primitives.js +81 -0
- package/dist/src/ui/slash/compact.js +5 -7
- package/dist/src/ui/slash/cost.js +1 -1
- package/dist/src/ui/slash/council.js +19 -1
- package/dist/src/ui/slash/debug.d.ts +3 -31
- package/dist/src/ui/slash/debug.js +9 -20
- package/dist/src/ui/slash/ee.js +81 -0
- package/dist/src/ui/slash/ideal.d.ts +6 -2
- package/dist/src/ui/slash/ideal.js +97 -7
- package/dist/src/ui/slash/menu-items.d.ts +7 -0
- package/dist/src/ui/slash/menu-items.js +23 -20
- package/dist/src/ui/slash/registry.d.ts +2 -0
- package/dist/src/ui/slash/registry.js +4 -0
- package/dist/src/ui/status-bar/cache-hit.d.ts +6 -0
- package/dist/src/ui/status-bar/cache-hit.js +9 -0
- package/dist/src/ui/status-bar/index.d.ts +1 -1
- package/dist/src/ui/status-bar/index.js +7 -3
- package/dist/src/ui/status-bar/usd-meter.d.ts +5 -4
- package/dist/src/ui/status-bar/usd-meter.js +6 -4
- package/dist/src/ui/theme.d.ts +1 -0
- package/dist/src/ui/theme.js +2 -0
- package/dist/src/ui/types.d.ts +7 -0
- package/dist/src/ui/use-app-logic.js +0 -0
- package/dist/src/ui/utils/agent-activities.d.ts +39 -0
- package/dist/src/ui/utils/agent-activities.js +96 -0
- package/dist/src/ui/utils/format.d.ts +14 -0
- package/dist/src/ui/utils/format.js +23 -3
- package/dist/src/ui/utils/group-tool-entries.d.ts +26 -0
- package/dist/src/ui/utils/group-tool-entries.js +111 -0
- package/dist/src/ui/utils/tool-summary.d.ts +21 -0
- package/dist/src/ui/utils/tool-summary.js +91 -0
- package/dist/src/usage/downgrade.js +2 -2
- package/dist/src/usage/product-ledger.js +2 -2
- package/dist/src/utils/event-loop-monitor.d.ts +85 -0
- package/dist/src/utils/event-loop-monitor.js +107 -0
- package/dist/src/utils/install-manager.js +2 -1
- package/dist/src/utils/llm-deadline.d.ts +14 -0
- package/dist/src/utils/llm-deadline.js +19 -0
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/utils/loop-profiler.d.ts +102 -0
- package/dist/src/utils/loop-profiler.js +202 -0
- package/dist/src/utils/permission-mode.js +5 -3
- package/dist/src/utils/redactor.js +1 -1
- package/dist/src/utils/settings.d.ts +180 -5
- package/dist/src/utils/settings.js +271 -31
- package/dist/src/utils/side-question.d.ts +1 -2
- package/dist/src/utils/side-question.js +2 -2
- package/dist/src/utils/visible-retry.d.ts +11 -0
- package/dist/src/utils/visible-retry.js +10 -1
- package/dist/src/verify/entrypoint.d.ts +1 -1
- package/dist/src/verify/entrypoint.js +52 -17
- package/dist/src/verify/orchestrator.d.ts +1 -1
- package/dist/src/verify/orchestrator.js +20 -3
- package/dist/src/verify/recipes.d.ts +13 -0
- package/dist/src/verify/recipes.js +15 -0
- package/package.json +134 -132
- package/dist/src/cli/bw-vault.d.ts +0 -55
- package/dist/src/cli/bw-vault.js +0 -133
- package/dist/src/mcp/ee-tools.d.ts +0 -46
- package/dist/src/mcp/ee-tools.js +0 -193
- package/dist/src/providers/auth/gcloud.d.ts +0 -28
- package/dist/src/providers/auth/gcloud.js +0 -102
- package/dist/src/providers/auth/gemini-oauth.d.ts +0 -82
- package/dist/src/providers/auth/gemini-oauth.js +0 -472
- package/dist/src/providers/gemini.d.ts +0 -11
- package/dist/src/providers/gemini.js +0 -45
- package/dist/src/providers/siliconflow-sse-repair.d.ts +0 -58
- package/dist/src/providers/siliconflow-sse-repair.js +0 -177
- package/dist/src/providers/strategies/google.strategy.d.ts +0 -22
- package/dist/src/providers/strategies/google.strategy.js +0 -174
- package/dist/src/providers/strategies/siliconflow.strategy.js +0 -29
- package/dist/src/ui/containers/chat-feed.d.ts +0 -40
- package/dist/src/ui/containers/chat-feed.js +0 -66
package/dist/src/cli/keys.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `muonroi-cli keys` subcommand group.
|
|
3
3
|
*
|
|
4
|
-
* Manages provider API keys via the
|
|
5
|
-
*
|
|
6
|
-
* keychain → env → settings.json priority chain in providers/keychain.ts.
|
|
7
|
-
*
|
|
8
|
-
* On Linux without libsecret + an active secret service (gnome-keyring etc.),
|
|
9
|
-
* or in headless sessions, keychain writes return false and callers fall back
|
|
10
|
-
* to advising environment variables (which are still honored at runtime).
|
|
4
|
+
* Manages provider API keys via the env-store. Keys are read by the CLI through
|
|
5
|
+
* the env-store → env → settings.json priority chain in providers/keychain.ts.
|
|
11
6
|
*
|
|
12
7
|
* Subcommands:
|
|
13
|
-
* keys set <provider> — interactive prompt, stores
|
|
8
|
+
* keys set <provider> — interactive prompt, stores the key
|
|
14
9
|
* keys list — show masked keys currently stored
|
|
15
10
|
* keys delete <provider> — remove a stored key
|
|
16
|
-
* keys
|
|
17
|
-
* keys
|
|
18
|
-
* keys login <provider> — OAuth login (openai,
|
|
19
|
-
* keys logout <provider> — OAuth logout (openai,
|
|
11
|
+
* keys export <file> — export keys to an encrypted portable bundle
|
|
12
|
+
* keys import <file> — import an encrypted bundle
|
|
13
|
+
* keys login <provider> — OAuth login (openai, xai)
|
|
14
|
+
* keys logout <provider> — OAuth logout (openai, xai)
|
|
20
15
|
*/
|
|
21
|
-
import { spawnSync } from "node:child_process";
|
|
22
16
|
import { promises as fs } from "node:fs";
|
|
23
|
-
import * as os from "node:os";
|
|
24
17
|
import * as path from "node:path";
|
|
25
18
|
import { getChatSecret, listChatSecrets, setChatSecret } from "../chat/chat-keychain.js";
|
|
26
19
|
import { setMcpKey } from "../mcp/mcp-keychain.js";
|
|
@@ -39,11 +32,6 @@ const MCP_KEY_IDS = ["tavily"];
|
|
|
39
32
|
function isMcpKeyId(value) {
|
|
40
33
|
return MCP_KEY_IDS.includes(value);
|
|
41
34
|
}
|
|
42
|
-
const CHAT_SECRET_IDS = ["discord-token", "discord-guild-id", "slack-token", "slack-team-id"];
|
|
43
|
-
function isChatSecretId(value) {
|
|
44
|
-
return CHAT_SECRET_IDS.includes(value);
|
|
45
|
-
}
|
|
46
|
-
const SETTINGS_PATH = path.join(os.homedir(), ".muonroi-cli", "user-settings.json");
|
|
47
35
|
function maskKey(key) {
|
|
48
36
|
if (key.length <= 10)
|
|
49
37
|
return "***";
|
|
@@ -51,8 +39,6 @@ function maskKey(key) {
|
|
|
51
39
|
}
|
|
52
40
|
function normalizeProvider(p) {
|
|
53
41
|
const lower = p.toLowerCase();
|
|
54
|
-
if (lower === "agy")
|
|
55
|
-
return "google"; // agy is alias for google (OAuth + key)
|
|
56
42
|
if (KEYCHAIN_PROVIDER_IDS.includes(lower)) {
|
|
57
43
|
return lower;
|
|
58
44
|
}
|
|
@@ -112,10 +98,10 @@ async function promptHidden(question) {
|
|
|
112
98
|
process.stdin.on("data", onData);
|
|
113
99
|
});
|
|
114
100
|
}
|
|
115
|
-
export async function runKeysSet(provider,
|
|
101
|
+
export async function runKeysSet(provider, _options = {}) {
|
|
116
102
|
const norm = normalizeProvider(provider);
|
|
117
103
|
if (!norm) {
|
|
118
|
-
console.error(`Unknown provider '${provider}'. Valid: ${KEYCHAIN_PROVIDER_IDS.join(", ")}
|
|
104
|
+
console.error(`Unknown provider '${provider}'. Valid: ${KEYCHAIN_PROVIDER_IDS.join(", ")}`);
|
|
119
105
|
process.exit(1);
|
|
120
106
|
}
|
|
121
107
|
const key = (await promptHidden(`Paste ${provider} API key (hidden): `)).trim();
|
|
@@ -123,16 +109,6 @@ export async function runKeysSet(provider, options = {}) {
|
|
|
123
109
|
console.error("Aborted (empty key).");
|
|
124
110
|
process.exit(1);
|
|
125
111
|
}
|
|
126
|
-
if (options.bw) {
|
|
127
|
-
const { writeBwSecureNote } = await import("./bw-vault.js");
|
|
128
|
-
const itemName = `${options.itemPrefix ?? "muonroi-cli/"}${provider}`;
|
|
129
|
-
const res = await writeBwSecureNote(itemName, key);
|
|
130
|
-
if (!res.ok) {
|
|
131
|
-
console.error(`Bitwarden write failed: ${res.error}`);
|
|
132
|
-
process.exit(2);
|
|
133
|
-
}
|
|
134
|
-
console.log(`Bitwarden vault: ${res.action} '${itemName}'.`);
|
|
135
|
-
}
|
|
136
112
|
try {
|
|
137
113
|
const ok = await setKeyForProvider(norm, key);
|
|
138
114
|
if (!ok) {
|
|
@@ -152,7 +128,7 @@ export async function runKeysSet(provider, options = {}) {
|
|
|
152
128
|
process.exit(1);
|
|
153
129
|
}
|
|
154
130
|
}
|
|
155
|
-
export async function runMcpKeysSet(id,
|
|
131
|
+
export async function runMcpKeysSet(id, _options = {}) {
|
|
156
132
|
if (!isMcpKeyId(id)) {
|
|
157
133
|
console.error(`Unknown MCP key '${id}'. Valid: ${MCP_KEY_IDS.join(", ")}`);
|
|
158
134
|
process.exit(1);
|
|
@@ -162,16 +138,6 @@ export async function runMcpKeysSet(id, options = {}) {
|
|
|
162
138
|
console.error("Aborted (empty key).");
|
|
163
139
|
process.exit(1);
|
|
164
140
|
}
|
|
165
|
-
if (options.bw) {
|
|
166
|
-
const { writeBwSecureNote } = await import("./bw-vault.js");
|
|
167
|
-
const itemName = `${options.itemPrefix ?? "muonroi-cli/"}${id}`;
|
|
168
|
-
const res = await writeBwSecureNote(itemName, key);
|
|
169
|
-
if (!res.ok) {
|
|
170
|
-
console.error(`Bitwarden write failed: ${res.error}`);
|
|
171
|
-
process.exit(2);
|
|
172
|
-
}
|
|
173
|
-
console.log(`Bitwarden vault: ${res.action} '${itemName}'.`);
|
|
174
|
-
}
|
|
175
141
|
try {
|
|
176
142
|
const ok = await setMcpKey(id, key);
|
|
177
143
|
if (!ok) {
|
|
@@ -199,30 +165,11 @@ export async function runKeysList() {
|
|
|
199
165
|
const oauthIds = await getOAuthProviderIds();
|
|
200
166
|
for (const p of oauthIds) {
|
|
201
167
|
try {
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const agyTokens = await loadAgyTokensWithRefresh();
|
|
208
|
-
if (agyTokens && Date.now() < agyTokens.expiresAt) {
|
|
209
|
-
tokens = agyTokens;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (tokens) {
|
|
213
|
-
if (Date.now() < tokens.expiresAt) {
|
|
214
|
-
const cfg = await getOAuthProviderConfig(p);
|
|
215
|
-
const display = cfg?.displayName ?? p;
|
|
216
|
-
oauthRows.push({ provider: p, display, email: tokens.email, expiresAt: tokens.expiresAt });
|
|
217
|
-
}
|
|
218
|
-
else if (p === "google") {
|
|
219
|
-
// auto-clean stale Agy token from our store (imported from old ~/.gemini)
|
|
220
|
-
try {
|
|
221
|
-
const { deleteTokens } = await import("../providers/auth/token-store.js");
|
|
222
|
-
await deleteTokens("google");
|
|
223
|
-
}
|
|
224
|
-
catch { }
|
|
225
|
-
}
|
|
168
|
+
const tokens = await loadTokens(p);
|
|
169
|
+
if (tokens && Date.now() < tokens.expiresAt) {
|
|
170
|
+
const cfg = await getOAuthProviderConfig(p);
|
|
171
|
+
const display = cfg?.displayName ?? p;
|
|
172
|
+
oauthRows.push({ provider: p, display, email: tokens.email, expiresAt: tokens.expiresAt });
|
|
226
173
|
}
|
|
227
174
|
}
|
|
228
175
|
catch {
|
|
@@ -232,9 +179,8 @@ export async function runKeysList() {
|
|
|
232
179
|
const hasAnything = stored.length > 0 || chatStored.length > 0 || oauthRows.length > 0;
|
|
233
180
|
if (!hasAnything) {
|
|
234
181
|
console.log("No keys stored in OS keychain.");
|
|
235
|
-
console.log("Run 'muonroi-cli keys set <provider>'
|
|
182
|
+
console.log("Run 'muonroi-cli keys set <provider>' to add some.");
|
|
236
183
|
console.log("Run 'muonroi-cli keys login openai' to log in with your OpenAI subscription.");
|
|
237
|
-
console.log("Run 'muonroi-cli keys login google' or 'keys login agy' to log in with Agy (Google OAuth).");
|
|
238
184
|
console.log("Run 'muonroi-cli keys login xai' to log in with your SuperGrok / X Premium+ subscription.");
|
|
239
185
|
return;
|
|
240
186
|
}
|
|
@@ -288,35 +234,11 @@ export async function runKeysList() {
|
|
|
288
234
|
export async function runKeysDelete(provider) {
|
|
289
235
|
const norm = normalizeProvider(provider);
|
|
290
236
|
if (!norm) {
|
|
291
|
-
console.error(`Unknown provider '${provider}'. Valid: ${KEYCHAIN_PROVIDER_IDS.join(", ")}
|
|
237
|
+
console.error(`Unknown provider '${provider}'. Valid: ${KEYCHAIN_PROVIDER_IDS.join(", ")}`);
|
|
292
238
|
process.exit(1);
|
|
293
239
|
}
|
|
294
240
|
const ok = await deleteKeyForProvider(norm);
|
|
295
241
|
console.log(ok ? `Deleted ${provider} key from keychain.` : `No ${provider} key was stored.`);
|
|
296
|
-
// If deleting google/agy, also clean the OAuth token (Agy uses the google slot for its OAuth)
|
|
297
|
-
if (norm === "google") {
|
|
298
|
-
try {
|
|
299
|
-
const { loadTokens, deleteTokens } = await import("../providers/auth/token-store.js");
|
|
300
|
-
const { getOAuthProviderConfig } = await import("../providers/auth/registry.js");
|
|
301
|
-
const tokens = await loadTokens("google");
|
|
302
|
-
if (tokens) {
|
|
303
|
-
const cfg = await getOAuthProviderConfig("google");
|
|
304
|
-
if (cfg?.provider) {
|
|
305
|
-
try {
|
|
306
|
-
await cfg.provider.revoke(tokens);
|
|
307
|
-
}
|
|
308
|
-
catch {
|
|
309
|
-
// best effort
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
await deleteTokens("google");
|
|
313
|
-
console.log(`Also cleared Agy/Google OAuth token.`);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
catch {
|
|
317
|
-
// ignore secondary errors
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
242
|
}
|
|
321
243
|
export async function runKeysExport(filePath) {
|
|
322
244
|
const providers = {};
|
|
@@ -411,161 +333,6 @@ export async function runKeysImport(filePath) {
|
|
|
411
333
|
}
|
|
412
334
|
console.log(`\nImported ${imported} key(s); ${skipped} skipped.`);
|
|
413
335
|
}
|
|
414
|
-
export async function runKeysImportBw(opts = {}) {
|
|
415
|
-
const which = spawnSync("bw", ["--version"], { encoding: "utf8" });
|
|
416
|
-
if (which.status !== 0) {
|
|
417
|
-
console.error("Bitwarden CLI ('bw') not found in PATH.");
|
|
418
|
-
console.error("Install: https://bitwarden.com/help/cli/");
|
|
419
|
-
process.exit(2);
|
|
420
|
-
}
|
|
421
|
-
const session = process.env.BW_SESSION;
|
|
422
|
-
if (!session) {
|
|
423
|
-
console.error("BW_SESSION not set. Run:");
|
|
424
|
-
console.error(" export BW_SESSION=$(bw unlock --raw)");
|
|
425
|
-
process.exit(2);
|
|
426
|
-
}
|
|
427
|
-
const status = spawnSync("bw", ["status", "--session", session], { encoding: "utf8" });
|
|
428
|
-
if (status.status !== 0) {
|
|
429
|
-
console.error(`bw status failed: ${status.stderr || status.stdout}`);
|
|
430
|
-
process.exit(2);
|
|
431
|
-
}
|
|
432
|
-
let parsed;
|
|
433
|
-
try {
|
|
434
|
-
parsed = JSON.parse(status.stdout);
|
|
435
|
-
}
|
|
436
|
-
catch {
|
|
437
|
-
parsed = {};
|
|
438
|
-
}
|
|
439
|
-
if (parsed.status !== "unlocked") {
|
|
440
|
-
console.error(`Bitwarden vault is not unlocked (status: ${parsed.status ?? "unknown"}).`);
|
|
441
|
-
console.error("Run: export BW_SESSION=$(bw unlock --raw)");
|
|
442
|
-
process.exit(2);
|
|
443
|
-
}
|
|
444
|
-
const requested = opts.providers && opts.providers.length > 0 ? opts.providers : KEYCHAIN_PROVIDER_IDS.slice();
|
|
445
|
-
const prefix = opts.itemPrefix ?? "muonroi-cli/";
|
|
446
|
-
let imported = 0;
|
|
447
|
-
let skipped = 0;
|
|
448
|
-
for (const provider of requested) {
|
|
449
|
-
const norm = normalizeProvider(provider);
|
|
450
|
-
if (!norm) {
|
|
451
|
-
console.warn(`Skip unknown provider: ${provider}`);
|
|
452
|
-
skipped++;
|
|
453
|
-
continue;
|
|
454
|
-
}
|
|
455
|
-
const itemName = `${prefix}${provider}`;
|
|
456
|
-
const got = spawnSync("bw", ["get", "notes", itemName, "--session", session], { encoding: "utf8" });
|
|
457
|
-
if (got.status !== 0) {
|
|
458
|
-
// bw prints "Not found." on stderr when the item is missing — treat as skip.
|
|
459
|
-
skipped++;
|
|
460
|
-
continue;
|
|
461
|
-
}
|
|
462
|
-
const key = got.stdout.trim();
|
|
463
|
-
if (!key || key.length < 20) {
|
|
464
|
-
console.warn(`Skip ${provider}: vault item '${itemName}' empty or too short.`);
|
|
465
|
-
skipped++;
|
|
466
|
-
continue;
|
|
467
|
-
}
|
|
468
|
-
try {
|
|
469
|
-
const ok = await setKeyForProvider(norm, key);
|
|
470
|
-
if (!ok) {
|
|
471
|
-
console.warn(`! ${provider} — OS keychain unavailable (keytar or secret service backend).`);
|
|
472
|
-
console.warn(" Linux fix: sudo dnf install libsecret (Fedora) or sudo apt-get install libsecret-1-0 (Ubuntu)");
|
|
473
|
-
console.warn(` Fallback (works at runtime): export ${provider.toUpperCase()}_API_KEY=...`);
|
|
474
|
-
skipped++;
|
|
475
|
-
}
|
|
476
|
-
else {
|
|
477
|
-
console.log(`Imported ${provider} → keychain.`);
|
|
478
|
-
imported++;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
console.warn(`Failed ${provider}: ${e.message}`);
|
|
483
|
-
skipped++;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
console.log(`\nDone. Imported: ${imported}, skipped: ${skipped}.`);
|
|
487
|
-
if (imported > 0) {
|
|
488
|
-
console.log("Run 'muonroi-cli keys cleanup-settings' to strip any plaintext keys from settings.json.");
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Import MCP secrets (e.g. Tavily) from a Bitwarden vault into the OS
|
|
493
|
-
* keychain via mcp-keychain. Vault items are expected at `<prefix><id>` —
|
|
494
|
-
* default prefix `muonroi-cli/`. The key value is read from the item's
|
|
495
|
-
* notes field, mirroring the provider import-bw flow.
|
|
496
|
-
*/
|
|
497
|
-
export async function runMcpImportBw(opts = {}) {
|
|
498
|
-
const which = spawnSync("bw", ["--version"], { encoding: "utf8" });
|
|
499
|
-
if (which.status !== 0) {
|
|
500
|
-
console.error("Bitwarden CLI ('bw') not found in PATH.");
|
|
501
|
-
console.error("Install: https://bitwarden.com/help/cli/");
|
|
502
|
-
process.exit(2);
|
|
503
|
-
}
|
|
504
|
-
const session = process.env.BW_SESSION;
|
|
505
|
-
if (!session) {
|
|
506
|
-
console.error("BW_SESSION not set. Run:");
|
|
507
|
-
console.error(" export BW_SESSION=$(bw unlock --raw)");
|
|
508
|
-
process.exit(2);
|
|
509
|
-
}
|
|
510
|
-
const status = spawnSync("bw", ["status", "--session", session], { encoding: "utf8" });
|
|
511
|
-
if (status.status !== 0) {
|
|
512
|
-
console.error(`bw status failed: ${status.stderr || status.stdout}`);
|
|
513
|
-
process.exit(2);
|
|
514
|
-
}
|
|
515
|
-
let parsed;
|
|
516
|
-
try {
|
|
517
|
-
parsed = JSON.parse(status.stdout);
|
|
518
|
-
}
|
|
519
|
-
catch {
|
|
520
|
-
parsed = {};
|
|
521
|
-
}
|
|
522
|
-
if (parsed.status !== "unlocked") {
|
|
523
|
-
console.error(`Bitwarden vault is not unlocked (status: ${parsed.status ?? "unknown"}).`);
|
|
524
|
-
console.error("Run: export BW_SESSION=$(bw unlock --raw)");
|
|
525
|
-
process.exit(2);
|
|
526
|
-
}
|
|
527
|
-
const requested = opts.keys && opts.keys.length > 0 ? opts.keys : MCP_KEY_IDS.slice();
|
|
528
|
-
const prefix = opts.itemPrefix ?? "muonroi-cli/";
|
|
529
|
-
let imported = 0;
|
|
530
|
-
let skipped = 0;
|
|
531
|
-
for (const id of requested) {
|
|
532
|
-
if (!isMcpKeyId(id)) {
|
|
533
|
-
console.warn(`Skip unknown MCP key: ${id}`);
|
|
534
|
-
skipped++;
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
const itemName = `${prefix}${id}`;
|
|
538
|
-
const got = spawnSync("bw", ["get", "notes", itemName, "--session", session], { encoding: "utf8" });
|
|
539
|
-
if (got.status !== 0) {
|
|
540
|
-
skipped++;
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
const key = got.stdout.trim();
|
|
544
|
-
if (!key || key.length < 16) {
|
|
545
|
-
console.warn(`Skip ${id}: vault item '${itemName}' empty or too short.`);
|
|
546
|
-
skipped++;
|
|
547
|
-
continue;
|
|
548
|
-
}
|
|
549
|
-
try {
|
|
550
|
-
const ok = await setMcpKey(id, key);
|
|
551
|
-
if (!ok) {
|
|
552
|
-
console.warn(`! ${id} — OS keychain unavailable (keytar or secret service backend).`);
|
|
553
|
-
console.warn(" Linux fix: sudo dnf install libsecret (Fedora) or sudo apt-get install libsecret-1-0 (Ubuntu)");
|
|
554
|
-
console.warn(` Fallback (works at runtime): export ${id.toUpperCase()}_API_KEY=...`);
|
|
555
|
-
skipped++;
|
|
556
|
-
}
|
|
557
|
-
else {
|
|
558
|
-
console.log(`Imported MCP key '${id}' → keychain.`);
|
|
559
|
-
imported++;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
catch (e) {
|
|
563
|
-
console.warn(`Failed ${id}: ${e.message}`);
|
|
564
|
-
skipped++;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
console.log(`\nDone. Imported: ${imported}, skipped: ${skipped}.`);
|
|
568
|
-
}
|
|
569
336
|
export async function runChatKeySet(id, value) {
|
|
570
337
|
if (!value || value.length < 8) {
|
|
571
338
|
console.error(`Value for chat secret '${id}' is too short (< 8 chars).`);
|
|
@@ -586,85 +353,6 @@ export async function runChatKeySet(id, value) {
|
|
|
586
353
|
process.exit(1);
|
|
587
354
|
}
|
|
588
355
|
}
|
|
589
|
-
/**
|
|
590
|
-
* Import chat secrets (discord-token, discord-guild-id, slack-token, slack-team-id)
|
|
591
|
-
* from a Bitwarden vault into the OS keychain. Vault items are expected at
|
|
592
|
-
* `<prefix><id>` — default prefix `muonroi-cli/chat-`. The value is read from
|
|
593
|
-
* the item's notes field, mirroring the provider/MCP import-bw flow.
|
|
594
|
-
*/
|
|
595
|
-
export async function runChatImportBw(opts = {}) {
|
|
596
|
-
const which = spawnSync("bw", ["--version"], { encoding: "utf8" });
|
|
597
|
-
if (which.status !== 0) {
|
|
598
|
-
console.error("Bitwarden CLI ('bw') not found in PATH.");
|
|
599
|
-
console.error("Install: https://bitwarden.com/help/cli/");
|
|
600
|
-
process.exit(2);
|
|
601
|
-
}
|
|
602
|
-
const session = process.env.BW_SESSION;
|
|
603
|
-
if (!session) {
|
|
604
|
-
console.error("BW_SESSION not set. Run:");
|
|
605
|
-
console.error(" export BW_SESSION=$(bw unlock --raw)");
|
|
606
|
-
process.exit(2);
|
|
607
|
-
}
|
|
608
|
-
const status = spawnSync("bw", ["status", "--session", session], { encoding: "utf8" });
|
|
609
|
-
if (status.status !== 0) {
|
|
610
|
-
console.error(`bw status failed: ${status.stderr || status.stdout}`);
|
|
611
|
-
process.exit(2);
|
|
612
|
-
}
|
|
613
|
-
let parsed;
|
|
614
|
-
try {
|
|
615
|
-
parsed = JSON.parse(status.stdout);
|
|
616
|
-
}
|
|
617
|
-
catch {
|
|
618
|
-
parsed = {};
|
|
619
|
-
}
|
|
620
|
-
if (parsed.status !== "unlocked") {
|
|
621
|
-
console.error(`Bitwarden vault is not unlocked (status: ${parsed.status ?? "unknown"}).`);
|
|
622
|
-
console.error("Run: export BW_SESSION=$(bw unlock --raw)");
|
|
623
|
-
process.exit(2);
|
|
624
|
-
}
|
|
625
|
-
const requested = opts.ids && opts.ids.length > 0 ? opts.ids : CHAT_SECRET_IDS.slice();
|
|
626
|
-
const prefix = opts.itemPrefix ?? "muonroi-cli/chat-";
|
|
627
|
-
let imported = 0;
|
|
628
|
-
let skipped = 0;
|
|
629
|
-
for (const id of requested) {
|
|
630
|
-
if (!isChatSecretId(id)) {
|
|
631
|
-
console.warn(`Skip unknown chat secret: ${id}`);
|
|
632
|
-
skipped++;
|
|
633
|
-
continue;
|
|
634
|
-
}
|
|
635
|
-
const itemName = `${prefix}${id}`;
|
|
636
|
-
const got = spawnSync("bw", ["get", "notes", itemName, "--session", session], { encoding: "utf8" });
|
|
637
|
-
if (got.status !== 0) {
|
|
638
|
-
// bw prints "Not found." on stderr when the item is missing — treat as skip.
|
|
639
|
-
skipped++;
|
|
640
|
-
continue;
|
|
641
|
-
}
|
|
642
|
-
const value = got.stdout.trim();
|
|
643
|
-
if (!value || value.length < 8) {
|
|
644
|
-
console.warn(`Skip ${id}: vault item '${itemName}' empty or too short.`);
|
|
645
|
-
skipped++;
|
|
646
|
-
continue;
|
|
647
|
-
}
|
|
648
|
-
try {
|
|
649
|
-
const ok = await setChatSecret(id, value);
|
|
650
|
-
if (!ok) {
|
|
651
|
-
console.warn(`! ${id} — OS keychain unavailable (keytar or secret service backend).`);
|
|
652
|
-
console.warn(" Linux fix: sudo dnf install libsecret (Fedora) or sudo apt-get install libsecret-1-0 (Ubuntu)");
|
|
653
|
-
console.warn(` Fallback (works at runtime): export ${id.includes("token") ? "MUONROI_" : "MUONROI_"}${id.replace("-", "_").toUpperCase()}=...`);
|
|
654
|
-
skipped++;
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
console.log(`Imported chat secret '${id}' → keychain.`);
|
|
658
|
-
imported++;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
catch (e) {
|
|
662
|
-
console.warn(`Failed ${id}: ${e.message}`);
|
|
663
|
-
skipped++;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
console.log(`\nDone. Imported: ${imported}, skipped: ${skipped}.`);
|
|
667
|
-
}
|
|
668
356
|
// ---------------------------------------------------------------------------
|
|
669
357
|
// OAuth login / logout
|
|
670
358
|
// ---------------------------------------------------------------------------
|
|
@@ -679,9 +367,9 @@ export async function runChatImportBw(opts = {}) {
|
|
|
679
367
|
*/
|
|
680
368
|
export async function runKeysLogin(provider) {
|
|
681
369
|
const oauthIds = await getOAuthProviderIds();
|
|
682
|
-
const norm = provider
|
|
370
|
+
const norm = provider;
|
|
683
371
|
if (!oauthIds.includes(norm)) {
|
|
684
|
-
const supported = oauthIds.
|
|
372
|
+
const supported = oauthIds.join(", ");
|
|
685
373
|
console.error(`OAuth login not supported for '${provider}'. Supported: ${supported}`);
|
|
686
374
|
process.exit(1);
|
|
687
375
|
}
|
|
@@ -693,22 +381,6 @@ export async function runKeysLogin(provider) {
|
|
|
693
381
|
process.exit(1);
|
|
694
382
|
}
|
|
695
383
|
const name = cfg.displayName;
|
|
696
|
-
// Special handling for google: prefer importing/reusing token from agy local config
|
|
697
|
-
// (~/.gemini/oauth_creds.json) so existing agy login "just works" without browser.
|
|
698
|
-
if (provider === "google") {
|
|
699
|
-
const { loadAgyTokensWithRefresh } = await import("../providers/auth/gemini-oauth.js");
|
|
700
|
-
const existing = await loadAgyTokensWithRefresh();
|
|
701
|
-
if (existing?.accessToken) {
|
|
702
|
-
console.log(`Found existing agy token for ${existing.email || "(no email)"}.`);
|
|
703
|
-
console.log("Reusing it (refreshed if near expiry). No browser needed.");
|
|
704
|
-
const expiry = new Date(existing.expiresAt).toLocaleString();
|
|
705
|
-
const isExpired = Date.now() > existing.expiresAt;
|
|
706
|
-
console.log(`Token expires: ${expiry}${isExpired ? " (was expired, refresh attempted)" : ""}`);
|
|
707
|
-
console.log("Run 'muonroi-cli keys list' to verify.");
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
// No existing agy token — fall through to normal browser flow (using agy client)
|
|
711
|
-
}
|
|
712
384
|
console.log(`Logging in to ${name} via OAuth...`);
|
|
713
385
|
console.log("A browser window will open. Complete the sign-in to continue.");
|
|
714
386
|
const tokens = await cfg.provider.login({
|
|
@@ -729,6 +401,16 @@ export async function runKeysLogin(provider) {
|
|
|
729
401
|
},
|
|
730
402
|
});
|
|
731
403
|
await saveTokens(norm, tokens);
|
|
404
|
+
// One auth mode per provider (OAuth XOR API key): logging in via OAuth clears
|
|
405
|
+
// any stored API key for this provider so a stale key can never shadow OAuth.
|
|
406
|
+
try {
|
|
407
|
+
const { clearEnvVar } = await import("../providers/env-store.js");
|
|
408
|
+
const { ENV_BY_PROVIDER } = await import("../providers/keychain.js");
|
|
409
|
+
clearEnvVar(ENV_BY_PROVIDER[norm]);
|
|
410
|
+
}
|
|
411
|
+
catch (err) {
|
|
412
|
+
console.error(`[keys] failed to clear API key after OAuth login for ${norm}: ${err instanceof Error ? err.message : String(err)}`);
|
|
413
|
+
}
|
|
732
414
|
const emailDisplay = tokens.email ? ` (${tokens.email})` : "";
|
|
733
415
|
const expiry = new Date(tokens.expiresAt).toLocaleString();
|
|
734
416
|
console.log(`\nLogged in to ${name}${emailDisplay}. Token expires: ${expiry}`);
|
|
@@ -742,9 +424,9 @@ export async function runKeysLogin(provider) {
|
|
|
742
424
|
*/
|
|
743
425
|
export async function runKeysLogout(provider) {
|
|
744
426
|
const oauthIds = await getOAuthProviderIds();
|
|
745
|
-
const norm = provider
|
|
427
|
+
const norm = provider;
|
|
746
428
|
if (!oauthIds.includes(norm)) {
|
|
747
|
-
const supported = oauthIds.
|
|
429
|
+
const supported = oauthIds.join(", ");
|
|
748
430
|
console.error(`OAuth logout not supported for '${provider}'. Supported: ${supported}`);
|
|
749
431
|
process.exit(1);
|
|
750
432
|
}
|
|
@@ -763,54 +445,4 @@ export async function runKeysLogout(provider) {
|
|
|
763
445
|
const name = cfg?.displayName ?? provider;
|
|
764
446
|
console.log(`Logged out of ${name}. OAuth tokens revoked and deleted.`);
|
|
765
447
|
}
|
|
766
|
-
export async function runKeysCleanupSettings() {
|
|
767
|
-
let raw;
|
|
768
|
-
try {
|
|
769
|
-
raw = await fs.readFile(SETTINGS_PATH, "utf8");
|
|
770
|
-
}
|
|
771
|
-
catch (e) {
|
|
772
|
-
if (e.code === "ENOENT") {
|
|
773
|
-
console.log("No user-settings.json found — nothing to clean.");
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
throw e;
|
|
777
|
-
}
|
|
778
|
-
let json;
|
|
779
|
-
try {
|
|
780
|
-
json = JSON.parse(raw);
|
|
781
|
-
}
|
|
782
|
-
catch {
|
|
783
|
-
console.error(`Settings file is not valid JSON: ${SETTINGS_PATH}`);
|
|
784
|
-
process.exit(1);
|
|
785
|
-
}
|
|
786
|
-
const ts = new Date().toISOString().replace(/[:.]/g, "-");
|
|
787
|
-
const backup = `${SETTINGS_PATH}.bak.${ts}`;
|
|
788
|
-
await fs.writeFile(backup, raw, "utf8");
|
|
789
|
-
let removed = 0;
|
|
790
|
-
if ("apiKey" in json) {
|
|
791
|
-
delete json.apiKey;
|
|
792
|
-
removed++;
|
|
793
|
-
}
|
|
794
|
-
if (json.providers && typeof json.providers === "object") {
|
|
795
|
-
const providers = json.providers;
|
|
796
|
-
for (const [name, block] of Object.entries(providers)) {
|
|
797
|
-
if (block && "apiKey" in block) {
|
|
798
|
-
delete block.apiKey;
|
|
799
|
-
removed++;
|
|
800
|
-
if (Object.keys(block).length === 0) {
|
|
801
|
-
delete providers[name];
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
if (Object.keys(providers).length === 0) {
|
|
806
|
-
delete json.providers;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
await fs.writeFile(SETTINGS_PATH, `${JSON.stringify(json, null, 2)}\n`, "utf8");
|
|
810
|
-
console.log(`Backed up to: ${backup}`);
|
|
811
|
-
console.log(`Removed ${removed} plaintext key field(s) from: ${SETTINGS_PATH}`);
|
|
812
|
-
if (removed === 0) {
|
|
813
|
-
console.log("(File was already clean.)");
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
448
|
//# sourceMappingURL=keys.js.map
|
|
@@ -46,6 +46,7 @@ export declare function judgeReadiness(spec: ClarifiedSpec, topic: string, qa: A
|
|
|
46
46
|
confidence: number;
|
|
47
47
|
gaps: string[];
|
|
48
48
|
}>;
|
|
49
|
+
export declare function resolveInterviewLanguage(topic: string): string;
|
|
49
50
|
export interface ClarifyOptionsResult {
|
|
50
51
|
options: CouncilQuestionOption[];
|
|
51
52
|
/**
|
|
@@ -68,7 +69,28 @@ export interface ClarifyOptionsResult {
|
|
|
68
69
|
* returned `defaultIndex` points to it. Otherwise `defaultIndex` is omitted
|
|
69
70
|
* so the UI knows to suppress the "(Recommended)" tag.
|
|
70
71
|
*/
|
|
71
|
-
export declare function buildClarifyOptions(suggestions: string[] | undefined, recommended?: string): ClarifyOptionsResult;
|
|
72
|
+
export declare function buildClarifyOptions(suggestions: string[] | undefined, recommended?: string, lang?: string): ClarifyOptionsResult;
|
|
73
|
+
/**
|
|
74
|
+
* Model-designed option object: a choice the user picks between, carrying its
|
|
75
|
+
* own explanation. `recommended:true` marks the pre-selected default. This is
|
|
76
|
+
* the richer shape the clarifier prompt now asks for so every choice shows a
|
|
77
|
+
* per-option "why" (not just the question-level `why`).
|
|
78
|
+
*/
|
|
79
|
+
export interface ClarifyOptionSpec {
|
|
80
|
+
label: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
recommended?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build council options from the model's richer `{label, description,
|
|
86
|
+
* recommended}` objects, preserving each choice's explanation as `description`
|
|
87
|
+
* and pointing `defaultIndex` at the option the model flagged `recommended`
|
|
88
|
+
* (falling back to the first when none is flagged). The same "Type something" /
|
|
89
|
+
* "Chat about this" escape-hatches are appended as in `buildClarifyOptions`.
|
|
90
|
+
* Pure + exported for unit testing.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildClarifyOptionsRich(specs: ClarifyOptionSpec[] | undefined, lang?: string): ClarifyOptionsResult;
|
|
93
|
+
export declare function researchScopeForClarification(topic: string, conversationContext: string, leaderModelId: string, llm: CouncilLLM, signal: AbortSignal | undefined, reachableModels: string[]): AsyncGenerator<StreamChunk, string, unknown>;
|
|
72
94
|
export declare function runClarification(topic: string, leaderModelId: string, conversationContext: string, respondToQuestion: QuestionResponder, llm: CouncilLLM, signal?: AbortSignal, seedQuestions?: GrayAreaQuestion[], maxRounds?: number,
|
|
73
95
|
/**
|
|
74
96
|
* Optional pre-filled answers keyed by seed-question id. When the loop's
|
|
@@ -83,5 +105,11 @@ prefillAnswers?: Map<string, string>,
|
|
|
83
105
|
* a cheaper tier model on the same provider as the leader. Falls back to
|
|
84
106
|
* the leader model if no cheaper model is cataloged. Default false.
|
|
85
107
|
*/
|
|
86
|
-
costAware?: boolean
|
|
87
|
-
|
|
108
|
+
costAware?: boolean,
|
|
109
|
+
/**
|
|
110
|
+
* Healthy panel models to fall back to when the leader's cost-tier spec-synth
|
|
111
|
+
* model is on a failing proxy — keeps the spec's ≥3 observable criteria (and
|
|
112
|
+
* thus a meaningful leader eval) instead of degrading to one generic criterion.
|
|
113
|
+
*/
|
|
114
|
+
fallbackModels?: string[]): AsyncGenerator<StreamChunk, ClarifiedSpec, unknown>;
|
|
115
|
+
export declare function buildSpecFromTopic(topic: string, conversationContext: string): ClarifiedSpec;
|