@abacus-ai/cli 2.0.0-canary.1 → 2.0.0-canary.11

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 (198) hide show
  1. package/README.md +25 -0
  2. package/dist/index.mjs +466 -438
  3. package/package.json +4 -1
  4. package/.oxlintrc.json +0 -8
  5. package/resources/abacus.ico +0 -0
  6. package/resources/entitlements.plist +0 -9
  7. package/src/__e2e__/README.md +0 -196
  8. package/src/__e2e__/agent-interactions.e2e.test.tsx +0 -61
  9. package/src/__e2e__/cli-commands.e2e.test.tsx +0 -77
  10. package/src/__e2e__/conversation-throttle.e2e.test.ts +0 -453
  11. package/src/__e2e__/conversation.e2e.test.tsx +0 -56
  12. package/src/__e2e__/diff-preview.e2e.test.tsx +0 -3399
  13. package/src/__e2e__/file-creation.e2e.test.tsx +0 -149
  14. package/src/__e2e__/helpers/test-helpers.ts +0 -449
  15. package/src/__e2e__/keyboard-navigation.e2e.test.tsx +0 -34
  16. package/src/__e2e__/llm-models.e2e.test.ts +0 -402
  17. package/src/__e2e__/mcp/mcp-callback-flow.e2e.test.tsx +0 -71
  18. package/src/__e2e__/mcp/mcp-full-app-ui.e2e.test.tsx +0 -167
  19. package/src/__e2e__/mcp/mcp-ui-rendering.e2e.test.tsx +0 -185
  20. package/src/__e2e__/repl.e2e.test.tsx +0 -78
  21. package/src/__e2e__/shell-compatibility.e2e.test.tsx +0 -76
  22. package/src/__e2e__/theme-mcp.e2e.test.tsx +0 -98
  23. package/src/__e2e__/tool-permissions.e2e.test.tsx +0 -66
  24. package/src/args.ts +0 -22
  25. package/src/components/__tests__/react-compiler.test.tsx +0 -78
  26. package/src/components/__tests__/status-indicator.test.tsx +0 -403
  27. package/src/components/composer/__tests__/bash-runner.test.tsx +0 -263
  28. package/src/components/composer/agent-mode-indicator.tsx +0 -63
  29. package/src/components/composer/bash-runner.tsx +0 -54
  30. package/src/components/composer/commands/default-commands.tsx +0 -615
  31. package/src/components/composer/commands/handler.tsx +0 -59
  32. package/src/components/composer/commands/picker.tsx +0 -273
  33. package/src/components/composer/commands/registry.ts +0 -233
  34. package/src/components/composer/commands/types.ts +0 -33
  35. package/src/components/composer/context.tsx +0 -88
  36. package/src/components/composer/file-mention-picker.tsx +0 -83
  37. package/src/components/composer/help.tsx +0 -44
  38. package/src/components/composer/index.tsx +0 -1007
  39. package/src/components/composer/mentions.ts +0 -57
  40. package/src/components/composer/message-queue.tsx +0 -70
  41. package/src/components/composer/mode-panel.tsx +0 -35
  42. package/src/components/composer/modes/__tests__/bash-handler.test.tsx +0 -755
  43. package/src/components/composer/modes/__tests__/bash-renderer.test.tsx +0 -1108
  44. package/src/components/composer/modes/bash-handler.tsx +0 -132
  45. package/src/components/composer/modes/bash-renderer.tsx +0 -175
  46. package/src/components/composer/modes/default-handlers.tsx +0 -33
  47. package/src/components/composer/modes/index.ts +0 -41
  48. package/src/components/composer/modes/types.ts +0 -21
  49. package/src/components/composer/persistent-shell.ts +0 -283
  50. package/src/components/composer/process.ts +0 -65
  51. package/src/components/composer/types.ts +0 -9
  52. package/src/components/composer/use-mention-search.ts +0 -68
  53. package/src/components/error-boundry.tsx +0 -60
  54. package/src/components/exit-message.tsx +0 -29
  55. package/src/components/expanded-view.tsx +0 -74
  56. package/src/components/file-completion.tsx +0 -127
  57. package/src/components/header.tsx +0 -47
  58. package/src/components/logo.tsx +0 -37
  59. package/src/components/segments.tsx +0 -356
  60. package/src/components/status-indicator.tsx +0 -306
  61. package/src/components/tool-group-summary.tsx +0 -263
  62. package/src/components/tool-permissions/ask-user-question-permission-ui.tsx +0 -319
  63. package/src/components/tool-permissions/diff-preview.tsx +0 -359
  64. package/src/components/tool-permissions/index.ts +0 -5
  65. package/src/components/tool-permissions/permission-options.tsx +0 -401
  66. package/src/components/tool-permissions/permission-preview-header.tsx +0 -57
  67. package/src/components/tool-permissions/tool-permission-ui.tsx +0 -420
  68. package/src/components/tools/agent/ask-user-question.tsx +0 -107
  69. package/src/components/tools/agent/enter-plan-mode.tsx +0 -55
  70. package/src/components/tools/agent/exit-plan-mode.tsx +0 -83
  71. package/src/components/tools/agent/handoff-to-main.tsx +0 -27
  72. package/src/components/tools/agent/subagent.tsx +0 -37
  73. package/src/components/tools/agent/todo-write.tsx +0 -104
  74. package/src/components/tools/browser/close-tab.tsx +0 -58
  75. package/src/components/tools/browser/computer.tsx +0 -70
  76. package/src/components/tools/browser/get-interactive-elements.tsx +0 -54
  77. package/src/components/tools/browser/get-tab-content.tsx +0 -51
  78. package/src/components/tools/browser/navigate-to.tsx +0 -59
  79. package/src/components/tools/browser/new-tab.tsx +0 -60
  80. package/src/components/tools/browser/perform-action.tsx +0 -63
  81. package/src/components/tools/browser/refresh-tab.tsx +0 -43
  82. package/src/components/tools/browser/switch-tab.tsx +0 -58
  83. package/src/components/tools/filesystem/delete-file.tsx +0 -104
  84. package/src/components/tools/filesystem/edit.tsx +0 -220
  85. package/src/components/tools/filesystem/list-dir.tsx +0 -78
  86. package/src/components/tools/filesystem/read-file.tsx +0 -180
  87. package/src/components/tools/filesystem/upload-image.tsx +0 -76
  88. package/src/components/tools/ide/ide-diagnostics.tsx +0 -62
  89. package/src/components/tools/index.ts +0 -91
  90. package/src/components/tools/mcp/mcp-tool.tsx +0 -158
  91. package/src/components/tools/search/fetch-url.tsx +0 -73
  92. package/src/components/tools/search/file-search.tsx +0 -78
  93. package/src/components/tools/search/grep.tsx +0 -90
  94. package/src/components/tools/search/semantic-search.tsx +0 -66
  95. package/src/components/tools/search/web-search.tsx +0 -71
  96. package/src/components/tools/shared/index.tsx +0 -48
  97. package/src/components/tools/shared/zod-coercion.ts +0 -35
  98. package/src/components/tools/terminal/bash-tool-output.tsx +0 -188
  99. package/src/components/tools/terminal/get-terminal-output.tsx +0 -91
  100. package/src/components/tools/terminal/run-in-terminal.tsx +0 -131
  101. package/src/components/tools/types.ts +0 -16
  102. package/src/components/tools.tsx +0 -68
  103. package/src/components/ui/__tests__/divider.test.tsx +0 -61
  104. package/src/components/ui/__tests__/gradient.test.tsx +0 -125
  105. package/src/components/ui/__tests__/input.test.tsx +0 -166
  106. package/src/components/ui/__tests__/select.test.tsx +0 -273
  107. package/src/components/ui/__tests__/shimmer.test.tsx +0 -99
  108. package/src/components/ui/blinking-indicator.tsx +0 -27
  109. package/src/components/ui/divider.tsx +0 -162
  110. package/src/components/ui/gradient.tsx +0 -56
  111. package/src/components/ui/input.tsx +0 -228
  112. package/src/components/ui/select.tsx +0 -151
  113. package/src/components/ui/shimmer.tsx +0 -76
  114. package/src/context/agent-mode.tsx +0 -95
  115. package/src/context/extension-file.tsx +0 -136
  116. package/src/context/network-activity.tsx +0 -45
  117. package/src/context/notification.tsx +0 -62
  118. package/src/context/shell-size.tsx +0 -49
  119. package/src/context/shell-title.tsx +0 -38
  120. package/src/entrypoints/print-mode.ts +0 -312
  121. package/src/entrypoints/repl.tsx +0 -389
  122. package/src/hooks/use-agent.ts +0 -15
  123. package/src/hooks/use-api-client.ts +0 -1
  124. package/src/hooks/use-available-height.ts +0 -8
  125. package/src/hooks/use-cleanup.ts +0 -29
  126. package/src/hooks/use-interrupt-manager.ts +0 -242
  127. package/src/hooks/use-models.ts +0 -22
  128. package/src/index.ts +0 -217
  129. package/src/lib/__tests__/ansi.test.ts +0 -255
  130. package/src/lib/__tests__/cli.test.ts +0 -122
  131. package/src/lib/__tests__/commands.test.ts +0 -325
  132. package/src/lib/__tests__/constants.test.ts +0 -15
  133. package/src/lib/__tests__/focusables.test.ts +0 -25
  134. package/src/lib/__tests__/fs.test.ts +0 -231
  135. package/src/lib/__tests__/markdown.test.tsx +0 -348
  136. package/src/lib/__tests__/mcpCommandHandler.test.ts +0 -173
  137. package/src/lib/__tests__/mcpManagement.test.ts +0 -38
  138. package/src/lib/__tests__/path-paste.test.ts +0 -144
  139. package/src/lib/__tests__/path.test.ts +0 -300
  140. package/src/lib/__tests__/queries.test.ts +0 -39
  141. package/src/lib/__tests__/standaloneMcpService.test.ts +0 -71
  142. package/src/lib/__tests__/text-buffer.test.ts +0 -328
  143. package/src/lib/__tests__/text-utils.test.ts +0 -32
  144. package/src/lib/__tests__/timing.test.ts +0 -78
  145. package/src/lib/__tests__/utils.test.ts +0 -238
  146. package/src/lib/__tests__/vim-buffer-actions.test.ts +0 -154
  147. package/src/lib/ansi.ts +0 -150
  148. package/src/lib/cli-push-server.ts +0 -112
  149. package/src/lib/cli.ts +0 -44
  150. package/src/lib/clipboard.ts +0 -226
  151. package/src/lib/command-utils.ts +0 -93
  152. package/src/lib/commands.ts +0 -270
  153. package/src/lib/constants.ts +0 -3
  154. package/src/lib/extension-connection.ts +0 -181
  155. package/src/lib/focusables.ts +0 -7
  156. package/src/lib/fs.ts +0 -533
  157. package/src/lib/markdown/code-block.tsx +0 -63
  158. package/src/lib/markdown/index.ts +0 -4
  159. package/src/lib/markdown/link.tsx +0 -19
  160. package/src/lib/markdown/markdown.tsx +0 -372
  161. package/src/lib/markdown/types.ts +0 -15
  162. package/src/lib/mcpCommandHandler.ts +0 -121
  163. package/src/lib/mcpManagement.ts +0 -44
  164. package/src/lib/path-paste.ts +0 -185
  165. package/src/lib/path.ts +0 -179
  166. package/src/lib/queries.ts +0 -15
  167. package/src/lib/standaloneMcpService.ts +0 -688
  168. package/src/lib/status-utils.ts +0 -237
  169. package/src/lib/test-utils.tsx +0 -72
  170. package/src/lib/text-buffer.ts +0 -2415
  171. package/src/lib/text-utils.ts +0 -272
  172. package/src/lib/timing.ts +0 -63
  173. package/src/lib/types.ts +0 -295
  174. package/src/lib/utils.ts +0 -182
  175. package/src/lib/vim-buffer-actions.ts +0 -732
  176. package/src/providers/agent.tsx +0 -1063
  177. package/src/providers/api-client.tsx +0 -43
  178. package/src/services/logger.ts +0 -85
  179. package/src/terminal/detection.ts +0 -187
  180. package/src/terminal/exit.ts +0 -279
  181. package/src/terminal/notification.ts +0 -83
  182. package/src/terminal/progress.ts +0 -201
  183. package/src/terminal/setup.ts +0 -797
  184. package/src/terminal/types.ts +0 -51
  185. package/src/theme/context.tsx +0 -57
  186. package/src/theme/index.ts +0 -4
  187. package/src/theme/themed.tsx +0 -35
  188. package/src/theme/themes.json +0 -546
  189. package/src/theme/types.ts +0 -110
  190. package/src/tools/types.ts +0 -59
  191. package/src/tools/utils/__tests__/zod-coercion.test.ts +0 -33
  192. package/src/tools/utils/tool-ui-components.tsx +0 -649
  193. package/src/tools/utils/zod-coercion.ts +0 -35
  194. package/tsconfig.json +0 -16
  195. package/tsconfig.node.json +0 -29
  196. package/tsconfig.test.json +0 -27
  197. package/tsdown.config.ts +0 -17
  198. package/vitest.config.ts +0 -76
