@opencode/ai 0.0.0-reserved → 2.0.1
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 +879 -2
- package/dist/cache-policy.d.ts +2 -0
- package/dist/cache-policy.js +129 -0
- package/dist/image-client.d.ts +19 -0
- package/dist/image-client.js +28 -0
- package/dist/image.d.ts +110 -0
- package/dist/image.js +103 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +12 -0
- package/dist/llm.d.ts +252 -0
- package/dist/llm.js +74 -0
- package/dist/protocols/alibaba-chat.d.ts +225 -0
- package/dist/protocols/alibaba-chat.js +75 -0
- package/dist/protocols/alibaba-messages.d.ts +350 -0
- package/dist/protocols/alibaba-messages.js +40 -0
- package/dist/protocols/alibaba-responses.d.ts +255 -0
- package/dist/protocols/alibaba-responses.js +80 -0
- package/dist/protocols/anthropic-messages.d.ts +980 -0
- package/dist/protocols/anthropic-messages.js +1460 -0
- package/dist/protocols/bedrock-converse.d.ts +499 -0
- package/dist/protocols/bedrock-converse.js +643 -0
- package/dist/protocols/bedrock-event-stream.d.ts +9 -0
- package/dist/protocols/bedrock-event-stream.js +97 -0
- package/dist/protocols/gemini.d.ts +285 -0
- package/dist/protocols/gemini.js +671 -0
- package/dist/protocols/google-images.d.ts +30 -0
- package/dist/protocols/google-images.js +181 -0
- package/dist/protocols/index.d.ts +12 -0
- package/dist/protocols/index.js +12 -0
- package/dist/protocols/meta-images.d.ts +26 -0
- package/dist/protocols/meta-images.js +89 -0
- package/dist/protocols/meta-messages.d.ts +356 -0
- package/dist/protocols/meta-messages.js +41 -0
- package/dist/protocols/meta-responses.d.ts +473 -0
- package/dist/protocols/meta-responses.js +173 -0
- package/dist/protocols/mistral-chat.d.ts +540 -0
- package/dist/protocols/mistral-chat.js +624 -0
- package/dist/protocols/open-responses-channel.d.ts +25 -0
- package/dist/protocols/open-responses-channel.js +141 -0
- package/dist/protocols/open-responses-continuation.d.ts +16 -0
- package/dist/protocols/open-responses-continuation.js +170 -0
- package/dist/protocols/open-responses.d.ts +1715 -0
- package/dist/protocols/open-responses.js +1228 -0
- package/dist/protocols/openai-chat.d.ts +860 -0
- package/dist/protocols/openai-chat.js +966 -0
- package/dist/protocols/openai-compatible-chat.d.ts +109 -0
- package/dist/protocols/openai-compatible-chat.js +19 -0
- package/dist/protocols/openai-compatible-responses.d.ts +172 -0
- package/dist/protocols/openai-compatible-responses.js +18 -0
- package/dist/protocols/openai-images.d.ts +32 -0
- package/dist/protocols/openai-images.js +183 -0
- package/dist/protocols/openai-responses.d.ts +1389 -0
- package/dist/protocols/openai-responses.js +260 -0
- package/dist/protocols/shared.d.ts +193 -0
- package/dist/protocols/shared.js +290 -0
- package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
- package/dist/protocols/utils/bedrock-auth.js +85 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
- package/dist/protocols/utils/bedrock-cache.js +49 -0
- package/dist/protocols/utils/bedrock-media.d.ts +55 -0
- package/dist/protocols/utils/bedrock-media.js +73 -0
- package/dist/protocols/utils/cache.d.ts +6 -0
- package/dist/protocols/utils/cache.js +5 -0
- package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
- package/dist/protocols/utils/gemini-tool-schema.js +103 -0
- package/dist/protocols/utils/image-input.d.ts +21 -0
- package/dist/protocols/utils/image-input.js +20 -0
- package/dist/protocols/utils/lifecycle.d.ts +24 -0
- package/dist/protocols/utils/lifecycle.js +72 -0
- package/dist/protocols/utils/meta-image.d.ts +2 -0
- package/dist/protocols/utils/meta-image.js +13 -0
- package/dist/protocols/utils/open-responses-options.d.ts +56 -0
- package/dist/protocols/utils/open-responses-options.js +61 -0
- package/dist/protocols/utils/openai-image.d.ts +5 -0
- package/dist/protocols/utils/openai-image.js +18 -0
- package/dist/protocols/utils/openai-options.d.ts +16 -0
- package/dist/protocols/utils/openai-options.js +14 -0
- package/dist/protocols/utils/partial-json-options.d.ts +62 -0
- package/dist/protocols/utils/partial-json-options.js +52 -0
- package/dist/protocols/utils/partial-json.d.ts +8 -0
- package/dist/protocols/utils/partial-json.js +279 -0
- package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
- package/dist/protocols/utils/responses-checkpoint.js +107 -0
- package/dist/protocols/utils/responses-compaction.d.ts +4 -0
- package/dist/protocols/utils/responses-compaction.js +129 -0
- package/dist/protocols/utils/responses-hosted-tools.d.ts +26 -0
- package/dist/protocols/utils/responses-hosted-tools.js +32 -0
- package/dist/protocols/utils/tool-schema.d.ts +8 -0
- package/dist/protocols/utils/tool-schema.js +54 -0
- package/dist/protocols/utils/tool-stream.d.ts +710 -0
- package/dist/protocols/utils/tool-stream.js +155 -0
- package/dist/protocols/xai-images.d.ts +26 -0
- package/dist/protocols/xai-images.js +106 -0
- package/dist/protocols/xai-responses.d.ts +250 -0
- package/dist/protocols/xai-responses.js +81 -0
- package/dist/protocols/zai-chat.d.ts +202 -0
- package/dist/protocols/zai-chat.js +49 -0
- package/dist/protocols/zai-images.d.ts +22 -0
- package/dist/protocols/zai-images.js +79 -0
- package/dist/protocols/zai-messages.d.ts +344 -0
- package/dist/protocols/zai-messages.js +27 -0
- package/dist/protocols.d.ts +1 -0
- package/dist/protocols.js +1 -0
- package/dist/provider-error.d.ts +15 -0
- package/dist/provider-error.js +125 -0
- package/dist/provider-package.d.ts +15 -0
- package/dist/provider-package.js +1 -0
- package/dist/provider.d.ts +23 -0
- package/dist/provider.js +2 -0
- package/dist/providers/alibaba/chat.d.ts +1 -0
- package/dist/providers/alibaba/chat.js +1 -0
- package/dist/providers/alibaba/messages.d.ts +3 -0
- package/dist/providers/alibaba/messages.js +1 -0
- package/dist/providers/alibaba/responses.d.ts +3 -0
- package/dist/providers/alibaba/responses.js +1 -0
- package/dist/providers/alibaba.d.ts +711 -0
- package/dist/providers/alibaba.js +94 -0
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +313 -0
- package/dist/providers/amazon-bedrock-mantle.js +79 -0
- package/dist/providers/amazon-bedrock.d.ts +173 -0
- package/dist/providers/amazon-bedrock.js +41 -0
- package/dist/providers/anthropic-compatible.d.ts +309 -0
- package/dist/providers/anthropic-compatible.js +50 -0
- package/dist/providers/anthropic.d.ts +307 -0
- package/dist/providers/anthropic.js +42 -0
- package/dist/providers/azure/chat.d.ts +2 -0
- package/dist/providers/azure/chat.js +1 -0
- package/dist/providers/azure/responses.d.ts +2 -0
- package/dist/providers/azure/responses.js +1 -0
- package/dist/providers/azure.d.ts +598 -0
- package/dist/providers/azure.js +115 -0
- package/dist/providers/baseten.d.ts +228 -0
- package/dist/providers/baseten.js +38 -0
- package/dist/providers/cerebras.d.ts +227 -0
- package/dist/providers/cerebras.js +40 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +237 -0
- package/dist/providers/cloudflare-ai-gateway.js +65 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +231 -0
- package/dist/providers/cloudflare-workers-ai.js +51 -0
- package/dist/providers/deepinfra.d.ts +227 -0
- package/dist/providers/deepinfra.js +43 -0
- package/dist/providers/deepseek.d.ts +228 -0
- package/dist/providers/deepseek.js +41 -0
- package/dist/providers/fireworks.d.ts +228 -0
- package/dist/providers/fireworks.js +38 -0
- package/dist/providers/google-vertex/chat.d.ts +2 -0
- package/dist/providers/google-vertex/chat.js +1 -0
- package/dist/providers/google-vertex/gemini.d.ts +2 -0
- package/dist/providers/google-vertex/gemini.js +1 -0
- package/dist/providers/google-vertex/messages.d.ts +2 -0
- package/dist/providers/google-vertex/messages.js +1 -0
- package/dist/providers/google-vertex/responses.d.ts +2 -0
- package/dist/providers/google-vertex/responses.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +132 -0
- package/dist/providers/google-vertex-chat.js +55 -0
- package/dist/providers/google-vertex-messages.d.ts +306 -0
- package/dist/providers/google-vertex-messages.js +75 -0
- package/dist/providers/google-vertex-responses.d.ts +197 -0
- package/dist/providers/google-vertex-responses.js +56 -0
- package/dist/providers/google-vertex-shared.d.ts +22 -0
- package/dist/providers/google-vertex-shared.js +72 -0
- package/dist/providers/google-vertex.d.ts +119 -0
- package/dist/providers/google-vertex.js +98 -0
- package/dist/providers/google.d.ts +114 -0
- package/dist/providers/google.js +42 -0
- package/dist/providers/groq.d.ts +314 -0
- package/dist/providers/groq.js +81 -0
- package/dist/providers/index.d.ts +31 -0
- package/dist/providers/index.js +31 -0
- package/dist/providers/meta/chat.d.ts +2 -0
- package/dist/providers/meta/chat.js +1 -0
- package/dist/providers/meta/messages.d.ts +2 -0
- package/dist/providers/meta/messages.js +1 -0
- package/dist/providers/meta/responses.d.ts +2 -0
- package/dist/providers/meta/responses.js +1 -0
- package/dist/providers/meta.d.ts +636 -0
- package/dist/providers/meta.js +113 -0
- package/dist/providers/minimax/chat.d.ts +4 -0
- package/dist/providers/minimax/chat.js +8 -0
- package/dist/providers/minimax/messages.d.ts +1 -0
- package/dist/providers/minimax/messages.js +1 -0
- package/dist/providers/minimax/responses.d.ts +4 -0
- package/dist/providers/minimax/responses.js +8 -0
- package/dist/providers/minimax.d.ts +598 -0
- package/dist/providers/minimax.js +89 -0
- package/dist/providers/mistral.d.ts +207 -0
- package/dist/providers/mistral.js +28 -0
- package/dist/providers/moonshot/chat.d.ts +1 -0
- package/dist/providers/moonshot/chat.js +1 -0
- package/dist/providers/moonshot/messages.d.ts +4 -0
- package/dist/providers/moonshot/messages.js +8 -0
- package/dist/providers/moonshot/responses.d.ts +4 -0
- package/dist/providers/moonshot/responses.js +8 -0
- package/dist/providers/moonshot.d.ts +596 -0
- package/dist/providers/moonshot.js +90 -0
- package/dist/providers/open-responses-options.d.ts +6 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai/chat.d.ts +2 -0
- package/dist/providers/openai/chat.js +1 -0
- package/dist/providers/openai/responses.d.ts +2 -0
- package/dist/providers/openai/responses.js +1 -0
- package/dist/providers/openai-compatible/responses.d.ts +1 -0
- package/dist/providers/openai-compatible/responses.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +195 -0
- package/dist/providers/openai-compatible-responses.js +32 -0
- package/dist/providers/openai-compatible.d.ts +130 -0
- package/dist/providers/openai-compatible.js +33 -0
- package/dist/providers/openai-options.d.ts +26 -0
- package/dist/providers/openai-options.js +41 -0
- package/dist/providers/openai.d.ts +404 -0
- package/dist/providers/openai.js +82 -0
- package/dist/providers/openrouter.d.ts +563 -0
- package/dist/providers/openrouter.js +114 -0
- package/dist/providers/togetherai.d.ts +227 -0
- package/dist/providers/togetherai.js +40 -0
- package/dist/providers/xai.d.ts +163 -0
- package/dist/providers/xai.js +88 -0
- package/dist/providers/zai/chat.d.ts +1 -0
- package/dist/providers/zai/chat.js +1 -0
- package/dist/providers/zai-coding-plan/chat.d.ts +1 -0
- package/dist/providers/zai-coding-plan/chat.js +1 -0
- package/dist/providers/zai-coding-plan/messages.d.ts +4 -0
- package/dist/providers/zai-coding-plan/messages.js +8 -0
- package/dist/providers/zai-coding-plan/responses.d.ts +4 -0
- package/dist/providers/zai-coding-plan/responses.js +8 -0
- package/dist/providers/zai-coding-plan.d.ts +577 -0
- package/dist/providers/zai-coding-plan.js +63 -0
- package/dist/providers/zai.d.ts +149 -0
- package/dist/providers/zai.js +53 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.js +1 -0
- package/dist/route/auth-options.d.ts +34 -0
- package/dist/route/auth-options.js +14 -0
- package/dist/route/auth.d.ts +51 -0
- package/dist/route/auth.js +87 -0
- package/dist/route/client.d.ts +430 -0
- package/dist/route/client.js +307 -0
- package/dist/route/endpoint.d.ts +28 -0
- package/dist/route/endpoint.js +21 -0
- package/dist/route/executor.d.ts +27 -0
- package/dist/route/executor.js +183 -0
- package/dist/route/framing.d.ts +29 -0
- package/dist/route/framing.js +14 -0
- package/dist/route/index.d.ts +16 -0
- package/dist/route/index.js +9 -0
- package/dist/route/protocol.d.ts +76 -0
- package/dist/route/protocol.js +16 -0
- package/dist/route/transport/http.d.ts +34 -0
- package/dist/route/transport/http.js +68 -0
- package/dist/route/transport/index.d.ts +41 -0
- package/dist/route/transport/index.js +4 -0
- package/dist/route/transport/websocket-channel.d.ts +57 -0
- package/dist/route/transport/websocket-channel.js +1 -0
- package/dist/route/transport/websocket.d.ts +56 -0
- package/dist/route/transport/websocket.js +370 -0
- package/dist/route.d.ts +1 -0
- package/dist/route.js +1 -0
- package/dist/schema/errors.d.ts +170 -0
- package/dist/schema/errors.js +131 -0
- package/dist/schema/events.d.ts +8123 -0
- package/dist/schema/events.js +550 -0
- package/dist/schema/ids.d.ts +17 -0
- package/dist/schema/ids.js +10 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/messages.d.ts +646 -0
- package/dist/schema/messages.js +301 -0
- package/dist/schema/options.d.ts +159 -0
- package/dist/schema/options.js +189 -0
- package/dist/testing.d.ts +1693 -0
- package/dist/testing.js +129 -0
- package/dist/tool-history.d.ts +2 -0
- package/dist/tool-history.js +84 -0
- package/dist/tool-runtime.d.ts +15 -0
- package/dist/tool-runtime.js +62 -0
- package/dist/tool.d.ts +136 -0
- package/dist/tool.js +66 -0
- package/dist/utils/record.d.ts +2 -0
- package/dist/utils/record.js +2 -0
- package/dist/utils/sanitize.d.ts +1 -0
- package/dist/utils/sanitize.js +12 -0
- package/package.json +43 -10
|
@@ -0,0 +1,1693 @@
|
|
|
1
|
+
export * as TestLLM from "./testing.js";
|
|
2
|
+
import { LLMClient } from "./route/client.js";
|
|
3
|
+
import { LLMEvent, CompactionResponse, CompactionCheckpointResponse, type FinishReasonDetails, type AIError, type LLMRequest, type ProviderMetadata, type UsageInput } from "./schema/index.js";
|
|
4
|
+
import { Context, Effect, Layer, Scope, Stream } from "effect";
|
|
5
|
+
export type Response = readonly LLMEvent[] | Stream.Stream<LLMEvent, AIError> | CompactionResponse | CompactionCheckpointResponse;
|
|
6
|
+
export type Gate = Readonly<{
|
|
7
|
+
started: Effect.Effect<void>;
|
|
8
|
+
release: Effect.Effect<void>;
|
|
9
|
+
}>;
|
|
10
|
+
type ClientInterface = Context.Service.Shape<typeof LLMClient.Service>;
|
|
11
|
+
export type Responder = (request: LLMRequest) => Response;
|
|
12
|
+
export interface TestInterface extends ClientInterface {
|
|
13
|
+
/** Returns a snapshot of requests observed at execution time. */
|
|
14
|
+
readonly requests: () => Effect.Effect<readonly LLMRequest[]>;
|
|
15
|
+
readonly push: (...responses: readonly Response[]) => Effect.Effect<void>;
|
|
16
|
+
/** Replaces the fallback without changing queued responses. */
|
|
17
|
+
readonly always: (response: Response) => Effect.Effect<void>;
|
|
18
|
+
/** Answers requests after the one-shot queue is exhausted; receives the original request. */
|
|
19
|
+
readonly serve: (responder: Responder) => Effect.Effect<void>;
|
|
20
|
+
/** Waits for request arrivals, not output or completion. */
|
|
21
|
+
readonly wait: (count: number) => Effect.Effect<void>;
|
|
22
|
+
readonly gate: () => Effect.Effect<Gate, never, Scope.Scope>;
|
|
23
|
+
}
|
|
24
|
+
declare const Test_base: Context.ServiceClass<Test, "@opencode/ai/TestLLM/Test", TestInterface>;
|
|
25
|
+
export declare class Test extends Test_base {
|
|
26
|
+
}
|
|
27
|
+
/** @deprecated Use TestInterface through Test and testLayer. */
|
|
28
|
+
export interface Interface {
|
|
29
|
+
readonly requests: LLMRequest[];
|
|
30
|
+
readonly push: (...responses: readonly Response[]) => Effect.Effect<void>;
|
|
31
|
+
readonly always: (response: Response) => Effect.Effect<void>;
|
|
32
|
+
readonly wait: (count: number) => Effect.Effect<void>;
|
|
33
|
+
readonly gate: Effect.Effect<Gate, never, Scope.Scope>;
|
|
34
|
+
readonly client: ClientInterface;
|
|
35
|
+
}
|
|
36
|
+
export interface LayerOptions {
|
|
37
|
+
readonly transformRequest?: (request: LLMRequest) => LLMRequest;
|
|
38
|
+
/** Used after the one-shot response queue is exhausted. Omit to defect on unexpected requests. */
|
|
39
|
+
readonly fallback?: Response;
|
|
40
|
+
}
|
|
41
|
+
declare const Service_base: Context.ServiceClass<Service, "@opencode/ai/TestLLM", Interface>;
|
|
42
|
+
/** @deprecated Use Test and testLayer for normal client methods and test controls. */
|
|
43
|
+
export declare class Service extends Service_base {
|
|
44
|
+
}
|
|
45
|
+
export declare const complete: (options: {
|
|
46
|
+
readonly reason: FinishReasonDetails;
|
|
47
|
+
readonly usage?: UsageInput;
|
|
48
|
+
readonly providerMetadata?: ProviderMetadata;
|
|
49
|
+
}, ...events: readonly LLMEvent[]) => (({
|
|
50
|
+
readonly type: "compaction";
|
|
51
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
52
|
+
readonly id?: string | undefined;
|
|
53
|
+
readonly text?: string | null | undefined;
|
|
54
|
+
readonly encrypted?: string | undefined;
|
|
55
|
+
} & ({
|
|
56
|
+
readonly encrypted: string;
|
|
57
|
+
readonly text?: never;
|
|
58
|
+
} | {
|
|
59
|
+
readonly text: string | null;
|
|
60
|
+
readonly encrypted?: never;
|
|
61
|
+
})) | {
|
|
62
|
+
readonly type: "step-start";
|
|
63
|
+
readonly index: number;
|
|
64
|
+
} | {
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly type: "text-start";
|
|
67
|
+
readonly providerMetadata?: {
|
|
68
|
+
readonly [x: string]: {
|
|
69
|
+
readonly [x: string]: unknown;
|
|
70
|
+
};
|
|
71
|
+
} | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly type: "text-delta";
|
|
75
|
+
readonly text: string;
|
|
76
|
+
readonly providerMetadata?: {
|
|
77
|
+
readonly [x: string]: {
|
|
78
|
+
readonly [x: string]: unknown;
|
|
79
|
+
};
|
|
80
|
+
} | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly type: "text-end";
|
|
84
|
+
readonly text?: string | undefined;
|
|
85
|
+
readonly providerMetadata?: {
|
|
86
|
+
readonly [x: string]: {
|
|
87
|
+
readonly [x: string]: unknown;
|
|
88
|
+
};
|
|
89
|
+
} | undefined;
|
|
90
|
+
} | {
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly type: "reasoning-start";
|
|
93
|
+
readonly providerMetadata?: {
|
|
94
|
+
readonly [x: string]: {
|
|
95
|
+
readonly [x: string]: unknown;
|
|
96
|
+
};
|
|
97
|
+
} | undefined;
|
|
98
|
+
} | {
|
|
99
|
+
readonly id: string;
|
|
100
|
+
readonly type: "reasoning-delta";
|
|
101
|
+
readonly text: string;
|
|
102
|
+
readonly providerMetadata?: {
|
|
103
|
+
readonly [x: string]: {
|
|
104
|
+
readonly [x: string]: unknown;
|
|
105
|
+
};
|
|
106
|
+
} | undefined;
|
|
107
|
+
} | {
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly type: "reasoning-end";
|
|
110
|
+
readonly text?: string | undefined;
|
|
111
|
+
readonly providerMetadata?: {
|
|
112
|
+
readonly [x: string]: {
|
|
113
|
+
readonly [x: string]: unknown;
|
|
114
|
+
};
|
|
115
|
+
} | undefined;
|
|
116
|
+
} | {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly type: "tool-input-start";
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly providerMetadata?: {
|
|
121
|
+
readonly [x: string]: {
|
|
122
|
+
readonly [x: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
} | undefined;
|
|
125
|
+
readonly namespace?: string | undefined;
|
|
126
|
+
readonly providerExecuted?: boolean | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly type: "tool-input-delta";
|
|
130
|
+
readonly name: string;
|
|
131
|
+
readonly text: string;
|
|
132
|
+
readonly input?: unknown;
|
|
133
|
+
readonly namespace?: string | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly type: "tool-input-end";
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly providerMetadata?: {
|
|
139
|
+
readonly [x: string]: {
|
|
140
|
+
readonly [x: string]: unknown;
|
|
141
|
+
};
|
|
142
|
+
} | undefined;
|
|
143
|
+
readonly namespace?: string | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
readonly id: string;
|
|
146
|
+
readonly type: "tool-input-error";
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly raw: string;
|
|
149
|
+
readonly namespace?: string | undefined;
|
|
150
|
+
} | {
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly type: "tool-call";
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly input: unknown;
|
|
155
|
+
readonly providerMetadata?: {
|
|
156
|
+
readonly [x: string]: {
|
|
157
|
+
readonly [x: string]: unknown;
|
|
158
|
+
};
|
|
159
|
+
} | undefined;
|
|
160
|
+
readonly namespace?: string | undefined;
|
|
161
|
+
readonly providerExecuted?: boolean | undefined;
|
|
162
|
+
} | {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly type: "tool-result";
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly result: {
|
|
167
|
+
readonly type: "json";
|
|
168
|
+
readonly value: unknown;
|
|
169
|
+
} | {
|
|
170
|
+
readonly type: "text";
|
|
171
|
+
readonly value: unknown;
|
|
172
|
+
} | {
|
|
173
|
+
readonly type: "error";
|
|
174
|
+
readonly value: unknown;
|
|
175
|
+
} | {
|
|
176
|
+
readonly type: "content";
|
|
177
|
+
readonly value: readonly ({
|
|
178
|
+
readonly type: "text";
|
|
179
|
+
readonly text: string;
|
|
180
|
+
} | {
|
|
181
|
+
readonly type: "file";
|
|
182
|
+
readonly uri: string;
|
|
183
|
+
readonly mime: string;
|
|
184
|
+
readonly name?: string | undefined;
|
|
185
|
+
})[];
|
|
186
|
+
};
|
|
187
|
+
readonly output?: {
|
|
188
|
+
readonly structured: unknown;
|
|
189
|
+
readonly content: readonly ({
|
|
190
|
+
readonly type: "text";
|
|
191
|
+
readonly text: string;
|
|
192
|
+
} | {
|
|
193
|
+
readonly type: "file";
|
|
194
|
+
readonly uri: string;
|
|
195
|
+
readonly mime: string;
|
|
196
|
+
readonly name?: string | undefined;
|
|
197
|
+
})[];
|
|
198
|
+
} | undefined;
|
|
199
|
+
readonly providerMetadata?: {
|
|
200
|
+
readonly [x: string]: {
|
|
201
|
+
readonly [x: string]: unknown;
|
|
202
|
+
};
|
|
203
|
+
} | undefined;
|
|
204
|
+
readonly namespace?: string | undefined;
|
|
205
|
+
readonly providerExecuted?: boolean | undefined;
|
|
206
|
+
} | {
|
|
207
|
+
readonly id: string;
|
|
208
|
+
readonly type: "tool-error";
|
|
209
|
+
readonly name: string;
|
|
210
|
+
readonly message: string;
|
|
211
|
+
readonly error?: unknown;
|
|
212
|
+
readonly providerMetadata?: {
|
|
213
|
+
readonly [x: string]: {
|
|
214
|
+
readonly [x: string]: unknown;
|
|
215
|
+
};
|
|
216
|
+
} | undefined;
|
|
217
|
+
readonly namespace?: string | undefined;
|
|
218
|
+
} | {
|
|
219
|
+
readonly type: "step-finish";
|
|
220
|
+
readonly reason: {
|
|
221
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
222
|
+
readonly raw?: string | undefined;
|
|
223
|
+
};
|
|
224
|
+
readonly index: number;
|
|
225
|
+
readonly providerMetadata?: {
|
|
226
|
+
readonly [x: string]: {
|
|
227
|
+
readonly [x: string]: unknown;
|
|
228
|
+
};
|
|
229
|
+
} | undefined;
|
|
230
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
readonly type: "finish";
|
|
233
|
+
readonly reason: {
|
|
234
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
235
|
+
readonly raw?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
readonly providerMetadata?: {
|
|
238
|
+
readonly [x: string]: {
|
|
239
|
+
readonly [x: string]: unknown;
|
|
240
|
+
};
|
|
241
|
+
} | undefined;
|
|
242
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
243
|
+
} | {
|
|
244
|
+
readonly type: "provider-error";
|
|
245
|
+
readonly message: string;
|
|
246
|
+
readonly providerMetadata?: {
|
|
247
|
+
readonly [x: string]: {
|
|
248
|
+
readonly [x: string]: unknown;
|
|
249
|
+
};
|
|
250
|
+
} | undefined;
|
|
251
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
252
|
+
})[];
|
|
253
|
+
export declare const stop: (...events: readonly LLMEvent[]) => (({
|
|
254
|
+
readonly type: "compaction";
|
|
255
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
256
|
+
readonly id?: string | undefined;
|
|
257
|
+
readonly text?: string | null | undefined;
|
|
258
|
+
readonly encrypted?: string | undefined;
|
|
259
|
+
} & ({
|
|
260
|
+
readonly encrypted: string;
|
|
261
|
+
readonly text?: never;
|
|
262
|
+
} | {
|
|
263
|
+
readonly text: string | null;
|
|
264
|
+
readonly encrypted?: never;
|
|
265
|
+
})) | {
|
|
266
|
+
readonly type: "step-start";
|
|
267
|
+
readonly index: number;
|
|
268
|
+
} | {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly type: "text-start";
|
|
271
|
+
readonly providerMetadata?: {
|
|
272
|
+
readonly [x: string]: {
|
|
273
|
+
readonly [x: string]: unknown;
|
|
274
|
+
};
|
|
275
|
+
} | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
readonly id: string;
|
|
278
|
+
readonly type: "text-delta";
|
|
279
|
+
readonly text: string;
|
|
280
|
+
readonly providerMetadata?: {
|
|
281
|
+
readonly [x: string]: {
|
|
282
|
+
readonly [x: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
} | undefined;
|
|
285
|
+
} | {
|
|
286
|
+
readonly id: string;
|
|
287
|
+
readonly type: "text-end";
|
|
288
|
+
readonly text?: string | undefined;
|
|
289
|
+
readonly providerMetadata?: {
|
|
290
|
+
readonly [x: string]: {
|
|
291
|
+
readonly [x: string]: unknown;
|
|
292
|
+
};
|
|
293
|
+
} | undefined;
|
|
294
|
+
} | {
|
|
295
|
+
readonly id: string;
|
|
296
|
+
readonly type: "reasoning-start";
|
|
297
|
+
readonly providerMetadata?: {
|
|
298
|
+
readonly [x: string]: {
|
|
299
|
+
readonly [x: string]: unknown;
|
|
300
|
+
};
|
|
301
|
+
} | undefined;
|
|
302
|
+
} | {
|
|
303
|
+
readonly id: string;
|
|
304
|
+
readonly type: "reasoning-delta";
|
|
305
|
+
readonly text: string;
|
|
306
|
+
readonly providerMetadata?: {
|
|
307
|
+
readonly [x: string]: {
|
|
308
|
+
readonly [x: string]: unknown;
|
|
309
|
+
};
|
|
310
|
+
} | undefined;
|
|
311
|
+
} | {
|
|
312
|
+
readonly id: string;
|
|
313
|
+
readonly type: "reasoning-end";
|
|
314
|
+
readonly text?: string | undefined;
|
|
315
|
+
readonly providerMetadata?: {
|
|
316
|
+
readonly [x: string]: {
|
|
317
|
+
readonly [x: string]: unknown;
|
|
318
|
+
};
|
|
319
|
+
} | undefined;
|
|
320
|
+
} | {
|
|
321
|
+
readonly id: string;
|
|
322
|
+
readonly type: "tool-input-start";
|
|
323
|
+
readonly name: string;
|
|
324
|
+
readonly providerMetadata?: {
|
|
325
|
+
readonly [x: string]: {
|
|
326
|
+
readonly [x: string]: unknown;
|
|
327
|
+
};
|
|
328
|
+
} | undefined;
|
|
329
|
+
readonly namespace?: string | undefined;
|
|
330
|
+
readonly providerExecuted?: boolean | undefined;
|
|
331
|
+
} | {
|
|
332
|
+
readonly id: string;
|
|
333
|
+
readonly type: "tool-input-delta";
|
|
334
|
+
readonly name: string;
|
|
335
|
+
readonly text: string;
|
|
336
|
+
readonly input?: unknown;
|
|
337
|
+
readonly namespace?: string | undefined;
|
|
338
|
+
} | {
|
|
339
|
+
readonly id: string;
|
|
340
|
+
readonly type: "tool-input-end";
|
|
341
|
+
readonly name: string;
|
|
342
|
+
readonly providerMetadata?: {
|
|
343
|
+
readonly [x: string]: {
|
|
344
|
+
readonly [x: string]: unknown;
|
|
345
|
+
};
|
|
346
|
+
} | undefined;
|
|
347
|
+
readonly namespace?: string | undefined;
|
|
348
|
+
} | {
|
|
349
|
+
readonly id: string;
|
|
350
|
+
readonly type: "tool-input-error";
|
|
351
|
+
readonly name: string;
|
|
352
|
+
readonly raw: string;
|
|
353
|
+
readonly namespace?: string | undefined;
|
|
354
|
+
} | {
|
|
355
|
+
readonly id: string;
|
|
356
|
+
readonly type: "tool-call";
|
|
357
|
+
readonly name: string;
|
|
358
|
+
readonly input: unknown;
|
|
359
|
+
readonly providerMetadata?: {
|
|
360
|
+
readonly [x: string]: {
|
|
361
|
+
readonly [x: string]: unknown;
|
|
362
|
+
};
|
|
363
|
+
} | undefined;
|
|
364
|
+
readonly namespace?: string | undefined;
|
|
365
|
+
readonly providerExecuted?: boolean | undefined;
|
|
366
|
+
} | {
|
|
367
|
+
readonly id: string;
|
|
368
|
+
readonly type: "tool-result";
|
|
369
|
+
readonly name: string;
|
|
370
|
+
readonly result: {
|
|
371
|
+
readonly type: "json";
|
|
372
|
+
readonly value: unknown;
|
|
373
|
+
} | {
|
|
374
|
+
readonly type: "text";
|
|
375
|
+
readonly value: unknown;
|
|
376
|
+
} | {
|
|
377
|
+
readonly type: "error";
|
|
378
|
+
readonly value: unknown;
|
|
379
|
+
} | {
|
|
380
|
+
readonly type: "content";
|
|
381
|
+
readonly value: readonly ({
|
|
382
|
+
readonly type: "text";
|
|
383
|
+
readonly text: string;
|
|
384
|
+
} | {
|
|
385
|
+
readonly type: "file";
|
|
386
|
+
readonly uri: string;
|
|
387
|
+
readonly mime: string;
|
|
388
|
+
readonly name?: string | undefined;
|
|
389
|
+
})[];
|
|
390
|
+
};
|
|
391
|
+
readonly output?: {
|
|
392
|
+
readonly structured: unknown;
|
|
393
|
+
readonly content: readonly ({
|
|
394
|
+
readonly type: "text";
|
|
395
|
+
readonly text: string;
|
|
396
|
+
} | {
|
|
397
|
+
readonly type: "file";
|
|
398
|
+
readonly uri: string;
|
|
399
|
+
readonly mime: string;
|
|
400
|
+
readonly name?: string | undefined;
|
|
401
|
+
})[];
|
|
402
|
+
} | undefined;
|
|
403
|
+
readonly providerMetadata?: {
|
|
404
|
+
readonly [x: string]: {
|
|
405
|
+
readonly [x: string]: unknown;
|
|
406
|
+
};
|
|
407
|
+
} | undefined;
|
|
408
|
+
readonly namespace?: string | undefined;
|
|
409
|
+
readonly providerExecuted?: boolean | undefined;
|
|
410
|
+
} | {
|
|
411
|
+
readonly id: string;
|
|
412
|
+
readonly type: "tool-error";
|
|
413
|
+
readonly name: string;
|
|
414
|
+
readonly message: string;
|
|
415
|
+
readonly error?: unknown;
|
|
416
|
+
readonly providerMetadata?: {
|
|
417
|
+
readonly [x: string]: {
|
|
418
|
+
readonly [x: string]: unknown;
|
|
419
|
+
};
|
|
420
|
+
} | undefined;
|
|
421
|
+
readonly namespace?: string | undefined;
|
|
422
|
+
} | {
|
|
423
|
+
readonly type: "step-finish";
|
|
424
|
+
readonly reason: {
|
|
425
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
426
|
+
readonly raw?: string | undefined;
|
|
427
|
+
};
|
|
428
|
+
readonly index: number;
|
|
429
|
+
readonly providerMetadata?: {
|
|
430
|
+
readonly [x: string]: {
|
|
431
|
+
readonly [x: string]: unknown;
|
|
432
|
+
};
|
|
433
|
+
} | undefined;
|
|
434
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
435
|
+
} | {
|
|
436
|
+
readonly type: "finish";
|
|
437
|
+
readonly reason: {
|
|
438
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
439
|
+
readonly raw?: string | undefined;
|
|
440
|
+
};
|
|
441
|
+
readonly providerMetadata?: {
|
|
442
|
+
readonly [x: string]: {
|
|
443
|
+
readonly [x: string]: unknown;
|
|
444
|
+
};
|
|
445
|
+
} | undefined;
|
|
446
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
447
|
+
} | {
|
|
448
|
+
readonly type: "provider-error";
|
|
449
|
+
readonly message: string;
|
|
450
|
+
readonly providerMetadata?: {
|
|
451
|
+
readonly [x: string]: {
|
|
452
|
+
readonly [x: string]: unknown;
|
|
453
|
+
};
|
|
454
|
+
} | undefined;
|
|
455
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
456
|
+
})[];
|
|
457
|
+
export declare const toolCalls: (...events: readonly LLMEvent[]) => (({
|
|
458
|
+
readonly type: "compaction";
|
|
459
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
460
|
+
readonly id?: string | undefined;
|
|
461
|
+
readonly text?: string | null | undefined;
|
|
462
|
+
readonly encrypted?: string | undefined;
|
|
463
|
+
} & ({
|
|
464
|
+
readonly encrypted: string;
|
|
465
|
+
readonly text?: never;
|
|
466
|
+
} | {
|
|
467
|
+
readonly text: string | null;
|
|
468
|
+
readonly encrypted?: never;
|
|
469
|
+
})) | {
|
|
470
|
+
readonly type: "step-start";
|
|
471
|
+
readonly index: number;
|
|
472
|
+
} | {
|
|
473
|
+
readonly id: string;
|
|
474
|
+
readonly type: "text-start";
|
|
475
|
+
readonly providerMetadata?: {
|
|
476
|
+
readonly [x: string]: {
|
|
477
|
+
readonly [x: string]: unknown;
|
|
478
|
+
};
|
|
479
|
+
} | undefined;
|
|
480
|
+
} | {
|
|
481
|
+
readonly id: string;
|
|
482
|
+
readonly type: "text-delta";
|
|
483
|
+
readonly text: string;
|
|
484
|
+
readonly providerMetadata?: {
|
|
485
|
+
readonly [x: string]: {
|
|
486
|
+
readonly [x: string]: unknown;
|
|
487
|
+
};
|
|
488
|
+
} | undefined;
|
|
489
|
+
} | {
|
|
490
|
+
readonly id: string;
|
|
491
|
+
readonly type: "text-end";
|
|
492
|
+
readonly text?: string | undefined;
|
|
493
|
+
readonly providerMetadata?: {
|
|
494
|
+
readonly [x: string]: {
|
|
495
|
+
readonly [x: string]: unknown;
|
|
496
|
+
};
|
|
497
|
+
} | undefined;
|
|
498
|
+
} | {
|
|
499
|
+
readonly id: string;
|
|
500
|
+
readonly type: "reasoning-start";
|
|
501
|
+
readonly providerMetadata?: {
|
|
502
|
+
readonly [x: string]: {
|
|
503
|
+
readonly [x: string]: unknown;
|
|
504
|
+
};
|
|
505
|
+
} | undefined;
|
|
506
|
+
} | {
|
|
507
|
+
readonly id: string;
|
|
508
|
+
readonly type: "reasoning-delta";
|
|
509
|
+
readonly text: string;
|
|
510
|
+
readonly providerMetadata?: {
|
|
511
|
+
readonly [x: string]: {
|
|
512
|
+
readonly [x: string]: unknown;
|
|
513
|
+
};
|
|
514
|
+
} | undefined;
|
|
515
|
+
} | {
|
|
516
|
+
readonly id: string;
|
|
517
|
+
readonly type: "reasoning-end";
|
|
518
|
+
readonly text?: string | undefined;
|
|
519
|
+
readonly providerMetadata?: {
|
|
520
|
+
readonly [x: string]: {
|
|
521
|
+
readonly [x: string]: unknown;
|
|
522
|
+
};
|
|
523
|
+
} | undefined;
|
|
524
|
+
} | {
|
|
525
|
+
readonly id: string;
|
|
526
|
+
readonly type: "tool-input-start";
|
|
527
|
+
readonly name: string;
|
|
528
|
+
readonly providerMetadata?: {
|
|
529
|
+
readonly [x: string]: {
|
|
530
|
+
readonly [x: string]: unknown;
|
|
531
|
+
};
|
|
532
|
+
} | undefined;
|
|
533
|
+
readonly namespace?: string | undefined;
|
|
534
|
+
readonly providerExecuted?: boolean | undefined;
|
|
535
|
+
} | {
|
|
536
|
+
readonly id: string;
|
|
537
|
+
readonly type: "tool-input-delta";
|
|
538
|
+
readonly name: string;
|
|
539
|
+
readonly text: string;
|
|
540
|
+
readonly input?: unknown;
|
|
541
|
+
readonly namespace?: string | undefined;
|
|
542
|
+
} | {
|
|
543
|
+
readonly id: string;
|
|
544
|
+
readonly type: "tool-input-end";
|
|
545
|
+
readonly name: string;
|
|
546
|
+
readonly providerMetadata?: {
|
|
547
|
+
readonly [x: string]: {
|
|
548
|
+
readonly [x: string]: unknown;
|
|
549
|
+
};
|
|
550
|
+
} | undefined;
|
|
551
|
+
readonly namespace?: string | undefined;
|
|
552
|
+
} | {
|
|
553
|
+
readonly id: string;
|
|
554
|
+
readonly type: "tool-input-error";
|
|
555
|
+
readonly name: string;
|
|
556
|
+
readonly raw: string;
|
|
557
|
+
readonly namespace?: string | undefined;
|
|
558
|
+
} | {
|
|
559
|
+
readonly id: string;
|
|
560
|
+
readonly type: "tool-call";
|
|
561
|
+
readonly name: string;
|
|
562
|
+
readonly input: unknown;
|
|
563
|
+
readonly providerMetadata?: {
|
|
564
|
+
readonly [x: string]: {
|
|
565
|
+
readonly [x: string]: unknown;
|
|
566
|
+
};
|
|
567
|
+
} | undefined;
|
|
568
|
+
readonly namespace?: string | undefined;
|
|
569
|
+
readonly providerExecuted?: boolean | undefined;
|
|
570
|
+
} | {
|
|
571
|
+
readonly id: string;
|
|
572
|
+
readonly type: "tool-result";
|
|
573
|
+
readonly name: string;
|
|
574
|
+
readonly result: {
|
|
575
|
+
readonly type: "json";
|
|
576
|
+
readonly value: unknown;
|
|
577
|
+
} | {
|
|
578
|
+
readonly type: "text";
|
|
579
|
+
readonly value: unknown;
|
|
580
|
+
} | {
|
|
581
|
+
readonly type: "error";
|
|
582
|
+
readonly value: unknown;
|
|
583
|
+
} | {
|
|
584
|
+
readonly type: "content";
|
|
585
|
+
readonly value: readonly ({
|
|
586
|
+
readonly type: "text";
|
|
587
|
+
readonly text: string;
|
|
588
|
+
} | {
|
|
589
|
+
readonly type: "file";
|
|
590
|
+
readonly uri: string;
|
|
591
|
+
readonly mime: string;
|
|
592
|
+
readonly name?: string | undefined;
|
|
593
|
+
})[];
|
|
594
|
+
};
|
|
595
|
+
readonly output?: {
|
|
596
|
+
readonly structured: unknown;
|
|
597
|
+
readonly content: readonly ({
|
|
598
|
+
readonly type: "text";
|
|
599
|
+
readonly text: string;
|
|
600
|
+
} | {
|
|
601
|
+
readonly type: "file";
|
|
602
|
+
readonly uri: string;
|
|
603
|
+
readonly mime: string;
|
|
604
|
+
readonly name?: string | undefined;
|
|
605
|
+
})[];
|
|
606
|
+
} | undefined;
|
|
607
|
+
readonly providerMetadata?: {
|
|
608
|
+
readonly [x: string]: {
|
|
609
|
+
readonly [x: string]: unknown;
|
|
610
|
+
};
|
|
611
|
+
} | undefined;
|
|
612
|
+
readonly namespace?: string | undefined;
|
|
613
|
+
readonly providerExecuted?: boolean | undefined;
|
|
614
|
+
} | {
|
|
615
|
+
readonly id: string;
|
|
616
|
+
readonly type: "tool-error";
|
|
617
|
+
readonly name: string;
|
|
618
|
+
readonly message: string;
|
|
619
|
+
readonly error?: unknown;
|
|
620
|
+
readonly providerMetadata?: {
|
|
621
|
+
readonly [x: string]: {
|
|
622
|
+
readonly [x: string]: unknown;
|
|
623
|
+
};
|
|
624
|
+
} | undefined;
|
|
625
|
+
readonly namespace?: string | undefined;
|
|
626
|
+
} | {
|
|
627
|
+
readonly type: "step-finish";
|
|
628
|
+
readonly reason: {
|
|
629
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
630
|
+
readonly raw?: string | undefined;
|
|
631
|
+
};
|
|
632
|
+
readonly index: number;
|
|
633
|
+
readonly providerMetadata?: {
|
|
634
|
+
readonly [x: string]: {
|
|
635
|
+
readonly [x: string]: unknown;
|
|
636
|
+
};
|
|
637
|
+
} | undefined;
|
|
638
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
639
|
+
} | {
|
|
640
|
+
readonly type: "finish";
|
|
641
|
+
readonly reason: {
|
|
642
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
643
|
+
readonly raw?: string | undefined;
|
|
644
|
+
};
|
|
645
|
+
readonly providerMetadata?: {
|
|
646
|
+
readonly [x: string]: {
|
|
647
|
+
readonly [x: string]: unknown;
|
|
648
|
+
};
|
|
649
|
+
} | undefined;
|
|
650
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
651
|
+
} | {
|
|
652
|
+
readonly type: "provider-error";
|
|
653
|
+
readonly message: string;
|
|
654
|
+
readonly providerMetadata?: {
|
|
655
|
+
readonly [x: string]: {
|
|
656
|
+
readonly [x: string]: unknown;
|
|
657
|
+
};
|
|
658
|
+
} | undefined;
|
|
659
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
660
|
+
})[];
|
|
661
|
+
export declare const text: (value: string, id: string) => (({
|
|
662
|
+
readonly type: "compaction";
|
|
663
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
664
|
+
readonly id?: string | undefined;
|
|
665
|
+
readonly text?: string | null | undefined;
|
|
666
|
+
readonly encrypted?: string | undefined;
|
|
667
|
+
} & ({
|
|
668
|
+
readonly encrypted: string;
|
|
669
|
+
readonly text?: never;
|
|
670
|
+
} | {
|
|
671
|
+
readonly text: string | null;
|
|
672
|
+
readonly encrypted?: never;
|
|
673
|
+
})) | {
|
|
674
|
+
readonly type: "step-start";
|
|
675
|
+
readonly index: number;
|
|
676
|
+
} | {
|
|
677
|
+
readonly id: string;
|
|
678
|
+
readonly type: "text-start";
|
|
679
|
+
readonly providerMetadata?: {
|
|
680
|
+
readonly [x: string]: {
|
|
681
|
+
readonly [x: string]: unknown;
|
|
682
|
+
};
|
|
683
|
+
} | undefined;
|
|
684
|
+
} | {
|
|
685
|
+
readonly id: string;
|
|
686
|
+
readonly type: "text-delta";
|
|
687
|
+
readonly text: string;
|
|
688
|
+
readonly providerMetadata?: {
|
|
689
|
+
readonly [x: string]: {
|
|
690
|
+
readonly [x: string]: unknown;
|
|
691
|
+
};
|
|
692
|
+
} | undefined;
|
|
693
|
+
} | {
|
|
694
|
+
readonly id: string;
|
|
695
|
+
readonly type: "text-end";
|
|
696
|
+
readonly text?: string | undefined;
|
|
697
|
+
readonly providerMetadata?: {
|
|
698
|
+
readonly [x: string]: {
|
|
699
|
+
readonly [x: string]: unknown;
|
|
700
|
+
};
|
|
701
|
+
} | undefined;
|
|
702
|
+
} | {
|
|
703
|
+
readonly id: string;
|
|
704
|
+
readonly type: "reasoning-start";
|
|
705
|
+
readonly providerMetadata?: {
|
|
706
|
+
readonly [x: string]: {
|
|
707
|
+
readonly [x: string]: unknown;
|
|
708
|
+
};
|
|
709
|
+
} | undefined;
|
|
710
|
+
} | {
|
|
711
|
+
readonly id: string;
|
|
712
|
+
readonly type: "reasoning-delta";
|
|
713
|
+
readonly text: string;
|
|
714
|
+
readonly providerMetadata?: {
|
|
715
|
+
readonly [x: string]: {
|
|
716
|
+
readonly [x: string]: unknown;
|
|
717
|
+
};
|
|
718
|
+
} | undefined;
|
|
719
|
+
} | {
|
|
720
|
+
readonly id: string;
|
|
721
|
+
readonly type: "reasoning-end";
|
|
722
|
+
readonly text?: string | undefined;
|
|
723
|
+
readonly providerMetadata?: {
|
|
724
|
+
readonly [x: string]: {
|
|
725
|
+
readonly [x: string]: unknown;
|
|
726
|
+
};
|
|
727
|
+
} | undefined;
|
|
728
|
+
} | {
|
|
729
|
+
readonly id: string;
|
|
730
|
+
readonly type: "tool-input-start";
|
|
731
|
+
readonly name: string;
|
|
732
|
+
readonly providerMetadata?: {
|
|
733
|
+
readonly [x: string]: {
|
|
734
|
+
readonly [x: string]: unknown;
|
|
735
|
+
};
|
|
736
|
+
} | undefined;
|
|
737
|
+
readonly namespace?: string | undefined;
|
|
738
|
+
readonly providerExecuted?: boolean | undefined;
|
|
739
|
+
} | {
|
|
740
|
+
readonly id: string;
|
|
741
|
+
readonly type: "tool-input-delta";
|
|
742
|
+
readonly name: string;
|
|
743
|
+
readonly text: string;
|
|
744
|
+
readonly input?: unknown;
|
|
745
|
+
readonly namespace?: string | undefined;
|
|
746
|
+
} | {
|
|
747
|
+
readonly id: string;
|
|
748
|
+
readonly type: "tool-input-end";
|
|
749
|
+
readonly name: string;
|
|
750
|
+
readonly providerMetadata?: {
|
|
751
|
+
readonly [x: string]: {
|
|
752
|
+
readonly [x: string]: unknown;
|
|
753
|
+
};
|
|
754
|
+
} | undefined;
|
|
755
|
+
readonly namespace?: string | undefined;
|
|
756
|
+
} | {
|
|
757
|
+
readonly id: string;
|
|
758
|
+
readonly type: "tool-input-error";
|
|
759
|
+
readonly name: string;
|
|
760
|
+
readonly raw: string;
|
|
761
|
+
readonly namespace?: string | undefined;
|
|
762
|
+
} | {
|
|
763
|
+
readonly id: string;
|
|
764
|
+
readonly type: "tool-call";
|
|
765
|
+
readonly name: string;
|
|
766
|
+
readonly input: unknown;
|
|
767
|
+
readonly providerMetadata?: {
|
|
768
|
+
readonly [x: string]: {
|
|
769
|
+
readonly [x: string]: unknown;
|
|
770
|
+
};
|
|
771
|
+
} | undefined;
|
|
772
|
+
readonly namespace?: string | undefined;
|
|
773
|
+
readonly providerExecuted?: boolean | undefined;
|
|
774
|
+
} | {
|
|
775
|
+
readonly id: string;
|
|
776
|
+
readonly type: "tool-result";
|
|
777
|
+
readonly name: string;
|
|
778
|
+
readonly result: {
|
|
779
|
+
readonly type: "json";
|
|
780
|
+
readonly value: unknown;
|
|
781
|
+
} | {
|
|
782
|
+
readonly type: "text";
|
|
783
|
+
readonly value: unknown;
|
|
784
|
+
} | {
|
|
785
|
+
readonly type: "error";
|
|
786
|
+
readonly value: unknown;
|
|
787
|
+
} | {
|
|
788
|
+
readonly type: "content";
|
|
789
|
+
readonly value: readonly ({
|
|
790
|
+
readonly type: "text";
|
|
791
|
+
readonly text: string;
|
|
792
|
+
} | {
|
|
793
|
+
readonly type: "file";
|
|
794
|
+
readonly uri: string;
|
|
795
|
+
readonly mime: string;
|
|
796
|
+
readonly name?: string | undefined;
|
|
797
|
+
})[];
|
|
798
|
+
};
|
|
799
|
+
readonly output?: {
|
|
800
|
+
readonly structured: unknown;
|
|
801
|
+
readonly content: readonly ({
|
|
802
|
+
readonly type: "text";
|
|
803
|
+
readonly text: string;
|
|
804
|
+
} | {
|
|
805
|
+
readonly type: "file";
|
|
806
|
+
readonly uri: string;
|
|
807
|
+
readonly mime: string;
|
|
808
|
+
readonly name?: string | undefined;
|
|
809
|
+
})[];
|
|
810
|
+
} | undefined;
|
|
811
|
+
readonly providerMetadata?: {
|
|
812
|
+
readonly [x: string]: {
|
|
813
|
+
readonly [x: string]: unknown;
|
|
814
|
+
};
|
|
815
|
+
} | undefined;
|
|
816
|
+
readonly namespace?: string | undefined;
|
|
817
|
+
readonly providerExecuted?: boolean | undefined;
|
|
818
|
+
} | {
|
|
819
|
+
readonly id: string;
|
|
820
|
+
readonly type: "tool-error";
|
|
821
|
+
readonly name: string;
|
|
822
|
+
readonly message: string;
|
|
823
|
+
readonly error?: unknown;
|
|
824
|
+
readonly providerMetadata?: {
|
|
825
|
+
readonly [x: string]: {
|
|
826
|
+
readonly [x: string]: unknown;
|
|
827
|
+
};
|
|
828
|
+
} | undefined;
|
|
829
|
+
readonly namespace?: string | undefined;
|
|
830
|
+
} | {
|
|
831
|
+
readonly type: "step-finish";
|
|
832
|
+
readonly reason: {
|
|
833
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
834
|
+
readonly raw?: string | undefined;
|
|
835
|
+
};
|
|
836
|
+
readonly index: number;
|
|
837
|
+
readonly providerMetadata?: {
|
|
838
|
+
readonly [x: string]: {
|
|
839
|
+
readonly [x: string]: unknown;
|
|
840
|
+
};
|
|
841
|
+
} | undefined;
|
|
842
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
843
|
+
} | {
|
|
844
|
+
readonly type: "finish";
|
|
845
|
+
readonly reason: {
|
|
846
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
847
|
+
readonly raw?: string | undefined;
|
|
848
|
+
};
|
|
849
|
+
readonly providerMetadata?: {
|
|
850
|
+
readonly [x: string]: {
|
|
851
|
+
readonly [x: string]: unknown;
|
|
852
|
+
};
|
|
853
|
+
} | undefined;
|
|
854
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
855
|
+
} | {
|
|
856
|
+
readonly type: "provider-error";
|
|
857
|
+
readonly message: string;
|
|
858
|
+
readonly providerMetadata?: {
|
|
859
|
+
readonly [x: string]: {
|
|
860
|
+
readonly [x: string]: unknown;
|
|
861
|
+
};
|
|
862
|
+
} | undefined;
|
|
863
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
864
|
+
})[];
|
|
865
|
+
export declare const textWithUsage: (value: string, id: string, inputTokens: number) => (({
|
|
866
|
+
readonly type: "compaction";
|
|
867
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
868
|
+
readonly id?: string | undefined;
|
|
869
|
+
readonly text?: string | null | undefined;
|
|
870
|
+
readonly encrypted?: string | undefined;
|
|
871
|
+
} & ({
|
|
872
|
+
readonly encrypted: string;
|
|
873
|
+
readonly text?: never;
|
|
874
|
+
} | {
|
|
875
|
+
readonly text: string | null;
|
|
876
|
+
readonly encrypted?: never;
|
|
877
|
+
})) | {
|
|
878
|
+
readonly type: "step-start";
|
|
879
|
+
readonly index: number;
|
|
880
|
+
} | {
|
|
881
|
+
readonly id: string;
|
|
882
|
+
readonly type: "text-start";
|
|
883
|
+
readonly providerMetadata?: {
|
|
884
|
+
readonly [x: string]: {
|
|
885
|
+
readonly [x: string]: unknown;
|
|
886
|
+
};
|
|
887
|
+
} | undefined;
|
|
888
|
+
} | {
|
|
889
|
+
readonly id: string;
|
|
890
|
+
readonly type: "text-delta";
|
|
891
|
+
readonly text: string;
|
|
892
|
+
readonly providerMetadata?: {
|
|
893
|
+
readonly [x: string]: {
|
|
894
|
+
readonly [x: string]: unknown;
|
|
895
|
+
};
|
|
896
|
+
} | undefined;
|
|
897
|
+
} | {
|
|
898
|
+
readonly id: string;
|
|
899
|
+
readonly type: "text-end";
|
|
900
|
+
readonly text?: string | undefined;
|
|
901
|
+
readonly providerMetadata?: {
|
|
902
|
+
readonly [x: string]: {
|
|
903
|
+
readonly [x: string]: unknown;
|
|
904
|
+
};
|
|
905
|
+
} | undefined;
|
|
906
|
+
} | {
|
|
907
|
+
readonly id: string;
|
|
908
|
+
readonly type: "reasoning-start";
|
|
909
|
+
readonly providerMetadata?: {
|
|
910
|
+
readonly [x: string]: {
|
|
911
|
+
readonly [x: string]: unknown;
|
|
912
|
+
};
|
|
913
|
+
} | undefined;
|
|
914
|
+
} | {
|
|
915
|
+
readonly id: string;
|
|
916
|
+
readonly type: "reasoning-delta";
|
|
917
|
+
readonly text: string;
|
|
918
|
+
readonly providerMetadata?: {
|
|
919
|
+
readonly [x: string]: {
|
|
920
|
+
readonly [x: string]: unknown;
|
|
921
|
+
};
|
|
922
|
+
} | undefined;
|
|
923
|
+
} | {
|
|
924
|
+
readonly id: string;
|
|
925
|
+
readonly type: "reasoning-end";
|
|
926
|
+
readonly text?: string | undefined;
|
|
927
|
+
readonly providerMetadata?: {
|
|
928
|
+
readonly [x: string]: {
|
|
929
|
+
readonly [x: string]: unknown;
|
|
930
|
+
};
|
|
931
|
+
} | undefined;
|
|
932
|
+
} | {
|
|
933
|
+
readonly id: string;
|
|
934
|
+
readonly type: "tool-input-start";
|
|
935
|
+
readonly name: string;
|
|
936
|
+
readonly providerMetadata?: {
|
|
937
|
+
readonly [x: string]: {
|
|
938
|
+
readonly [x: string]: unknown;
|
|
939
|
+
};
|
|
940
|
+
} | undefined;
|
|
941
|
+
readonly namespace?: string | undefined;
|
|
942
|
+
readonly providerExecuted?: boolean | undefined;
|
|
943
|
+
} | {
|
|
944
|
+
readonly id: string;
|
|
945
|
+
readonly type: "tool-input-delta";
|
|
946
|
+
readonly name: string;
|
|
947
|
+
readonly text: string;
|
|
948
|
+
readonly input?: unknown;
|
|
949
|
+
readonly namespace?: string | undefined;
|
|
950
|
+
} | {
|
|
951
|
+
readonly id: string;
|
|
952
|
+
readonly type: "tool-input-end";
|
|
953
|
+
readonly name: string;
|
|
954
|
+
readonly providerMetadata?: {
|
|
955
|
+
readonly [x: string]: {
|
|
956
|
+
readonly [x: string]: unknown;
|
|
957
|
+
};
|
|
958
|
+
} | undefined;
|
|
959
|
+
readonly namespace?: string | undefined;
|
|
960
|
+
} | {
|
|
961
|
+
readonly id: string;
|
|
962
|
+
readonly type: "tool-input-error";
|
|
963
|
+
readonly name: string;
|
|
964
|
+
readonly raw: string;
|
|
965
|
+
readonly namespace?: string | undefined;
|
|
966
|
+
} | {
|
|
967
|
+
readonly id: string;
|
|
968
|
+
readonly type: "tool-call";
|
|
969
|
+
readonly name: string;
|
|
970
|
+
readonly input: unknown;
|
|
971
|
+
readonly providerMetadata?: {
|
|
972
|
+
readonly [x: string]: {
|
|
973
|
+
readonly [x: string]: unknown;
|
|
974
|
+
};
|
|
975
|
+
} | undefined;
|
|
976
|
+
readonly namespace?: string | undefined;
|
|
977
|
+
readonly providerExecuted?: boolean | undefined;
|
|
978
|
+
} | {
|
|
979
|
+
readonly id: string;
|
|
980
|
+
readonly type: "tool-result";
|
|
981
|
+
readonly name: string;
|
|
982
|
+
readonly result: {
|
|
983
|
+
readonly type: "json";
|
|
984
|
+
readonly value: unknown;
|
|
985
|
+
} | {
|
|
986
|
+
readonly type: "text";
|
|
987
|
+
readonly value: unknown;
|
|
988
|
+
} | {
|
|
989
|
+
readonly type: "error";
|
|
990
|
+
readonly value: unknown;
|
|
991
|
+
} | {
|
|
992
|
+
readonly type: "content";
|
|
993
|
+
readonly value: readonly ({
|
|
994
|
+
readonly type: "text";
|
|
995
|
+
readonly text: string;
|
|
996
|
+
} | {
|
|
997
|
+
readonly type: "file";
|
|
998
|
+
readonly uri: string;
|
|
999
|
+
readonly mime: string;
|
|
1000
|
+
readonly name?: string | undefined;
|
|
1001
|
+
})[];
|
|
1002
|
+
};
|
|
1003
|
+
readonly output?: {
|
|
1004
|
+
readonly structured: unknown;
|
|
1005
|
+
readonly content: readonly ({
|
|
1006
|
+
readonly type: "text";
|
|
1007
|
+
readonly text: string;
|
|
1008
|
+
} | {
|
|
1009
|
+
readonly type: "file";
|
|
1010
|
+
readonly uri: string;
|
|
1011
|
+
readonly mime: string;
|
|
1012
|
+
readonly name?: string | undefined;
|
|
1013
|
+
})[];
|
|
1014
|
+
} | undefined;
|
|
1015
|
+
readonly providerMetadata?: {
|
|
1016
|
+
readonly [x: string]: {
|
|
1017
|
+
readonly [x: string]: unknown;
|
|
1018
|
+
};
|
|
1019
|
+
} | undefined;
|
|
1020
|
+
readonly namespace?: string | undefined;
|
|
1021
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1022
|
+
} | {
|
|
1023
|
+
readonly id: string;
|
|
1024
|
+
readonly type: "tool-error";
|
|
1025
|
+
readonly name: string;
|
|
1026
|
+
readonly message: string;
|
|
1027
|
+
readonly error?: unknown;
|
|
1028
|
+
readonly providerMetadata?: {
|
|
1029
|
+
readonly [x: string]: {
|
|
1030
|
+
readonly [x: string]: unknown;
|
|
1031
|
+
};
|
|
1032
|
+
} | undefined;
|
|
1033
|
+
readonly namespace?: string | undefined;
|
|
1034
|
+
} | {
|
|
1035
|
+
readonly type: "step-finish";
|
|
1036
|
+
readonly reason: {
|
|
1037
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1038
|
+
readonly raw?: string | undefined;
|
|
1039
|
+
};
|
|
1040
|
+
readonly index: number;
|
|
1041
|
+
readonly providerMetadata?: {
|
|
1042
|
+
readonly [x: string]: {
|
|
1043
|
+
readonly [x: string]: unknown;
|
|
1044
|
+
};
|
|
1045
|
+
} | undefined;
|
|
1046
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1047
|
+
} | {
|
|
1048
|
+
readonly type: "finish";
|
|
1049
|
+
readonly reason: {
|
|
1050
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1051
|
+
readonly raw?: string | undefined;
|
|
1052
|
+
};
|
|
1053
|
+
readonly providerMetadata?: {
|
|
1054
|
+
readonly [x: string]: {
|
|
1055
|
+
readonly [x: string]: unknown;
|
|
1056
|
+
};
|
|
1057
|
+
} | undefined;
|
|
1058
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1059
|
+
} | {
|
|
1060
|
+
readonly type: "provider-error";
|
|
1061
|
+
readonly message: string;
|
|
1062
|
+
readonly providerMetadata?: {
|
|
1063
|
+
readonly [x: string]: {
|
|
1064
|
+
readonly [x: string]: unknown;
|
|
1065
|
+
};
|
|
1066
|
+
} | undefined;
|
|
1067
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
1068
|
+
})[];
|
|
1069
|
+
export declare const tool: (id: string, name: string, input: unknown) => (({
|
|
1070
|
+
readonly type: "compaction";
|
|
1071
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1072
|
+
readonly id?: string | undefined;
|
|
1073
|
+
readonly text?: string | null | undefined;
|
|
1074
|
+
readonly encrypted?: string | undefined;
|
|
1075
|
+
} & ({
|
|
1076
|
+
readonly encrypted: string;
|
|
1077
|
+
readonly text?: never;
|
|
1078
|
+
} | {
|
|
1079
|
+
readonly text: string | null;
|
|
1080
|
+
readonly encrypted?: never;
|
|
1081
|
+
})) | {
|
|
1082
|
+
readonly type: "step-start";
|
|
1083
|
+
readonly index: number;
|
|
1084
|
+
} | {
|
|
1085
|
+
readonly id: string;
|
|
1086
|
+
readonly type: "text-start";
|
|
1087
|
+
readonly providerMetadata?: {
|
|
1088
|
+
readonly [x: string]: {
|
|
1089
|
+
readonly [x: string]: unknown;
|
|
1090
|
+
};
|
|
1091
|
+
} | undefined;
|
|
1092
|
+
} | {
|
|
1093
|
+
readonly id: string;
|
|
1094
|
+
readonly type: "text-delta";
|
|
1095
|
+
readonly text: string;
|
|
1096
|
+
readonly providerMetadata?: {
|
|
1097
|
+
readonly [x: string]: {
|
|
1098
|
+
readonly [x: string]: unknown;
|
|
1099
|
+
};
|
|
1100
|
+
} | undefined;
|
|
1101
|
+
} | {
|
|
1102
|
+
readonly id: string;
|
|
1103
|
+
readonly type: "text-end";
|
|
1104
|
+
readonly text?: string | undefined;
|
|
1105
|
+
readonly providerMetadata?: {
|
|
1106
|
+
readonly [x: string]: {
|
|
1107
|
+
readonly [x: string]: unknown;
|
|
1108
|
+
};
|
|
1109
|
+
} | undefined;
|
|
1110
|
+
} | {
|
|
1111
|
+
readonly id: string;
|
|
1112
|
+
readonly type: "reasoning-start";
|
|
1113
|
+
readonly providerMetadata?: {
|
|
1114
|
+
readonly [x: string]: {
|
|
1115
|
+
readonly [x: string]: unknown;
|
|
1116
|
+
};
|
|
1117
|
+
} | undefined;
|
|
1118
|
+
} | {
|
|
1119
|
+
readonly id: string;
|
|
1120
|
+
readonly type: "reasoning-delta";
|
|
1121
|
+
readonly text: string;
|
|
1122
|
+
readonly providerMetadata?: {
|
|
1123
|
+
readonly [x: string]: {
|
|
1124
|
+
readonly [x: string]: unknown;
|
|
1125
|
+
};
|
|
1126
|
+
} | undefined;
|
|
1127
|
+
} | {
|
|
1128
|
+
readonly id: string;
|
|
1129
|
+
readonly type: "reasoning-end";
|
|
1130
|
+
readonly text?: string | undefined;
|
|
1131
|
+
readonly providerMetadata?: {
|
|
1132
|
+
readonly [x: string]: {
|
|
1133
|
+
readonly [x: string]: unknown;
|
|
1134
|
+
};
|
|
1135
|
+
} | undefined;
|
|
1136
|
+
} | {
|
|
1137
|
+
readonly id: string;
|
|
1138
|
+
readonly type: "tool-input-start";
|
|
1139
|
+
readonly name: string;
|
|
1140
|
+
readonly providerMetadata?: {
|
|
1141
|
+
readonly [x: string]: {
|
|
1142
|
+
readonly [x: string]: unknown;
|
|
1143
|
+
};
|
|
1144
|
+
} | undefined;
|
|
1145
|
+
readonly namespace?: string | undefined;
|
|
1146
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1147
|
+
} | {
|
|
1148
|
+
readonly id: string;
|
|
1149
|
+
readonly type: "tool-input-delta";
|
|
1150
|
+
readonly name: string;
|
|
1151
|
+
readonly text: string;
|
|
1152
|
+
readonly input?: unknown;
|
|
1153
|
+
readonly namespace?: string | undefined;
|
|
1154
|
+
} | {
|
|
1155
|
+
readonly id: string;
|
|
1156
|
+
readonly type: "tool-input-end";
|
|
1157
|
+
readonly name: string;
|
|
1158
|
+
readonly providerMetadata?: {
|
|
1159
|
+
readonly [x: string]: {
|
|
1160
|
+
readonly [x: string]: unknown;
|
|
1161
|
+
};
|
|
1162
|
+
} | undefined;
|
|
1163
|
+
readonly namespace?: string | undefined;
|
|
1164
|
+
} | {
|
|
1165
|
+
readonly id: string;
|
|
1166
|
+
readonly type: "tool-input-error";
|
|
1167
|
+
readonly name: string;
|
|
1168
|
+
readonly raw: string;
|
|
1169
|
+
readonly namespace?: string | undefined;
|
|
1170
|
+
} | {
|
|
1171
|
+
readonly id: string;
|
|
1172
|
+
readonly type: "tool-call";
|
|
1173
|
+
readonly name: string;
|
|
1174
|
+
readonly input: unknown;
|
|
1175
|
+
readonly providerMetadata?: {
|
|
1176
|
+
readonly [x: string]: {
|
|
1177
|
+
readonly [x: string]: unknown;
|
|
1178
|
+
};
|
|
1179
|
+
} | undefined;
|
|
1180
|
+
readonly namespace?: string | undefined;
|
|
1181
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1182
|
+
} | {
|
|
1183
|
+
readonly id: string;
|
|
1184
|
+
readonly type: "tool-result";
|
|
1185
|
+
readonly name: string;
|
|
1186
|
+
readonly result: {
|
|
1187
|
+
readonly type: "json";
|
|
1188
|
+
readonly value: unknown;
|
|
1189
|
+
} | {
|
|
1190
|
+
readonly type: "text";
|
|
1191
|
+
readonly value: unknown;
|
|
1192
|
+
} | {
|
|
1193
|
+
readonly type: "error";
|
|
1194
|
+
readonly value: unknown;
|
|
1195
|
+
} | {
|
|
1196
|
+
readonly type: "content";
|
|
1197
|
+
readonly value: readonly ({
|
|
1198
|
+
readonly type: "text";
|
|
1199
|
+
readonly text: string;
|
|
1200
|
+
} | {
|
|
1201
|
+
readonly type: "file";
|
|
1202
|
+
readonly uri: string;
|
|
1203
|
+
readonly mime: string;
|
|
1204
|
+
readonly name?: string | undefined;
|
|
1205
|
+
})[];
|
|
1206
|
+
};
|
|
1207
|
+
readonly output?: {
|
|
1208
|
+
readonly structured: unknown;
|
|
1209
|
+
readonly content: readonly ({
|
|
1210
|
+
readonly type: "text";
|
|
1211
|
+
readonly text: string;
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly type: "file";
|
|
1214
|
+
readonly uri: string;
|
|
1215
|
+
readonly mime: string;
|
|
1216
|
+
readonly name?: string | undefined;
|
|
1217
|
+
})[];
|
|
1218
|
+
} | undefined;
|
|
1219
|
+
readonly providerMetadata?: {
|
|
1220
|
+
readonly [x: string]: {
|
|
1221
|
+
readonly [x: string]: unknown;
|
|
1222
|
+
};
|
|
1223
|
+
} | undefined;
|
|
1224
|
+
readonly namespace?: string | undefined;
|
|
1225
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1226
|
+
} | {
|
|
1227
|
+
readonly id: string;
|
|
1228
|
+
readonly type: "tool-error";
|
|
1229
|
+
readonly name: string;
|
|
1230
|
+
readonly message: string;
|
|
1231
|
+
readonly error?: unknown;
|
|
1232
|
+
readonly providerMetadata?: {
|
|
1233
|
+
readonly [x: string]: {
|
|
1234
|
+
readonly [x: string]: unknown;
|
|
1235
|
+
};
|
|
1236
|
+
} | undefined;
|
|
1237
|
+
readonly namespace?: string | undefined;
|
|
1238
|
+
} | {
|
|
1239
|
+
readonly type: "step-finish";
|
|
1240
|
+
readonly reason: {
|
|
1241
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1242
|
+
readonly raw?: string | undefined;
|
|
1243
|
+
};
|
|
1244
|
+
readonly index: number;
|
|
1245
|
+
readonly providerMetadata?: {
|
|
1246
|
+
readonly [x: string]: {
|
|
1247
|
+
readonly [x: string]: unknown;
|
|
1248
|
+
};
|
|
1249
|
+
} | undefined;
|
|
1250
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1251
|
+
} | {
|
|
1252
|
+
readonly type: "finish";
|
|
1253
|
+
readonly reason: {
|
|
1254
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1255
|
+
readonly raw?: string | undefined;
|
|
1256
|
+
};
|
|
1257
|
+
readonly providerMetadata?: {
|
|
1258
|
+
readonly [x: string]: {
|
|
1259
|
+
readonly [x: string]: unknown;
|
|
1260
|
+
};
|
|
1261
|
+
} | undefined;
|
|
1262
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1263
|
+
} | {
|
|
1264
|
+
readonly type: "provider-error";
|
|
1265
|
+
readonly message: string;
|
|
1266
|
+
readonly providerMetadata?: {
|
|
1267
|
+
readonly [x: string]: {
|
|
1268
|
+
readonly [x: string]: unknown;
|
|
1269
|
+
};
|
|
1270
|
+
} | undefined;
|
|
1271
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
1272
|
+
})[];
|
|
1273
|
+
export declare const failAfter: (error: AIError, ...events: readonly LLMEvent[]) => Stream.Stream<({
|
|
1274
|
+
readonly type: "compaction";
|
|
1275
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1276
|
+
readonly id?: string | undefined;
|
|
1277
|
+
readonly text?: string | null | undefined;
|
|
1278
|
+
readonly encrypted?: string | undefined;
|
|
1279
|
+
} & ({
|
|
1280
|
+
readonly encrypted: string;
|
|
1281
|
+
readonly text?: never;
|
|
1282
|
+
} | {
|
|
1283
|
+
readonly text: string | null;
|
|
1284
|
+
readonly encrypted?: never;
|
|
1285
|
+
})) | {
|
|
1286
|
+
readonly type: "step-start";
|
|
1287
|
+
readonly index: number;
|
|
1288
|
+
} | {
|
|
1289
|
+
readonly id: string;
|
|
1290
|
+
readonly type: "text-start";
|
|
1291
|
+
readonly providerMetadata?: {
|
|
1292
|
+
readonly [x: string]: {
|
|
1293
|
+
readonly [x: string]: unknown;
|
|
1294
|
+
};
|
|
1295
|
+
} | undefined;
|
|
1296
|
+
} | {
|
|
1297
|
+
readonly id: string;
|
|
1298
|
+
readonly type: "text-delta";
|
|
1299
|
+
readonly text: string;
|
|
1300
|
+
readonly providerMetadata?: {
|
|
1301
|
+
readonly [x: string]: {
|
|
1302
|
+
readonly [x: string]: unknown;
|
|
1303
|
+
};
|
|
1304
|
+
} | undefined;
|
|
1305
|
+
} | {
|
|
1306
|
+
readonly id: string;
|
|
1307
|
+
readonly type: "text-end";
|
|
1308
|
+
readonly text?: string | undefined;
|
|
1309
|
+
readonly providerMetadata?: {
|
|
1310
|
+
readonly [x: string]: {
|
|
1311
|
+
readonly [x: string]: unknown;
|
|
1312
|
+
};
|
|
1313
|
+
} | undefined;
|
|
1314
|
+
} | {
|
|
1315
|
+
readonly id: string;
|
|
1316
|
+
readonly type: "reasoning-start";
|
|
1317
|
+
readonly providerMetadata?: {
|
|
1318
|
+
readonly [x: string]: {
|
|
1319
|
+
readonly [x: string]: unknown;
|
|
1320
|
+
};
|
|
1321
|
+
} | undefined;
|
|
1322
|
+
} | {
|
|
1323
|
+
readonly id: string;
|
|
1324
|
+
readonly type: "reasoning-delta";
|
|
1325
|
+
readonly text: string;
|
|
1326
|
+
readonly providerMetadata?: {
|
|
1327
|
+
readonly [x: string]: {
|
|
1328
|
+
readonly [x: string]: unknown;
|
|
1329
|
+
};
|
|
1330
|
+
} | undefined;
|
|
1331
|
+
} | {
|
|
1332
|
+
readonly id: string;
|
|
1333
|
+
readonly type: "reasoning-end";
|
|
1334
|
+
readonly text?: string | undefined;
|
|
1335
|
+
readonly providerMetadata?: {
|
|
1336
|
+
readonly [x: string]: {
|
|
1337
|
+
readonly [x: string]: unknown;
|
|
1338
|
+
};
|
|
1339
|
+
} | undefined;
|
|
1340
|
+
} | {
|
|
1341
|
+
readonly id: string;
|
|
1342
|
+
readonly type: "tool-input-start";
|
|
1343
|
+
readonly name: string;
|
|
1344
|
+
readonly providerMetadata?: {
|
|
1345
|
+
readonly [x: string]: {
|
|
1346
|
+
readonly [x: string]: unknown;
|
|
1347
|
+
};
|
|
1348
|
+
} | undefined;
|
|
1349
|
+
readonly namespace?: string | undefined;
|
|
1350
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1351
|
+
} | {
|
|
1352
|
+
readonly id: string;
|
|
1353
|
+
readonly type: "tool-input-delta";
|
|
1354
|
+
readonly name: string;
|
|
1355
|
+
readonly text: string;
|
|
1356
|
+
readonly input?: unknown;
|
|
1357
|
+
readonly namespace?: string | undefined;
|
|
1358
|
+
} | {
|
|
1359
|
+
readonly id: string;
|
|
1360
|
+
readonly type: "tool-input-end";
|
|
1361
|
+
readonly name: string;
|
|
1362
|
+
readonly providerMetadata?: {
|
|
1363
|
+
readonly [x: string]: {
|
|
1364
|
+
readonly [x: string]: unknown;
|
|
1365
|
+
};
|
|
1366
|
+
} | undefined;
|
|
1367
|
+
readonly namespace?: string | undefined;
|
|
1368
|
+
} | {
|
|
1369
|
+
readonly id: string;
|
|
1370
|
+
readonly type: "tool-input-error";
|
|
1371
|
+
readonly name: string;
|
|
1372
|
+
readonly raw: string;
|
|
1373
|
+
readonly namespace?: string | undefined;
|
|
1374
|
+
} | {
|
|
1375
|
+
readonly id: string;
|
|
1376
|
+
readonly type: "tool-call";
|
|
1377
|
+
readonly name: string;
|
|
1378
|
+
readonly input: unknown;
|
|
1379
|
+
readonly providerMetadata?: {
|
|
1380
|
+
readonly [x: string]: {
|
|
1381
|
+
readonly [x: string]: unknown;
|
|
1382
|
+
};
|
|
1383
|
+
} | undefined;
|
|
1384
|
+
readonly namespace?: string | undefined;
|
|
1385
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1386
|
+
} | {
|
|
1387
|
+
readonly id: string;
|
|
1388
|
+
readonly type: "tool-result";
|
|
1389
|
+
readonly name: string;
|
|
1390
|
+
readonly result: {
|
|
1391
|
+
readonly type: "json";
|
|
1392
|
+
readonly value: unknown;
|
|
1393
|
+
} | {
|
|
1394
|
+
readonly type: "text";
|
|
1395
|
+
readonly value: unknown;
|
|
1396
|
+
} | {
|
|
1397
|
+
readonly type: "error";
|
|
1398
|
+
readonly value: unknown;
|
|
1399
|
+
} | {
|
|
1400
|
+
readonly type: "content";
|
|
1401
|
+
readonly value: readonly ({
|
|
1402
|
+
readonly type: "text";
|
|
1403
|
+
readonly text: string;
|
|
1404
|
+
} | {
|
|
1405
|
+
readonly type: "file";
|
|
1406
|
+
readonly uri: string;
|
|
1407
|
+
readonly mime: string;
|
|
1408
|
+
readonly name?: string | undefined;
|
|
1409
|
+
})[];
|
|
1410
|
+
};
|
|
1411
|
+
readonly output?: {
|
|
1412
|
+
readonly structured: unknown;
|
|
1413
|
+
readonly content: readonly ({
|
|
1414
|
+
readonly type: "text";
|
|
1415
|
+
readonly text: string;
|
|
1416
|
+
} | {
|
|
1417
|
+
readonly type: "file";
|
|
1418
|
+
readonly uri: string;
|
|
1419
|
+
readonly mime: string;
|
|
1420
|
+
readonly name?: string | undefined;
|
|
1421
|
+
})[];
|
|
1422
|
+
} | undefined;
|
|
1423
|
+
readonly providerMetadata?: {
|
|
1424
|
+
readonly [x: string]: {
|
|
1425
|
+
readonly [x: string]: unknown;
|
|
1426
|
+
};
|
|
1427
|
+
} | undefined;
|
|
1428
|
+
readonly namespace?: string | undefined;
|
|
1429
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1430
|
+
} | {
|
|
1431
|
+
readonly id: string;
|
|
1432
|
+
readonly type: "tool-error";
|
|
1433
|
+
readonly name: string;
|
|
1434
|
+
readonly message: string;
|
|
1435
|
+
readonly error?: unknown;
|
|
1436
|
+
readonly providerMetadata?: {
|
|
1437
|
+
readonly [x: string]: {
|
|
1438
|
+
readonly [x: string]: unknown;
|
|
1439
|
+
};
|
|
1440
|
+
} | undefined;
|
|
1441
|
+
readonly namespace?: string | undefined;
|
|
1442
|
+
} | {
|
|
1443
|
+
readonly type: "step-finish";
|
|
1444
|
+
readonly reason: {
|
|
1445
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1446
|
+
readonly raw?: string | undefined;
|
|
1447
|
+
};
|
|
1448
|
+
readonly index: number;
|
|
1449
|
+
readonly providerMetadata?: {
|
|
1450
|
+
readonly [x: string]: {
|
|
1451
|
+
readonly [x: string]: unknown;
|
|
1452
|
+
};
|
|
1453
|
+
} | undefined;
|
|
1454
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1455
|
+
} | {
|
|
1456
|
+
readonly type: "finish";
|
|
1457
|
+
readonly reason: {
|
|
1458
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1459
|
+
readonly raw?: string | undefined;
|
|
1460
|
+
};
|
|
1461
|
+
readonly providerMetadata?: {
|
|
1462
|
+
readonly [x: string]: {
|
|
1463
|
+
readonly [x: string]: unknown;
|
|
1464
|
+
};
|
|
1465
|
+
} | undefined;
|
|
1466
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1467
|
+
} | {
|
|
1468
|
+
readonly type: "provider-error";
|
|
1469
|
+
readonly message: string;
|
|
1470
|
+
readonly providerMetadata?: {
|
|
1471
|
+
readonly [x: string]: {
|
|
1472
|
+
readonly [x: string]: unknown;
|
|
1473
|
+
};
|
|
1474
|
+
} | undefined;
|
|
1475
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
1476
|
+
}, AIError, never>;
|
|
1477
|
+
export declare const hangAfter: (...events: readonly LLMEvent[]) => Stream.Stream<({
|
|
1478
|
+
readonly type: "compaction";
|
|
1479
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1480
|
+
readonly id?: string | undefined;
|
|
1481
|
+
readonly text?: string | null | undefined;
|
|
1482
|
+
readonly encrypted?: string | undefined;
|
|
1483
|
+
} & ({
|
|
1484
|
+
readonly encrypted: string;
|
|
1485
|
+
readonly text?: never;
|
|
1486
|
+
} | {
|
|
1487
|
+
readonly text: string | null;
|
|
1488
|
+
readonly encrypted?: never;
|
|
1489
|
+
})) | {
|
|
1490
|
+
readonly type: "step-start";
|
|
1491
|
+
readonly index: number;
|
|
1492
|
+
} | {
|
|
1493
|
+
readonly id: string;
|
|
1494
|
+
readonly type: "text-start";
|
|
1495
|
+
readonly providerMetadata?: {
|
|
1496
|
+
readonly [x: string]: {
|
|
1497
|
+
readonly [x: string]: unknown;
|
|
1498
|
+
};
|
|
1499
|
+
} | undefined;
|
|
1500
|
+
} | {
|
|
1501
|
+
readonly id: string;
|
|
1502
|
+
readonly type: "text-delta";
|
|
1503
|
+
readonly text: string;
|
|
1504
|
+
readonly providerMetadata?: {
|
|
1505
|
+
readonly [x: string]: {
|
|
1506
|
+
readonly [x: string]: unknown;
|
|
1507
|
+
};
|
|
1508
|
+
} | undefined;
|
|
1509
|
+
} | {
|
|
1510
|
+
readonly id: string;
|
|
1511
|
+
readonly type: "text-end";
|
|
1512
|
+
readonly text?: string | undefined;
|
|
1513
|
+
readonly providerMetadata?: {
|
|
1514
|
+
readonly [x: string]: {
|
|
1515
|
+
readonly [x: string]: unknown;
|
|
1516
|
+
};
|
|
1517
|
+
} | undefined;
|
|
1518
|
+
} | {
|
|
1519
|
+
readonly id: string;
|
|
1520
|
+
readonly type: "reasoning-start";
|
|
1521
|
+
readonly providerMetadata?: {
|
|
1522
|
+
readonly [x: string]: {
|
|
1523
|
+
readonly [x: string]: unknown;
|
|
1524
|
+
};
|
|
1525
|
+
} | undefined;
|
|
1526
|
+
} | {
|
|
1527
|
+
readonly id: string;
|
|
1528
|
+
readonly type: "reasoning-delta";
|
|
1529
|
+
readonly text: string;
|
|
1530
|
+
readonly providerMetadata?: {
|
|
1531
|
+
readonly [x: string]: {
|
|
1532
|
+
readonly [x: string]: unknown;
|
|
1533
|
+
};
|
|
1534
|
+
} | undefined;
|
|
1535
|
+
} | {
|
|
1536
|
+
readonly id: string;
|
|
1537
|
+
readonly type: "reasoning-end";
|
|
1538
|
+
readonly text?: string | undefined;
|
|
1539
|
+
readonly providerMetadata?: {
|
|
1540
|
+
readonly [x: string]: {
|
|
1541
|
+
readonly [x: string]: unknown;
|
|
1542
|
+
};
|
|
1543
|
+
} | undefined;
|
|
1544
|
+
} | {
|
|
1545
|
+
readonly id: string;
|
|
1546
|
+
readonly type: "tool-input-start";
|
|
1547
|
+
readonly name: string;
|
|
1548
|
+
readonly providerMetadata?: {
|
|
1549
|
+
readonly [x: string]: {
|
|
1550
|
+
readonly [x: string]: unknown;
|
|
1551
|
+
};
|
|
1552
|
+
} | undefined;
|
|
1553
|
+
readonly namespace?: string | undefined;
|
|
1554
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1555
|
+
} | {
|
|
1556
|
+
readonly id: string;
|
|
1557
|
+
readonly type: "tool-input-delta";
|
|
1558
|
+
readonly name: string;
|
|
1559
|
+
readonly text: string;
|
|
1560
|
+
readonly input?: unknown;
|
|
1561
|
+
readonly namespace?: string | undefined;
|
|
1562
|
+
} | {
|
|
1563
|
+
readonly id: string;
|
|
1564
|
+
readonly type: "tool-input-end";
|
|
1565
|
+
readonly name: string;
|
|
1566
|
+
readonly providerMetadata?: {
|
|
1567
|
+
readonly [x: string]: {
|
|
1568
|
+
readonly [x: string]: unknown;
|
|
1569
|
+
};
|
|
1570
|
+
} | undefined;
|
|
1571
|
+
readonly namespace?: string | undefined;
|
|
1572
|
+
} | {
|
|
1573
|
+
readonly id: string;
|
|
1574
|
+
readonly type: "tool-input-error";
|
|
1575
|
+
readonly name: string;
|
|
1576
|
+
readonly raw: string;
|
|
1577
|
+
readonly namespace?: string | undefined;
|
|
1578
|
+
} | {
|
|
1579
|
+
readonly id: string;
|
|
1580
|
+
readonly type: "tool-call";
|
|
1581
|
+
readonly name: string;
|
|
1582
|
+
readonly input: unknown;
|
|
1583
|
+
readonly providerMetadata?: {
|
|
1584
|
+
readonly [x: string]: {
|
|
1585
|
+
readonly [x: string]: unknown;
|
|
1586
|
+
};
|
|
1587
|
+
} | undefined;
|
|
1588
|
+
readonly namespace?: string | undefined;
|
|
1589
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1590
|
+
} | {
|
|
1591
|
+
readonly id: string;
|
|
1592
|
+
readonly type: "tool-result";
|
|
1593
|
+
readonly name: string;
|
|
1594
|
+
readonly result: {
|
|
1595
|
+
readonly type: "json";
|
|
1596
|
+
readonly value: unknown;
|
|
1597
|
+
} | {
|
|
1598
|
+
readonly type: "text";
|
|
1599
|
+
readonly value: unknown;
|
|
1600
|
+
} | {
|
|
1601
|
+
readonly type: "error";
|
|
1602
|
+
readonly value: unknown;
|
|
1603
|
+
} | {
|
|
1604
|
+
readonly type: "content";
|
|
1605
|
+
readonly value: readonly ({
|
|
1606
|
+
readonly type: "text";
|
|
1607
|
+
readonly text: string;
|
|
1608
|
+
} | {
|
|
1609
|
+
readonly type: "file";
|
|
1610
|
+
readonly uri: string;
|
|
1611
|
+
readonly mime: string;
|
|
1612
|
+
readonly name?: string | undefined;
|
|
1613
|
+
})[];
|
|
1614
|
+
};
|
|
1615
|
+
readonly output?: {
|
|
1616
|
+
readonly structured: unknown;
|
|
1617
|
+
readonly content: readonly ({
|
|
1618
|
+
readonly type: "text";
|
|
1619
|
+
readonly text: string;
|
|
1620
|
+
} | {
|
|
1621
|
+
readonly type: "file";
|
|
1622
|
+
readonly uri: string;
|
|
1623
|
+
readonly mime: string;
|
|
1624
|
+
readonly name?: string | undefined;
|
|
1625
|
+
})[];
|
|
1626
|
+
} | undefined;
|
|
1627
|
+
readonly providerMetadata?: {
|
|
1628
|
+
readonly [x: string]: {
|
|
1629
|
+
readonly [x: string]: unknown;
|
|
1630
|
+
};
|
|
1631
|
+
} | undefined;
|
|
1632
|
+
readonly namespace?: string | undefined;
|
|
1633
|
+
readonly providerExecuted?: boolean | undefined;
|
|
1634
|
+
} | {
|
|
1635
|
+
readonly id: string;
|
|
1636
|
+
readonly type: "tool-error";
|
|
1637
|
+
readonly name: string;
|
|
1638
|
+
readonly message: string;
|
|
1639
|
+
readonly error?: unknown;
|
|
1640
|
+
readonly providerMetadata?: {
|
|
1641
|
+
readonly [x: string]: {
|
|
1642
|
+
readonly [x: string]: unknown;
|
|
1643
|
+
};
|
|
1644
|
+
} | undefined;
|
|
1645
|
+
readonly namespace?: string | undefined;
|
|
1646
|
+
} | {
|
|
1647
|
+
readonly type: "step-finish";
|
|
1648
|
+
readonly reason: {
|
|
1649
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1650
|
+
readonly raw?: string | undefined;
|
|
1651
|
+
};
|
|
1652
|
+
readonly index: number;
|
|
1653
|
+
readonly providerMetadata?: {
|
|
1654
|
+
readonly [x: string]: {
|
|
1655
|
+
readonly [x: string]: unknown;
|
|
1656
|
+
};
|
|
1657
|
+
} | undefined;
|
|
1658
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1659
|
+
} | {
|
|
1660
|
+
readonly type: "finish";
|
|
1661
|
+
readonly reason: {
|
|
1662
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1663
|
+
readonly raw?: string | undefined;
|
|
1664
|
+
};
|
|
1665
|
+
readonly providerMetadata?: {
|
|
1666
|
+
readonly [x: string]: {
|
|
1667
|
+
readonly [x: string]: unknown;
|
|
1668
|
+
};
|
|
1669
|
+
} | undefined;
|
|
1670
|
+
readonly usage?: import("./schema/events.js").Usage | undefined;
|
|
1671
|
+
} | {
|
|
1672
|
+
readonly type: "provider-error";
|
|
1673
|
+
readonly message: string;
|
|
1674
|
+
readonly providerMetadata?: {
|
|
1675
|
+
readonly [x: string]: {
|
|
1676
|
+
readonly [x: string]: unknown;
|
|
1677
|
+
};
|
|
1678
|
+
} | undefined;
|
|
1679
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
1680
|
+
}, never, never>;
|
|
1681
|
+
/** Provides one shared implementation under the normal client and test-control tags. */
|
|
1682
|
+
export declare const testLayer: (options?: LayerOptions) => Layer.Layer<import("./route/client.js").Service | Test, never, never>;
|
|
1683
|
+
/** @deprecated Use testLayer; retained for published callers of the legacy control interface. */
|
|
1684
|
+
export declare const layer: (options?: LayerOptions) => Layer.Layer<Service, never, never>;
|
|
1685
|
+
/** @deprecated testLayer provides LLMClient.Service directly. */
|
|
1686
|
+
export declare const clientLayer: Layer.Layer<import("./route/client.js").Service, never, Service>;
|
|
1687
|
+
export declare const push: (...responses: readonly Response[]) => Effect.Effect<void, never, Service>;
|
|
1688
|
+
export declare const always: (response: Response) => Effect.Effect<void, never, Service>;
|
|
1689
|
+
export declare const wait: (count: number) => Effect.Effect<void, never, Service>;
|
|
1690
|
+
export declare const gate: Effect.Effect<Readonly<{
|
|
1691
|
+
started: Effect.Effect<void>;
|
|
1692
|
+
release: Effect.Effect<void>;
|
|
1693
|
+
}>, never, Scope.Scope | Service>;
|