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.
Files changed (40) hide show
  1. package/README.md +14 -0
  2. package/dist/{chat-handler-TRAITVLO.js → chat-handler-LI4R4Z2E.js} +11 -11
  3. package/dist/{chunk-L4WACPUX.js → chunk-73N5CJH3.js} +5 -5
  4. package/dist/{chunk-BKTBHEPY.js → chunk-HZNY77HZ.js} +32 -42
  5. package/dist/{chunk-QZRS2RF5.js → chunk-JFQSQO2N.js} +362 -92
  6. package/dist/{chunk-3WL5YCP6.js → chunk-O3G6X5CT.js} +6 -6
  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-WEB4WBUF.js → chunk-WD75RSGR.js} +149 -117
  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-TQ23BAFQ.js → orchestrator-PFN7C5JI.js} +14 -14
  20. package/dist/package.json +5 -1
  21. package/dist/{processor-3ZOFGZP5.js → processor-AYYXP5NS.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-CNA5NKOR.js → serve-54KALE6R.js} +15 -16
  28. package/dist/server/index.d.ts +6 -87
  29. package/dist/server/index.js +12 -13
  30. package/dist/{server-CI5IEBOC.js → server-Z2A5YZM6.js} +10 -14
  31. package/dist/shared/index.d.ts +3 -2
  32. package/dist/{tools-33FQNFKC.js → tools-R6LPK6OS.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-CETZPQXr.js → index-CkE65FP4.js} +74 -73
  36. package/dist/web/assets/{index-BGkyTfuQ.css → index-DvPmgi8F.css} +1 -1
  37. package/dist/web/index.html +2 -2
  38. package/dist/web/sw.js +1 -1
  39. package/package.json +5 -1
  40. package/dist/chunk-M3RB4IF6.js +0 -114
@@ -1,91 +1,7 @@
1
- import { aO as ToolCall, c as Attachment, R as Diagnostic, an as Provider, ab as ModelConfig, aA as Session, aJ as SessionSummary, aj as Project, aE as SessionMode, aG as SessionPhase, M as Message, J as Criterion, L as CriterionStatus, a8 as MetadataEntry, aw as QueuedMessage, F as ContextState, O as DangerLevel$1, ay as ServerMessage, aL as StatsIdentity, aR as ToolResult, D as Config } from '../protocol-J7khRG62.js';
1
+ import { h as Diagnostic, u as Provider, r as ModelConfig, w as Session, B as SessionSummary, t as Project, y as SessionMode, z as SessionPhase, M as Message, d as Criterion, f as CriterionStatus, q as MetadataEntry, A as Attachment, b as ContextState, D as DangerLevel$1, H as StatsIdentity, O as ToolResult, a as Config } from '../types-akHmgvBk.js';
2
2
  import { Server } from 'node:http';
