@gajae-code/coding-agent 0.17.2 → 0.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +267 -0
- package/dist/types/cli/daemon-cli.d.ts +3 -1
- package/dist/types/cli/github-release.d.ts +17 -0
- package/dist/types/cli/public-command-entry.d.ts +56 -0
- package/dist/types/cli/public-command-errors.d.ts +126 -0
- package/dist/types/cli/public-command-evidence.d.ts +99 -0
- package/dist/types/cli/public-command-help.d.ts +65 -0
- package/dist/types/cli/public-command-registry.d.ts +69 -0
- package/dist/types/cli/session-picker.d.ts +1 -1
- package/dist/types/cli/setup-cli.d.ts +1 -0
- package/dist/types/cli/skills-cli.d.ts +5 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/commands/daemon.d.ts +4 -50
- package/dist/types/commands/sdk.d.ts +20 -37
- package/dist/types/commands/setup.d.ts +3 -0
- package/dist/types/commands/skills.d.ts +9 -0
- package/dist/types/config/autorouting-tier-map.d.ts +1049 -3
- package/dist/types/config/file-lock.d.ts +13 -3
- package/dist/types/config/model-profile-activation.d.ts +45 -1
- package/dist/types/config/model-registry.d.ts +14 -3
- package/dist/types/config/model-resolver.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +11 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +6 -1
- package/dist/types/daemon/operator-contract.d.ts +5 -1
- package/dist/types/eval/js/worker-protocol.d.ts +2 -0
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/extensibility/extensions/types.d.ts +12 -0
- package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +11 -2
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +18 -0
- package/dist/types/extensibility/shared-events.d.ts +3 -1
- package/dist/types/gjc-runtime/session-state-lock.d.ts +61 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/harness-control-plane/control-endpoint.d.ts +4 -1
- package/dist/types/harness-control-plane/finalize.d.ts +14 -3
- package/dist/types/internal-urls/embedded-protocol.d.ts +9 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/parse.d.ts +9 -1
- package/dist/types/main.d.ts +23 -1
- package/dist/types/modes/acp/acp-agent.d.ts +55 -1
- package/dist/types/modes/acp/startup-provenance.d.ts +16 -0
- package/dist/types/modes/components/custom-provider-wizard.d.ts +19 -1
- package/dist/types/modes/components/session-selector.d.ts +5 -2
- package/dist/types/modes/components/user-message-selector.d.ts +5 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +11 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +14 -1
- package/dist/types/modes/types.d.ts +2 -2
- package/dist/types/runtime/process-lifecycle.d.ts +2 -0
- package/dist/types/runtime-mcp/loader.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +69 -6
- package/dist/types/runtime-mcp/pool.d.ts +17 -0
- package/dist/types/runtime-mcp/redaction.d.ts +20 -0
- package/dist/types/runtime-mcp/startup-policy.d.ts +6 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +9 -0
- package/dist/types/runtime-mcp/transports/http.d.ts +11 -0
- package/dist/types/sdk/broker/broker.d.ts +17 -4
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/identity.d.ts +5 -1
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +23 -3
- package/dist/types/sdk/broker/lifecycle.d.ts +15 -8
- package/dist/types/sdk/broker/managed-task-dag.d.ts +1335 -0
- package/dist/types/sdk/broker/managed-task-verification.d.ts +37 -0
- package/dist/types/sdk/broker/runtime.d.ts +1 -1
- package/dist/types/sdk/broker/session-index.d.ts +22 -3
- package/dist/types/sdk/broker/spawn-authority.d.ts +12 -0
- package/dist/types/sdk/broker/startup-failure.d.ts +4 -0
- package/dist/types/sdk/broker/stderr-drainer.d.ts +13 -0
- package/dist/types/sdk/bus/index.d.ts +19 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +7 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +5 -0
- package/dist/types/sdk/cli/master-cli.d.ts +6 -10
- package/dist/types/sdk/cli/rows.d.ts +19 -1
- package/dist/types/sdk/cli/session-cli.d.ts +22 -5
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/guides/cli.d.ts +3 -4
- package/dist/types/sdk/guides/verify.d.ts +2 -0
- package/dist/types/sdk/host/host.d.ts +9 -0
- package/dist/types/sdk/host/session-runtime.d.ts +31 -0
- package/dist/types/sdk/host/types.d.ts +10 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/prompt-deadline-flush.d.ts +85 -0
- package/dist/types/sdk/prompt-deadline-manager.d.ts +37 -0
- package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +3 -3
- package/dist/types/sdk/startup-capability.d.ts +2 -0
- package/dist/types/sdk/transport/relay.d.ts +1 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +48 -4
- package/dist/types/sdk/transport/stdio.d.ts +5 -1
- package/dist/types/session/agent-session.d.ts +175 -23
- package/dist/types/session/fallback-chain-controller.d.ts +6 -6
- package/dist/types/session/fold-coordinator.d.ts +17 -3
- package/dist/types/session/internal/managed-session-storage.d.ts +7 -1
- package/dist/types/session/session-manager.d.ts +64 -1
- package/dist/types/session/session-work-lease.d.ts +14 -0
- package/dist/types/setup/model-onboarding-guidance.d.ts +1 -1
- package/dist/types/setup/provider-onboarding.d.ts +81 -1
- package/dist/types/task/types.d.ts +2 -0
- package/dist/types/tools/bash-interactive.d.ts +1 -0
- package/dist/types/tools/bash.d.ts +37 -11
- package/dist/types/tools/fetch.d.ts +10 -1
- package/dist/types/tools/job.d.ts +1 -1
- package/dist/types/tools/steer-fold.d.ts +31 -0
- package/dist/types/tools/subagent.d.ts +8 -1
- package/dist/types/utils/git.d.ts +28 -2
- package/dist/types/utils/mupdf-embedded.d.ts +2 -0
- package/dist/types/utils/mupdf.d.ts +4 -0
- package/dist/types/utils/session-title-generation.d.ts +6 -0
- package/dist/types/utils/title-generator.d.ts +11 -2
- package/dist/types/web/scrapers/types.d.ts +3 -0
- package/package.json +18 -10
- package/scripts/build-binary.ts +9 -3
- package/scripts/compile-args.ts +0 -9
- package/scripts/embed-mupdf.ts +52 -0
- package/scripts/generate-sdk-operation-inventory.ts +31 -1
- package/scripts/vendor-markit.ts +196 -0
- package/src/async/job-manager.ts +22 -1
- package/src/cli/daemon-cli.ts +53 -18
- package/src/cli/github-release.ts +87 -5
- package/src/cli/mcp-cli.ts +38 -4
- package/src/cli/public-command-entry.ts +450 -0
- package/src/cli/public-command-errors.ts +581 -0
- package/src/cli/public-command-evidence.ts +717 -0
- package/src/cli/public-command-help.ts +360 -0
- package/src/cli/public-command-registry.ts +541 -0
- package/src/cli/session-picker.ts +2 -1
- package/src/cli/setup-cli.ts +10 -1
- package/src/cli/skills-cli.ts +46 -2
- package/src/cli/stats-cli.ts +11 -1
- package/src/cli.ts +61 -1
- package/src/commands/daemon.ts +65 -69
- package/src/commands/sdk.ts +175 -117
- package/src/commands/setup.ts +2 -0
- package/src/commands/skills.ts +11 -0
- package/src/config/autorouting-tier-map.ts +543 -3
- package/src/config/file-lock.ts +206 -65
- package/src/config/model-discovery-manager.ts +4 -4
- package/src/config/model-profile-activation.ts +417 -66
- package/src/config/model-registry.ts +254 -36
- package/src/config/model-resolver.ts +6 -1
- package/src/config/settings-schema.ts +26 -2
- package/src/coordinator-mcp/policy.ts +10 -5
- package/src/coordinator-mcp/question-gate-codec.ts +17 -0
- package/src/coordinator-mcp/question-state.ts +179 -9
- package/src/coordinator-mcp/server.ts +521 -87
- package/src/coordinator-mcp/session-reaper.ts +6 -4
- package/src/crash/record-loader.ts +6 -2
- package/src/daemon/operator-contract.ts +26 -12
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
- package/src/eval/js/context-manager.ts +8 -8
- package/src/eval/js/worker-core.ts +9 -4
- package/src/eval/js/worker-protocol.ts +2 -0
- package/src/exec/bash-executor.ts +3 -0
- package/src/extensibility/extensions/runner.ts +52 -4
- package/src/extensibility/extensions/types.ts +10 -0
- package/src/extensibility/gjc-plugins/registry.ts +196 -37
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +46 -8
- package/src/extensibility/runtime-skill-discovery.ts +61 -3
- package/src/extensibility/shared-events.ts +3 -1
- package/src/gjc-runtime/session-state-lock.ts +165 -24
- package/src/gjc-runtime/state-writer.ts +317 -6
- package/src/gjc-runtime/ultragoal-succession.ts +31 -3
- package/src/harness-control-plane/control-endpoint.ts +24 -6
- package/src/harness-control-plane/finalize.ts +312 -25
- package/src/harness-control-plane/owner.ts +323 -89
- package/src/internal-urls/docs-index.generated.ts +23 -20
- package/src/internal-urls/embedded-protocol.ts +83 -0
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/parse.ts +21 -1
- package/src/internal-urls/router.ts +4 -2
- package/src/main.ts +192 -74
- package/src/modes/acp/acp-agent.ts +973 -56
- package/src/modes/acp/startup-provenance.ts +59 -0
- package/src/modes/components/custom-provider-wizard.ts +308 -7
- package/src/modes/components/gjc-bundle-settings.ts +21 -1
- package/src/modes/components/oauth-selector.ts +9 -0
- package/src/modes/components/session-selector.ts +47 -4
- package/src/modes/components/tool-status-header.ts +72 -6
- package/src/modes/components/user-message-selector.ts +57 -15
- package/src/modes/controllers/command-controller.ts +58 -32
- package/src/modes/controllers/extension-ui-controller.ts +33 -7
- package/src/modes/controllers/input-controller.ts +4 -0
- package/src/modes/controllers/runtime-mcp-command-controller.ts +1 -1
- package/src/modes/controllers/selector-controller.ts +161 -15
- package/src/modes/interactive-mode.ts +21 -7
- package/src/modes/runtime-init.ts +1 -0
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +124 -7
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +16 -2
- package/src/modes/types.ts +2 -2
- package/src/prompts/agent-fragments/browser-aside.md +1 -0
- package/src/prompts/system/title-system.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/job.md +1 -1
- package/src/prompts/tools/read.md +2 -0
- package/src/runtime/network-prewarm-service.test.ts +36 -1
- package/src/runtime/network-prewarm-service.ts +28 -3
- package/src/runtime/process-lifecycle.ts +22 -11
- package/src/runtime-mcp/config.ts +16 -1
- package/src/runtime-mcp/loader.ts +6 -3
- package/src/runtime-mcp/manager.ts +845 -109
- package/src/runtime-mcp/pool.test.ts +31 -0
- package/src/runtime-mcp/pool.ts +304 -28
- package/src/runtime-mcp/redaction.ts +42 -0
- package/src/runtime-mcp/startup-policy.ts +7 -0
- package/src/runtime-mcp/tool-bridge.ts +71 -0
- package/src/runtime-mcp/transports/http.ts +108 -25
- package/src/sdk/acp/adapter.ts +27 -8
- package/src/sdk/broker/broker.ts +1431 -198
- package/src/sdk/broker/ensure.ts +21 -3
- package/src/sdk/broker/identity.ts +22 -1
- package/src/sdk/broker/lifecycle-ledger.ts +95 -31
- package/src/sdk/broker/lifecycle.ts +690 -141
- package/src/sdk/broker/managed-task-dag.ts +1927 -0
- package/src/sdk/broker/managed-task-verification.ts +642 -0
- package/src/sdk/broker/runtime.ts +1 -1
- package/src/sdk/broker/session-index.ts +97 -4
- package/src/sdk/broker/spawn-authority.ts +175 -14
- package/src/sdk/broker/startup-failure.ts +80 -1
- package/src/sdk/broker/stderr-drainer.ts +59 -0
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
- package/src/sdk/bus/index.ts +707 -81
- package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
- package/src/sdk/bus/telegram-daemon-contract.ts +7 -1
- package/src/sdk/bus/telegram-daemon.ts +10 -3
- package/src/sdk/cli/master-cli.ts +47 -36
- package/src/sdk/cli/rows.ts +30 -7
- package/src/sdk/cli/session-cli.ts +705 -184
- package/src/sdk/client/client.ts +18 -0
- package/src/sdk/guides/catalog.ts +2 -2
- package/src/sdk/guides/cli.ts +20 -62
- package/src/sdk/guides/verify.ts +14 -0
- package/src/sdk/host/host.ts +49 -5
- package/src/sdk/host/session-runtime.test.ts +184 -2
- package/src/sdk/host/session-runtime.ts +322 -101
- package/src/sdk/host/types.ts +12 -1
- package/src/sdk/host/websocket-transport.lifecycle.test.ts +84 -0
- package/src/sdk/host/websocket-transport.ts +40 -6
- package/src/sdk/index.ts +11 -0
- package/src/sdk/lifecycle/service.ts +2 -0
- package/src/sdk/prompt-deadline-flush.ts +356 -0
- package/src/sdk/prompt-deadline-manager.ts +133 -1
- package/src/sdk/prompt-tool-boundary.ts +121 -0
- package/src/sdk/protocol/operation-inventory.generated.json +106 -0
- package/src/sdk/router/session-router.ts +9 -1
- package/src/sdk/session.ts +763 -116
- package/src/sdk/startup-capability.ts +1 -1
- package/src/sdk/transport/relay.ts +71 -6
- package/src/sdk/transport/serve-cli.ts +397 -42
- package/src/sdk/transport/socket.ts +12 -11
- package/src/sdk/transport/stdio.ts +7 -3
- package/src/session/agent-session.ts +2472 -407
- package/src/session/fallback-chain-controller.ts +6 -7
- package/src/session/fold-coordinator.ts +24 -5
- package/src/session/internal/managed-session-scope.ts +68 -18
- package/src/session/internal/managed-session-storage.ts +334 -12
- package/src/session/session-manager.ts +382 -44
- package/src/session/session-work-lease.ts +34 -0
- package/src/setup/model-onboarding-guidance.ts +1 -1
- package/src/setup/provider-onboarding.ts +397 -24
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +259 -15
- package/src/task/executor.ts +46 -17
- package/src/task/index.ts +14 -2
- package/src/task/types.ts +2 -0
- package/src/tools/bash-interactive.ts +2 -0
- package/src/tools/bash.ts +118 -78
- package/src/tools/fetch.ts +140 -25
- package/src/tools/job.ts +151 -25
- package/src/tools/output-meta.ts +15 -2
- package/src/tools/path-utils.ts +27 -3
- package/src/tools/read.ts +3 -3
- package/src/tools/steer-fold.ts +107 -0
- package/src/tools/subagent-render.ts +24 -1
- package/src/tools/subagent.ts +27 -1
- package/src/tools/tool-catalog.generated.ts +29 -2
- package/src/tools/tool-errors.ts +4 -0
- package/src/utils/git.ts +53 -3
- package/src/utils/markit.ts +55 -41
- package/src/utils/mupdf-assets.d.ts +4 -0
- package/src/utils/mupdf-embedded.ts +4 -0
- package/src/utils/mupdf.ts +136 -0
- package/src/utils/session-title-generation.ts +29 -0
- package/src/utils/title-generator.ts +46 -2
- package/src/web/scrapers/types.ts +24 -3
- package/vendor/markit-ai/LICENSE +21 -0
- package/vendor/markit-ai/MANIFEST.json +412 -0
- package/vendor/markit-ai/dist/commands/config.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/config.js +139 -0
- package/vendor/markit-ai/dist/commands/convert.d.ts +6 -0
- package/vendor/markit-ai/dist/commands/convert.js +113 -0
- package/vendor/markit-ai/dist/commands/formats.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/formats.js +92 -0
- package/vendor/markit-ai/dist/commands/init.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/init.js +29 -0
- package/vendor/markit-ai/dist/commands/onboard.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/onboard.js +61 -0
- package/vendor/markit-ai/dist/commands/plugin.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/plugin.js +58 -0
- package/vendor/markit-ai/dist/config.d.ts +26 -0
- package/vendor/markit-ai/dist/config.js +42 -0
- package/vendor/markit-ai/dist/converters/audio.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/audio.js +104 -0
- package/vendor/markit-ai/dist/converters/csv.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/csv.js +83 -0
- package/vendor/markit-ai/dist/converters/docx.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/docx.js +57 -0
- package/vendor/markit-ai/dist/converters/epub.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/epub.js +128 -0
- package/vendor/markit-ai/dist/converters/github.d.ts +18 -0
- package/vendor/markit-ai/dist/converters/github.js +148 -0
- package/vendor/markit-ai/dist/converters/html.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/html.js +30 -0
- package/vendor/markit-ai/dist/converters/image.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/image.js +124 -0
- package/vendor/markit-ai/dist/converters/ipynb.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/ipynb.js +75 -0
- package/vendor/markit-ai/dist/converters/iwork.d.ts +20 -0
- package/vendor/markit-ai/dist/converters/iwork.js +391 -0
- package/vendor/markit-ai/dist/converters/json.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/json.js +21 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.d.ts +35 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.js +93 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.js +514 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.d.ts +25 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.js +795 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.js +108 -0
- package/vendor/markit-ai/dist/converters/pdf/index.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/index.js +136 -0
- package/vendor/markit-ai/dist/converters/pdf/mupdf-loader.js +9 -0
- package/vendor/markit-ai/dist/converters/pdf/render.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/render.js +513 -0
- package/vendor/markit-ai/dist/converters/pdf/types.d.ts +75 -0
- package/vendor/markit-ai/dist/converters/pdf/types.js +1 -0
- package/vendor/markit-ai/dist/converters/plain-text.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/plain-text.js +87 -0
- package/vendor/markit-ai/dist/converters/pptx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/pptx.js +289 -0
- package/vendor/markit-ai/dist/converters/rss.d.ts +11 -0
- package/vendor/markit-ai/dist/converters/rss.js +138 -0
- package/vendor/markit-ai/dist/converters/wikipedia.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/wikipedia.js +33 -0
- package/vendor/markit-ai/dist/converters/xlsx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/xlsx.js +147 -0
- package/vendor/markit-ai/dist/converters/xml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/xml.js +18 -0
- package/vendor/markit-ai/dist/converters/yaml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/yaml.js +17 -0
- package/vendor/markit-ai/dist/converters/zip.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/zip.js +57 -0
- package/vendor/markit-ai/dist/index.d.ts +30 -0
- package/vendor/markit-ai/dist/index.js +26 -0
- package/vendor/markit-ai/dist/main.d.ts +2 -0
- package/vendor/markit-ai/dist/main.js +191 -0
- package/vendor/markit-ai/dist/markit.d.ts +45 -0
- package/vendor/markit-ai/dist/markit.js +267 -0
- package/vendor/markit-ai/dist/plugins/api.d.ts +7 -0
- package/vendor/markit-ai/dist/plugins/api.js +42 -0
- package/vendor/markit-ai/dist/plugins/index.d.ts +4 -0
- package/vendor/markit-ai/dist/plugins/index.js +3 -0
- package/vendor/markit-ai/dist/plugins/installer.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/installer.js +176 -0
- package/vendor/markit-ai/dist/plugins/loader.d.ts +6 -0
- package/vendor/markit-ai/dist/plugins/loader.js +61 -0
- package/vendor/markit-ai/dist/plugins/types.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/types.js +1 -0
- package/vendor/markit-ai/dist/providers/anthropic.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/anthropic.js +47 -0
- package/vendor/markit-ai/dist/providers/index.d.ts +21 -0
- package/vendor/markit-ai/dist/providers/index.js +56 -0
- package/vendor/markit-ai/dist/providers/openai.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/openai.js +76 -0
- package/vendor/markit-ai/dist/providers/types.d.ts +26 -0
- package/vendor/markit-ai/dist/providers/types.js +1 -0
- package/vendor/markit-ai/dist/types.d.ts +36 -0
- package/vendor/markit-ai/dist/types.js +1 -0
- package/vendor/markit-ai/dist/utils/exit-codes.d.ts +4 -0
- package/vendor/markit-ai/dist/utils/exit-codes.js +4 -0
- package/vendor/markit-ai/dist/utils/output.d.ts +22 -0
- package/vendor/markit-ai/dist/utils/output.js +31 -0
- package/vendor/markit-ai/dist/utils/turndown.d.ts +8 -0
- package/vendor/markit-ai/dist/utils/turndown.js +70 -0
- package/vendor/markit-ai/package.json +74 -0
- package/vendor/markit-ai.patch +49 -0
package/src/tools/bash.ts
CHANGED
|
@@ -66,10 +66,13 @@ import {
|
|
|
66
66
|
} from "./output-meta";
|
|
67
67
|
import { resolveToCwd } from "./path-utils";
|
|
68
68
|
import { formatToolWorkingDirectory, replaceTabs } from "./render-utils";
|
|
69
|
+
import { steerFoldReasonLine, watchSteerForFold } from "./steer-fold";
|
|
69
70
|
import { checkTmuxSelfInjection } from "./tmux-self-injection-guard";
|
|
70
71
|
import { ToolAbortError, ToolError } from "./tool-errors";
|
|
71
72
|
import { toolResult } from "./tool-result";
|
|
72
73
|
|
|
74
|
+
export { STEER_FOLD_GRACE_MS, steerFoldReasonLine } from "./steer-fold";
|
|
75
|
+
|
|
73
76
|
function sliceTextAfterUtf8ByteOffset(text: string, offsetBytes: number): string {
|
|
74
77
|
if (offsetBytes <= 0) return text;
|
|
75
78
|
let consumed = 0;
|
|
@@ -86,24 +89,20 @@ function sliceTextAfterUtf8ByteOffset(text: string, offsetBytes: number): string
|
|
|
86
89
|
import { clampTimeout, TOOL_TIMEOUTS } from "./tool-timeouts";
|
|
87
90
|
|
|
88
91
|
export const BASH_DEFAULT_PREVIEW_LINES = 10;
|
|
89
|
-
/**
|
|
90
|
-
* A user steer folds a running foreground bash call only after it has been
|
|
91
|
-
* running at least this long. Shorter commands finish normally and the steer is
|
|
92
|
-
* consumed at the ordinary tool boundary, so a quick `git status` never turns
|
|
93
|
-
* into a background job plus a wake-up turn.
|
|
94
|
-
*/
|
|
95
|
-
export const STEER_FOLD_GRACE_MS = 2_000;
|
|
96
|
-
|
|
97
|
-
/** Model-facing line appended to a steer-folded background-start result. */
|
|
98
|
-
export function steerFoldReasonLine(jobId: string): string {
|
|
99
|
-
return `Folded into background job ${jobId} because a user steer arrived; the command keeps running with its original timeout and its result will wake a later turn.`;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
92
|
const BASH_ERROR_MAX_BYTES = 4096;
|
|
103
93
|
const ARTIFACT_SAVE_DIAGNOSTIC_MAX_BYTES = 256;
|
|
104
94
|
const BASH_ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
105
95
|
const MASTER_CAPABILITY_ENV = "GJC_MASTER_CAPABILITY";
|
|
106
96
|
const MASTER_OWNER_SESSION_ENV = "GJC_MASTER_OWNER_SESSION_ID";
|
|
97
|
+
const COORDINATOR_ONLY_BASH_ENV = [
|
|
98
|
+
"GJC_COORDINATOR_SESSION_STATE_FILE",
|
|
99
|
+
"GJC_COORDINATOR_SESSION_ID",
|
|
100
|
+
"GJC_COORDINATOR_SESSION_BRANCH",
|
|
101
|
+
"GJC_COORDINATOR_SESSION_LAUNCH_ID",
|
|
102
|
+
"GJC_COORDINATOR_SESSION_READINESS_FILE",
|
|
103
|
+
"GJC_COORDINATOR_SIDECAR_SIGNATURE_REQUIRED",
|
|
104
|
+
"GJC_COORDINATOR_SIDECAR_KEY_ID",
|
|
105
|
+
] as const;
|
|
107
106
|
const DEFAULT_AUTO_BACKGROUND_THRESHOLD_MS = 60_000;
|
|
108
107
|
const ACP_RELEASE_TIMEOUT_MS = 1_000;
|
|
109
108
|
const READ_ONLY_BASH_ENV: Record<string, string> = {
|
|
@@ -481,12 +480,50 @@ export async function saveBashOriginalArtifactForTests(
|
|
|
481
480
|
return result.status === "saved" ? result.artifactId : undefined;
|
|
482
481
|
}
|
|
483
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Model-declared activity metadata for the browser-backend routing contract
|
|
485
|
+
* (`browser.backend: aside`). When that contract routes a browser task through
|
|
486
|
+
* Bash, it requires the call to declare the activity structurally so consumers
|
|
487
|
+
* can project it without parsing the command text. The declaration is
|
|
488
|
+
* model-declared and schema-validated only: nothing here verifies that the
|
|
489
|
+
* command actually invokes Aside, and the executor never inspects `command`.
|
|
490
|
+
*/
|
|
491
|
+
export type BashActivityProvider = "aside";
|
|
492
|
+
export type BashActivityMode = "repl" | "exec";
|
|
493
|
+
export interface BashActivityDeclaration {
|
|
494
|
+
kind: "browser";
|
|
495
|
+
provider: BashActivityProvider;
|
|
496
|
+
mode: BashActivityMode;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const bashActivityDeclarationSchema = z
|
|
500
|
+
.object({
|
|
501
|
+
kind: z.literal("browser"),
|
|
502
|
+
provider: z.literal("aside"),
|
|
503
|
+
mode: z.enum(["repl", "exec"]),
|
|
504
|
+
})
|
|
505
|
+
.strict();
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Optional activity declaration. Anything that is not the exact supported
|
|
509
|
+
* shape is dropped rather than failing the call: the declaration is routing
|
|
510
|
+
* metadata, and a malformed value must never make an otherwise valid command
|
|
511
|
+
* unusable. Values are never coerced — `mode: "EXEC"` is dropped, not guessed.
|
|
512
|
+
*/
|
|
513
|
+
const optionalBashActivity = z
|
|
514
|
+
.preprocess(
|
|
515
|
+
value => (bashActivityDeclarationSchema.safeParse(value).success ? value : undefined),
|
|
516
|
+
bashActivityDeclarationSchema.optional(),
|
|
517
|
+
)
|
|
518
|
+
.describe("declare browser activity for the aside browser backend: repl or exec");
|
|
519
|
+
|
|
484
520
|
const bashSchemaBase = z.object({
|
|
485
521
|
command: z.string().describe("command to execute"),
|
|
486
522
|
env: z.record(z.string().regex(BASH_ENV_NAME_PATTERN), z.string()).optional().describe("extra env vars"),
|
|
487
523
|
timeout: z.number().default(300).describe("timeout in seconds, NOT milliseconds (30 = 30s)").optional(),
|
|
488
524
|
cwd: z.string().describe("working directory").optional(),
|
|
489
525
|
pty: z.boolean().describe("run in pty mode").optional(),
|
|
526
|
+
activity: optionalBashActivity,
|
|
490
527
|
});
|
|
491
528
|
|
|
492
529
|
const bashSchemaWithAsync = bashSchemaBase.extend({
|
|
@@ -503,6 +540,8 @@ export interface BashToolInput {
|
|
|
503
540
|
|
|
504
541
|
async?: boolean;
|
|
505
542
|
pty?: boolean;
|
|
543
|
+
/** Accepted activity declaration, mirrored into {@link BashToolDetails.activity}. */
|
|
544
|
+
activity?: BashActivityDeclaration;
|
|
506
545
|
}
|
|
507
546
|
|
|
508
547
|
export interface BashToolDetails {
|
|
@@ -512,6 +551,8 @@ export interface BashToolDetails {
|
|
|
512
551
|
terminalId?: string;
|
|
513
552
|
/** Why the foreground wait was folded, when this result is a background-start after a fold. */
|
|
514
553
|
foldReason?: FoldReason;
|
|
554
|
+
/** The accepted model-declared activity declaration, when the call carried one. */
|
|
555
|
+
activity?: BashActivityDeclaration;
|
|
515
556
|
async?: {
|
|
516
557
|
state: "running" | "completed" | "failed";
|
|
517
558
|
jobId: string;
|
|
@@ -924,6 +965,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
924
965
|
notices?: readonly string[];
|
|
925
966
|
terminalId?: string;
|
|
926
967
|
artifactReferenceInBody?: boolean;
|
|
968
|
+
activity?: BashActivityDeclaration;
|
|
927
969
|
} = {},
|
|
928
970
|
): AgentToolResult<BashToolDetails> {
|
|
929
971
|
const shortArtifactInBody = !result.truncated && result.artifactId !== undefined;
|
|
@@ -947,6 +989,9 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
947
989
|
if (options.terminalId !== undefined) {
|
|
948
990
|
details.terminalId = options.terminalId;
|
|
949
991
|
}
|
|
992
|
+
if (options.activity !== undefined) {
|
|
993
|
+
details.activity = options.activity;
|
|
994
|
+
}
|
|
950
995
|
const resultBuilder = toolResult(details)
|
|
951
996
|
.text(outputText)
|
|
952
997
|
.truncationFromSummary(result, {
|
|
@@ -967,6 +1012,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
967
1012
|
notices?: readonly string[];
|
|
968
1013
|
terminalId?: string;
|
|
969
1014
|
foldReason?: FoldReason;
|
|
1015
|
+
activity?: BashActivityDeclaration;
|
|
970
1016
|
} = {},
|
|
971
1017
|
): AgentToolResult<BashToolDetails> {
|
|
972
1018
|
const details: BashToolDetails = {
|
|
@@ -980,6 +1026,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
980
1026
|
details.requestedTimeoutSeconds = options.requestedTimeoutSec;
|
|
981
1027
|
}
|
|
982
1028
|
if (options.foldReason !== undefined) details.foldReason = options.foldReason;
|
|
1029
|
+
if (options.activity !== undefined) details.activity = options.activity;
|
|
983
1030
|
const lines: string[] = [];
|
|
984
1031
|
const trimmedPreview = previewText.trimEnd();
|
|
985
1032
|
if (trimmedPreview.length > 0) {
|
|
@@ -1013,12 +1060,15 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1013
1060
|
notices?: readonly string[];
|
|
1014
1061
|
|
|
1015
1062
|
resolvedEnv?: Record<string, string>;
|
|
1063
|
+
unsetEnv: string[];
|
|
1016
1064
|
directMasterSpawn: boolean;
|
|
1017
1065
|
onUpdate?: AgentToolUpdateCallback<BashToolDetails>;
|
|
1018
1066
|
startBackgrounded: boolean;
|
|
1019
1067
|
onCompletion?: () => void;
|
|
1020
1068
|
/** Immutable attempt-scoped tool call id, when executed via a tool call. */
|
|
1021
1069
|
toolCallId?: string;
|
|
1070
|
+
/** Accepted activity declaration, mirrored into job progress and result details. */
|
|
1071
|
+
activity?: BashActivityDeclaration;
|
|
1022
1072
|
}): ManagedBashJobHandle {
|
|
1023
1073
|
const manager = this.#resolveOwnedJobManager();
|
|
1024
1074
|
if (!manager) {
|
|
@@ -1032,12 +1082,13 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1032
1082
|
: options.command;
|
|
1033
1083
|
let latestText = "";
|
|
1034
1084
|
let backgrounded = options.startBackgrounded;
|
|
1085
|
+
const activityDetails = options.activity === undefined ? {} : { activity: options.activity };
|
|
1035
1086
|
const runningDetails = (jobId: string): Record<string, unknown> | undefined =>
|
|
1036
|
-
backgrounded ? { async: { state: "running", jobId, type: "bash" } } : undefined;
|
|
1087
|
+
backgrounded ? { async: { state: "running", jobId, type: "bash" }, ...activityDetails } : undefined;
|
|
1037
1088
|
const completedDetails = (jobId: string): Record<string, unknown> | undefined =>
|
|
1038
|
-
backgrounded ? { async: { state: "completed", jobId, type: "bash" } } : undefined;
|
|
1089
|
+
backgrounded ? { async: { state: "completed", jobId, type: "bash" }, ...activityDetails } : undefined;
|
|
1039
1090
|
const failedDetails = (jobId: string): Record<string, unknown> | undefined =>
|
|
1040
|
-
backgrounded ? { async: { state: "failed", jobId, type: "bash" } } : undefined;
|
|
1091
|
+
backgrounded ? { async: { state: "failed", jobId, type: "bash" }, ...activityDetails } : undefined;
|
|
1041
1092
|
const completion = Promise.withResolvers<ManagedBashJobCompletion>();
|
|
1042
1093
|
|
|
1043
1094
|
const jobId = manager.register(
|
|
@@ -1067,6 +1118,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1067
1118
|
timeout: options.timeoutMs,
|
|
1068
1119
|
signal: runSignal,
|
|
1069
1120
|
env: options.resolvedEnv,
|
|
1121
|
+
unsetEnv: options.unsetEnv,
|
|
1070
1122
|
artifactPath,
|
|
1071
1123
|
artifactId,
|
|
1072
1124
|
artifactPublisher,
|
|
@@ -1088,6 +1140,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1088
1140
|
requestedTimeoutSec: options.requestedTimeoutSec,
|
|
1089
1141
|
notices: options.notices,
|
|
1090
1142
|
artifactReferenceInBody: true,
|
|
1143
|
+
activity: options.activity,
|
|
1091
1144
|
});
|
|
1092
1145
|
const finalText = this.#extractTextResult(finalResult);
|
|
1093
1146
|
latestText = finalText;
|
|
@@ -1110,7 +1163,10 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1110
1163
|
latestText = text;
|
|
1111
1164
|
await options.onUpdate?.({
|
|
1112
1165
|
content: [{ type: "text", text }],
|
|
1113
|
-
|
|
1166
|
+
// Backgrounded frames carry the job details verbatim; a foreground
|
|
1167
|
+
// frame has no job facts, but the activity declaration is per-call
|
|
1168
|
+
// metadata and stays attached so partial results are self-describing.
|
|
1169
|
+
details: backgrounded ? ((details ?? {}) as BashToolDetails) : (activityDetails as BashToolDetails),
|
|
1114
1170
|
});
|
|
1115
1171
|
},
|
|
1116
1172
|
},
|
|
@@ -1155,62 +1211,6 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1155
1211
|
return AsyncJobManager.forEndpoint(endpointId) ?? AsyncJobManager.instance();
|
|
1156
1212
|
}
|
|
1157
1213
|
|
|
1158
|
-
/**
|
|
1159
|
-
* Whether a queued user steer may fold the running foreground wait. Mirrors
|
|
1160
|
-
* the loop's steer admission: `busyPromptMode=queue` never admits a steer
|
|
1161
|
-
* into the busy run, so it never folds. `toolInterruptPolicy` is
|
|
1162
|
-
* deliberately NOT a gate: `finish_tools` means "do not kill the batch to
|
|
1163
|
-
* deliver a steer", and a fold kills nothing. It is the one way to deliver
|
|
1164
|
-
* the steer now AND let the command finish, so it applies under both
|
|
1165
|
-
* policies; the policy only decides what the loop does with sibling tools
|
|
1166
|
-
* after the fold returns. The auto-background setting is likewise not
|
|
1167
|
-
* consulted: like the chord, a steer fold is a user action.
|
|
1168
|
-
*
|
|
1169
|
-
* Fails closed: a session that cannot report newly admitted steering or
|
|
1170
|
-
* accept a fold request is not steer-foldable.
|
|
1171
|
-
*/
|
|
1172
|
-
#steerFoldEnabled(): boolean {
|
|
1173
|
-
const { waitForUserSteering, requestForegroundBashBackground } = this.session;
|
|
1174
|
-
if (!waitForUserSteering || !requestForegroundBashBackground) return false;
|
|
1175
|
-
return this.session.settings.get("busyPromptMode") === "steer";
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
/**
|
|
1179
|
-
* Fold `adapter` on the first user steer that ARRIVES after the wait has run
|
|
1180
|
-
* for {@link STEER_FOLD_GRACE_MS} since `startedAt`. A steer already queued
|
|
1181
|
-
* when the wait starts, or one that arrives inside the grace window, never
|
|
1182
|
-
* folds: the command finishes normally and that steer is consumed at the
|
|
1183
|
-
* ordinary tool boundary. The watcher keeps observing so a later qualifying
|
|
1184
|
-
* steer still folds, and re-checks the gate at that moment so a
|
|
1185
|
-
* `busyPromptMode` change during the command is honored.
|
|
1186
|
-
* Returns a stop function; call it when the wait settles. No-op when steer
|
|
1187
|
-
* folding is gated off at start.
|
|
1188
|
-
*/
|
|
1189
|
-
#watchSteerForFold(adapter: FoldAdapter, startedAt: number): () => void {
|
|
1190
|
-
if (!this.#steerFoldEnabled()) return () => {};
|
|
1191
|
-
const waitForSteer = this.session.waitForUserSteering;
|
|
1192
|
-
const requestFold = this.session.requestForegroundBashBackground;
|
|
1193
|
-
if (!waitForSteer || !requestFold) return () => {};
|
|
1194
|
-
const watch = new AbortController();
|
|
1195
|
-
const observe = async (): Promise<void> => {
|
|
1196
|
-
while (!watch.signal.aborted) {
|
|
1197
|
-
await waitForSteer(watch.signal);
|
|
1198
|
-
if (watch.signal.aborted) return;
|
|
1199
|
-
if (Date.now() - startedAt < STEER_FOLD_GRACE_MS) continue;
|
|
1200
|
-
if (!this.#steerFoldEnabled()) continue;
|
|
1201
|
-
await requestFold("steer", adapter);
|
|
1202
|
-
return;
|
|
1203
|
-
}
|
|
1204
|
-
};
|
|
1205
|
-
observe().catch((error: unknown) => {
|
|
1206
|
-
logger.warn("Steer-triggered fold failed", {
|
|
1207
|
-
jobId: adapter.jobId,
|
|
1208
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1209
|
-
});
|
|
1210
|
-
});
|
|
1211
|
-
return () => watch.abort();
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
1214
|
/**
|
|
1215
1215
|
* Race a managed job against the auto-background threshold, an explicit fold
|
|
1216
1216
|
* (chord / SDK control / steer), and abort. A steer that arrives once the
|
|
@@ -1269,7 +1269,9 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
1271
|
const stopSteerWatch =
|
|
1272
|
-
backgroundRequest && foldAdapter
|
|
1272
|
+
backgroundRequest && foldAdapter
|
|
1273
|
+
? watchSteerForFold(this.session, startedAt, fold => fold("steer", foldAdapter), foldAdapter.jobId)
|
|
1274
|
+
: () => {};
|
|
1273
1275
|
try {
|
|
1274
1276
|
return await Promise.race(waiters);
|
|
1275
1277
|
} finally {
|
|
@@ -1299,6 +1301,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1299
1301
|
command: string;
|
|
1300
1302
|
commandCwd: string;
|
|
1301
1303
|
resolvedEnv: Record<string, string>;
|
|
1304
|
+
unsetEnv: string[];
|
|
1302
1305
|
directMasterSpawn: boolean;
|
|
1303
1306
|
requestedTimeoutSec: number;
|
|
1304
1307
|
timeoutSec: number;
|
|
@@ -1471,6 +1474,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1471
1474
|
...(this.session.bashRestrictionProfile === "read-only" ? READ_ONLY_BASH_ENV : {}),
|
|
1472
1475
|
...(allowedPrefixes && allowedPrefixes.length > 0 ? { [GJC_RESTRICTED_ROLE_AGENT_BASH_ENV]: "1" } : {}),
|
|
1473
1476
|
};
|
|
1477
|
+
const unsetEnv = COORDINATOR_ONLY_BASH_ENV.filter(name => !Object.hasOwn(expandedEnv ?? {}, name));
|
|
1474
1478
|
|
|
1475
1479
|
if (cwd?.includes("://") || cwd?.includes("local:/")) {
|
|
1476
1480
|
cwd = await expandInternalUrls(cwd, { ...internalUrlOptions, noEscape: true });
|
|
@@ -1503,6 +1507,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1503
1507
|
command,
|
|
1504
1508
|
commandCwd,
|
|
1505
1509
|
resolvedEnv,
|
|
1510
|
+
unsetEnv,
|
|
1506
1511
|
directMasterSpawn,
|
|
1507
1512
|
requestedTimeoutSec,
|
|
1508
1513
|
timeoutSec,
|
|
@@ -1571,9 +1576,10 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1571
1576
|
notices: readonly string[],
|
|
1572
1577
|
signal: AbortSignal | undefined,
|
|
1573
1578
|
resolvedEnv: Record<string, string>,
|
|
1579
|
+
activity: BashActivityDeclaration | undefined,
|
|
1574
1580
|
): Promise<AgentToolResult<BashToolDetails>> {
|
|
1575
1581
|
const result = await this.#runDirectMasterSpawn(command, commandCwd, timeoutMs, signal, resolvedEnv);
|
|
1576
|
-
return this.#buildCompletedResult(result, timeoutSec, { requestedTimeoutSec, notices });
|
|
1582
|
+
return this.#buildCompletedResult(result, timeoutSec, { requestedTimeoutSec, notices, activity });
|
|
1577
1583
|
}
|
|
1578
1584
|
|
|
1579
1585
|
/**
|
|
@@ -1665,6 +1671,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1665
1671
|
timeout: monitorTimeoutMs,
|
|
1666
1672
|
signal,
|
|
1667
1673
|
env: prepared.resolvedEnv,
|
|
1674
|
+
unsetEnv: prepared.unsetEnv,
|
|
1668
1675
|
artifactPath,
|
|
1669
1676
|
artifactId,
|
|
1670
1677
|
artifactPublisher,
|
|
@@ -1723,6 +1730,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1723
1730
|
|
|
1724
1731
|
async: asyncRequested = false,
|
|
1725
1732
|
pty = false,
|
|
1733
|
+
activity,
|
|
1726
1734
|
}: BashToolInput,
|
|
1727
1735
|
signal?: AbortSignal,
|
|
1728
1736
|
onUpdate?: AgentToolUpdateCallback<BashToolDetails>,
|
|
@@ -1750,6 +1758,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1750
1758
|
command,
|
|
1751
1759
|
commandCwd,
|
|
1752
1760
|
resolvedEnv,
|
|
1761
|
+
unsetEnv,
|
|
1753
1762
|
directMasterSpawn,
|
|
1754
1763
|
requestedTimeoutSec,
|
|
1755
1764
|
timeoutSec,
|
|
@@ -1767,6 +1776,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1767
1776
|
pendingNotices,
|
|
1768
1777
|
signal,
|
|
1769
1778
|
resolvedEnv,
|
|
1779
|
+
activity,
|
|
1770
1780
|
);
|
|
1771
1781
|
}
|
|
1772
1782
|
|
|
@@ -1788,10 +1798,12 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1788
1798
|
notices: pendingNotices,
|
|
1789
1799
|
|
|
1790
1800
|
resolvedEnv,
|
|
1801
|
+
unsetEnv,
|
|
1791
1802
|
directMasterSpawn,
|
|
1792
1803
|
onUpdate,
|
|
1793
1804
|
startBackgrounded: true,
|
|
1794
1805
|
toolCallId,
|
|
1806
|
+
activity,
|
|
1795
1807
|
});
|
|
1796
1808
|
const jobGeneration = asyncManager.getJob(job.jobId)?.generation ?? job.jobId;
|
|
1797
1809
|
job.setBackgrounded(true);
|
|
@@ -1799,6 +1811,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1799
1811
|
return this.#buildBackgroundStartResult(job.jobId, job.label, "", timeoutSec, {
|
|
1800
1812
|
requestedTimeoutSec,
|
|
1801
1813
|
notices: pendingNotices,
|
|
1814
|
+
activity,
|
|
1802
1815
|
});
|
|
1803
1816
|
}
|
|
1804
1817
|
|
|
@@ -1838,6 +1851,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1838
1851
|
notices: pendingNotices,
|
|
1839
1852
|
|
|
1840
1853
|
resolvedEnv,
|
|
1854
|
+
unsetEnv,
|
|
1841
1855
|
directMasterSpawn,
|
|
1842
1856
|
onUpdate,
|
|
1843
1857
|
startBackgrounded,
|
|
@@ -1845,6 +1859,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1845
1859
|
managedForegroundSettled = true;
|
|
1846
1860
|
},
|
|
1847
1861
|
toolCallId,
|
|
1862
|
+
activity,
|
|
1848
1863
|
});
|
|
1849
1864
|
const jobGeneration = ownedManager.getJob(job.jobId)?.generation ?? job.jobId;
|
|
1850
1865
|
if (startBackgrounded) {
|
|
@@ -1853,6 +1868,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1853
1868
|
return this.#buildBackgroundStartResult(job.jobId, job.label, "", timeoutSec, {
|
|
1854
1869
|
requestedTimeoutSec,
|
|
1855
1870
|
notices: pendingNotices,
|
|
1871
|
+
activity,
|
|
1856
1872
|
});
|
|
1857
1873
|
}
|
|
1858
1874
|
const backgroundRequest = Promise.withResolvers<FoldReason>();
|
|
@@ -1948,6 +1964,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
1948
1964
|
requestedTimeoutSec,
|
|
1949
1965
|
notices: pendingNotices,
|
|
1950
1966
|
foldReason: waitResult.reason,
|
|
1967
|
+
activity,
|
|
1951
1968
|
});
|
|
1952
1969
|
}
|
|
1953
1970
|
|
|
@@ -2246,6 +2263,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2246
2263
|
requestedTimeoutSec,
|
|
2247
2264
|
notices: timeoutNotices,
|
|
2248
2265
|
terminalId: handle.terminalId,
|
|
2266
|
+
activity,
|
|
2249
2267
|
});
|
|
2250
2268
|
}
|
|
2251
2269
|
|
|
@@ -2378,6 +2396,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2378
2396
|
requestedTimeoutSec,
|
|
2379
2397
|
notices: bridgeNotices,
|
|
2380
2398
|
terminalId: handle.terminalId,
|
|
2399
|
+
activity,
|
|
2381
2400
|
});
|
|
2382
2401
|
};
|
|
2383
2402
|
|
|
@@ -2419,7 +2438,12 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2419
2438
|
bridgeCompletion.resolve({ kind: "completed", result });
|
|
2420
2439
|
await reportProgress(
|
|
2421
2440
|
finalText,
|
|
2422
|
-
bridgeBackgrounded
|
|
2441
|
+
bridgeBackgrounded
|
|
2442
|
+
? {
|
|
2443
|
+
async: { state: "completed", jobId, type: "bash" },
|
|
2444
|
+
...(activity === undefined ? {} : { activity }),
|
|
2445
|
+
}
|
|
2446
|
+
: undefined,
|
|
2423
2447
|
);
|
|
2424
2448
|
return finalText;
|
|
2425
2449
|
} catch (error) {
|
|
@@ -2429,7 +2453,12 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2429
2453
|
bridgeCompletion.resolve({ kind: "failed", error });
|
|
2430
2454
|
await reportProgress(
|
|
2431
2455
|
message,
|
|
2432
|
-
bridgeBackgrounded
|
|
2456
|
+
bridgeBackgrounded
|
|
2457
|
+
? {
|
|
2458
|
+
async: { state: "failed", jobId, type: "bash" },
|
|
2459
|
+
...(activity === undefined ? {} : { activity }),
|
|
2460
|
+
}
|
|
2461
|
+
: undefined,
|
|
2433
2462
|
);
|
|
2434
2463
|
throw error;
|
|
2435
2464
|
} finally {
|
|
@@ -2556,6 +2585,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2556
2585
|
notices: pendingNotices,
|
|
2557
2586
|
terminalId: handle.terminalId,
|
|
2558
2587
|
foldReason: bridgeWait.reason,
|
|
2588
|
+
activity,
|
|
2559
2589
|
});
|
|
2560
2590
|
}
|
|
2561
2591
|
|
|
@@ -2594,6 +2624,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2594
2624
|
timeoutMs,
|
|
2595
2625
|
signal,
|
|
2596
2626
|
env: resolvedEnv,
|
|
2627
|
+
unsetEnv,
|
|
2597
2628
|
artifactPath,
|
|
2598
2629
|
artifactId,
|
|
2599
2630
|
artifactPublisher,
|
|
@@ -2640,6 +2671,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2640
2671
|
outcome = await controls.terminalCompletion;
|
|
2641
2672
|
const completed = this.#buildCompletedResult(outcome, timeoutSec, {
|
|
2642
2673
|
requestedTimeoutSec,
|
|
2674
|
+
activity,
|
|
2643
2675
|
});
|
|
2644
2676
|
return this.#extractTextResult(completed);
|
|
2645
2677
|
} finally {
|
|
@@ -2707,6 +2739,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2707
2739
|
requestedTimeoutSec,
|
|
2708
2740
|
notices: pendingNotices,
|
|
2709
2741
|
foldReason: receipt.reason,
|
|
2742
|
+
activity,
|
|
2710
2743
|
});
|
|
2711
2744
|
const outcome = controls.detachObserver(
|
|
2712
2745
|
interactiveResultFromText(this.#extractTextResult(started)),
|
|
@@ -2722,7 +2755,12 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2722
2755
|
resolveForegroundObserver: () => "already-settled",
|
|
2723
2756
|
};
|
|
2724
2757
|
const unregisterPtyFold = this.session.registerForegroundFoldParticipant?.(ptyFoldAdapter);
|
|
2725
|
-
const stopPtySteerWatch =
|
|
2758
|
+
const stopPtySteerWatch = watchSteerForFold(
|
|
2759
|
+
this.session,
|
|
2760
|
+
ptyStartedAt,
|
|
2761
|
+
fold => fold("steer", ptyFoldAdapter),
|
|
2762
|
+
ptyFoldAdapter.jobId,
|
|
2763
|
+
);
|
|
2726
2764
|
ptyFoldUnregister = () => {
|
|
2727
2765
|
stopPtySteerWatch();
|
|
2728
2766
|
unregisterPtyFold?.();
|
|
@@ -2755,6 +2793,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2755
2793
|
timeout: timeoutMs,
|
|
2756
2794
|
signal,
|
|
2757
2795
|
env: resolvedEnv,
|
|
2796
|
+
unsetEnv,
|
|
2758
2797
|
artifactPath,
|
|
2759
2798
|
artifactId,
|
|
2760
2799
|
artifactPublisher,
|
|
@@ -2790,6 +2829,7 @@ export class BashTool implements AgentTool<BashToolSchema, BashToolDetails> {
|
|
|
2790
2829
|
return this.#buildCompletedResult(result, timeoutSec, {
|
|
2791
2830
|
requestedTimeoutSec,
|
|
2792
2831
|
notices: pendingNotices,
|
|
2832
|
+
activity,
|
|
2793
2833
|
});
|
|
2794
2834
|
}
|
|
2795
2835
|
}
|