@andorra-labs/code 0.1.12 → 0.1.13
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 +2 -42
- 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 +49 -416
- 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 +9 -153
- 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/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 +0 -28
- package/dist/src/app-server/protocol.d.ts +13 -245
- 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 +27 -927
- package/dist/src/app-server.js +537 -2992
- 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 +0 -93
- package/dist/src/auth/AuthManager.js +3 -165
- 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 +0 -16
- package/dist/src/auth/deployment.js +0 -16
- package/dist/src/auth/index.d.ts +0 -11
- package/dist/src/auth/index.js +0 -11
- package/dist/src/auth/lock.d.ts +0 -1
- package/dist/src/auth/lock.js +0 -1
- package/dist/src/auth/store.d.ts +7 -108
- package/dist/src/auth/store.js +21 -129
- 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 +4 -45
- 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 +0 -12
- package/dist/src/browser-stealth.js +0 -36
- 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 +11 -93
- package/dist/src/browser-view.d.ts +47 -301
- package/dist/src/browser-view.js +333 -582
- 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 +80 -721
- 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 +24 -0
- package/dist/src/command-screens.js +132 -100
- package/dist/src/commands.d.ts +6 -63
- package/dist/src/commands.js +20 -100
- 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 +11 -116
- package/dist/src/config.js +39 -171
- 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 +0 -2
- package/dist/src/dashboard-view.js +0 -35
- 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 +0 -10
- package/dist/src/decision/applyToolMenu.d.ts +0 -1
- package/dist/src/decision/applyToolMenu.js +1 -5
- 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 +0 -1
- package/dist/src/decision/toolMenu.d.ts +0 -3
- package/dist/src/decision/toolMenu.js +0 -4
- package/dist/src/decision/types.d.ts +0 -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 +0 -63
- package/dist/src/graph-health.js +0 -57
- package/dist/src/graph-manager-chat.d.ts +5 -155
- package/dist/src/graph-manager-chat.js +2 -177
- 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 +31 -391
- package/dist/src/graph-selection.d.ts +0 -14
- package/dist/src/graph-selection.js +0 -14
- 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 +152 -491
- 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 +3 -180
- 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 +11 -134
- package/dist/src/graph-ui/theme.js +1 -26
- package/dist/src/graph-ui/tokens.css +15 -114
- package/dist/src/graphs.d.ts +6 -157
- package/dist/src/graphs.js +65 -266
- 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 +8 -46
- 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 +0 -13
- package/dist/src/membership.d.ts +2 -60
- package/dist/src/membership.js +0 -85
- 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-health-cache.d.ts +0 -38
- package/dist/src/model-health-cache.js +1 -49
- package/dist/src/model-metadata.d.ts +0 -18
- package/dist/src/model-metadata.js +2 -42
- 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 +0 -63
- package/dist/src/palette.js +0 -63
- package/dist/src/permissions.d.ts +0 -15
- package/dist/src/permissions.js +0 -17
- 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 +0 -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 +0 -2
- package/dist/src/provider-settings.js +0 -32
- package/dist/src/providers.d.ts +0 -217
- package/dist/src/providers.js +0 -315
- 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 +95 -415
- 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 +17 -335
- 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 +0 -7
- package/dist/src/run-control.js +0 -7
- 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 +10 -228
- package/dist/src/runtime.js +0 -127
- 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 +2 -122
- package/dist/src/sessions.js +7 -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/provenance.json +1 -1
- 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 +0 -163
- package/dist/src/subagent-run.js +4 -373
- 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 +1 -82
- 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 +14 -523
- package/dist/src/terminal-ui.js +74 -876
- 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 +2 -60
- package/dist/src/types.d.ts +1 -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 +2 -2
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import type { Config } from './config.js';
|
|
2
2
|
export declare function currentGraphSubject(): Promise<string | undefined>;
|
|
3
|
-
/**
|
|
4
|
-
* Whether the identity a choice was made under is still the one on this machine.
|
|
5
|
-
*
|
|
6
|
-
* A choice made while signed out was made under no identity, and a sign-in that lands while the
|
|
7
|
-
* choice is still being prepared must not own it: the write would land on the account that just
|
|
8
|
-
* signed in, over whatever it had chosen for itself. A client that names no identity at all is a
|
|
9
|
-
* client from before the field, and its choice is written as it always was.
|
|
10
|
-
*/
|
|
11
3
|
export declare function identityStillHolds(declared: {
|
|
12
4
|
subject?: string;
|
|
13
5
|
signedOut?: boolean;
|
|
14
6
|
}, current: string | undefined): boolean;
|
|
15
|
-
/** Legacy installation-wide selections have no reliable owner. Require explicit reselection. */
|
|
16
7
|
export declare function configuredGraphSelection(config: Config, subject?: string): string;
|
|
17
8
|
export declare function saveGraphSelection(config: Config, graph: string, subject?: string): void;
|
|
18
|
-
/**
|
|
19
|
-
* A deleted graph must not stay an account's configured editor default: startup selects it, and
|
|
20
|
-
* the preflight falls back only for a membership refusal, so its missing file would abort the
|
|
21
|
-
* launch. Point the account back at the bundled preset; other accounts keep their selections.
|
|
22
|
-
*/
|
|
23
9
|
export declare function resetDeletedGraphSelection(config: Config, subject: string, graph: string): Config | undefined;
|
|
@@ -3,14 +3,6 @@ export async function currentGraphSubject() {
|
|
|
3
3
|
const status = await getAuthStatus().catch(() => ({ signedIn: false, subject: undefined }));
|
|
4
4
|
return status.signedIn && status.subject && /^[A-Za-z0-9-]{1,128}$/.test(status.subject) ? status.subject : undefined;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* Whether the identity a choice was made under is still the one on this machine.
|
|
8
|
-
*
|
|
9
|
-
* A choice made while signed out was made under no identity, and a sign-in that lands while the
|
|
10
|
-
* choice is still being prepared must not own it: the write would land on the account that just
|
|
11
|
-
* signed in, over whatever it had chosen for itself. A client that names no identity at all is a
|
|
12
|
-
* client from before the field, and its choice is written as it always was.
|
|
13
|
-
*/
|
|
14
6
|
export function identityStillHolds(declared, current) {
|
|
15
7
|
if (declared.subject !== undefined)
|
|
16
8
|
return current === declared.subject;
|
|
@@ -18,7 +10,6 @@ export function identityStillHolds(declared, current) {
|
|
|
18
10
|
return current === undefined;
|
|
19
11
|
return true;
|
|
20
12
|
}
|
|
21
|
-
/** Legacy installation-wide selections have no reliable owner. Require explicit reselection. */
|
|
22
13
|
export function configuredGraphSelection(config, subject) {
|
|
23
14
|
return subject && Object.hasOwn(config.graphSelections ?? {}, subject) ? config.graphSelections[subject] : 'default';
|
|
24
15
|
}
|
|
@@ -29,11 +20,6 @@ export function saveGraphSelection(config, graph, subject) {
|
|
|
29
20
|
config.graphSelections = { ...config.graphSelections, [subject]: graph };
|
|
30
21
|
delete config.graph;
|
|
31
22
|
}
|
|
32
|
-
/**
|
|
33
|
-
* A deleted graph must not stay an account's configured editor default: startup selects it, and
|
|
34
|
-
* the preflight falls back only for a membership refusal, so its missing file would abort the
|
|
35
|
-
* launch. Point the account back at the bundled preset; other accounts keep their selections.
|
|
36
|
-
*/
|
|
37
23
|
export function resetDeletedGraphSelection(config, subject, graph) {
|
|
38
24
|
if (config.graphSelections?.[subject] !== graph)
|
|
39
25
|
return undefined;
|
|
@@ -2,14 +2,11 @@ import { type Config } from './config.js';
|
|
|
2
2
|
import { type Membership } from './membership.js';
|
|
3
3
|
import { GraphSync } from './graph-sync.js';
|
|
4
4
|
import { GraphManagerChat, type ManagerGraphRevision } from './graph-manager-chat.js';
|
|
5
|
-
/** What the Graph Manager routes need of the chat; a test supplies a stand-in for the engine-backed one. */
|
|
6
|
-
/**
|
|
7
|
-
* What the Graph Manager chat reads after each `graphs` call: the graph's latest stored revision, and
|
|
8
|
-
* whether it is the one a deletion publishes. Undefined for a graph with nothing stored.
|
|
9
|
-
*/
|
|
10
5
|
export declare function readManagerGraphRevision(id: string, graphDirectory: string): Promise<ManagerGraphRevision | undefined>;
|
|
11
6
|
export type GraphManagerChatSession = Pick<GraphManagerChat, 'subscribe' | 'send' | 'approve' | 'answer' | 'cancel' | 'reset' | 'close'>;
|
|
12
7
|
export declare function createGraphSessionCheck(subject: string | undefined, status?: (signal?: AbortSignal) => Promise<import("./auth/types.js").AuthStatus>, membership?: (signal?: AbortSignal, home?: string) => Promise<Membership>): () => Promise<void>;
|
|
8
|
+
export declare const EDITOR_MEMBERSHIP_TTL_MS = 30000;
|
|
9
|
+
export declare function sharedRead<T>(read: () => Promise<T>, ttlMs: number, now?: () => number): () => Promise<T>;
|
|
13
10
|
export declare function requireGraphProviders(directory?: string): Promise<Config>;
|
|
14
11
|
export declare function startGraphServer(directory?: string, checkMembership?: () => Promise<unknown>, options?: {
|
|
15
12
|
membership?: () => Promise<Membership>;
|
|
@@ -21,10 +18,5 @@ export declare function startGraphServer(directory?: string, checkMembership?: (
|
|
|
21
18
|
token: string;
|
|
22
19
|
close: () => Promise<void>;
|
|
23
20
|
}>;
|
|
24
|
-
/**
|
|
25
|
-
* Reset the configured selection only after the deletion succeeds. Otherwise a graph-lock
|
|
26
|
-
* timeout would change the next CLI launch even though the graph still exists. A crash
|
|
27
|
-
* between removal and reset is handled by the CLI's missing-selection fallback.
|
|
28
|
-
*/
|
|
29
21
|
export declare function deleteGraphWithTombstone(id: string, graphDirectory: string, directory: string, subject: string | undefined, sync: Pick<GraphSync, 'forgetGraph'> | undefined): Promise<void>;
|
|
30
22
|
export declare function launchGraphEditor(noOpen?: boolean): Promise<void>;
|
package/dist/src/graph-server.js
CHANGED
|
@@ -6,7 +6,7 @@ import { execFile } from 'node:child_process';
|
|
|
6
6
|
import { changeConfigFile, configDirectory, loadConfig, validateConfig } from './config.js';
|
|
7
7
|
import { stampGraphProviderProfiles } from './graph-provider-portability.js';
|
|
8
8
|
import { resetDeletedGraphSelection } from './graph-selection.js';
|
|
9
|
-
import { listGraphs, loadGraph, saveGraph, validateGraph, migrateGraphForEditor, deleteGraph, isDeletedGraph, withoutDeletedGraphs, GRAPH_MANAGER_GRAPH_ID, reservedGraphId } from './graphs.js';
|
|
9
|
+
import { listGraphs, loadGraph, saveGraph, saveGraphOrder, validateGraph, migrateGraphForEditor, deleteGraph, isDeletedGraph, withoutDeletedGraphs, GRAPH_MANAGER_GRAPH_ID, reservedGraphId } from './graphs.js';
|
|
10
10
|
import { createTools } from './tools.js';
|
|
11
11
|
import { AutomationStore } from './automations.js';
|
|
12
12
|
import { deleteAgentDefinition, exportAgentDefinition, importAgentDefinition, listAgentDefinitions, readAgentDefinition, saveAgentDefinition, validateAgentDefinition } from './agent-definitions.js';
|
|
@@ -22,28 +22,14 @@ import { GraphSync } from './graph-sync.js';
|
|
|
22
22
|
import { editorSkillCatalog } from './skills/invocable-skills.js';
|
|
23
23
|
import { graphRevisionHistory, previewGraphRoutes, studioRuns, studioRunEvents } from './graph-studio-features.js';
|
|
24
24
|
import { GraphManagerChat } from './graph-manager-chat.js';
|
|
25
|
-
/** What the Graph Manager routes need of the chat; a test supplies a stand-in for the engine-backed one. */
|
|
26
|
-
/**
|
|
27
|
-
* What the Graph Manager chat reads after each `graphs` call: the graph's latest stored revision, and
|
|
28
|
-
* whether it is the one a deletion publishes. Undefined for a graph with nothing stored.
|
|
29
|
-
*/
|
|
30
25
|
export function readManagerGraphRevision(id, graphDirectory) {
|
|
31
26
|
return loadGraph(id, undefined, graphDirectory).then(graph => ({ revision: graph.revision, deleted: isDeletedGraph(graph) }), () => undefined);
|
|
32
27
|
}
|
|
33
|
-
/** The ids a graph can have in the editor; a Graph Manager conversation is named by one. */
|
|
34
28
|
const MANAGER_GRAPH_ID = /^[\w-]{1,120}$/;
|
|
35
|
-
/** The largest request body the editor accepts for a graph, whether it is being saved or sent to Graph Manager. */
|
|
36
29
|
const GRAPH_BODY_LIMIT = 512 * 1024;
|
|
37
|
-
// The vendor marks the editor's model picker can draw (model-picker.js `logoFor`): the desktop's
|
|
38
|
-
// glyph files (desktop/src/assets/providers/glyphs), which build-assets.mjs copies beside the editor.
|
|
39
30
|
const PROVIDER_GLYPHS = ['alibaba-cloud', 'anthropic', 'aws-bedrock', 'claude', 'deepseek', 'fireworks', 'kimi', 'minimax', 'openai', 'opencode', 'openrouter', 'xai', 'xiaomi-mimo', 'zai'];
|
|
40
31
|
const MANAGER_TOO_LARGE = 'This graph is too large to send to Graph Manager.';
|
|
41
32
|
const MANAGER_PING_MS = 15_000;
|
|
42
|
-
/**
|
|
43
|
-
* Reads a request body of at most `limit` bytes; undefined when it is larger. An oversized body is
|
|
44
|
-
* read to its end without being kept: leaving the loop early would destroy the request, and the
|
|
45
|
-
* connection with it, before the refusal could be delivered.
|
|
46
|
-
*/
|
|
47
33
|
async function readBody(req, limit) {
|
|
48
34
|
let size = 0;
|
|
49
35
|
let chunks = [];
|
|
@@ -70,13 +56,25 @@ export function createGraphSessionCheck(subject, status = getAuthStatus, members
|
|
|
70
56
|
revoked = true;
|
|
71
57
|
throw new PaidMembershipRequiredError();
|
|
72
58
|
}
|
|
73
|
-
// A free account keeps its editor: the free allowance is enforced on save, not by revoking the session.
|
|
74
59
|
if (!access.paid && !access.unavailable && !access.subject) {
|
|
75
60
|
revoked = true;
|
|
76
61
|
throw new PaidMembershipRequiredError();
|
|
77
62
|
}
|
|
78
63
|
};
|
|
79
64
|
}
|
|
65
|
+
// One editor page load is about thirty requests, each of which checks the session. Callers that
|
|
66
|
+
// arrive together share one read, and an answer is reused for `ttlMs` (0 shares in-flight reads only).
|
|
67
|
+
export const EDITOR_MEMBERSHIP_TTL_MS = 30_000;
|
|
68
|
+
export function sharedRead(read, ttlMs, now = Date.now) {
|
|
69
|
+
let pending;
|
|
70
|
+
let held;
|
|
71
|
+
return () => {
|
|
72
|
+
if (held && now() - held.at < ttlMs)
|
|
73
|
+
return Promise.resolve(held.value);
|
|
74
|
+
pending ??= read().then(value => { held = { at: now(), value }; return value; }).finally(() => { pending = undefined; });
|
|
75
|
+
return pending;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
80
78
|
export async function requireGraphProviders(directory = configDirectory()) {
|
|
81
79
|
let value;
|
|
82
80
|
try {
|
|
@@ -95,11 +93,8 @@ export async function requireGraphProviders(directory = configDirectory()) {
|
|
|
95
93
|
catch {
|
|
96
94
|
throw new Error('Invalid provider configuration. Run `andorra` and open `/providers` to repair it.');
|
|
97
95
|
}
|
|
98
|
-
// Loaded through the configuration reader so saved API keys come back from the OS credential store;
|
|
99
|
-
// a store that cannot be read says so rather than passing for an invalid file.
|
|
100
96
|
return await loadConfig(directory);
|
|
101
97
|
}
|
|
102
|
-
/** Graph editing may be provider-free, but invalid config keeps actionable repair guidance. */
|
|
103
98
|
async function editorConfig(directory) {
|
|
104
99
|
try {
|
|
105
100
|
return await loadConfig(directory);
|
|
@@ -111,18 +106,17 @@ async function editorConfig(directory) {
|
|
|
111
106
|
export async function startGraphServer(directory = configDirectory(), checkMembership = readGraphMembership, options = {}) {
|
|
112
107
|
await editorConfig(directory);
|
|
113
108
|
const startup = await checkMembership();
|
|
114
|
-
// A caller supplying its own authorization check has no production account binding.
|
|
115
109
|
const account = checkMembership === readGraphMembership ? await getAuthStatus() : { signedIn: false, subject: undefined };
|
|
116
110
|
const graphDirectory = account.subject ? await graphStorageDirectory(directory, account.subject, true) : directory;
|
|
117
|
-
// A caller may bring its own store of drafts: a test has no signed-in account to bind one to.
|
|
118
111
|
const sync = options.sync ?? (account.subject ? new GraphSync(graphDirectory, account.subject) : undefined);
|
|
119
112
|
await sync?.start();
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
// The sign-in state is local and read on every request, so signing out or switching accounts
|
|
114
|
+
// ends the session at once; the account service's answer is a network call and is reused briefly.
|
|
115
|
+
const sessionMembership = sharedRead(() => getMembership(), EDITOR_MEMBERSHIP_TTL_MS);
|
|
116
|
+
const checkSession = checkMembership === readGraphMembership
|
|
117
|
+
? createGraphSessionCheck(account.subject, sharedRead(() => getAuthStatus(), 0), sessionMembership)
|
|
118
|
+
: checkMembership;
|
|
119
|
+
const readMembership = options.membership ?? (checkMembership === readGraphMembership ? sessionMembership : undefined);
|
|
126
120
|
const seeded = checkMembership === readGraphMembership ? startup : undefined;
|
|
127
121
|
let lastPaid = seeded && !seeded.unavailable ? seeded.paid : undefined;
|
|
128
122
|
const freeTier = async () => {
|
|
@@ -135,18 +129,13 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
135
129
|
};
|
|
136
130
|
await freeTier();
|
|
137
131
|
const token = randomBytes(32).toString('hex');
|
|
138
|
-
// The Graph Manager chat owns a child engine, so it exists only once a panel asks for it. Revisions
|
|
139
|
-
// are read from the folder this account's graphs are saved in, which is where the agent's saves land.
|
|
140
132
|
const createManagerChat = options.managerChat ?? ((home, _graphId) => new GraphManagerChat({
|
|
141
133
|
directory: home,
|
|
142
134
|
readRevision: id => readManagerGraphRevision(id, graphDirectory),
|
|
143
135
|
}));
|
|
144
|
-
// Each graph has a conversation of its own, so one graph's requests and edits never reach the
|
|
145
|
-
// agent working on another. A chat's engine stops on its own once nobody is listening to it.
|
|
146
136
|
const managers = new Map();
|
|
147
137
|
let closing = false;
|
|
148
138
|
const managerChat = (graph) => {
|
|
149
|
-
// A request that outlives close() must not start an engine nothing would stop.
|
|
150
139
|
if (closing)
|
|
151
140
|
throw new Error('The editor is closing.');
|
|
152
141
|
if (typeof graph !== 'string' || !MANAGER_GRAPH_ID.test(graph))
|
|
@@ -158,7 +147,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
158
147
|
}
|
|
159
148
|
return chat;
|
|
160
149
|
};
|
|
161
|
-
/** Ends each open Graph Manager stream, so closing the server never waits on one. */
|
|
162
150
|
const managerStreams = new Set();
|
|
163
151
|
let origin = '';
|
|
164
152
|
const assets = {
|
|
@@ -185,28 +173,17 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
185
173
|
'/library.css': ['library.css', 'text/css; charset=utf-8'],
|
|
186
174
|
'/tokens.css': ['tokens.css', 'text/css; charset=utf-8'],
|
|
187
175
|
'/theme.js': ['theme.js', 'text/javascript; charset=utf-8'],
|
|
188
|
-
// The editor renders the desktop client's face, so it serves the same font files from its own
|
|
189
|
-
// origin rather than falling back to the system's.
|
|
190
176
|
'/fonts/geist-sans-latin-400-normal.woff2': ['fonts/geist-sans-latin-400-normal.woff2', 'font/woff2'],
|
|
191
177
|
'/fonts/geist-sans-latin-500-normal.woff2': ['fonts/geist-sans-latin-500-normal.woff2', 'font/woff2'],
|
|
192
178
|
'/fonts/geist-mono-latin-400-normal.woff2': ['fonts/geist-mono-latin-400-normal.woff2', 'font/woff2'],
|
|
193
179
|
'/andorra-logo.png': ['andorra-logo.png', 'image/png'],
|
|
194
180
|
};
|
|
195
|
-
// The provider marks the model picker draws: the desktop's own glyphs, copied beside the editor
|
|
196
|
-
// by build-assets.mjs.
|
|
197
181
|
for (const logo of PROVIDER_GLYPHS)
|
|
198
182
|
assets[`/provider-glyphs/${logo}.png`] = [`provider-glyphs/${logo}.png`, 'image/png'];
|
|
199
183
|
const reply = (res, status, value) => {
|
|
200
184
|
res.writeHead(status, { 'Content-Type': 'application/json; charset=utf-8' });
|
|
201
185
|
res.end(JSON.stringify(value));
|
|
202
186
|
};
|
|
203
|
-
// The editor's provider registry payload. `baseUrl` is included deliberately: it is the one
|
|
204
|
-
// non-secret field that distinguishes a provider whose id, type, active model, and configured
|
|
205
|
-
// models are otherwise unchanged, and the client's applyProviderRegistry invalidates its
|
|
206
|
-
// per-provider model-discovery caches only when this payload differs — an endpoint swap must
|
|
207
|
-
// be visible to it, or the editor keeps serving the previous endpoint's catalog. `label` is
|
|
208
|
-
// derived from the whole list, so a second Codex account also reaches the editor as a change.
|
|
209
|
-
// Credentials (apiKey, apiKeyEnv) stay out.
|
|
210
187
|
const providerRegistryPayload = (providers) => providers.map(provider => ({ id: provider.id, model: provider.model, models: provider.models, type: provider.type, baseUrl: provider.baseUrl, label: providerLabel(provider, providers) }));
|
|
211
188
|
const liveEditorState = async () => {
|
|
212
189
|
const [{ pid: _pid, ...status }, config] = await Promise.all([readActivity(directory), editorConfig(directory)]);
|
|
@@ -220,16 +197,12 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
220
197
|
res.setHeader('Cache-Control', 'no-store');
|
|
221
198
|
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
222
199
|
res.setHeader('Referrer-Policy', 'no-referrer');
|
|
223
|
-
// The editor may be framed only by our packaged Tauri window (macOS custom protocol and
|
|
224
|
-
// Windows/Linux virtual host) or the fixed local Tauri dev server. Arbitrary websites remain
|
|
225
|
-
// unable to frame the token-gated editing UI; origin/host checks still protect every request.
|
|
226
200
|
res.setHeader('Content-Security-Policy', "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self'; frame-ancestors tauri://localhost http://tauri.localhost http://127.0.0.1:7347; base-uri 'none'; form-action 'none'");
|
|
227
201
|
try {
|
|
228
202
|
if (req.headers.host !== new URL(origin).host || (req.headers.origin && req.headers.origin !== origin)) {
|
|
229
203
|
reply(res, 403, { error: 'Untrusted origin' });
|
|
230
204
|
return;
|
|
231
205
|
}
|
|
232
|
-
// Re-check even after launch: logout or removal from the paid group revokes this editor session.
|
|
233
206
|
if (sync?.accessDenied)
|
|
234
207
|
throw new PaidMembershipRequiredError();
|
|
235
208
|
await checkSession();
|
|
@@ -237,8 +210,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
237
210
|
if (path.startsWith('/api/')) {
|
|
238
211
|
const expected = Buffer.from(`Bearer ${token}`);
|
|
239
212
|
const authorized = (value) => { const supplied = Buffer.from(value); return supplied.length === expected.length && timingSafeEqual(supplied, expected); };
|
|
240
|
-
// EventSource cannot send an Authorization header, so the two event streams alone also
|
|
241
|
-
// accept the session token in the query string.
|
|
242
213
|
const streamQuery = path === '/api/activity/stream' || path === '/api/manager/stream' ? `Bearer ${new URL(req.url, origin).searchParams.get('token') ?? ''}` : undefined;
|
|
243
214
|
if (!authorized(req.headers.authorization ?? '') && !(streamQuery !== undefined && authorized(streamQuery))) {
|
|
244
215
|
reply(res, 401, { error: 'Reopen the editor using andorra graph.' });
|
|
@@ -264,10 +235,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
264
235
|
return;
|
|
265
236
|
inFlight = true;
|
|
266
237
|
try {
|
|
267
|
-
// Re-check even mid-stream: logout or a membership downgrade revokes an open feed the
|
|
268
|
-
// same way it revokes any other editor request. Checked every 5 s rather than every
|
|
269
|
-
// tick to match the page's own polling cadence; a definitive revocation closes the
|
|
270
|
-
// stream, and the client clears its state once reconnect attempts have failed.
|
|
271
238
|
if (ticks > 0 && ticks % 5 === 0) {
|
|
272
239
|
try {
|
|
273
240
|
if (sync?.accessDenied)
|
|
@@ -279,7 +246,7 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
279
246
|
try {
|
|
280
247
|
res.end();
|
|
281
248
|
}
|
|
282
|
-
catch {
|
|
249
|
+
catch { }
|
|
283
250
|
return;
|
|
284
251
|
}
|
|
285
252
|
}
|
|
@@ -298,7 +265,7 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
298
265
|
res.write(': ping\n\n');
|
|
299
266
|
ticks++;
|
|
300
267
|
}
|
|
301
|
-
catch {
|
|
268
|
+
catch { }
|
|
302
269
|
}
|
|
303
270
|
finally {
|
|
304
271
|
inFlight = false;
|
|
@@ -325,9 +292,8 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
325
292
|
const end = () => { finish(); try {
|
|
326
293
|
res.end();
|
|
327
294
|
}
|
|
328
|
-
catch {
|
|
295
|
+
catch { } };
|
|
329
296
|
const timer = setInterval(() => {
|
|
330
|
-
// Logout or a membership downgrade revokes an open stream like any other editor request.
|
|
331
297
|
void (async () => { if (sync?.accessDenied)
|
|
332
298
|
throw new PaidMembershipRequiredError(); await checkSession(); })()
|
|
333
299
|
.then(() => { if (open && !res.destroyed)
|
|
@@ -336,7 +302,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
336
302
|
managerStreams.add(end);
|
|
337
303
|
req.on('close', finish);
|
|
338
304
|
res.on('close', finish);
|
|
339
|
-
// The chat hands over the conversation so far as a snapshot before anything else.
|
|
340
305
|
unsubscribe = chat.subscribe(event => { if (open && !res.destroyed)
|
|
341
306
|
res.write(`data: ${JSON.stringify(event)}\n\n`); });
|
|
342
307
|
if (!open)
|
|
@@ -345,8 +310,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
345
310
|
}
|
|
346
311
|
if (req.method === 'POST' && path.startsWith('/api/manager/')) {
|
|
347
312
|
const action = path.slice('/api/manager/'.length);
|
|
348
|
-
// The chat reports what goes wrong on the engine's side as an `error` event on the stream,
|
|
349
|
-
// and a message can take as long as an engine start, so no route waits for its outcome.
|
|
350
313
|
const accepted = (work) => { void work.catch(() => { }); reply(res, 200, { ok: true }); };
|
|
351
314
|
if (action === 'cancel' || action === 'reset' || action === 'message' || action === 'approve' || action === 'answer') {
|
|
352
315
|
if (!req.headers['content-type']?.startsWith('application/json')) {
|
|
@@ -360,7 +323,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
360
323
|
}
|
|
361
324
|
const parsed = JSON.parse(body.toString('utf8'));
|
|
362
325
|
const value = parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
|
|
363
|
-
// Every request names the graph whose conversation it belongs to; a message names it by its canvas.
|
|
364
326
|
const graphId = action === 'message' ? value.graph?.id : value.graphId;
|
|
365
327
|
if (action === 'cancel') {
|
|
366
328
|
accepted(managerChat(graphId).cancel());
|
|
@@ -402,7 +364,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
402
364
|
reply(res, 200, sync?.status ?? { state: 'pending', detail: 'Saved locally' });
|
|
403
365
|
return;
|
|
404
366
|
}
|
|
405
|
-
// The prompt fields' `/` picker, and the names they warn about: this machine's skills.
|
|
406
367
|
if (req.method === 'GET' && path === '/api/skills') {
|
|
407
368
|
reply(res, 200, await editorSkillCatalog(config, AbortSignal.timeout(MODEL_LISTING_TIMEOUT_MS), directory));
|
|
408
369
|
return;
|
|
@@ -432,9 +393,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
432
393
|
const provider = config.providers.find(item => item.id === (params.get('provider') || config.provider));
|
|
433
394
|
if (!provider)
|
|
434
395
|
throw new Error('Choose a configured model profile.');
|
|
435
|
-
// The saved configuration knows only the models the user typed; the endpoint knows every
|
|
436
|
-
// model it serves, which is what lets the studio offer the whole catalog, not just the
|
|
437
|
-
// active model.
|
|
438
396
|
const discovered = await discoverModelMetadata(provider, AbortSignal.timeout(MODEL_LISTING_TIMEOUT_MS));
|
|
439
397
|
reply(res, 200, { provider: provider.id, models: [...new Set(discovered.map(item => item.id).filter(Boolean))] });
|
|
440
398
|
return;
|
|
@@ -459,20 +417,11 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
459
417
|
const model = typeof value.model === 'string' ? value.model.trim() : '';
|
|
460
418
|
if (!model || model.length > 500)
|
|
461
419
|
throw new Error('Model name must be within 500 characters.');
|
|
462
|
-
// Selecting a suggested model records it with the provider, mirroring what /model does on
|
|
463
|
-
// selection. Execution validates a node's explicit model against the provider's configured
|
|
464
|
-
// models (graph-provider-portability), so a discovered pick has to reach the same list the
|
|
465
|
-
// endpoint offered it from, or the saved graph would refuse to run. The change is applied
|
|
466
|
-
// under the configuration lock against the file as it is now, not the snapshot read when
|
|
467
|
-
// the request opened: two overlapping recordings merge instead of the later write dropping
|
|
468
|
-
// the earlier selection, and provider edits made in between survive.
|
|
469
420
|
const saved = await changeConfigFile(directory, current => {
|
|
470
421
|
const target = current.providers.find(item => item.id === requested);
|
|
471
422
|
if (!target)
|
|
472
423
|
throw new Error('Choose a configured model profile.');
|
|
473
424
|
recordProviderModel(target, model);
|
|
474
|
-
// validateConfig rejects an external-subagent pair whose provider has an explicit model
|
|
475
|
-
// list that omits the pair's model, so materializing the list must carry it along.
|
|
476
425
|
const pair = current.externalSubagent;
|
|
477
426
|
if (pair && pair.provider === target.id && target.models && !target.models.includes(pair.model))
|
|
478
427
|
target.models.push(pair.model);
|
|
@@ -489,7 +438,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
489
438
|
graphMigrationErrors.push({ id, name: id, error: error instanceof Error ? error.message : 'Graph load failed' });
|
|
490
439
|
});
|
|
491
440
|
const free = await freeTier();
|
|
492
|
-
// Deleted graphs stay out of the editor; restoring one goes through the graph MCP server.
|
|
493
441
|
for (const saved of withoutDeletedGraphs(savedGraphs)) {
|
|
494
442
|
try {
|
|
495
443
|
graphs.push(migrateGraphForEditor(saved, { addOrchestrator: !free }));
|
|
@@ -501,7 +449,7 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
501
449
|
const plan = free
|
|
502
450
|
? { paid: false, customGraphLimit: FREE_CUSTOM_GRAPH_LIMIT, nodeLimit: FREE_GRAPH_NODE_LIMIT, ...await readGraphQuota(graphDirectory, savedGraphs) }
|
|
503
451
|
: { paid: true };
|
|
504
|
-
reply(res, 200, { plan, graphs, graphMigrationErrors, definitions: await listAgentDefinitions(directory), defaultProvider: config.provider, providers: providerRegistryPayload(config.providers), tools: [...createTools().filter(tool => tool.providerVisible !== false).map(tool => tool.name), 'git_read', 'read_artifact', 'write_artifact', 'repo_explore', 'memory_search', 'read_skill_resource', 'browser.panel', 'browser.incognito'], runtime: { spawnAvailable: true, rawShellForSubagents: false, browser: true, deployment: false } });
|
|
452
|
+
reply(res, 200, { plan, graphs, graphMigrationErrors, definitions: await listAgentDefinitions(directory), defaultProvider: config.provider, providers: providerRegistryPayload(config.providers), tools: [...createTools().filter(tool => tool.providerVisible !== false).map(tool => tool.name), 'git_read', 'read_artifact', 'write_artifact', 'repo_explore', 'memory_search', 'read_skill_resource', 'browser.panel', 'browser.incognito', 'browser.extensions'], runtime: { spawnAvailable: true, rawShellForSubagents: false, browser: true, deployment: false } });
|
|
505
453
|
return;
|
|
506
454
|
}
|
|
507
455
|
if (req.method === 'GET' && /^\/api\/graphs\/[\w-]+\/revisions$/.test(path)) {
|
|
@@ -512,11 +460,23 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
512
460
|
if (req.method === 'GET' && /^\/api\/graphs\/[\w-]+\/revisions\/[1-9]\d*$/.test(path)) {
|
|
513
461
|
const segments = path.split('/');
|
|
514
462
|
const graph = await loadGraph(segments[3], Number(segments[5]), graphDirectory);
|
|
515
|
-
// Immutable snapshots remain untouched on disk; return an editor-ready
|
|
516
|
-
// copy so historical restore does not resave an obsolete schema.
|
|
517
463
|
reply(res, 200, migrateGraphForEditor(graph, { addOrchestrator: !await freeTier() }));
|
|
518
464
|
return;
|
|
519
465
|
}
|
|
466
|
+
if (req.method === 'PUT' && path === '/api/graph-order') {
|
|
467
|
+
if (!req.headers['content-type']?.startsWith('application/json')) {
|
|
468
|
+
reply(res, 415, { error: 'Expected application/json' });
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
const body = await readBody(req, GRAPH_BODY_LIMIT);
|
|
472
|
+
if (!body) {
|
|
473
|
+
reply(res, 413, { error: 'Request exceeds 512 KiB' });
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
const value = JSON.parse(body.toString('utf8'));
|
|
477
|
+
reply(res, 200, { order: await saveGraphOrder(value?.order, graphDirectory) });
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
520
480
|
if (req.method === 'GET' && path === '/api/runs') {
|
|
521
481
|
const id = new URL(req.url, origin).searchParams.get('graph') || '';
|
|
522
482
|
if (!account.subject && checkMembership === readGraphMembership)
|
|
@@ -538,8 +498,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
538
498
|
}
|
|
539
499
|
if (req.method === 'DELETE' && /^\/api\/graphs\/[\w-]+$/.test(path)) {
|
|
540
500
|
const id = path.split('/').at(-1);
|
|
541
|
-
// The preset is bundled with the CLI: it has no storage to remove, and hiding it would
|
|
542
|
-
// only last until the next launch.
|
|
543
501
|
if (id === 'default') {
|
|
544
502
|
reply(res, 400, { error: 'The bundled default graph cannot be deleted.' });
|
|
545
503
|
return;
|
|
@@ -548,8 +506,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
548
506
|
reply(res, 400, { error: reservedGraphId(id).message });
|
|
549
507
|
return;
|
|
550
508
|
}
|
|
551
|
-
// forgetGraph schedules the post-delete sync pass itself; scheduling another here
|
|
552
|
-
// would bump the pass generation and traverse the whole history twice per delete.
|
|
553
509
|
await deleteGraphWithTombstone(id, graphDirectory, directory, account.subject, sync);
|
|
554
510
|
reply(res, 200, { deleted: id });
|
|
555
511
|
return;
|
|
@@ -575,8 +531,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
575
531
|
return;
|
|
576
532
|
}
|
|
577
533
|
const value = JSON.parse(body.toString('utf8'));
|
|
578
|
-
// The deletion marker is set only through the graph MCP server's delete tool, which confirms
|
|
579
|
-
// with the person and checks automations first; an ordinary save may not carry it.
|
|
580
534
|
if (path === '/api/graphs' && value && typeof value === 'object' && value.metadata && typeof value.metadata === 'object' && Object.hasOwn(value.metadata, 'deletedAt')) {
|
|
581
535
|
reply(res, 400, { error: 'metadata.deletedAt is reserved for deleting a graph through the graph MCP server.' });
|
|
582
536
|
return;
|
|
@@ -596,7 +550,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
596
550
|
return;
|
|
597
551
|
}
|
|
598
552
|
if (path === '/api/definitions/import') {
|
|
599
|
-
// The client mints the new id, so a retry after a lost response confirms its earlier write.
|
|
600
553
|
if (!value || typeof value !== 'object' || typeof value.id !== 'string')
|
|
601
554
|
throw new Error('Import needs a new Agent id and the shared Agent file.');
|
|
602
555
|
reply(res, 200, await importAgentDefinition(value.file, value.id, { providers: config.providers, defaultProvider: config.provider, spawnAvailable: true }, directory));
|
|
@@ -623,7 +576,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
623
576
|
reply(res, 200, { graph });
|
|
624
577
|
return;
|
|
625
578
|
}
|
|
626
|
-
// Stamping can add profile entries after the streamed body already passed the limit.
|
|
627
579
|
const stamped = stampGraphProviderProfiles(graph, config);
|
|
628
580
|
if (Buffer.byteLength(JSON.stringify(stamped)) > GRAPH_BODY_LIMIT) {
|
|
629
581
|
reply(res, 413, { error: 'Graph exceeds 512 KiB' });
|
|
@@ -631,8 +583,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
631
583
|
}
|
|
632
584
|
const expected = graph.revision === 0 ? null : graph.revision;
|
|
633
585
|
const saved = await freeTier() ? await saveFreeTierGraph(stamped, expected, graphDirectory) : await saveGraph(stamped, expected, graphDirectory);
|
|
634
|
-
// Do not claim a successful re-creation while its tombstone still excludes cloud
|
|
635
|
-
// uploads and drafts. reviveGraph retries account-lock contention and reports errors.
|
|
636
586
|
await sync?.reviveGraph(saved.id);
|
|
637
587
|
void sync?.sync();
|
|
638
588
|
reply(res, 200, saved);
|
|
@@ -651,7 +601,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
651
601
|
res.end(content);
|
|
652
602
|
}
|
|
653
603
|
catch (error) {
|
|
654
|
-
// A free-tier refusal is an answer to this request, not a revoked session, so it is not a 403.
|
|
655
604
|
if (error instanceof FreeTierLimitError) {
|
|
656
605
|
reply(res, 422, { error: error.message, code: error.code });
|
|
657
606
|
return;
|
|
@@ -670,7 +619,6 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
670
619
|
closing = true;
|
|
671
620
|
for (const end of [...managerStreams])
|
|
672
621
|
end();
|
|
673
|
-
// The server goes down even when the chat's engine does not stop cleanly.
|
|
674
622
|
try {
|
|
675
623
|
await Promise.all([...managers.values()].map(chat => chat.close()));
|
|
676
624
|
}
|
|
@@ -680,25 +628,15 @@ export async function startGraphServer(directory = configDirectory(), checkMembe
|
|
|
680
628
|
}
|
|
681
629
|
} };
|
|
682
630
|
}
|
|
683
|
-
/**
|
|
684
|
-
* Reset the configured selection only after the deletion succeeds. Otherwise a graph-lock
|
|
685
|
-
* timeout would change the next CLI launch even though the graph still exists. A crash
|
|
686
|
-
* between removal and reset is handled by the CLI's missing-selection fallback.
|
|
687
|
-
*/
|
|
688
631
|
export async function deleteGraphWithTombstone(id, graphDirectory, directory, subject, sync) {
|
|
689
|
-
// The signed-in path never reaches deleteGraph, so the built-in graph is refused here for both.
|
|
690
632
|
if (id === GRAPH_MANAGER_GRAPH_ID)
|
|
691
633
|
throw reservedGraphId(id);
|
|
692
|
-
// An automation would fail at its next run; the user decides what it runs instead. The graph
|
|
693
|
-
// MCP server's delete tool applies the same check, so the editor cannot bypass it.
|
|
694
634
|
const users = (await new AutomationStore(directory).list()).filter(job => job.execution?.graph === id);
|
|
695
635
|
if (users.length)
|
|
696
636
|
throw new Error('Graph ' + id + ' is run by automation'
|
|
697
637
|
+ (users.length === 1 ? ' ' : 's ') + users.map(job => '"' + job.name + '"').join(', ')
|
|
698
638
|
+ '. Change or remove ' + (users.length === 1 ? 'it' : 'them') + ' first.');
|
|
699
639
|
if (sync) {
|
|
700
|
-
// forgetGraph already detaches the old folder under the graph lock. A second removal
|
|
701
|
-
// here could erase a new graph that was saved under the same id after that detach.
|
|
702
640
|
await sync.forgetGraph(id);
|
|
703
641
|
}
|
|
704
642
|
else {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Graph } from './graphs.js';
|
|
2
|
-
/** All Studio previews are read-only. No graph runner, shell, or action tools are invoked here. */
|
|
3
2
|
export interface RouteChoice {
|
|
4
3
|
outcome?: string;
|
|
5
4
|
output?: Record<string, unknown>;
|
|
@@ -18,9 +17,7 @@ export interface RoutePreview {
|
|
|
18
17
|
completed: string[];
|
|
19
18
|
truncated: boolean;
|
|
20
19
|
}
|
|
21
|
-
/** A conservative connectivity walkthrough, not a substitute for a real Agent/Join/Loop run. */
|
|
22
20
|
export declare function previewGraphRoutes(graph: Graph, choices?: Record<string, RouteChoice>): RoutePreview;
|
|
23
|
-
/** Saved revisions are immutable; restoring one means editing it as a new revision. */
|
|
24
21
|
export declare function graphRevisionHistory(id: string, directory: string): Promise<{
|
|
25
22
|
revision: number;
|
|
26
23
|
name: string;
|
|
@@ -28,7 +25,6 @@ export declare function graphRevisionHistory(id: string, directory: string): Pro
|
|
|
28
25
|
edgeCount: number;
|
|
29
26
|
updatedAt: string | null;
|
|
30
27
|
}[]>;
|
|
31
|
-
/** Returns only recent, same-graph run summaries. A run's events are fetched separately. */
|
|
32
28
|
export declare function studioRuns(directory: string, graphId: string, accountSubject?: string): Promise<{
|
|
33
29
|
id: string;
|
|
34
30
|
status: string;
|
|
@@ -36,7 +32,6 @@ export declare function studioRuns(directory: string, graphId: string, accountSu
|
|
|
36
32
|
graphRevision: number | null;
|
|
37
33
|
toolCalls: number | null;
|
|
38
34
|
}[]>;
|
|
39
|
-
/** Read a bounded tail: large coding runs must not make the local editor unresponsive. */
|
|
40
35
|
export declare function studioRunEvents(directory: string, runId: string, graphId: string, accountSubject?: string): Promise<{
|
|
41
36
|
status: string;
|
|
42
37
|
truncated: boolean;
|