openfox 2.0.61 → 2.0.63

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 (40) hide show
  1. package/README.md +14 -0
  2. package/dist/{chat-handler-6DRGMDXZ.js → chat-handler-WNARPARQ.js} +11 -11
  3. package/dist/{chunk-KX4C5Q5J.js → chunk-5OPZLQDV.js} +196 -114
  4. package/dist/{chunk-S5DWUGKZ.js → chunk-FGG4KRFX.js} +6 -6
  5. package/dist/{chunk-ZHSCXD75.js → chunk-IVJYQZSN.js} +65 -6
  6. package/dist/{chunk-LHTVTDQQ.js → chunk-N5JF4RYJ.js} +362 -92
  7. package/dist/{chunk-GJU35MDV.js → chunk-OESYKZCM.js} +2 -2
  8. package/dist/{chunk-JKLPWTUN.js → chunk-QBYQ7KDX.js} +9 -4
  9. package/dist/{chunk-NVPVDDQZ.js → chunk-QJ5FH5DP.js} +14 -10
  10. package/dist/{chunk-H774GQJW.js → chunk-RYIREJAW.js} +234 -40
  11. package/dist/{chunk-AA4G4DGK.js → chunk-W4PUAODY.js} +34 -44
  12. package/dist/{chunk-43UFGATL.js → chunk-WGAAQASA.js} +31 -9
  13. package/dist/{chunk-6VDCH5ML.js → chunk-X5YCWKNS.js} +4 -4
  14. package/dist/cli/dev.js +1 -1
  15. package/dist/cli/index.js +1 -1
  16. package/dist/{client-KRFGMNGN.js → client-LAKW7TA5.js} +3 -3
  17. package/dist/{compactor-Q33AJPCQ.js → compactor-I3N56PSJ.js} +4 -4
  18. package/dist/{config-GMQUPNBY.js → config-EUMVEFHU.js} +2 -2
  19. package/dist/{orchestrator-AHCSLBB3.js → orchestrator-OIBLY5QJ.js} +14 -14
  20. package/dist/package.json +6 -1
  21. package/dist/{processor-45VWLZIV.js → processor-27VCKRGB.js} +13 -12
  22. package/dist/protocol-Cq66hdDX.d.ts +375 -0
  23. package/dist/provider/index.d.ts +129 -0
  24. package/dist/provider/index.js +1 -0
  25. package/dist/{provider-LBYBC5AG.js → provider-GYOW4OWQ.js} +7 -9
  26. package/dist/{provider-manager-ABEUYU3K.js → provider-manager-HRHNF73A.js} +4 -5
  27. package/dist/{serve-V44O2QE6.js → serve-HB222ARV.js} +15 -16
  28. package/dist/server/index.d.ts +5 -87
  29. package/dist/server/index.js +12 -13
  30. package/dist/{server-JDB2QVKP.js → server-XDC7R2IX.js} +10 -14
  31. package/dist/shared/index.d.ts +3 -2
  32. package/dist/{tools-7QUMO5DJ.js → tools-W2FFSF4N.js} +7 -7
  33. package/dist/types-CDZakn7f.d.ts +89 -0
  34. package/dist/{protocol-J7khRG62.d.ts → types-akHmgvBk.d.ts} +17 -373
  35. package/dist/web/assets/{index-BGkyTfuQ.css → index-DvPmgi8F.css} +1 -1
  36. package/dist/web/assets/{index-CETZPQXr.js → index-bSaZSLjg.js} +74 -73
  37. package/dist/web/index.html +2 -2
  38. package/dist/web/sw.js +1 -1
  39. package/package.json +6 -1
  40. package/dist/chunk-M3RB4IF6.js +0 -114
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  streamWithSegments
3
3
  } from "./chunk-J2GP3J3X.js";
4
+ import {
5
+ getModelProfile
6
+ } from "./chunk-V4IE7HJY.js";
4
7
  import {
5
8
  getBackendCapabilities
6
9
  } from "./chunk-YHEQTVFV.js";
