@agentclientprotocol/claude-agent-acp 0.102.1-preview.1 → 0.102.1-preview.2

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 (203) hide show
  1. package/README.md +5 -1
  2. package/dist/acp-agent.d.ts +113 -439
  3. package/dist/acp-agent.d.ts.map +1 -1
  4. package/dist/acp-agent.js +362 -2409
  5. package/dist/acp-subagents.d.ts +1 -2
  6. package/dist/acp-subagents.d.ts.map +1 -1
  7. package/dist/auth-methods.d.ts +21 -0
  8. package/dist/auth-methods.d.ts.map +1 -0
  9. package/dist/auth-methods.js +68 -0
  10. package/dist/auth-status-reporter.d.ts +112 -0
  11. package/dist/auth-status-reporter.d.ts.map +1 -0
  12. package/dist/auth-status-reporter.js +253 -0
  13. package/dist/background-work.d.ts +12 -265
  14. package/dist/background-work.d.ts.map +1 -1
  15. package/dist/background-work.js +8 -558
  16. package/dist/client-system-prompt.d.ts +7 -0
  17. package/dist/client-system-prompt.d.ts.map +1 -1
  18. package/dist/client-system-prompt.js +24 -0
  19. package/dist/context-compaction.d.ts +20 -0
  20. package/dist/context-compaction.d.ts.map +1 -1
  21. package/dist/context-compaction.js +26 -0
  22. package/dist/context-window.d.ts +70 -0
  23. package/dist/context-window.d.ts.map +1 -0
  24. package/dist/context-window.js +132 -0
  25. package/dist/diff.d.ts +1 -1
  26. package/dist/diff.js +1 -1
  27. package/dist/elicitation.d.ts +66 -1
  28. package/dist/elicitation.d.ts.map +1 -1
  29. package/dist/elicitation.js +109 -0
  30. package/dist/file-change-audit.d.ts +4 -3
  31. package/dist/file-change-audit.d.ts.map +1 -1
  32. package/dist/file-change-audit.js +3 -2
  33. package/dist/mcp-oauth.d.ts +44 -0
  34. package/dist/mcp-oauth.d.ts.map +1 -0
  35. package/dist/mcp-oauth.js +142 -0
  36. package/dist/mcp-servers.d.ts +10 -0
  37. package/dist/mcp-servers.d.ts.map +1 -0
  38. package/dist/mcp-servers.js +29 -0
  39. package/dist/native-subagents.d.ts +18 -8
  40. package/dist/native-subagents.d.ts.map +1 -1
  41. package/dist/native-subagents.js +7 -35
  42. package/dist/permissions/presentation.d.ts +29 -0
  43. package/dist/permissions/presentation.d.ts.map +1 -1
  44. package/dist/permissions/presentation.js +38 -11
  45. package/dist/prompt-suggestions.d.ts +29 -0
  46. package/dist/prompt-suggestions.d.ts.map +1 -1
  47. package/dist/prompt-suggestions.js +45 -0
  48. package/dist/providers.d.ts +139 -0
  49. package/dist/providers.d.ts.map +1 -0
  50. package/dist/providers.js +286 -0
  51. package/dist/remote-control.d.ts +62 -0
  52. package/dist/remote-control.d.ts.map +1 -0
  53. package/dist/remote-control.js +78 -0
  54. package/dist/result-end.d.ts +39 -0
  55. package/dist/result-end.d.ts.map +1 -0
  56. package/dist/result-end.js +50 -0
  57. package/dist/serve.d.ts +7 -2
  58. package/dist/serve.d.ts.map +1 -1
  59. package/dist/serve.js +10 -5
  60. package/dist/session-config-ids.d.ts +1 -0
  61. package/dist/session-config-ids.d.ts.map +1 -1
  62. package/dist/session-config-ids.js +1 -0
  63. package/dist/session-config-options.d.ts +64 -0
  64. package/dist/session-config-options.d.ts.map +1 -0
  65. package/dist/session-config-options.js +162 -0
  66. package/dist/session-effort.d.ts +67 -0
  67. package/dist/session-effort.d.ts.map +1 -1
  68. package/dist/session-effort.js +98 -0
  69. package/dist/session-env.d.ts +22 -0
  70. package/dist/session-env.d.ts.map +1 -0
  71. package/dist/session-env.js +66 -0
  72. package/dist/session-fast-mode.d.ts +83 -0
  73. package/dist/session-fast-mode.d.ts.map +1 -0
  74. package/dist/session-fast-mode.js +142 -0
  75. package/dist/session-index/connection.d.ts +2 -5
  76. package/dist/session-index/connection.d.ts.map +1 -1
  77. package/dist/session-index/connection.js +3 -5
  78. package/dist/session-mode.d.ts +1 -0
  79. package/dist/session-mode.d.ts.map +1 -1
  80. package/dist/session-mode.js +1 -1
  81. package/dist/session-model.d.ts +41 -0
  82. package/dist/session-model.d.ts.map +1 -1
  83. package/dist/session-model.js +110 -45
  84. package/dist/session-notices.d.ts +44 -0
  85. package/dist/session-notices.d.ts.map +1 -1
  86. package/dist/session-notices.js +68 -0
  87. package/dist/session-titles.d.ts +34 -12
  88. package/dist/session-titles.d.ts.map +1 -1
  89. package/dist/session-titles.js +7 -6
  90. package/dist/session-usage.d.ts +125 -0
  91. package/dist/session-usage.d.ts.map +1 -0
  92. package/dist/session-usage.js +196 -0
  93. package/dist/streamed-text.d.ts +33 -0
  94. package/dist/streamed-text.d.ts.map +1 -0
  95. package/dist/streamed-text.js +71 -0
  96. package/dist/subagent-configuration.d.ts +32 -0
  97. package/dist/subagent-configuration.d.ts.map +1 -0
  98. package/dist/subagent-configuration.js +70 -0
  99. package/dist/subagent-replay.d.ts +18 -0
  100. package/dist/subagent-replay.d.ts.map +1 -1
  101. package/dist/subagent-replay.js +25 -15
  102. package/dist/tool-calls/client-capabilities.d.ts +8 -8
  103. package/dist/tool-calls/client-capabilities.js +4 -4
  104. package/dist/tool-calls/renderer.d.ts +4 -5
  105. package/dist/tool-calls/renderer.d.ts.map +1 -1
  106. package/dist/tool-calls/renderer.js +4 -5
  107. package/dist/turn-events.d.ts +6 -46
  108. package/dist/turn-events.d.ts.map +1 -1
  109. package/dist/v2/agent.d.ts +7 -11
  110. package/dist/v2/agent.d.ts.map +1 -1
  111. package/dist/v2/agent.js +751 -331
  112. package/dist/v2/air.d.ts +33 -0
  113. package/dist/v2/air.d.ts.map +1 -0
  114. package/dist/v2/air.js +29 -0
  115. package/dist/v2/auth.d.ts +97 -0
  116. package/dist/v2/auth.d.ts.map +1 -0
  117. package/dist/v2/auth.js +216 -0
  118. package/dist/v2/background.d.ts +27 -16
  119. package/dist/v2/background.d.ts.map +1 -1
  120. package/dist/v2/background.js +4 -32
  121. package/dist/v2/child-config.d.ts +55 -0
  122. package/dist/v2/child-config.d.ts.map +1 -0
  123. package/dist/v2/child-config.js +92 -0
  124. package/dist/v2/clear-context.d.ts +94 -0
  125. package/dist/v2/clear-context.d.ts.map +1 -0
  126. package/dist/v2/clear-context.js +176 -0
  127. package/dist/v2/commands.d.ts +46 -0
  128. package/dist/v2/commands.d.ts.map +1 -0
  129. package/dist/v2/commands.js +54 -0
  130. package/dist/v2/config.d.ts +187 -0
  131. package/dist/v2/config.d.ts.map +1 -0
  132. package/dist/v2/config.js +494 -0
  133. package/dist/v2/elicitation.d.ts +93 -0
  134. package/dist/v2/elicitation.d.ts.map +1 -0
  135. package/dist/v2/elicitation.js +160 -0
  136. package/dist/v2/file-changes.d.ts +61 -0
  137. package/dist/v2/file-changes.d.ts.map +1 -0
  138. package/dist/v2/file-changes.js +108 -0
  139. package/dist/v2/file-preview.d.ts +18 -0
  140. package/dist/v2/file-preview.d.ts.map +1 -0
  141. package/dist/v2/file-preview.js +29 -0
  142. package/dist/v2/initialize.d.ts +10 -24
  143. package/dist/v2/initialize.d.ts.map +1 -1
  144. package/dist/v2/initialize.js +4 -111
  145. package/dist/v2/outcome.d.ts +81 -0
  146. package/dist/v2/outcome.d.ts.map +1 -0
  147. package/dist/v2/outcome.js +165 -0
  148. package/dist/v2/permissions.d.ts +92 -0
  149. package/dist/v2/permissions.d.ts.map +1 -0
  150. package/dist/v2/permissions.js +162 -0
  151. package/dist/v2/prompt.d.ts +2 -42
  152. package/dist/v2/prompt.d.ts.map +1 -1
  153. package/dist/v2/prompt.js +2 -119
  154. package/dist/v2/remote-control.d.ts +41 -0
  155. package/dist/v2/remote-control.d.ts.map +1 -0
  156. package/dist/v2/remote-control.js +63 -0
  157. package/dist/v2/reports.d.ts +198 -0
  158. package/dist/v2/reports.d.ts.map +1 -0
  159. package/dist/v2/reports.js +487 -0
  160. package/dist/v2/restarts.d.ts +128 -0
  161. package/dist/v2/restarts.d.ts.map +1 -0
  162. package/dist/v2/restarts.js +348 -0
  163. package/dist/v2/session-requests.d.ts +20 -0
  164. package/dist/v2/session-requests.d.ts.map +1 -0
  165. package/dist/v2/session-requests.js +108 -0
  166. package/dist/v2/session-update.d.ts +2 -13
  167. package/dist/v2/session-update.d.ts.map +1 -1
  168. package/dist/v2/session-update.js +2 -22
  169. package/dist/v2/session.d.ts +340 -41
  170. package/dist/v2/session.d.ts.map +1 -1
  171. package/dist/v2/session.js +1223 -141
  172. package/dist/v2/setup.d.ts +49 -0
  173. package/dist/v2/setup.d.ts.map +1 -0
  174. package/dist/v2/setup.js +62 -0
  175. package/dist/v2/stopped-work.d.ts +123 -0
  176. package/dist/v2/stopped-work.d.ts.map +1 -0
  177. package/dist/v2/stopped-work.js +210 -0
  178. package/dist/v2/stream.d.ts +228 -0
  179. package/dist/v2/stream.d.ts.map +1 -0
  180. package/dist/v2/stream.js +506 -0
  181. package/dist/v2/subagent-replay.d.ts +115 -0
  182. package/dist/v2/subagent-replay.d.ts.map +1 -0
  183. package/dist/v2/subagent-replay.js +479 -0
  184. package/dist/v2/subscription-guard.d.ts +60 -0
  185. package/dist/v2/subscription-guard.d.ts.map +1 -0
  186. package/dist/v2/subscription-guard.js +84 -0
  187. package/dist/v2/tasks.d.ts +492 -0
  188. package/dist/v2/tasks.d.ts.map +1 -0
  189. package/dist/v2/tasks.js +1728 -0
  190. package/dist/v2/terminal.d.ts.map +1 -1
  191. package/dist/v2/terminal.js +6 -1
  192. package/dist/v2/tool-call.d.ts +3 -2
  193. package/dist/v2/tool-call.d.ts.map +1 -1
  194. package/dist/v2/update-translator.d.ts +36 -0
  195. package/dist/v2/update-translator.d.ts.map +1 -0
  196. package/dist/v2/update-translator.js +80 -0
  197. package/dist/workflow-progress.d.ts +23 -0
  198. package/dist/workflow-progress.d.ts.map +1 -1
  199. package/dist/workflow-progress.js +31 -8
  200. package/package.json +1 -1
  201. package/dist/v2/permission.d.ts +0 -28
  202. package/dist/v2/permission.d.ts.map +0 -1
  203. package/dist/v2/permission.js +0 -41
