@markusylisiurunen/tau 0.3.81 → 0.3.83
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 +6 -4
- 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/registry.js +0 -22
- 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 +2 -13
- package/dist/core/runtime/chat_runtime.js.map +1 -1
- 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 +69 -72
- 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 +46 -91
- package/dist/core/static/tau_docs/session-protocol.md +54 -54
- package/dist/core/static/tau_docs/sessions.md +97 -107
- 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 +65 -182
- package/dist/core/static/tau_docs/tools.md +72 -91
- package/dist/core/static/tau_docs/troubleshooting.md +94 -149
- package/dist/core/static/tau_docs/tui.md +124 -81
- package/dist/core/telegram/adapter.js +1 -6
- package/dist/core/telegram/adapter.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/tools/catalog.js +0 -11
- package/dist/core/tools/catalog.js.map +1 -1
- package/dist/core/tools/tool_names.js +0 -6
- package/dist/core/tools/tool_names.js.map +1 -1
- package/dist/core/utils/gemini_transcription.js +103 -28
- 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/utils/user_metadata.js +0 -14
- package/dist/core/utils/user_metadata.js.map +1 -1
- package/dist/core/version.js +2 -2
- package/dist/diff_tool/app/dist/assets/{angular-html-BbLgbIhq.js → angular-html-x29PkEoY.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{angular-ts-DXk17TRM.js → angular-ts-CsWCqoCf.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{apl-BsvksCXR.js → apl-CEvdc7jl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{astro-DH775E4V.js → astro-Cgi6YxH2.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{blade-Ck99Rm59.js → blade-B0pr7Zx6.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{c-DJpHqu5J.js → c-DDVLgtVy.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{chapel-Owff0Csy.js → chapel-Bk9M7Jej.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cobol-Cv2gZuhO.js → cobol-DyEvnPuC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{coffee-Bji0YCf_.js → coffee-Di2-m3Jq.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{cpp-DTjA_yFF.js → cpp-CWpAaUgO.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{crystal-Dd00NOeb.js → crystal-CUker9Zt.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{css-D44TN1V6.js → css-D4XpBIiJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{edge-CVmGSi2m.js → edge-CVxhhF7L.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elixir-B8Mq7no2.js → elixir-B_FS9APl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{elm-CXS0I3Z2.js → elm-1KyefTkH.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{erb-B9oDKaUo.js → erb-CCgO9dRW.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{git-rebase-DT-YFebH.js → git-rebase-D0VYo_oY.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-js-s0DXlNjq.js → glimmer-js-Ce07ngjZ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glimmer-ts-QgEB5S2z.js → glimmer-ts-BmOM4djO.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{glsl-NA0icwbY.js → glsl-D-jkLYJ8.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{graphql-0_dOlfV0.js → graphql-DZOwJE5e.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hack-D-mr7l1l.js → hack-Cgvn19h8.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{haml-B0-oQmz7.js → haml-JTmDSYQl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{handlebars-Yq9bXpWN.js → handlebars-CChh7Dy5.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-B8bMmdRK.js → html-BKgzx_cb.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{html-derivative-BpxSlQb_.js → html-derivative-CdFl0BmX.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{http-hS_53mxt.js → http-DZeL7KvH.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{hurl-B2ST1kwl.js → hurl-CqKevOlQ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/index-BXyr8GCM.js +341 -0
- package/dist/diff_tool/app/dist/assets/{java-D4mj0lZJ.js → java-Sq3MCkId.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{javascript-wC7rrKiV.js → javascript-CHZB4Nse.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jinja-DbQ3o87F.js → jinja-C4ucJVla.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jison-CrE9FdvP.js → jison-D3mprebA.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{json-xjicDyWN.js → json-DgPfCYJ1.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{jsx-m28lXojQ.js → jsx-BG-Tx0cw.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{julia-19xkOmop.js → julia-B1GnFeUC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{just-Cf7OorTr.js → just-_MZzo0MF.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{latex-DDb7GQOy.js → latex-DI0kqjQy.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{liquid-DHOuQ0rf.js → liquid-BtMAPeHl.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{lua-BGyIvonw.js → lua-CFxaP0To.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{marko-DB5OqI1C.js → marko-BIJocuFI.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{mdc-DTyNMupO.js → mdc-BAgrdjTH.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nginx-DfF0fMYD.js → nginx-DE-3CsYn.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{nim-BbwsXuZD.js → nim-DOxeXLhb.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{org-BkOBBl1f.js → org-KTfP0tHA.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{perl-BTXTOl4K.js → perl-BH-NxpgK.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{php-DIMVQWiA.js → php-vuiVEXZK.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{pug-B_nrb4dJ.js → pug-VlIlTMUy.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{qml-1PXi8G8Z.js → qml-k6wTtGG-.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{r-CJrAkc2Z.js → r-Ccjcb2zh.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{razor-DgPUftNd.js → razor-BNhYgSCv.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{regexp-C2hS8XvL.js → regexp-C4LFejPu.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{rst-CDouhKnc.js → rst-DXLxI-UJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ruby-CAjKW1uO.js → ruby-BPuL4jDV.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sas-qAHkHLc1.js → sas-B3Yz8snb.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{scss-Bfx2Ydid.js → scss-B2AJ5vpk.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellscript-Bu76R8y2.js → shellscript-zyDexxnC.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{shellsession-BU8BL0oL.js → shellsession-C8b8xluk.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{soy-FRl8ozP-.js → soy-DKWe_XML.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{sql-BacQgsEs.js → sql-uEbz-Epf.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{stata-B9kkG-ET.js → stata-DieRPmHY.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{surrealql-qvETr7iY.js → surrealql-Dbk3Sp1P.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{svelte-B0z1MgHc.js → svelte-CjPbRmkM.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{templ-DTnPshKb.js → templ-Do_f5vc4.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tex-Cosab9_H.js → tex-UjLP4qUm.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{ts-tags-DNYvLFUH.js → ts-tags-5L2FutA6.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{tsx-Dstq6j1a.js → tsx-B1pNtpUr.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{twig-BzqZdwaX.js → twig-O41Vg_IM.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typescript-YOQ_oE25.js → typescript-Bj9uwnnJ.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{typst-DTffwfpc.js → typst-DsibO7oD.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-D4OMj_C5.js → vue-DPhaEurv.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-html-kT4WrHGK.js → vue-html-DDV9NSy1.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{vue-vine-CxeapeMO.js → vue-vine-Dh4jOifx.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xml-DWVpuurg.js → xml-DtIulkQk.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{xsl-C0ciup5a.js → xsl-DoWtb58Z.js} +1 -1
- package/dist/diff_tool/app/dist/assets/{yaml-98Fvyfpc.js → yaml-CZC-l1Dg.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/local_session_host.js +24 -318
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/host/session_host.js.map +1 -1
- package/dist/host/session_protocol_handler.js +0 -98
- 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 +3 -28
- package/dist/protocol/session_protocol.js +1 -56
- 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 +0 -20
- package/dist/sdk/session.js.map +1 -1
- package/dist/sdk/types.d.ts +1 -7
- package/dist/store/session_snapshot_migrations.js +72 -1
- package/dist/store/session_snapshot_migrations.js.map +1 -1
- package/dist/tui/session_chat_controller.js +14 -30
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/ui/footer.js +4 -9
- package/dist/tui/ui/footer.js.map +1 -1
- package/package.json +9 -9
- package/dist/core/session/goal.js +0 -54
- package/dist/core/session/goal.js.map +0 -1
- package/dist/core/tools/goal.js +0 -167
- package/dist/core/tools/goal.js.map +0 -1
- package/dist/diff_tool/app/dist/assets/index-CBT_sNIz.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": 17,
|
|
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": 17,
|
|
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": 17,
|
|
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": 17,
|
|
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,31 +100,31 @@ 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
|
-
| `
|
|
103
|
+
| `settings`, `costTotal` | Persona and reasoning 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
|
-
`catalog.mcpServers` lists enabled MCP
|
|
111
|
+
`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.
|
|
112
112
|
|
|
113
|
-
`bootstrap.prompt.subagentSystemPrompt` is present when
|
|
113
|
+
`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
114
|
|
|
115
115
|
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
116
|
|
|
117
117
|
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
118
|
|
|
119
|
-
User message text is raw
|
|
119
|
+
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
120
|
|
|
121
|
-
The
|
|
121
|
+
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
122
|
|
|
123
|
-
|
|
123
|
+
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
124
|
|
|
125
|
-
Turn requests return a
|
|
125
|
+
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
126
|
|
|
127
|
-
User-facing behavior such as
|
|
127
|
+
User-facing behavior such as retry, compaction, rewind, and recovery is described in [sessions](sessions.md).
|
|
128
128
|
|
|
129
129
|
## Apply snapshot deltas in order
|
|
130
130
|
|
|
@@ -132,7 +132,7 @@ Observed snapshot changes arrive as `session.delta`:
|
|
|
132
132
|
|
|
133
133
|
```json
|
|
134
134
|
{
|
|
135
|
-
"version":
|
|
135
|
+
"version": 17,
|
|
136
136
|
"type": "session.delta",
|
|
137
137
|
"sessionId": "0195d6e4-4cf9-7f44-a2d8-f8f7f49ee9d3",
|
|
138
138
|
"fromRevision": 8,
|
|
@@ -152,17 +152,17 @@ Observed snapshot changes arrive as `session.delta`:
|
|
|
152
152
|
}
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
For a patch, `fromRevision` must equal
|
|
155
|
+
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
156
|
|
|
157
|
-
`snapshot.reset` carries a complete
|
|
157
|
+
`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
158
|
|
|
159
|
-
If a patch has an unexpected `fromRevision`, or
|
|
159
|
+
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
160
|
|
|
161
161
|
Node clients can use `applySessionProtocolDelta`, which validates session identity, revision continuity, timeline rules, references, and the resulting snapshot.
|
|
162
162
|
|
|
163
163
|
## Maintain the independent live-state channels
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
Some live state is not part of the snapshot. Each of these channels has its own revision or delivery rules.
|
|
166
166
|
|
|
167
167
|
### Pending user messages
|
|
168
168
|
|
|
@@ -170,7 +170,7 @@ Not all observed state belongs in the recoverable snapshot. Each live channel ha
|
|
|
170
170
|
|
|
171
171
|
```json
|
|
172
172
|
{
|
|
173
|
-
"version":
|
|
173
|
+
"version": 17,
|
|
174
174
|
"type": "session.pendingUserMessages",
|
|
175
175
|
"sessionId": "...",
|
|
176
176
|
"state": {
|
|
@@ -183,23 +183,23 @@ Not all observed state belongs in the recoverable snapshot. Each live channel ha
|
|
|
183
183
|
}
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
Replace the
|
|
186
|
+
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
187
|
|
|
188
188
|
### Subagent activities
|
|
189
189
|
|
|
190
190
|
`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
191
|
|
|
192
|
-
Activity lists contain
|
|
192
|
+
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
193
|
|
|
194
194
|
### Ephemeral events
|
|
195
195
|
|
|
196
|
-
`session.ephemeral` carries
|
|
196
|
+
`session.ephemeral` carries live events that are not guaranteed and have no revision:
|
|
197
197
|
|
|
198
|
-
- `feedback.notice` is
|
|
199
|
-
- `ephemeral-agent.thread-update` reports
|
|
200
|
-
- `timeline.item` is a
|
|
198
|
+
- `feedback.notice` is short-lived footer feedback.
|
|
199
|
+
- `ephemeral-agent.thread-update` reports progress of an ephemeral context and thread.
|
|
200
|
+
- `timeline.item` is a notice that is not saved, with a timeline epoch and sequence number.
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
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
203
|
|
|
204
204
|
## Delegate client tools
|
|
205
205
|
|
|
@@ -207,7 +207,7 @@ An initialized client that advertised a tool can receive:
|
|
|
207
207
|
|
|
208
208
|
```json
|
|
209
209
|
{
|
|
210
|
-
"version":
|
|
210
|
+
"version": 17,
|
|
211
211
|
"type": "session.clientTool.call",
|
|
212
212
|
"sessionId": "...",
|
|
213
213
|
"agentId": "main",
|
|
@@ -219,11 +219,11 @@ An initialized client that advertised a tool can receive:
|
|
|
219
219
|
}
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
Acknowledge promptly with `session.clientTool.ack`, optionally
|
|
222
|
+
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
223
|
|
|
224
|
-
A successful result is rejected until acknowledgement has completed. If preparation
|
|
224
|
+
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
225
|
|
|
226
|
-
`session.clientTool.cancel` names the session and call with reason `aborted`, `timeout`, `client-detached`, or `host-failed`.
|
|
226
|
+
`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
227
|
|
|
228
228
|
## Handle errors and terminal transport failure
|
|
229
229
|
|
|
@@ -231,7 +231,7 @@ Error responses use `ok: false`:
|
|
|
231
231
|
|
|
232
232
|
```json
|
|
233
233
|
{
|
|
234
|
-
"version":
|
|
234
|
+
"version": 17,
|
|
235
235
|
"type": "response",
|
|
236
236
|
"id": "req-42",
|
|
237
237
|
"ok": false,
|
|
@@ -255,19 +255,19 @@ The supported codes are:
|
|
|
255
255
|
| `cancelled` | Pending input, execution, or sampling was cancelled. |
|
|
256
256
|
| `internal_error` | The host could not complete the operation. |
|
|
257
257
|
|
|
258
|
-
When
|
|
258
|
+
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
259
|
|
|
260
|
-
A WebSocket close, malformed server
|
|
260
|
+
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
261
|
|
|
262
262
|
## Coordinate concurrent work
|
|
263
263
|
|
|
264
|
-
The server
|
|
264
|
+
The server accepts new requests before earlier ones finish, so responses and streamed messages can interleave.
|
|
265
265
|
|
|
266
|
-
- Only one
|
|
267
|
-
- `session.queue` waits
|
|
268
|
-
- Session
|
|
269
|
-
- `session.setReasoning`
|
|
270
|
-
- `session.exec` and `session.sample`
|
|
271
|
-
- Ephemeral contexts
|
|
266
|
+
- Only one main-session turn runs at a time. `session.submit` and `session.retry` return `busy` on conflict.
|
|
267
|
+
- `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.
|
|
268
|
+
- 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.
|
|
269
|
+
- `session.setReasoning` waits its turn but does not interrupt the running turn. The new setting applies from the next turn.
|
|
270
|
+
- `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.
|
|
271
|
+
- 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
272
|
|
|
273
|
-
|
|
273
|
+
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.
|