@deepseek-ai/dsh-tool-cordis 0.2.1-rc.5 → 0.2.2-alpha.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.
@@ -13,6 +13,38 @@
13
13
  */
14
14
  /** Every harness `ctx.<key>` service, sorted by key. */
15
15
  export const SERVICE_API = [
16
+ {
17
+ key: 'actionCards',
18
+ summary: 'Card tool, kind registry, Session projection, user actions and status notices.',
19
+ description: 'Card tool, kind registry, Session projection, user actions and status notices.',
20
+ methods: [
21
+ {
22
+ signature: 'register<Details>(kind: ActionCardKind<Details>): () => void',
23
+ description: 'Register one action kind for the caller\'s lifetime.',
24
+ parameters: [{ name: 'kind', description: 'the kind\'s skill, details schema, verbs and handler.' }],
25
+ returns: 'disposer removing the kind; actions on its cards are then unavailable.',
26
+ throws: ['when another kind already registered the same action.'],
27
+ },
28
+ {
29
+ signature: 'record(agent: Agent, decision: ActionCardDecision): void',
30
+ description: 'Record a card decision in the Session log; the next model request reports it.',
31
+ parameters: [{ name: 'agent', description: 'agent whose Session owns the card.' }, { name: 'decision', description: 'the card\'s new state.' }],
32
+ throws: ['when no kind ever registered the decision\'s action with this service, or its phase is one the projection derives.'],
33
+ },
34
+ {
35
+ signature: 'view(session: Session): ActionCardView',
36
+ description: 'Read the cards of one Session.',
37
+ parameters: [{ name: 'session', description: 'a Session whose projections are prepared.' }],
38
+ returns: 'proposals and decisions by call id.',
39
+ },
40
+ {
41
+ signature: '@Remote act(agent: Agent, callId: ToolCallId, verb: string, payload?: Record<string, JsonValue>): Promise<ActionCardResult>',
42
+ description: 'Apply a user action to a logged card. Shared checks run first, then the kind reconciles the card; `dismiss` is recorded here and every other verb goes to the card\'s kind. `dismiss` also works on an unstarted card whose kind is no longer registered. Concurrent actions on one card share one operation.',
43
+ parameters: [{ name: 'agent', description: 'live root resolved from the displayed Session.' }, { name: 'callId', description: 'the card\'s `propose_action` call id.' }, { name: 'verb', description: '`dismiss` or one of the kind\'s verbs.' }, { name: 'payload', description: 'kind-defined fields such as a chosen location.' }],
44
+ returns: 'acceptance of background work, the decision in effect, or a refusal.',
45
+ },
46
+ ],
47
+ },
16
48
  {
17
49
  key: 'agentDefaultModel',
18
50
  summary: 'Owns the default model selection independently of any Host or transport.',
@@ -67,6 +99,12 @@ export const SERVICE_API = [
67
99
  summary: 'Registry of YAML-declared presets and the revisions live Agents retain.',
68
100
  description: 'Registry of YAML-declared presets and the revisions live Agents retain.',
69
101
  methods: [
102
+ {
103
+ signature: 'presetForSession(session: Session): string | null',
104
+ description: 'Read the preset recorded for a Session, including selections no longer in the roster.',
105
+ parameters: [{ name: 'session', description: 'Session whose committed preset selection is read.' }],
106
+ returns: 'the recorded preset, or null when none was selected.',
107
+ },
70
108
  {
71
109
  signature: 'async register(definition: PresetDefinition): Promise<() => Promise<void>>',
72
110
  description: 'Register and eagerly load a definition; activation failure remains visible in the roster.',
@@ -158,6 +196,12 @@ export const SERVICE_API = [
158
196
  summary: 'Agent service (`ctx.agents`): tracks live agents and carries the initiating Agent through one process-local asynchronous driver chain.',
159
197
  description: 'Agent service (`ctx.agents`): tracks live agents and carries the initiating Agent through one process-local asynchronous driver chain. Agent *creation* is provided by whichever plugin implements the AgentFactory (`@deepseek-ai/dsh-agent-loop`), registered via setFactory.\n\nInitiator methods provide same-process causal attribution only. Ambient presence is neither liveness proof nor authorization; subjects and owners remain explicit, as does identity at worker, process, persistence, and wire boundaries. Returned Promise boundaries drain during teardown, except a nested lineage that starts an owning-fiber unload is excluded from its own drain.',
160
198
  methods: [
199
+ {
200
+ signature: 'turnBoundaryOf(session: Session): TurnBoundaryProjection',
201
+ description: 'Read the turn and step positions recorded in a Session.',
202
+ parameters: [{ name: 'session', description: 'Session whose committed events are read.' }],
203
+ returns: 'the current turn and step positions; do not mutate the returned value.',
204
+ },
161
205
  {
162
206
  signature: 'currentInitiator(): Agent | undefined',
163
207
  description: 'Read the Agent that initiated the inherited asynchronous driver chain. Use this optional form for logging, tracing, metrics, or host attribution that also supports agentless calls. When a parent creates a child, setup reports the causal parent while the setup callback\'s Agent parameter identifies the child.',
@@ -371,8 +415,8 @@ export const SERVICE_API = [
371
415
  },
372
416
  {
373
417
  signature: 'async admitPromptContent( content: readonly AttachmentAdmissionPart[], ): Promise<AdmittedPromptContentPart[]>',
374
- description: 'Admit one Host prompt and replace each uploaded image with its durable reference. Text and durable file references pass through unchanged. A prompt without image parts performs no storage operation.',
375
- parameters: [{ name: 'content', description: 'prompt parts in message order after file receipt resolution.' }],
418
+ description: 'Admit one Host prompt and replace each encoded image with its durable reference. Text, durable file references, and already stored images pass through unchanged. Every image part counts toward `maxImagesPerMessage` and `maxMessageImageBytes`; a stored image counts the bytes of the upload that stored it. Refused content starts no writes. A prompt without encoded images performs no storage operation.',
419
+ parameters: [{ name: 'content', description: 'prompt parts in message order after upload receipt resolution.' }],
376
420
  returns: 'admitted prompt parts in the same order as `content`.',
377
421
  throws: ['AttachmentError when the image batch is refused.'],
378
422
  },
@@ -397,8 +441,8 @@ export const SERVICE_API = [
397
441
  },
398
442
  {
399
443
  signature: 'abstract readImage(ref: ImageAttachmentRef, signal?: AbortSignal): Promise<StoredImageAttachment>',
400
- description: 'Read one image and verify that bytes still match the recorded reference.',
401
- parameters: [{ name: 'ref', description: 'durable reference from the session log.' }, { name: 'signal', description: 'optional cancellation for backend read and verification work.' }],
444
+ description: 'Read one image and verify its ID, format, byte length, and dimensions against the supplied reference.',
445
+ parameters: [{ name: 'ref', description: 'supplied image reference; name and originalDimensions are preserved without file verification.' }, { name: 'signal', description: 'optional cancellation for backend read and verification work.' }],
402
446
  returns: 'the verified bytes and normalized attachment reference.',
403
447
  throws: ['the signal reason when aborted, or a storage error when verification fails.'],
404
448
  },
@@ -424,7 +468,7 @@ export const SERVICE_API = [
424
468
  {
425
469
  signature: 'async *readFileStream( ref: FileAttachmentRef, signal?: AbortSignal, ): AsyncIterable<Uint8Array>',
426
470
  description: 'Read and verify one verbatim stored file as bounded chunks. Providers must not collect the complete file in memory. Backends without verbatim file reads keep this default rejection.',
427
- parameters: [{ name: 'ref', description: 'durable reference from the session log.' }, { name: 'signal', description: 'optional cancellation for backend reads and verification work.' }],
471
+ parameters: [{ name: 'ref', description: 'durable file reference from the session log.' }, { name: 'signal', description: 'optional cancellation for backend reads and verification work.' }],
428
472
  returns: 'exact file bytes in order; integrity failures reject the iteration.',
429
473
  },
430
474
  {
@@ -521,8 +565,8 @@ export const SERVICE_API = [
521
565
  },
522
566
  {
523
567
  key: 'clientModules',
524
- summary: 'The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index injection rows.',
525
- description: 'The web plugin table service: incremental `dsh.client` scan + wire composition + bundle route + index injection rows. Construction runs the activation scan synchronously — a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud throw (FAILED fiber; the boot activation audit reports it).',
568
+ summary: 'The web plugin table service: incremental `dsh.client` scan + wire composition + bundle and package-asset route + index injection rows.',
569
+ description: 'The web plugin table service: incremental `dsh.client` scan + wire composition + bundle and package-asset route + index injection rows. Construction runs the activation scan synchronously — a malformed declaration or missing bundle among the already-loaded entries aggregates into one loud throw (FAILED fiber; the boot activation audit reports it).',
526
570
  methods: [
527
571
  {
528
572
  signature: 'graph(): WebBootGraph',
@@ -538,7 +582,7 @@ export const SERVICE_API = [
538
582
  },
539
583
  {
540
584
  signature: 'async fetchBundle(request: Request): Promise<Response>',
541
- description: 'Serve an advertised revisioned bundle or source map without a Web server. Unknown URLs return 404, unsupported methods return 405, and `HEAD` returns the same immutable headers without materializing a body. Each body is built once on its first `GET`; script construction never reads maps.',
585
+ description: 'Serve an advertised revisioned bundle, source map, chunk, or package asset without a Web server. Unknown URLs return 404, unsupported methods return 405, and `HEAD` returns the same immutable headers without materializing a body. Each bundle body is built once on its first `GET`; script construction never reads maps. A package asset is read on every request and answers 304 without a body when `If-None-Match` equals its entity tag; its body holds the file open until the caller consumes or cancels it. A bundle, map, or chunk body is the held buffer itself, not a copy, so a caller must not modify its bytes.',
542
586
  parameters: [{ name: 'request', description: 'shell-carrier request for a `/plugins` resource.' }],
543
587
  returns: 'the exact response also exposed by the optional Web route.',
544
588
  },
@@ -550,13 +594,13 @@ export const SERVICE_API = [
550
594
  },
551
595
  {
552
596
  signature: 'rebuilt(id: string): string | undefined',
553
- description: 'Publish one completed bundle generation (the HMR watch\'s registration hook — the only entry point through which build changes reach the graph). Unchanged mtime, ctime and size preserve the graph without reading the bundle.',
597
+ description: 'Publish one completed bundle generation (the HMR watch\'s registration hook; an entry restart publishes through reconciliation instead). Unchanged mtime, ctime and size preserve the graph without reading the bundle.',
554
598
  parameters: [{ name: 'id', description: 'entry id (package name).' }],
555
599
  returns: 'the current artifact rev, or undefined for an unknown id.',
556
600
  },
557
601
  {
558
602
  signature: 'onRebuilt(listener: (id: string, rev: string) => void): () => void',
559
- description: 'Subscribe to bundle rebuilds; fires only when artifact metadata changes the rev.',
603
+ description: 'Subscribe to bundle rebuilds; fires when rebuilt changes a rev. A rev an entry restart publishes reaches only onGraphChanged listeners.',
560
604
  parameters: [{ name: 'listener', description: 'receives the entry id and its new bundle rev.' }],
561
605
  returns: 'the unsubscriber.',
562
606
  },
@@ -842,6 +886,67 @@ export const SERVICE_API = [
842
886
  },
843
887
  ],
844
888
  },
889
+ {
890
+ key: 'cuaAccess',
891
+ summary: 'Browser controls for provider-owned native permission and application decisions.',
892
+ description: 'Browser controls for provider-owned native permission and application decisions.',
893
+ methods: [
894
+ {
895
+ signature: '@Remote ptcConfiguration(): { persistent: boolean; writable: boolean }',
896
+ description: 'Read PTC execution state separately from native permission checks.',
897
+ parameters: [],
898
+ returns: 'Whether the shared runtime retains memory and has an editable profile entry.',
899
+ },
900
+ {
901
+ signature: '@Remote async enablePersistentPtc(): Promise<void>',
902
+ description: 'Persist in-memory PTC execution through the existing profile editor and Loader lifecycle.',
903
+ parameters: [],
904
+ returns: 'Completion after the shared runtime reload; already-persistent runtimes are left intact.',
905
+ },
906
+ {
907
+ signature: '@Remote applications(): Promise<CuaApplicationState>',
908
+ description: 'Read fresh stored application decisions without issuing a native request.',
909
+ parameters: [],
910
+ returns: 'Saved grants, refused applications and durable-storage availability.',
911
+ },
912
+ {
913
+ signature: '@Remote async systemStatus(): Promise<CuaSystemPermissionState>',
914
+ description: 'Inspect system privileges independently of application decisions and icons.',
915
+ parameters: [],
916
+ returns: 'Fresh native preflight and launch metadata.',
917
+ },
918
+ {
919
+ signature: '@Remote async applicationIcons(): Promise<Record<string, string>>',
920
+ description: 'Load presentation icons separately from application decisions.',
921
+ parameters: [],
922
+ returns: 'Optional native PNG icons keyed by executable path; applications without paths are skipped.',
923
+ },
924
+ {
925
+ signature: '@Remote async requestPermission(permission: CuaSystemPermission, locale: string): Promise<CuaSystemPermissionState>',
926
+ description: 'Request the selected system privilege through the native provider.',
927
+ parameters: [{ name: 'permission', description: 'macOS privilege to request.' }, { name: 'locale', description: 'Current Client language for provider-owned permission UI.' }],
928
+ returns: 'Current permission observations; requesting does not establish consent.',
929
+ },
930
+ {
931
+ signature: '@Remote async openSettings(permission: CuaSystemPermission, locale: string): Promise<void>',
932
+ description: 'Open the macOS privacy pane selected by the user.',
933
+ parameters: [{ name: 'permission', description: 'Corresponding system privilege.' }, { name: 'locale', description: 'Current Client language for provider-owned recovery instructions.' }],
934
+ returns: 'Completion after macOS accepted the open request.',
935
+ },
936
+ {
937
+ signature: '@Remote revoke(id: CuaApplicationId): Promise<void>',
938
+ description: 'Remove saved and session access and join affected operations.',
939
+ parameters: [{ name: 'id', description: 'Application identity displayed on the permission page.' }],
940
+ returns: 'Completion after persistence and cancellation; dispatched input cannot be undone.',
941
+ },
942
+ {
943
+ signature: '@Remote async retryApproval(id: CuaApplicationId): Promise<void>',
944
+ description: 'Clear this application\'s refusals across sessions so each session may ask for access again.',
945
+ parameters: [{ name: 'id', description: 'Refused or revoked application displayed on the permission page.' }],
946
+ returns: 'Completion after clearing refusals; no permission is granted and no action is replayed.',
947
+ },
948
+ ],
949
+ },
845
950
  {
846
951
  key: 'deepseekAccount',
847
952
  summary: 'Account operations; only Host consumers can obtain a request credential.',
@@ -1009,7 +1114,7 @@ export const SERVICE_API = [
1009
1114
  returns: 'disposer removing this resolver.',
1010
1115
  },
1011
1116
  {
1012
- signature: '@Remote(\'upload\') upload(agent: Agent, request: EncodedFileUploadRequest, signal: AbortSignal): Promise<FileUploadValue>',
1117
+ signature: '@Remote(\'upload\') async upload(agent: Agent, request: EncodedFileUploadRequest, signal: AbortSignal): Promise<FileUploadValue>',
1013
1118
  description: 'Persist one encoded upload and stage it under the Agent receiver selected by Typert.',
1014
1119
  parameters: [{ name: 'agent', description: 'receiving Agent resolved from the Remote Agent scope.' }, { name: 'request', description: 'canonical base64 bytes and optional display name.' }, { name: 'signal', description: 'caller cancellation before storage begins.' }],
1015
1120
  returns: 'the staged receipt and durable file reference.',
@@ -1021,10 +1126,16 @@ export const SERVICE_API = [
1021
1126
  returns: 'the staged receipt and durable file reference.',
1022
1127
  },
1023
1128
  {
1024
- signature: 'resolve(agent: Agent, receiptId: FileUploadReceiptId): FileAttachmentRef | undefined',
1129
+ signature: 'async uploadImageStream(request: { readonly sessionId: SessionId readonly data: AsyncIterable<Uint8Array> readonly mediaType: string readonly signal?: AbortSignal readonly name?: string }): Promise<ImageUploadValue>',
1130
+ description: 'Persist one prompt image for a Session: read at most the smaller of the deployment\'s per-image and per-message byte limits, then validate, normalize, and store the image the way prompt admission does, so a later prompt cites it by receipt. Cancellation before storage begins stores nothing; a cancelled upload never receives a receipt, although an image whose storage already began stays in the content-addressed store.',
1131
+ parameters: [{ name: 'request', description: 'Session identity, ordered bytes, the declared media type that this deployment must accept, cancellation, and optional display name.' }],
1132
+ returns: 'the staged receipt and durable normalized image reference.',
1133
+ },
1134
+ {
1135
+ signature: 'resolve(agent: Agent, receiptId: FileUploadReceiptId): StagedAttachment | undefined',
1025
1136
  description: 'Resolve one staged receipt for the receiving Agent\'s exact Session.',
1026
1137
  parameters: [{ name: 'agent', description: 'receiving Agent.' }, { name: 'receiptId', description: 'opaque receipt minted for one completed upload.' }],
1027
- returns: 'durable file reference, or `undefined` for an unknown or foreign receipt.',
1138
+ returns: 'the staged file or image, or `undefined` for an unknown or foreign receipt.',
1028
1139
  },
1029
1140
  {
1030
1141
  signature: 'bindPrompt( agent: Agent, receiptIds: readonly FileUploadReceiptId[], requestId: string, ): PromptFileBinding',
@@ -1039,10 +1150,290 @@ export const SERVICE_API = [
1039
1150
  },
1040
1151
  ],
1041
1152
  },
1153
+ {
1154
+ key: 'forge',
1155
+ summary: 'Registry of forge providers.',
1156
+ description: 'Registry of forge providers. Watchers of one change request share a single polling loop; each forge has at most one fetch in flight, which batches every due change request of that forge.',
1157
+ methods: [
1158
+ {
1159
+ signature: 'register(provider: ForgeProvider): () => Promise<void>',
1160
+ description: 'Register the provider of one forge family as an effect on the calling fiber. Watches of that forge receive an `unavailable` failure when the registration ends. Unregistering cancels and awaits its in-flight calls; results from the withdrawn registration are discarded.',
1161
+ parameters: [{ name: 'provider', description: 'provider to serve `provider.forge`.' }],
1162
+ returns: 'the disposer that unregisters the provider and waits for its calls to finish.',
1163
+ throws: ['when another provider already serves the same forge.'],
1164
+ },
1165
+ {
1166
+ signature: 'repositoryFromRemote(url: string): ForgeRepository | undefined',
1167
+ description: 'Map a Git remote URL to a repository through the first provider that serves it.',
1168
+ parameters: [{ name: 'url', description: 'fetch or push URL as Git reports it.' }],
1169
+ returns: 'the repository, or undefined when no provider serves the URL.',
1170
+ },
1171
+ {
1172
+ signature: 'changeRequestFromUrl(url: string): ChangeRequestRef | undefined',
1173
+ description: 'Map a change request web URL through the first provider that serves it.',
1174
+ parameters: [{ name: 'url', description: 'web URL of a pull or merge request.' }],
1175
+ returns: 'the change request, or undefined when no provider serves the URL.',
1176
+ },
1177
+ {
1178
+ signature: 'changeRequestUrl(ref: ChangeRequestRef): string',
1179
+ description: 'Build the canonical web URL of a change request.',
1180
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }],
1181
+ returns: 'the provider\'s canonical URL.',
1182
+ throws: ['when no provider serves the change request\'s forge.'],
1183
+ },
1184
+ {
1185
+ signature: 'async findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise<readonly ChangeRequestRef[]>',
1186
+ description: 'Find open change requests whose head is `branch`, excluding the default branch and forks.',
1187
+ parameters: [{ name: 'repository', description: 'repository served by a registered provider.' }, { name: 'branch', description: 'head branch name on the host.' }, { name: 'signal', description: 'cancellation for the lookup.' }],
1188
+ returns: 'matching change requests, newest first as the provider reports them.',
1189
+ throws: ['when no provider serves the repository\'s forge or the lookup fails.'],
1190
+ },
1191
+ {
1192
+ signature: 'async readiness(repository: ForgeRepository, signal: AbortSignal): Promise<ForgeReadiness>',
1193
+ description: 'Report whether the provider can reach the repository\'s host with current credentials.',
1194
+ parameters: [{ name: 'repository', description: 'repository served by a registered provider.' }, { name: 'signal', description: 'cancellation for the probe.' }],
1195
+ returns: 'the provider\'s readiness for the host.',
1196
+ throws: ['when no provider serves the repository\'s forge.'],
1197
+ },
1198
+ {
1199
+ signature: 'async markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeActionFailure | undefined>',
1200
+ description: 'Mark a draft change request ready for review, then poll it at once when it is watched.',
1201
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'signal', description: 'cancellation of the request.' }],
1202
+ returns: 'undefined once the host accepted the change, or why it did not.',
1203
+ throws: ['when no provider serves the change request\'s forge, or with `signal.reason` when it aborts.'],
1204
+ },
1205
+ {
1206
+ signature: 'async merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>',
1207
+ description: 'Merge a change request while its head is still `request.headSha`, then poll it at once when it is watched.',
1208
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'request', description: 'merge method and the head commit the user confirmed.' }, { name: 'signal', description: 'cancellation of the request.' }],
1209
+ returns: 'undefined once the host merged it, or why it did not.',
1210
+ throws: ['when no provider serves the change request\'s forge, or with `signal.reason` when it aborts.'],
1211
+ },
1212
+ {
1213
+ signature: 'async fetchChecks(ref: ChangeRequestRef, signal: AbortSignal): Promise<ChangeRequestSnapshot | ForgeFailure>',
1214
+ description: 'Read complete check details independently of periodic polling.',
1215
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'signal', description: 'cancellation of the detail view.' }],
1216
+ returns: 'a complete snapshot or the provider\'s failure; unsupported providers return unavailable.',
1217
+ throws: ['on cancellation, provider disposal, or expiry of this read\'s own `fetchTimeoutMs` deadline.'],
1218
+ },
1219
+ {
1220
+ signature: 'async diff(ref: ChangeRequestRef, signal: AbortSignal): Promise<string | ForgeFailure>',
1221
+ description: 'Read the changes of a change request as its host computes them.',
1222
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'signal', description: 'cancellation of the read.' }],
1223
+ returns: 'one unified patch with `a/` and `b/` path prefixes, or why the host did not provide it.',
1224
+ throws: ['when no provider serves the change request\'s forge, or with `signal.reason` when it aborts.'],
1225
+ },
1226
+ {
1227
+ signature: 'async submitReview(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>',
1228
+ description: 'Publish one comment or a completed review, then refresh the watched status.',
1229
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'request', description: 'explicitly selected commit, comments, and review decision.' }, { name: 'signal', description: 'request cancellation.' }],
1230
+ returns: 'a publication URL or a failure, including an unknown write outcome.',
1231
+ },
1232
+ {
1233
+ signature: 'async fileText(ref: ChangeRequestRef, commit: string, path: string, signal: AbortSignal): Promise<string | ForgeFailure>',
1234
+ description: 'Read the text of one file at a commit of a change request\'s repository.',
1235
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'commit', description: 'commit object name.' }, { name: 'path', description: 'path relative to the repository root.' }, { name: 'signal', description: 'cancellation of the read.' }],
1236
+ returns: 'the text, or why the host did not provide it.',
1237
+ throws: ['when no provider serves the change request\'s forge, or with `signal.reason` when it aborts.'],
1238
+ },
1239
+ {
1240
+ signature: 'fileUrl(ref: ChangeRequestRef, commit: string, path: string): string',
1241
+ description: 'Build the web page of one file at a commit of a change request\'s repository.',
1242
+ parameters: [{ name: 'ref', description: 'change request served by a registered provider.' }, { name: 'commit', description: 'commit object name.' }, { name: 'path', description: 'path relative to the repository root.' }],
1243
+ returns: 'the provider\'s URL.',
1244
+ throws: ['when no provider serves the change request\'s forge.'],
1245
+ },
1246
+ {
1247
+ signature: 'watch(ref: ChangeRequestRef, listener: ChangeRequestListener): () => void',
1248
+ description: 'Watch one change request as an effect on the calling fiber. The first watcher starts polling at once; listeners receive every later result, and `latest` returns the current one. Polling stops when the last watcher leaves. Listeners must not throw; a thrown error is logged and skipped.',
1249
+ parameters: [{ name: 'ref', description: 'change request to poll.' }, { name: 'listener', description: 'receives each polling result.' }],
1250
+ returns: 'the disposer that stops this watch.',
1251
+ },
1252
+ {
1253
+ signature: 'refresh(ref: ChangeRequestRef): void',
1254
+ description: 'Poll a watched change request at once, including after a terminal state. A fetch already in flight is followed immediately by another fetch; an unwatched change request is unchanged.',
1255
+ parameters: [{ name: 'ref', description: 'change request to poll.' }],
1256
+ },
1257
+ {
1258
+ signature: 'latest(ref: ChangeRequestRef): ChangeRequestUpdate | undefined',
1259
+ description: 'Read the latest polling result of a watched change request.',
1260
+ parameters: [{ name: 'ref', description: 'change request to read.' }],
1261
+ returns: 'the latest result, or undefined before the first result or without a watch.',
1262
+ },
1263
+ ],
1264
+ },
1265
+ {
1266
+ key: 'forgePanel',
1267
+ summary: 'Serves the forge panel.',
1268
+ description: 'Serves the forge panel. Following a Session inspects the checkout of its current directory using the Session\'s permissions and execution world, recognizes the code host of the upstream remote or `origin`, probes sign-in for that host, and polls the Session\'s bound change requests through `ctx.forge` until the last follower of that Session leaves. A worktree request makes the panel create a branch and checkout through an optional `ctx.worktrees` and enter it while the Session\'s first message waits in the inbox, or at the first step proposal of a message no wait took. After a failed or stopped attempt the message keeps waiting for another attempt or for the request to be withdrawn. A message also waits while the worktree the Session works in is gone, until that worktree is checked out again or left for the source checkout. Changes to a Session\'s checkout run as Agent maintenance, so a message that arrives meanwhile waits for them.',
1269
+ methods: [
1270
+ {
1271
+ signature: '@Remote({ mode: \'stream\' }) async *follow(session: Session, signal: AbortSignal): AsyncIterable<ForgePanelState>',
1272
+ description: 'Stream the panel state of a Session: the current state first, then each later state. Intermediate states may be skipped when the reader is slower than the updates. The stream ends when `signal` aborts or the Remote stops.',
1273
+ parameters: [{ name: 'session', description: 'Session to follow.' }, { name: 'signal', description: 'ends the stream.' }],
1274
+ returns: 'panel states in publication order.',
1275
+ },
1276
+ {
1277
+ signature: '@Remote({ mode: \'stream\' }) async *changeRequestStates(signal: AbortSignal): AsyncIterable<ForgeChangeRequestStatesFrame>',
1278
+ description: 'Stream the last known state of every change request that a listed Session the caller may read binds: the stored states first, then each state a poll changes or a new binding reveals. Listing reads no Session log: loaded Sessions report their bindings, others the cached Session summary, and a Session without one shows nothing until it is opened. Closed requests are polled at the idle cadence so reopening is observed. The stream ends when `signal` aborts or the Remote stops.',
1279
+ parameters: [{ name: 'signal', description: 'ends the stream.' }],
1280
+ returns: 'frames in publication order.',
1281
+ throws: ['when the Host lacks the Session query, projection cache, storage, or Session store service.'],
1282
+ },
1283
+ {
1284
+ signature: '@Remote async branches(session: Session, signal: AbortSignal): Promise<ForgeBranches>',
1285
+ description: 'List the local branches that can start a worktree of the Session\'s current checkout.',
1286
+ parameters: [{ name: 'session', description: 'Session whose current directory is listed.' }, { name: 'signal', description: 'request cancellation.' }],
1287
+ returns: 'the checked-out branch and at most `maxBranches` local branches, the checked-out one first.',
1288
+ throws: ['when the current directory is not inside a checkout or Git fails.'],
1289
+ },
1290
+ {
1291
+ signature: '@Remote async track(session: Session, url: string, signal: AbortSignal): Promise<void>',
1292
+ description: 'Bind a change request to a Session by URL, or restore a dismissed binding.',
1293
+ parameters: [{ name: 'session', description: 'Session that receives the binding.' }, { name: 'url', description: 'web URL of the change request.' }, { name: 'signal', description: 'request cancellation.' }],
1294
+ throws: ['`forgePanel/unrecognized-url` when no registered provider serves the URL.'],
1295
+ },
1296
+ {
1297
+ signature: '@Remote async dismiss(session: Session, url: string, signal: AbortSignal): Promise<void>',
1298
+ description: 'Hide a visible binding of a Session; other URLs leave the Session unchanged.',
1299
+ parameters: [{ name: 'session', description: 'Session that owns the binding.' }, { name: 'url', description: 'web URL of the change request.' }, { name: 'signal', description: 'request cancellation.' }],
1300
+ },
1301
+ {
1302
+ signature: '@Remote async refresh(session: Session, signal: AbortSignal): Promise<void>',
1303
+ description: 'Reinspect a followed Session\'s checkout, probe sign-in again, and poll its change requests at once; an unfollowed Session is unchanged.',
1304
+ parameters: [{ name: 'session', description: 'Session whose panel refreshes.' }, { name: 'signal', description: 'request cancellation.' }],
1305
+ returns: 'settles once the inspection and the sign-in probe have ended; poll results reach the panel stream later.',
1306
+ },
1307
+ {
1308
+ signature: '@Remote async localDiff(session: Session, scope: ForgeLocalScope, signal: AbortSignal): Promise<ForgeLocalDiff>',
1309
+ description: 'Read the changes one scope covers in the checkout of the Session\'s current directory, with Git using the Session\'s sandbox policy.',
1310
+ parameters: [{ name: 'session', description: 'Session whose checkout is read.' }, { name: 'scope', description: 'which changes to read.' }, { name: 'signal', description: 'request cancellation.' }],
1311
+ returns: 'the files, the base of the `branch` scope, and the untracked files left out.',
1312
+ throws: ['`forgePanel/not-a-checkout` outside a checkout; `forgePanel/no-fork-point` for the `branch` scope of a checkout without one; `forgePanel/filter-config-failed` when filter configuration cannot be read completely, before any comparison; `forgePanel/diff-too-large` over `maxDiffBytes`; the Git error when Git fails.'],
1313
+ },
1314
+ {
1315
+ signature: '@Remote async localText(session: Session, scope: ForgeLocalScope, path: string, signal: AbortSignal): Promise<string>',
1316
+ description: 'Read the new side of one changed file in a scope, which supplies the unchanged lines between its hunks: the index for `staged`, else the working tree.',
1317
+ parameters: [{ name: 'session', description: 'Session whose checkout is read.' }, { name: 'scope', description: 'the scope the diff was read in.' }, { name: 'path', description: 'path relative to the checkout\'s top-level directory, as the diff names it.' }, { name: 'signal', description: 'request cancellation.' }],
1318
+ returns: 'the text.',
1319
+ throws: ['`forgePanel/not-a-checkout` outside a checkout; `forgePanel/diff-too-large` over `maxDiffBytes`; an error for a path outside the checkout, binary content, or a failed read.'],
1320
+ },
1321
+ {
1322
+ signature: '@Remote async changeRequestChecks(session: Session, url: string, headSha: string, signal: AbortSignal): Promise<ChangeRequestSnapshot>',
1323
+ description: 'Load complete checks for the change request whose list the user opened.',
1324
+ parameters: [{ name: 'session', description: 'Session retaining the visible binding.' }, { name: 'url', description: 'binding URL.' }, { name: 'headSha', description: 'commit displayed by the card; a different head rejects the result.' }, { name: 'signal', description: 'cancellation when the list closes.' }],
1325
+ returns: 'the complete snapshot at the displayed head.',
1326
+ throws: ['`forgePanel/not-bound` for an invisible binding, `forgePanel/stale-head` for a moved head, or `forgePanel/checks-failed` when the provider cannot complete the read.'],
1327
+ },
1328
+ {
1329
+ signature: '@Remote async changeRequestDiff(session: Session, url: string, signal: AbortSignal): Promise<ForgeChangeRequestDiff>',
1330
+ description: 'Read the changes of a change request of a Session as its code host computes them, at the head commit of its latest status. A patch already read at the same head commit and base branch is reused from memory, for any Session, until `maxCachedDiffBytes` evicts it.',
1331
+ parameters: [{ name: 'session', description: 'Session the change request is bound to.' }, { name: 'url', description: 'binding URL of the change request.' }, { name: 'signal', description: 'request cancellation.' }],
1332
+ returns: 'the files, the head commit, each file\'s web page, and the commits the checkout has beyond the head.',
1333
+ throws: ['`forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; `forgePanel/diff-too-large` when the host or its provider refuses the diff over a size limit; `forgePanel/diff-failed` before its status was read and when the host does not provide the diff otherwise.'],
1334
+ },
1335
+ {
1336
+ signature: '@Remote async changeRequestText(session: Session, url: string, commit: string, path: string, signal: AbortSignal): Promise<string>',
1337
+ description: 'Read one file of a change request\'s repository at a commit, which supplies the unchanged lines between the hunks of its diff.',
1338
+ parameters: [{ name: 'session', description: 'Session the change request is bound to.' }, { name: 'url', description: 'binding URL of the change request.' }, { name: 'commit', description: 'commit object name, the head commit of the diff.' }, { name: 'path', description: 'path relative to the repository root.' }, { name: 'signal', description: 'request cancellation.' }],
1339
+ returns: 'the text.',
1340
+ throws: ['`forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; `forgePanel/diff-too-large` when the host or its provider refuses the file over a size limit; `forgePanel/diff-failed` when the host does not provide the file otherwise.'],
1341
+ },
1342
+ {
1343
+ signature: '@Remote async submitReview(session: Session, url: string, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>',
1344
+ description: 'Publish a line comment or completed review for a visible Session binding.',
1345
+ parameters: [{ name: 'session', description: 'Session retaining the change request.' }, { name: 'url', description: 'visible binding URL.' }, { name: 'request', description: 'reviewed head, ranges, plain text, and explicit review decision.' }, { name: 'signal', description: 'request cancellation.' }],
1346
+ returns: 'confirmed publication or a typed failure; unknown outcomes require reconciliation on the host.',
1347
+ },
1348
+ {
1349
+ signature: '@Remote async markReady(session: Session, url: string, signal: AbortSignal): Promise<void>',
1350
+ description: 'Mark a draft change request of a Session ready for review; the change request is polled again once the host answers.',
1351
+ parameters: [{ name: 'session', description: 'Session the change request is bound to.' }, { name: 'url', description: 'binding URL of the change request.' }, { name: 'signal', description: 'request cancellation.' }],
1352
+ throws: ['`forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; `forgePanel/action-failed` with the host\'s reason when the host refuses or cannot be reached.'],
1353
+ },
1354
+ {
1355
+ signature: '@Remote async merge(session: Session, url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise<void>',
1356
+ description: 'Merge a change request of a Session while its head is still `headSha`; the change request is polled again once the host answers.',
1357
+ parameters: [{ name: 'session', description: 'Session the change request is bound to.' }, { name: 'url', description: 'binding URL of the change request.' }, { name: 'method', description: 'how the commits enter the base branch.' }, { name: 'headSha', description: 'head commit the user confirmed.' }, { name: 'signal', description: 'request cancellation.' }],
1358
+ throws: ['`forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; `forgePanel/stale-head` when the head moved past `headSha`; `forgePanel/action-failed` with the host\'s reason when the host refuses otherwise or cannot be reached.'],
1359
+ },
1360
+ {
1361
+ signature: '@Remote async requestWorktree(session: Session, from: string | null, signal: AbortSignal): Promise<void>',
1362
+ description: 'Ask for a new worktree before the Session\'s first turn, replacing an open request and forgetting a failed attempt. While the next message waits in the inbox, or else at the first step proposal, the panel creates a branch from `from`, or from HEAD of the current checkout when it is null, and enters its checkout. A message that already waits after a failed or stopped attempt keeps waiting for ForgePanelController.retryWorktree.',
1363
+ parameters: [{ name: 'session', description: 'Session without a started turn.' }, { name: 'from', description: 'local base branch, or null for HEAD.' }, { name: 'signal', description: 'request cancellation.' }],
1364
+ throws: ['`forgePanel/invalid-branch` when `from` is empty; `forgePanel/worktrees-unavailable` without a worktree service; `forgePanel/session-started` after a turn started or the worktree was created; `forgePanel/session-busy` while the worktree is being created.'],
1365
+ },
1366
+ {
1367
+ signature: '@Remote async cancelWorktree(session: Session, signal: AbortSignal): Promise<void>',
1368
+ description: 'Withdraw the open worktree request of a Session with its failed attempt, which lets a waiting message go on in the current checkout; without a request the Session is unchanged. Withdrawing needs no worktree service.',
1369
+ parameters: [{ name: 'session', description: 'Session without a started turn.' }, { name: 'signal', description: 'request cancellation.' }],
1370
+ throws: ['`forgePanel/session-started` after a turn started or the worktree was created; `forgePanel/session-busy` while the worktree is being created.'],
1371
+ },
1372
+ {
1373
+ signature: '@Remote async stopCreation(session: Session, signal: AbortSignal): Promise<void>',
1374
+ description: 'Stop the creation a message of the Session waits for; the message keeps waiting with the request still open. Without such a creation the Session is unchanged.',
1375
+ parameters: [{ name: 'session', description: 'Session whose creation stops.' }, { name: 'signal', description: 'request cancellation.' }],
1376
+ },
1377
+ {
1378
+ signature: '@Remote async retryWorktree(session: Session, signal: AbortSignal): Promise<void>',
1379
+ description: 'Make another attempt, with a new branch name, at the worktree a message of the Session waits for after a failed or stopped attempt.',
1380
+ parameters: [{ name: 'session', description: 'Session whose message waits.' }, { name: 'signal', description: 'request cancellation.' }],
1381
+ throws: ['`forgePanel/not-waiting` when no message waits or an attempt is running.'],
1382
+ },
1383
+ {
1384
+ signature: '@Remote async restoreWorktree(session: Session, signal: AbortSignal): Promise<void>',
1385
+ description: 'Check out the created worktree of a Session again at its recorded directory when that directory is gone: its branch when the branch still exists, otherwise a new branch of the same name at the base commit. Changes that were never committed are not recovered. Runs as Agent maintenance, inside the wait of a message that waits for the restoration, which then goes on; without a missing directory the Session is unchanged.',
1386
+ parameters: [{ name: 'session', description: 'Session whose worktree directory is gone.' }, { name: 'signal', description: 'request cancellation, which aborts the restoration.' }],
1387
+ throws: ['`forgePanel/no-worktree` without a created worktree; `forgePanel/worktrees-unavailable` without a worktree service; `forgePanel/session-busy` while the Session\'s Agent is not loaded or has other work; `forgePanel/restore-failed` when Git fails.'],
1388
+ },
1389
+ {
1390
+ signature: '@Remote async continueInProject(session: Session, signal: AbortSignal): Promise<void>',
1391
+ description: 'Move a Session from its created worktree to the source checkout the worktree came from; the Session no longer works in the worktree. Runs as Agent maintenance, inside the wait of a message that waits for the removed worktree, which then goes on.',
1392
+ parameters: [{ name: 'session', description: 'Session with a created worktree.' }, { name: 'signal', description: 'request cancellation.' }],
1393
+ throws: ['`forgePanel/no-worktree` without a created worktree; `forgePanel/session-busy` while the Session\'s Agent is not loaded or has other work; the working-directory service\'s error when the source checkout no longer exists.'],
1394
+ },
1395
+ ],
1396
+ },
1397
+ {
1398
+ key: 'forgeSession',
1399
+ summary: 'Session-scoped change request bindings.',
1400
+ description: 'Session-scoped change request bindings. The `forgeChangeRequests` projection derives them from `gh pr create`, `gh pr view`, `gh pr edit`, `gh pr checkout`, and `git push` results and from `plugin:forge-session/binding` records. After each push result, and when a caller reports the branch a Session works on, the service looks up open change requests whose head is that branch and records the unbound ones as discovered. Watching a Session polls its visible change requests through `ctx.forge`.',
1401
+ methods: [
1402
+ {
1403
+ signature: 'changeRequests(session: Session): SessionChangeRequest[]',
1404
+ description: 'List the change requests bound to a Session and not dismissed.',
1405
+ parameters: [{ name: 'session', description: 'Session whose bindings are read.' }],
1406
+ returns: 'visible bindings in first-recorded order, each with its latest polling result.',
1407
+ },
1408
+ {
1409
+ signature: 'track(session: Session, url: string): void',
1410
+ description: 'Bind a change request to a Session by URL, or restore a dismissed binding. Appends a `track` record with the provider\'s canonical URL unless the change request is already visible.',
1411
+ parameters: [{ name: 'session', description: 'Session that receives the binding.' }, { name: 'url', description: 'web URL of the change request.' }],
1412
+ throws: ['when no registered provider recognizes the URL.'],
1413
+ },
1414
+ {
1415
+ signature: 'discoverBranch(session: Session, remote: string, branch: string): Promise<void>',
1416
+ description: 'Look up open change requests whose head is a branch the Session works on, and record the unbound ones as discovered, as after a push of that branch. A remote that no provider recognizes changes nothing; a failed lookup is logged and changes nothing.',
1417
+ parameters: [{ name: 'session', description: 'Session that receives the bindings.' }, { name: 'remote', description: 'URL of the remote that holds the branch.' }, { name: 'branch', description: 'branch name on that remote.' }],
1418
+ returns: 'resolves once the lookup has recorded its bindings or failed.',
1419
+ },
1420
+ {
1421
+ signature: 'dismiss(session: Session, url: string): void',
1422
+ description: 'Hide a visible binding. Appends a `dismiss` record; a URL that is not visibly bound leaves the log unchanged. Discovery never restores a dismissed binding; `track` does.',
1423
+ parameters: [{ name: 'session', description: 'Session that owns the binding.' }, { name: 'url', description: 'web URL of the change request.' }],
1424
+ },
1425
+ {
1426
+ signature: 'watch(session: Session, listener: SessionChangeRequestsListener): () => void',
1427
+ description: 'Watch a Session\'s visible change requests as an effect on the calling fiber. Every visible change request that a provider recognizes is polled through `ctx.forge` while the Session has a watcher. Listeners receive the complete list after each later binding or provider change, or polling result; read the current list with changeRequests. Listeners must not throw; a thrown error is logged and skipped.',
1428
+ parameters: [{ name: 'session', description: 'Session to watch.' }, { name: 'listener', description: 'receives the complete visible list.' }],
1429
+ returns: 'the disposer that stops this watch.',
1430
+ },
1431
+ ],
1432
+ },
1042
1433
  {
1043
1434
  key: 'fs',
1044
1435
  summary: 'Abstract filesystem provider.',
1045
- description: 'Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and mutations are atomic. Optional guards add stale protection without changing the unguarded provider contract.',
1436
+ description: 'Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and single-file publication is atomic. Moves can retain their source after publishing the destination. Optional guards add stale protection without changing the unguarded provider contract.',
1046
1437
  methods: [
1047
1438
  {
1048
1439
  signature: 'watch(target: FsTarget, changed: (error?: Error) => void, signal: AbortSignal): Promise<() => Promise<void>>',
@@ -1135,6 +1526,24 @@ export const SERVICE_API = [
1135
1526
  parameters: [{ name: 'target', description: 'the resolved target to edit.' }, { name: 'edit', description: 'the literal search/replace request.' }, { name: 'expected', description: 'the version guard; omit for an unconditional edit.' }, { name: 'signal', description: 'aborts before atomic publication takes effect.' }, { name: 'sandboxPolicy', description: 'the per-call mode and workspace root this edit runs under; a sandboxing backend fences the edit by it, the bare backend ignores it. Omit to leave the backend its own default.' }],
1136
1527
  returns: 'the outcome, including the version the edit produced.',
1137
1528
  },
1529
+ {
1530
+ signature: 'abstract patchText( target: FsTarget, hunks: readonly PatchHunk[], expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>',
1531
+ description: 'Atomically apply parsed hunks to the LF-normalized text and restore the stored line-ending style. A missing or stale target reports `FS_STALE_VERSION`; an unmatched hunk reports `FS_PATCH_MISMATCH`.',
1532
+ parameters: [{ name: 'target', description: 'the resolved regular file to patch.' }, { name: 'hunks', description: 'ordered hunks from `parsePatch`.' }, { name: 'expected', description: 'the version guard; omit for an unconditional patch.' }, { name: 'signal', description: 'aborts before atomic publication takes effect.' }, { name: 'sandboxPolicy', description: 'the per-call mode and workspace root this patch runs under; a sandboxing backend fences the patch by it, the bare backend ignores it. Omit to leave the backend its own default.' }],
1533
+ returns: 'the outcome, including the version the patch produced.',
1534
+ },
1535
+ {
1536
+ signature: 'abstract deleteFile( target: FsTarget, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsDeleteOutcome>',
1537
+ description: 'Remove a regular file. A missing or stale target reports `FS_STALE_VERSION`; a directory or other non-file reports `FS_NOT_REGULAR_FILE`. Resolution has already followed symlinks, so the target is the real file.',
1538
+ parameters: [{ name: 'target', description: 'the resolved file to remove.' }, { name: 'expected', description: 'the version guard; omit for an unconditional removal.' }, { name: 'signal', description: 'aborts before removal.' }, { name: 'sandboxPolicy', description: 'the per-call mode and workspace root this removal runs under; a sandboxing backend fences it, the bare backend ignores it. Omit to leave the backend its own default.' }],
1539
+ returns: 'the bounded LF-normalized removed text, or null when no basis is available.',
1540
+ },
1541
+ {
1542
+ signature: 'abstract moveFile( source: FsTarget, destination: FsTarget, options: { hunks?: readonly PatchHunk[] expectedSource?: { version: FsVersion } expectedDestination?: FsWriteIntent }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsMoveOutcome>',
1543
+ description: 'Publish the source text, optionally patched, at the destination, then remove the source. Both targets stay locked in canonical order. Identical targets report `FS_SAME_TARGET`; the source guard follows `patchText` and the destination guard follows `writeText`. The two effects are separate: a published destination with a retained source is a final outcome reported through `sourceDeleted: false`.',
1544
+ parameters: [{ name: 'source', description: 'the resolved regular source; its line-ending style and mode carry over.' }, { name: 'destination', description: 'the resolved destination within the same provider.' }, { name: 'options', description: 'optional hunks and the source/destination guards; an omitted guard is unconditional.' }, { name: 'signal', description: 'checked before destination staging; the commit then completes both effects.' }, { name: 'sandboxPolicy', description: 'the per-call mode and workspace root both paths run under; a sandboxing backend fences them, the bare backend ignores it. Omit to leave the backend its own default.' }],
1545
+ returns: 'the bounded LF source basis, the destination outcome, and the source-removal status.',
1546
+ },
1138
1547
  ],
1139
1548
  },
1140
1549
  {
@@ -1205,6 +1614,43 @@ export const SERVICE_API = [
1205
1614
  },
1206
1615
  ],
1207
1616
  },
