@markusylisiurunen/tau 0.3.82 → 0.3.84
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 +1 -3
- package/dist/core/agent/agent_runtime.js +10 -6
- package/dist/core/agent/agent_runtime.js.map +1 -1
- package/dist/core/cli.js +2 -2
- package/dist/core/cli.js.map +1 -1
- package/dist/core/code_mode/models.js +61 -22
- package/dist/core/code_mode/models.js.map +1 -1
- package/dist/core/commands/auto_compact.js +16 -0
- package/dist/core/commands/auto_compact.js.map +1 -0
- package/dist/core/commands/registry.js +13 -0
- package/dist/core/commands/registry.js.map +1 -1
- package/dist/core/history/cli.js +48 -0
- package/dist/core/history/cli.js.map +1 -1
- package/dist/core/history/history_manager.js +9 -3
- package/dist/core/history/history_manager.js.map +1 -1
- package/dist/core/history/local_history_store.js +9 -2
- package/dist/core/history/local_history_store.js.map +1 -1
- package/dist/core/history/remote_history_client.js +18 -3
- package/dist/core/history/remote_history_client.js.map +1 -1
- package/dist/core/models/openrouter.js +17 -5
- package/dist/core/models/openrouter.js.map +1 -1
- package/dist/core/models/openrouter_decisions.js +16 -1
- package/dist/core/models/openrouter_decisions.js.map +1 -1
- package/dist/core/runtime/chat_runtime.js +5 -0
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- package/dist/core/session/auto_compaction_threshold.js +4 -0
- package/dist/core/session/auto_compaction_threshold.js.map +1 -0
- package/dist/core/static/tau_docs/client-tools.md +53 -53
- package/dist/core/static/tau_docs/config-reference.md +46 -43
- package/dist/core/static/tau_docs/configuration.md +40 -36
- package/dist/core/static/tau_docs/credentials.md +32 -31
- package/dist/core/static/tau_docs/getting-started.md +28 -28
- package/dist/core/static/tau_docs/history.md +114 -79
- package/dist/core/static/tau_docs/image-generation.md +20 -18
- package/dist/core/static/tau_docs/index.md +30 -31
- package/dist/core/static/tau_docs/manifest.json +1 -0
- package/dist/core/static/tau_docs/models.md +17 -17
- package/dist/core/static/tau_docs/node-sdk.md +74 -69
- package/dist/core/static/tau_docs/nook.md +75 -69
- package/dist/core/static/tau_docs/openrouter.md +28 -13
- package/dist/core/static/tau_docs/ownership-and-scope.md +21 -23
- package/dist/core/static/tau_docs/pdf-unpacking.md +6 -6
- package/dist/core/static/tau_docs/personas.md +29 -27
- package/dist/core/static/tau_docs/prompts-and-project-context.md +41 -39
- package/dist/core/static/tau_docs/remote-sessions.md +38 -38
- package/dist/core/static/tau_docs/sdk-diff-review.md +16 -12
- package/dist/core/static/tau_docs/security.md +72 -72
- package/dist/core/static/tau_docs/session-protocol-methods.md +69 -45
- package/dist/core/static/tau_docs/session-protocol.md +59 -52
- package/dist/core/static/tau_docs/sessions.md +112 -88
- package/dist/core/static/tau_docs/skills.md +25 -20
- package/dist/core/static/tau_docs/speech-generation.md +5 -5
- package/dist/core/static/tau_docs/subagents.md +42 -44
- package/dist/core/static/tau_docs/telegram-projects.md +142 -0
- package/dist/core/static/tau_docs/telegram.md +67 -181
- package/dist/core/static/tau_docs/tools.md +72 -80
- package/dist/core/static/tau_docs/troubleshooting.md +94 -149
- package/dist/core/static/tau_docs/tui.md +127 -80
- package/dist/core/subagents/agent_supervisor.js +1 -0
- package/dist/core/subagents/agent_supervisor.js.map +1 -1
- package/dist/core/telegram/adapter.js +31 -1
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/session_manager.js +11 -0
- package/dist/core/telegram/session_manager.js.map +1 -1
- package/dist/core/tool/image_generate.js +5 -17
- package/dist/core/tool/image_generate.js.map +1 -1
- package/dist/core/tool/openrouter.js +21 -2
- package/dist/core/tool/openrouter.js.map +1 -1
- package/dist/core/utils/gemini_transcription.js +43 -13
- package/dist/core/utils/gemini_transcription.js.map +1 -1
- package/dist/core/utils/model_stream.js +17 -1
- package/dist/core/utils/model_stream.js.map +1 -1
- package/dist/core/version.js +2 -2
- package/dist/diff_tool/app/dist/assets/{angular-html-D20byCHL.js → angular-html-Dr923UVo.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{angular-ts-CvVQslm2.js → angular-ts-DOChuIbB.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{apl-DNIxlYWe.js → apl-Bs_bcAcm.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{astro-DDOw4EUG.js → astro-a4yvqyGV.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{blade-DlhB-SLW.js → blade-BD5OxwVc.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{c-C1f4vhDm.js → c-CPWQkPLc.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{chapel-Ctt8xOX1.js → chapel-DaQatW92.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cobol-BXw71PAA.js → cobol-Dv7H5p9m.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{coffee-CRh_5Nmr.js → coffee-BUGvGi57.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cpp-IlI-zWOZ.js → cpp-fo_wPsB8.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{crystal-CXeL28i7.js → crystal--pI-R_dD.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{css-BfST9hFI.js → css-BssyxPkY.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{edge--Q22k_ty.js → edge-CZ8t3-Ec.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elixir-CIfC_rQx.js → elixir-UZt0J7RJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elm-OkZ29XRO.js → elm-DIbchse0.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{erb-B8ZXgEqv.js → erb-BOBhlFtI.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{git-rebase-CxkO_WGd.js → git-rebase-BAOt70YV.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-js-BVadyIrr.js → glimmer-js-CEvU-NQC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-ts-D5J3Qb7n.js → glimmer-ts-BTMr7YQb.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glsl-B6iy73-Y.js → glsl-BdwQytbZ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{graphql-Dc3rUXf5.js → graphql-MVXf_Gip.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hack-q8Utf8Jp.js → hack-BKsyThYd.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{haml-mjMIlj_2.js → haml-aYjo4kTQ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{handlebars-CA-BL8Ks.js → handlebars-CkBj5nNj.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-BmPxhYCX.js → html-V_XLZjq3.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-derivative-CvknIjuB.js → html-derivative-CLtkZVT2.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{http-DNxLDRIi.js → http-nUN1ldGy.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hurl-kbd3Eq2V.js → hurl-BBwLfekr.js} +1 -1
- package/dist/diff_tool/app/dist/assets/index-Dt2v7POE.js +341 -0
- package/dist/diff_tool/app/dist/assets/{java-BuZshgf1.js → java-DLkxtNEL.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{javascript-DfL2oeFU.js → javascript-CVr4Rx0e.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jinja-Bu0KQihU.js → jinja-BOSJTyD0.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jison-Bqn7Mf3Q.js → jison-Di3-hBGP.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{json-BuX5LKaB.js → json-D9C8xfZt.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jsx-DdVJ-ZBp.js → jsx-CUDhGSfU.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{julia-CQeijOoQ.js → julia-CRy8R7YY.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{just-vzAktFGR.js → just-tUqjHI43.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{latex-Dm60cg0k.js → latex-8_LCZmZN.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{liquid-vxKzm2P8.js → liquid-CvGorueR.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{lua-DIoqi4dd.js → lua-DR_7pVFC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{marko-BTHgFKby.js → marko-sTN8ZOd5.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{mdc-CEfz8gZ9.js → mdc-xRsS5Ubl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nginx-DNlFDEfJ.js → nginx-ypaVSshx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nim-DnvT_0lZ.js → nim-DTc1FpAl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{org-BbD-ElVf.js → org-B7I2tEAw.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{perl-DTsbnAmK.js → perl-CTNhHvKx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{php-CwEsJe-W.js → php-LzxyOsOP.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{pug-BOttMVH-.js → pug-D5FIy7qc.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{qml-C8KkSItN.js → qml-CfdV5Js7.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{r-K4ksJj_R.js → r-CZ-EMZDs.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{razor-yuWRrrG6.js → razor-BhyBjPmN.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{regexp-CV-jhnUz.js → regexp-iPvMX04S.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{rst-CLA3Attc.js → rst-Dpp9DE6Q.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ruby-DiHR2-DX.js → ruby-CVyShlOK.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sas-DxIjbYJ5.js → sas-DFmollAV.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{scss-CShwEaV4.js → scss-Di6lsIQE.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellscript-CeezOnrF.js → shellscript-CRHervLi.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellsession-CjSS2r7j.js → shellsession-CHP7Q5Ym.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{soy-CI_v23nJ.js → soy-CNXyGE_T.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sql-D9GaB00A.js → sql-DnPFF_uz.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{stata-hK92TPE_.js → stata-CobN2W6n.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{surrealql-UO8LtPJG.js → surrealql-DqvGXHs7.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{svelte-kIlaw_oh.js → svelte-ChhfFBzQ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{templ-DFRz1JP6.js → templ-DKi2U_4-.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tex-CfxIXk_z.js → tex-Cjl-M5D5.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ts-tags-BtUHl0ff.js → ts-tags-CV2veQhe.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tsx-Cd4SAe2C.js → tsx-Dw0DYsvT.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{twig-CWk4q5Y3.js → twig-r46-w1o_.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typescript-BqxGJiP0.js → typescript-QuYM-098.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typst-D9nAun2p.js → typst-B9jAU5LS.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-D6HYhg6_.js → vue-CIrFiYWU.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-html-1VRlaENS.js → vue-html-bfczklzO.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-vine-BaH0We9y.js → vue-vine-BmBCOwQI.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xml-C4RWnUuj.js → xml-DYPsS0xh.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xsl-D1iD38ga.js → xsl-DZFDwCkt.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{yaml-yAb4W0G-.js → yaml-9CQ32JJD.js} +1 -1
- package/dist/diff_tool/app/dist/index.html +1 -1
- package/dist/history/worker/index.js +87 -83
- package/dist/history/worker/index.js.map +1 -1
- package/dist/host/hosted_ephemeral_agent_session.js +1 -0
- package/dist/host/hosted_ephemeral_agent_session.js.map +1 -1
- package/dist/host/local_session_host.js +30 -1
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/host/session_protocol_handler.js +18 -0
- package/dist/host/session_protocol_handler.js.map +1 -1
- package/dist/main.js +6 -7
- package/dist/main.js.map +1 -1
- package/dist/protocol/index.d.ts +1 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/session_protocol.d.ts +13 -2
- package/dist/protocol/session_protocol.js +31 -1
- package/dist/protocol/session_protocol.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/session.js +11 -0
- package/dist/sdk/session.js.map +1 -1
- package/dist/sdk/types.d.ts +2 -0
- package/dist/store/session_snapshot_migrations.js +19 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/dist/tui/session_chat_controller.js +41 -4
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/terminal.js +1 -0
- package/dist/tui/terminal.js.map +1 -1
- package/dist/tui/ui/chat_container.js +34 -17
- package/dist/tui/ui/chat_container.js.map +1 -1
- package/dist/tui/ui/footer.js +2 -4
- package/dist/tui/ui/footer.js.map +1 -1
- package/package.json +11 -10
- package/dist/diff_tool/app/dist/assets/index-D8ZI_2RC.js +0 -340
- package/dist/nook/README.md +0 -123
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Session protocol
|
|
2
2
|
|
|
3
|
-
Tau's session protocol is the
|
|
3
|
+
Tau's session protocol is the wire format for clients that create, observe, and control sessions hosted by `tau serve`. Node applications can usually use the typed [Node SDK](node-sdk.md) instead.
|
|
4
4
|
|
|
5
|
-
The protocol is
|
|
5
|
+
The protocol is based on requests and responses, plus server messages for session state, pending input, subagent activity, short-lived feedback, and client tool calls. It does not depend on a particular transport; Tau serves it over WebSocket. The complete method surface is in the [session protocol method reference](session-protocol-methods.md).
|
|
6
6
|
|
|
7
7
|
## Connect over WebSocket
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ The protocol is transport-neutral and request and response based, with separate
|
|
|
10
10
|
|
|
11
11
|
The server exposes one host. Starting it does not create or select a session. A client lists, creates, or observes sessions explicitly.
|
|
12
12
|
|
|
13
|
-
The client, host, and execution environment
|
|
13
|
+
The client, host, and execution environment are separate, even when they share a process or filesystem. Session paths and commands are on the execution environment. Saving, credentials, model calls, and protocol handling are on the host. Client tools and local UI are on the connected client. See [ownership and scope](ownership-and-scope.md) before passing paths or credentials across this boundary.
|
|
14
14
|
|
|
15
15
|
## Connect and initialize
|
|
16
16
|
|
|
@@ -18,19 +18,19 @@ The server sends `ready` as its first message:
|
|
|
18
18
|
|
|
19
19
|
```json
|
|
20
20
|
{
|
|
21
|
-
"version":
|
|
21
|
+
"version": 18,
|
|
22
22
|
"type": "ready",
|
|
23
23
|
"methods": ["initialize", "session.create", "session.list"]
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
The
|
|
27
|
+
The real `methods` array lists every supported method; the example above is shortened. Versions must match exactly and are not negotiated. If client and host disagree on `version`, use matching Tau releases.
|
|
28
28
|
|
|
29
29
|
After `ready`, send `initialize` with non-empty client metadata:
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
33
|
-
"version":
|
|
33
|
+
"version": 18,
|
|
34
34
|
"type": "request",
|
|
35
35
|
"id": "init-1",
|
|
36
36
|
"method": "initialize",
|
|
@@ -40,9 +40,9 @@ After `ready`, send `initialize` with non-empty client metadata:
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
A successful result returns `protocolVersion`, the
|
|
43
|
+
A successful result returns `protocolVersion`, the full `methods` array, and `alreadyInitialized`. Calling `initialize` again is allowed and returns `alreadyInitialized: true`. It does not act on any session, but clients should complete it before other requests.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
A client can offer its own tools in `client.tools` when initializing. Calls to those tools are then sent to it over this connection. [Client tools](client-tools.md) covers tool behavior, permissions, and command helpers; this page covers only the wire messages a raw protocol client needs.
|
|
46
46
|
|
|
47
47
|
## Send requests and match responses
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ Every request has the same envelope:
|
|
|
50
50
|
|
|
51
51
|
```json
|
|
52
52
|
{
|
|
53
|
-
"version":
|
|
53
|
+
"version": 18,
|
|
54
54
|
"type": "request",
|
|
55
55
|
"id": "req-42",
|
|
56
56
|
"method": "session.snapshot",
|
|
@@ -58,13 +58,13 @@ Every request has the same envelope:
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
`id` is a non-empty
|
|
61
|
+
`id` is a non-empty string chosen by the client, unique among its open requests on the connection. `params` is always required, even if empty, as in `{}` for `session.list`. The host validates required fields, types, discriminators, method names, and the exact protocol version. Unknown fields are accepted and removed, except in system messages and their metadata, where they are rejected.
|
|
62
62
|
|
|
63
63
|
Successful responses echo the request id:
|
|
64
64
|
|
|
65
65
|
```json
|
|
66
66
|
{
|
|
67
|
-
"version":
|
|
67
|
+
"version": 18,
|
|
68
68
|
"type": "response",
|
|
69
69
|
"id": "req-42",
|
|
70
70
|
"ok": true,
|
|
@@ -76,7 +76,7 @@ A request can remain open while the host emits state messages or handles later r
|
|
|
76
76
|
|
|
77
77
|
## Observe before consuming session state
|
|
78
78
|
|
|
79
|
-
`session.create` creates a
|
|
79
|
+
`session.create` creates a session but does not observe it. `session.observe` starts observing on this connection and returns three complete starting states together:
|
|
80
80
|
|
|
81
81
|
```json
|
|
82
82
|
{
|
|
@@ -86,13 +86,13 @@ A request can remain open while the host emits state messages or handles later r
|
|
|
86
86
|
}
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
Install all three
|
|
89
|
+
Install all three before processing later messages for that session. The host holds back updates while preparing the response, and afterward sends only updates newer than the returned revisions.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Observing controls which updates you receive; it does not make you the owner. `session.unobserve` stops this connection's updates without deleting the session or interrupting work. Several connections can observe one session, and each can change it. Client tool names must be unique among observing clients.
|
|
92
92
|
|
|
93
|
-
## Treat the snapshot as
|
|
93
|
+
## Treat the snapshot as the source of truth
|
|
94
94
|
|
|
95
|
-
`SessionProtocolSnapshot` is the recoverable
|
|
95
|
+
`SessionProtocolSnapshot` is the saved, recoverable state of one session. Its main fields are:
|
|
96
96
|
|
|
97
97
|
| Field | Meaning |
|
|
98
98
|
| --- | --- |
|
|
@@ -100,29 +100,36 @@ Observation controls delivery, not session ownership. `session.unobserve` stops
|
|
|
100
100
|
| `revision` | Monotonic protocol snapshot revision. |
|
|
101
101
|
| `lifecycle` | `idle` or `running`. |
|
|
102
102
|
| `agentState` | Independent agent revision, model context key, and optional usage checkpoint. |
|
|
103
|
-
| `settings`, `costTotal` | Persona and
|
|
103
|
+
| `settings`, `costTotal` | Persona, reasoning, and auto-compaction settings, and accumulated session cost. |
|
|
104
104
|
| `bootstrap`, `catalog` | Selected model and prompt metadata plus available personas, prompt metadata, skills, and enabled host-configured MCP server names. |
|
|
105
105
|
| `executionEnvironment` | The environment kind, identity, `cwd`, and home used for agent-visible work. |
|
|
106
|
-
| `messages`, `turns` |
|
|
106
|
+
| `messages`, `turns` | Messages sent to the model, and a saved record for each accepted turn. |
|
|
107
107
|
| `timeline` | Ordered active transcript placement. |
|
|
108
|
-
| `tools`, `operations`, `agents` |
|
|
108
|
+
| `tools`, `operations`, `agents` | Changing state that timeline items or client views refer to. |
|
|
109
109
|
| `facets` | Versioned client-facing metadata. Unknown facet kinds and versions should be ignored. |
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Both auto-compaction fields in `settings` are required:
|
|
112
112
|
|
|
113
|
-
`
|
|
113
|
+
- `autoCompactThresholdTokens` is the configured value: a safe integer of at least 50,000, or `null` for the model-based default.
|
|
114
|
+
- `effectiveAutoCompactThresholdTokens` is the integer threshold clients should display. It is the model's context window minus 16,384 tokens, or the configured value if that is smaller.
|
|
115
|
+
|
|
116
|
+
`bootstrap.model.contextWindow` is the full model window, regardless of the compaction threshold.
|
|
117
|
+
|
|
118
|
+
`catalog.mcpServers` lists the enabled MCP servers in the host configuration, by name only. It does not mean they are connected; servers connect on first use. Connection settings and credentials are never included.
|
|
119
|
+
|
|
120
|
+
`bootstrap.prompt.subagentSystemPrompt` is present when subagents can be started. Each catalog persona has a `subagentLaunchModels` allowlist. Subagent records have task titles and IDs; there are no worker types.
|
|
114
121
|
|
|
115
122
|
Render active transcript order from `timeline.items`, not by sorting or filtering `messages`. A timeline item either contains a notice or references a message, tool, or operation in the corresponding snapshot collection. Some model-visible messages intentionally have no timeline item.
|
|
116
123
|
|
|
117
124
|
The timeline has an `epoch`, a per-epoch sequence high-water mark, and ordered items. Successful compaction replaces the active recoverable timeline and advances the epoch. Rewind stays in the same epoch, removes later items, and preserves the sequence high-water mark so sequence numbers are not reused.
|
|
118
125
|
|
|
119
|
-
User message text is raw
|
|
126
|
+
User message text is stored raw. Before showing it, remove Tau metadata and any leading `<system>...</system>\n` blocks; the Node SDK exports helpers for this. Apply this only to user messages, never to assistant, tool-result, or system messages.
|
|
120
127
|
|
|
121
|
-
The
|
|
128
|
+
The first system message is the persona's base prompt. Later system messages are history records, in order, with plain-text `content`, a `timestamp`, and required `metadata`: `{ type: "instruction" | "auto-compaction-continuation", version: 1 }`. The model sees them and they are recoverable. The TUI hides them, and searchable history includes them as system entries. Tau metadata is removed before sending to the provider. System messages cannot contain text-block arrays, named sections, or tool changes.
|
|
122
129
|
|
|
123
|
-
|
|
130
|
+
These later system messages are added without a turn record. Adding one uses the `system-message` delta cause and needs no timeline item. The base prompt has no such metadata, and recovery restores later instructions without duplicating it. Clients cannot insert system messages, and a user's `<system>` text is never turned into one.
|
|
124
131
|
|
|
125
|
-
Turn requests return a
|
|
132
|
+
Turn requests return a final outcome, and each accepted user turn is also recorded in `snapshot.turns`, keyed by `userHistoryEntryId`. Use this record to tell an unknown request apart from accepted work that is running or finished. Never infer outcomes from notice titles, message counts, or timing.
|
|
126
133
|
|
|
127
134
|
User-facing behavior such as retry, compaction, rewind, and recovery is described in [sessions](sessions.md).
|
|
128
135
|
|
|
@@ -132,7 +139,7 @@ Observed snapshot changes arrive as `session.delta`:
|
|
|
132
139
|
|
|
133
140
|
```json
|
|
134
141
|
{
|
|
135
|
-
"version":
|
|
142
|
+
"version": 18,
|
|
136
143
|
"type": "session.delta",
|
|
137
144
|
"sessionId": "0195d6e4-4cf9-7f44-a2d8-f8f7f49ee9d3",
|
|
138
145
|
"fromRevision": 8,
|
|
@@ -152,17 +159,17 @@ Observed snapshot changes arrive as `session.delta`:
|
|
|
152
159
|
}
|
|
153
160
|
```
|
|
154
161
|
|
|
155
|
-
For a patch, `fromRevision` must equal
|
|
162
|
+
For a patch, `fromRevision` must equal your current snapshot revision, and `toRevision` becomes the new one. Apply all `changes` in order, as one unit. Changes can set scalar state, append or replace messages, append streamed content, update the timeline, or set and remove keyed tools, operations, agents, turns, and facets.
|
|
156
163
|
|
|
157
|
-
`snapshot.reset` carries a complete
|
|
164
|
+
`snapshot.reset` carries a complete new snapshot. Its cause is `compaction`, `rewind`, or `resync`, and compaction and rewind include the timeline data needed to validate the change. Use the cause; never guess at a destructive change from the content.
|
|
158
165
|
|
|
159
|
-
If a patch has an unexpected `fromRevision`, or
|
|
166
|
+
If a patch has an unexpected `fromRevision`, or a change would leave invalid references or ordering, stop applying deltas and call `session.snapshot`. A delta whose `toRevision` you already have is stale; do not replay its effects in the UI.
|
|
160
167
|
|
|
161
168
|
Node clients can use `applySessionProtocolDelta`, which validates session identity, revision continuity, timeline rules, references, and the resulting snapshot.
|
|
162
169
|
|
|
163
170
|
## Maintain the independent live-state channels
|
|
164
171
|
|
|
165
|
-
|
|
172
|
+
Some live state is not part of the snapshot. Each of these channels has its own revision or delivery rules.
|
|
166
173
|
|
|
167
174
|
### Pending user messages
|
|
168
175
|
|
|
@@ -170,7 +177,7 @@ Not all observed state belongs in the recoverable snapshot. Each live channel ha
|
|
|
170
177
|
|
|
171
178
|
```json
|
|
172
179
|
{
|
|
173
|
-
"version":
|
|
180
|
+
"version": 18,
|
|
174
181
|
"type": "session.pendingUserMessages",
|
|
175
182
|
"sessionId": "...",
|
|
176
183
|
"state": {
|
|
@@ -183,23 +190,23 @@ Not all observed state belongs in the recoverable snapshot. Each live channel ha
|
|
|
183
190
|
}
|
|
184
191
|
```
|
|
185
192
|
|
|
186
|
-
Replace the
|
|
193
|
+
Replace the whole list, but only when the revision is newer. These revisions are separate from snapshot revisions. All observers share this state while the session is loaded on the host. It is empty after recovery.
|
|
187
194
|
|
|
188
195
|
### Subagent activities
|
|
189
196
|
|
|
190
197
|
`session.subagentActivities` carries an independent `revision` and a list of changes. `agent.set` replaces that agent's complete current-run activity list; `agent.remove` deletes it. Apply changes only when the message revision is newer than the installed activity revision. The observe result provides the complete baseline.
|
|
191
198
|
|
|
192
|
-
Activity lists contain
|
|
199
|
+
Activity lists contain limited assistant text, finished tool cards, and notices. They are live progress information, do not replace `snapshot.agents`, and are empty after recovery.
|
|
193
200
|
|
|
194
201
|
### Ephemeral events
|
|
195
202
|
|
|
196
|
-
`session.ephemeral` carries
|
|
203
|
+
`session.ephemeral` carries live events that are not guaranteed and have no revision:
|
|
197
204
|
|
|
198
|
-
- `feedback.notice` is
|
|
199
|
-
- `ephemeral-agent.thread-update` reports
|
|
200
|
-
- `timeline.item` is a
|
|
205
|
+
- `feedback.notice` is short-lived footer feedback.
|
|
206
|
+
- `ephemeral-agent.thread-update` reports progress of an ephemeral context and thread.
|
|
207
|
+
- `timeline.item` is a notice that is not saved, with a timeline epoch and sequence number.
|
|
201
208
|
|
|
202
|
-
|
|
209
|
+
Show a `timeline.item` only if its epoch matches your snapshot. After compaction, drop items from the old epoch; after rewind, drop items past the rewind point. Missing ephemeral events never require a resync.
|
|
203
210
|
|
|
204
211
|
## Delegate client tools
|
|
205
212
|
|
|
@@ -207,7 +214,7 @@ An initialized client that advertised a tool can receive:
|
|
|
207
214
|
|
|
208
215
|
```json
|
|
209
216
|
{
|
|
210
|
-
"version":
|
|
217
|
+
"version": 18,
|
|
211
218
|
"type": "session.clientTool.call",
|
|
212
219
|
"sessionId": "...",
|
|
213
220
|
"agentId": "main",
|
|
@@ -219,11 +226,11 @@ An initialized client that advertised a tool can receive:
|
|
|
219
226
|
}
|
|
220
227
|
```
|
|
221
228
|
|
|
222
|
-
Acknowledge promptly with `session.clientTool.ack`, optionally
|
|
229
|
+
Acknowledge promptly with `session.clientTool.ack`, optionally with a partial presentation for the running tool card. Start work only after the acknowledgement returns `{ accepted: true }`. Then send exactly one `session.clientTool.result` with `{ ok: true, content }` or `{ ok: false, error }`, optionally with a separate presentation for the finished card. `content` is an ordered array of text and image blocks. Both presentations may contain `subject`, `subjectWrap`, `details`, and `metadata`. The host sets the action and operation and fills in omitted fields. Fields you set are kept unchanged once they pass validation, while defaults are truncated the way Tau truncates its own cards. An empty `details` or `metadata` array hides that default.
|
|
223
230
|
|
|
224
|
-
A successful result is rejected until acknowledgement has completed. If preparation
|
|
231
|
+
A successful result is rejected until the acknowledgement has completed. If preparation fails, send an error result before acknowledging; the host records a preparation failure and the tool never runs. If no result arrives, because of a timeout, cancellation, detach, or other failure, the host shows a complete default card. The result method returns `{ accepted: boolean }`; `false` means the result does not fit the call's current state or the call no longer expects it.
|
|
225
232
|
|
|
226
|
-
`session.clientTool.cancel` names the session and call with reason `aborted`, `timeout`, `client-detached`, or `host-failed`.
|
|
233
|
+
`session.clientTool.cancel` names the session and call, with reason `aborted`, `timeout`, `client-detached`, or `host-failed`. Stop local work and do not send a result. The SDK handles all of this for you. Permissions and execution-environment access for client tools are covered in [client tools](client-tools.md).
|
|
227
234
|
|
|
228
235
|
## Handle errors and terminal transport failure
|
|
229
236
|
|
|
@@ -231,7 +238,7 @@ Error responses use `ok: false`:
|
|
|
231
238
|
|
|
232
239
|
```json
|
|
233
240
|
{
|
|
234
|
-
"version":
|
|
241
|
+
"version": 18,
|
|
235
242
|
"type": "response",
|
|
236
243
|
"id": "req-42",
|
|
237
244
|
"ok": false,
|
|
@@ -255,19 +262,19 @@ The supported codes are:
|
|
|
255
262
|
| `cancelled` | Pending input, execution, or sampling was cancelled. |
|
|
256
263
|
| `internal_error` | The host could not complete the operation. |
|
|
257
264
|
|
|
258
|
-
When
|
|
265
|
+
When the request ID cannot be read, the error response uses `id: null`. The error `message` and optional `data` are for diagnostics. Branch on `code`, never on message text.
|
|
259
266
|
|
|
260
|
-
A WebSocket close, malformed server
|
|
267
|
+
A WebSocket close, a malformed server message, an unsupported version, or another fatal transport failure rejects all open requests. Stop sending, cancel running client tools, and reconnect or create a new transport on purpose. A WebSocket disconnect only detaches from the long-running host.
|
|
261
268
|
|
|
262
269
|
## Coordinate concurrent work
|
|
263
270
|
|
|
264
|
-
The server
|
|
271
|
+
The server accepts new requests before earlier ones finish, so responses and streamed messages can interleave.
|
|
265
272
|
|
|
266
273
|
- Only one main-session turn runs at a time. `session.submit` and `session.retry` return `busy` on conflict.
|
|
267
|
-
- `session.queue` waits
|
|
268
|
-
- Session
|
|
269
|
-
- `session.setReasoning`
|
|
270
|
-
- `session.exec` and `session.sample`
|
|
271
|
-
- Ephemeral contexts
|
|
274
|
+
- `session.queue` waits until the session is idle. `session.steer` joins the running turn at its next safe point. Each request gets its own response when done.
|
|
275
|
+
- Session changes run one at a time, in arrival order across all clients. Changes that replace the context can interrupt running work and reject pending input. `session.rewind` instead requires an idle session with no pending input.
|
|
276
|
+
- `session.setReasoning` and `session.setAutoCompactThreshold` wait their turn but do not interrupt the running turn. New settings apply from the next logical turn. The running turn and its steering continuations keep their original settings.
|
|
277
|
+
- `session.exec` and `session.sample` run alongside everything else: turns, other changes, each other, and ephemeral agents. Clients must coordinate their own use of the workspace.
|
|
278
|
+
- Ephemeral contexts are not part of that one-at-a-time ordering. Two submissions to the same ephemeral thread conflict, while different threads can run at once.
|
|
272
279
|
|
|
273
|
-
|
|
280
|
+
A success response may arrive before or after the deltas the request caused. Keep state from the observed streams, match completion by request ID, and call `session.snapshot` when unsure whether you missed something.
|