@sorbetai/acp 0.1.0-alpha.4 → 0.1.0-alpha.6

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.
Files changed (52) hide show
  1. package/COMPATIBILITY.md +13 -11
  2. package/README.md +47 -30
  3. package/agent.json +2 -2
  4. package/dist/{agent-BCOPO0L6.js → agent-BovB-tw0.js} +23 -7
  5. package/dist/agent-BovB-tw0.js.map +1 -0
  6. package/dist/{agent-BhmoMZBU.d.ts → agent-S0BFq45U.d.ts} +4 -2
  7. package/dist/{authentication-ceH0FNpg.js → authentication-BIVmLfrb.js} +3 -2
  8. package/dist/authentication-BIVmLfrb.js.map +1 -0
  9. package/dist/{compatibility-Dj5DvCj9.d.ts → compatibility-87fR9ZAa.d.ts} +9 -1
  10. package/dist/{compatibility-afjlc8C_.js → compatibility-DbQl9fV9.js} +9 -1
  11. package/dist/compatibility-DbQl9fV9.js.map +1 -0
  12. package/dist/compatibility.d.ts +1 -1
  13. package/dist/compatibility.js +1 -1
  14. package/dist/{index-Dgnt2Dbe.d.ts → credentials-CHHCSH_7.d.ts} +2156 -846
  15. package/dist/{experimental-v2-uBjYsXWJ.d.ts → experimental-v2-BoLcFf2t.d.ts} +4 -2
  16. package/dist/{experimental-v2-B0g-apN0.js → experimental-v2-CY-_9I4S.js} +24 -7
  17. package/dist/experimental-v2-CY-_9I4S.js.map +1 -0
  18. package/dist/experimental-v2.d.ts +3 -2
  19. package/dist/experimental-v2.js +4 -4
  20. package/dist/extensions-8WYNyhPy.d.ts +47 -0
  21. package/dist/extensions-Eaix9kSN.js +17 -0
  22. package/dist/extensions-Eaix9kSN.js.map +1 -0
  23. package/dist/extensions.d.ts +2 -33
  24. package/dist/extensions.js +2 -2
  25. package/dist/index.d.ts +5 -4
  26. package/dist/index.js +6 -6
  27. package/dist/isolate-worker.mjs +321 -181
  28. package/dist/{mcp-host-profile-ws1FVgCu.js → mcp-host-profile-RdE3910q.js} +3 -3
  29. package/dist/{mcp-host-profile-ws1FVgCu.js.map → mcp-host-profile-RdE3910q.js.map} +1 -1
  30. package/dist/mcp-host.js +1 -1
  31. package/dist/{otlp-7Yu-NQ4V.js → otlp-BUnHo5Yu.js} +2 -2
  32. package/dist/{otlp-7Yu-NQ4V.js.map → otlp-BUnHo5Yu.js.map} +1 -1
  33. package/dist/{prompt-work-DR0Y4XcD.js → prompt-work-GOaSft-m.js} +4776 -3428
  34. package/dist/prompt-work-GOaSft-m.js.map +1 -0
  35. package/dist/{src-t1dCyRPw.js → src-Bc3Cz0DW.js} +3 -3
  36. package/dist/{src-t1dCyRPw.js.map → src-Bc3Cz0DW.js.map} +1 -1
  37. package/dist/{stdio-zoYDCG-W.js → stdio-CR8vZgia.js} +3 -3
  38. package/dist/{stdio-zoYDCG-W.js.map → stdio-CR8vZgia.js.map} +1 -1
  39. package/dist/{stdio-cli-main-p8c8vhUL.js → stdio-cli-main-C2eTBZdr.js} +649 -1868
  40. package/dist/stdio-cli-main-C2eTBZdr.js.map +1 -0
  41. package/dist/stdio-cli.js +1 -1
  42. package/dist/stdio.d.ts +4 -3
  43. package/dist/stdio.js +6 -6
  44. package/package.json +10 -22
  45. package/dist/agent-BCOPO0L6.js.map +0 -1
  46. package/dist/authentication-ceH0FNpg.js.map +0 -1
  47. package/dist/compatibility-afjlc8C_.js.map +0 -1
  48. package/dist/experimental-v2-B0g-apN0.js.map +0 -1
  49. package/dist/extensions-Da4-kIik.js +0 -14
  50. package/dist/extensions-Da4-kIik.js.map +0 -1
  51. package/dist/prompt-work-DR0Y4XcD.js.map +0 -1
  52. package/dist/stdio-cli-main-p8c8vhUL.js.map +0 -1
