@qlairoslabs/acp-client 0.11.1 → 0.12.1
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-consumer-fixes.md +62 -0
- package/CHANGELOG-operation-lifecycle.md +64 -0
- package/CONSUMER_GUIDE.md +288 -12
- package/MIGRATION-0.10-to-0.12.md +189 -0
- package/README.md +6 -3
- package/package.json +5 -2
- package/src/adapters.ts +8 -1
- package/src/agent/adoption/replay.ts +1 -0
- package/src/agent/config.ts +4 -0
- package/src/agent/conversation-manager.ts +178 -150
- package/src/agent/error-record-writer.ts +77 -0
- package/src/agent/persisted-lifecycle.ts +152 -35
- package/src/agent/record-capture.ts +18 -18
- package/src/agent-adapter-registry.ts +2 -0
- package/src/agent-client.ts +9 -3
- package/src/agent-conversation-contracts.ts +6 -0
- package/src/agent-conversation-owner.ts +31 -6
- package/src/agent-conversation-presentation.ts +12 -1
- package/src/agent-conversation-queue.ts +3 -2
- package/src/agent-session.ts +535 -94
- package/src/agent.ts +46 -23
- package/src/audit/config.ts +4 -0
- package/src/audit/projection.ts +3 -0
- package/src/checkpointing/recovery.ts +12 -0
- package/src/checkpointing/strategy.ts +2 -0
- package/src/client.ts +132 -30
- package/src/controller.ts +116 -7
- package/src/degraded/pty-client.ts +25 -1
- package/src/index.ts +17 -0
- package/src/internal-inference/config.ts +7 -0
- package/src/internal-inference/contracts.ts +3 -0
- package/src/internal-inference/coordination/handles.ts +11 -2
- package/src/internal-inference/coordination/manager.ts +20 -3
- package/src/internal-inference/index.ts +2 -0
- package/src/internal-inference/persistence/records.ts +3 -1
- package/src/internal-inference/persistence/sqlite-repository.ts +4 -1
- package/src/internal-inference/runtime/disposable-session-env.ts +84 -0
- package/src/internal-inference/runtime/harness-runtime.ts +19 -2
- package/src/media/acp.ts +118 -0
- package/src/media/capture.ts +15 -0
- package/src/media/content.ts +142 -0
- package/src/media/files.ts +28 -0
- package/src/media/parts.ts +145 -0
- package/src/media/pending.ts +51 -0
- package/src/media/redact.ts +14 -0
- package/src/media/store.ts +127 -0
- package/src/metering/provider.ts +8 -1
- package/src/operations/activity-tracker.ts +31 -0
- package/src/operations/contracts.ts +63 -0
- package/src/operations/errors.ts +31 -0
- package/src/operations/index.ts +6 -0
- package/src/operations/stale-policy.ts +51 -0
- package/src/operations/supervisor.ts +209 -0
- package/src/operations/timers.ts +12 -0
- package/src/out-of-band-messages.ts +49 -32
- package/src/persistence/audit-runtime.ts +14 -2
- package/src/persistence/backend.ts +108 -12
- package/src/persistence/error-records.ts +27 -0
- package/src/persistence/index.ts +8 -0
- package/src/persistence/presentation.ts +9 -1
- package/src/persistence/projection.ts +20 -0
- package/src/persistence/records.ts +45 -6
- package/src/persistence/sqlite-backend.ts +207 -16
- package/src/persistence/sqlite-conversation-records.ts +31 -4
- package/src/persistence/sqlite-files.ts +95 -0
- package/src/persistence/sqlite-media-store.ts +67 -0
- package/src/persistence/sqlite-schema.ts +86 -10
- package/src/persistence/state-runtime.ts +2 -0
- package/src/persistence/timeline-reconcile.ts +21 -4
- package/src/persistence/transcript-reader.ts +11 -4
- package/src/persistence/transcript-runtime.ts +105 -12
- package/src/repl/repl.ts +1 -1
- package/src/response.ts +40 -8
- package/src/steering/combine.ts +11 -4
- package/src/steering/contracts.ts +14 -4
- package/src/steering/controller.ts +96 -21
- package/src/steering/index.ts +1 -0
- package/src/transport/acp-transport.ts +18 -7
- package/src/types.ts +7 -0
- package/src/updates.ts +4 -4
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Migrating from 0.10.2 to 0.12.0
|
|
2
|
+
|
|
3
|
+
For agents-core and the webapp, which pin `@qlairoslabs/acp-client` `0.10.2`. This covers everything
|
|
4
|
+
since: `0.11.0`, the operation lifecycle (`0.11.2`), and the work done for the 2026-10-13
|
|
5
|
+
requirements list. `CONSUMER_GUIDE.md` is the full reference; this file says what changed and what to do
|
|
6
|
+
about it.
|
|
7
|
+
|
|
8
|
+
**Status.** 0.12.0 is on the library's `beta` branch, not yet pushed or published. Until it is,
|
|
9
|
+
point agents-core at a local checkout of the library to try it.
|
|
10
|
+
|
|
11
|
+
## Before you upgrade
|
|
12
|
+
|
|
13
|
+
- **Back up the SQLite agent databases.** Opening one migrates it to schema 16 (from 14, through 15).
|
|
14
|
+
The migration is one way: an older library refuses the migrated file.
|
|
15
|
+
- Schema 15 rebuilds `conversation_records` to admit a new record kind, and recovers `operationId` on
|
|
16
|
+
older records from their record ids.
|
|
17
|
+
- Schema 16 adds a blob table for kept media and an out-of-band delivery table, and rebuilds the
|
|
18
|
+
message full-text index without inline bytes. On a large database the first open takes longer.
|
|
19
|
+
- JSONL transcripts and audit logs need no migration; they gain new line types (below).
|
|
20
|
+
|
|
21
|
+
## Breaking changes checklist
|
|
22
|
+
|
|
23
|
+
Each item says what changed and what agents-core has to do.
|
|
24
|
+
|
|
25
|
+
| # | change | what to do |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| 1 | **A prompt sent while a turn runs is steered by default** (`busyDelivery: "steer"`, was `"queue"`). | agents-core already passes `delivery: "steer"` when a turn runs. Elsewhere, set `busyDelivery: "queue"` to keep the old behavior. |
|
|
28
|
+
| 2 | **Silent turns now fail as stalled.** No output for 120 s after the request, or 180 s between outputs (tools and permissions pause the clock), fails the operation with `OperationStalledError` (`code: "stalled"`). Agent-owned conversations record an error record and mark the partial reply failed. | Handle `stalled` like other turn failures. Raise or disable limits with `operationLifecycle: { turns: { firstOutputMs, nextOutputMs } }` (`false` disables one). |
|
|
29
|
+
| 3 | **The conversation reconnects by itself** after the provider process exits or is force-stopped, on the next operation (`provider_reconnected`, `via: loaded \| recovered \| fresh`). | If agents-core retires a conversation whose provider died, it can keep it instead and prompt again. |
|
|
30
|
+
| 4 | **Queued messages are held after a failed turn** the provider received. Pending steers run after recovery; the next consumer turn that completes releases the hold. | Show `state.pendingHold` and `pendingMessages[].heldBy` if the UI lists pending messages. With `busyDelivery: "queue"`, send one prompt with `delivery: "steer"` to release. |
|
|
31
|
+
| 5 | **Cancelled results say how the cancel ended:** `cancel: "acknowledged" \| "forced"`. Pending permissions are answered as cancelled, and the permission handler gets an optional `AbortSignal`. | Nothing required. Use the `AbortSignal` to close a permission dialog. |
|
|
32
|
+
| 6 | **Every record carries `operationId`** (typed field), not only messages in their metadata. | Prefer `record.operationId` over `JSON.parse(record.metadata).operationId`; both work for messages. |
|
|
33
|
+
| 7 | **Appended out-of-band messages have no operation.** `appendAssistantMessage` used to give each its own operation id; now the record is standalone, at the sequence it was appended. | Don't expect `operationId` on appended messages. |
|
|
34
|
+
| 8 | **New record kind `cancellation`** (SQLite and JSONL; audit key `cancellation`). It has `requested` (reason: `steer`, `interrupt`, `stalled`, `stop`, `abort`) and `resolved` (outcome: `acknowledged`, `forced`, `too_late`, `failed`) revisions, under the cancelled operation. | `projectSqliteChatRecord` maps unknown kinds to activities, so these show up as `cancellation` activity items. Decide whether to show them (a turn shown as stopped or redirected after reload) or skip them. |
|
|
35
|
+
| 9 | **Timeline item ids for tool calls, permissions, thinking and activity change once**: items are now keyed by operation, so two turns reusing a provider id stay two items. Message ids don't change. | If agents-core stores timeline item ids (from `conversationTimelineItemId`), expect them to change once for those kinds. |
|
|
36
|
+
| 10 | **Message content can be blocks, not just a string.** A message with media or a named paste stores `PersistedContentBlock[]`: `text`, `pasted`, `media`. Plain text messages stay strings. | `projectSqliteChatRecord` keeps only `type: "text"` blocks, so a pasted block's text disappears. Include `pasted`, and render `media` blocks (below). Note that it joins text blocks with `"\n"`, while the library joins a message's text parts with nothing (separators are their own parts). |
|
|
37
|
+
| 11 | **Attachments go out as their real kind.** `prompt(text, handlers, attachments)` used to send every attachment as an ACP `image`. Now an image is an `image`, audio is `audio`, and anything else is an embedded file, which needs the agent's `embeddedContext`. An agent that can't take the kind refuses the prompt with `agent does not support <kind> copies`. | Expect that error for non-image attachments to agents without that support. Claude's adapter advertises embedded context but silently drops binary files (PDFs), so send those to Claude as links (`mode: "link"`); text files work. |
|
|
38
|
+
| 12 | **Attachments are recorded** on Agent-owned conversations, as media blocks with name, type, size and hash (`keep: false`, no bytes). The user message's `content` becomes blocks when it has attachments (see 10). | Nothing required; it's the start of dropping the `chat-attachments` side store (below). |
|
|
39
|
+
| 13 | **Presentation items' `timestamp` is deprecated**, an alias of the new `updatedAt`. Timeline items gain `startedAt` and `updatedAt`. | Show a message's time with `startedAt`. |
|
|
40
|
+
| 14 | **`AgentConversation.listSessions()` is deprecated** and now throws when the harness listing fails, instead of silently returning the catalog half. | Use `agent.conversations.list()` for conversations and `agent.conversations.listProviderSessions()` for harness sessions. |
|
|
41
|
+
| 15 | **`setConfig` with the value the option already has does nothing**: no request, record or event. | Nothing required. The Hub's re-applied settings stop filling the history. |
|
|
42
|
+
| 16 | **`PromptPart` is renamed `CombinedMessage`** (steering's original messages of a combined prompt). `PromptPart` stays as a deprecated alias. | Rename when convenient. |
|
|
43
|
+
|
|
44
|
+
## The requirements, before and after
|
|
45
|
+
|
|
46
|
+
### 1, 2. Operation ids, and history pages that don't cut turns
|
|
47
|
+
|
|
48
|
+
`identity-store.ts` reads recent history with `listRecent({ limit })`, which counts records, so a page can
|
|
49
|
+
start in the middle of a turn.
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
// now: N agent messages per page, each with what led to it; nothing is split
|
|
53
|
+
const page = await persistence.records.listRecent(conversationId, {
|
|
54
|
+
agentMessages: 20, // the page unit; the cut is right after an agent message
|
|
55
|
+
fold: true, // timeline items instead of records
|
|
56
|
+
detail: "summary", // tool calls without input/output
|
|
57
|
+
...(cursor ? { olderCursor: cursor } : {}),
|
|
58
|
+
});
|
|
59
|
+
page.items; // ConversationTimelineItem[]
|
|
60
|
+
page.olderCursor; // next older page
|
|
61
|
+
page.truncated; // the page hit `limit` (default 2000)
|
|
62
|
+
|
|
63
|
+
// a tool call's full input/output, on demand
|
|
64
|
+
const record = await persistence.records.get(recordId);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- Every record lands on the page where its item began, so an item never spans two pages.
|
|
68
|
+
- A cursor remembers its unit; a records cursor can't be used for an agent-messages page.
|
|
69
|
+
- `records.list(id, { operationId })` filters by operation.
|
|
70
|
+
- Without the new options, `listRecent` behaves as before.
|
|
71
|
+
|
|
72
|
+
### 3. How a turn ended
|
|
73
|
+
|
|
74
|
+
The `cancellation` records (checklist item 8) say whether a turn was stopped, steered or interrupted,
|
|
75
|
+
and whether the cancel was acknowledged or forced. A failed turn already had an error record.
|
|
76
|
+
|
|
77
|
+
### 4. Re-applied settings
|
|
78
|
+
|
|
79
|
+
Not recorded any more (checklist item 15).
|
|
80
|
+
|
|
81
|
+
### 5. A message's time
|
|
82
|
+
|
|
83
|
+
`ConversationTimelineItem.startedAt` is the first revision's time, `updatedAt` the latest. Messages are
|
|
84
|
+
also recorded `completed` when the next message or a tool call starts, with that time, instead of all
|
|
85
|
+
at turn end with one timestamp. A tool call now ends the message before it, also when the agent sends
|
|
86
|
+
no message ids.
|
|
87
|
+
|
|
88
|
+
### 6, 7, 10. Messages made of parts
|
|
89
|
+
|
|
90
|
+
agents-core keeps attachments in its own `chat-attachments` store (files under the agent's shared
|
|
91
|
+
directory, plus `prompt-records.json` joined to history by operation id). The library can now hold
|
|
92
|
+
them itself:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
await conversation.prompt({
|
|
96
|
+
text: "compare these",
|
|
97
|
+
parts: [
|
|
98
|
+
{ kind: "image", data: bytes, name: "chart.png", mimeType: "image/png" }, // copy, kept by default
|
|
99
|
+
{ kind: "file", path: "/srv/files/report.pdf" }, // copy or link, by size
|
|
100
|
+
{ kind: "file", path: "/srv/files/big.log", mode: "link" }, // the agent opens it
|
|
101
|
+
{ kind: "pasted", text: longPaste, name: "error output" }, // a named paste
|
|
102
|
+
{ kind: "text", text: "Answer in Spanish.", record: false }, // sent, not recorded
|
|
103
|
+
],
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- **A part's source:** `data` (bytes), `path` (a path or `file://` uri) or `ref` (a copy already kept).
|
|
108
|
+
- **`mode: "copy"`** sends the content in the prompt. **`mode: "link"`** sends a pointer and the agent
|
|
109
|
+
opens the file itself; later edits or deletion of the file affect what history shows. Without a mode,
|
|
110
|
+
a path goes as a link above 100 KB for files, 3.75 MB for images and 5 MB for audio (configurable:
|
|
111
|
+
`Agent.open({ media: { thresholds } })`).
|
|
112
|
+
- **`keep: false`** records name, type, size and hash without the bytes. **`record: false`** sends the
|
|
113
|
+
part without recording it. This is requirement 7: text for the provider only.
|
|
114
|
+
- **Where kept bytes go:** by default a table in the agent's SQLite database, written in the same
|
|
115
|
+
transaction as the message. To keep them elsewhere, pass your own store:
|
|
116
|
+
`Agent.open({ media: { store } })`, an object with `put`, `get`, `delete` and `list(owner)`.
|
|
117
|
+
- **What's recorded is controlled by `capture.media`** (`none`, `metadata`, `content`; default
|
|
118
|
+
`content`), separately from `capture.message`, and per conversation through the persistence resolver.
|
|
119
|
+
- **Reading media back:** a message's `media` block has `kind`, `mode`, `mimeType`, `name`, `size`,
|
|
120
|
+
`sha256`, and `ref` (kept copy) or `uri` (link). Get bytes with
|
|
121
|
+
`(agent.media.store ?? agent.persistence.media).get(ref)`. Delete bytes with `agent.deleteMedia(ref)`
|
|
122
|
+
(history keeps the metadata) or `agent.deleteMediaForConversation(id)`.
|
|
123
|
+
- **Search (10):** message search stays over text and pasted text. Files have their own listing and
|
|
124
|
+
search over name, kind, MIME type and size: `agent.persistence.files.list({ agentConversationId })`,
|
|
125
|
+
`files.search({ text: "report" })`.
|
|
126
|
+
- **Media the agent sends** (images, audio, links, embedded files) is recorded the same way and comes
|
|
127
|
+
back as `result.messages[].parts`; `text` stays the text-only view.
|
|
128
|
+
- **Shared directories:** `conversationDefaults: { additionalDirectories: ["/srv/files"] }` declares
|
|
129
|
+
directories to the harness, which applies its own permissions to links outside the workspace.
|
|
130
|
+
- Media is recorded on Agent-owned conversations only. The `SessionManager` / JSONL path can send parts
|
|
131
|
+
and records a line per part (`[image chart.png]`).
|
|
132
|
+
|
|
133
|
+
**For agents-core:** with `keep: true` copies (or links into the shared directory) the
|
|
134
|
+
`chat-attachments` store and the operation-id join in `identity-store.ts` and `hub/index.ts` can go.
|
|
135
|
+
`session.prompt({ text, attachments })` keeps working as before (attachments become `keep: false`
|
|
136
|
+
copies), so this can be done later.
|
|
137
|
+
|
|
138
|
+
### 8. Out-of-band messages with media, delivered once
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
await agent.conversations.appendAssistantMessage(conversationId, {
|
|
142
|
+
parts: [
|
|
143
|
+
{ kind: "text", text: "Here is the chart I sent you on Telegram" },
|
|
144
|
+
{ kind: "image", data: bytes, mimeType: "image/png", name: "chart.png" },
|
|
145
|
+
],
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- `text` alone still works; media-only messages are allowed.
|
|
150
|
+
- The next successful turn delivers it once, in a `<messages-you-sent>` block, media included. After
|
|
151
|
+
that it is ordinary history.
|
|
152
|
+
- If the agent can't take a part's kind, or its bytes are gone, the part is named instead
|
|
153
|
+
(`[image chart.png: not supported by this agent]`), so the turn never fails because of it.
|
|
154
|
+
- Parts that aren't kept wait in memory until delivered. After a restart such a copy is named
|
|
155
|
+
(`[image chart.png: not available]`).
|
|
156
|
+
|
|
157
|
+
### 13. Live message completion
|
|
158
|
+
|
|
159
|
+
No separate event: a message's record turns `completed` when the next message or a tool call starts
|
|
160
|
+
(see 5), and `agent.events` publishes that record as it commits.
|
|
161
|
+
|
|
162
|
+
### Not done, or done differently
|
|
163
|
+
|
|
164
|
+
| # | requirement | status |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| 2 | paging by operations | done by agent messages instead (above) |
|
|
167
|
+
| 9 | persist agent capabilities | not stored: they come from `initialize`, so start the session to read them |
|
|
168
|
+
| 11 | Claude thinking rarely persisted | not investigated yet |
|
|
169
|
+
| 12 | Codex steer handover delay | not investigated yet; it may be in agents-core rather than the library |
|
|
170
|
+
| 13 | live completion event | done through the completed record, no event |
|
|
171
|
+
|
|
172
|
+
## Also new since 0.10.2, not breaking
|
|
173
|
+
|
|
174
|
+
- Adopting a session the provider already holds: `agent.conversations.create({ adopt })`, with an
|
|
175
|
+
optional recap, and `listProviderSessions()` to choose one.
|
|
176
|
+
- Per-conversation persistence through a resolver (capture, audit, metering retention).
|
|
177
|
+
- `agent.conversations.clearTranscript(id)` and `agent.conversations.delete(id)`, optionally at the
|
|
178
|
+
provider.
|
|
179
|
+
- Operation visibility: the current operation's stage and last output time on conversation state.
|
|
180
|
+
- Codex per-turn usage counters in metering.
|
|
181
|
+
|
|
182
|
+
## Known gaps
|
|
183
|
+
|
|
184
|
+
- The media probes on real harnesses ran before the last fix to embedded copies' uri, and need a rerun.
|
|
185
|
+
- Codex's tool output (sent through `_meta` terminal chunks) is not captured yet: its tool calls show
|
|
186
|
+
empty output.
|
|
187
|
+
- Claude's adapter silently drops binary embedded files (PDFs): its `promptToClaude` has no branch for
|
|
188
|
+
blobs. Send them as links (`mode: "link"`); Claude's Read tool opens PDFs. A fix belongs upstream
|
|
189
|
+
(map a PDF blob to an Anthropic `document` block).
|
package/README.md
CHANGED
|
@@ -326,9 +326,12 @@ const session = await AgentSession.create({
|
|
|
326
326
|
|
|
327
327
|
await session.prompt("Start working on the auth module.");
|
|
328
328
|
|
|
329
|
-
// later. List
|
|
330
|
-
|
|
331
|
-
|
|
329
|
+
// later. List the two separately through an Agent (`Agent.open`, see the consumer guide);
|
|
330
|
+
// the merged `session.listSessions()` is deprecated
|
|
331
|
+
const { conversations } = await agent.conversations.list(); // our catalog
|
|
332
|
+
for (const c of conversations) console.log(c.agentConversationId, c.agentSessionId, c.title);
|
|
333
|
+
for (const s of await agent.conversations.listProviderSessions()) { // the harness's own sessions
|
|
334
|
+
console.log(s.providerSessionId, s.title, s.adoptedBy); // adoptedBy: the conversation that owns it, if any
|
|
332
335
|
}
|
|
333
336
|
|
|
334
337
|
await session.stop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlairoslabs/acp-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Embeddable Agent Client Protocol (ACP) client library with degraded PTY fallback.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
"src",
|
|
36
36
|
"CONSUMER_GUIDE.md",
|
|
37
37
|
"CHANGELOG-audit.md",
|
|
38
|
-
"CHANGELOG-metering.md"
|
|
38
|
+
"CHANGELOG-metering.md",
|
|
39
|
+
"CHANGELOG-operation-lifecycle.md",
|
|
40
|
+
"CHANGELOG-consumer-fixes.md",
|
|
41
|
+
"MIGRATION-0.10-to-0.12.md"
|
|
39
42
|
],
|
|
40
43
|
"exports": {
|
|
41
44
|
".": "./src/index.ts",
|
package/src/adapters.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Adapters carry
|
|
1
|
+
// Adapters carry the launch command and the grace for terminating an unresponsive harness.
|
|
2
2
|
// Everything else (auth methods, capabilities, features) is DISCOVERED from initialize.
|
|
3
3
|
// See SPEC.md "Adapters" + "Core principles".
|
|
4
4
|
|
|
5
5
|
export interface Adapter {
|
|
6
|
+
/** Maximum cancellation wait before terminating this provider process. */
|
|
7
|
+
cancelGraceMs?: number;
|
|
6
8
|
/** The command to spawn the ACP agent binary, e.g. ["kimi", "acp"]. */
|
|
7
9
|
command: string[];
|
|
8
10
|
/**
|
|
@@ -55,6 +57,11 @@ export const ADAPTERS = {
|
|
|
55
57
|
// @automatalabs/pi-acp embeds Pi through its SDK and publishes the `pi-acp` binary.
|
|
56
58
|
// Pi itself remains the interactive PTY command for bridge/degraded mode.
|
|
57
59
|
pi: { command: ["pi-acp"], ptyCommand: ["pi"], displayName: "Pi" },
|
|
60
|
+
// verified — xAI's Grok Build (`grok` CLI, 1.0.70). ACP over `grok agent stdio`; xAI advises
|
|
61
|
+
// `--no-auto-update` for ACP in automated use, so a session does not start a background update.
|
|
62
|
+
// No `session/delete`: its sessions live in folders under ~/.grok/sessions/. Only the ACP command
|
|
63
|
+
// is verified; the pty command (its interactive TUI) has not been run in degraded mode.
|
|
64
|
+
grok: { command: ["grok", "--no-auto-update", "agent", "stdio"], ptyCommand: ["grok"], displayName: "Grok Build" },
|
|
58
65
|
// Below: from each project's docs, not spawned here. Correct at time of writing, unverified.
|
|
59
66
|
gemini: { command: ["gemini", "--acp", "--stdio"], ptyCommand: ["gemini"], displayName: "Gemini" },
|
|
60
67
|
copilot: { command: ["copilot", "--acp", "--stdio"], ptyCommand: ["copilot"], displayName: "Copilot" },
|
|
@@ -34,6 +34,7 @@ export function turnsFromReplay(notifications: readonly unknown[]): ImportedTurn
|
|
|
34
34
|
if (!update || typeof update.sessionUpdate !== "string") continue;
|
|
35
35
|
|
|
36
36
|
const response = extractResponseChunk(update as never);
|
|
37
|
+
if (response?.part) continue; // Loaded media is already history; do not import duplicate copies.
|
|
37
38
|
if (response) {
|
|
38
39
|
if (!current) {
|
|
39
40
|
current = { items: [] };
|
package/src/agent/config.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OperationLifecycleConfig } from "../operations/contracts.ts";
|
|
1
2
|
import type * as schema from "@agentclientprotocol/sdk";
|
|
2
3
|
import type { AgentConversationId, AgentSessionId } from "../agent-ids.ts";
|
|
3
4
|
import type { AgentAdapterRegistration } from "../agent-adapter-registry.ts";
|
|
@@ -28,6 +29,7 @@ import type {
|
|
|
28
29
|
import type { AppendAssistantMessageInput } from "../out-of-band-messages.ts";
|
|
29
30
|
import type { ConversationPersistenceResolver } from "./persistence-policy/index.ts";
|
|
30
31
|
import type { AdoptProviderSessionConfig, ListProviderSessionsOptions, ProviderSessionSummary } from "./adoption/index.ts";
|
|
32
|
+
import type { MediaConfig } from "../media/store.ts";
|
|
31
33
|
|
|
32
34
|
export type AgentPersistenceConfig =
|
|
33
35
|
| {
|
|
@@ -60,6 +62,8 @@ export type AgentConversationRuntimeDefaults = Omit<
|
|
|
60
62
|
>;
|
|
61
63
|
|
|
62
64
|
export interface AgentConfig {
|
|
65
|
+
readonly media?: MediaConfig;
|
|
66
|
+
readonly operationLifecycle?: OperationLifecycleConfig;
|
|
63
67
|
readonly id?: AgentSessionId;
|
|
64
68
|
readonly persistence: AgentPersistenceConfig;
|
|
65
69
|
readonly adapters: Readonly<Record<string, import("../adapters.ts").Adapter>>
|