@markusylisiurunen/tau 0.3.49 → 0.3.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -908
- package/dist/core/commands/registry.js +4 -4
- package/dist/core/commands/registry.js.map +1 -1
- package/dist/core/personas.js +19 -10
- package/dist/core/personas.js.map +1 -1
- package/dist/core/runtime/runtime_bootstrap.js +14 -9
- package/dist/core/runtime/runtime_bootstrap.js.map +1 -1
- package/dist/core/static/tau_docs/client-tools.md +228 -0
- package/dist/core/static/tau_docs/config-reference.md +422 -0
- package/dist/core/static/tau_docs/configuration.md +210 -0
- package/dist/core/static/tau_docs/credentials.md +200 -0
- package/dist/core/static/tau_docs/getting-started.md +140 -0
- package/dist/core/static/tau_docs/history.md +163 -0
- package/dist/core/static/tau_docs/index.md +40 -0
- package/dist/core/static/tau_docs/manifest.json +28 -0
- package/dist/core/static/tau_docs/models.md +198 -0
- package/dist/core/static/tau_docs/node-sdk.md +399 -0
- package/dist/core/static/tau_docs/nook.md +264 -0
- package/dist/core/static/tau_docs/ownership-and-scope.md +104 -0
- package/dist/core/static/tau_docs/personas.md +199 -0
- package/dist/core/static/tau_docs/prompts-and-project-context.md +181 -0
- package/dist/core/static/tau_docs/remote-sessions.md +274 -0
- package/dist/core/static/tau_docs/security.md +188 -0
- package/dist/core/static/tau_docs/session-protocol-methods.md +577 -0
- package/dist/core/static/tau_docs/session-protocol.md +265 -0
- package/dist/core/static/tau_docs/sessions.md +223 -0
- package/dist/core/static/tau_docs/skills.md +176 -0
- package/dist/core/static/tau_docs/subagents.md +203 -0
- package/dist/core/static/tau_docs/telegram.md +342 -0
- package/dist/core/static/tau_docs/tools.md +203 -0
- package/dist/core/static/tau_docs/troubleshooting.md +292 -0
- package/dist/core/static/tau_docs/tui.md +224 -0
- package/dist/core/telegram/session_manager.js +4 -3
- package/dist/core/telegram/session_manager.js.map +1 -1
- package/dist/core/tools/catalog.js +3 -1
- package/dist/core/tools/catalog.js.map +1 -1
- package/dist/core/tools/presentation.js +12 -1
- package/dist/core/tools/presentation.js.map +1 -1
- package/dist/core/tools/tau_docs.js +115 -0
- package/dist/core/tools/tau_docs.js.map +1 -0
- package/dist/core/tools/tool_names.js +8 -0
- package/dist/core/tools/tool_names.js.map +1 -1
- package/dist/core/utils/repository.js +19 -0
- package/dist/core/utils/repository.js.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/host/client_tool_broker.js +3 -18
- package/dist/host/client_tool_broker.js.map +1 -1
- package/dist/protocol/session_protocol.d.ts +1 -0
- package/dist/protocol/session_protocol.js +2 -1
- package/dist/protocol/session_protocol.js.map +1 -1
- package/dist/tui/session_chat_app.js +1 -0
- package/dist/tui/session_chat_app.js.map +1 -1
- package/dist/tui/session_chat_controller.js +13 -13
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/session_creation_attributes.js +3 -3
- package/dist/tui/session_creation_attributes.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
# Session protocol method reference
|
|
2
|
+
|
|
3
|
+
This page defines every request method in protocol version 12. It is the compact wire reference for clients that already understand connection, observation, and delta application from the [session protocol](session-protocol.md).
|
|
4
|
+
|
|
5
|
+
Every request uses `{ version, type: "request", id, method, params }`. Every successful response uses `{ version, type: "response", id, ok: true, result }`. `params` is required even when empty, and unknown object fields are stripped.
|
|
6
|
+
|
|
7
|
+
## Common values
|
|
8
|
+
|
|
9
|
+
A `sessionId` is a non-empty opaque string returned by `session.create` or `session.list`. A client-supplied `historyEntryId` is also a non-empty opaque string; omit it to let Tau generate one.
|
|
10
|
+
|
|
11
|
+
Reasoning values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
|
|
12
|
+
|
|
13
|
+
Turn methods return one of these terminal outcomes:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type TurnOutcome =
|
|
17
|
+
| { status: "completed"; stopReason: "stop" | "length" | "toolUse" }
|
|
18
|
+
| { status: "failed"; stopReason: "error"; errorMessage?: string }
|
|
19
|
+
| { status: "aborted"; stopReason: "aborted" }
|
|
20
|
+
| {
|
|
21
|
+
status: "blocked";
|
|
22
|
+
reason: "auto-compaction-failed";
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
A completed protocol request can therefore contain a failed, aborted, or blocked turn outcome. The protocol request itself fails only when the host cannot accept or settle it.
|
|
28
|
+
|
|
29
|
+
## Connect and find sessions
|
|
30
|
+
|
|
31
|
+
### `initialize`
|
|
32
|
+
|
|
33
|
+
Advertises client identity and optional client tools. Send it after `ready`.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
params: {
|
|
37
|
+
client: {
|
|
38
|
+
name: string;
|
|
39
|
+
version: string;
|
|
40
|
+
tools?: Array<{
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
parameters: unknown;
|
|
44
|
+
executionTimeoutMs?: number;
|
|
45
|
+
}>;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
result: {
|
|
50
|
+
protocolVersion: 12;
|
|
51
|
+
methods: string[];
|
|
52
|
+
alreadyInitialized: boolean;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`name` and `version` must be non-empty. Tool names must not collide with host tools or tools advertised by another observer. Only the first initialization on a connection registers tools; a repeated call reports `alreadyInitialized: true`.
|
|
57
|
+
|
|
58
|
+
### `session.create`
|
|
59
|
+
|
|
60
|
+
Creates a session in one explicitly selected execution environment.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
params: {
|
|
64
|
+
executionEnvironment:
|
|
65
|
+
| { kind: "local"; cwd: string; env?: Record<string, string> }
|
|
66
|
+
| {
|
|
67
|
+
kind: "cloudflare-sandbox";
|
|
68
|
+
bridgeId: string;
|
|
69
|
+
sandboxId: string;
|
|
70
|
+
cwd: string;
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
kind: "fly-sprite";
|
|
74
|
+
apiId: string;
|
|
75
|
+
spriteName: string;
|
|
76
|
+
cwd: string;
|
|
77
|
+
};
|
|
78
|
+
attributes: Record<string, string>;
|
|
79
|
+
personaId?: string;
|
|
80
|
+
reasoning?: Reasoning;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
result: { sessionId: string }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`cwd` must be absolute inside the selected execution environment. Cloudflare sandboxes and Fly Sprites must already exist and be reachable through a host-configured resolver. Tau does not provision a target or repository.
|
|
87
|
+
|
|
88
|
+
`attributes` is required, including when empty. It accepts at most 32 immutable pairs; keys are 1 to 64 characters and values at most 1,024 characters. Tau stores the supplied strings without inferring missing provenance. Conventional attributes and their use are covered in [sessions](sessions.md) and [history](history.md).
|
|
89
|
+
|
|
90
|
+
A local `env` supplies execution-environment overrides. Names must be valid environment-variable names, values cannot contain NUL, and `HOME` is forbidden because the execution environment owns it. Overrides become durable session state, so do not put secrets there unless the session store is protected accordingly.
|
|
91
|
+
|
|
92
|
+
Creation returns only an id. Call `session.observe` for state and streamed updates.
|
|
93
|
+
|
|
94
|
+
### `session.list`
|
|
95
|
+
|
|
96
|
+
Lists sessions available from this host.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
params: {
|
|
100
|
+
}
|
|
101
|
+
result: {
|
|
102
|
+
sessions: Array<{ sessionId: string; lifecycle: "idle" | "running" }>;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `session.observe`
|
|
107
|
+
|
|
108
|
+
Observes one session on this connection.
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
params: {
|
|
112
|
+
sessionId: string;
|
|
113
|
+
}
|
|
114
|
+
result: {
|
|
115
|
+
snapshot: SessionProtocolSnapshot;
|
|
116
|
+
pendingUserMessages: PendingUserMessagesState;
|
|
117
|
+
subagentActivities: SubagentActivitiesState;
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Install all three baselines before applying later messages. Calling `observe` again refreshes the baselines without creating a second session.
|
|
122
|
+
|
|
123
|
+
### `session.unobserve`
|
|
124
|
+
|
|
125
|
+
Stops this connection's observation without deleting or interrupting the hosted session.
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
params: {
|
|
129
|
+
sessionId: string;
|
|
130
|
+
}
|
|
131
|
+
result: {
|
|
132
|
+
unobserved: true;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The session must currently be observed by this connection.
|
|
137
|
+
|
|
138
|
+
## Add user input and run turns
|
|
139
|
+
|
|
140
|
+
### `session.record`
|
|
141
|
+
|
|
142
|
+
Appends user-authored text without running an assistant turn.
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
146
|
+
result: { snapshot: SessionProtocolSnapshot; userHistoryEntryId: string }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This is a serialized context mutation. It can interrupt an active turn and rejects pending queue or steering requests before appending the message. Use it for user-authored material that should become model-visible, not for arbitrary client diagnostics.
|
|
150
|
+
|
|
151
|
+
### `session.submit`
|
|
152
|
+
|
|
153
|
+
Appends user text and runs one ordinary turn. The session must be idle.
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
157
|
+
result: { userHistoryEntryId: string; turn: TurnOutcome }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Once accepted, the turn is durably represented in `snapshot.turns[userHistoryEntryId]`. Changes stream through the observed state channels while the request remains open.
|
|
161
|
+
|
|
162
|
+
### `session.queue`
|
|
163
|
+
|
|
164
|
+
Uses the same parameters and result as `session.submit`. When the session is idle it starts immediately. While a turn is active, it appears in pending state and starts after the session becomes idle.
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
params: { sessionId: string; text: string; historyEntryId?: string }
|
|
168
|
+
result: { userHistoryEntryId: string; turn: TurnOutcome }
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The request response remains pending until its eventual turn settles.
|
|
172
|
+
|
|
173
|
+
### `session.steer`
|
|
174
|
+
|
|
175
|
+
Requests a change of direction for active model work.
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
params: {
|
|
179
|
+
sessionId: string;
|
|
180
|
+
text: string;
|
|
181
|
+
}
|
|
182
|
+
result: {
|
|
183
|
+
userHistoryEntryId: string;
|
|
184
|
+
turn: TurnOutcome;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
When idle, steering starts an ordinary turn. During an active turn, Tau waits for a safe continuation boundary, batches steering in arrival order, and starts one continuation turn before queued work. Batched requests share the generated `userHistoryEntryId`. Steering does not accept a caller-provided history id.
|
|
189
|
+
|
|
190
|
+
### `session.cancelPendingMessages`
|
|
191
|
+
|
|
192
|
+
Cancels all pending queue and steering requests without interrupting active work.
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
params: {
|
|
196
|
+
sessionId: string;
|
|
197
|
+
}
|
|
198
|
+
result: {
|
|
199
|
+
cancelled: Array<{ id: string; mode: "queue" | "steer"; text: string }>;
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The returned order is steering first, then queued messages. Each cancelled queue or steering request receives a `cancelled` error response.
|
|
204
|
+
|
|
205
|
+
### `session.retry`
|
|
206
|
+
|
|
207
|
+
Runs one turn from current history without appending user text.
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
params: {
|
|
211
|
+
sessionId: string;
|
|
212
|
+
}
|
|
213
|
+
result: {
|
|
214
|
+
turn: TurnOutcome;
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
The session must be idle. Retry is unavailable while a goal controls the session; use `session.resumeGoal` for a blocked goal.
|
|
219
|
+
|
|
220
|
+
### `session.interrupt`
|
|
221
|
+
|
|
222
|
+
Requests cancellation of active session work, including turns, direct executions, model samples, and maintenance.
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
params: {
|
|
226
|
+
sessionId: string;
|
|
227
|
+
}
|
|
228
|
+
result: {
|
|
229
|
+
interrupted: boolean;
|
|
230
|
+
isTurnRunning: boolean;
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`isTurnRunning` may remain `true` while cancellation settles. The method also cancels unapplied boundary steering. It does not dispose reusable subagent threads; use `session.interruptSubagent` for one subagent.
|
|
235
|
+
|
|
236
|
+
## Run independent execution and sampling
|
|
237
|
+
|
|
238
|
+
### `session.exec`
|
|
239
|
+
|
|
240
|
+
Runs a fresh non-interactive login Bash in the session execution environment. It does not change the snapshot or add output to conversation history.
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
params: {
|
|
244
|
+
sessionId: string;
|
|
245
|
+
execId: string;
|
|
246
|
+
command: string;
|
|
247
|
+
args?: string[];
|
|
248
|
+
env?: Record<string, string>;
|
|
249
|
+
stdinBase64?: string;
|
|
250
|
+
cwd?: string;
|
|
251
|
+
timeoutMs?: number;
|
|
252
|
+
maxCaptureBytes?: number;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
result: {
|
|
256
|
+
output: string;
|
|
257
|
+
stdout: string;
|
|
258
|
+
stderr: string;
|
|
259
|
+
exitCode: number | null;
|
|
260
|
+
truncated: boolean;
|
|
261
|
+
timedOut: boolean;
|
|
262
|
+
aborted: boolean;
|
|
263
|
+
closeSignal: string | null;
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
`execId` must be unique among active executions in the session. `stdinBase64` is limited to 16 MiB decoded. `maxCaptureBytes` is positive and at most 24 MiB; the default is 1 MiB. `HOME` cannot be overridden.
|
|
268
|
+
|
|
269
|
+
When `args` is present, Bash receives the first value as `$0` and the rest as `$@`. A safe exact-executable pattern is `command: 'exec "$0" "$@"'` with the executable and arguments in `args`. `cwd` chooses the command directory but is not a confinement boundary.
|
|
270
|
+
|
|
271
|
+
Executions can overlap turns, samples, mutations, and other executions. Clients must coordinate workspace access when consistency matters.
|
|
272
|
+
|
|
273
|
+
### `session.cancelExec`
|
|
274
|
+
|
|
275
|
+
Cancels one active execution without interrupting other work.
|
|
276
|
+
|
|
277
|
+
```ts
|
|
278
|
+
params: {
|
|
279
|
+
sessionId: string;
|
|
280
|
+
execId: string;
|
|
281
|
+
}
|
|
282
|
+
result: {
|
|
283
|
+
cancelled: boolean;
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### `session.sample`
|
|
288
|
+
|
|
289
|
+
Runs isolated inference against the session's active resolved model target. It uses only the supplied context and does not mutate the session, execute tool calls, emit deltas, or add to session cost.
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
params: {
|
|
293
|
+
sessionId: string;
|
|
294
|
+
context: {
|
|
295
|
+
systemPrompt: string;
|
|
296
|
+
messages: Message[];
|
|
297
|
+
tools?: Array<{
|
|
298
|
+
name: string;
|
|
299
|
+
description: string;
|
|
300
|
+
parameters: Record<string, unknown>;
|
|
301
|
+
}>;
|
|
302
|
+
};
|
|
303
|
+
options: { reasoning?: Reasoning; maxTokens?: number };
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
result: { message: AssistantMessage }
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
`context.messages` and the returned message use Tau's provider-neutral model message shape. Returned tool calls are data only. Samples can run concurrently and are cancelled by `session.interrupt`, transport shutdown, or host shutdown.
|
|
310
|
+
|
|
311
|
+
## Read and change session state
|
|
312
|
+
|
|
313
|
+
### `session.snapshot`
|
|
314
|
+
|
|
315
|
+
Returns the complete authoritative snapshot.
|
|
316
|
+
|
|
317
|
+
```ts
|
|
318
|
+
params: {
|
|
319
|
+
sessionId: string;
|
|
320
|
+
}
|
|
321
|
+
result: SessionProtocolSnapshot;
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Use this after observation, on demand, or to recover from a delta revision gap. The [session protocol](session-protocol.md) describes the snapshot and client application rules.
|
|
325
|
+
|
|
326
|
+
### `session.setReasoning`
|
|
327
|
+
|
|
328
|
+
Changes the reasoning effort for the next independently started turn.
|
|
329
|
+
|
|
330
|
+
```ts
|
|
331
|
+
params: {
|
|
332
|
+
sessionId: string;
|
|
333
|
+
reasoning: Reasoning;
|
|
334
|
+
}
|
|
335
|
+
result: {
|
|
336
|
+
revision: number;
|
|
337
|
+
settings: SessionProtocolSettingsSnapshot;
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
The update is serialized but does not interrupt a running turn. Active turns and steering continuations retain their captured settings.
|
|
342
|
+
|
|
343
|
+
### `session.setPersona`
|
|
344
|
+
|
|
345
|
+
Changes the persona to an id in the session catalog.
|
|
346
|
+
|
|
347
|
+
```ts
|
|
348
|
+
params: {
|
|
349
|
+
sessionId: string;
|
|
350
|
+
personaId: string;
|
|
351
|
+
}
|
|
352
|
+
result: SessionProtocolSnapshot;
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
This is a serialized context mutation. It interrupts an active turn and rejects pending input before returning the authoritative snapshot.
|
|
356
|
+
|
|
357
|
+
### `session.resolvePrompt`
|
|
358
|
+
|
|
359
|
+
Loads one current prompt body from the execution environment.
|
|
360
|
+
|
|
361
|
+
```ts
|
|
362
|
+
params: {
|
|
363
|
+
sessionId: string;
|
|
364
|
+
promptId: string;
|
|
365
|
+
}
|
|
366
|
+
result: {
|
|
367
|
+
promptId: string;
|
|
368
|
+
text: string;
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Snapshot catalog entries contain prompt metadata only. Call this lazily when the user invokes a prompt.
|
|
373
|
+
|
|
374
|
+
### `session.autocompletePaths`
|
|
375
|
+
|
|
376
|
+
Returns bounded path suggestions from the execution environment.
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
params: { sessionId: string; query: string; limit: number }
|
|
380
|
+
result: { paths: string[] }
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
`limit` is a positive integer no greater than 100. Results can include directories with a trailing `/` and are not snapshot state.
|
|
384
|
+
|
|
385
|
+
## Manage goals
|
|
386
|
+
|
|
387
|
+
### `session.startGoal`
|
|
388
|
+
|
|
389
|
+
Creates a persistent active goal, commits its objective as user input, and runs autonomous continuations until the goal completes, blocks, fails, or is interrupted.
|
|
390
|
+
|
|
391
|
+
```ts
|
|
392
|
+
params: {
|
|
393
|
+
sessionId: string;
|
|
394
|
+
objective: string;
|
|
395
|
+
}
|
|
396
|
+
result: {
|
|
397
|
+
userHistoryEntryId: string;
|
|
398
|
+
turn: TurnOutcome;
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Only one goal can exist. Queued messages wait for goal work to settle.
|
|
403
|
+
|
|
404
|
+
### `session.resumeGoal`
|
|
405
|
+
|
|
406
|
+
Resumes a blocked goal without adding a visible user message.
|
|
407
|
+
|
|
408
|
+
```ts
|
|
409
|
+
params: {
|
|
410
|
+
sessionId: string;
|
|
411
|
+
}
|
|
412
|
+
result: {
|
|
413
|
+
turn: TurnOutcome;
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### `session.clearGoal`
|
|
418
|
+
|
|
419
|
+
Clears the current goal and returns the updated snapshot.
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
params: {
|
|
423
|
+
sessionId: string;
|
|
424
|
+
}
|
|
425
|
+
result: SessionProtocolSnapshot;
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
If no goal exists, the method returns `invalid_request`. Clearing interrupts an active turn and rejects pending input.
|
|
429
|
+
|
|
430
|
+
## Reload, compact, and rewind
|
|
431
|
+
|
|
432
|
+
### `session.reload`
|
|
433
|
+
|
|
434
|
+
Reloads session-owned configuration and content from the execution environment.
|
|
435
|
+
|
|
436
|
+
```ts
|
|
437
|
+
params: { sessionId: string }
|
|
438
|
+
result: {
|
|
439
|
+
snapshot: SessionProtocolSnapshot;
|
|
440
|
+
warnings: string[];
|
|
441
|
+
counts: { personas: number; prompts: number; skills: number };
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Reload is a serialized context mutation. It interrupts an active turn and rejects pending input. It does not reload client-owned themes or tools, process environment variables, or host-wide services. See [configuration](configuration.md) for apply boundaries.
|
|
446
|
+
|
|
447
|
+
### `session.compact`
|
|
448
|
+
|
|
449
|
+
Manually replaces active model context with a generated summary.
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
params: {
|
|
453
|
+
sessionId: string;
|
|
454
|
+
mode: "summary-only" | "summary-and-last";
|
|
455
|
+
guidance?: string;
|
|
456
|
+
}
|
|
457
|
+
result: {
|
|
458
|
+
snapshot: SessionProtocolSnapshot;
|
|
459
|
+
compactionMessage: string;
|
|
460
|
+
includedLastAssistant: boolean;
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Compaction interrupts an active turn, rejects pending input, and returns an authoritative replacement snapshot. A successful compaction advances the timeline epoch.
|
|
465
|
+
|
|
466
|
+
### `session.rewind`
|
|
467
|
+
|
|
468
|
+
Removes one selected user history entry and all later active state.
|
|
469
|
+
|
|
470
|
+
```ts
|
|
471
|
+
params: { sessionId: string; historyEntryId: string }
|
|
472
|
+
result: {
|
|
473
|
+
snapshot: SessionProtocolSnapshot;
|
|
474
|
+
historyEntryId: string;
|
|
475
|
+
text: string;
|
|
476
|
+
removedEntryIds: string[];
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Rewind requires no active turn and no pending user input. It returns `busy` rather than interrupting work. The returned `text` is the selected user text for restoring to an editor.
|
|
481
|
+
|
|
482
|
+
## Control subagents and ephemeral contexts
|
|
483
|
+
|
|
484
|
+
### `session.interruptSubagent`
|
|
485
|
+
|
|
486
|
+
Interrupts the current run of one supervised subagent without disposing its reusable thread.
|
|
487
|
+
|
|
488
|
+
```ts
|
|
489
|
+
params: {
|
|
490
|
+
sessionId: string;
|
|
491
|
+
subagentId: string;
|
|
492
|
+
}
|
|
493
|
+
result: {
|
|
494
|
+
found: boolean;
|
|
495
|
+
}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### `session.ephemeral.create`
|
|
499
|
+
|
|
500
|
+
Creates a non-persisted host-owned agent context independent of the main timeline.
|
|
501
|
+
|
|
502
|
+
```ts
|
|
503
|
+
params: {
|
|
504
|
+
sessionId: string;
|
|
505
|
+
instructions: string;
|
|
506
|
+
tools: Array<"bash" | "write" | "edit" | "view_image" | "web">;
|
|
507
|
+
}
|
|
508
|
+
result: {
|
|
509
|
+
contextId: string;
|
|
510
|
+
}
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
The context uses the hosted session's persona and execution environment plus the supplied instructions and exact tool set. It is not recoverable after host restart.
|
|
514
|
+
|
|
515
|
+
### `session.ephemeral.submit`
|
|
516
|
+
|
|
517
|
+
Runs or continues one thread in an ephemeral context.
|
|
518
|
+
|
|
519
|
+
```ts
|
|
520
|
+
params: {
|
|
521
|
+
sessionId: string;
|
|
522
|
+
contextId: string;
|
|
523
|
+
threadId: string;
|
|
524
|
+
forkFromThreadId?: string;
|
|
525
|
+
message: string;
|
|
526
|
+
}
|
|
527
|
+
result: { threadId: string; response: string }
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
`forkFromThreadId` creates a new thread from an idle thread in the same context. Overlapping submissions to the same thread return `busy`; independent threads can run concurrently.
|
|
531
|
+
|
|
532
|
+
### `session.ephemeral.close`
|
|
533
|
+
|
|
534
|
+
Closes a context and interrupts its live threads.
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
params: {
|
|
538
|
+
sessionId: string;
|
|
539
|
+
contextId: string;
|
|
540
|
+
}
|
|
541
|
+
result: {
|
|
542
|
+
closed: boolean;
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
`closed` is `false` when the context was not present.
|
|
547
|
+
|
|
548
|
+
## Complete delegated client-tool calls
|
|
549
|
+
|
|
550
|
+
These methods are for a client that advertised tools during `initialize`. Ordinary clients do not call them.
|
|
551
|
+
|
|
552
|
+
### `session.clientTool.ack`
|
|
553
|
+
|
|
554
|
+
Acknowledges a `session.clientTool.call` before its deadline.
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
params: {
|
|
558
|
+
sessionId: string;
|
|
559
|
+
callId: string;
|
|
560
|
+
}
|
|
561
|
+
result: {
|
|
562
|
+
accepted: boolean;
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### `session.clientTool.result`
|
|
567
|
+
|
|
568
|
+
Completes an acknowledged call with model-visible content or an error.
|
|
569
|
+
|
|
570
|
+
```ts
|
|
571
|
+
params:
|
|
572
|
+
| { sessionId: string; callId: string; ok: true; content: string }
|
|
573
|
+
| { sessionId: string; callId: string; ok: false; error: string }
|
|
574
|
+
result: { accepted: boolean }
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
`accepted: false` means the call was cancelled, timed out, detached, unknown, or already completed. Do not retry or send additional results for that call.
|