@gajae-code/coding-agent 0.19.3-nightly.20261030094347.41301593972.gf536b1010d4e → 0.19.3
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 +238 -0
- package/dist/types/async/job-manager.d.ts +56 -18
- package/dist/types/cli/auth-token-file.d.ts +9 -0
- package/dist/types/cli/doctor/install-repairs.d.ts +1 -0
- package/dist/types/cli/doctor/types.d.ts +1 -0
- package/dist/types/cli/install-activation.d.ts +10 -1
- package/dist/types/cli/malloc-env-guard.d.ts +8 -0
- package/dist/types/cli/update-cli.d.ts +4 -1
- package/dist/types/config/atomic-yaml-patch.d.ts +34 -1
- package/dist/types/config/model-profile-activation.d.ts +40 -13
- package/dist/types/config/model-registry.d.ts +3 -0
- package/dist/types/config/models-config-schema.d.ts +4 -0
- package/dist/types/config/settings-schema.d.ts +49 -8
- package/dist/types/config/settings.d.ts +39 -5
- package/dist/types/config/task-delegation.d.ts +2 -0
- package/dist/types/extensibility/extensions/runner.d.ts +2 -0
- package/dist/types/extensibility/slash-commands.d.ts +14 -1
- package/dist/types/gjc-runtime/managed-owner-admission.d.ts +4 -12
- package/dist/types/gjc-runtime/managed-owner-binding.d.ts +164 -0
- package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +26 -33
- package/dist/types/gjc-runtime/owner-lifecycle-path.d.ts +21 -0
- package/dist/types/gjc-runtime/owner-lifecycle-root.d.ts +7 -0
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +8 -1
- package/dist/types/gjc-runtime/tmux-common.d.ts +10 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +131 -5
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +46 -0
- package/dist/types/gjc-runtime/ultragoal-owner-loss-recovery.d.ts +1 -1
- package/dist/types/harness-control-plane/session-lease.d.ts +29 -2
- package/dist/types/harness-control-plane/storage.d.ts +8 -0
- package/dist/types/main.d.ts +12 -0
- package/dist/types/memories/index.d.ts +7 -1
- package/dist/types/memories/storage.d.ts +1 -0
- package/dist/types/memory-backend/types.d.ts +6 -1
- package/dist/types/modes/components/model-selector.d.ts +11 -4
- package/dist/types/modes/components/notifications-settings-editor.d.ts +2 -166
- package/dist/types/modes/components/settings-defs.d.ts +2 -1
- package/dist/types/modes/components/settings-selector.d.ts +5 -2
- package/dist/types/modes/components/smart-routing-panel.d.ts +19 -14
- package/dist/types/modes/components/tool-execution.d.ts +6 -0
- package/dist/types/modes/controllers/goal-mode-controller.d.ts +5 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +7 -59
- package/dist/types/plan-mode/state.d.ts +7 -0
- package/dist/types/runtime-mcp/config.d.ts +8 -0
- package/dist/types/runtime-mcp/manager.d.ts +43 -0
- package/dist/types/runtime-mcp/session-controls-grant.d.ts +7 -0
- package/dist/types/sdk/broker/broker.d.ts +33 -7
- package/dist/types/sdk/broker/lifecycle.d.ts +1 -0
- package/dist/types/sdk/broker/session-index.d.ts +2 -0
- package/dist/types/sdk/broker/session-scope.d.ts +31 -1
- package/dist/types/sdk/broker/spawn-authority.d.ts +19 -0
- package/dist/types/sdk/broker/spawn-substrate.d.ts +12 -1
- package/dist/types/sdk/bus/index.d.ts +5 -0
- package/dist/types/sdk/bus/notification-orchestration.d.ts +21 -3
- package/dist/types/sdk/bus/notification-service.d.ts +2 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
- package/dist/types/sdk/cli/rows.d.ts +7 -0
- package/dist/types/sdk/extension-interaction.d.ts +108 -0
- package/dist/types/sdk/host/control/btw-ask.d.ts +19 -0
- package/dist/types/sdk/host/control/dispatch.d.ts +2 -0
- package/dist/types/sdk/host/control/index.d.ts +1 -0
- package/dist/types/sdk/host/control/operations.d.ts +7 -0
- package/dist/types/sdk/host/external-permissions.d.ts +47 -0
- package/dist/types/sdk/host/host.d.ts +8 -2
- package/dist/types/sdk/host/query/handlers.d.ts +1 -0
- package/dist/types/sdk/host/session-runtime.d.ts +13 -1
- package/dist/types/sdk/host/surface-policy.d.ts +2 -1
- package/dist/types/sdk/index.d.ts +11 -0
- package/dist/types/sdk/job-observation.d.ts +51 -0
- package/dist/types/sdk/lifecycle/service.d.ts +6 -1
- package/dist/types/sdk/notification-setup-contract.d.ts +169 -0
- package/dist/types/sdk/notification-setup.d.ts +54 -0
- package/dist/types/sdk/protocol/adapter-validation.d.ts +2 -0
- package/dist/types/sdk/router/session-router.d.ts +5 -0
- package/dist/types/sdk/routing-settings.d.ts +57 -0
- package/dist/types/sdk/session-list.d.ts +5 -0
- package/dist/types/sdk/session-recap.d.ts +50 -0
- package/dist/types/sdk/session.d.ts +14 -0
- package/dist/types/sdk/settings-catalog.d.ts +52 -0
- package/dist/types/sdk/workflow-gates.d.ts +9 -0
- package/dist/types/session/agent-session.d.ts +129 -15
- package/dist/types/session/client-bridge.d.ts +1 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +6 -0
- package/dist/types/session/recap.d.ts +104 -0
- package/dist/types/session/session-manager.d.ts +51 -1
- package/dist/types/session/streaming-output.d.ts +9 -1
- package/dist/types/session/workflow-recovery-field-fence.d.ts +4 -0
- package/dist/types/session/yield-queue.d.ts +16 -0
- package/dist/types/task/executor.d.ts +2 -0
- package/dist/types/tools/auto-generated-guard.d.ts +8 -1
- package/dist/types/tools/bash.d.ts +1 -1
- package/dist/types/tools/grouped-file-tree.d.ts +21 -0
- package/dist/types/tools/image-gen.d.ts +6 -1
- package/dist/types/tools/index.d.ts +7 -0
- package/dist/types/tui/file-list.d.ts +0 -3
- package/dist/types/utils/gh.d.ts +5 -0
- package/dist/types/utils/herdr-core-status.d.ts +31 -0
- package/dist/types/utils/herdr-pane.d.ts +7 -0
- package/dist/types/utils/recap-generator.d.ts +41 -0
- package/dist/types/web/hardened-http.d.ts +41 -0
- package/dist/types/web/insane/url-guard.d.ts +2 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +28 -1
- package/src/async/job-manager.ts +381 -41
- package/src/cli/auth-broker-cli.ts +11 -53
- package/src/cli/auth-gateway-cli.ts +13 -56
- package/src/cli/auth-token-file.ts +56 -0
- package/src/cli/customize-doctor.ts +40 -27
- package/src/cli/doctor/install-repairs.ts +36 -2
- package/src/cli/doctor/repairs.ts +1 -0
- package/src/cli/doctor/report.ts +2 -0
- package/src/cli/doctor/types.ts +1 -0
- package/src/cli/install-activation.ts +58 -1
- package/src/cli/malloc-env-guard.ts +11 -0
- package/src/cli/session-picker.ts +8 -2
- package/src/cli/setup-cli.ts +2 -0
- package/src/cli/update-cli.ts +48 -3
- package/src/cli-main.ts +2 -2
- package/src/cli-ordinary.ts +2 -2
- package/src/commands/harness.ts +16 -3
- package/src/config/atomic-yaml-patch.ts +439 -141
- package/src/config/machine-identity.ts +6 -2
- package/src/config/mcp-schema.json +1 -1
- package/src/config/model-profile-activation.ts +505 -248
- package/src/config/model-registry.ts +54 -2
- package/src/config/models-config-schema.ts +2 -0
- package/src/config/settings-schema.ts +52 -8
- package/src/config/settings.ts +640 -237
- package/src/config/task-delegation.ts +4 -1
- package/src/coordinator-mcp/question-gate-codec.ts +17 -5
- package/src/coordinator-mcp/server.ts +2 -0
- package/src/extensibility/extensions/runner.ts +6 -0
- package/src/extensibility/gjc-plugins/installer.ts +2 -1
- package/src/extensibility/plugins/marketplace/fetcher.ts +28 -119
- package/src/extensibility/slash-commands.ts +90 -16
- package/src/gjc-runtime/launch-tmux.ts +79 -23
- package/src/gjc-runtime/launch-worktree.ts +15 -3
- package/src/gjc-runtime/managed-owner-admission.ts +298 -212
- package/src/gjc-runtime/managed-owner-binding.ts +410 -0
- package/src/gjc-runtime/managed-owner-supervisor.ts +265 -112
- package/src/gjc-runtime/owner-lifecycle-path.ts +82 -0
- package/src/gjc-runtime/owner-lifecycle-root.ts +26 -0
- package/src/gjc-runtime/ralplan-current-final.ts +35 -15
- package/src/gjc-runtime/ralplan-runtime.ts +3 -0
- package/src/gjc-runtime/session-state-sidecar.ts +61 -28
- package/src/gjc-runtime/tmux-common.ts +28 -0
- package/src/gjc-runtime/tmux-owner-isolation.ts +1100 -111
- package/src/gjc-runtime/tmux-sessions.ts +293 -58
- package/src/gjc-runtime/ultragoal-change-set.ts +8 -1
- package/src/gjc-runtime/ultragoal-owner-loss-recovery.ts +1 -1
- package/src/harness-control-plane/finalize.ts +2 -0
- package/src/harness-control-plane/owner.ts +23 -1
- package/src/harness-control-plane/preserve.ts +7 -1
- package/src/harness-control-plane/session-lease.ts +357 -3
- package/src/harness-control-plane/storage.ts +61 -10
- package/src/hashline/execute.ts +13 -1
- package/src/internal-urls/docs-index.generated.ts +12 -12
- package/src/lsp/lspmux.ts +4 -0
- package/src/main.ts +44 -3
- package/src/master-mode/snapshot.ts +13 -1
- package/src/memories/index.ts +8 -1
- package/src/memories/storage.ts +1 -0
- package/src/memory-backend/types.ts +6 -1
- package/src/modes/acp/acp-agent.ts +28 -4
- package/src/modes/components/gjc-bundle-settings.ts +56 -14
- package/src/modes/components/model-selector.ts +98 -18
- package/src/modes/components/notifications-settings-editor.ts +68 -188
- package/src/modes/components/session-selector.ts +27 -5
- package/src/modes/components/settings-defs.ts +4 -10
- package/src/modes/components/settings-selector.ts +93 -66
- package/src/modes/components/smart-routing-panel.ts +363 -48
- package/src/modes/components/tool-execution.ts +388 -9
- package/src/modes/controllers/event-controller.ts +2 -1
- package/src/modes/controllers/extension-ui-controller.ts +2 -1
- package/src/modes/controllers/goal-mode-controller.ts +24 -0
- package/src/modes/controllers/plan-mode-controller.ts +11 -3
- package/src/modes/controllers/selector-controller.ts +127 -1242
- package/src/modes/interactive-mode.ts +44 -3
- package/src/modes/runtime-init.ts +2 -1
- package/src/modes/shared/agent-wire/approval-gate.ts +13 -2
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +2 -4
- package/src/plan-mode/state.ts +17 -0
- package/src/prompts/system/master-mode.md +2 -0
- package/src/prompts/system/recap-system.md +5 -0
- package/src/prompts/system/system-prompt.md +5 -1
- package/src/prompts/tools/ask.md +4 -3
- package/src/runtime-mcp/config.ts +20 -1
- package/src/runtime-mcp/manager.ts +588 -45
- package/src/runtime-mcp/session-controls-grant.ts +24 -0
- package/src/sdk/acp/adapter.ts +14 -3
- package/src/sdk/broker/broker.ts +237 -23
- package/src/sdk/broker/lifecycle.ts +2 -0
- package/src/sdk/broker/session-index.ts +93 -19
- package/src/sdk/broker/session-scope.ts +81 -2
- package/src/sdk/broker/spawn-authority.ts +34 -5
- package/src/sdk/broker/spawn-substrate.ts +117 -18
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +77 -11
- package/src/sdk/bus/notification-orchestration.ts +141 -59
- package/src/sdk/bus/notification-service.ts +25 -23
- package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
- package/src/sdk/cli/master-cli.ts +2 -2
- package/src/sdk/cli/rows.ts +9 -0
- package/src/sdk/cli/session-cli.ts +29 -4
- package/src/sdk/extension-interaction.ts +533 -0
- package/src/sdk/host/control/btw-ask.ts +49 -0
- package/src/sdk/host/control/dispatch.ts +12 -0
- package/src/sdk/host/control/index.ts +1 -0
- package/src/sdk/host/control/operations.ts +7 -0
- package/src/sdk/host/external-permissions.ts +332 -0
- package/src/sdk/host/host.ts +8 -2
- package/src/sdk/host/query/handlers.ts +9 -0
- package/src/sdk/host/sdk-surface-parity.test.ts +55 -1
- package/src/sdk/host/session-runtime.test.ts +142 -1
- package/src/sdk/host/session-runtime.ts +108 -28
- package/src/sdk/host/surface-policy.ts +11 -0
- package/src/sdk/index.ts +15 -0
- package/src/sdk/job-observation.ts +157 -0
- package/src/sdk/lifecycle/service.ts +15 -2
- package/src/sdk/notification-setup-contract.ts +181 -0
- package/src/sdk/notification-setup.ts +1151 -0
- package/src/sdk/protocol/adapter-validation.ts +6 -1
- package/src/sdk/protocol/operation-inventory.generated.json +239 -6
- package/src/sdk/protocol/operation-registry.ts +21 -3
- package/src/sdk/router/session-router.ts +12 -1
- package/src/sdk/routing-settings.ts +395 -0
- package/src/sdk/session-list.ts +37 -0
- package/src/sdk/session-recap.ts +121 -0
- package/src/sdk/session.ts +335 -23
- package/src/sdk/settings-catalog.ts +119 -0
- package/src/sdk/workflow-gates.ts +30 -0
- package/src/session/agent-session.ts +1880 -238
- package/src/session/client-bridge.ts +1 -1
- package/src/session/contribution-prep.ts +8 -1
- package/src/session/internal/managed-session-storage.ts +17 -3
- package/src/session/recap.ts +298 -0
- package/src/session/session-manager.ts +776 -121
- package/src/session/streaming-output.ts +69 -9
- package/src/session/workflow-recovery-field-fence.ts +27 -0
- package/src/session/yield-queue.ts +52 -1
- package/src/setup/provider-presets.json +3 -1
- package/src/slash-commands/builtin-registry.ts +124 -4
- package/src/ssh/connection-manager.ts +3 -2
- package/src/ssh/ssh-executor.ts +3 -0
- package/src/ssh/sshfs-mount.ts +5 -4
- package/src/task/executor.ts +3 -0
- package/src/task/index.ts +48 -19
- package/src/tools/ast-edit.ts +10 -47
- package/src/tools/ast-grep.ts +10 -45
- package/src/tools/auto-generated-guard.ts +21 -1
- package/src/tools/bash-allowed-prefixes.ts +2 -0
- package/src/tools/bash.ts +10 -4
- package/src/tools/bisect.ts +5 -0
- package/src/tools/browser/launch.ts +7 -2
- package/src/tools/browser/registry.ts +5 -0
- package/src/tools/grouped-file-tree.ts +86 -0
- package/src/tools/image-gen.ts +180 -174
- package/src/tools/index.ts +7 -0
- package/src/tools/json-tree.ts +2 -2
- package/src/tools/recipe/runners/cargo.ts +3 -0
- package/src/tools/recipe/runners/just.ts +3 -0
- package/src/tools/recipe/runners/task.ts +3 -0
- package/src/tools/search.ts +9 -48
- package/src/tools/tool-catalog.generated.ts +1 -1
- package/src/tui/file-list.ts +14 -3
- package/src/utils/gh.ts +14 -1
- package/src/utils/git.ts +1 -8
- package/src/utils/herdr-core-status.ts +156 -0
- package/src/utils/herdr-pane.ts +38 -26
- package/src/utils/recap-generator.ts +191 -0
- package/src/web/hardened-http.ts +183 -0
- package/src/web/insane/bridge.ts +2 -1
- package/src/web/insane/url-guard.ts +7 -2
- package/src/web/scrapers/youtube.ts +3 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
2
|
import { type Api, type Model } from "@gajae-code/ai/core";
|
|
3
|
-
import type { AgentSession, AgentSessionProfileInstalledOverrideState, DefaultFallbackRuntimeState } from "../session/agent-session";
|
|
3
|
+
import type { AgentSession, AgentSessionProfileInstalledOverrideState, DefaultFallbackRuntimeState, PreparedProfileModelSelection, SessionAgentModelOverrideState } from "../session/agent-session";
|
|
4
4
|
import { type ModelProfileDefinition } from "./model-profiles";
|
|
5
5
|
export { resolveModelProfileName } from "./model-profile-contract";
|
|
6
|
+
import { type DurableModelProfileOwnership } from "./model-profile-ownership";
|
|
6
7
|
import { type GjcModelAssignmentTargetId, type ModelRegistry } from "./model-registry";
|
|
7
8
|
import { type ModelSelectorValue } from "./model-selector-value";
|
|
8
9
|
import type { Settings } from "./settings";
|
|
@@ -37,12 +38,16 @@ type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel
|
|
|
37
38
|
/** Profile-installed baselines, preserved when a refreshed profile drops an assignment. */
|
|
38
39
|
getProfileInstalledOverrideState?: () => AgentSessionProfileInstalledOverrideState;
|
|
39
40
|
restoreProfileInstalledOverrideState?: (state: AgentSessionProfileInstalledOverrideState) => void;
|
|
41
|
+
getSessionAgentModelOverrideState?: AgentSession["getSessionAgentModelOverrideState"];
|
|
42
|
+
retireSessionAgentModelOverrides?: AgentSession["retireSessionAgentModelOverrides"];
|
|
43
|
+
restoreSessionAgentModelOverrides?: AgentSession["restoreSessionAgentModelOverrides"];
|
|
40
44
|
/** Re-apply vendor-separated delegation (task tool + prompt) after the role layer changed. */
|
|
41
45
|
syncEagerDelegation?: () => Promise<void>;
|
|
42
46
|
getSessionDefaultModelSelector?: () => string | undefined;
|
|
43
47
|
recordResumeDefaultModel?: (selector: string | undefined) => void;
|
|
44
48
|
getUserCanonicalVariantSelection?: () => UserCanonicalVariantSelection;
|
|
45
49
|
getUserModelSelectionRevision?: () => number;
|
|
50
|
+
getThinkingLevelMutationRevision?: () => number;
|
|
46
51
|
seedDefaultFallbackResolution?: (activeIndex: number, skips: Array<{
|
|
47
52
|
selector: string;
|
|
48
53
|
reason: string;
|
|
@@ -55,6 +60,9 @@ type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel
|
|
|
55
60
|
prepareModelSelectionForProfileActivation?: AgentSession["prepareModelSelectionForProfileActivation"];
|
|
56
61
|
commitPreparedProfileModelSelection?: AgentSession["commitPreparedProfileModelSelection"];
|
|
57
62
|
finishPreparedProfileModelSelection?: AgentSession["finishPreparedProfileModelSelection"];
|
|
63
|
+
setThinkingLevel?: AgentSession["setThinkingLevel"];
|
|
64
|
+
dispose?: AgentSession["dispose"];
|
|
65
|
+
sessionLifecycle?: AgentSession["sessionLifecycle"];
|
|
58
66
|
modelRegistry?: Pick<ModelRegistry, "getSessionCanonicalVariant" | "restoreSessionCanonicalVariant" | "clearCanonicalVariant" | "getModelProfile" | "getAvailable" | "lookupAliasExists" | "resolveModelByLookupAlias" | "authStorage" | "isCredentiallessProvider"> & Partial<Pick<ModelRegistry, "seedCanonicalVariant">>;
|
|
59
67
|
getConfiguredModelChainState?: (role: string) => ConfiguredModelChainState | undefined;
|
|
60
68
|
};
|
|
@@ -67,6 +75,7 @@ type ConfiguredModelChainState = {
|
|
|
67
75
|
type PublishedModelProfileActivationState = {
|
|
68
76
|
model: Model<Api> | undefined;
|
|
69
77
|
thinkingLevel: ThinkingLevel | undefined;
|
|
78
|
+
thinkingIntentRevision: number | undefined;
|
|
70
79
|
modelRolesOverride: Readonly<Record<string, ModelSelectorValue>> | undefined;
|
|
71
80
|
agentModelOverridesOverride: Readonly<Record<string, ModelSelectorValue>> | undefined;
|
|
72
81
|
defaultChainState: ConfiguredModelChainState | undefined;
|
|
@@ -75,12 +84,6 @@ type PublishedModelProfileActivationState = {
|
|
|
75
84
|
activatedModelProfile: string | undefined;
|
|
76
85
|
profileInstalledOverrideState: AgentSessionProfileInstalledOverrideState | undefined;
|
|
77
86
|
sessionDefaultModel: string | undefined;
|
|
78
|
-
persistedModelRoles: Readonly<Record<string, ModelSelectorValue>> | undefined;
|
|
79
|
-
persistedAgentModelOverrides: Readonly<Record<string, ModelSelectorValue>> | undefined;
|
|
80
|
-
persistedDefaultProfile: string | undefined;
|
|
81
|
-
persistedDefaultThinkingLevel: Exclude<ThinkingLevel, "inherit"> | undefined;
|
|
82
|
-
defaultThinkingLevelOverride: Exclude<ThinkingLevel, "inherit"> | undefined;
|
|
83
|
-
defaultProfileOverride: string | undefined;
|
|
84
87
|
};
|
|
85
88
|
export interface PrepareModelProfileActivationOptions {
|
|
86
89
|
session: ModelProfileActivationSession;
|
|
@@ -106,13 +109,33 @@ export interface ApplyModelProfileActivationOptions {
|
|
|
106
109
|
signal?: AbortSignal;
|
|
107
110
|
/** Cancels deferred activation if a newer user model selection exists. */
|
|
108
111
|
isCurrent?: () => boolean;
|
|
112
|
+
/** Captured before yielding, or advanced only by an applicable local predecessor receipt. */
|
|
113
|
+
observedOwnership?: DurableModelProfileOwnership;
|
|
114
|
+
/** Recheck request intent under the durable lock, then again before synchronous publication. */
|
|
115
|
+
validateCurrent?: (durableCommitted: boolean) => void;
|
|
116
|
+
/** Snapshot only activation-owned state, before asynchronous finishing can admit unrelated intent. */
|
|
117
|
+
onRuntimePublished?: () => void;
|
|
109
118
|
}
|
|
110
119
|
export interface PreparedModelProfileActivation {
|
|
111
120
|
profileName: string;
|
|
112
121
|
session: ModelProfileActivationSession & {
|
|
113
122
|
setModelTemporary: AgentSession["setModelTemporary"];
|
|
114
123
|
};
|
|
115
|
-
settings: Pick<Settings, "clearOverride" | "get" | "getGlobal" | "getOverride" | "override" | "set" | "unset" | "flush" | "flushOrThrow">;
|
|
124
|
+
settings: Pick<Settings, "clearOverride" | "get" | "getGlobal" | "getOverride" | "override" | "set" | "unset" | "flush" | "flushOrThrow" | "commitAtomicBatchWithCurrent">;
|
|
125
|
+
observedOwnership: DurableModelProfileOwnership;
|
|
126
|
+
committedOwnership?: DurableModelProfileOwnership;
|
|
127
|
+
binding: {
|
|
128
|
+
sessionId: string;
|
|
129
|
+
generation: number | undefined;
|
|
130
|
+
userSelectionRevision: number | undefined;
|
|
131
|
+
settingsIntent: {
|
|
132
|
+
modelRoles: unknown;
|
|
133
|
+
agentOverrides: unknown;
|
|
134
|
+
globalRoles: unknown;
|
|
135
|
+
globalAgentOverrides: unknown;
|
|
136
|
+
globalThinking: unknown;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
116
139
|
previousModel: Model<Api> | undefined;
|
|
117
140
|
previousThinkingLevel: ThinkingLevel | undefined;
|
|
118
141
|
previousAgentModelOverrides: Record<string, ModelSelectorValue>;
|
|
@@ -123,16 +146,18 @@ export interface PreparedModelProfileActivation {
|
|
|
123
146
|
previousAgentModelOverridesOverride: Record<string, ModelSelectorValue> | undefined;
|
|
124
147
|
previousDefaultProfileOverride: string | undefined;
|
|
125
148
|
previousPersistedDefaultProfile: string | undefined;
|
|
126
|
-
previousPersistedDefaultThinkingLevel: Exclude<ThinkingLevel, "inherit"> | undefined;
|
|
127
|
-
previousDefaultThinkingLevelOverride: Exclude<ThinkingLevel, "inherit"> | undefined;
|
|
128
149
|
baseAgentModelOverrides: Record<string, ModelSelectorValue>;
|
|
129
150
|
baseModelRoles: Record<string, ModelSelectorValue>;
|
|
130
151
|
previousDefaultChain: readonly string[] | undefined;
|
|
131
152
|
previousDefaultChainState: ConfiguredModelChainState | undefined;
|
|
132
153
|
previousProfileInstalledOverrideState: AgentSessionProfileInstalledOverrideState | undefined;
|
|
133
|
-
|
|
154
|
+
previousSessionAgentModelOverrides: SessionAgentModelOverrideState | undefined;
|
|
155
|
+
preserveSessionAgentModelOverrides: boolean;
|
|
156
|
+
retiredSessionAgentModelRevision?: number;
|
|
157
|
+
preparedDefaultModelSelection: PreparedProfileModelSelection | undefined;
|
|
134
158
|
defaultChainPublished: boolean;
|
|
135
159
|
defaultModelPublished: boolean;
|
|
160
|
+
thinkingLevelPublished: boolean;
|
|
136
161
|
/** MRU order slot claimed when the reload publication committed the profile DEFAULT. */
|
|
137
162
|
defaultModelPublishedUsageSequence?: number;
|
|
138
163
|
publishedState: PublishedModelProfileActivationState | undefined;
|
|
@@ -321,7 +346,7 @@ export declare function resolveModelProfileDefaultChain(options: {
|
|
|
321
346
|
export declare function rewriteSelectorForProxy(selector: string, proxyProvider: string, proxyMode: ModelProfileProxyMode, allModels: Model<Api>[], directlyAuthenticated: ReadonlySet<string>, routableProviders: ReadonlySet<string>): string;
|
|
322
347
|
export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
|
|
323
348
|
/** Publish the prepared model selection and role layer without awaiting. */
|
|
324
|
-
export declare function publishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: Pick<ApplyModelProfileActivationOptions, "preserveDefaultModelSelection" | "preserveLiveModelSelection">): void;
|
|
349
|
+
export declare function publishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: Pick<ApplyModelProfileActivationOptions, "preserveDefaultModelSelection" | "preserveLiveModelSelection" | "thinkingLevelOverride">): void;
|
|
325
350
|
/**
|
|
326
351
|
* Record a published profile DEFAULT in the model usage order. Call synchronously
|
|
327
352
|
* once the enclosing publication finalized, before any await: a user selection
|
|
@@ -329,7 +354,9 @@ export declare function publishPreparedModelProfileActivation(prepared: Prepared
|
|
|
329
354
|
* most recent usage instead of being overtaken by this older profile choice.
|
|
330
355
|
*/
|
|
331
356
|
export declare function recordPublishedModelProfileActivationUsage(prepared: PreparedModelProfileActivation): void;
|
|
332
|
-
export declare function finishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation
|
|
357
|
+
export declare function finishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: {
|
|
358
|
+
strictModelSelection?: boolean;
|
|
359
|
+
}): Promise<void>;
|
|
333
360
|
export declare function applyPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: ApplyModelProfileActivationOptions): Promise<void>;
|
|
334
361
|
/** Restore an applied activation when its enclosing settings/registry commit fails. */
|
|
335
362
|
export declare function rollbackPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: ApplyModelProfileActivationOptions): Promise<void>;
|
|
@@ -126,6 +126,8 @@ export declare const ModelsConfigFile: ConfigFile<{
|
|
|
126
126
|
type: "llama.cpp" | "lm-studio" | "models-dev" | "ollama" | "omlx" | "openai-models-list" | "sglang" | "vllm";
|
|
127
127
|
apiByModelPrefix?: Record<string, "anthropic-messages" | "openai-completions"> | undefined;
|
|
128
128
|
modelsDevProvider?: string | undefined;
|
|
129
|
+
outputModalities?: string[] | undefined;
|
|
130
|
+
inputModalities?: string[] | undefined;
|
|
129
131
|
} | undefined;
|
|
130
132
|
requestTransform?: {
|
|
131
133
|
profile?: "openai-proxy" | undefined;
|
|
@@ -676,6 +678,7 @@ export declare class ModelRegistry {
|
|
|
676
678
|
* Check if a model is using OAuth credentials (subscription).
|
|
677
679
|
*/
|
|
678
680
|
isUsingOAuth(model: Model<Api>): boolean;
|
|
681
|
+
/** Effective dispatch kind, including this registry's config and runtime key overrides. */
|
|
679
682
|
getSessionCredentialType(provider: string, sessionId?: string): "api_key" | "oauth" | undefined;
|
|
680
683
|
/**
|
|
681
684
|
* Remove custom API/OAuth registrations for a specific extension source.
|
|
@@ -367,6 +367,8 @@ export declare const ProviderDiscoverySchema: z.ZodObject<{
|
|
|
367
367
|
"openai-completions": "openai-completions";
|
|
368
368
|
}>>>;
|
|
369
369
|
modelsDevProvider: z.ZodOptional<z.ZodString>;
|
|
370
|
+
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
371
|
+
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
370
372
|
}, z.core.$strip>;
|
|
371
373
|
export declare const ProviderAuthSchema: z.ZodEnum<{
|
|
372
374
|
apiKey: "apiKey";
|
|
@@ -494,6 +496,8 @@ export declare const ModelsConfigSchema: z.ZodObject<{
|
|
|
494
496
|
"openai-completions": "openai-completions";
|
|
495
497
|
}>>>;
|
|
496
498
|
modelsDevProvider: z.ZodOptional<z.ZodString>;
|
|
499
|
+
outputModalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
500
|
+
inputModalities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
497
501
|
}, z.core.$strip>>;
|
|
498
502
|
requestTransform: z.ZodOptional<z.ZodObject<{
|
|
499
503
|
profile: z.ZodOptional<z.ZodEnum<{
|
|
@@ -86,29 +86,37 @@ export type JsonSchemaObject = {
|
|
|
86
86
|
minimum?: number;
|
|
87
87
|
const?: unknown;
|
|
88
88
|
};
|
|
89
|
-
interface
|
|
89
|
+
export interface SettingApplication {
|
|
90
|
+
kind: "next-run" | "host-presentation" | "reload" | "restart";
|
|
91
|
+
reason: string;
|
|
92
|
+
}
|
|
93
|
+
interface SettingApplicationMetadata {
|
|
94
|
+
/** Absent means application behavior has not been classified for the portable catalog. */
|
|
95
|
+
application?: SettingApplication;
|
|
96
|
+
}
|
|
97
|
+
interface BooleanDef extends SettingApplicationMetadata {
|
|
90
98
|
type: "boolean";
|
|
91
99
|
default?: boolean;
|
|
92
100
|
ui?: UiBoolean;
|
|
93
101
|
}
|
|
94
|
-
interface StringDef {
|
|
102
|
+
interface StringDef extends SettingApplicationMetadata {
|
|
95
103
|
type: "string";
|
|
96
104
|
default: string | undefined;
|
|
97
105
|
ui?: UiString;
|
|
98
106
|
}
|
|
99
|
-
interface NumberDef {
|
|
107
|
+
interface NumberDef extends SettingApplicationMetadata {
|
|
100
108
|
type: "number";
|
|
101
109
|
default: number;
|
|
102
110
|
validate?: (value: number) => boolean;
|
|
103
111
|
ui?: UiNumber;
|
|
104
112
|
}
|
|
105
|
-
interface EnumDef<T extends readonly string[]> {
|
|
113
|
+
interface EnumDef<T extends readonly string[]> extends SettingApplicationMetadata {
|
|
106
114
|
type: "enum";
|
|
107
115
|
values: T;
|
|
108
116
|
default: T[number];
|
|
109
117
|
ui?: UiEnum<T>;
|
|
110
118
|
}
|
|
111
|
-
interface ArrayDef<T> {
|
|
119
|
+
interface ArrayDef<T> extends SettingApplicationMetadata {
|
|
112
120
|
type: "array";
|
|
113
121
|
default: T[];
|
|
114
122
|
items?: {
|
|
@@ -133,7 +141,7 @@ interface ConstrainedRecordValueDef {
|
|
|
133
141
|
pattern: string;
|
|
134
142
|
description: string;
|
|
135
143
|
}
|
|
136
|
-
interface ConstrainedRecordDef<T> {
|
|
144
|
+
interface ConstrainedRecordDef<T> extends SettingApplicationMetadata {
|
|
137
145
|
type: "constrained-record";
|
|
138
146
|
default: T;
|
|
139
147
|
keys: readonly string[];
|
|
@@ -141,13 +149,13 @@ interface ConstrainedRecordDef<T> {
|
|
|
141
149
|
description?: string;
|
|
142
150
|
ui?: UiBase;
|
|
143
151
|
}
|
|
144
|
-
interface RecordDef<T> {
|
|
152
|
+
interface RecordDef<T> extends SettingApplicationMetadata {
|
|
145
153
|
type: "record";
|
|
146
154
|
default: Record<string, T>;
|
|
147
155
|
valueSchema?: RecordValueDef;
|
|
148
156
|
ui?: UiBase;
|
|
149
157
|
}
|
|
150
|
-
export interface OptionalObjectDef<T> {
|
|
158
|
+
export interface OptionalObjectDef<T> extends SettingApplicationMetadata {
|
|
151
159
|
type: "optional-object";
|
|
152
160
|
default: undefined;
|
|
153
161
|
jsonSchema: JsonSchemaObject;
|
|
@@ -608,6 +616,15 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
608
616
|
}];
|
|
609
617
|
};
|
|
610
618
|
};
|
|
619
|
+
readonly "recap.enabled": {
|
|
620
|
+
readonly type: "boolean";
|
|
621
|
+
readonly default: false;
|
|
622
|
+
readonly ui: {
|
|
623
|
+
readonly tab: "context";
|
|
624
|
+
readonly label: "Session Recap";
|
|
625
|
+
readonly description: "Generate a short recap after completed turns for session listings. Uses the default model and may incur model usage; never adds recap text to the conversation.";
|
|
626
|
+
};
|
|
627
|
+
};
|
|
611
628
|
readonly modelTags: {
|
|
612
629
|
readonly type: "record";
|
|
613
630
|
readonly default: ModelTagsSettings;
|
|
@@ -1394,6 +1411,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1394
1411
|
};
|
|
1395
1412
|
};
|
|
1396
1413
|
readonly temperature: {
|
|
1414
|
+
readonly application: {
|
|
1415
|
+
readonly kind: "next-run";
|
|
1416
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1417
|
+
};
|
|
1397
1418
|
readonly type: "number";
|
|
1398
1419
|
readonly default: -1;
|
|
1399
1420
|
readonly ui: {
|
|
@@ -1428,6 +1449,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1428
1449
|
};
|
|
1429
1450
|
};
|
|
1430
1451
|
readonly topP: {
|
|
1452
|
+
readonly application: {
|
|
1453
|
+
readonly kind: "next-run";
|
|
1454
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1455
|
+
};
|
|
1431
1456
|
readonly type: "number";
|
|
1432
1457
|
readonly default: -1;
|
|
1433
1458
|
readonly ui: {
|
|
@@ -1462,6 +1487,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1462
1487
|
};
|
|
1463
1488
|
};
|
|
1464
1489
|
readonly topK: {
|
|
1490
|
+
readonly application: {
|
|
1491
|
+
readonly kind: "next-run";
|
|
1492
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1493
|
+
};
|
|
1465
1494
|
readonly type: "number";
|
|
1466
1495
|
readonly default: -1;
|
|
1467
1496
|
readonly ui: {
|
|
@@ -1492,6 +1521,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1492
1521
|
};
|
|
1493
1522
|
};
|
|
1494
1523
|
readonly minP: {
|
|
1524
|
+
readonly application: {
|
|
1525
|
+
readonly kind: "next-run";
|
|
1526
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1527
|
+
};
|
|
1495
1528
|
readonly type: "number";
|
|
1496
1529
|
readonly default: -1;
|
|
1497
1530
|
readonly ui: {
|
|
@@ -1518,6 +1551,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1518
1551
|
};
|
|
1519
1552
|
};
|
|
1520
1553
|
readonly presencePenalty: {
|
|
1554
|
+
readonly application: {
|
|
1555
|
+
readonly kind: "next-run";
|
|
1556
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1557
|
+
};
|
|
1521
1558
|
readonly type: "number";
|
|
1522
1559
|
readonly default: -1;
|
|
1523
1560
|
readonly ui: {
|
|
@@ -1548,6 +1585,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1548
1585
|
};
|
|
1549
1586
|
};
|
|
1550
1587
|
readonly repetitionPenalty: {
|
|
1588
|
+
readonly application: {
|
|
1589
|
+
readonly kind: "next-run";
|
|
1590
|
+
readonly reason: "New agent runs capture effective sampling; an in-flight run keeps its snapshot.";
|
|
1591
|
+
};
|
|
1551
1592
|
readonly type: "number";
|
|
1552
1593
|
readonly default: -1;
|
|
1553
1594
|
readonly ui: {
|
|
@@ -61,12 +61,13 @@ export declare const SettingsMigrationTestHooks: {
|
|
|
61
61
|
* to make the marker unreadable so the rollback path is exercised. */
|
|
62
62
|
beforeProjectMarkerMerge?: () => void | Promise<void>;
|
|
63
63
|
};
|
|
64
|
+
export type SettingsAtomicPath = SettingPath | `modelRoles.${string}`;
|
|
64
65
|
export type SettingsAtomicPatch = {
|
|
65
|
-
path:
|
|
66
|
+
path: SettingsAtomicPath;
|
|
66
67
|
op: "set";
|
|
67
68
|
value: unknown;
|
|
68
69
|
} | {
|
|
69
|
-
path:
|
|
70
|
+
path: SettingsAtomicPath;
|
|
70
71
|
op: "unset";
|
|
71
72
|
};
|
|
72
73
|
export type SettingsAtomicReceipt = CasReceipt;
|
|
@@ -87,6 +88,16 @@ export interface SettingsOptions {
|
|
|
87
88
|
*/
|
|
88
89
|
readonly?: boolean;
|
|
89
90
|
}
|
|
91
|
+
/** Configuration layers, not a claim about a consumer's live application. */
|
|
92
|
+
export type SettingsLayer = "global" | "project" | "runtime";
|
|
93
|
+
export interface SettingsPathResolution {
|
|
94
|
+
/** Highest configured scalar layer; objects can be constructed from several layers. */
|
|
95
|
+
origin: SettingsLayer | "default" | "layered";
|
|
96
|
+
/** Present, permitted layers in precedence order, including shadowed values. */
|
|
97
|
+
layers: SettingsLayer[];
|
|
98
|
+
/** Layers accepted by Settings merging; not filesystem write or execution authority. */
|
|
99
|
+
allowedLayers: SettingsLayer[];
|
|
100
|
+
}
|
|
90
101
|
/** Additional layer setup for {@link Settings.isolated}. */
|
|
91
102
|
export interface IsolatedSettingsOptions {
|
|
92
103
|
/** Initial runtime overrides. Notification paths are rejected. */
|
|
@@ -141,6 +152,13 @@ export declare class Settings implements NotificationSettingsReader {
|
|
|
141
152
|
* Returns the merged value from global + project + overrides, or the default.
|
|
142
153
|
*/
|
|
143
154
|
get<P extends SettingPath>(path: P): SettingValue<P>;
|
|
155
|
+
/**
|
|
156
|
+
* Describe Settings.get resolution without exposing configuration values.
|
|
157
|
+
* Object origins describe layered construction, not per-leaf provenance.
|
|
158
|
+
* This is a read-only snapshot; it is neither a durability receipt nor proof
|
|
159
|
+
* that an engine consumer has applied the resulting value.
|
|
160
|
+
*/
|
|
161
|
+
getResolutionSnapshot(): Record<SettingPath, SettingsPathResolution>;
|
|
144
162
|
/**
|
|
145
163
|
* Get a setting value from the user/global config only.
|
|
146
164
|
*
|
|
@@ -160,7 +178,12 @@ export declare class Settings implements NotificationSettingsReader {
|
|
|
160
178
|
getSchemaReport(): SettingsSchemaReport;
|
|
161
179
|
/** Effective merged autorouting state shared by settings diagnostics and routing policy. */
|
|
162
180
|
getEffectiveAutorouting(): AutoroutingEffective;
|
|
163
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Subscribe to effective-setting changes. The `apply` phase runs before schema hooks and
|
|
183
|
+
* ordinary observers so a live applicator sees the restored state before an observer can
|
|
184
|
+
* synchronously start a run.
|
|
185
|
+
*/
|
|
186
|
+
onChanged(listener: (path: SettingPath) => void, phase?: "apply" | "observe"): () => void;
|
|
164
187
|
/** The resolved global config.yml path, or null for in-memory settings. */
|
|
165
188
|
getGlobalConfigPath(): string | null;
|
|
166
189
|
/**
|
|
@@ -193,7 +216,14 @@ export declare class Settings implements NotificationSettingsReader {
|
|
|
193
216
|
* {@link set}, canonical state and hooks change only after the rename succeeds.
|
|
194
217
|
*/
|
|
195
218
|
commitAtomicBatch(patches: readonly SettingsAtomicPatch[]): Promise<CasReceipt>;
|
|
196
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* Build a batch from current YAML under the shared queue/lock. New local or
|
|
221
|
+
* runtime intent invalidates nonempty batches prepared asynchronously. Such
|
|
222
|
+
* builders must not perform irreversible external work before publication.
|
|
223
|
+
* Empty batches may hold the durable writer queue for an adjacent action, but
|
|
224
|
+
* cannot prevent synchronous setters or runtime overrides during that action.
|
|
225
|
+
* Synchronous memory builders publish without yielding to another setter.
|
|
226
|
+
*/
|
|
197
227
|
commitAtomicBatchWithCurrent(buildPatches: (current: Readonly<RawSettings>) => Promise<readonly SettingsAtomicPatch[]> | readonly SettingsAtomicPatch[]): Promise<CasReceipt>;
|
|
198
228
|
/**
|
|
199
229
|
* Apply runtime overrides (not persisted).
|
|
@@ -205,7 +235,11 @@ export declare class Settings implements NotificationSettingsReader {
|
|
|
205
235
|
* Clear a runtime override.
|
|
206
236
|
*/
|
|
207
237
|
clearOverride(path: SettingPath): void;
|
|
208
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* Flush a reserved debounced save without allowing it to be overtaken.
|
|
240
|
+
* A caller holding a YAML lease cannot flush an actively held file, even a
|
|
241
|
+
* different one; independent callers still wait in FIFO order.
|
|
242
|
+
*/
|
|
209
243
|
flush(): Promise<void>;
|
|
210
244
|
/** Like {@link flush}, but reports a durable save failure to the caller. */
|
|
211
245
|
flushOrThrow(): Promise<void>;
|
|
@@ -24,6 +24,8 @@ export interface EagerTaskDelegationInput {
|
|
|
24
24
|
settings: Settings;
|
|
25
25
|
/** Active profile, when its bindings are not (yet) installed into settings. */
|
|
26
26
|
profile?: ModelProfileDefinition;
|
|
27
|
+
/** Authoritative merged task role selectors for a live session. */
|
|
28
|
+
agentModelOverrides?: Readonly<Record<string, ModelSelectorValue>>;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Effective role selectors: profile mapping as the baseline, installed settings
|
|
@@ -110,6 +110,8 @@ export declare class ExtensionRunner {
|
|
|
110
110
|
*/
|
|
111
111
|
emitCredentialDisabled(event: CredentialDisabledEvent): Promise<void>;
|
|
112
112
|
getUIContext(): ExtensionUIContext;
|
|
113
|
+
/** Bind fresh UI for future contexts without rerunning initialization or changing captured contexts. */
|
|
114
|
+
setUIContext(uiContext: ExtensionUIContext): void;
|
|
113
115
|
hasUI(): boolean;
|
|
114
116
|
getExtensionPaths(): string[];
|
|
115
117
|
/** Get all registered tools from all extensions. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AutocompleteItem } from "@gajae-code/tui";
|
|
2
|
+
import type { AgentSession } from "../session/agent-session";
|
|
2
3
|
import { type BuiltinSlashCommand } from "../slash-commands/builtin-registry";
|
|
3
4
|
export type SlashCommandSource = "extension" | "prompt" | "skill";
|
|
4
5
|
export type SlashCommandLocation = "user" | "project" | "path";
|
|
@@ -18,7 +19,12 @@ export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand &
|
|
|
18
19
|
getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null;
|
|
19
20
|
getInlineHint?: (argumentText: string) => string | null;
|
|
20
21
|
}>;
|
|
21
|
-
|
|
22
|
+
/** Builtin command whose argument completions may resolve asynchronously from session state. */
|
|
23
|
+
export type SessionBuiltinSlashCommand = BuiltinSlashCommand & {
|
|
24
|
+
getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;
|
|
25
|
+
getInlineHint?: (argumentText: string) => string | null;
|
|
26
|
+
};
|
|
27
|
+
export declare function getBuiltinSlashCommandsForSession(hasExactMcpControls: boolean, session?: Pick<AgentSession, "hasSessionMcpControls" | "getSessionMcpCompletionCandidates">): readonly SessionBuiltinSlashCommand[];
|
|
22
28
|
/**
|
|
23
29
|
* Represents a custom slash command loaded from a file
|
|
24
30
|
*/
|
|
@@ -33,6 +39,13 @@ export interface FileSlashCommand {
|
|
|
33
39
|
level: "user" | "project" | "native";
|
|
34
40
|
};
|
|
35
41
|
}
|
|
42
|
+
/** A command name is shown as typed. Names that display sanitization would change are not loaded. */
|
|
43
|
+
export declare function isDisplaySafeCommandName(name: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Description shown for a file-backed slash command.
|
|
46
|
+
* Terminal controls are removed before the body-preview cutoff.
|
|
47
|
+
*/
|
|
48
|
+
export declare function slashCommandDescription(content: string): string;
|
|
36
49
|
export interface LoadSlashCommandsOptions {
|
|
37
50
|
/** Working directory for project-local commands. Default: getProjectDir() */
|
|
38
51
|
cwd?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ManagedOwnerRecoverableBinding, type ManagedOwnerSigabrtReceipt } from "./managed-owner-binding";
|
|
2
2
|
import { type UltragoalRecoveryDecision } from "./ultragoal-owner-loss-recovery";
|
|
3
3
|
export declare const MANAGED_OWNER_PREDECESSOR_TOKEN_ENV = "GJC_MANAGED_OWNER_PREDECESSOR_TOKEN";
|
|
4
4
|
export declare const MANAGED_OWNER_PREDECESSOR_GENERATION_ENV = "GJC_MANAGED_OWNER_PREDECESSOR_GENERATION";
|
|
@@ -10,7 +10,7 @@ export declare function trustedManagedOwnerTranscriptPath(env?: NodeJS.ProcessEn
|
|
|
10
10
|
export declare function trustedManagedOwnerLaunchSessionFile(env: NodeJS.ProcessEnv, cwd: string): string;
|
|
11
11
|
export interface ManagedOwnerRecoveryContext {
|
|
12
12
|
root: string;
|
|
13
|
-
binding:
|
|
13
|
+
binding: ManagedOwnerRecoverableBinding;
|
|
14
14
|
receipt: ManagedOwnerSigabrtReceipt;
|
|
15
15
|
admission: {
|
|
16
16
|
session_id: string;
|
|
@@ -28,17 +28,9 @@ export type ManagedOwnerAdmission = {
|
|
|
28
28
|
} | {
|
|
29
29
|
kind: "blocked";
|
|
30
30
|
};
|
|
31
|
-
/**
|
|
32
|
-
* This is the pre-CLI barrier. A replacement is identified only by the exact
|
|
33
|
-
* predecessor token supplied by its launch binding; directory enumeration is
|
|
34
|
-
* deliberately never an authority source.
|
|
35
|
-
*/
|
|
31
|
+
/** Pre-CLI barrier: environment only selects exact evidence; it never grants admission. */
|
|
36
32
|
export declare function admitManagedOwnerBeforeCli(): Promise<ManagedOwnerAdmission>;
|
|
37
|
-
/**
|
|
38
|
-
* The ordinary CLI factory has no recovery-owned writer-lease or exact-child
|
|
39
|
-
* reconciliation capability. Do not route a recovered owner through it: first
|
|
40
|
-
* revalidate the immutable evidence and B0, then publish a terminal handoff.
|
|
41
|
-
*/
|
|
33
|
+
/** The ordinary CLI does not own the recovery writer lease or exact-child reconciliation seam. */
|
|
42
34
|
export declare function completeManagedOwnerRecovery(context: ManagedOwnerRecoveryContext): Promise<{
|
|
43
35
|
kind: "handoff";
|
|
44
36
|
exitCode: 75;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
interface ManagedOwnerBindingBase {
|
|
2
|
+
schema_version: 3;
|
|
3
|
+
generation: string;
|
|
4
|
+
session_id: string;
|
|
5
|
+
run_id: string;
|
|
6
|
+
endpoint_incarnation: string;
|
|
7
|
+
child_token: string;
|
|
8
|
+
supervisor_pid: number;
|
|
9
|
+
supervisor_start_time: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ManagedOwnerOpaqueBinding extends ManagedOwnerBindingBase {
|
|
13
|
+
binding_kind: "opaque";
|
|
14
|
+
}
|
|
15
|
+
export interface ManagedOwnerRecoverableBinding extends ManagedOwnerBindingBase {
|
|
16
|
+
binding_kind: "recoverable";
|
|
17
|
+
command: string[];
|
|
18
|
+
command_sha256: string;
|
|
19
|
+
}
|
|
20
|
+
export type ManagedOwnerBinding = ManagedOwnerOpaqueBinding | ManagedOwnerRecoverableBinding;
|
|
21
|
+
export interface ManagedOwnerSigabrtReceipt {
|
|
22
|
+
schema_version: 2;
|
|
23
|
+
generation: string;
|
|
24
|
+
session_id: string;
|
|
25
|
+
run_id: string;
|
|
26
|
+
endpoint_incarnation: string;
|
|
27
|
+
child_token: string;
|
|
28
|
+
command_sha256: string;
|
|
29
|
+
supervisor_pid: number;
|
|
30
|
+
supervisor_start_time: string;
|
|
31
|
+
child_pid: number;
|
|
32
|
+
child_start_time: string;
|
|
33
|
+
signal: "SIGABRT";
|
|
34
|
+
signal_number: 6;
|
|
35
|
+
exit_code: number | null;
|
|
36
|
+
received_at: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ManagedOwnerBindingIdentity {
|
|
39
|
+
generation: string;
|
|
40
|
+
sessionId: string;
|
|
41
|
+
runId: string;
|
|
42
|
+
incarnation: string;
|
|
43
|
+
token: string;
|
|
44
|
+
}
|
|
45
|
+
export declare function managedOwnerCommandDigest(command: readonly string[]): string;
|
|
46
|
+
/** A runnable argv: a nonempty executable; later arguments may be empty but never contain NUL. */
|
|
47
|
+
export declare function isManagedOwnerCommand(value: unknown): value is string[];
|
|
48
|
+
export declare function isManagedOwnerBinding(value: unknown, expected?: ManagedOwnerBindingIdentity): value is ManagedOwnerBinding;
|
|
49
|
+
export declare function isManagedOwnerSigabrtReceipt(value: unknown, binding: ManagedOwnerRecoverableBinding): value is ManagedOwnerSigabrtReceipt;
|
|
50
|
+
/**
|
|
51
|
+
* Darwin: one per generation, published no-replace by the generation's supervisor
|
|
52
|
+
* after its binding. A close reads this exact file instead of scanning the
|
|
53
|
+
* lifecycle root, so retained history from earlier generations never matters.
|
|
54
|
+
*/
|
|
55
|
+
export interface ManagedOwnerSupervisorIndex {
|
|
56
|
+
schema_version: 1;
|
|
57
|
+
generation: string;
|
|
58
|
+
session_id: string;
|
|
59
|
+
child_token: string;
|
|
60
|
+
supervisor_pid: number;
|
|
61
|
+
supervisor_start_time: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function isManagedOwnerSupervisorIndex(value: unknown): value is ManagedOwnerSupervisorIndex;
|
|
64
|
+
/**
|
|
65
|
+
* Off Linux: published no-replace by each process admitted through a binding,
|
|
66
|
+
* before its generation fence. A supervisor killed after admission leaves no
|
|
67
|
+
* receipt and cannot reconcile its child, so a relaunch proves every admitted
|
|
68
|
+
* process gone through these records before it replaces the generation.
|
|
69
|
+
*/
|
|
70
|
+
export interface ManagedOwnerAdmittedChild {
|
|
71
|
+
schema_version: 1;
|
|
72
|
+
generation: string;
|
|
73
|
+
session_id: string;
|
|
74
|
+
child_token: string;
|
|
75
|
+
child_pid: number;
|
|
76
|
+
child_incarnation: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Named for the exact process: one process admits more than once (both CLI entry
|
|
80
|
+
* layers run admission), and a reused pid is a different process with its own record.
|
|
81
|
+
*/
|
|
82
|
+
export declare function managedOwnerAdmittedChildFile(token: string, pid: number, incarnation: string): string;
|
|
83
|
+
/** The pid an admitted-child record of `token` is named for, or undefined for any other entry. */
|
|
84
|
+
export declare function managedOwnerAdmittedChildPid(token: string, entry: string): number | undefined;
|
|
85
|
+
export declare function isManagedOwnerAdmittedChild(value: unknown, binding: ManagedOwnerBinding, entry: string): value is ManagedOwnerAdmittedChild;
|
|
86
|
+
/**
|
|
87
|
+
* Darwin: published no-replace by the exact supervisor, under the generation lock,
|
|
88
|
+
* as `relay-<generation>.pending.json` before it relays its cooperative signal for one
|
|
89
|
+
* intent. Only after the signal was sent does it publish `relay-<generation>.json`,
|
|
90
|
+
* whose `relayed_at` was sampled immediately before delivery, and remove the
|
|
91
|
+
* pending record. Only the confirmed record proves delivery: an operator-shutdown
|
|
92
|
+
* verdict requires it, and never for an observation earlier than `relayed_at`. A pending record without confirmation is uncertain and blocks retirement; an
|
|
93
|
+
* expired intent with neither was provably never delivered and may be retired.
|
|
94
|
+
*/
|
|
95
|
+
export interface ManagedOwnerRelayRecord {
|
|
96
|
+
schema_version: 1;
|
|
97
|
+
intent_id: string;
|
|
98
|
+
dispatch_id: string;
|
|
99
|
+
generation: string;
|
|
100
|
+
session_id: string;
|
|
101
|
+
server_key: string;
|
|
102
|
+
child_token: string;
|
|
103
|
+
supervisor_pid: number;
|
|
104
|
+
supervisor_start_time: string;
|
|
105
|
+
relayed_at: string;
|
|
106
|
+
}
|
|
107
|
+
export declare function isManagedOwnerRelayRecord(value: unknown): value is ManagedOwnerRelayRecord;
|
|
108
|
+
/** Darwin: the signal only the exact supervisor sends to relay a cooperative intent. */
|
|
109
|
+
export declare const MANAGED_OWNER_COOPERATIVE_SIGNAL = "SIGUSR2";
|
|
110
|
+
/**
|
|
111
|
+
* Darwin: published no-replace by an admitted child as
|
|
112
|
+
* `cooperative-ready-<generation>.json` only after it installed its cooperative
|
|
113
|
+
* signal handler, so its supervisor never relays to a child whose default action
|
|
114
|
+
* for that signal would kill it.
|
|
115
|
+
*/
|
|
116
|
+
export interface ManagedOwnerCooperativeReady {
|
|
117
|
+
schema_version: 1;
|
|
118
|
+
generation: string;
|
|
119
|
+
session_id: string;
|
|
120
|
+
child_token: string;
|
|
121
|
+
child_pid: number;
|
|
122
|
+
signal: typeof MANAGED_OWNER_COOPERATIVE_SIGNAL;
|
|
123
|
+
}
|
|
124
|
+
export declare function isManagedOwnerCooperativeReady(value: unknown): value is ManagedOwnerCooperativeReady;
|
|
125
|
+
/**
|
|
126
|
+
* Darwin: created exclusively by an admitted child as `shutdown-cause-<generation>.json`
|
|
127
|
+
* from the first termination signal it handles. `cooperative` means the supervisor's
|
|
128
|
+
* cooperative signal came first; any SIGTERM, SIGHUP or SIGINT handled before it
|
|
129
|
+
* records `signal`. Exclusive creation linearizes the two, so an unrelated signal the
|
|
130
|
+
* child began handling before the relay can never be attributed to that relay.
|
|
131
|
+
*/
|
|
132
|
+
export interface ManagedOwnerShutdownCause {
|
|
133
|
+
schema_version: 1;
|
|
134
|
+
generation: string;
|
|
135
|
+
session_id: string;
|
|
136
|
+
child_token: string;
|
|
137
|
+
child_pid: number;
|
|
138
|
+
cause: "cooperative" | "signal";
|
|
139
|
+
signal: string;
|
|
140
|
+
recorded_at: string;
|
|
141
|
+
}
|
|
142
|
+
export declare function isManagedOwnerShutdownCause(value: unknown): value is ManagedOwnerShutdownCause;
|
|
143
|
+
/**
|
|
144
|
+
* Darwin: published no-replace by the exact supervisor as `supervised-exit-<generation>.json`
|
|
145
|
+
* after the child it relayed a cooperative intent to has exited. `explained` is true
|
|
146
|
+
* only when the child's first handled cause was that relay and it then ended through
|
|
147
|
+
* its own exit (code 0 or the handled-SIGTERM 143), not a fatal signal. A cooperative
|
|
148
|
+
* close succeeds only with an explained record for its exact intent.
|
|
149
|
+
*/
|
|
150
|
+
export interface ManagedOwnerChildExit {
|
|
151
|
+
schema_version: 1;
|
|
152
|
+
generation: string;
|
|
153
|
+
session_id: string;
|
|
154
|
+
child_token: string;
|
|
155
|
+
child_pid: number;
|
|
156
|
+
intent_id: string;
|
|
157
|
+
dispatch_id: string;
|
|
158
|
+
signal: string | null;
|
|
159
|
+
exit_code: number | null;
|
|
160
|
+
explained: boolean;
|
|
161
|
+
observed_at: string;
|
|
162
|
+
}
|
|
163
|
+
export declare function isManagedOwnerChildExit(value: unknown): value is ManagedOwnerChildExit;
|
|
164
|
+
export {};
|