package/COMPATIBILITY.md CHANGED
@@ -35,7 +35,7 @@ supported behavior is connected and operational.
35
35
  | Shared protocol methods | 1 | 0 | 0 | 1 |
36
36
  | Lody extension capabilities | 8 | 0 | 3 | 11 |
37
37
  | Lody custom methods | 8 | 0 | 2 | 10 |
38
- | Sorbet extensions | 7 | 0 | 1 | 8 |
38
+ | Sorbet extensions | 9 | 0 | 1 | 10 |
39
39
 
40
40
  ## Status definitions
41
41
 
@@ -223,13 +223,15 @@ supported behavior is connected and operational.
223
223
 
224
224
  ## Sorbet extensions
225
225
 
226
- | Protocol item | Status | Notes |
227
- | -------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
228
- | `_session/steering` | ✅ Supported | Stable v1 injects steering into an active Run or starts a new turn. |
229
- | `_sorbet/session/run/get` | ✅ Supported | Stable v1 returns the durable Sorbet Run snapshot. |
230
- | `_sorbet/session/replay` | ✅ Supported | Stable v1 returns cursor-based Journal fact summaries. |
231
- | `_sorbet/plugins/query` | ✅ Supported | Negotiated v1/v2 transport reads the attached Session’s Host-bound, filtered composition facade. |
232
- | `_sorbet/plugins/apply` | ✅ Supported | Submits patches to the Host-bound facade; the transport cannot supply authorization. Desired concurrency and durable command identity apply. |
233
- | `_sorbet/plugins/watch` | ✅ Supported | Starts or stops one coalesced snapshot subscription per attached Session; cleanup follows the connection. |
234
- | `_sorbet/plugins/changed` | ✅ Supported | Publishes initial and changed composition snapshots, including Service-driven Mount changes without a Desired edit. |
235
- | `_sorbet/session/activity` | ❌ Unsupported | The name is reserved, but no activity notification is emitted yet. |
226
+ | Protocol item | Status | Notes |
227
+ | --------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
228
+ | `_sorbet/auth/credentials/list` | ✅ Supported | Lists non-secret stored credential metadata when the authentication port provides credential management. |
229
+ | `_sorbet/auth/credentials/logout` | ✅ Supported | Logs out one Provider through the authentication port credential management capability. |
230
+ | `_session/steering` | ✅ Supported | Stable v1 injects steering into an active Run or starts a new turn. |
231
+ | `_sorbet/session/run/get` | ✅ Supported | Stable v1 returns the durable Sorbet Run snapshot. |
232
+ | `_sorbet/session/replay` | ✅ Supported | Stable v1 returns cursor-based Journal fact summaries. |
233
+ | `_sorbet/plugins/query` | ✅ Supported | Negotiated v1/v2 transport reads the attached Session’s Host-bound, filtered composition facade. |
234
+ | `_sorbet/plugins/apply` | ✅ Supported | Submits patches to the Host-bound facade; the transport cannot supply authorization. Desired concurrency and durable command identity apply. |
235
+ | `_sorbet/plugins/watch` | ✅ Supported | Starts or stops one coalesced snapshot subscription per attached Session; cleanup follows the connection. |
236
+ | `_sorbet/plugins/changed` | ✅ Supported | Publishes initial and changed composition snapshots, including Service-driven Mount changes without a Desired edit. |
237
+ | `_sorbet/session/activity` | ❌ Unsupported | The name is reserved, but no activity notification is emitted yet. |
package/README.md CHANGED
@@ -64,7 +64,7 @@ per Session; the Host source directory is shared. Authority data is kept under
64
64
  rollback. Reattachment constructs fresh plugin instances. Filesystem input stops before
65
65
  execution shutdown; loaders and storage close after the Session's request borrowers
66
66
  and Platform have released their resources. Sorbet Package Activations execute in