@@ -1,287 +1,34 @@
1
+ /**
2
+ * The commands of a session that went to the background, for a client that
3
+ * renders terminals from the terminal extension and is not AIR (AIR shows a
4
+ * command through its async tasks): the display terminal of each command
5
+ * runs from its Bash tool result until its task ends.
6
+ */
1
7
  import type { AcpSessionNotification } from "./acp-subagents.js";
2
- import type { NativeSubagent } from "./native-subagents.js";
3
- import { type AcpToolCallRenderer } from "./tool-calls/renderer.js";
4
- import { BackgroundOutputTail } from "./background-output.js";
5
- import type { TaskProgressFields } from "./async-tasks.js";
6
- import { type WorkflowSnapshot } from "./workflow-progress.js";
7
- /** An item of a `background` list. */
8
- export type BackgroundItem = {
9
- type: "terminal";
10
- terminalId: string;
11
- } | {
12
- type: "tool_call";
13
- toolCallId: string;
14
- } | {
15
- type: "subagent";
16
- sessionId: string;
17
- };
18
- /** The display terminal of a command that went to the background (see `Session.backgroundTerminals`). */
8
+ /** The display terminal of a command that went to the background. */
19
9
  export interface BackgroundTerminal {
20
10
  /** The Bash tool call, whose id names the terminal. */
21
11
  toolCallId: string;
22
12
  /** The subagent tool call that ran the command, if any. */
23
13
  parentToolUseId?: string;
24
- /** The file that Claude Code writes the command's output to, from the Bash result. */
25
- outputFilePath?: string;
26
- /** Reads that file into the terminal while the command runs. */
27
- output?: BackgroundOutputTail;
28
- }
29
- /** A tool call whose task runs on in the background (see `Session.backgroundToolCalls`). */
30
- export interface BackgroundToolCall {
31
- toolCallId: string;
32
- /**
33
- * The tool use of the call, which Claude Code no longer caches after its
34
- * result. Undefined for a call that the adapter started for a task (see
35
- * `SessionBackgroundWork.adoptTasks`), which has `title` instead.
36
- */
37
- toolUse?: {
38
- name: string;
39
- input: unknown;
40
- };
41
- /** The title of a call that the adapter started for a task: the task's description. */
42
- title?: string;
43
- /** The subagent tool call that made the call, if any. */
44
- parentToolUseId?: string;
45
- paused?: boolean;
46
- }
47
- /** How a background task ended, as Claude Code reports it. Undefined when it did not say. */
48
- export type BackgroundTaskEnd = "completed" | "failed" | "stopped" | undefined;
49
- /** The live background task set of `background_tasks_changed`, by task id. */
50
- export type BackgroundLevel = Map<string, {
51
- ambient: boolean;
52
- taskType: string;
53
- description: string;
54
- parentTaskId?: string;
55
- progress?: WorkflowCardProgress;
56
- }>;
57
- /** What a workflow card shows: the task's progress fields and its latest phase and agent list. */
58
- export type WorkflowCardProgress = TaskProgressFields & {
59
- workflow?: WorkflowSnapshot;
60
- };
61
- /** The work state of a session, as its `state_update` names it. */
62
- export type WorkStateName = "idle" | "running" | "requires_action" | "unknown";
63
- /** A new list of the session `sessionId`, with what its repeated state needs. */
64
- export interface BackgroundReport {
65
- sessionId: string;
66
- items: BackgroundItem[];
67
- /** The session's work state now, or undefined when it has none yet. */
68
- state: WorkStateName | undefined;
69
- /** The parent of a subagent session, which mirrors the child's state. */
70
- parentSessionId?: string;
71
- }
72
- /** Where the agent reports the lists (see the agent's `background` option). */
73
- export interface BackgroundSink {
74
- /** The list of a session changed, or is reported for the first time. */
75
- changed(report: BackgroundReport): void;
76
- /** The session ended: its list is no longer reported. */
77
- forget(sessionId: string): void;
78
- }
79
- /**
80
- * The state of a session that other modules own, and that the background
81
- * work reads: Claude Code's tasks as the consumer tracks them, the subagent
82
- * sessions, and the query that stops a task.
83
- */
84
- export interface BackgroundOwner {
85
- liveBackgroundTasks: Map<string, {
86
- parentToolUseId?: string;
87
- isSubagent: boolean;
88
- }>;
89
- nativeSubagentsByTaskId?: Map<string, NativeSubagent>;
90
- query: {
91
- stopTask(taskId: string): Promise<void>;
92
- };
93
14
  }
