@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
|
@@ -658,7 +658,44 @@ export declare const RESUME_TRANSCRIPT_MAX_BYTES: number;
|
|
|
658
658
|
* source exactly at the advertised limit.
|
|
659
659
|
*/
|
|
660
660
|
export declare const BOUNDED_RESUME_TRANSCRIPT_MAX_BYTES: number;
|
|
661
|
-
|
|
661
|
+
/**
|
|
662
|
+
* Recovery actions offered when a live transcript is at or past the managed
|
|
663
|
+
* per-file cap.
|
|
664
|
+
*
|
|
665
|
+
* Constrained three ways, and every command named here satisfies all three:
|
|
666
|
+
*
|
|
667
|
+
* 1. **It must exist.** `gjc export <session-file>` was advised for both limits
|
|
668
|
+
* and is not a subcommand, so following it literally started a fresh agent
|
|
669
|
+
* that read "export" as a prompt while the session stayed unwritable. (The
|
|
670
|
+
* root `--export` flag renders HTML and exits; it yields no resumable
|
|
671
|
+
* session.)
|
|
672
|
+
* 2. **It must be reachable on every surface that renders the message.** These
|
|
673
|
+
* strings reach ACP/text consumers through `AgentSession`, and the ACP
|
|
674
|
+
* registry is filtered to definitions carrying `handle`
|
|
675
|
+
* (`slash-commands/acp-builtins.ts`), so a `handleTui`-only command such as
|
|
676
|
+
* `/new` is a different dead end rather than a fix.
|
|
677
|
+
* 3. **It must not drop the retained near-limit entries.** A failed append is
|
|
678
|
+
* kept in memory with a full rewrite armed, and a rejected managed rewrite
|
|
679
|
+
* likewise retains its resident entries; both messages promise the work
|
|
680
|
+
* persists on the next successful write. `/compact` and `/clear` keep the
|
|
681
|
+
* manager — and therefore that pending debt — alive; a session switch closes
|
|
682
|
+
* the writer without paying it.
|
|
683
|
+
*
|
|
684
|
+
* Every near-limit error class MUST interpolate this constant rather than
|
|
685
|
+
* restate the advice. `SessionNearLimitRewriteError` restated it and thereby
|
|
686
|
+
* reintroduced `gjc export <session-file>` after #5621 removed it (#5691).
|
|
687
|
+
*
|
|
688
|
+
* `session-recovery-guidance.test.ts` pins all three constraints against the
|
|
689
|
+
* CLI, builtin, and ACP registries, for every near-limit error class.
|
|
690
|
+
*/
|
|
691
|
+
export declare const SESSION_LIMIT_RECOVERY_ACTIONS = "compact the session (`/compact`), or clear its context (`/clear`) if compaction cannot reclaim enough";
|
|
692
|
+
/**
|
|
693
|
+
* Oversized-resume guidance. This surface is reached *before* a session is
|
|
694
|
+
* opened, so it deliberately does not reuse {@link SESSION_LIMIT_RECOVERY_ACTIONS}:
|
|
695
|
+
* an in-session command there would act on whichever session the user resumes
|
|
696
|
+
* next, never on the transcript that was just rejected.
|
|
697
|
+
*/
|
|
698
|
+
export declare const SESSION_OVERSIZED_RECOVERY_MESSAGE = "The selected session transcript is too large to resume safely. Resume a different session, or remove/archive this transcript after confirming its content is no longer needed.";
|
|
662
699
|
export declare class SessionAppendPersistenceError extends Error {
|
|
663
700
|
readonly phase: SessionAppendPersistenceFailurePhase;
|
|
664
701
|
readonly entryId: string;
|
|
@@ -692,6 +729,28 @@ export declare class SessionNearLimitAppendError extends Error {
|
|
|
692
729
|
entryRetained: boolean;
|
|
693
730
|
});
|
|
694
731
|
}
|
|
732
|
+
/**
|
|
733
|
+
* Typed near-limit rewrite outcome (follow-up to #4566).
|
|
734
|
+
*
|
|
735
|
+
* A managed atomic rewrite (`#writeEntriesAtomicallySync`) whose serialized
|
|
736
|
+
* transcript crosses the per-file cap cannot be published: the managed store
|
|
737
|
+
* rejects the bytes with `content_too_large`. Unlike the append path there is
|
|
738
|
+
* no appended entry here — the whole live transcript is the payload — so this
|
|
739
|
+
* error carries the rejected rewrite size and the cap instead of append
|
|
740
|
+
* fields, and every rewrite/flush/close caller can point at compaction or
|
|
741
|
+
* export as the continuation path.
|
|
742
|
+
*/
|
|
743
|
+
export declare class SessionNearLimitRewriteError extends Error {
|
|
744
|
+
readonly code: "near_limit_rewrite";
|
|
745
|
+
/** Serialized transcript size (bytes) rejected by the managed store. */
|
|
746
|
+
readonly transcriptBytes: number;
|
|
747
|
+
/** Managed per-file cap in force when the rewrite was rejected. */
|
|
748
|
+
readonly capBytes: number;
|
|
749
|
+
constructor(details: {
|
|
750
|
+
transcriptBytes: number;
|
|
751
|
+
capBytes: number;
|
|
752
|
+
});
|
|
753
|
+
}
|
|
695
754
|
export declare class SessionManagedStorageError extends Error {
|
|
696
755
|
readonly code = "managed_storage_unsupported";
|
|
697
756
|
constructor();
|
|
@@ -1037,6 +1096,7 @@ export declare const SessionManagerTestHooks: {
|
|
|
1037
1096
|
afterForkTranscriptPublished?: () => void | Promise<void>;
|
|
1038
1097
|
beforeEphemeralArtifactManagerInstall?: (dir: string) => void | Promise<void>;
|
|
1039
1098
|
beforePersistPatchFence?: (attempt: number) => void;
|
|
1099
|
+
beforeLivePickerStarFence?: () => void;
|
|
1040
1100
|
beforeStrictMissingCheck?: (filePath: string, storage: SessionStorage) => void;
|
|
1041
1101
|
beforeManagedResumeAcceptance?: (filePath: string, storage: SessionStorage) => void;
|
|
1042
1102
|
beforeManagedResumeReturn?: (filePath: string, storage: SessionStorage) => void;
|
|
@@ -1421,6 +1481,9 @@ export declare class SessionManager {
|
|
|
1421
1481
|
getSessionName(): string | undefined;
|
|
1422
1482
|
isSessionStarred(): boolean;
|
|
1423
1483
|
setSessionStarred(starred: boolean): Promise<boolean>;
|
|
1484
|
+
setSessionStarredForPicker(session: SessionInfo, starred: boolean): Promise<void>;
|
|
1485
|
+
/** Update only a picker candidate's metadata, without opening a runtime or publishing a resume breadcrumb. */
|
|
1486
|
+
static setSessionStarredForPicker(session: SessionInfo, starred: boolean, explicitSessionDir?: string): Promise<void>;
|
|
1424
1487
|
setSessionName(name: string, source?: "auto" | "user"): Promise<boolean>;
|
|
1425
1488
|
_persist(entry: SessionEntry): void;
|
|
1426
1489
|
/** Append a configured fallback chain as child of current leaf, then advance leaf. Returns entry id. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One authoritative, reference-counted lease for work that still needs a
|
|
3
|
+
* session host. Each admitted work state owns one handle and releases that
|
|
4
|
+
* handle at its terminal boundary; the host only observes whether any handle
|
|
5
|
+
* remains held.
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionWorkLeaseHandle {
|
|
8
|
+
release(): void;
|
|
9
|
+
}
|
|
10
|
+
export interface SessionWorkLease {
|
|
11
|
+
acquire(): SessionWorkLeaseHandle;
|
|
12
|
+
isHeld(): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSessionWorkLease(): SessionWorkLease;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MODEL_ONBOARDING_API_PROVIDER_COMMAND = "/provider add --compat <openai|anthropic> --provider <id> --base-url <url> --api-key-env <ENV> --model <model>";
|
|
1
|
+
export declare const MODEL_ONBOARDING_API_PROVIDER_COMMAND = "/provider add --compat <openai|anthropic> --provider <id> --base-url <url> --api-key-env <ENV> (--model <model> | --discover)";
|
|
2
2
|
export declare const MODEL_ONBOARDING_PROVIDER_PRESET_COMMAND = "/provider add --preset <id>";
|
|
3
3
|
export declare const MODEL_ONBOARDING_SETUP_COMMAND = "gjc setup provider";
|
|
4
4
|
export declare const MODEL_ONBOARDING_OAUTH_COMMAND = "/provider login [provider-id] or /login [provider-id]";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AuthStorage } from "@gajae-code/ai/core";
|
|
1
2
|
import { type ModelsConfig, type ProviderDiscovery } from "../config/models-config-schema";
|
|
2
3
|
export type ProviderCompatibility = "openai" | "anthropic";
|
|
3
4
|
export type ProviderSetupApi = "openai-responses" | "openai-completions" | "anthropic-messages";
|
|
@@ -11,6 +12,37 @@ export interface ProviderSetupInput {
|
|
|
11
12
|
models?: string[];
|
|
12
13
|
modelsPath?: string;
|
|
13
14
|
force?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Opt into live OpenAI `/v1/models` discovery for an OpenAI-compatible
|
|
17
|
+
* custom provider. Manual `--model` ids may be omitted when set; the
|
|
18
|
+
* runtime auto-discovers the catalog on refresh and merges it without
|
|
19
|
+
* duplicates.
|
|
20
|
+
*
|
|
21
|
+
* When no manual models are given, setup probes the endpoint before
|
|
22
|
+
* writing config so an unreachable endpoint, rejected credential, or
|
|
23
|
+
* empty catalog fails the setup loudly instead of writing a provider
|
|
24
|
+
* that can never serve a model. There is deliberately no skip flag: the
|
|
25
|
+
* pre-write probe is the enforcement point, and the wizard's
|
|
26
|
+
* interactive probe is a preview only (inputs may have changed since).
|
|
27
|
+
*/
|
|
28
|
+
discover?: boolean;
|
|
29
|
+
/** Probe override for tests; defaults to the live endpoint probe. */
|
|
30
|
+
probeDiscovery?: (input: ProviderDiscoveryProbeInput) => Promise<ProviderDiscoveryProbeResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Cancel discovery and persistence until the atomic config rename is
|
|
33
|
+
* invoked. Later cancellation does not undo a committed provider.
|
|
34
|
+
* Combined with the shared deadline inside the probe; callers that omit
|
|
35
|
+
* it get deadline-only probe behavior.
|
|
36
|
+
*/
|
|
37
|
+
discoverySignal?: AbortSignal;
|
|
38
|
+
/**
|
|
39
|
+
* Live credential authority for literal-key persistence. Interactive
|
|
40
|
+
* callers pass the active session registry's AuthStorage so the
|
|
41
|
+
* subsequent targeted online refresh authenticates from the same
|
|
42
|
+
* authority that stored the key. When omitted, onboarding falls back
|
|
43
|
+
* to a short-lived store at the agent DB path (headless/CLI behavior).
|
|
44
|
+
*/
|
|
45
|
+
authStorage?: ProviderSetupCredentialStore;
|
|
14
46
|
}
|
|
15
47
|
export interface ProviderSetupResult {
|
|
16
48
|
providerId: string;
|
|
@@ -21,11 +53,18 @@ export interface ProviderSetupResult {
|
|
|
21
53
|
modelsPath: string;
|
|
22
54
|
redactedApiKey: string;
|
|
23
55
|
credentialSource: "literal" | "env";
|
|
56
|
+
/** True when the provider persists a `discovery:` block (live catalog). */
|
|
57
|
+
discoveryEnabled: boolean;
|
|
58
|
+
/** The persisted discovery type, when any (e.g. `openai-models-list`). */
|
|
59
|
+
discoveryType?: string;
|
|
24
60
|
preset?: string;
|
|
25
61
|
presetName?: string;
|
|
26
62
|
}
|
|
27
63
|
type ProviderConfig = NonNullable<NonNullable<ModelsConfig["providers"]>[string]>;
|
|
28
64
|
type ProviderCompatConfig = NonNullable<ProviderConfig["compat"]>;
|
|
65
|
+
type ProviderSetupCredentialStore = Pick<AuthStorage, "set" | "remove" | "exportSnapshot"> & {
|
|
66
|
+
peekApiKey?: (provider: string) => Promise<string | undefined>;
|
|
67
|
+
};
|
|
29
68
|
interface ProviderPreset {
|
|
30
69
|
id: string;
|
|
31
70
|
aliases: readonly string[];
|
|
@@ -54,8 +93,49 @@ export declare function parseProviderCompatibility(value: string): ProviderCompa
|
|
|
54
93
|
export declare function findProviderPreset(value: string | undefined): ProviderPreset | undefined;
|
|
55
94
|
export declare function formatProviderPresetList(): string;
|
|
56
95
|
export declare function parseModelList(values: readonly string[]): string[];
|
|
57
|
-
export declare function redactSecret(
|
|
96
|
+
export declare function redactSecret(_secret: string): string;
|
|
58
97
|
export declare function validateModelApi(modelApi: Readonly<Record<string, string>> | undefined, models: readonly string[], presetId: string): void;
|
|
59
98
|
export declare function addApiCompatibleProvider(input: ProviderSetupInput): Promise<ProviderSetupResult>;
|
|
99
|
+
export interface ProviderDiscoveryProbeInput {
|
|
100
|
+
baseUrl: string;
|
|
101
|
+
apiKeyEnv?: string;
|
|
102
|
+
apiKey?: string;
|
|
103
|
+
timeoutMs?: number;
|
|
104
|
+
signal?: AbortSignal;
|
|
105
|
+
}
|
|
106
|
+
export interface ProviderDiscoveryProbeResult {
|
|
107
|
+
models: string[];
|
|
108
|
+
endpoint: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Probe an OpenAI-compatible `/v1/models` endpoint and return the sorted
|
|
112
|
+
* model ids. Used by the Add-custom-provider wizard so gateway catalogs
|
|
113
|
+
* (LiteLLM and friends) do not need manual transcription.
|
|
114
|
+
*
|
|
115
|
+
* Credential handling: an `apiKeyEnv` name resolves through the trusted
|
|
116
|
+
* credential env only (never `cwd/.env`); a literal `apiKey` is used as-is.
|
|
117
|
+
* Errors name the redacted endpoint only — the key material never appears
|
|
118
|
+
* in messages, and callers must not log the request headers.
|
|
119
|
+
*/
|
|
120
|
+
export declare function probeOpenAIModelsList(input: ProviderDiscoveryProbeInput): Promise<ProviderDiscoveryProbeResult>;
|
|
121
|
+
export interface DiscoveryCatalogRefresher {
|
|
122
|
+
refresh(mode: "offline" | "online" | "online-if-uncached", credentialSessionId?: string): Promise<void>;
|
|
123
|
+
refreshProvider(providerId: string, strategy?: "offline" | "online" | "online-if-uncached", credentialSessionId?: string): Promise<void>;
|
|
124
|
+
getProviderDiscoveryState(providerId: string): {
|
|
125
|
+
status: string;
|
|
126
|
+
error?: string;
|
|
127
|
+
} | undefined;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Reload static config offline, then refresh only the newly added discovery
|
|
131
|
+
* provider online so freshly requested live catalogs are selectable
|
|
132
|
+
* immediately (including alongside manual models). Preset-managed
|
|
133
|
+
* discovery is excluded by callers: presets resolve lazily at runtime.
|
|
134
|
+
* Returns a recovery hint instead of reporting unconditional success when
|
|
135
|
+
* the live catalog stays unavailable: the config is saved and valid, but
|
|
136
|
+
* the user needs to know the catalog did not populate and how to recover
|
|
137
|
+
* (wait for the next refresh, or re-add with explicit `--model` ids).
|
|
138
|
+
*/
|
|
139
|
+
export declare function reloadAndRefreshDiscoveryCatalog(registry: DiscoveryCatalogRefresher, providerId: string, credentialSessionId?: string): Promise<string | null>;
|
|
60
140
|
export declare function formatProviderSetupResult(result: ProviderSetupResult): string;
|
|
61
141
|
export {};
|
|
@@ -514,6 +514,8 @@ export interface AgentProgress {
|
|
|
514
514
|
}>;
|
|
515
515
|
recentOutput: string[];
|
|
516
516
|
toolCount: number;
|
|
517
|
+
/** Epoch ms of the latest event observed from this subagent (any agent event). */
|
|
518
|
+
lastActivityMs?: number;
|
|
517
519
|
/** Cumulative input + output + cacheWrite tokens across all turns. Excludes cacheRead (re-reads cached context every turn, making cumulative sum misleading). */
|
|
518
520
|
tokens: number;
|
|
519
521
|
/**
|
|
@@ -30,6 +30,7 @@ export declare function runInteractiveBashPty(ui: NonNullable<AgentToolContext["
|
|
|
30
30
|
timeoutMs: number;
|
|
31
31
|
signal?: AbortSignal;
|
|
32
32
|
env?: Record<string, string>;
|
|
33
|
+
unsetEnv?: string[];
|
|
33
34
|
artifactPath?: string;
|
|
34
35
|
artifactId?: string;
|
|
35
36
|
artifactPublisher?: TerminalArtifactPublisher;
|
|
@@ -8,25 +8,40 @@ import { type Theme } from "../modes/theme/theme";
|
|
|
8
8
|
import { type SdkSpawnArgs } from "../sdk/cli/master-cli";
|
|
9
9
|
import type { ToolSession } from ".";
|
|
10
10
|
import { type OutputMeta } from "./output-meta";
|
|
11
|
+
export { STEER_FOLD_GRACE_MS, steerFoldReasonLine } from "./steer-fold";
|
|
11
12
|
export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
|
|
12
|
-
/**
|
|
13
|
-
* A user steer folds a running foreground bash call only after it has been
|
|
14
|
-
* running at least this long. Shorter commands finish normally and the steer is
|
|
15
|
-
* consumed at the ordinary tool boundary, so a quick `git status` never turns
|
|
16
|
-
* into a background job plus a wake-up turn.
|
|
17
|
-
*/
|
|
18
|
-
export declare const STEER_FOLD_GRACE_MS = 2000;
|
|
19
|
-
/** Model-facing line appended to a steer-folded background-start result. */
|
|
20
|
-
export declare function steerFoldReasonLine(jobId: string): string;
|
|
21
13
|
export type BashOriginalArtifactSaveResult = BashArtifactSaveResult;
|
|
22
14
|
export declare function suffixPrefixOverlap(source: string, target: string): number;
|
|
23
15
|
export declare function saveBashOriginalArtifactForTests(session: ToolSession, originalText: string, onResult?: (result: BashOriginalArtifactSaveResult) => void): Promise<string | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Model-declared activity metadata for the browser-backend routing contract
|
|
18
|
+
* (`browser.backend: aside`). When that contract routes a browser task through
|
|
19
|
+
* Bash, it requires the call to declare the activity structurally so consumers
|
|
20
|
+
* can project it without parsing the command text. The declaration is
|
|
21
|
+
* model-declared and schema-validated only: nothing here verifies that the
|
|
22
|
+
* command actually invokes Aside, and the executor never inspects `command`.
|
|
23
|
+
*/
|
|
24
|
+
export type BashActivityProvider = "aside";
|
|
25
|
+
export type BashActivityMode = "repl" | "exec";
|
|
26
|
+
export interface BashActivityDeclaration {
|
|
27
|
+
kind: "browser";
|
|
28
|
+
provider: BashActivityProvider;
|
|
29
|
+
mode: BashActivityMode;
|
|
30
|
+
}
|
|
24
31
|
declare const bashSchemaBase: z.ZodObject<{
|
|
25
32
|
command: z.ZodString;
|
|
26
33
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
34
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
28
35
|
cwd: z.ZodOptional<z.ZodString>;
|
|
29
36
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
activity: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"browser">;
|
|
39
|
+
provider: z.ZodLiteral<"aside">;
|
|
40
|
+
mode: z.ZodEnum<{
|
|
41
|
+
exec: "exec";
|
|
42
|
+
repl: "repl";
|
|
43
|
+
}>;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
30
45
|
}, z.core.$strip>;
|
|
31
46
|
declare const bashSchemaWithAsync: z.ZodObject<{
|
|
32
47
|
command: z.ZodString;
|
|
@@ -34,6 +49,14 @@ declare const bashSchemaWithAsync: z.ZodObject<{
|
|
|
34
49
|
timeout: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
35
50
|
cwd: z.ZodOptional<z.ZodString>;
|
|
36
51
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
activity: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"browser">;
|
|
54
|
+
provider: z.ZodLiteral<"aside">;
|
|
55
|
+
mode: z.ZodEnum<{
|
|
56
|
+
exec: "exec";
|
|
57
|
+
repl: "repl";
|
|
58
|
+
}>;
|
|
59
|
+
}, z.core.$strict>>>;
|
|
37
60
|
async: z.ZodOptional<z.ZodBoolean>;
|
|
38
61
|
}, z.core.$strip>;
|
|
39
62
|
type BashToolSchema = typeof bashSchemaBase | typeof bashSchemaWithAsync;
|
|
@@ -44,6 +67,8 @@ export interface BashToolInput {
|
|
|
44
67
|
cwd?: string;
|
|
45
68
|
async?: boolean;
|
|
46
69
|
pty?: boolean;
|
|
70
|
+
/** Accepted activity declaration, mirrored into {@link BashToolDetails.activity}. */
|
|
71
|
+
activity?: BashActivityDeclaration;
|
|
47
72
|
}
|
|
48
73
|
export interface BashToolDetails {
|
|
49
74
|
meta?: OutputMeta;
|
|
@@ -52,6 +77,8 @@ export interface BashToolDetails {
|
|
|
52
77
|
terminalId?: string;
|
|
53
78
|
/** Why the foreground wait was folded, when this result is a background-start after a fold. */
|
|
54
79
|
foldReason?: FoldReason;
|
|
80
|
+
/** The accepted model-declared activity declaration, when the call carried one. */
|
|
81
|
+
activity?: BashActivityDeclaration;
|
|
55
82
|
async?: {
|
|
56
83
|
state: "running" | "completed" | "failed";
|
|
57
84
|
jobId: string;
|
|
@@ -104,7 +131,7 @@ export declare class BashTool implements AgentTool<BashToolSchema, BashToolDetai
|
|
|
104
131
|
label: string;
|
|
105
132
|
commandCwd: string;
|
|
106
133
|
}>;
|
|
107
|
-
execute(toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
|
|
134
|
+
execute(toolCallId: string, { command: rawCommand, env: rawEnv, timeout: rawTimeout, cwd, async: asyncRequested, pty, activity, }: BashToolInput, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<BashToolDetails>, ctx?: AgentToolContext): Promise<AgentToolResult<BashToolDetails>>;
|
|
108
135
|
}
|
|
109
136
|
export interface BashRenderArgs {
|
|
110
137
|
command?: string;
|
|
@@ -173,4 +200,3 @@ export declare const bashToolRenderer: {
|
|
|
173
200
|
mergeCallAndResult: boolean;
|
|
174
201
|
inline: boolean;
|
|
175
202
|
};
|
|
176
|
-
export {};
|
|
@@ -4,8 +4,9 @@ import type { Settings } from "../config/settings";
|
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
7
|
+
import type { AgentStorage } from "../session/agent-storage";
|
|
7
8
|
import { type TruncationDirection } from "../session/streaming-output";
|
|
8
|
-
import type
|
|
9
|
+
import { type RenderResult } from "../web/scrapers/types";
|
|
9
10
|
import { type OutputMeta } from "./output-meta";
|
|
10
11
|
export declare function isReadableUrlPath(value: string): boolean;
|
|
11
12
|
export interface ParsedReadUrlTarget {
|
|
@@ -27,6 +28,14 @@ interface FetchImagePayload {
|
|
|
27
28
|
type FetchRenderResult = RenderResult & {
|
|
28
29
|
image?: FetchImagePayload;
|
|
29
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Try all special handlers
|
|
33
|
+
*/
|
|
34
|
+
declare function handleSpecialUrls(url: string, timeout: number, signal: AbortSignal | undefined, storage: AgentStorage | null): Promise<FetchRenderResult | null>;
|
|
35
|
+
/** Test-only seam for verifying lazy special-handler loading and dispatch. */
|
|
36
|
+
export declare const fetchSpecialHandlerTestHooks: {
|
|
37
|
+
dispatch: typeof handleSpecialUrls;
|
|
38
|
+
};
|
|
30
39
|
export declare function tryInsaneFallback(args: {
|
|
31
40
|
url: string;
|
|
32
41
|
finalUrl: string;
|
|
@@ -15,7 +15,7 @@ type JobParams = z.infer<typeof jobSchema>;
|
|
|
15
15
|
interface JobSnapshot {
|
|
16
16
|
id: string;
|
|
17
17
|
type: "bash" | "task";
|
|
18
|
-
status: "running" | "completed" | "failed" | "cancelled";
|
|
18
|
+
status: "running" | "paused" | "completed" | "failed" | "cancelled";
|
|
19
19
|
label: string;
|
|
20
20
|
durationMs: number;
|
|
21
21
|
/** Present when the job was folded out of a foreground wait. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FoldReason } from "../async/job-manager";
|
|
2
|
+
import type { ToolSession } from ".";
|
|
3
|
+
/** A short foreground wait stays in the foreground even when a steer is admitted. */
|
|
4
|
+
export declare const STEER_FOLD_GRACE_MS = 2000;
|
|
5
|
+
/** Model-facing line appended to a steer-folded background-start result. */
|
|
6
|
+
export declare function steerFoldReasonLine(jobId: string): string;
|
|
7
|
+
/** Model-facing cause clause for a fold, keyed by the recorded {@link FoldReason}. */
|
|
8
|
+
export declare function foldReasonClause(reason: FoldReason): string;
|
|
9
|
+
/** Model-facing line used when the `job` tool's own wait is folded; states the real trigger. */
|
|
10
|
+
export declare function foldAwaitReasonLine(folded: ReadonlyMap<string, FoldReason>): string;
|
|
11
|
+
type SteerFoldSession = Pick<ToolSession, "settings" | "waitForUserSteering" | "requestForegroundBashBackground">;
|
|
12
|
+
/** The session hooks a steer fold needs, resolved once so callers never re-read and non-null-assert them. */
|
|
13
|
+
interface SteerFoldHooks {
|
|
14
|
+
waitForSteer: NonNullable<ToolSession["waitForUserSteering"]>;
|
|
15
|
+
requestFold: NonNullable<ToolSession["requestForegroundBashBackground"]>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Fold on the first user steer that ARRIVES after the wait has run for
|
|
19
|
+
* {@link STEER_FOLD_GRACE_MS} since `startedAt`. A steer already queued when
|
|
20
|
+
* the wait starts, or one that arrives inside the grace window, never folds:
|
|
21
|
+
* the wait finishes normally and that steer is consumed at the ordinary tool
|
|
22
|
+
* boundary. The watcher keeps observing so a later qualifying steer still
|
|
23
|
+
* folds, and re-checks the gate at that moment so a `busyPromptMode` change
|
|
24
|
+
* during the wait is honored. `requestFold` receives the session's resolved
|
|
25
|
+
* fold request so the caller targets its own adapter without re-reading the
|
|
26
|
+
* optional session hook.
|
|
27
|
+
* Returns a stop function; call it when the wait settles. No-op when steer
|
|
28
|
+
* folding is gated off at start.
|
|
29
|
+
*/
|
|
30
|
+
export declare function watchSteerForFold(session: SteerFoldSession, startedAt: number, requestFold: (fold: SteerFoldHooks["requestFold"]) => Promise<unknown>, jobId?: string): () => void;
|
|
31
|
+
export {};
|
|
@@ -80,6 +80,10 @@ export interface SubagentLiveProgress {
|
|
|
80
80
|
recentOutputSummary?: {
|
|
81
81
|
lineCount: number;
|
|
82
82
|
};
|
|
83
|
+
toolCount?: number;
|
|
84
|
+
contextTokens?: number;
|
|
85
|
+
contextWindow?: number;
|
|
86
|
+
lastActivityMs?: number;
|
|
83
87
|
fastMode?: boolean;
|
|
84
88
|
retryState?: {
|
|
85
89
|
attempt: number;
|
|
@@ -165,10 +169,13 @@ export declare function capCodePointsAndBytes(text: string, maxCodePoints: numbe
|
|
|
165
169
|
* unsafe.
|
|
166
170
|
*
|
|
167
171
|
* Time-derived fields are intentionally excluded so the panel does not churn while
|
|
168
|
-
* idle
|
|
172
|
+
* idle (the child's last-event timestamp is included; it moves only on real
|
|
173
|
+
* activity): raw durations (`durationMs`), current-tool elapsed (`currentToolStartMs`),
|
|
169
174
|
* and retry countdowns (`retryState.startedAtMs`) are omitted. Idle duration and
|
|
170
175
|
* countdown ticking is sacrificed by design; every real transition still changes
|
|
171
176
|
* the signature.
|
|
172
177
|
*/
|
|
178
|
+
/** Shared cadence for await progress refreshes and rendered last-activity age. */
|
|
179
|
+
export declare const SUBAGENT_ACTIVITY_BUCKET_MS = 5000;
|
|
173
180
|
export declare function subagentAwaitRenderedStateSignature(subagents: readonly SubagentSnapshot[], receipt?: Pick<SubagentToolDetails, "awaitOutcome" | "interrupted">): string;
|
|
174
181
|
export {};
|
|
@@ -162,8 +162,12 @@ export declare const status: ((cwd: string, options?: StatusOptions) => Promise<
|
|
|
162
162
|
parse: typeof parseStatusPorcelain;
|
|
163
163
|
};
|
|
164
164
|
export declare const stage: {
|
|
165
|
-
/**
|
|
166
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Stage files. Empty array stages all (`git add -A`). Accepts a bare signal or
|
|
167
|
+
* `{ env, signal }`; `env` exists so a caller can stage into an isolated
|
|
168
|
+
* `GIT_INDEX_FILE` instead of the repository's real index.
|
|
169
|
+
*/
|
|
170
|
+
files(cwd: string, files?: readonly string[], options?: AbortSignal | Pick<CommandOptions, "env" | "signal">): Promise<void>;
|
|
167
171
|
/** Selectively stage hunks from the provided diff or the current working tree diff. */
|
|
168
172
|
hunks(cwd: string, selections: HunkSelection[], options?: StageHunksOptions): Promise<void>;
|
|
169
173
|
/** Unstage files. Empty array unstages all (`git reset`). */
|
|
@@ -181,6 +185,17 @@ export declare function fetch(cwd: string, remote: string, source: string, targe
|
|
|
181
185
|
export declare function readTree(cwd: string, treeish: string, options?: Pick<CommandOptions, "env" | "signal">): Promise<void>;
|
|
182
186
|
/** Write the current index as a tree and return its object id. */
|
|
183
187
|
export declare function writeTree(cwd: string, options?: Pick<CommandOptions, "env" | "signal">): Promise<string>;
|
|
188
|
+
export interface CommitTreeOptions {
|
|
189
|
+
readonly env?: Record<string, string | undefined>;
|
|
190
|
+
readonly parents?: readonly string[];
|
|
191
|
+
readonly signal?: AbortSignal;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create a commit object from an existing tree and return its SHA. Plumbing:
|
|
195
|
+
* unlike `commit` this touches neither the index nor any ref, and runs no
|
|
196
|
+
* `pre-commit`/`commit-msg` hook.
|
|
197
|
+
*/
|
|
198
|
+
export declare function commitTree(cwd: string, tree: string, message: string, options?: CommitTreeOptions): Promise<string>;
|
|
184
199
|
/** Run `git show` on a revision. */
|
|
185
200
|
export declare const show: ((cwd: string, revision: string, options?: {
|
|
186
201
|
format?: string;
|
|
@@ -241,6 +256,17 @@ export declare const ref: {
|
|
|
241
256
|
exists(cwd: string, refName: string, signal?: AbortSignal): Promise<boolean>;
|
|
242
257
|
/** Resolve a ref to its commit SHA. */
|
|
243
258
|
resolve(cwd: string, refName: string, signal?: AbortSignal): Promise<string | null>;
|
|
259
|
+
/**
|
|
260
|
+
* Move a ref to `newValue`, but only while it still holds `expectedOldValue`
|
|
261
|
+
* (the empty string asserts the ref does not exist yet). Git verifies the old
|
|
262
|
+
* value and writes the new one under its own ref lock, so this is an atomic
|
|
263
|
+
* compare-and-swap: a concurrent writer that moved the ref first makes this
|
|
264
|
+
* throw instead of silently clobbering their commit.
|
|
265
|
+
*/
|
|
266
|
+
update(cwd: string, refName: string, newValue: string, expectedOldValue: string, options?: {
|
|
267
|
+
reason?: string;
|
|
268
|
+
signal?: AbortSignal;
|
|
269
|
+
}): Promise<void>;
|
|
244
270
|
/** Tags pointing at a ref. */
|
|
245
271
|
tags(cwd: string, refName?: string, signal?: AbortSignal): Promise<string[]>;
|
|
246
272
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Start a new regeneration and invalidate every older completion. */
|
|
2
|
+
export declare function beginSessionTitleGeneration(owner: object): number;
|
|
3
|
+
/** Invalidate pending regeneration after a newer session mutation is accepted. */
|
|
4
|
+
export declare function invalidateSessionTitleGeneration(owner: object): void;
|
|
5
|
+
/** Return whether a regeneration still owns the latest generation lease. */
|
|
6
|
+
export declare function isSessionTitleGenerationCurrent(owner: object, generation: number): boolean;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import type { AgentMessage } from "@gajae-code/agent-core";
|
|
1
2
|
import { type Api, type Model } from "@gajae-code/ai/core";
|
|
2
3
|
import type { ModelRegistry } from "../config/model-registry";
|
|
3
4
|
import type { Settings } from "../config/settings";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Build a bounded conversation digest for title regeneration. Regeneration
|
|
7
|
+
* reads several messages so a throwaway first prompt can be corrected, while
|
|
8
|
+
* the automatic first-message path intentionally uses only its initial input.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildConversationTitleInput(messages: readonly AgentMessage[]): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Generate a title for a session based on the provided user-message input.
|
|
13
|
+
* Automatic titles pass the first user message; regeneration passes a bounded
|
|
14
|
+
* conversation digest.
|
|
6
15
|
*
|
|
7
|
-
* @param firstMessage The first user message
|
|
16
|
+
* @param firstMessage The first user message or bounded conversation digest
|
|
8
17
|
* @param registry Model registry
|
|
9
18
|
* @param settings Settings used to resolve the smol role
|
|
10
19
|
* @param sessionId Optional session id for sticky API key selection
|
|
@@ -34,7 +34,10 @@ export interface LoadPageOptions {
|
|
|
34
34
|
}
|
|
35
35
|
export interface LoadPageResult {
|
|
36
36
|
content: string;
|
|
37
|
+
/** The bounded response bytes retained for binary classification/conversion. */
|
|
38
|
+
buffer?: Uint8Array;
|
|
37
39
|
contentType: string;
|
|
40
|
+
contentDisposition?: string;
|
|
38
41
|
finalUrl: string;
|
|
39
42
|
ok: boolean;
|
|
40
43
|
status?: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/coding-agent",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.5",
|
|
5
5
|
"description": "Gajae Code CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
7
7
|
"author": "Yeachan-Heo and Gajae Code Contributors",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"가재씨": "bin/gajaessi.js"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "bun scripts/build-binary.ts",
|
|
33
|
-
"check": "biome check . && bun run check:types",
|
|
32
|
+
"build": "bun run verify:markit-vendor && bun scripts/build-binary.ts",
|
|
33
|
+
"check": "bun run verify:markit-vendor && biome check . && bun run check:types",
|
|
34
34
|
"check:runtime": "bun run generate-hotkeys-docs --check && bun run verify:sdk-canonicalization",
|
|
35
35
|
"check:types": "tsc -p tsconfig.json --noEmit",
|
|
36
36
|
"check:autorouting-map": "bun scripts/check-autorouting-tier-map.ts",
|
|
@@ -49,32 +49,40 @@
|
|
|
49
49
|
"generate-template": "bun scripts/generate-template.ts",
|
|
50
50
|
"install:defaults": "bun src/cli.ts setup defaults",
|
|
51
51
|
"verify:insane-vendor": "bun scripts/verify-insane-vendor.ts",
|
|
52
|
+
"verify:markit-vendor": "bun scripts/vendor-markit.ts --check",
|
|
52
53
|
"verify:sdk-canonicalization": "bun scripts/verify-gjc-sdk-canonicalization.ts",
|
|
53
54
|
"check:sdk-closure": "bun ../../scripts/telegram-daemon-generation-guard.ts --validate-current-tree && bun test ../../scripts/telegram-daemon-generation-guard.test.ts && bun scripts/generate-sdk-operation-inventory.ts --check && bun scripts/generate-sdk-adapter-parity-manifest.ts --check && GJC_MANIFEST_RECEIPT_CONCURRENCY=8 bun scripts/run-test-manifest.ts test/manifests/sdk-adapter-parity-v1.json && bun scripts/generate-telegram-baseline-manifest.ts --check && bun scripts/run-test-manifest.ts test/manifests/telegram-baseline-v1.json && bun test test/sdk-downgrade-rollback.test.ts test/sdk-downgrade-unknown-version.test.ts && bun scripts/verify-gjc-sdk-canonicalization.ts --self-test && bun scripts/verify-gjc-sdk-canonicalization.ts && bun scripts/verify-gjc-sdk-rename.ts"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
57
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
57
58
|
"@babel/parser": "^7.29.3",
|
|
58
|
-
"@gajae-code/agent-core": "0.17.2",
|
|
59
|
-
"@gajae-code/ai": "0.17.2",
|
|
60
|
-
"@gajae-code/natives": "0.17.2",
|
|
61
|
-
"@gajae-code/stats": "0.17.2",
|
|
62
|
-
"@gajae-code/tui": "0.17.2",
|
|
63
|
-
"@gajae-code/utils": "0.17.2",
|
|
64
59
|
"@mozilla/readability": "^0.6.0",
|
|
60
|
+
"@gajae-code/stats": "0.17.5",
|
|
61
|
+
"@gajae-code/agent-core": "0.17.5",
|
|
62
|
+
"@gajae-code/ai": "0.17.5",
|
|
63
|
+
"@gajae-code/natives": "0.17.5",
|
|
64
|
+
"@gajae-code/tui": "0.17.5",
|
|
65
|
+
"@gajae-code/utils": "0.17.5",
|
|
65
66
|
"@puppeteer/browsers": "^2.13.0",
|
|
66
67
|
"@types/turndown": "5.0.6",
|
|
67
68
|
"@xterm/headless": "^6.0.0",
|
|
68
69
|
"chalk": "^5.6.2",
|
|
70
|
+
"commander": "14.0.3",
|
|
69
71
|
"diff": "^9.0.0",
|
|
72
|
+
"exifr": "7.1.3",
|
|
73
|
+
"fast-xml-parser": "5.10.1",
|
|
70
74
|
"fflate": "0.8.2",
|
|
71
75
|
"handlebars": "^4.7.9",
|
|
72
76
|
"jsonc-parser": "3.3.1",
|
|
77
|
+
"jszip": "3.10.1",
|
|
73
78
|
"linkedom": "^0.18.12",
|
|
74
79
|
"lru-cache": "11.3.6",
|
|
80
|
+
"mammoth": "1.12.0",
|
|
75
81
|
"marked": "18.0.6",
|
|
76
|
-
"
|
|
82
|
+
"mupdf": "1.28.0",
|
|
83
|
+
"music-metadata": "11.14.0",
|
|
77
84
|
"puppeteer-core": "^24.42.0",
|
|
85
|
+
"rss-parser": "3.13.0",
|
|
78
86
|
"turndown": "7.2.4",
|
|
79
87
|
"turndown-plugin-gfm": "1.0.2",
|
|
80
88
|
"zod": "4.4.3"
|
package/scripts/build-binary.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { signMacOSBinary } from "../../../scripts/macos-code-signing";
|
|
5
5
|
import { buildDevCompileArgs } from "./compile-args";
|
|
6
|
+
import { generateMuPdfAsset, resetMuPdfAsset } from "./embed-mupdf";
|
|
6
7
|
|
|
7
8
|
const packageDir = path.join(import.meta.dir, "..");
|
|
8
9
|
const outputPath = path.join(packageDir, "dist", "gjc");
|
|
@@ -31,10 +32,11 @@ async function stageWorkspaceNativeAddons(): Promise<void> {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
async function main(): Promise<void> {
|
|
34
|
-
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
|
|
35
35
|
try {
|
|
36
|
-
await runCommand(["bun", "--cwd=../
|
|
36
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
|
|
37
37
|
try {
|
|
38
|
+
await generateMuPdfAsset();
|
|
39
|
+
await runCommand(["bun", "--cwd=../natives", "run", "embed:native"]);
|
|
38
40
|
const buildEnv = shouldAdhocSignDarwinBinary() ? { ...Bun.env, BUN_NO_CODESIGN_MACHO_BINARY: "1" } : Bun.env;
|
|
39
41
|
await runCommand(buildDevCompileArgs(), buildEnv);
|
|
40
42
|
|
|
@@ -47,7 +49,11 @@ async function main(): Promise<void> {
|
|
|
47
49
|
await runCommand(["bun", "--cwd=../natives", "run", "embed:native", "--reset"]);
|
|
48
50
|
}
|
|
49
51
|
} finally {
|
|
50
|
-
|
|
52
|
+
try {
|
|
53
|
+
await resetMuPdfAsset();
|
|
54
|
+
} finally {
|
|
55
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--reset"]);
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
|