3
-
4
- interface LLMMessage {
5
- role: 'system' | 'user' | 'assistant' | 'tool';
6
- content: string;
7
- thinkingContent?: string;
8
- toolCalls?: ToolCall[];
9
- toolCallId?: string;
10
- name?: string;
11
- attachments?: Attachment[];
12
- }
13
- interface LLMToolDefinition {
14
- type: 'function';
15
- function: {
16
- name: string;
17
- description: string;
18
- parameters: Record<string, unknown>;
19
- };
20
- }
21
- type ReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
22
- interface LLMCompletionRequest {
23
- messages: LLMMessage[];
24
- tools?: LLMToolDefinition[];
25
- toolChoice?: 'auto' | 'none' | 'required' | {
26
- type: 'function';
27
- function: {
28
- name: string;
29
- };
30
- };
31
- temperature?: number;
32
- maxTokens?: number;
33
- stream?: boolean;
34
- signal?: AbortSignal;
35
- reasoningEffort?: ReasoningEffort;
36
- modelSettings?: {
37
- temperature?: number;
38
- topP?: number;
39
- topK?: number;
40
- maxTokens?: number;
41
- supportsVision?: boolean;
42
- chatTemplateKwargs?: Record<string, unknown>;
43
- queryParams?: Record<string, unknown>;
44
- };
45
- /** When true, include the raw API response body in the result */
46
- returnRaw?: boolean;
47
- /** When true, the client-level reasoningEffort (from thinkingLevel) is NOT applied.
48
- * Used by non-thinking callers (e.g. title generation) that want to opt out. */
49
- skipClientReasoningEffort?: boolean;
50
- }
51
- interface LLMCompletionResponse {
52
- id: string;
53
- content: string;
54
- toolCalls?: ToolCall[];
55
- thinkingContent?: string;
56
- reasoning_content?: string;
57
- finishReason: 'stop' | 'tool_calls' | 'length' | 'content_filter';
58
- usage: {
59
- promptTokens: number;
60
- completionTokens: number;
61
- totalTokens: number;
62
- };
63
- /** Raw API response body, only set when returnRaw was requested */
64
- raw?: string;
65
- }
66
- type LLMStreamEvent = {
67
- type: 'text_delta';
68
- content: string;
69
- } | {
70
- type: 'thinking_delta';
71
- content: string;
72
- } | {
73
- type: 'tool_call_delta';
74
- index: number;
75
- id?: string;
76
- name?: string;
77
- arguments?: string;
78
- } | {
79
- type: 'done';
80
- response: LLMCompletionResponse;
81
- } | {
82
- type: 'error';
83
- error: string;
84
- };
85
- interface LLMClient {
86
- complete(request: LLMCompletionRequest): Promise<LLMCompletionResponse>;
87
- stream(request: LLMCompletionRequest): AsyncIterable<LLMStreamEvent>;
88
- }
3
+ import { e as LLMClient, d as LLMToolDefinition } from '../types-CDZakn7f.js';
4
+ import { a0 as QueuedMessage, a1 as ServerMessage } from '../protocol-Cq66hdDX.js';
89
5
 