94
- /** A task of a `background_tasks_changed` payload. */
95
- export type LevelTask = {
96
- task_id: string;
97
- task_type: string;
98
- description: string;
99
- parent_task_id?: string;
100
- ambient?: boolean;
101
- };
102
- /**
103
- * The background work of one root session, and of its subagent sessions: the
104
- * terminals and tool calls of the tasks that run in the background, and what
105
- * the client is told of them.
106
- *
107
- * Terminals are kept for every client that renders them, as before the
108
- * background lists. The rest is kept only when `reported`.
109
- */
15
+ /** The terminals of the commands that one root session, and its subagents, run in the background. */
110
16
  export declare class SessionBackgroundWork {
111
17
  private readonly sessionId;
112
- readonly reported: boolean;
113
- /** Claude Code's live background task set, from its last `background_tasks_changed`. */
114
- private level;
115
18
  /** The terminals of the commands that went to the background, by task id. */
116
19
  private readonly terminals;
117
- /** The tool calls whose tasks went on in the background, by task id. */
118
- private readonly toolCalls;
119
- /**
120
- * The tool calls that returned, oldest first. A task that a call started
121
- * is part of that call until it returns, and the foreground work waits on
122
- * it. The task's `task_started` can come after the call returned. Bounded
123
- * by {@link MAX_RETURNED_CALLS}: a task joins the level around the time its
124
- * call returns.
125
- */
126
- private readonly returned;
127
- /**
128
- * `reported`: whether the client gets the lists. Only when Claude Code's
129
- * interrupt spares background tasks, as `perTaskStopAffordance` makes it.
130
- */
131
- constructor(sessionId: string, reported: boolean);
20
+ constructor(sessionId: string);
132
21
  /**
133
22
  * Keeps the display terminal of the command `taskId` running after its Bash
134
23
  * result, until its task ends (see `withRunningTerminal`).
135
24
  */
136
25
  terminalStarted(taskId: string, terminal: BackgroundTerminal): void;
137
26
  /**
138
- * Reads what a tool result message tells of the background tasks:
139
- *
140
- * - The returned calls no longer hold the tasks that they started.
141
- * - Each call whose task goes on in the background is registered: a
142
- * `Monitor` or `Workflow` call, whose structured result names its task,
143
- * or a call that a live task names as its tool use, such as a
144
- * backgrounded MCP call. The task must be in the level: one that ended
145
- * already leaves its call as it is. Claude Code marks every live-update
146
- * watcher `ambient`, including the task of a `Monitor` call; a call
147
- * started it, so it is work the client can see and stop, and is
148
- * registered all the same. Ambient tasks without a call of their own,
149
- * such as watchers Claude Code starts by itself, are never registered.
150
- *
151
- * Returns the ids of the registered calls, whose result then reports
152
- * `in_progress` (see `withRunningToolCall`).
153
- */
154
- toolResults(owner: BackgroundOwner, content: unknown, toolUseResult: unknown, toolUses: Record<string, {
155
- name: string;
156
- input: unknown;
157
- }>, parentToolUseId: string | null): Set<string>;
158
- /**
159
- * Starts reading the output of the background command `taskId` into its
160
- * terminal, when the client gets the lists and the Bash result named the
161
- * command's output file. `send` sends an update of the terminal's tool
162
- * call, routed as the call's other updates. Called once the Bash result's
163
- * own updates are sent: the first output replaces the placeholder that they
164
- * gave the terminal.
165
- */
166
- followOutput(taskId: string, send: Send): void;
167
- /**
168
- * The task `taskId` ended. Reads the rest of its command's output, then
169
- * exits its terminal, and gives a tool call whose task it was its final
170
- * status: `cancelled` for a task that Claude Code stopped, and `completed`
171
- * for one that ended without saying how, such as one that the level
172
- * dropped: it no longer runs, and reported no failure. Claude Code reports
173
- * no exit code for a command, and `completed` does not mean 0: Claude Code
174
- * accepts some non-zero codes as a success, such as grep's 1.
175
- */
176
- taskEnded(taskId: string, end: BackgroundTaskEnd, send: Send): Promise<void>;
177
- /**
178
- * The update that reports the background tool call of the task `taskId` as
179
- * `paused`, or as `in_progress` again, when `paused` changes it. Claude Code
180
- * pauses a workflow this way.
27
+ * The task `taskId` ended: exits its command's terminal, with no exit code.
28
+ * Claude Code reports no exit code for a command.
181
29
  */
182
- taskPaused(taskId: string, paused: boolean): AcpSessionNotification | undefined;
183
- /**
184
- * Updates an existing workflow card without changing its work state. A
185
- * report without `workflow` keeps the last phase and agent list.
186
- */
187
- taskProgress(taskId: string, progress: WorkflowCardProgress): AcpSessionNotification | undefined;
188
- /**
189
- * The latest progress of the workflow calls in `toolCallIds`.
190
- *
191
- * A task can report progress before its launch tool returns. Those fields
192
- * wait in the live task level and are sent after the launch result.
193
- */
194
- toolCallProgress(toolCallIds: ReadonlySet<string>): AcpSessionNotification[];
195
- /**
196
- * Takes Claude Code's new live background task set. The terminals and tool
197
- * calls whose tasks it no longer holds end first, before a list drops them,
198
- * as v2 requires. A terminal or tool call is registered at its tool result,
199
- * after its task joined the level, so a later level without the task means
200
- * that it ended. Claude Code usually sends a task's end before that level,
201
- * which ends them first, but the SDK does not promise that order.
202
- */
203
- levelChanged(tasks: LevelTask[], send: Send): Promise<void>;
204
- /**
205
- * The query closed: Claude Code's background tasks end with its process.
206
- * Stops reading output, and returns the updates that exit the root
207
- * session's terminals and cancel its tool calls. The level empties, so the
208
- * next lists are empty. A subagent's command or tool call is left as it
209
- * was: it is on the child's stream, which the closed query's routing owned.
210
- */
211
- queryClosed(): AcpSessionNotification[];
212
- /**
213
- * Starts a tool call for each live task that no terminal or tool call
214
- * stands for yet, and returns the `tool_call`s to send: v2 lists background work only by an entity
215
- * the client knows. Such a task is one that no tool call started, such as
216
- * one a hook started, or one whose tool call returned, with its final
217
- * status, before the task started. The call has the task's description as
218
- * its title, is `in_progress`, and ends with the task (see `taskEnded`). A
219
- * task that an announced subagent session runs gets its call on that
220
- * session's stream. Ambient tasks are housekeeping and get no call.
221
- *
222
- * The agent sends them before each list it publishes, so the call comes
223
- * before the first list that names it, as v2 requires.
224
- */
225
- adoptTasks(owner: BackgroundOwner): AcpSessionNotification[];
226
- /**
227
- * The `background` list of the root session and of each of its announced
228
- * subagent sessions, with what their repeated states need, deeper sessions
229
- * first and the root last: a child's own list goes out before its parent's
230
- * list drops it. Each list is empty while the level has not been reported:
231
- * Claude Code sends none before the first background task starts.
232
- */
233
- reports(owner: BackgroundOwner, rootState: WorkStateName): BackgroundReport[];
234
- /**
235
- * The current state of each background tool call in `toolCallIds`: the
236
- * call as `renderer` shows its tool use, with its status now (see
237
- * `ClaudeAcpAgent.publishBackgroundToolCalls`).
238
- */
239
- toolCallStates(toolCallIds: string[], renderer: AcpToolCallRenderer, cwd: string): AcpSessionNotification[];
240
- /**
241
- * The task of the terminal or tool call `target` that the session
242
- * `sessionId` lists, or undefined when it lists no such item.
243
- */
244
- listedTask(owner: BackgroundOwner, sessionId: string, target: BackgroundTarget): string | undefined;
30
+ taskEnded(taskId: string, send: Send): Promise<void>;
245
31
  }