@@ -10,9 +13,6 @@ import {
10
13
  import {
11
14
  logger
12
15
  } from "./chunk-K44MW7JJ.js";
13
- import {
14
- getModelProfile
15
- } from "./chunk-V4IE7HJY.js";
16
16
 
17
17
  // src/server/tools/tool-policy.ts
18
18
  var ALWAYS_ALLOWED = /* @__PURE__ */ new Set(["step_done"]);
@@ -705,4 +705,4 @@ export {
705
705
  createChatDoneEvent,
706
706
  consumeStreamGenerator
707
707
  };
708
- //# sourceMappingURL=chunk-6VDCH5ML.js.map
708
+ //# sourceMappingURL=chunk-X5YCWKNS.js.map
package/dist/cli/dev.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-S5DWUGKZ.js";
4
+ } from "../chunk-FGG4KRFX.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "../chunk-S5DWUGKZ.js";
4
+ } from "../chunk-FGG4KRFX.js";
5
5
  import "../chunk-XY3LESVZ.js";
6
6
  import {
7
7
  logger
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createLLMClient
3
- } from "./chunk-JKLPWTUN.js";
3
+ } from "./chunk-QBYQ7KDX.js";
4
+ import "./chunk-V4IE7HJY.js";
4
5
  import "./chunk-YHEQTVFV.js";
5
6
  import "./chunk-HNCM3D7Y.js";
6
7
  import "./chunk-Z6W4YHJB.js";
7
8
  import "./chunk-ZO5EXQMG.js";
8
9
  import "./chunk-K44MW7JJ.js";
9
- import "./chunk-V4IE7HJY.js";
10
10
  import "./chunk-5WRI5ZAA.js";
11
11
  export {
12
12
  createLLMClient
13
13
  };
14
- //# sourceMappingURL=client-KRFGMNGN.js.map
14
+ //# sourceMappingURL=client-LAKW7TA5.js.map
@@ -2,20 +2,20 @@ import {
2
2
  appendCompactionPrompt,
3
3
  getCompactionTarget,
4
4
  shouldCompact
5
- } from "./chunk-GJU35MDV.js";
6
- import "./chunk-6VDCH5ML.js";
5
+ } from "./chunk-OESYKZCM.js";
6
+ import "./chunk-X5YCWKNS.js";
7
7
  import "./chunk-AIJE3RYH.js";
8
8
  import "./chunk-TMUBLQFC.js";
9
9
  import "./chunk-ZPIZLTWU.js";
10
10
  import "./chunk-J2GP3J3X.js";
11
+ import "./chunk-V4IE7HJY.js";
11
12
  import "./chunk-YHEQTVFV.js";
12
13
  import "./chunk-Z6W4YHJB.js";
13
14
  import "./chunk-K44MW7JJ.js";
14
- import "./chunk-V4IE7HJY.js";
15
15
  import "./chunk-5WRI5ZAA.js";
16
16
  export {
17
17
  appendCompactionPrompt,
18
18
  getCompactionTarget,
19
19
  shouldCompact
20
20
  };
21
- //# sourceMappingURL=compactor-Q33AJPCQ.js.map
21
+ //# sourceMappingURL=compactor-I3N56PSJ.js.map
@@ -11,7 +11,7 @@ import {
11
11
  saveGlobalConfig,
12
12
  setDefaultModelSelection,
13
13
  updateProvider
14
- } from "./chunk-43UFGATL.js";
14
+ } from "./chunk-WGAAQASA.js";
15
15
  import "./chunk-CQGTEGKL.js";
16
16
  import "./chunk-5WRI5ZAA.js";