90
6
  /**
91
7
  * Model-specific configuration profiles.
@@ -214,6 +130,8 @@ interface ModelSettingsUpdate {
214
130
  }
215
131
  interface ProviderManager {
216
132
  getProviders(): Provider[];
133
+ createClient(providerId: string, model: string): LLMClientWithModel | undefined;
134
+ resolveModel(providerId: string, model?: string): string | undefined;
217
135
  getActiveProvider(): Provider | undefined;
218
136
  getActiveProviderId(): string | undefined;
219
137
  getCurrentModel(): string | undefined;
@@ -624,6 +542,7 @@ interface ToolContext {
624
542
  sessionId: string;
625
543
  sessionManager: SessionManager;
626
544
  dangerLevel?: DangerLevel$1;
545
+ isSubAgent?: boolean;
627
546
  signal?: AbortSignal | undefined;
628
547
  onProgress?: ((message: string) => void) | undefined;
629
548
  onEvent?: ((event: ServerMessage) => void) | undefined;
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  createServer,
3
3
  createServerHandle
4
- } from "../chunk-QZRS2RF5.js";
5
- import "../chunk-BKTBHEPY.js";
6
- import "../chunk-L4WACPUX.js";
7
- import "../chunk-WEB4WBUF.js";
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";
14
+ import "../chunk-AIJE3RYH.js";
15
+ import "../chunk-TMUBLQFC.js";
12
16
  import "../chunk-F4PMNP7S.js";
13
17
  import "../chunk-EU3WWTFH.js";
14
18
  import "../chunk-SVSKQYFH.js";
15
19
  import "../chunk-YQ3SOPBI.js";
16
- import "../chunk-GJU35MDV.js";
17
- import "../chunk-6VDCH5ML.js";
18
- import "../chunk-AIJE3RYH.js";
19
- import "../chunk-TMUBLQFC.js";
20
20
  import "../chunk-ZPIZLTWU.js";
21
- import "../chunk-H774GQJW.js";
22
- import "../chunk-M3RB4IF6.js";
21
+ import "../chunk-RYIREJAW.js";
23
22
  import "../chunk-J2GP3J3X.js";
24
- import "../chunk-JKLPWTUN.js";
23
+ import "../chunk-QBYQ7KDX.js";
24
+ import "../chunk-V4IE7HJY.js";
25
25
  import "../chunk-YHEQTVFV.js";
26
26
  import "../chunk-HNCM3D7Y.js";
27
27
  import "../chunk-Z6W4YHJB.js";
@@ -29,9 +29,8 @@ import "../chunk-ZO5EXQMG.js";
29
29
  import "../chunk-K44MW7JJ.js";
30
30
  import "../chunk-VUQCQXXJ.js";
31
31
  import "../chunk-YD6NDTKF.js";
32
- import "../chunk-43UFGATL.js";
32
+ import "../chunk-WGAAQASA.js";
33
33
  import "../chunk-CQGTEGKL.js";
34
- import "../chunk-V4IE7HJY.js";
35
34
  import "../chunk-5WRI5ZAA.js";
36
35
  export {
37
36
  createServer,
@@ -1,38 +1,34 @@
1
1
  import {
2
2
  createWebSocketServer,
3
3
  signalMcpReady
4
- } from "./chunk-BKTBHEPY.js";
5
- import "./chunk-L4WACPUX.js";
6
- import "./chunk-WEB4WBUF.js";
4
+ } from "./chunk-HZNY77HZ.js";
5
+ import "./chunk-OESYKZCM.js";
6
+ import "./chunk-73N5CJH3.js";
7
+ import "./chunk-WD75RSGR.js";
8
+ import "./chunk-X5YCWKNS.js";
7
9
  import "./chunk-LBGHZLLH.js";
8
10
  import "./chunk-BGTEIA2S.js";
9
11
  import "./chunk-PK2RMVMB.js";
10
12
  import "./chunk-NWO6GRYE.js";
13
+ import "./chunk-AIJE3RYH.js";
14
+ import "./chunk-TMUBLQFC.js";
11
15
  import "./chunk-F4PMNP7S.js";
12
16
  import "./chunk-EU3WWTFH.js";
13
17
  import "./chunk-SVSKQYFH.js";
14
18
  import "./chunk-YQ3SOPBI.js";
15
- import "./chunk-GJU35MDV.js";
16
- import "./chunk-6VDCH5ML.js";
17
- import "./chunk-AIJE3RYH.js";
18
- import "./chunk-TMUBLQFC.js";
19
19
  import "./chunk-ZPIZLTWU.js";
20
- import "./chunk-M3RB4IF6.js";
21
20
  import "./chunk-J2GP3J3X.js";
22
- import "./chunk-JKLPWTUN.js";
21
+ import "./chunk-V4IE7HJY.js";
23
22
  import "./chunk-YHEQTVFV.js";
24
- import "./chunk-HNCM3D7Y.js";
25
23
  import "./chunk-Z6W4YHJB.js";
26
- import "./chunk-ZO5EXQMG.js";
27
24
  import "./chunk-K44MW7JJ.js";
28
25
  import "./chunk-VUQCQXXJ.js";
29
26
  import "./chunk-YD6NDTKF.js";
30
- import "./chunk-43UFGATL.js";
27
+ import "./chunk-WGAAQASA.js";
31
28
  import "./chunk-CQGTEGKL.js";
32
- import "./chunk-V4IE7HJY.js";
33
29
  import "./chunk-5WRI5ZAA.js";
34
30
  export {
35
31
  createWebSocketServer,
36
32
  signalMcpReady
37
33
  };
38
- //# sourceMappingURL=server-CI5IEBOC.js.map
34
+ //# sourceMappingURL=server-Z2A5YZM6.js.map
@@ -1,5 +1,6 @@
1
- import { M as Message, S as SessionStats } from '../protocol-J7khRG62.js';
2
- export { A as AgentEvent, a as AskAnswerPayload, b as AskUserEvent, c as Attachment, B as BackgroundProcess, d as BackgroundProcessExitedPayload, e as BackgroundProcessOutputPayload, f as BackgroundProcessRemovedPayload, g as BackgroundProcessStartedPayload, h as BackgroundProcessStatus, C as CallStatsDataPoint, i as ChatAskUserPayload, j as ChatDeltaPayload, k as ChatDonePayload, l as ChatErrorPayload, m as ChatFormatRetryPayload, n as ChatMessagePayload, o as ChatMessageUpdatedPayload, p as ChatPathConfirmationPayload, q as ChatProgressPayload, r as ChatThinkingPayload, s as ChatTodoPayload, t as ChatToolCallPayload, u as ChatToolOutputPayload, v as ChatToolPreparingPayload, w as ChatToolResultPayload, x as ChatVisionFallbackPayload, y as ClientMessage, z as ClientMessageType, D as Config, E as ContextCompactionEvent, F as ContextState, G as ContextStatePayload, H as ContextWindow, I as CriteriaUpdatedPayload, J as Criterion, K as CriterionAttempt, L as CriterionStatus, N as CriterionValidation, O as DangerLevel, P as DevServerOutputPayload, Q as DevServerStatePayload, R as Diagnostic, T as EditContextEdit, U as EditContextLine, V as EditContextRegion, W as ElementData, X as ErrorPayload, Y as ExecutionState, Z as FileReadEntry, _ as GitDiffFile, $ as GitStatusPayload, a0 as InjectedFile, a1 as LLMCallStats, a2 as LlmBackend, a3 as LogLine, a4 as LspDiagnosticsPayload, a5 as MessageRole, a6 as MessageSegment, a7 as MessageStats, a8 as MetadataEntry, a9 as MetadataUpdatedPayload, aa as ModeChangedPayload, ab as ModelConfig, ac as ModelSessionStats, ad as PathConfirmPayload, ae as PathConfirmationReason, af as PendingPathConfirmationPayload, ag as PendingQuestionPayload, ah as PhaseChangedPayload, ai as PreparingToolCall, aj as Project, ak as ProjectDeletedPayload, al as ProjectListPayload, am as ProjectStatePayload, an as Provider, ao as ProviderBackend, ap as ProviderChangedPayload, aq as QueueAddedEvent, ar as QueueCancelledEvent, as as QueueDrainedEvent, at as QueueEvent, au as QueueEventType, av as QueueStatePayload, aw as QueuedMessage, ax as RecentUserPrompt, ay as ServerMessage, az as ServerMessageType, aA as Session, aB as SessionListPayload, aC as SessionLoadPayload, aD as SessionMetadata, aE as SessionMode, aF as SessionNameGeneratedPayload, aG as SessionPhase, aH as SessionRunningPayload, aI as SessionStatePayload, aJ as SessionSummary, aK as StatsDataPoint, aL as StatsIdentity, aM as TaskCompletedPayload, aN as Todo, aO as ToolCall, aP as ToolMode, aQ as ToolName, aR as ToolResult, aS as ValidationResult, aT as createClientMessage, aU as createServerMessage, aV as isClientMessage, aW as isServerMessage } from '../protocol-J7khRG62.js';
1
+ import { M as Message, S as SessionStats } from '../types-akHmgvBk.js';
2
+ export { A as Attachment, C as CallStatsDataPoint, a as Config, b as ContextState, c as ContextWindow, d as Criterion, e as CriterionAttempt, f as CriterionStatus, g as CriterionValidation, D as DangerLevel, h as Diagnostic, E as EditContextEdit, i as EditContextLine, j as EditContextRegion, k as ElementData, l as ExecutionState, F as FileReadEntry, I as InjectedFile, L as LLMCallStats, m as LlmBackend, n as MessageRole, o as MessageSegment, p as MessageStats, q as MetadataEntry, r as ModelConfig, s as ModelSessionStats, P as PreparingToolCall, t as Project, u as Provider, v as ProviderBackend, R as RecentUserPrompt, w as Session, x as SessionMetadata, y as SessionMode, z as SessionPhase, B as SessionSummary, G as StatsDataPoint, H as StatsIdentity, T as Todo, J as ToolCall, K as ToolMode, N as ToolName, O as ToolResult, V as ValidationResult } from '../types-akHmgvBk.js';
3
+ export { A as AgentEvent, a as AskAnswerPayload, b as AskUserEvent, B as BackgroundProcess, c as BackgroundProcessExitedPayload, d as BackgroundProcessOutputPayload, e as BackgroundProcessRemovedPayload, f as BackgroundProcessStartedPayload, g as BackgroundProcessStatus, C as ChatAskUserPayload, h as ChatDeltaPayload, i as ChatDonePayload, j as ChatErrorPayload, k as ChatFormatRetryPayload, l as ChatMessagePayload, m as ChatMessageUpdatedPayload, n as ChatPathConfirmationPayload, o as ChatProgressPayload, p as ChatThinkingPayload, q as ChatTodoPayload, r as ChatToolCallPayload, s as ChatToolOutputPayload, t as ChatToolPreparingPayload, u as ChatToolResultPayload, v as ChatVisionFallbackPayload, w as ClientMessage, x as ClientMessageType, y as ContextCompactionEvent, z as ContextStatePayload, D as CriteriaUpdatedPayload, E as DevServerOutputPayload, F as DevServerStatePayload, G as ErrorPayload, H as GitDiffFile, I as GitStatusPayload, L as LogLine, J as LspDiagnosticsPayload, M as MetadataUpdatedPayload, K as ModeChangedPayload, P as PathConfirmPayload, N as PathConfirmationReason, O as PendingPathConfirmationPayload, Q as PendingQuestionPayload, R as PhaseChangedPayload, S as ProjectDeletedPayload, T as ProjectListPayload, U as ProjectStatePayload, V as ProviderChangedPayload, W as QueueAddedEvent, X as QueueCancelledEvent, Y as QueueDrainedEvent, Z as QueueEvent, _ as QueueEventType, $ as QueueStatePayload, a0 as QueuedMessage, a1 as ServerMessage, a2 as ServerMessageType, a3 as SessionListPayload, a4 as SessionLoadPayload, a5 as SessionNameGeneratedPayload, a6 as SessionRunningPayload, a7 as SessionStatePayload, a8 as TaskCompletedPayload, a9 as createClientMessage, aa as createServerMessage, ab as isClientMessage, ac as isServerMessage } from '../protocol-Cq66hdDX.js';
3
4
 
4
5
  /**
5
6
  * Session stats computation - aggregates response-level MessageStats from
@@ -12,11 +12,14 @@ import {
12
12
  setMcpTools,
13
13
  stepDoneTool,
14
14
  validateToolAction
15
- } from "./chunk-WEB4WBUF.js";
15
+ } from "./chunk-WD75RSGR.js";
16
+ import "./chunk-X5YCWKNS.js";
16
17
  import "./chunk-LBGHZLLH.js";
17
18
  import "./chunk-BGTEIA2S.js";
18
19
  import "./chunk-PK2RMVMB.js";
19
20
  import "./chunk-NWO6GRYE.js";
21
+ import "./chunk-AIJE3RYH.js";
22
+ import "./chunk-TMUBLQFC.js";
20
23
  import "./chunk-F4PMNP7S.js";
21
24
  import {
22
25
  AskUserInterrupt,
@@ -26,18 +29,15 @@ import {
26
29
  } from "./chunk-EU3WWTFH.js";
27
30
  import "./chunk-SVSKQYFH.js";
28
31
  import "./chunk-YQ3SOPBI.js";
29
- import "./chunk-6VDCH5ML.js";
30
- import "./chunk-AIJE3RYH.js";
31
- import "./chunk-TMUBLQFC.js";
32
32
  import "./chunk-ZPIZLTWU.js";
33
33
  import "./chunk-J2GP3J3X.js";
34
+ import "./chunk-V4IE7HJY.js";
34
35
  import "./chunk-YHEQTVFV.js";
35
36
  import "./chunk-Z6W4YHJB.js";
36
37
  import "./chunk-K44MW7JJ.js";
37
38
  import "./chunk-YD6NDTKF.js";
38
- import "./chunk-43UFGATL.js";
39
+ import "./chunk-WGAAQASA.js";
39
40
  import "./chunk-CQGTEGKL.js";
40
- import "./chunk-V4IE7HJY.js";
41
41
  import "./chunk-5WRI5ZAA.js";
42
42
  export {
43
43
  AskUserInterrupt,
@@ -58,4 +58,4 @@ export {
58
58
  stepDoneTool,
59
59
  validateToolAction
60
60
  };
61
- //# sourceMappingURL=tools-33FQNFKC.js.map
61
+ //# sourceMappingURL=tools-R6LPK6OS.js.map
@@ -0,0 +1,89 @@
1
+ import { J as ToolCall, A as Attachment } from './types-akHmgvBk.js';
2
+
3
+ interface LLMMessage {
4
+ role: 'system' | 'user' | 'assistant' | 'tool';
5
+ content: string;
6
+ thinkingContent?: string;
7
+ toolCalls?: ToolCall[];
8
+ toolCallId?: string;
9
+ name?: string;
10
+ attachments?: Attachment[];
11
+ }
12
+ interface LLMToolDefinition {
13
+ type: 'function';
14
+ function: {
15
+ name: string;
16
+ description: string;
17
+ parameters: Record<string, unknown>;
18
+ };
19
+ }
20
+ type ReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
21
+ interface LLMCompletionRequest {
22
+ messages: LLMMessage[];
23
+ tools?: LLMToolDefinition[];
24
+ toolChoice?: 'auto' | 'none' | 'required' | {
25
+ type: 'function';
26
+ function: {
27
+ name: string;
28
+ };
29
+ };
30
+ temperature?: number;
31
+ maxTokens?: number;
32
+ stream?: boolean;
33
+ signal?: AbortSignal;
34
+ reasoningEffort?: ReasoningEffort;
35
+ modelSettings?: {
36
+ temperature?: number;
37
+ topP?: number;
38
+ topK?: number;
39
+ maxTokens?: number;
40
+ supportsVision?: boolean;
41
+ chatTemplateKwargs?: Record<string, unknown>;
42
+ queryParams?: Record<string, unknown>;
43
+ };
44
+ /** When true, include the raw API response body in the result */
45
+ returnRaw?: boolean;
46
+ /** When true, the client-level reasoningEffort (from thinkingLevel) is NOT applied.
47
+ * Used by non-thinking callers (e.g. title generation) that want to opt out. */
48
+ skipClientReasoningEffort?: boolean;
49
+ }
50
+ interface LLMCompletionResponse {
51
+ id: string;
52
+ content: string;
53
+ toolCalls?: ToolCall[];
54
+ thinkingContent?: string;
55
+ reasoning_content?: string;
56
+ finishReason: 'stop' | 'tool_calls' | 'length' | 'content_filter';
57
+ usage: {
58
+ promptTokens: number;
59
+ completionTokens: number;
60
+ totalTokens: number;
61
+ };
62
+ /** Raw API response body, only set when returnRaw was requested */
63
+ raw?: string;
64
+ }
65
+ type LLMStreamEvent = {
66
+ type: 'text_delta';
67
+ content: string;
68
+ } | {
69
+ type: 'thinking_delta';
70
+ content: string;
71
+ } | {
72
+ type: 'tool_call_delta';
73
+ index: number;
74
+ id?: string;
75
+ name?: string;
76
+ arguments?: string;
77
+ } | {
78
+ type: 'done';
79
+ response: LLMCompletionResponse;
80
+ } | {
81
+ type: 'error';
82
+ error: string;
83
+ };
84
+ interface LLMClient {
85
+ complete(request: LLMCompletionRequest): Promise<LLMCompletionResponse>;
86
+ stream(request: LLMCompletionRequest): AsyncIterable<LLMStreamEvent>;
87
+ }
88
+
89
+ export type { LLMCompletionRequest as L, LLMCompletionResponse as a, LLMStreamEvent as b, LLMMessage as c, LLMToolDefinition as d, LLMClient as e };