@@ -1,1063 +0,0 @@
1
- import type { AbacusClient, ToolUseResult } from "@codellm/api";
2
-
3
- import {
4
- AgentMode,
5
- AgentStatus,
6
- AgentSession,
7
- CallbackPermissionProvider,
8
- type ConversationSegment,
9
- type Diagnostic,
10
- type McpManager,
11
- type PermissionRequest,
12
- type PermissionDecision,
13
- type ToolDisplayData,
14
- type ParsedToolResult,
15
- } from "@codellm/agent";
16
- import { AuthExpiredError, NetworkError } from "@codellm/api";
17
- import {
18
- createContext,
19
- memo,
20
- useCallback,
21
- useEffect,
22
- useMemo,
23
- useReducer,
24
- useRef,
25
- useState,
26
- useTransition,
27
- } from "react";
28
-
29
- import type { AgentArgs } from "../args.js";
30
- import type { FileAttachment, HistorySegment } from "../lib/types.js";
31
-
32
- import { useAgentMode } from "../context/agent-mode.js";
33
- import { useExtensionFile } from "../context/extension-file.js";
34
- import { useNetworkActivity } from "../context/network-activity.js";
35
- import { useNotification } from "../context/notification.js";
36
- import { useApiClient } from "../providers/api-client.js";
37
- import { showProgress, hideProgress } from "../terminal/progress.js";
38
-
39
- export { AgentMode, AgentStatus };
40
-
41
- // Re-export permission decision types for permission-options.tsx compatibility
42
- export type ToolPermissionDecision = "accept" | "reject" | "background" | "allowAlways";
43
-
44
- export interface ToolPermissionResult {
45
- decision: ToolPermissionDecision;
46
- userMessage?: string;
47
- }
48
-
49
- /** Permission pending in the UI — uses SDK's PermissionRequest directly */
50
- export interface PendingToolPermission {
51
- request: PermissionRequest;
52
- resolve: (decision: PermissionDecision) => void;
53
- }
54
-
55
- export interface RetryState {
56
- attempt: number;
57
- maxAttempts: number;
58
- delayMs: number;
59
- isNetworkError: boolean;
60
- }
61
-
62
- export interface AgentContextValue {
63
- conversationId: string | null;
64
- conversationTitle: string | null;
65
- segments: HistorySegment[];
66
- segmentsLength: number;
67
- sendMessage: (options: {
68
- message: string;
69
- selectedModel?: string;
70
- fileAttachments?: FileAttachment[];
71
- }) => Promise<void>;
72
- stop: () => void;
73
- rejectPendingPermission: () => void;
74
- agentStatus: AgentStatus;
75
- clearSegments: () => void;
76
- clearSegmentsOnly: () => void;
77
- clearTempSegments: () => void;
78
- loadConversation: (id: string) => Promise<void>;
79
- addNotification: (
80
- message: string,
81
- severity?: "info" | "warning" | "error",
82
- temp?: boolean,
83
- ) => void;
84
- mcp: McpManager;
85
- addAllowedDirectory: (dirPath: string) => void;
86
- pendingToolPermission: PendingToolPermission | null;
87
- refreshMcpTools: (skipReload?: boolean, showNotification?: boolean) => Promise<void>;
88
- isPendingSegmentUpdate: boolean;
89
- queuedMessages: string[];
90
- addToQueue: (message: string) => void;
91
- removeFirstFromQueue: () => void;
92
- clearQueue: () => void;
93
- /** First queued message drained when the agent was manually stopped — the composer
94
- * should restore this into the input buffer and then call clearDequeuedOnStop(). */
95
- dequeuedOnStop: string | null;
96
- clearDequeuedOnStop: () => void;
97
- /** @deprecated use agentStatus directly */
98
- activeToolOutputs: Record<string, string>;
99
- retryState: RetryState | null;
100
- networkOnline: boolean;
101
- }
102
-
103
- export const AgentContext = createContext<AgentContextValue | null>(null);
104
-
105
- // ---------------------------------------------------------------------------
106
- // Segment reducer
107
- // ---------------------------------------------------------------------------
108
- type SegmentAction =
109
- | { type: "INIT_SEND"; userSeg: HistorySegment; spinnySeg: HistorySegment }
110
- | { type: "TEXT_DELTA"; segId: string; content: string }
111
- | { type: "THINKING_DELTA"; segId: string; content: string; startTime: number }
112
- | { type: "THINKING_COMPLETE"; segId: string; endTime: number }
113
- | { type: "TOOL_DISPLAY_DATA"; toolCallId: string; data: Partial<ToolDisplayData> }
114
- | {
115
- type: "TOOL_REQUESTED";
116
- toolCallId: string;
117
- textSegId: string | null;
118
- toolSeg: HistorySegment;
119
- }
120
- | {
121
- type: "TOOL_EXECUTION_COMPLETE";
122
- toolCallId: string;
123
- rawResult: ToolUseResult;
124
- parsedResult?: ParsedToolResult;
125
- spinnySeg: HistorySegment;
126
- }
127
- | { type: "TOOL_USER_MESSAGE"; seg: HistorySegment }
128
- | { type: "TEXT_COMPLETED"; segId: string }
129
- | { type: "FINALIZE"; textSegId: string | null }
130
- | { type: "ADD_NOTIFICATION"; seg: HistorySegment }
131
- | { type: "ERROR"; errorSeg: HistorySegment }
132
- | { type: "REMOVE_USER_SEG"; userSegId: string }
133
- | { type: "CLEAR" }
134
- | { type: "LOAD"; segments: HistorySegment[] }
135
- | { type: "REMOVE_TEMP" };
136
-
137
- function segmentsReducer(prev: HistorySegment[], action: SegmentAction): HistorySegment[] {
138
- switch (action.type) {
139
- case "INIT_SEND":
140
- // Remove temp segments, add user message and spinny placeholder
141
- return [...prev.filter((s) => s.temp !== true), action.userSeg, action.spinnySeg];
142
-
143
- case "TEXT_DELTA": {
144
- const { segId, content } = action;
145
- const base = prev.map((s) =>
146
- s.type === "code_llm_tool_call" && s.status === "transient" && !s.toolUseResult
147
- ? {
148
- ...s,
149
- status: "completed" as const,
150
- parsedResult: {
151
- phase: "error" as const,
152
- toolType: Array.isArray(s.toolUseRequest)
153
- ? (s.toolUseRequest[0]?.name ?? "")
154
- : (s.toolUseRequest?.name ?? ""),
155
- data: {},
156
- summary: "",
157
- },
158
- }
159
- : s,
160
- );
161
- const withoutSpinny = base.filter((s) => !s.isSpinny);
162
- const existing = withoutSpinny.find((s) => s.id === segId);
163
- if (existing) {
164
- return withoutSpinny.map((s) =>
165
- s.id === segId ? { ...s, segment: ((s.segment as string) || "") + content } : s,
166
- );
167
- }
168
- return [
169
- ...withoutSpinny,
170
- {
171
- id: segId,
172
- status: "transient",
173
- source: "bot",
174
- type: "text",
175
- segment: content,
176
- } as HistorySegment,
177
- ];
178
- }
179
-
180
- case "THINKING_DELTA": {
181
- const { segId, content, startTime } = action;
182
- const existing = prev.find((s) => s.id === segId);
183
- if (existing) {
184
- return prev.map((s) =>
185
- s.id === segId ? { ...s, segment: ((s.segment as string) || "") + content } : s,
186
- );
187
- }
188
- return [
189
- ...prev,
190
- {
191
- id: segId,
192
- status: "transient",
193
- source: "bot",
194
- type: "thinking",
195
- isSpinny: true,
196
- segment: content,
197
- thinkingStartTime: startTime,
198
- } as HistorySegment,
199
- ];
200
- }
201
-
202
- case "THINKING_COMPLETE":
203
- return prev.map((s) =>
204
- s.id === action.segId
205
- ? { ...s, status: "completed", isSpinny: false, thinkingEndTime: action.endTime }
206
- : s,
207
- );
208
-
209
- case "TOOL_DISPLAY_DATA":
210
- return prev.map((s) =>
211
- s.id === action.toolCallId
212
- ? { ...s, toolDisplayData: { ...s.toolDisplayData, ...action.data } }
213
- : s,
214
- );
215
-
216
- case "TOOL_REQUESTED": {
217
- const { textSegId, toolSeg } = action;
218
- let withoutSpinny: HistorySegment[];
219
- if (textSegId) {
220
- withoutSpinny = prev
221
- .filter((s) => !s.isSpinny)
222
- .map((s) => (s.id === textSegId ? { ...s, status: "completed" as const } : s));
223
- } else {
224
- withoutSpinny = prev.filter((s) => !s.isSpinny);
225
- }
226
- return [...withoutSpinny, toolSeg];
227
- }
228
-
229
- case "TOOL_EXECUTION_COMPLETE": {
230
- const { toolCallId, rawResult, parsedResult, spinnySeg } = action;
231
- const updated = prev.map((s) =>
232
- s.id === toolCallId
233
- ? {
234
- ...s,
235
- status: "completed" as const,
236
- toolUseResult: rawResult,
237
- ...(parsedResult !== undefined && { parsedResult }),
238
- }
239
- : s,
240
- );
241
- return [...updated, spinnySeg];
242
- }
243
-
244
- case "TOOL_USER_MESSAGE":
245
- return [...prev, action.seg];
246
-
247
- case "TEXT_COMPLETED":
248
- return prev.map((s) => (s.id === action.segId ? { ...s, status: "completed" as const } : s));
249
-
250
- case "FINALIZE": {
251
- // Mark transient text segment as completed (if any), then remove all spinny segments
252
- let result = prev;
253
- if (action.textSegId) {
254
- result = result.map((s) =>
255
- s.id === action.textSegId ? { ...s, status: "completed" as const } : s,
256
- );
257
- }
258
- return result.filter((s) => !s.isSpinny);
259
- }
260
-
261
- case "ADD_NOTIFICATION": {
262
- const seg = action.seg;
263
- // Deduplicate: if the last segment is a notification with the same message, flash it instead
264
- const last = prev[prev.length - 1];
265
- if (
266
- last &&
267
- last.type === "code_llm_notification" &&
268
- last.message === seg.message &&
269
- last.severity === seg.severity
270
- ) {
271
- const updated = [...prev];
272
- updated[updated.length - 1] = {
273
- ...last,
274
- flashKey: (last.flashKey ?? 0) + 1,
275
- };
276
- return updated;
277
- }
278
- return [...prev, seg];
279
- }
280
-
281
- case "ERROR":
282
- return [...prev.filter((s) => !s.isSpinny), action.errorSeg];
283
-
284
- case "REMOVE_USER_SEG":
285
- return prev.filter((s) => s.id !== action.userSegId);
286
-
287
- case "CLEAR":
288
- return [];
289
-
290
- case "LOAD":
291
- return action.segments;
292
-
293
- case "REMOVE_TEMP":
294
- if (!prev.some((s) => s.temp === true)) return prev;
295
- return prev.filter((s) => s.temp !== true);
296
-
297
- default:
298
- return prev;
299
- }
300
- }
301
-
302
- interface AgentProviderProps extends React.PropsWithChildren {
303
- apiClient: AbacusClient;
304
- agentArgs?: AgentArgs;
305
- }
306
-
307
- // ---------------------------------------------------------------------------
308
- // Bridge: ConversationSegment → HistorySegment (temporary until CLI fully adopts ConversationSegment)
309
- // ---------------------------------------------------------------------------
310
- function conversationSegmentToHistory(seg: ConversationSegment): HistorySegment {
311
- switch (seg.type) {
312
- case "text":
313
- return {
314
- id: seg.id,
315
- status: "completed",
316
- source: seg.source,
317
- type: "text",
318
- segment: seg.content,
319
- };
320
- case "thinking":
321
- return {
322
- id: seg.id,
323
- status: "completed",
324
- source: "bot",
325
- type: "thinking",
326
- segment: seg.content,
327
- isSpinny: seg.isSpinny,
328
- ...(seg.title !== undefined && { title: seg.title }),
329
- };
330
- case "tool_call":
331
- return {
332
- id: seg.id,
333
- status: "completed",
334
- source: "bot",
335
- type: "code_llm_tool_call",
336
- toolUseRequest: seg.toolUseRequest,
337
- toolUseResult: seg.toolUseResult ?? {
338
- id: seg.toolUseRequest.id,
339
- content: " ",
340
- },
341
- ...(seg.parsedResult !== undefined && { parsedResult: seg.parsedResult }),
342
- ...(seg.toolDisplayData !== undefined && { toolDisplayData: seg.toolDisplayData }),
343
- };
344
- case "notification":
345
- return {
346
- id: seg.id,
347
- status: "completed",
348
- source: "bot",
349
- type: "code_llm_notification",
350
- message: seg.message,
351
- severity: seg.severity,
352
- ...(seg.actions !== undefined && { actions: seg.actions }),
353
- };
354
- case "tool_group":
355
- // Flatten tool groups — each tool becomes its own segment
356
- // The first tool carries the group info
357
- return {
358
- id: seg.id,
359
- status: "completed",
360
- source: "bot",
361
- type: "text",
362
- segment: seg.summary,
363
- };
364
- }
365
- }
366
-
367
- export const AgentProvider = memo(({ children, apiClient, agentArgs }: AgentProviderProps) => {
368
- const [isPendingSegmentUpdate, startSegmentTransition] = useTransition();
369
- const { agentMode, setAgentMode } = useAgentMode();
370
- const agentModeRef = useRef(agentMode);
371
- const { notifyActionRequired, notifyTaskComplete } = useNotification();
372
- const { startUpload, startDownload, stopActivity } = useNetworkActivity();
373
- const { authManager, setAuthExpired } = useApiClient();
374
-
375
- const { connection, pushServer } = useExtensionFile();
376
- const connectionRef = useRef(connection);
377
- const pushServerRef = useRef(pushServer);
378
- useEffect(() => {
379
- connectionRef.current = connection;
380
- }, [connection]);
381
- useEffect(() => {
382
- pushServerRef.current = pushServer;
383
- }, [pushServer]);
384
-
385
- const [agentStatus, setAgentStatus] = useState<AgentStatus>(AgentStatus.Idle);
386
- const [segments, dispatchSegments] = useReducer(segmentsReducer, []);
387
- const displayDataMapRef = useRef<Map<string, ToolDisplayData>>(new Map());
388
- const [conversationTitle, setConversationTitle] = useState<string | null>(null);
389
- const [pendingToolPermission, setPendingToolPermission] = useState<PendingToolPermission | null>(
390
- null,
391
- );
392
- const [queuedMessages, setQueuedMessages] = useState<string[]>([]);
393
- const [dequeuedOnStop, setDequeuedOnStop] = useState<string | null>(null);
394
- const [retryState, setRetryState] = useState<RetryState | null>(null);
395
- const [networkOnline, setNetworkOnline] = useState(true);
396
-
397
- // activeToolOutputs kept for BashToolOutput compatibility
398
- const activeToolOutputs: Record<string, string> = {};
399
-
400
- const conversationIdRef = useRef<string | null>(null);
401
-
402
- const cwd = process.cwd();
403
-
404
- const permissionProvider = useMemo(() => {
405
- return new CallbackPermissionProvider(
406
- async (req: PermissionRequest): Promise<PermissionDecision> => {
407
- const conn = connectionRef.current;
408
- let permissionReq: PermissionRequest = req;
409
- let editorDiffFilePath: string | null = null;
410
-
411
- // For edit tool with VS Code connection: show diff in VS Code
412
- if (conn && pushServerRef.current && req.type === "edit_file") {
413
- const toolId = req.tool.id;
414
- const displayData = displayDataMapRef.current.get(toolId);
415
- const input = req.tool.input as Record<string, unknown>;
416
- const filePath = String(input.targetFile ?? req.filePath ?? "");
417
- const originalContent = displayData?.originalContent ?? req.originalContent ?? "";
418
- const newContent =
419
- displayData?.newContent ?? req.newContent ?? String(input.codeEdit ?? "");
420
-
421
- if (filePath && (originalContent || newContent)) {
422
- const shown = await conn.showDiff({
423
- filePath,
424
- originalContent,
425
- modifiedContent: newContent,
426
- toolId,
427
- });
428
- if (shown) {
429
- permissionReq = { ...req, diffShownInEditor: true };
430
- editorDiffFilePath = filePath;
431
- }
432
- }
433
- }
434
-
435
- // For exit_plan_mode with VS Code connection: open plan in VS Code, wait for decision
436
- if (conn && pushServerRef.current && req.type === "exit_plan_mode") {
437
- const toolId = req.tool.id;
438
- const shown = await conn.showToolView({
439
- filePath: req.planFilePath,
440
- toolKey: toolId,
441
- });
442
- if (shown) {
443
- const decision = await pushServerRef.current.waitForDecision(toolId);
444
- return decision === "allowAlways" ? "allowAlways" : decision;
445
- }
446
- }
447
-
448
- // Fallback: show CLI permission UI
449
- const decision = await new Promise<PermissionDecision>((resolve) => {
450
- setPendingToolPermission({
451
- request: permissionReq,
452
- resolve: (decision) => {
453
- setPendingToolPermission(null);
454
- const isAccept =
455
- decision === "accept" ||
456
- decision === "allowAlways" ||
457
- (typeof decision === "object" && decision.type === "accept_with_message") ||
458
- (typeof decision === "object" && decision.type === "question_answers");
459
- setAgentStatus(isAccept ? AgentStatus.ExecutingTool : AgentStatus.Submitted);
460
- resolve(decision);
461
- },
462
- });
463
- setAgentStatus(AgentStatus.WaitingForToolPermission);
464
- void notifyActionRequired("Abacus.AI is waiting for your input");
465
- });
466
-
467
- if (editorDiffFilePath && conn) {
468
- const isReject =
469
- decision === "reject" ||
470
- (typeof decision === "object" && decision.type === "reject_with_message");
471
- conn
472
- .notifyDiffDecision({
473
- targetFile: editorDiffFilePath,
474
- decision: isReject ? "reject" : "accept",
475
- })
476
- .catch(() => {});
477
- }
478
-
479
- return decision;
480
- },
481
- );
482
- }, [notifyActionRequired]);
483
-
484
- const sessionRef = useRef<AgentSession | null>(null);
485
-
486
- function createSession(): AgentSession {
487
- return new AgentSession({
488
- allowedDirectories: [cwd],
489
- primaryWorkspace: cwd,
490
- apiClient,
491
- mode: agentModeRef.current,
492
- permissionProvider,
493
- diagnosticsProvider: {
494
- getDiagnostics: async (files?: string[]): Promise<Diagnostic[]> => {
495
- const conn = connectionRef.current;
496
- if (!conn) return [];
497
- return conn.getDiagnostics(files) as Promise<Diagnostic[]>;
498
- },
499
- },
500
- });
501
- }
502
-
503
- if (!sessionRef.current) {
504
- sessionRef.current = createSession();
505
- }
506
-
507
- const session = sessionRef.current;
508
-
509
- useEffect(() => {
510
- agentModeRef.current = agentMode;
511
- session.setMode(agentMode);
512
- }, [agentMode, session]);
513
-
514
- useEffect(() => {
515
- if (agentArgs?.conversationId) {
516
- void loadConversation(agentArgs.conversationId);
517
- }
518
- // eslint-disable-next-line react-hooks/exhaustive-deps
519
- }, []);
520
-
521
- // Progress indicator side effects
522
- useEffect(() => {
523
- switch (agentStatus) {
524
- case AgentStatus.Submitted:
525
- case AgentStatus.Streaming:
526
- showProgress({ state: "indeterminate", label: "Processing" });
527
- break;
528
- case AgentStatus.ExecutingTool:
529
- showProgress({ state: "indeterminate", label: "Executing tools" });
530
- break;
531
- case AgentStatus.WaitingForToolPermission:
532
- hideProgress();
533
- break;
534
- case AgentStatus.Idle:
535
- hideProgress();
536
- break;
537
- }
538
- }, [agentStatus]);
539
-
540
- const addNotification = useCallback(
541
- (message: string, severity: "info" | "warning" | "error" = "info", temp = false) => {
542
- const seg: HistorySegment = {
543
- id: crypto.randomUUID(),
544
- status: "completed",
545
- source: "bot",
546
- type: "code_llm_notification",
547
- severity,
548
- message,
549
- temp,
550
- };
551
- dispatchSegments({ type: "ADD_NOTIFICATION", seg });
552
- },
553
- [],
554
- );
555
-
556
- const clearSegments = useCallback(() => {
557
- dispatchSegments({ type: "CLEAR" });
558
- setConversationTitle(null);
559
- setAgentStatus(AgentStatus.Idle);
560
- conversationIdRef.current = null;
561
- displayDataMapRef.current.clear();
562
- sessionRef.current = createSession();
563
- // eslint-disable-next-line react-hooks/exhaustive-deps
564
- }, [apiClient, cwd, permissionProvider]);
565
-
566
- const clearSegmentsOnly = useCallback(() => {
567
- dispatchSegments({ type: "CLEAR" });
568
- }, []);
569
-
570
- const clearTempSegments = useCallback(() => {
571
- dispatchSegments({ type: "REMOVE_TEMP" });
572
- }, []);
573
-
574
- const stop = useCallback(() => {
575
- const first = session.dequeue();
576
- session.clearQueue();
577
- setQueuedMessages([]);
578
- if (first !== null) {
579
- setDequeuedOnStop(first);
580
- }
581
- session.stop();
582
- setPendingToolPermission(null);
583
- setAgentStatus(AgentStatus.Idle);
584
- }, [session]);
585
-
586
- const rejectPendingPermission = useCallback(() => {
587
- if (pendingToolPermission) {
588
- pendingToolPermission.resolve("reject");
589
- }
590
- }, [pendingToolPermission]);
591
-
592
- const loadConversation = useCallback(
593
- async (id: string) => {
594
- setAgentStatus(AgentStatus.LoadingConversation);
595
- dispatchSegments({ type: "CLEAR" });
596
- setConversationTitle(null);
597
- conversationIdRef.current = id;
598
- try {
599
- const result = await session.loadConversation(id);
600
-
601
- if (result.title) {
602
- setConversationTitle(result.title);
603
- }
604
-
605
- if (result.segments.length > 0) {
606
- // Convert ConversationSegment[] to HistorySegment[] for existing CLI rendering
607
- dispatchSegments({
608
- type: "LOAD",
609
- segments: result.segments.map((seg) => conversationSegmentToHistory(seg)),
610
- });
611
- }
612
- } catch {
613
- addNotification("Failed to load conversation", "error");
614
- } finally {
615
- setAgentStatus(AgentStatus.Idle);
616
- }
617
- },
618
- [session, addNotification],
619
- );
620
-
621
- const refreshMcpTools = useCallback(
622
- async (_skipReload?: boolean, showNotification?: boolean) => {
623
- await session.mcp.refresh();
624
- if (showNotification) {
625
- addNotification("MCP tools refreshed", "info", true);
626
- }
627
- },
628
- [session, addNotification],
629
- );
630
-
631
- const sendMessage = useCallback(
632
- async ({
633
- message,
634
- selectedModel,
635
- fileAttachments,
636
- }: {
637
- message: string;
638
- selectedModel?: string;
639
- fileAttachments?: FileAttachment[];
640
- }) => {
641
- if (!message) return;
642
- if (agentStatus === AgentStatus.LoadingConversation) return;
643
-
644
- if (selectedModel) session.setModel(selectedModel);
645
-
646
- // Attach file content to message
647
- let fullMessage = message;
648
- if (fileAttachments && fileAttachments.length > 0) {
649
- const textAttachments = fileAttachments.filter((a) => !a.mimeType.startsWith("image/"));
650
- for (const attachment of textAttachments) {
651
- const content =
652
- typeof attachment.content === "string"
653
- ? attachment.content
654
- : attachment.content.toString("utf-8");
655
- fullMessage += `\n\n<file path="${attachment.filePath}">\n${content}\n</file>`;
656
- }
657
- }
658
-
659
- const userSegId = crypto.randomUUID();
660
- const userSeg: HistorySegment = {
661
- id: userSegId,
662
- status: "completed",
663
- source: "user",
664
- type: "text",
665
- segment: message,
666
- };
667
- const spinnySeg: HistorySegment = {
668
- id: crypto.randomUUID(),
669
- status: "transient",
670
- source: "bot",
671
- type: "collapsible_component",
672
- title: "Processing request",
673
- temp: true,
674
- isSpinny: true,
675
- };
676
- dispatchSegments({ type: "INIT_SEND", userSeg, spinnySeg });
677
-
678
- setAgentStatus(AgentStatus.Submitted);
679
- startUpload();
680
-
681
- let currentTextSegId: string | null = null;
682
- let currentThinkingSegId: string | null = null;
683
-
684
- let diagnosticIssues: string | undefined;
685
- const conn = connectionRef.current;
686
- const currentFile = conn?.getCurrentFile();
687
- const selectionRange = conn?.getSelectionRange();
688
- if (conn && currentFile) {
689
- try {
690
- const diags = (await conn.getDiagnostics([currentFile])) as Diagnostic[];
691
- const issues = diags.filter((d) => d.severity === "error" || d.severity === "warning");
692
- if (issues.length > 0) {
693
- diagnosticIssues = issues
694
- .map((d) => `${d.file}:${d.line}:${d.column} [${d.severity}] ${d.message}`)
695
- .join("\n");
696
- }
697
- } catch {
698
- // ignore diagnostics errors
699
- }
700
- }
701
-
702
- try {
703
- for await (const event of session.send(fullMessage, {
704
- diagnosticIssues,
705
- currentFile: currentFile ?? undefined,
706
- selectionStartLine: selectionRange?.startLine,
707
- selectionEndLine: selectionRange?.endLine,
708
- })) {
709
- switch (event.type) {
710
- case "text_delta": {
711
- setAgentStatus(AgentStatus.Streaming);
712
- stopActivity();
713
- startDownload();
714
-
715
- const content = event.content;
716
- if (!currentTextSegId) {
717
- currentTextSegId = crypto.randomUUID();
718
- }
719
- const segId = currentTextSegId;
720
- startSegmentTransition(() => {
721
- dispatchSegments({ type: "TEXT_DELTA", segId, content });
722
- });
723
- break;
724
- }
725
-
726
- case "thinking_delta": {
727
- const content = event.content;
728
- if (!currentThinkingSegId) {
729
- currentThinkingSegId = crypto.randomUUID();
730
- }
731
- const thinkSegId = currentThinkingSegId;
732
- const thinkStart = Date.now();
733
- startSegmentTransition(() => {
734
- dispatchSegments({
735
- type: "THINKING_DELTA",
736
- segId: thinkSegId,
737
- content,
738
- startTime: thinkStart,
739
- });
740
- });
741
- break;
742
- }
743
-
744
- case "thinking_complete": {
745
- if (currentThinkingSegId) {
746
- const segId = currentThinkingSegId;
747
- const endTime = Date.now();
748
- dispatchSegments({ type: "THINKING_COMPLETE", segId, endTime });
749
- currentThinkingSegId = null;
750
- }
751
- break;
752
- }
753
-
754
- case "tool_display_data": {
755
- const { toolCallId, data } = event;
756
- const current = displayDataMapRef.current.get(toolCallId) ?? {};
757
- displayDataMapRef.current.set(toolCallId, { ...current, ...data });
758
- // Update any already-existing segment for this toolCallId
759
- dispatchSegments({ type: "TOOL_DISPLAY_DATA", toolCallId, data });
760
- break;
761
- }
762
-
763
- case "tool_requested": {
764
- setAgentStatus(AgentStatus.ExecutingTool);
765
- stopActivity();
766
- startUpload();
767
-
768
- const toolCallId = event.tool.id;
769
- const toolSeg: HistorySegment = {
770
- id: toolCallId,
771
- status: "transient",
772
- source: "bot",
773
- type: "code_llm_tool_call",
774
- toolUseRequest: {
775
- id: toolCallId,
776
- name: event.tool.name,
777
- input: event.tool.input,
778
- },
779
- toolDisplayData: displayDataMapRef.current.get(toolCallId),
780
- } as HistorySegment;
781
- dispatchSegments({
782
- type: "TOOL_REQUESTED",
783
- toolCallId,
784
- textSegId: currentTextSegId,
785
- toolSeg,
786
- });
787
- currentTextSegId = null;
788
- break;
789
- }
790
-
791
- case "tool_execution_complete": {
792
- stopActivity();
793
- startDownload();
794
-
795
- const toolCallId = event.tool.id;
796
- const { parsedResult, ...rawResult } = event.result;
797
- const spinnySeg: HistorySegment = {
798
- id: crypto.randomUUID(),
799
- status: "transient",
800
- source: "bot",
801
- type: "collapsible_component",
802
- title: "Analyzing result",
803
- temp: true,
804
- isSpinny: true,
805
- } as HistorySegment;
806
- dispatchSegments({
807
- type: "TOOL_EXECUTION_COMPLETE",
808
- toolCallId,
809
- rawResult,
810
- ...(parsedResult !== undefined && { parsedResult }),
811
- spinnySeg,
812
- });
813
- currentTextSegId = null;
814
- break;
815
- }
816
-
817
- case "notification": {
818
- const notifSeg: HistorySegment = {
819
- id: crypto.randomUUID(),
820
- status: "completed",
821
- source: "bot",
822
- type: "code_llm_notification",
823
- severity: event.severity,
824
- message: event.message,
825
- ...(event.actions !== undefined && { actions: event.actions }),
826
- };
827
- dispatchSegments({ type: "ADD_NOTIFICATION", seg: notifSeg });
828
- break;
829
- }
830
-
831
- case "error": {
832
- const errorSeg: HistorySegment = {
833
- id: crypto.randomUUID(),
834
- status: "completed",
835
- source: "bot",
836
- type: "code_llm_notification",
837
- severity: "error",
838
- message: event.error.message,
839
- } as HistorySegment;
840
- dispatchSegments({ type: "ERROR", errorSeg });
841
- break;
842
- }
843
-
844
- case "mode_changed": {
845
- setAgentMode(event.mode);
846
- break;
847
- }
848
-
849
- case "tool_user_message": {
850
- const userMsgSeg: HistorySegment = {
851
- id: crypto.randomUUID(),
852
- status: "completed",
853
- source: "user",
854
- type: "text",
855
- segment: event.message,
856
- } as HistorySegment;
857
- dispatchSegments({ type: "TOOL_USER_MESSAGE", seg: userMsgSeg });
858
- break;
859
- }
860
-
861
- case "retry": {
862
- setRetryState({
863
- attempt: event.attempt,
864
- maxAttempts: event.maxAttempts,
865
- delayMs: event.delayMs,
866
- isNetworkError: event.isNetworkError,
867
- });
868
- break;
869
- }
870
-
871
- case "network_status": {
872
- setNetworkOnline(event.online);
873
- if (event.online) {
874
- setRetryState(null);
875
- }
876
- break;
877
- }
878
-
879
- case "user_message_dequeued": {
880
- // A queued user message is now being processed. Render it as a user
881
- // turn in the conversation, replacing the existing spinner with a
882
- // fresh one so the UI shows the correct turn structure.
883
- const dequeuedUserSeg: HistorySegment = {
884
- id: crypto.randomUUID(),
885
- status: "completed",
886
- source: "user",
887
- type: "text",
888
- segment: event.content,
889
- };
890
- const newSpinnySeg: HistorySegment = {
891
- id: crypto.randomUUID(),
892
- status: "transient",
893
- source: "bot",
894
- type: "collapsible_component",
895
- title: "Processing request",
896
- temp: true,
897
- isSpinny: true,
898
- };
899
- dispatchSegments({
900
- type: "INIT_SEND",
901
- userSeg: dequeuedUserSeg,
902
- spinnySeg: newSpinnySeg,
903
- });
904
- // The dequeued message is no longer in the queue; sync display state.
905
- setQueuedMessages(session.getQueue());
906
- // Reset so the next text_delta produces a fresh streaming segment.
907
- currentTextSegId = null;
908
- currentThinkingSegId = null;
909
- break;
910
- }
911
-
912
- case "turn_complete": {
913
- if (currentTextSegId) {
914
- const segId = currentTextSegId;
915
- dispatchSegments({ type: "TEXT_COMPLETED", segId });
916
- currentTextSegId = null;
917
- }
918
- // Sync React queue state in case AgentRunner consumed a queued message
919
- // inline (Anthropic/OpenAI path) — keeps the queue pill accurate.
920
- setQueuedMessages(session.getQueue());
921
- break;
922
- }
923
- }
924
- }
925
- } catch (err) {
926
- // Auth expired — trigger logout flow (unless env-based auth)
927
- if (err instanceof AuthExpiredError) {
928
- if (!authManager.isEnvAuth()) {
929
- setAuthExpired(true);
930
- void authManager.logout();
931
- }
932
- dispatchSegments({ type: "REMOVE_USER_SEG", userSegId });
933
- addNotification("Session expired — use /login to authenticate again.", "error");
934
- } else {
935
- const errorMessage =
936
- err instanceof NetworkError
937
- ? "Unable to connect to API"
938
- : err instanceof Error
939
- ? err.message
940
- : "An error occurred";
941
- dispatchSegments({ type: "REMOVE_USER_SEG", userSegId });
942
- addNotification(errorMessage, "error");
943
- }
944
-
945
- // Restore message to input buffer on error
946
- setDequeuedOnStop(fullMessage);
947
- // Clear the queue — messages won't be processed after a failure
948
- session.clearQueue();
949
- setQueuedMessages([]);
950
- } finally {
951
- stopActivity();
952
- setRetryState(null);
953
- // Finalize transient text segment and remove all spinny transient segments
954
- dispatchSegments({ type: "FINALIZE", textSegId: currentTextSegId });
955
- setAgentStatus(AgentStatus.Idle);
956
- void notifyTaskComplete("Abacus.AI completed the task");
957
- }
958
- },
959
- // eslint-disable-next-line react-hooks/exhaustive-deps
960
- [
961
- session,
962
- agentStatus,
963
- addNotification,
964
- notifyTaskComplete,
965
- startUpload,
966
- startDownload,
967
- stopActivity,
968
- startSegmentTransition,
969
- setAgentMode,
970
- authManager,
971
- setAuthExpired,
972
- ],
973
- );
974
-
975
- const addToQueue = useCallback(
976
- (message: string) => {
977
- session.enqueue(message);
978
- setQueuedMessages(session.getQueue());
979
- },
980
- [session],
981
- );
982
-
983
- const removeFirstFromQueue = useCallback(() => {
984
- session.dequeue();
985
- setQueuedMessages(session.getQueue());
986
- }, [session]);
987
-
988
- const clearQueue = useCallback(() => {
989
- session.clearQueue();
990
- setQueuedMessages([]);
991
- }, [session]);
992
-
993
- const clearDequeuedOnStop = useCallback(() => {
994
- setDequeuedOnStop(null);
995
- }, []);
996
-
997
- const addAllowedDirectory = useCallback(
998
- (dirPath: string) => session.addAllowedDirectory(dirPath),
999
- [session],
1000
- );
1001
-
1002
- const contextValue = useMemo<AgentContextValue>(
1003
- () => ({
1004
- conversationId: conversationIdRef.current,
1005
- conversationTitle,
1006
- segments,
1007
- segmentsLength: segments.length,
1008
- sendMessage,
1009
- stop,
1010
- rejectPendingPermission,
1011
- agentStatus,
1012
- clearSegments,
1013
- clearSegmentsOnly,
1014
- clearTempSegments,
1015
- loadConversation,
1016
- addNotification,
1017
- mcp: session.mcp,
1018
- addAllowedDirectory,
1019
- pendingToolPermission,
1020
- refreshMcpTools,
1021
- isPendingSegmentUpdate,
1022
- queuedMessages,
1023
- addToQueue,
1024
- removeFirstFromQueue,
1025
- clearQueue,
1026
- dequeuedOnStop,
1027
- clearDequeuedOnStop,
1028
- activeToolOutputs,
1029
- retryState,
1030
- networkOnline,
1031
- }),
1032
- [
1033
- conversationTitle,
1034
- segments,
1035
- sendMessage,
1036
- stop,
1037
- rejectPendingPermission,
1038
- agentStatus,
1039
- clearSegments,
1040
- clearSegmentsOnly,
1041
- clearTempSegments,
1042
- loadConversation,
1043
- addNotification,
1044
- session,
1045
- addAllowedDirectory,
1046
- pendingToolPermission,
1047
- refreshMcpTools,
1048
- isPendingSegmentUpdate,
1049
- queuedMessages,
1050
- addToQueue,
1051
- removeFirstFromQueue,
1052
- clearQueue,
1053
- dequeuedOnStop,
1054
- clearDequeuedOnStop,
1055
- retryState,
1056
- networkOnline,
1057
- ],
1058
- );
1059
-
1060
- return <AgentContext.Provider value={contextValue}>{children}</AgentContext.Provider>;
1061
- });
1062
-
1063
- AgentProvider.displayName = "AgentProvider";