@robota-sdk/agent-session 3.0.0-beta.93 → 3.0.0-beta.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,167 @@
1
1
  # @robota-sdk/agent-session
2
2
 
3
+ ## 3.0.0-beta.95
4
+ ### Minor Changes
5
+
6
+ - 04719a9: **A permission request names the tool call it is about.**
7
+
8
+ `IPermissionRequestEvent` gains an optional `executionId`: the same id the call's `tool_start` and
9
+ `tool_end` carry, so a surface can hold one row from the request to the call's end. The session's
10
+ permission path carries the call's id from the tool wrapper to the prompt (`IPermissionAskContext.executionId`)
11
+ and the framework's prompt registry stamps it on the event, so it reaches every client that receives
12
+ the event, the WebSocket and HTTP `permission_request` frames included. It is present whenever the
13
+ session reports that call (its own, or an in-process background agent's) and absent for a
14
+ child-process agent's forwarded request.
15
+
16
+ The ACP agent transport keys its permission rows by that id: the request's `toolCallId` is the
17
+ call's execution id, its start and end address the same row, a denial the session decides on its
18
+ own while the editor's dialog is open closes that one row, and two same-named calls each follow
19
+ their own row whatever order the editor answers in. A request that names no call gets a row that
20
+ closes with the answer, and is closed at the end of the turn if no answer came. The name-ordered
21
+ matching is gone.
22
+ - 04a6de4: **Reasoning text a provider streams now reaches the editor as an ACP `agent_thought_chunk`, through a new `thinking_delta` session event.**
23
+
24
+ `IChatOptions.onThinkingDelta`, `IRunOptions.onThinkingDelta` and `IResumeExecutionOptions.onThinkingDelta`
25
+ (typed `TThinkingDeltaCallback`) carry reasoning text from a provider through the run, and the session
26
+ options (`ISessionOptions.onThinkingDelta`, `ICreateSessionOptions.onThinkingDelta`) hand it to the
27
+ session's owner. `InteractiveSession` emits it as `thinking_delta(delta)`, beside `text_delta`. The
28
+ text is never part of the reply: it is not appended to the conversation, not streamed through
29
+ `onTextDelta`, and the core adds no record of its own for it (no text-delta log entry, no
30
+ `provider_stream_raw_delta`); a provider's own native payload capture and response metadata keep
31
+ what the provider sent, as before. A reasoning delta counts as provider activity for the idle
32
+ timeout whether or not anyone listens to it, so a model that is only thinking is not cut off. The
33
+ existing `thinking(isThinking)` event is unchanged and remains the busy indicator. Where a provider
34
+ sends no reasoning text, nothing is emitted and nothing new is switched on.
35
+
36
+ `@robota-sdk/agent-interface-session` is a major change because a new session event name makes an
37
+ exhaustive map over the event names stop compiling until it classifies the event.
38
+
39
+ `@robota-sdk/agent-transport-acp` sends each non-empty `thinking_delta` to the editor as an
40
+ `agent_thought_chunk`, in order with the message chunks, so `robota acp` shows the model's reasoning
41
+ in the editor. A turn that streamed only thoughts still shows its result text, because only reply
42
+ text marks a turn as streamed. The WebSocket wire, the HTTP stream, headless stream-json, `query()`
43
+ and the terminal UI do not carry the new event in this change (`@robota-sdk/agent-transport` and
44
+ `@robota-sdk/agent-ui-terminal` classify it as non-surface). A forked skill and an in-process subagent
45
+ pass their reply text up but not their reasoning.
46
+
47
+ Two providers already receive reasoning text and now report it. `@robota-sdk/agent-provider-openai`
48
+ passes `response.reasoning_summary_text.delta` events of a streamed Responses call to
49
+ `onThinkingDelta`; the API sends them only when the provider profile asks for a reasoning summary, and
50
+ no request option changed; a summary streamed in several parts, and the summary of a later reasoning
51
+ item, each start on a new paragraph (`\n\n`) so the parts do not run together.
52
+ `@robota-sdk/agent-provider-openai-compatible` reports the text of Gemma's thought channel, which the
53
+ provider already removed from the reply, as it streams across chunk boundaries, with each later
54
+ channel of one reply on a new paragraph; the reply text is unchanged. No other provider reports
55
+ reasoning, and Anthropic thinking is not enabled. A model fallback chain still moves to the next model when only reasoning had streamed.
56
+
57
+ The scripted test provider (`@robota-sdk/agent-core/testing`) accepts an optional `thinking` string on
58
+ a turn and delivers it through `onThinkingDelta` before the turn's text; the scripted session harness
59
+ collects `thinking_delta` and now keeps a scripted tool-call turn's `usage`, which it used to drop.
60
+ - 0ba247b: A tool result can now carry a view its source declared (an MCP app), and a surface can invoke a
61
+ runtime tool through the session's permission gate with a prompt. This is the contract and wiring
62
+ layer: nothing produces a view yet, and the GUI does not yet host one.
63
+
64
+ - `agent-core` — `IToolResult.view` carries an `IToolAppView` (source, `ui://` resource, mime type,
65
+ HTML, structured content, callable tools, the call's input). `view` is now a typed key of
66
+ `IToolResult`, so an extension that already used a `view` key with another type must rename it.
67
+ The view is display data: it never enters model context or the size that decides a spill, and a
68
+ result replaced by its reference keeps it.
69
+ - `agent-interface-session` — `invokeRuntimeTool` takes `permissionInteraction` (`'interactive'` or
70
+ the default `'deny'`), a `driverId` (a host that attributes prompts names it as the requester) and
71
+ an `executionId` its events carry. A finished model call's `tool_end` names its view with
72
+ `IToolState.appView` (`viewId`, source, resource), and the new
73
+ `ISessionToolAppViews.readToolAppView(viewId)` reads the document. A permission handler may take
74
+ `{ signal }`, and aborting it withdraws the prompt.
75
+ - `agent-session` — a direct call asks a person only when its caller says so, and the handler is
76
+ given the call's own signal; the tool end event carries the view, never in the logged result data.
77
+ - `agent-framework` — the view of a model's call is kept under a `viewId` the session mints, in a
78
+ bounded per-session store (16 views, 4 MiB each, 16 MiB in all, measured on the whole serialized
79
+ view), and read on demand, so the document never rides `tool_end` to every surface, never enters
80
+ the recorded history, and a repeated provider tool-call id cannot overwrite another turn's view.
81
+ A malformed view is dropped. A direct call keeps and names no view, recognised by the id it was
82
+ started with. A submission or agent wakeup that arrives while a direct call holds the session is
83
+ queued behind it, as during a turn, instead of refused. A direct call acting for a driver
84
+ attributes its permission prompt and tool events to that driver, and aborting its signal withdraws
85
+ an open prompt from every surface.
86
+ - `agent-transport` — a driving connection sends `call-app-tool` (answered by `app_tool_result`) and
87
+ `read-app-view` (answered by `app_view`). A call names its view and reaches only the tools that
88
+ view's source declared; a call or read that decodes but cannot be served answers `protocol_error`
89
+ echoing the `requestId`, while an observer's attempt is refused like any non-read. A call still
90
+ waiting on its prompt is cancelled when its connection goes away (for the resume bridge, when the
91
+ bridge is disposed). `maxFrameBytes` bounds an app answer to what a carrier's channel carries;
92
+ the WebRTC carrier uses a history page's worth. `IProtocolSession` now includes the runtime-tool
93
+ and app-view roles.
94
+ - `agent-ui-web` — the two new server messages are recorded as not rendered until the app-view host
95
+ consumes them.
96
+
97
+ An implementation of `IInteractiveSession` or `IProtocolSession` outside this repository must add
98
+ `readToolAppView` (and, for `IProtocolSession`, `listRuntimeTools` and `invokeRuntimeTool`); the
99
+ members are required so a host cannot silently lack them.
100
+
101
+ ### Patch Changes
102
+
103
+ - 60f3965: **`robota mcp serve --ask-client` puts a caller's permission and ask prompts to the calling MCP client through elicitation instead of failing them.**
104
+
105
+ `@robota-sdk/agent-transport-mcp`: `createMcpTransport`, `createMcpHttpHost`,
106
+ `createMcpRemoteHttpHost` and `createAgentMcpServer` take `askClient`. Off by default, every prompt
107
+ is a tool error as before. On, and when the client declared form-mode elicitation, a permission or
108
+ ask prompt raised by that client's own call is put to it: a permission offers allow once or deny
109
+ only, never a remembered grant; an ask becomes a form (choice, multiple choice, free text); a masked
110
+ ask is never sent; deny, decline, cancel, a client error or an answer naming nothing offered keeps
111
+ today's outcome. stdio asks during the call. The HTTP hosts keep no session state, so they ask only
112
+ a client on the 2026-07-28 revision, through input-required rounds whose `requestState` is a
113
+ single-use random token naming one parked call; a 2025-era HTTP client keeps the tool error.
114
+ A call listens for prompts only while its own work drives the session, so a submission waiting
115
+ in the queue never holds another caller's prompt that it cannot answer.
116
+ Breaking for hand-written sessions: `IMcpTransportSession` now also requires `ISessionEvents`
117
+ (`on`/`off`), `ISessionPromptResolution` (`resolvePermission`/`resolveAsk`) and
118
+ `ISessionDriverAttribution` (`getActiveDriverId`), which `InteractiveSession` and the published
119
+ test double already implement.
120
+
121
+ `@robota-sdk/agent-interface-session` / `@robota-sdk/agent-session` / `@robota-sdk/agent-framework`:
122
+ `ISessionRuntimeTools.invokeRuntimeTool` (and `Session.invokeRuntimeTool`) accept
123
+ `options.permissionInteraction` and `options.driverId`. A direct call still denies a decision that
124
+ would need a person, and finds no one to ask a question, unless its caller passes
125
+ `permissionInteraction: 'interactive'`; then it asks the session's permission handler and its
126
+ tools get the session's ask port. `InteractiveSession` makes `driverId` the active driver while
127
+ the direct call runs, so a prompt the call raises carries it as `requesterDriverId`. With
128
+ `askClient` on, an MCP call runs under its own `mcp:<n>` driver id; a submission made that way is
129
+ attributed to it rather than to the owner.
130
+
131
+ `@robota-sdk/agent-transport`: exports `permissionSummaryArgument`, the argument a person recognises
132
+ a tool call by (`filePath` for the built-in file tools), for every transport that puts a permission
133
+ request to a person in its own wire form.
134
+
135
+ `@robota-sdk/agent-cli`: `mcp serve --ask-client` turns this on for whichever carrier the run serves.
136
+ - Updated dependencies [60f3965]
137
+ - Updated dependencies [115e104]
138
+ - Updated dependencies [04719a9]
139
+ - Updated dependencies [04a6de4]
140
+ - Updated dependencies [0ba247b]
141
+ - Updated dependencies [02053ec]
142
+ - @robota-sdk/agent-interface-session@3.0.0-beta.95
143
+ - @robota-sdk/agent-core@3.0.0-beta.95
144
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.95
145
+ - @robota-sdk/agent-file-authority@3.0.0-beta.95
146
+
147
+ ## 3.0.0-beta.94
148
+ ### Patch Changes
149
+
150
+ - e706b43: Live telemetry can name its spans with the OpenTelemetry GenAI semantic conventions. Set
151
+ `PRODUCT_TELEMETRY_SEMCONV` to `gen_ai` to export `invoke_agent`, `chat {model}` (client) and
152
+ `execute_tool {tool}` spans with `gen_ai.*` attributes, keeping Robota-only facts as `agent.*`; or to
153
+ `gen_ai/dup` to emit both attribute sets while dashboards move. The default, `agent`, exports exactly
154
+ the spans it did before. An unknown value, or the setting while neither traces nor metrics are exported,
155
+ refuses startup. Console traces under a GenAI mode print the same projected spans.
156
+
157
+ The live prompt trace now carries each tool body's name (the session's tool-body observation includes it
158
+ and the framework's live projection passes a label-safe name through); it reaches spans only under a
159
+ GenAI mode and is never written to session history.
160
+ - @robota-sdk/agent-interface-session@3.0.0-beta.94
161
+ - @robota-sdk/agent-core@3.0.0-beta.94
162
+ - @robota-sdk/agent-file-authority@3.0.0-beta.94
163
+ - @robota-sdk/agent-interface-execution@3.0.0-beta.94
164
+
3
165
  ## 3.0.0-beta.93
4
166
  ### Patch Changes
5
167