@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
|
@@ -3,8 +3,8 @@ import * as path from "node:path";
|
|
|
3
3
|
import { ThinkingLevel } from "@gajae-code/agent-core";
|
|
4
4
|
import { type Model, modelsAreEqual } from "@gajae-code/ai/core";
|
|
5
5
|
import { getOAuthProviders } from "@gajae-code/ai/utils/oauth";
|
|
6
|
-
import { PET_SKIN_IDS, PET_SKINS, type PetMode, Spacer, Text } from "@gajae-code/tui";
|
|
7
|
-
import { setProjectDir } from "@gajae-code/utils";
|
|
6
|
+
import { PET_SKIN_IDS, PET_SKINS, type PetMode, replaceTabs, Spacer, Text } from "@gajae-code/tui";
|
|
7
|
+
import { sanitizeDisplayLine, setProjectDir } from "@gajae-code/utils";
|
|
8
8
|
import { jobElapsedMs } from "../async";
|
|
9
9
|
import { activateModelProfile, materializeActiveModelProfileAssignments } from "../config/model-profile-activation";
|
|
10
10
|
import { formatModelProfileDisplayLabel } from "../config/model-profiles";
|
|
@@ -34,17 +34,28 @@ import { parseUiLanguage, resolveUiLanguage, UI_LANGUAGE_LABELS, UI_LANGUAGES, u
|
|
|
34
34
|
// W1b/W5b: notification-service and daemon controllers stay off the static
|
|
35
35
|
// import graph; the /notify handlers import them lazily at first use.
|
|
36
36
|
import type { NotificationProvider } from "../sdk/bus/config";
|
|
37
|
+
import type { AgentSession, ExactMcpStatusSnapshot } from "../session/agent-session";
|
|
37
38
|
import { computeCacheMissCostSummary, formatCacheMissSummaryLines } from "../session/cache-economics";
|
|
38
39
|
import { formatProviderSessionImportSummary, runSessionImportCommand } from "../session-import";
|
|
39
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
formatModelOnboardingGuidance,
|
|
42
|
+
MODEL_ONBOARDING_API_PROVIDER_COMMAND,
|
|
43
|
+
} from "../setup/model-onboarding-guidance";
|
|
40
44
|
import {
|
|
41
45
|
addApiCompatibleProvider,
|
|
42
46
|
formatProviderPresetList,
|
|
43
47
|
formatProviderSetupResult,
|
|
44
48
|
parseProviderCompatibility,
|
|
49
|
+
reloadAndRefreshDiscoveryCatalog,
|
|
45
50
|
} from "../setup/provider-onboarding";
|
|
46
51
|
import { parseThinkingLevel } from "../thinking";
|
|
47
52
|
import { getDisplayChangelogEntries } from "../utils/changelog";
|
|
53
|
+
import {
|
|
54
|
+
beginSessionTitleGeneration,
|
|
55
|
+
invalidateSessionTitleGeneration,
|
|
56
|
+
isSessionTitleGenerationCurrent,
|
|
57
|
+
} from "../utils/session-title-generation";
|
|
58
|
+
import { buildConversationTitleInput, generateSessionTitle } from "../utils/title-generator";
|
|
48
59
|
import { handleAsideAcp } from "./helpers/aside";
|
|
49
60
|
import { buildAutoroutingStatusReport } from "./helpers/autorouting-status";
|
|
50
61
|
import { buildContextReportText } from "./helpers/context-report";
|
|
@@ -140,6 +151,44 @@ function toSlashCommandRuntime(runtime: TuiSlashCommandRuntime): SlashCommandRun
|
|
|
140
151
|
};
|
|
141
152
|
}
|
|
142
153
|
|
|
154
|
+
async function regenerateSessionTitle(runtime: SlashCommandRuntime): Promise<SlashCommandResult> {
|
|
155
|
+
try {
|
|
156
|
+
const generation = beginSessionTitleGeneration(runtime.sessionManager);
|
|
157
|
+
const input = buildConversationTitleInput(runtime.session.messages);
|
|
158
|
+
if (!input) {
|
|
159
|
+
return usage("Nothing to summarize yet — pass a title: /rename <title>", runtime);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const generated = await generateSessionTitle(
|
|
163
|
+
input,
|
|
164
|
+
runtime.session.modelRegistry,
|
|
165
|
+
runtime.settings,
|
|
166
|
+
runtime.session.credentialSessionId,
|
|
167
|
+
runtime.session.model,
|
|
168
|
+
provider => runtime.session.agent.metadataForProvider(provider),
|
|
169
|
+
);
|
|
170
|
+
if (
|
|
171
|
+
!isSessionTitleGenerationCurrent(runtime.sessionManager, generation) ||
|
|
172
|
+
buildConversationTitleInput(runtime.session.messages) !== input
|
|
173
|
+
)
|
|
174
|
+
return commandConsumed();
|
|
175
|
+
if (!generated) {
|
|
176
|
+
return usage("Could not generate a session title — pass one: /rename <title>", runtime);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const stored = await runtime.sessionManager.setSessionName(generated, "user");
|
|
180
|
+
if (!stored) {
|
|
181
|
+
await runtime.output("Session name not changed (a user-set name takes precedence).");
|
|
182
|
+
return commandConsumed();
|
|
183
|
+
}
|
|
184
|
+
await runtime.notifyTitleChanged?.();
|
|
185
|
+
await runtime.output(`Session renamed to ${generated}.`);
|
|
186
|
+
return commandConsumed();
|
|
187
|
+
} catch (err) {
|
|
188
|
+
return usage(`Rename failed: ${errorMessage(err)}`, runtime);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
143
192
|
async function updateSessionStar(
|
|
144
193
|
starred: boolean,
|
|
145
194
|
command: ParsedSlashCommand,
|
|
@@ -171,6 +220,7 @@ function parseProviderSetupSlashArgs(args: string): {
|
|
|
171
220
|
apiKeyEnv?: string;
|
|
172
221
|
rejectedRawApiKey: boolean;
|
|
173
222
|
force: boolean;
|
|
223
|
+
discover: boolean;
|
|
174
224
|
models: string[];
|
|
175
225
|
} {
|
|
176
226
|
const tokens = args.split(/\s+/).filter(Boolean);
|
|
@@ -182,9 +232,11 @@ function parseProviderSetupSlashArgs(args: string): {
|
|
|
182
232
|
apiKeyEnv?: string;
|
|
183
233
|
rejectedRawApiKey: boolean;
|
|
184
234
|
force: boolean;
|
|
235
|
+
discover: boolean;
|
|
185
236
|
models: string[];
|
|
186
237
|
} = {
|
|
187
238
|
force: false,
|
|
239
|
+
discover: false,
|
|
188
240
|
models: [],
|
|
189
241
|
rejectedRawApiKey: false,
|
|
190
242
|
};
|
|
@@ -194,6 +246,10 @@ function parseProviderSetupSlashArgs(args: string): {
|
|
|
194
246
|
result.force = true;
|
|
195
247
|
continue;
|
|
196
248
|
}
|
|
249
|
+
if (token === "--discover") {
|
|
250
|
+
result.discover = true;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
197
253
|
if (!token.startsWith("-") && !result.preset) {
|
|
198
254
|
result.preset = token;
|
|
199
255
|
continue;
|
|
@@ -230,14 +286,44 @@ function providerSetupUsage(): string {
|
|
|
230
286
|
return [
|
|
231
287
|
"Provider onboarding",
|
|
232
288
|
"Presets: /provider add --preset <id> [--force]",
|
|
233
|
-
"Aliases include minimax, zai, alibaba, cline, command-code, and
|
|
234
|
-
|
|
289
|
+
"Aliases include minimax, zai, alibaba, cline, command-code, goat, and ionet.",
|
|
290
|
+
`API providers: ${MODEL_ONBOARDING_API_PROVIDER_COMMAND} [--force]`,
|
|
235
291
|
`Available presets:\n${formatProviderPresetList()}`,
|
|
236
292
|
"OAuth/subscription providers: /provider login [provider-id] or /login [provider-id]",
|
|
237
293
|
"Headless OAuth callbacks can be pasted with /login <redirect URL or code>.",
|
|
238
294
|
].join("\n");
|
|
239
295
|
}
|
|
240
296
|
|
|
297
|
+
function exactMcpDisplayName(name: string): string {
|
|
298
|
+
const sanitized = replaceTabs(sanitizeDisplayLine(name));
|
|
299
|
+
return sanitized || "<unnamed>";
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function renderExactMcpStatus(snapshot: ExactMcpStatusSnapshot): string {
|
|
303
|
+
if (snapshot.servers.length === 0) {
|
|
304
|
+
return snapshot.startup === "no-servers-declared"
|
|
305
|
+
? "MCP servers: the config declares none."
|
|
306
|
+
: "MCP servers: not started yet.";
|
|
307
|
+
}
|
|
308
|
+
const servers = snapshot.servers.map(server => ({ ...server, name: exactMcpDisplayName(server.name) }));
|
|
309
|
+
// Server names and counts vary in width, so pad to the widest of each column;
|
|
310
|
+
// an unaligned table is unreadable once more than a couple of servers connect.
|
|
311
|
+
const nameWidth = Math.max(...servers.map(server => server.name.length));
|
|
312
|
+
const transportWidth = Math.max(...servers.map(server => server.transport.length));
|
|
313
|
+
const stateWidth = Math.max(...servers.map(server => server.state.length));
|
|
314
|
+
const countWidth = Math.max(...servers.map(server => String(server.toolCount).length));
|
|
315
|
+
const lines = [`MCP servers (${snapshot.startup}):`];
|
|
316
|
+
for (const server of servers) {
|
|
317
|
+
const count = String(server.toolCount).padStart(countWidth);
|
|
318
|
+
const unit = server.toolCount === 1 ? "tool" : "tools";
|
|
319
|
+
lines.push(
|
|
320
|
+
` ${server.name.padEnd(nameWidth)} ${server.transport.padEnd(transportWidth)} ` +
|
|
321
|
+
`${server.state.padEnd(stateWidth)} ${count} ${unit}`,
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
return lines.join("\n");
|
|
325
|
+
}
|
|
326
|
+
|
|
241
327
|
function formatModelAssignmentSummary(runtime: SlashCommandRuntime): string {
|
|
242
328
|
const agentModelOverrides = runtime.settings.get("task.agentModelOverrides");
|
|
243
329
|
const lines = ["Model assignments:"];
|
|
@@ -1619,6 +1705,121 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
1619
1705
|
runtime.ctx.editor.setText("");
|
|
1620
1706
|
},
|
|
1621
1707
|
},
|
|
1708
|
+
{
|
|
1709
|
+
name: "mcp",
|
|
1710
|
+
description: "Show MCP server status for this session",
|
|
1711
|
+
allowArgs: true,
|
|
1712
|
+
subcommands: [
|
|
1713
|
+
{ name: "status", description: "Show MCP server status for this session" },
|
|
1714
|
+
{ name: "list", description: "Alias for status" },
|
|
1715
|
+
{ name: "suspend", description: "Suspend one server for this session" },
|
|
1716
|
+
{ name: "resume", description: "Resume one suspended server" },
|
|
1717
|
+
{ name: "reconnect", description: "Reconnect one server" },
|
|
1718
|
+
],
|
|
1719
|
+
// Exact MCP command surface yields its namespace without the exact capability: no `handle`, so the ACP dispatcher
|
|
1720
|
+
// neither advertises nor routes it. Controls stay on the terminal surface.
|
|
1721
|
+
handleTui: async (command, runtime) => {
|
|
1722
|
+
// This builtin is installed statically, but the exact MCP capability is
|
|
1723
|
+
// granted only to root interactive --mcp-config sessions. Preserve the
|
|
1724
|
+
// pristine command namespace for every other session.
|
|
1725
|
+
if (!runtime.ctx.session.hasExactMcpControls) return { prompt: command.text };
|
|
1726
|
+
runtime.ctx.editor.setText("");
|
|
1727
|
+
const args = command.args.trim() ? command.args.trim().split(/\s+/) : [];
|
|
1728
|
+
const subcommand = args[0] ?? "";
|
|
1729
|
+
// `list` is what every other MCP-capable tool calls this, so accept it
|
|
1730
|
+
// rather than punishing the habit with an error.
|
|
1731
|
+
if (
|
|
1732
|
+
subcommand !== "" &&
|
|
1733
|
+
subcommand !== "status" &&
|
|
1734
|
+
subcommand !== "list" &&
|
|
1735
|
+
subcommand !== "suspend" &&
|
|
1736
|
+
subcommand !== "resume" &&
|
|
1737
|
+
subcommand !== "reconnect"
|
|
1738
|
+
) {
|
|
1739
|
+
runtime.ctx.showError(
|
|
1740
|
+
`Unknown subcommand: ${exactMcpDisplayName(subcommand)}. Usage: /mcp [status|list|suspend <name>|resume <name>|reconnect <name>]`,
|
|
1741
|
+
);
|
|
1742
|
+
return commandConsumed();
|
|
1743
|
+
}
|
|
1744
|
+
if (subcommand === "suspend" || subcommand === "resume" || subcommand === "reconnect") {
|
|
1745
|
+
const name = args[1];
|
|
1746
|
+
if (!name || args.length !== 2) {
|
|
1747
|
+
runtime.ctx.showError(`Server name required. Usage: /mcp ${subcommand} <name>`);
|
|
1748
|
+
return commandConsumed();
|
|
1749
|
+
}
|
|
1750
|
+
let result: Awaited<ReturnType<AgentSession["controlExactMcpServer"]>>;
|
|
1751
|
+
try {
|
|
1752
|
+
result = await runtime.ctx.session.controlExactMcpServer(subcommand, name);
|
|
1753
|
+
} catch (error) {
|
|
1754
|
+
if ((error as { code?: string } | undefined)?.code === "busy") {
|
|
1755
|
+
runtime.ctx.showWarning(`MCP ${subcommand} is unavailable while this session is busy.`);
|
|
1756
|
+
return commandConsumed();
|
|
1757
|
+
}
|
|
1758
|
+
runtime.ctx.showError(`MCP ${subcommand} failed.`);
|
|
1759
|
+
return commandConsumed();
|
|
1760
|
+
}
|
|
1761
|
+
if (!result) {
|
|
1762
|
+
runtime.ctx.showWarning(
|
|
1763
|
+
"MCP controls are not available in this session. Start gjc with --mcp-config <absolute-path> to enable them.",
|
|
1764
|
+
);
|
|
1765
|
+
return commandConsumed();
|
|
1766
|
+
}
|
|
1767
|
+
const displayName = exactMcpDisplayName(result.name);
|
|
1768
|
+
switch (result.status) {
|
|
1769
|
+
case "suspended":
|
|
1770
|
+
runtime.ctx.showStatus(`MCP server "${displayName}" suspended for this session.`);
|
|
1771
|
+
break;
|
|
1772
|
+
case "resumed":
|
|
1773
|
+
runtime.ctx.showStatus(`MCP server "${displayName}" resumed (${result.toolCount} tools).`);
|
|
1774
|
+
break;
|
|
1775
|
+
case "reconnected":
|
|
1776
|
+
runtime.ctx.showStatus(`MCP server "${displayName}" reconnected (${result.toolCount} tools).`);
|
|
1777
|
+
break;
|
|
1778
|
+
case "already-suspended":
|
|
1779
|
+
runtime.ctx.showWarning(`MCP server "${displayName}" is already suspended.`);
|
|
1780
|
+
break;
|
|
1781
|
+
case "not-suspended":
|
|
1782
|
+
runtime.ctx.showWarning(`MCP server "${displayName}" is not suspended.`);
|
|
1783
|
+
break;
|
|
1784
|
+
case "unknown-server":
|
|
1785
|
+
runtime.ctx.showError(`Unknown MCP server: ${displayName}`);
|
|
1786
|
+
break;
|
|
1787
|
+
case "unavailable":
|
|
1788
|
+
runtime.ctx.showError(
|
|
1789
|
+
result.action === "resume"
|
|
1790
|
+
? `MCP server "${displayName}" could not be resumed and remains suspended.`
|
|
1791
|
+
: `MCP server "${displayName}" could not be reconnected.`,
|
|
1792
|
+
);
|
|
1793
|
+
break;
|
|
1794
|
+
}
|
|
1795
|
+
return commandConsumed();
|
|
1796
|
+
}
|
|
1797
|
+
if (args.length > 1) {
|
|
1798
|
+
runtime.ctx.showError(`Usage: /mcp ${subcommand || "status"}`);
|
|
1799
|
+
return commandConsumed();
|
|
1800
|
+
}
|
|
1801
|
+
let snapshot: Awaited<ReturnType<AgentSession["getExactMcpStatusSnapshot"]>>;
|
|
1802
|
+
try {
|
|
1803
|
+
snapshot = await runtime.ctx.session.getExactMcpStatusSnapshot();
|
|
1804
|
+
} catch (error) {
|
|
1805
|
+
if ((error as { code?: string } | undefined)?.code === "busy") {
|
|
1806
|
+
runtime.ctx.showWarning(
|
|
1807
|
+
"MCP status is unavailable while this session is busy. Try again once it settles.",
|
|
1808
|
+
);
|
|
1809
|
+
return commandConsumed();
|
|
1810
|
+
}
|
|
1811
|
+
throw error;
|
|
1812
|
+
}
|
|
1813
|
+
if (!snapshot) {
|
|
1814
|
+
runtime.ctx.showWarning(
|
|
1815
|
+
"MCP status is not available in this session. Start gjc with --mcp-config <absolute-path> to enable it.",
|
|
1816
|
+
);
|
|
1817
|
+
return commandConsumed();
|
|
1818
|
+
}
|
|
1819
|
+
runtime.ctx.showStatus(renderExactMcpStatus(snapshot));
|
|
1820
|
+
return commandConsumed();
|
|
1821
|
+
},
|
|
1822
|
+
},
|
|
1622
1823
|
{
|
|
1623
1824
|
name: "agents",
|
|
1624
1825
|
description: "Open Agent Control Center dashboard",
|
|
@@ -1652,6 +1853,19 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
1652
1853
|
runtime.ctx.editor.setText("");
|
|
1653
1854
|
},
|
|
1654
1855
|
},
|
|
1856
|
+
{
|
|
1857
|
+
name: "fork",
|
|
1858
|
+
description: "Choose an earlier prompt to continue in a new session",
|
|
1859
|
+
allowArgs: true,
|
|
1860
|
+
handleTui: async (command, runtime) => {
|
|
1861
|
+
runtime.ctx.editor.setText("");
|
|
1862
|
+
if (command.args.trim()) {
|
|
1863
|
+
runtime.ctx.showError("Usage: /fork");
|
|
1864
|
+
return;
|
|
1865
|
+
}
|
|
1866
|
+
await runtime.ctx.handleForkCommand();
|
|
1867
|
+
},
|
|
1868
|
+
},
|
|
1655
1869
|
|
|
1656
1870
|
{
|
|
1657
1871
|
name: "provider",
|
|
@@ -1685,7 +1899,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
1685
1899
|
}
|
|
1686
1900
|
if (!parsed.preset) {
|
|
1687
1901
|
if (!parsed.apiKeyEnv) missing.push("--api-key-env");
|
|
1688
|
-
if (parsed.models.length === 0) missing.push("--model");
|
|
1902
|
+
if (parsed.models.length === 0 && !parsed.discover) missing.push("--model or --discover");
|
|
1689
1903
|
}
|
|
1690
1904
|
if (missing.length > 0) {
|
|
1691
1905
|
return usage(
|
|
@@ -1701,10 +1915,24 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
1701
1915
|
baseUrl: parsed.baseUrl,
|
|
1702
1916
|
apiKeyEnv: parsed.apiKeyEnv,
|
|
1703
1917
|
models: parsed.models,
|
|
1918
|
+
discover: parsed.discover,
|
|
1704
1919
|
force: parsed.force,
|
|
1705
1920
|
});
|
|
1706
|
-
|
|
1707
|
-
|
|
1921
|
+
let recoveryHint: string | null = null;
|
|
1922
|
+
if (result.discoveryEnabled && !result.preset) {
|
|
1923
|
+
recoveryHint = await reloadAndRefreshDiscoveryCatalog(
|
|
1924
|
+
runtime.session.modelRegistry,
|
|
1925
|
+
result.providerId,
|
|
1926
|
+
runtime.session.credentialSessionId,
|
|
1927
|
+
);
|
|
1928
|
+
} else {
|
|
1929
|
+
await runtime.session.modelRegistry.refresh("offline", runtime.session.credentialSessionId);
|
|
1930
|
+
}
|
|
1931
|
+
await runtime.output(
|
|
1932
|
+
recoveryHint
|
|
1933
|
+
? `${formatProviderSetupResult(result)}\n${recoveryHint}`
|
|
1934
|
+
: formatProviderSetupResult(result),
|
|
1935
|
+
);
|
|
1708
1936
|
await runtime.notifyConfigChanged?.();
|
|
1709
1937
|
return commandConsumed();
|
|
1710
1938
|
} catch (err) {
|
|
@@ -1742,10 +1970,25 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
1742
1970
|
baseUrl: parsed.baseUrl,
|
|
1743
1971
|
apiKeyEnv: parsed.apiKeyEnv,
|
|
1744
1972
|
models: parsed.models,
|
|
1973
|
+
discover: parsed.discover,
|
|
1745
1974
|
force: parsed.force,
|
|
1975
|
+
authStorage: runtime.ctx.session.modelRegistry.authStorage,
|
|
1746
1976
|
});
|
|
1747
|
-
|
|
1748
|
-
|
|
1977
|
+
let recoveryHint: string | null = null;
|
|
1978
|
+
if (result.discoveryEnabled && !result.preset) {
|
|
1979
|
+
recoveryHint = await reloadAndRefreshDiscoveryCatalog(
|
|
1980
|
+
runtime.ctx.session.modelRegistry,
|
|
1981
|
+
result.providerId,
|
|
1982
|
+
runtime.ctx.session.credentialSessionId,
|
|
1983
|
+
);
|
|
1984
|
+
} else {
|
|
1985
|
+
await runtime.ctx.session.modelRegistry.refresh("offline", runtime.ctx.session.credentialSessionId);
|
|
1986
|
+
}
|
|
1987
|
+
runtime.ctx.showStatus(
|
|
1988
|
+
recoveryHint
|
|
1989
|
+
? `${formatProviderSetupResult(result)}\n${recoveryHint}`
|
|
1990
|
+
: formatProviderSetupResult(result),
|
|
1991
|
+
);
|
|
1749
1992
|
} catch (err) {
|
|
1750
1993
|
runtime.ctx.showError(`Provider setup failed: ${errorMessage(err)}`);
|
|
1751
1994
|
}
|
|
@@ -2134,11 +2377,12 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
2134
2377
|
},
|
|
2135
2378
|
{
|
|
2136
2379
|
name: "rename",
|
|
2137
|
-
description: "Rename the current session",
|
|
2138
|
-
inlineHint: "
|
|
2380
|
+
description: "Rename the current session, or regenerate the title from the conversation",
|
|
2381
|
+
inlineHint: "[title]",
|
|
2139
2382
|
allowArgs: true,
|
|
2140
2383
|
handle: async (command, runtime) => {
|
|
2141
|
-
if (!command.args) return
|
|
2384
|
+
if (!command.args) return regenerateSessionTitle(runtime);
|
|
2385
|
+
invalidateSessionTitleGeneration(runtime.sessionManager);
|
|
2142
2386
|
const ok = await runtime.sessionManager.setSessionName(command.args, "user");
|
|
2143
2387
|
if (!ok) {
|
|
2144
2388
|
await runtime.output("Session name not changed (a user-set name takes precedence).");
|
|
@@ -2151,8 +2395,8 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<SlashCommandSpec> = [
|
|
|
2151
2395
|
handleTui: async (command, runtime) => {
|
|
2152
2396
|
const title = command.args.trim();
|
|
2153
2397
|
if (!title) {
|
|
2154
|
-
runtime.ctx.showError("Usage: /rename <title>");
|
|
2155
2398
|
runtime.ctx.editor.setText("");
|
|
2399
|
+
await runtime.ctx.handleRenameCommand();
|
|
2156
2400
|
return;
|
|
2157
2401
|
}
|
|
2158
2402
|
runtime.ctx.editor.setText("");
|
|
@@ -2230,7 +2474,7 @@ export function formatUnknownBuiltinSlashCommandDiagnostic(commandName: string):
|
|
|
2230
2474
|
return [
|
|
2231
2475
|
"Unknown slash command: /provicer.",
|
|
2232
2476
|
"Did you mean /provider?",
|
|
2233
|
-
|
|
2477
|
+
`Run: ${MODEL_ONBOARDING_API_PROVIDER_COMMAND}`,
|
|
2234
2478
|
].join("\n");
|
|
2235
2479
|
}
|
|
2236
2480
|
|
package/src/task/executor.ts
CHANGED
|
@@ -37,6 +37,7 @@ import { ModelRegistry } from "../config/model-registry";
|
|
|
37
37
|
import {
|
|
38
38
|
formatModelString,
|
|
39
39
|
isExplicitProviderModelOverride,
|
|
40
|
+
refreshMissingQualifiedModelProviders,
|
|
40
41
|
resolveModelOverrideWithAuthFallback,
|
|
41
42
|
} from "../config/model-resolver";
|
|
42
43
|
import type { PromptTemplate } from "../config/prompt-templates";
|
|
@@ -1418,6 +1419,7 @@ export async function runSubprocessOnce(options: ExecutorOptions): Promise<Singl
|
|
|
1418
1419
|
forwardSubagentEvent(event);
|
|
1419
1420
|
|
|
1420
1421
|
const now = Date.now();
|
|
1422
|
+
progress.lastActivityMs = now;
|
|
1421
1423
|
let flushProgress = false;
|
|
1422
1424
|
// A retry is recovered at the first assistant provider event, before the
|
|
1423
1425
|
// session emits auto_retry_end after message completion.
|
|
@@ -1719,19 +1721,20 @@ export async function runSubprocessOnce(options: ExecutorOptions): Promise<Singl
|
|
|
1719
1721
|
checkAbort();
|
|
1720
1722
|
// Pin authStorage to modelRegistry.authStorage — mirrors the createAgentSession invariant.
|
|
1721
1723
|
const registryFromParent = options.modelRegistry !== undefined;
|
|
1724
|
+
const effectiveAgentDir = options.agentDir ?? settings.getAgentDir();
|
|
1722
1725
|
const registryAuthStorage =
|
|
1723
1726
|
options.authStorage ??
|
|
1724
1727
|
options.modelRegistry?.authStorage ??
|
|
1725
|
-
(await awaitAbortable(discoverAuthStorage(
|
|
1728
|
+
(await awaitAbortable(discoverAuthStorage(effectiveAgentDir)));
|
|
1726
1729
|
if (options.modelRegistry === undefined && options.authStorage === undefined)
|
|
1727
1730
|
ownedAuthStorage = registryAuthStorage;
|
|
1728
1731
|
ownedModelRegistry = options.modelRegistry
|
|
1729
1732
|
? undefined
|
|
1730
|
-
: new ModelRegistry(registryAuthStorage, path.join(
|
|
1731
|
-
agentDir:
|
|
1733
|
+
: new ModelRegistry(registryAuthStorage, path.join(effectiveAgentDir, "models.yml"), settings, {
|
|
1734
|
+
agentDir: effectiveAgentDir,
|
|
1732
1735
|
automaticRefresh: false,
|
|
1733
1736
|
});
|
|
1734
|
-
|
|
1737
|
+
let modelRegistry = options.modelRegistry ?? ownedModelRegistry!;
|
|
1735
1738
|
const authStorage = modelRegistry.authStorage;
|
|
1736
1739
|
if (options.authStorage && options.authStorage !== authStorage) {
|
|
1737
1740
|
throw new Error(
|
|
@@ -1754,17 +1757,7 @@ export async function runSubprocessOnce(options: ExecutorOptions): Promise<Singl
|
|
|
1754
1757
|
const canonicalChildScope = getSubagentCanonicalScope(options.parentSessionId, options.subagentId ?? id);
|
|
1755
1758
|
|
|
1756
1759
|
if (options.preflightProbe || options.preflightDurable) preflightOperation = "auth_resolve";
|
|
1757
|
-
const
|
|
1758
|
-
model,
|
|
1759
|
-
thinkingLevel: resolvedThinkingLevel,
|
|
1760
|
-
explicitThinkingLevel,
|
|
1761
|
-
authFallbackUsed: resolvedAuthFallbackUsed,
|
|
1762
|
-
requestedModel,
|
|
1763
|
-
fallbackReason,
|
|
1764
|
-
activeIndex,
|
|
1765
|
-
parentFallbackSelector,
|
|
1766
|
-
skips,
|
|
1767
|
-
} = await awaitAbortable(
|
|
1760
|
+
const resolveConfiguredModel = () =>
|
|
1768
1761
|
resolveModelOverrideWithAuthFallback(
|
|
1769
1762
|
modelPatterns,
|
|
1770
1763
|
options.preflightProbe || options.preflightDurable ? undefined : options.parentActiveModelPattern,
|
|
@@ -1776,8 +1769,44 @@ export async function runSubprocessOnce(options: ExecutorOptions): Promise<Singl
|
|
|
1776
1769
|
...(options.parentActiveModelProfile ? { aliasIntent: "preset-equivalent" } : {}),
|
|
1777
1770
|
},
|
|
1778
1771
|
canonicalChildScope,
|
|
1779
|
-
)
|
|
1780
|
-
);
|
|
1772
|
+
);
|
|
1773
|
+
let resolution = await awaitAbortable(resolveConfiguredModel());
|
|
1774
|
+
if (
|
|
1775
|
+
!resolution.model &&
|
|
1776
|
+
registryFromParent &&
|
|
1777
|
+
isExplicitProviderModelOverride(modelPatterns) &&
|
|
1778
|
+
resolution.skips.some(skip => skip.reason === "unknown_model")
|
|
1779
|
+
) {
|
|
1780
|
+
ownedModelRegistry = new ModelRegistry(
|
|
1781
|
+
registryAuthStorage,
|
|
1782
|
+
path.join(effectiveAgentDir, "models.yml"),
|
|
1783
|
+
settings,
|
|
1784
|
+
{
|
|
1785
|
+
agentDir: effectiveAgentDir,
|
|
1786
|
+
automaticRefresh: false,
|
|
1787
|
+
},
|
|
1788
|
+
);
|
|
1789
|
+
await awaitAbortable(
|
|
1790
|
+
refreshMissingQualifiedModelProviders(
|
|
1791
|
+
modelPatterns,
|
|
1792
|
+
ownedModelRegistry,
|
|
1793
|
+
options.parentCredentialSessionId ?? options.parentSessionId,
|
|
1794
|
+
),
|
|
1795
|
+
);
|
|
1796
|
+
modelRegistry = ownedModelRegistry;
|
|
1797
|
+
resolution = await awaitAbortable(resolveConfiguredModel());
|
|
1798
|
+
}
|
|
1799
|
+
const {
|
|
1800
|
+
model,
|
|
1801
|
+
thinkingLevel: resolvedThinkingLevel,
|
|
1802
|
+
explicitThinkingLevel,
|
|
1803
|
+
authFallbackUsed: resolvedAuthFallbackUsed,
|
|
1804
|
+
requestedModel,
|
|
1805
|
+
fallbackReason,
|
|
1806
|
+
activeIndex,
|
|
1807
|
+
parentFallbackSelector,
|
|
1808
|
+
skips,
|
|
1809
|
+
} = resolution;
|
|
1781
1810
|
if (!model && isExplicitProviderModelOverride(modelPatterns)) {
|
|
1782
1811
|
const skipReasons = [...new Set(skips.map(skip => skip.reason))];
|
|
1783
1812
|
if ((options.preflightProbe || options.preflightDurable) && skipReasons.includes("unauthenticated")) {
|
package/src/task/index.ts
CHANGED
|
@@ -1786,13 +1786,25 @@ export class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskToolDetai
|
|
|
1786
1786
|
const parentProfileDefinition = parentActiveModelProfile
|
|
1787
1787
|
? this.session.modelRegistry?.getModelProfile?.(parentActiveModelProfile)
|
|
1788
1788
|
: undefined;
|
|
1789
|
+
const parentProfileBindings = parentProfileDefinition
|
|
1790
|
+
? resolveProfileBindings(parentProfileDefinition)
|
|
1791
|
+
: undefined;
|
|
1792
|
+
const parentProfileBinding =
|
|
1793
|
+
parentProfileBindings?.agentModelOverrides[
|
|
1794
|
+
agentName as keyof typeof parentProfileBindings.agentModelOverrides
|
|
1795
|
+
];
|
|
1789
1796
|
const parentOwnedModelProfile =
|
|
1790
1797
|
parentProfileDefinition &&
|
|
1791
|
-
|
|
1798
|
+
parentProfileBindings &&
|
|
1799
|
+
Object.hasOwn(parentProfileBindings.agentModelOverrides, agentName)
|
|
1792
1800
|
? parentActiveModelProfile
|
|
1793
1801
|
: undefined;
|
|
1794
1802
|
const modelOverride = resolveAgentModelPatterns({
|
|
1795
|
-
|
|
1803
|
+
// Profile bindings are runtime-owned and may not be present in the
|
|
1804
|
+
// persisted settings view exposed to detached task construction.
|
|
1805
|
+
// Keep explicit task settings authoritative, then inherit the active
|
|
1806
|
+
// profile's role binding before falling back to the parent model.
|
|
1807
|
+
settingsOverride: settingsModelOverride ?? parentProfileBinding,
|
|
1796
1808
|
agentModel: effectiveAgent.model,
|
|
1797
1809
|
settings: this.session.settings,
|
|
1798
1810
|
activeModelPattern: parentActiveModelPattern,
|
package/src/task/types.ts
CHANGED
|
@@ -285,6 +285,8 @@ export interface AgentProgress {
|
|
|
285
285
|
recentTools: Array<{ tool: string; args: string; endMs: number }>;
|
|
286
286
|
recentOutput: string[];
|
|
287
287
|
toolCount: number;
|
|
288
|
+
/** Epoch ms of the latest event observed from this subagent (any agent event). */
|
|
289
|
+
lastActivityMs?: number;
|
|
288
290
|
/** Cumulative input + output + cacheWrite tokens across all turns. Excludes cacheRead (re-reads cached context every turn, making cumulative sum misleading). */
|
|
289
291
|
tokens: number;
|
|
290
292
|
/**
|
|
@@ -331,6 +331,7 @@ export async function runInteractiveBashPty(
|
|
|
331
331
|
timeoutMs: number;
|
|
332
332
|
signal?: AbortSignal;
|
|
333
333
|
env?: Record<string, string>;
|
|
334
|
+
unsetEnv?: string[];
|
|
334
335
|
artifactPath?: string;
|
|
335
336
|
artifactId?: string;
|
|
336
337
|
artifactPublisher?: TerminalArtifactPublisher;
|
|
@@ -422,6 +423,7 @@ export async function runInteractiveBashPty(
|
|
|
422
423
|
cwd: options.cwd,
|
|
423
424
|
timeoutMs: options.timeoutMs,
|
|
424
425
|
env: { ...NON_INTERACTIVE_ENV, ...options.env },
|
|
426
|
+
unsetEnv: options.unsetEnv,
|
|
425
427
|
signal: processAbortController.signal,
|
|
426
428
|
cols: initialPtySize.cols,
|
|
427
429
|
rows: initialPtySize.rows,
|