1617
+ {
1618
+ key: 'headlessStartup',
1619
+ summary: 'What the runner row reads from HEADLESS_STARTUP_SERVICE.',
1620
+ description: 'What the runner row reads from HEADLESS_STARTUP_SERVICE.',
1621
+ methods: [
1622
+ {
1623
+ signature: 'task: string | undefined',
1624
+ description: 'The task text this invocation asked for; absent when the runner reads stdin.',
1625
+ parameters: [],
1626
+ },
1627
+ {
1628
+ signature: 'sessionId: string | undefined',
1629
+ description: 'Exact Session identity to adopt; absent for a fresh random identity.',
1630
+ parameters: [],
1631
+ },
1632
+ {
1633
+ signature: 'json: boolean',
1634
+ description: 'Whether stdout carries the machine-readable event stream instead of final text.',
1635
+ parameters: [],
1636
+ },
1637
+ {
1638
+ signature: 'permissionMode?: string',
1639
+ description: 'Permission preset to apply before the task; absent preserves session policy.',
1640
+ parameters: [],
1641
+ },
1642
+ {
1643
+ signature: 'approvalPolicy?: ApprovalPolicy',
1644
+ description: 'Approval behavior applied after the permission preset; absent keeps the current policy.',
1645
+ parameters: [],
1646
+ },
1647
+ {
1648
+ signature: 'additionalWritableRoots?: string[]',
1649
+ description: 'Explicit absolute write grants for this invocation; absent adds no directories.',
1650
+ parameters: [],
1651
+ },
1652
+ ],
1653
+ },
1208
1654
  {
1209
1655
  key: 'hmr',
1210
1656
  summary: 'Hot reload service with Cordis-compatible module configuration and events.',
@@ -1355,6 +1801,85 @@ export const SERVICE_API = [
1355
1801
  },
1356
1802
  ],
1357
1803
  },