17
17
  export {
@@ -28,4 +28,4 @@ export {
28
28
  setDefaultModelSelection,
29
29
  updateProvider
30
30
  };
31
- //# sourceMappingURL=config-GMQUPNBY.js.map
31
+ //# sourceMappingURL=config-EUMVEFHU.js.map
@@ -2,16 +2,8 @@ import {
2
2
  injectWorkflowKickoffIfNeeded,
3
3
  runAgentTurn,
4
4
  runChatTurn
5
- } from "./chunk-ZHSCXD75.js";
6
- import "./chunk-KX4C5Q5J.js";
7
- import "./chunk-LBGHZLLH.js";
8
- import "./chunk-BGTEIA2S.js";
9
- import "./chunk-PK2RMVMB.js";
10
- import "./chunk-NWO6GRYE.js";
11
- import "./chunk-F4PMNP7S.js";
12
- import "./chunk-EU3WWTFH.js";
13
- import "./chunk-SVSKQYFH.js";
14
- import "./chunk-YQ3SOPBI.js";
5
+ } from "./chunk-IVJYQZSN.js";
6
+ import "./chunk-5OPZLQDV.js";
15
7
  import {
16
8
  TurnMetrics,
17
9
  createChatDoneEvent,
@@ -19,18 +11,26 @@ import {
19
11
  createMessageStartEvent,
20
12
  createToolCallEvent,
21
13
  createToolResultEvent
22
- } from "./chunk-6VDCH5ML.js";
14
+ } from "./chunk-X5YCWKNS.js";
15
+ import "./chunk-LBGHZLLH.js";
16
+ import "./chunk-BGTEIA2S.js";
17
+ import "./chunk-PK2RMVMB.js";
18
+ import "./chunk-NWO6GRYE.js";
23
19
  import "./chunk-AIJE3RYH.js";
24
20
  import "./chunk-TMUBLQFC.js";
21
+ import "./chunk-F4PMNP7S.js";
22
+ import "./chunk-EU3WWTFH.js";
23
+ import "./chunk-SVSKQYFH.js";
24
+ import "./chunk-YQ3SOPBI.js";
25
25
  import "./chunk-ZPIZLTWU.js";
26
26
  import "./chunk-J2GP3J3X.js";
27
+ import "./chunk-V4IE7HJY.js";
27
28
  import "./chunk-YHEQTVFV.js";
28
29
  import "./chunk-Z6W4YHJB.js";
29
30
  import "./chunk-K44MW7JJ.js";
30
31
  import "./chunk-YD6NDTKF.js";
31
- import "./chunk-43UFGATL.js";
32
+ import "./chunk-WGAAQASA.js";
32
33
  import "./chunk-CQGTEGKL.js";
33
- import "./chunk-V4IE7HJY.js";
34
34
  import "./chunk-5WRI5ZAA.js";
35
35
  export {
36
36
  TurnMetrics,
@@ -43,4 +43,4 @@ export {
43
43
  runAgentTurn,
44
44
  runChatTurn
45
45
  };
46
- //# sourceMappingURL=orchestrator-AHCSLBB3.js.map
46
+ //# sourceMappingURL=orchestrator-OIBLY5QJ.js.map
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfox",
3
- "version": "2.0.61",
3
+ "version": "2.0.63",
4
4
  "description": "Local-LLM-first agentic coding assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,10 @@
15
15
  "./shared": {
16
16
  "types": "./dist/shared/index.d.ts",
17
17
  "import": "./dist/shared/index.js"
18
+ },
19
+ "./provider": {
20
+ "types": "./dist/provider/index.d.ts",
21
+ "import": "./dist/provider/index.js"
18
22
  }
19
23
  },
20
24
  "files": [
@@ -79,6 +83,7 @@
79
83
  "multer": "^2.2.0",
80
84
  "node-pty": "^1.2.0-beta.12",
81
85
  "open": "^11.0.0",
86
+ "pdfjs-dist": "^6.1.200",
82
87
  "pyright": "^1.1.408",
83
88
  "react-markdown": "^10.1.0",
84
89
  "react-syntax-highlighter": "^16.1.1",
@@ -2,12 +2,17 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-NVPVDDQZ.js";
6
- import "./chunk-KX4C5Q5J.js";
5
+ } from "./chunk-QJ5FH5DP.js";
6
+ import "./chunk-5OPZLQDV.js";
7
+ import "./chunk-X5YCWKNS.js";
7
8
  import "./chunk-LBGHZLLH.js";
