@andorra-labs/code 0.1.12 → 0.1.14
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/dist/src/account-presentation.d.ts +1 -37
- package/dist/src/account-presentation.js +6 -43
- package/dist/src/activity.d.ts +0 -25
- package/dist/src/activity.js +1 -23
- package/dist/src/agent-definitions.d.ts +0 -26
- package/dist/src/agent-definitions.js +0 -43
- package/dist/src/agent-execution.d.ts +0 -2
- package/dist/src/agent-execution.js +347 -554
- package/dist/src/agent-mcp-catalog.d.ts +0 -8
- package/dist/src/agent-mcp-catalog.js +0 -2
- package/dist/src/agent-mcp.d.ts +0 -56
- package/dist/src/agent-mcp.js +11 -155
- package/dist/src/agent-modifiers.d.ts +0 -1
- package/dist/src/agent-modifiers.js +25 -68
- package/dist/src/analytics.d.ts +0 -66
- package/dist/src/analytics.js +0 -45
- package/dist/src/andorra/endpoint.d.ts +7 -0
- package/dist/src/andorra/endpoint.js +46 -0
- package/dist/src/andorra/entry.d.ts +21 -0
- package/dist/src/andorra/entry.js +100 -0
- package/dist/src/andorra/errors.d.ts +2 -0
- package/dist/src/andorra/errors.js +39 -0
- package/dist/src/andorra/hosted.d.ts +52 -0
- package/dist/src/andorra/hosted.js +126 -0
- package/dist/src/andorra/monitor.d.ts +151 -0
- package/dist/src/andorra/monitor.js +393 -0
- package/dist/src/andorra/notices.d.ts +7 -0
- package/dist/src/andorra/notices.js +15 -0
- package/dist/src/andorra/opt-in.d.ts +58 -0
- package/dist/src/andorra/opt-in.js +112 -0
- package/dist/src/andorra/request-watch.d.ts +6 -0
- package/dist/src/andorra/request-watch.js +10 -0
- package/dist/src/andorra/state.d.ts +86 -0
- package/dist/src/andorra/state.js +238 -0
- package/dist/src/andorra/terminal.d.ts +68 -0
- package/dist/src/andorra/terminal.js +125 -0
- package/dist/src/andorra/usage-format.d.ts +9 -0
- package/dist/src/andorra/usage-format.js +19 -0
- package/dist/src/anthropic-console-auth.d.ts +0 -24
- package/dist/src/anthropic-console-auth.js +0 -37
- package/dist/src/anthropic-credentials.d.ts +0 -25
- package/dist/src/anthropic-credentials.js +9 -29
- package/dist/src/app-server/protocol.d.ts +18 -246
- package/dist/src/app-server/protocol.js +1 -132
- package/dist/src/app-server/reasoning.d.ts +0 -31
- package/dist/src/app-server/reasoning.js +0 -54
- package/dist/src/app-server/terminal.d.ts +0 -36
- package/dist/src/app-server/terminal.js +3 -39
- package/dist/src/app-server/workspace.d.ts +0 -167
- package/dist/src/app-server/workspace.js +4 -406
- package/dist/src/app-server.d.ts +52 -925
- package/dist/src/app-server.js +828 -3076
- package/dist/src/artifacts.d.ts +0 -10
- package/dist/src/artifacts.js +1 -11
- package/dist/src/attachments.d.ts +4 -98
- package/dist/src/attachments.js +10 -130
- package/dist/src/auth/AuthManager.d.ts +9 -93
- package/dist/src/auth/AuthManager.js +164 -186
- package/dist/src/auth/callback-page.d.ts +0 -1
- package/dist/src/auth/callback-page.js +0 -4
- package/dist/src/auth/callback.d.ts +0 -25
- package/dist/src/auth/callback.js +1 -29
- package/dist/src/auth/deployment.d.ts +1 -16
- package/dist/src/auth/deployment.js +1 -16
- package/dist/src/auth/index.d.ts +1 -12
- package/dist/src/auth/index.js +1 -12
- package/dist/src/auth/lock.d.ts +0 -1
- package/dist/src/auth/lock.js +0 -1
- package/dist/src/auth/store.d.ts +33 -108
- package/dist/src/auth/store.js +55 -130
- package/dist/src/auth/types.d.ts +0 -8
- package/dist/src/auth-commands.d.ts +0 -5
- package/dist/src/auth-commands.js +0 -1
- package/dist/src/automation-runner.d.ts +0 -9
- package/dist/src/automation-runner.js +0 -11
- package/dist/src/automation-service.d.ts +0 -10
- package/dist/src/automation-service.js +3 -17
- package/dist/src/automation-tool.js +0 -5
- package/dist/src/automation-worker-shutdown.d.ts +0 -1
- package/dist/src/automation-worker-shutdown.js +0 -3
- package/dist/src/automations.d.ts +23 -2
- package/dist/src/automations.js +91 -12
- package/dist/src/background-tasks.d.ts +0 -23
- package/dist/src/background-tasks.js +0 -11
- package/dist/src/boot-trace.d.ts +0 -13
- package/dist/src/boot-trace.js +1 -14
- package/dist/src/browser-activity.js +0 -2
- package/dist/src/browser-bridge.d.ts +0 -2
- package/dist/src/browser-bridge.js +0 -27
- package/dist/src/browser-captcha-tool.d.ts +0 -13
- package/dist/src/browser-captcha-tool.js +3 -35
- package/dist/src/browser-extensions-tool.d.ts +24 -0
- package/dist/src/browser-extensions-tool.js +137 -0
- package/dist/src/browser-extensions.d.ts +127 -0
- package/dist/src/browser-extensions.js +729 -0
- package/dist/src/browser-observation.d.ts +0 -15
- package/dist/src/browser-observation.js +1 -22
- package/dist/src/browser-panel-tool.d.ts +1 -37
- package/dist/src/browser-panel-tool.js +3 -73
- package/dist/src/browser-runner.d.ts +0 -1
- package/dist/src/browser-runner.js +5 -46
- package/dist/src/browser-server.d.ts +0 -6
- package/dist/src/browser-server.js +6 -229
- package/dist/src/browser-session.d.ts +0 -25
- package/dist/src/browser-session.js +1 -71
- package/dist/src/browser-stealth.d.ts +19 -13
- package/dist/src/browser-stealth.js +22 -38
- package/dist/src/browser-ui/app.js +7 -174
- package/dist/src/browser-ui/style.css +0 -68
- package/dist/src/browser-ui/tokens.css +15 -97
- package/dist/src/browser-view.d.ts +106 -295
- package/dist/src/browser-view.js +551 -587
- package/dist/src/capabilities.d.ts +0 -8
- package/dist/src/capabilities.js +0 -29
- package/dist/src/capsolver.d.ts +0 -13
- package/dist/src/capsolver.js +0 -15
- package/dist/src/clarification-ui.d.ts +0 -7
- package/dist/src/clarification-ui.js +0 -8
- package/dist/src/claude-executable.d.ts +0 -1
- package/dist/src/claude-executable.js +1 -2
- package/dist/src/claude-provider.d.ts +6 -19
- package/dist/src/claude-provider.js +155 -63
- package/dist/src/cli-executable.d.ts +0 -16
- package/dist/src/cli-executable.js +0 -7
- package/dist/src/cli-process.d.ts +0 -26
- package/dist/src/cli-process.js +0 -18
- package/dist/src/cli-sign-in.d.ts +0 -20
- package/dist/src/cli-sign-in.js +1 -17
- package/dist/src/cli.d.ts +1 -55
- package/dist/src/cli.js +118 -742
- package/dist/src/code-intelligence/CodeIntelligenceManager.d.ts +4 -59
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +26 -99
- package/dist/src/code-intelligence/ContextLedger.d.ts +0 -4
- package/dist/src/code-intelligence/ContextLedger.js +0 -10
- package/dist/src/code-intelligence/ContextRouter.d.ts +0 -6
- package/dist/src/code-intelligence/ContextRouter.js +0 -8
- package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.d.ts +0 -2
- package/dist/src/code-intelligence/codegraph/CodeGraphProjectSession.js +5 -12
- package/dist/src/code-intelligence/codegraph/CodeGraphProvider.d.ts +0 -6
- package/dist/src/code-intelligence/codegraph/CodeGraphProvider.js +0 -6
- package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.d.ts +0 -5
- package/dist/src/code-intelligence/codegraph/CodeGraphSyncBarrier.js +1 -17
- package/dist/src/code-intelligence/codegraph/repoExploreTool.d.ts +0 -5
- package/dist/src/code-intelligence/codegraph/repoExploreTool.js +0 -5
- package/dist/src/code-intelligence/repository.d.ts +0 -9
- package/dist/src/code-intelligence/repository.js +1 -11
- package/dist/src/code-intelligence/types.d.ts +0 -8
- package/dist/src/codex-auth.d.ts +0 -44
- package/dist/src/codex-auth.js +0 -45
- package/dist/src/codex-browser-auth.d.ts +0 -13
- package/dist/src/codex-browser-auth.js +3 -20
- package/dist/src/codex-errors.js +0 -2
- package/dist/src/codex-executable.d.ts +0 -2
- package/dist/src/codex-executable.js +1 -7
- package/dist/src/codex-provider.d.ts +0 -13
- package/dist/src/codex-provider.js +0 -28
- package/dist/src/codex-rpc.d.ts +0 -10
- package/dist/src/codex-rpc.js +0 -12
- package/dist/src/coding-tools.d.ts +4 -26
- package/dist/src/coding-tools.js +161 -181
- package/dist/src/command-metrics.d.ts +0 -4
- package/dist/src/command-output-tap.d.ts +0 -11
- package/dist/src/command-output-tap.js +0 -3
- package/dist/src/command-screens.d.ts +41 -1
- package/dist/src/command-screens.js +316 -113
- package/dist/src/commands.d.ts +12 -63
- package/dist/src/commands.js +98 -127
- package/dist/src/completion-gates.d.ts +0 -47
- package/dist/src/completion-gates.js +0 -14
- package/dist/src/completion.d.ts +0 -98
- package/dist/src/completion.js +2 -239
- package/dist/src/config.d.ts +15 -115
- package/dist/src/config.js +123 -172
- package/dist/src/context-budget.d.ts +0 -22
- package/dist/src/context-budget.js +0 -44
- package/dist/src/context-compaction.d.ts +29 -6
- package/dist/src/context-compaction.js +94 -25
- package/dist/src/context-selection.d.ts +0 -24
- package/dist/src/context-selection.js +0 -34
- package/dist/src/dashboard-view.d.ts +2 -2
- package/dist/src/dashboard-view.js +11 -37
- package/dist/src/dashboard.d.ts +0 -2
- package/dist/src/dashboard.js +0 -9
- package/dist/src/deadline.d.ts +0 -45
- package/dist/src/deadline.js +0 -54
- package/dist/src/decision/ContinuationAdapter.d.ts +0 -5
- package/dist/src/decision/ContinuationAdapter.js +0 -5
- package/dist/src/decision/DecisionEngine.d.ts +0 -4
- package/dist/src/decision/DecisionManager.d.ts +0 -1
- package/dist/src/decision/DecisionManager.js +2 -7
- package/dist/src/decision/DecisionPolicy.d.ts +0 -1
- package/dist/src/decision/DecisionPolicy.js +0 -1
- package/dist/src/decision/FactContinuations.d.ts +11 -43
- package/dist/src/decision/FactContinuations.js +126 -95
- package/dist/src/decision/FactServiceGate.d.ts +0 -1
- package/dist/src/decision/FactServiceGate.js +0 -4
- package/dist/src/decision/PreparedSteps.d.ts +0 -15
- package/dist/src/decision/PreparedSteps.js +1 -11
- package/dist/src/decision/applyToolMenu.d.ts +0 -1
- package/dist/src/decision/applyToolMenu.js +2 -6
- package/dist/src/decision/checks.d.ts +15 -28
- package/dist/src/decision/checks.js +118 -49
- package/dist/src/decision/facts.d.ts +0 -16
- package/dist/src/decision/facts.js +0 -30
- package/dist/src/decision/guidancePolicy.js +0 -1
- package/dist/src/decision/hostedPolicy.d.ts +0 -6
- package/dist/src/decision/hostedPolicy.js +0 -7
- package/dist/src/decision/hostedSkills.d.ts +0 -19
- package/dist/src/decision/hostedSkills.js +0 -19
- package/dist/src/decision/optimizationPolicy.d.ts +0 -3
- package/dist/src/decision/optimizationPolicy.js +1 -4
- package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +0 -7
- package/dist/src/decision/providers/AndorraDecisionProvider.js +4 -27
- package/dist/src/decision/providers/HttpDecisionProvider.d.ts +0 -2
- package/dist/src/decision/providers/HttpDecisionProvider.js +0 -6
- package/dist/src/decision/routeTools.d.ts +0 -8
- package/dist/src/decision/routeTools.js +1 -8
- package/dist/src/decision/toolFamilies.d.ts +0 -1
- package/dist/src/decision/toolFamilies.js +1 -2
- package/dist/src/decision/toolMenu.d.ts +0 -3
- package/dist/src/decision/toolMenu.js +0 -4
- package/dist/src/decision/types.d.ts +1 -6
- package/dist/src/default-graph.d.ts +0 -9
- package/dist/src/default-graph.js +0 -9
- package/dist/src/delegation-changes.d.ts +0 -56
- package/dist/src/delegation-changes.js +4 -130
- package/dist/src/diff-preview.d.ts +0 -1
- package/dist/src/diff-preview.js +0 -17
- package/dist/src/duration.d.ts +0 -50
- package/dist/src/duration.js +0 -50
- package/dist/src/efficiency.d.ts +0 -39
- package/dist/src/efficiency.js +0 -16
- package/dist/src/engine/protocol.d.ts +0 -2
- package/dist/src/engine/protocol.js +0 -2
- package/dist/src/engine-streams.d.ts +0 -9
- package/dist/src/extensions.d.ts +3 -2
- package/dist/src/extensions.js +63 -35
- package/dist/src/favicons.d.ts +0 -26
- package/dist/src/favicons.js +0 -34
- package/dist/src/file-diff.d.ts +2 -58
- package/dist/src/file-diff.js +0 -32
- package/dist/src/file-read-key.d.ts +0 -7
- package/dist/src/file-read-key.js +0 -7
- package/dist/src/file-read-state.d.ts +0 -1
- package/dist/src/file-read-state.js +0 -4
- package/dist/src/firefox-cookies.d.ts +0 -34
- package/dist/src/firefox-cookies.js +1 -55
- package/dist/src/git-identity-audit.d.ts +27 -0
- package/dist/src/git-identity-audit.js +286 -0
- package/dist/src/git-identity-guard.d.ts +4 -0
- package/dist/src/git-identity-guard.js +998 -0
- package/dist/src/git-identity-hold.d.ts +12 -0
- package/dist/src/git-identity-hold.js +81 -0
- package/dist/src/git-summary.d.ts +0 -58
- package/dist/src/git-summary.js +2 -212
- package/dist/src/goal-completion-verification.d.ts +2 -2
- package/dist/src/goal-completion-verification.js +3 -6
- package/dist/src/graph-account.d.ts +0 -21
- package/dist/src/graph-account.js +0 -17
- package/dist/src/graph-editor-session.d.ts +0 -1
- package/dist/src/graph-editor-session.js +0 -3
- package/dist/src/graph-health.d.ts +9 -61
- package/dist/src/graph-health.js +34 -59
- package/dist/src/graph-manager-chat.d.ts +36 -153
- package/dist/src/graph-manager-chat.js +161 -182
- package/dist/src/graph-provider-portability.d.ts +1 -21
- package/dist/src/graph-provider-portability.js +6 -45
- package/dist/src/graph-quota.d.ts +0 -33
- package/dist/src/graph-quota.js +1 -44
- package/dist/src/graph-runner.d.ts +0 -1
- package/dist/src/graph-runner.js +58 -391
- package/dist/src/graph-selection.d.ts +0 -14
- package/dist/src/graph-selection.js +2 -15
- package/dist/src/graph-server.d.ts +2 -10
- package/dist/src/graph-server.js +39 -101
- package/dist/src/graph-studio-features.d.ts +0 -5
- package/dist/src/graph-studio-features.js +2 -42
- package/dist/src/graph-sync.d.ts +0 -78
- package/dist/src/graph-sync.js +5 -201
- package/dist/src/graph-tool.d.ts +0 -18
- package/dist/src/graph-tool.js +0 -27
- package/dist/src/graph-ui/app.js +176 -492
- package/dist/src/graph-ui/compat.js +0 -7
- package/dist/src/graph-ui/controls.css +0 -48
- package/dist/src/graph-ui/controls.js +0 -88
- package/dist/src/graph-ui/drafts.js +0 -12
- package/dist/src/graph-ui/edge-router.js +0 -62
- package/dist/src/graph-ui/embed.js +0 -59
- package/dist/src/graph-ui/icons.js +0 -8
- package/dist/src/graph-ui/library.css +0 -5
- package/dist/src/graph-ui/manager-markdown.js +0 -11
- package/dist/src/graph-ui/manager-state.js +1 -78
- package/dist/src/graph-ui/manager.css +0 -18
- package/dist/src/graph-ui/manager.js +43 -185
- package/dist/src/graph-ui/model-picker.js +0 -29
- package/dist/src/graph-ui/sidebar.js +2 -3
- package/dist/src/graph-ui/skill-picker.js +373 -39
- package/dist/src/graph-ui/studio-canvas.js +3 -38
- package/dist/src/graph-ui/studio.css +0 -18
- package/dist/src/graph-ui/studio.js +3 -71
- package/dist/src/graph-ui/style.css +16 -136
- package/dist/src/graph-ui/theme.js +1 -26
- package/dist/src/graph-ui/tokens.css +19 -118
- package/dist/src/graphs.d.ts +6 -157
- package/dist/src/graphs.js +66 -269
- package/dist/src/grep-regex-worker.js +0 -2
- package/dist/src/grep-regex.d.ts +1 -5
- package/dist/src/grep-regex.js +6 -8
- package/dist/src/grok-provider.d.ts +0 -17
- package/dist/src/grok-provider.js +1 -26
- package/dist/src/handoffs.d.ts +0 -11
- package/dist/src/handoffs.js +0 -13
- package/dist/src/hardened-runtime.d.ts +0 -10
- package/dist/src/hardened-runtime.js +9 -47
- package/dist/src/harness-home.d.ts +21 -0
- package/dist/src/harness-home.js +87 -0
- package/dist/src/host-process-guard.d.ts +0 -50
- package/dist/src/host-process-guard.js +0 -641
- package/dist/src/limits.d.ts +0 -64
- package/dist/src/limits.js +0 -62
- package/dist/src/managed-sign-in.d.ts +0 -12
- package/dist/src/managed-sign-in.js +0 -16
- package/dist/src/markdown.d.ts +0 -28
- package/dist/src/markdown.js +1 -175
- package/dist/src/mcp.d.ts +0 -99
- package/dist/src/mcp.js +4 -170
- package/dist/src/membership-errors.d.ts +0 -14
- package/dist/src/membership-errors.js +1 -14
- package/dist/src/membership.d.ts +9 -59
- package/dist/src/membership.js +20 -91
- package/dist/src/memory/LocalToolMemory.d.ts +0 -1
- package/dist/src/memory/LocalToolMemory.js +2 -7
- package/dist/src/memory/MemoryDistiller.js +0 -15
- package/dist/src/memory/MemoryManager.d.ts +0 -3
- package/dist/src/memory/MemoryManager.js +6 -18
- package/dist/src/memory/MemoryPolicy.d.ts +0 -2
- package/dist/src/memory/MemoryPolicy.js +0 -2
- package/dist/src/memory/MemoryProvider.d.ts +0 -6
- package/dist/src/memory/MemoryRetriever.js +0 -7
- package/dist/src/memory/PermissionMemoryProvider.d.ts +0 -1
- package/dist/src/memory/PermissionMemoryProvider.js +0 -1
- package/dist/src/memory/ProjectMemory.d.ts +5 -40
- package/dist/src/memory/ProjectMemory.js +22 -47
- package/dist/src/memory/ToolFailureLessons.d.ts +0 -3
- package/dist/src/memory/ToolFailureLessons.js +0 -6
- package/dist/src/memory/providers/NoOpMemoryProvider.d.ts +0 -1
- package/dist/src/memory/providers/NoOpMemoryProvider.js +0 -1
- package/dist/src/memory/redaction.d.ts +0 -5
- package/dist/src/memory/redaction.js +0 -11
- package/dist/src/memory/repository.d.ts +0 -6
- package/dist/src/memory/repository.js +2 -12
- package/dist/src/memory/types.d.ts +0 -1
- package/dist/src/model-context-windows.d.ts +2 -0
- package/dist/src/model-context-windows.js +24 -0
- package/dist/src/model-health-cache.d.ts +0 -38
- package/dist/src/model-health-cache.js +2 -50
- package/dist/src/model-metadata.d.ts +1 -18
- package/dist/src/model-metadata.js +42 -45
- package/dist/src/model-override.d.ts +0 -36
- package/dist/src/model-override.js +0 -43
- package/dist/src/model-tiers.d.ts +0 -13
- package/dist/src/model-tiers.js +0 -23
- package/dist/src/opencode-catalog.d.ts +0 -2
- package/dist/src/opencode-catalog.js +0 -11
- package/dist/src/opencode-cli-provider.d.ts +0 -35
- package/dist/src/opencode-cli-provider.js +1 -44
- package/dist/src/opencode-provider.d.ts +0 -2
- package/dist/src/opencode-provider.js +1 -16
- package/dist/src/package-name.d.ts +0 -2
- package/dist/src/package-name.js +0 -2
- package/dist/src/paged-transcript.d.ts +0 -11
- package/dist/src/paged-transcript.js +2 -20
- package/dist/src/palette.d.ts +1 -63
- package/dist/src/palette.js +1 -64
- package/dist/src/permissions.d.ts +0 -15
- package/dist/src/permissions.js +17 -21
- package/dist/src/powershell-pool.d.ts +0 -9
- package/dist/src/powershell-pool.js +3 -26
- package/dist/src/process-warnings.d.ts +4 -0
- package/dist/src/process-warnings.js +103 -0
- package/dist/src/profile.d.ts +0 -43
- package/dist/src/profile.js +0 -43
- package/dist/src/project-reservation.d.ts +11 -0
- package/dist/src/project-reservation.js +143 -0
- package/dist/src/provider-connection.d.ts +0 -18
- package/dist/src/provider-connection.js +15 -39
- package/dist/src/provider-engine.d.ts +0 -21
- package/dist/src/provider-engine.js +1 -96
- package/dist/src/provider-import.d.ts +0 -49
- package/dist/src/provider-import.js +0 -60
- package/dist/src/provider-keys.d.ts +1 -36
- package/dist/src/provider-keys.js +5 -48
- package/dist/src/provider-settings.d.ts +16 -3
- package/dist/src/provider-settings.js +36 -52
- package/dist/src/providers.d.ts +14 -219
- package/dist/src/providers.js +69 -326
- package/dist/src/pull-requests.d.ts +0 -173
- package/dist/src/pull-requests.js +5 -195
- package/dist/src/qa/browser/PlaywrightRunner.d.ts +0 -7
- package/dist/src/qa/browser/PlaywrightRunner.js +2 -16
- package/dist/src/qa/command-policy.d.ts +0 -23
- package/dist/src/qa/command-policy.js +0 -30
- package/dist/src/qa/guidance.d.ts +0 -21
- package/dist/src/qa/guidance.js +0 -20
- package/dist/src/qa/profile/ProjectInspector.d.ts +0 -4
- package/dist/src/qa/profile/ProjectInspector.js +0 -6
- package/dist/src/qa/profile/QaConfigLoader.d.ts +0 -7
- package/dist/src/qa/profile/QaConfigLoader.js +0 -6
- package/dist/src/qa/profile/QaProfile.d.ts +0 -7
- package/dist/src/qa/profile/QaProfile.js +0 -7
- package/dist/src/qa/profile/yaml.d.ts +0 -9
- package/dist/src/qa/profile/yaml.js +0 -13
- package/dist/src/qa/qa-authorize.d.ts +0 -19
- package/dist/src/qa/qa-authorize.js +4 -11
- package/dist/src/qa/runtime/ProcessManager.d.ts +0 -31
- package/dist/src/qa/runtime/ProcessManager.js +4 -41
- package/dist/src/qa/runtime/PtyManager.d.ts +0 -4
- package/dist/src/qa/runtime/PtyManager.js +1 -7
- package/dist/src/qa/runtime/changes.d.ts +0 -11
- package/dist/src/qa/runtime/changes.js +1 -3
- package/dist/src/qa/tools.d.ts +0 -10
- package/dist/src/qa/tools.js +0 -12
- package/dist/src/qa/types.d.ts +0 -13
- package/dist/src/react-runtime.d.ts +2 -21
- package/dist/src/react-runtime.js +107 -422
- package/dist/src/read-document-doc.d.ts +0 -6
- package/dist/src/read-document-doc.js +0 -55
- package/dist/src/read-document-docx.d.ts +0 -16
- package/dist/src/read-document-docx.js +2 -69
- package/dist/src/read-document-text.d.ts +0 -17
- package/dist/src/read-document-text.js +0 -22
- package/dist/src/read-document-tool.d.ts +0 -31
- package/dist/src/read-document-tool.js +0 -30
- package/dist/src/read-document.d.ts +0 -49
- package/dist/src/read-document.js +1 -67
- package/dist/src/read-image.d.ts +0 -32
- package/dist/src/read-image.js +0 -33
- package/dist/src/remote/cert.d.ts +0 -18
- package/dist/src/remote/cert.js +0 -44
- package/dist/src/remote/client.d.ts +0 -70
- package/dist/src/remote/client.js +1 -116
- package/dist/src/remote/command.js +0 -17
- package/dist/src/remote/engine-pool.d.ts +0 -152
- package/dist/src/remote/engine-pool.js +22 -339
- package/dist/src/remote/errors.d.ts +0 -15
- package/dist/src/remote/errors.js +0 -7
- package/dist/src/remote/network.d.ts +0 -26
- package/dist/src/remote/network.js +1 -34
- package/dist/src/remote/pairing.d.ts +16 -51
- package/dist/src/remote/pairing.js +50 -57
- package/dist/src/remote/pem.d.ts +0 -4
- package/dist/src/remote/pem.js +0 -4
- package/dist/src/remote/roots.d.ts +0 -20
- package/dist/src/remote/roots.js +0 -8
- package/dist/src/remote/serve.d.ts +0 -47
- package/dist/src/remote/serve.js +0 -30
- package/dist/src/remote/server.d.ts +0 -14
- package/dist/src/remote/server.js +1 -79
- package/dist/src/remote/types.d.ts +1 -32
- package/dist/src/remote/types.js +0 -10
- package/dist/src/run-control.d.ts +2 -9
- package/dist/src/run-control.js +9 -13
- package/dist/src/run-progress.d.ts +0 -170
- package/dist/src/run-progress.js +0 -285
- package/dist/src/run-records.d.ts +0 -443
- package/dist/src/run-records.js +14 -687
- package/dist/src/run-temp.d.ts +12 -0
- package/dist/src/run-temp.js +50 -0
- package/dist/src/runtime.d.ts +12 -228
- package/dist/src/runtime.js +2 -128
- package/dist/src/sandbox-child.js +0 -1
- package/dist/src/save-lock.d.ts +0 -12
- package/dist/src/save-lock.js +0 -28
- package/dist/src/screen-selection.d.ts +0 -23
- package/dist/src/screen-selection.js +0 -22
- package/dist/src/secret-redaction.d.ts +0 -12
- package/dist/src/secret-redaction.js +0 -45
- package/dist/src/session-changes.d.ts +4 -80
- package/dist/src/session-changes.js +25 -130
- package/dist/src/session-goal.d.ts +129 -0
- package/dist/src/session-goal.js +230 -0
- package/dist/src/session-monitor.d.ts +1 -10
- package/dist/src/session-monitor.js +2 -39
- package/dist/src/session-reaper.d.ts +0 -15
- package/dist/src/session-reaper.js +0 -14
- package/dist/src/session-skills.d.ts +15 -44
- package/dist/src/session-skills.js +75 -60
- package/dist/src/session-summary.d.ts +0 -26
- package/dist/src/session-summary.js +0 -32
- package/dist/src/session-title.d.ts +0 -1
- package/dist/src/session-title.js +0 -2
- package/dist/src/sessions.d.ts +3 -122
- package/dist/src/sessions.js +9 -178
- package/dist/src/shell.d.ts +3 -20
- package/dist/src/shell.js +8 -72
- package/dist/src/side-panel.d.ts +5 -99
- package/dist/src/side-panel.js +76 -133
- package/dist/src/sign-in-detection.d.ts +0 -39
- package/dist/src/sign-in-detection.js +0 -43
- package/dist/src/sign-in-offer.d.ts +1 -19
- package/dist/src/sign-in-offer.js +0 -13
- package/dist/src/skill-commands.d.ts +0 -1
- package/dist/src/skill-commands.js +1 -4
- package/dist/src/skills/bundled/control-browser/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/errors.md +1 -1
- package/dist/src/skills/bundled/provenance.json +738 -738
- package/dist/src/skills/invocable-skills.d.ts +0 -18
- package/dist/src/skills/invocable-skills.js +0 -17
- package/dist/src/skills/project-skills.d.ts +0 -1
- package/dist/src/skills/project-skills.js +0 -3
- package/dist/src/skills/prompt-skills.js +0 -14
- package/dist/src/skills/runtime-skills.d.ts +0 -13
- package/dist/src/skills/runtime-skills.js +0 -37
- package/dist/src/stall-recovery.d.ts +0 -25
- package/dist/src/stall-recovery.js +0 -38
- package/dist/src/stray-files.d.ts +0 -9
- package/dist/src/stray-files.js +0 -16
- package/dist/src/structured-step.d.ts +0 -22
- package/dist/src/structured-step.js +0 -22
- package/dist/src/subagent-run.d.ts +2 -163
- package/dist/src/subagent-run.js +18 -376
- package/dist/src/subagent-tree.d.ts +32 -0
- package/dist/src/subagent-tree.js +128 -0
- package/dist/src/telemetry/aggregate.d.ts +0 -37
- package/dist/src/telemetry/aggregate.js +0 -40
- package/dist/src/telemetry/capture-core.d.ts +0 -87
- package/dist/src/telemetry/capture-core.js +0 -67
- package/dist/src/telemetry/capture.d.ts +0 -1
- package/dist/src/telemetry/capture.js +0 -3
- package/dist/src/telemetry/classify.d.ts +0 -58
- package/dist/src/telemetry/classify.js +0 -60
- package/dist/src/telemetry/decision-capture.d.ts +0 -1
- package/dist/src/telemetry/emitter.d.ts +0 -30
- package/dist/src/telemetry/emitter.js +1 -62
- package/dist/src/telemetry/gate.d.ts +0 -29
- package/dist/src/telemetry/gate.js +0 -22
- package/dist/src/telemetry/identity.d.ts +0 -13
- package/dist/src/telemetry/identity.js +0 -29
- package/dist/src/telemetry/outbox.d.ts +0 -64
- package/dist/src/telemetry/outbox.js +1 -108
- package/dist/src/telemetry/schema.d.ts +1 -49
- package/dist/src/telemetry/schema.js +3 -84
- package/dist/src/telemetry/state.d.ts +0 -53
- package/dist/src/telemetry/state.js +0 -64
- package/dist/src/telemetry/surface.d.ts +0 -31
- package/dist/src/telemetry/surface.js +1 -39
- package/dist/src/telemetry/uploader.d.ts +0 -11
- package/dist/src/telemetry/uploader.js +0 -46
- package/dist/src/telemetry/uploads.d.ts +0 -11
- package/dist/src/telemetry/uploads.js +0 -11
- package/dist/src/telemetry/version.d.ts +0 -4
- package/dist/src/telemetry/version.js +0 -14
- package/dist/src/telemetry/workspace.d.ts +0 -7
- package/dist/src/telemetry/workspace.js +1 -22
- package/dist/src/terminal-ui.d.ts +33 -521
- package/dist/src/terminal-ui.js +145 -884
- package/dist/src/test-edit-guard.d.ts +74 -0
- package/dist/src/test-edit-guard.js +269 -0
- package/dist/src/text.d.ts +0 -1
- package/dist/src/text.js +0 -1
- package/dist/src/time-limit.d.ts +0 -36
- package/dist/src/time-limit.js +0 -37
- package/dist/src/timers.d.ts +0 -161
- package/dist/src/timers.js +0 -126
- package/dist/src/todos.d.ts +0 -1
- package/dist/src/todos.js +0 -3
- package/dist/src/token-rate.d.ts +0 -94
- package/dist/src/token-rate.js +0 -154
- package/dist/src/tool-activity.d.ts +0 -6
- package/dist/src/tool-activity.js +0 -7
- package/dist/src/tool-availability.d.ts +0 -13
- package/dist/src/tool-availability.js +1 -14
- package/dist/src/tool-call-clock.d.ts +1 -4
- package/dist/src/tool-call-clock.js +0 -13
- package/dist/src/tool-catalog.d.ts +0 -11
- package/dist/src/tool-catalog.js +0 -23
- package/dist/src/tool-dependencies.d.ts +0 -5
- package/dist/src/tool-dependencies.js +0 -4
- package/dist/src/tool-diff-stats.d.ts +0 -23
- package/dist/src/tool-diff-stats.js +0 -49
- package/dist/src/tool-errors.d.ts +9 -7
- package/dist/src/tool-errors.js +13 -6
- package/dist/src/tool-failure-tracker.d.ts +3 -11
- package/dist/src/tool-failure-tracker.js +19 -27
- package/dist/src/tool-names.d.ts +0 -16
- package/dist/src/tool-names.js +0 -12
- package/dist/src/tool-profile.d.ts +6 -0
- package/dist/src/tool-profile.js +23 -0
- package/dist/src/tool-result-filter.d.ts +0 -19
- package/dist/src/tool-result-filter.js +1 -66
- package/dist/src/tool-schema-compatibility.d.ts +0 -6
- package/dist/src/tool-schema-compatibility.js +0 -9
- package/dist/src/tools.d.ts +0 -4
- package/dist/src/tools.js +11 -114
- package/dist/src/trajectory.d.ts +0 -13
- package/dist/src/trajectory.js +23 -79
- package/dist/src/transcript.d.ts +0 -41
- package/dist/src/transcript.js +5 -60
- package/dist/src/types.d.ts +4 -168
- package/dist/src/untracked-file-removal.js +0 -20
- package/dist/src/update-check.d.ts +0 -14
- package/dist/src/update-check.js +1 -15
- package/dist/src/update.d.ts +0 -35
- package/dist/src/update.js +0 -100
- package/dist/src/usage-analytics.d.ts +17 -17
- package/dist/src/usage-analytics.js +168 -209
- package/dist/src/web-search.d.ts +0 -23
- package/dist/src/web-search.js +1 -27
- package/dist/src/widgets.d.ts +0 -25
- package/dist/src/widgets.js +0 -24
- package/dist/src/workspace-facts.d.ts +0 -12
- package/dist/src/workspace-facts.js +1 -18
- package/dist/src/workspace-git-metadata.d.ts +0 -16
- package/dist/src/workspace-git-metadata.js +0 -21
- package/dist/src/workspace-instructions.d.ts +3 -15
- package/dist/src/workspace-instructions.js +6 -19
- package/package.json +13 -2
package/dist/src/commands.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { isPermissionMode, permissionLabel, workspacePermissionKey } from './permissions.js';
|
|
1
|
+
import { isPermissionMode, permissionLabel, PERMISSION_OPTIONS, workspacePermissionKey } from './permissions.js';
|
|
2
|
+
export function permissionChoices(current) {
|
|
3
|
+
const width = Math.max(...PERMISSION_OPTIONS.map(option => option.id.length));
|
|
4
|
+
const rows = PERMISSION_OPTIONS.map(option => `${option.id === current ? '●' : ' '} ${option.id.padEnd(width)} ${option.label}${option.id === current ? ' (current)' : ''}: ${option.description}`);
|
|
5
|
+
return [`Permissions: ${permissionLabel(current)}`, 'Change with /permissions <mode>:', ...rows].join('\n');
|
|
6
|
+
}
|
|
2
7
|
import { graphStorageDirectory } from './graph-account.js';
|
|
3
8
|
import { configuredGraphSelection, currentGraphSubject, saveGraphSelection } from './graph-selection.js';
|
|
4
|
-
import { loadAccessibleGraph, requireGraphMembership } from './membership.js';
|
|
9
|
+
import { currentGraphSelection, loadAccessibleGraph, requireGraphMembership } from './membership.js';
|
|
5
10
|
import { GraphProviderUnavailableError } from './graph-provider-portability.js';
|
|
6
11
|
import { confirmAndApplyModelOverride } from './model-override.js';
|
|
12
|
+
import { applyGoalCommand } from './session-goal.js';
|
|
7
13
|
import { changeConfigFile, configDirectory, loadConfig, loadSavedAnalytics } from './config.js';
|
|
8
|
-
import { applyModelContextWindow, providerLabel, recordProviderModel, REASONING_EFFORTS } from './providers.js';
|
|
14
|
+
import { applyModelContextWindow, modelDisplayName, modelIdForDisplayName, providerLabel, recordProviderModel, REASONING_EFFORTS } from './providers.js';
|
|
9
15
|
import { resolveRepositoryId } from './code-intelligence/repository.js';
|
|
10
16
|
import { logoutCodex } from './codex-auth.js';
|
|
11
17
|
import { codexAccountHome } from './codex-rpc.js';
|
|
@@ -15,6 +21,7 @@ import { telemetryDirectory } from './telemetry/identity.js';
|
|
|
15
21
|
import { purgeOutbox } from './telemetry/outbox.js';
|
|
16
22
|
import { recordPreference } from './telemetry/state.js';
|
|
17
23
|
import { telemetryGate } from './telemetry/gate.js';
|
|
24
|
+
import { formatWeekReset } from './andorra/usage-format.js';
|
|
18
25
|
const MAX_CODEINTEL_REPO_OVERRIDES = 100;
|
|
19
26
|
const REASONING_USAGE = 'Usage: /reasoning default|none|minimal|low|medium|high|xhigh|max';
|
|
20
27
|
export const HELP = `Commands:
|
|
@@ -23,7 +30,7 @@ export const HELP = `Commands:
|
|
|
23
30
|
/login [--no-browser] Sign in or create an Andorra account (prints the address over SSH)
|
|
24
31
|
/auth logout Remove this machine's saved Andorra account session
|
|
25
32
|
/auth status Show Andorra account session status
|
|
26
|
-
/model [model-id] Open model
|
|
33
|
+
/model [model-id] Open the provider/model tree (→ expands, ← collapses) or select a model directly; with a graph that pins node models, asks whether to override them
|
|
27
34
|
/model list Discover models from the active provider
|
|
28
35
|
/providers [id] Choose providers; Right/e edits; Add provider configures
|
|
29
36
|
/subagent [id [model]] Set the provider/model external hosts (Claude/Codex CLI) must use for Andorra subagent runs; off clears it
|
|
@@ -34,7 +41,8 @@ export const HELP = `Commands:
|
|
|
34
41
|
/attach <path> Attach a file or folder to your next task (large pastes and dropped files attach automatically)
|
|
35
42
|
/usage Open session usage (Escape to return)
|
|
36
43
|
/permissions [mode] Choose and remember workspace permissions
|
|
37
|
-
/jev <on|off|status> Turn Jev on or off for
|
|
44
|
+
/jev <on|off|status> Turn Jev on or off for this session, or show its setting
|
|
45
|
+
/jev global <on|off> Turn the Global Jev switch on or off; off stops Jev in every session and agent
|
|
38
46
|
/feedback <on|off|status> Show the anonymous-feedback setting; Paid accounts can turn it off
|
|
39
47
|
/yolo <on|off> Turn session-wide Full Access on or off (host files and network)
|
|
40
48
|
/tools List available coding tools
|
|
@@ -49,6 +57,7 @@ export const HELP = `Commands:
|
|
|
49
57
|
/status Show workspace and current settings
|
|
50
58
|
/clear Clear the conversation on screen and the retained context (session usage is retained)
|
|
51
59
|
/compact Compact retained conversation history to free context
|
|
60
|
+
/goal [text|clear] Set, show or clear the session goal; a run keeps working until a completion check agrees the goal is met
|
|
52
61
|
/help Show commands
|
|
53
62
|
/exit Quit
|
|
54
63
|
Selection screens: Up/Down to browse, Enter or Space to select, Escape to return.
|
|
@@ -56,17 +65,28 @@ Ctrl+B toggles dashboard; Ctrl+G pages its graph; Ctrl+N cycles dashboard model
|
|
|
56
65
|
Ctrl+T expands/collapses todos; Ctrl+O expands/collapses tool details; Ctrl+Y collapses/expands live thinking.
|
|
57
66
|
Shift+Arrow/Home/End selects prompt text; Ctrl+C copies and Ctrl+X cuts a selection. The wheel scrolls; Up/Down recall prompts. Drag selects and copies transcript text; double-click copies a word.
|
|
58
67
|
Ctrl+C stops an interactive run; send direction to resume, or press Ctrl+C again to exit (idle Ctrl+C exits too). /yolo on|off applies immediately, including at approvals. /exit quits. Headless Ctrl+C cancels the run; a second press exits.`;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
/** `name (id)` when the model has a display name, else the id. */
|
|
69
|
+
function modelWithName(provider, id) {
|
|
70
|
+
const name = modelDisplayName(provider, id);
|
|
71
|
+
return name === id ? id : `${name} (${id})`;
|
|
72
|
+
}
|
|
73
|
+
/** The /status line for Andorra's hosted models, with its leading line break; empty while there is nothing to show. */
|
|
74
|
+
function andorraUsageLine(state) {
|
|
75
|
+
const usage = state.andorra?.usage?.();
|
|
76
|
+
if (!usage)
|
|
77
|
+
return '';
|
|
78
|
+
if (usage.kind === 'not-available')
|
|
79
|
+
return '\nAndorra models: Not available at the moment.';
|
|
80
|
+
const resets = formatWeekReset(usage.resetsAt);
|
|
81
|
+
return `\nAndorra models, this week: ${usage.usedPercent}% used${resets ? `, resets ${resets}` : ''}`;
|
|
82
|
+
}
|
|
83
|
+
/** The message refusing a switch to this provider, or undefined when it may be selected. An absent `state.andorra` counts as available. */
|
|
84
|
+
export function andorraRefusal(state, providerId) {
|
|
85
|
+
if (state.config.providers.find(item => item.id === providerId)?.type !== 'andorra')
|
|
86
|
+
return undefined;
|
|
87
|
+
const availability = state.andorra?.availability();
|
|
88
|
+
return availability && !availability.available ? availability.message : undefined;
|
|
89
|
+
}
|
|
70
90
|
export function compactHistory(turns) {
|
|
71
91
|
const clip = (text, limit) => { const flat = text.replace(/\s+/g, ' ').trim(); return flat.length > limit ? flat.slice(0, limit - 1) + '…' : flat; };
|
|
72
92
|
const lines = turns.map((turn, index) => `${index + 1}. ${clip(turn.task, 160)}${turn.direction === undefined ? '' : ` (continued with: ${clip(turn.direction, 160)})`} → ${clip(turn.completion.summary, 240)}`);
|
|
@@ -75,20 +95,10 @@ export function compactHistory(turns) {
|
|
|
75
95
|
completion: { summary: lines.join('\n'), tests: [] },
|
|
76
96
|
}];
|
|
77
97
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Estimate the context the compacted history will occupy, in tokens, so the footer can
|
|
80
|
-
* drop the moment `/compact` runs. This is a character-based approximation (the same
|
|
81
|
-
* seed text measured at ~4 characters per token); the next model request replaces it with
|
|
82
|
-
* the provider-reported input size.
|
|
83
|
-
*/
|
|
84
98
|
export function compactedContextEstimate(turns) {
|
|
85
99
|
return Math.ceil(JSON.stringify(turns).length / 4);
|
|
86
100
|
}
|
|
87
101
|
const CODEGRAPH_USAGE = 'Usage: /codegraph status|enable|disable|rebuild. Add --global to enable|disable to set the saved default for every project (this clears per-repository overrides).';
|
|
88
|
-
/**
|
|
89
|
-
* `/codegraph`. `enable|disable` alone records an override for the current repository; with
|
|
90
|
-
* `--global` it sets the saved default that every project and every later session starts from.
|
|
91
|
-
*/
|
|
92
102
|
async function codegraphCommand(action, scope, state, signal) {
|
|
93
103
|
const manager = state.codeIntel;
|
|
94
104
|
if (!manager)
|
|
@@ -100,7 +110,7 @@ async function codegraphCommand(action, scope, state, signal) {
|
|
|
100
110
|
const status = await manager.getStatus();
|
|
101
111
|
const indexed = status.stats?.lastIndexedAt ? new Date(status.stats.lastIndexedAt).toLocaleString() : 'never';
|
|
102
112
|
const repositoryId = await resolveRepositoryId(state.workspace).catch(() => undefined);
|
|
103
|
-
const saved = state.config.codeIntel?.enabled
|
|
113
|
+
const saved = state.config.codeIntel?.enabled === true;
|
|
104
114
|
const override = !repositoryId ? ''
|
|
105
115
|
: (state.config.codeIntel?.enabledRepos ?? []).includes(repositoryId) ? '; this repository is enabled by override'
|
|
106
116
|
: (state.config.codeIntel?.disabledRepos ?? []).includes(repositoryId) ? '; this repository is disabled by override'
|
|
@@ -111,17 +121,12 @@ async function codegraphCommand(action, scope, state, signal) {
|
|
|
111
121
|
case 'disable': {
|
|
112
122
|
const enable = action === 'enable';
|
|
113
123
|
if (scope === 'global') {
|
|
114
|
-
// The global toggle is the newest statement of intent, so it resets the per-repository
|
|
115
|
-
// exceptions: after it, every project follows the saved default until a plain
|
|
116
|
-
// `/codegraph enable|disable` records a new override.
|
|
117
124
|
const cleared = (state.config.codeIntel?.enabledRepos?.length ?? 0) + (state.config.codeIntel?.disabledRepos?.length ?? 0);
|
|
118
125
|
state.config.codeIntel = { ...state.config.codeIntel, enabled: enable, enabledRepos: [], disabledRepos: [] };
|
|
119
126
|
return { text: `Code intelligence ${enable ? 'enabled' : 'disabled'} for every project; new sessions in other projects start with it ${enable ? 'on' : 'off'}.${cleared ? ` ${cleared} per-repository override${cleared === 1 ? ' was' : 's were'} cleared.` : ''} /codegraph ${enable ? 'disable' : 'enable'} without --global overrides this for one repository.`, save: true };
|
|
120
127
|
}
|
|
121
128
|
const repositoryId = await resolveRepositoryId(state.workspace).catch(() => undefined);
|
|
122
129
|
if (repositoryId) {
|
|
123
|
-
// Per-repository override: never touch the global enabled flag, so a
|
|
124
|
-
// global disable survives enabling one repository (and vice versa).
|
|
125
130
|
const disabled = new Set(state.config.codeIntel?.disabledRepos ?? []);
|
|
126
131
|
const enabledRepos = new Set(state.config.codeIntel?.enabledRepos ?? []);
|
|
127
132
|
const target = enable ? enabledRepos : disabled;
|
|
@@ -141,7 +146,6 @@ async function codegraphCommand(action, scope, state, signal) {
|
|
|
141
146
|
else {
|
|
142
147
|
state.config.codeIntel = { ...state.config.codeIntel, enabled: enable };
|
|
143
148
|
}
|
|
144
|
-
// The live manager is updated by executeCommand only after persistence succeeds.
|
|
145
149
|
return { text: `Code intelligence ${enable ? 'enabled' : 'disabled'}${repositoryId ? ' for this repository' : ''}.`, save: true };
|
|
146
150
|
}
|
|
147
151
|
case 'rebuild':
|
|
@@ -160,12 +164,6 @@ async function codegraphCommand(action, scope, state, signal) {
|
|
|
160
164
|
return { text: CODEGRAPH_USAGE };
|
|
161
165
|
}
|
|
162
166
|
}
|
|
163
|
-
/**
|
|
164
|
-
* Copy a configuration over the live one, deletions included.
|
|
165
|
-
*
|
|
166
|
-
* `Object.assign` only adds and replaces, so a setting another writer deleted would stay in the
|
|
167
|
-
* live configuration and be resurrected by the next command that saves the whole snapshot.
|
|
168
|
-
*/
|
|
169
167
|
function syncConfig(target, source) {
|
|
170
168
|
for (const key of Object.keys(target)) {
|
|
171
169
|
if (!(key in source))
|
|
@@ -173,11 +171,9 @@ function syncConfig(target, source) {
|
|
|
173
171
|
}
|
|
174
172
|
Object.assign(target, source);
|
|
175
173
|
}
|
|
176
|
-
/** What the command says after it changed the preference. */
|
|
177
174
|
function feedbackChangedText(enabled) {
|
|
178
175
|
return `Anonymous feedback ${enabled ? 'on' : 'off'}. Setting saved for this machine.${enabled ? ' It never includes your code, prompts, or API keys.' : ' No anonymous product data will be reported from this installation.'}`;
|
|
179
176
|
}
|
|
180
|
-
/** The line shown for a plan that collects as a condition of the plan. */
|
|
181
177
|
function includedWithPlanText(plan) {
|
|
182
178
|
if (plan === 'legacy')
|
|
183
179
|
return 'on (included with the Legacy plan)';
|
|
@@ -185,33 +181,20 @@ function includedWithPlanText(plan) {
|
|
|
185
181
|
return 'on (included with the Free plan)';
|
|
186
182
|
return 'on (included with your plan until this account\'s plan is confirmed)';
|
|
187
183
|
}
|
|
188
|
-
/** Why a plan that cannot opt out refuses `/feedback off`. */
|
|
189
184
|
function optOutRefusedText(plan) {
|
|
190
185
|
const named = plan === 'free' ? 'Free' : plan === 'legacy' ? 'Legacy' : 'current';
|
|
191
186
|
return `Anonymous feedback stays on: collection is included with the ${named} plan. Upgrade to Paid to turn it off.`;
|
|
192
187
|
}
|
|
193
|
-
/**
|
|
194
|
-
* Whether a `/subagent off` invocation clears the saved pair.
|
|
195
|
-
*
|
|
196
|
-
* A provider may legally be named "off", and a selection of a real provider must not delete the
|
|
197
|
-
* configuration: the clear applies only when nothing is configured under that name.
|
|
198
|
-
*/
|
|
199
188
|
export function subagentClearRequested(line, providers) {
|
|
200
189
|
return /^\/subagent\s+off\s*$/.test(line.trim()) && !providers.some(provider => provider.id === 'off');
|
|
201
190
|
}
|
|
202
|
-
/** Commit selection changes only after persistence succeeds; callers render the returned result afterward. */
|
|
203
191
|
export async function executeCommand(line, state, persist, signal, graphAccess = { load: loadAccessibleGraph, requirePaid: requireGraphMembership }, graphSubject = currentGraphSubject, logout = logoutCodex) {
|
|
204
|
-
// `/logout` is the Andorra account's sign-out, the counterpart of `/login`; a provider's managed
|
|
205
|
-
// sign-in is named explicitly, so signing out of the account never touches provider sessions.
|
|
206
192
|
if (/^\/logout\s+\S/.test(line.trim()) && !/^\/logout\s+--all$/.test(line.trim())) {
|
|
207
193
|
if (!/^\/logout\s+codex$/.test(line.trim()))
|
|
208
194
|
return { text: 'Usage: /logout [--all] | /logout codex' };
|
|
209
195
|
const codex = state.config.providers.filter(candidate => candidate.type === 'codex');
|
|
210
196
|
if (!codex.length)
|
|
211
197
|
return { text: 'No Codex provider is configured, so there is no Codex sign-in to log out of. Use /logout to sign out of your Andorra account.' };
|
|
212
|
-
// Each configured account has its own home, so all of them leave together: signing out one
|
|
213
|
-
// alone would leave the others' sessions live under entries the person believes are gone.
|
|
214
|
-
// Slot-less providers share the default home, which is signed out once.
|
|
215
198
|
const homes = [];
|
|
216
199
|
for (const item of codex) {
|
|
217
200
|
const home = codexAccountHome(item.codexAccount);
|
|
@@ -234,23 +217,14 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
|
|
|
234
217
|
return { text: 'Signed out of every configured Codex account. Provider settings are retained; use /providers to sign in again.', exit: true, clear: true };
|
|
235
218
|
}
|
|
236
219
|
const draft = { ...state, config: structuredClone(state.config) };
|
|
237
|
-
// The feedback preference belongs to the installation rather than to this process: the desktop
|
|
238
|
-
// app and another CLI write the same file, so the answer this command reports and the value it
|
|
239
|
-
// changes are the ones saved now, not the snapshot this process loaded when it started. The bare
|
|
240
|
-
// form only reports, like `status`.
|
|
241
220
|
const feedbackWrite = /^\/feedback(?:\s+(?:on|off|status))?$/.test(line.trim());
|
|
242
221
|
if (feedbackWrite)
|
|
243
222
|
draft.config.analytics = await loadSavedAnalytics();
|
|
244
|
-
// The plan gate is resolved before the command runs, so `/feedback off` refuses rather than
|
|
245
|
-
// writes a value that only looks stored.
|
|
246
223
|
if (feedbackWrite) {
|
|
247
|
-
// Read the preference from the file, not this process's snapshot: another writer may have
|
|
248
|
-
// changed it since the run started.
|
|
249
224
|
const gate = await telemetryGate({ home: configDirectory(), config: await loadConfig(configDirectory()), subject: await graphSubject().catch(() => undefined) });
|
|
250
225
|
draft.analytics = { plan: gate.plan, canOptOut: gate.canOptOut };
|
|
251
226
|
}
|
|
252
227
|
const graphCommand = /^\/graph\s+(\S+)\s*$/.exec(line.trim());
|
|
253
|
-
// A second word is only ever `--global`; a bare `/codegraph --global` or a misspelt flag reaches the usage text.
|
|
254
228
|
const codegraph = /^\/codegraph(?:\s+(\S+))?(?:\s+(\S+))?\s*$/.exec(line.trim());
|
|
255
229
|
const codegraphScope = codegraph?.[2] === undefined ? 'repository' : codegraph[2] === '--global' ? 'global' : undefined;
|
|
256
230
|
let result;
|
|
@@ -261,20 +235,17 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
|
|
|
261
235
|
if (action === 'logout' || action === 'login') {
|
|
262
236
|
delete draft.graph;
|
|
263
237
|
result.clear = true;
|
|
238
|
+
state.andorra?.accountChanged?.();
|
|
264
239
|
}
|
|
265
240
|
}
|
|
266
241
|
else if (codegraph) {
|
|
267
242
|
result = codegraphScope ? await codegraphCommand(codegraph[1] ?? 'status', codegraphScope, draft, signal) : { text: CODEGRAPH_USAGE };
|
|
268
243
|
}
|
|
269
244
|
else if (graphCommand) {
|
|
270
|
-
const id = graphCommand[1];
|
|
245
|
+
const id = currentGraphSelection(graphCommand[1]);
|
|
271
246
|
try {
|
|
272
247
|
signal?.throwIfAborted();
|
|
273
248
|
const subject = await graphSubject();
|
|
274
|
-
// A graph that cannot bind to this machine's providers stays selectable: the choice names
|
|
275
|
-
// what a task will run, and it is the run that refuses those references. The graph is read
|
|
276
|
-
// once more without binding so the answer can still name it; membership and storage errors
|
|
277
|
-
// keep refusing the selection outright.
|
|
278
249
|
let graph;
|
|
279
250
|
let unavailable;
|
|
280
251
|
try {
|
|
@@ -297,8 +268,6 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
|
|
|
297
268
|
delete draft.graph;
|
|
298
269
|
else
|
|
299
270
|
draft.graph = id;
|
|
300
|
-
// This form has no UI to confirm on, so the warning that the switch starts fresh travels
|
|
301
|
-
// in the returned text; an unchanged graph clears nothing and carries no warning.
|
|
302
271
|
result = { text: `Graph: ${id === 'default' ? 'Default' : graph.name} (${id === 'default' ? 'Andorra Agent only' : `${graph.id}@${graph.revision}`})${changed ? ". This session's context is cleared and the new graph starts fresh." : ''}${unavailable ? ` ${unavailable} The graph is selected anyway; a task on it starts only once it can run on this machine, or after /model overrides every node with one provider you have.` : ''}`, clear: changed, save };
|
|
303
272
|
}
|
|
304
273
|
catch (error) {
|
|
@@ -311,13 +280,10 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
|
|
|
311
280
|
const modelDirect = /^\/model\s+(\S+)$/.exec(line.trim());
|
|
312
281
|
const activeProvider = draft.config.providers.find(p => p.id === draft.config.provider);
|
|
313
282
|
if (modelDirect && modelDirect[1] !== 'list' && draft.graph && activeProvider && state.confirmModelOverride) {
|
|
314
|
-
// The graph is saved before the config: a declined or failed override leaves both untouched.
|
|
315
283
|
const outcome = await confirmAndApplyModelOverride({
|
|
316
284
|
graphId: draft.graph,
|
|
317
285
|
target: { provider: activeProvider.id, model: modelDirect[1] },
|
|
318
286
|
configProviders: draft.config.providers.map(p => ({ id: p.id, type: p.type, model: p.model })),
|
|
319
|
-
// Same rule as the /model screen: the override rewrites every provider reference, so the
|
|
320
|
-
// graph is read without binding — binding is what refuses a graph whose providers are gone.
|
|
321
287
|
loadGraph: (id, graphSignal) => graphAccess.load(id, graphSignal, undefined, { bindProviders: false }),
|
|
322
288
|
resolveDirectory: async () => graphStorageDirectory(undefined, await graphSubject()),
|
|
323
289
|
confirm: state.confirmModelOverride,
|
|
@@ -335,53 +301,41 @@ export async function executeCommand(line, state, persist, signal, graphAccess =
|
|
|
335
301
|
result = handleCommand(line, draft);
|
|
336
302
|
}
|
|
337
303
|
const permissionsChanged = draft.permissions !== state.permissions;
|
|
338
|
-
// Cache writes must stop before Read Only or Plan is persisted or exposed to the run.
|
|
339
304
|
if (permissionsChanged && (draft.permissions === 'read-only' || draft.permissions === 'plan'))
|
|
340
305
|
await state.codeIntel?.setPermissions(draft.permissions);
|
|
341
306
|
if (result.save && feedbackWrite) {
|
|
342
|
-
// The preference belongs to the installation, so its change is written to the file's current
|
|
343
|
-
// content under the configuration's lock: saving this process's snapshot would revert a
|
|
344
|
-
// provider, a limit or a permission that another writer changed while it was running.
|
|
345
|
-
// Every event already queued under the old preference is discarded only when reporting actually
|
|
346
|
-
// turns off. Repeating `/feedback off` on an installation that is already off keeps the
|
|
347
|
-
// generation, so purging again would delete events another process legitimately queued since —
|
|
348
|
-
// on a shared home, a plan that cannot opt out still reports. The purge is decided inside the
|
|
349
|
-
// locked update so it sees the state the write replaced.
|
|
350
307
|
let preferenceTurnedOff = false;
|
|
351
308
|
const saved = await changeConfigFile(configDirectory(), current => {
|
|
352
309
|
const enabled = draft.config.analytics?.enabled !== false;
|
|
353
310
|
preferenceTurnedOff = resolveAnalyticsConfig(current).enabled && !enabled;
|
|
354
311
|
return { ...current, analytics: { ...draft.config.analytics, generation: analyticsGenerationFor(current.analytics, enabled) } };
|
|
355
312
|
});
|
|
356
|
-
// The generation bump closes the race against a task engine that appends just after this purge.
|
|
357
313
|
if (preferenceTurnedOff)
|
|
358
314
|
await purgeOutbox(telemetryDirectory());
|
|
359
315
|
if (saved.analytics !== undefined) {
|
|
360
316
|
await recordPreference({ subject: await graphSubject().catch(() => undefined), preference: saved.analytics.enabled === false ? 'off' : 'on' }).catch(() => { });
|
|
361
317
|
}
|
|
362
|
-
// The live configuration follows the file, not the snapshot this process started with.
|
|
363
318
|
draft.config = saved;
|
|
364
319
|
}
|
|
365
320
|
else if (result.save)
|
|
366
321
|
await persist(draft.config);
|
|
367
|
-
// Preserve the config object shared by the CLI's run callback, and the deletions another writer
|
|
368
|
-
// made in it: a setting that is gone from the file must be gone from the live configuration too.
|
|
369
322
|
syncConfig(state.config, draft.config);
|
|
370
323
|
if (graphCommand && result.save)
|
|
371
324
|
delete state.config.graph;
|
|
372
|
-
// A cleared subagent pair is a delete on the draft, which Object.assign cannot carry back. A
|
|
373
|
-
// provider named "off" is a selection, not a clear, so it leaves the setting alone.
|
|
374
325
|
if (subagentClearRequested(line, state.config.providers) && result.save)
|
|
375
326
|
delete state.config.externalSubagent;
|
|
376
327
|
state.yolo = draft.yolo;
|
|
377
328
|
state.permissions = draft.permissions;
|
|
329
|
+
if (result.goalChanged)
|
|
330
|
+
state.goal = draft.goal;
|
|
331
|
+
if (draft.jev !== undefined)
|
|
332
|
+
state.jev = draft.jev;
|
|
378
333
|
if (permissionsChanged && draft.permissions !== 'read-only' && draft.permissions !== 'plan')
|
|
379
334
|
await state.codeIntel?.setPermissions(draft.permissions);
|
|
380
335
|
if (draft.graph === undefined)
|
|
381
336
|
delete state.graph;
|
|
382
337
|
else
|
|
383
338
|
state.graph = draft.graph;
|
|
384
|
-
// Live manager changes follow persistence, never precede it.
|
|
385
339
|
if (codegraph && result.save && (codegraph[1] === 'enable' || codegraph[1] === 'disable')) {
|
|
386
340
|
await state.codeIntel?.setEnabled(codegraph[1] === 'enable');
|
|
387
341
|
}
|
|
@@ -404,27 +358,45 @@ export function handleCommand(line, state) {
|
|
|
404
358
|
return { text: 'Nothing to compact: no conversation history is retained yet.' };
|
|
405
359
|
return { text: `Compacted ${turns.length} retained turn${turns.length === 1 ? '' : 's'} into one summary entry. The next request sends the condensed history; session usage totals are unchanged.`, compact: true };
|
|
406
360
|
}
|
|
361
|
+
case '/goal': {
|
|
362
|
+
const outcome = applyGoalCommand(line, state.goal);
|
|
363
|
+
if (outcome.changed)
|
|
364
|
+
state.goal = outcome.goal;
|
|
365
|
+
return { text: outcome.text, ...(outcome.changed ? { goalChanged: true } : {}) };
|
|
366
|
+
}
|
|
407
367
|
case '/model':
|
|
408
368
|
if (arg === 'list')
|
|
409
369
|
return { text: '', discover: true };
|
|
410
370
|
if (!arg)
|
|
411
|
-
return { text: `${provider.id}: ${provider.model}` };
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
371
|
+
return { text: `${provider.id}: ${modelWithName(provider, provider.model)}` };
|
|
372
|
+
{ // An Andorra model may also be named by its exact display name; the id is what is saved.
|
|
373
|
+
const chosen = modelIdForDisplayName(provider, arg) ?? (args.length === 1 ? arg : undefined);
|
|
374
|
+
if (chosen === undefined)
|
|
375
|
+
return { text: 'Usage: /model <model-id>' };
|
|
376
|
+
if (provider.model !== chosen) {
|
|
377
|
+
applyModelContextWindow(provider, chosen);
|
|
378
|
+
delete provider.reasoningEffort;
|
|
379
|
+
}
|
|
380
|
+
recordProviderModel(provider, chosen);
|
|
381
|
+
provider.model = chosen;
|
|
382
|
+
return { text: `Model: ${provider.id}/${modelWithName(provider, chosen)}`, save: true, clear: true };
|
|
417
383
|
}
|
|
418
|
-
recordProviderModel(provider, arg);
|
|
419
|
-
provider.model = arg;
|
|
420
|
-
return { text: `Model: ${provider.id}/${arg}`, save: true, clear: true };
|
|
421
384
|
case '/providers':
|
|
422
385
|
if (!arg && !provider)
|
|
423
386
|
return { text: 'No providers configured. Open /providers and choose Add provider.' };
|
|
424
|
-
if (!arg)
|
|
425
|
-
|
|
387
|
+
if (!arg) {
|
|
388
|
+
// Andorra listed by default and not saved yet reads like any provider, first. Naming it here saves nothing.
|
|
389
|
+
const listed = state.andorra?.listed?.();
|
|
390
|
+
const shown = listed ? [listed, ...state.config.providers] : state.config.providers;
|
|
391
|
+
return { text: shown.map(p => `${p !== listed && p.id === provider.id ? '*' : ' '} ${providerLabel(p, shown)} (${p.type}) — ${modelDisplayName(p, p.model)}`).join('\n') };
|
|
392
|
+
}
|
|
426
393
|
if (!state.config.providers.some(p => p.id === arg))
|
|
427
394
|
return { text: `Unknown provider: ${arg}. Use /providers to browse configured providers.` };
|
|
395
|
+
{
|
|
396
|
+
const refusal = andorraRefusal(state, arg);
|
|
397
|
+
if (refusal)
|
|
398
|
+
return { text: refusal };
|
|
399
|
+
}
|
|
428
400
|
state.config.provider = arg;
|
|
429
401
|
return { text: `Provider: ${arg}. Conversation cleared for the new provider.`, save: true, clear: true };
|
|
430
402
|
case '/subagent': {
|
|
@@ -433,8 +405,6 @@ export function handleCommand(line, state) {
|
|
|
433
405
|
return { text: setting
|
|
434
406
|
? `External subagent: ${setting.provider}/${setting.model}. Claude CLI and Codex CLI subagent runs use this pair.`
|
|
435
407
|
: 'External subagent: not set. External hosts cannot start an Andorra subagent run until a provider/model is picked; they receive a PROVIDER_NOT_SET error listing the options. Use /subagent <provider> [model], or /subagent to pick.' };
|
|
436
|
-
// A provider may legally be named "off", so the clear applies only when nothing is
|
|
437
|
-
// configured under that name: a selection of a real provider must not delete the setting.
|
|
438
408
|
if (arg === 'off' && !state.config.providers.some(provider => provider.id === 'off')) {
|
|
439
409
|
if (!setting)
|
|
440
410
|
return { text: 'External subagent: already not set.' };
|
|
@@ -474,18 +444,17 @@ export function handleCommand(line, state) {
|
|
|
474
444
|
if (changed)
|
|
475
445
|
return { text: 'Graph: Default (Andorra Agent)', clear: true };
|
|
476
446
|
}
|
|
477
|
-
return { text: 'Graph: Default - Andorra Agent only. Use the graph selector for
|
|
447
|
+
return { text: 'Graph: Default - Andorra Agent only. Use the graph selector for custom graphs.' };
|
|
478
448
|
case '/permissions':
|
|
479
449
|
if (!arg)
|
|
480
|
-
return { text:
|
|
450
|
+
return { text: permissionChoices(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval')) };
|
|
481
451
|
if (!isPermissionMode(arg))
|
|
482
|
-
return { text:
|
|
452
|
+
return { text: `Unknown permission mode "${arg}".\n${permissionChoices(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}` };
|
|
483
453
|
state.config.workspacePermissions = { ...state.config.workspacePermissions, [workspacePermissionKey(state.workspace)]: arg };
|
|
484
454
|
state.permissions = arg;
|
|
485
455
|
state.yolo = arg === 'full-access';
|
|
486
456
|
return { text: `Permissions: ${permissionLabel(arg)} (remembered for this workspace).`, save: true };
|
|
487
457
|
case '/yolo':
|
|
488
|
-
// The bare form reports and changes nothing: a stray Enter must never flip approvals.
|
|
489
458
|
if (!arg)
|
|
490
459
|
return { text: `YOLO: ${state.yolo ? 'on' : 'off'}.\nUsage: /yolo on|off` };
|
|
491
460
|
if (!['on', 'off'].includes(arg))
|
|
@@ -496,30 +465,37 @@ export function handleCommand(line, state) {
|
|
|
496
465
|
? 'YOLO on: session-wide Full Access. Host files, shell, Git, QA, MCP and network operations are automatically approved.'
|
|
497
466
|
: 'YOLO off: session permissions restored to Ask for approval.' };
|
|
498
467
|
case '/jev': {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const
|
|
468
|
+
const jevUsage = 'Usage: /jev on|off|status, or /jev global on|off';
|
|
469
|
+
const global = args[0] === 'global';
|
|
470
|
+
const globalArg = global ? args[1] : undefined;
|
|
471
|
+
if (global ? args.length !== 2 || !['on', 'off'].includes(globalArg ?? '') : args.length > 1 || (arg && !['on', 'off', 'status'].includes(arg)))
|
|
472
|
+
return { text: jevUsage };
|
|
473
|
+
const jevStatus = () => {
|
|
474
|
+
const globalOn = state.config.jevEnabled !== false;
|
|
475
|
+
const sessionOn = state.jev !== false;
|
|
476
|
+
return `Jev: ${globalOn && sessionOn ? 'on' : 'off'} for this session (session ${sessionOn ? 'on' : 'off'}, Global Jev switch ${globalOn ? 'on' : 'off'}).`
|
|
477
|
+
+ (globalOn ? ' Applies to Agent nodes with Jev turned on. Requires sign-in and available quota.' : ' The Global Jev switch is off, so no session and no Agent node uses Jev. Turn it on with /jev global on.');
|
|
478
|
+
};
|
|
502
479
|
if (arg === 'status')
|
|
503
|
-
return { text: jevStatus };
|
|
480
|
+
return { text: jevStatus() };
|
|
504
481
|
if (!arg)
|
|
505
|
-
return { text: `${jevStatus}\
|
|
506
|
-
state.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return { text:
|
|
510
|
-
|
|
482
|
+
return { text: `${jevStatus()}\n${jevUsage}` };
|
|
483
|
+
const kept = state.running ? ' The current run keeps its setting; the change applies after it ends or you interrupt it.' : '';
|
|
484
|
+
if (global) {
|
|
485
|
+
state.config.jevEnabled = globalArg === 'on';
|
|
486
|
+
return { text: `Global Jev switch ${state.config.jevEnabled ? 'on' : 'off'}. Setting saved for this machine.${kept}${state.config.jevEnabled ? ` Each session keeps its own setting; this session is ${state.jev === false ? 'off' : 'on'}.` : ' No session and no Agent node uses Jev until it is turned back on.'}`, save: true };
|
|
487
|
+
}
|
|
488
|
+
state.jev = arg === 'on';
|
|
489
|
+
if (state.config.jevEnabled === false)
|
|
490
|
+
return { text: `Jev ${state.jev ? 'on' : 'off'} for this session, but the Global Jev switch is off, so Jev stays off. Turn it on with /jev global on.` };
|
|
491
|
+
return { text: `Jev ${state.jev ? 'on' : 'off'} for this session.${kept}${state.jev && !state.running ? ' It applies to Agent nodes with Jev turned on and requires sign-in and available quota.' : ''}` };
|
|
511
492
|
}
|
|
512
493
|
case '/feedback': {
|
|
513
494
|
if (args.length > 1 || (arg && !['on', 'off', 'status'].includes(arg)))
|
|
514
495
|
return { text: 'Usage: /feedback on|off|status' };
|
|
515
|
-
// The saved answer is the effective one, not the raw stored field: a configuration that
|
|
516
|
-
// never mentioned the setting still reports on, and the status line has to say so.
|
|
517
|
-
// The stored preference, not the effective reporting answer: a never-confirmed installation
|
|
518
|
-
// collects even with the preference off, and the status line still has to say what was saved.
|
|
519
496
|
const enabled = resolveAnalyticsConfig(state.config).enabled;
|
|
520
497
|
const plan = state.analytics?.plan ?? 'unknown';
|
|
521
498
|
const canOptOut = state.analytics?.canOptOut ?? true;
|
|
522
|
-
// The bare form reports, like `status`: a stray Enter must never change the preference.
|
|
523
499
|
if (arg === 'status' || !arg) {
|
|
524
500
|
const usage = arg ? '' : '\nUsage: /feedback on|off|status';
|
|
525
501
|
if (!canOptOut)
|
|
@@ -527,17 +503,12 @@ export function handleCommand(line, state) {
|
|
|
527
503
|
return { text: `Anonymous feedback: ${enabled ? 'on' : 'off'} (saved preference). It never includes your code, prompts, or API keys.${usage}` };
|
|
528
504
|
}
|
|
529
505
|
const next = arg === 'on';
|
|
530
|
-
// A switch that silently does nothing is worse than one that is not offered: a plan that
|
|
531
|
-
// cannot opt out refuses the change and says why.
|
|
532
506
|
if (!next && !canOptOut)
|
|
533
507
|
return { text: optOutRefusedText(plan) };
|
|
534
508
|
state.config.analytics = { ...state.config.analytics, enabled: next };
|
|
535
509
|
return { text: feedbackChangedText(next), save: true };
|
|
536
510
|
}
|
|
537
511
|
case '/usage': {
|
|
538
|
-
// Cache traffic renders only when reported, mirroring the usage screen: an
|
|
539
|
-
// unreported read is omitted rather than shown as a measured zero, and the
|
|
540
|
-
// hit-rate percentage needs a positive input total to mean anything.
|
|
541
512
|
const read = state.usage.cacheRead ?? 0, write = state.usage.cacheWrite ?? 0;
|
|
542
513
|
const cache = read > 0 || write > 0
|
|
543
514
|
? `, ${[read > 0 ? `${read} cache-read${state.usage.inputTokens > 0 ? ` (${Math.round(read / state.usage.inputTokens * 100)}% of input)` : ''}` : '',
|
|
@@ -545,7 +516,7 @@ export function handleCommand(line, state) {
|
|
|
545
516
|
: '';
|
|
546
517
|
return { text: `Session: ${state.usage.requests} model requests, ${state.usage.inputTokens} input + ${state.usage.outputTokens} output tokens${cache} (provider-reported; missing usage is not estimated).\nCost: unavailable; no pricing assumptions.${state.lastRun ? `\nLast run: ${state.lastRun.id} — ${state.lastRun.status}, ${state.lastRun.toolCalls} tool calls` : ''}` };
|
|
547
518
|
}
|
|
548
|
-
case '/status': return { text: `Workspace: ${state.workspace}\nProvider/model: ${provider.id}/${provider.model}\nThinking: ${provider.reasoningEffort ?? 'provider default'}\nContext window: ${provider.contextWindow?.toLocaleString() ?? 'unknown'}\nGraph: ${state.graph ?? 'Default'}\nPermissions: ${permissionLabel(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}\nYOLO: ${state.yolo ? 'on' : 'off'}` };
|
|
519
|
+
case '/status': return { text: `Workspace: ${state.workspace}\nProvider/model: ${provider.id}/${modelWithName(provider, provider.model)}\nThinking: ${provider.reasoningEffort ?? 'provider default'}\nContext window: ${provider.contextWindow?.toLocaleString() ?? 'unknown'}\nGraph: ${state.graph ?? 'Default'}\nPermissions: ${permissionLabel(state.permissions ?? (state.yolo ? 'full-access' : 'ask-for-approval'))}\nYOLO: ${state.yolo ? 'on' : 'off'}${andorraUsageLine(state)}` };
|
|
549
520
|
case '/tools': return { text: 'Read, Write, Edit, Glob, Grep, Bash, PowerShell; repo_explore (when CodeGraph is enabled), git_read, qa.*, memory_search and artifact/control tools as permitted.\nEnabled skills add read_skill_resource. Enabled MCP servers and plugins discover namespaced tools at each task start; connection status reports availability. External tools require an agent with shell permission.\nWrites and shell commands obey /permissions; unsupported strict sandboxes fail closed. Host/network escalation and MCP connections/calls require approval unless Full Access is selected. Existing graph configs using retired read_file/search_files/Pi lowercase names are translated internally and are not advertised to models.' };
|
|
550
521
|
default: return { text: `Unknown command: ${command}. Use /help.` };
|
|
551
522
|
}
|
|
@@ -1,70 +1,23 @@
|
|
|
1
1
|
import type { TodoItem } from './todos.js';
|
|
2
|
-
/**
|
|
3
|
-
* Checks on the completion that ends a run, made by the host before it accepts the handoff.
|
|
4
|
-
*
|
|
5
|
-
* A model's own `complete_agent` call was the only thing that ended a run on the default graph: no
|
|
6
|
-
* guard, no verifier. A live run ended that way with its plan still "in progress" and an envelope
|
|
7
|
-
* that carried no summary, so the transcript closed on the raw output object and a finished-looking
|
|
8
|
-
* turn read as a run cut off halfway. Both conditions are facts the host already holds, so they are
|
|
9
|
-
* checked in code rather than left to the prompt.
|
|
10
|
-
*
|
|
11
|
-
* The `summary` and `todos` gates each send the handoff back at most `MAX_GATE_ASKS` times and are
|
|
12
|
-
* waived after that. A gate never spends a completion repair and never fails the run.
|
|
13
|
-
*
|
|
14
|
-
* The `unfinished` gate is different in kind. It fires when the completion itself says the task is
|
|
15
|
-
* not done: a non-empty `remaining` list, or a "Not done" section in the summary. A run must not end
|
|
16
|
-
* on its own with work it can still do. In a benchmark trial with a fifteen-minute limit the agent
|
|
17
|
-
* had a build that booted but drew no frame, was told a quarter of its time was left, and completed
|
|
18
|
-
* two steps later with "frame output still missing" in its own summary and two minutes unused; the
|
|
19
|
-
* host accepted it, and the trial failed. So a completion that reports unfinished work is sent back
|
|
20
|
-
* to keep working for as long as the agent does work in between, with no cap on how often. It is
|
|
21
|
-
* accepted only when sending it back cannot help: the agent has twice in a row answered the
|
|
22
|
-
* send-back with the same report and no tool call (there is nothing more it can do without the
|
|
23
|
-
* user), the attempt's clock has all but run out, or it is on its last allowed iteration. Each of
|
|
24
|
-
* those is recorded as a waiver with its reason.
|
|
25
|
-
*
|
|
26
|
-
* Earlier the "Not done" section was the way a completion with open plan items got through at once.
|
|
27
|
-
* That made the honest report an exit, and the trial above took it.
|
|
28
|
-
*/
|
|
29
2
|
export type FinalAnswerGateId = 'summary' | 'todos' | 'unfinished';
|
|
30
3
|
export declare const MAX_GATE_ASKS = 2;
|
|
31
|
-
/** Consecutive send-backs the agent may answer with no tool call before an unfinished report is accepted. */
|
|
32
4
|
export declare const MAX_IDLE_UNFINISHED_ASKS = 2;
|
|
33
|
-
/** With less than this left on the attempt's clock, another turn could not do any work. */
|
|
34
5
|
export declare const UNFINISHED_MIN_TIME_MS = 20000;
|
|
35
6
|
export type UnfinishedWaiver = 'noFurtherWork' | 'outOfTime';
|
|
36
7
|
export interface FinalAnswerGateInput {
|
|
37
|
-
/** The envelope had no summary, so the serialized output is what the user would read. */
|
|
38
8
|
summaryStoodIn: boolean;
|
|
39
|
-
/** The run's plan as it stands after any update sent beside the completion. */
|
|
40
9
|
todos: readonly TodoItem[];
|
|
41
|
-
/** The summary as the user will read it; a "Not done" section in it reports unfinished work. */
|
|
42
10
|
summary?: string;
|
|
43
|
-
/** The completion's own list of what the task still lacks; empty or absent when it claims to be done. */
|
|
44
11
|
remaining?: readonly string[];
|
|
45
|
-
/** How many times the summary and plan gates have already sent a handoff back in this run. */
|
|
46
12
|
asked?: Partial<Record<FinalAnswerGateId, number>>;
|
|
47
|
-
/** Send-backs for unfinished work, in a row, that the agent answered without running any tool. */
|
|
48
13
|
idleUnfinishedAsks?: number;
|
|
49
|
-
/** Time left on the attempt's wall clock; undefined when the attempt has none. */
|
|
50
14
|
timeLeftMs?: number;
|
|
51
15
|
}
|
|
52
16
|
export interface FinalAnswerGateResult {
|
|
53
|
-
/** Gates that send this handoff back. Empty when every failed gate is waived. */
|
|
54
17
|
gates: FinalAnswerGateId[];
|
|
55
|
-
/** Gates that failed but let the handoff through; the handoff is accepted despite them. */
|
|
56
18
|
waived: FinalAnswerGateId[];
|
|
57
|
-
/** What the model is told. Empty when nothing is sent back. */
|
|
58
19
|
message: string;
|
|
59
|
-
/** Why an unfinished report was let through, when `waived` includes `unfinished`. */
|
|
60
20
|
unfinishedWaiver?: UnfinishedWaiver;
|
|
61
21
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Whether the summary has a section that reports unfinished work: a markdown heading, or a line
|
|
64
|
-
* that is only a bold or plain label, reading "Not done" (also "Not completed", "Not finished",
|
|
65
|
-
* "Unfinished", "Remaining work", "Incomplete"). A sentence that merely contains the words does not
|
|
66
|
-
* count: a summary may say "nothing was left not done".
|
|
67
|
-
*/
|
|
68
22
|
export declare function declaresUnfinishedWork(summary: string | undefined): boolean;
|
|
69
|
-
/** Undefined when the handoff passes every gate. */
|
|
70
23
|
export declare function finalAnswerGate(input: FinalAnswerGateInput): FinalAnswerGateResult | undefined;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
export const MAX_GATE_ASKS = 2;
|
|
2
|
-
/** Consecutive send-backs the agent may answer with no tool call before an unfinished report is accepted. */
|
|
3
2
|
export const MAX_IDLE_UNFINISHED_ASKS = 2;
|
|
4
|
-
/** With less than this left on the attempt's clock, another turn could not do any work. */
|
|
5
3
|
export const UNFINISHED_MIN_TIME_MS = 20_000;
|
|
6
|
-
/** Plan items and remaining items named in the message; a longer list is counted, not listed. */
|
|
7
4
|
const MAX_NAMED_TODOS = 8;
|
|
8
5
|
const MAX_NAMED_REMAINING = 5;
|
|
9
6
|
const MAX_REMAINING_CHARS = 160;
|
|
10
7
|
const UNFINISHED_SECTION = /^[ \t]*(?:#{1,6}[ \t]+|\*\*|__)?(?:not (?:done|completed?|finished)|unfinished(?: work)?|remaining work|incomplete)(?:\*\*|__)?[ \t]*:?[ \t]*(?:\*\*|__)?[ \t]*$/im;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the summary has a section that reports unfinished work: a markdown heading, or a line
|
|
13
|
-
* that is only a bold or plain label, reading "Not done" (also "Not completed", "Not finished",
|
|
14
|
-
* "Unfinished", "Remaining work", "Incomplete"). A sentence that merely contains the words does not
|
|
15
|
-
* count: a summary may say "nothing was left not done".
|
|
16
|
-
*/
|
|
17
8
|
export function declaresUnfinishedWork(summary) {
|
|
18
9
|
return !!summary && UNFINISHED_SECTION.test(summary);
|
|
19
10
|
}
|
|
@@ -24,14 +15,10 @@ function timeLeftPhrase(ms) {
|
|
|
24
15
|
const minutes = Math.round(seconds / 60);
|
|
25
16
|
return minutes < 90 ? `about ${minutes} minutes` : `about ${Math.round(minutes / 6) / 10} hours`;
|
|
26
17
|
}
|
|
27
|
-
/** Undefined when the handoff passes every gate. */
|
|
28
18
|
export function finalAnswerGate(input) {
|
|
29
19
|
const open = input.todos.filter(todo => todo.status !== 'completed');
|
|
30
20
|
const remaining = (input.remaining ?? []).filter(item => item.trim());
|
|
31
|
-
// A stand-in summary is the serialized output, never the model's own account of the work.
|
|
32
21
|
const reportsUnfinished = !input.summaryStoodIn && (remaining.length > 0 || declaresUnfinishedWork(input.summary));
|
|
33
|
-
// Open plan items the completion accounts for as unfinished belong to the unfinished gate; the
|
|
34
|
-
// plan gate is for a plan left open under a completion that claims to be done.
|
|
35
22
|
const failed = [
|
|
36
23
|
...(input.summaryStoodIn ? ['summary'] : []),
|
|
37
24
|
...(reportsUnfinished ? ['unfinished'] : open.length ? ['todos'] : []),
|
|
@@ -51,7 +38,6 @@ export function finalAnswerGate(input) {
|
|
|
51
38
|
parts.push('It has no summary. The summary is the final answer the user reads; without one they see only the raw output object. Send summary as markdown (the outcome first, then what changed, how it was verified, and anything not done) and tests as one line per check that ran, or [] when none did, beside outcome and output.');
|
|
52
39
|
}
|
|
53
40
|
if (gates.includes('todos')) {
|
|
54
|
-
// Ids and statuses only: the plan's text is model-authored and is already in the todo snapshot.
|
|
55
41
|
const named = open.slice(0, MAX_NAMED_TODOS).map(todo => `${todo.id} (${todo.status})`).join(', ');
|
|
56
42
|
const more = open.length > MAX_NAMED_TODOS ? `, and ${open.length - MAX_NAMED_TODOS} more` : '';
|
|
57
43
|
parts.push(`The plan still lists ${open.length} unfinished ${open.length === 1 ? 'item' : 'items'}: ${named}${more}. Do the work that is left, using tools. For work that is already done, send update_todos with the true statuses in the same batch as complete_agent. Do not close an item, or ship a change you do not believe in, only to make the plan read as finished.`);
|