67
- sandboxed processes; the explicit Pi and DSH Tool profiles own trusted native
67
+ sandboxed processes; the explicit Pi Tool profiles own trusted native
68
68
  environments in the CLI process. Closing an attachment releases its Authority
69
69
  lock while the CLI continues running, allowing another process to take ownership.
70
70
 
@@ -122,12 +122,10 @@ permissions and Journal write-ahead still precede dispatch. See the
122
122
 
123
123
  The CLI accepts these explicit installation ABIs alongside Sorbet Packages:
124
124
 
125
- | ABI | Execution and contribution contract |
126
- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
127
- | `pi.extension/1.1.0-native-tool-v1` | Pinned single-file Pi Tool profile with null configuration. |
128
- | `pi.extension/1.1.0-native-package-v1` | Recorded Pi source tree and text resources; optional extension flags and Host-installed dependencies. See [Pi bridge](../plugin-pi/README.md). |
129
- | `dsh.tool-plugin/0.1.6-alpha.2-single-file-v1` | Pinned single-file Cordis Tool profile with null configuration. |
130
- | `dsh.tool-plugin/0.1.6-alpha.2-package-v1` | Recorded Cordis ESM source tree, text resources and manifest-validated configuration. See [DSH bridge](../plugin-deepseek/README.md). |
125
+ | ABI | Execution and contribution contract |
126
+ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
127
+ | `pi.extension/1.1.0-native-tool-v1` | Pinned single-file Pi Tool profile with null configuration. |
128
+ | `pi.extension/1.1.0-native-package-v1` | Recorded Pi source tree and text resources; optional extension flags and Host-installed dependencies. See [Pi bridge](../plugin-pi/README.md). |
131
129
 
132
130
  Put the original, unchanged single-file plugin next to a `plugin.json` manifest in
133
131
  the Host plugin directory. For example, `plugins/hello/plugin.json` can contain:
@@ -153,10 +151,7 @@ pinned framework versions with `--native-plugin-node-modules /absolute/node_modu
153
151
  keep that tree unchanged while Sessions using its generations remain open.
154
152
 
155
153
  Pi package configuration accepts `extensionFlagValues` containing declared boolean
156
- or string flags. DSH package configuration follows `plugin.json.configSchema` and
157
- the original Cordis plugin's Config contract. The CLI supplies native DSH prompt,
158
- projection, LLM metadata and local subprocess/bash services; native model calls are
159
- refused. SDK Hosts can choose their own services instead.
154
+ or string flags. The CLI does not install dependencies or execute install scripts.
160
155
 
161
156
  Sorbet alone runs the model loop. A native tool receives the model's Tool Call ID,
162
157
  validated arguments and cancellation, and its result returns to that same Sorbet
@@ -180,16 +175,13 @@ Host tools in the next request.
180
175
  Directory-backed ACP Sessions use Pi's sequential Tool batch mode, including when
181
176
  a watcher installs a native plugin later. Native Session writers must observe the
182
177
  previous Tool's committed result before preparing another write; an adapter mutex
183
- alone cannot enforce that Journal boundary. SDK Hosts supplying writable DSH
184
- Session projections must also select `SorbetSessionOptions.toolExecution: 'sequential'`.
178
+ alone cannot enforce that Journal boundary.
185
179
 
186
- DSH receives the current Sorbet Session's workspace and committed history through
187
- a read-only Journal projection. Supported native Session writes and next-step inbox
188
- injections travel in durable Tool result details and are replayed from those facts.
189
- Prompt assembly narrows the next model request's tool visibility, and execution
190
- rejects hidden tools before protected dispatch. Individual package installations
191
- own separate native worlds; a routing plugin cannot automatically manage another
192
- world's registrations or wrap Sorbet Host tool implementations.
180
+ The CLI registers only Pi native Tool profiles. DSH native worlds were removed by
181
+ [ADR-0114](../../docs/adr/0114-sorbet-owns-the-run.md); the retained DSH
182
+ supplemental pre-step adapter is a library profile, not an ACP installation ABI.
183
+ Pi packages own separate native worlds; a routing plugin cannot automatically
184
+ manage another world's registrations or wrap Sorbet Host tool implementations.
193
185
 
194
186
  Each model request leases its current declarations and implementations. Directory
195
187
  replacement or uninstall changes subsequent requests while borrowed worlds drain.
@@ -197,19 +189,17 @@ An internal native registry change may invalidate an older binding; it must fail
197
189
  or cancel rather than invoke a same-name replacement. `--watch-plugins` applies to
198
190
  these profiles as well as isolated Packages.
199
191
 
200
- These profiles cover the documented Tool, command and preparation contracts.
192
+ These profiles cover the documented Pi Tool, command and preparation contracts.
201
193
  Original Pi `subagent`, `sandbox` and `ssh` still require unprovided process or
202
194
  lifecycle contracts and are refused explicitly. Shared-process `process.argv`,
203
195
  `process.cwd()` and `process.chdir()` assumptions require an isolated native worker.
204
- DSH Agent scheduling, native surface rewrites, inherited fork history, unsupported
205
- message content and deferred tool contexts also fail explicitly. These boundaries
206
- are not implied by basic Tool compatibility.
196
+ These boundaries are not implied by basic Tool compatibility.
207
197
  Native plugins execute with ambient process access; tool permission and Effect
208
198
  recording mediate Sorbet dispatch, not arbitrary module, hook or background effects.
209
199
  They cooperate with cancellation and do not gain worker termination or ESM cache
210
200
  reclamation from the isolated profile. The [stdio regression](./tests/stdio.test.ts)
211
201
  exercises the actual CLI with a scripted Provider transport; it does not establish
212
- live Provider compatibility or compatibility with every Pi or DSH plugin.
202
+ live Provider compatibility or compatibility with every Pi plugin.
213
203
 
214
204
  The executable routes Provider requests, including OAuth exchange and token
215
205
  refresh, through `HTTP_PROXY`, `HTTPS_PROXY`, or `ALL_PROXY` when configured and
@@ -281,11 +271,13 @@ may instead launch `node packages/acp/dist/stdio-cli.js`; production configs
281
271
  should use the PATH-resolved executable so they do not depend on a checkout's
282
272
  absolute path.
283
273
 
284
- Stable v1 advertises one ACP authentication method for each Provider OAuth or
285
- API-key login supported by Pi. Lody selects a method and relays request-scoped
286
- URL, device-code, secret, text, or select elicitations. Sorbet persists the
287
- result in its credential store; credentials are never returned in ACP
288
- capability data or Lody workspace configuration.
274
+ Stable v1 advertises Provider OAuth methods when the Client supports both form and URL
275
+ elicitation. Generic ACP does not expose API-key login; a Provider that only supports an
276
+ API key must be configured by the embedding Host outside ACP. Lody selects a method and
277
+ relays request-scoped URL, device-code, text, or select elicitations; secret and manual-code
278
+ forms additionally require Lody's credential-safe form capability. Sorbet persists the result
279
+ in its credential store; credentials are never returned in ACP capability data or Lody
280
+ workspace configuration.
289
281
 
290
282
  Session create, load, resume, and fork responses publish each advertised
291
283
  model's model-dependent ACP config options under
@@ -452,6 +444,31 @@ job. `pnpm compatibility:acp` exists for a faster local review.
452
444
  Sorbet custom methods begin with `_sorbet/`. Custom fields are placed under
453
445
  `_meta["sorbet.dev"]` and include an explicit extension version.
454
446
 
447
+ ## Credential management extension
448
+
449
+ ACP v1 and experimental v2 advertise `_meta["sorbet.dev"].credentials: { "version": 1 }`
450
+ when the authentication implementation supports credential management. Clients should check this
451
+ Agent capability before issuing the following connection-level JSON-RPC requests:
452
+
453
+ - `_sorbet/auth/credentials/list` takes `{}` and returns
454
+ `{ "credentials": [{ "providerId": "...", "type": "oauth" | "api_key" }] }`.
455
+ - `_sorbet/auth/credentials/logout` takes `{ "providerId": "..." }` and returns `{}` after
456
+ the selected Provider's credential is removed. An empty Provider ID is invalid.
457
+
458
+ The list describes credentials stored by the authentication implementation. It does not expose
459
+ secrets, account identity, remote validity, or credentials supplied only through the environment.
460
+ A missing entry means no stored credential was listed; it does not prove that a Provider cannot
461
+ be used. Refresh the list after authentication or logout. Logout affects the selected stored
462
+ credential; it does not promise remote token revocation or removal of environment credentials.
463
+ The ordinary ACP `logout` remains a separate operation which logs out all stored credentials in
464
+ the default implementation.
465
+
466
+ The default Node Agent authentication implements this extension using the Node Agent credential
467
+ store. When a Host injects an `AcpAuthentication` or `AcpV2Authentication`, it must explicitly
468
+ supply `credentials` for the same authentication store to advertise the extension. Otherwise the
469
+ methods return method-not-found. The ACP connection is trusted to manage these credentials;
470
+ Hosts accepting untrusted Clients must enforce access at their transport boundary.
471
+
455
472
  ## MCP Protocol Compatibility
456
473
 
457
474
  SDK embeddings and ACP Clients own MCP UI and credentials. Standard MCP form/URL
package/agent.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "sorbet",
3
3
  "name": "Sorbet",
4
- "version": "0.1.0-alpha.4",
5
- "description": "A durable Pi-based Agent Harness with ACP v1 and experimental ACP v2 support.",
4
+ "version": "0.1.0-alpha.6",
5
+ "description": "A durable Agent Harness with Pi-backed model access and ACP v1 plus experimental ACP v2 support.",
6
6
  "repository": "https://github.com/lodyspeak/sorbet",
7
7
  "license": "MIT",
8
8
  "distribution": {
@@ -1,6 +1,6 @@
1
- import { A as coordinateNodeAgentBehavior, At as parseSlashCommand, B as pluginApplyParser, C as contextUsageUpdate, D as createV1SessionElicitation, E as createV1RequestElicitation, F as NodeAgentErrorCode, H as pluginWatchParser, I as JournalCursorSchema, N as isAuthoritativeSessionTitleSource, Ot as commandGoal, P as NodeAgentError, S as SORBET_ACP_VERSION, T as observeSessionUsage, V as pluginQueryParser, _ as mcpElicitationProfile, a as AcpSessionAttachments, b as connectMcpServers, c as projectBackgroundRun, d as toolTitle, f as listRefreshedModels, h as createV1McpElicitationOptions, i as readGoalPromptControl, jt as watchSlashCommands, kt as getGoal, l as presentationTools, m as modelsIncludingCurrent, n as applyGoalControl, o as lodyTitleSource, p as modelConfigOptions, r as cancelSessionWork, s as sessionRequestError, t as AcpPromptWork, u as projectedToolTitle, v as AcpMcpHost, w as detailedUsageUpdate, y as AcpMcpAttachment, z as AcpPluginComposition } from "./prompt-work-DR0Y4XcD.js";
2
- import { a as SORBET_PLUGINS_CHANGED, c as SORBET_REPLAY_METHOD, i as SORBET_PLUGINS_APPLY, l as SORBET_RUN_INSPECT_METHOD, o as SORBET_PLUGINS_QUERY, r as SORBET_EXTENSION_VERSION, s as SORBET_PLUGINS_WATCH, t as SESSION_STEERING_METHOD } from "./extensions-Da4-kIik.js";
3
- import { a as SORBET_MCP_QUERY, d as mcpControlParser, f as mcpQueryParser, m as mcpRootsChangedParser, n as SORBET_MCP_CONTROL, o as SORBET_MCP_READ, p as mcpReadParser, s as SORBET_MCP_ROOTS_CHANGED, t as SORBET_MCP_CALL, u as mcpCallParser } from "./mcp-host-profile-ws1FVgCu.js";
1
+ import { A as nodeAgentCredentialManagement, C as SORBET_ACP_VERSION, D as createV1RequestElicitation, E as observeSessionUsage, F as isAuthoritativeSessionTitleSource, H as pluginApplyParser, I as NodeAgentError, L as NodeAgentErrorCode, M as coordinateNodeAgentBehavior, Mt as getGoal, Nt as parseSlashCommand, O as createV1SessionElicitation, Pt as watchSlashCommands, R as JournalCursorSchema, T as detailedUsageUpdate, U as pluginQueryParser, V as AcpPluginComposition, W as pluginWatchParser, a as AcpSessionAttachments, b as AcpMcpAttachment, c as projectBackgroundRun, d as projectedToolTitle, f as toolTitle, g as createV1McpElicitationOptions, h as modelsIncludingCurrent, i as readGoalPromptControl, jt as commandGoal, l as presentationTools, m as modelConfigOptions, n as applyGoalControl, o as lodyTitleSource, p as listRefreshedModels, r as cancelSessionWork, s as sessionRequestError, t as AcpPromptWork, u as projectedToolLabels, v as mcpElicitationProfile, w as contextUsageUpdate, x as connectMcpServers, y as AcpMcpHost } from "./prompt-work-GOaSft-m.js";
2
+ import { a as SORBET_CREDENTIALS_VERSION, c as SORBET_PLUGINS_CHANGED, d as SORBET_REPLAY_METHOD, f as SORBET_RUN_INSPECT_METHOD, i as SORBET_CREDENTIALS_LOGOUT_METHOD, l as SORBET_PLUGINS_QUERY, o as SORBET_EXTENSION_VERSION, r as SORBET_CREDENTIALS_LIST_METHOD, s as SORBET_PLUGINS_APPLY, t as SESSION_STEERING_METHOD, u as SORBET_PLUGINS_WATCH } from "./extensions-Eaix9kSN.js";
3
+ import { a as SORBET_MCP_QUERY, d as mcpControlParser, f as mcpQueryParser, m as mcpRootsChangedParser, n as SORBET_MCP_CONTROL, o as SORBET_MCP_READ, p as mcpReadParser, s as SORBET_MCP_ROOTS_CHANGED, t as SORBET_MCP_CALL, u as mcpCallParser } from "./mcp-host-profile-RdE3910q.js";
4
4
  import { Type } from "typebox";
5
5
  import { Check, Parse } from "typebox/schema";
6
6
  import * as acp from "@agentclientprotocol/sdk";
@@ -697,6 +697,7 @@ function createSorbetAcpAgent(options) {
697
697
  } };
698
698
  }
699
699
  function buildConnectionApp(options, state) {
700
+ const credentialManagement = options.authentication === void 0 ? nodeAgentCredentialManagement(options.agent) : options.authentication.credentials;
700
701
  return acp.agent({ name: "sorbet-acp" }).onRequest(acp.methods.agent.initialize, async ({ params, signal }) => {
701
702
  state.capabilities = params.clientCapabilities ?? {};
702
703
  const { _meta: metadata } = state.capabilities;
@@ -729,6 +730,7 @@ function buildConnectionApp(options, state) {
729
730
  _meta: {
730
731
  "sorbet.dev": {
731
732
  version: SORBET_EXTENSION_VERSION,
733
+ ...credentialManagement === void 0 ? {} : { credentials: { version: SORBET_CREDENTIALS_VERSION } },
732
734
  runInspection: true,
733
735
  replay: true,
734
736
  plugins: state.plugins.capabilities(),
@@ -746,6 +748,16 @@ function buildConnectionApp(options, state) {
746
748
  authMethods: (await options.authentication?.methods(state.capabilities))?.map(({ method }) => method) ?? [],
747
749
  _meta: { steering: { supported: true } }
748
750
  };
751
+ }).onRequest(SORBET_CREDENTIALS_LIST_METHOD, z.object({}), async ({ signal }) => {
752
+ if (credentialManagement === void 0) throw acp.RequestError.methodNotFound(SORBET_CREDENTIALS_LIST_METHOD);
753
+ return { credentials: (await credentialManagement.list(signal)).map(({ providerId, type }) => ({
754
+ providerId,
755
+ type
756
+ })) };
757
+ }).onRequest(SORBET_CREDENTIALS_LOGOUT_METHOD, z.object({ providerId: z.string().min(1) }), async ({ params, signal }) => {
758
+ if (credentialManagement === void 0) throw acp.RequestError.methodNotFound(SORBET_CREDENTIALS_LOGOUT_METHOD);
759
+ await credentialManagement.logout(params.providerId, signal);
760
+ return {};
749
761
  }).onRequest(SORBET_MCP_QUERY, mcpQueryParser, ({ params, signal }) => state.mcpHost.query(requireAttached(state, params.sessionId), params, signal)).onRequest(SORBET_MCP_READ, mcpReadParser, ({ params, signal }) => state.mcpHost.read(requireAttached(state, params.sessionId), params, signal)).onRequest(SORBET_MCP_CALL, mcpCallParser, ({ params, signal, client }) => state.mcpHost.call(requireAttached(state, params.sessionId), params, signal, client)).onRequest(SORBET_MCP_CONTROL, mcpControlParser, ({ params, signal }) => state.mcpHost.control(requireAttached(state, params.sessionId), params, signal)).onRequest(SORBET_MCP_ROOTS_CHANGED, mcpRootsChangedParser, ({ params, signal }) => state.mcpHost.rootsChanged(requireAttached(state, params.sessionId), params, signal)).onRequest(SORBET_PLUGINS_QUERY, pluginQueryParser, ({ params, signal }) => state.plugins.query(requireAttached(state, params.sessionId), signal)).onRequest(SORBET_PLUGINS_APPLY, pluginApplyParser, ({ params, signal }) => state.sessions.run(params.sessionId, () => state.plugins.apply(requireAttached(state, params.sessionId), params.patch, signal))).onRequest(SORBET_PLUGINS_WATCH, pluginWatchParser, ({ params, client, signal }) => state.sessions.run(params.sessionId, () => state.plugins.watch(requireAttached(state, params.sessionId), params.enabled, (snapshot) => client.notify(SORBET_PLUGINS_CHANGED, {
750
762
  sessionId: params.sessionId,
751
763
  snapshot
@@ -1432,15 +1444,19 @@ function decodeCursor(cursor) {
1432
1444
  }
1433
1445
  async function replayConversation(agent, sessionId$1, session, client, tools, supportsPlanUpdates) {
1434
1446
  const entries = await session.runtime.conversationEntries();
1447
+ const labels = await projectedToolLabels(tools, entries.flatMap((entry) => entry.message.role === "assistant" ? entry.message.content.flatMap((block) => block.type === "toolCall" ? [{
1448
+ toolCallId: block.id,
1449
+ runId: entry.runId
1450
+ }] : []) : []));
1435
1451
  let cachedChildren;
1436
1452
  const children = session.metadata.depth === 0 ? () => {
1437
1453
  cachedChildren ??= agent.listChildAgents(sessionId$1, { includeClosed: true }).then(({ agents }) => new Map(agents.map((child) => [child.agentId, child])));
1438
1454
  return cachedChildren;
1439
1455
  } : void 0;
1440
- for (const entry of entries) await replayEntry(sessionId$1, entry, client, tools, children);
1456
+ for (const entry of entries) await replayEntry(sessionId$1, entry, client, tools, children, labels);
1441
1457
  for (const behavior of await session.runtime.listBehaviors()) await projectBehaviorSnapshot(sessionId$1, behavior, client, supportsPlanUpdates);
1442
1458
  }
1443
- async function replayEntry(sessionId$1, entry, client, tools, children) {
1459
+ async function replayEntry(sessionId$1, entry, client, tools, children, labels) {
1444
1460
  const message = entry.message;
1445
1461
  if (message.role === "user") {
1446
1462
  const blocks = isString(message.content) ? [{
@@ -1480,7 +1496,7 @@ async function replayEntry(sessionId$1, entry, client, tools, children) {
1480
1496
  await update(client, sessionId$1, {
1481
1497
  sessionUpdate: "tool_call",
1482
1498
  toolCallId: content.id,
1483
- title: await projectedToolTitle(content.name, content.arguments, tools, content.id, entry.runId),
1499
+ title: await projectedToolTitle(content.name, content.arguments, tools, content.id, entry.runId, false, labels),
1484
1500
  name: content.name,
1485
1501
  kind: toolKind(content.name),
1486
1502
  status: "pending",
@@ -1745,4 +1761,4 @@ async function attachOpeningSlashCommands(state, attached, client) {
1745
1761
 
1746
1762
  //#endregion
1747
1763
  export { createSorbetAcpAgent as t };
1748
- //# sourceMappingURL=agent-BCOPO0L6.js.map
1764
+ //# sourceMappingURL=agent-BovB-tw0.js.map