8
9
  import "./chunk-BGTEIA2S.js";
9
10
  import "./chunk-PK2RMVMB.js";
10
11
  import "./chunk-NWO6GRYE.js";
12
+ import {
13
+ getEventStore
14
+ } from "./chunk-AIJE3RYH.js";
15
+ import "./chunk-TMUBLQFC.js";
11
16
  import {
12
17
  createChatMessageMessage,
13
18
  createSessionRunningMessage
@@ -15,22 +20,17 @@ import {
15
20
  import "./chunk-EU3WWTFH.js";
16
21
  import "./chunk-SVSKQYFH.js";
17
22
  import "./chunk-YQ3SOPBI.js";
18
- import "./chunk-6VDCH5ML.js";
19
- import {
20
- getEventStore
21
- } from "./chunk-AIJE3RYH.js";
22
- import "./chunk-TMUBLQFC.js";
23
23
  import "./chunk-ZPIZLTWU.js";
24
24
  import "./chunk-J2GP3J3X.js";
25
+ import "./chunk-V4IE7HJY.js";
25
26
  import "./chunk-YHEQTVFV.js";
26
27
  import "./chunk-Z6W4YHJB.js";
27
28
  import {
28
29
  logger
29
30
  } from "./chunk-K44MW7JJ.js";
30
31
  import "./chunk-YD6NDTKF.js";
31
- import "./chunk-43UFGATL.js";
32
+ import "./chunk-WGAAQASA.js";
32
33
  import "./chunk-CQGTEGKL.js";
33
- import "./chunk-V4IE7HJY.js";
34
34
  import "./chunk-5WRI5ZAA.js";
35
35
 
36
36
  // src/server/queue/processor.ts
@@ -139,7 +139,8 @@ var QueueProcessor = class {
139
139
  providerManager: this.deps.providerManager,
140
140
  broadcastForSession,
141
141
  eventStore: getEventStore(),
142
- getLLMClient: this.deps.getLLMClient
142
+ getLLMClient: this.deps.getLLMClient,
143
+ ...this.deps.getLLMClientForProvider ? { getLLMClientForProvider: this.deps.getLLMClientForProvider } : {}
143
144
  },
144
145
  controller.signal
145
146
  );
@@ -174,7 +175,7 @@ var QueueProcessor = class {
174
175
  backend: provider?.backend ?? llmClient.getBackend(),
175
176
  model: llmClient.getModel()
176
177
  };
177
- const { runChatTurn } = await import("./orchestrator-AHCSLBB3.js");
178
+ const { runChatTurn } = await import("./orchestrator-OIBLY5QJ.js");
178
179
  const runChatTurnParams = buildRunChatTurnParams({
179
180
  sessionManager,
180
181
  sessionId,
@@ -222,4 +223,4 @@ var QueueProcessor = class {
222
223
  export {
223
224
  QueueProcessor
224
225
  };
225
- //# sourceMappingURL=processor-45VWLZIV.js.map
226
+ //# sourceMappingURL=processor-27VCKRGB.js.map
@@ -0,0 +1,375 @@
1
+ import { A as Attachment, K as ToolMode, O as ToolResult, M as Message, T as Todo, b as ContextState, d as Criterion, h as Diagnostic, q as MetadataEntry, y as SessionMode, z as SessionPhase, t as Project, B as SessionSummary, w as Session } from './types-akHmgvBk.js';
2
+
3
+ type ClientMessageType = 'session.load' | 'context.compact' | 'context.checkDynamic' | 'context.applyDynamic' | 'runner.launch' | 'path.confirm' | 'ask.answer';
4
+ interface ClientMessage<T = unknown> {
5
+ id: string;
6
+ type: ClientMessageType;
7
+ payload: T;
8
+ }
9
+ interface SessionLoadPayload {
10
+ sessionId: string;
11
+ lastEventSeq?: number;
12
+ }
13
+ interface AskAnswerPayload {
14
+ callId: string;
15
+ answer: string;
16
+ skip?: boolean;
17
+ }
18
+ interface QueuedMessage {
19
+ queueId: string;
20
+ mode: 'asap' | 'completion';
21
+ content: string;
22
+ attachments?: Attachment[];
23
+ queuedAt: string;
24
+ messageKind?: string;
25
+ }
26
+ type ServerMessageType = 'project.state' | 'project.list' | 'project.deleted' | 'session.state' | 'session.list' | 'session.deleted' | 'session.deletedAll' | 'session.running' | 'session.name_generated' | 'chat.delta' | 'chat.thinking' | 'chat.tool_preparing' | 'chat.tool_call' | 'chat.tool_output' | 'chat.tool_result' | 'chat.todo' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.vision_fallback' | 'chat.error' | 'chat.path_confirmation' | 'chat.ask_user' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'metadata.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'devServer.output' | 'devServer.state' | 'backgroundProcess.started' | 'backgroundProcess.output' | 'backgroundProcess.exited' | 'backgroundProcess.removed' | 'git.status' | 'mcp.servers.changed' | 'lsp.diagnostics' | 'error' | 'ack';
27
+ interface ServerMessage<T = unknown> {
28
+ id?: string;
29
+ type: ServerMessageType;
30
+ payload: T;
31
+ seq?: number;
32
+ sessionId?: string;
33
+ }
34
+ interface ProjectStatePayload {
35
+ project: Project;
36
+ }
37
+ interface ProjectListPayload {
38
+ projects: Project[];
39
+ }
40
+ interface ProjectDeletedPayload {
41
+ projectId: string;
42
+ }
43
+ interface PendingQuestionPayload {
44
+ callId: string;
45
+ question: string;
46
+ type: 'text' | 'confirm' | 'choice';
47
+ options: string[] | undefined;
48
+ }
49
+ interface SessionStatePayload {
50
+ session: Session;
51
+ messages: Message[];
52
+ pendingConfirmations: PendingPathConfirmationPayload[];
53
+ pendingQuestions?: PendingQuestionPayload[];
54
+ gitStatus?: GitStatusPayload;
55
+ }
56
+ interface PendingPathConfirmationPayload {
57
+ callId: string;
58
+ tool: string;
59
+ paths: string[];
60
+ workdir: string;
61
+ reason: 'outside_workdir' | 'sensitive_file' | 'both' | 'dangerous_command' | 'git_no_verify';
62
+ }
63
+ interface SessionListPayload {
64
+ sessions: SessionSummary[];
65
+ }
66
+ interface SessionRunningPayload {
67
+ isRunning: boolean;
68
+ }
69
+ interface SessionNameGeneratedPayload {
70
+ name: string;
71
+ }
72
+ interface ChatDeltaPayload {
73
+ messageId: string;
74
+ content: string;
75
+ subAgentType?: string;
76
+ }
77
+ interface ChatThinkingPayload {
78
+ messageId: string;
79
+ content: string;
80
+ }
81
+ interface ChatToolPreparingPayload {
82
+ messageId: string;
83
+ index: number;
84
+ name: string;
85
+ arguments?: string;
86
+ }
87
+ interface ChatToolCallPayload {
88
+ messageId: string;
89
+ callId: string;
90
+ tool: string;
91
+ args: Record<string, unknown>;
92
+ }
93
+ interface ChatToolResultPayload {
94
+ messageId: string;
95
+ callId: string;
96
+ tool: string;
97
+ result: ToolResult;
98
+ }
99
+ interface ChatToolOutputPayload {
100
+ messageId: string;
101
+ callId: string;
102
+ output: string;
103
+ stream: 'stdout' | 'stderr';
104
+ }
105
+ interface ChatTodoPayload {
106
+ todos: Todo[];
107
+ }
108
+ interface ChatProgressPayload {
109
+ message: string;
110
+ phase?: 'summary' | 'mode_switch' | 'starting' | 'context_warning' | 'context_error';
111
+ }
112
+ interface ChatFormatRetryPayload {
113
+ attempt: number;
114
+ maxAttempts: number;
115
+ pattern?: string;
116
+ field?: string;
117
+ matchedContent?: string;
118
+ }
119
+ interface ChatVisionFallbackPayload {
120
+ type: 'start' | 'done';
121
+ messageId: string;
122
+ attachmentId: string;
123
+ filename?: string;
124
+ description?: string;
125
+ }
126
+ interface ChatMessagePayload {
127
+ message: Message;
128
+ }
129
+ interface ChatMessageUpdatedPayload {
130
+ messageId: string;
131
+ updates: Partial<Pick<Message, 'content' | 'thinkingContent' | 'toolCalls' | 'isStreaming' | 'stats' | 'partial'>>;
132
+ }
133
+ interface ChatDonePayload {
134
+ messageId: string;
135
+ reason: 'complete' | 'stopped' | 'error' | 'waiting_for_user' | 'truncated' | 'step_done';
136
+ agentType?: 'sub-agent';
137
+ stats?: {
138
+ model: string;
139
+ mode: ToolMode;
140
+ totalTime: number;
141
+ toolTime: number;
142
+ prefillTokens: number;
143
+ prefillSpeed: number;
144
+ generationTokens: number;
145
+ generationSpeed: number;
146
+ };
147
+ }
148
+ interface ChatErrorPayload {
149
+ error: string;
150
+ recoverable: boolean;
151
+ }
152
+ type PathConfirmationReason = 'outside_workdir' | 'sensitive_file' | 'both' | 'dangerous_command' | 'git_no_verify';
153
+ interface ChatPathConfirmationPayload {
154
+ callId: string;
155
+ tool: string;
156
+ paths: string[];
157
+ workdir: string;
158
+ reason: PathConfirmationReason;
159
+ }
160
+ interface PathConfirmPayload {
161
+ callId: string;
162
+ approved: boolean;
163
+ alwaysAllow?: boolean;
164
+ }
165
+ interface ChatAskUserPayload {
166
+ callId: string;
167
+ question: string;
168
+ type: 'text' | 'confirm' | 'choice' | undefined;
169
+ options: string[] | undefined;
170
+ }
171
+ interface ModeChangedPayload {
172
+ mode: SessionMode;
173
+ auto: boolean;
174
+ reason?: string;
175
+ }
176
+ interface PhaseChangedPayload {
177
+ phase: SessionPhase;
178
+ }
179
+ interface TaskCompletedPayload {
180
+ summary: string | null;
181
+ iterations: number;
182
+ totalTimeSeconds: number;
183
+ totalToolCalls: number;
184
+ totalTokensGenerated: number;
185
+ avgGenerationSpeed: number;
186
+ responseCount: number;
187
+ llmCallCount: number;
188
+ criteria: Array<{
189
+ id: string;
190
+ description: string;
191
+ status: string;
192
+ }>;
193
+ workflowName?: string;
194
+ workflowId?: string;
195
+ workflowColor?: string;
196
+ }
197
+ interface CriteriaUpdatedPayload {
198
+ criteria: Criterion[];
199
+ changedId?: string;
200
+ }
201
+ interface MetadataUpdatedPayload {
202
+ key: string;
203
+ entries: MetadataEntry[];
204
+ }
205
+ interface ContextStatePayload {
206
+ context: ContextState;
207
+ subAgentId?: string;
208
+ }
209
+ interface ProviderChangedPayload {
210
+ providerId: string;
211
+ providerName: string;
212
+ model: string;
213
+ backend: string;
214
+ }
215
+ interface QueueStatePayload {
216
+ messages: QueuedMessage[];
217
+ }
218
+ interface DevServerOutputPayload {
219
+ workdir: string;
220
+ stream: 'stdout' | 'stderr';
221
+ content: string;
222
+ }
223
+ interface DevServerStatePayload {
224
+ workdir: string;
225
+ state: 'off' | 'running' | 'warning' | 'error';
226
+ errorMessage?: string;
227
+ }
228
+ interface BackgroundProcessStartedPayload {
229
+ processId: string;
230
+ name: string;
231
+ pid: number;
232
+ status: BackgroundProcessStatus;
233
+ }
234
+ interface BackgroundProcessOutputPayload {
235
+ processId: string;
236
+ stream: 'stdout' | 'stderr';
237
+ content: string;
238
+ }
239
+ interface BackgroundProcessExitedPayload {
240
+ processId: string;
241
+ exitCode: number | null;
242
+ }
243
+ interface BackgroundProcessRemovedPayload {
244
+ processId: string;
245
+ }
246
+ interface GitStatusPayload {
247
+ branch: string | null;
248
+ diff: {
249
+ files: GitDiffFile[];
250
+ };
251
+ }
252
+ interface GitDiffFile {
253
+ path: string;
254
+ status: 'modified' | 'added' | 'deleted';
255
+ additions: number;
256
+ deletions: number;
257
+ }
258
+ type BackgroundProcessStatus = 'pending' | 'starting' | 'running' | 'stopping' | 'exited';
259
+ interface BackgroundProcess {
260
+ id: string;
261
+ sessionId: string;
262
+ name: string;
263
+ command: string;
264
+ cwd: string;
265
+ pid: number | null;
266
+ status: BackgroundProcessStatus;
267
+ exitCode: number | null;
268
+ createdAt: number;
269
+ startedAt: number | null;
270
+ endedAt: number | null;
271
+ }
272
+ interface LogLine {
273
+ offset: number;
274
+ content: string;
275
+ timestamp: number;
276
+ stream: 'stdout' | 'stderr';
277
+ }
278
+ interface LspDiagnosticsPayload {
279
+ path: string;
280
+ diagnostics: Diagnostic[];
281
+ }
282
+ interface ErrorPayload {
283
+ code: string;
284
+ message: string;
285
+ details?: unknown;
286
+ }
287
+ interface ContextCompactionEvent {
288
+ beforeTokens: number;
289
+ afterTokens: number;
290
+ }
291
+ interface AskUserEvent {
292
+ question: string;
293
+ callId: string;
294
+ }
295
+ type AgentEvent = {
296
+ type: 'aborted';
297
+ } | {
298
+ type: 'text_delta';
299
+ content: string;
300
+ } | {
301
+ type: 'thinking';
302
+ content: string;
303
+ } | {
304
+ type: 'error';
305
+ error: string;
306
+ recoverable: boolean;
307
+ } | {
308
+ type: 'context_compaction';
309
+ beforeTokens: number;
310
+ afterTokens: number;
311
+ } | {
312
+ type: 'done';
313
+ allCriteriaPassed: boolean;
314
+ summary: string;
315
+ stats: ChatDonePayload['stats'];
316
+ } | {
317
+ type: 'stuck';
318
+ reason: string;
319
+ failedAttempts: number;
320
+ } | {
321
+ type: 'tool_call';
322
+ callId: string;
323
+ tool: string;
324
+ args: Record<string, unknown>;
325
+ } | {
326
+ type: 'tool_result';
327
+ callId: string;
328
+ tool: string;
329
+ result: ToolResult;
330
+ } | {
331
+ type: 'tool_error';
332
+ callId: string;
333
+ tool: string;
334
+ error: string;
335
+ willRetry: boolean;
336
+ } | {
337
+ type: 'ask_user';
338
+ question: string;
339
+ callId: string;
340
+ } | {
341
+ type: 'format_retry';
342
+ attempt: number;
343
+ maxAttempts: number;
344
+ };
345
+ declare function createClientMessage<T>(type: ClientMessageType, payload: T): ClientMessage<T>;
346
+ declare function createServerMessage<T>(type: ServerMessageType, payload: T, correlationId?: string): ServerMessage<T>;
347
+ declare function isClientMessage(msg: unknown): msg is ClientMessage;
348
+ declare function isServerMessage(msg: unknown): msg is ServerMessage;
349
+ type QueueEventType = 'queue.added' | 'queue.drained' | 'queue.cancelled';
350
+ interface QueueAddedEvent {
351
+ type: 'queue.added';
352
+ data: {
353
+ queueId: string;
354
+ mode: 'asap' | 'completion';
355
+ content: string;
356
+ attachments?: Attachment[];
357
+ messageKind?: string;
358
+ queuedAt: string;
359
+ };
360
+ }
361
+ interface QueueDrainedEvent {
362
+ type: 'queue.drained';
363
+ data: {
364
+ queueId: string;
365
+ };
366
+ }
367
+ interface QueueCancelledEvent {
368
+ type: 'queue.cancelled';
369
+ data: {
370
+ queueId: string;
371
+ };
372
+ }
373
+ type QueueEvent = QueueAddedEvent | QueueDrainedEvent | QueueCancelledEvent;
374
+
375
+ export { type QueueStatePayload as $, type AgentEvent as A, type BackgroundProcess as B, type ChatAskUserPayload as C, type CriteriaUpdatedPayload as D, type DevServerOutputPayload as E, type DevServerStatePayload as F, type ErrorPayload as G, type GitDiffFile as H, type GitStatusPayload as I, type LspDiagnosticsPayload as J, type ModeChangedPayload as K, type LogLine as L, type MetadataUpdatedPayload as M, type PathConfirmationReason as N, type PendingPathConfirmationPayload as O, type PathConfirmPayload as P, type PendingQuestionPayload as Q, type PhaseChangedPayload as R, type ProjectDeletedPayload as S, type ProjectListPayload as T, type ProjectStatePayload as U, type ProviderChangedPayload as V, type QueueAddedEvent as W, type QueueCancelledEvent as X, type QueueDrainedEvent as Y, type QueueEvent as Z, type QueueEventType as _, type AskAnswerPayload as a, type QueuedMessage as a0, type ServerMessage as a1, type ServerMessageType as a2, type SessionListPayload as a3, type SessionLoadPayload as a4, type SessionNameGeneratedPayload as a5, type SessionRunningPayload as a6, type SessionStatePayload as a7, type TaskCompletedPayload as a8, createClientMessage as a9, createServerMessage as aa, isClientMessage as ab, isServerMessage as ac, type AskUserEvent as b, type BackgroundProcessExitedPayload as c, type BackgroundProcessOutputPayload as d, type BackgroundProcessRemovedPayload as e, type BackgroundProcessStartedPayload as f, type BackgroundProcessStatus as g, type ChatDeltaPayload as h, type ChatDonePayload as i, type ChatErrorPayload as j, type ChatFormatRetryPayload as k, type ChatMessagePayload as l, type ChatMessageUpdatedPayload as m, type ChatPathConfirmationPayload as n, type ChatProgressPayload as o, type ChatThinkingPayload as p, type ChatTodoPayload as q, type ChatToolCallPayload as r, type ChatToolOutputPayload as s, type ChatToolPreparingPayload as t, type ChatToolResultPayload as u, type ChatVisionFallbackPayload as v, type ClientMessage as w, type ClientMessageType as x, type ContextCompactionEvent as y, type ContextStatePayload as z };