246
32
  type Send = (notification: AcpSessionNotification) => Promise<void>;
247
- /** A terminal or tool call that `terminal/cancel` or `tool_call/cancel` names. */
248
- export type BackgroundTarget = {
249
- terminalId: string;
250
- } | {
251
- toolCallId: string;
252
- };
253
- /**
254
- * Stops the task of a terminal or tool call that the session `sessionId`
255
- * lists (v2 `terminal/cancel` and `tool_call/cancel`). `sessions` are the
256
- * root sessions: a subagent session's list is built with its root's. The
257
- * terminal exits, or the tool call gets its final status, when Claude Code
258
- * reports the task stopped.
259
- */
260
- export declare function cancelBackgroundWork(sessions: Array<BackgroundOwner & {
261
- background?: SessionBackgroundWork;
262
- }>, sessionId: string, target: BackgroundTarget): Promise<void>;
263
- /**
264
- * Publishes the lists of each session that reports them, each time one
265
- * changes. The sink sends them to the client synchronously, so a list follows
266
- * the updates sent before it.
267
- */
268
- export declare class BackgroundWorkReporter {
269
- private readonly sink?;
270
- /** The list last published for each session, as JSON, and the root session it is built with. */
271
- private readonly published;
272
- constructor(sink?: BackgroundSink | undefined);
273
- /** Whether the lists are reported at all. */
274
- get enabled(): boolean;
275
- /**
276
- * Publishes each list of the root session `rootSessionId` that changed. The
277
- * first call for a session publishes its list, also when it is empty.
278
- * `rootState` is the root session's state now.
279
- */
280
- sync(rootSessionId: string, session: BackgroundOwner & {
281
- background?: SessionBackgroundWork;
282
- }, rootState: WorkStateName): void;
283
- /** The root session `rootSessionId` ended, and its subagent sessions with it. */
284
- forget(rootSessionId: string): void;
285
- }
286
33
  export {};
287
34
  //# sourceMappingURL=background-work.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"background-work.d.ts","sourceRoot":"","sources":["../src/background-work.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,mBAAmB,EAA2B,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAyB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,wBAAwB,CAAC;AAGrF,sCAAsC;AACtC,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,WAAW,C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