@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/app-server.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Config } from './config.js';
|
|
1
2
|
import { type ProviderConfig } from './providers.js';
|
|
2
3
|
import { removeCodexAccount } from './codex-auth.js';
|
|
3
4
|
import { CodexAccountAuth } from './codex-browser-auth.js';
|
|
@@ -12,118 +13,43 @@ import { type GhRunner } from './pull-requests.js';
|
|
|
12
13
|
import { type Completion, type RunResult } from './runtime.js';
|
|
13
14
|
import { CodeIntelligenceManager } from './code-intelligence/CodeIntelligenceManager.js';
|
|
14
15
|
import { type AppServerErrorCode } from './app-server/protocol.js';
|
|
15
|
-
|
|
16
|
-
* `andorra app-server --stdio`: the engine a non-TUI client drives.
|
|
17
|
-
*
|
|
18
|
-
* The transport, the wire types, and the client-side mirror live in `./app-server/protocol.ts` and
|
|
19
|
-
* `./app-server/workspace.ts`. This module owns the state a client cannot: the active run, the
|
|
20
|
-
* approval and question exchanges inside it, open terminals, the graph editor server, and the
|
|
21
|
-
* lazily created code-intelligence manager.
|
|
22
|
-
*
|
|
23
|
-
* One run at a time
|
|
24
|
-
* -----------------
|
|
25
|
-
* A process owns at most one run. The TUI is one run by construction and a second concurrent run
|
|
26
|
-
* would need the durable multi-run runtime the roadmap defers, so `run.start` reports `busy`
|
|
27
|
-
* instead of quietly interleaving two runs' approvals and journals.
|
|
28
|
-
*
|
|
29
|
-
* Nothing here prints to stdout except protocol lines: a stray write would corrupt the stream.
|
|
30
|
-
* Diagnostics go to stderr.
|
|
31
|
-
*/
|
|
16
|
+
import { type HostedMonitorOptions } from './andorra/monitor.js';
|
|
32
17
|
declare class AppServerError extends Error {
|
|
33
18
|
readonly code: AppServerErrorCode;
|
|
34
19
|
constructor(code: AppServerErrorCode, message: string);
|
|
35
20
|
}
|
|
36
21
|
type ManagedSignInService = Pick<CliSignIn, 'start' | 'status' | 'cancel' | 'logout' | 'submitCode' | 'close'>;
|
|
37
22
|
type OpenCodeSignInService = Pick<OpenCodeSignIn, 'start' | 'status' | 'cancel' | 'logout' | 'submitCode' | 'close'>;
|
|
38
|
-
|
|
39
|
-
* Merge a client's provider list with the stored secrets.
|
|
40
|
-
*
|
|
41
|
-
* The client reads providers through `configView`, which deliberately omits every `apiKey`, so a
|
|
42
|
-
* round trip that replaced the array wholesale would delete the credentials of every provider the
|
|
43
|
-
* user did not retype: making another provider active or removing one would break the rest. An entry
|
|
44
|
-
* that names no key therefore keeps the stored one, and an explicit `null` is how a client asks for
|
|
45
|
-
* one to be removed. The configured model list is carried over the same way, because a client written
|
|
46
|
-
* before that field existed reads an entry without it and cannot send back what it never saw.
|
|
47
|
-
*
|
|
48
|
-
* `streamIdleTimeoutMs` follows the same retain-on-omit rule, because a desktop build from before the
|
|
49
|
-
* field exists cannot name it: reconstructing the provider from its entry alone would silently delete
|
|
50
|
-
* the stored bound and restore the indefinite stall the field exists to prevent. A client that wants
|
|
51
|
-
* the bound gone names it as `null` rather than leaving it out. The per-model context windows follow
|
|
52
|
-
* that rule too: an older client's save must not erase the limits a newer one stored, and `null`
|
|
53
|
-
* removes the map.
|
|
54
|
-
*
|
|
55
|
-
* Retention stops where the type cannot hold the value. Codex accepts neither a key nor a stream bound,
|
|
56
|
-
* and the clients that leave both out rather than naming the removal — one built before the bound
|
|
57
|
-
* existed cannot name it at all — are exactly the ones converting a provider to Codex. Carrying either
|
|
58
|
-
* value into the new entry made `validateConfig` refuse the whole save over fields the type does not
|
|
59
|
-
* have, so a Codex entry starts without them. A model list is not one of those: the configuration
|
|
60
|
-
* allows it on Codex, so it is retained for that type like any other.
|
|
61
|
-
*
|
|
62
|
-
* A Codex entry's account slot and its recorded email follow the retain-on-omit rule with the same
|
|
63
|
-
* urgency: a client that omits the slot has simply never seen it — the provider view does not report
|
|
64
|
-
* it — and dropping it on save would silently point a second account at the default home's sign-in.
|
|
65
|
-
*/
|
|
23
|
+
export declare function rekeyProjectExtensions(config: Config, fromKey: string, toKey: string, merged: boolean): Config;
|
|
66
24
|
export declare function mergeProviderSecrets(stored: ProviderConfig[], incoming: unknown[]): ProviderConfig[];
|
|
67
25
|
export declare function isFinalWakeRefusal(error: unknown): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* The account a finished run leaves on the session turn.
|
|
70
|
-
*
|
|
71
|
-
* A graph that finished one node before it was cancelled, exhausted, or failed in the next
|
|
72
|
-
* returns that node's completion alongside the non-success status. The status is the attempt's
|
|
73
|
-
* last word — the client branches on it to keep a stopped attempt's activity visible — so the
|
|
74
|
-
* retained completion carries it too; without the stamp a stopped attempt folds like a done turn.
|
|
75
|
-
*
|
|
76
|
-
* `closedWithRun` says the abort came from the app going away rather than from a Stop. Closing is
|
|
77
|
-
* not the person giving up on the attempt: it is recorded as `interrupted`, the same status startup
|
|
78
|
-
* recovery gives a run whose engine was killed, so it reads as stopped work to resume (the row's
|
|
79
|
-
* mark and the Resume control both key on it) instead of a stop that was asked for.
|
|
80
|
-
*/
|
|
81
26
|
export declare function finalCompletion(result: RunResult | undefined, aborted: boolean, failure: unknown, closedWithRun?: boolean): Completion;
|
|
82
|
-
/**
|
|
83
|
-
* The session as it was before this run's in-flight marker: the marker turn out of both histories.
|
|
84
|
-
*
|
|
85
|
-
* The marker is written into history and contextHistory together - one is the transcript a client reads, the
|
|
86
|
-
* other the model context a later run seeds from - so an abandoned start has to remove it from both. Stripping
|
|
87
|
-
* only the transcript leaves the two disagreeing: the rail shows the session as it was, while the next attempt
|
|
88
|
-
* seeds from a turn reporting work this run never did, and is free to repeat it.
|
|
89
|
-
*/
|
|
90
27
|
export declare function withoutRunMarker(record: SavedSession, runId: string): SavedSession;
|
|
91
28
|
export interface AppServerOptions {
|
|
92
29
|
directory?: string;
|
|
93
30
|
output?: NodeJS.WritableStream;
|
|
94
31
|
error?: NodeJS.WritableStream;
|
|
95
|
-
/** Overridable so a test can answer the model preflight without reaching a provider. */
|
|
96
32
|
checkGraphHealth?: typeof checkGraphModelHealth;
|
|
97
|
-
/** How long a model that answered the preflight is not asked again; `0` asks every model before every run. */
|
|
98
33
|
modelHealthTtlMs?: number;
|
|
99
|
-
/** Overridable so a test can watch the code-intelligence manager's mode without starting CodeGraph. */
|
|
100
34
|
createCodeIntelligence?: typeof CodeIntelligenceManager.create;
|
|
101
|
-
/** Overridable so a test can run a graph whose access rules it cannot meet. */
|
|
102
35
|
loadGraph?: typeof loadAccessibleGraph;
|
|
103
|
-
/** Provider authentication is owned here, independently of the Andorra account sign-in. */
|
|
104
36
|
codexAuth?: Pick<CodexAccountAuth, 'start' | 'status' | 'cancel' | 'logout' | 'close'>;
|
|
105
|
-
/** Overridable so a test can watch a retired slot without reaching the Codex CLI. */
|
|
106
37
|
removeCodexAccount?: typeof removeCodexAccount;
|
|
107
|
-
/** Claude Console sign-in for Anthropic providers; overridable so a test never spawns `ant`. */
|
|
108
38
|
anthropicAuth?: Pick<AnthropicConsoleAuth, 'start' | 'status' | 'cancel' | 'logout' | 'discard' | 'close'>;
|
|
109
|
-
/** Subscription sign-ins run through a vendor CLI; overridable so a test never spawns one. */
|
|
110
39
|
managedSignIn?: {
|
|
111
40
|
claude?: ManagedSignInService;
|
|
112
41
|
grok?: ManagedSignInService;
|
|
113
42
|
opencode?: OpenCodeSignInService;
|
|
114
43
|
};
|
|
115
|
-
/** How each vendor CLI is asked whether it is signed in; overridable so a test never spawns one. */
|
|
116
44
|
signInProbes?: Partial<SignInProbes>;
|
|
117
|
-
/** Overridable so a test can answer `gh` without reaching GitHub. */
|
|
118
45
|
gh?: GhRunner;
|
|
119
|
-
/** How often the pull request watcher polls; a test shortens it. */
|
|
120
46
|
pullRequestPollMs?: number;
|
|
47
|
+
hostedCheck?: HostedMonitorOptions['check'];
|
|
48
|
+
hostedNow?: () => number;
|
|
121
49
|
}
|
|
122
50
|
export declare class AppServer {
|
|
123
51
|
private automationCheck?;
|
|
124
|
-
/** The daily auto-archive pass; a change to the setting runs one immediately as well. */
|
|
125
52
|
private autoArchiveCheck?;
|
|
126
|
-
/** The tail of the auto-archive passes, so a settings change never runs one over another. */
|
|
127
53
|
private autoArchivePass;
|
|
128
54
|
private readonly automationTasks;
|
|
129
55
|
private readonly manualAutomationTasks;
|
|
@@ -132,7 +58,6 @@ export declare class AppServer {
|
|
|
132
58
|
private readonly output;
|
|
133
59
|
private readonly error;
|
|
134
60
|
private readonly checkGraphHealth;
|
|
135
|
-
/** The models that answered recently, shared with the other engines on this home. */
|
|
136
61
|
private readonly modelHealth;
|
|
137
62
|
private readonly createCodeIntelligence;
|
|
138
63
|
private readonly loadGraph;
|
|
@@ -142,267 +67,111 @@ export declare class AppServer {
|
|
|
142
67
|
private readonly grokSignIn;
|
|
143
68
|
private readonly openCodeSignIn;
|
|
144
69
|
private readonly signInProbes;
|
|
145
|
-
/** The last detection of each tool: an import names a type and a model, and is checked against this. */
|
|
146
70
|
private readonly detectedSignIns;
|
|
147
|
-
/** Retires a removed provider's slot home; a seam so a test never has to spawn the Codex CLI. */
|
|
148
71
|
private readonly retireCodexAccount;
|
|
149
|
-
/** The `gh` the pull request settings and watcher run through. */
|
|
150
72
|
private readonly gh;
|
|
151
|
-
/** Polls the PRs whose sessions asked for Auto-fix; one engine per home actually polls. */
|
|
152
73
|
private readonly pullRequestWatcher;
|
|
153
|
-
/** The files each session's agent changed since the person last reviewed them (Keep / Undo). */
|
|
154
74
|
private readonly sessionChanges;
|
|
155
|
-
/** The wakes this engine armed for Auto-fix, checked against the PR record again before delivery. */
|
|
156
75
|
private readonly autoFixWakes;
|
|
157
|
-
/**
|
|
158
|
-
* A run of the session waiting inside the `pull_request` tool's `await_review` for its PR's next review, by
|
|
159
|
-
* session: the review comments the watcher finds go to it instead of to a wake, and it hears when the PR is
|
|
160
|
-
* merged, closed, dismissed or has Auto-fix switched off.
|
|
161
|
-
*/
|
|
162
76
|
private readonly reviewWaiters;
|
|
163
|
-
/** Sessions whose review wait is reserved and still being prepared (`awaitReview`). */
|
|
164
77
|
private readonly reviewWaitsStarting;
|
|
165
|
-
/**
|
|
166
|
-
* The account's graph sync, so a graph saved on another machine is listed here too. A first pass that
|
|
167
|
-
* outlasts the listing's bounded wait publishes `graphs.changed`: that listing already answered from
|
|
168
|
-
* the copy on disk, and the surface behind it has to read again to see what the pass restored.
|
|
169
|
-
*/
|
|
170
78
|
private readonly graphSync;
|
|
171
79
|
private readonly terminals;
|
|
172
|
-
/** Background jobs and QA terminals this engine holds, each with the session whose run started it. */
|
|
173
80
|
private readonly backgroundTasks;
|
|
174
81
|
private stopBackgroundWatch;
|
|
175
|
-
/** Holds a flooding shell's output back while the protocol stream is behind. */
|
|
176
82
|
private readonly flow;
|
|
177
|
-
/** Panel browsers: interactive session-owned pages, separate from the agent's qa.browser_session tool. */
|
|
178
83
|
private readonly browserViews;
|
|
179
|
-
|
|
84
|
+
private readonly browserExtensions;
|
|
85
|
+
private extensionStatus;
|
|
180
86
|
private readonly pending;
|
|
181
|
-
|
|
87
|
+
private readonly waiting;
|
|
182
88
|
private readonly panelRelays;
|
|
183
|
-
/** Panel operations executing on this engine, keyed by the relay that asked for them. */
|
|
184
89
|
private readonly panelOperations;
|
|
185
|
-
/**
|
|
186
|
-
* The runs those operations answer with, keyed the same way.
|
|
187
|
-
*
|
|
188
|
-
* Every window attached to a paired machine receives the same request frame, so the same relay id
|
|
189
|
-
* can arrive twice. A repeated id joins the run already going rather than pressing the key or
|
|
190
|
-
* opening the tab a second time.
|
|
191
|
-
*/
|
|
192
90
|
private readonly panelOperationRuns;
|
|
193
|
-
/** Requests in flight: shutdown waits for them rather than exiting under their I/O. */
|
|
194
91
|
private readonly requests;
|
|
195
92
|
private run?;
|
|
196
93
|
private readonly originalModelGraphs;
|
|
197
|
-
/**
|
|
198
|
-
* The attempt whose work is over and whose finalizer is still putting it away.
|
|
199
|
-
*
|
|
200
|
-
* The live-run slot is released before the terminal events go out — a client that chains runs sends
|
|
201
|
-
* its next `run.start` the moment it sees `run.completed`, and that start must not meet `engine-busy`
|
|
202
|
-
* while the engine is only tidying up — so during the tail `run` no longer names the attempt, but
|
|
203
|
-
* its open claim still stands and the merged save has just landed. A rename that arrives in that
|
|
204
|
-
* window belongs to this process all the same: naming the finishing attempt is how `renameSession`
|
|
205
|
-
* keeps excusing its claim instead of refusing the user's own run as "another window".
|
|
206
|
-
*/
|
|
207
94
|
private finishingRunId;
|
|
208
|
-
/** The session the finishing attempt belongs to, so the excuse above is not handed to a stranger. */
|
|
209
95
|
private finishingSessionId;
|
|
210
|
-
/**
|
|
211
|
-
* Why the active run's controller was aborted — finalization reads it to tell a Stop the person
|
|
212
|
-
* pressed from the app being closed while the attempt was still running. Cleared when a run starts.
|
|
213
|
-
*/
|
|
214
96
|
private runAbort?;
|
|
215
|
-
/** Set synchronously while a start is being prepared, so two starts in one tick cannot both pass the guard. */
|
|
216
97
|
private starting;
|
|
217
|
-
/**
|
|
218
|
-
* Self-wake registry for this engine, shared by the runs it serves.
|
|
219
|
-
*
|
|
220
|
-
* Engine-wide rather than per run on purpose: a wake armed by a task is expected to arrive after that
|
|
221
|
-
* task is over, which is the entire point of arming one. Every wake carries the session that armed it, so
|
|
222
|
-
* the prompt — and the wait a row draws for it — goes back to that session, not to whichever one happens
|
|
223
|
-
* to be running: an engine serves many sessions over its life, and two of them can be waiting at once.
|
|
224
|
-
* The CLI gets the same tool through a registry of its own; here the engine is also the deliverer,
|
|
225
|
-
* because a window has no loop to carry a wake in.
|
|
226
|
-
*/
|
|
227
98
|
private readonly timers;
|
|
228
|
-
/** Engine timer for the next deadline, so a wake due while a run is in flight is retried. */
|
|
229
99
|
private timerCheck?;
|
|
230
|
-
/** One delivery pass at a time, so a due callback cannot start a second one. */
|
|
231
100
|
private timerDeliveryTask?;
|
|
232
|
-
/**
|
|
233
|
-
* A branch switch in flight, held until it completes.
|
|
234
|
-
*
|
|
235
|
-
* Switching the tree and starting a run are separate requests, and the checkout awaits Git twice:
|
|
236
|
-
* a start arriving in that window used to pass the busy guard, launch the agent, and then have the
|
|
237
|
-
* tree switched underneath it — so the branch the changes land in is not the one the task started
|
|
238
|
-
* on. The reservation is taken synchronously and refused, not queued: a run that waits would begin
|
|
239
|
-
* against a repository whose branch the user has stopped describing.
|
|
240
|
-
*/
|
|
241
101
|
private checkout?;
|
|
242
|
-
/** Memoized creation of the run-record directory, which this mode must do for itself. */
|
|
243
102
|
private runRecordsReady?;
|
|
244
|
-
/**
|
|
245
|
-
* The session a `run.resume` is preparing: the record is read and will be saved by the resumed
|
|
246
|
-
* run, so a rename or delete accepted in that window is silently reverted. `this.run` does not
|
|
247
|
-
* cover it yet — the run is installed only when preparation ends.
|
|
248
|
-
*/
|
|
249
103
|
private startingSession?;
|
|
250
|
-
/**
|
|
251
|
-
* Each live run's journal writer. A writer holds the events its file refused and writes them once
|
|
252
|
-
* appends succeed again, so it is also what knows, at finalization, whether the journal is a
|
|
253
|
-
* complete account (the record and a marker file carry the answer past a crash).
|
|
254
|
-
*/
|
|
255
104
|
private readonly journals;
|
|
256
|
-
/**
|
|
257
|
-
* The session trajectory of the run in flight: one sanitized debug log per session
|
|
258
|
-
* (`trajectories/<sessionId>.jsonl` in this home), appended by every run and resume of that
|
|
259
|
-
* session. Unlike the per-run journal it spans attempts, and it records the model calls
|
|
260
|
-
* themselves — requests, responses, errors — where the journal stays the engine's own resume
|
|
261
|
-
* record. Cleared when the run's final marker has been written and flushed.
|
|
262
|
-
*/
|
|
263
105
|
private trajectory?;
|
|
264
|
-
/** Tail of the configuration write queue; see `serializeConfig`. */
|
|
265
106
|
private configWrites;
|
|
266
|
-
/** Tail of each Codex slot home's lifecycle; a retirement and a sign-in on one slot never interleave. */
|
|
267
107
|
private readonly slotWrites;
|
|
268
|
-
/** The run in flight, retained so shutdown can wait for its bookkeeping instead of racing it. */
|
|
269
108
|
private runTask?;
|
|
270
|
-
/**
|
|
271
|
-
* Resolvers waiting for a run's first provider answer — or for its end, whichever comes first.
|
|
272
|
-
*
|
|
273
|
-
* Automatic titling holds until then: the run's first request must reach a serializing endpoint
|
|
274
|
-
* ahead of the naming request, and after that answer the run executes its turn's tools while the
|
|
275
|
-
* provider is free. Waiting for the whole run instead would leave a session's name as the local
|
|
276
|
-
* word-slice for the entire task, and a stopped task would never be named at all.
|
|
277
|
-
*/
|
|
278
109
|
private readonly titleReleases;
|
|
279
|
-
|
|
110
|
+
private readonly titleAnswered;
|
|
280
111
|
private readonly sessionTitles;
|
|
281
|
-
/** Bumped whenever new work starts; a title begun under an older generation never runs. */
|
|
282
112
|
private workGeneration;
|
|
283
|
-
/** Sign-in and discovery controllers, aborted at shutdown so neither outlives the client. */
|
|
284
113
|
private readonly operations;
|
|
285
|
-
/** A start still being prepared, awaited and refused at shutdown. */
|
|
286
114
|
private prepareTask?;
|
|
287
|
-
/** The poll for runs whose holder was still shutting down when this engine started; see `watchForeignEngineShutdown`. */
|
|
288
115
|
private foreignEngineWatch?;
|
|
289
116
|
private editor?;
|
|
290
|
-
/** The editor start in flight, so two opens cannot race into two servers. */
|
|
291
117
|
private editorTask?;
|
|
292
118
|
private codeIntel?;
|
|
293
|
-
/** The tail of the manager openings, taken one at a time: a run and a warm-up can ask at once. */
|
|
294
119
|
private codeIntelOpening;
|
|
295
|
-
/**
|
|
296
|
-
* The remote-serve outcome this engine holds: either the listener whose lock and descriptor are
|
|
297
|
-
* ours to release at close, or the record that this installation has nothing to serve.
|
|
298
|
-
*/
|
|
299
120
|
private remoteServe?;
|
|
300
|
-
/**
|
|
301
|
-
* Outbound engine links, one per paired workspace this engine relays for its client.
|
|
302
|
-
*
|
|
303
|
-
* A link is the long-lived event stream to the paired machine plus the connection id its requests
|
|
304
|
-
* identify as; the frames it receives are re-emitted on this engine's own stream as
|
|
305
|
-
* `remote.engine.event`, which is how a paired machine's engines reach the desktop without the
|
|
306
|
-
* desktop ever speaking TLS itself.
|
|
307
|
-
*/
|
|
308
121
|
private readonly engineLinks;
|
|
309
|
-
/** The last grant each workspace's live probe reported, for offline views (see remoteWorkspaceState). */
|
|
310
122
|
private readonly lastKnownGrants;
|
|
311
|
-
/** Tail of the queue serializing serve/lock transitions; see `serializeRemote`. */
|
|
312
123
|
private remoteOps;
|
|
313
124
|
private closed;
|
|
314
|
-
/**
|
|
315
|
-
* Whether events still reach the protocol stream. Unlike `closed`, this stays open across the
|
|
316
|
-
* shutdown wait: the run finalizer settles during that window, and a client that stayed connected
|
|
317
|
-
* to ask for the stop — an engine stop with the app still running — is exactly the one that has
|
|
318
|
-
* to hear the terminal story. What the finalizer emits is normalized to agree with the record it
|
|
319
|
-
* just wrote, so the event and the next `runs.list` tell the same one.
|
|
320
|
-
*/
|
|
321
125
|
private emitsStopped;
|
|
322
|
-
|
|
126
|
+
private readonly hosted;
|
|
127
|
+
private hostedStarted;
|
|
323
128
|
private telemetrySettle;
|
|
324
129
|
onStop?: () => void;
|
|
325
130
|
constructor(options: AppServerOptions & {
|
|
326
131
|
output: NodeJS.WritableStream;
|
|
327
132
|
error: NodeJS.WritableStream;
|
|
328
133
|
});
|
|
134
|
+
private extensionListing;
|
|
135
|
+
private agentExtensionListing;
|
|
136
|
+
private runExtensionStep;
|
|
137
|
+
private extensionsChanged;
|
|
329
138
|
private emit;
|
|
330
139
|
private log;
|
|
331
|
-
/** The handshake every client waits for before it sends anything. */
|
|
332
140
|
ready(): Promise<void>;
|
|
333
|
-
/** Queue one auto-archive pass behind any pass still running. A failure is logged, never thrown. */
|
|
334
|
-
private reapSessions;
|
|
335
141
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* A session with a run in flight or a wake armed is skipped, for the reason `setSessionArchived`
|
|
341
|
-
* refuses it: the run saves the record it captured and would revert the flag, and a filed row hides
|
|
342
|
-
* the approval or the wake it is waiting on. A wake armed by another engine is invisible to this
|
|
343
|
-
* process's registry, so the claim arming wrote — swept here once its owner is gone — is what holds
|
|
344
|
-
* the session too. Every change is re-planned against the record and the setting read under the
|
|
345
|
-
* session's mutation lock: another window's pass, a run that just started, a threshold another
|
|
346
|
-
* engine saved (or the reaper another turned off) after this pass opened, or a manual filing that
|
|
347
|
-
* landed since the list was read is never overwritten.
|
|
142
|
+
* Keeps the Andorra entry current from an enabled answer. A missing entry is created only when the user added
|
|
143
|
+
* Andorra: that decision is read inside this engine's queue of config writes and inside the cross-process
|
|
144
|
+
* config lock, so an add or a removal recorded just before, here or in another process, is the one that counts.
|
|
348
145
|
*/
|
|
349
|
-
private
|
|
146
|
+
private applyHostedEntry;
|
|
350
147
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
*
|
|
148
|
+
* What clients are told about Andorra: its availability, whether it can be added, and, while it is offered and
|
|
149
|
+
* the user has not removed it, the entry to LIST: a provider view built from the hosted answer that is not in
|
|
150
|
+
* the saved config (`listed`). A client shows it as an ordinary provider and saves it with `andorra.add` the
|
|
151
|
+
* first time the user picks it. `usage`, when known, is what to show for the hosted models (HostedMonitor.usage).
|
|
354
152
|
*/
|
|
153
|
+
private hostedStatus;
|
|
154
|
+
/** The user removed the listed, never-saved Andorra: it is no longer listed (Add Provider still offers it). */
|
|
155
|
+
private hideListedEntry;
|
|
156
|
+
/** Saves the Andorra provider because the user asked for it; with `select`, it becomes the active provider in the same write. */
|
|
157
|
+
private addHostedEntry;
|
|
158
|
+
private reapSessions;
|
|
159
|
+
private autoArchiveSessions;
|
|
160
|
+
private currentRun;
|
|
355
161
|
private hostInfo;
|
|
356
162
|
private version;
|
|
357
|
-
/**
|
|
358
|
-
* Parse and answer one input line. Never throws: every failure becomes a response.
|
|
359
|
-
*
|
|
360
|
-
* The request is tracked while it runs, because lines are read concurrently and `close()` has to be able
|
|
361
|
-
* to wait for the work a shutdown would otherwise cut through — a read still in progress when the process
|
|
362
|
-
* exits, or a state-changing request finished after the client was told the engine had stopped.
|
|
363
|
-
*/
|
|
364
163
|
handle(line: string): Promise<void>;
|
|
365
164
|
private dispatchLine;
|
|
366
165
|
private write;
|
|
367
166
|
private dispatch;
|
|
368
167
|
private store;
|
|
369
|
-
/**
|
|
370
|
-
* Canonicalize a workspace the way session records are stored.
|
|
371
|
-
*
|
|
372
|
-
* `sessions.create` and `run.start` record the real path, but `SessionStore.list` compares
|
|
373
|
-
* lexically, so a project added through a symlink, a junction, or a differently cased Windows path
|
|
374
|
-
* would list nothing even though its sessions exist. A folder that no longer exists is passed
|
|
375
|
-
* through unchanged: it simply has no sessions.
|
|
376
|
-
*/
|
|
377
168
|
private listableWorkspace;
|
|
378
|
-
/**
|
|
379
|
-
* The sessions a client's rail lists: one workspace, or several in one pass.
|
|
380
|
-
*
|
|
381
|
-
* Reading the store means reading and parsing every session record it holds, so a client that asked
|
|
382
|
-
* once per project paid that whole scan per project — with P projects and S saved sessions, P × S
|
|
383
|
-
* reads and parses to fill one tree. The batched form canonicalizes each requested path exactly as
|
|
384
|
-
* the single form does, reads the store once, and answers with the same summaries grouped by the
|
|
385
|
-
* path the client asked for, so it can file each group under its own row.
|
|
386
|
-
*/
|
|
387
169
|
private listSessions;
|
|
388
|
-
/**
|
|
389
|
-
* Run a configuration change as a read-modify-write with nothing interleaved.
|
|
390
|
-
*
|
|
391
|
-
* Requests are answered concurrently by design, so two saves that each loaded the file and then
|
|
392
|
-
* wrote their own merge would silently discard one another: toggling two settings in quick
|
|
393
|
-
* succession would keep only the second. Every write to the configuration file goes through here.
|
|
394
|
-
*/
|
|
395
170
|
private serializeConfig;
|
|
396
|
-
/**
|
|
397
|
-
* Run one Codex slot home's lifecycle step after every earlier one has settled.
|
|
398
|
-
*
|
|
399
|
-
* A slot home is created by a sign-in and deleted by a retirement, and the two requests can arrive
|
|
400
|
-
* at once. Ordering them per slot is what keeps a retirement from deleting a home that a sign-in
|
|
401
|
-
* began after the provider was re-created, without serializing unrelated accounts against each other.
|
|
402
|
-
*/
|
|
403
171
|
private slotLock;
|
|
404
172
|
private setConfig;
|
|
405
|
-
|
|
173
|
+
private projectExtensionEntry;
|
|
174
|
+
private setProjectExtensionEntry;
|
|
406
175
|
private extensionKind;
|
|
407
176
|
private skillResources;
|
|
408
177
|
private skillRead;
|
|
@@ -410,625 +179,131 @@ export declare class AppServer {
|
|
|
410
179
|
private installExtension;
|
|
411
180
|
private removeExtension;
|
|
412
181
|
private setExtensionEnabled;
|
|
413
|
-
/** Preserve MCP credentials when toggling or deleting an existing entry. */
|
|
414
182
|
private mutateMcp;
|
|
415
|
-
/**
|
|
416
|
-
* One configured MCP server as an edit form can show it: the command and its arguments, or the
|
|
417
|
-
* endpoint, and the *names* of its environment variables and headers. Their values are secrets
|
|
418
|
-
* the engine never returns; an edit keeps a saved value by naming it (see mergeMcpEdit). The
|
|
419
|
-
* endpoint is returned without its query string, which can hold a credential.
|
|
420
|
-
*/
|
|
421
183
|
private mcpServerView;
|
|
422
|
-
/**
|
|
423
|
-
* Check one configured MCP server, on the person's explicit request ("Check Connection"): start
|
|
424
|
-
* it, ask for its tools, stop it, and record the answer beside the ones tasks record. A server that
|
|
425
|
-
* is turned off is reported off without being started. A stdio server starts in the workspace the
|
|
426
|
-
* caller names, as it would for a task there, or the home folder. A page never calls this on its
|
|
427
|
-
* own: a task asks before it connects a server, and opening Settings is not that consent.
|
|
428
|
-
*/
|
|
429
184
|
private mcpStatus;
|
|
430
|
-
/**
|
|
431
|
-
* What each configured server last answered, without starting anything: the status a task's
|
|
432
|
-
* connection or an explicit check recorded, while it still describes the server's current
|
|
433
|
-
* definition. An edited server, and one never connected, has none ("Not checked").
|
|
434
|
-
*/
|
|
435
185
|
private mcpStatuses;
|
|
436
|
-
/**
|
|
437
|
-
* Apply one provider change inside the serialized configuration transaction.
|
|
438
|
-
*
|
|
439
|
-
* A client cannot do this atomically for itself: it would read the configuration, change the list, and
|
|
440
|
-
* write it back, and the engine treats a `providers` array as a replacement — so a change the CLI or
|
|
441
|
-
* another window made between the two requests would be deleted by the write. The read-modify-write
|
|
442
|
-
* happens here, under the same queue that orders every configuration write, which makes one provider
|
|
443
|
-
* edit indivisible.
|
|
444
|
-
*
|
|
445
|
-
* Exactly one operation per call: `upsert` (one provider entry, by id), `remove` (an id), or
|
|
446
|
-
* `clearKey` (drop one provider's saved secret). `active` may accompany an upsert.
|
|
447
|
-
*/
|
|
448
186
|
private updateProviders;
|
|
449
|
-
/**
|
|
450
|
-
* Delete the Claude Console logins of providers a committed configuration no longer signs in.
|
|
451
|
-
*
|
|
452
|
-
* The configuration is read again first: an overlapping request can re-create the provider with
|
|
453
|
-
* sign-in before this runs, and that provider's fresh login is not this removal's to delete.
|
|
454
|
-
*/
|
|
455
187
|
private retireAnthropicAccounts;
|
|
456
|
-
/**
|
|
457
|
-
* Delete the slot homes a committed configuration no longer names.
|
|
458
|
-
*
|
|
459
|
-
* Each retirement takes the slot's lock, which a sign-in also takes, and re-reads the configuration
|
|
460
|
-
* before deleting: an overlapping request can re-create the provider and sign the slot in before
|
|
461
|
-
* this removal finishes, and that fresh session is not the retired one's to delete.
|
|
462
|
-
*/
|
|
463
188
|
private retireSlots;
|
|
464
189
|
private discoverModels;
|
|
465
|
-
/**
|
|
466
|
-
* Which vendor CLIs on this machine are signed in and have no provider yet.
|
|
467
|
-
*
|
|
468
|
-
* Local-client only, like the sign-ins themselves: these logins belong to this machine. Only display
|
|
469
|
-
* fields and model ids are answered; a probe that fails says nothing rather than surfacing CLI output.
|
|
470
|
-
*/
|
|
471
190
|
private detectProviderSignIns;
|
|
472
|
-
/** Add the chosen detected sign-ins as providers; each must name a tool and model the last detection reported. */
|
|
473
191
|
private importProviderSignIns;
|
|
474
|
-
/** Local-client only. The remote engine relay deliberately does not admit these methods. */
|
|
475
192
|
private providerAuth;
|
|
476
|
-
/**
|
|
477
|
-
* Subscription sign-in through a vendor CLI's own login: Claude Code, Grok, or one of OpenCode's
|
|
478
|
-
* upstream providers. Local-client only, like the others. Each of these logins belongs to the CLI
|
|
479
|
-
* on this machine rather than to one provider entry, so the draft a person is adding can sign in
|
|
480
|
-
* before it is saved; a providerId is accepted and ignored.
|
|
481
|
-
*/
|
|
482
193
|
private managedProviderAuth;
|
|
483
|
-
/**
|
|
484
|
-
* Claude Console sign-in for one configured Anthropic provider. Local-client only, like Codex
|
|
485
|
-
* sign-in: the remote engine relay does not admit these methods.
|
|
486
|
-
*/
|
|
487
194
|
private anthropicProviderAuth;
|
|
488
|
-
/**
|
|
489
|
-
* Record the account email a sign-in just verified on the provider entry that names it.
|
|
490
|
-
*
|
|
491
|
-
* The label that tells two linked accounts apart is derived from this stored email, and a window
|
|
492
|
-
* can sign in from the provider's detail panel where no form save follows. Best effort: a
|
|
493
|
-
* configuration that cannot be written must not turn a completed sign-in into an error.
|
|
494
|
-
*/
|
|
495
195
|
private recordCodexEmail;
|
|
496
|
-
/**
|
|
497
|
-
* Test one provider's connection exactly as configured, for the settings surface's Test button.
|
|
498
|
-
*
|
|
499
|
-
* `model` names one model to check instead of the provider's active one: the probe is the same
|
|
500
|
-
* listing either way, and `modelAvailable` then answers whether that model is on offer. The
|
|
501
|
-
* override never reaches the stored configuration.
|
|
502
|
-
*
|
|
503
|
-
* The probe is read-only and spends no tokens, and its deadline is the operation's own rather than
|
|
504
|
-
* the client's request deadline: a test that outlives the window that asked for it is a test whose
|
|
505
|
-
* answer the window can no longer show.
|
|
506
|
-
*/
|
|
507
196
|
private testProviderEndpoint;
|
|
508
|
-
/** Run one long operation whose cancellation shutdown owns, optionally with its own deadline. */
|
|
509
197
|
private operation;
|
|
510
198
|
private accountStatus;
|
|
511
|
-
/**
|
|
512
|
-
* The signed-in account's own profile.
|
|
513
|
-
*
|
|
514
|
-
* The profile lives in the account service, so it follows the account rather than the machine:
|
|
515
|
-
* the same profile is the same on every installation that signs in.
|
|
516
|
-
*/
|
|
517
199
|
private accountProfile;
|
|
518
|
-
/** Save the profile fields the owner changed. */
|
|
519
200
|
private updateAccountProfile;
|
|
520
|
-
/** What this account has done on this machine, in totals. */
|
|
521
201
|
private sessionStats;
|
|
522
202
|
private signIn;
|
|
523
203
|
private signOut;
|
|
204
|
+
/** Signing in or out changes what Andorra offers this account: ask now instead of at the next interval. */
|
|
205
|
+
private checkHostedAfterAccountChange;
|
|
524
206
|
private publishAccount;
|
|
525
|
-
/**
|
|
526
|
-
* The log a session's conversation was written to.
|
|
527
|
-
*
|
|
528
|
-
* A session the window started writes to the log named after its own id. A session the terminal
|
|
529
|
-
* created or continued writes to the log of that terminal's process, whose name is not the
|
|
530
|
-
* session's id, and the record names that log. The name is a file stem, never a path, so it can
|
|
531
|
-
* only name a log in this home.
|
|
532
|
-
*/
|
|
533
207
|
private trajectoryIdOf;
|
|
534
208
|
private readSession;
|
|
535
|
-
/**
|
|
536
|
-
* The session behind a due wake, or `undefined` only when its record is genuinely not there.
|
|
537
|
-
*
|
|
538
|
-
* `readSession` is written for a client asking about a session, so a missing file, a lock, a permission
|
|
539
|
-
* problem and a half-written record all answer "that session no longer exists". For a delivery that answer
|
|
540
|
-
* is destructive: the wake would be spent - and its prompt lost - on a condition that clears by itself.
|
|
541
|
-
* Only a file that is not there is treated as a deleted session here; everything else is thrown so the
|
|
542
|
-
* caller can put the wake back and try again on the retry the registry gives a wake already due.
|
|
543
|
-
*/
|
|
544
209
|
private readSessionForWake;
|
|
210
|
+
private withSessionMutation;
|
|
211
|
+
/** The id a folder's project keeps across a rename, so a task started after the move shares the older tasks' browser profile. */
|
|
212
|
+
private configuredProjectId;
|
|
545
213
|
/**
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
* check, the fresh read, and the save; the check has to sit inside it, since the state it reads is
|
|
551
|
-
* the state the mutation is about to overwrite. A session held by another writer past the wait is
|
|
552
|
-
* answered `busy` rather than racing it.
|
|
214
|
+
* The id a task started in `root` is filed under: the one the project already answers to, otherwise the one its path
|
|
215
|
+
* derives. A path can outlive the project that was there: rename A to B and B keeps the identity it moved with, so a new
|
|
216
|
+
* folder created at A would derive that same identity and share B's browser profile and task grouping. The newcomer
|
|
217
|
+
* takes a fresh id instead, remembered so its later tasks keep it.
|
|
553
218
|
*/
|
|
554
|
-
private
|
|
219
|
+
private projectIdFor;
|
|
555
220
|
private createSession;
|
|
556
221
|
private renameSession;
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
* `contextHistory` — what the next run seeds from — changes; `history`, the transcript a client
|
|
561
|
-
* shows, keeps every turn. A run owns the record while it is live, and its finalizer would write
|
|
562
|
-
* the uncompacted context back, so compaction waits for the session to be idle.
|
|
563
|
-
*/
|
|
222
|
+
private setSessionJev;
|
|
223
|
+
private setSessionGoal;
|
|
224
|
+
private emitSessionGoal;
|
|
564
225
|
private compactSession;
|
|
565
|
-
/**
|
|
566
|
-
* Persist a finished run's record without reverting what the user changed while it ran.
|
|
567
|
-
*
|
|
568
|
-
* The finalizer builds its record from the snapshot captured at startup, but a rename is now
|
|
569
|
-
* accepted mid-run: a bare save would put the old name back, and dropping the `renamed` pin with
|
|
570
|
-
* it would let the automatic title overwrite a name the user chose after the run settled. So the
|
|
571
|
-
* save re-reads the record under the same per-session mutation lock the user's own renames take.
|
|
572
|
-
* The fields this process owns — the turns, usage and widgets the run just produced — are written
|
|
573
|
-
* from the captured record; everything the user can edit stays with what is on disk. A read that
|
|
574
|
-
* finds nothing saves the captured record unchanged, as before: losing the finished turn would be
|
|
575
|
-
* the worse outcome. The lock is taken with retries because a rename's critical section is one
|
|
576
|
-
* small read-modify-write, and momentary contention must not turn a finished run into an unsaved
|
|
577
|
-
* one.
|
|
578
|
-
*
|
|
579
|
-
* The finalizer's summary-carrying events publish through `publish`, inside the same critical
|
|
580
|
-
* section as the save. Publishing after the lock would let a rename land in between: it would
|
|
581
|
-
* save and publish its new name, and the finalizer would follow with the older snapshot it
|
|
582
|
-
* holds, so the client's unconditional upsert would briefly revert the row the user just renamed.
|
|
583
|
-
*/
|
|
584
226
|
private saveFinalizedSession;
|
|
585
|
-
/**
|
|
586
|
-
* Put a session away from (or back onto) the rail without deleting it.
|
|
587
|
-
*
|
|
588
|
-
* Archive is organization, not content: unlike rename it does not touch `updatedAt`, so archiving a
|
|
589
|
-
* session never reorders the list a user is reading. It is refused while the session owns a run for
|
|
590
|
-
* the same reason rename is — `executeRun` saves the record it captured at startup, which would
|
|
591
|
-
* silently revert the flag when the run finished, and a row that vanished mid-run would strand the
|
|
592
|
-
* approval it is waiting for.
|
|
593
|
-
*/
|
|
594
227
|
private setSessionArchived;
|
|
595
228
|
private deleteSession;
|
|
596
|
-
/**
|
|
597
|
-
* Start one run and answer immediately with its identity.
|
|
598
|
-
*
|
|
599
|
-
* The execution continues in the background and reports through events, so a client can cancel,
|
|
600
|
-
* answer an approval, or open a terminal while the model works.
|
|
601
|
-
*/
|
|
602
229
|
private startRun;
|
|
603
|
-
/**
|
|
604
|
-
* Resume a stopped attempt: a new run on the same session, continuing where the attempt stopped.
|
|
605
|
-
*
|
|
606
|
-
* The attempt being resumed has to be a recorded one whose process is gone: `succeeded` has
|
|
607
|
-
* nothing left to do, and `running` with a live pid is the original still working, not a stopped
|
|
608
|
-
* attempt. The session is not forked the way an explicit `run.start` resume-branch forks it:
|
|
609
|
-
* a resumed attempt belongs on the same timeline as the attempt it continues, so both turns —
|
|
610
|
-
* the stopped one and the new one — stay visible together. The new run gets its own id, its own
|
|
611
|
-
* journal, and its own open record; `resumedFrom` on both records names the lineage. Everything
|
|
612
|
-
* after this point is `run.start`'s own path — same events, same client run flow, one-run-per-
|
|
613
|
-
* engine guard included.
|
|
614
|
-
*/
|
|
615
230
|
private resumeRun;
|
|
616
|
-
/**
|
|
617
|
-
* Switch the working tree to a branch, holding the tree for the whole operation.
|
|
618
|
-
*
|
|
619
|
-
* One run at a time, in both directions: a switch is refused while a run or a prepared start
|
|
620
|
-
* exists, and a start is refused while a switch is in flight. The reservation is taken before the
|
|
621
|
-
* first await, because the workspace resolution in between is exactly the window a `run.start`
|
|
622
|
-
* could otherwise slip through.
|
|
623
|
-
*/
|
|
624
231
|
private switchBranch;
|
|
625
|
-
/** Refuse to continue work whose engine is shutting down. */
|
|
626
232
|
private assertRunning;
|
|
627
|
-
/**
|
|
628
|
-
* Start one run. `internal` is never client-supplied — it is how `run.resume` tells this
|
|
629
|
-
* method to continue an existing session in place instead of forking, which stopped
|
|
630
|
-
* attempt the new run continues, the message sent with that continuation, and the
|
|
631
|
-
* attachments the continued message carried.
|
|
632
|
-
*
|
|
633
|
-
* The wrapper owns the spools this request created: attachment resolution spools pastes and
|
|
634
|
-
* clipboard images before provider, permission, session, graph, and resume validation run. If any
|
|
635
|
-
* later check refuses the start — most simply when no provider is configured — the request has
|
|
636
|
-
* created no run and no persisted owner, and up to ~50 MB of the user's data would otherwise sit
|
|
637
|
-
* in the spool until the retention prune. Every rejection below propagates through here, and
|
|
638
|
-
* every spool this request wrote is deleted; a successful start owns its spools as part of the
|
|
639
|
-
* run. `prepareRunValidated` is the body: the wrapper exists only to own that cleanup.
|
|
640
|
-
*/
|
|
641
233
|
private prepareRun;
|
|
642
|
-
/**
|
|
643
|
-
* The graph this run executes, with the model's override applied when the run asked for one.
|
|
644
|
-
*
|
|
645
|
-
* The override rewrites the copy the run reads, never the saved graph: a run that overrides
|
|
646
|
-
* every node must not change what the next run of the same graph does. Applying it here — where
|
|
647
|
-
* the graph is loaded — is what keeps the runner, the resume guard and the health preflight from
|
|
648
|
-
* disagreeing about the model a node runs, because all three read this same graph.
|
|
649
|
-
*/
|
|
650
234
|
private graphForRun;
|
|
651
|
-
/**
|
|
652
|
-
* The graph a resume replays against, with carried node switches applied before its remaining
|
|
653
|
-
* provider references are bound.
|
|
654
|
-
*
|
|
655
|
-
* A node moved to provider B survives provider A leaving the configuration: the carried provider
|
|
656
|
-
* replaces the switched node's reference before the binder validates what is left, so the
|
|
657
|
-
* obsolete pin cannot fail the load. The carried model travels after the bind — the binder offers
|
|
658
|
-
* only models a provider's configuration lists, and a live switch may have named a model the
|
|
659
|
-
* endpoint serves without the configuration listing it, which `resolveModel` accepted. A
|
|
660
|
-
* whole-run override sets every reference aside instead, so it binds nothing, as before.
|
|
661
|
-
*/
|
|
662
235
|
private loadResumeGraph;
|
|
663
236
|
private prepareRunValidated;
|
|
664
|
-
/**
|
|
665
|
-
* Name a brand-new session from its first prompt with one bounded model request.
|
|
666
|
-
*
|
|
667
|
-
* The session already displays its local name, so this only upgrades it: any failure keeps the
|
|
668
|
-
* local name and never touches the run. The request is queued behind the run's first provider
|
|
669
|
-
* answer — the one inference turn a serializing endpoint must not be made to wait for — and goes
|
|
670
|
-
* out while the run executes that turn's tools, so the row carries the real name for the task
|
|
671
|
-
* instead of its first words cut off, and a task the user stops early is still named. The title
|
|
672
|
-
* does not belong to the run's lifetime either: stopping the run leaves it generating.
|
|
673
|
-
*
|
|
674
|
-
* The record on disk is read back under the lock the user's own renames take, so a name chosen
|
|
675
|
-
* once the run is over is never momentarily reverted, a session claimed by another run is left to
|
|
676
|
-
* that run's snapshot, and a deleted session is never recreated on the rail. While this run is
|
|
677
|
-
* still working, the save is written underneath it: the finalizer merges the record it finds, so
|
|
678
|
-
* the finished attempt keeps the name this saved.
|
|
679
|
-
*/
|
|
680
237
|
private titleSessionFromPrompt;
|
|
681
|
-
/**
|
|
682
|
-
* Let a title request that was waiting for its run go ahead: the run answered the provider for the
|
|
683
|
-
* first time, or ended without ever doing so.
|
|
684
|
-
*/
|
|
685
238
|
private releaseTitleWaiter;
|
|
686
|
-
/** Abort title requests still on the wire: new work is about to need the provider itself. */
|
|
687
239
|
private cancelSessionTitles;
|
|
688
240
|
private executeRun;
|
|
689
|
-
/**
|
|
690
|
-
* The run's adapter, with each call's reasoning published to the connected window.
|
|
691
|
-
*
|
|
692
|
-
* Reasoning is display-only: those events go to the client and are deliberately never written to
|
|
693
|
-
* the run journal, the session record, or the trajectory (see `app-server/reasoning.ts`). A call
|
|
694
|
-
* made outside a run has no stream to publish into, so it is left as an adapter that simply does
|
|
695
|
-
* not report reasoning.
|
|
696
|
-
*/
|
|
697
241
|
private reasoningAdapter;
|
|
698
|
-
/**
|
|
699
|
-
* The adapter a run resolves, recorded into the session's trajectory: every model call of the
|
|
700
|
-
* run — request, response, error — lands in the per-session debug log with the run and provider
|
|
701
|
-
* that made it. The trajectory wrap sits outside the reasoning wrap for the same reason the
|
|
702
|
-
* CLI's does: reasoning is display-only and never reaches records. Calls made outside a run
|
|
703
|
-
* (no trajectory open) pass through unchanged.
|
|
704
|
-
*/
|
|
705
242
|
private tracedAdapter;
|
|
706
|
-
/**
|
|
707
|
-
* Serialize all writes to a live run's JSON record, including the preflight shape stamp,
|
|
708
|
-
* accepted model selections, and the terminal result. The recovery reader can then see
|
|
709
|
-
* either the old selection or the fully durable new one, never an overlapping stale write.
|
|
710
|
-
*/
|
|
711
243
|
private serializeRunRecordWrite;
|
|
712
|
-
/** Change the next model turn without aborting a stream or replaying tools. */
|
|
713
244
|
private setRunModel;
|
|
714
|
-
/**
|
|
715
|
-
* Change the permission mode a live attempt runs under, without interrupting it.
|
|
716
|
-
*
|
|
717
|
-
* The new mode reaches the attempt through its permission control (`ActiveRun.permissionControl`): a
|
|
718
|
-
* tool call that has not decided yet decides under it, and every approval the attempt is waiting on
|
|
719
|
-
* is handed back as `policy-changed`, so its tool decides again — a prompt the new mode answers goes
|
|
720
|
-
* away, and one the new mode still requires is asked again. The mode is saved where the attempt read
|
|
721
|
-
* it from, so the next task, a resume and a terminal on the same project agree with what is running.
|
|
722
|
-
*/
|
|
723
245
|
private setRunPermissions;
|
|
724
246
|
private applyRunPermissions;
|
|
725
|
-
/**
|
|
726
|
-
* Move a live run's control to `next` and journal the change, settling any prompt that waited
|
|
727
|
-
* across it. Shared by the saved switch (`run.setPermissions`) and the run-scoped plan-approval
|
|
728
|
-
* flip: neither re-asks a mode the run already has.
|
|
729
|
-
*/
|
|
730
247
|
private switchLiveRunPermissions;
|
|
731
|
-
/**
|
|
732
|
-
* The plan-approval flip. Unlike `run.setPermissions` it is run-scoped only: approving a plan
|
|
733
|
-
* never rewrites the saved workspace default, so the next task plans again. The run continues in
|
|
734
|
-
* the workspace's saved default when that is an editing mode, and in Ask for approval otherwise.
|
|
735
|
-
*/
|
|
736
248
|
private approvePlan;
|
|
737
|
-
/** Save a live mode where the attempt reads it from: its own record when bound, the workspace default otherwise. */
|
|
738
249
|
private saveRunPermissions;
|
|
739
|
-
/**
|
|
740
|
-
* Bring the workspace's code-intelligence manager, once it exists, to the mode the run holds for it.
|
|
741
|
-
*
|
|
742
|
-
* One change at a time, each reading the target when it runs, so the last one leaves the manager on
|
|
743
|
-
* the latest target. A manager already on the target is left alone; one whose change failed is in an
|
|
744
|
-
* unknown mode, so the next sync applies the target again rather than trusting it.
|
|
745
|
-
*/
|
|
746
250
|
private syncCodeIntelPermissions;
|
|
251
|
+
/** `sessionId`: the session whose run will talk to this adapter; a run passes its own, known before `this.run` is set. */
|
|
747
252
|
private resolveModel;
|
|
748
|
-
/**
|
|
749
|
-
* The client-visible configuration with the plan-aware analytics answer.
|
|
750
|
-
*
|
|
751
|
-
* Resolved on every read rather than cached: the account can sign in, sign out, or confirm a plan
|
|
752
|
-
* between two reads, and a settings page that showed a stale opt-out is exactly the disagreement
|
|
753
|
-
* the plan gate exists to remove.
|
|
754
|
-
*/
|
|
755
253
|
private analyticsConfigView;
|
|
756
254
|
private resolveProvider;
|
|
757
|
-
/**
|
|
758
|
-
* One code-intelligence manager per workspace, reused across runs and released at shutdown.
|
|
759
|
-
*
|
|
760
|
-
* Two guards come from the terminal path and exist for the same reasons here: Read Only mode
|
|
761
|
-
* suspends indexing because the cache requires writes, and a project that *is* the user's home
|
|
762
|
-
* directory never indexes automatically, because a desktop user can pick any folder and
|
|
763
|
-
* recursively crawling a personal tree must not be an implicit side effect of opening the app.
|
|
764
|
-
*/
|
|
765
255
|
private codeIntelligence;
|
|
766
256
|
private openCodeIntelligence;
|
|
767
|
-
/**
|
|
768
|
-
* Prepare a workspace for the task its client expects to start in it.
|
|
769
|
-
*
|
|
770
|
-
* A client whose user has a project open, and an engine with nothing to do, knows where the
|
|
771
|
-
* next task is likely to run before it is sent. What a first task in a workspace waits for at
|
|
772
|
-
* its first node — opening the code index and synchronizing it with the files — is done here
|
|
773
|
-
* instead, so the run finds the manager it would have created, in the state a previous task in
|
|
774
|
-
* this engine would have left it in.
|
|
775
|
-
*
|
|
776
|
-
* Under the mode the task would run in: the one named, or the workspace's saved one. Read Only
|
|
777
|
-
* and Plan prepare nothing, because the index is a cache the engine may not write there. An
|
|
778
|
-
* engine that is running a task refuses, with the code that sends a start to another engine,
|
|
779
|
-
* and so does one that accepted a task while this was waiting: the manager belongs to the run.
|
|
780
|
-
* The answer does not wait for the synchronization, which carries on behind it.
|
|
781
|
-
*
|
|
782
|
-
* This is only worth doing while the engine is idle. The synchronization is work this process
|
|
783
|
-
* does itself, so starting it once a run is being set up moves it from the first node into the
|
|
784
|
-
* setup without shortening either: measured, the first model request arrives no sooner.
|
|
785
|
-
*/
|
|
786
257
|
private warmWorkspace;
|
|
787
|
-
/** Code-intelligence events belong to the active run's stream when one is running. */
|
|
788
258
|
private runEvent;
|
|
789
|
-
/** The journal writer of one run, created on its first event. */
|
|
790
259
|
private journalFor;
|
|
791
|
-
/**
|
|
792
|
-
* Journal first, then the client: a client that missed an event can re-read the record.
|
|
793
|
-
*
|
|
794
|
-
* The writer creates `runs/` when the first append finds it missing: the terminal client creates
|
|
795
|
-
* it during startup, and this mode returns before that code runs, so a fresh configuration home
|
|
796
|
-
* would otherwise fail every append with ENOENT. Appends are ordered: the filesystem does not
|
|
797
|
-
* finish concurrent appends in the order they were started.
|
|
798
|
-
*/
|
|
799
260
|
private recordRunEvent;
|
|
800
261
|
private ensureRunRecords;
|
|
801
262
|
private interaction;
|
|
802
263
|
private approve;
|
|
803
264
|
private ask;
|
|
804
265
|
private settleApproval;
|
|
805
|
-
/**
|
|
806
|
-
* How a run engine without the panel browser asks the desktop to run its
|
|
807
|
-
* agent's panel operations on the engine that owns the panel. The request
|
|
808
|
-
* travels as a `browser.panel.request` event and the desktop answers through
|
|
809
|
-
* `browser.panel.result` — the same exchange shape an approval uses.
|
|
810
|
-
*/
|
|
811
266
|
private panelBrowserRelayFor;
|
|
812
267
|
private settlePanelRelay;
|
|
813
268
|
private settleAnswer;
|
|
814
269
|
private cancelRun;
|
|
815
|
-
/**
|
|
816
|
-
* Queue a message into the live attempt's steering channel.
|
|
817
|
-
*
|
|
818
|
-
* The runtime polls that channel at turn boundaries and injects each message into the node's own
|
|
819
|
-
* conversation, so the attempt redirects without being cancelled and the node keeps the plan and
|
|
820
|
-
* context it built. Nothing is delivered by this call: the answer says the message is queued, and
|
|
821
|
-
* `run.steered` announces it so every window draws the user's own row immediately. What the run
|
|
822
|
-
* never read is reported on its terminal event, so a message that arrived too late is returned
|
|
823
|
-
* to the composer instead of disappearing.
|
|
824
|
-
*
|
|
825
|
-
* `runId` must name the attempt this engine is actually running. A message for any other attempt
|
|
826
|
-
* — one that already finished, or another engine's — is refused rather than queued, because a
|
|
827
|
-
* queue nobody polls would look exactly like a delivered message.
|
|
828
|
-
*/
|
|
829
270
|
private steerRun;
|
|
830
|
-
/**
|
|
831
|
-
* The directory an account's graphs live in, with the identity it was chosen for.
|
|
832
|
-
*
|
|
833
|
-
* The two travel together because they are one decision: a caller that read the subject again afterwards
|
|
834
|
-
* could label one account's names with another's identity if the credentials changed while the listing
|
|
835
|
-
* was being read.
|
|
836
|
-
*
|
|
837
|
-
* The account's cloud copy is brought current first, the way the CLI's graph editor does it: a graph
|
|
838
|
-
* saved on another machine reaches this one only through a sync, and the window lists graphs without
|
|
839
|
-
* ever opening the editor. The wait is bounded and a sync that fails leaves the copy already here.
|
|
840
|
-
*
|
|
841
|
-
* Ownership is decided here too. A directory no account has claimed is shared, so a sync that ran
|
|
842
|
-
* there would restore account A's cloud graphs into it and account B's install would then upload
|
|
843
|
-
* them into B's account. `graphStorageAccess` claims an unclaimed directory for a confirmed account —
|
|
844
|
-
* the account the builder claims it for — and reports the ones that are still shared.
|
|
845
|
-
*/
|
|
846
|
-
/** Whether a stored graph selection names a graph whose latest revision is soft-deleted. */
|
|
847
271
|
private selectionIsDeleted;
|
|
848
272
|
private graphDirectory;
|
|
849
|
-
/**
|
|
850
|
-
* Whether the account service confirms this account, paid or free.
|
|
851
|
-
*
|
|
852
|
-
* The verdict is only definitive for the account it names: an answer that arrived while the
|
|
853
|
-
* credentials changed describes the other account, and claiming this installation's graph directory
|
|
854
|
-
* for it would bind legacy local graphs to an account that is no longer signed in.
|
|
855
|
-
*/
|
|
856
273
|
private currentAccountIsConfirmed;
|
|
857
274
|
private listGraphs;
|
|
858
|
-
/**
|
|
859
|
-
* The shareable file of one library Agent, for the desktop's Share action to write into the
|
|
860
|
-
* user's Downloads folder. Agents live in this home's own library, not an account's graph
|
|
861
|
-
* store, so no account attribution applies; only the id crosses from the editor frame.
|
|
862
|
-
*/
|
|
863
275
|
private exportAgent;
|
|
864
276
|
private getGraph;
|
|
865
|
-
/**
|
|
866
|
-
* Persist the installation's graph selection.
|
|
867
|
-
*
|
|
868
|
-
* The Andorra preset is selectable per run but not storable: the configuration schema admits only
|
|
869
|
-
* word-character graph ids, so `:andorra` would make the next config load fail. The desktop keeps
|
|
870
|
-
* that choice per project instead and passes it to `run.start`.
|
|
871
|
-
*/
|
|
872
277
|
private selectGraph;
|
|
873
278
|
private openEditor;
|
|
874
279
|
private closeEditor;
|
|
875
|
-
/**
|
|
876
|
-
* Run a serve/lock transition behind every other one this process has queued.
|
|
877
|
-
*
|
|
878
|
-
* Two concurrent `remote.hosting.status` calls would otherwise race the same serve lock from one
|
|
879
|
-
* process: the loser sees a busy lock whose descriptor the winner has not written yet and
|
|
880
|
-
* reports the listener this engine is starting as a foreign one. `startRemoteServe` and the
|
|
881
|
-
* status handler — the two paths that can start a listener — share this queue.
|
|
882
|
-
*/
|
|
883
280
|
private serializeRemote;
|
|
884
|
-
/**
|
|
885
|
-
* Bring up or adopt this installation's remote listener, holding it until close.
|
|
886
|
-
*
|
|
887
|
-
* Called once at engine startup, after which a paired machine can reach this one while the
|
|
888
|
-
* desktop is open. With no devices and no active invitation the ensure resolves to not-serving
|
|
889
|
-
* without binding a port, so an unpaired install pays nothing; a later Settings-open grows the
|
|
890
|
-
* listener through the status handler, which queues behind this one.
|
|
891
|
-
*/
|
|
892
281
|
startRemoteServe(): Promise<void>;
|
|
893
|
-
/** A peer-side failure as a wire error; the UI branches on `status`, not on these codes. */
|
|
894
282
|
private remoteError;
|
|
895
|
-
/** The failure kinds that mean "this address did not answer" — all others end the host sequence. */
|
|
896
283
|
private remoteStatusFailure;
|
|
897
|
-
/**
|
|
898
|
-
* Run one peer call against the workspace's hosts in order, trying the next address only when
|
|
899
|
-
* this one was unreachable. An identity or authorization answer is about the machine, not the
|
|
900
|
-
* address: probing a second host would repeat it or paper over a certificate swap with an older
|
|
901
|
-
* address that still answers.
|
|
902
|
-
*
|
|
903
|
-
* The failure is converted for RPC boundaries that throw it at the window. A liveness probe is
|
|
904
|
-
* not one of those — it reads the failure's kind to report `offline`/`unauthorized`/
|
|
905
|
-
* `identity-changed` — so it asks for the peer error itself via `preservePeerError`; converting
|
|
906
|
-
* would flatten every kind into a generic network error and the status surface would never see a
|
|
907
|
-
* state other than `unknown`.
|
|
908
|
-
*/
|
|
909
284
|
private peerCall;
|
|
910
|
-
/**
|
|
911
|
-
* The peer target for a stored workspace, with the hosts to try in order: the operator's
|
|
912
|
-
* host override first (moving the target without touching trust — identity is the pinned
|
|
913
|
-
* fingerprint), then every address the pairing code advertised.
|
|
914
|
-
*/
|
|
915
285
|
private remoteTarget;
|
|
916
|
-
/** The stored workspace as the wire sees it: never the device token, never the certificate. */
|
|
917
286
|
private remoteWorkspaceView;
|
|
918
|
-
/**
|
|
919
|
-
* The host-side Settings surface, and the call that starts hosting.
|
|
920
|
-
*
|
|
921
|
-
* The listener a status call starts belongs to this engine until close — that is what makes the
|
|
922
|
-
* desktop closing read as offline to peers unless a standalone `andorra remote serve` owns the
|
|
923
|
-
* lock; an adopted handle releases to nothing, so there is nothing to hold.
|
|
924
|
-
*/
|
|
925
287
|
private remoteHostingStatus;
|
|
926
|
-
/**
|
|
927
|
-
* Replace the live invitation with a fresh one — the Settings page's "New code" action.
|
|
928
|
-
*
|
|
929
|
-
* The status call replaces an invitation only after it expires or is redeemed, so a code that was
|
|
930
|
-
* pasted somewhere it should not have been stays redeemable for the rest of its ten minutes. This
|
|
931
|
-
* is the explicit way to invalidate it: the previous token stops working the moment the new
|
|
932
|
-
* invitation is written, and the answer is the same hosting snapshot the page already renders.
|
|
933
|
-
*/
|
|
934
288
|
private remoteHostingInvitationFull;
|
|
935
289
|
private remoteHostingInvitationRegenerate;
|
|
936
290
|
private remoteShareAdd;
|
|
937
291
|
private remoteShareRemove;
|
|
938
292
|
private remoteDeviceRevoke;
|
|
939
|
-
/**
|
|
940
|
-
* Raise a paired device to full owner authority, and answer with the refreshed hosting snapshot.
|
|
941
|
-
*
|
|
942
|
-
* The grant is the Settings alternative to revoke-and-re-pair the product contract names; like a
|
|
943
|
-
* full-scope invitation it is refused over cleartext hosting, because the token that would carry
|
|
944
|
-
* the authority travels the wire unencrypted there.
|
|
945
|
-
*/
|
|
946
293
|
private remoteDeviceGrant;
|
|
947
|
-
/**
|
|
948
|
-
* Open (or replace) this engine's relay link to one paired workspace.
|
|
949
|
-
*
|
|
950
|
-
* Idempotent per connection id — the desktop reconnects after its own restarts and must not pay
|
|
951
|
-
* for a second stream while the first still runs. The answer carries what the peer's identity
|
|
952
|
-
* probe said (including the engine capabilities its relay serves), which is what the desktop uses
|
|
953
|
-
* to decide which controls the link can honor.
|
|
954
|
-
*/
|
|
955
294
|
private remoteEngineConnect;
|
|
956
|
-
/** End this engine's relay link to one workspace, if it holds one. */
|
|
957
295
|
private remoteEngineDisconnect;
|
|
958
|
-
/**
|
|
959
|
-
* One workspace's event stream, held until the link is replaced or disconnected.
|
|
960
|
-
*
|
|
961
|
-
* A stream that ends is retried after a pause — a serve restarting, a machine rebooting — but only
|
|
962
|
-
* while the stored pairing is still the one the link was opened for, and never for the verdicts a
|
|
963
|
-
* retry would repeat forever: an identity change or a revocation is reported to the window as a
|
|
964
|
-
* closed link instead.
|
|
965
|
-
*/
|
|
966
296
|
private runEngineLink;
|
|
967
|
-
/**
|
|
968
|
-
* One relayed engine request: a full-grant pairing's client surface, proxied through the same
|
|
969
|
-
* host walk every other peer call uses, with the caller's own deadline carried across so a slow
|
|
970
|
-
* method keeps the budget the desktop granted it.
|
|
971
|
-
*/
|
|
972
297
|
private remoteEngineRequest;
|
|
973
|
-
/**
|
|
974
|
-
* Every paired workspace with a live liveness probe.
|
|
975
|
-
*
|
|
976
|
-
* The probes run together because each is bounded by the client's own timeout; a workspace whose
|
|
977
|
-
* machine is asleep costs one timeout, not one per remaining workspace. A successful probe also
|
|
978
|
-
* refreshes the identity fields from the peer itself, so a rebuilt machine shows its new name.
|
|
979
|
-
*/
|
|
980
298
|
private remoteWorkspacesList;
|
|
981
|
-
/**
|
|
982
|
-
* One workspace's state, probed against the peer addresses the listing would walk.
|
|
983
|
-
*
|
|
984
|
-
* Shared by the listing and the single-workspace re-check: a window watching a machine that is
|
|
985
|
-
* not online asks for that one workspace, and must reach the same answer a full listing would
|
|
986
|
-
* have produced for it — the same address order, the same failure kinds, the same identity fields.
|
|
987
|
-
*/
|
|
988
299
|
private remoteWorkspaceState;
|
|
989
|
-
/**
|
|
990
|
-
* Re-probe one paired workspace.
|
|
991
|
-
*
|
|
992
|
-
* A missing id is the window's stale view of a pairing removed elsewhere, answered as not-found so
|
|
993
|
-
* the client drops the row instead of treating an unknown workspace as an unreachable machine.
|
|
994
|
-
*/
|
|
995
300
|
private remoteWorkspaceProbe;
|
|
996
|
-
/**
|
|
997
|
-
* The fields a probe answer depends on, as one comparable value.
|
|
998
|
-
*
|
|
999
|
-
* The cached identity fields are deliberately absent: they describe the machine as some earlier
|
|
1000
|
-
* answer saw it, not what this walk was asked to reach, and only pairing writes them. Everything
|
|
1001
|
-
* listed here is a fact about the target, so a difference means the answer above is not this row's.
|
|
1002
|
-
*/
|
|
1003
301
|
private remoteProbeIdentity;
|
|
1004
|
-
/**
|
|
1005
|
-
* What a link's reconnect must agree on: trust and addressing. The display label is not among
|
|
1006
|
-
* them — a rename while a run's link is live is not a pairing replacement, and closing the link
|
|
1007
|
-
* for one would abandon work over a cosmetic edit.
|
|
1008
|
-
*/
|
|
1009
302
|
private remoteTrustIdentity;
|
|
1010
|
-
/**
|
|
1011
|
-
* Redeem a pasted pairing code and store the workspace.
|
|
1012
|
-
*
|
|
1013
|
-
* The credential and the pinned certificate come back from the redemption itself; the invitation
|
|
1014
|
-
* is single-use, so the peer rejects a second redemption of the same code. Nothing here is
|
|
1015
|
-
* retried against another host after a refusal: a refused invite stays refused.
|
|
1016
|
-
*/
|
|
1017
303
|
private remoteWorkspaceAdd;
|
|
1018
304
|
private remoteWorkspaceRemove;
|
|
1019
305
|
private remoteWorkspaceRename;
|
|
1020
|
-
/**
|
|
1021
|
-
* Move a workspace's target address without touching its trust anchor.
|
|
1022
|
-
*
|
|
1023
|
-
* The override is what a DHCP lease change asks for: the fingerprint pin still decides which
|
|
1024
|
-
* machine is the paired one, so pointing at a new address cannot adopt a different certificate.
|
|
1025
|
-
* A null host removes the override and falls back to the advertised addresses.
|
|
1026
|
-
*/
|
|
1027
306
|
private remoteWorkspaceSetHost;
|
|
1028
|
-
/**
|
|
1029
|
-
* Everything a peer will let this device browse: its registered projects and its explicit
|
|
1030
|
-
* shares. Labels are the peer's chosen display names — absolute paths never cross the wire.
|
|
1031
|
-
*/
|
|
1032
307
|
private remoteRootsList;
|
|
1033
308
|
private remoteProjectsFetch;
|
|
1034
309
|
private remoteBrowse;
|
|
@@ -1036,195 +311,47 @@ export declare class AppServer {
|
|
|
1036
311
|
private remoteOwnerBrowse;
|
|
1037
312
|
private remoteOwnerAddProject;
|
|
1038
313
|
private listProjects;
|
|
1039
|
-
/**
|
|
1040
|
-
* Register a project folder, canonicalized so the registry and a peer's root ids agree.
|
|
1041
|
-
*
|
|
1042
|
-
* realpath makes `projects.add` idempotent across junctions, symlinks, and Windows drive-letter
|
|
1043
|
-
* case, and it is the same canonical form `projectRootId` hashes — so the id a peer derives and
|
|
1044
|
-
* the id this machine hosts cannot drift apart by spelling.
|
|
1045
|
-
*/
|
|
1046
314
|
private addProject;
|
|
1047
315
|
private removeProject;
|
|
1048
|
-
/** The
|
|
316
|
+
/** The browser profile a task browses on: its project identity when it carries one, otherwise its folder. */
|
|
317
|
+
private static panelProfileKey;
|
|
318
|
+
private relinkProject;
|
|
319
|
+
private changeProjectFolder;
|
|
1049
320
|
private timersFor;
|
|
1050
|
-
/**
|
|
1051
|
-
* A session summary plus what only this process knows: the wakes it is holding, and whether a run of
|
|
1052
|
-
* this session is in flight.
|
|
1053
|
-
*
|
|
1054
|
-
* A row reads its task's story off the saved record, and the saved record lags a live run — the turn
|
|
1055
|
-
* being written is not in the file yet, so the last saved one still reads as finished. Naming the run
|
|
1056
|
-
* here is what keeps a session that is working from being drawn as a task that is done with you.
|
|
1057
|
-
*/
|
|
1058
321
|
private summary;
|
|
1059
|
-
/**
|
|
1060
|
-
* The summary a completed or failed run publishes, built without the live-run override.
|
|
1061
|
-
*
|
|
1062
|
-
* The terminal story is the saved record's: a completion says the session is done (or waiting on an
|
|
1063
|
-
* armed wake), never running. Building the payload from the record alone keeps that true whatever
|
|
1064
|
-
* the engine's live-run slot holds at the instant of the emit, rather than relying on the slot
|
|
1065
|
-
* having been released a statement earlier in the finalizer.
|
|
1066
|
-
*/
|
|
1067
322
|
private terminalSummary;
|
|
1068
|
-
/**
|
|
1069
|
-
* Every wake this process is holding, grouped by the session that armed it.
|
|
1070
|
-
*
|
|
1071
|
-
* The desktop runs one engine per task, so the wakes a session is waiting on can live in a process its
|
|
1072
|
-
* `sessions.list` never reaches: the primary answers for every session on disk and knows only its own
|
|
1073
|
-
* registry. This is how a window that has just reloaded asks each engine it reattached to what it is still
|
|
1074
|
-
* holding — without it a row whose wake is alive loses its clock, and the user has no way to see that the
|
|
1075
|
-
* task is still coming back.
|
|
1076
|
-
*/
|
|
1077
323
|
private listTimers;
|
|
1078
|
-
|
|
1079
|
-
private emitSessionSkill;
|
|
1080
|
-
/**
|
|
1081
|
-
* Pause, resume or remove the session's skill. It takes effect from the session's next message: a
|
|
1082
|
-
* run already working read the skill when it started.
|
|
1083
|
-
*/
|
|
324
|
+
private emitSessionSkills;
|
|
1084
325
|
private updateSessionSkill;
|
|
1085
|
-
/** Say what a session is waiting on. An empty list is a real answer: it is what ends a wait. */
|
|
1086
326
|
private emitPullRequest;
|
|
1087
|
-
/**
|
|
1088
|
-
* Hold the calling run until its PR's next review: the comments the watcher finds are handed to it as the Auto-fix
|
|
1089
|
-
* prompt would be, instead of being armed as a wake. A wake already armed for comments it has not delivered is
|
|
1090
|
-
* taken at once. `origin` (the waiting node) becomes the node later Auto-fix wakes go to, since it owns the loop.
|
|
1091
|
-
*/
|
|
1092
327
|
private awaitReview;
|
|
1093
|
-
/**
|
|
1094
|
-
* What the session's PR record says a review wait should end with, handed to `deliver`: the PR is gone, finished or
|
|
1095
|
-
* has Auto-fix off, or it holds comments found and not yet carried by a run. Those are taken under the lock, handed
|
|
1096
|
-
* over first and only then marked handled, so a wait that ended meanwhile never loses them. A wake this engine is
|
|
1097
|
-
* delivering now is left to that delivery.
|
|
1098
|
-
*/
|
|
1099
328
|
private reviewWaitFromRecord;
|
|
1100
|
-
/** A run now carries the Auto-fix prompt behind `wakeId`: its comments are handled. */
|
|
1101
329
|
private recordAutoFixDelivered;
|
|
1102
|
-
/** The pending set as a change left it, without diffs: a client reads those with `sessions.changes.list`. */
|
|
1103
330
|
private emitSessionChanges;
|
|
1104
|
-
/**
|
|
1105
|
-
* Start tracking `ref` for the session. A PR already tracked under the same URL keeps its settings, so a
|
|
1106
|
-
* repeated `gh pr create` (which reports the existing PR) never switches off what the user turned on.
|
|
1107
|
-
*/
|
|
1108
331
|
private attachPullRequest;
|
|
1109
332
|
private updatePullRequest;
|
|
1110
333
|
private dismissPullRequest;
|
|
1111
|
-
/**
|
|
1112
|
-
* Withdraw an Auto-fix wake this engine holds. One held by another engine is not reachable from here; that
|
|
1113
|
-
* engine checks the record again before it delivers (`deliverDueTimers`), and finds the wake unwanted.
|
|
1114
|
-
*/
|
|
1115
334
|
private cancelAutoFixWake;
|
|
1116
|
-
/** The `pull_request` tool's view of one session's PR; `carry` is the calling run's selections. */
|
|
1117
335
|
private pullRequestControl;
|
|
1118
|
-
/**
|
|
1119
|
-
* Hand an Auto-fix prompt to the session through the same wake a `set_timer` arms, under the selections the
|
|
1120
|
-
* session's PR was configured from: without them the continuation would run under whatever graph and model
|
|
1121
|
-
* the configuration names today, with different tools than the work it is fixing. `origin` addresses the prompt to
|
|
1122
|
-
* the graph node that switched Auto-fix on (`deliverDueTimers`), rather than to the graph's entry node.
|
|
1123
|
-
*/
|
|
1124
336
|
private wakeForPullRequest;
|
|
1125
337
|
private emitTimers;
|
|
1126
|
-
/**
|
|
1127
|
-
* Publish what a session whose run just ended is waiting on, and arm the next deadline.
|
|
1128
|
-
*
|
|
1129
|
-
* A wake still armed means the session is waiting rather than finished, and the engine is the only thing
|
|
1130
|
-
* left that can deliver it. Nothing armed means the row is free to read as completed.
|
|
1131
|
-
*/
|
|
1132
338
|
private settleSessionTimers;
|
|
1133
|
-
/** Arm the next deadline check, across every session this engine holds wakes for. */
|
|
1134
339
|
private armTimerCheck;
|
|
1135
|
-
/**
|
|
1136
|
-
* When this engine should next look for a due wake, across every session it holds wakes for.
|
|
1137
|
-
*
|
|
1138
|
-
* Not the same thing as the soonest deadline: a wake a delivery handed back is not looked at again until the
|
|
1139
|
-
* beat it came back for has passed, which the registry records on the wake itself. One sweep serves every
|
|
1140
|
-
* session this engine has served, so a sweep that read the floor as the deadline would keep arriving at the
|
|
1141
|
-
* wake that cannot be delivered, and reach the ones that can only after it.
|
|
1142
|
-
*/
|
|
1143
340
|
private nextWakeLook;
|
|
1144
|
-
/** Begin a delivery pass when none is going. Called by the registry's due callback and by the check. */
|
|
1145
341
|
private checkTimers;
|
|
1146
|
-
/**
|
|
1147
|
-
* Say a wake will never be delivered: drop it, publish the shorter wait list, and tell the user why.
|
|
1148
|
-
*
|
|
1149
|
-
* A wake is the agent's own reminder about work that is over or was replaced, and starting it as a new task
|
|
1150
|
-
* would restart that work behind the user's back. Dropping it silently would hide a promise the agent made,
|
|
1151
|
-
* so the reason goes out with `timers.spent` - which a window shows as a notice - and into the log.
|
|
1152
|
-
*/
|
|
1153
342
|
private spendWake;
|
|
1154
|
-
/**
|
|
1155
|
-
* Whether a wake is a `set_timer` reminder a graph node set about the work it was doing. Those belong to that work:
|
|
1156
|
-
* they are read by the node while its attempt runs, and spent once the node or the attempt is done with it.
|
|
1157
|
-
*
|
|
1158
|
-
* An Auto-fix wake also names a node (the one that switched Auto-fix on), but only as its address: review comments
|
|
1159
|
-
* are new work that outlives the attempt that turned Auto-fix on, so they are never spent with it and always wait
|
|
1160
|
-
* for the engine to be free (`deliverDueTimers`).
|
|
1161
|
-
*/
|
|
1162
343
|
private nodeReminder;
|
|
1163
|
-
/**
|
|
1164
|
-
* Spend the session's node-armed wakes that belong to an attempt in `attempts` and satisfy `spent`.
|
|
1165
|
-
*
|
|
1166
|
-
* Wakes another surface is in the middle of delivering are left alone: that delivery decides what became of
|
|
1167
|
-
* them. Wakes no graph node armed are never touched here.
|
|
1168
|
-
*/
|
|
1169
344
|
private spendAttemptWakes;
|
|
1170
|
-
/**
|
|
1171
|
-
* Hand every due wake the live run itself armed (or an attempt that run continues) to that run, as a
|
|
1172
|
-
* steering message its working node reads at the next turn boundary.
|
|
1173
|
-
*
|
|
1174
|
-
* The wake is settled once the message is queued: from there the run owns it. One the run ends before
|
|
1175
|
-
* reading is put back on the registry by the finalizer, where the rules for a finished run decide it.
|
|
1176
|
-
*/
|
|
1177
345
|
private steerDueWakes;
|
|
1178
|
-
/**
|
|
1179
|
-
* Where a node-armed wake goes once no run has the engine: the attempt to continue, a reason it is spent, or
|
|
1180
|
-
* a reason to wait.
|
|
1181
|
-
*
|
|
1182
|
-
* It continues only the session's newest attempt, and only when that attempt is the one that armed it or a
|
|
1183
|
-
* continuation of it, the attempt stopped without finishing, the user did not stop it, and the arming node
|
|
1184
|
-
* has not finished since the wake was armed. Anything else means the work the reminder was about is over or
|
|
1185
|
-
* was replaced by a newer turn, and it is spent.
|
|
1186
|
-
*/
|
|
1187
346
|
private wakeContinuation;
|
|
1188
|
-
/**
|
|
1189
|
-
* Give every wake that has come due to the session that armed it, one run at a time.
|
|
1190
|
-
*
|
|
1191
|
-
* Each is started on the path a task submitted over the socket takes, so a client sees one lifecycle for
|
|
1192
|
-
* both and the row moves from waiting to running on its own. A wake waits out a run that is already going:
|
|
1193
|
-
* a deadline says the earliest a prompt may be given, not the moment it is, and a session whose engine is
|
|
1194
|
-
* busy is not that moment. A wake whose session has been deleted is dropped — it has no conversation left
|
|
1195
|
-
* to return to. A delivery the engine refuses because it is already busy is put back and tried again: that
|
|
1196
|
-
* refusal describes the moment, not the task. Any other refusal is reported and left spent, rather than
|
|
1197
|
-
* retried on a deadline forever; the row stops saying the session is waiting on it. A wake whose session
|
|
1198
|
-
* cannot be read is put back for the beat its restore armed it for, and the pass carries on: one session's
|
|
1199
|
-
* unreadable record says nothing about what another session is owed.
|
|
1200
|
-
*/
|
|
1201
347
|
private deliverDueTimers;
|
|
1202
|
-
/**
|
|
1203
|
-
* Re-reconcile the runs a foreign engine still owned when this one started, once that engine exits.
|
|
1204
|
-
*
|
|
1205
|
-
* Startup recovery leaves an open record alone while its pid is alive, because a second engine on
|
|
1206
|
-
* this home may genuinely be running it. In the close-and-immediately-reopen flow that holder is
|
|
1207
|
-
* the engine that was shutting down: by the time it exits, this engine has already answered
|
|
1208
|
-
* `sessions.list` with the stale `running`, and the rail reloads nothing on its own — so neither
|
|
1209
|
-
* the spinner nor the interruption mark would show until the window reloads. Poll each holder, and
|
|
1210
|
-
* as soon as one exits, re-run recovery scoped to exactly the records this watch captured
|
|
1211
|
-
* (`onlyRunIds`), then republish the sessions those records name: a window already holding the
|
|
1212
|
-
* stale row gets the correction as an ordinary `session.updated`, and a client that connects later
|
|
1213
|
-
* reads the corrected record off disk. The scoping is what keeps this safe next to live work: this
|
|
1214
|
-
* engine may have started its own run by the time a predecessor dies, and an unscoped sweep — whose
|
|
1215
|
-
* pid check treats a record owned by this very process as stale — would stamp that active attempt
|
|
1216
|
-
* `interrupted` and hand out a Resume for work that is still running. A holder that outlives the
|
|
1217
|
-
* wait is accepted as a genuinely running engine — its work is left exactly as recovery intended.
|
|
1218
|
-
*/
|
|
1219
348
|
watchForeignEngineShutdown(owners: {
|
|
1220
349
|
runId: string;
|
|
1221
350
|
pid: number;
|
|
1222
351
|
sessionId: string | undefined;
|
|
1223
352
|
}[]): void;
|
|
1224
|
-
/** Release everything this process owns. Safe to call twice. */
|
|
1225
353
|
close(): Promise<void>;
|
|
1226
354
|
}
|
|
1227
|
-
/** Run the engine until stdin closes or a client asks for shutdown. Returns the process exit code. */
|
|
1228
355
|
export declare function runAppServer(options?: AppServerOptions & {
|
|
1229
356
|
input?: NodeJS.ReadableStream;
|
|
1230
357
|
}): Promise<number>;
|