openfox 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/dist/branch.api-WDHKZJS6.js +48 -0
- package/dist/branch.api-WDHKZJS6.js.map +1 -0
- package/dist/chunk-26NRL3HX.js +116 -0
- package/dist/chunk-26NRL3HX.js.map +1 -0
- package/dist/chunk-43SWNGYW.js +273 -0
- package/dist/chunk-43SWNGYW.js.map +1 -0
- package/dist/chunk-4Z2OZ6NX.js +132 -0
- package/dist/chunk-4Z2OZ6NX.js.map +1 -0
- package/dist/chunk-6MOGZMGX.js +218 -0
- package/dist/chunk-6MOGZMGX.js.map +1 -0
- package/dist/chunk-AF7XS4OI.js +55 -0
- package/dist/chunk-AF7XS4OI.js.map +1 -0
- package/dist/chunk-EI46G5WO.js +138 -0
- package/dist/chunk-EI46G5WO.js.map +1 -0
- package/dist/chunk-FF6Z2MC3.js +844 -0
- package/dist/chunk-FF6Z2MC3.js.map +1 -0
- package/dist/chunk-IKAWIOXM.js +5817 -0
- package/dist/chunk-IKAWIOXM.js.map +1 -0
- package/dist/chunk-IVHCPQO2.js +29 -0
- package/dist/chunk-IVHCPQO2.js.map +1 -0
- package/dist/chunk-MTX5Y3V3.js +46 -0
- package/dist/chunk-MTX5Y3V3.js.map +1 -0
- package/dist/chunk-N2XYX4ZA.js +83 -0
- package/dist/chunk-N2XYX4ZA.js.map +1 -0
- package/dist/chunk-QY7BMXWT.js +124 -0
- package/dist/chunk-QY7BMXWT.js.map +1 -0
- package/dist/chunk-U62ZECSQ.js +54 -0
- package/dist/chunk-U62ZECSQ.js.map +1 -0
- package/dist/chunk-YQ36AK5A.js +5570 -0
- package/dist/chunk-YQ36AK5A.js.map +1 -0
- package/dist/cli/dev.d.ts +1 -0
- package/dist/cli/dev.js +14 -0
- package/dist/cli/dev.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +14 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/command-defaults/defaults/commit-push.command.md +13 -0
- package/dist/command-defaults/defaults/init.command.md +18 -0
- package/dist/command-defaults/defaults/test-ui.command.md +16 -0
- package/dist/config-6GJ4SVFH.js +33 -0
- package/dist/config-6GJ4SVFH.js.map +1 -0
- package/dist/init-UVZDOHMX.js +185 -0
- package/dist/init-UVZDOHMX.js.map +1 -0
- package/dist/paths-4BPXWB2W.js +17 -0
- package/dist/paths-4BPXWB2W.js.map +1 -0
- package/dist/project-creator-CWPKRIKI.js +69 -0
- package/dist/project-creator-CWPKRIKI.js.map +1 -0
- package/dist/protocol-BJsm88OW.d.ts +760 -0
- package/dist/provider-LCE6WZA6.js +343 -0
- package/dist/provider-LCE6WZA6.js.map +1 -0
- package/dist/serve-27DZK34K.js +177 -0
- package/dist/serve-27DZK34K.js.map +1 -0
- package/dist/server/index.d.ts +479 -0
- package/dist/server/index.js +20 -0
- package/dist/server/index.js.map +1 -0
- package/dist/settings-D5O3TMLD.js +17 -0
- package/dist/settings-D5O3TMLD.js.map +1 -0
- package/dist/shared/index.d.ts +19 -0
- package/dist/shared/index.js +17 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/skill-defaults/defaults/playwright-cli.skill.md +38 -0
- package/dist/tools-R4YQAYUF.js +46 -0
- package/dist/tools-R4YQAYUF.js.map +1 -0
- package/dist/web/assets/html2canvas.esm-QH1iLAAe.js +22 -0
- package/dist/web/assets/index-BMNDCsbJ.js +120 -0
- package/dist/web/assets/index-BSlSWZrM.css +1 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- package/dist/web/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/web/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/web/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/web/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/web/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- package/dist/web/assets/openfox.png +0 -0
- package/dist/web/fox.svg +25 -0
- package/dist/web/index.html +14 -0
- package/dist/web/sounds/achievement.mp3 +0 -0
- package/dist/web/sounds/intervention.mp3 +0 -0
- package/dist/web/sounds/notification.mp3 +0 -0
- package/dist/web/sounds/waiting-for-user.mp3 +0 -0
- package/package.json +101 -0
|
@@ -0,0 +1,760 @@
|
|
|
1
|
+
interface Project {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
workdir: string;
|
|
5
|
+
customInstructions?: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
}
|
|
9
|
+
type SessionMode = string;
|
|
10
|
+
type ToolMode = string;
|
|
11
|
+
type SessionPhase = 'plan' | 'build' | 'verification' | 'blocked' | 'done';
|
|
12
|
+
interface Session {
|
|
13
|
+
id: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
workdir: string;
|
|
16
|
+
mode: SessionMode;
|
|
17
|
+
phase: SessionPhase;
|
|
18
|
+
isRunning: boolean;
|
|
19
|
+
summary: string | null;
|
|
20
|
+
providerId?: string | null;
|
|
21
|
+
providerModel?: string | null;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
messages: Message[];
|
|
25
|
+
criteria: Criterion[];
|
|
26
|
+
contextWindows: ContextWindow[];
|
|
27
|
+
executionState: ExecutionState | null;
|
|
28
|
+
metadata: SessionMetadata;
|
|
29
|
+
}
|
|
30
|
+
interface ContextWindow {
|
|
31
|
+
id: string;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
sequenceNumber: number;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
summaryOfPrevious?: string;
|
|
36
|
+
summaryTokenCount?: number;
|
|
37
|
+
closedAt?: string;
|
|
38
|
+
tokenCountAtClose?: number;
|
|
39
|
+
}
|
|
40
|
+
interface SessionMetadata {
|
|
41
|
+
title?: string;
|
|
42
|
+
totalTokensUsed: number;
|
|
43
|
+
totalToolCalls: number;
|
|
44
|
+
iterationCount: number;
|
|
45
|
+
}
|
|
46
|
+
interface RecentUserPrompt {
|
|
47
|
+
id: string;
|
|
48
|
+
content: string;
|
|
49
|
+
timestamp: string;
|
|
50
|
+
}
|
|
51
|
+
interface SessionSummary {
|
|
52
|
+
id: string;
|
|
53
|
+
projectId: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
workdir: string;
|
|
56
|
+
mode: SessionMode;
|
|
57
|
+
phase: SessionPhase;
|
|
58
|
+
isRunning: boolean;
|
|
59
|
+
providerId?: string | null;
|
|
60
|
+
providerModel?: string | null;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
criteriaCount: number;
|
|
64
|
+
criteriaCompleted: number;
|
|
65
|
+
recentUserPrompts?: RecentUserPrompt[];
|
|
66
|
+
}
|
|
67
|
+
type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
68
|
+
type MessageSegment = {
|
|
69
|
+
type: 'text';
|
|
70
|
+
content: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'thinking';
|
|
73
|
+
content: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'tool_call';
|
|
76
|
+
toolCallId: string;
|
|
77
|
+
};
|
|
78
|
+
interface MessageStats {
|
|
79
|
+
providerId: string;
|
|
80
|
+
providerName: string;
|
|
81
|
+
backend: ProviderBackend;
|
|
82
|
+
model: string;
|
|
83
|
+
mode: ToolMode;
|
|
84
|
+
totalTime: number;
|
|
85
|
+
toolTime: number;
|
|
86
|
+
prefillTokens: number;
|
|
87
|
+
prefillSpeed: number;
|
|
88
|
+
generationTokens: number;
|
|
89
|
+
generationSpeed: number;
|
|
90
|
+
llmCalls?: LLMCallStats[];
|
|
91
|
+
}
|
|
92
|
+
interface LLMCallStats {
|
|
93
|
+
providerId: string;
|
|
94
|
+
providerName: string;
|
|
95
|
+
backend: ProviderBackend;
|
|
96
|
+
model: string;
|
|
97
|
+
callIndex: number;
|
|
98
|
+
promptTokens: number;
|
|
99
|
+
completionTokens: number;
|
|
100
|
+
ttft: number;
|
|
101
|
+
completionTime: number;
|
|
102
|
+
prefillSpeed: number;
|
|
103
|
+
generationSpeed: number;
|
|
104
|
+
totalTime: number;
|
|
105
|
+
timestamp?: string;
|
|
106
|
+
}
|
|
107
|
+
interface StatsDataPoint {
|
|
108
|
+
messageId: string;
|
|
109
|
+
timestamp: string;
|
|
110
|
+
providerId: string;
|
|
111
|
+
providerName: string;
|
|
112
|
+
backend: ProviderBackend;
|
|
113
|
+
model: string;
|
|
114
|
+
mode: ToolMode;
|
|
115
|
+
responseIndex: number;
|
|
116
|
+
prefillTokens: number;
|
|
117
|
+
generationTokens: number;
|
|
118
|
+
prefillSpeed: number;
|
|
119
|
+
generationSpeed: number;
|
|
120
|
+
totalTime: number;
|
|
121
|
+
aiTime: number;
|
|
122
|
+
toolTime: number;
|
|
123
|
+
}
|
|
124
|
+
interface CallStatsDataPoint {
|
|
125
|
+
messageId: string;
|
|
126
|
+
timestamp: string;
|
|
127
|
+
providerId: string;
|
|
128
|
+
providerName: string;
|
|
129
|
+
backend: ProviderBackend;
|
|
130
|
+
model: string;
|
|
131
|
+
mode: ToolMode;
|
|
132
|
+
responseIndex: number;
|
|
133
|
+
sessionCallIndex: number;
|
|
134
|
+
callIndex: number;
|
|
135
|
+
promptTokens: number;
|
|
136
|
+
completionTokens: number;
|
|
137
|
+
ttft: number;
|
|
138
|
+
completionTime: number;
|
|
139
|
+
prefillSpeed: number;
|
|
140
|
+
generationSpeed: number;
|
|
141
|
+
totalTime: number;
|
|
142
|
+
}
|
|
143
|
+
interface SessionStats {
|
|
144
|
+
totalTime: number;
|
|
145
|
+
aiTime: number;
|
|
146
|
+
toolTime: number;
|
|
147
|
+
prefillTokens: number;
|
|
148
|
+
generationTokens: number;
|
|
149
|
+
avgPrefillSpeed: number;
|
|
150
|
+
avgGenerationSpeed: number;
|
|
151
|
+
responseCount: number;
|
|
152
|
+
llmCallCount: number;
|
|
153
|
+
dataPoints: StatsDataPoint[];
|
|
154
|
+
callDataPoints: CallStatsDataPoint[];
|
|
155
|
+
modelGroups: ModelSessionStats[];
|
|
156
|
+
}
|
|
157
|
+
interface StatsIdentity {
|
|
158
|
+
providerId: string;
|
|
159
|
+
providerName: string;
|
|
160
|
+
backend: ProviderBackend;
|
|
161
|
+
model: string;
|
|
162
|
+
}
|
|
163
|
+
interface ModelSessionStats extends StatsIdentity {
|
|
164
|
+
key: string;
|
|
165
|
+
label: string;
|
|
166
|
+
totalTime: number;
|
|
167
|
+
aiTime: number;
|
|
168
|
+
toolTime: number;
|
|
169
|
+
prefillTokens: number;
|
|
170
|
+
generationTokens: number;
|
|
171
|
+
avgPrefillSpeed: number;
|
|
172
|
+
avgGenerationSpeed: number;
|
|
173
|
+
responseCount: number;
|
|
174
|
+
llmCallCount: number;
|
|
175
|
+
dataPoints: StatsDataPoint[];
|
|
176
|
+
callDataPoints: CallStatsDataPoint[];
|
|
177
|
+
}
|
|
178
|
+
interface PromptContext {
|
|
179
|
+
systemPrompt: string;
|
|
180
|
+
injectedFiles: InjectedFile[];
|
|
181
|
+
userMessage: string;
|
|
182
|
+
messages: PromptContextMessage[];
|
|
183
|
+
tools: PromptContextTool[];
|
|
184
|
+
requestOptions: PromptRequestOptions;
|
|
185
|
+
}
|
|
186
|
+
interface PromptContextMessage {
|
|
187
|
+
role: 'user' | 'assistant' | 'tool';
|
|
188
|
+
content: string;
|
|
189
|
+
source: 'history' | 'runtime';
|
|
190
|
+
toolCalls?: Array<{
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
arguments: Record<string, unknown>;
|
|
194
|
+
}>;
|
|
195
|
+
toolCallId?: string;
|
|
196
|
+
attachments?: Attachment[];
|
|
197
|
+
}
|
|
198
|
+
interface PromptContextTool {
|
|
199
|
+
name: string;
|
|
200
|
+
description: string;
|
|
201
|
+
parameters: Record<string, unknown>;
|
|
202
|
+
}
|
|
203
|
+
interface PromptRequestOptions {
|
|
204
|
+
toolChoice: 'auto' | 'none' | 'required' | {
|
|
205
|
+
type: 'function';
|
|
206
|
+
function: {
|
|
207
|
+
name: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
disableThinking: boolean;
|
|
211
|
+
}
|
|
212
|
+
interface InjectedFile {
|
|
213
|
+
path: string;
|
|
214
|
+
content: string;
|
|
215
|
+
source: 'agents-md' | 'global' | 'project';
|
|
216
|
+
}
|
|
217
|
+
interface PreparingToolCall {
|
|
218
|
+
index: number;
|
|
219
|
+
name: string;
|
|
220
|
+
}
|
|
221
|
+
interface Attachment {
|
|
222
|
+
id: string;
|
|
223
|
+
filename: string;
|
|
224
|
+
mimeType: 'image/png' | 'image/jpeg' | 'image/gif';
|
|
225
|
+
size: number;
|
|
226
|
+
data: string;
|
|
227
|
+
}
|
|
228
|
+
interface Message {
|
|
229
|
+
id: string;
|
|
230
|
+
role: MessageRole;
|
|
231
|
+
content: string;
|
|
232
|
+
contextWindowId?: string;
|
|
233
|
+
toolCalls?: ToolCall[];
|
|
234
|
+
preparingToolCalls?: PreparingToolCall[];
|
|
235
|
+
thinkingContent?: string;
|
|
236
|
+
toolCallId?: string;
|
|
237
|
+
toolName?: string;
|
|
238
|
+
toolResult?: ToolResult;
|
|
239
|
+
timestamp: string;
|
|
240
|
+
tokenCount?: number;
|
|
241
|
+
isCompacted?: boolean;
|
|
242
|
+
originalMessageIds?: string[];
|
|
243
|
+
segments?: MessageSegment[];
|
|
244
|
+
stats?: MessageStats;
|
|
245
|
+
partial?: boolean;
|
|
246
|
+
isSystemGenerated?: boolean;
|
|
247
|
+
isStreaming?: boolean;
|
|
248
|
+
messageKind?: 'correction' | 'auto-prompt' | 'context-reset' | 'task-completed' | 'workflow-started' | 'command';
|
|
249
|
+
isCompactionSummary?: boolean;
|
|
250
|
+
subAgentId?: string;
|
|
251
|
+
subAgentType?: string;
|
|
252
|
+
promptContext?: PromptContext;
|
|
253
|
+
attachments?: Attachment[];
|
|
254
|
+
}
|
|
255
|
+
interface ToolCall {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
arguments: Record<string, unknown>;
|
|
259
|
+
result?: ToolResult;
|
|
260
|
+
startedAt?: number;
|
|
261
|
+
streamingOutput?: Array<{
|
|
262
|
+
stream: 'stdout' | 'stderr';
|
|
263
|
+
content: string;
|
|
264
|
+
}>;
|
|
265
|
+
parseError?: string;
|
|
266
|
+
rawArguments?: string;
|
|
267
|
+
}
|
|
268
|
+
/** A single line of context around an edit */
|
|
269
|
+
interface EditContextLine {
|
|
270
|
+
lineNumber: number;
|
|
271
|
+
content: string;
|
|
272
|
+
}
|
|
273
|
+
/** A single edit within a region (for replace_all with multiple matches) */
|
|
274
|
+
interface EditContextEdit {
|
|
275
|
+
startLine: number;
|
|
276
|
+
endLine: number;
|
|
277
|
+
oldContent: string;
|
|
278
|
+
newContent: string;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* A region of the file showing context around one or more edits.
|
|
282
|
+
* Multiple edits are merged when their contexts overlap.
|
|
283
|
+
*/
|
|
284
|
+
interface EditContextRegion {
|
|
285
|
+
beforeContext: EditContextLine[];
|
|
286
|
+
afterContext: EditContextLine[];
|
|
287
|
+
startLine: number;
|
|
288
|
+
endLine: number;
|
|
289
|
+
oldContent: string;
|
|
290
|
+
newContent: string;
|
|
291
|
+
edits: EditContextEdit[];
|
|
292
|
+
}
|
|
293
|
+
interface ToolResult {
|
|
294
|
+
success: boolean;
|
|
295
|
+
output?: string;
|
|
296
|
+
error?: string;
|
|
297
|
+
durationMs: number;
|
|
298
|
+
truncated: boolean;
|
|
299
|
+
diagnostics?: Diagnostic[];
|
|
300
|
+
editContext?: {
|
|
301
|
+
regions: EditContextRegion[];
|
|
302
|
+
};
|
|
303
|
+
metadata?: Record<string, unknown>;
|
|
304
|
+
}
|
|
305
|
+
type ToolName = 'read_file' | 'write_file' | 'edit_file' | 'run_command' | 'glob' | 'grep' | 'ask_user' | 'add_criterion' | 'update_criterion' | 'remove_criterion' | 'get_criteria' | 'complete_criterion' | 'pass_criterion' | 'fail_criterion' | 'todo_write' | 'web_fetch';
|
|
306
|
+
interface Criterion {
|
|
307
|
+
id: string;
|
|
308
|
+
description: string;
|
|
309
|
+
status: CriterionStatus;
|
|
310
|
+
attempts: CriterionAttempt[];
|
|
311
|
+
}
|
|
312
|
+
type CriterionStatus = {
|
|
313
|
+
type: 'pending';
|
|
314
|
+
} | {
|
|
315
|
+
type: 'in_progress';
|
|
316
|
+
} | {
|
|
317
|
+
type: 'completed';
|
|
318
|
+
completedAt: string;
|
|
319
|
+
reason?: string;
|
|
320
|
+
} | {
|
|
321
|
+
type: 'passed';
|
|
322
|
+
verifiedAt: string;
|
|
323
|
+
reason?: string;
|
|
324
|
+
} | {
|
|
325
|
+
type: 'failed';
|
|
326
|
+
reason: string;
|
|
327
|
+
failedAt: string;
|
|
328
|
+
};
|
|
329
|
+
interface CriterionAttempt {
|
|
330
|
+
attemptNumber: number;
|
|
331
|
+
status: 'passed' | 'failed';
|
|
332
|
+
timestamp: string;
|
|
333
|
+
details?: string;
|
|
334
|
+
}
|
|
335
|
+
interface Todo {
|
|
336
|
+
content: string;
|
|
337
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
338
|
+
}
|
|
339
|
+
interface FileReadEntry {
|
|
340
|
+
hash: string;
|
|
341
|
+
readAt: string;
|
|
342
|
+
}
|
|
343
|
+
interface ExecutionState {
|
|
344
|
+
iteration: number;
|
|
345
|
+
modifiedFiles: string[];
|
|
346
|
+
readFiles: Record<string, FileReadEntry>;
|
|
347
|
+
consecutiveFailures: number;
|
|
348
|
+
lastFailedTool?: string;
|
|
349
|
+
lastFailureReason?: string;
|
|
350
|
+
currentTokenCount: number;
|
|
351
|
+
messageCountAtLastUpdate: number;
|
|
352
|
+
compactionCount: number;
|
|
353
|
+
startedAt: string;
|
|
354
|
+
lastActivityAt: string;
|
|
355
|
+
}
|
|
356
|
+
interface ContextState {
|
|
357
|
+
currentTokens: number;
|
|
358
|
+
maxTokens: number;
|
|
359
|
+
compactionCount: number;
|
|
360
|
+
dangerZone: boolean;
|
|
361
|
+
canCompact: boolean;
|
|
362
|
+
}
|
|
363
|
+
interface ValidationResult {
|
|
364
|
+
allPassed: boolean;
|
|
365
|
+
results: CriterionValidation[];
|
|
366
|
+
}
|
|
367
|
+
interface CriterionValidation {
|
|
368
|
+
criterionId: string;
|
|
369
|
+
status: 'pass' | 'fail';
|
|
370
|
+
reasoning: string;
|
|
371
|
+
issues: string[];
|
|
372
|
+
}
|
|
373
|
+
interface Diagnostic {
|
|
374
|
+
path: string;
|
|
375
|
+
range: {
|
|
376
|
+
start: {
|
|
377
|
+
line: number;
|
|
378
|
+
character: number;
|
|
379
|
+
};
|
|
380
|
+
end: {
|
|
381
|
+
line: number;
|
|
382
|
+
character: number;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
severity: 'error' | 'warning' | 'info' | 'hint';
|
|
386
|
+
message: string;
|
|
387
|
+
source: string;
|
|
388
|
+
code?: string | number;
|
|
389
|
+
}
|
|
390
|
+
/** Supported LLM inference backends */
|
|
391
|
+
type LlmBackend = 'vllm' | 'sglang' | 'ollama' | 'llamacpp' | 'unknown';
|
|
392
|
+
/** Extended backend type including cloud providers */
|
|
393
|
+
type ProviderBackend = LlmBackend | 'openai' | 'anthropic' | 'auto';
|
|
394
|
+
/** LLM provider configuration */
|
|
395
|
+
interface Provider {
|
|
396
|
+
id: string;
|
|
397
|
+
name: string;
|
|
398
|
+
url: string;
|
|
399
|
+
backend: ProviderBackend;
|
|
400
|
+
apiKey?: string | undefined;
|
|
401
|
+
maxContext?: number | undefined;
|
|
402
|
+
isActive: boolean;
|
|
403
|
+
createdAt: string;
|
|
404
|
+
}
|
|
405
|
+
interface Config {
|
|
406
|
+
llm: {
|
|
407
|
+
baseUrl: string;
|
|
408
|
+
model: string;
|
|
409
|
+
timeout: number;
|
|
410
|
+
idleTimeout: number;
|
|
411
|
+
/** Backend type - 'auto' for auto-detection, or explicit backend name */
|
|
412
|
+
backend: LlmBackend | 'auto';
|
|
413
|
+
/** Disable thinking/reasoning globally (for e2e tests) */
|
|
414
|
+
disableThinking?: boolean;
|
|
415
|
+
};
|
|
416
|
+
context: {
|
|
417
|
+
maxTokens: number;
|
|
418
|
+
compactionThreshold: number;
|
|
419
|
+
compactionTarget: number;
|
|
420
|
+
};
|
|
421
|
+
agent: {
|
|
422
|
+
maxIterations: number;
|
|
423
|
+
maxConsecutiveFailures: number;
|
|
424
|
+
toolTimeout: number;
|
|
425
|
+
};
|
|
426
|
+
server: {
|
|
427
|
+
port: number;
|
|
428
|
+
host: string;
|
|
429
|
+
openBrowser?: boolean;
|
|
430
|
+
};
|
|
431
|
+
database: {
|
|
432
|
+
path: string;
|
|
433
|
+
};
|
|
434
|
+
logging?: {
|
|
435
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
436
|
+
};
|
|
437
|
+
mode?: 'development' | 'production';
|
|
438
|
+
dev?: boolean;
|
|
439
|
+
/** Configured providers (loaded from global config) */
|
|
440
|
+
providers?: Provider[] | undefined;
|
|
441
|
+
/** Default model selection in format "providerId/modelName" */
|
|
442
|
+
defaultModelSelection?: string | undefined;
|
|
443
|
+
/** ID of the active provider (deprecated, use defaultModelSelection) */
|
|
444
|
+
activeProviderId?: string | undefined;
|
|
445
|
+
/** Workspace directory for projects */
|
|
446
|
+
workdir: string;
|
|
447
|
+
/** Active workflow ID (defaults to "default") */
|
|
448
|
+
activeWorkflowId?: string | undefined;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
type ClientMessageType = 'project.create' | 'project.create-with-dir' | 'project.list' | 'project.load' | 'project.update' | 'project.delete' | 'session.create' | 'session.load' | 'session.list' | 'session.delete' | 'session.deleteAll' | 'chat.send' | 'chat.stop' | 'chat.continue' | 'mode.switch' | 'mode.accept' | 'criteria.edit' | 'context.compact' | 'runner.launch' | 'path.confirm' | 'settings.get' | 'settings.set' | 'provider.activate' | 'session.setProvider' | 'queue.asap' | 'queue.completion' | 'queue.cancel';
|
|
452
|
+
interface ClientMessage<T = unknown> {
|
|
453
|
+
id: string;
|
|
454
|
+
type: ClientMessageType;
|
|
455
|
+
payload: T;
|
|
456
|
+
}
|
|
457
|
+
interface ProjectCreatePayload {
|
|
458
|
+
name: string;
|
|
459
|
+
workdir: string;
|
|
460
|
+
}
|
|
461
|
+
interface ProjectCreateWithDirPayload {
|
|
462
|
+
name: string;
|
|
463
|
+
}
|
|
464
|
+
interface ProjectLoadPayload {
|
|
465
|
+
projectId: string;
|
|
466
|
+
}
|
|
467
|
+
interface ProjectUpdatePayload {
|
|
468
|
+
projectId: string;
|
|
469
|
+
name?: string;
|
|
470
|
+
customInstructions?: string | null;
|
|
471
|
+
}
|
|
472
|
+
interface ProjectDeletePayload {
|
|
473
|
+
projectId: string;
|
|
474
|
+
}
|
|
475
|
+
interface SessionCreatePayload {
|
|
476
|
+
projectId: string;
|
|
477
|
+
title?: string;
|
|
478
|
+
}
|
|
479
|
+
interface SessionLoadPayload {
|
|
480
|
+
sessionId: string;
|
|
481
|
+
lastEventSeq?: number;
|
|
482
|
+
}
|
|
483
|
+
interface SessionDeleteAllPayload {
|
|
484
|
+
projectId: string;
|
|
485
|
+
}
|
|
486
|
+
interface ChatSendPayload {
|
|
487
|
+
content: string;
|
|
488
|
+
attachments?: Attachment[];
|
|
489
|
+
messageKind?: 'command';
|
|
490
|
+
isSystemGenerated?: boolean;
|
|
491
|
+
}
|
|
492
|
+
interface ModeSwitchPayload {
|
|
493
|
+
mode: SessionMode;
|
|
494
|
+
}
|
|
495
|
+
interface CriteriaEditPayload {
|
|
496
|
+
criteria: Criterion[];
|
|
497
|
+
}
|
|
498
|
+
interface SettingsGetPayload {
|
|
499
|
+
key: string;
|
|
500
|
+
}
|
|
501
|
+
interface SettingsSetPayload {
|
|
502
|
+
key: string;
|
|
503
|
+
value: string;
|
|
504
|
+
}
|
|
505
|
+
interface SettingsValuePayload {
|
|
506
|
+
key: string;
|
|
507
|
+
value: string | null;
|
|
508
|
+
}
|
|
509
|
+
interface ProviderActivatePayload {
|
|
510
|
+
providerId: string;
|
|
511
|
+
}
|
|
512
|
+
interface SessionSetProviderPayload {
|
|
513
|
+
providerId: string;
|
|
514
|
+
model?: string;
|
|
515
|
+
}
|
|
516
|
+
interface QueueAsapPayload {
|
|
517
|
+
content: string;
|
|
518
|
+
attachments?: Attachment[];
|
|
519
|
+
}
|
|
520
|
+
interface QueueCompletionPayload {
|
|
521
|
+
content: string;
|
|
522
|
+
attachments?: Attachment[];
|
|
523
|
+
}
|
|
524
|
+
interface QueueCancelPayload {
|
|
525
|
+
queueId: string;
|
|
526
|
+
}
|
|
527
|
+
interface QueuedMessage {
|
|
528
|
+
queueId: string;
|
|
529
|
+
mode: 'asap' | 'completion';
|
|
530
|
+
content: string;
|
|
531
|
+
attachments?: Attachment[];
|
|
532
|
+
queuedAt: string;
|
|
533
|
+
}
|
|
534
|
+
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.summary' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.error' | 'chat.path_confirmation' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'lsp.diagnostics' | 'error' | 'ack';
|
|
535
|
+
interface ServerMessage<T = unknown> {
|
|
536
|
+
id?: string;
|
|
537
|
+
type: ServerMessageType;
|
|
538
|
+
payload: T;
|
|
539
|
+
seq?: number;
|
|
540
|
+
sessionId?: string;
|
|
541
|
+
}
|
|
542
|
+
interface ProjectStatePayload {
|
|
543
|
+
project: Project;
|
|
544
|
+
}
|
|
545
|
+
interface ProjectListPayload {
|
|
546
|
+
projects: Project[];
|
|
547
|
+
}
|
|
548
|
+
interface ProjectDeletedPayload {
|
|
549
|
+
projectId: string;
|
|
550
|
+
}
|
|
551
|
+
interface SessionStatePayload {
|
|
552
|
+
session: Session;
|
|
553
|
+
messages: Message[];
|
|
554
|
+
}
|
|
555
|
+
interface SessionListPayload {
|
|
556
|
+
sessions: SessionSummary[];
|
|
557
|
+
}
|
|
558
|
+
interface SessionRunningPayload {
|
|
559
|
+
isRunning: boolean;
|
|
560
|
+
}
|
|
561
|
+
interface SessionNameGeneratedPayload {
|
|
562
|
+
name: string;
|
|
563
|
+
}
|
|
564
|
+
interface ChatDeltaPayload {
|
|
565
|
+
messageId: string;
|
|
566
|
+
content: string;
|
|
567
|
+
}
|
|
568
|
+
interface ChatThinkingPayload {
|
|
569
|
+
messageId: string;
|
|
570
|
+
content: string;
|
|
571
|
+
}
|
|
572
|
+
interface ChatToolPreparingPayload {
|
|
573
|
+
messageId: string;
|
|
574
|
+
index: number;
|
|
575
|
+
name: string;
|
|
576
|
+
}
|
|
577
|
+
interface ChatToolCallPayload {
|
|
578
|
+
messageId: string;
|
|
579
|
+
callId: string;
|
|
580
|
+
tool: string;
|
|
581
|
+
args: Record<string, unknown>;
|
|
582
|
+
}
|
|
583
|
+
interface ChatToolResultPayload {
|
|
584
|
+
messageId: string;
|
|
585
|
+
callId: string;
|
|
586
|
+
tool: string;
|
|
587
|
+
result: ToolResult;
|
|
588
|
+
}
|
|
589
|
+
interface ChatToolOutputPayload {
|
|
590
|
+
messageId: string;
|
|
591
|
+
callId: string;
|
|
592
|
+
output: string;
|
|
593
|
+
stream: 'stdout' | 'stderr';
|
|
594
|
+
}
|
|
595
|
+
interface ChatTodoPayload {
|
|
596
|
+
todos: Todo[];
|
|
597
|
+
}
|
|
598
|
+
interface ChatSummaryPayload {
|
|
599
|
+
summary: string;
|
|
600
|
+
}
|
|
601
|
+
interface ChatProgressPayload {
|
|
602
|
+
message: string;
|
|
603
|
+
phase?: 'summary' | 'mode_switch' | 'starting' | 'context_warning' | 'context_error';
|
|
604
|
+
}
|
|
605
|
+
interface ChatFormatRetryPayload {
|
|
606
|
+
attempt: number;
|
|
607
|
+
maxAttempts: number;
|
|
608
|
+
}
|
|
609
|
+
interface ChatMessagePayload {
|
|
610
|
+
message: Message;
|
|
611
|
+
}
|
|
612
|
+
interface ChatMessageUpdatedPayload {
|
|
613
|
+
messageId: string;
|
|
614
|
+
updates: Partial<Pick<Message, 'content' | 'thinkingContent' | 'toolCalls' | 'isStreaming' | 'stats' | 'promptContext' | 'partial'>>;
|
|
615
|
+
}
|
|
616
|
+
interface ChatDonePayload {
|
|
617
|
+
messageId: string;
|
|
618
|
+
reason: 'complete' | 'stopped' | 'error' | 'waiting_for_user';
|
|
619
|
+
stats?: {
|
|
620
|
+
model: string;
|
|
621
|
+
mode: ToolMode;
|
|
622
|
+
totalTime: number;
|
|
623
|
+
toolTime: number;
|
|
624
|
+
prefillTokens: number;
|
|
625
|
+
prefillSpeed: number;
|
|
626
|
+
generationTokens: number;
|
|
627
|
+
generationSpeed: number;
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
interface ChatErrorPayload {
|
|
631
|
+
error: string;
|
|
632
|
+
recoverable: boolean;
|
|
633
|
+
}
|
|
634
|
+
type PathConfirmationReason = 'outside_workdir' | 'sensitive_file' | 'both';
|
|
635
|
+
interface ChatPathConfirmationPayload {
|
|
636
|
+
callId: string;
|
|
637
|
+
tool: string;
|
|
638
|
+
paths: string[];
|
|
639
|
+
workdir: string;
|
|
640
|
+
reason: PathConfirmationReason;
|
|
641
|
+
}
|
|
642
|
+
interface PathConfirmPayload {
|
|
643
|
+
callId: string;
|
|
644
|
+
approved: boolean;
|
|
645
|
+
}
|
|
646
|
+
interface ModeChangedPayload {
|
|
647
|
+
mode: SessionMode;
|
|
648
|
+
auto: boolean;
|
|
649
|
+
reason?: string;
|
|
650
|
+
}
|
|
651
|
+
interface PhaseChangedPayload {
|
|
652
|
+
phase: SessionPhase;
|
|
653
|
+
}
|
|
654
|
+
interface TaskCompletedPayload {
|
|
655
|
+
summary: string | null;
|
|
656
|
+
iterations: number;
|
|
657
|
+
totalTimeSeconds: number;
|
|
658
|
+
totalToolCalls: number;
|
|
659
|
+
totalTokensGenerated: number;
|
|
660
|
+
avgGenerationSpeed: number;
|
|
661
|
+
responseCount: number;
|
|
662
|
+
llmCallCount: number;
|
|
663
|
+
criteria: Array<{
|
|
664
|
+
id: string;
|
|
665
|
+
description: string;
|
|
666
|
+
status: string;
|
|
667
|
+
}>;
|
|
668
|
+
workflowName?: string;
|
|
669
|
+
workflowId?: string;
|
|
670
|
+
workflowColor?: string;
|
|
671
|
+
}
|
|
672
|
+
interface CriteriaUpdatedPayload {
|
|
673
|
+
criteria: Criterion[];
|
|
674
|
+
changedId?: string;
|
|
675
|
+
}
|
|
676
|
+
interface ContextStatePayload {
|
|
677
|
+
context: ContextState;
|
|
678
|
+
}
|
|
679
|
+
interface ProviderChangedPayload {
|
|
680
|
+
providerId: string;
|
|
681
|
+
providerName: string;
|
|
682
|
+
model: string;
|
|
683
|
+
backend: string;
|
|
684
|
+
}
|
|
685
|
+
interface QueueStatePayload {
|
|
686
|
+
messages: QueuedMessage[];
|
|
687
|
+
}
|
|
688
|
+
interface LspDiagnosticsPayload {
|
|
689
|
+
path: string;
|
|
690
|
+
diagnostics: Diagnostic[];
|
|
691
|
+
}
|
|
692
|
+
interface ErrorPayload {
|
|
693
|
+
code: string;
|
|
694
|
+
message: string;
|
|
695
|
+
details?: unknown;
|
|
696
|
+
}
|
|
697
|
+
interface ContextCompactionEvent {
|
|
698
|
+
beforeTokens: number;
|
|
699
|
+
afterTokens: number;
|
|
700
|
+
}
|
|
701
|
+
interface AskUserEvent {
|
|
702
|
+
question: string;
|
|
703
|
+
callId: string;
|
|
704
|
+
}
|
|
705
|
+
type AgentEvent = {
|
|
706
|
+
type: 'aborted';
|
|
707
|
+
} | {
|
|
708
|
+
type: 'text_delta';
|
|
709
|
+
content: string;
|
|
710
|
+
} | {
|
|
711
|
+
type: 'thinking';
|
|
712
|
+
content: string;
|
|
713
|
+
} | {
|
|
714
|
+
type: 'error';
|
|
715
|
+
error: string;
|
|
716
|
+
recoverable: boolean;
|
|
717
|
+
} | {
|
|
718
|
+
type: 'context_compaction';
|
|
719
|
+
beforeTokens: number;
|
|
720
|
+
afterTokens: number;
|
|
721
|
+
} | {
|
|
722
|
+
type: 'done';
|
|
723
|
+
allCriteriaPassed: boolean;
|
|
724
|
+
summary: string;
|
|
725
|
+
stats: ChatDonePayload['stats'];
|
|
726
|
+
} | {
|
|
727
|
+
type: 'stuck';
|
|
728
|
+
reason: string;
|
|
729
|
+
failedAttempts: number;
|
|
730
|
+
} | {
|
|
731
|
+
type: 'tool_call';
|
|
732
|
+
callId: string;
|
|
733
|
+
tool: string;
|
|
734
|
+
args: Record<string, unknown>;
|
|
735
|
+
} | {
|
|
736
|
+
type: 'tool_result';
|
|
737
|
+
callId: string;
|
|
738
|
+
tool: string;
|
|
739
|
+
result: ToolResult;
|
|
740
|
+
} | {
|
|
741
|
+
type: 'tool_error';
|
|
742
|
+
callId: string;
|
|
743
|
+
tool: string;
|
|
744
|
+
error: string;
|
|
745
|
+
willRetry: boolean;
|
|
746
|
+
} | {
|
|
747
|
+
type: 'ask_user';
|
|
748
|
+
question: string;
|
|
749
|
+
callId: string;
|
|
750
|
+
} | {
|
|
751
|
+
type: 'format_retry';
|
|
752
|
+
attempt: number;
|
|
753
|
+
maxAttempts: number;
|
|
754
|
+
};
|
|
755
|
+
declare function createClientMessage<T>(type: ClientMessageType, payload: T): ClientMessage<T>;
|
|
756
|
+
declare function createServerMessage<T>(type: ServerMessageType, payload: T, correlationId?: string): ServerMessage<T>;
|
|
757
|
+
declare function isClientMessage(msg: unknown): msg is ClientMessage;
|
|
758
|
+
declare function isServerMessage(msg: unknown): msg is ServerMessage;
|
|
759
|
+
|
|
760
|
+
export { type PathConfirmationReason as $, type AgentEvent as A, type CriteriaUpdatedPayload as B, type CallStatsDataPoint as C, type Criterion as D, type CriterionAttempt as E, type CriterionStatus as F, type CriterionValidation as G, type Diagnostic as H, type EditContextEdit as I, type EditContextLine as J, type EditContextRegion as K, type ErrorPayload as L, type Message as M, type ExecutionState as N, type FileReadEntry as O, type InjectedFile as P, type LLMCallStats as Q, type LlmBackend as R, type SessionStats as S, type LspDiagnosticsPayload as T, type MessageRole as U, type MessageSegment as V, type MessageStats as W, type ModeChangedPayload as X, type ModeSwitchPayload as Y, type ModelSessionStats as Z, type PathConfirmPayload as _, type AskUserEvent as a, type PhaseChangedPayload as a0, type PreparingToolCall as a1, type Project as a2, type ProjectCreatePayload as a3, type ProjectCreateWithDirPayload as a4, type ProjectDeletePayload as a5, type ProjectDeletedPayload as a6, type ProjectListPayload as a7, type ProjectLoadPayload as a8, type ProjectStatePayload as a9, type SessionRunningPayload as aA, type SessionSetProviderPayload as aB, type SessionStatePayload as aC, type SessionSummary as aD, type SettingsGetPayload as aE, type SettingsSetPayload as aF, type SettingsValuePayload as aG, type StatsDataPoint as aH, type StatsIdentity as aI, type TaskCompletedPayload as aJ, type Todo as aK, type ToolCall as aL, type ToolMode as aM, type ToolName as aN, type ToolResult as aO, type ValidationResult as aP, createClientMessage as aQ, createServerMessage as aR, isClientMessage as aS, isServerMessage as aT, type ProjectUpdatePayload as aa, type PromptContext as ab, type PromptContextMessage as ac, type PromptContextTool as ad, type PromptRequestOptions as ae, type Provider as af, type ProviderActivatePayload as ag, type ProviderBackend as ah, type ProviderChangedPayload as ai, type QueueAsapPayload as aj, type QueueCancelPayload as ak, type QueueCompletionPayload as al, type QueueStatePayload as am, type QueuedMessage as an, type RecentUserPrompt as ao, type ServerMessage as ap, type ServerMessageType as aq, type Session as ar, type SessionCreatePayload as as, type SessionDeleteAllPayload as at, type SessionListPayload as au, type SessionLoadPayload as av, type SessionMetadata as aw, type SessionMode as ax, type SessionNameGeneratedPayload as ay, type SessionPhase as az, type Attachment as b, type ChatDeltaPayload as c, type ChatDonePayload as d, type ChatErrorPayload as e, type ChatFormatRetryPayload as f, type ChatMessagePayload as g, type ChatMessageUpdatedPayload as h, type ChatPathConfirmationPayload as i, type ChatProgressPayload as j, type ChatSendPayload as k, type ChatSummaryPayload as l, type ChatThinkingPayload as m, type ChatTodoPayload as n, type ChatToolCallPayload as o, type ChatToolOutputPayload as p, type ChatToolPreparingPayload as q, type ChatToolResultPayload as r, type ClientMessage as s, type ClientMessageType as t, type Config as u, type ContextCompactionEvent as v, type ContextState as w, type ContextStatePayload as x, type ContextWindow as y, type CriteriaEditPayload as z };
|