@gajae-code/coding-agent 0.17.2 → 0.17.4
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 +194 -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 +18 -0
- package/dist/types/config/file-lock.d.ts +9 -1
- package/dist/types/config/model-profile-activation.d.ts +45 -1
- package/dist/types/config/model-registry.d.ts +11 -2
- 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/extensibility/extensions/types.d.ts +12 -0
- package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
- 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/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 +22 -0
- 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/manager.d.ts +56 -0
- 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 +13 -2
- package/dist/types/sdk/broker/identity.d.ts +3 -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/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 +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 +3 -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 +83 -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/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 +168 -21
- 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/tools/bash.d.ts +37 -11
- package/dist/types/tools/job.d.ts +1 -1
- package/dist/types/tools/steer-fold.d.ts +31 -0
- 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 +535 -0
- package/src/cli/session-picker.ts +2 -1
- package/src/cli/setup-cli.ts +9 -1
- package/src/cli/skills-cli.ts +46 -2
- 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 +14 -0
- package/src/config/file-lock.ts +147 -51
- package/src/config/model-profile-activation.ts +334 -43
- package/src/config/model-registry.ts +183 -25
- 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 +175 -8
- package/src/coordinator-mcp/server.ts +507 -81
- 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/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/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/ultragoal-succession.ts +31 -3
- package/src/internal-urls/docs-index.generated.ts +20 -19
- 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 +123 -55
- package/src/modes/acp/acp-agent.ts +408 -35
- package/src/modes/acp/startup-provenance.ts +59 -0
- package/src/modes/components/custom-provider-wizard.ts +308 -7
- package/src/modes/components/oauth-selector.ts +9 -0
- package/src/modes/components/session-selector.ts +47 -4
- 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/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/manager.ts +689 -55
- 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 +378 -52
- package/src/sdk/broker/identity.ts +9 -1
- package/src/sdk/broker/lifecycle-ledger.ts +95 -31
- package/src/sdk/broker/lifecycle.ts +690 -141
- package/src/sdk/broker/runtime.ts +1 -1
- package/src/sdk/broker/session-index.ts +97 -4
- package/src/sdk/broker/spawn-authority.ts +35 -7
- package/src/sdk/broker/stderr-drainer.ts +59 -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 +690 -80
- package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
- package/src/sdk/bus/telegram-daemon-contract.ts +3 -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 +687 -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 +138 -2
- package/src/sdk/host/session-runtime.ts +311 -97
- 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/prompt-deadline-flush.ts +334 -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 +182 -7
- 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 +2437 -400
- 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 +58 -18
- package/src/session/internal/managed-session-storage.ts +304 -11
- 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/slash-commands/builtin-registry.ts +258 -14
- package/src/task/index.ts +14 -2
- package/src/tools/bash.ts +98 -78
- package/src/tools/fetch.ts +119 -20
- 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/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 +129 -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;
|
|
@@ -231,13 +287,43 @@ function providerSetupUsage(): string {
|
|
|
231
287
|
"Provider onboarding",
|
|
232
288
|
"Presets: /provider add --preset <id> [--force]",
|
|
233
289
|
"Aliases include minimax, zai, alibaba, cline, command-code, and goat.",
|
|
234
|
-
|
|
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/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,
|