open-multi-agent-kit 0.98.3 → 0.98.5
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/CHANGELOG.md +44 -0
- package/README.md +12 -2
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +14 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +3 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/mcp-attach.d.ts +3 -3
- package/dist/cli/mcp-attach.d.ts.map +1 -1
- package/dist/cli/mcp-attach.js +5 -4
- package/dist/cli/mcp-attach.js.map +1 -1
- package/dist/cli/model-contract.d.ts +5 -0
- package/dist/cli/model-contract.d.ts.map +1 -0
- package/dist/cli/model-contract.js +45 -0
- package/dist/cli/model-contract.js.map +1 -0
- package/dist/commands/adaptorch-doctor-cli.d.ts.map +1 -1
- package/dist/commands/adaptorch-doctor-cli.js +32 -10
- package/dist/commands/adaptorch-doctor-cli.js.map +1 -1
- package/dist/commands/init-cli.d.ts +12 -0
- package/dist/commands/init-cli.d.ts.map +1 -0
- package/dist/commands/init-cli.js +76 -0
- package/dist/commands/init-cli.js.map +1 -0
- package/dist/commands/provider-sync-cli.d.ts +27 -0
- package/dist/commands/provider-sync-cli.d.ts.map +1 -0
- package/dist/commands/provider-sync-cli.js +177 -0
- package/dist/commands/provider-sync-cli.js.map +1 -0
- package/dist/commands/run-command.d.ts +9 -0
- package/dist/commands/run-command.d.ts.map +1 -0
- package/dist/commands/run-command.js +34 -0
- package/dist/commands/run-command.js.map +1 -0
- package/dist/commands/verified-run-cli.d.ts +6 -0
- package/dist/commands/verified-run-cli.d.ts.map +1 -0
- package/dist/commands/verified-run-cli.js +190 -0
- package/dist/commands/verified-run-cli.js.map +1 -0
- package/dist/core/active-skill-state.d.ts +7 -0
- package/dist/core/active-skill-state.d.ts.map +1 -0
- package/dist/core/active-skill-state.js +25 -0
- package/dist/core/active-skill-state.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +10 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +43 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +7 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +91 -126
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/codex-chatgpt-web-bridge.d.ts +99 -0
- package/dist/core/codex-chatgpt-web-bridge.d.ts.map +1 -0
- package/dist/core/codex-chatgpt-web-bridge.js +192 -0
- package/dist/core/codex-chatgpt-web-bridge.js.map +1 -0
- package/dist/core/codex-chatgpt-web-sync.d.ts +50 -0
- package/dist/core/codex-chatgpt-web-sync.d.ts.map +1 -0
- package/dist/core/codex-chatgpt-web-sync.js +119 -0
- package/dist/core/codex-chatgpt-web-sync.js.map +1 -0
- package/dist/core/compaction/compaction-headroom.d.ts +30 -0
- package/dist/core/compaction/compaction-headroom.d.ts.map +1 -0
- package/dist/core/compaction/compaction-headroom.js +48 -0
- package/dist/core/compaction/compaction-headroom.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +2 -29
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +19 -47
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/overflow-retry-guard.d.ts +20 -0
- package/dist/core/compaction/overflow-retry-guard.d.ts.map +1 -0
- package/dist/core/compaction/overflow-retry-guard.js +38 -0
- package/dist/core/compaction/overflow-retry-guard.js.map +1 -0
- package/dist/core/context-budget-headroom-types.d.ts.map +1 -1
- package/dist/core/context-budget-headroom-types.js +1 -1
- package/dist/core/context-budget-headroom-types.js.map +1 -1
- package/dist/core/context-budget-token-counter-types.d.ts +27 -0
- package/dist/core/context-budget-token-counter-types.d.ts.map +1 -0
- package/dist/core/context-budget-token-counter-types.js +2 -0
- package/dist/core/context-budget-token-counter-types.js.map +1 -0
- package/dist/core/context-budget-token-counter.d.ts +2 -26
- package/dist/core/context-budget-token-counter.d.ts.map +1 -1
- package/dist/core/context-budget-token-counter.js +2 -0
- package/dist/core/context-budget-token-counter.js.map +1 -1
- package/dist/core/context-budget-v2-scoring.d.ts.map +1 -1
- package/dist/core/context-budget-v2-scoring.js +14 -10
- package/dist/core/context-budget-v2-scoring.js.map +1 -1
- package/dist/core/domain-router.d.ts.map +1 -1
- package/dist/core/domain-router.js +1 -1
- package/dist/core/domain-router.js.map +1 -1
- package/dist/core/grok-harness-dispatch.d.ts +4 -0
- package/dist/core/grok-harness-dispatch.d.ts.map +1 -1
- package/dist/core/grok-harness-dispatch.js +20 -3
- package/dist/core/grok-harness-dispatch.js.map +1 -1
- package/dist/core/grok-harness.d.ts +15 -9
- package/dist/core/grok-harness.d.ts.map +1 -1
- package/dist/core/grok-harness.js +34 -8
- package/dist/core/grok-harness.js.map +1 -1
- package/dist/core/mcp/tools.d.ts +2 -2
- package/dist/core/mcp/tools.d.ts.map +1 -1
- package/dist/core/mcp/tools.js +29 -3
- package/dist/core/mcp/tools.js.map +1 -1
- package/dist/core/model-registry-schema.d.ts +1081 -0
- package/dist/core/model-registry-schema.d.ts.map +1 -0
- package/dist/core/model-registry-schema.js +148 -0
- package/dist/core/model-registry-schema.js.map +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +1 -146
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/prompt-preset.d.ts +1 -1
- package/dist/core/prompt-preset.d.ts.map +1 -1
- package/dist/core/prompt-preset.js +16 -1
- package/dist/core/prompt-preset.js.map +1 -1
- package/dist/core/prompt-settlement.d.ts +4 -3
- package/dist/core/prompt-settlement.d.ts.map +1 -1
- package/dist/core/prompt-settlement.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/provider-resilience.d.ts +8 -0
- package/dist/core/provider-resilience.d.ts.map +1 -1
- package/dist/core/provider-resilience.js +20 -3
- package/dist/core/provider-resilience.js.map +1 -1
- package/dist/core/provider-usage-types.d.ts +42 -0
- package/dist/core/provider-usage-types.d.ts.map +1 -0
- package/dist/core/provider-usage-types.js +2 -0
- package/dist/core/provider-usage-types.js.map +1 -0
- package/dist/core/provider-usage.d.ts +2 -31
- package/dist/core/provider-usage.d.ts.map +1 -1
- package/dist/core/provider-usage.js +4 -0
- package/dist/core/provider-usage.js.map +1 -1
- package/dist/core/redaction.d.ts.map +1 -1
- package/dist/core/redaction.js +18 -2
- package/dist/core/redaction.js.map +1 -1
- package/dist/core/run-budget-policy.d.ts +18 -0
- package/dist/core/run-budget-policy.d.ts.map +1 -0
- package/dist/core/run-budget-policy.js +52 -0
- package/dist/core/run-budget-policy.js.map +1 -0
- package/dist/core/run-budget.d.ts +33 -0
- package/dist/core/run-budget.d.ts.map +1 -0
- package/dist/core/run-budget.js +89 -0
- package/dist/core/run-budget.js.map +1 -0
- package/dist/core/run-execution-api.d.ts +15 -0
- package/dist/core/run-execution-api.d.ts.map +1 -0
- package/dist/core/run-execution-api.js +7 -0
- package/dist/core/run-execution-api.js.map +1 -0
- package/dist/core/run-journal.d.ts.map +1 -1
- package/dist/core/run-journal.js +30 -208
- package/dist/core/run-journal.js.map +1 -1
- package/dist/core/sandbox/policy-merge.d.ts +6 -0
- package/dist/core/sandbox/policy-merge.d.ts.map +1 -0
- package/dist/core/sandbox/policy-merge.js +74 -0
- package/dist/core/sandbox/policy-merge.js.map +1 -0
- package/dist/core/sandbox/policy-paths.d.ts +4 -0
- package/dist/core/sandbox/policy-paths.d.ts.map +1 -0
- package/dist/core/sandbox/policy-paths.js +21 -0
- package/dist/core/sandbox/policy-paths.js.map +1 -0
- package/dist/core/sandbox/policy-types.d.ts +75 -0
- package/dist/core/sandbox/policy-types.d.ts.map +1 -0
- package/dist/core/sandbox/policy-types.js +2 -0
- package/dist/core/sandbox/policy-types.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +3 -77
- package/dist/core/sandbox/policy.d.ts.map +1 -1
- package/dist/core/sandbox/policy.js +3 -98
- package/dist/core/sandbox/policy.js.map +1 -1
- package/dist/core/sdk-provider-stream.d.ts +14 -0
- package/dist/core/sdk-provider-stream.d.ts.map +1 -0
- package/dist/core/sdk-provider-stream.js +38 -0
- package/dist/core/sdk-provider-stream.js.map +1 -0
- package/dist/core/sdk.d.ts +5 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +17 -33
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-bash-service.d.ts +2 -2
- package/dist/core/session-bash-service.d.ts.map +1 -1
- package/dist/core/session-bash-service.js +21 -9
- package/dist/core/session-bash-service.js.map +1 -1
- package/dist/core/session-failure-cause.d.ts.map +1 -1
- package/dist/core/session-failure-cause.js +15 -3
- package/dist/core/session-failure-cause.js.map +1 -1
- package/dist/core/session-prompt-lifecycle.d.ts +25 -0
- package/dist/core/session-prompt-lifecycle.d.ts.map +1 -0
- package/dist/core/session-prompt-lifecycle.js +87 -0
- package/dist/core/session-prompt-lifecycle.js.map +1 -0
- package/dist/core/session-run-budget.d.ts +28 -0
- package/dist/core/session-run-budget.d.ts.map +1 -0
- package/dist/core/session-run-budget.js +127 -0
- package/dist/core/session-run-budget.js.map +1 -0
- package/dist/core/session-run-termination.d.ts +18 -0
- package/dist/core/session-run-termination.d.ts.map +1 -0
- package/dist/core/session-run-termination.js +72 -0
- package/dist/core/session-run-termination.js.map +1 -0
- package/dist/core/session-termination-types.d.ts +97 -0
- package/dist/core/session-termination-types.d.ts.map +1 -0
- package/dist/core/session-termination-types.js +26 -0
- package/dist/core/session-termination-types.js.map +1 -0
- package/dist/core/session-termination.d.ts +3 -97
- package/dist/core/session-termination.d.ts.map +1 -1
- package/dist/core/session-termination.js +25 -29
- package/dist/core/session-termination.js.map +1 -1
- package/dist/core/skill-selector.d.ts +40 -0
- package/dist/core/skill-selector.d.ts.map +1 -0
- package/dist/core/skill-selector.js +102 -0
- package/dist/core/skill-selector.js.map +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-lane-launcher.d.ts +3 -2
- package/dist/core/subagent-lane-launcher.d.ts.map +1 -1
- package/dist/core/subagent-lane-launcher.js +24 -13
- package/dist/core/subagent-lane-launcher.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +2 -4
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/turn-metrics-record.d.ts +55 -0
- package/dist/core/turn-metrics-record.d.ts.map +1 -0
- package/dist/core/turn-metrics-record.js +149 -0
- package/dist/core/turn-metrics-record.js.map +1 -0
- package/dist/core/turn-metrics.d.ts +4 -56
- package/dist/core/turn-metrics.d.ts.map +1 -1
- package/dist/core/turn-metrics.js +12 -60
- package/dist/core/turn-metrics.js.map +1 -1
- package/dist/core/verified-run/broker.d.ts +26 -0
- package/dist/core/verified-run/broker.d.ts.map +1 -0
- package/dist/core/verified-run/broker.js +210 -0
- package/dist/core/verified-run/broker.js.map +1 -0
- package/dist/core/verified-run/candidate.d.ts +24 -0
- package/dist/core/verified-run/candidate.d.ts.map +1 -0
- package/dist/core/verified-run/candidate.js +167 -0
- package/dist/core/verified-run/candidate.js.map +1 -0
- package/dist/core/verified-run/check-receipt.d.ts +18 -0
- package/dist/core/verified-run/check-receipt.d.ts.map +1 -0
- package/dist/core/verified-run/check-receipt.js +92 -0
- package/dist/core/verified-run/check-receipt.js.map +1 -0
- package/dist/core/verified-run/coordinator.d.ts +39 -0
- package/dist/core/verified-run/coordinator.d.ts.map +1 -0
- package/dist/core/verified-run/coordinator.js +190 -0
- package/dist/core/verified-run/coordinator.js.map +1 -0
- package/dist/core/verified-run/dag-candidates.d.ts +8 -0
- package/dist/core/verified-run/dag-candidates.d.ts.map +1 -0
- package/dist/core/verified-run/dag-candidates.js +65 -0
- package/dist/core/verified-run/dag-candidates.js.map +1 -0
- package/dist/core/verified-run/dag-phase.d.ts +7 -0
- package/dist/core/verified-run/dag-phase.d.ts.map +1 -0
- package/dist/core/verified-run/dag-phase.js +92 -0
- package/dist/core/verified-run/dag-phase.js.map +1 -0
- package/dist/core/verified-run/dag-projection.d.ts +7 -0
- package/dist/core/verified-run/dag-projection.d.ts.map +1 -0
- package/dist/core/verified-run/dag-projection.js +90 -0
- package/dist/core/verified-run/dag-projection.js.map +1 -0
- package/dist/core/verified-run/dag-recovery.d.ts +13 -0
- package/dist/core/verified-run/dag-recovery.d.ts.map +1 -0
- package/dist/core/verified-run/dag-recovery.js +98 -0
- package/dist/core/verified-run/dag-recovery.js.map +1 -0
- package/dist/core/verified-run/dag-retry-projection.d.ts +9 -0
- package/dist/core/verified-run/dag-retry-projection.d.ts.map +1 -0
- package/dist/core/verified-run/dag-retry-projection.js +43 -0
- package/dist/core/verified-run/dag-retry-projection.js.map +1 -0
- package/dist/core/verified-run/dag-types.d.ts +47 -0
- package/dist/core/verified-run/dag-types.d.ts.map +1 -0
- package/dist/core/verified-run/dag-types.js +2 -0
- package/dist/core/verified-run/dag-types.js.map +1 -0
- package/dist/core/verified-run/event-parser.d.ts +3 -0
- package/dist/core/verified-run/event-parser.d.ts.map +1 -0
- package/dist/core/verified-run/event-parser.js +153 -0
- package/dist/core/verified-run/event-parser.js.map +1 -0
- package/dist/core/verified-run/events.d.ts +4 -0
- package/dist/core/verified-run/events.d.ts.map +1 -0
- package/dist/core/verified-run/events.js +3 -0
- package/dist/core/verified-run/events.js.map +1 -0
- package/dist/core/verified-run/evidence-binding.d.ts +18 -0
- package/dist/core/verified-run/evidence-binding.d.ts.map +1 -0
- package/dist/core/verified-run/evidence-binding.js +81 -0
- package/dist/core/verified-run/evidence-binding.js.map +1 -0
- package/dist/core/verified-run/evidence.d.ts +27 -0
- package/dist/core/verified-run/evidence.d.ts.map +1 -0
- package/dist/core/verified-run/evidence.js +100 -0
- package/dist/core/verified-run/evidence.js.map +1 -0
- package/dist/core/verified-run/journal.d.ts +32 -0
- package/dist/core/verified-run/journal.d.ts.map +1 -0
- package/dist/core/verified-run/journal.js +103 -0
- package/dist/core/verified-run/journal.js.map +1 -0
- package/dist/core/verified-run/namespace-identity.d.ts +11 -0
- package/dist/core/verified-run/namespace-identity.d.ts.map +1 -0
- package/dist/core/verified-run/namespace-identity.js +77 -0
- package/dist/core/verified-run/namespace-identity.js.map +1 -0
- package/dist/core/verified-run/owned-execution.d.ts +21 -0
- package/dist/core/verified-run/owned-execution.d.ts.map +1 -0
- package/dist/core/verified-run/owned-execution.js +43 -0
- package/dist/core/verified-run/owned-execution.js.map +1 -0
- package/dist/core/verified-run/phase-context.d.ts +9 -0
- package/dist/core/verified-run/phase-context.d.ts.map +1 -0
- package/dist/core/verified-run/phase-context.js +2 -0
- package/dist/core/verified-run/phase-context.js.map +1 -0
- package/dist/core/verified-run/process-gate.d.ts +5 -0
- package/dist/core/verified-run/process-gate.d.ts.map +1 -0
- package/dist/core/verified-run/process-gate.js +31 -0
- package/dist/core/verified-run/process-gate.js.map +1 -0
- package/dist/core/verified-run/projection.d.ts +4 -0
- package/dist/core/verified-run/projection.d.ts.map +1 -0
- package/dist/core/verified-run/projection.js +219 -0
- package/dist/core/verified-run/projection.js.map +1 -0
- package/dist/core/verified-run/recovery-clock.d.ts +19 -0
- package/dist/core/verified-run/recovery-clock.d.ts.map +1 -0
- package/dist/core/verified-run/recovery-clock.js +69 -0
- package/dist/core/verified-run/recovery-clock.js.map +1 -0
- package/dist/core/verified-run/recovery-command.d.ts +11 -0
- package/dist/core/verified-run/recovery-command.d.ts.map +1 -0
- package/dist/core/verified-run/recovery-command.js +73 -0
- package/dist/core/verified-run/recovery-command.js.map +1 -0
- package/dist/core/verified-run/recovery-projection.d.ts +12 -0
- package/dist/core/verified-run/recovery-projection.d.ts.map +1 -0
- package/dist/core/verified-run/recovery-projection.js +88 -0
- package/dist/core/verified-run/recovery-projection.js.map +1 -0
- package/dist/core/verified-run/recovery.d.ts +12 -0
- package/dist/core/verified-run/recovery.d.ts.map +1 -0
- package/dist/core/verified-run/recovery.js +115 -0
- package/dist/core/verified-run/recovery.js.map +1 -0
- package/dist/core/verified-run/run-types.d.ts +103 -0
- package/dist/core/verified-run/run-types.d.ts.map +1 -0
- package/dist/core/verified-run/run-types.js +2 -0
- package/dist/core/verified-run/run-types.js.map +1 -0
- package/dist/core/verified-run/scripted-writer.d.ts +15 -0
- package/dist/core/verified-run/scripted-writer.d.ts.map +1 -0
- package/dist/core/verified-run/scripted-writer.js +94 -0
- package/dist/core/verified-run/scripted-writer.js.map +1 -0
- package/dist/core/verified-run/session-port.d.ts +27 -0
- package/dist/core/verified-run/session-port.d.ts.map +1 -0
- package/dist/core/verified-run/session-port.js +2 -0
- package/dist/core/verified-run/session-port.js.map +1 -0
- package/dist/core/verified-run/storage.d.ts +15 -0
- package/dist/core/verified-run/storage.d.ts.map +1 -0
- package/dist/core/verified-run/storage.js +96 -0
- package/dist/core/verified-run/storage.js.map +1 -0
- package/dist/core/verified-run/verification-phase.d.ts +5 -0
- package/dist/core/verified-run/verification-phase.d.ts.map +1 -0
- package/dist/core/verified-run/verification-phase.js +56 -0
- package/dist/core/verified-run/verification-phase.js.map +1 -0
- package/dist/core/verified-run/work-recovery.d.ts +8 -0
- package/dist/core/verified-run/work-recovery.d.ts.map +1 -0
- package/dist/core/verified-run/work-recovery.js +44 -0
- package/dist/core/verified-run/work-recovery.js.map +1 -0
- package/dist/core/verified-run/writer-completion.d.ts +4 -0
- package/dist/core/verified-run/writer-completion.d.ts.map +1 -0
- package/dist/core/verified-run/writer-completion.js +27 -0
- package/dist/core/verified-run/writer-completion.js.map +1 -0
- package/dist/core/verified-run/writer-phase.d.ts +8 -0
- package/dist/core/verified-run/writer-phase.d.ts.map +1 -0
- package/dist/core/verified-run/writer-phase.js +76 -0
- package/dist/core/verified-run/writer-phase.js.map +1 -0
- package/dist/core/verified-run/writer-projection.d.ts +11 -0
- package/dist/core/verified-run/writer-projection.d.ts.map +1 -0
- package/dist/core/verified-run/writer-projection.js +70 -0
- package/dist/core/verified-run/writer-projection.js.map +1 -0
- package/dist/core/verified-run/writer-recovery.d.ts +16 -0
- package/dist/core/verified-run/writer-recovery.d.ts.map +1 -0
- package/dist/core/verified-run/writer-recovery.js +107 -0
- package/dist/core/verified-run/writer-recovery.js.map +1 -0
- package/dist/core/workload-permit-pool.d.ts +1 -3
- package/dist/core/workload-permit-pool.d.ts.map +1 -1
- package/dist/core/workload-permit-pool.js +11 -11
- package/dist/core/workload-permit-pool.js.map +1 -1
- package/dist/guardrails/evidence-system.d.ts +1 -1
- package/dist/guardrails/evidence-system.d.ts.map +1 -1
- package/dist/guardrails/evidence-system.js +18 -29
- package/dist/guardrails/evidence-system.js.map +1 -1
- package/dist/guardrails/merge-gate-result.d.ts +4 -0
- package/dist/guardrails/merge-gate-result.d.ts.map +1 -0
- package/dist/guardrails/merge-gate-result.js +32 -0
- package/dist/guardrails/merge-gate-result.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -23
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/session-failure.d.ts +13 -0
- package/dist/modes/interactive/components/session-failure.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-failure.js +81 -0
- package/dist/modes/interactive/components/session-failure.js.map +1 -0
- package/dist/modes/interactive/interactive-login-options.d.ts +27 -0
- package/dist/modes/interactive/interactive-login-options.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-login-options.js +54 -0
- package/dist/modes/interactive/interactive-login-options.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +8 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +183 -171
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-resume-command.d.ts +3 -0
- package/dist/modes/interactive/interactive-resume-command.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-resume-command.js +24 -0
- package/dist/modes/interactive/interactive-resume-command.js.map +1 -0
- package/dist/modes/interactive/interactive-tool-result.d.ts +32 -0
- package/dist/modes/interactive/interactive-tool-result.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-tool-result.js +59 -0
- package/dist/modes/interactive/interactive-tool-result.js.map +1 -0
- package/dist/modes/interactive/tui-diagnostics.d.ts +36 -0
- package/dist/modes/interactive/tui-diagnostics.d.ts.map +1 -0
- package/dist/modes/interactive/tui-diagnostics.js +105 -0
- package/dist/modes/interactive/tui-diagnostics.js.map +1 -0
- package/dist/modes/interactive/tui-runtime-info.d.ts +20 -0
- package/dist/modes/interactive/tui-runtime-info.d.ts.map +1 -0
- package/dist/modes/interactive/tui-runtime-info.js +76 -0
- package/dist/modes/interactive/tui-runtime-info.js.map +1 -0
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +22 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +10 -60
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/terminal-links.d.ts +13 -0
- package/dist/utils/terminal-links.d.ts.map +1 -0
- package/dist/utils/terminal-links.js +68 -0
- package/dist/utils/terminal-links.js.map +1 -0
- package/dist/utils/windows-clipboard-image.d.ts +16 -0
- package/dist/utils/windows-clipboard-image.d.ts.map +1 -0
- package/dist/utils/windows-clipboard-image.js +87 -0
- package/dist/utils/windows-clipboard-image.js.map +1 -0
- package/docs/adaptorch-onboarding.md +80 -0
- package/docs/containerization.md +12 -0
- package/docs/context-files.md +97 -0
- package/docs/correctness-wall.md +8 -0
- package/docs/custom-provider.md +35 -0
- package/docs/development.md +28 -3
- package/docs/environment-variables.md +2 -0
- package/docs/grok-harness.md +4 -0
- package/docs/harness-boundaries.md +154 -0
- package/docs/harness-improvements.md +90 -0
- package/docs/json.md +19 -0
- package/docs/keybindings.md +2 -2
- package/docs/mcp.md +22 -2
- package/docs/metrics.md +66 -16
- package/docs/model-catalog-refresh.md +190 -0
- package/docs/model-contract.md +168 -0
- package/docs/models.md +21 -4
- package/docs/provider-resilience.md +5 -3
- package/docs/providers.md +68 -1
- package/docs/quickstart.md +4 -0
- package/docs/release-audit-0.98.4.md +112 -0
- package/docs/release-audit-0.98.5.md +84 -0
- package/docs/review-bundle-followup.md +195 -0
- package/docs/run-protocol.md +33 -1
- package/docs/runtime-algorithms.md +45 -0
- package/docs/sdk.md +204 -2
- package/docs/sessions.md +1 -1
- package/docs/settings.md +17 -1
- package/docs/skills.md +2 -0
- package/docs/tb21-audit.md +131 -0
- package/docs/terminal-setup.md +20 -0
- package/docs/usage.md +77 -1
- package/docs/verified-run-testing.md +417 -0
- package/docs/verified-run.md +388 -0
- package/docs/windows.md +48 -0
- package/examples/README.md +4 -0
- package/examples/context/AGENTS.md +64 -0
- package/examples/context/CLAUDE.md +17 -0
- package/examples/context/INTERNET.md +42 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +18 -18
- package/package.json +6 -6
|
@@ -7,12 +7,15 @@ import * as fs from "node:fs";
|
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
9
|
import { spawn, spawnSync } from "child_process";
|
|
10
|
-
import { getProviders, } from "omk-ai";
|
|
11
10
|
import { AttachmentStore } from "../../core/attachment-store.js";
|
|
12
11
|
import { describePromptImageAttachment } from "../../core/prompt-attachment.js";
|
|
13
12
|
import { createAttachmentStrip } from "./components/attachment-strip.js";
|
|
14
|
-
|
|
15
|
-
import {
|
|
13
|
+
export { formatResumeCommand } from "./interactive-resume-command.js";
|
|
14
|
+
import { getApiKeyLoginDisplayName, isApiKeyLoginProvider, resolveLoginProviderArg, } from "./interactive-login-options.js";
|
|
15
|
+
import { disposeComponent, ExpandableText, isExpandable, normalizeToolExecutionResult, } from "./interactive-tool-result.js";
|
|
16
|
+
export { getApiKeyLoginDisplayName, isApiKeyLoginProvider, resolveLoginProviderArg, } from "./interactive-login-options.js";
|
|
17
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, } from "omk-tui";
|
|
18
|
+
import { APP_NAME, APP_TITLE, getAgentDir, getAuthPath, getDocsPath, getShareViewerUrl, VERSION, } from "../../config.js";
|
|
16
19
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
17
20
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
18
21
|
import { parseBangInvocation } from "../../core/bang-skill-invocation.js";
|
|
@@ -25,12 +28,10 @@ import { KeybindingsManager } from "../../core/keybindings.js";
|
|
|
25
28
|
import { createCompactionSummaryMessage } from "../../core/messages.js";
|
|
26
29
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScope } from "../../core/model-resolver.js";
|
|
27
30
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
28
|
-
import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-names.js";
|
|
29
31
|
import { decideResourceAdmission } from "../../core/resource-admission.js";
|
|
30
32
|
import { formatResourcePolicyLines, formatResourceProbeLines, formatResourceSummaryLines, resolveResourceGovernorSettings, } from "../../core/resource-governor-settings.js";
|
|
31
33
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
32
34
|
import { SessionManager } from "../../core/session-manager.js";
|
|
33
|
-
import { formatSessionTermination } from "../../core/session-termination.js";
|
|
34
35
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
35
36
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
36
37
|
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
@@ -40,6 +41,7 @@ import { parseGitUrl } from "../../utils/git.js";
|
|
|
40
41
|
import { openBrowser } from "../../utils/open-browser.js";
|
|
41
42
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
42
43
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
44
|
+
import { terminalMarkdownLinks } from "../../utils/terminal-links.js";
|
|
43
45
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
44
46
|
import { checkForNewOmkVersion } from "../../utils/version-check.js";
|
|
45
47
|
import { ArminComponent } from "./components/armin.js";
|
|
@@ -67,6 +69,7 @@ import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
|
67
69
|
import { OAuthAccountSelectorComponent } from "./components/oauth-account-selector.js";
|
|
68
70
|
import { OAuthSelectorComponent } from "./components/oauth-selector.js";
|
|
69
71
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
72
|
+
import { SessionFailureComponent } from "./components/session-failure.js";
|
|
70
73
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
71
74
|
import { SettingsSelectorComponent, ThinkingSelectorComponent } from "./components/settings-selector.js";
|
|
72
75
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
@@ -76,63 +79,9 @@ import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
|
76
79
|
import { UserMessageComponent } from "./components/user-message.js";
|
|
77
80
|
import { UserMessageSelectorComponent } from "./components/user-message-selector.js";
|
|
78
81
|
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, initTheme, onThemeChange, setRegisteredThemes, setTheme, setThemeInstance, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
function disposeComponent(component) {
|
|
83
|
-
if (typeof component === "object" &&
|
|
84
|
-
component !== null &&
|
|
85
|
-
"dispose" in component &&
|
|
86
|
-
typeof component.dispose === "function") {
|
|
87
|
-
component.dispose();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function isRecord(value) {
|
|
91
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
92
|
-
}
|
|
93
|
-
function isToolExecutionContent(value) {
|
|
94
|
-
if (!isRecord(value))
|
|
95
|
-
return false;
|
|
96
|
-
if (value.type === "text")
|
|
97
|
-
return typeof value.text === "string";
|
|
98
|
-
return value.type === "image" && typeof value.data === "string" && typeof value.mimeType === "string";
|
|
99
|
-
}
|
|
100
|
-
function isToolExecutionResult(value) {
|
|
101
|
-
return isRecord(value) && Array.isArray(value.content) && value.content.every(isToolExecutionContent);
|
|
102
|
-
}
|
|
103
|
-
function normalizeToolExecutionResult(result, isError) {
|
|
104
|
-
try {
|
|
105
|
-
if (isToolExecutionResult(result)) {
|
|
106
|
-
return { content: result.content, details: result.details, isError };
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
// Treat inaccessible or malformed extension payloads as invalid results.
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
content: [{ type: "text", text: "Tool returned an invalid result." }],
|
|
114
|
-
isError: true,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
class ExpandableText extends Text {
|
|
118
|
-
getCollapsedText;
|
|
119
|
-
getExpandedText;
|
|
120
|
-
expanded;
|
|
121
|
-
constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
|
|
122
|
-
super(expanded ? getExpandedText() : getCollapsedText(), paddingX, paddingY);
|
|
123
|
-
this.getCollapsedText = getCollapsedText;
|
|
124
|
-
this.getExpandedText = getExpandedText;
|
|
125
|
-
this.expanded = expanded;
|
|
126
|
-
}
|
|
127
|
-
setExpanded(expanded) {
|
|
128
|
-
this.expanded = expanded;
|
|
129
|
-
this.setText(expanded ? this.getExpandedText() : this.getCollapsedText());
|
|
130
|
-
}
|
|
131
|
-
invalidate() {
|
|
132
|
-
this.setText(this.expanded ? this.getExpandedText() : this.getCollapsedText());
|
|
133
|
-
super.invalidate();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
82
|
+
import { createTuiDiagnostics, createTuiDiagnosticsView, saveTuiDiagnostics } from "./tui-diagnostics.js";
|
|
83
|
+
import { captureTuiRuntime, inspectTuiRuntime } from "./tui-runtime-info.js";
|
|
84
|
+
const TUI_RUNTIME = captureTuiRuntime(import.meta.url);
|
|
136
85
|
const DEAD_TERMINAL_ERROR_CODES = new Set(["EIO", "EPIPE", "ENOTCONN"]);
|
|
137
86
|
/**
|
|
138
87
|
* Pseudo-entry for the thinking selector/autocomplete representing auto mode.
|
|
@@ -155,41 +104,10 @@ function isAnthropicSubscriptionAuthKey(apiKey) {
|
|
|
155
104
|
function isUnknownModel(model) {
|
|
156
105
|
return !!model && model.provider === "unknown" && model.id === "unknown" && model.api === "unknown";
|
|
157
106
|
}
|
|
158
|
-
function quoteIfNeeded(value) {
|
|
159
|
-
if (value.length > 0 && !/[^a-zA-Z0-9_\-./~:@]/.test(value)) {
|
|
160
|
-
return value;
|
|
161
|
-
}
|
|
162
|
-
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
163
|
-
}
|
|
164
|
-
export function formatResumeCommand(sessionManager) {
|
|
165
|
-
if (!process.stdout.isTTY)
|
|
166
|
-
return undefined;
|
|
167
|
-
if (!sessionManager.isPersisted())
|
|
168
|
-
return undefined;
|
|
169
|
-
const sessionFile = sessionManager.getSessionFile();
|
|
170
|
-
if (!sessionFile || !fs.existsSync(sessionFile))
|
|
171
|
-
return undefined;
|
|
172
|
-
const args = [APP_NAME];
|
|
173
|
-
if (!sessionManager.usesDefaultSessionDir()) {
|
|
174
|
-
args.push("--session-dir", quoteIfNeeded(sessionManager.getSessionDir()));
|
|
175
|
-
}
|
|
176
|
-
args.push("--session", sessionManager.getSessionId());
|
|
177
|
-
return args.join(" ");
|
|
178
|
-
}
|
|
179
107
|
function hasDefaultModelProvider(providerId) {
|
|
180
108
|
return providerId in defaultModelPerProvider;
|
|
181
109
|
}
|
|
182
110
|
const BEDROCK_PROVIDER_ID = "amazon-bedrock";
|
|
183
|
-
const BUILT_IN_MODEL_PROVIDERS = new Set(getProviders());
|
|
184
|
-
export function isApiKeyLoginProvider(providerId, oauthProviderIds, builtInProviderIds = BUILT_IN_MODEL_PROVIDERS) {
|
|
185
|
-
if (BUILT_IN_PROVIDER_DISPLAY_NAMES[providerId]) {
|
|
186
|
-
return true;
|
|
187
|
-
}
|
|
188
|
-
if (builtInProviderIds.has(providerId)) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return !oauthProviderIds.has(providerId);
|
|
192
|
-
}
|
|
193
111
|
/** Placeholder shown in the empty editor to make core affordances discoverable. */
|
|
194
112
|
const EDITOR_PLACEHOLDER = "Ask anything · / for commands · ! for skills/bash";
|
|
195
113
|
/** How long transient info notices stay visible below the editor. */
|
|
@@ -219,6 +137,7 @@ export class InteractiveMode {
|
|
|
219
137
|
// Stored so the same manager can be injected into custom editors, selectors, and extension UI.
|
|
220
138
|
keybindings;
|
|
221
139
|
version;
|
|
140
|
+
lastResourceReloadAt;
|
|
222
141
|
isInitialized = false;
|
|
223
142
|
onInputCallback;
|
|
224
143
|
pendingPromptPayloads = [];
|
|
@@ -434,6 +353,46 @@ export class InteractiveMode {
|
|
|
434
353
|
});
|
|
435
354
|
};
|
|
436
355
|
}
|
|
356
|
+
const loginCommand = slashCommands.find((command) => command.name === "login");
|
|
357
|
+
if (loginCommand) {
|
|
358
|
+
loginCommand.argumentHint = "[provider]";
|
|
359
|
+
loginCommand.getArgumentCompletions = (prefix) => {
|
|
360
|
+
const options = this.getLoginProviderOptions();
|
|
361
|
+
// Dedupe ids that appear as both oauth and api_key (e.g.
|
|
362
|
+
// meta): keep the oauth (subscription) entry.
|
|
363
|
+
const byId = new Map();
|
|
364
|
+
for (const option of options) {
|
|
365
|
+
const existing = byId.get(option.id);
|
|
366
|
+
if (!existing || (existing.authType !== "oauth" && option.authType === "oauth")) {
|
|
367
|
+
byId.set(option.id, option);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
const unique = [...byId.values()];
|
|
371
|
+
const filtered = fuzzyFilter(unique, prefix.trimStart(), (option) => `${option.id} ${option.name}`);
|
|
372
|
+
if (filtered.length === 0)
|
|
373
|
+
return null;
|
|
374
|
+
return filtered.map((option) => ({
|
|
375
|
+
value: option.id,
|
|
376
|
+
label: option.id,
|
|
377
|
+
description: option.name,
|
|
378
|
+
}));
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
const logoutCommand = slashCommands.find((command) => command.name === "logout");
|
|
382
|
+
if (logoutCommand) {
|
|
383
|
+
logoutCommand.argumentHint = "[provider]";
|
|
384
|
+
logoutCommand.getArgumentCompletions = (prefix) => {
|
|
385
|
+
const options = this.getLogoutProviderOptions();
|
|
386
|
+
const filtered = fuzzyFilter(options, prefix.trimStart(), (option) => `${option.id} ${option.name}`);
|
|
387
|
+
if (filtered.length === 0)
|
|
388
|
+
return null;
|
|
389
|
+
return filtered.map((option) => ({
|
|
390
|
+
value: option.id,
|
|
391
|
+
label: option.id,
|
|
392
|
+
description: option.name,
|
|
393
|
+
}));
|
|
394
|
+
};
|
|
395
|
+
}
|
|
437
396
|
const modelCommand = slashCommands.find((command) => command.name === "model");
|
|
438
397
|
if (modelCommand) {
|
|
439
398
|
modelCommand.getArgumentCompletions = (prefix) => {
|
|
@@ -899,6 +858,7 @@ export class InteractiveMode {
|
|
|
899
858
|
getMarkdownThemeWithSettings() {
|
|
900
859
|
return {
|
|
901
860
|
...getMarkdownTheme(),
|
|
861
|
+
...terminalMarkdownLinks(this.sessionManager.getCwd()),
|
|
902
862
|
codeBlockIndent: this.settingsManager.getCodeBlockIndent(),
|
|
903
863
|
};
|
|
904
864
|
}
|
|
@@ -2217,7 +2177,7 @@ export class InteractiveMode {
|
|
|
2217
2177
|
this.updateEditorBorderColor();
|
|
2218
2178
|
}
|
|
2219
2179
|
};
|
|
2220
|
-
// Handle clipboard image
|
|
2180
|
+
// Handle the configured clipboard image shortcut (Ctrl+V or Alt+V).
|
|
2221
2181
|
this.defaultEditor.onPasteImage = () => {
|
|
2222
2182
|
this.handleClipboardImagePaste();
|
|
2223
2183
|
};
|
|
@@ -2226,18 +2186,13 @@ export class InteractiveMode {
|
|
|
2226
2186
|
try {
|
|
2227
2187
|
const image = await readClipboardImage();
|
|
2228
2188
|
if (!image) {
|
|
2189
|
+
this.showStatus("No image in clipboard. Copy a screenshot, then press Alt+V (or Ctrl+V if forwarded by your terminal).");
|
|
2229
2190
|
return;
|
|
2230
2191
|
}
|
|
2231
|
-
|
|
2232
|
-
try {
|
|
2233
|
-
attachment = this.attachmentStore.put(new Uint8Array(image.bytes), "clipboard");
|
|
2234
|
-
}
|
|
2235
|
-
catch (error) {
|
|
2236
|
-
this.showWarning(error instanceof Error ? error.message : String(error));
|
|
2237
|
-
return;
|
|
2238
|
-
}
|
|
2192
|
+
const attachment = this.attachmentStore.put(new Uint8Array(image.bytes), "clipboard");
|
|
2239
2193
|
this.draftAttachmentIds.push(attachment.id);
|
|
2240
2194
|
this.refreshAttachmentStrip();
|
|
2195
|
+
this.showStatus("Image attached to the prompt. Submit when ready.");
|
|
2241
2196
|
}
|
|
2242
2197
|
catch (error) {
|
|
2243
2198
|
this.showWarning(`Clipboard paste failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -2433,13 +2388,25 @@ export class InteractiveMode {
|
|
|
2433
2388
|
this.editor.setText("");
|
|
2434
2389
|
return;
|
|
2435
2390
|
}
|
|
2436
|
-
if (text === "/login") {
|
|
2437
|
-
|
|
2391
|
+
if (text === "/login" || text.startsWith("/login ")) {
|
|
2392
|
+
const providerArg = text.startsWith("/login ") ? text.slice("/login".length).trim() : undefined;
|
|
2393
|
+
if (providerArg) {
|
|
2394
|
+
await this.handleLoginProviderArg(providerArg);
|
|
2395
|
+
}
|
|
2396
|
+
else {
|
|
2397
|
+
this.showOAuthSelector("login");
|
|
2398
|
+
}
|
|
2438
2399
|
this.editor.setText("");
|
|
2439
2400
|
return;
|
|
2440
2401
|
}
|
|
2441
|
-
if (text === "/logout") {
|
|
2442
|
-
|
|
2402
|
+
if (text === "/logout" || text.startsWith("/logout ")) {
|
|
2403
|
+
const providerArg = text.startsWith("/logout ") ? text.slice("/logout".length).trim() : undefined;
|
|
2404
|
+
if (providerArg) {
|
|
2405
|
+
await this.handleLogoutProviderArg(providerArg);
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
this.showOAuthSelector("logout");
|
|
2409
|
+
}
|
|
2443
2410
|
this.editor.setText("");
|
|
2444
2411
|
return;
|
|
2445
2412
|
}
|
|
@@ -2459,8 +2426,8 @@ export class InteractiveMode {
|
|
|
2459
2426
|
await this.handleReloadCommand();
|
|
2460
2427
|
return;
|
|
2461
2428
|
}
|
|
2462
|
-
if (text === "/debug") {
|
|
2463
|
-
this.handleDebugCommand();
|
|
2429
|
+
if (text === "/debug" || text.startsWith("/debug ")) {
|
|
2430
|
+
this.handleDebugCommand(text.slice("/debug".length).trim());
|
|
2464
2431
|
this.editor.setText("");
|
|
2465
2432
|
return;
|
|
2466
2433
|
}
|
|
@@ -2906,13 +2873,22 @@ export class InteractiveMode {
|
|
|
2906
2873
|
return textBlocks.map((c) => c.text).join("");
|
|
2907
2874
|
}
|
|
2908
2875
|
showSessionTermination(termination) {
|
|
2909
|
-
if (termination.kind === "completed"
|
|
2876
|
+
if (termination.kind === "completed")
|
|
2877
|
+
return;
|
|
2878
|
+
const last = this.lastRenderedTermination;
|
|
2879
|
+
if (last?.sessionId === termination.sessionId &&
|
|
2880
|
+
last.runId === termination.runId &&
|
|
2881
|
+
last.timestamp === termination.timestamp &&
|
|
2882
|
+
last.causeCode === termination.causeCode &&
|
|
2883
|
+
last.source === termination.source)
|
|
2910
2884
|
return;
|
|
2911
2885
|
this.lastRenderedTermination = termination;
|
|
2912
2886
|
// compaction_end owns the concise cancellation status; rendering this too duplicates it as a scary error.
|
|
2913
2887
|
if (termination.causeCode === "compaction.aborted")
|
|
2914
2888
|
return;
|
|
2915
|
-
this.
|
|
2889
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
2890
|
+
this.chatContainer.addChild(new SessionFailureComponent(termination, this.toolOutputExpanded));
|
|
2891
|
+
this.ui.requestRender();
|
|
2916
2892
|
}
|
|
2917
2893
|
showPromptError(error, previousTermination) {
|
|
2918
2894
|
const termination = this.session.lastTermination;
|
|
@@ -4342,14 +4318,21 @@ export class InteractiveMode {
|
|
|
4342
4318
|
if (!isApiKeyLoginProvider(providerId, oauthProviderIds)) {
|
|
4343
4319
|
continue;
|
|
4344
4320
|
}
|
|
4321
|
+
const displayName = this.session.modelRegistry.getProviderDisplayName(providerId);
|
|
4345
4322
|
options.push({
|
|
4346
4323
|
id: providerId,
|
|
4347
|
-
name
|
|
4324
|
+
// The shared "meta" id resolves its display name to the oauth
|
|
4325
|
+
// entry, so label the API-key row distinctly.
|
|
4326
|
+
name: oauthProviderIds.has(providerId) && displayName !== providerId
|
|
4327
|
+
? getApiKeyLoginDisplayName(providerId, displayName)
|
|
4328
|
+
: displayName,
|
|
4348
4329
|
authType: "api_key",
|
|
4349
4330
|
});
|
|
4350
4331
|
}
|
|
4351
4332
|
const filteredOptions = authType ? options.filter((option) => option.authType === authType) : options;
|
|
4352
|
-
|
|
4333
|
+
// Stable order: by name, then oauth before api_key so a shared id
|
|
4334
|
+
// (e.g. meta) lists the subscription entry first.
|
|
4335
|
+
return filteredOptions.sort((a, b) => a.name.localeCompare(b.name) || a.authType.localeCompare(b.authType));
|
|
4353
4336
|
}
|
|
4354
4337
|
getLogoutProviderOptions() {
|
|
4355
4338
|
const authStorage = this.session.modelRegistry.authStorage;
|
|
@@ -4367,6 +4350,40 @@ export class InteractiveMode {
|
|
|
4367
4350
|
}
|
|
4368
4351
|
return options.sort((a, b) => a.name.localeCompare(b.name));
|
|
4369
4352
|
}
|
|
4353
|
+
async handleLogoutProviderArg(providerArg) {
|
|
4354
|
+
const providerOptions = this.getLogoutProviderOptions();
|
|
4355
|
+
const match = resolveLoginProviderArg(providerArg, providerOptions);
|
|
4356
|
+
if (!match) {
|
|
4357
|
+
const hint = providerOptions.length > 0
|
|
4358
|
+
? "Run /logout and pick from the list of stored credentials."
|
|
4359
|
+
: "No stored credentials to remove.";
|
|
4360
|
+
this.showWarning(`Unknown provider "${providerArg}". ${hint}`);
|
|
4361
|
+
return;
|
|
4362
|
+
}
|
|
4363
|
+
await this.logoutProvider(match);
|
|
4364
|
+
}
|
|
4365
|
+
async logoutProvider(providerOption) {
|
|
4366
|
+
try {
|
|
4367
|
+
const oauthAccountCount = this.session.modelRegistry.authStorage.getOAuthAccountCount(providerOption.id);
|
|
4368
|
+
this.session.modelRegistry.authStorage.logout(providerOption.id);
|
|
4369
|
+
this.session.modelRegistry.refresh();
|
|
4370
|
+
await this.updateAvailableProviderCount();
|
|
4371
|
+
let message;
|
|
4372
|
+
if (providerOption.authType === "oauth") {
|
|
4373
|
+
message =
|
|
4374
|
+
oauthAccountCount > 1
|
|
4375
|
+
? `Logged out of ${providerOption.name}. Removed ${oauthAccountCount} subscription accounts.`
|
|
4376
|
+
: `Logged out of ${providerOption.name}`;
|
|
4377
|
+
}
|
|
4378
|
+
else {
|
|
4379
|
+
message = `Removed stored API key for ${providerOption.name}. Environment variables and models.json config are unchanged.`;
|
|
4380
|
+
}
|
|
4381
|
+
this.showStatus(message);
|
|
4382
|
+
}
|
|
4383
|
+
catch (error) {
|
|
4384
|
+
this.showError(`Logout failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4370
4387
|
showLoginAuthTypeSelector() {
|
|
4371
4388
|
const subscriptionLabel = "Use a subscription";
|
|
4372
4389
|
const apiKeyLabel = "Use an API key";
|
|
@@ -4382,6 +4399,33 @@ export class InteractiveMode {
|
|
|
4382
4399
|
return { component: selector, focus: selector };
|
|
4383
4400
|
});
|
|
4384
4401
|
}
|
|
4402
|
+
async handleLoginProviderArg(providerArg) {
|
|
4403
|
+
const providerOptions = this.getLoginProviderOptions();
|
|
4404
|
+
const match = resolveLoginProviderArg(providerArg, providerOptions);
|
|
4405
|
+
if (!match) {
|
|
4406
|
+
this.showWarning(`Unknown provider "${providerArg}". Run /login and pick from the list, or check /model for provider ids.`);
|
|
4407
|
+
return;
|
|
4408
|
+
}
|
|
4409
|
+
await this.startLoginForProvider(match);
|
|
4410
|
+
}
|
|
4411
|
+
async startLoginForProvider(providerOption) {
|
|
4412
|
+
if (providerOption.authType === "oauth") {
|
|
4413
|
+
const authStorage = this.session.modelRegistry.authStorage;
|
|
4414
|
+
const accounts = authStorage.listOAuthAccounts(providerOption.id);
|
|
4415
|
+
if (accounts.length > 0) {
|
|
4416
|
+
this.showOAuthAccountSelector(providerOption);
|
|
4417
|
+
}
|
|
4418
|
+
else {
|
|
4419
|
+
await this.showLoginDialog(providerOption.id, providerOption.name);
|
|
4420
|
+
}
|
|
4421
|
+
}
|
|
4422
|
+
else if (providerOption.id === BEDROCK_PROVIDER_ID) {
|
|
4423
|
+
this.showBedrockSetupDialog(providerOption.id, providerOption.name);
|
|
4424
|
+
}
|
|
4425
|
+
else {
|
|
4426
|
+
await this.showApiKeyLoginDialog(providerOption.id, providerOption.name);
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4385
4429
|
showLoginProviderSelector(authType) {
|
|
4386
4430
|
const providerOptions = this.getLoginProviderOptions(authType);
|
|
4387
4431
|
if (providerOptions.length === 0) {
|
|
@@ -4395,21 +4439,7 @@ export class InteractiveMode {
|
|
|
4395
4439
|
if (!providerOption) {
|
|
4396
4440
|
return;
|
|
4397
4441
|
}
|
|
4398
|
-
|
|
4399
|
-
const accounts = this.session.modelRegistry.authStorage.listOAuthAccounts(providerOption.id);
|
|
4400
|
-
if (accounts.length > 0) {
|
|
4401
|
-
this.showOAuthAccountSelector(providerOption);
|
|
4402
|
-
}
|
|
4403
|
-
else {
|
|
4404
|
-
await this.showLoginDialog(providerOption.id, providerOption.name);
|
|
4405
|
-
}
|
|
4406
|
-
}
|
|
4407
|
-
else if (providerOption.id === BEDROCK_PROVIDER_ID) {
|
|
4408
|
-
this.showBedrockSetupDialog(providerOption.id, providerOption.name);
|
|
4409
|
-
}
|
|
4410
|
-
else {
|
|
4411
|
-
await this.showApiKeyLoginDialog(providerOption.id, providerOption.name);
|
|
4412
|
-
}
|
|
4442
|
+
await this.startLoginForProvider(providerOption);
|
|
4413
4443
|
}, () => {
|
|
4414
4444
|
done();
|
|
4415
4445
|
this.showLoginAuthTypeSelector();
|
|
@@ -4467,26 +4497,7 @@ export class InteractiveMode {
|
|
|
4467
4497
|
if (!providerOption) {
|
|
4468
4498
|
return;
|
|
4469
4499
|
}
|
|
4470
|
-
|
|
4471
|
-
const oauthAccountCount = this.session.modelRegistry.authStorage.getOAuthAccountCount(providerOption.id);
|
|
4472
|
-
this.session.modelRegistry.authStorage.logout(providerOption.id);
|
|
4473
|
-
this.session.modelRegistry.refresh();
|
|
4474
|
-
await this.updateAvailableProviderCount();
|
|
4475
|
-
let message;
|
|
4476
|
-
if (providerOption.authType === "oauth") {
|
|
4477
|
-
message =
|
|
4478
|
-
oauthAccountCount > 1
|
|
4479
|
-
? `Logged out of ${providerOption.name}. Removed ${oauthAccountCount} subscription accounts.`
|
|
4480
|
-
: `Logged out of ${providerOption.name}`;
|
|
4481
|
-
}
|
|
4482
|
-
else {
|
|
4483
|
-
message = `Removed stored API key for ${providerOption.name}. Environment variables and models.json config are unchanged.`;
|
|
4484
|
-
}
|
|
4485
|
-
this.showStatus(message);
|
|
4486
|
-
}
|
|
4487
|
-
catch (error) {
|
|
4488
|
-
this.showError(`Logout failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
4489
|
-
}
|
|
4500
|
+
await this.logoutProvider(providerOption);
|
|
4490
4501
|
}, () => {
|
|
4491
4502
|
done();
|
|
4492
4503
|
this.ui.requestRender();
|
|
@@ -4777,6 +4788,7 @@ export class InteractiveMode {
|
|
|
4777
4788
|
if (modelsJsonError) {
|
|
4778
4789
|
this.showError(`models.json error: ${modelsJsonError}`);
|
|
4779
4790
|
}
|
|
4791
|
+
this.lastResourceReloadAt = new Date().toISOString();
|
|
4780
4792
|
this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
|
|
4781
4793
|
}
|
|
4782
4794
|
catch (error) {
|
|
@@ -5275,31 +5287,31 @@ export class InteractiveMode {
|
|
|
5275
5287
|
await this.handleFatalRuntimeError("Failed to create session", error);
|
|
5276
5288
|
}
|
|
5277
5289
|
}
|
|
5278
|
-
handleDebugCommand() {
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
const
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
}),
|
|
5294
|
-
"",
|
|
5295
|
-
"=== Agent messages (JSONL) ===",
|
|
5296
|
-
...this.session.messages.map((msg) => JSON.stringify(msg)),
|
|
5297
|
-
"",
|
|
5298
|
-
].join("\n");
|
|
5299
|
-
fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
|
|
5300
|
-
fs.writeFileSync(debugLogPath, debugData);
|
|
5290
|
+
handleDebugCommand(args = "") {
|
|
5291
|
+
if (args !== "" && args !== "save") {
|
|
5292
|
+
this.showError("Usage: /debug [save]. Raw transcripts are not part of diagnostics.");
|
|
5293
|
+
return;
|
|
5294
|
+
}
|
|
5295
|
+
const report = createTuiDiagnostics({
|
|
5296
|
+
runtime: inspectTuiRuntime(TUI_RUNTIME),
|
|
5297
|
+
columns: this.ui.terminal.columns,
|
|
5298
|
+
rows: this.ui.terminal.rows,
|
|
5299
|
+
isStreaming: this.session.isStreaming,
|
|
5300
|
+
isCompacting: this.session.isCompacting,
|
|
5301
|
+
messageCount: this.session.messages.length,
|
|
5302
|
+
termination: this.session.lastTermination,
|
|
5303
|
+
lastResourceReloadAt: this.lastResourceReloadAt,
|
|
5304
|
+
});
|
|
5301
5305
|
this.chatContainer.addChild(new Spacer(1));
|
|
5302
|
-
this.chatContainer.addChild(
|
|
5306
|
+
this.chatContainer.addChild(createTuiDiagnosticsView(report, TUI_RUNTIME));
|
|
5307
|
+
if (args === "save") {
|
|
5308
|
+
try {
|
|
5309
|
+
this.showStatus(`Metadata-only diagnostics saved locally: ${saveTuiDiagnostics(report)}`);
|
|
5310
|
+
}
|
|
5311
|
+
catch {
|
|
5312
|
+
this.showError("Could not save diagnostics. Check temporary-directory permissions; no transcript was exported.");
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5303
5315
|
this.ui.requestRender();
|
|
5304
5316
|
}
|
|
5305
5317
|
handleArminSaysHi() {
|