@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,12 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A refusal that tells the model which Read must happen before the same call can succeed.
|
|
3
|
-
*
|
|
4
|
-
* This is not a call that cannot work: the model is expected to Read the file and retry the
|
|
5
|
-
* byte-identical call, so the repeated-failure guard must not count it like a broken tool.
|
|
6
|
-
*/
|
|
7
1
|
export declare class FileReadRequiredError extends Error {
|
|
8
2
|
readonly refusal: "fresh-read";
|
|
9
3
|
constructor(message: string);
|
|
10
4
|
}
|
|
11
|
-
/** The actionable refusal classes the engine separates from real tool failures. */
|
|
12
5
|
export type ToolRefusal = FileReadRequiredError['refusal'];
|
|
6
|
+
/**
|
|
7
|
+
* A command that ran to the end and returned a non-zero exit code. The call still counts as failed,
|
|
8
|
+
* but its output is the command's own (a failing test, grep without matches, diff with differences),
|
|
9
|
+
* so it is shown to the model as it is and not labelled as a tool error.
|
|
10
|
+
*/
|
|
11
|
+
export declare class CommandExitError extends Error {
|
|
12
|
+
readonly exitCode: number;
|
|
13
|
+
constructor(message: string, exitCode: number);
|
|
14
|
+
}
|
package/dist/src/tool-errors.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A refusal that tells the model which Read must happen before the same call can succeed.
|
|
3
|
-
*
|
|
4
|
-
* This is not a call that cannot work: the model is expected to Read the file and retry the
|
|
5
|
-
* byte-identical call, so the repeated-failure guard must not count it like a broken tool.
|
|
6
|
-
*/
|
|
7
1
|
export class FileReadRequiredError extends Error {
|
|
8
2
|
refusal = 'fresh-read';
|
|
9
3
|
constructor(message) {
|
|
@@ -11,3 +5,16 @@ export class FileReadRequiredError extends Error {
|
|
|
11
5
|
this.name = 'FileReadRequiredError';
|
|
12
6
|
}
|
|
13
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* A command that ran to the end and returned a non-zero exit code. The call still counts as failed,
|
|
10
|
+
* but its output is the command's own (a failing test, grep without matches, diff with differences),
|
|
11
|
+
* so it is shown to the model as it is and not labelled as a tool error.
|
|
12
|
+
*/
|
|
13
|
+
export class CommandExitError extends Error {
|
|
14
|
+
exitCode;
|
|
15
|
+
constructor(message, exitCode) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.exitCode = exitCode;
|
|
18
|
+
this.name = 'CommandExitError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import type { ToolCall } from './types.js';
|
|
2
2
|
import type { ToolRefusal } from './tool-errors.js';
|
|
3
|
-
/**
|
|
4
|
-
* Stops unchanged retries while allowing another attempt after a workspace repair, and counts a
|
|
5
|
-
* Read-gate refusal as guidance rather than as a broken call.
|
|
6
|
-
*
|
|
7
|
-
* Real failures keep the three-strike rule: a command that fails the same way three times with no
|
|
8
|
-
* successful file repair between them is a loop. A refusal that names the Read still owed for a
|
|
9
|
-
* file is different, because the model is expected to retry the identical call after that Read:
|
|
10
|
-
* counts are kept per call, a successful Read of that file clears them, and only a model that
|
|
11
|
-
* keeps retrying without reading reaches the ceiling.
|
|
12
|
-
*/
|
|
13
3
|
export declare class ToolFailureTracker {
|
|
14
4
|
private readonly failures;
|
|
15
5
|
private readonly guidance;
|
|
16
|
-
|
|
6
|
+
private readonly countedThisResponse;
|
|
7
|
+
private response;
|
|
8
|
+
record(call: ToolCall, failed: boolean, executionSucceeded?: boolean, refusal?: ToolRefusal, response?: object): boolean;
|
|
17
9
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { canonicalToolName } from './tool-names.js';
|
|
2
|
-
/**
|
|
3
|
-
* How many times one call may be refused for a missing Read before the guard calls it a loop.
|
|
4
|
-
*
|
|
5
|
-
* A staged read of a long file is expected to take several refusals and several Reads; a model
|
|
6
|
-
* that never reads is what this ceiling stops.
|
|
7
|
-
*/
|
|
8
2
|
const GUIDANCE_CEILING = 8;
|
|
9
|
-
/** The file a call names, so a Read can answer the refusal for that file alone. */
|
|
10
3
|
function argumentPath(call) {
|
|
11
4
|
let args;
|
|
12
5
|
try {
|
|
@@ -23,42 +16,41 @@ function argumentPath(call) {
|
|
|
23
16
|
const unified = value.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
24
17
|
return process.platform === 'win32' ? unified.toLowerCase() : unified;
|
|
25
18
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Stops unchanged retries while allowing another attempt after a workspace repair, and counts a
|
|
28
|
-
* Read-gate refusal as guidance rather than as a broken call.
|
|
29
|
-
*
|
|
30
|
-
* Real failures keep the three-strike rule: a command that fails the same way three times with no
|
|
31
|
-
* successful file repair between them is a loop. A refusal that names the Read still owed for a
|
|
32
|
-
* file is different, because the model is expected to retry the identical call after that Read:
|
|
33
|
-
* counts are kept per call, a successful Read of that file clears them, and only a model that
|
|
34
|
-
* keeps retrying without reading reaches the ceiling.
|
|
35
|
-
*/
|
|
36
19
|
export class ToolFailureTracker {
|
|
37
20
|
failures = new Map();
|
|
38
21
|
guidance = new Map();
|
|
39
|
-
|
|
22
|
+
countedThisResponse = new Set();
|
|
23
|
+
response;
|
|
24
|
+
record(call, failed, executionSucceeded = !failed, refusal, response) {
|
|
40
25
|
const signature = `${call.name}:${call.arguments}`;
|
|
26
|
+
if (response === undefined || response !== this.response)
|
|
27
|
+
this.countedThisResponse.clear();
|
|
28
|
+
this.response = response;
|
|
41
29
|
if (refusal) {
|
|
42
30
|
const path = argumentPath(call);
|
|
43
|
-
const
|
|
31
|
+
const repeat = this.countedThisResponse.has(signature);
|
|
32
|
+
if (response !== undefined)
|
|
33
|
+
this.countedThisResponse.add(signature);
|
|
34
|
+
const count = (this.guidance.get(signature)?.count ?? 0) + (repeat ? 0 : 1);
|
|
44
35
|
this.guidance.set(signature, { ...(path ? { path } : {}), count });
|
|
45
36
|
return count >= GUIDANCE_CEILING;
|
|
46
37
|
}
|
|
47
|
-
// Guidance counts answer the call that was refused; any other outcome for that call ends them.
|
|
48
38
|
this.guidance.delete(signature);
|
|
49
39
|
const canonical = canonicalToolName(call.name);
|
|
50
|
-
// Reads, shell diagnostics, metadata writes and failed/blocked repairs are not
|
|
51
|
-
// evidence that the files used by a failing command have been repaired.
|
|
52
40
|
if (executionSucceeded && !failed && ['Write', 'Edit', 'apply_patch'].includes(canonical)) {
|
|
53
41
|
this.failures.clear();
|
|
54
42
|
this.guidance.clear();
|
|
43
|
+
this.countedThisResponse.clear();
|
|
55
44
|
}
|
|
56
|
-
if (failed)
|
|
57
|
-
this.failures.set(signature, (this.failures.get(signature) ?? 0) + 1);
|
|
58
|
-
else
|
|
45
|
+
if (!failed) {
|
|
59
46
|
this.failures.delete(signature);
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
this.countedThisResponse.delete(signature);
|
|
48
|
+
}
|
|
49
|
+
else if (!this.countedThisResponse.has(signature)) {
|
|
50
|
+
if (response !== undefined)
|
|
51
|
+
this.countedThisResponse.add(signature);
|
|
52
|
+
this.failures.set(signature, (this.failures.get(signature) ?? 0) + 1);
|
|
53
|
+
}
|
|
62
54
|
if (!failed && canonical === 'Read') {
|
|
63
55
|
const path = argumentPath(call);
|
|
64
56
|
if (path)
|
package/dist/src/tool-names.d.ts
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical provider-visible coding tools.
|
|
3
|
-
*
|
|
4
|
-
* Models see one canonical surface. Historical Pi/Andorra spellings remain
|
|
5
|
-
* configuration aliases so existing saved graph revisions keep working
|
|
6
|
-
* without advertising duplicate schemas on every model request.
|
|
7
|
-
*/
|
|
8
1
|
export declare const CANONICAL_CODING_TOOLS: readonly ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "PowerShell"];
|
|
9
2
|
export type CanonicalCodingTool = typeof CANONICAL_CODING_TOOLS[number];
|
|
10
3
|
export declare function canonicalCodingToolName(name: string): CanonicalCodingTool | undefined;
|
|
11
4
|
export declare function canonicalToolName(name: string): string;
|
|
12
5
|
export declare function toolNameMatches(configured: string, actual: string): boolean;
|
|
13
6
|
export declare function canonicalizeToolList(names: readonly string[] | undefined): string[] | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Rewrites the tool names one provider request sees and restores Andorra's names on everything
|
|
16
|
-
* that comes back. Canonical Andorra tool names use dots (`qa.terminal`, `browser.panel`), while
|
|
17
|
-
* strict providers validate `function.name` against `^[a-zA-Z0-9_-]+$` and reject the whole
|
|
18
|
-
* request with an HTTP 400. The provider-side names are a pure transport encoding: journals,
|
|
19
|
-
* the executor and the desktop keep the canonical spellings.
|
|
20
|
-
*/
|
|
21
7
|
export interface ProviderToolNameCodec {
|
|
22
8
|
encode(name: string): string;
|
|
23
9
|
decode(name: string): string;
|
|
24
10
|
}
|
|
25
|
-
/** Encode a request's tool list for the provider and pair it with the matching name codec. */
|
|
26
11
|
export declare function encodeProviderToolNames<T extends {
|
|
27
12
|
name: string;
|
|
28
13
|
}>(tools: readonly T[]): {
|
|
@@ -30,5 +15,4 @@ export declare function encodeProviderToolNames<T extends {
|
|
|
30
15
|
codec: ProviderToolNameCodec;
|
|
31
16
|
};
|
|
32
17
|
export declare const LEGACY_CODING_TOOL_NAMES: readonly string[];
|
|
33
|
-
/** Translate historical Pi/Andorra tool arguments into the canonical coding-tool contract. */
|
|
34
18
|
export declare function adaptLegacyCodingToolArguments(name: string, args: Record<string, unknown>): Record<string, unknown>;
|
package/dist/src/tool-names.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical provider-visible coding tools.
|
|
3
|
-
*
|
|
4
|
-
* Models see one canonical surface. Historical Pi/Andorra spellings remain
|
|
5
|
-
* configuration aliases so existing saved graph revisions keep working
|
|
6
|
-
* without advertising duplicate schemas on every model request.
|
|
7
|
-
*/
|
|
8
1
|
export const CANONICAL_CODING_TOOLS = [
|
|
9
2
|
'Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'PowerShell',
|
|
10
3
|
];
|
|
@@ -32,9 +25,7 @@ export function canonicalizeToolList(names) {
|
|
|
32
25
|
return undefined;
|
|
33
26
|
return [...new Set(names.map(canonicalToolName))];
|
|
34
27
|
}
|
|
35
|
-
/** Characters provider tool-name validators (OpenAI-compatible endpoints, Messages API) reject. */
|
|
36
28
|
const UNSAFE_TOOL_NAME_CHARS = /[^a-zA-Z0-9_-]/g;
|
|
37
|
-
/** Encode a request's tool list for the provider and pair it with the matching name codec. */
|
|
38
29
|
export function encodeProviderToolNames(tools) {
|
|
39
30
|
const byEncoded = new Map();
|
|
40
31
|
const byOriginal = new Map();
|
|
@@ -51,8 +42,6 @@ export function encodeProviderToolNames(tools) {
|
|
|
51
42
|
return {
|
|
52
43
|
tools: list,
|
|
53
44
|
codec: {
|
|
54
|
-
// History can hold calls for tools this request no longer advertises; those still must
|
|
55
|
-
// not carry rejected characters, even though their response aliases cannot be decoded.
|
|
56
45
|
encode: name => byOriginal.get(name) ?? sanitized(name),
|
|
57
46
|
decode: name => byEncoded.get(name) ?? name,
|
|
58
47
|
},
|
|
@@ -62,7 +51,6 @@ export const LEGACY_CODING_TOOL_NAMES = Object.freeze(Object.keys(ALIASES).filte
|
|
|
62
51
|
function escapeRegexLiteral(value) {
|
|
63
52
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
64
53
|
}
|
|
65
|
-
/** Translate historical Pi/Andorra tool arguments into the canonical coding-tool contract. */
|
|
66
54
|
export function adaptLegacyCodingToolArguments(name, args) {
|
|
67
55
|
const canonical = canonicalCodingToolName(name);
|
|
68
56
|
if (!canonical || name === canonical)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tool } from './types.js';
|
|
2
|
+
export declare const TOOL_PROFILES: readonly ["default", "coding"];
|
|
3
|
+
export type ToolProfile = typeof TOOL_PROFILES[number];
|
|
4
|
+
export declare function isToolProfile(value: unknown): value is ToolProfile;
|
|
5
|
+
/** Keeps the tools the profile names. A hidden compatibility alias stays when the tool it stands for stays. */
|
|
6
|
+
export declare function applyToolProfile<T extends Tool>(tools: readonly T[], profile: ToolProfile | undefined): T[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { canonicalToolName } from './tool-names.js';
|
|
2
|
+
export const TOOL_PROFILES = ['default', 'coding'];
|
|
3
|
+
export function isToolProfile(value) {
|
|
4
|
+
return typeof value === 'string' && TOOL_PROFILES.includes(value);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What a headless coding run can use: files, search, the shell, read-only Git, CodeGraph when it is
|
|
8
|
+
* on, the plan, completion, artifacts and skills. Everything else (browsers, timers, automations,
|
|
9
|
+
* graphs, pull requests, project memory, web search, plan presentation, delegation, MCP tools) is left out.
|
|
10
|
+
*/
|
|
11
|
+
const CODING_TOOLS = new Set([
|
|
12
|
+
'Read', 'Write', 'Edit', 'Glob', 'Grep', 'Bash', 'PowerShell', 'PowerShellFast', 'NativeExec', 'AsyncProcess',
|
|
13
|
+
'git_read', 'repo_explore',
|
|
14
|
+
'update_todos', 'prepare_finish', 'complete_agent', 'restore_tools', 'expand_tool_output',
|
|
15
|
+
'read_artifact', 'write_artifact',
|
|
16
|
+
'Skill', 'read_skill_resource', 'load_project_skill',
|
|
17
|
+
]);
|
|
18
|
+
/** Keeps the tools the profile names. A hidden compatibility alias stays when the tool it stands for stays. */
|
|
19
|
+
export function applyToolProfile(tools, profile) {
|
|
20
|
+
if (!profile || profile === 'default')
|
|
21
|
+
return [...tools];
|
|
22
|
+
return tools.filter(tool => CODING_TOOLS.has(tool.name) || CODING_TOOLS.has(canonicalToolName(tool.name)));
|
|
23
|
+
}
|
|
@@ -5,11 +5,8 @@ export interface ToolResultFilterInput {
|
|
|
5
5
|
args?: Record<string, unknown>;
|
|
6
6
|
output: string;
|
|
7
7
|
isError: boolean;
|
|
8
|
-
/** Outputs at or under this many characters are left alone. */
|
|
9
8
|
thresholdChars: number;
|
|
10
|
-
/** Upper bound on the filtered result. Default 8000. */
|
|
11
9
|
maxKeptChars?: number;
|
|
12
|
-
/** The reference the complete original is stored under; named in the filtered result. */
|
|
13
10
|
reference?: string;
|
|
14
11
|
}
|
|
15
12
|
export interface ToolResultFilterResult {
|
|
@@ -21,20 +18,10 @@ export interface ToolResultFilterResult {
|
|
|
21
18
|
keptChars: number;
|
|
22
19
|
originalLines: number;
|
|
23
20
|
omittedLines: number;
|
|
24
|
-
/** Parsed facts, all counts; never free text from the output. */
|
|
25
21
|
facts: Record<string, number>;
|
|
26
22
|
}
|
|
27
|
-
/** Which family of output a tool is expected to produce, or undefined when it must not be filtered. */
|
|
28
23
|
export declare function toolResultFilterCandidate(toolName: string, args: Record<string, unknown> | undefined): 'shell' | 'search' | 'listing' | undefined;
|
|
29
|
-
/** Parse and reduce one tool result. The original is never modified; the caller stores it. */
|
|
30
24
|
export declare function filterToolResult(input: ToolResultFilterInput): ToolResultFilterResult;
|
|
31
|
-
/**
|
|
32
|
-
* The runtime-owned store of complete originals for one invocation.
|
|
33
|
-
*
|
|
34
|
-
* References are opaque and scoped to the invocation that created them: another run, node or
|
|
35
|
-
* invocation cannot name them, and a range request is bounded so an expansion is a deliberate,
|
|
36
|
-
* accounted read rather than the original flooding back into context.
|
|
37
|
-
*/
|
|
38
25
|
export declare class ToolOutputArchive {
|
|
39
26
|
private readonly scope;
|
|
40
27
|
private readonly maxBytes;
|
|
@@ -52,13 +39,7 @@ export declare class ToolOutputArchive {
|
|
|
52
39
|
nextOffset?: number;
|
|
53
40
|
};
|
|
54
41
|
size(): number;
|
|
55
|
-
/** The references that reached durable storage, by the artifact holding each: what a checkpoint records. */
|
|
56
42
|
exportPersisted(): Record<string, string>;
|
|
57
|
-
/**
|
|
58
|
-
* Re-admit a stopped attempt's references from the artifacts its checkpoint named. Only
|
|
59
|
-
* `tool-output://` references are accepted, an artifact that cannot be loaded is skipped, and the
|
|
60
|
-
* byte budget still applies. Returns how many references serve again.
|
|
61
|
-
*/
|
|
62
43
|
import(mapping: Record<string, string>, load: (artifactRef: string) => Promise<string | undefined>): Promise<number>;
|
|
63
44
|
}
|
|
64
45
|
export declare const EXPAND_TOOL_OUTPUT = "expand_tool_output";
|
|
@@ -1,47 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deterministic filtering of bulky tool results before they enter the model-visible conversation.
|
|
3
|
-
*
|
|
4
|
-
* A test run, a compiler, a long listing, a search or a progress-heavy command can return
|
|
5
|
-
* thousands of lines of which the coding model needs a few: the failures, the diagnostics, the
|
|
6
|
-
* counts and the exit status. This module parses what it can recognize and keeps verbatim
|
|
7
|
-
* excerpts of what matters; it never writes a summary of its own, so no sentence here can turn
|
|
8
|
-
* untrusted output into an instruction. Every filtered result says what was omitted and names the
|
|
9
|
-
* artifact holding the complete original, which the model expands by reference and range.
|
|
10
|
-
*
|
|
11
|
-
* What is never filtered: source reads, patch hunks and skill or memory content (those tools are
|
|
12
|
-
* not candidates at all), tool errors other than a non-zero exit status (the error text is the
|
|
13
|
-
* evidence), small outputs (nothing to gain), and formats this module does not recognize (the
|
|
14
|
-
* existing clip and pressure-driven compaction remain the fallbacks). Filtering runs once, at
|
|
15
|
-
* insertion; it never rewrites an older conversation prefix.
|
|
16
|
-
* @module tool-result-filter
|
|
17
|
-
*/
|
|
18
1
|
import { canonicalToolName } from './tool-names.js';
|
|
19
2
|
const SHELL_TOOLS = new Set(['Bash', 'PowerShell', 'NativeExec', 'AsyncProcess', 'PowerShellFast', 'ShellMetrics', 'shell', 'bash', 'powershell', 'qa.terminal']);
|
|
20
3
|
const SEARCH_TOOLS = new Set(['Grep', 'grep', 'search_files']);
|
|
21
4
|
const LISTING_TOOLS = new Set(['Glob', 'find', 'ls', 'list_files']);
|
|
22
|
-
/** A shell command that prints source or a patch is a read, whatever its size. */
|
|
23
5
|
const SOURCE_COMMAND = /codegraph|Get-Content|\bcat\b|\bsed\b|\btype\b|\bhead\b|\btail\b|\bless\b|\bmore\b|read[_-]?file|readFile|\.read_text\b|\bgit(?:\.exe)?\b[^\r\n;|&]*\b(?:diff|show|log\s+-p)\b/i;
|
|
24
6
|
const EXIT_HEADER = /^(Tool error: )?Exit code: (-?\d+|[A-Z]+)\r?\n/;
|
|
25
|
-
/** The shipped Bash tool appends the status instead: `<output>\nCommand exited with code N`, wrapped in `Tool error: `. */
|
|
26
7
|
const EXIT_FOOTER = /\n?Command exited with code (-?\d+)\s*$/;
|
|
27
8
|
const MAX_FAILURE_BLOCK_LINES = 40;
|
|
28
9
|
const MAX_HEAD_LINES = 6;
|
|
29
10
|
const MAX_TAIL_LINES = 12;
|
|
30
11
|
const TEST_PASS = /^\s*(?:ok \d+ -|✔|✓|√|PASS(?:ED)?\b|test .* \.\.\. ok$|--- PASS|\[\s*PASS\s*\]|·|\s+✓)/;
|
|
31
|
-
// pytest names each failure with an underscore-delimited section header and groups the sections
|
|
32
|
-
// under an `= FAILURES =` (or `= ERRORS =`) banner; the sections hold the assertions and
|
|
33
|
-
// tracebacks, and dropping them leaves only the bottom `FAILED ...` summary lines. The same
|
|
34
|
-
// underscore shape also frames pytest's `Captured stdout/stderr` evidence blocks, which belong to
|
|
35
|
-
// the failure they follow, not to a failure of their own.
|
|
36
12
|
const TEST_FAIL = /^\s*(?:not ok \d+|✖|✗|×|FAIL(?:ED)?\b|test .* \.\.\. FAILED$|--- FAIL|\[\s*FAIL\s*\]|ERROR\b|panicked at|AssertionError|Error:|(?![^\n]*\b[Cc]aptured\b)_{8,}\s+\S.*\s+_{8,}$)/;
|
|
37
13
|
const TEST_SUMMARY = /^\s*(?:# (?:tests|pass|fail|skipped|todo|cancelled|duration_ms)|ℹ (?:tests|suites|pass|fail|cancelled|skipped|todo|duration_ms)|Tests?:\s|Test Files\s|Test Suites:|=+ .*(?:passed|failed|error).* =+$|=+\s*FAIL(?:URES|ED)\s*=+$|=+\s*ERRORS\s*=+$|test result:|ok\s+\S+\s+[\d.]+s$|FAIL\s+\S+\s+[\d.]+s$|\d+ passing|\d+ failing|\d+ pending|Ran \d+ tests?)/;
|
|
38
|
-
// pytest prefixes its assertion explanations with `E `, which must never end a failure block.
|
|
39
14
|
const DIAGNOSTIC = /^\s*(?:at |File "|-->|\s*\d+ \||caused by|Caused by|stack:|expected|actual|Expected|Received|\+ |- |diff:|AssertionError|TypeError|ReferenceError|SyntaxError|RangeError|Error\b|E\s)/;
|
|
40
15
|
const COMPILER_ERROR = /(?:\berror\b\s*(?:TS\d+|\[E\d+\]|C\d+|CS\d+)?:?|\bwarning\b\s*(?:C\d+|CS\d+)?:|\(\d+,\d+\): (?:error|warning)|^\S+:\d+:\d+:\s*(?:error|warning)|^error\[|^warning: |^error: )/;
|
|
41
16
|
const COMPILER_SUMMARY = /^(?:Found \d+ errors?|\d+ errors? generated|error: could not compile|warning: .* generated \d+ warnings?|Build (?:succeeded|FAILED)|Compilation (?:succeeded|failed)|\s*\d+ Warning\(s\)|\s*\d+ Error\(s\))/;
|
|
42
17
|
const PROGRESS = /(?:\[=+>?\s*\]|\d{1,3}%|█|░|\.{10,}|(?:Receiving|Resolving|Compressing|Counting|Unpacking|Downloading|Compiling|Building|Bundling)\b.*\d)/;
|
|
43
18
|
const SEARCH_LINE = /^([^\s:][^:\n]{0,400}?):(\d+)(?::|-)/;
|
|
44
|
-
/** Which family of output a tool is expected to produce, or undefined when it must not be filtered. */
|
|
45
19
|
export function toolResultFilterCandidate(toolName, args) {
|
|
46
20
|
const canonical = canonicalToolName(toolName);
|
|
47
21
|
if (SHELL_TOOLS.has(canonical) || SHELL_TOOLS.has(toolName)) {
|
|
@@ -54,7 +28,6 @@ export function toolResultFilterCandidate(toolName, args) {
|
|
|
54
28
|
return 'listing';
|
|
55
29
|
return undefined;
|
|
56
30
|
}
|
|
57
|
-
/** Collapse runs of lines that differ only in digits, percentages or carriage-return redraws. */
|
|
58
31
|
function collapseProgress(lines) {
|
|
59
32
|
const out = [];
|
|
60
33
|
let collapsed = 0;
|
|
@@ -93,7 +66,6 @@ function keepTestReport(lines) {
|
|
|
93
66
|
if (TEST_FAIL.test(line)) {
|
|
94
67
|
fail++;
|
|
95
68
|
keep(index, true);
|
|
96
|
-
// Preceding diagnostic context (a warning or a console line) that explains the failure.
|
|
97
69
|
for (let offset = 1; offset <= 3 && index - offset >= 0; offset++) {
|
|
98
70
|
const previous = lines[index - offset];
|
|
99
71
|
if (!previous.trim() || TEST_PASS.test(previous))
|
|
@@ -101,8 +73,6 @@ function keepTestReport(lines) {
|
|
|
101
73
|
if (/warn|deprecat|error|console\./i.test(previous))
|
|
102
74
|
keep(index - offset);
|
|
103
75
|
}
|
|
104
|
-
// The failure's own block: assertion, diff and stack frames up to the next test line. The
|
|
105
|
-
// block's lines are consumed here so an assertion inside it is not counted as a second failure.
|
|
106
76
|
let consumed = 0;
|
|
107
77
|
for (let offset = 1; offset <= MAX_FAILURE_BLOCK_LINES && index + offset < lines.length; offset++) {
|
|
108
78
|
const next = lines[index + offset];
|
|
@@ -233,22 +203,11 @@ function render(kept, total) {
|
|
|
233
203
|
}
|
|
234
204
|
return { text: parts.join('\n'), omitted };
|
|
235
205
|
}
|
|
236
|
-
/** No kept line may be longer than this; the rest of it is named by its length and lives in the archive. */
|
|
237
206
|
const MAX_LINE_CHARS = 1_000;
|
|
238
|
-
/** Slack under the bound for the newline before the trailer and the omitted-count digits it may grow by. */
|
|
239
207
|
const RENDER_SLACK = 40;
|
|
240
208
|
function clipLine(line) {
|
|
241
209
|
return line.length <= MAX_LINE_CHARS ? line : `${line.slice(0, MAX_LINE_CHARS)} …[${line.length - MAX_LINE_CHARS} more characters of this line omitted]`;
|
|
242
210
|
}
|
|
243
|
-
/**
|
|
244
|
-
* Fit the kept lines into the character bound as they will be rendered, gap markers included:
|
|
245
|
-
* every line is clipped first, so one oversized line cannot carry the excerpt past the bound on its
|
|
246
|
-
* own, then what shrinks is whole runs of a block's own lines, so head and tail survive and no
|
|
247
|
-
* failure or error heading is dropped or torn from its evidence. Formats without headings (a
|
|
248
|
-
* search, a listing, progress) drop single middle lines as before. When only headings remain and
|
|
249
|
-
* they still do not fit, the over-bound excerpt is returned and the caller declines filtering
|
|
250
|
-
* rather than dropping failures the original kept.
|
|
251
|
-
*/
|
|
252
211
|
function fit(kept, total, maxChars) {
|
|
253
212
|
let items = kept.map(item => item.line.length > MAX_LINE_CHARS ? { ...item, line: clipLine(item.line) } : item);
|
|
254
213
|
let rendered = render(items, total);
|
|
@@ -282,7 +241,6 @@ function fit(kept, total, maxChars) {
|
|
|
282
241
|
}
|
|
283
242
|
return rendered;
|
|
284
243
|
}
|
|
285
|
-
/** Parse and reduce one tool result. The original is never modified; the caller stores it. */
|
|
286
244
|
export function filterToolResult(input) {
|
|
287
245
|
const originalChars = input.output.length;
|
|
288
246
|
const unchanged = (reason, lines = 0) => ({ output: input.output, filtered: false, reason, originalChars, keptChars: originalChars, originalLines: lines, omittedLines: 0, facts: {} });
|
|
@@ -291,18 +249,13 @@ export function filterToolResult(input) {
|
|
|
291
249
|
return unchanged('protected_tool');
|
|
292
250
|
if (originalChars <= input.thresholdChars)
|
|
293
251
|
return unchanged('below_threshold');
|
|
294
|
-
// A non-zero exit is an outcome whose body is still a report; any other error is the evidence.
|
|
295
252
|
const header = EXIT_HEADER.exec(input.output);
|
|
296
253
|
const footer = header ? null : EXIT_FOOTER.exec(input.output);
|
|
297
254
|
if (input.isError && !header && !footer)
|
|
298
255
|
return unchanged('error_output');
|
|
299
|
-
// The status stays pinned where the tool put it: a header at the top, a footer right after the
|
|
300
|
-
// excerpt; the `Tool error: ` wrapper stays at the top either way.
|
|
301
256
|
const pinned = header ? header[0] : input.output.startsWith('Tool error: ') ? 'Tool error: ' : '';
|
|
302
257
|
const pinnedTail = footer ? `${footer[0].trim()}\n` : '';
|
|
303
258
|
const body = input.output.slice(pinned.length, footer ? footer.index : undefined);
|
|
304
|
-
// CRLF endings are line endings, not redraws: the trailing carriage return comes off here so the
|
|
305
|
-
// progress collapser only sees the carriage returns a redraw actually wrote inside a line.
|
|
306
259
|
const rawLines = body.split('\n').map(line => line.endsWith('\r') ? line.slice(0, -1) : line);
|
|
307
260
|
const maxKept = input.maxKeptChars ?? 8000;
|
|
308
261
|
let format;
|
|
@@ -360,27 +313,15 @@ export function filterToolResult(input) {
|
|
|
360
313
|
...notes.map(note => ` ${note}.`),
|
|
361
314
|
input.reference ? ` Complete original: ${input.reference} (use expand_tool_output with ref, offset and limit).]` : ' Complete original not retained.]',
|
|
362
315
|
].join('');
|
|
363
|
-
// The trailer is part of what the model sees, so the lines get what the bound leaves after it;
|
|
364
|
-
// two clipped lines are the least that still reads as an excerpt.
|
|
365
316
|
const lineBudget = Math.max(2 * (MAX_LINE_CHARS + 80), maxKept - trailerFor(lines.length).length - pinned.length - pinnedTail.length - RENDER_SLACK);
|
|
366
317
|
const rendered = fit(kept, lines.length, lineBudget);
|
|
367
318
|
const output = `${pinned}${rendered.text}\n${pinnedTail}${trailerFor(rendered.omitted)}`;
|
|
368
319
|
if (output.length > originalChars * 0.8)
|
|
369
320
|
return unchanged('no_benefit', rawLines.length);
|
|
370
|
-
// The excerpt the runtime inserts must stay under the bound with its trailer, or the later clip
|
|
371
|
-
// would cut the summary and the reference the model needs to expand the rest; a bound too small
|
|
372
|
-
// for even the least excerpt declines rather than overflowing.
|
|
373
321
|
if (output.length > maxKept)
|
|
374
322
|
return unchanged('no_benefit', rawLines.length);
|
|
375
323
|
return { output, filtered: true, reason: 'filtered', format, originalChars, keptChars: output.length, originalLines: rawLines.length, omittedLines: rendered.omitted, facts };
|
|
376
324
|
}
|
|
377
|
-
/**
|
|
378
|
-
* The runtime-owned store of complete originals for one invocation.
|
|
379
|
-
*
|
|
380
|
-
* References are opaque and scoped to the invocation that created them: another run, node or
|
|
381
|
-
* invocation cannot name them, and a range request is bounded so an expansion is a deliberate,
|
|
382
|
-
* accounted read rather than the original flooding back into context.
|
|
383
|
-
*/
|
|
384
325
|
export class ToolOutputArchive {
|
|
385
326
|
scope;
|
|
386
327
|
maxBytes;
|
|
@@ -405,7 +346,7 @@ export class ToolOutputArchive {
|
|
|
405
346
|
if (typeof stored === 'string')
|
|
406
347
|
this.persisted.set(ref, stored);
|
|
407
348
|
}
|
|
408
|
-
catch {
|
|
349
|
+
catch { }
|
|
409
350
|
return ref;
|
|
410
351
|
}
|
|
411
352
|
has(ref) { return typeof ref === 'string' && this.entries.has(ref); }
|
|
@@ -417,13 +358,7 @@ export class ToolOutputArchive {
|
|
|
417
358
|
return { content: value.slice(offset, end), totalChars: value.length, offset, ...(end < value.length ? { nextOffset: end } : {}) };
|
|
418
359
|
}
|
|
419
360
|
size() { return this.entries.size; }
|
|
420
|
-
/** The references that reached durable storage, by the artifact holding each: what a checkpoint records. */
|
|
421
361
|
exportPersisted() { return Object.fromEntries(this.persisted); }
|
|
422
|
-
/**
|
|
423
|
-
* Re-admit a stopped attempt's references from the artifacts its checkpoint named. Only
|
|
424
|
-
* `tool-output://` references are accepted, an artifact that cannot be loaded is skipped, and the
|
|
425
|
-
* byte budget still applies. Returns how many references serve again.
|
|
426
|
-
*/
|
|
427
362
|
async import(mapping, load) {
|
|
428
363
|
let restored = 0;
|
|
429
364
|
for (const [ref, artifactRef] of Object.entries(mapping)) {
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true when the full validator authoritatively checked an extended contract.
|
|
3
|
-
*
|
|
4
|
-
* The compiler is several hundred modules and only schemas with extended keywords need it, so it
|
|
5
|
-
* is loaded the first time one does rather than with every process that can run a tool.
|
|
6
|
-
*/
|
|
7
1
|
export declare function validateExtendedToolSchema(schema: Record<string, unknown>, input: unknown): Promise<boolean>;
|
|
@@ -7,14 +7,11 @@ function needsExtendedValidation(schema) {
|
|
|
7
7
|
const node = schema;
|
|
8
8
|
if (Object.keys(node).some(key => !nativeKeywords.has(key)))
|
|
9
9
|
return true;
|
|
10
|
-
// Native values use identity equality; JSON Schema compares objects/arrays structurally.
|
|
11
10
|
const composite = (value) => value !== null && typeof value === 'object';
|
|
12
11
|
if (composite(node.const) || (Array.isArray(node.enum) && node.enum.some(composite)))
|
|
13
12
|
return true;
|
|
14
|
-
// Draft tuple items are positional schemas, not one homogeneous item schema.
|
|
15
13
|
if (Array.isArray(node.items))
|
|
16
14
|
return true;
|
|
17
|
-
// Native oneOf returns before applying siblings. Preserve external contracts.
|
|
18
15
|
if (node.oneOf && Object.keys(node).some(key => !['oneOf', 'title', 'description', 'default', 'examples'].includes(key)))
|
|
19
16
|
return true;
|
|
20
17
|
if (node.additionalProperties && typeof node.additionalProperties === 'object')
|
|
@@ -24,12 +21,6 @@ function needsExtendedValidation(schema) {
|
|
|
24
21
|
|| (Array.isArray(node.oneOf) && node.oneOf.some(needsExtendedValidation));
|
|
25
22
|
}
|
|
26
23
|
const validators = new WeakMap();
|
|
27
|
-
/**
|
|
28
|
-
* Returns true when the full validator authoritatively checked an extended contract.
|
|
29
|
-
*
|
|
30
|
-
* The compiler is several hundred modules and only schemas with extended keywords need it, so it
|
|
31
|
-
* is loaded the first time one does rather than with every process that can run a tool.
|
|
32
|
-
*/
|
|
33
24
|
export async function validateExtendedToolSchema(schema, input) {
|
|
34
25
|
if (!needsExtendedValidation(schema))
|
|
35
26
|
return false;
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Tool, ToolContext } from './types.js';
|
|
2
2
|
export declare function within(root: string, target: string): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* The paths among `names` (relative to `base`) where a write needs approval under workspace rules:
|
|
5
|
-
* outside the workspace, or inside it under protected repository/runtime metadata.
|
|
6
|
-
*/
|
|
7
3
|
export declare function classifyWorkspaceWrites(workspace: string, base: string, names: readonly string[]): Promise<{
|
|
8
4
|
outside: string[];
|
|
9
5
|
protected: string[];
|