openfox 2.0.62 → 2.0.64
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 +14 -0
- package/dist/{chat-handler-TRAITVLO.js → chat-handler-LI4R4Z2E.js} +11 -11
- package/dist/{chunk-L4WACPUX.js → chunk-73N5CJH3.js} +5 -5
- package/dist/{chunk-BKTBHEPY.js → chunk-HZNY77HZ.js} +32 -42
- package/dist/{chunk-QZRS2RF5.js → chunk-JFQSQO2N.js} +362 -92
- package/dist/{chunk-3WL5YCP6.js → chunk-O3G6X5CT.js} +6 -6
- package/dist/{chunk-GJU35MDV.js → chunk-OESYKZCM.js} +2 -2
- package/dist/{chunk-JKLPWTUN.js → chunk-QBYQ7KDX.js} +9 -4
- package/dist/{chunk-NVPVDDQZ.js → chunk-QJ5FH5DP.js} +14 -10
- package/dist/{chunk-H774GQJW.js → chunk-RYIREJAW.js} +234 -40
- package/dist/{chunk-WEB4WBUF.js → chunk-WD75RSGR.js} +149 -117
- package/dist/{chunk-43UFGATL.js → chunk-WGAAQASA.js} +31 -9
- package/dist/{chunk-6VDCH5ML.js → chunk-X5YCWKNS.js} +4 -4
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{client-KRFGMNGN.js → client-LAKW7TA5.js} +3 -3
- package/dist/{compactor-Q33AJPCQ.js → compactor-I3N56PSJ.js} +4 -4
- package/dist/{config-GMQUPNBY.js → config-EUMVEFHU.js} +2 -2
- package/dist/{orchestrator-TQ23BAFQ.js → orchestrator-PFN7C5JI.js} +14 -14
- package/dist/package.json +5 -1
- package/dist/{processor-3ZOFGZP5.js → processor-AYYXP5NS.js} +13 -12
- package/dist/protocol-Cq66hdDX.d.ts +375 -0
- package/dist/provider/index.d.ts +129 -0
- package/dist/provider/index.js +1 -0
- package/dist/{provider-LBYBC5AG.js → provider-GYOW4OWQ.js} +7 -9
- package/dist/{provider-manager-ABEUYU3K.js → provider-manager-HRHNF73A.js} +4 -5
- package/dist/{serve-CNA5NKOR.js → serve-54KALE6R.js} +15 -16
- package/dist/server/index.d.ts +6 -87
- package/dist/server/index.js +12 -13
- package/dist/{server-CI5IEBOC.js → server-Z2A5YZM6.js} +10 -14
- package/dist/shared/index.d.ts +3 -2
- package/dist/{tools-33FQNFKC.js → tools-R6LPK6OS.js} +7 -7
- package/dist/types-CDZakn7f.d.ts +89 -0
- package/dist/{protocol-J7khRG62.d.ts → types-akHmgvBk.d.ts} +17 -373
- package/dist/web/assets/{index-CETZPQXr.js → index-CkE65FP4.js} +74 -73
- package/dist/web/assets/{index-BGkyTfuQ.css → index-DvPmgi8F.css} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +5 -1
- package/dist/chunk-M3RB4IF6.js +0 -114
|
@@ -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 };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { r as ModelConfig } from '../types-akHmgvBk.js';
|
|
2
|
+
export { J as ToolCall } from '../types-akHmgvBk.js';
|
|
3
|
+
import { L as LLMCompletionRequest, a as LLMCompletionResponse, b as LLMStreamEvent } from '../types-CDZakn7f.js';
|
|
4
|
+
export { c as LLMMessage, d as LLMToolDefinition } from '../types-CDZakn7f.js';
|
|
5
|
+
|
|
6
|
+
type ProviderAuthState = 'disconnected' | 'pending' | 'connected' | 'expired' | 'error';
|
|
7
|
+
interface ProviderAuthStatus {
|
|
8
|
+
state: ProviderAuthState;
|
|
9
|
+
accountLabel?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ProviderLoginChallenge {
|
|
13
|
+
mode: 'device' | 'browser' | 'external';
|
|
14
|
+
verificationUrl: string;
|
|
15
|
+
directUrl?: string;
|
|
16
|
+
userCode?: string;
|
|
17
|
+
instructions: string;
|
|
18
|
+
expiresAt?: string;
|
|
19
|
+
intervalSeconds?: number;
|
|
20
|
+
}
|
|
21
|
+
interface ProviderLoginResult {
|
|
22
|
+
credentialRef: string;
|
|
23
|
+
}
|
|
24
|
+
interface ProviderAccessContext {
|
|
25
|
+
accessToken?: string;
|
|
26
|
+
accountId?: string;
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
}
|
|
29
|
+
interface ProviderAuthAdapter {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
beginLogin(context: {
|
|
32
|
+
providerId: string;
|
|
33
|
+
}): Promise<{
|
|
34
|
+
challenge: ProviderLoginChallenge;
|
|
35
|
+
completion: Promise<ProviderLoginResult>;
|
|
36
|
+
}>;
|
|
37
|
+
getStatus(context: {
|
|
38
|
+
providerId: string;
|
|
39
|
+
credentialRef?: string;
|
|
40
|
+
}): Promise<ProviderAuthStatus>;
|
|
41
|
+
getAccessContext(credentialRef: string): Promise<ProviderAccessContext>;
|
|
42
|
+
logout(credentialRef: string): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
interface ProviderRequestContext {
|
|
45
|
+
providerId: string;
|
|
46
|
+
credentialRef?: string;
|
|
47
|
+
auth?: ProviderAccessContext;
|
|
48
|
+
model?: string;
|
|
49
|
+
catalogModel?: string;
|
|
50
|
+
requestBody?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
interface ProviderTransportAdapter {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
listModels(context: ProviderRequestContext): Promise<ModelConfig[]>;
|
|
55
|
+
complete(request: LLMCompletionRequest, context: ProviderRequestContext): Promise<LLMCompletionResponse>;
|
|
56
|
+
stream(request: LLMCompletionRequest, context: ProviderRequestContext): AsyncIterable<LLMStreamEvent>;
|
|
57
|
+
}
|
|
58
|
+
/** Describes a provider preset shown in the UI setup wizard. */
|
|
59
|
+
interface ProviderPreset {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
documentationUrl?: string;
|
|
64
|
+
requiresAuth: boolean;
|
|
65
|
+
authAdapter?: string;
|
|
66
|
+
transportAdapter?: string;
|
|
67
|
+
defaults: {
|
|
68
|
+
name?: string;
|
|
69
|
+
url: string;
|
|
70
|
+
backend: string;
|
|
71
|
+
models?: ModelConfig[];
|
|
72
|
+
};
|
|
73
|
+
connectLabel?: string;
|
|
74
|
+
disconnectLabel?: string;
|
|
75
|
+
missingPluginMessage?: string;
|
|
76
|
+
}
|
|
77
|
+
interface ProviderPluginRuntime {
|
|
78
|
+
readonly mode: 'production' | 'development';
|
|
79
|
+
readonly configDirectory: string;
|
|
80
|
+
}
|
|
81
|
+
interface ProviderPluginRegistry {
|
|
82
|
+
registerAuth(adapter: ProviderAuthAdapter): void;
|
|
83
|
+
registerTransport(adapter: ProviderTransportAdapter): void;
|
|
84
|
+
registerPreset(preset: ProviderPreset): void;
|
|
85
|
+
readonly runtime: ProviderPluginRuntime;
|
|
86
|
+
}
|
|
87
|
+
/** Describes an auth adapter contributed by a plugin (for UI metadata). */
|
|
88
|
+
interface PluginAuthDescriptor {
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
authUI?: {
|
|
92
|
+
type: 'device' | 'oauth' | 'api-key';
|
|
93
|
+
instructions?: string;
|
|
94
|
+
connectLabel?: string;
|
|
95
|
+
disconnectLabel?: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/** Describes a transport adapter contributed by a plugin. */
|
|
99
|
+
interface PluginTransportDescriptor {
|
|
100
|
+
id: string;
|
|
101
|
+
label: string;
|
|
102
|
+
}
|
|
103
|
+
/** A provider plugin manifest describes everything a plugin contributes. */
|
|
104
|
+
interface ProviderPluginManifest {
|
|
105
|
+
/** Unique plugin ID (npm package name). */
|
|
106
|
+
id: string;
|
|
107
|
+
/** Human-readable name. */
|
|
108
|
+
name: string;
|
|
109
|
+
/** Semver version string. */
|
|
110
|
+
version: string;
|
|
111
|
+
/** Auth adapters this plugin provides. */
|
|
112
|
+
authAdapters: PluginAuthDescriptor[];
|
|
113
|
+
/** Transport adapters this plugin provides. */
|
|
114
|
+
transportAdapters: PluginTransportDescriptor[];
|
|
115
|
+
}
|
|
116
|
+
/** A provider plugin registers adapters and presets with the runtime. */
|
|
117
|
+
interface ProviderPlugin {
|
|
118
|
+
readonly manifest: ProviderPluginManifest;
|
|
119
|
+
register(registry: ProviderPluginRegistry): void;
|
|
120
|
+
}
|
|
121
|
+
/** Frontend-facing metadata for a registered adapter. */
|
|
122
|
+
interface ProviderAdapterMeta {
|
|
123
|
+
id: string;
|
|
124
|
+
kind: 'auth' | 'transport';
|
|
125
|
+
label: string;
|
|
126
|
+
authUI?: PluginAuthDescriptor['authUI'];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { LLMCompletionRequest, LLMCompletionResponse, LLMStreamEvent, ModelConfig, type PluginAuthDescriptor, type PluginTransportDescriptor, type ProviderAccessContext, type ProviderAdapterMeta, type ProviderAuthAdapter, type ProviderAuthState, type ProviderAuthStatus, type ProviderLoginChallenge, type ProviderLoginResult, type ProviderPlugin, type ProviderPluginManifest, type ProviderPluginRegistry, type ProviderPluginRuntime, type ProviderPreset, type ProviderRequestContext, type ProviderTransportAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -9,13 +9,12 @@ import {
|
|
|
9
9
|
be
|
|
10
10
|
} from "./chunk-XY3LESVZ.js";
|
|
11
11
|
import {
|
|
12
|
+
detectModel,
|
|
12
13
|
fetchAvailableModelsFromBackend
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
detectModel
|
|
16
|
-
} from "./chunk-M3RB4IF6.js";
|
|
14
|
+
} from "./chunk-RYIREJAW.js";
|
|
17
15
|
import "./chunk-J2GP3J3X.js";
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-QBYQ7KDX.js";
|
|
17
|
+
import "./chunk-V4IE7HJY.js";
|
|
19
18
|
import "./chunk-YHEQTVFV.js";
|
|
20
19
|
import "./chunk-HNCM3D7Y.js";
|
|
21
20
|
import "./chunk-Z6W4YHJB.js";
|
|
@@ -28,9 +27,8 @@ import {
|
|
|
28
27
|
loadGlobalConfig,
|
|
29
28
|
removeProvider,
|
|
30
29
|
saveGlobalConfig
|
|
31
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WGAAQASA.js";
|
|
32
31
|
import "./chunk-CQGTEGKL.js";
|
|
33
|
-
import "./chunk-V4IE7HJY.js";
|
|
34
32
|
import "./chunk-5WRI5ZAA.js";
|
|
35
33
|
|
|
36
34
|
// src/cli/provider.ts
|
|
@@ -270,7 +268,7 @@ async function runProviderAdd(mode) {
|
|
|
270
268
|
isActive: makeActive
|
|
271
269
|
});
|
|
272
270
|
if (makeActive) {
|
|
273
|
-
const { setDefaultModelSelection } = await import("./config-
|
|
271
|
+
const { setDefaultModelSelection } = await import("./config-EUMVEFHU.js");
|
|
274
272
|
newConfig = setDefaultModelSelection(
|
|
275
273
|
newConfig,
|
|
276
274
|
newConfig.providers[newConfig.providers.length - 1].id,
|
|
@@ -398,4 +396,4 @@ export {
|
|
|
398
396
|
runProviderRemove,
|
|
399
397
|
runProviderUse
|
|
400
398
|
};
|
|
401
|
-
//# sourceMappingURL=provider-
|
|
399
|
+
//# sourceMappingURL=provider-GYOW4OWQ.js.map
|
|
@@ -3,16 +3,15 @@ import {
|
|
|
3
3
|
fetchAvailableModelsFromBackend,
|
|
4
4
|
fetchModelsWithContext,
|
|
5
5
|
parseDefaultModelSelection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-M3RB4IF6.js";
|
|
6
|
+
} from "./chunk-RYIREJAW.js";
|
|
8
7
|
import "./chunk-J2GP3J3X.js";
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-QBYQ7KDX.js";
|
|
9
|
+
import "./chunk-V4IE7HJY.js";
|
|
10
10
|
import "./chunk-YHEQTVFV.js";
|
|
11
11
|
import "./chunk-HNCM3D7Y.js";
|
|
12
12
|
import "./chunk-Z6W4YHJB.js";
|
|
13
13
|
import "./chunk-ZO5EXQMG.js";
|
|
14
14
|
import "./chunk-K44MW7JJ.js";
|
|
15
|
-
import "./chunk-V4IE7HJY.js";
|
|
16
15
|
import "./chunk-5WRI5ZAA.js";
|
|
17
16
|
export {
|
|
18
17
|
createProviderManager,
|
|
@@ -20,4 +19,4 @@ export {
|
|
|
20
19
|
fetchModelsWithContext,
|
|
21
20
|
parseDefaultModelSelection
|
|
22
21
|
};
|
|
23
|
-
//# sourceMappingURL=provider-manager-
|
|
22
|
+
//# sourceMappingURL=provider-manager-HRHNF73A.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION,
|
|
3
3
|
createServer
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JFQSQO2N.js";
|
|
5
|
+
import "./chunk-HZNY77HZ.js";
|
|
6
|
+
import "./chunk-OESYKZCM.js";
|
|
7
|
+
import "./chunk-73N5CJH3.js";
|
|
8
|
+
import "./chunk-WD75RSGR.js";
|
|
9
|
+
import "./chunk-X5YCWKNS.js";
|
|
8
10
|
import "./chunk-LBGHZLLH.js";
|
|
9
11
|
import "./chunk-BGTEIA2S.js";
|
|
10
12
|
import "./chunk-PK2RMVMB.js";
|
|
11
13
|
import "./chunk-NWO6GRYE.js";
|
|
12
|
-
import "./chunk-F4PMNP7S.js";
|
|
13
|
-
import "./chunk-EU3WWTFH.js";
|
|
14
|
-
import "./chunk-SVSKQYFH.js";
|
|
15
|
-
import "./chunk-YQ3SOPBI.js";
|
|
16
|
-
import "./chunk-GJU35MDV.js";
|
|
17
|
-
import "./chunk-6VDCH5ML.js";
|
|
18
14
|
import {
|
|
19
15
|
loadConfig
|
|
20
16
|
} from "./chunk-AIJE3RYH.js";
|
|
21
17
|
import "./chunk-TMUBLQFC.js";
|
|
18
|
+
import "./chunk-F4PMNP7S.js";
|
|
19
|
+
import "./chunk-EU3WWTFH.js";
|
|
20
|
+
import "./chunk-SVSKQYFH.js";
|
|
21
|
+
import "./chunk-YQ3SOPBI.js";
|
|
22
22
|
import "./chunk-ZPIZLTWU.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-M3RB4IF6.js";
|
|
23
|
+
import "./chunk-RYIREJAW.js";
|
|
25
24
|
import "./chunk-J2GP3J3X.js";
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-QBYQ7KDX.js";
|
|
26
|
+
import "./chunk-V4IE7HJY.js";
|
|
27
27
|
import "./chunk-YHEQTVFV.js";
|
|
28
28
|
import "./chunk-HNCM3D7Y.js";
|
|
29
29
|
import "./chunk-Z6W4YHJB.js";
|
|
@@ -37,13 +37,12 @@ import {
|
|
|
37
37
|
getActiveProvider,
|
|
38
38
|
getDefaultModel,
|
|
39
39
|
loadGlobalConfig
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WGAAQASA.js";
|
|
41
41
|
import {
|
|
42
42
|
ensureDataDirExists,
|
|
43
43
|
getDatabasePath,
|
|
44
44
|
getGlobalConfigPath
|
|
45
45
|
} from "./chunk-CQGTEGKL.js";
|
|
46
|
-
import "./chunk-V4IE7HJY.js";
|
|
47
46
|
import "./chunk-5WRI5ZAA.js";
|
|
48
47
|
|
|
49
48
|
// src/server/utils/network.ts
|
|
@@ -205,4 +204,4 @@ async function runServe(options) {
|
|
|
205
204
|
export {
|
|
206
205
|
runServe
|
|
207
206
|
};
|
|
208
|
-
//# sourceMappingURL=serve-
|
|
207
|
+
//# sourceMappingURL=serve-54KALE6R.js.map
|