@gajae-code/coding-agent 0.21.0 → 0.21.1
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 +60 -0
- package/dist/types/config/autorouting-contract.d.ts +4 -4
- package/dist/types/config/autorouting-tier-map.d.ts +1 -1
- package/dist/types/config/keybindings.d.ts +1 -5
- package/dist/types/config/model-profile-activation.d.ts +30 -3
- package/dist/types/config/model-registry.d.ts +2 -0
- package/dist/types/config/models-config-schema.d.ts +8 -0
- package/dist/types/config/settings-schema.d.ts +7 -3
- package/dist/types/coordinator-mcp/canonical-json.d.ts +7 -0
- package/dist/types/extensibility/gjc-plugins/metadata.d.ts +1 -1
- package/dist/types/harness-control-plane/receipts.d.ts +1 -1
- package/dist/types/modes/components/settings-selector.d.ts +5 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/input-controller.d.ts +12 -0
- 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-schema.d.ts +1 -1
- package/dist/types/modes/types.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +101 -6
- package/dist/types/session/session-manager.d.ts +124 -9
- package/dist/types/setup/provider-onboarding.d.ts +55 -2
- package/dist/types/slash-commands/builtin-registry.d.ts +11 -0
- package/dist/types/utils/clipboard.d.ts +18 -0
- package/dist/types/utils/pasted-image-path.d.ts +2 -0
- package/dist/types/web/search/providers/keenable.d.ts +30 -0
- package/dist/types/web/search/types.d.ts +2 -2
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +28 -0
- package/src/cli/doctor/config-repairs.ts +1 -4
- package/src/cli/local-provider-smoke.ts +1 -4
- package/src/cli/public-command-help.ts +1 -1
- package/src/config/autorouting-contract.ts +5 -8
- package/src/config/autorouting-tier-map.ts +1 -1
- package/src/config/keybindings.ts +1 -2
- package/src/config/model-profile-activation.ts +332 -28
- package/src/config/model-registry.ts +156 -8
- package/src/config/models-config-schema.ts +27 -0
- package/src/config/settings-schema.ts +6 -0
- package/src/coordinator-mcp/canonical-json.ts +15 -0
- package/src/coordinator-mcp/policy.ts +1 -0
- package/src/coordinator-mcp/question-gate-codec.ts +1 -2
- package/src/coordinator-mcp/question-state.ts +2 -12
- package/src/coordinator-mcp/server.ts +1 -10
- package/src/customization/import.ts +1 -5
- package/src/discovery/mcp-compat.ts +1 -5
- package/src/discovery/mcp-json.ts +1 -4
- package/src/edit/notebook.ts +1 -5
- package/src/extensibility/gjc-plugins/lifecycle.ts +1 -3
- package/src/extensibility/gjc-plugins/metadata.ts +2 -5
- package/src/extensibility/gjc-plugins/schema.ts +1 -4
- package/src/gjc-runtime/deep-interview-crystallize.ts +1 -4
- package/src/gjc-runtime/deep-interview-runtime.ts +1 -4
- package/src/gjc-runtime/state-renderer.ts +1 -5
- package/src/gjc-runtime/tmux-owner-isolation.ts +1 -3
- package/src/gjc-runtime/ultragoal-owner-loss-recovery.ts +1 -4
- package/src/gjc-runtime/ultragoal-succession.ts +1 -4
- package/src/goals/continuation-timeout-guard.ts +1 -4
- package/src/harness-control-plane/receipts.ts +1 -1
- package/src/internal-urls/docs-index.generated.ts +4 -4
- package/src/migrate/mcp-mapper.ts +2 -4
- package/src/modes/components/hook-editor.ts +4 -8
- package/src/modes/components/hook-selector.ts +3 -1
- package/src/modes/components/settings-selector.ts +26 -2
- package/src/modes/controllers/command-controller.ts +4 -98
- package/src/modes/controllers/extension-ui-controller.ts +6 -14
- package/src/modes/controllers/goal-mode-controller.ts +4 -4
- package/src/modes/controllers/input-controller.ts +110 -46
- package/src/modes/controllers/plan-mode-controller.ts +6 -10
- package/src/modes/controllers/selector-controller.ts +66 -23
- package/src/modes/controllers/todo-command-controller.ts +2 -2
- package/src/modes/interactive-mode.ts +2 -2
- package/src/modes/prompt-action-autocomplete.ts +1 -1
- package/src/modes/runtime-init.ts +4 -4
- package/src/modes/shared/agent-wire/workflow-gate-schema.ts +1 -1
- package/src/modes/types.ts +1 -1
- package/src/modes/utils/hotkeys-markdown.ts +1 -1
- package/src/runtime-mcp/client.ts +1 -4
- package/src/runtime-mcp/elicitation.ts +1 -5
- package/src/runtime-mcp/protocol.ts +2 -4
- package/src/sdk/broker/lifecycle-ledger.ts +1 -0
- package/src/sdk/broker/lifecycle.ts +1 -0
- package/src/sdk/cli/rows.ts +2 -3
- package/src/sdk/cli/session-cli.ts +2 -8
- package/src/sdk/host/query/cursor.ts +1 -0
- package/src/sdk/host/reverse-leases.ts +1 -0
- package/src/sdk/lifecycle/service.ts +1 -0
- package/src/sdk/protocol/operation-inventory.generated.json +154 -0
- package/src/session/agent-session.ts +1877 -224
- package/src/session/btw-prefix-ledger.ts +1 -4
- package/src/session/internal/managed-gc-retirement-codec.ts +1 -4
- package/src/session/session-manager.ts +732 -224
- package/src/session/task-artifact-owner-codec.ts +1 -4
- package/src/session-import/claude.ts +1 -4
- package/src/session-import/detect.ts +1 -6
- package/src/session-import/provider-codex.ts +1 -6
- package/src/session-import/provider-service.ts +4 -0
- package/src/setup/hermes-setup.ts +1 -4
- package/src/setup/provider-onboarding.ts +514 -26
- package/src/slash-commands/builtin-registry.ts +26 -13
- package/src/slash-commands/helpers/todo.ts +3 -1
- package/src/task/delegation-hint.ts +1 -4
- package/src/task/executor.ts +4 -2
- package/src/task/provider-retry-status.ts +1 -4
- package/src/tools/json-tree.ts +1 -4
- package/src/tools/recipe/runners/pkg.ts +1 -5
- package/src/utils/clipboard.ts +155 -2
- package/src/utils/mac-file-urls.applescript +37 -0
- package/src/utils/pasted-image-path.ts +5 -0
- package/src/web/search/provider.ts +6 -0
- package/src/web/search/providers/keenable.ts +207 -0
- package/src/web/search/types.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,66 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.21.1] - 2026-11-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added an optional Keenable `web_search` provider. Select it with `providers.webSearch = "keenable"` or list it in `web_search.fallback`. It works without an API key; `KEENABLE_API_KEY` (or a stored `keenable` credential) only raises rate limits. `auto` resolution and the DuckDuckGo terminal fallback are unchanged.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Ctrl+V / Cmd+V attaches image files copied in Finder on macOS, and pastes the clipboard text when the clipboard holds no image instead of reporting "No image in clipboard".
|
|
14
|
+
|
|
15
|
+
### Removed
|
|
16
|
+
|
|
17
|
+
- Removed the unreachable `/copy` code, all and cmd branches; `/copy` takes no arguments and copies the last agent message.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Automatic and manual session titles no longer bar ordinary transcript appends for the rest of the session: title admission is scoped to its publication, while canonical shared appends keep their permanent append and rewrite fences (#7815).
|
|
22
|
+
- A title that adopts a transcript already holding state this session never committed keeps whole-transcript rewrite authority barred, so fork, star, and rewrite paths refuse instead of republishing a partial resident graph over the sibling branch. Renaming a transcript this session wrote itself keeps full authority (#7815).
|
|
23
|
+
- One-shot publications in a shared session (temporary model change, explicit thinking-level append, discovered-tool selection, mode change) scope append admission to their own transaction and keep only the whole-transcript rewrite fence, so they no longer bar later appends for the rest of the session (#7815).
|
|
24
|
+
- In-turn producers in a shared session publish through the session's admitted path instead of the legacy append, so they persist instead of aborting the turn once a canonical message has been published: extension and hook `appendEntry`/`setLabel` (interactive and subagent executors), tree-navigator labels, todo entries and reminders, goal entries, mode changes, credential pins, session recaps, TTSR injection markers, bash/Python results and deferred command results (#7815).
|
|
25
|
+
- A refused background publication is now operator-visible: the entry is reported with a `session-publication` warning naming the operation and cause, command results keep their deferred queue slot for retry, and `onPersisted` fires only when the entry is durable (#7815).
|
|
26
|
+
- A shared session that hits the managed per-file limit while its only recovery is the barred whole-transcript rewrite now keeps the typed near-limit outcome and its recovery guidance instead of degrading into a generic rewrite-required abort (#7815).
|
|
27
|
+
- Still refused by design in a shared session, unchanged: whole-transcript rewrites, forks, stars, branch switches, session drop/delete/move, staged-selection promotion, `/clear` roots, and the legacy public append API. Callers that need durability must use the session's `*ForSession`/`*InBackground` seams (#7815).
|
|
28
|
+
|
|
29
|
+
- Publish model presets through managed shared-session admission after ordinary messages or title changes, preserving sibling branches and the configured fallback chain, effective thinking, and resume default (#7823).
|
|
30
|
+
- Keep known refused preset publications from attempting an unneeded rollback; preserve publication receipts and close the session when a shared preset write has an uncertain outcome or cannot be applied after commit (#7823).
|
|
31
|
+
|
|
32
|
+
- `/clear` now works in a shared root TUI session. It publishes a new parentless context-clear root, followed by the model, effort and service tier, as an append-only shared write. Sibling branches published by other openers are kept. A refused write leaves the conversation unchanged, and an uncertain write closes the session (#7824).
|
|
33
|
+
- A default fallback that changes the thinking level now saves that level through admitted shared publication before switching the model, instead of refusing in a shared session (#7824).
|
|
34
|
+
- Assigning a model role while a profile is active now saves the session's configured model chain through admitted shared publication after the settings commit. If that write is refused, the session closes and the message says the settings were saved but the session was not updated (#7824).
|
|
35
|
+
- A configuration reload that changes the active profile or the live model now publishes the profile chain, model and effort as one shared write before applying anything. A refused write rolls back only the staged catalog. A failure after the transcript commit restores settings and the catalog and closes the session (#7824).
|
|
36
|
+
- When a model selection fails in a shared session, the selector now undoes it with one shared write that contains only the values that actually changed. If nothing changed, nothing is written and no incomplete-rollback message is shown. The selector never undoes an uncertain or committed-but-unapplied write (#7824).
|
|
37
|
+
- Starring a previous session from the picker after `/new` now appends the star under that session's transaction lease when this process published to it through shared admission. A star that would rewrite the whole transcript is refused instead of moving a live peer's transcript (#7824).
|
|
38
|
+
|
|
39
|
+
- Fixed `/fast`, the service tier, the settings-screen default thinking level, `/effort <level>`, model selection (`/model`, selector, cycling, SDK/ACP `model.set`), explicit tool selection and OAuth credential pin/AUTO in shared root TUI sessions after an ordinary message. They no longer fail with "Shared session mutation requires transaction admission"; each publishes its entries additively through admitted shared publication before changing live state (#7824).
|
|
40
|
+
- Credential pin/AUTO now records the session intent before changing the live account selection, so a refused write leaves the account unchanged (#7824).
|
|
41
|
+
- In a shared session, `/drop` now refuses before it switches. It used to switch and then report a drop that never happened. Internal MCP, `/ssh` and plugin tool refreshes record their selection through admitted shared publication (#7824).
|
|
42
|
+
- `/rename`, automatic titles, plan-mode titles and the extension `setSessionName` now save the title through admitted shared title publication. Previously they called the session manager's legacy writer, which is refused once the session is shared (#7824).
|
|
43
|
+
- Per-tool TTSR reminder records are now saved through admitted shared publication instead of being silently dropped (#7824).
|
|
44
|
+
- An uncertain or committed-but-unapplied shared control write now closes the session with a message that says what happened, instead of retrying or rolling back (#7824).
|
|
45
|
+
- Shared tool selection now follows the same rule: an uncertain write, or a saved selection the session could not apply, closes the session and keeps the saved entry IDs, and an uncertain write blocks further writes from that session (#7824).
|
|
46
|
+
- A deferred bash or Python result whose shared write is uncertain is no longer retried under a new entry ID. The session closes and reports the attempted ID (#7824).
|
|
47
|
+
- Overlapping deferred bash or Python result flushes, such as forced abort recovery and a prompt, now share one flush, so each result is written and reported once (#7824).
|
|
48
|
+
|
|
49
|
+
- In the ask prompt and the inline "Other" answer, a bare line feed (Ctrl+J, or a Shift+Enter→LF terminal mapping) inserts a newline on every platform instead of submitting.
|
|
50
|
+
|
|
51
|
+
- Providers that need no API key by design (Devin, which logs in through its own CLI, and other `allowUnauthenticated` providers such as LM Studio and oMLX) are now treated as credentialless from the first model load. Before, they were marked credentialless only during the online discovery sweep, so a subagent or an offline refresh failed them with "No credentials found" and a fallback chain such as `deepseek → devin/swe-2 → …` skipped Devin. A provider configured in `models.yml` keeps the auth mode configured there.
|
|
52
|
+
|
|
53
|
+
- Cmd+V with an image-only clipboard attaches the image in terminals that send it as an empty bracketed paste instead of doing nothing.
|
|
54
|
+
|
|
55
|
+
- Fixed session wedge after threshold auto-compaction when user prompts again. The `checkCompaction` method was using stale assistant message usage from before a compaction completed, causing re-entry into `runAutoCompaction("threshold")` with no-op compaction. The `errorIsFromBeforeCompaction` guard—which prevents compaction triggers from messages already compacted—is now also applied to the threshold branch (previously it was only applied to the overflow branch). This ensures that after a threshold compaction completes and a user prompts, the stale message does not trigger another unnecessary compaction attempt.
|
|
56
|
+
|
|
57
|
+
- Pasting a custom provider API key during onboarding now writes `credential: store` to `models.yml` and the loader accepts it, so the generated provider loads and resolves the stored key instead of being rejected as credential-less while setup reported success. Setup also runs the loader's semantic validation before its atomic rename and surfaces load failures instead of the success banner, and model discovery resolves a stored `!<command>` or env-name value through the same resolver requests use — for both a caller-supplied credential store and the store setup opens itself — treating an unresolvable value as absent instead of sending it as a bearer token. A pasted literal is resolved the same way for the pre-write probe, so a `!<command>` or env-name-shaped paste probes with the secret the runtime would send and an unresolvable reference fails the add before anything is written. Headless setup inspects only the local credential store, so a broker-owned key is neither probed nor disclosed; run setup on the broker host or use the interactive wizard.
|
|
58
|
+
- `credential: store` is rejected when combined with another credential source, `openaiCompat` (its descriptor marks the provider keyless, so the declaration would not be enforced), `auth: none`/`auth: oauth`, or the Bedrock credential chain (provider or model api), an override-only provider entry may declare it on its own, and a declared but missing stored key now logs a load-time warning instead of only failing later as a generic missing-API-key error.
|
|
59
|
+
- Replacing a `credential: store` provider with an `apiKeyEnv` one via `--force` now disables the stale stored API key only when that entry declared `credential: store` and the env reference resolves, verifies the row no longer resolves, and reports the confirmed disable count; OAuth rows and env-pinned providers are untouched. The success banner says the credentials were disabled (not removed) and names `gjc accounts logout <provider> --all`, which removes every stored credential for the provider including OAuth logins, for permanent deletion. A cleanup failure restores the previous provider settings (re-serialized) but leaves already-disabled rows disabled; rows whose disable was not confirmed still resolve and remain the provider's credential. It reports a store-rejected disable and an unconfirmable removal as separate diagnoses, and points at `/provider` with no arguments in the interactive TUI for a pasted literal key or `/provider add ... --api-key-env <ENV> --force` (the same flags work on `gjc setup provider`) to restore usability, because the add commands reject a raw `--api-key`. The surviving-key warning names the broker form (`gjc auth-broker logout <provider>`) for broker configurations. Any env add that leaves a stored API key in place warns that it still takes precedence with the same removal breadth; broker-owned stores fail with host-side guidance that covers every credential type for the provider.
|
|
60
|
+
|
|
61
|
+
- Interactive runs no longer abort with `shared_session_mutation_unsupported` ("Agent run failed.") when an extension, hook or system reminder adds a custom message after the first message was saved. Custom messages are now saved through the shared session path, like other messages.
|
|
62
|
+
|
|
63
|
+
- Copying to the clipboard on Termux no longer freezes the TUI while `termux-clipboard-set` runs.
|
|
64
|
+
|
|
5
65
|
## [0.21.0] - 2026-11-16
|
|
6
66
|
|
|
7
67
|
### Added
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Autorouting vocabulary and settings validators.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* policy code.
|
|
4
|
+
* Apart from the shared @gajae-code/utils type guards, this module deliberately
|
|
5
|
+
* does not import Settings, task code, or model profiles. It is the shared
|
|
6
|
+
* contract used by settings and (later) routing policy code.
|
|
7
7
|
*/
|
|
8
8
|
export declare const AUTOROUTING_TIERS: readonly ["fast", "balanced", "strong"];
|
|
9
9
|
export type AutoroutingTier = (typeof AUTOROUTING_TIERS)[number];
|
|
@@ -18495,7 +18495,7 @@ export declare const TIER_MAP_SKIP_LIST: {
|
|
|
18495
18495
|
};
|
|
18496
18496
|
};
|
|
18497
18497
|
export declare const CURATED_TIER_MAP: AutoroutingCuratedTierMap;
|
|
18498
|
-
/** Canonical JSON uses sorted object keys and preserves array order. */
|
|
18498
|
+
/** Canonical JSON uses sorted object keys and preserves array order. `undefined`/function/symbol encode as the literal `undefined`; explicit undefined array entries become null, while sparse holes are skipped and produce invalid JSON. */
|
|
18499
18499
|
export declare function canonicalJson(value: unknown): string;
|
|
18500
18500
|
/** UTF-8 bytes for the one-line canonical JSON representation. */
|
|
18501
18501
|
export declare function canonicalJsonBytes(value: unknown): Uint8Array;
|
|
@@ -161,10 +161,6 @@ export declare const KEYBINDINGS: {
|
|
|
161
161
|
readonly defaultKeys: "tab";
|
|
162
162
|
readonly description: "Tab / autocomplete";
|
|
163
163
|
};
|
|
164
|
-
readonly "tui.input.copy": {
|
|
165
|
-
readonly defaultKeys: "ctrl+c";
|
|
166
|
-
readonly description: "Copy selection";
|
|
167
|
-
};
|
|
168
164
|
readonly "tui.select.up": {
|
|
169
165
|
readonly defaultKeys: "up";
|
|
170
166
|
readonly description: "Move selection up";
|
|
@@ -263,7 +259,7 @@ export declare const KEYBINDINGS: {
|
|
|
263
259
|
};
|
|
264
260
|
readonly "app.clipboard.pasteImage": {
|
|
265
261
|
readonly defaultKeys: KeyId[];
|
|
266
|
-
readonly description: "Paste image from clipboard";
|
|
262
|
+
readonly description: "Paste image or text from clipboard";
|
|
267
263
|
};
|
|
268
264
|
readonly "app.clipboard.pasteText": {
|
|
269
265
|
readonly defaultKeys: [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
2
|
import { type Api, type Model } from "@gajae-code/ai/core";
|
|
3
3
|
import type { AgentSession, AgentSessionProfileInstalledOverrideState, DefaultFallbackRuntimeState, PreparedProfileModelSelection, SessionAgentModelOverrideState } from "../session/agent-session";
|
|
4
|
+
import type { ModelProfileTranscriptPlan, SharedEntriesAppendOutcome } from "../session/session-manager";
|
|
4
5
|
import { type ModelProfileDefinition } from "./model-profiles";
|
|
5
6
|
export { resolveModelProfileName } from "./model-profile-contract";
|
|
6
7
|
import { type DurableModelProfileOwnership } from "./model-profile-ownership";
|
|
@@ -13,6 +14,12 @@ type UserCanonicalVariantSelection = {
|
|
|
13
14
|
};
|
|
14
15
|
type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel" | "sessionId" | "getConfiguredModelChain" | "setConfiguredModelChain"> & {
|
|
15
16
|
credentialSessionId?: string;
|
|
17
|
+
usesSharedControlPublication?: AgentSession["usesSharedControlPublication"];
|
|
18
|
+
assertConfiguredModelChainWritable?: AgentSession["assertConfiguredModelChainWritable"];
|
|
19
|
+
setConfiguredModelChainForControl?: AgentSession["setConfiguredModelChainForControl"];
|
|
20
|
+
withModelProfilePublication?: AgentSession["withModelProfilePublication"];
|
|
21
|
+
appendModelProfileActivationForControl?: AgentSession["appendModelProfileActivationForControl"];
|
|
22
|
+
publishCommittedModelProfileSessionState?: AgentSession["publishCommittedModelProfileSessionState"];
|
|
16
23
|
setModelTemporary?: AgentSession["setModelTemporary"];
|
|
17
24
|
setActiveModelProfile?: (name: string | undefined, activatedByThisProcess?: boolean) => void;
|
|
18
25
|
getActiveModelProfile?: () => string | undefined;
|
|
@@ -124,10 +131,12 @@ export interface PreparedModelProfileActivation {
|
|
|
124
131
|
settings: Pick<Settings, "clearOverride" | "get" | "getGlobal" | "getOverride" | "override" | "set" | "unset" | "flush" | "flushOrThrow" | "commitAtomicBatchWithCurrent">;
|
|
125
132
|
observedOwnership: DurableModelProfileOwnership;
|
|
126
133
|
committedOwnership?: DurableModelProfileOwnership;
|
|
134
|
+
sharedPublicationOutcome?: SharedEntriesAppendOutcome;
|
|
127
135
|
binding: {
|
|
128
136
|
sessionId: string;
|
|
129
137
|
generation: number | undefined;
|
|
130
138
|
userSelectionRevision: number | undefined;
|
|
139
|
+
thinkingRevision?: number;
|
|
131
140
|
settingsIntent: {
|
|
132
141
|
modelRoles: unknown;
|
|
133
142
|
agentOverrides: unknown;
|
|
@@ -201,7 +210,7 @@ export interface PreparedModelProfileActivation {
|
|
|
201
210
|
modelRegistry: PrepareModelProfileActivationOptions["modelRegistry"];
|
|
202
211
|
}
|
|
203
212
|
export interface MaterializeModelProfileAssignmentOptions {
|
|
204
|
-
session: Pick<ModelProfileActivationSession, "model" | "thinkingLevel" | "sessionId" | "credentialSessionId" | "getConfiguredModelChain" | "getConfiguredModelChainState" | "setConfiguredModelChain" | "setActiveModelProfile" | "getActiveModelProfile" | "getActivatedModelProfile" | "getProfileInstalledOverrideState" | "getDefaultFallbackRuntimeState" | "restoreDefaultFallbackRuntimeState" | "modelRegistry" | "clearProfileInstalledOverrides" | "dispose" | "sessionLifecycle" | "getUserModelSelectionRevision">;
|
|
213
|
+
session: Pick<ModelProfileActivationSession, "model" | "thinkingLevel" | "sessionId" | "credentialSessionId" | "getConfiguredModelChain" | "getConfiguredModelChainState" | "setConfiguredModelChain" | "assertConfiguredModelChainWritable" | "setConfiguredModelChainForControl" | "usesSharedControlPublication" | "setActiveModelProfile" | "getActiveModelProfile" | "getActivatedModelProfile" | "getProfileInstalledOverrideState" | "getDefaultFallbackRuntimeState" | "restoreDefaultFallbackRuntimeState" | "modelRegistry" | "clearProfileInstalledOverrides" | "dispose" | "sessionLifecycle" | "getUserModelSelectionRevision">;
|
|
205
214
|
settings: Pick<Settings, "clearOverride" | "get" | "getGlobal" | "getOverride" | "override" | "commitAtomicBatchWithCurrent">;
|
|
206
215
|
observedOwnership?: DurableModelProfileOwnership;
|
|
207
216
|
validateCurrent?: () => void;
|
|
@@ -209,7 +218,7 @@ export interface MaterializeModelProfileAssignmentOptions {
|
|
|
209
218
|
selector: string;
|
|
210
219
|
}
|
|
211
220
|
export interface MaterializeModelProfileAssignmentsOptions {
|
|
212
|
-
session: Pick<ModelProfileActivationSession, "model" | "thinkingLevel" | "sessionId" | "credentialSessionId" | "getConfiguredModelChain" | "getConfiguredModelChainState" | "setConfiguredModelChain" | "setActiveModelProfile" | "getActiveModelProfile" | "getActivatedModelProfile" | "getProfileInstalledOverrideState" | "getDefaultFallbackRuntimeState" | "restoreDefaultFallbackRuntimeState" | "modelRegistry" | "clearProfileInstalledOverrides" | "dispose" | "sessionLifecycle" | "getUserModelSelectionRevision">;
|
|
221
|
+
session: Pick<ModelProfileActivationSession, "model" | "thinkingLevel" | "sessionId" | "credentialSessionId" | "getConfiguredModelChain" | "getConfiguredModelChainState" | "setConfiguredModelChain" | "assertConfiguredModelChainWritable" | "setConfiguredModelChainForControl" | "usesSharedControlPublication" | "setActiveModelProfile" | "getActiveModelProfile" | "getActivatedModelProfile" | "getProfileInstalledOverrideState" | "getDefaultFallbackRuntimeState" | "restoreDefaultFallbackRuntimeState" | "modelRegistry" | "clearProfileInstalledOverrides" | "dispose" | "sessionLifecycle" | "getUserModelSelectionRevision">;
|
|
213
222
|
settings: Pick<Settings, "clearOverride" | "get" | "getGlobal" | "getOverride" | "override" | "commitAtomicBatchWithCurrent">;
|
|
214
223
|
observedOwnership?: DurableModelProfileOwnership;
|
|
215
224
|
validateCurrent?: () => void;
|
|
@@ -358,8 +367,26 @@ export declare function resolveModelProfileDefaultChain(options: {
|
|
|
358
367
|
}>;
|
|
359
368
|
export declare function rewriteSelectorForProxy(selector: string, proxyProvider: string, proxyMode: ModelProfileProxyMode, allModels: Model<Api>[], directlyAuthenticated: ReadonlySet<string>, routableProviders: ReadonlySet<string>): string;
|
|
360
369
|
export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
|
|
370
|
+
export declare class ModelProfilePublicationError extends Error {
|
|
371
|
+
readonly outcome: SharedEntriesAppendOutcome;
|
|
372
|
+
readonly code = "model_profile_publication_failed";
|
|
373
|
+
constructor(outcome: SharedEntriesAppendOutcome, cause?: unknown);
|
|
374
|
+
readonly publicationCause: unknown;
|
|
375
|
+
}
|
|
376
|
+
export type CommittedModelProfileSessionPublication = {
|
|
377
|
+
plan: ModelProfileTranscriptPlan;
|
|
378
|
+
receipt: Extract<SharedEntriesAppendOutcome, {
|
|
379
|
+
kind: "committed";
|
|
380
|
+
}>;
|
|
381
|
+
/**
|
|
382
|
+
* The prepared selection whose model the plan's temporary entry records, when it is not
|
|
383
|
+
* the profile's own default selection (a configuration reload of the live model).
|
|
384
|
+
*/
|
|
385
|
+
selection?: PreparedProfileModelSelection;
|
|
386
|
+
};
|
|
387
|
+
export declare function buildModelProfileTranscriptPlan(prepared: PreparedModelProfileActivation, options: ApplyModelProfileActivationOptions): ModelProfileTranscriptPlan;
|
|
361
388
|
/** Publish the prepared model selection and role layer without awaiting. */
|
|
362
|
-
export declare function publishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: Pick<ApplyModelProfileActivationOptions, "preserveDefaultModelSelection" | "preserveLiveModelSelection" | "thinkingLevelOverride"
|
|
389
|
+
export declare function publishPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: Pick<ApplyModelProfileActivationOptions, "preserveDefaultModelSelection" | "preserveLiveModelSelection" | "thinkingLevelOverride">, committedSessionPublication?: CommittedModelProfileSessionPublication): void;
|
|
363
390
|
/**
|
|
364
391
|
* Record a published profile DEFAULT in the model usage order. Call synchronously
|
|
365
392
|
* once the enclosing publication finalized, before any await: a user selection
|
|
@@ -65,11 +65,13 @@ export declare function getKnownRoleIds(settings: Settings): string[];
|
|
|
65
65
|
* Configured metadata overrides built-in defaults when present.
|
|
66
66
|
*/
|
|
67
67
|
export declare function getRoleInfo(role: string, settings: Settings): RoleInfo;
|
|
68
|
+
export declare function validateModelsConfig(config: ModelsConfig): void;
|
|
68
69
|
export declare const ModelsConfigFile: ConfigFile<{
|
|
69
70
|
providers?: Record<string, {
|
|
70
71
|
baseUrl?: string | undefined;
|
|
71
72
|
apiKey?: string | undefined;
|
|
72
73
|
apiKeyEnv?: string | undefined;
|
|
74
|
+
credential?: "store" | undefined;
|
|
73
75
|
api?: "anthropic-messages" | "azure-openai-responses" | "bedrock-converse-stream" | "cursor-agent" | "devin-acp" | "google-gemini-cli" | "google-generative-ai" | "google-vertex" | "kiro-codewhisperer-stream" | "ollama-chat" | "openai-codex-responses" | "openai-completions" | "openai-responses" | undefined;
|
|
74
76
|
headers?: Record<string, string> | undefined;
|
|
75
77
|
compat?: {
|
|
@@ -377,11 +377,19 @@ export declare const ProviderAuthSchema: z.ZodEnum<{
|
|
|
377
377
|
}>;
|
|
378
378
|
export type ProviderAuthMode = z.infer<typeof ProviderAuthSchema>;
|
|
379
379
|
export type ProviderDiscovery = z.infer<typeof ProviderDiscoverySchema>;
|
|
380
|
+
/**
|
|
381
|
+
* The one spelling of the `credential: store` declaration. The schema, the
|
|
382
|
+
* loader's provider validation, and provider setup all derive from this
|
|
383
|
+
* constant so the literal cannot drift between writer and reader.
|
|
384
|
+
*/
|
|
385
|
+
export declare const PROVIDER_CREDENTIAL_STORE: "store";
|
|
386
|
+
export type ProviderStoreCredential = typeof PROVIDER_CREDENTIAL_STORE;
|
|
380
387
|
export declare const ModelsConfigSchema: z.ZodObject<{
|
|
381
388
|
providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
382
389
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
383
390
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
384
391
|
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
392
|
+
credential: z.ZodOptional<z.ZodLiteral<"store">>;
|
|
385
393
|
api: z.ZodOptional<z.ZodEnum<{
|
|
386
394
|
"anthropic-messages": "anthropic-messages";
|
|
387
395
|
"azure-openai-responses": "azure-openai-responses";
|
|
@@ -3558,14 +3558,14 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3558
3558
|
};
|
|
3559
3559
|
readonly "web_search.provider": {
|
|
3560
3560
|
readonly type: "enum";
|
|
3561
|
-
readonly values: readonly ["auto", "duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng"];
|
|
3561
|
+
readonly values: readonly ["auto", "duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng", "keenable"];
|
|
3562
3562
|
readonly default: "auto";
|
|
3563
3563
|
};
|
|
3564
3564
|
readonly "web_search.fallback": {
|
|
3565
3565
|
readonly type: "array";
|
|
3566
3566
|
readonly default: string[];
|
|
3567
3567
|
readonly items: {
|
|
3568
|
-
readonly enum: readonly ["duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng"];
|
|
3568
|
+
readonly enum: readonly ["duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "anthropic", "perplexity", "gemini", "codex", "xai", "tavily", "parallel", "kagi", "synthetic", "searxng", "keenable"];
|
|
3569
3569
|
};
|
|
3570
3570
|
readonly ui: {
|
|
3571
3571
|
readonly tab: "tools";
|
|
@@ -4432,7 +4432,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4432
4432
|
};
|
|
4433
4433
|
readonly "providers.webSearch": {
|
|
4434
4434
|
readonly type: "enum";
|
|
4435
|
-
readonly values: readonly ["auto", "duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "perplexity", "anthropic", "gemini", "codex", "xai", "tavily", "kagi", "synthetic", "parallel", "searxng"];
|
|
4435
|
+
readonly values: readonly ["auto", "duckduckgo", "insane", "exa", "brave", "jina", "kimi", "zai", "perplexity", "anthropic", "gemini", "codex", "xai", "tavily", "kagi", "synthetic", "parallel", "searxng", "keenable"];
|
|
4436
4436
|
readonly default: "auto";
|
|
4437
4437
|
readonly ui: {
|
|
4438
4438
|
readonly tab: "providers";
|
|
@@ -4510,6 +4510,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4510
4510
|
readonly value: "searxng";
|
|
4511
4511
|
readonly label: "SearXNG";
|
|
4512
4512
|
readonly description: "Requires SEARXNG_ENDPOINT or searxng.endpoint";
|
|
4513
|
+
}, {
|
|
4514
|
+
readonly value: "keenable";
|
|
4515
|
+
readonly label: "Keenable";
|
|
4516
|
+
readonly description: "Keyless; optional KEENABLE_API_KEY raises rate limits";
|
|
4513
4517
|
}];
|
|
4514
4518
|
};
|
|
4515
4519
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Byte-stable JSON for coordinator idempotency and outbox digests: keys are
|
|
3
|
+
* sorted by code unit. Unlike `sdk/broker/canonical-json.ts` it does not omit
|
|
4
|
+
* `undefined` properties, so persisted digests of the same value stay stable
|
|
5
|
+
* across both the server and question-state writers.
|
|
6
|
+
*/
|
|
7
|
+
export declare function canonicalJson(value: unknown): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JsonSchema202012 } from "./types";
|
|
2
2
|
export declare const JSON_SCHEMA_202012_URI = "https://json-schema.org/draft/2020-12/schema";
|
|
3
|
-
/** Stable JSON serialization used for schema hashes and registry fingerprints. */
|
|
3
|
+
/** Stable JSON serialization used for schema hashes and registry fingerprints. Throws on an explicit undefined value or object key and on non-finite numbers; bigints fail in JSON.stringify. Sparse array holes are not visited by map and produce invalid JSON, so callers must not pass sparse arrays. */
|
|
4
4
|
export declare function canonicalJson(value: unknown): string;
|
|
5
5
|
export declare function verifyImplementationHash(filePath: string, expected: string): Promise<string>;
|
|
6
6
|
/** Validate and canonicalize a JSON Schema 2020-12 document without executing user code. */
|
|
@@ -20,7 +20,7 @@ export interface ReceiptEnvelope<E = Record<string, unknown>> {
|
|
|
20
20
|
sha256: string;
|
|
21
21
|
}
|
|
22
22
|
export declare const RECEIPT_SCHEMA_VERSION: 1;
|
|
23
|
-
/** Deterministic stringify with sorted keys (stable hash basis). */
|
|
23
|
+
/** Deterministic stringify with sorted keys (stable hash basis). Byte-identical to modes/shared/agent-wire/workflow-gate-schema.ts; kept local so this plane does not depend on agent-wire. */
|
|
24
24
|
export declare function canonicalJson(value: unknown): string;
|
|
25
25
|
export declare function sha256Hex(input: string): string;
|
|
26
26
|
export interface BuildReceiptInput<E> {
|
|
@@ -49,8 +49,11 @@ export interface StatusLinePreviewSettings {
|
|
|
49
49
|
maxRows?: number;
|
|
50
50
|
}
|
|
51
51
|
export interface SettingsCallbacks {
|
|
52
|
-
/**
|
|
53
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Called when any setting value changes. A returned promise means the change is
|
|
54
|
+
* committed by a session-owned control; session-owned settings await it.
|
|
55
|
+
*/
|
|
56
|
+
onChange: (path: SettingPath, newValue: unknown) => unknown;
|
|
54
57
|
/** Called for theme preview while browsing theme settings */
|
|
55
58
|
onThemePreview?: (theme: string) => void | Promise<void>;
|
|
56
59
|
/** Called to restore the rendered theme when theme settings preview is cancelled */
|
|
@@ -15,7 +15,7 @@ export declare class CommandController {
|
|
|
15
15
|
handleDumpCommand(): void;
|
|
16
16
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
17
17
|
handleShareCommand(): Promise<void>;
|
|
18
|
-
handleCopyCommand(
|
|
18
|
+
handleCopyCommand(): void;
|
|
19
19
|
handleSessionCommand(): Promise<void>;
|
|
20
20
|
handleJobsCommand(): Promise<void>;
|
|
21
21
|
handleUsageCommand(reports?: UsageReport[] | null): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AutocompleteProvider, type SlashCommand } from "@gajae-code/tui";
|
|
2
2
|
import { type ComposerSubmissionOptions, type InteractiveModeContext, type SubmittedUserInput } from "../../modes/types";
|
|
3
|
+
import { readImageFromClipboard, readMacFileUrlsFromClipboard, readTextFromClipboard } from "../../utils/clipboard";
|
|
3
4
|
import { loadPastedImageBatch } from "../../utils/pasted-image-loading";
|
|
4
5
|
import { ActionRegistry } from "../action-registry";
|
|
5
6
|
import type { PasteTextContext } from "../components/custom-editor";
|
|
@@ -14,8 +15,14 @@ import type { PasteTextContext } from "../components/custom-editor";
|
|
|
14
15
|
export declare const AVAILABILITY_GATED_NAV_PALETTE_ACTIONS: readonly ["app.session.dashboard", "app.transcript.browse", "app.transcript.prevTurn", "app.transcript.nextTurn", "app.queue.togglePane", "app.message.sendNow"];
|
|
15
16
|
export declare const INTERACTIVE_ABORT_CLEANUP_TIMEOUT_MS = 5000;
|
|
16
17
|
export declare const BACKGROUND_FOLD_DOUBLE_PRESS_MS = 750;
|
|
18
|
+
interface ClipboardReaders {
|
|
19
|
+
readImage: typeof readImageFromClipboard;
|
|
20
|
+
readText: typeof readTextFromClipboard;
|
|
21
|
+
readMacFileUrls: typeof readMacFileUrlsFromClipboard;
|
|
22
|
+
}
|
|
17
23
|
interface InputControllerDependencies {
|
|
18
24
|
loadPastedImageBatch?: typeof loadPastedImageBatch;
|
|
25
|
+
clipboard?: Partial<ClipboardReaders>;
|
|
19
26
|
}
|
|
20
27
|
export declare class InputController {
|
|
21
28
|
#private;
|
|
@@ -58,6 +65,11 @@ export declare class InputController {
|
|
|
58
65
|
handleBackgroundCommand(): void;
|
|
59
66
|
handleForegroundToolBackgroundFold(): boolean;
|
|
60
67
|
handleTextPaste(text: string, context: PasteTextContext): boolean | Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Ctrl+V / Cmd+V smart paste. Order matters: macOS pasteboard file URLs first (a Finder-copied
|
|
70
|
+
* image also carries a generic file-icon bitmap), then the bitmap, then clipboard text, inserted
|
|
71
|
+
* verbatim.
|
|
72
|
+
*/
|
|
61
73
|
handleImagePaste(): Promise<boolean>;
|
|
62
74
|
/**
|
|
63
75
|
* Explicit "Paste text from configured clipboard" action (P3-b v1). Only
|
|
@@ -65,7 +65,7 @@ export declare class SelectorController {
|
|
|
65
65
|
* Most settings are saved directly via SettingsManager in the definitions.
|
|
66
66
|
* This handles side effects and session-specific settings.
|
|
67
67
|
*/
|
|
68
|
-
handleSettingChange(id: string, value: unknown): void
|
|
68
|
+
handleSettingChange(id: string, value: unknown): void | Promise<void>;
|
|
69
69
|
previewSmartRouting(draft: AutoroutingSetup): RoutingSettingsPreview;
|
|
70
70
|
applySmartRouting(draft: AutoroutingSetup, options?: {
|
|
71
71
|
preview?: RoutingSettingsPreview;
|
|
@@ -242,7 +242,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
242
242
|
handleDumpCommand(): void;
|
|
243
243
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
244
244
|
handleShareCommand(): Promise<void>;
|
|
245
|
-
handleCopyCommand(
|
|
245
|
+
handleCopyCommand(): void;
|
|
246
246
|
handleTodoCommand(args: string): Promise<void>;
|
|
247
247
|
handleSessionCommand(): Promise<void>;
|
|
248
248
|
handleJobsCommand(): Promise<void>;
|
|
@@ -11,7 +11,7 @@ export declare class WorkflowGateSchemaError extends Error {
|
|
|
11
11
|
readonly code = "invalid_workflow_gate_schema";
|
|
12
12
|
constructor(message: string);
|
|
13
13
|
}
|
|
14
|
-
/** Canonical (stable-key-ordered) JSON serialization used for hashing. */
|
|
14
|
+
/** Canonical (stable-key-ordered) JSON serialization used for hashing. Byte-identical to harness-control-plane/receipts.ts canonicalJson. */
|
|
15
15
|
export declare function canonicalJson(value: unknown): string;
|
|
16
16
|
export declare function schemaHash(schema: JsonSchema): string;
|
|
17
17
|
declare function answerHashOf(answer: unknown): string;
|
|
@@ -279,7 +279,7 @@ export interface InteractiveModeContext {
|
|
|
279
279
|
resetIrcSidebarSession(): void;
|
|
280
280
|
handleExportCommand(text: string): Promise<void>;
|
|
281
281
|
handleShareCommand(): Promise<void>;
|
|
282
|
-
handleCopyCommand(
|
|
282
|
+
handleCopyCommand(): void;
|
|
283
283
|
handleTodoCommand(args: string): Promise<void>;
|
|
284
284
|
handleSessionCommand(): Promise<void>;
|
|
285
285
|
handleJobsCommand(): Promise<void>;
|
|
@@ -129,11 +129,17 @@ import type { ClientBridge, ClientBridgePermissionOption, ClientBridgePermission
|
|
|
129
129
|
import { type ContributionPrepOptions, type ContributionPrepResult } from "./contribution-prep";
|
|
130
130
|
import { type FoldAdapter, FoldCoordinator, type ForegroundFoldOutcome } from "./fold-coordinator";
|
|
131
131
|
import type { MemoryGuardRestoreResult } from "./memory-guard-checkpoint-participant";
|
|
132
|
-
import { type CustomMessage } from "./messages";
|
|
133
|
-
import type {
|
|
132
|
+
import { type BashExecutionMessage, type CustomMessage, type FileMentionMessage, type PythonExecutionMessage } from "./messages";
|
|
133
|
+
import type { SessionRecapAppendResult, SessionRecapInput } from "./recap";
|
|
134
|
+
import type { BranchSummaryEntry, CompactionEntry, ModelProfileTranscriptPlan, NewSessionOptions, PreparedNewSession, RecoveryHydrationContext, RecoveryHydrationPromotionFence, SessionArtifactPublication, SessionContext, SessionManagerCloseOutcome, SessionMemoryStats, SharedEntriesAppendOutcome } from "./session-manager";
|
|
134
135
|
import { SessionManager } from "./session-manager";
|
|
135
136
|
import { ToolChoiceQueue } from "./tool-choice-queue";
|
|
136
137
|
import { YieldQueue } from "./yield-queue";
|
|
138
|
+
/**
|
|
139
|
+
* Message shapes this session persists through the manager. `appendMessageSharingSession` and
|
|
140
|
+
* `appendMessage` accept the same set including hook messages, which this session never writes.
|
|
141
|
+
*/
|
|
142
|
+
type SessionPersistedMessage = Message | CustomMessage | BashExecutionMessage | PythonExecutionMessage | FileMentionMessage;
|
|
137
143
|
/**
|
|
138
144
|
* Classify an async-result delivery against terminal-abort ownership:
|
|
139
145
|
* - "ordinary": no owned-completion envelope — deliver as before.
|
|
@@ -146,6 +152,36 @@ import { YieldQueue } from "./yield-queue";
|
|
|
146
152
|
* from stopped work), even if a delivery races the settlement purge.
|
|
147
153
|
*/
|
|
148
154
|
export declare function ownedCompletionResumeAction(message: AgentMessage): "ordinary" | "fresh" | "drop";
|
|
155
|
+
/**
|
|
156
|
+
* A session control could not complete its admitted shared publication (#7823, #7824).
|
|
157
|
+
*
|
|
158
|
+
* `rejected`/`stale` prove nothing was written and nothing live changed. `unknown`
|
|
159
|
+
* and `committed_not_applied` mean the transcript may hold (or holds) the change while
|
|
160
|
+
* this session did not apply it; the session is closed instead of compensating.
|
|
161
|
+
*/
|
|
162
|
+
export declare class SharedControlPublicationError extends Error {
|
|
163
|
+
readonly operation: string;
|
|
164
|
+
readonly outcome: SharedEntriesAppendOutcome;
|
|
165
|
+
readonly code: "rejected" | "stale" | "unknown" | "committed_not_applied";
|
|
166
|
+
constructor(operation: string, outcome: SharedEntriesAppendOutcome, publicationCause?: unknown);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Durable session intent a model-selection rollback restores along with the live model:
|
|
170
|
+
* the configured DEFAULT chain and the resume default. Absent fields are left alone.
|
|
171
|
+
*/
|
|
172
|
+
export interface ModelSelectionRollbackDurableState {
|
|
173
|
+
readonly defaultChain?: {
|
|
174
|
+
readonly state: {
|
|
175
|
+
readonly entries: readonly string[];
|
|
176
|
+
readonly origin: string;
|
|
177
|
+
readonly identity?: string;
|
|
178
|
+
readonly explicitHead?: boolean;
|
|
179
|
+
} | undefined;
|
|
180
|
+
};
|
|
181
|
+
readonly resumeDefault?: {
|
|
182
|
+
readonly selector: string | undefined;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
149
185
|
/** Session-specific events that extend the core AgentEvent */
|
|
150
186
|
export type AutoCompactionContinuationSkipReason = "auto_continue_disabled_non_resumable_tail";
|
|
151
187
|
export type AgentSessionEvent = AgentEvent | {
|
|
@@ -1436,6 +1472,33 @@ export declare class AgentSession {
|
|
|
1436
1472
|
get customCommands(): ReadonlyArray<LoadedCustomCommand>;
|
|
1437
1473
|
/** Update the MCP prompt commands list. Called when server prompts are (re)loaded. */
|
|
1438
1474
|
setMCPPromptCommands(commands: LoadedCustomCommand[]): void;
|
|
1475
|
+
/**
|
|
1476
|
+
* Publish an additive custom entry at this opener's admitted branch cursor.
|
|
1477
|
+
*
|
|
1478
|
+
* A shared-append session refuses legacy appends once a canonical shared publication
|
|
1479
|
+
* adopted an identity this opener did not import, so every in-turn producer publishes
|
|
1480
|
+
* through the shared lease instead (the custom-message path does the same). Throws when
|
|
1481
|
+
* the publication is refused: a silently dropped entry is worse than a loud failure.
|
|
1482
|
+
*/
|
|
1483
|
+
appendCustomEntryForSession<T = unknown>(customType: string, data?: T): Promise<string | undefined>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Publish a custom entry from a synchronous call site.
|
|
1486
|
+
*
|
|
1487
|
+
* A shared-append session publishes through its admitted path in the background and
|
|
1488
|
+
* logs a refusal, because such a caller cannot await a transaction and a refusal must
|
|
1489
|
+
* not abort its turn. The legacy form throws inline exactly as before.
|
|
1490
|
+
*/
|
|
1491
|
+
appendCustomEntryInBackground<T = unknown>(customType: string, data?: T): Promise<BackgroundPublicationResult>;
|
|
1492
|
+
/** Publish a message from a synchronous call site. */
|
|
1493
|
+
appendMessageInBackground(message: SessionPersistedMessage): Promise<BackgroundPublicationResult>;
|
|
1494
|
+
/** Publish a message at this opener's admitted branch cursor. */
|
|
1495
|
+
appendMessageForSession(message: SessionPersistedMessage): Promise<string>;
|
|
1496
|
+
/** Publish a session recap at this opener's admitted branch cursor. */
|
|
1497
|
+
appendSessionRecapForSession(input: SessionRecapInput): Promise<SessionRecapAppendResult>;
|
|
1498
|
+
/** Publish a label change from a synchronous call site. */
|
|
1499
|
+
appendLabelChangeInBackground(targetId: string, label: string | undefined): Promise<BackgroundPublicationResult>;
|
|
1500
|
+
/** Publish a mode change from a synchronous call site. */
|
|
1501
|
+
appendModeChangeInBackground(mode: string, data?: Record<string, unknown>): Promise<BackgroundPublicationResult>;
|
|
1439
1502
|
/**
|
|
1440
1503
|
* Send a prompt to the agent.
|
|
1441
1504
|
* - Handles extension commands (registered via pi.registerCommand) immediately, even during streaming
|
|
@@ -1836,6 +1899,19 @@ export declare class AgentSession {
|
|
|
1836
1899
|
identity?: string;
|
|
1837
1900
|
explicitHead: boolean;
|
|
1838
1901
|
} | undefined;
|
|
1902
|
+
/**
|
|
1903
|
+
* Refuse before any caller-side effect when {@link setConfiguredModelChain}'s legacy
|
|
1904
|
+
* append would be refused (shared admission latched; #7824).
|
|
1905
|
+
*/
|
|
1906
|
+
assertConfiguredModelChainWritable(): void;
|
|
1907
|
+
/**
|
|
1908
|
+
* Persist a configured chain on behalf of a control that already committed its durable
|
|
1909
|
+
* settings. A shared session publishes the chain through the common admitted control
|
|
1910
|
+
* publication before the runtime fallback controller changes (#7824); a legacy session
|
|
1911
|
+
* appends it as {@link setConfiguredModelChain} does. `isCurrent` is the caller's own
|
|
1912
|
+
* currentness fence and is re-checked under the publication lease.
|
|
1913
|
+
*/
|
|
1914
|
+
setConfiguredModelChainForControl(role: string, entries: readonly string[], origin: string, identity: string | undefined, explicitHead: boolean, isCurrent: () => boolean): Promise<void>;
|
|
1839
1915
|
/** Persist the configured fallback selectors for a model role. */
|
|
1840
1916
|
setConfiguredModelChain(role: string, entries: readonly string[], origin: string, identity?: string, explicitHead?: boolean): void;
|
|
1841
1917
|
/**
|
|
@@ -1911,6 +1987,14 @@ export declare class AgentSession {
|
|
|
1911
1987
|
prepareModelSelectionForProfileActivation(model: Model, thinkingLevel: ThinkingLevel | undefined, signal?: AbortSignal, options?: {
|
|
1912
1988
|
validateCredentials: boolean;
|
|
1913
1989
|
}): Promise<PreparedProfileModelSelection>;
|
|
1990
|
+
/** All migrated controls and canonical messages share one publication protocol. */
|
|
1991
|
+
usesSharedControlPublication(): boolean;
|
|
1992
|
+
withModelProfilePublication<T>(assertCurrent: () => void, body: () => Promise<T>): Promise<T>;
|
|
1993
|
+
appendModelProfileActivationForControl(plan: ModelProfileTranscriptPlan, isCurrent: () => boolean): Promise<SharedEntriesAppendOutcome>;
|
|
1994
|
+
/** Consume only a receipt issued by this session for these exact committed entries. */
|
|
1995
|
+
publishCommittedModelProfileSessionState(plan: ModelProfileTranscriptPlan, receipt: Extract<SharedEntriesAppendOutcome, {
|
|
1996
|
+
kind: "committed";
|
|
1997
|
+
}>, selection?: PreparedProfileModelSelection): void;
|
|
1914
1998
|
commitPreparedProfileModelSelection(prepared: PreparedProfileModelSelection, onThinkingLevelApplied?: (mutationRevision: number) => void): void;
|
|
1915
1999
|
finishPreparedProfileModelSelection(prepared: PreparedProfileModelSelection): Promise<void>;
|
|
1916
2000
|
/**
|
|
@@ -1938,7 +2022,7 @@ export declare class AgentSession {
|
|
|
1938
2022
|
* Restore the exact live-model state captured before a failed selector transaction.
|
|
1939
2023
|
* Compensation is not a usage choice, so the restored model is not recorded.
|
|
1940
2024
|
*/
|
|
1941
|
-
restoreModelSelectionForRollback(model: Model | undefined, thinkingLevel: ThinkingLevel | undefined): Promise<void>;
|
|
2025
|
+
restoreModelSelectionForRollback(model: Model | undefined, thinkingLevel: ThinkingLevel | undefined, durable?: ModelSelectionRollbackDurableState): Promise<void>;
|
|
1942
2026
|
/** Set a durable per-session model from a control surface without exposing credential errors. */
|
|
1943
2027
|
setModelTemporaryForControl(model: Model, expectedSessionId?: string, thinkingLevel?: ThinkingLevel): Promise<boolean>;
|
|
1944
2028
|
setDefaultModelSelection(model: Model, thinkingLevel: ThinkingLevel | undefined, options?: {
|
|
@@ -1992,6 +2076,12 @@ export declare class AgentSession {
|
|
|
1992
2076
|
* Set thinking level from a control surface. Global changes commit before affecting live state.
|
|
1993
2077
|
*/
|
|
1994
2078
|
setThinkingLevelForControl(level: ThinkingLevel, persist: boolean): Promise<void>;
|
|
2079
|
+
/**
|
|
2080
|
+
* Non-operator, session-only thinking change (plan mode model follow). Shared sessions
|
|
2081
|
+
* publish the entry through admitted shared publication before the live change;
|
|
2082
|
+
* other sessions keep the synchronous legacy write.
|
|
2083
|
+
*/
|
|
2084
|
+
setThinkingLevelForSession(level: ThinkingLevel | undefined): Promise<void>;
|
|
1995
2085
|
getThinkingScopeForControl(): "session" | "global config";
|
|
1996
2086
|
getThinkingVisibility(): "visible" | "hidden";
|
|
1997
2087
|
setThinkingVisibility(visibility: "visible" | "hidden", persist?: boolean): void;
|
|
@@ -2033,9 +2123,9 @@ export declare class AgentSession {
|
|
|
2033
2123
|
* for pure configured intent (e.g. subagent/`modelRoles` display rows).
|
|
2034
2124
|
*/
|
|
2035
2125
|
isFastModeActive(): boolean;
|
|
2036
|
-
setServiceTier(serviceTier: ServiceTier | undefined): void
|
|
2037
|
-
setFastMode(enabled: boolean): void
|
|
2038
|
-
toggleFastMode(): boolean
|
|
2126
|
+
setServiceTier(serviceTier: ServiceTier | undefined): Promise<void>;
|
|
2127
|
+
setFastMode(enabled: boolean): Promise<void>;
|
|
2128
|
+
toggleFastMode(): Promise<boolean>;
|
|
2039
2129
|
/**
|
|
2040
2130
|
* Get available thinking levels for current model.
|
|
2041
2131
|
*/
|
|
@@ -2379,3 +2469,8 @@ export declare class AgentSession {
|
|
|
2379
2469
|
*/
|
|
2380
2470
|
get extensionRunner(): ExtensionRunner | undefined;
|
|
2381
2471
|
}
|
|
2472
|
+
/** Outcome of a background publication: `false` means nothing reached the transcript. */
|
|
2473
|
+
interface BackgroundPublicationResult {
|
|
2474
|
+
readonly committed: boolean;
|
|
2475
|
+
readonly cause?: string;
|
|
2476
|
+
}
|