1804
+ {
1805
+ key: 'liveshareShares',
1806
+ summary: 'Owner-only Remote surface over the share-management operations.',
1807
+ description: 'Owner-only Remote surface over the share-management operations.\n\nThe Gateway decides each call through remote access, so a `share-viewer` Peer is refused before a method runs; the owner Peer reaches the one implementation that owns each share-management side effect. `create` takes its Session as the `sessionId` of its single request object, so the Session resource kind\'s default resolver names that Session for the call without a reader declared here.',
1808
+ methods: [
1809
+ {
1810
+ signature: '@Remote(\'create\') create(request: CreateShareRequest): Promise<CreatedShare>',
1811
+ description: 'Publish one Session and store the share.',
1812
+ parameters: [{ name: 'request', description: 'Session, title, access, lifetime, and both switches the owner chose.' }],
1813
+ returns: 'The created share\'s link and stored values.',
1814
+ },
1815
+ {
1816
+ signature: '@Remote(\'list\') list(): Promise<OwnerShareList>',
1817
+ description: 'Refresh titles and Liveshare server authority, then list this host\'s shares.',
1818
+ parameters: [],
1819
+ returns: 'Every share this host publishes.',
1820
+ },
1821
+ {
1822
+ signature: '@Remote(\'stop\') stop(request: StopShareRequest): Promise<StopShareResult>',
1823
+ description: 'Stop one share locally, revoke its forks, and delete its row on the Liveshare server when reachable.',
1824
+ parameters: [{ name: 'request', description: 'Share to stop.' }],
1825
+ returns: 'Whether the row on the Liveshare server still needs a retry.',
1826
+ },
1827
+ {
1828
+ signature: '@Remote(\'updatePermissions\') updatePermissions(request: UpdateSharePermissionsRequest): Promise<SharePermissions>',
1829
+ description: 'Change one share\'s tier, fork switch, or both.',
1830
+ parameters: [{ name: 'request', description: 'Share and the switches to change.' }],
1831
+ returns: 'The permissions the share now carries.',
1832
+ },
1833
+ {
1834
+ signature: '@Remote(\'setCapabilities\') setCapabilities(request: SetShareCapabilitiesRequest): Promise<ShareCapabilities>',
1835
+ description: 'Replace one share\'s exposed plugin endpoints.',
1836
+ parameters: [{ name: 'request', description: 'Share and the selection to store.' }],
1837
+ returns: 'The capability selection the share now carries.',
1838
+ },
1839
+ {
1840
+ signature: '@Remote(\'capabilities\') capabilities(): ShareCapabilityOffers',
1841
+ description: 'Read the endpoints plugins currently offer.',
1842
+ parameters: [],
1843
+ returns: 'The live offer list.',
1844
+ },
1845
+ {
1846
+ signature: '@Remote(\'relay\') relay(): OwnerRelayState',
1847
+ description: 'Read the Liveshare server address the owner saved.',
1848
+ parameters: [],
1849
+ returns: 'The current Liveshare server state, with both address fields absent while none is saved.',
1850
+ },
1851
+ {
1852
+ signature: '@Remote(\'setRelay\') setRelay(request: SetRelayRequest): Promise<OwnerRelayState>',
1853
+ description: 'Choose the Liveshare server address later shares publish to.',
1854
+ parameters: [{ name: 'request', description: 'Normalized address or null to clear the saved one.' }],
1855
+ returns: 'The Liveshare server state after the change.',
1856
+ },
1857
+ {
1858
+ signature: '@Remote(\'identity\') identity(request: OwnerIdentityRequest): Promise<OwnerIdentityStatus>',
1859
+ description: 'Report this host\'s owner identity for one Liveshare server address.',
1860
+ parameters: [{ name: 'request', description: 'Address to report, or the effective one when absent.' }],
1861
+ returns: 'The owner identity status, without the credential.',
1862
+ },
1863
+ {
1864
+ signature: '@Remote(\'audit\') audit(request: ShareAuditRequest): Promise<ShareAudit>',
1865
+ description: 'Read the Liveshare server\'s durable audit trail for one share.',
1866
+ parameters: [{ name: 'request', description: 'Share whose audit is read.' }],
1867
+ returns: 'The audit events, or a structured failure when the Liveshare server cannot answer.',
1868
+ },
1869
+ {
1870
+ signature: '@Remote(\'testRelay\') testRelay(): Promise<RelayConnectivityView>',
1871
+ description: 'Check that the effective Liveshare server answers at all.',
1872
+ parameters: [],
1873
+ returns: 'The anonymous connectivity result.',
1874
+ },
1875
+ {
1876
+ signature: '@Remote(\'testPublish\') testPublish(request: TestPublishRequest): Promise<RelayPublishView>',
1877
+ description: 'Register one throwaway share to check whether this host may publish.',
1878
+ parameters: [{ name: 'request', description: 'Session the throwaway registration names.' }],
1879
+ returns: 'The Liveshare server\'s decision about this host\'s credential.',
1880
+ },
1881
+ ],
1882
+ },
1358
1883
  {
1359
1884
  key: 'llm',
1360
1885
  summary: 'The abstract `llm` service: an adapter registry plus a streaming model-call API, interceptable via the `llm/stream` waterfall.',
@@ -1612,8 +2137,8 @@ export const SERVICE_API = [
1612
2137
  },
1613
2138
  {
1614
2139
  key: 'planMode',
1615
- summary: '`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool.',
1616
- description: '`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the stable exit tool. Client carriers expose the projection\'s cropped `{ active, pending }` view.',
2140
+ summary: '`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the conditional exit tool.',
2141
+ description: '`ctx.planMode`: owns logged plan state, applies and narrates selected state at step start, the `plan:policy` section, the `/plan` command, and the conditional exit tool. Client carriers expose the projection\'s cropped `{ active, pending }` view. Agent prompt assembly fails while the projection reader is not ready; callers must await plugin activation before running an agent.',
1617
2142
  methods: [
1618
2143
  {
1619
2144
  signature: 'get(agent: Agent): { active: boolean; pending?: boolean }',
@@ -1634,6 +2159,13 @@ export const SERVICE_API = [
1634
2159
  summary: 'Manage profile files and apply their declared reload lifecycle.',
1635
2160
  description: 'Manage profile files and apply their declared reload lifecycle.',
1636
2161
  methods: [
2162
+ {
2163
+ signature: '@Remote async readBundleDetail(name: string, language: string, options?: { npmFileSources?: NpmFileSource[] }): Promise<BundleDetail>',
2164
+ description: 'Read a bundle\'s long description: the Markdown file its locale `meta.detail` names in `language`, otherwise its README. An installed bundle is read from its directory without network access; an official bundle the installation offers before it is installed is read from the npm file CDNs at its offered version. Nothing is cached.',
2165
+ parameters: [{ name: 'name', description: 'the bundle\'s package name, as `listBundles()` lists it.' }, { name: 'language', description: 'the display language, such as `zh-CN`; documents fall back through its prefixes to English.' }, { name: 'options', description: '`npmFileSources` names npm file CDNs to ask first for an offered bundle, in order, such as the one a Client measured as fastest; configured CDNs it omits follow, and CDNs that are not configured are not asked.' }],
2166
+ returns: 'the document with its origin and path, or `none`.',
2167
+ throws: ['{RemoteError} `plugin-manager/unknown-bundle`, `plugin-manager/invalid-language`, or `plugin-manager/detail-unavailable`.'],
2168
+ },
1637
2169
  {
1638
2170
  signature: '@Remote listVersionExemptions(): { exemptions: Record<string, string[]>; warnings: string[] }',
1639
2171
  description: 'Read exact plugin-version exemptions saved in this profile.',
@@ -1670,6 +2202,18 @@ export const SERVICE_API = [
1670
2202
  parameters: [{ name: 'spec', description: 'One package spec: a registry name, an absolute path, a git address, or a tarball.' }, { name: 'options', description: 'The registry asked first.' }, { name: 'signal', description: 'Ends a registry lookup early.' }],
1671
2203
  returns: 'The package the spec names, or why it is refused.',
1672
2204
  },
2205
+ {
2206
+ signature: '@Remote async listVersions(name: string, options?: ListVersionsOptions, signal?: AbortSignal): Promise<PluginVersionList>',
2207
+ description: 'Read the published versions newer than an installed registry package\'s version, from the first registry that answers. Official bundles follow the DSH version and are not listed.',
2208
+ parameters: [{ name: 'name', description: 'Installed profile dependency name.' }, { name: 'options', description: 'The registry asked first; absent, the one the package was installed from in this process, else the configured one.' }, { name: 'signal', description: 'Ends the lookups early.' }],
2209
+ returns: 'At most `versionListLimit` newer versions, newest first, with their tags, deprecation, bundle declaration, and DSH compatibility, and the registry that answered; or why no list could be read, with every registry asked.',
2210
+ },
2211
+ {
2212
+ signature: '@Remote async updateBundle(name: string, version: string, options?: UpdateBundleOptions): Promise<PluginUpdateResult>',
2213
+ description: 'Replace an installed registry bundle with a newer published version. The target is checked on the registry first: it must exist, declare a bundle, and accept the running DSH version, or nothing changes. With HMR the installed version is removed, so its plugins stop, and the target is installed with the same selection; when that installation fails or is cancelled, the removed version is installed again from the registry it came from. Without HMR the target is installed over the running version and the result reports the restart.',
2214
+ parameters: [{ name: 'name', description: 'Installed profile dependency name.' }, { name: 'version', description: 'Exact published version newer than the installed one.' }, { name: 'options', description: 'The registry asked first, as for `listVersions`, and the request id naming the progress and the target installation\'s logs and cancellation.' }],
2215
+ returns: 'The versions, the last step that ran with its result, and the reinstallation when one ran.',
2216
+ },
1673
2217
  {
1674
2218
  signature: '@Remote setPluginEnabled(id: PluginEntryId, enabled: boolean): Promise<ChangeResult>',
1675
2219
  description: 'Persist a plugin entry\'s desired enablement and apply it on live profiles.',
@@ -1684,7 +2228,7 @@ export const SERVICE_API = [
1684
2228
  },
1685
2229
  {
1686
2230
  signature: '@Remote installBundle(spec: string, options?: InstallBundleOptions): Promise<ChangeResult>',
1687
- description: 'Install a package using the same pnpm implementation as dsh plugin. GitHub repositories get a connection check bounded by githubConnectionTimeoutMs before pnpm starts; only network failures or timeouts stop installation, while pnpm owns authentication and transport fallback. A run that fails, is cancelled, or adds a package without a bundle patch restores `package.json` and `pnpm-lock.yaml` as they were; downloaded files can stay.',
2231
+ description: 'Install a package using the same pnpm implementation as dsh plugin. GitHub repositories get a connection check bounded by githubConnectionTimeoutMs before pnpm starts; only network failures or timeouts stop installation, and a stop streams the check\'s diagnostic as the installation\'s install-log run under its request id, while pnpm owns authentication and transport fallback. An HTTP(S) Git URL on another host is installed over SSH instead when access probes bounded by gitTransportTimeoutMs find that only SSH can read it. A run that fails, is cancelled, or adds a package without a bundle patch restores `package.json` and `pnpm-lock.yaml` as they were; downloaded files can stay.',
1688
2232
  parameters: [{ name: 'spec', description: 'One package spec, including local paths relative to the invocation directory.' }, { name: 'options', description: 'Whether to activate the installed bundle (defaults to true), the request id a cancellation names, the pending build scripts to allow, whether to save an exact dependency, and the registry asked first.' }],
1689
2233
  returns: 'Package-manager diagnostics, the registries asked, and the observed activation outcome.',
1690
2234
  },
@@ -1739,6 +2283,26 @@ export const SERVICE_API = [
1739
2283
  returns: 'the plugin with its default version, installation status, and annotated versions; undefined when the index does not list it.',
1740
2284
  throws: ['{RemoteError} `plugin-market/unknown-index`, `plugin-market/invalid-index-url`, `plugin-market/fetch-failed`, or `plugin-market/invalid-index`.'],
1741
2285
  },
2286
+ {
2287
+ signature: '@Remote async readEntryDetail( url: string, name: string, version: string, language: string, options?: { refresh?: boolean; npmFileSources?: NpmFileSource[] }, ): Promise<PluginDetail>',
2288
+ description: 'Read the long description of one listed version of a plugin market entry, from the version\'s source: the npm file CDNs for a public npm version, or its pinned Git commit. The Markdown file the package\'s locale `meta.detail` names in `language` comes first, then the package\'s README, then the README of the entry\'s `repository`, or for an npm version without one, of its `package.json` `repository`, at the default branch. An npm version from another registry has no readable package files, so only the entry\'s `repository` is read.',
2289
+ parameters: [{ name: 'url', description: 'a configured index URL.' }, { name: 'name', description: 'the plugin\'s package name.' }, { name: 'version', description: 'one listed version.' }, { name: 'language', description: 'the display language, such as `zh-CN`; documents fall back through its prefixes to English.' }, { name: 'options', description: '`refresh` reads again instead of reusing a result cached for `cacheTtlMs`; `npmFileSources` names npm file CDNs to ask first for an npm version, in order; configured CDNs it omits follow, and CDNs that are not configured are not asked.' }],
2290
+ returns: 'the document with its origin and image document id, or `none`.',
2291
+ throws: ['{RemoteError} the failures of `search`, `plugin-market/unknown-plugin` for an unlisted plugin or version, `plugin-market/invalid-query`, or `plugin-market/detail-unavailable`.'],
2292
+ },
2293
+ ],
2294
+ },
2295
+ {
2296
+ key: 'pluginRecommendations',
2297
+ summary: 'Catalog lookups for card text and the enabling behind the `enable_official_plugin` card.',
2298
+ description: 'Catalog lookups for card text and the enabling behind the `enable_official_plugin` card.',
2299
+ methods: [
2300
+ {
2301
+ signature: '@Remote async describe(agent: Agent, callId: ToolCallId): Promise<RecommendationDetails>',
2302
+ description: 'Read the current catalog text for a logged card.',
2303
+ parameters: [{ name: 'agent', description: 'Exact live root resolved by the Gateway from the Session id.' }, { name: 'callId', description: 'The card\'s `propose_action` call id, never a package supplied by the browser.' }],
2304
+ returns: 'the plugin\'s title, description and selection, or a refusal when the card names no available official plugin.',
2305
+ },
1742
2306
  ],
1743
2307
  },
1744
2308
  {
@@ -1826,7 +2390,7 @@ export const SERVICE_API = [
1826
2390
  methods: [
1827
2391
  {
1828
2392
  signature: 'abstract readonly language: string',
1829
- description: 'The source language run expects `program` to be written in, as a lowercase identifier. Informational, not gating — a consumer that generates language-specific presentation (typed SDK stubs, usage instructions) switches on it and fails loud on a language it cannot present. Well-known values: `\'typescript\'` and `\'python\'`, those `dsh-tools` presents; the TypeScript backend is released, the Python backend is experimental and private (not published).',
2393
+ description: 'The source language run expects `program` to be written in, as a lowercase identifier. Informational, not gating — a consumer that generates language-specific presentation (typed SDK stubs, usage instructions) switches on it and fails loud on a language it cannot present. Well-known values: `\'typescript\'` and `\'python\'`, those `dsh-tool-executor-ptc` presents; the TypeScript backend is released, the Python backend is experimental and private (not published).',
1830
2394
  parameters: [],
1831
2395
  },
1832
2396
  {
@@ -1887,7 +2451,7 @@ export const SERVICE_API = [
1887
2451
  },
1888
2452
  {
1889
2453
  signature: 'snapshotFor(principal: Principal): RemoteAccessBaseline',
1890
- description: 'The baseline a page opens with before its snapshot stream connects. A business package rendering a non-owner page assigns this value to REMOTE_ACCESS_SNAPSHOT_KEY after every index injection row, replacing the owner baseline the webServer index carries.',
2454
+ description: 'The baseline a page opens with before its snapshot stream connects; every index the webServer renders carries it under REMOTE_ACCESS_SNAPSHOT_KEY for the Peer the page speaks for.',
1891
2455
  parameters: [{ name: 'principal', description: 'the page\'s caller identity.' }],
1892
2456
  returns: 'the owner baseline for the owner; otherwise the principal\'s current grants.',
1893
2457
  },
@@ -1927,6 +2491,11 @@ export const SERVICE_API = [
1927
2491
  description: 'The absolute `workspace-write` fallback root for calls without a session cwd.',
1928
2492
  parameters: [],
1929
2493
  },
2494
+ {
2495
+ signature: 'readonly additionalWritableRoots: readonly string[] | undefined',
2496
+ description: 'The frozen extra writable directories shared by every resolved policy, or `undefined` for none.',
2497
+ parameters: [],
2498
+ },
1930
2499
  {
1931
2500
  signature: 'resolve(request: SandboxPolicyRequest = {}): SandboxExecutionPolicy',
1932
2501
  description: 'Resolve the complete policy for one capability call. An approved explicit mode outranks the session\'s last `sandbox/mode` event, which outranks the deployment default. A session cwd is its workspace-write boundary; the configured root is the fallback for agentless calls and sessions without a cwd.',
@@ -1943,45 +2512,86 @@ export const SERVICE_API = [
1943
2512
  },
1944
2513
  {
1945
2514
  key: 'schedule',
1946
- summary: 'Shared management service; reads, deletion, and timing edits never activate a Session.',
1947
- description: 'Shared management service; reads, deletion, and timing edits never activate a Session.\n\n`sessionPersistence` is a load-order requirement rather than a directly called service: a delivery commits only when `ctx.sessions.flush()` reports that a `session/flush` listener participated, and the persistence backend providing this service is the plugin that registers that listener.',
2515
+ summary: 'Shared management service; reads and management writes never activate a Session, and only delivery creates or resumes one.',
2516
+ description: 'Shared management service; reads and management writes never activate a Session, and only delivery creates or resumes one.\n\n`sessionPersistence` supplies header-only target validation and the `session/flush` listener that acknowledges durable inbox delivery through `ctx.sessions.flush()`.',
1948
2517
  methods: [
1949
2518
  {
1950
- signature: 'async create(sessionId: SessionId, request: ScheduleCreateRequest, signal?: AbortSignal): Promise<ScheduleRecord>',
1951
- description: 'Create a reminder bound to the caller-selected Session without activating it.\n\nThe request must supply a title; a missing, blank-after-trim, or over-long title rejects with `invalid_prompt` instead of deriving one from the prompt. A Session a delegated child owns rejects with `subagent_session`, because delivery can never reach it: the child is one whose delegation depth is above zero. The record is built from the clock reading taken before the request joins the serialized queue, so a create that waits behind a longer operation keeps its request-time anchor and may already be due when the queue reaches it.',
1952
- parameters: [{ name: 'sessionId', description: 'Original Session receiving the reminder.' }, { name: 'request', description: 'Validated tool selector, required title, and reminder content.' }, { name: 'signal', description: 'Optional cancellation checked before persistence begins, including after FIFO waits.' }],
1953
- returns: 'The durably stored schedule. Cancellation does not roll back an in-flight write.',
2519
+ signature: '@Remote(\'deliveryLimits\') deliveryLimits(): { readonly newSessionIntervalSeconds: number }',
2520
+ description: 'Read effective delivery limits without loading or activating a task.',
2521
+ parameters: [],
2522
+ returns: 'The configured minimum spacing between deliveries that each create a Session, in seconds.',
2523
+ },
2524
+ {
2525
+ signature: '@Remote(\'create\') async remoteCreate(request: ScheduleCreateRequest, signal?: AbortSignal): Promise<ScheduleCatalogEntry>',
2526
+ description: 'Create one task with a Host-generated identity for a human Remote caller.',
2527
+ parameters: [{ name: 'request', description: 'Title, prompt, recurrence, and delivery destination.' }, { name: 'signal', description: 'Cancellation checked before the durable write begins, including after FIFO waits.' }],
2528
+ returns: 'The stored task. Cancellation does not roll back an in-flight write.',
2529
+ },
2530
+ {
2531
+ signature: 'async create( request: ScheduleCreateRequest, actorSessionId?: SessionId, signal?: AbortSignal, ): Promise<ScheduleCatalogEntry>',
2532
+ description: 'Create one task and record the acting Agent\'s Session as involved; the Remote form omits that Session.\n\nThe record is built from the clock reading taken before the request joins the serialized queue. A `session` target must exist and must not belong to a delegated child; a `new_once` target reserves its Session identity.',
2533
+ parameters: [{ name: 'request', description: 'Title, prompt, recurrence, and delivery destination.' }, { name: 'actorSessionId', description: 'Session of the acting Agent, or undefined for a human caller.' }, { name: 'signal', description: 'Cancellation checked before the durable write begins, including after FIFO waits.' }],
2534
+ returns: 'The stored task. Cancellation does not roll back an in-flight write.',
1954
2535
  },
1955
2536
  {
1956
- signature: '@Remote(\'list\') async list(request: ScheduleListRequest): Promise<ScheduleRecord[]>',
1957
- description: 'Read the selected Session\'s active tasks without resuming its Agent.',
1958
- parameters: [{ name: 'request', description: 'Session whose task list is requested.' }],
1959
- returns: 'Persisted reminders in storage order.',
2537
+ signature: 'async list(request: ScheduleListRequest = {}): Promise<ScheduleListResult>',
2538
+ description: 'Read one page of Host tasks without activating target Sessions.',
2539
+ parameters: [{ name: 'request', description: 'Optional activity filter, page size, and offset.' }],
2540
+ returns: 'The requested page and total matching task count.',
2541
+ },
2542
+ {
2543
+ signature: '@Remote(\'list\') async remoteList(request: ScheduleListRequest): Promise<ScheduleListResult>',
2544
+ description: 'Remote form of the shared Host-wide list.',
2545
+ parameters: [{ name: 'request', description: 'Optional activity filter, page size, and offset.' }],
2546
+ returns: 'The requested page and total matching task count.',
1960
2547
  },
1961
2548
  {
1962
2549
  signature: '@Remote(\'catalog\') async catalog(): Promise<ScheduleCatalogEntry[]>',
1963
- description: 'Read all active and inactive Host reminders with their original Session bindings. A deleted reminder has no row, so it is absent here. Does not activate Sessions or read Session history.',
2550
+ description: 'Read every Host task without a page bound or Session activation.',
1964
2551
  parameters: [],
1965
- returns: 'Reminders ordered by scheduledAt ascending, then lexicographically by id.',
2552
+ returns: 'All tasks, active first, with target and execution metadata.',
2553
+ },
2554
+ {
2555
+ signature: '@Remote(\'view\') async view(request: ScheduleViewRequest): Promise<ScheduleViewResult>',
2556
+ description: 'Read one task without activating its target Sessions.',
2557
+ parameters: [{ name: 'request', description: 'Task identity.' }],
2558
+ returns: 'The task, or a non-mutating miss.',
1966
2559
  },
1967
2560
  {
1968
- signature: '@Remote(\'history\') async history(request: ScheduleDeliveryHistoryRequest): Promise<ScheduleDeliveryHistoryResult>',
1969
- description: 'Read saved inbox deliveries without activating or reading the original Session. The task\'s own row supplies its binding, so its records stay readable through this lookup.',
1970
- parameters: [{ name: 'request', description: 'Session binding, task identity, explicit limit, and optional exclusive message cursor.' }],
2561
+ signature: 'async history(request: ScheduleDeliveryHistoryRequest): Promise<ScheduleDeliveryHistoryResult>',
2562
+ description: 'Read one page of saved deliveries without activating or reading a target Session.',
2563
+ parameters: [{ name: 'request', description: 'Task identity, explicit page size, and optional exclusive cursor.' }],
2564
+ returns: 'Newest-first saved deliveries, or a task/cursor lookup failure.',
2565
+ },
2566
+ {
2567
+ signature: '@Remote(\'history\') async remoteHistory(request: ScheduleDeliveryHistoryRequest): Promise<ScheduleDeliveryHistoryResult>',
2568
+ description: 'Remote form of the target-based ScheduleService.history; an invalid limit rejects with `schedule/input-invalid`.',
2569
+ parameters: [{ name: 'request', description: 'Task identity, explicit limit, and optional exclusive message cursor.' }],
1971
2570
  returns: 'Newest-first deliveries in append order, or a task/cursor lookup failure.',
1972
- throws: ['ScheduleInputError when limit is not a safe integer from 1 through 100.'],
1973
2571
  },
1974
2572
  {
1975
- signature: '@Remote(\'delete\') async delete(request: ScheduleDeleteRequest, signal?: AbortSignal): Promise<ScheduleDeleteResult>',
1976
- description: 'Delete one task belonging to the selected Session, leaving queued messages intact.\n\nThe row is removed: the task no longer schedules, leaves `list` and `catalog`, and its saved delivery records go with it. A task bound to a Session a delegated child owns stays deletable even though creation and timing edits refuse that binding, so a task stored before that rule existed remains removable.',
1977
- parameters: [{ name: 'request', description: 'Session and exact task identity.' }, { name: 'signal', description: 'Optional cancellation checked before persistence begins, including after FIFO waits.' }],
1978
- returns: 'Whether that Session owned a deleted task. Cancellation does not roll back an in-flight write.',
2573
+ signature: '@Remote(\'run\') async run(request: ScheduleRunRequest, signal?: AbortSignal): Promise<ScheduleRunResult>',
2574
+ description: 'Deliver one task now without consuming or moving its scheduled occurrence; an archived destination Session rejects with `schedule/target-archived`.',
2575
+ parameters: [{ name: 'request', description: 'Task identity.' }, { name: 'signal', description: 'Cancellation checked after entering the delivery transaction and before delivery.' }],
2576
+ returns: 'Task state after Session persistence acknowledged the delivery, `schedule_execution_pending` while another execution of the task is queued, running, or inside its delivery floor, or a non-mutating miss.',
2577
+ },
2578
+ {
2579
+ signature: '@Remote(\'deleteInactive\') async deleteInactive(): Promise<ScheduleDeleteInactiveResult>',
2580
+ description: 'Delete every ended Host task, leaving active tasks armed.\n\nEnded tasks never schedule another delivery, so the removal changes no pending target and no timer is recomputed. Rows are enumerated and removed in one FIFO slot, so a delivery ordered behind this call ends its task after the enumeration rather than during it. The batch is one domain write: a normal failure rejects with every listed row still stored, while a backend `unknown-state` failure may have removed rows and quarantines the Host domain, so later schedule operations reject until the domain is reopened. A successful nonempty batch emits `schedule/changed` without Agent notices. A rejected batch announces `schedule/changed` because it does not establish which rows landed, and clients then re-read the catalog.',
2581
+ parameters: [],
2582
+ returns: 'Count of removed rows; zero when the Host held no ended task.',
2583
+ },
2584
+ {
2585
+ signature: '@Remote(\'edit\') async remoteEdit(request: ScheduleEditRequest, signal?: AbortSignal): Promise<ScheduleEditResult>',
2586
+ description: 'Update or delete one task for a human Remote caller; an invalid patch rejects with `schedule/input-invalid`.',
2587
+ parameters: [{ name: 'request', description: 'Task identity and one update or delete operation.' }, { name: 'signal', description: 'Cancellation checked before the durable write begins, including after FIFO waits.' }],
2588
+ returns: 'The updated task, the deletion outcome, or a non-mutating miss or conflict.',
1979
2589
  },
1980
2590
  {
1981
- signature: '@Remote(\'update\') async update(request: ScheduleUpdateRequest, signal?: AbortSignal): Promise<ScheduleUpdateResult>',
1982
- description: 'Update the name, instruction, and timing of an active task within the original Session binding without activating the Session or changing saved deliveries.\n\nEach supplied field replaces its stored value; an omitted field keeps it. A name or instruction change alone does not reset the committed target. A Session a delegated child owns returns the non-mutating `subagent_session` result, so an edit cannot re-arm a task bound to a Session delivery can never reach, and the Web editor can explain the refusal through the ordinary result it already renders.',
1983
- parameters: [{ name: 'request', description: 'Task binding, complete observed record, and any combination of timing, name, and instruction.' }, { name: 'signal', description: 'Cancellation checked after domain readiness and FIFO waits, before persistence begins.' }],
1984
- returns: 'The committed record, unchanged record for a no-op, or a non-mutating input/lookup/conflict/refusal result. Storage and lifecycle failures reject; cancellation after a write starts does not roll it back.',
2591
+ signature: 'async edit( request: ScheduleEditRequest, actorSessionId?: SessionId, signal?: AbortSignal, ): Promise<ScheduleEditResult>',
2592
+ description: 'Update or delete one task and record the acting Agent\'s Session as involved; the Remote form omits that Session.\n\nAn update applies every patch field in one write and recomputes the next occurrence when the rule changes or the task resumes. A supplied `expectedUpdatedAt` that differs from the stored value returns `schedule_conflict`.',
2593
+ parameters: [{ name: 'request', description: 'Task identity and one update or delete operation.' }, { name: 'actorSessionId', description: 'Session of the acting Agent, or undefined for a human caller.' }, { name: 'signal', description: 'Cancellation checked before the durable write begins, including after FIFO waits.' }],
2594
+ returns: 'The updated task, the deletion outcome, or a non-mutating miss or conflict.',
1985
2595
  },
1986
2596
  ],
1987
2597
  },
@@ -1996,12 +2606,6 @@ export const SERVICE_API = [
1996
2606
  parameters: [{ name: 'sessionId', description: 'Session identity whose Agent owns the operation.' }],
1997
2607
  returns: 'the live Agent or the stable Session-domain failure.',
1998
2608
  },
1999
- {
2000
- signature: 'inspect( sessionId: SessionId, signal?: AbortSignal, ): Promise<SessionInspection>',
2001
- description: 'Inspect one attached or persisted Session without activating its Agent.',
2002
- parameters: [{ name: 'sessionId', description: 'durable Session identity.' }, { name: 'signal', description: 'optional caller cancellation for persistence reads.' }],
2003
- returns: 'the current attached state or persisted header and event prefix.',
2004
- },
2005
2609
  {
2006
2610
  signature: '@Remote(\'list\') async list(_request: SessionListRequest, signal: AbortSignal): Promise<SessionListValue>',
2007
2611
  description: 'Read all visible Session rows without resuming an Agent.',
@@ -2084,8 +2688,8 @@ export const SERVICE_API = [
2084
2688
  },
2085
2689
  {
2086
2690
  signature: '@Remote(\'attachment\') attachment(request: SessionAttachmentRequest): Promise<SessionAttachmentValue>',
2087
- description: 'Read one image proven reachable from the addressed Session log.',
2088
- parameters: [{ name: 'request', description: 'Session and attachment identities used for authorization.' }],
2691
+ description: 'Read one image from the attachment store after gateway authorization.',
2692
+ parameters: [{ name: 'request', description: 'image reference and gateway permission scope; Session existence is not checked.' }],
2089
2693
  returns: 'the durable attachment reference and base64-encoded bytes.',
2090
2694
  },
2091
2695
  {
@@ -2101,19 +2705,49 @@ export const SERVICE_API = [
2101
2705
  returns: 'acknowledgement that cancellation was requested.',
2102
2706
  },
2103
2707
  {
2104
- signature: '@Remote({ name: \'page\', resources: { session: addressedSession } }) page(request: SessionPageRequest, signal: AbortSignal): Promise<SessionPage>',
2708
+ signature: '@Remote events(request: SessionPageRequest, signal: AbortSignal): Promise<SessionEventsPage>',
2105
2709
  description: 'Read one cold-safe, message-aligned Session history page.',
2106
- parameters: [{ name: 'request', description: 'durable address, backward cursor, and page budget.' }, { name: 'signal', description: 'cancellation for persistence reads.' }],
2107
- returns: 'one chronological page.',
2710
+ parameters: [{ name: 'request', description: 'durable address, optional fixed cut, backward cursor, and page budget.' }, { name: 'signal', description: 'cancellation for persistence reads.' }],
2711
+ returns: 'one chronological page with its inclusive cursor.',
2108
2712
  },
2109
2713
  {
2110
- signature: '@Remote({ mode: \'stream\', resources: { session: addressedSession } }) follow(request: SessionFollowRequest, signal: AbortSignal): AsyncIterable<SessionFollowFrame>',
2714
+ signature: '@Remote({ mode: \'stream\' }) observeEvent(request: SessionObserveEventRequest, signal: AbortSignal): AsyncIterable<SessionEventFrame>',
2715
+ description: 'Subscribe to Session events without reading a snapshot.',
2716
+ parameters: [{ name: 'request', description: 'Session address.' }, { name: 'signal', description: 'subscription cancellation.' }],
2717
+ returns: 'readiness and subsequent events, without a snapshot.',
2718
+ },
2719
+ {
2720
+ signature: '@Remote({ mode: \'stream\' }) observeProjections(request: SessionProjectionsRequest, signal: AbortSignal): AsyncIterable<SessionProjectionFrame>',
2721
+ description: 'Subscribe to Session projection changes.',
2722
+ parameters: [{ name: 'request', description: 'target Session.' }, { name: 'signal', description: 'subscription cancellation.' }],
2723
+ returns: 'readiness followed by one projection change frame per committed event.',
2724
+ },
2725
+ {
2726
+ signature: '@Remote state(request: SessionStateRequest, signal: AbortSignal): Promise<SessionState>',
2727
+ description: 'Read passive Session state.',
2728
+ parameters: [{ name: 'request', description: 'target Session.' }, { name: 'signal', description: 'read cancellation.' }],
2729
+ returns: 'current passive state.',
2730
+ },
2731
+ {
2732
+ signature: '@Remote({ mode: \'stream\' }) observeState(request: SessionStateRequest, signal: AbortSignal): AsyncIterable<SessionState>',
2733
+ description: 'Subscribe to complete Session state replacements.',
2734
+ parameters: [{ name: 'request', description: 'target Session.' }, { name: 'signal', description: 'subscription cancellation.' }],
2735
+ returns: 'complete passive state replacements.',
2736
+ },
2737
+ {
2738
+ signature: '@Remote wait(request: SessionWaitRequest, signal: AbortSignal): Promise<SessionWaitValue>',
2739
+ description: 'Wait for Session quiescence or pending input with bounded assistant output.',
2740
+ parameters: [{ name: 'request', description: 'Session, wait bounds and output window.' }, { name: 'signal', description: 'caller cancellation.' }],
2741
+ returns: 'stopping state and bounded assistant output.',
2742
+ },
2743
+ {
2744
+ signature: '@Remote({ mode: \'stream\' }) follow(request: SessionFollowRequest, signal: AbortSignal): AsyncIterable<SessionFollowFrame>',
2111
2745
  description: 'Follow one Session log from its opening or resume cursor.',
2112
2746
  parameters: [{ name: 'request', description: 'durable address and last committed sequence already held by the caller.' }, { name: 'signal', description: 'cancellation owned by the Remote stream carrier.' }],
2113
2747
  returns: 'a complete opening snapshot followed by gap-free durable event frames and optional cursorless assistant-stream frames.',
2114
2748
  },
2115
2749
  {
2116
- signature: '@Remote(\'projections\') async projections(request: SessionProjectionsRequest, signal: AbortSignal): Promise<SessionProjectionsValue>',
2750
+ signature: '@Remote(\'projections\') projections(request: SessionProjectionsRequest, signal: AbortSignal): Promise<SessionProjectionsValue>',
2117
2751
  description: 'Read exact projections, returning cached hints only when migration is required.',
2118
2752
  parameters: [{ name: 'request', description: 'Session whose current values are required.' }, { name: 'signal', description: 'cancellation for the Session read.' }],
2119
2753
  returns: 'a sequenced baseline, cached hints when migration is deferred, or null when absent.',
@@ -2152,6 +2786,19 @@ export const SERVICE_API = [
2152
2786
  },
2153
2787
  ],
2154
2788
  },
2789
+ {
2790
+ key: 'sessionLogDeepSeek',
2791
+ summary: 'Incremental Session-log contributor with caller-owned upload exclusions.',
2792
+ description: 'Incremental Session-log contributor with caller-owned upload exclusions.',
2793
+ methods: [
2794
+ {
2795
+ signature: 'registerExclusion(exclude: SessionLogUploadExclusion): () => Promise<void>',
2796
+ description: 'Exclude matching requests before reading or preparing their log contribution. Any matching rule suppresses both the field and its acceptance callback. With no matching rules, normal upload eligibility applies. A throwing rule fails this contribution; the request-extension registry omits it and reports the error.',
2797
+ parameters: [{ name: 'exclude', description: 'synchronous, side-effect-free predicate; `true` skips this upload.' }],
2798
+ returns: 'effect disposer that removes this registration when called or when the caller unloads.',
2799
+ },
2800
+ ],
2801
+ },
2155
2802
  {
2156
2803
  key: 'sessionPersistence',
2157
2804
  summary: 'Durable append-only session storage addressed through per-session handles.',
@@ -2203,7 +2850,7 @@ export const SERVICE_API = [
2203
2850
  description: 'The persisted projection cache service. Opens the `session_projcache` domain at init, checkpoints live sessions on a throttled write-behind (count/interval triggers from Config) plus three mandatory points — session creation, `turn/end`, and session disposal (the live-to-cold moment) — and serves the cached rows for a session header. Every durable write is fail-soft: failures log a warning and the cache self-heals on the next write.',
2204
2851
  methods: [
2205
2852
  {
2206
- signature: 'cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined',
2853
+ signature: 'cachedSnapshot( meta: SessionHeader, keys?: ProjectionKeySelection, ): ProjectionSnapshot | undefined',
2207
2854
  description: 'The zero-I/O listing read: whole values viewed straight from the stored rows (version-matching keys only) of the record bound to the caller\'s lifecycle. The header is the only identity witness a listing holds, so this face matches the lifecycle identity (`formatVersion`, `createdAt`, `cwd`, `isSeeded`) and not the inherited cut: within one format generation the cut is fixed at fork time, so it distinguishes no lifecycle the other fields do not, and a viewed value never seeds a fold. The view is as stale as the last durable checkpoint but never wrong and never from an unrelated log. Its `asOfSeq` is the lowest watermark among the served rows: the stored record\'s own position, which the header cannot relate to the log the caller later opens. The Session list therefore labels the block as cached, and the client lets every value the connected Session produces supersede it whatever this number says.',
2208
2855
  parameters: [{ name: 'meta', description: 'the listed session\'s header (identity witness; no log read).' }, { name: 'keys', description: 'optional projection keys required by the caller\'s audience.' }],
2209
2856
  returns: 'the viewed block, or `undefined` when no usable row exists for this lifecycle at the current Session format.',
@@ -2237,19 +2884,19 @@ export const SERVICE_API = [
2237
2884
  {
2238
2885
  key: 'sessionProjections',
2239
2886
  summary: '`ctx.sessionProjections`: the projection unit table and its drive.',
2240
- description: '`ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit\'s `apply` (eager drive). A changed state reference computes the next client view; the change feed is notified only when its raw result changes by `Object.is`. Cells build lazily — a unit registered after events flowed, or a session older than the registry, folds `init` over the in-memory log on first touch (event or read). Registration is an effect (disposer rides the calling fiber): an unloaded domain plugin\'s key disappears from snapshots and clients read it as capability absence. A host reader either declares `sessionProjections` in its plugin `inject` or fails explicitly when the registry or required key is absent. Contributors may preserve optional registration through `ctx.inject([\'sessionProjections\'], ...)`. Registrants sharing a key share one unit and are counted: the same tool package mounted in N agent presets registers N times, and the key survives until the last one unloads.',
2887
+ description: '`ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit\'s `apply` (eager drive). A changed state reference computes the next client view; the change feed is notified only when its raw result changes by `Object.is`. Cells build lazily — a unit registered after events flowed, or a session older than the registry, folds `init` over the in-memory log on first touch (event or read). Consumers declare `sessionProjections` as a required injection, await registration during activation, and retain its ready handle. Registrants sharing a key share one unit and are counted. The last release removes the unit from live drives, restores, and client snapshots, while checkpoints keep each Session\'s last cell of it until the key registers again and the new unit refolds the log; retained handles still fold new events on demand using the original unit.',
2241
2888
  methods: [
2242
2889
  {
2243
- signature: 'register< K extends keyof SessionProjectionMap, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, \'wire\'> & { wire: NonNullable<ProjectionDefinition<K, S>[\'wire\']> }, ): () => void',
2244
- description: 'Register one domain\'s unit. The registration is an effect on the calling context\'s fiber: disposing the fiber (or calling the returned disposer) removes the key — and the unit\'s cached cells — from subsequent drives and snapshots.',
2890
+ signature: 'register<K extends keyof SessionProjectionMap, S>( definition: Omit<ProjectionDefinition<K, S>, \'wire\'> & { wire: NonNullable<ProjectionDefinition<K, S>[\'wire\']> }, ): Promise<ProjectionHandle<S>>',
2891
+ description: 'Register one domain\'s unit on the calling context\'s fiber. Fiber or handle disposal releases one reference; the final release removes live participation. Retained handles remain readable after release. Callers must await registration before publishing consumers; registration may perform asynchronous work.',
2245
2892
  parameters: [{ name: 'definition', description: 'key, state schema, pure unit functions, and stateVersion.' }],
2246
- returns: 'the exact disposer that unregisters this unit.',
2893
+ returns: 'an awaitable yielding a ready handle; the callable runtime value is deprecated.',
2247
2894
  },
2248
2895
  {
2249
- signature: 'register< K extends Exclude<keyof SessionProjectionStateMap, keyof SessionProjectionMap>, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, \'wire\'>, ): () => void',
2250
- description: 'Register one host-only unit. Its state is omitted from client snapshots and always checkpointed like every other unit.',
2896
+ signature: 'register<K extends string, S>( definition: ProjectionDefinition<K, S> & { key: Exclude<K, keyof SessionProjectionMap> }, ): Promise<ProjectionHandle<S>>',
2897
+ description: 'Register one host-only unit. Its state is omitted from client snapshots and always checkpointed like every other unit. Callers must await registration before publishing consumers; registration may perform asynchronous work.',
2251
2898
  parameters: [{ name: 'definition', description: 'key, state schema, pure unit functions, and stateVersion.' }],
2252
- returns: 'the exact disposer that unregisters this unit.',
2899
+ returns: 'an awaitable yielding a ready handle; the callable runtime value is deprecated.',
2253
2900
  },
2254
2901
  {
2255
2902
  signature: 'onChanged(listener: ProjectionChangeListener): () => void',
@@ -2258,37 +2905,37 @@ export const SERVICE_API = [
2258
2905
  returns: 'the exact disposer that unsubscribes.',
2259
2906
  },
2260
2907
  {
2261
- signature: 'stateOf<K extends keyof SessionProjectionStateMap>( session: Session, key: K, ): SessionProjectionStateMap[K] | undefined',
2262
- description: 'Read one unit\'s current host state after materializing every registered unit at the Session cursor. Unrelated wire views are not produced. The returned value is live; callers must not mutate it.',
2263
- parameters: [{ name: 'session', description: 'the session whose state is read.' }, { name: 'key', description: 'the registered unit key.' }],
2264
- returns: 'current state, or `undefined` when the key is not registered.',
2908
+ signature: 'onEventChanged(listener: ProjectionEventChangeListener): () => void',
2909
+ description: 'Subscribe to the event-level change feed. The registration is an effect on the calling context\'s fiber. The listener runs synchronously inside the committed event\'s `session/event` handling, once after every unit has been driven and after every onChanged call for that event. If a unit or an onChanged listener throws during that drive, the listener still receives the changes made before the throw.',
2910
+ parameters: [{ name: 'listener', description: 'called once per committed event that changed at least one client-visible unit\'s raw view by `Object.is`.' }],
2911
+ returns: 'the exact disposer that unsubscribes.',
2265
2912
  },
2266
2913
  {
2267
- signature: 'snapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot',
2268
- description: 'One consistent cut over every registered client-visible unit for one session, read from the watermark cache (missing cells fold lazily over the in-memory log). Fully synchronous — every value and `asOfSeq` reflect the same log position. Each value passes its unit\'s `viewSchema` before leaving.',
2269
- parameters: [{ name: 'session', description: 'the session whose projection values are read.' }, { name: 'keys', description: 'optional client-visible outputs; state materialization remains complete.' }],
2914
+ signature: 'snapshot( session: Session, keys?: ProjectionKeySelection, ): ProjectionSnapshot',
2915
+ description: 'One consistent cut over every registered client-visible unit for one session, read from the watermark cache (missing cells fold lazily over the in-memory log). Only the returned units are computed: other units, including Host-only units without `wire`, are neither folded nor advanced by this read. Fully synchronous — every value and `asOfSeq` reflect the same log position. Each value passes its unit\'s `viewSchema` before leaving.',
2916
+ parameters: [{ name: 'session', description: 'the session whose projection values are read.' }, { name: 'keys', description: 'optional client-visible outputs; only these units are computed.' }],
2270
2917
  returns: 'the snapshot; `values` is empty when no selected client-visible unit is registered.',
2271
2918
  },
2272
2919
  {
2273
- signature: 'cachedSnapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined',
2274
- description: 'Read only already-materialized client-visible cells without folding history. Values may trail the live Session and are therefore hints, not a complete baseline. Missing cells are omitted.',
2275
- parameters: [{ name: 'session', description: 'attached Session whose cached cells are inspected.' }, { name: 'keys', description: 'optional wire keys to view.' }],
2276
- returns: 'the lowest common cached cut, or `undefined` when no wire cell exists.',
2920
+ signature: 'summaryKeys(): ReadonlySet<Extract<keyof SessionProjectionMap, string>>',
2921
+ description: 'The keys a Session summary carries: every registered client-visible key whose unit does not declare `summary: false`. The returned set is stable — the same instance on every call — until a registration or its disposal changes the key table, so a consumer may hold it across rows. Callers pass it to a key-taking read face such as `snapshot(session, summaryKeys())` or `viewCheckpoint(rows, summaryKeys())`; those faces use the set as-is.',
2922
+ parameters: [],
2923
+ returns: 'the current summary key set; do not mutate it.',
2277
2924
  },
2278
2925
  {
2279
2926
  signature: 'checkpoint(session: Session): ProjectionCheckpoint',
2280
- description: 'State-level checkpoint of every persisted unit for one session, read from the watermark cache (missing cells fold lazily over the in-memory log). This is the write side of the persisted projection cache: the returned rows are the `(key → {ver, seq, val})` part of the durable `(sessionId, key, ver, seq, val)` rows. Every `val` is a DETACHED structured clone — never the live cell reference: the watermark cache is this registry\'s authoritative mutable state, and a caller reaching the live reference could corrupt every subsequent snapshot and frame through it (plain JSON by the unit contract, so the clone is total).',
2927
+ description: 'State-level checkpoint of every persisted unit for one session, read from the watermark cache (missing cells fold lazily over the in-memory log). This is the write side of the persisted projection cache: the returned rows are the `(key → {ver, seq, val})` part of the durable `(sessionId, key, ver, seq, val)` rows. Every `val` is a DETACHED structured clone — never the live cell reference: the watermark cache is this registry\'s authoritative mutable state, and a caller reaching the live reference could corrupt every subsequent snapshot and frame through it (plain JSON by the unit contract, so the clone is total). A released unit contributes the Session\'s last cell. The registry no longer advances that cell, while a retained handle read still advances it forward, so a writer running after a plugin unloads keeps that unit\'s latest state; a Session that has no cell of it gets no row. restore folds only live units, so its refreshed rows omit released units.',
2281
2928
  parameters: [{ name: 'session', description: 'the session whose unit states are checkpointed.' }],
2282
- returns: 'one row per registered key.',
2929
+ returns: 'one row per registered key, plus one per released key with a cell for this Session.',
2283
2930
  },
2284
2931
  {
2285
2932
  signature: 'restoreFloor(checkpoint: ProjectionCheckpoint): SessionLogOffset | undefined',
2286
2933
  description: 'The stored seq a restore tail read over `checkpoint` must start at: one event BELOW the lowest usable watermark (a row is usable when its `ver` matches the live unit\'s `stateVersion`; an absent or mismatched row pulls the floor to `0` — that key must refold the full log). The one-below anchor is load-bearing: the tail then proves how far the stored log still extends, so restore can detect a log that shrank below a row\'s watermark (crash-repair truncation) instead of serving the stale row as current — an empty tail read from the anchor yields an end below every watermark and the restore rejects for a full re-read.',
2287
2934
  parameters: [{ name: 'checkpoint', description: 'persisted rows for one session (possibly stale or empty).' }],
2288
- returns: 'the offset for the stored-log suffix read (`SessionHandle.read`), or `undefined` when no unit is registered (no read needed — {@link restore} would serve empty values regardless).',
2935
+ returns: 'the offset for the stored-log suffix read (`SessionHandle.read`), or `undefined` when no live unit is registered (released predecessors do not count; no read needed — {@link restore} would serve empty values regardless).',
2289
2936
  },
2290
2937
  {
2291
- signature: 'viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): Partial<SessionProjectionMap>',
2938
+ signature: 'viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: ProjectionKeySelection, ): Partial<SessionProjectionMap>',
2292
2939
  description: 'View a checkpoint\'s rows without any log read: for every registered client-visible unit whose row\'s `ver` matches, serve the schema-validated `view` of the schema-validated stored state; mismatched, malformed, or absent rows leave their key absent (a cold or listing consumer treats it as not-yet-available and a fuller read path refolds it). The zero-I/O rung of the read ladder — values are as stale as their rows, never wrong.',
2293
2940
  parameters: [{ name: 'checkpoint', description: 'persisted rows for one session (possibly stale or empty).' }, { name: 'keys', description: 'optional wire keys to view.' }],
2294
2941
  returns: 'whole values per key with a usable row; empty when none.',
@@ -2297,7 +2944,7 @@ export const SERVICE_API = [
2297
2944
  signature: 'restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, header: SessionHeader, inheritedEventCount: SessionLogOffset, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }',
2298
2945
  description: 'Cold read: fold every persisted unit over a stored log suffix, seeding each from its checkpoint row when usable — the one read recipe (cached state + forward tail replay + `view`) applied without a live `Session`. Call with the stored events at or past `restoreFloor(checkpoint)` (a `SessionHandle.read` slice) and that same floor as `baseSeq`; the floor\'s one-below anchor makes the supplied end honest, so a shrunk log is detected here. A row is usable iff its `ver` matches the live unit\'s `stateVersion`, it does not predate `baseSeq` (`seq >= baseSeq - 1`), and it does not claim events past the supplied end (`seq <= endSeq`); an unusable row is discarded and its key refolds from `init` — which is only sound over the full log, so a discarded row with `baseSeq > 0` throws (the caller re-reads from seq 0, e.g. after a crash-repair truncation shrank the log below a row\'s watermark).',
2299
2946
  parameters: [{ name: 'checkpoint', description: 'persisted rows for one session (possibly stale or empty).' }, { name: 'events', description: 'the stored events with `seq >= baseSeq`, in seq order.' }, { name: 'baseSeq', description: 'the seq `events` starts at (its first event\'s seq when non-empty).' }, { name: 'header', description: 'immutable metadata for the Session being restored.' }, { name: 'inheritedEventCount', description: 'exact fork-inherited prefix length supplied to unit initialization.' }],
2300
- returns: 'the snapshot cut at the supplied log end (`asOfSeq` is the last supplied event\'s seq, `baseSeq - 1` for an empty tail) plus the refreshed checkpoint rows at that cut, ready for a durable write-back.',
2947
+ returns: 'the snapshot cut at the supplied log end (`asOfSeq` is the last supplied event\'s seq, `baseSeq - 1` for an empty tail) plus the refreshed checkpoint rows at that cut, ready for a durable write-back. The rows cover live units only: a released unit has no cell for a log folded without a live `Session`, so a write-back of them omits it.',
2301
2948
  },
2302
2949
  {
2303
2950
  signature: 'hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, ): ProjectionSnapshot',
@@ -2426,9 +3073,9 @@ export const SERVICE_API = [
2426
3073
  returns: 'mention-carrying candidates in rank order.',
2427
3074
  },
2428
3075
  {
2429
- signature: 'async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], signal?: AbortSignal, ): Promise<PreparedReferencedMessage>',
2430
- description: 'Snapshot all references for one accepted direct message and return one aggregated durable context. Automatic budgets use the last assembled route, or agent options before any assembly. Missing model capacity or adapter uses 64 KiB; other metadata lookup failures and cancellation reject preparation. Truncated previews include omission facts and a full-snapshot spill locator, or an explicit unavailable notice. Cancellation prevents context publication, including when storage completes after cancellation.',
2431
- parameters: [{ name: 'agent', description: 'target agent; references to it are rejected.' }, { name: 'content', description: 'already host-normalized readable message content.' }, { name: 'references', description: 'structured source sessions in mention order.' }, { name: 'signal', description: 'optional cancellation boundary for the active turn.' }],
3076
+ signature: 'async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], route: Readonly<Pick<LlmCallConfig, \'provider\' | \'model\'>>, signal?: AbortSignal, ): Promise<PreparedReferencedMessage>',
3077
+ description: 'Snapshot all references for one accepted direct message and return one aggregated durable context. Automatic budgets use the context capacity of `route`. Missing model capacity or adapter uses 64 KiB; other metadata lookup failures and cancellation reject preparation. Truncated previews include omission facts and a full-snapshot spill locator, or an explicit unavailable notice. Cancellation prevents context publication, including when storage completes after cancellation.',
3078
+ parameters: [{ name: 'agent', description: 'target agent; references to it are rejected.' }, { name: 'content', description: 'already host-normalized readable message content.' }, { name: 'references', description: 'structured source sessions in mention order.' }, { name: 'route', description: 'provider and model whose context capacity sizes the previews.' }, { name: 'signal', description: 'optional cancellation boundary for the active turn.' }],
2432
3079
  returns: 'detached content and optional referenced-session context.',
2433
3080
  },
2434
3081
  ],
@@ -2456,19 +3103,19 @@ export const SERVICE_API = [
2456
3103
  signature: 'prepare(id?: SessionId, options?: PrepareSessionOptions): Session',
2457
3104
  description: 'Build a session WITHOUT entering it into the store — validate the id/cwd and construct the Session (with its immutable SessionHeader). Pairs with enter + announce: a caller that owns a composite `ctx.effect` (the agent factory) folds the session lifecycle into that ONE effect so a fiber unload tears the session + agent down as a single ORDERED chain rather than as racing sibling effects — which would remove the publication hooks before the driver\'s closing events commit, dropping them.',
2458
3105
  parameters: [{ name: 'id', description: 'the session id; omitted, the store mints `session-<n>`.' }, { name: 'options', description: 'seed events and/or creation metadata for the header. With `eventState`, every seed event is either independently owned or any shared value is deeply frozen; {@link Session.fromRestore} validates and adopts those values without copying or freezing them.' }],
2459
- returns: 'the constructed session, NOT yet in the store.',
3106
+ returns: 'the store-owned session, not yet entered and read-only until announced.',
2460
3107
  throws: ['if a session with `id` already exists, metadata is not a plain lossless-JSON record with valid scalar fields, or `meta.cwd` is a non-absolute path.'],
2461
3108
  },
2462
3109
  {
2463
3110
  signature: 'enter(session: Session): () => void',
2464
- description: 'Enter a prepared session into the store: install the module-private append publication hooks and add it to the store. Returns the DETACH disposer (hooks + store removal). Does NOT emit `session/created` — the caller yields this disposer inside its effect and THEN calls announce, so a throwing `session/created` listener rolls the attach back instead of leaking it.\n\nRe-checks the id for a duplicate: `prepare` and `enter` are public cross-package primitives and a caller may interleave arbitrary work (or another create) between them, so a stale prepared session must NOT overwrite a live store entry of the same id — its detach disposer would later delete the REAL session. The create convenience and the agent factory call the two back-to-back so they never trip this, but the public API cannot assume that.',
2465
- parameters: [{ name: 'session', description: 'a {@link prepare}d session not yet in the store.' }],
3111
+ description: 'Enter a session into the store: install the module-private append publication hooks and add it to the store. Writes remain disabled until announce completes successfully. Returns the DETACH disposer (hooks + store removal). Does NOT emit `session/created` — the caller yields this disposer inside its effect and THEN calls announce, so a throwing `session/created` listener rolls the attach back instead of leaking it.\n\nRe-checks the id for a duplicate: `prepare` and `enter` are public cross-package primitives and a caller may interleave arbitrary work (or another create) between them, so a stale prepared session must NOT overwrite a live store entry of the same id — its detach disposer would later delete the REAL session. The create convenience and the agent factory call the two back-to-back so they never trip this, but the public API cannot assume that.',
3112
+ parameters: [{ name: 'session', description: 'an unentered session; independent instances become store-owned.' }],
2466
3113
  returns: 'the detach disposer (publication hooks + store removal). When called from a synchronous `session/created` listener, removal and disposal wait until that creation dispatch unwinds.',
2467
3114
  throws: ['if a session with this id is already in the store.'],
2468
3115
  },
2469
3116
  {
2470
3117
  signature: 'announce(session: Session): void',
2471
- description: 'Emit `session/created` exactly once for an entered session (with the carrier enter captured). Separate from enter so the caller can yield the detach disposer first (rollback safety — see enter).',
3118
+ description: 'Emit `session/created` exactly once for an entered session (with the carrier enter captured). Separate from enter so the caller can yield the detach disposer first (rollback safety — see enter). The Session remains read-only throughout synchronous dispatch; successful completion enables appends. A failed announcement leaves it read-only and cannot be retried.',
2472
3119
  parameters: [{ name: 'session', description: 'the entered session to announce to listeners.' }],
2473
3120
  throws: ['if the session is not live or its announcement already began, including a reentrant call from a creation listener.'],
2474
3121
  },
@@ -2493,7 +3140,7 @@ export const SERVICE_API = [
2493
3140
  },
2494
3141
  {
2495
3142
  signature: 'fork(source: SessionForkSource, boundary?: SessionSeq, childSessionId?: SessionId): Session',
2496
- description: 'Create a live child session from an exact prefix of a live source. `boundary` is an inclusive source event seq; omitted means the source\'s current last event. An open tail receives synthetic tool results and step/turn closers with the forked cause. Closed steps and turns remain unchanged, including any failed tool calls already missing results. `inheritedEventCount` counts only copied source events, excluding these closers.',
3143
+ description: 'Create an independent live session from an exact prefix of a live source. `boundary` is an inclusive source event seq; omitted means the source\'s current last event. An open tail receives synthetic tool results and step/turn closers with the forked cause. Closed steps and turns remain unchanged, including any failed tool calls already missing results. `inheritedEventCount` counts only copied source events, excluding these closers.',
2497
3144
  parameters: [{ name: 'source', description: 'Live source session object or id.' }, { name: 'boundary', description: 'Inclusive source event seq to fork through; omitted means the source\'s current last event, and omitted on an empty source forks an empty child.' }, { name: 'childSessionId', description: 'Optional child session id; omitted delegates to `SessionStore`\'s id policy.' }],
2498
3145
  returns: 'The created live child session.',
2499
3146
  },
@@ -2933,16 +3580,9 @@ export const SERVICE_API = [
2933
3580
  },
2934
3581
  {
2935
3582
  key: 'subagentModelSelection',
2936
- summary: 'Singleton settings owner read when delegation tools are composed for a Session.',
2937
- description: 'Singleton settings owner read when delegation tools are composed for a Session.',
2938
- methods: [
2939
- {
2940
- signature: 'current(): SubagentModelSelectionSettings',
2941
- description: 'Read a detached selection preference for the next eligible Session composition.',
2942
- parameters: [],
2943
- returns: 'the enabled state and exact allowed routes.',
2944
- },
2945
- ],
3583
+ summary: 'Host settings owner that records Session authorization before the first model request.',
3584
+ description: 'Host settings owner that records Session authorization before the first model request.',
3585
+ methods: [],
2946
3586
  },
2947
3587
  {
2948
3588
  key: 'subagents',
@@ -3135,9 +3775,9 @@ export const SERVICE_API = [
3135
3775
  },
3136
3776
  {
3137
3777
  signature: 'async assemble(context: AssembleContext = {}): Promise<PromptAssembly>',
3138
- description: 'Assemble global and scoped providers, detach tool parameters, apply canonical ordering, then run the assembly waterfall. Scoped sections and variables shadow globals. The returned waterfall value is authoritative except that an effective complete section is restored afterwards as the sole prompt section.',
3139
- parameters: [{ name: 'context', description: 'the optional scope and plugin-defined assembly fields.' }],
3140
- returns: 'the post-waterfall assembly with any complete prompt enforced.',
3778
+ description: 'Assemble global and scoped providers, detach tool parameters, apply canonical ordering, then run the presentation waterfall. Scoped sections and variables shadow globals. The waterfall\'s text is authoritative except that an effective complete section is restored afterwards as the sole prompt section; tool declarations stay provider-owned.',
3779
+ parameters: [{ name: 'context', description: 'the optional scope, step tool set, and plugin-defined assembly fields.' }],
3780
+ returns: 'the post-waterfall assembly with ordered tool declarations and any complete prompt enforced.',
3141
3781
  },
3142
3782
  ],
3143
3783
  },
@@ -3282,12 +3922,12 @@ export const SERVICE_API = [
3282
3922
  parameters: [],
3283
3923
  },
3284
3924
  {
3285
- signature: 'throttle<F extends (...args: any[]) => void>(callback: F, delay: number, noTrailing?: boolean): F & { dispose: () => void }',
3925
+ signature: 'throttle<F extends (...args: any[]) => any>(callback: F, delay: number, noTrailing?: boolean): ((...args: Parameters<F>) => void) & { dispose: () => void }',
3286
3926
  description: 'Return a throttled function whose timer is disposed with the current fiber.',
3287
3927
  parameters: [],
3288
3928
  },
3289
3929
  {
3290
- signature: 'debounce<F extends (...args: any[]) => void>(callback: F, delay: number): F & { dispose: () => void }',
3930
+ signature: 'debounce<F extends (...args: any[]) => any>(callback: F, delay: number): ((...args: Parameters<F>) => void) & { dispose: () => void }',
3291
3931
  description: 'Return a debounced function whose timer is disposed with the current fiber.',
3292
3932
  parameters: [],
3293
3933
  },
@@ -3298,6 +3938,12 @@ export const SERVICE_API = [
3298
3938
  summary: 'Replay owner for one service-wide estimator and isolated per-session folds.',
3299
3939
  description: 'Replay owner for one service-wide estimator and isolated per-session folds.',
3300
3940
  methods: [
3941
+ {
3942
+ signature: 'contextPressure(session: Session): Pick<ContextPressureProjection, \'pressureTokens\' | \'contextWindow\'>',
3943
+ description: 'Read the latest logged provider prompt size and route capacity.',
3944
+ parameters: [{ name: 'session', description: 'Session whose committed usage and request capacity are read.' }],
3945
+ returns: 'context pressure; fields remain absent until their source events are recorded.',
3946
+ },
3301
3947
  {
3302
3948
  signature: 'measure(session: Session, requestHeader?: EpochHeader): TokenMeasurement',
3303
3949
  description: 'Measure current request pressure and surface through the durable tail.\n\nThe effective envelope\'s routed provider/model selects the request-image pricing every node is priced under: a route whose adapter declares image pricing charges each retained image its visual tokens plus its model-visible text, while other routes keep the fixed heuristic. Provider usage is reused only when the latest successful call\'s canonical request envelope matches `requestHeader` and its total is no lower than that call\'s full route-priced anchor; otherwise the complete envelope and surface are repriced. The anchor includes all surface nodes immediately before the assistant message, including inputs admitted after step/start.\n\n`requestHeader` replaces the latest logged envelope for pressure and node pricing; the node set always describes the current session surface. Every call clones those positional nodes, so measurement is O(surface).',
@@ -3345,19 +3991,13 @@ export const SERVICE_API = [
3345
3991
  },
3346
3992
  {
3347
3993
  key: 'tools',
3348
- summary: 'Tool registry and execution pipeline.',
3349
- description: 'Tool registry and execution pipeline. Scoped registrations shadow globals; one visibility resolver feeds presentation, lookup, and dispatch.',
3994
+ summary: 'Concrete tool registry and scoped executor dispatcher.',
3995
+ description: 'Concrete tool registry and scoped executor dispatcher.',
3350
3996
  methods: [
3351
3997
  {
3352
- signature: 'presentAs(mode: ToolPresentationMode): () => void',
3353
- description: 'Present the calling scope\'s tools in `mode` instead of the deployment default. Nearest scope on the chain wins, so a preset\'s standing declaration covers every agent joined under it.\n\nScoped only, and one declaration per scope: this is how an agent preset composes PTC mode agents beside native ones in the same process, and a process-global override would be the `mode` config field instead.',
3354
- parameters: [{ name: 'mode', description: 'the presentation the covered agents\' models see.' }],
3355
- returns: 'the exact disposer that restores the deployment default.',
3356
- },
3357
- {
3358
- signature: 'register(definition: ToolDefinition): () => void',
3998
+ signature: 'register(definition: ToolDefinition, options: ToolRegistrationOptions = {}): () => void',
3359
3999
  description: 'Register globally or in the calling agent scope. Scoped tools shadow globals; duplicates within one layer and the reserved `run_code` name fail.',
3360
- parameters: [{ name: 'definition', description: 'tool schema, execution, and optional finalization/presentation callbacks.' }],
4000
+ parameters: [{ name: 'definition', description: 'tool schema, execution, and optional finalization/presentation callbacks.' }, { name: 'options', description: 'optional step-time activation condition.' }],
3361
4001
  returns: 'the exact disposer that unregisters the tool.',
3362
4002
  },
3363
4003
  {
@@ -3367,34 +4007,58 @@ export const SERVICE_API = [
3367
4007
  returns: 'the exact disposer that lifts this restriction.',
3368
4008
  },
3369
4009
  {
3370
- signature: 'guard(guard: ToolGuard): () => void',
3371
- description: 'Register a monotonic guard after the extensible `tools/pre-execute` waterfall. A plain-context guard applies globally; one registered through `agent.ctx` applies only to that agent. Any matching guard may deny by returning a reason, while no guard can force-allow a call another guard denied. The exact effect disposer is returned for ordered ownership and HMR cleanup.',
3372
- parameters: [{ name: 'guard', description: 'synchronous check; a returned string denies the execution.' }],
3373
- returns: 'the exact disposer that unregisters the guard.',
3374
- },
3375
- {
3376
- signature: 'get(name: string, scope?: ScopeKey): ToolDefinition | undefined',
4010
+ signature: 'get(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined',
3377
4011
  description: 'Look up a tool as one scope sees it (scoped shadows global; a restricted-away global reads as absent). Presenters pass the calling agent so the rendered card matches the definition that actually executed.',
3378
- parameters: [{ name: 'name', description: 'the tool name as registered.' }, { name: 'scope', description: 'the viewing scope (the agent); omitted = the global view.' }],
4012
+ parameters: [{ name: 'name', description: 'the tool name as registered.' }, { name: 'scope', description: 'the viewing scope (the agent); omitted = the global view.' }, { name: 'toolSet', description: 'step admission; omit only to inspect registered definitions.' }],
3379
4013
  returns: 'the definition the scope resolves, or undefined when none is visible.',
3380
4014
  },
3381
4015
  {
3382
- signature: 'schemas(scope?: ScopeKey): ToolSchema[]',
4016
+ signature: 'executable(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined',
4017
+ description: 'Resolve the definition a call may execute. With a step\'s admitted set, the set decides; without one, conditional registrations are unavailable.',
4018
+ parameters: [{ name: 'name', description: 'the tool name as registered.' }, { name: 'scope', description: 'the calling agent; omitted = the global view.' }, { name: 'toolSet', description: 'step admission, or omitted for a call outside a model step.' }],
4019
+ returns: 'the executable definition, or undefined when the call must fail as `UNKNOWN_TOOL`.',
4020
+ },
4021
+ {
4022
+ signature: 'async resolve(context: ToolActivationContext): Promise<ResolvedToolSet>',
4023
+ description: 'Resolve conditions once for this step without changing shared registrations. Cancellation or a rejected condition publishes no partial selection. Removed registrations cannot be restored by a late condition result.',
4024
+ parameters: [{ name: 'context', description: 'preparing agent, captured model selection, and cancellation.' }],
4025
+ returns: 'the complete selection; the caller disposes it after its tool batch settles.',
4026
+ },
4027
+ {
4028
+ signature: 'definitions(scope?: ScopeKey, toolSet?: ResolvedToolSet): readonly ToolDefinition[]',
4029
+ description: 'Read the visible capability definitions for descriptions and program bindings.',
4030
+ parameters: [{ name: 'scope', description: 'viewing Agent or preset; omitted selects the global view.' }, { name: 'toolSet', description: 'step admission; omit only to inspect registered definitions.' }],
4031
+ returns: 'definitions after scoped shadowing and restrictions, limited to the step\'s admission when given.',
4032
+ },
4033
+ {
4034
+ signature: 'schemas(scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolSchema[]',
3383
4035
  description: 'Project visible definitions onto the allowlisted model-facing schema fields, excluding execution and presentation callbacks.',
3384
- parameters: [{ name: 'scope', description: 'the viewing scope (the agent); omitted = the global view.' }],
4036
+ parameters: [{ name: 'scope', description: 'the viewing scope (the agent); omitted = the global view.' }, { name: 'toolSet', description: 'step admission, or omitted for registered-definition inspection.' }],
3385
4037
  returns: 'one deep-cloned schema per visible tool.',
3386
4038
  },
3387
4039
  {
3388
- signature: 'executionMode(exec: ToolExecutionInput): ToolExecutionMode',
3389
- description: 'Classify a pending call through the caller\'s visible tool definition. Only an exact `true` is parallel; unknown, hidden, undeclared, invalid, or throwing classifiers are exclusive.',
3390
- parameters: [{ name: 'exec', description: 'call name, parsed arguments, and optional agent scope.' }],
3391
- returns: 'the fail-closed scheduling mode.',
4040
+ signature: 'setExecutor(executor: ToolExecutor): () => void',
4041
+ description: 'Provide the executor for the calling scope; an unscoped contribution is the deployment default. Rendering any executor-owned section requires the viewing scope\'s selection to remain available.',
4042
+ parameters: [{ name: 'executor', description: 'initialized provider owned by the contributing plugin.' }],
4043
+ returns: 'the effect disposer. Unloading leaves the selection unavailable until it is replaced.',
4044
+ },
4045
+ {
4046
+ signature: 'async execute(input: ToolBatchInput): Promise<ToolBatchResult>',
4047
+ description: 'Delegate a raw call batch to its Agent\'s provider or the deployment default. Select at dispatch; accepted batches settle through that provider even if it unloads.',
4048
+ parameters: [{ name: 'input', description: 'original calls, optional owning Agent, and optional logging step.' }],
4049
+ returns: 'the selected executor\'s settled batch; unavailable selections reject.',
3392
4050
  },
3393
4051
  {
3394
- signature: 'async execute(exec: ToolExecutionInput): Promise<ToolExecutionResult>',
3395
- description: 'Execute through pre-policy, guards, around-dispatch, post-policy, definition-owned content finalization, and final notification. Tool and listener failures resolve as materialized error results; an invisible tool reports `UNKNOWN_TOOL`. The returned outcome is the same lossless, frozen snapshot final observers receive. Cancellation arriving after entry and before final result materialization skips a not-yet-started body with `ABORTED_BEFORE_DISPATCH` or replaces a successful started outcome with `ABORTED`; already-started work is still drained and may retain a tool-owned structured error.',
3396
- parameters: [{ name: 'exec', description: 'the typed same-process call input. The registry assigns its correlation token before policy begins.' }],
3397
- returns: 'the materialized final result.',
4052
+ signature: 'guard(guard: ToolGuard): () => void',
4053
+ description: 'Register a monotonic denial in the calling scope.',
4054
+ parameters: [{ name: 'guard', description: 'evaluated after extensible pre-execute policy by the shared pipeline.' }],
4055
+ returns: 'the effect disposer that removes this guard.',
4056
+ },
4057
+ {
4058
+ signature: 'checkGuards(exec: ToolExecution): string | undefined',
4059
+ description: 'Check global and inherited guards after pre-execute policy and approval resolve.',
4060
+ parameters: [{ name: 'exec', description: 'invocation whose guards are checked before dispatch.' }],
4061
+ returns: 'the first denial reason, or undefined when no guard denies.',
3398
4062
  },
3399
4063
  ],
3400
4064
  },
@@ -3489,6 +4153,12 @@ export const SERVICE_API = [
3489
4153
  parameters: [],
3490
4154
  returns: 'whether an owner stream is open and has not been cancelled.',
3491
4155
  },
4156
+ {
4157
+ signature: 'getPendingRemoteEvents(): readonly PendingRemoteEventInfo[]',
4158
+ description: 'Inspect unsettled forwarded events without changing their lifetime.',
4159
+ parameters: [],
4160
+ returns: 'detached event names and Agent identities.',
4161
+ },
3492
4162
  {
3493
4163
  signature: 'registerRemoteEvents( source: TypertRemoteEventSource, host: RemoteEventHostInfo, ): () => Promise<void>',
3494
4164
  description: 'Register the sole application-selected forwarded-event source.',
@@ -3567,12 +4237,24 @@ export const SERVICE_API = [
3567
4237
  parameters: [{ name: 'request', description: 'the query and optional result limit.' }, { name: 'signal', description: 'optional cancellation signal forwarded to the provider.' }],
3568
4238
  returns: 'the provider\'s results, capped to `request.maxResults`.',
3569
4239
  },
4240
+ {
4241
+ signature: 'async searchReady(llmProvider?: string): Promise<boolean>',
4242
+ description: 'Whether the provider `search()` would select can authenticate a search made for a model request on the `llmProvider` chat route. Asks only that provider\'s `ready()`; one without `ready()` counts as ready. Makes no network calls. A selection failure answers true, because `search()` reports that failure as a structured `WebError`.',
4243
+ parameters: [{ name: 'llmProvider', description: 'the provider route id of the model request, when known.' }],
4244
+ returns: 'false only when the selected provider reports that it cannot authenticate.',
4245
+ },
3570
4246
  {
3571
4247
  signature: 'async fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>',
3572
4248
  description: 'Retrieve one URL through the selected provider. Resolves the provider at call time with the selection rules above; throws WebError when the capability cannot run. A non-2xx response is a result, not a throw.',
3573
4249
  parameters: [{ name: 'request', description: 'the URL plus retrieval options.' }, { name: 'signal', description: 'optional cancellation signal forwarded to the provider.' }],
3574
4250
  returns: 'the retrieval outcome; non-2xx responses resolve descriptively.',
3575
4251
  },
4252
+ {
4253
+ signature: 'async fetchReady(llmProvider?: string): Promise<boolean>',
4254
+ description: 'Whether the provider `fetch()` would select can authenticate a fetch made for a model request on the `llmProvider` chat route. Asks only that provider\'s `ready()`; one without `ready()` counts as ready. Makes no network calls. A selection failure answers true, because `fetch()` reports that failure as a structured `WebError`.',
4255
+ parameters: [{ name: 'llmProvider', description: 'the provider route id of the model request, when known.' }],
4256
+ returns: 'false only when the selected provider reports that it cannot authenticate.',
4257
+ },
3576
4258
  ],
3577
4259
  },
3578
4260
  {
@@ -3610,7 +4292,7 @@ export const SERVICE_API = [
3610
4292
  {
3611
4293
  key: 'webServer',
3612
4294
  summary: 'The browser HTTP carrier service.',
3613
- description: 'The browser HTTP carrier service. Activation loads any configured TLS material, then listens immediately; a material or listen failure rejects initialization, and the boot process reports the failed fiber. Route registration order does not affect requests because configured named routes must be distinct, and the fallback handler answers anything not yet claimed during startup with 404 until its owner registers.',
4295
+ description: 'The browser HTTP carrier service. Activation loads any configured TLS material, then listens immediately; a material or listen failure rejects initialization, and the boot process reports the failed fiber. Route registration order does not affect requests because configured named routes must be distinct, and a request no named route matches is answered 404 until the fallback owner registers.',
3614
4296
  methods: [
3615
4297
  {
3616
4298
  signature: 'getOrigin(): string',
@@ -3620,9 +4302,9 @@ export const SERVICE_API = [
3620
4302
  throws: ['before `listen` binds a port, or when the bind address has no URL form.'],
3621
4303
  },
3622
4304
  {
3623
- signature: 'register(route: WebRoute): () => void',
4305
+ signature: 'register(route: WebRoute | WebResourceRoute): () => void',
3624
4306
  description: 'Register a named route. Duplicate (kind, path) throws — route patterns are a composition-level contract, so a collision is a misconfiguration.',
3625
- parameters: [{ name: 'route', description: 'kind, path, and the owning handler.' }],
4307
+ parameters: [{ name: 'route', description: 'kind, path, and the owning handler or resource.' }],
3626
4308
  returns: 'the disposer removing the route.',
3627
4309
  },
3628
4310
  {
@@ -3632,11 +4314,17 @@ export const SERVICE_API = [
3632
4314
  returns: 'the disposer removing the route.',
3633
4315
  },
3634
4316
  {
3635
- signature: 'registerFallback(handler: WebRoute[\'handler\']): () => void',
3636
- description: 'Claim the fallback seat: the handler answering every request no named route matches (the SPA dist server in the shipped Web composition). One owner only — a second registration throws, because two fallbacks cannot compose.',
3637
- parameters: [{ name: 'handler', description: 'owns the full response lifecycle of unmatched requests.' }],
4317
+ signature: 'registerFallback(fallback: WebRoute[\'handler\'] | Pick<WebResourceRoute, \'resource\'>): () => void',
4318
+ description: 'Claim the fallback seat: the handler or resource answering every request no named route matches (the SPA dist server in the shipped Web composition). One owner only — a second registration throws, because two fallbacks cannot compose.',
4319
+ parameters: [{ name: 'fallback', description: 'a handler owning the full response lifecycle of unmatched requests, or `{ resource }` answering them.' }],
3638
4320
  returns: 'the disposer releasing the seat.',
3639
4321
  },
4322
+ {
4323
+ signature: 'async readResource(request: Request, peer: PeerScope): Promise<Response>',
4324
+ description: 'Read the response an HTTP request for the same URL would receive, as the resource computes it for `peer`, without an HTTP exchange. The request path picks the responder by the HTTP match order — exact, longest prefix, then the fallback — and only a resource answers. This method checks no cookie, Host, or Origin: the caller admits the reader before reading.',
4325
+ parameters: [{ name: 'request', description: 'the read; its URL path selects the responder.' }, { name: 'peer', description: 'the Peer the read speaks for, passed to the resource.' }],
4326
+ returns: 'the resource\'s response, without a body for HEAD as over HTTP; 405 with `Allow: GET, HEAD` for any other method, checked before matching, where over HTTP a handler route or an unmatched path answers such a method itself; 404 when the path matches a handler route, or reaches the fallback seat while it is unclaimed or holds a handler. A resource that throws rejects the read, where an HTTP request would receive 400.',
4327
+ },
3640
4328
  {
3641
4329
  signature: 'tapIndex(transform: (html: string) => string): () => void',
3642
4330
  description: 'Register a raw-HTML index transform, the escape hatch for markup no IndexInjection row expresses: renderIndex applies taps in registration order after rendering the structured rows.',
@@ -3650,15 +4338,15 @@ export const SERVICE_API = [
3650
4338
  returns: 'the transformed body.',
3651
4339
  },
3652
4340
  {
3653
- signature: 'collectIndexInjections(): IndexInjection[]',
3654
- description: 'Gather the structured injection table: one `webserver/index-inject` emit, every subscriber pushes its current rows. Fresh per call, so subscribers read live state (module graph, theme preference) at emit time.',
3655
- parameters: [],
4341
+ signature: 'collectIndexInjections(peer: PeerScope): IndexInjection[]',
4342
+ description: 'Gather the structured injection table for one Peer: one `webserver/index-inject` emit, every subscriber pushes its current rows. Fresh per call, so subscribers read live state (module graph, theme preference, the Peer\'s access) at emit time.',
4343
+ parameters: [{ name: 'peer', description: 'the Peer the page speaks for.' }],
3656
4344
  returns: 'rows in subscriber activation order.',
3657
4345
  },
3658
4346
  {
3659
- signature: 'renderIndex(html: string): string',
3660
- description: 'Render one index.html body: the structured injection table first, then the raw `tapIndex` transforms over the result.',
3661
- parameters: [{ name: 'html', description: 'the raw index.html body.' }],
4347
+ signature: 'renderIndex(html: string, peer: PeerScope): string',
4348
+ description: 'Render one index.html body for one Peer: the structured injection table first, then the raw `tapIndex` transforms over the result.',
4349
+ parameters: [{ name: 'html', description: 'the raw index.html body.' }, { name: 'peer', description: 'the Peer the page speaks for.' }],
3662
4350
  returns: 'the transformed body.',
3663
4351
  },
3664
4352
  ],
@@ -3918,11 +4606,17 @@ export const SERVICE_API = [
3918
4606
  description: 'Creates retained Git worktrees under the mounted filesystem and sandbox providers.',
3919
4607
  methods: [
3920
4608
  {
3921
- signature: 'async create(agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortSignal): Promise<CreatedWorktree>',
4609
+ signature: 'async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<CreatedWorktree>',
3922
4610
  description: 'Create a fresh branch and checkout at a pinned local revision, then enter it. Existing branches or checkout paths fail. Uncommitted files stay in the source checkout. Checkout disables configured clean, smudge, and process filters without changing Git config. Repository-local replacement refs still apply; baseCommit reports the resolved object name. The new checkout becomes current only after Git setup succeeds. Failures may retain newly allocated Git/filesystem artifacts; no branch or checkout is removed automatically.',
3923
- parameters: [{ name: 'agent', description: 'caller whose current directory selects the source repository and file policy.' }, { name: 'request', description: 'optional new name and local revision; defaults are generated name and HEAD.' }, { name: 'signal', description: 'cancellation of lookup, creation, and working-directory publication.' }],
4611
+ parameters: [{ name: 'agent', description: 'caller whose current directory selects the source repository and file policy.' }, { name: 'request', description: 'optional new name and local revision; defaults are generated name and HEAD.' }, { name: 'signal', description: 'cancellation of lookup, creation, and working-directory publication.' }, { name: 'onPhase', description: 'receives each stage before it begins; it must not throw.' }],
3924
4612
  returns: 'canonical checkout path, branch name, pinned commit, and source repository root.',
3925
4613
  },
4614
+ {
4615
+ signature: 'async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<RestoredWorktree>',
4616
+ description: 'Check out a removed worktree again at its recorded directory: its branch when the branch still exists, otherwise a new branch of the same name at `baseCommit`. Only the missing target\'s unlocked registration is removed, and an existing directory fails. Changes that were never committed are not recovered. Checkout disables configured clean, smudge, and process filters, as creation does. The calling Session\'s working directory does not change. Failures may retain newly allocated Git/filesystem artifacts.',
4617
+ parameters: [{ name: 'agent', description: 'caller whose sandbox policy confines the commands.' }, { name: 'request', description: 'recorded directory, branch, base commit, and source repository root.' }, { name: 'signal', description: 'cancellation of the restoration.' }, { name: 'onPhase', description: 'receives each stage before it begins; it must not throw.' }],
4618
+ returns: 'the directory and whether the branch was created again.',
4619
+ },
3926
4620
  ],
3927
4621
  },
3928
4622
  ];
@@ -4003,18 +4697,10 @@ export const EVENT_API = [
4003
4697
  {
4004
4698
  name: 'agent/pre-step',
4005
4699
  mode: 'waterfall',
4006
- signature: '\'agent/pre-step\'(this: Scoped<Agent>, payload: { agent: Agent; messages: UserMessage[]; turn: number; step: number; signal: AbortSignal }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>',
4700
+ signature: '\'agent/pre-step\'(this: Scoped<Agent>, payload: { agent: Agent; messages: UserMessage[]; turn: number; step: number; signal: AbortSignal; modelSelection: Readonly<ModelSelection> }, next: () => Promise<PreStepDecision>): Promise<PreStepDecision>',
4007
4701
  summary: 'Reject a proposed step or replace the messages that enter it.',
4008
4702
  description: 'Reject a proposed step or replace the messages that enter it. Calling `next()` preserves the current messages.',
4009
- parameters: [{ name: 'payload', description: '.signal - the current turn\'s cancellation signal. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.' }],
4010
- },
4011
- {
4012
- name: 'agent/request',
4013
- mode: 'waterfall',
4014
- signature: '\'agent/request\'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; signal: AbortSignal }, next: () => Promise<LlmCallConfig>): Promise<LlmCallConfig>',
4015
- summary: 'Replace the frozen call configuration.',
4016
- description: 'Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.',
4017
- parameters: [{ name: 'payload', description: '.signal - the current turn\'s explicit abort signal. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.' }],
4703
+ parameters: [{ name: 'payload', description: '.modelSelection - captured step selection, retained across retries; omitted effort uses adapter defaults. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.' }],
4018
4704
  },
4019
4705
  {
4020
4706
  name: 'agent/request-error',
@@ -4232,6 +4918,22 @@ export const EVENT_API = [
4232
4918
  description: 'Observe a durable cold feedback mutation without publishing a live Session. Observers run before write ownership is released and must not await another message-feedback operation for this Session. The payload is borrowed read-only; deep-clone it before transferring ownership (for example, to Session.fromRestore).',
4233
4919
  parameters: [{ name: 'inspection', description: 'committed canonical prefix, including the feedback as its last event.' }],
4234
4920
  },
4921
+ {
4922
+ name: 'forge/providers-changed',
4923
+ mode: 'parallel',
4924
+ signature: '\'forge/providers-changed\'(forge: string): void | Promise<void>',
4925
+ summary: 'Announces a provider registration or withdrawal after the registry changes.',
4926
+ description: 'Announces a provider registration or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running.',
4927
+ parameters: [{ name: 'forge', description: 'family whose provider changed.' }],
4928
+ },
4929
+ {
4930
+ name: 'fs/delete-intent',
4931
+ mode: 'waterfall',
4932
+ signature: '\'fs/delete-intent\'(target: FsTarget, actor: object | undefined, next: () => { version: FsVersion } | undefined | Promise<{ version: FsVersion } | undefined>): Promise<{ version: FsVersion } | undefined>',
4933
+ summary: 'Single-slot decision for FileSystem.deleteFile; the first returned guard wins.',
4934
+ description: 'Single-slot decision for FileSystem.deleteFile; the first returned guard wins. Calling next() delegates to an unconditional deletion.',
4935
+ parameters: [{ name: 'target', description: 'the resolved source about to be removed.' }, { name: 'actor', description: 'the opaque tool-execution context used to select observed state.' }],
4936
+ },
4235
4937
  {
4236
4938
  name: 'fs/edit-intent',
4237
4939
  mode: 'waterfall',
@@ -4288,6 +4990,14 @@ export const EVENT_API = [
4288
4990
  description: 'Module replacements have finished loading.',
4289
4991
  parameters: [{ name: 'reloads', description: 'Replaced plugins and their module locations.' }],
4290
4992
  },
4993
+ {
4994
+ name: 'llm-pi-ai/request-headers',
4995
+ mode: 'waterfall',
4996
+ signature: '\'llm-pi-ai/request-headers\'(request: PiAiRequestHeaderContext, headers: Headers, next: () => Headers): Headers',
4997
+ summary: 'Prepare headers for one pi-ai inference call, excluding model discovery.',
4998
+ description: 'Prepare headers for one pi-ai inference call, excluding model discovery. Listeners run synchronously and must call next(); they may edit only the request-owned headers and must not retain them. Throws fail the call with REQUEST_HEADERS before inference I/O. Harness attribution wins afterward. Non-TypeError messages are user-visible and must exclude secrets. TypeError details and non-Error values are replaced with safe guidance.',
4999
+ parameters: [{ name: 'request', description: 'immutable routing metadata from the exact prepared call.' }, { name: 'headers', description: 'fresh profile headers, shared only within this dispatch.' }, { name: 'next', description: 'continue header preparation through the remaining listeners.' }],
5000
+ },
4291
5001
  {
4292
5002
  name: 'llm/adapters-updated',
4293
5003
  mode: 'emit',
@@ -4296,6 +5006,14 @@ export const EVENT_API = [
4296
5006
  description: 'The provider topology changed: an adapter registered or unregistered routes, or the configurable-provider directory gained or lost entries. This payload-free registry notification fires at each commit point (including registration disposal); consumers re-read `listProviders()`, `listModels()`, or `listConfigurableProviders()` for the new state. Observer failures are contained and cannot veto the registry mutation.',
4297
5007
  parameters: [],
4298
5008
  },
5009
+ {
5010
+ name: 'llm/models-updated',
5011
+ mode: 'emit',
5012
+ signature: '\'llm/models-updated\'(provider: string): void',
5013
+ summary: 'A provider\'s advertised models or display metadata changed; consumers reload `listModels()`.',
5014
+ description: 'A provider\'s advertised models or display metadata changed; consumers reload `listModels()`.',
5015
+ parameters: [{ name: 'provider', description: 'route whose model catalog changed.' }],
5016
+ },
4299
5017
  {
4300
5018
  name: 'llm/stream',
4301
5019
  mode: 'waterfall',
@@ -4324,8 +5042,8 @@ export const EVENT_API = [
4324
5042
  name: 'plugin-manager/install-log',
4325
5043
  mode: 'emit',
4326
5044
  signature: '\'plugin-manager/install-log\'(chunk: PluginInstallLogChunk): void',
4327
- summary: 'One chunk of a pnpm run\'s output, streamed as the run produces it.',
4328
- description: 'One chunk of a pnpm run\'s output, streamed as the run produces it.',
5045
+ summary: 'One chunk of an installation run\'s output, streamed as the run produces it.',
5046
+ description: 'One chunk of an installation run\'s output, streamed as the run produces it.',
4329
5047
  parameters: [{ name: 'chunk', description: 'the chunk and the run it belongs to.' }],
4330
5048
  },
4331
5049
  {
@@ -4336,6 +5054,22 @@ export const EVENT_API = [
4336
5054
  description: 'An installation moved between its Host phases. `installing` is announced once per registry the installation asks, with the attempt\'s registry and position; `cancelling` and `applying` once.',
4337
5055
  parameters: [{ name: 'progress', description: 'the installation\'s request id and phase, with the attempt while installing.' }],
4338
5056
  },
5057
+ {
5058
+ name: 'plugin-manager/operation',
5059
+ mode: 'parallel',
5060
+ signature: '\'plugin-manager/operation\'(operation: PluginOperation): void | Promise<void>',
5061
+ summary: 'One manager invocation started or ended; subscribers run independently without delaying management.',
5062
+ description: 'One manager invocation started or ended; subscribers run independently without delaying management.',
5063
+ parameters: [{ name: 'operation', description: 'Correlated operation facts; a start without an end has an unknown outcome.' }],
5064
+ },
5065
+ {
5066
+ name: 'plugin-manager/update-state',
5067
+ mode: 'emit',
5068
+ signature: '\'plugin-manager/update-state\'(progress: PluginUpdateProgress): void',
5069
+ summary: 'An update moved to its next step: checking the target, removing the installed version, installing the target, or reinstalling the removed version after the target failed.',
5070
+ description: 'An update moved to its next step: checking the target, removing the installed version, installing the target, or reinstalling the removed version after the target failed. Announced once per step.',
5071
+ parameters: [{ name: 'progress', description: 'the update\'s request id and step.' }],
5072
+ },
4339
5073
  {
4340
5074
  name: 'plugin-market/changed',
4341
5075
  mode: 'emit',
@@ -4352,6 +5086,14 @@ export const EVENT_API = [
4352
5086
  description: 'Durable task set changed; clients refetch global task and Session-active catalogs.',
4353
5087
  parameters: [],
4354
5088
  },
5089
+ {
5090
+ name: 'schedule/resolve-agent',
5091
+ mode: 'waterfall',
5092
+ signature: '\'schedule/resolve-agent\'(sessionId: SessionId, next: () => Promise<Agent>): Promise<Agent>',
5093
+ summary: 'Restore a reminder\'s Session through its embedding\'s owning controller.',
5094
+ description: 'Restore a reminder\'s Session through its embedding\'s owning controller. Call next() to use the Web Session controller.',
5095
+ parameters: [{ name: 'sessionId', description: 'Original Session receiving the reminder.' }],
5096
+ },
4355
5097
  {
4356
5098
  name: 'session-telemetry/record',
4357
5099
  mode: 'waterfall',
@@ -4364,8 +5106,8 @@ export const EVENT_API = [
4364
5106
  name: 'session/created',
4365
5107
  mode: 'emit',
4366
5108
  signature: '\'session/created\'(this: Scoped<Session>, session: Session): void',
4367
- summary: 'Creation announcement during session publication.',
4368
- description: 'Creation announcement during session publication. A synchronous throw vetoes and rolls back with a paired disposal; detach requested during dispatch is deferred. A returned-promise rejection is logged but cannot retroactively veto this synchronous boundary. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only sessions entered through that agent\'s context.',
5109
+ summary: 'Read-only creation announcement after store entry.',
5110
+ description: 'Read-only creation announcement after store entry. New events reject until every synchronous listener has returned successfully. A synchronous throw vetoes creation and rolls back with a paired disposal; detach requested during dispatch is deferred. A returned-promise rejection is logged but cannot retroactively veto this synchronous boundary. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only sessions entered through that agent\'s context.',
4369
5111
  parameters: [{ name: 'session', description: 'the session just entered and announced.' }],
4370
5112
  },
4371
5113
  {
@@ -4443,9 +5185,9 @@ export const EVENT_API = [
4443
5185
  {
4444
5186
  name: 'system-prompt/assemble',
4445
5187
  mode: 'waterfall',
4446
- signature: '\'system-prompt/assemble\'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>',
4447
- summary: 'Expert waterfall over the assembled sections, contexts, tools, and variables.',
4448
- description: 'Expert waterfall over the assembled sections, contexts, tools, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope\'s assemblies. The returned value is authoritative. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope\'s system prompt.',
5188
+ signature: '\'system-prompt/assemble\'(this: Scoped<SystemPrompt>, assembly: PromptPresentation, context: AssembleContext, next: () => Promise<PromptPresentation>): Promise<PromptPresentation>',
5189
+ summary: 'Presentation waterfall over assembled sections, contexts, and variables.',
5190
+ description: 'Presentation waterfall over assembled sections, contexts, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope\'s assemblies. The returned text is authoritative; tool declarations remain provider-owned. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope\'s system prompt.',
4449
5191
  parameters: [{ name: 'assembly', description: 'the mutable assembly built from registered providers.' }, { name: 'context', description: 'the caller\'s per-assembly context.' }],
4450
5192
  },
4451
5193
  {
@@ -4460,14 +5202,14 @@ export const EVENT_API = [
4460
5202
  name: 'tools/change',
4461
5203
  mode: 'emit',
4462
5204
  signature: '\'tools/change\'(): void',
4463
- summary: 'A tool was registered or unregistered, or a scoped restriction changed (the available tool set changed — possibly for one scope only).',
4464
- description: 'A tool was registered or unregistered, or a scoped restriction changed (the available tool set changed — possibly for one scope only). An UNFILTERED registry-subject notification, deliberately not scope-filtered dispatch: a global change concerns every agent\'s next assembly, so a scoped listener subscribing here sees every change, not just its own scope\'s.',
5205
+ summary: 'A tool was registered or unregistered, or a scoped restriction changed.',
5206
+ description: 'A tool was registered or unregistered, or a scoped restriction changed. Unfiltered registry notification: scoped listeners receive changes from every scope because a global contribution can affect every agent\'s next assembly.',
4465
5207
  parameters: [],
4466
5208
  },
4467
5209
  {
4468
5210
  name: 'tools/execute',
4469
5211
  mode: 'waterfall',
4470
- signature: '\'tools/execute\'(this: Scoped<ToolRuntime>, exec: ToolDispatchExecution, next: () => Promise<ToolExecutionResult>): Promise<ToolExecutionResult>',
5212
+ signature: '\'tools/execute\'(this: Scoped<ToolsService>, exec: ToolDispatchExecution, next: () => Promise<ToolExecutionResult>): Promise<ToolExecutionResult>',
4471
5213
  summary: 'Around-dispatch waterfall for timeout, retry, or metrics.',
4472
5214
  description: 'Around-dispatch waterfall for timeout, retry, or metrics. `next()` returns a normalized result; wrappers may change only `exec.signal`, while call identity remains immutable. The registry re-fuses the original caller signal before the body, so replacement cannot detach caller cancellation; wrappers must still restore their signal and reach quiescence. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent\'s calls.',
4473
5215
  parameters: [{ name: 'exec', description: 'the allowed call about to dispatch (name, parsed arguments, caller agent, signal).' }],
@@ -4475,7 +5217,7 @@ export const EVENT_API = [
4475
5217
  {
4476
5218
  name: 'tools/post-execute',
4477
5219
  mode: 'waterfall',
4478
- signature: '\'tools/post-execute\'(this: Scoped<ToolRuntime>, exec: ToolExecution, result: Readonly<ToolExecutionResult>, next: () => Promise<PostToolDecision>): Promise<PostToolDecision>',
5220
+ signature: '\'tools/post-execute\'(this: Scoped<ToolsService>, exec: ToolExecution, result: Readonly<ToolExecutionResult>, next: () => Promise<PostToolDecision>): Promise<PostToolDecision>',
4479
5221
  summary: 'Accept, replace, enrich, or block a normalized dispatch result.',
4480
5222
  description: 'Accept, replace, enrich, or block a normalized dispatch result. `next()` accepts it unchanged; thrown tools still reach this waterfall as errors. Async listeners must observe `exec.signal`; after they settle, caller cancellation replaces only a successful accepted outcome with the code selected by whether the tool body was invoked. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent\'s calls.',
4481
5223
  parameters: [{ name: 'exec', description: 'the call that just ran (name, parsed arguments, caller agent).' }, { name: 'result', description: 'the dispatch outcome a listener may accept, replace, or block.' }],
@@ -4483,7 +5225,7 @@ export const EVENT_API = [
4483
5225
  {
4484
5226
  name: 'tools/pre-execute',
4485
5227
  mode: 'waterfall',
4486
- signature: '\'tools/pre-execute\'(this: Scoped<ToolRuntime>, exec: ToolExecution, next: () => Promise<PreToolDecision>): Promise<PreToolDecision>',
5228
+ signature: '\'tools/pre-execute\'(this: Scoped<ToolsService>, exec: ToolExecution, next: () => Promise<PreToolDecision>): Promise<PreToolDecision>',
4487
5229
  summary: 'Allow, deny, cancel, or ask before dispatch.',
4488
5230
  description: 'Allow, deny, cancel, or ask before dispatch. `next()` delegates to allow; `cancel` selects the canonical pre-dispatch cancellation result, and missing approval support turns `ask` into denial. Async gates must observe `exec.signal`; the registry rechecks cancellation after they settle but never abandons their promise. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent\'s calls.',
4489
5231
  parameters: [{ name: 'exec', description: 'the pending call (name, parsed arguments, caller agent).' }],
@@ -4491,7 +5233,7 @@ export const EVENT_API = [
4491
5233
  {
4492
5234
  name: 'tools/ptc-dispatch-log',
4493
5235
  mode: 'waterfall',
4494
- signature: '\'tools/ptc-dispatch-log\'(this: Scoped<ToolRuntime>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>',
5236
+ signature: '\'tools/ptc-dispatch-log\'(this: Scoped<ToolsService>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>',
4495
5237
  summary: 'Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/ptc-dispatch` event.',
4496
5238
  description: 'Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/ptc-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy\'s preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent\'s dispatches.',
4497
5239
  parameters: [{ name: 'dispatch', description: 'the parent execution, sub-call identity, and the settled content to log.' }],
@@ -4499,7 +5241,7 @@ export const EVENT_API = [
4499
5241
  {
4500
5242
  name: 'tools/result',
4501
5243
  mode: 'emit',
4502
- signature: '\'tools/result\'(this: Scoped<ToolRuntime>, exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): undefined',
5244
+ signature: '\'tools/result\'(this: Scoped<ToolsService>, exec: Readonly<ToolExecution>, result: Readonly<ToolExecutionResult>): undefined',
4503
5245
  summary: 'Observe the frozen, lossless-JSON final outcome.',
4504
5246
  description: 'Observe the frozen, lossless-JSON final outcome. Listener failures are contained. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): keyed by `exec.agent`.',
4505
5247
  parameters: [{ name: 'exec', description: 'the execution object that traversed the pipeline.' }, { name: 'result', description: 'a deep-frozen snapshot of the final returned result.' }],
@@ -4515,10 +5257,10 @@ export const EVENT_API = [
4515
5257
  {
4516
5258
  name: 'webserver/index-inject',
4517
5259
  mode: 'emit',
4518
- signature: '\'webserver/index-inject\'(table: IndexInjection[]): void',
4519
- summary: 'Collect the structured index injection table.',
4520
- description: 'Collect the structured index injection table. Emitted on every index render and every worker boot-payload request; listeners push their current rows, so a row\'s data is read fresh at emit time.',
4521
- parameters: [{ name: 'table', description: 'Mutable row table; listeners append in activation order.' }],
5260
+ signature: '\'webserver/index-inject\'(table: IndexInjection[], peer: PeerScope): void',
5261
+ summary: 'Collect the structured index injection table for the page `peer` speaks for.',
5262
+ description: 'Collect the structured index injection table for the page `peer` speaks for. Emitted on every index render and every worker boot-payload request; listeners push their current rows, so a row\'s data is read fresh at emit time.',
5263
+ parameters: [{ name: 'table', description: 'Mutable row table; listeners append in activation order.' }, { name: 'peer', description: 'The Peer the rendered page speaks for.' }],
4522
5264
  },
4523
5265
  {
4524
5266
  name: 'workflow/agent-end',
@@ -4627,6 +5369,38 @@ export const TYPE_API = [
4627
5369
  name: 'AccountWallet',
4628
5370
  declaration: 'export interface AccountWallet {\n readonly currency: \'CNY\' | \'USD\';\n readonly balance: string;\n}',
4629
5371
  },
5372
+ {
5373
+ name: 'ActionCardDecision',
5374
+ declaration: 'export interface ActionCardDecision {\n readonly callId: ToolCallId;\n readonly action: string;\n readonly phase: string;\n readonly data?: ActionCardFields | undefined;\n}',
5375
+ },
5376
+ {
5377
+ name: 'ActionCardFields',
5378
+ declaration: 'export type ActionCardFields = Readonly<Record<string, JsonValue>>;',
5379
+ },
5380
+ {
5381
+ name: 'ActionCardKind',
5382
+ declaration: 'export interface ActionCardKind<Details> {\n readonly action: string;\n readonly skill: string;\n readonly invitation: string;\n readonly details: ZodType<Details>;\n readonly verbs: Readonly<Record<string, ActionCardVerb>>;\n readonly openPhases?: readonly string[];\n readonly statusGuidance?: string;\n readonly statusFields?: readonly string[];\n dismissal?(proposal: ActionCardProposalOf<Details>, payload: ActionCardFields | undefined): ActionCardFields | undefined;\n reconcile?(agent: Agent, proposal: ActionCardProposalOf<Details>): Promise<void>;\n act(agent: Agent, proposal: ActionCardProposalOf<Details>, verb: string, payload: ActionCardFields | undefined): Promise<ActionCardResult>;\n}',
5383
+ },
5384
+ {
5385
+ name: 'ActionCardProposal',
5386
+ declaration: 'export interface ActionCardProposal {\n readonly callId: ToolCallId;\n readonly turn: number;\n readonly action: string;\n readonly title: string;\n readonly brief: string;\n readonly details: ActionCardFields;\n}',
5387
+ },
5388
+ {
5389
+ name: 'ActionCardProposalOf',
5390
+ declaration: 'export type ActionCardProposalOf<Details> = Omit<ActionCardProposal, \'details\'> & {\n readonly details: Details;\n};',
5391
+ },
5392
+ {
5393
+ name: 'ActionCardResult',
5394
+ declaration: 'export type ActionCardResult = {\n readonly status: \'accepted\';\n} | {\n readonly status: \'settled\';\n readonly decision: ActionCardDecision;\n} | {\n readonly status: \'refused\';\n readonly reason: string;\n} | {\n readonly status: \'unconfirmed\';\n readonly reason: string;\n};',
5395
+ },
5396
+ {
5397
+ name: 'ActionCardVerb',
5398
+ declaration: 'export interface ActionCardVerb {\n readonly global?: true;\n readonly writes?: true;\n}',
5399
+ },
5400
+ {
5401
+ name: 'ActionCardView',
5402
+ declaration: 'export interface ActionCardView {\n readonly proposals: Readonly<Record<string, ActionCardProposal>>;\n readonly decisions: Readonly<Record<string, ActionCardDecision>>;\n}',
5403
+ },
4630
5404
  {
4631
5405
  name: 'AdapterRegistrationHandle',
4632
5406
  declaration: 'export interface AdapterRegistrationHandle {\n (): void;\n replace(providers: string[]): void;\n}',
@@ -4657,7 +5431,7 @@ export const TYPE_API = [
4657
5431
  },
4658
5432
  {
4659
5433
  name: 'AgentOptions',
4660
- declaration: 'export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId;\n maxTokens?: number;\n}',
5434
+ declaration: 'export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId | undefined;\n maxTokens?: number;\n}',
4661
5435
  },
4662
5436
  {
4663
5437
  name: 'AgentPresetComposition',
@@ -4761,7 +5535,7 @@ export const TYPE_API = [
4761
5535
  },
4762
5536
  {
4763
5537
  name: 'AskUserQuestionIntent',
4764
- declaration: 'export type AskUserQuestionIntent = {\n kind: \'plan-review\';\n approve: string;\n callId?: ToolCallId;\n};',
5538
+ declaration: 'export type AskUserQuestionIntent = {\n kind: \'plan-review\';\n approve: string;\n callId?: ToolCallId;\n} | {\n kind: \'approval\';\n approve: string;\n reject: string;\n always?: string;\n subject?: {\n name: string;\n icon?: string;\n };\n display?: {\n question: {\n en: string;\n [locale: string]: string;\n };\n detail?: {\n en: string;\n [locale: string]: string;\n };\n approve?: {\n en: string;\n [locale: string]: string;\n };\n };\n};',
4765
5539
  },
4766
5540
  {
4767
5541
  name: 'AskUserQuestionItem',
@@ -4817,7 +5591,7 @@ export const TYPE_API = [
4817
5591
  },
4818
5592
  {
4819
5593
  name: 'AttachmentAdmissionPart',
4820
- declaration: 'export type AttachmentAdmissionPart = PromptContentPart | {\n readonly type: \'file\';\n readonly attachment: FileAttachmentRef;\n};',
5594
+ declaration: 'export type AttachmentAdmissionPart = PromptContentPart | {\n readonly type: \'file\';\n readonly attachment: FileAttachmentRef;\n} | {\n readonly type: \'image\';\n readonly attachment: ImageAttachmentRef;\n readonly encodedBytes: number;\n};',
4821
5595
  },
4822
5596
  {
4823
5597
  name: 'AttachmentError',
@@ -4895,6 +5669,10 @@ export const TYPE_API = [
4895
5669
  name: 'BashEnvVariableInfo',
4896
5670
  declaration: 'export interface BashEnvVariableInfo extends BashEnvVariable {\n contributor: string;\n key: DshEnvironmentKey;\n}',
4897
5671
  },
5672
+ {
5673
+ name: 'BindingOrigin',
5674
+ declaration: 'export type BindingOrigin = \'created\' | \'referenced\' | \'discovered\' | \'tracked\';',
5675
+ },
4898
5676
  {
4899
5677
  name: 'BoxProps',
4900
5678
  declaration: 'export interface BoxProps {\n readonly flexDirection?: \'row\' | \'column\' | undefined;\n readonly paddingX?: number | undefined;\n readonly paddingY?: number | undefined;\n readonly padding?: number | undefined;\n readonly gap?: number | undefined;\n readonly border?: boolean | string | undefined;\n readonly borderColor?: string | undefined;\n readonly children?: UiNode | undefined;\n}',
@@ -4911,9 +5689,13 @@ export const TYPE_API = [
4911
5689
  name: 'BrowserUseProviderName',
4912
5690
  declaration: 'export type BrowserUseProviderName = Branded<\'BrowserUseProviderName\'>;',
4913
5691
  },
5692
+ {
5693
+ name: 'BundleDetail',
5694
+ declaration: 'export type BundleDetail = {\n readonly status: \'found\';\n readonly origin: \'locale\' | \'readme\';\n readonly path: string;\n readonly markdown: string;\n} | {\n readonly status: \'none\';\n};',
5695
+ },
4914
5696
  {
4915
5697
  name: 'BundleInfo',
4916
- declaration: 'export interface BundleInfo {\n name: string;\n official: boolean;\n availability: \'installation\' | \'profile\' | \'missing\';\n installTarget?: {\n spec: string;\n version: string;\n };\n version?: string;\n meta?: PluginLocalizedMeta;\n description?: string;\n enabled: boolean;\n installed: boolean;\n source?: string;\n optional: boolean;\n removable: boolean;\n readOnlyReason?: ReadOnlyReason;\n error?: ManagementError;\n rows: BundleRowInfo[];\n overrides: string[];\n}',
5698
+ declaration: 'export interface BundleInfo {\n name: string;\n official: boolean;\n availability: \'installation\' | \'profile\' | \'missing\';\n installTarget?: {\n spec: string;\n version: string;\n };\n version?: string;\n meta?: PluginLocalizedMeta;\n description?: string;\n listedByDefault?: boolean;\n enabled: boolean;\n installed: boolean;\n source?: string;\n optional: boolean;\n removable: boolean;\n updatable: boolean;\n readOnlyReason?: ReadOnlyReason;\n error?: ManagementError;\n rows: BundleRowInfo[];\n overrides: string[];\n}',
4917
5699
  },
4918
5700
  {
4919
5701
  name: 'BundleRowInfo',
@@ -4923,10 +5705,50 @@ export const TYPE_API = [
4923
5705
  name: 'ButtonProps',
4924
5706
  declaration: 'export interface ButtonProps {\n readonly label: string;\n readonly hotkey?: string | undefined;\n readonly disabled?: boolean | undefined;\n readonly onPress?: (() => unknown) | undefined;\n}',
4925
5707
  },
5708
+ {
5709
+ name: 'ChangeRequestCheck',
5710
+ declaration: 'export interface ChangeRequestCheck {\n readonly name: string;\n readonly state: CheckState;\n readonly url: string | null;\n readonly workflow: string | null;\n readonly startedAt: string | null;\n readonly completedAt: string | null;\n}',
5711
+ },
5712
+ {
5713
+ name: 'ChangeRequestKey',
5714
+ declaration: 'export type ChangeRequestKey = Branded<\'ChangeRequestKey\'>;',
5715
+ },
5716
+ {
5717
+ name: 'ChangeRequestListener',
5718
+ declaration: 'export type ChangeRequestListener = (update: ChangeRequestUpdate) => void;',
5719
+ },
5720
+ {
5721
+ name: 'ChangeRequestRef',
5722
+ declaration: 'export interface ChangeRequestRef {\n readonly repository: ForgeRepository;\n readonly number: number;\n}',
5723
+ },
5724
+ {
5725
+ name: 'ChangeRequestSnapshot',
5726
+ declaration: 'export interface ChangeRequestSnapshot {\n readonly ref: ChangeRequestRef;\n readonly url: string;\n readonly title: string;\n readonly state: ChangeRequestState;\n readonly draft: boolean;\n readonly author: string | null;\n readonly headBranch: string;\n readonly headSha: string;\n readonly baseBranch: string;\n readonly additions: number;\n readonly deletions: number;\n readonly mergeability: Mergeability;\n readonly mergeReady: boolean;\n readonly mergeMethods: readonly MergeMethod[];\n readonly reviewDecision: ReviewDecision;\n readonly checks: readonly ChangeRequestCheck[];\n readonly checksRollup: ChecksRollup;\n readonly checksTruncated: boolean;\n readonly unresolvedThreads: number;\n readonly updatedAt: string;\n readonly closedAt: string | null;\n}',
5727
+ },
5728
+ {
5729
+ name: 'ChangeRequestState',
5730
+ declaration: 'export type ChangeRequestState = \'open\' | \'closed\' | \'merged\';',
5731
+ },
5732
+ {
5733
+ name: 'ChangeRequestUpdate',
5734
+ declaration: 'export type ChangeRequestUpdate = {\n readonly key: ChangeRequestKey;\n readonly fetchedAt: number;\n} & ({\n readonly snapshot: ChangeRequestSnapshot;\n} | {\n readonly failure: ForgeFailure;\n});',
5735
+ },
4926
5736
  {
4927
5737
  name: 'ChangeResult',
4928
5738
  declaration: 'export interface ChangeResult {\n changed: boolean;\n application: \'applied\' | \'restart-required\' | \'overridden\' | \'failed\' | \'cancelled\';\n restartReason?: RestartReason;\n stage: \'install\' | \'enable\' | \'remove\';\n target: string;\n enabled?: boolean;\n error?: ManagementError;\n warnings?: string[];\n packageResult?: PackageResult;\n bundle?: string;\n version?: string;\n pendingBuilds?: string[];\n approvedBuilds?: string[];\n registries?: Registry[];\n failedAt?: \'registry\' | \'spec-host\';\n}',
4929
5739
  },
5740
+ {
5741
+ name: 'ChecksRollup',
5742
+ declaration: 'export type ChecksRollup = \'none\' | \'pending\' | \'success\' | \'failure\';',
5743
+ },
5744
+ {
5745
+ name: 'CheckState',
5746
+ declaration: 'export type CheckState = \'pending\' | \'success\' | \'failure\' | \'neutral\' | \'skipped\' | \'cancelled\';',
5747
+ },
5748
+ {
5749
+ name: 'ClaimOutcome',
5750
+ declaration: 'export interface ClaimOutcome {\n readonly claimed: number;\n readonly skipped: number;\n}',
5751
+ },
4930
5752
  {
4931
5753
  name: 'ClientArtifactBaseline',
4932
5754
  declaration: 'export interface ClientArtifactBaseline {\n readonly path: string;\n readonly mtimeMs: number;\n readonly ctimeMs: number;\n readonly size: number;\n}',
@@ -5095,6 +5917,10 @@ export const TYPE_API = [
5095
5917
  name: 'ContentBlockType',
5096
5918
  declaration: 'export type ContentBlockType = keyof ContentBlockMap;',
5097
5919
  },
5920
+ {
5921
+ name: 'ContextPressureProjection',
5922
+ declaration: 'export interface ContextPressureProjection {\n pressureTokens?: number;\n projectedTokens?: number;\n contextWindow?: number;\n}',
5923
+ },
5098
5924
  {
5099
5925
  name: 'ContinuableCreateRequest',
5100
5926
  declaration: 'export interface ContinuableCreateRequest {\n readonly cwd: string;\n readonly sessionId: SessionId;\n readonly parent: Agent;\n readonly signal: AbortSignal;\n}',
@@ -5183,6 +6009,10 @@ export const TYPE_API = [
5183
6009
  name: 'CreateAgentOptions',
5184
6010
  declaration: 'export interface CreateAgentOptions {\n readonly sessionId: SessionId;\n readonly parentAgent?: Agent;\n readonly meta?: {\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded?: boolean;\n readonly origin?: \'subagent\';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n readonly inheritedEventCount?: SessionLogOffset;\n readonly seed?: readonly SessionEvent[];\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}',
5185
6011
  },
6012
+ {
6013
+ name: 'CreatedShare',
6014
+ declaration: 'export interface CreatedShare {\n readonly link: string;\n readonly shareId: string;\n readonly sessionId: string;\n readonly sessionMode: \'view\' | \'write\';\n readonly access: ShareAccess;\n}',
6015
+ },
5186
6016
  {
5187
6017
  name: 'CreatedWorktree',
5188
6018
  declaration: 'export interface CreatedWorktree {\n path: string;\n branch: string;\n baseCommit: string;\n repositoryRoot: string;\n}',
@@ -5199,10 +6029,18 @@ export const TYPE_API = [
5199
6029
  name: 'CreateSessionOptions',
5200
6030
  declaration: 'export interface CreateSessionOptions {\n readonly seed?: readonly SessionEvent[];\n readonly inheritedEventCount?: SessionLogOffset;\n readonly meta?: {\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly createdAt?: number;\n readonly isSeeded?: boolean;\n readonly origin?: \'subagent\';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n}',
5201
6031
  },
6032
+ {
6033
+ name: 'CreateShareRequest',
6034
+ declaration: 'export interface CreateShareRequest {\n readonly sessionId: string;\n readonly sessionTitle?: string;\n readonly accessMode?: \'open\' | \'selected\';\n readonly ttlMinutes?: number;\n readonly allowedSubjectIds?: readonly string[];\n readonly allowsFork?: boolean;\n readonly sessionMode?: \'view\' | \'write\';\n}',
6035
+ },
5202
6036
  {
5203
6037
  name: 'CreateTeamTaskRequest',
5204
6038
  declaration: 'export interface CreateTeamTaskRequest {\n readonly subject: string;\n readonly description: string;\n readonly blockedBy?: readonly TeamTaskId[];\n readonly writeScopes?: readonly string[];\n}',
5205
6039
  },
6040
+ {
6041
+ name: 'CreateWorktreePhase',
6042
+ declaration: 'export type CreateWorktreePhase = \'prepare\' | \'checkout\';',
6043
+ },
5206
6044
  {
5207
6045
  name: 'CreateWorktreeRequest',
5208
6046
  declaration: 'export interface CreateWorktreeRequest {\n name?: string;\n from?: string;\n}',
@@ -5239,6 +6077,30 @@ export const TYPE_API = [
5239
6077
  name: 'CronScheduleRecord',
5240
6078
  declaration: 'export interface CronScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: \'cron\';\n readonly title: string;\n readonly prompt: string;\n readonly expression: string;\n readonly timeZone: string;\n readonly scheduledAt: string;\n}',
5241
6079
  },
6080
+ {
6081
+ name: 'CuaApplicationGrant',
6082
+ declaration: 'export interface CuaApplicationGrant {\n id: CuaApplicationId;\n name: string;\n executablePath?: string | undefined;\n}',
6083
+ },
6084
+ {
6085
+ name: 'CuaApplicationId',
6086
+ declaration: 'export type CuaApplicationId = Branded<\'CuaApplicationId\'>;',
6087
+ },
6088
+ {
6089
+ name: 'CuaApplicationState',
6090
+ declaration: 'export interface CuaApplicationState {\n allowedApps: readonly CuaApplicationGrant[];\n blockedApps: readonly CuaApplicationGrant[];\n persistentAvailable: boolean;\n}',
6091
+ },
6092
+ {
6093
+ name: 'CuaPermissionProcess',
6094
+ declaration: 'export interface CuaPermissionProcess {\n pid: number;\n path?: string | undefined;\n name?: string | undefined;\n}',
6095
+ },
6096
+ {
6097
+ name: 'CuaSystemPermission',
6098
+ declaration: 'export type CuaSystemPermission = \'accessibility\' | \'screenRecording\';',
6099
+ },
6100
+ {
6101
+ name: 'CuaSystemPermissionState',
6102
+ declaration: 'export interface CuaSystemPermissionState {\n accessibility: boolean;\n screenRecording: boolean;\n helper: CuaPermissionProcess;\n parent: CuaPermissionProcess;\n launchApplication?: {\n name: string;\n path: string;\n icon?: string | undefined;\n } | undefined;\n}',
6103
+ },
5242
6104
  {
5243
6105
  name: 'DailyInput',
5244
6106
  declaration: 'export interface DailyInput {\n readonly time: string;\n readonly time_zone: string;\n}',
@@ -5257,7 +6119,7 @@ export const TYPE_API = [
5257
6119
  },
5258
6120
  {
5259
6121
  name: 'DeepSeekLlmApiExtensionRequest',
5260
- declaration: 'export interface DeepSeekLlmApiExtensionRequest {\n readonly body: Readonly<Record<string, DeepSeekLlmApiJson>>;\n readonly sessionId?: string;\n readonly purpose?: \'compaction\' | \'session-title\';\n readonly signal: AbortSignal;\n}',
6122
+ declaration: 'export interface DeepSeekLlmApiExtensionRequest {\n readonly body: Readonly<Record<string, DeepSeekLlmApiJson>>;\n readonly sessionId?: string;\n readonly purpose?: string;\n readonly signal: AbortSignal;\n}',
5261
6123
  },
5262
6124
  {
5263
6125
  name: 'DeepSeekLlmApiJson',
@@ -5388,72 +6250,200 @@ export const TYPE_API = [
5388
6250
  declaration: 'export interface EncodedFileUploadRequest {\n readonly data: string;\n readonly name?: string;\n}',
5389
6251
  },
5390
6252
  {
5391
- name: 'EncodedImageAttachment',
5392
- declaration: 'export interface EncodedImageAttachment {\n mediaType: ImageMediaType;\n data: string;\n name?: string;\n}',
6253
+ name: 'EncodedImageAttachment',
6254
+ declaration: 'export interface EncodedImageAttachment {\n mediaType: ImageMediaType;\n data: string;\n name?: string;\n}',
6255
+ },
6256
+ {
6257
+ name: 'EpochHeader',
6258
+ declaration: 'export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}',
6259
+ },
6260
+ {
6261
+ name: 'EventLogOptions',
6262
+ declaration: 'export interface EventLogOptions {\n exporter: LogExporterOptions;\n resourceAttributes: Attributes;\n scope: {\n name: string;\n version?: string;\n };\n processor: Omit<BatchLogRecordProcessorOptions, \'exporter\'>;\n onFailure: SessionLogOptions[\'onFailure\'];\n}',
6263
+ },
6264
+ {
6265
+ name: 'EventLogReporter',
6266
+ declaration: 'export class EventLogReporter {\n constructor(options: EventLogOptions);\n emit(record: OTelEventRecord): void;\n async shutdown(signal?: AbortSignal): Promise<void>;\n}',
6267
+ },
6268
+ {
6269
+ name: 'EveryScheduleRecord',
6270
+ declaration: 'export interface EveryScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: \'every\';\n readonly title: string;\n readonly prompt: string;\n readonly everySeconds: number;\n readonly scheduledAt: string;\n}',
6271
+ },
6272
+ {
6273
+ name: 'FeedbackCategory',
6274
+ declaration: 'export type FeedbackCategory = \'task-result\' | \'instruction-following\' | \'product-interaction\' | \'service-stability\' | \'resource-cost\' | \'security-privacy-permission\' | \'other\';',
6275
+ },
6276
+ {
6277
+ name: 'FiberState',
6278
+ declaration: 'export const enum FiberState {\n PENDING,\n LOADING,\n ACTIVE,\n FAILED,\n DISPOSED,\n UNLOADING\n}',
6279
+ },
6280
+ {
6281
+ name: 'FileAttachmentRef',
6282
+ declaration: 'export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}',
6283
+ },
6284
+ {
6285
+ name: 'FileBlock',
6286
+ declaration: 'export interface FileBlock {\n type: \'file\';\n attachment: FileAttachmentRef;\n}',
6287
+ },
6288
+ {
6289
+ name: 'FileDiff',
6290
+ declaration: 'export interface FileDiff {\n path: string;\n oldText: string | null;\n newText: string;\n}',
6291
+ },
6292
+ {
6293
+ name: 'FileLocation',
6294
+ declaration: 'export interface FileLocation {\n path: string;\n line?: number;\n}',
6295
+ },
6296
+ {
6297
+ name: 'FileReferenceCandidate',
6298
+ declaration: 'export interface FileReferenceCandidate {\n path: string;\n kind: \'file\' | \'directory\';\n}',
6299
+ },
6300
+ {
6301
+ name: 'FileUploadReceiptId',
6302
+ declaration: 'export type FileUploadReceiptId = Branded<\'file-upload-receipt-id\'>;',
6303
+ },
6304
+ {
6305
+ name: 'FileUploadValue',
6306
+ declaration: 'export interface FileUploadValue {\n readonly receiptId: FileUploadReceiptId;\n readonly file: FileAttachmentRef;\n}',
6307
+ },
6308
+ {
6309
+ name: 'FinishReason',
6310
+ declaration: 'export type FinishReason = FinishReasonMap[keyof FinishReasonMap];',
6311
+ },
6312
+ {
6313
+ name: 'FinishReasonMap',
6314
+ declaration: 'export interface FinishReasonMap {\n \'stop\': {\n kind: \'stop\';\n };\n \'tool-calls\': {\n kind: \'tool-calls\';\n };\n \'max-tokens\': {\n kind: \'max-tokens\';\n };\n \'aborted\': {\n kind: \'aborted\';\n failure: LlmFailure;\n };\n \'error\': {\n kind: \'error\';\n failure: LlmFailure;\n };\n}',
6315
+ },
6316
+ {
6317
+ name: 'ForgeActionFailure',
6318
+ declaration: 'export interface ForgeActionFailure {\n readonly code: \'unauthenticated\' | \'stale\' | \'failed\';\n readonly message: string;\n}',
6319
+ },
6320
+ {
6321
+ name: 'ForgeBranches',
6322
+ declaration: 'export interface ForgeBranches {\n readonly current: string | null;\n readonly branches: readonly string[];\n}',
6323
+ },
6324
+ {
6325
+ name: 'ForgeChangedFile',
6326
+ declaration: 'export interface ForgeChangedFile {\n readonly path: string;\n readonly additions: number;\n readonly deletions: number;\n readonly binary: boolean;\n}',
6327
+ },
6328
+ {
6329
+ name: 'ForgeChangeRequestDiff',
6330
+ declaration: 'export interface ForgeChangeRequestDiff {\n readonly headSha: string;\n readonly files: readonly ForgeDiffFile[];\n readonly localAhead: number | null;\n readonly fileUrls: Readonly<Record<string, string>>;\n}',
6331
+ },
6332
+ {
6333
+ name: 'ForgeChangeRequestListState',
6334
+ declaration: 'export type ForgeChangeRequestListState = Pick<ChangeRequestSnapshot, \'url\' | \'title\' | \'state\' | \'draft\' | \'checksRollup\' | \'reviewDecision\' | \'mergeability\'> & {\n readonly number: number;\n};',
6335
+ },
6336
+ {
6337
+ name: 'ForgeChangeRequestStatesFrame',
6338
+ declaration: 'export type ForgeChangeRequestStatesFrame = {\n readonly type: \'baseline\';\n readonly states: readonly ForgeChangeRequestListState[];\n} | {\n readonly type: \'changed\';\n readonly states: readonly ForgeChangeRequestListState[];\n};',
6339
+ },
6340
+ {
6341
+ name: 'ForgeCheckout',
6342
+ declaration: 'export interface ForgeCheckout {\n readonly root: string;\n readonly branch: string | null;\n readonly linked: boolean;\n readonly commit: string | null;\n}',
6343
+ },
6344
+ {
6345
+ name: 'ForgeCheckoutState',
6346
+ declaration: 'export type ForgeCheckoutState = {\n readonly state: \'pending\';\n} | {\n readonly state: \'none\';\n} | {\n readonly state: \'failed\';\n readonly message: string;\n} | {\n readonly state: \'ready\';\n readonly checkout: ForgeCheckout;\n};',
6347
+ },
6348
+ {
6349
+ name: 'ForgeDiffFile',
6350
+ declaration: 'export interface ForgeDiffFile {\n readonly path: string;\n readonly previousPath: string | null;\n readonly status: ForgeDiffStatus;\n readonly binary: boolean;\n readonly oversized: boolean;\n readonly untracked: boolean;\n readonly additions: number;\n readonly deletions: number;\n readonly hunks: readonly ForgeDiffHunk[];\n}',
6351
+ },
6352
+ {
6353
+ name: 'ForgeDiffHunk',
6354
+ declaration: 'export interface ForgeDiffHunk {\n readonly oldStart: number;\n readonly oldLines: number;\n readonly newStart: number;\n readonly newLines: number;\n readonly lines: readonly string[];\n}',
6355
+ },
6356
+ {
6357
+ name: 'ForgeDiffStatus',
6358
+ declaration: 'export type ForgeDiffStatus = \'added\' | \'deleted\' | \'modified\' | \'renamed\';',
6359
+ },
6360
+ {
6361
+ name: 'ForgeFailure',
6362
+ declaration: 'export interface ForgeFailure {\n readonly code: \'not-found\' | \'unauthenticated\' | \'too-large\' | \'unavailable\';\n readonly message: string;\n}',
6363
+ },
6364
+ {
6365
+ name: 'ForgeLineComment',
6366
+ declaration: 'export interface ForgeLineComment {\n readonly path: string;\n readonly side: \'L\' | \'R\';\n readonly startLine: number;\n readonly endLine: number;\n readonly body: string;\n}',
6367
+ },
6368
+ {
6369
+ name: 'ForgeLocalChanges',
6370
+ declaration: 'export interface ForgeLocalChanges {\n readonly base: string;\n readonly files: readonly ForgeChangedFile[];\n}',
6371
+ },
6372
+ {
6373
+ name: 'ForgeLocalDiff',
6374
+ declaration: 'export interface ForgeLocalDiff {\n readonly base: string | null;\n readonly files: readonly ForgeDiffFile[];\n readonly omitted: number;\n}',
6375
+ },
6376
+ {
6377
+ name: 'ForgeLocalScope',
6378
+ declaration: 'export type ForgeLocalScope = {\n readonly kind: \'branch\';\n} | {\n readonly kind: \'uncommitted\';\n} | {\n readonly kind: \'unstaged\';\n} | {\n readonly kind: \'staged\';\n};',
6379
+ },
6380
+ {
6381
+ name: 'ForgeMissingWorktree',
6382
+ declaration: 'export interface ForgeMissingWorktree {\n readonly branchExists: boolean | null;\n}',
5393
6383
  },
5394
6384
  {
5395
- name: 'EpochHeader',
5396
- declaration: 'export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}',
6385
+ name: 'ForgePanelChangeRequest',
6386
+ declaration: 'export interface ForgePanelChangeRequest extends SessionChangeRequest {\n readonly snapshot: ChangeRequestSnapshot | null;\n}',
5397
6387
  },
5398
6388
  {
5399
- name: 'EventLogOptions',
5400
- declaration: 'export interface EventLogOptions {\n exporter: LogExporterOptions;\n resourceAttributes: Attributes;\n scope: {\n name: string;\n version?: string;\n };\n processor: Omit<BatchLogRecordProcessorOptions, \'exporter\'>;\n onFailure: SessionLogOptions[\'onFailure\'];\n}',
6389
+ name: 'ForgePanelState',
6390
+ declaration: 'export interface ForgePanelState {\n readonly directory: string;\n readonly checkout: ForgeCheckoutState;\n readonly repository: ForgeRepository | null;\n readonly readiness: ForgeReadiness | null;\n readonly changeRequests: readonly ForgePanelChangeRequest[];\n readonly worktree: ForgePanelWorktree;\n readonly local: ForgeLocalChanges | null;\n}',
5401
6391
  },
5402
6392
  {
5403
- name: 'EventLogReporter',
5404
- declaration: 'export class EventLogReporter {\n constructor(options: EventLogOptions);\n emit(record: OTelEventRecord): void;\n async shutdown(signal?: AbortSignal): Promise<void>;\n}',
6393
+ name: 'ForgePanelWorktree',
6394
+ declaration: 'export interface ForgePanelWorktree {\n readonly editable: boolean;\n readonly blocker: ForgeWorktreeBlocker | null;\n readonly request: ForgeWorktreeRequest | null;\n readonly created: ForgeSessionWorktree | null;\n readonly creation: ForgeWorktreeCreation | null;\n readonly failure: ForgeWorktreeFailure | null;\n readonly missing: ForgeMissingWorktree | null;\n readonly restoration: ForgeWorktreeRestoration | null;\n readonly waiting: ForgeWorktreeWaiting | null;\n}',
5405
6395
  },
5406
6396
  {
5407
- name: 'EveryScheduleRecord',
5408
- declaration: 'export interface EveryScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: \'every\';\n readonly title: string;\n readonly prompt: string;\n readonly everySeconds: number;\n readonly scheduledAt: string;\n}',
6397
+ name: 'ForgeProvider',
6398
+ declaration: 'export interface ForgeProvider {\n readonly forge: string;\n submitReview?(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise<ForgeReviewResult>;\n repositoryFromRemote(url: string): ForgeRepository | undefined;\n changeRequestFromUrl(url: string): ChangeRequestRef | undefined;\n changeRequestUrl(ref: ChangeRequestRef): string;\n fetch(refs: readonly ChangeRequestRef[], signal: AbortSignal): Promise<ReadonlyMap<ChangeRequestKey, ChangeRequestSnapshot | ForgeFailure>>;\n fetchChecks?(ref: ChangeRequestRef, signal: AbortSignal): Promise<ChangeRequestSnapshot | ForgeFailure>;\n findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise<readonly ChangeRequestRef[]>;\n readiness(host: string, signal: AbortSignal): Promise<ForgeReadiness>;\n markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise<ForgeActionFailure | undefined>;\n merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise<ForgeActionFailure | undefined>;\n diff(ref: ChangeRequestRef, signal: AbortSignal): Promise<string | ForgeFailure>;\n fileText(ref: ChangeRequestRef, commit: string, path: string, signal: AbortSignal): Promise<string | ForgeFailure>;\n fileUrl(ref: ChangeRequestRef, commit: string, path: string): string;\n}',
5409
6399
  },
5410
6400
  {
5411
- name: 'FeedbackCategory',
5412
- declaration: 'export type FeedbackCategory = \'task-result\' | \'instruction-following\' | \'product-interaction\' | \'service-stability\' | \'resource-cost\' | \'security-privacy-permission\' | \'other\';',
6401
+ name: 'ForgeReadiness',
6402
+ declaration: 'export interface ForgeReadiness {\n readonly state: \'ready\' | \'unauthenticated\' | \'unavailable\';\n readonly message: string | null;\n}',
5413
6403
  },
5414
6404
  {
5415
- name: 'FiberState',
5416
- declaration: 'export const enum FiberState {\n PENDING,\n LOADING,\n ACTIVE,\n FAILED,\n DISPOSED,\n UNLOADING\n}',
6405
+ name: 'ForgeRepository',
6406
+ declaration: 'export interface ForgeRepository {\n readonly forge: string;\n readonly host: string;\n readonly owner: string;\n readonly name: string;\n}',
5417
6407
  },
5418
6408
  {
5419
- name: 'FileAttachmentRef',
5420
- declaration: 'export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}',
6409
+ name: 'ForgeReviewRequest',
6410
+ declaration: 'export type ForgeReviewRequest = {\n readonly headSha: string;\n} & ({\n readonly kind: \'comment\';\n readonly comment: ForgeLineComment;\n} | {\n readonly kind: \'review\';\n readonly event: \'comment\' | \'approve\' | \'request-changes\';\n readonly body: string;\n readonly comments: readonly ForgeLineComment[];\n});',
5421
6411
  },
5422
6412
  {
5423
- name: 'FileBlock',
5424
- declaration: 'export interface FileBlock {\n type: \'file\';\n attachment: FileAttachmentRef;\n}',
6413
+ name: 'ForgeReviewResult',
6414
+ declaration: 'export type ForgeReviewResult = {\n readonly ok: true;\n readonly url: string;\n} | {\n readonly ok: false;\n readonly code: \'unsupported\' | \'stale\' | \'failed\' | \'unknown\';\n readonly message: string;\n};',
5425
6415
  },
5426
6416
  {
5427
- name: 'FileDiff',
5428
- declaration: 'export interface FileDiff {\n path: string;\n oldText: string | null;\n newText: string;\n}',
6417
+ name: 'ForgeSessionWorktree',
6418
+ declaration: 'export interface ForgeSessionWorktree {\n readonly path: string;\n readonly branch: string;\n readonly from: string | null;\n readonly baseCommit: string;\n readonly repositoryRoot: string;\n}',
5429
6419
  },
5430
6420
  {
5431
- name: 'FileLocation',
5432
- declaration: 'export interface FileLocation {\n path: string;\n line?: number;\n}',
6421
+ name: 'ForgeWorktreeBlocker',
6422
+ declaration: 'export type ForgeWorktreeBlocker = \'not-git\' | \'outside-writable-root\' | \'read-only\';',
5433
6423
  },
5434
6424
  {
5435
- name: 'FileReferenceCandidate',
5436
- declaration: 'export interface FileReferenceCandidate {\n path: string;\n kind: \'file\' | \'directory\';\n}',
6425
+ name: 'ForgeWorktreeCreation',
6426
+ declaration: 'export interface ForgeWorktreeCreation {\n readonly phase: \'prepare\' | \'checkout\';\n readonly branch: string;\n readonly from: string | null;\n readonly held: boolean;\n}',
5437
6427
  },
5438
6428
  {
5439
- name: 'FileUploadReceiptId',
5440
- declaration: 'export type FileUploadReceiptId = Branded<\'file-upload-receipt-id\'>;',
6429
+ name: 'ForgeWorktreeFailure',
6430
+ declaration: 'export interface ForgeWorktreeFailure {\n readonly branch: string | null;\n readonly from: string | null;\n readonly phase: \'prepare\' | \'checkout\';\n readonly message: string;\n}',
5441
6431
  },
5442
6432
  {
5443
- name: 'FileUploadValue',
5444
- declaration: 'export interface FileUploadValue {\n readonly receiptId: FileUploadReceiptId;\n readonly file: FileAttachmentRef;\n}',
6433
+ name: 'ForgeWorktreeRequest',
6434
+ declaration: 'export interface ForgeWorktreeRequest {\n readonly from: string | null;\n}',
5445
6435
  },
5446
6436
  {
5447
- name: 'FinishReason',
5448
- declaration: 'export type FinishReason = FinishReasonMap[keyof FinishReasonMap];',
6437
+ name: 'ForgeWorktreeRestoration',
6438
+ declaration: 'export interface ForgeWorktreeRestoration {\n readonly phase: \'prepare\' | \'checkout\';\n}',
5449
6439
  },
5450
6440
  {
5451
- name: 'FinishReasonMap',
5452
- declaration: 'export interface FinishReasonMap {\n \'stop\': {\n kind: \'stop\';\n };\n \'tool-calls\': {\n kind: \'tool-calls\';\n };\n \'max-tokens\': {\n kind: \'max-tokens\';\n };\n \'aborted\': {\n kind: \'aborted\';\n failure: LlmFailure;\n };\n \'error\': {\n kind: \'error\';\n failure: LlmFailure;\n };\n}',
6441
+ name: 'ForgeWorktreeWaiting',
6442
+ declaration: 'export type ForgeWorktreeWaiting = \'creation\' | \'restoration\';',
5453
6443
  },
5454
6444
  {
5455
- name: 'FrequencyTooHighError',
5456
- declaration: 'export interface FrequencyTooHighError {\n readonly code: \'frequency_too_high\';\n readonly message: string;\n}',
6445
+ name: 'FsDeleteOutcome',
6446
+ declaration: 'export interface FsDeleteOutcome {\n before: string | null;\n}',
5457
6447
  },
5458
6448
  {
5459
6449
  name: 'FsDirEntry',
@@ -5467,10 +6457,22 @@ export const TYPE_API = [
5467
6457
  name: 'FsEditRequest',
5468
6458
  declaration: 'export interface FsEditRequest {\n oldString: string;\n newString: string;\n replaceAll: boolean;\n}',
5469
6459
  },
6460
+ {
6461
+ name: 'FsErrorCode',
6462
+ declaration: 'export type FsErrorCode = typeof FS_ERROR_CODES[number];',
6463
+ },
5470
6464
  {
5471
6465
  name: 'FsInfo',
5472
6466
  declaration: 'export interface FsInfo {\n version: FsVersion;\n type: \'file\' | \'directory\' | \'other\';\n size?: number;\n}',
5473
6467
  },
6468
+ {
6469
+ name: 'FsMoveOutcome',
6470
+ declaration: 'export type FsMoveOutcome = {\n sourceBefore: string | null;\n destination: FsWriteOutcome;\n sourceDeleted: true;\n} | {\n sourceBefore: string | null;\n destination: FsWriteOutcome;\n sourceDeleted: false;\n sourceFailure: FsMoveSourceFailure;\n};',
6471
+ },
6472
+ {
6473
+ name: 'FsMoveSourceFailure',
6474
+ declaration: 'export interface FsMoveSourceFailure {\n code: FsErrorCode;\n message: string;\n}',
6475
+ },
5474
6476
  {
5475
6477
  name: 'FsObservation',
5476
6478
  declaration: 'export type FsObservation = {\n readonly kind: \'present\';\n readonly version: FsVersion;\n} | {\n readonly kind: \'absent\';\n};',
@@ -5501,7 +6503,7 @@ export const TYPE_API = [
5501
6503
  },
5502
6504
  {
5503
6505
  name: 'GenerateOptions',
5504
- declaration: 'export interface GenerateOptions {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n messages: RequestMessage[];\n system?: string;\n tools?: ToolSchema[];\n toolHistory?: ToolHistory;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n signal?: AbortSignal;\n sessionId?: Branded<\'SessionId\'>;\n purpose?: \'compaction\' | \'session-title\';\n}',
6506
+ declaration: 'export interface GenerateOptions<Purpose extends string = LlmRequestPurpose> {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n messages: RequestMessage[];\n system?: string;\n tools?: ToolSchema[];\n toolHistory?: ToolHistory;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n signal?: AbortSignal;\n sessionId?: Branded<\'SessionId\'>;\n purpose?: Purpose;\n}',
5505
6507
  },
5506
6508
  {
5507
6509
  name: 'GenericCallView',
@@ -5607,6 +6609,10 @@ export const TYPE_API = [
5607
6609
  name: 'ImageRequestTarget',
5608
6610
  declaration: 'export interface ImageRequestTarget {\n width: number;\n height: number;\n maxBytes: number;\n}',
5609
6611
  },
6612
+ {
6613
+ name: 'ImageUploadValue',
6614
+ declaration: 'export interface ImageUploadValue {\n readonly receiptId: FileUploadReceiptId;\n readonly image: ImageAttachmentRef;\n}',
6615
+ },
5610
6616
  {
5611
6617
  name: 'ImageVariantId',
5612
6618
  declaration: 'export type ImageVariantId = Branded<\'ImageVariantId\'>;',
@@ -5651,26 +6657,6 @@ export const TYPE_API = [
5651
6657
  name: 'InstallSpecKind',
5652
6658
  declaration: 'export type InstallSpecKind = \'registry\' | \'path\' | \'git\' | \'tarball\';',
5653
6659
  },
5654
- {
5655
- name: 'InternalScheduleError',
5656
- declaration: 'export interface InternalScheduleError {\n readonly code: \'internal_error\';\n readonly message: string;\n}',
5657
- },
5658
- {
5659
- name: 'InvalidPromptError',
5660
- declaration: 'export interface InvalidPromptError {\n readonly code: \'invalid_prompt\';\n readonly message: string;\n}',
5661
- },
5662
- {
5663
- name: 'InvalidRuleError',
5664
- declaration: 'export interface InvalidRuleError {\n readonly code: \'invalid_rule\';\n readonly message: string;\n}',
5665
- },
5666
- {
5667
- name: 'InvalidSelectorError',
5668
- declaration: 'export interface InvalidSelectorError {\n readonly code: \'invalid_selector\';\n readonly message: string;\n}',
5669
- },
5670
- {
5671
- name: 'InvalidTimeZoneError',
5672
- declaration: 'export interface InvalidTimeZoneError {\n readonly code: \'invalid_time_zone\';\n readonly message: string;\n}',
5673
- },
5674
6660
  {
5675
6661
  name: 'InvocationDescriptor',
5676
6662
  declaration: 'export interface InvocationDescriptor {\n readonly id: string;\n readonly service: string;\n readonly namespace: string;\n readonly method: string;\n readonly implementation?: string;\n readonly mode?: \'stream\';\n readonly invocation: {\n readonly kind: \'direct\';\n } | {\n readonly kind: \'context\';\n readonly context: string;\n readonly wire: string;\n readonly codec: TypertCodec;\n };\n readonly scope?: {\n readonly context: string;\n readonly wire: string;\n };\n readonly parameters: readonly InvocationParameterDescriptor[];\n readonly uplink?: {\n readonly codec: TypertCodec;\n };\n readonly cancellation?: {\n readonly parameter: \'signal\';\n };\n readonly result: TypertCodec;\n readonly description?: string;\n readonly sourceLocation?: InvocationSourceLocation;\n}',
@@ -5821,16 +6807,20 @@ export const TYPE_API = [
5821
6807
  },
5822
6808
  {
5823
6809
  name: 'KvTable',
5824
- declaration: 'export interface KvTable<K extends string, V> {\n get(key: K): V | undefined;\n entries(): IterableIterator<[\n K,\n V\n ]>;\n keys(): IterableIterator<K>;\n readonly size: number;\n put(key: K, value: V): Promise<void>;\n delete(key: K): Promise<boolean>;\n update(key: K, fn: (current: V) => V): Promise<V>;\n}',
6810
+ declaration: 'export interface KvTable<K extends string, V> {\n get(key: K): V | undefined;\n entries(): IterableIterator<[\n K,\n V\n ]>;\n keys(): IterableIterator<K>;\n readonly size: number;\n put(key: K, value: V): Promise<void>;\n delete(key: K): Promise<boolean>;\n deleteMany(keys: readonly K[]): Promise<number>;\n update(key: K, fn: (current: V) => V): Promise<V>;\n}',
5825
6811
  },
5826
6812
  {
5827
6813
  name: 'KvUnit',
5828
- declaration: 'export interface KvUnit {\n loadAll(): Promise<{\n tables: Record<string, Record<string, unknown>>;\n global: unknown;\n }>;\n putRecord(table: string, key: string, value: unknown): Promise<void>;\n deleteRecord(table: string, key: string): Promise<void>;\n backupRecord?(table: string, key: string): Promise<string>;\n setGlobal(value: unknown): Promise<void>;\n close(): Promise<void>;\n}',
6814
+ declaration: 'export interface KvUnit {\n loadAll(): Promise<{\n tables: Record<string, Record<string, unknown>>;\n global: unknown;\n }>;\n putRecord(table: string, key: string, value: unknown): Promise<void>;\n deleteRecord(table: string, key: string): Promise<void>;\n deleteRecords(table: string, keys: readonly string[]): Promise<void>;\n backupRecord?(table: string, key: string): Promise<string>;\n setGlobal(value: unknown): Promise<void>;\n close(): Promise<void>;\n}',
5829
6815
  },
5830
6816
  {
5831
6817
  name: 'KvUnitDescriptor',
5832
6818
  declaration: 'export interface KvUnitDescriptor {\n readonly name: string;\n readonly version: number;\n readonly tables: readonly string[];\n readonly hasGlobal: boolean;\n readonly layout?: \'single\' | \'per-record\';\n readonly compatibleVersions?: readonly number[];\n}',
5833
6819
  },
6820
+ {
6821
+ name: 'ListVersionsOptions',
6822
+ declaration: 'export interface ListVersionsOptions {\n readonly registry?: Registry;\n}',
6823
+ },
5834
6824
  {
5835
6825
  name: 'LlmAdapter',
5836
6826
  declaration: 'export abstract class LlmAdapter {\n providerInfo(provider: string): LlmProviderInfo;\n providerRetryPolicy(_provider: string): ResolvedRetryPolicy | undefined;\n imageRequestPricing(_provider: string, _model: string): LlmImageRequestPricing | undefined;\n imageRequestTarget(_provider: string, _model: string, image: ImageAttachmentRef): ImageRequestTarget;\n listModels(_provider: string): Promise<readonly LlmModelInfo[]>;\n resolveModel(provider: string, model: string, _signal?: AbortSignal): Promise<LlmResolvedModelInfo>;\n async prepareCall(provider: string, model: string, signal?: AbortSignal): Promise<PreparedAdapterCall>;\n abstract stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n}',
@@ -5871,6 +6861,14 @@ export const TYPE_API = [
5871
6861
  name: 'LlmImageRequestPricing',
5872
6862
  declaration: 'export interface LlmImageRequestPricing {\n priceImages(images: readonly ImageBlock[]): readonly LlmImageRequestPrice[];\n}',
5873
6863
  },
6864
+ {
6865
+ name: 'LlmModelBadge',
6866
+ declaration: 'export interface LlmModelBadge {\n text: LocalizedText;\n tone: LlmModelBadgeTone;\n}',
6867
+ },
6868
+ {
6869
+ name: 'LlmModelBadgeTone',
6870
+ declaration: 'export type LlmModelBadgeTone = \'neutral\' | \'info\' | \'success\' | \'warning\';',
6871
+ },
5874
6872
  {
5875
6873
  name: 'LlmModelContext',
5876
6874
  declaration: 'export interface LlmModelContext {\n contextWindow: number;\n}',
@@ -5881,7 +6879,7 @@ export const TYPE_API = [
5881
6879
  },
5882
6880
  {
5883
6881
  name: 'LlmModelInfo',
5884
- declaration: 'export interface LlmModelInfo {\n provider: string;\n id: string;\n name: string;\n description?: string;\n inputModalities?: readonly ModelModality[];\n}',
6882
+ declaration: 'export interface LlmModelInfo {\n provider: string;\n id: string;\n name: string;\n description?: string;\n inputModalities?: readonly ModelModality[];\n badge?: LlmModelBadge;\n}',
5885
6883
  },
5886
6884
  {
5887
6885
  name: 'LlmModelReasoningInfo',
@@ -5899,6 +6897,14 @@ export const TYPE_API = [
5899
6897
  name: 'LlmReasoningEffortInfo',
5900
6898
  declaration: 'export interface LlmReasoningEffortInfo {\n id: ReasoningEffortId;\n name: string;\n description?: string;\n}',
5901
6899
  },
6900
+ {
6901
+ name: 'LlmRequestPurpose',
6902
+ declaration: 'export type LlmRequestPurpose = Extract<keyof LlmRequestPurposeMap, string>;',
6903
+ },
6904
+ {
6905
+ name: 'LlmRequestPurposeMap',
6906
+ declaration: 'export interface LlmRequestPurposeMap {\n}',
6907
+ },
5902
6908
  {
5903
6909
  name: 'LlmResolvedModelInfo',
5904
6910
  declaration: 'export interface LlmResolvedModelInfo extends LlmModelInfo {\n context?: LlmModelContext;\n defaultMaxTokens?: number;\n reasoning?: LlmModelReasoningInfo;\n systemPromptUpdate?: SystemPromptUpdate;\n toolUpdate?: ToolUpdate;\n}',
@@ -5961,7 +6967,7 @@ export const TYPE_API = [
5961
6967
  },
5962
6968
  {
5963
6969
  name: 'ManagementError',
5964
- declaration: 'export interface ManagementError {\n code: ReadOnlyReason | \'unknown-plugin\' | \'invalid-spec\' | \'already-installed\' | \'ambiguous-install\' | \'not-bundle\' | \'not-removable\' | \'stop-profile\' | \'bundle-in-use\' | \'stale-approval\' | \'incompatible-version\' | \'operation-error\';\n diagnostic?: string;\n incompatible?: IncompatiblePlugin[];\n}',
6970
+ declaration: 'export interface ManagementError {\n code: ReadOnlyReason | \'unknown-plugin\' | \'invalid-spec\' | \'already-installed\' | \'ambiguous-install\' | \'not-bundle\' | \'not-removable\' | \'stop-profile\' | \'bundle-in-use\' | \'stale-approval\' | \'incompatible-version\' | \'unsupported-platform\' | \'operation-error\';\n diagnostic?: string;\n incompatible?: IncompatiblePlugin[];\n}',
5965
6971
  },
5966
6972
  {
5967
6973
  name: 'ManualCompactAgentContext',
@@ -6055,6 +7061,18 @@ export const TYPE_API = [
6055
7061
  name: 'McpResourceRequest',
6056
7062
  declaration: 'export type McpResourceRequest = {\n method: \'resources/list\' | \'resources/templates/list\';\n cursor?: string;\n} | {\n method: \'resources/read\';\n uri: string;\n};',
6057
7063
  },
7064
+ {
7065
+ name: 'Mergeability',
7066
+ declaration: 'export type Mergeability = \'mergeable\' | \'conflicting\' | \'unknown\';',
7067
+ },
7068
+ {
7069
+ name: 'MergeMethod',
7070
+ declaration: 'export type MergeMethod = \'merge\' | \'squash\' | \'rebase\';',
7071
+ },
7072
+ {
7073
+ name: 'MergeRequest',
7074
+ declaration: 'export interface MergeRequest {\n readonly method: MergeMethod;\n readonly headSha: string;\n}',
7075
+ },
6058
7076
  {
6059
7077
  name: 'Message',
6060
7078
  declaration: 'export type Message = MessageRoleMap[keyof MessageRoleMap];',
@@ -6161,7 +7179,7 @@ export const TYPE_API = [
6161
7179
  },
6162
7180
  {
6163
7181
  name: 'ModelCatalogModel',
6164
- declaration: 'export interface ModelCatalogModel {\n readonly id: string;\n readonly name: string;\n readonly description?: string;\n readonly reasoning?: ModelReasoning;\n}',
7182
+ declaration: 'export interface ModelCatalogModel {\n readonly id: string;\n readonly name: string;\n readonly description?: string;\n readonly reasoning?: ModelReasoning;\n readonly badge?: LlmModelBadge;\n}',
6165
7183
  },
6166
7184
  {
6167
7185
  name: 'ModelMessageSource',
@@ -6216,8 +7234,8 @@ export const TYPE_API = [
6216
7234
  declaration: 'export interface NativeFileApplication {\n readonly id: string;\n readonly name: string;\n readonly default: boolean;\n readonly icon: string | null;\n}',
6217
7235
  },
6218
7236
  {
6219
- name: 'NotFutureError',
6220
- declaration: 'export interface NotFutureError {\n readonly code: \'not_future\';\n readonly message: string;\n}',
7237
+ name: 'NpmFileSource',
7238
+ declaration: 'export type NpmFileSource = \'jsdelivr\' | \'unpkg\' | \'npmmirror\';',
6221
7239
  },
6222
7240
  {
6223
7241
  name: 'ObjectJsonSchema',
@@ -6271,6 +7289,30 @@ export const TYPE_API = [
6271
7289
  name: 'OTelEventScalar',
6272
7290
  declaration: 'export type OTelEventScalar = string | number | boolean;',
6273
7291
  },
7292
+ {
7293
+ name: 'OwnerIdentityRequest',
7294
+ declaration: 'export interface OwnerIdentityRequest {\n readonly relay?: string;\n}',
7295
+ },
7296
+ {
7297
+ name: 'OwnerIdentityState',
7298
+ declaration: 'export type OwnerIdentityState = \'verified\' | \'expired\' | \'unverified\' | \'relay-unsupported\';',
7299
+ },
7300
+ {
7301
+ name: 'OwnerIdentityStatus',
7302
+ declaration: 'export interface OwnerIdentityStatus {\n readonly state: OwnerIdentityState;\n readonly relay: string;\n readonly displayName?: string;\n readonly subjectId?: string;\n readonly avatarUrl?: string;\n readonly expiresAt?: string;\n readonly renewed?: boolean;\n readonly claim?: ClaimOutcome;\n}',
7303
+ },
7304
+ {
7305
+ name: 'OwnerRelayState',
7306
+ declaration: 'export interface OwnerRelayState {\n readonly configured?: string;\n readonly override?: string;\n readonly effective?: string;\n}',
7307
+ },
7308
+ {
7309
+ name: 'OwnerShareList',
7310
+ declaration: 'export interface OwnerShareList {\n readonly shares: readonly OwnerShareView[];\n}',
7311
+ },
7312
+ {
7313
+ name: 'OwnerShareView',
7314
+ declaration: 'export interface OwnerShareView {\n readonly shareId: string;\n readonly sessionId: string;\n readonly sessionTitle: string;\n readonly link: string;\n readonly createdAt: string;\n readonly expiresAt?: string;\n readonly allowsFork: boolean;\n readonly sessionMode: \'view\' | \'write\';\n readonly viewerCapabilities: readonly ShareCapabilityGroup[];\n readonly online: boolean;\n readonly access?: ShareAccess;\n}',
7315
+ },
6274
7316
  {
6275
7317
  name: 'PackageResult',
6276
7318
  declaration: 'export interface PackageResult {\n exitCode: number;\n output: string;\n truncated: boolean;\n logPath: string;\n kind?: PluginInstallFailureKind;\n timedOut?: boolean;\n incompatible?: IncompatiblePlugin[];\n}',
@@ -6291,6 +7333,10 @@ export const TYPE_API = [
6291
7333
  name: 'PaneOpenResult',
6292
7334
  declaration: 'export interface PaneOpenResult {\n id: string;\n isPlaced: boolean;\n reason?: string;\n}',
6293
7335
  },
7336
+ {
7337
+ name: 'PatchHunk',
7338
+ declaration: 'export interface PatchHunk {\n lineNumber: number;\n context?: string;\n oldLines: string[];\n newLines: string[];\n isEndOfFile: boolean;\n}',
7339
+ },
6294
7340
  {
6295
7341
  name: 'PeerAdmission',
6296
7342
  declaration: 'export type PeerAdmission = {\n readonly peer: PeerScope;\n} | {\n readonly rejection: 401 | 403;\n};',
@@ -6307,10 +7353,18 @@ export const TYPE_API = [
6307
7353
  name: 'PendingModule',
6308
7354
  declaration: 'export interface PendingModule {\n url: string;\n reason: \'host-module\' | \'unmanaged-plugin\' | \'module-comparison\';\n}',
6309
7355
  },
7356
+ {
7357
+ name: 'PendingRemoteEventInfo',
7358
+ declaration: 'export interface PendingRemoteEventInfo {\n readonly event: string;\n readonly agentId: RemoteEventAgentId;\n}',
7359
+ },
6310
7360
  {
6311
7361
  name: 'PermissionCatalog',
6312
7362
  declaration: 'export interface PermissionCatalog {\n options: PresetOption[];\n defaultOptions: PresetOption[];\n defaultPreset: string;\n}',
6313
7363
  },
7364
+ {
7365
+ name: 'PiAiRequestHeaderContext',
7366
+ declaration: 'export interface PiAiRequestHeaderContext extends Readonly<Pick<GenerateOptions<string>, \'provider\' | \'model\' | \'sessionId\' | \'purpose\'>> {\n readonly baseURL: string;\n}',
7367
+ },
6314
7368
  {
6315
7369
  name: 'PlatformSession',
6316
7370
  declaration: 'export interface PlatformSession {\n readonly origin: string;\n readonly token: string;\n readonly userId: AccountUserId | null;\n readonly embeddedPageDist?: string;\n readonly requestHeaders?: Readonly<Record<string, string>>;\n}',
@@ -6319,6 +7373,18 @@ export const TYPE_API = [
6319
7373
  name: 'PluginChange',
6320
7374
  declaration: 'export interface PluginChange {\n readonly reason: \'plugin\' | \'bundle\' | \'install\' | \'remove\';\n}',
6321
7375
  },
7376
+ {
7377
+ name: 'PluginDetail',
7378
+ declaration: 'export type PluginDetail = {\n readonly status: \'found\';\n readonly origin: PluginDetailOrigin;\n readonly markdown: string;\n readonly document: PluginDetailDocumentId;\n} | {\n readonly status: \'none\';\n};',
7379
+ },
7380
+ {
7381
+ name: 'PluginDetailDocumentId',
7382
+ declaration: 'export type PluginDetailDocumentId = Branded<\'PluginDetailDocumentId\'>;',
7383
+ },
7384
+ {
7385
+ name: 'PluginDetailOrigin',
7386
+ declaration: 'export type PluginDetailOrigin = \'locale\' | \'readme\' | \'repository\';',
7387
+ },
6322
7388
  {
6323
7389
  name: 'PluginEntryId',
6324
7390
  declaration: 'export type PluginEntryId = Branded<\'PluginEntryId\'>;',
@@ -6357,12 +7423,20 @@ export const TYPE_API = [
6357
7423
  },
6358
7424
  {
6359
7425
  name: 'PluginInventoryEntry',
6360
- declaration: 'export interface PluginInventoryEntry {\n readonly entryId: PluginEntryId;\n readonly moduleName: string;\n readonly meta?: PluginLocalizedMeta;\n readonly enabled: boolean;\n readonly fiberPhase: PluginFiberPhase;\n}',
7426
+ declaration: 'export interface PluginInventoryEntry {\n readonly entryId: PluginEntryId;\n readonly moduleName: string;\n readonly meta?: PluginLocalizedMeta;\n readonly enabled: boolean;\n readonly fiberPhase: PluginFiberPhase;\n readonly diagnostic?: string;\n}',
6361
7427
  },
6362
7428
  {
6363
7429
  name: 'PluginLocalizedMeta',
6364
7430
  declaration: 'export interface PluginLocalizedMeta {\n readonly title?: LocalizedText;\n readonly description?: LocalizedText;\n readonly icon?: string;\n readonly error?: string;\n}',
6365
7431
  },
7432
+ {
7433
+ name: 'PluginOperation',
7434
+ declaration: 'export type PluginOperation = {\n readonly id: PluginOperationId;\n readonly time: string;\n readonly reason: PluginChange[\'reason\'];\n readonly target: string | null;\n readonly stage: ChangeResult[\'stage\'];\n readonly enabled?: boolean | undefined;\n readonly version?: string | undefined;\n} & ({\n readonly phase: \'started\';\n} | {\n readonly phase: \'settled\';\n readonly application: ChangeResult[\'application\'];\n readonly changed: boolean;\n readonly errorCode?: ManagementError[\'code\'] | undefined;\n readonly restartReason?: RestartReason | undefined;\n} | {\n readonly phase: \'unknown\';\n});',
7435
+ },
7436
+ {
7437
+ name: 'PluginOperationId',
7438
+ declaration: 'export type PluginOperationId = Branded<\'PluginOperationId\'>;',
7439
+ },
6366
7440
  {
6367
7441
  name: 'PluginOptions',
6368
7442
  declaration: 'export type PluginOptions = Readonly<Record<string, PluginOptionValue>>;',
@@ -6379,6 +7453,26 @@ export const TYPE_API = [
6379
7453
  name: 'PluginSpecInspection',
6380
7454
  declaration: 'export type PluginSpecInspection = {\n readonly status: \'accepted\';\n readonly kind: InstallSpecKind;\n readonly name?: string;\n readonly version?: string;\n readonly description?: string;\n readonly bundle: boolean | null;\n readonly registry: Registry;\n readonly host?: string;\n} | {\n readonly status: \'refused\';\n readonly problem: PluginInspectProblem;\n readonly reason: string;\n readonly registries?: Registry[];\n};',
6381
7455
  },
7456
+ {
7457
+ name: 'PluginUpdateProgress',
7458
+ declaration: 'export interface PluginUpdateProgress {\n readonly requestId: PluginInstallRequestId;\n readonly step: PluginUpdateStep;\n}',
7459
+ },
7460
+ {
7461
+ name: 'PluginUpdateResult',
7462
+ declaration: 'export interface PluginUpdateResult {\n readonly from: string;\n readonly to: string;\n readonly step: \'check\' | \'remove\' | \'install\';\n readonly result: ChangeResult;\n readonly restore?: ChangeResult;\n}',
7463
+ },
7464
+ {
7465
+ name: 'PluginUpdateStep',
7466
+ declaration: 'export type PluginUpdateStep = \'checking\' | \'removing\' | \'installing\' | \'restoring\';',
7467
+ },
7468
+ {
7469
+ name: 'PluginVersion',
7470
+ declaration: 'export interface PluginVersion {\n readonly version: string;\n readonly publishedAt?: string;\n readonly tags: readonly string[];\n readonly prerelease: boolean;\n readonly deprecated?: string;\n readonly bundle: boolean;\n readonly incompatible?: IncompatiblePlugin;\n}',
7471
+ },
7472
+ {
7473
+ name: 'PluginVersionList',
7474
+ declaration: 'export type PluginVersionList = {\n readonly status: \'listed\';\n readonly installed: string;\n readonly registry: Registry;\n readonly attempts: readonly RegistryAttempt[];\n readonly versions: readonly PluginVersion[];\n readonly omitted: number;\n} | {\n readonly status: \'refused\';\n readonly problem: \'not-updatable\' | \'not-found\' | \'network\' | \'unknown\';\n readonly reason: string;\n readonly attempts: readonly RegistryAttempt[];\n};',
7475
+ },
6382
7476
  {
6383
7477
  name: 'PostToolDecision',
6384
7478
  declaration: 'export type PostToolDecision = {\n kind: \'accept\';\n content?: ContentBlock[];\n value?: never;\n additionalContexts?: UserMessage[];\n} | {\n kind: \'accept\';\n value: JsonValue;\n content?: never;\n additionalContexts?: UserMessage[];\n} | {\n kind: \'block\';\n feedback: ContentBlock[];\n additionalContexts?: UserMessage[];\n};',
@@ -6469,7 +7563,19 @@ export const TYPE_API = [
6469
7563
  },
6470
7564
  {
6471
7565
  name: 'ProjectionDefinition',
6472
- declaration: 'export interface ProjectionDefinition<K extends keyof SessionProjectionStateMap, S extends SessionProjectionStateMap[K] = SessionProjectionStateMap[K]> {\n key: K;\n stateSchema: ZodType<S>;\n init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>;\n apply(state: NoInfer<S>, event: SessionEvent): NoInfer<S>;\n wire?: K extends keyof SessionProjectionMap ? {\n viewSchema: ZodType<SessionProjectionMap[K]>;\n view(state: NoInfer<S>): SessionProjectionMap[K];\n } : never;\n stateVersion: number;\n}',
7566
+ declaration: 'export interface ProjectionDefinition<K extends string, S> {\n key: K;\n stateSchema: ZodType<S>;\n init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>;\n apply(state: NoInfer<S>, event: SessionEvent): NoInfer<S>;\n wire?: K extends keyof SessionProjectionMap ? {\n viewSchema: ZodType<SessionProjectionViewValue<SessionProjectionMap[K]>>;\n view(state: NoInfer<S>): SessionProjectionViewValue<SessionProjectionMap[K]>;\n summary?: boolean;\n } : never;\n stateVersion: number;\n}',
7567
+ },
7568
+ {
7569
+ name: 'ProjectionEventChangeListener',
7570
+ declaration: 'export type ProjectionEventChangeListener = (session: Session, changes: readonly {\n readonly key: Extract<keyof SessionProjectionMap, string>;\n readonly val: unknown;\n}[], seq: SessionSeq) => void;',
7571
+ },
7572
+ {
7573
+ name: 'ProjectionHandle',
7574
+ declaration: 'export interface ProjectionHandle<S> {\n stateOf(session: Session): S;\n readerFor(session: Session): () => S;\n dispose(): Promise<void>;\n}',
7575
+ },
7576
+ {
7577
+ name: 'ProjectionKeySelection',
7578
+ declaration: 'export type ProjectionKeySelection = readonly Extract<keyof SessionProjectionMap, string>[] | ReadonlySet<Extract<keyof SessionProjectionMap, string>>;',
6473
7579
  },
6474
7580
  {
6475
7581
  name: 'ProjectionSnapshot',
@@ -6477,7 +7583,7 @@ export const TYPE_API = [
6477
7583
  },
6478
7584
  {
6479
7585
  name: 'PromptAssembly',
6480
- declaration: 'export interface PromptAssembly {\n sections: AssembledSection[];\n contexts: AssembledContext[];\n tools: ToolSchema[];\n variables: Record<string, string | undefined>;\n}',
7586
+ declaration: 'export interface PromptAssembly extends PromptPresentation {\n tools: ToolSchema[];\n}',
6481
7587
  },
6482
7588
  {
6483
7589
  name: 'PromptContext',
@@ -6495,6 +7601,10 @@ export const TYPE_API = [
6495
7601
  name: 'PromptOrigin',
6496
7602
  declaration: 'export type PromptOrigin = {\n kind: \'composer\';\n} | {\n kind: \'plugin\';\n name: string;\n};',
6497
7603
  },
7604
+ {
7605
+ name: 'PromptPresentation',
7606
+ declaration: 'export interface PromptPresentation {\n sections: AssembledSection[];\n contexts: AssembledContext[];\n variables: Record<string, string | undefined>;\n}',
7607
+ },
6498
7608
  {
6499
7609
  name: 'PromptSection',
6500
7610
  declaration: 'export interface PromptSection {\n readonly name: string;\n readonly order: number;\n readonly text: string | ((context: AssembleContext) => string);\n readonly interpolate?: boolean;\n readonly complete?: boolean;\n}',
@@ -6591,9 +7701,13 @@ export const TYPE_API = [
6591
7701
  name: 'ReasoningEffortId',
6592
7702
  declaration: 'export type ReasoningEffortId = Branded<\'ReasoningEffortId\'>;',
6593
7703
  },
7704
+ {
7705
+ name: 'RecommendationDetails',
7706
+ declaration: 'export type RecommendationDetails = {\n readonly status: \'available\';\n readonly title: LocalizedText;\n readonly description: LocalizedText;\n readonly enabled: boolean;\n} | {\n readonly status: \'refused\';\n readonly reason: \'unknown\' | \'unavailable\' | \'not-live-root\' | \'closing\';\n};',
7707
+ },
6594
7708
  {
6595
7709
  name: 'RecurringScheduleRecord',
6596
- declaration: 'export type RecurringScheduleRecord = EveryScheduleRecord | DailyScheduleRecord | WeeklyScheduleRecord | CronScheduleRecord;',
7710
+ declaration: 'export type RecurringScheduleRecord = EveryScheduleRecord | DailyScheduleRecord | WeeklyScheduleRecord | CronScheduleRecord | RRuleScheduleRecord;',
6597
7711
  },
6598
7712
  {
6599
7713
  name: 'RedactedSecret',
@@ -6603,6 +7717,18 @@ export const TYPE_API = [
6603
7717
  name: 'Registry',
6604
7718
  declaration: 'export type Registry = string | null;',
6605
7719
  },
7720
+ {
7721
+ name: 'RegistryAttempt',
7722
+ declaration: 'export interface RegistryAttempt {\n readonly registry: Registry;\n readonly problem?: \'not-found\' | \'network\' | \'unknown\';\n readonly reason?: string;\n}',
7723
+ },
7724
+ {
7725
+ name: 'RelayConnectivityView',
7726
+ declaration: 'export interface RelayConnectivityView {\n readonly ok: boolean;\n readonly httpReachable: boolean;\n readonly blocking: boolean;\n readonly error?: string;\n}',
7727
+ },
7728
+ {
7729
+ name: 'RelayPublishView',
7730
+ declaration: 'export interface RelayPublishView {\n readonly ok: boolean;\n readonly blocking: boolean;\n readonly error?: string;\n}',
7731
+ },
6606
7732
  {
6607
7733
  name: 'Reload',
6608
7734
  declaration: 'export interface Reload {\n filename: string;\n modules: ReloadModules;\n runtime?: Plugin.Runtime | undefined;\n}',
@@ -6675,6 +7801,10 @@ export const TYPE_API = [
6675
7801
  name: 'RemoteErrorDetailsMap',
6676
7802
  declaration: 'export interface RemoteErrorDetailsMap {\n \'gateway/bad-request\': {\n readonly issues?: readonly object[];\n };\n \'gateway/cancelled\': {};\n \'gateway/internal\': {};\n}',
6677
7803
  },
7804
+ {
7805
+ name: 'RemoteEventAgentId',
7806
+ declaration: 'export type RemoteEventAgentId = Branded<\'RemoteEventAgentId\'>;',
7807
+ },
6678
7808
  {
6679
7809
  name: 'RemoteEventHostInfo',
6680
7810
  declaration: 'export interface RemoteEventHostInfo {\n readonly home: string;\n}',
@@ -6747,6 +7877,10 @@ export const TYPE_API = [
6747
7877
  name: 'ResolvedSubagentStartRequest',
6748
7878
  declaration: 'export interface ResolvedSubagentStartRequest extends SubagentStartRequest {\n readonly cwd: string;\n}',
6749
7879
  },
7880
+ {
7881
+ name: 'ResolvedToolSet',
7882
+ declaration: 'export interface ResolvedToolSet {\n dispose(): void;\n view(scope: ScopeKey | undefined): ReadonlyMap<string, ToolDefinition>;\n}',
7883
+ },
6750
7884
  {
6751
7885
  name: 'RestartReason',
6752
7886
  declaration: 'export type RestartReason = \'no-hmr\' | \'package-moved\' | \'host-module\' | \'unmanaged-plugin\' | \'module-comparison\';',
@@ -6755,14 +7889,30 @@ export const TYPE_API = [
6755
7889
  name: 'RestoredSessionOptions',
6756
7890
  declaration: 'export interface RestoredSessionOptions {\n readonly seed: SessionEvent[];\n readonly meta: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n readonly eventState: SessionSeedEventState;\n}',
6757
7891
  },
7892
+ {
7893
+ name: 'RestoredWorktree',
7894
+ declaration: 'export interface RestoredWorktree {\n path: string;\n branchRecreated: boolean;\n}',
7895
+ },
7896
+ {
7897
+ name: 'RestoreWorktreeRequest',
7898
+ declaration: 'export interface RestoreWorktreeRequest {\n path: string;\n branch: string;\n baseCommit: string;\n repositoryRoot: string;\n}',
7899
+ },
6758
7900
  {
6759
7901
  name: 'ResumeAgentOptions',
6760
7902
  declaration: 'export interface ResumeAgentOptions {\n readonly resumeSessionId: SessionId;\n readonly parentAgent?: Agent;\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}',
6761
7903
  },
7904
+ {
7905
+ name: 'ReviewDecision',
7906
+ declaration: 'export type ReviewDecision = \'approved\' | \'changes-requested\' | \'review-required\' | \'none\';',
7907
+ },
6762
7908
  {
6763
7909
  name: 'RpcId',
6764
7910
  declaration: 'export type RpcId = Branded<\'rpc-id\'>;',
6765
7911
  },
7912
+ {
7913
+ name: 'RRuleScheduleRecord',
7914
+ declaration: 'export interface RRuleScheduleRecord {\n readonly kind: \'rrule\';\n readonly id: ScheduleId;\n readonly title: string;\n readonly prompt: string;\n readonly rrule: string;\n readonly scheduledAt: string;\n}',
7915
+ },
6766
7916
  {
6767
7917
  name: 'RunnerFailureRule',
6768
7918
  declaration: 'export interface RunnerFailureRule {\n allowedExitCodes?: readonly number[];\n fatalSignatures: readonly string[];\n informationalLines?: readonly string[];\n}',
@@ -6773,7 +7923,7 @@ export const TYPE_API = [
6773
7923
  },
6774
7924
  {
6775
7925
  name: 'SandboxExecutionPolicy',
6776
- declaration: 'export interface SandboxExecutionPolicy {\n mode: SandboxMode;\n workspaceRoot: string;\n sessionId?: SessionId;\n}',
7926
+ declaration: 'export interface SandboxExecutionPolicy {\n mode: SandboxMode;\n workspaceRoot: string;\n additionalWritableRoots?: readonly string[];\n sessionId?: SessionId;\n}',
6777
7927
  },
6778
7928
  {
6779
7929
  name: 'SandboxMode',
@@ -6805,43 +7955,59 @@ export const TYPE_API = [
6805
7955
  },
6806
7956
  {
6807
7957
  name: 'ScheduleCatalogEntry',
6808
- declaration: 'export type ScheduleCatalogEntry = ScheduleRecord & {\n readonly sessionId: SessionId;\n readonly status: \'active\' | \'inactive\';\n readonly lastDelivery?: ScheduleDeliveryReceipt;\n};',
7958
+ declaration: 'export type ScheduleCatalogEntry = ScheduleRecord & {\n readonly target: ScheduleTarget;\n readonly involvedSessionIds: SessionId[];\n readonly status: \'active\' | \'paused\' | \'ended\';\n readonly createdAt?: string;\n readonly updatedAt?: string;\n readonly executionActive?: true;\n readonly deliveryFloorEndsAt?: string;\n readonly lastDelivery?: ScheduleDeliveryReceipt;\n};',
7959
+ },
7960
+ {
7961
+ name: 'ScheduleConflictResult',
7962
+ declaration: 'export interface ScheduleConflictResult {\n readonly id: ScheduleId;\n readonly code: \'schedule_conflict\';\n}',
6809
7963
  },
6810
7964
  {
6811
7965
  name: 'ScheduleCreateRequest',
6812
- declaration: 'export interface ScheduleCreateRequest {\n prompt: string;\n title: string;\n after_seconds?: number;\n at?: AtInput;\n every_seconds?: number;\n daily?: DailyInput;\n weekly?: WeeklyInput;\n cron?: CronInput;\n}',
7966
+ declaration: 'export interface ScheduleCreateRequest {\n readonly title: string;\n readonly prompt: string;\n readonly timing: ScheduleTiming;\n readonly target?: ScheduleTargetRequest;\n}',
6813
7967
  },
6814
7968
  {
6815
- name: 'ScheduleDeleteRequest',
6816
- declaration: 'export interface ScheduleDeleteRequest extends ScheduleListRequest {\n id: ScheduleId;\n}',
7969
+ name: 'ScheduleDeleteInactiveResult',
7970
+ declaration: 'export interface ScheduleDeleteInactiveResult {\n readonly deleted: number;\n}',
6817
7971
  },
6818
7972
  {
6819
7973
  name: 'ScheduleDeleteResult',
6820
7974
  declaration: 'export type ScheduleDeleteResult = {\n readonly id: ScheduleId;\n readonly deleted: true;\n} | {\n readonly id: ScheduleId;\n readonly deleted: false;\n readonly code: \'schedule_not_found\';\n};',
6821
7975
  },
7976
+ {
7977
+ name: 'ScheduleDeliveryHistoryMiss',
7978
+ declaration: 'export interface ScheduleDeliveryHistoryMiss {\n readonly id: ScheduleId;\n readonly code: \'schedule_not_found\' | \'delivery_cursor_not_found\';\n}',
7979
+ },
7980
+ {
7981
+ name: 'ScheduleDeliveryHistoryPage',
7982
+ declaration: 'export interface ScheduleDeliveryHistoryPage {\n readonly id: ScheduleId;\n readonly records: ScheduleDeliveryRecord[];\n readonly earlierRecordsUnavailable: boolean;\n readonly earlierRecordsPruned: boolean;\n readonly retention: DeliveryRetentionBounds;\n readonly nextBefore?: MessageId;\n}',
7983
+ },
6822
7984
  {
6823
7985
  name: 'ScheduleDeliveryHistoryRequest',
6824
- declaration: 'export interface ScheduleDeliveryHistoryRequest extends ScheduleDeleteRequest {\n limit: number;\n before?: MessageId;\n}',
7986
+ declaration: 'export interface ScheduleDeliveryHistoryRequest {\n readonly id: ScheduleId;\n readonly limit: number;\n readonly before?: MessageId;\n}',
6825
7987
  },
6826
7988
  {
6827
7989
  name: 'ScheduleDeliveryHistoryResult',
6828
- declaration: 'export type ScheduleDeliveryHistoryResult = {\n readonly id: ScheduleId;\n readonly records: ScheduleDeliveryRecord[];\n readonly earlierRecordsUnavailable: boolean;\n readonly earlierRecordsPruned: boolean;\n readonly retention: DeliveryRetentionBounds;\n readonly nextBefore?: MessageId;\n} | {\n readonly id: ScheduleId;\n readonly code: \'schedule_not_found\' | \'delivery_cursor_not_found\';\n};',
7990
+ declaration: 'export type ScheduleDeliveryHistoryResult = ScheduleDeliveryHistoryPage | ScheduleDeliveryHistoryMiss;',
6829
7991
  },
6830
7992
  {
6831
7993
  name: 'ScheduleDeliveryReceipt',
6832
- declaration: 'export interface ScheduleDeliveryReceipt {\n readonly scheduledAt: string;\n readonly deliveredAt: string;\n readonly messageId: MessageId;\n}',
7994
+ declaration: 'export interface ScheduleDeliveryReceipt {\n readonly scheduledAt: string;\n readonly deliveredAt: string;\n readonly messageId: MessageId;\n readonly targetSessionId: SessionId;\n}',
6833
7995
  },
6834
7996
  {
6835
7997
  name: 'ScheduleDeliveryRecord',
6836
7998
  declaration: 'export interface ScheduleDeliveryRecord extends ScheduleDeliveryReceipt {\n readonly prompt?: string;\n}',
6837
7999
  },
6838
8000
  {
6839
- name: 'ScheduledToolDispatch',
6840
- declaration: 'export type ScheduledToolDispatch = {\n kind: \'post-result\';\n result: ToolExecutionResult;\n} | {\n kind: \'final-result\';\n result: ToolExecutionResult;\n};',
8001
+ name: 'ScheduleEditRequest',
8002
+ declaration: 'export type ScheduleEditRequest = {\n readonly id: ScheduleId;\n readonly action: \'update\';\n readonly patch: SchedulePatch;\n readonly expectedUpdatedAt?: string | null;\n} | {\n readonly id: ScheduleId;\n readonly action: \'delete\';\n readonly expectedUpdatedAt?: string | null;\n};',
8003
+ },
8004
+ {
8005
+ name: 'ScheduleEditResult',
8006
+ declaration: 'export type ScheduleEditResult = ScheduleCatalogEntry | Extract<ScheduleDeleteResult, {\n readonly deleted: true;\n}> | ScheduleNotFoundResult | ScheduleConflictResult;',
6841
8007
  },
6842
8008
  {
6843
- name: 'ScheduledToolPreparation',
6844
- declaration: 'export type ScheduledToolPreparation = {\n kind: \'dispatch\';\n exec: ToolRunContext;\n} | {\n kind: \'post-result\';\n exec: ToolRunContext;\n result: ToolExecutionResult;\n} | {\n kind: \'final-result\';\n exec: ToolRunContext;\n result: ToolExecutionResult;\n};',
8009
+ name: 'ScheduleExecutionPendingResult',
8010
+ declaration: 'export interface ScheduleExecutionPendingResult {\n readonly id: ScheduleId;\n readonly code: \'schedule_execution_pending\';\n}',
6845
8011
  },
6846
8012
  {
6847
8013
  name: 'ScheduleId',
@@ -6849,35 +8015,55 @@ export const TYPE_API = [
6849
8015
  },
6850
8016
  {
6851
8017
  name: 'ScheduleListRequest',
6852
- declaration: 'export interface ScheduleListRequest {\n sessionId: SessionId;\n}',
8018
+ declaration: 'export interface ScheduleListRequest {\n readonly active?: boolean;\n readonly limit?: number;\n readonly offset?: number;\n}',
8019
+ },
8020
+ {
8021
+ name: 'ScheduleListResult',
8022
+ declaration: 'export interface ScheduleListResult {\n readonly items: ScheduleCatalogEntry[];\n readonly shown: number;\n readonly total: number;\n readonly limit: number;\n readonly offset: number;\n}',
8023
+ },
8024
+ {
8025
+ name: 'ScheduleNotFoundResult',
8026
+ declaration: 'export interface ScheduleNotFoundResult {\n readonly id: ScheduleId;\n readonly code: \'schedule_not_found\';\n}',
8027
+ },
8028
+ {
8029
+ name: 'SchedulePatch',
8030
+ declaration: 'export interface SchedulePatch {\n readonly title?: string;\n readonly prompt?: string;\n readonly timing?: ScheduleTiming;\n readonly target?: ScheduleTargetRequest;\n readonly active?: boolean;\n}',
6853
8031
  },
6854
8032
  {
6855
8033
  name: 'ScheduleRecord',
6856
8034
  declaration: 'export type ScheduleRecord = OneShotScheduleRecord | RecurringScheduleRecord;',
6857
8035
  },
6858
8036
  {
6859
- name: 'ScheduleTimingChange',
6860
- declaration: 'export type ScheduleTimingChange = {\n readonly kind: \'at\';\n readonly at: AtInput;\n} | {\n readonly kind: \'every\';\n readonly every_seconds: number;\n} | {\n readonly kind: \'daily\';\n readonly daily: DailyInput;\n} | {\n readonly kind: \'weekly\';\n readonly weekly: WeeklyInput;\n} | {\n readonly kind: \'cron\';\n readonly cron: CronInput;\n};',
8037
+ name: 'ScheduleRunRequest',
8038
+ declaration: 'export interface ScheduleRunRequest {\n readonly id: ScheduleId;\n}',
8039
+ },
8040
+ {
8041
+ name: 'ScheduleRunResult',
8042
+ declaration: 'export type ScheduleRunResult = ScheduleCatalogEntry | ScheduleNotFoundResult | ScheduleExecutionPendingResult;',
6861
8043
  },
6862
8044
  {
6863
- name: 'ScheduleToolError',
6864
- declaration: 'export type ScheduleToolError = InvalidPromptError | InvalidSelectorError | InvalidRuleError | InvalidTimeZoneError | NotFutureError | TimeOutOfRangeError | FrequencyTooHighError | SubagentSessionError | InternalScheduleError;',
8045
+ name: 'ScheduleSessionCreateSpec',
8046
+ declaration: 'export interface ScheduleSessionCreateSpec {\n readonly cwd?: string;\n readonly agentPreset?: string;\n}',
6865
8047
  },
6866
8048
  {
6867
- name: 'ScheduleUpdateContent',
6868
- declaration: 'export interface ScheduleUpdateContent {\n readonly title?: string;\n readonly prompt?: string;\n}',
8049
+ name: 'ScheduleTarget',
8050
+ declaration: 'export type ScheduleTarget = {\n readonly kind: \'session\';\n readonly sessionId: SessionId;\n} | {\n readonly kind: \'new_once\';\n readonly sessionId: SessionId;\n readonly create: ScheduleSessionCreateSpec;\n} | {\n readonly kind: \'new\';\n readonly create: ScheduleSessionCreateSpec;\n};',
6869
8051
  },
6870
8052
  {
6871
- name: 'ScheduleUpdateMiss',
6872
- declaration: 'export interface ScheduleUpdateMiss {\n readonly id: ScheduleId;\n readonly updated: false;\n readonly code: \'schedule_not_found\' | \'schedule_ended\' | \'schedule_conflict\';\n}',
8053
+ name: 'ScheduleTargetRequest',
8054
+ declaration: 'export type ScheduleTargetRequest = {\n readonly kind: \'session\';\n readonly sessionId: SessionId;\n} | {\n readonly kind: \'new_once\';\n readonly create?: ScheduleSessionCreateSpec;\n} | {\n readonly kind: \'new\';\n readonly create?: ScheduleSessionCreateSpec;\n};',
6873
8055
  },
6874
8056
  {
6875
- name: 'ScheduleUpdateRequest',
6876
- declaration: 'export interface ScheduleUpdateRequest extends ScheduleDeleteRequest, ScheduleUpdateContent {\n readonly expected: ScheduleRecord;\n readonly change?: ScheduleTimingChange;\n}',
8057
+ name: 'ScheduleTiming',
8058
+ declaration: 'export type ScheduleTiming = {\n readonly kind: \'after\';\n readonly after_seconds: number;\n} | {\n readonly kind: \'at\';\n readonly at: AtInput;\n} | {\n readonly kind: \'every\';\n readonly every_seconds: number;\n} | {\n readonly kind: \'daily\';\n readonly daily: DailyInput;\n} | {\n readonly kind: \'weekly\';\n readonly weekly: WeeklyInput;\n} | {\n readonly kind: \'cron\';\n readonly cron: CronInput;\n} | {\n readonly kind: \'rrule\';\n readonly rrule: string;\n};',
6877
8059
  },
6878
8060
  {
6879
- name: 'ScheduleUpdateResult',
6880
- declaration: 'export type ScheduleUpdateResult = {\n readonly id: ScheduleId;\n readonly updated: boolean;\n readonly record: ScheduleRecord;\n} | ScheduleUpdateMiss | ScheduleToolError;',
8061
+ name: 'ScheduleViewRequest',
8062
+ declaration: 'export interface ScheduleViewRequest {\n readonly id: ScheduleId;\n}',
8063
+ },
8064
+ {
8065
+ name: 'ScheduleViewResult',
8066
+ declaration: 'export type ScheduleViewResult = ScheduleCatalogEntry | ScheduleNotFoundResult;',
6881
8067
  },
6882
8068
  {
6883
8069
  name: 'Scoped',
@@ -6973,7 +8159,7 @@ export const TYPE_API = [
6973
8159
  },
6974
8160
  {
6975
8161
  name: 'SessionAttachmentRequest',
6976
- declaration: 'export interface SessionAttachmentRequest {\n readonly sessionId: SessionId;\n readonly attachmentId: AttachmentIdType;\n}',
8162
+ declaration: 'export interface SessionAttachmentRequest {\n readonly sessionId: SessionId;\n readonly attachment: ImageAttachmentRef;\n}',
6977
8163
  },
6978
8164
  {
6979
8165
  name: 'SessionAttachmentValue',
@@ -6991,6 +8177,14 @@ export const TYPE_API = [
6991
8177
  name: 'SessionCancelValue',
6992
8178
  declaration: 'export interface SessionCancelValue {\n readonly accepted: true;\n}',
6993
8179
  },
8180
+ {
8181
+ name: 'SessionChangeRequest',
8182
+ declaration: 'export interface SessionChangeRequest {\n readonly url: string;\n readonly origin: BindingOrigin;\n readonly ref: ChangeRequestRef | null;\n readonly update: ChangeRequestUpdate | null;\n}',
8183
+ },
8184
+ {
8185
+ name: 'SessionChangeRequestsListener',
8186
+ declaration: 'export type SessionChangeRequestsListener = (changeRequests: readonly SessionChangeRequest[]) => void;',
8187
+ },
6994
8188
  {
6995
8189
  name: 'SessionControlBaseline',
6996
8190
  declaration: 'export interface SessionControlBaseline {\n readonly projections: Readonly<Record<SessionId, SessionProjectionBaseline>>;\n}',
@@ -7023,6 +8217,10 @@ export const TYPE_API = [
7023
8217
  name: 'SessionEventEntry',
7024
8218
  declaration: 'export interface SessionEventEntry {\n readonly type: \'event\';\n readonly event: SessionWireEvent;\n}',
7025
8219
  },
8220
+ {
8221
+ name: 'SessionEventFrame',
8222
+ declaration: 'export type SessionEventFrame = {\n readonly type: \'ready\';\n} | SessionEventEntry;',
8223
+ },
7026
8224
  {
7027
8225
  name: 'SessionEventMap',
7028
8226
  declaration: 'export interface SessionEventMap {\n \'turn/start\': {\n turn: number;\n };\n \'turn/end\': {\n turn: number;\n reason: TurnEndReason;\n };\n \'step/start\': {\n turn: number;\n step: number;\n };\n \'step/end\': {\n turn: number;\n step: number;\n };\n \'user/message\': UserMessage;\n \'developer/message\': {\n turn: number;\n step: number;\n message: DeveloperMessage;\n headerSeq?: SessionSeq;\n };\n \'system/message\': {\n turn: number;\n step: number;\n message: SystemMessage;\n };\n \'assistant/message\': {\n turn: number;\n step: number;\n message: AssistantMessage;\n stream: AssistantStreamRecord[];\n usage?: TokenUsage;\n interrupted?: true;\n };\n \'assistant/attempt\': {\n turn: number;\n step: number;\n stream: AssistantStreamRecord[];\n };\n \'tool/call\': {\n turn: number;\n step: number;\n callId: ToolCallId;\n name: string;\n arguments: string;\n };\n \'tool/result\': {\n turn: number;\n step: number;\n message: ToolResultMessage;\n error?: {\n name: string;\n code: string;\n reason?: string;\n };\n meta?: JsonValue;\n };\n \'request/header\': {\n header: EpochHeader;\n reason: RequestHeaderReason;\n startsSeries?: true;\n };\n \'request/context\': RequestContext;\n \'session/end-seed\': {\n /* …truncated — full shape in source */',
@@ -7059,6 +8257,10 @@ export const TYPE_API = [
7059
8257
  name: 'SessionEventSearchRequest',
7060
8258
  declaration: 'export interface SessionEventSearchRequest {\n sessionId: SessionId;\n query: string;\n filters?: readonly SessionEventMetadataFilter[];\n limit?: number;\n cursor?: SessionSearchCursor;\n}',
7061
8259
  },
8260
+ {
8261
+ name: 'SessionEventsPage',
8262
+ declaration: 'export interface SessionEventsPage extends SessionPage {\n readonly cursor: number;\n}',
8263
+ },
7062
8264
  {
7063
8265
  name: 'SessionEventSurface',
7064
8266
  declaration: 'export type SessionEventSurface = \'current\' | \'shadowed\' | \'log-only\';',
@@ -7105,7 +8307,7 @@ export const TYPE_API = [
7105
8307
  },
7106
8308
  {
7107
8309
  name: 'SessionFollowRequest',
7108
- declaration: 'export interface SessionFollowRequest extends Pick<SessionPageRequest, \'maxMessages\' | \'turnWindow\'> {\n readonly address: SessionAddress;\n readonly assistantStream?: true;\n}',
8310
+ declaration: 'export interface SessionFollowRequest extends Pick<SessionPageRequest, \'maxMessages\' | \'turnWindow\'> {\n readonly address: SessionAddress;\n readonly activate?: boolean;\n readonly assistantStream?: true;\n}',
7109
8311
  },
7110
8312
  {
7111
8313
  name: 'SessionForkRequest',
@@ -7171,6 +8373,10 @@ export const TYPE_API = [
7171
8373
  name: 'SessionListValue',
7172
8374
  declaration: 'export interface SessionListValue {\n readonly items: readonly SessionSummary[];\n}',
7173
8375
  },
8376
+ {
8377
+ name: 'SessionLocation',
8378
+ declaration: 'export interface SessionLocation {\n readonly kind: string;\n readonly path: string;\n}',
8379
+ },
7174
8380
  {
7175
8381
  name: 'SessionLogOffset',
7176
8382
  declaration: 'export type SessionLogOffset = BrandedNumber<\'SessionLogOffset\'>;',
@@ -7195,6 +8401,14 @@ export const TYPE_API = [
7195
8401
  name: 'SessionLogSnapshot',
7196
8402
  declaration: 'export interface SessionLogSnapshot {\n session: SessionHeader;\n inheritedEventCount: SessionLogOffset;\n events: SessionEvent[];\n}',
7197
8403
  },
8404
+ {
8405
+ name: 'SessionLogUploadExclusion',
8406
+ declaration: 'export type SessionLogUploadExclusion = (request: SessionLogUploadRequest) => boolean;',
8407
+ },
8408
+ {
8409
+ name: 'SessionLogUploadRequest',
8410
+ declaration: 'export interface SessionLogUploadRequest {\n readonly sessionId: SessionId;\n readonly purpose?: string;\n}',
8411
+ },
7198
8412
  {
7199
8413
  name: 'SessionMessage',
7200
8414
  declaration: 'export interface SessionMessage {\n role: \'user\' | \'assistant\';\n text: string;\n toolUses: ToolUseSummary[];\n}',
@@ -7215,6 +8429,10 @@ export const TYPE_API = [
7215
8429
  name: 'SessionObservationOptions',
7216
8430
  declaration: 'export interface SessionObservationOptions {\n readonly signal?: AbortSignal;\n readonly projectionMode?: \'all\' | \'none\';\n}',
7217
8431
  },
8432
+ {
8433
+ name: 'SessionObserveEventRequest',
8434
+ declaration: 'export interface SessionObserveEventRequest {\n readonly address: SessionAddress;\n}',
8435
+ },
7218
8436
  {
7219
8437
  name: 'SessionOpenWorkspacePathRequest',
7220
8438
  declaration: 'export interface SessionOpenWorkspacePathRequest {\n readonly action?: \'reveal\';\n readonly application?: string;\n readonly path: string;\n}',
@@ -7229,7 +8447,11 @@ export const TYPE_API = [
7229
8447
  },
7230
8448
  {
7231
8449
  name: 'SessionPageRequest',
7232
- declaration: 'export interface SessionPageRequest {\n readonly address: SessionAddress;\n readonly throughSeq: number;\n readonly beforeSeq?: number;\n readonly maxMessages?: number;\n readonly turnWindow?: {\n readonly minMessages: number;\n readonly minTurns: number;\n };\n}',
8450
+ declaration: 'export interface SessionPageRequest {\n readonly address: SessionAddress;\n readonly throughSeq?: number;\n readonly beforeSeq?: number;\n readonly maxMessages?: number;\n readonly turnWindow?: {\n readonly minMessages: number;\n readonly minTurns: number;\n };\n}',
8451
+ },
8452
+ {
8453
+ name: 'SessionPendingInput',
8454
+ declaration: 'export type SessionPendingInput = \'approval\' | \'question\' | \'other\';',
7233
8455
  },
7234
8456
  {
7235
8457
  name: 'SessionPersistenceCreateOptions',
@@ -7249,7 +8471,7 @@ export const TYPE_API = [
7249
8471
  },
7250
8472
  {
7251
8473
  name: 'SessionPersistenceSnapshot',
7252
- declaration: 'export interface SessionPersistenceSnapshot {\n readonly header: SessionHeader;\n readonly formatStatus?: \'current\' | \'migration-required\';\n readonly revision: SessionPersistenceRevision;\n readonly eventCount?: number;\n readonly sizeBytes?: number;\n}',
8474
+ declaration: 'export interface SessionPersistenceSnapshot {\n readonly header: SessionHeader;\n readonly formatStatus?: \'current\' | \'migration-required\';\n readonly revision: SessionPersistenceRevision;\n readonly eventCount?: number;\n readonly sizeBytes?: number;\n readonly location?: SessionLocation;\n}',
7253
8475
  },
7254
8476
  {
7255
8477
  name: 'SessionPersistenceStatOptions',
@@ -7259,9 +8481,17 @@ export const TYPE_API = [
7259
8481
  name: 'SessionProjectionBaseline',
7260
8482
  declaration: 'export interface SessionProjectionBaseline {\n readonly asOfSeq: number;\n readonly values: SessionProjectionValues;\n}',
7261
8483
  },
8484
+ {
8485
+ name: 'SessionProjectionChange',
8486
+ declaration: 'export type SessionProjectionChange = {\n readonly type: \'projection\';\n} & Omit<SessionProjectionUpdate, \'sessionId\'>;',
8487
+ },
8488
+ {
8489
+ name: 'SessionProjectionFrame',
8490
+ declaration: 'export type SessionProjectionFrame = {\n readonly type: \'ready\';\n} | SessionProjectionChange;',
8491
+ },
7262
8492
  {
7263
8493
  name: 'SessionProjectionHints',
7264
- declaration: 'export interface SessionProjectionHints {\n readonly kind: \'cached\' | \'sequenced\';\n readonly asOfSeq: number;\n readonly values: SessionProjectionValues;\n}',
8494
+ declaration: 'export interface SessionProjectionHints {\n readonly kind: \'cached\' | \'sequenced\';\n readonly asOfSeq: number;\n readonly values: Partial<SessionProjectionSummaryValues>;\n}',
7265
8495
  },
7266
8496
  {
7267
8497
  name: 'SessionProjectionMap',
@@ -7272,8 +8502,16 @@ export const TYPE_API = [
7272
8502
  declaration: 'export interface SessionProjectionsRequest {\n readonly sessionId: SessionId;\n}',
7273
8503
  },
7274
8504
  {
7275
- name: 'SessionProjectionStateMap',
7276
- declaration: 'export interface SessionProjectionStateMap {\n}',
8505
+ name: 'SessionProjectionSummaryExcluded',
8506
+ declaration: 'export type SessionProjectionSummaryExcluded<T> = T & {\n readonly [sessionProjectionSummaryExcluded]: true;\n};',
8507
+ },
8508
+ {
8509
+ name: 'SessionProjectionSummaryExcludedKey',
8510
+ declaration: 'export type SessionProjectionSummaryExcludedKey = {\n [K in keyof SessionProjectionMap]: NonNullable<SessionProjectionMap[K]> extends SessionProjectionSummaryExcluded<unknown> ? K : never;\n}[keyof SessionProjectionMap];',
8511
+ },
8512
+ {
8513
+ name: 'SessionProjectionSummaryValues',
8514
+ declaration: 'export type SessionProjectionSummaryValues = Omit<SessionProjectionViewValues, SessionProjectionSummaryExcludedKey>;',
7277
8515
  },
7278
8516
  {
7279
8517
  name: 'SessionProjectionsValue',
@@ -7281,7 +8519,7 @@ export const TYPE_API = [
7281
8519
  },
7282
8520
  {
7283
8521
  name: 'SessionProjectionUpdate',
7284
- declaration: 'export interface SessionProjectionUpdate {\n readonly sessionId: SessionId;\n readonly key: string;\n readonly value: JsonValue;\n readonly seq: number;\n}',
8522
+ declaration: 'export interface SessionProjectionUpdate {\n readonly sessionId: SessionId;\n readonly seq: number;\n readonly changes: readonly {\n readonly key: string;\n readonly val: SessionProjectionValue;\n }[];\n}',
7285
8523
  },
7286
8524
  {
7287
8525
  name: 'SessionProjectionValue',
@@ -7291,6 +8529,14 @@ export const TYPE_API = [
7291
8529
  name: 'SessionProjectionValues',
7292
8530
  declaration: 'export type SessionProjectionValues = Partial<SessionProjectionMap> & Readonly<Record<string, SessionProjectionValue>>;',
7293
8531
  },
8532
+ {
8533
+ name: 'SessionProjectionViewValue',
8534
+ declaration: 'export type SessionProjectionViewValue<T> = T extends SessionProjectionSummaryExcluded<infer Value> ? Value : T;',
8535
+ },
8536
+ {
8537
+ name: 'SessionProjectionViewValues',
8538
+ declaration: 'export type SessionProjectionViewValues = {\n [K in keyof SessionProjectionMap]: SessionProjectionViewValue<SessionProjectionMap[K]>;\n};',
8539
+ },
7294
8540
  {
7295
8541
  name: 'SessionPromptRequest',
7296
8542
  declaration: 'export interface SessionPromptRequest {\n readonly requestId: SessionRequestId;\n readonly sessionId: SessionId;\n readonly mode: \'queue\' | \'steer\';\n readonly content: readonly PromptContentPart[];\n readonly clientTimeZone?: string;\n}',
@@ -7299,6 +8545,10 @@ export const TYPE_API = [
7299
8545
  name: 'SessionPromptValue',
7300
8546
  declaration: 'export interface SessionPromptValue {\n readonly accepted: true;\n}',
7301
8547
  },
8548
+ {
8549
+ name: 'SessionQueuedItem',
8550
+ declaration: 'export interface SessionQueuedItem {\n readonly id: MessageId;\n readonly placement: \'queued\' | \'steering\' | \'context\';\n readonly rpcId?: SessionRequestId;\n readonly content: readonly JsonValue[];\n}',
8551
+ },
7302
8552
  {
7303
8553
  name: 'SessionRecord',
7304
8554
  declaration: 'export interface SessionRecord {\n header: SessionHeader;\n live: boolean;\n persisted: boolean;\n formatStatus?: \'current\' | \'migration-required\';\n}',
@@ -7391,6 +8641,14 @@ export const TYPE_API = [
7391
8641
  name: 'SessionStartSource',
7392
8642
  declaration: 'export type SessionStartSource = \'startup\' | \'resume\' | \'clear\' | \'compact\';',
7393
8643
  },
8644
+ {
8645
+ name: 'SessionState',
8646
+ declaration: 'export interface SessionState {\n readonly cursor: number;\n readonly active: boolean;\n readonly running: boolean;\n readonly queue: readonly SessionQueuedItem[] | null;\n readonly pendingInput: readonly SessionPendingInput[];\n}',
8647
+ },
8648
+ {
8649
+ name: 'SessionStateRequest',
8650
+ declaration: 'export interface SessionStateRequest {\n readonly sessionId: SessionId;\n}',
8651
+ },
7394
8652
  {
7395
8653
  name: 'SessionStorageMetadata',
7396
8654
  declaration: 'export interface SessionStorageMetadata {\n readonly meta: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n}',
@@ -7471,6 +8729,18 @@ export const TYPE_API = [
7471
8729
  name: 'SessionUpdateQueueValue',
7472
8730
  declaration: 'export interface SessionUpdateQueueValue {\n readonly accepted: true;\n}',
7473
8731
  },
8732
+ {
8733
+ name: 'SessionWaitOutput',
8734
+ declaration: 'export interface SessionWaitOutput {\n readonly records: readonly SessionHistoryRecord[];\n readonly truncated: boolean;\n}',
8735
+ },
8736
+ {
8737
+ name: 'SessionWaitRequest',
8738
+ declaration: 'export interface SessionWaitRequest extends SessionStateRequest {\n readonly timeoutMs?: number;\n readonly afterSeq?: number;\n readonly maxMessages?: number;\n}',
8739
+ },
8740
+ {
8741
+ name: 'SessionWaitValue',
8742
+ declaration: 'export interface SessionWaitValue {\n readonly reason: \'idle\' | \'input-required\' | \'timeout\';\n readonly state: SessionState;\n readonly output: SessionWaitOutput;\n}',
8743
+ },
7474
8744
  {
7475
8745
  name: 'SessionWireEvent',
7476
8746
  declaration: 'export interface SessionWireEvent {\n readonly type: string;\n readonly seq: number;\n readonly time: number;\n readonly data: JsonValue;\n readonly ignorable?: true;\n readonly sourceEventSeqs?: JsonValue;\n readonly surfaceOp?: JsonValue;\n}',
@@ -7483,6 +8753,14 @@ export const TYPE_API = [
7483
8753
  name: 'SessionWorkspacePathApplication',
7484
8754
  declaration: 'export type SessionWorkspacePathApplication = NativeFileApplication;',
7485
8755
  },
8756
+ {
8757
+ name: 'SetRelayRequest',
8758
+ declaration: 'export interface SetRelayRequest {\n readonly relayUrl: string | null;\n}',
8759
+ },
8760
+ {
8761
+ name: 'SetShareCapabilitiesRequest',
8762
+ declaration: 'export interface SetShareCapabilitiesRequest {\n readonly shareId: string;\n readonly capabilities?: readonly ShareCapabilityGroup[];\n}',
8763
+ },
7486
8764
  {
7487
8765
  name: 'SettingsDescribeOptions',
7488
8766
  declaration: 'export interface SettingsDescribeOptions {\n redactSecrets?: boolean;\n}',
@@ -7519,6 +8797,38 @@ export const TYPE_API = [
7519
8797
  name: 'SettingsSecretView',
7520
8798
  declaration: 'export interface SettingsSecretView {\n path: string[];\n set: boolean;\n}',
7521
8799
  },
8800
+ {
8801
+ name: 'ShareAccess',
8802
+ declaration: 'export interface ShareAccess {\n readonly mode: \'open\' | \'selected\';\n readonly selected: readonly ShareAccessSelection[];\n readonly deploymentAllowedSubjectIds: readonly string[];\n readonly shareAllowedSubjectIds: readonly string[];\n readonly broadenedByDeploymentSubjects: boolean;\n readonly identityKeyAcl: true;\n}',
8803
+ },
8804
+ {
8805
+ name: 'ShareAccessSelection',
8806
+ declaration: 'export interface ShareAccessSelection {\n readonly providerId: string;\n readonly tenantId: string;\n readonly subjectId: string;\n readonly identityKey: string;\n}',
8807
+ },
8808
+ {
8809
+ name: 'ShareAudit',
8810
+ declaration: 'export interface ShareAudit {\n readonly events: readonly ShareAuditEntryView[];\n}',
8811
+ },
8812
+ {
8813
+ name: 'ShareAuditEntryView',
8814
+ declaration: 'export interface ShareAuditEntryView {\n readonly id: string;\n readonly action: string;\n readonly createdAt: string;\n readonly actor?: string;\n readonly detail?: JsonValue;\n}',
8815
+ },
8816
+ {
8817
+ name: 'ShareAuditRequest',
8818
+ declaration: 'export interface ShareAuditRequest {\n readonly shareId: string;\n}',
8819
+ },
8820
+ {
8821
+ name: 'ShareCapabilities',
8822
+ declaration: 'export interface ShareCapabilities {\n readonly shareId: string;\n readonly viewerCapabilities: readonly ShareCapabilityGroup[];\n}',
8823
+ },
8824
+ {
8825
+ name: 'ShareCapabilityGroup',
8826
+ declaration: 'export interface ShareCapabilityGroup {\n readonly plugin: string;\n readonly readable: readonly string[];\n readonly writable: readonly string[];\n}',
8827
+ },
8828
+ {
8829
+ name: 'ShareCapabilityOffers',
8830
+ declaration: 'export interface ShareCapabilityOffers {\n readonly capabilities: readonly ShareCapabilityGroup[];\n}',
8831
+ },
7522
8832
  {
7523
8833
  name: 'ShellExecRequest',
7524
8834
  declaration: 'export interface ShellExecRequest {\n command: string;\n workdir?: string | undefined;\n timeoutMs?: number | undefined;\n onExpiry?: ShellExpiryPolicy | undefined;\n stdoutMaxBytes?: number | undefined;\n signal?: AbortSignal | undefined;\n stdin?: string | undefined;\n env?: Record<string, string> | undefined;\n dshEnv?: DshEnvironment | undefined;\n sandboxPolicy?: SandboxExecutionPolicy | undefined;\n}',
@@ -7735,6 +9045,18 @@ export const TYPE_API = [
7735
9045
  name: 'SshStreamEndpoint',
7736
9046
  declaration: 'export type SshStreamEndpoint = z.infer<typeof streamEndpointSchema>;',
7737
9047
  },
9048
+ {
9049
+ name: 'StagedAttachment',
9050
+ declaration: 'export type StagedAttachment = {\n readonly type: \'file\';\n readonly attachment: FileAttachmentRef;\n} | {\n readonly type: \'image\';\n readonly attachment: ImageAttachmentRef;\n readonly encodedBytes: number;\n};',
9051
+ },
9052
+ {
9053
+ name: 'StopShareRequest',
9054
+ declaration: 'export interface StopShareRequest {\n readonly shareId: string;\n}',
9055
+ },
9056
+ {
9057
+ name: 'StopShareResult',
9058
+ declaration: 'export interface StopShareResult {\n readonly ok: true;\n readonly relay?: \'unreachable\';\n}',
9059
+ },
7738
9060
  {
7739
9061
  name: 'StorageBackend',
7740
9062
  declaration: 'export interface StorageBackend {\n readonly kv?: KvFacet;\n close(): Promise<void>;\n}',
@@ -7831,10 +9153,6 @@ export const TYPE_API = [
7831
9153
  name: 'SubagentSendMessageOptions',
7832
9154
  declaration: 'export interface SubagentSendMessageOptions {\n readonly signal: AbortSignal;\n}',
7833
9155
  },
7834
- {
7835
- name: 'SubagentSessionError',
7836
- declaration: 'export interface SubagentSessionError {\n readonly code: \'subagent_session\';\n readonly message: string;\n}',
7837
- },
7838
9156
  {
7839
9157
  name: 'SubagentStartRequest',
7840
9158
  declaration: 'export interface SubagentStartRequest {\n readonly cwd?: string;\n readonly agentPreset?: string;\n readonly label?: string;\n readonly prompt: ContentBlock[];\n readonly parent: Agent;\n readonly signal: AbortSignal;\n readonly agentOptions?: AgentOptions;\n readonly outputSchema?: ObjectJsonSchema;\n readonly maxDepth?: number;\n}',
@@ -8091,6 +9409,10 @@ export const TYPE_API = [
8091
9409
  name: 'TerminalWaitReason',
8092
9410
  declaration: 'export type TerminalWaitReason = \'stdin_read\' | \'inferred_idle\' | \'timeout\' | \'session_exit\';',
8093
9411
  },
9412
+ {
9413
+ name: 'TestPublishRequest',
9414
+ declaration: 'export interface TestPublishRequest {\n readonly sessionId: string;\n}',
9415
+ },
8094
9416
  {
8095
9417
  name: 'TextProps',
8096
9418
  declaration: 'export interface TextProps {\n readonly color?: string | undefined;\n readonly bold?: boolean | undefined;\n readonly dimColor?: boolean | undefined;\n readonly italic?: boolean | undefined;\n readonly underline?: boolean | undefined;\n readonly children?: UiNode | undefined;\n}',
@@ -8099,10 +9421,6 @@ export const TYPE_API = [
8099
9421
  name: 'TimedUserQuestionResult',
8100
9422
  declaration: 'export type TimedUserQuestionResult = AskUserQuestionAnswer | {\n pending: true;\n callId: ToolCallId;\n};',
8101
9423
  },
8102
- {
8103
- name: 'TimeOutOfRangeError',
8104
- declaration: 'export interface TimeOutOfRangeError {\n readonly code: \'time_out_of_range\';\n readonly message: string;\n}',
8105
- },
8106
9424
  {
8107
9425
  name: 'ToastOptions',
8108
9426
  declaration: 'export interface ToastOptions {\n timeoutMs?: number;\n}',
@@ -8123,10 +9441,22 @@ export const TYPE_API = [
8123
9441
  name: 'TokenUsage',
8124
9442
  declaration: 'export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}',
8125
9443
  },
9444
+ {
9445
+ name: 'ToolActivationContext',
9446
+ declaration: 'export interface ToolActivationContext {\n readonly agent: Agent;\n readonly modelSelection: Readonly<ModelSelection>;\n readonly signal: AbortSignal;\n}',
9447
+ },
8126
9448
  {
8127
9449
  name: 'ToolAdditionBlock',
8128
9450
  declaration: 'export interface ToolAdditionBlock {\n type: \'tool-addition\';\n toolName: string;\n tool?: never;\n}',
8129
9451
  },
9452
+ {
9453
+ name: 'ToolBatchInput',
9454
+ declaration: 'export interface ToolBatchInput {\n readonly calls: readonly ToolCallBlock[];\n readonly signal: AbortSignal;\n readonly maxParallelToolCalls?: number;\n readonly agent?: Agent;\n readonly toolSet?: ResolvedToolSet;\n readonly log?: {\n readonly turn: number;\n readonly step: number;\n };\n}',
9455
+ },
9456
+ {
9457
+ name: 'ToolBatchResult',
9458
+ declaration: 'export interface ToolBatchResult {\n readonly results: readonly ToolCallResult[];\n readonly additionalContexts: readonly UserMessage[];\n readonly concluded: boolean;\n}',
9459
+ },
8130
9460
  {
8131
9461
  name: 'ToolCallBlock',
8132
9462
  declaration: 'export interface ToolCallBlock {\n type: \'tool-call\';\n id: ToolCallId;\n name: string;\n arguments: string;\n}',
@@ -8143,10 +9473,6 @@ export const TYPE_API = [
8143
9473
  name: 'ToolCallKind',
8144
9474
  declaration: 'export type ToolCallKind = \'read\' | \'edit\' | \'delete\' | \'move\' | \'search\' | \'execute\' | \'fetch\' | \'other\';',
8145
9475
  },
8146
- {
8147
- name: 'ToolCallResult',
8148
- declaration: 'export type ToolCallResult = {\n deny: string;\n result?: undefined;\n isError?: undefined;\n} | {\n result: unknown;\n isError?: true;\n deny?: undefined;\n};',
8149
- },
8150
9476
  {
8151
9477
  name: 'ToolCallView',
8152
9478
  declaration: 'export type ToolCallView = GenericCallView | TerminalCallView | DiffCallView;',
@@ -8173,11 +9499,7 @@ export const TYPE_API = [
8173
9499
  },
8174
9500
  {
8175
9501
  name: 'ToolExecutionInput',
8176
- declaration: 'export interface ToolExecutionInput {\n readonly callId: ToolCallId;\n readonly rootCallId?: ToolCallId;\n readonly name: string;\n readonly schema?: ToolSchema;\n readonly arguments: unknown;\n readonly agent?: Agent;\n readonly parent?: ToolExecutionToken;\n readonly signal: AbortSignal;\n}',
8177
- },
8178
- {
8179
- name: 'ToolExecutionMode',
8180
- declaration: 'export type ToolExecutionMode = {\n kind: \'parallel\';\n} | {\n kind: \'exclusive\';\n};',
9502
+ declaration: 'export interface ToolExecutionInput {\n readonly callId: ToolCallId;\n readonly rootCallId?: ToolCallId;\n readonly name: string;\n readonly schema?: ToolSchema;\n readonly arguments: unknown;\n readonly agent?: Agent;\n readonly toolSet?: ResolvedToolSet;\n readonly parent?: ToolExecutionToken;\n readonly signal: AbortSignal;\n}',
8181
9503
  },
8182
9504
  {
8183
9505
  name: 'ToolExecutionResult',
@@ -8191,6 +9513,10 @@ export const TYPE_API = [
8191
9513
  name: 'ToolExecutionToken',
8192
9514
  declaration: 'export type ToolExecutionToken = symbol & {\n readonly [toolExecutionTokenBrand]: true;\n};',
8193
9515
  },
9516
+ {
9517
+ name: 'ToolExecutor',
9518
+ declaration: 'export interface ToolExecutor {\n readonly sections?: readonly ToolPromptSection[];\n describe(tools: readonly ToolDefinition[]): ToolModelInput;\n execute(input: ToolBatchInput): Promise<ToolBatchResult>;\n}',
9519
+ },
8194
9520
  {
8195
9521
  name: 'ToolFailure',
8196
9522
  declaration: 'export interface ToolFailure {\n message: string;\n info?: ToolErrorInfo;\n}',
@@ -8211,18 +9537,26 @@ export const TYPE_API = [
8211
9537
  name: 'ToolMessageSource',
8212
9538
  declaration: 'export interface ToolMessageSource {\n kind: \'tool\';\n callId: ToolCallId;\n}',
8213
9539
  },
9540
+ {
9541
+ name: 'ToolModelInput',
9542
+ declaration: 'export type ToolModelInput = Pick<ToolProviderResult, \'schemas\' | \'knownNames\'>;',
9543
+ },
8214
9544
  {
8215
9545
  name: 'ToolOutputDefinition',
8216
9546
  declaration: 'export interface ToolOutputDefinition {\n readonly schema: JsonSchemaNode;\n render(args: unknown, value: JsonValue): ContentBlock[];\n presentationMeta?(args: unknown, value: JsonValue): JsonValue;\n}',
8217
9547
  },
8218
9548
  {
8219
- name: 'ToolPresentationMode',
8220
- declaration: 'export type ToolPresentationMode = \'native\' | \'ptc\';',
9549
+ name: 'ToolPromptSection',
9550
+ declaration: 'export interface ToolPromptSection extends Pick<PromptSection, \'name\' | \'order\' | \'interpolate\'> {\n readonly text: string | ((tools: readonly ToolDefinition[]) => string);\n}',
8221
9551
  },
8222
9552
  {
8223
9553
  name: 'ToolProviderResult',
8224
9554
  declaration: 'export interface ToolProviderResult {\n readonly schemas: readonly ToolSchema[];\n readonly knownNames?: readonly string[];\n}',
8225
9555
  },
9556
+ {
9557
+ name: 'ToolRegistrationOptions',
9558
+ declaration: 'export interface ToolRegistrationOptions {\n readonly when?: (context: ToolActivationContext) => boolean | Promise<boolean>;\n}',
9559
+ },
8226
9560
  {
8227
9561
  name: 'ToolRemovalBlock',
8228
9562
  declaration: 'export interface ToolRemovalBlock {\n type: \'tool-removal\';\n toolName: string;\n}',
@@ -8247,14 +9581,6 @@ export const TYPE_API = [
8247
9581
  name: 'ToolRunContext',
8248
9582
  declaration: 'export interface ToolRunContext extends ToolExecution {\n deferContext(context: UserMessage): void;\n concludeTurn(): void;\n}',
8249
9583
  },
8250
- {
8251
- name: 'ToolRuntime',
8252
- declaration: 'export class ToolRuntime extends Service {\n static inject;\n static Config: z<Config>;\n readonly [TOOL_RUNTIME_SCHEDULER]: ToolRuntimeScheduler;\n constructor(ctx: Context, config: Config = {});\n presentAs(mode: ToolPresentationMode): () => void;\n register(definition: ToolDefinition): () => void;\n restrict(filter: ToolRestriction): () => void;\n guard(guard: ToolGuard): () => void;\n get(name: string, scope?: ScopeKey): ToolDefinition | undefined;\n schemas(scope?: ScopeKey): ToolSchema[];\n executionMode(exec: ToolExecutionInput): ToolExecutionMode;\n async execute(exec: ToolExecutionInput): Promise<ToolExecutionResult>;\n}',
8253
- },
8254
- {
8255
- name: 'ToolRuntimeScheduler',
8256
- declaration: 'export interface ToolRuntimeScheduler {\n prepare(exec: ToolExecutionInput): Promise<ScheduledToolPreparation>;\n dispatch(exec: ToolRunContext): Promise<ScheduledToolDispatch>;\n finalize(exec: ToolRunContext, result: ToolExecutionResult): Promise<ToolExecutionResult>;\n finish(exec: ToolRunContext, result: ToolExecutionResult): ToolExecutionResult;\n}',
8257
- },
8258
9584
  {
8259
9585
  name: 'ToolSchema',
8260
9586
  declaration: 'export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}',
@@ -8263,6 +9589,10 @@ export const TYPE_API = [
8263
9589
  name: 'ToolSpec',
8264
9590
  declaration: 'export interface ToolSpec {\n name: string;\n description: string;\n inputSchema?: Record<string, unknown>;\n}',
8265
9591
  },
9592
+ {
9593
+ name: 'ToolsService',
9594
+ declaration: 'export class ToolsService extends Service {\n static inject;\n static Config;\n constructor(ctx: Context);\n register(definition: ToolDefinition, options: ToolRegistrationOptions = {}): () => void;\n restrict(filter: ToolRestriction): () => void;\n get(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined;\n executable(name: string, scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolDefinition | undefined;\n async resolve(context: ToolActivationContext): Promise<ResolvedToolSet>;\n definitions(scope?: ScopeKey, toolSet?: ResolvedToolSet): readonly ToolDefinition[];\n schemas(scope?: ScopeKey, toolSet?: ResolvedToolSet): ToolSchema[];\n setExecutor(executor: ToolExecutor): () => void;\n async execute(input: ToolBatchInput): Promise<ToolBatchResult>;\n guard(guard: ToolGuard): () => void;\n checkGuards(exec: ToolExecution): string | undefined;\n}',
9595
+ },
8266
9596
  {
8267
9597
  name: 'ToolUpdate',
8268
9598
  declaration: 'export type ToolUpdate = \'in-history\' | \'addition-only\';',
@@ -8291,6 +9621,10 @@ export const TYPE_API = [
8291
9621
  name: 'TranslationSpec',
8292
9622
  declaration: 'export type TranslationSpec = AnonymousTranslationSpec | PaidTranslationSpec;',
8293
9623
  },
9624
+ {
9625
+ name: 'TurnBoundaryProjection',
9626
+ declaration: 'export interface TurnBoundaryProjection {\n readonly openTurnStartSeq: OptionalSessionSeq;\n readonly lastStepStartSeq: OptionalSessionSeq;\n readonly lastStepBoundary: {\n readonly kind: \'start\' | \'end\';\n readonly seq: SessionSeq;\n } | null;\n readonly lastTurn: number;\n}',
9627
+ },
8294
9628
  {
8295
9629
  name: 'TurnCompleteInput',
8296
9630
  declaration: 'export interface TurnCompleteInput {\n turnId: string;\n answer: string;\n durationMs: number;\n isAborted: boolean;\n reason: \'answer\' | \'aborted\' | \'error\';\n agentId?: string;\n usage?: TurnUsage;\n}',
@@ -8475,6 +9809,14 @@ export const TYPE_API = [
8475
9809
  name: 'UiRenderResult',
8476
9810
  declaration: 'export type UiRenderResult = UiNode;',
8477
9811
  },
9812
+ {
9813
+ name: 'UpdateBundleOptions',
9814
+ declaration: 'export interface UpdateBundleOptions {\n readonly registry?: Registry;\n readonly requestId?: PluginInstallRequestId;\n}',
9815
+ },
9816
+ {
9817
+ name: 'UpdateSharePermissionsRequest',
9818
+ declaration: 'export interface UpdateSharePermissionsRequest {\n readonly shareId: string;\n readonly sessionMode?: \'view\' | \'write\';\n readonly allowsFork?: boolean;\n readonly ttlMinutes?: number | null;\n}',
9819
+ },
8478
9820
  {
8479
9821
  name: 'UpdateTeamTaskRequest',
8480
9822
  declaration: 'export interface UpdateTeamTaskRequest {\n readonly taskId: TeamTaskId;\n readonly expectedRevision: number;\n readonly action: TeamTaskAction;\n readonly subject?: string;\n readonly description?: string;\n readonly blockedBy?: readonly TeamTaskId[];\n readonly writeScopes?: readonly string[];\n readonly owner?: string;\n}',
@@ -8513,7 +9855,7 @@ export const TYPE_API = [
8513
9855
  },
8514
9856
  {
8515
9857
  name: 'WebFetchProvider',
8516
- declaration: 'export interface WebFetchProvider {\n readonly id: string;\n available(): boolean;\n fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;\n}',
9858
+ declaration: 'export interface WebFetchProvider {\n readonly id: string;\n available(): boolean;\n ready?(llmProvider: string | undefined): Promise<boolean>;\n fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>;\n}',
8517
9859
  },
8518
9860
  {
8519
9861
  name: 'WebFetchRequest',
@@ -8559,6 +9901,14 @@ export const TYPE_API = [
8559
9901
  name: 'WebhookSourceId',
8560
9902
  declaration: 'export type WebhookSourceId = Branded<\'WebhookSourceId\'>;',
8561
9903
  },
9904
+ {
9905
+ name: 'WebResource',
9906
+ declaration: 'export type WebResource = (request: Request, peer?: PeerScope) => Promise<Response>;',
9907
+ },
9908
+ {
9909
+ name: 'WebResourceRoute',
9910
+ declaration: 'export interface WebResourceRoute {\n kind: WebRouteKind;\n path: string;\n resource: WebResource;\n}',
9911
+ },
8562
9912
  {
8563
9913
  name: 'WebResultView',
8564
9914
  declaration: 'export type WebResultView = WebSearchResultView | WebFetchResultView;',
@@ -8573,7 +9923,7 @@ export const TYPE_API = [
8573
9923
  },
8574
9924
  {
8575
9925
  name: 'WebSearchProvider',
8576
- declaration: 'export interface WebSearchProvider {\n readonly id: string;\n available(): boolean;\n search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;\n}',
9926
+ declaration: 'export interface WebSearchProvider {\n readonly id: string;\n available(): boolean;\n ready?(llmProvider: string | undefined): Promise<boolean>;\n search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;\n}',
8577
9927
  },
8578
9928
  {
8579
9929
  name: 'WebSearchRequest',
@@ -8589,7 +9939,7 @@ export const TYPE_API = [
8589
9939
  },
8590
9940
  {
8591
9941
  name: 'WebSearchSource',
8592
- declaration: 'export interface WebSearchSource {\n readonly url: string;\n readonly title?: string;\n readonly snippet?: string;\n readonly publishedAt?: string;\n}',
9942
+ declaration: 'export interface WebSearchSource {\n readonly url: string;\n readonly title?: string;\n readonly snippet?: string;\n readonly summary?: string;\n readonly publishedAt?: string;\n}',
8593
9943
  },
8594
9944
  {
8595
9945
  name: 'WebSource',