@opencode/ai 0.0.0-beta-19275

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 (252) hide show
  1. package/README.md +682 -0
  2. package/dist/cache-policy.d.ts +2 -0
  3. package/dist/cache-policy.js +129 -0
  4. package/dist/image-client.d.ts +19 -0
  5. package/dist/image-client.js +28 -0
  6. package/dist/image.d.ts +110 -0
  7. package/dist/image.js +103 -0
  8. package/dist/index.d.ts +18 -0
  9. package/dist/index.js +12 -0
  10. package/dist/llm.d.ts +252 -0
  11. package/dist/llm.js +74 -0
  12. package/dist/protocols/anthropic-messages.d.ts +957 -0
  13. package/dist/protocols/anthropic-messages.js +1414 -0
  14. package/dist/protocols/bedrock-converse.d.ts +499 -0
  15. package/dist/protocols/bedrock-converse.js +643 -0
  16. package/dist/protocols/bedrock-event-stream.d.ts +9 -0
  17. package/dist/protocols/bedrock-event-stream.js +97 -0
  18. package/dist/protocols/gemini.d.ts +285 -0
  19. package/dist/protocols/gemini.js +671 -0
  20. package/dist/protocols/google-images.d.ts +30 -0
  21. package/dist/protocols/google-images.js +181 -0
  22. package/dist/protocols/index.d.ts +12 -0
  23. package/dist/protocols/index.js +12 -0
  24. package/dist/protocols/meta-images.d.ts +26 -0
  25. package/dist/protocols/meta-images.js +89 -0
  26. package/dist/protocols/meta-messages.d.ts +350 -0
  27. package/dist/protocols/meta-messages.js +41 -0
  28. package/dist/protocols/meta-responses.d.ts +473 -0
  29. package/dist/protocols/meta-responses.js +173 -0
  30. package/dist/protocols/mistral-chat.d.ts +540 -0
  31. package/dist/protocols/mistral-chat.js +624 -0
  32. package/dist/protocols/open-responses-channel.d.ts +23 -0
  33. package/dist/protocols/open-responses-channel.js +141 -0
  34. package/dist/protocols/open-responses-continuation.d.ts +12 -0
  35. package/dist/protocols/open-responses-continuation.js +161 -0
  36. package/dist/protocols/open-responses.d.ts +1583 -0
  37. package/dist/protocols/open-responses.js +1206 -0
  38. package/dist/protocols/openai-chat.d.ts +860 -0
  39. package/dist/protocols/openai-chat.js +966 -0
  40. package/dist/protocols/openai-compatible-chat.d.ts +109 -0
  41. package/dist/protocols/openai-compatible-chat.js +19 -0
  42. package/dist/protocols/openai-compatible-responses.d.ts +172 -0
  43. package/dist/protocols/openai-compatible-responses.js +18 -0
  44. package/dist/protocols/openai-images.d.ts +32 -0
  45. package/dist/protocols/openai-images.js +183 -0
  46. package/dist/protocols/openai-responses.d.ts +1389 -0
  47. package/dist/protocols/openai-responses.js +260 -0
  48. package/dist/protocols/shared.d.ts +193 -0
  49. package/dist/protocols/shared.js +290 -0
  50. package/dist/protocols/utils/bedrock-auth.d.ts +60 -0
  51. package/dist/protocols/utils/bedrock-auth.js +85 -0
  52. package/dist/protocols/utils/bedrock-cache.d.ts +19 -0
  53. package/dist/protocols/utils/bedrock-cache.js +49 -0
  54. package/dist/protocols/utils/bedrock-media.d.ts +55 -0
  55. package/dist/protocols/utils/bedrock-media.js +73 -0
  56. package/dist/protocols/utils/cache.d.ts +6 -0
  57. package/dist/protocols/utils/cache.js +5 -0
  58. package/dist/protocols/utils/gemini-tool-schema.d.ts +2 -0
  59. package/dist/protocols/utils/gemini-tool-schema.js +103 -0
  60. package/dist/protocols/utils/image-input.d.ts +21 -0
  61. package/dist/protocols/utils/image-input.js +20 -0
  62. package/dist/protocols/utils/lifecycle.d.ts +24 -0
  63. package/dist/protocols/utils/lifecycle.js +72 -0
  64. package/dist/protocols/utils/meta-image.d.ts +2 -0
  65. package/dist/protocols/utils/meta-image.js +13 -0
  66. package/dist/protocols/utils/open-responses-options.d.ts +56 -0
  67. package/dist/protocols/utils/open-responses-options.js +61 -0
  68. package/dist/protocols/utils/openai-image.d.ts +5 -0
  69. package/dist/protocols/utils/openai-image.js +18 -0
  70. package/dist/protocols/utils/openai-options.d.ts +16 -0
  71. package/dist/protocols/utils/openai-options.js +14 -0
  72. package/dist/protocols/utils/partial-json-options.d.ts +62 -0
  73. package/dist/protocols/utils/partial-json-options.js +52 -0
  74. package/dist/protocols/utils/partial-json.d.ts +8 -0
  75. package/dist/protocols/utils/partial-json.js +279 -0
  76. package/dist/protocols/utils/responses-checkpoint.d.ts +4 -0
  77. package/dist/protocols/utils/responses-checkpoint.js +107 -0
  78. package/dist/protocols/utils/responses-compaction.d.ts +4 -0
  79. package/dist/protocols/utils/responses-compaction.js +129 -0
  80. package/dist/protocols/utils/responses-hosted-tools.d.ts +26 -0
  81. package/dist/protocols/utils/responses-hosted-tools.js +32 -0
  82. package/dist/protocols/utils/tool-schema.d.ts +8 -0
  83. package/dist/protocols/utils/tool-schema.js +54 -0
  84. package/dist/protocols/utils/tool-stream.d.ts +710 -0
  85. package/dist/protocols/utils/tool-stream.js +155 -0
  86. package/dist/protocols/xai-images.d.ts +26 -0
  87. package/dist/protocols/xai-images.js +106 -0
  88. package/dist/protocols/xai-responses.d.ts +250 -0
  89. package/dist/protocols/xai-responses.js +81 -0
  90. package/dist/protocols/zai-images.d.ts +22 -0
  91. package/dist/protocols/zai-images.js +79 -0
  92. package/dist/protocols.d.ts +1 -0
  93. package/dist/protocols.js +1 -0
  94. package/dist/provider-error.d.ts +15 -0
  95. package/dist/provider-error.js +125 -0
  96. package/dist/provider-package.d.ts +11 -0
  97. package/dist/provider-package.js +1 -0
  98. package/dist/provider.d.ts +23 -0
  99. package/dist/provider.js +2 -0
  100. package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -0
  101. package/dist/providers/amazon-bedrock/mantle/chat.js +1 -0
  102. package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -0
  103. package/dist/providers/amazon-bedrock/mantle/responses.js +1 -0
  104. package/dist/providers/amazon-bedrock/mantle.d.ts +2 -0
  105. package/dist/providers/amazon-bedrock/mantle.js +1 -0
  106. package/dist/providers/amazon-bedrock-mantle.d.ts +371 -0
  107. package/dist/providers/amazon-bedrock-mantle.js +76 -0
  108. package/dist/providers/amazon-bedrock.d.ts +173 -0
  109. package/dist/providers/amazon-bedrock.js +41 -0
  110. package/dist/providers/anthropic-compatible.d.ts +304 -0
  111. package/dist/providers/anthropic-compatible.js +44 -0
  112. package/dist/providers/anthropic.d.ts +302 -0
  113. package/dist/providers/anthropic.js +39 -0
  114. package/dist/providers/azure/chat.d.ts +2 -0
  115. package/dist/providers/azure/chat.js +1 -0
  116. package/dist/providers/azure/responses.d.ts +2 -0
  117. package/dist/providers/azure/responses.js +1 -0
  118. package/dist/providers/azure.d.ts +599 -0
  119. package/dist/providers/azure.js +115 -0
  120. package/dist/providers/baseten.d.ts +229 -0
  121. package/dist/providers/baseten.js +38 -0
  122. package/dist/providers/cerebras.d.ts +228 -0
  123. package/dist/providers/cerebras.js +40 -0
  124. package/dist/providers/cloudflare-ai-gateway.d.ts +238 -0
  125. package/dist/providers/cloudflare-ai-gateway.js +59 -0
  126. package/dist/providers/cloudflare-workers-ai.d.ts +232 -0
  127. package/dist/providers/cloudflare-workers-ai.js +45 -0
  128. package/dist/providers/deepinfra.d.ts +228 -0
  129. package/dist/providers/deepinfra.js +43 -0
  130. package/dist/providers/deepseek.d.ts +229 -0
  131. package/dist/providers/deepseek.js +41 -0
  132. package/dist/providers/fireworks.d.ts +229 -0
  133. package/dist/providers/fireworks.js +38 -0
  134. package/dist/providers/google-vertex/chat.d.ts +2 -0
  135. package/dist/providers/google-vertex/chat.js +1 -0
  136. package/dist/providers/google-vertex/gemini.d.ts +2 -0
  137. package/dist/providers/google-vertex/gemini.js +1 -0
  138. package/dist/providers/google-vertex/messages.d.ts +2 -0
  139. package/dist/providers/google-vertex/messages.js +1 -0
  140. package/dist/providers/google-vertex/responses.d.ts +2 -0
  141. package/dist/providers/google-vertex/responses.js +1 -0
  142. package/dist/providers/google-vertex-chat.d.ts +133 -0
  143. package/dist/providers/google-vertex-chat.js +55 -0
  144. package/dist/providers/google-vertex-messages.d.ts +301 -0
  145. package/dist/providers/google-vertex-messages.js +75 -0
  146. package/dist/providers/google-vertex-responses.d.ts +198 -0
  147. package/dist/providers/google-vertex-responses.js +56 -0
  148. package/dist/providers/google-vertex-shared.d.ts +22 -0
  149. package/dist/providers/google-vertex-shared.js +61 -0
  150. package/dist/providers/google-vertex.d.ts +120 -0
  151. package/dist/providers/google-vertex.js +92 -0
  152. package/dist/providers/google.d.ts +115 -0
  153. package/dist/providers/google.js +42 -0
  154. package/dist/providers/groq.d.ts +315 -0
  155. package/dist/providers/groq.js +81 -0
  156. package/dist/providers/index.d.ts +28 -0
  157. package/dist/providers/index.js +28 -0
  158. package/dist/providers/meta/chat.d.ts +2 -0
  159. package/dist/providers/meta/chat.js +1 -0
  160. package/dist/providers/meta/messages.d.ts +2 -0
  161. package/dist/providers/meta/messages.js +1 -0
  162. package/dist/providers/meta/responses.d.ts +2 -0
  163. package/dist/providers/meta/responses.js +1 -0
  164. package/dist/providers/meta.d.ts +631 -0
  165. package/dist/providers/meta.js +113 -0
  166. package/dist/providers/minimax/chat.d.ts +4 -0
  167. package/dist/providers/minimax/chat.js +8 -0
  168. package/dist/providers/minimax/messages.d.ts +1 -0
  169. package/dist/providers/minimax/messages.js +1 -0
  170. package/dist/providers/minimax/responses.d.ts +4 -0
  171. package/dist/providers/minimax/responses.js +8 -0
  172. package/dist/providers/minimax.d.ts +593 -0
  173. package/dist/providers/minimax.js +89 -0
  174. package/dist/providers/mistral.d.ts +208 -0
  175. package/dist/providers/mistral.js +28 -0
  176. package/dist/providers/open-responses-options.d.ts +6 -0
  177. package/dist/providers/open-responses-options.js +1 -0
  178. package/dist/providers/openai/chat.d.ts +2 -0
  179. package/dist/providers/openai/chat.js +1 -0
  180. package/dist/providers/openai/responses.d.ts +2 -0
  181. package/dist/providers/openai/responses.js +1 -0
  182. package/dist/providers/openai-compatible/responses.d.ts +1 -0
  183. package/dist/providers/openai-compatible/responses.js +1 -0
  184. package/dist/providers/openai-compatible-responses.d.ts +196 -0
  185. package/dist/providers/openai-compatible-responses.js +32 -0
  186. package/dist/providers/openai-compatible.d.ts +131 -0
  187. package/dist/providers/openai-compatible.js +33 -0
  188. package/dist/providers/openai-options.d.ts +26 -0
  189. package/dist/providers/openai-options.js +41 -0
  190. package/dist/providers/openai.d.ts +405 -0
  191. package/dist/providers/openai.js +82 -0
  192. package/dist/providers/openrouter.d.ts +564 -0
  193. package/dist/providers/openrouter.js +114 -0
  194. package/dist/providers/togetherai.d.ts +228 -0
  195. package/dist/providers/togetherai.js +40 -0
  196. package/dist/providers/xai.d.ts +164 -0
  197. package/dist/providers/xai.js +84 -0
  198. package/dist/providers/zai.d.ts +24 -0
  199. package/dist/providers/zai.js +21 -0
  200. package/dist/providers.d.ts +1 -0
  201. package/dist/providers.js +1 -0
  202. package/dist/route/auth-options.d.ts +34 -0
  203. package/dist/route/auth-options.js +14 -0
  204. package/dist/route/auth.d.ts +51 -0
  205. package/dist/route/auth.js +87 -0
  206. package/dist/route/client.d.ts +430 -0
  207. package/dist/route/client.js +304 -0
  208. package/dist/route/endpoint.d.ts +28 -0
  209. package/dist/route/endpoint.js +21 -0
  210. package/dist/route/executor.d.ts +27 -0
  211. package/dist/route/executor.js +183 -0
  212. package/dist/route/framing.d.ts +29 -0
  213. package/dist/route/framing.js +14 -0
  214. package/dist/route/index.d.ts +16 -0
  215. package/dist/route/index.js +9 -0
  216. package/dist/route/protocol.d.ts +76 -0
  217. package/dist/route/protocol.js +16 -0
  218. package/dist/route/transport/http.d.ts +34 -0
  219. package/dist/route/transport/http.js +68 -0
  220. package/dist/route/transport/index.d.ts +41 -0
  221. package/dist/route/transport/index.js +4 -0
  222. package/dist/route/transport/websocket-channel.d.ts +57 -0
  223. package/dist/route/transport/websocket-channel.js +1 -0
  224. package/dist/route/transport/websocket.d.ts +56 -0
  225. package/dist/route/transport/websocket.js +366 -0
  226. package/dist/route.d.ts +1 -0
  227. package/dist/route.js +1 -0
  228. package/dist/schema/errors.d.ts +158 -0
  229. package/dist/schema/errors.js +120 -0
  230. package/dist/schema/events.d.ts +8123 -0
  231. package/dist/schema/events.js +550 -0
  232. package/dist/schema/ids.d.ts +17 -0
  233. package/dist/schema/ids.js +10 -0
  234. package/dist/schema/index.d.ts +5 -0
  235. package/dist/schema/index.js +5 -0
  236. package/dist/schema/messages.d.ts +646 -0
  237. package/dist/schema/messages.js +301 -0
  238. package/dist/schema/options.d.ts +157 -0
  239. package/dist/schema/options.js +187 -0
  240. package/dist/testing.d.ts +1693 -0
  241. package/dist/testing.js +129 -0
  242. package/dist/tool-history.d.ts +2 -0
  243. package/dist/tool-history.js +84 -0
  244. package/dist/tool-runtime.d.ts +15 -0
  245. package/dist/tool-runtime.js +62 -0
  246. package/dist/tool.d.ts +136 -0
  247. package/dist/tool.js +66 -0
  248. package/dist/utils/record.d.ts +2 -0
  249. package/dist/utils/record.js +2 -0
  250. package/dist/utils/sanitize.d.ts +1 -0
  251. package/dist/utils/sanitize.js +12 -0
  252. package/package.json +48 -0
@@ -0,0 +1,646 @@
1
+ import { Schema } from "effect";
2
+ import { Tool } from "@opencode/schema/tool";
3
+ import { CacheHint, GenerationOptions, HttpOptions, type LanguageModel } from "./options.js";
4
+ export declare const MessageRole: Schema.Literals<readonly ["system", "user", "assistant", "tool"]>;
5
+ export type MessageRole = Schema.Schema.Type<typeof MessageRole>;
6
+ export declare const ProviderMetadata: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>;
7
+ export type ProviderMetadata = Schema.Schema.Type<typeof ProviderMetadata>;
8
+ declare const systemPartSchema: Schema.Struct<{
9
+ readonly type: Schema.Literal<"text">;
10
+ readonly text: Schema.String;
11
+ readonly cache: Schema.optional<typeof CacheHint>;
12
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
13
+ }>;
14
+ export type SystemPart = Schema.Schema.Type<typeof systemPartSchema>;
15
+ export declare const SystemPart: Schema.Struct<{
16
+ readonly type: Schema.Literal<"text">;
17
+ readonly text: Schema.String;
18
+ readonly cache: Schema.optional<typeof CacheHint>;
19
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
20
+ }> & {
21
+ make: (text: string) => SystemPart;
22
+ content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
23
+ };
24
+ export declare const TextPart: Schema.Struct<{
25
+ readonly type: Schema.Literal<"text">;
26
+ readonly text: Schema.String;
27
+ readonly cache: Schema.optional<typeof CacheHint>;
28
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
29
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
30
+ }>;
31
+ export type TextPart = Schema.Schema.Type<typeof TextPart>;
32
+ export declare const MediaPart: Schema.Struct<{
33
+ readonly type: Schema.Literal<"media">;
34
+ readonly mediaType: Schema.String;
35
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array]>;
36
+ readonly filename: Schema.optional<Schema.String>;
37
+ readonly cache: Schema.optional<typeof CacheHint>;
38
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
39
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
40
+ }>;
41
+ export type MediaPart = Schema.Schema.Type<typeof MediaPart>;
42
+ declare const toolResultValueSchema: Schema.Union<readonly [Schema.Struct<{
43
+ readonly type: Schema.Literal<"json">;
44
+ readonly value: Schema.Unknown;
45
+ }>, Schema.Struct<{
46
+ readonly type: Schema.Literal<"text">;
47
+ readonly value: Schema.Unknown;
48
+ }>, Schema.Struct<{
49
+ readonly type: Schema.Literal<"error">;
50
+ readonly value: Schema.Unknown;
51
+ }>, Schema.Struct<{
52
+ readonly type: Schema.Literal<"content">;
53
+ readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
54
+ readonly type: Schema.Literal<"text">;
55
+ readonly text: Schema.String;
56
+ }>, Schema.Struct<{
57
+ readonly type: Schema.Literal<"file">;
58
+ readonly uri: Schema.String;
59
+ readonly mime: Schema.String;
60
+ readonly name: Schema.optional<Schema.String>;
61
+ }>]>>;
62
+ }>]>;
63
+ export type ToolResultValue = Schema.Schema.Type<typeof toolResultValueSchema>;
64
+ export declare const ToolResultValue: Schema.Union<readonly [Schema.Struct<{
65
+ readonly type: Schema.Literal<"json">;
66
+ readonly value: Schema.Unknown;
67
+ }>, Schema.Struct<{
68
+ readonly type: Schema.Literal<"text">;
69
+ readonly value: Schema.Unknown;
70
+ }>, Schema.Struct<{
71
+ readonly type: Schema.Literal<"error">;
72
+ readonly value: Schema.Unknown;
73
+ }>, Schema.Struct<{
74
+ readonly type: Schema.Literal<"content">;
75
+ readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
76
+ readonly type: Schema.Literal<"text">;
77
+ readonly text: Schema.String;
78
+ }>, Schema.Struct<{
79
+ readonly type: Schema.Literal<"file">;
80
+ readonly uri: Schema.String;
81
+ readonly mime: Schema.String;
82
+ readonly name: Schema.optional<Schema.String>;
83
+ }>]>>;
84
+ }>]> & {
85
+ is: <I>(input: I) => input is I & ({
86
+ readonly type: "json";
87
+ readonly value: unknown;
88
+ } | {
89
+ readonly type: "text";
90
+ readonly value: unknown;
91
+ } | {
92
+ readonly type: "error";
93
+ readonly value: unknown;
94
+ } | {
95
+ readonly type: "content";
96
+ readonly value: readonly ({
97
+ readonly type: "text";
98
+ readonly text: string;
99
+ } | {
100
+ readonly type: "file";
101
+ readonly uri: string;
102
+ readonly mime: string;
103
+ readonly name?: string | undefined;
104
+ })[];
105
+ });
106
+ make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;
107
+ };
108
+ export interface ToolOutput {
109
+ readonly structured: unknown;
110
+ readonly content: ReadonlyArray<Tool.Content>;
111
+ }
112
+ export declare const ToolOutput: Schema.Struct<{
113
+ readonly structured: Schema.Unknown;
114
+ readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
115
+ readonly type: Schema.Literal<"text">;
116
+ readonly text: Schema.String;
117
+ }>, Schema.Struct<{
118
+ readonly type: Schema.Literal<"file">;
119
+ readonly uri: Schema.String;
120
+ readonly mime: Schema.String;
121
+ readonly name: Schema.optional<Schema.String>;
122
+ }>]>>;
123
+ }> & {
124
+ make: (structured: unknown, content?: ReadonlyArray<Tool.Content>) => ToolOutput;
125
+ fromResultValue: (result: ToolResultValue) => ToolOutput | undefined;
126
+ toResultValue: (output: ToolOutput) => ToolResultValue;
127
+ };
128
+ export declare const ToolCallPart: Schema.Struct<{
129
+ readonly type: Schema.Literal<"tool-call">;
130
+ readonly id: Schema.String;
131
+ readonly name: Schema.String;
132
+ readonly namespace: Schema.optional<Schema.String>;
133
+ readonly input: Schema.Unknown;
134
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
135
+ readonly cache: Schema.optional<typeof CacheHint>;
136
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
137
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
138
+ }> & {
139
+ make: (input: Omit<ToolCallPart, "type">) => ToolCallPart;
140
+ };
141
+ export type ToolCallPart = Schema.Schema.Type<typeof ToolCallPart>;
142
+ export declare const ToolResultPart: Schema.Struct<{
143
+ readonly type: Schema.Literal<"tool-result">;
144
+ readonly id: Schema.String;
145
+ readonly name: Schema.String;
146
+ readonly namespace: Schema.optional<Schema.String>;
147
+ readonly result: Schema.Union<readonly [Schema.Struct<{
148
+ readonly type: Schema.Literal<"json">;
149
+ readonly value: Schema.Unknown;
150
+ }>, Schema.Struct<{
151
+ readonly type: Schema.Literal<"text">;
152
+ readonly value: Schema.Unknown;
153
+ }>, Schema.Struct<{
154
+ readonly type: Schema.Literal<"error">;
155
+ readonly value: Schema.Unknown;
156
+ }>, Schema.Struct<{
157
+ readonly type: Schema.Literal<"content">;
158
+ readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
159
+ readonly type: Schema.Literal<"text">;
160
+ readonly text: Schema.String;
161
+ }>, Schema.Struct<{
162
+ readonly type: Schema.Literal<"file">;
163
+ readonly uri: Schema.String;
164
+ readonly mime: Schema.String;
165
+ readonly name: Schema.optional<Schema.String>;
166
+ }>]>>;
167
+ }>]> & {
168
+ is: <I>(input: I) => input is I & ({
169
+ readonly type: "json";
170
+ readonly value: unknown;
171
+ } | {
172
+ readonly type: "text";
173
+ readonly value: unknown;
174
+ } | {
175
+ readonly type: "error";
176
+ readonly value: unknown;
177
+ } | {
178
+ readonly type: "content";
179
+ readonly value: readonly ({
180
+ readonly type: "text";
181
+ readonly text: string;
182
+ } | {
183
+ readonly type: "file";
184
+ readonly uri: string;
185
+ readonly mime: string;
186
+ readonly name?: string | undefined;
187
+ })[];
188
+ });
189
+ make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;
190
+ };
191
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
192
+ readonly cache: Schema.optional<typeof CacheHint>;
193
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
194
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
195
+ }> & {
196
+ make: (input: Omit<ToolResultPart, "type" | "result"> & {
197
+ readonly result: unknown;
198
+ readonly resultType?: ToolResultValue["type"];
199
+ }) => ToolResultPart;
200
+ };
201
+ export type ToolResultPart = Schema.Schema.Type<typeof ToolResultPart>;
202
+ export declare const ReasoningPart: Schema.Struct<{
203
+ readonly type: Schema.Literal<"reasoning">;
204
+ readonly text: Schema.String;
205
+ readonly encrypted: Schema.optional<Schema.String>;
206
+ readonly cache: Schema.optional<typeof CacheHint>;
207
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
208
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
209
+ }>;
210
+ export type ReasoningPart = Schema.Schema.Type<typeof ReasoningPart>;
211
+ /** A provider-generated context checkpoint, distinct from visible assistant text. */
212
+ type CompactionContent = {
213
+ readonly encrypted: string;
214
+ readonly text?: never;
215
+ } | {
216
+ readonly text: string | null;
217
+ readonly encrypted?: never;
218
+ };
219
+ declare const compactionPartSchema: Schema.refine<{
220
+ readonly type: "compaction";
221
+ readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
222
+ readonly id?: string | undefined;
223
+ readonly text?: string | null | undefined;
224
+ readonly encrypted?: string | undefined;
225
+ } & CompactionContent, Schema.Struct<{
226
+ readonly type: Schema.Literal<"compaction">;
227
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
228
+ readonly id: Schema.optional<Schema.String>;
229
+ readonly encrypted: Schema.optional<Schema.String>;
230
+ /** Null means the provider failed to produce a summary; prior history must be retained. */
231
+ readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
232
+ }>>;
233
+ export type CompactionPart = typeof compactionPartSchema.Type;
234
+ export declare const CompactionPart: Schema.refine<{
235
+ readonly type: "compaction";
236
+ readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
237
+ readonly id?: string | undefined;
238
+ readonly text?: string | null | undefined;
239
+ readonly encrypted?: string | undefined;
240
+ } & CompactionContent, Schema.Struct<{
241
+ readonly type: Schema.Literal<"compaction">;
242
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
243
+ readonly id: Schema.optional<Schema.String>;
244
+ readonly encrypted: Schema.optional<Schema.String>;
245
+ /** Null means the provider failed to produce a summary; prior history must be retained. */
246
+ readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
247
+ }>> & {
248
+ make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
249
+ };
250
+ export declare const ContentPart: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
251
+ readonly type: Schema.Literal<"text">;
252
+ readonly text: Schema.String;
253
+ readonly cache: Schema.optional<typeof CacheHint>;
254
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
255
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
256
+ }>, Schema.Struct<{
257
+ readonly type: Schema.Literal<"media">;
258
+ readonly mediaType: Schema.String;
259
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array]>;
260
+ readonly filename: Schema.optional<Schema.String>;
261
+ readonly cache: Schema.optional<typeof CacheHint>;
262
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
263
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
264
+ }>, Schema.Struct<{
265
+ readonly type: Schema.Literal<"tool-call">;
266
+ readonly id: Schema.String;
267
+ readonly name: Schema.String;
268
+ readonly namespace: Schema.optional<Schema.String>;
269
+ readonly input: Schema.Unknown;
270
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
271
+ readonly cache: Schema.optional<typeof CacheHint>;
272
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
273
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
274
+ }> & {
275
+ make: (input: Omit<ToolCallPart, "type">) => ToolCallPart;
276
+ }, Schema.Struct<{
277
+ readonly type: Schema.Literal<"tool-result">;
278
+ readonly id: Schema.String;
279
+ readonly name: Schema.String;
280
+ readonly namespace: Schema.optional<Schema.String>;
281
+ readonly result: Schema.Union<readonly [Schema.Struct<{
282
+ readonly type: Schema.Literal<"json">;
283
+ readonly value: Schema.Unknown;
284
+ }>, Schema.Struct<{
285
+ readonly type: Schema.Literal<"text">;
286
+ readonly value: Schema.Unknown;
287
+ }>, Schema.Struct<{
288
+ readonly type: Schema.Literal<"error">;
289
+ readonly value: Schema.Unknown;
290
+ }>, Schema.Struct<{
291
+ readonly type: Schema.Literal<"content">;
292
+ readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
293
+ readonly type: Schema.Literal<"text">;
294
+ readonly text: Schema.String;
295
+ }>, Schema.Struct<{
296
+ readonly type: Schema.Literal<"file">;
297
+ readonly uri: Schema.String;
298
+ readonly mime: Schema.String;
299
+ readonly name: Schema.optional<Schema.String>;
300
+ }>]>>;
301
+ }>]> & {
302
+ is: <I>(input: I) => input is I & ({
303
+ readonly type: "json";
304
+ readonly value: unknown;
305
+ } | {
306
+ readonly type: "text";
307
+ readonly value: unknown;
308
+ } | {
309
+ readonly type: "error";
310
+ readonly value: unknown;
311
+ } | {
312
+ readonly type: "content";
313
+ readonly value: readonly ({
314
+ readonly type: "text";
315
+ readonly text: string;
316
+ } | {
317
+ readonly type: "file";
318
+ readonly uri: string;
319
+ readonly mime: string;
320
+ readonly name?: string | undefined;
321
+ })[];
322
+ });
323
+ make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;
324
+ };
325
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
326
+ readonly cache: Schema.optional<typeof CacheHint>;
327
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
328
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
329
+ }> & {
330
+ make: (input: Omit<ToolResultPart, "type" | "result"> & {
331
+ readonly result: unknown;
332
+ readonly resultType?: ToolResultValue["type"];
333
+ }) => ToolResultPart;
334
+ }, Schema.Struct<{
335
+ readonly type: Schema.Literal<"reasoning">;
336
+ readonly text: Schema.String;
337
+ readonly encrypted: Schema.optional<Schema.String>;
338
+ readonly cache: Schema.optional<typeof CacheHint>;
339
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
340
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
341
+ }>, Schema.refine<{
342
+ readonly type: "compaction";
343
+ readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
344
+ readonly id?: string | undefined;
345
+ readonly text?: string | null | undefined;
346
+ readonly encrypted?: string | undefined;
347
+ } & CompactionContent, Schema.Struct<{
348
+ readonly type: Schema.Literal<"compaction">;
349
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
350
+ readonly id: Schema.optional<Schema.String>;
351
+ readonly encrypted: Schema.optional<Schema.String>;
352
+ /** Null means the provider failed to produce a summary; prior history must be retained. */
353
+ readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
354
+ }>> & {
355
+ make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
356
+ }]>;
357
+ export type ContentPart = Schema.Schema.Type<typeof ContentPart>;
358
+ declare const Message_base: Schema.Class<Message, Schema.Struct<{
359
+ readonly id: Schema.optional<Schema.String>;
360
+ readonly role: Schema.Literals<readonly ["system", "user", "assistant", "tool"]>;
361
+ readonly content: Schema.$Array<Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
362
+ readonly type: Schema.Literal<"text">;
363
+ readonly text: Schema.String;
364
+ readonly cache: Schema.optional<typeof CacheHint>;
365
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
366
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
367
+ }>, Schema.Struct<{
368
+ readonly type: Schema.Literal<"media">;
369
+ readonly mediaType: Schema.String;
370
+ readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array]>;
371
+ readonly filename: Schema.optional<Schema.String>;
372
+ readonly cache: Schema.optional<typeof CacheHint>;
373
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
374
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
375
+ }>, Schema.Struct<{
376
+ readonly type: Schema.Literal<"tool-call">;
377
+ readonly id: Schema.String;
378
+ readonly name: Schema.String;
379
+ readonly namespace: Schema.optional<Schema.String>;
380
+ readonly input: Schema.Unknown;
381
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
382
+ readonly cache: Schema.optional<typeof CacheHint>;
383
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
384
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
385
+ }> & {
386
+ make: (input: Omit<ToolCallPart, "type">) => ToolCallPart;
387
+ }, Schema.Struct<{
388
+ readonly type: Schema.Literal<"tool-result">;
389
+ readonly id: Schema.String;
390
+ readonly name: Schema.String;
391
+ readonly namespace: Schema.optional<Schema.String>;
392
+ readonly result: Schema.Union<readonly [Schema.Struct<{
393
+ readonly type: Schema.Literal<"json">;
394
+ readonly value: Schema.Unknown;
395
+ }>, Schema.Struct<{
396
+ readonly type: Schema.Literal<"text">;
397
+ readonly value: Schema.Unknown;
398
+ }>, Schema.Struct<{
399
+ readonly type: Schema.Literal<"error">;
400
+ readonly value: Schema.Unknown;
401
+ }>, Schema.Struct<{
402
+ readonly type: Schema.Literal<"content">;
403
+ readonly value: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
404
+ readonly type: Schema.Literal<"text">;
405
+ readonly text: Schema.String;
406
+ }>, Schema.Struct<{
407
+ readonly type: Schema.Literal<"file">;
408
+ readonly uri: Schema.String;
409
+ readonly mime: Schema.String;
410
+ readonly name: Schema.optional<Schema.String>;
411
+ }>]>>;
412
+ }>]> & {
413
+ is: <I>(input: I) => input is I & ({
414
+ readonly type: "json";
415
+ readonly value: unknown;
416
+ } | {
417
+ readonly type: "text";
418
+ readonly value: unknown;
419
+ } | {
420
+ readonly type: "error";
421
+ readonly value: unknown;
422
+ } | {
423
+ readonly type: "content";
424
+ readonly value: readonly ({
425
+ readonly type: "text";
426
+ readonly text: string;
427
+ } | {
428
+ readonly type: "file";
429
+ readonly uri: string;
430
+ readonly mime: string;
431
+ readonly name?: string | undefined;
432
+ })[];
433
+ });
434
+ make: (value: unknown, type?: ToolResultValue["type"]) => ToolResultValue;
435
+ };
436
+ readonly providerExecuted: Schema.optional<Schema.Boolean>;
437
+ readonly cache: Schema.optional<typeof CacheHint>;
438
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
439
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
440
+ }> & {
441
+ make: (input: Omit<ToolResultPart, "type" | "result"> & {
442
+ readonly result: unknown;
443
+ readonly resultType?: ToolResultValue["type"];
444
+ }) => ToolResultPart;
445
+ }, Schema.Struct<{
446
+ readonly type: Schema.Literal<"reasoning">;
447
+ readonly text: Schema.String;
448
+ readonly encrypted: Schema.optional<Schema.String>;
449
+ readonly cache: Schema.optional<typeof CacheHint>;
450
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
451
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
452
+ }>, Schema.refine<{
453
+ readonly type: "compaction";
454
+ readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
455
+ readonly id?: string | undefined;
456
+ readonly text?: string | null | undefined;
457
+ readonly encrypted?: string | undefined;
458
+ } & CompactionContent, Schema.Struct<{
459
+ readonly type: Schema.Literal<"compaction">;
460
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
461
+ readonly id: Schema.optional<Schema.String>;
462
+ readonly encrypted: Schema.optional<Schema.String>;
463
+ /** Null means the provider failed to produce a summary; prior history must be retained. */
464
+ readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
465
+ }>> & {
466
+ make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
467
+ }]>>;
468
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
469
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
470
+ readonly native: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
471
+ }>, {}>;
472
+ export declare class Message extends Message_base {
473
+ }
474
+ export declare namespace Message {
475
+ type ContentInput = string | ContentPart | ReadonlyArray<ContentPart>;
476
+ type SystemContentInput = string | TextPart | ReadonlyArray<TextPart>;
477
+ type Input = Omit<ConstructorParameters<typeof Message>[0], "content"> & {
478
+ readonly content: ContentInput;
479
+ };
480
+ const text: (value: string) => ContentPart;
481
+ const content: (input: ContentInput) => any[];
482
+ const make: (input: Message | Input) => Message;
483
+ const user: (content: ContentInput) => Message;
484
+ const assistant: (content: ContentInput) => Message;
485
+ /**
486
+ * Add an operator-authored instruction at this chronological point in the
487
+ * conversation. This is distinct from the initial `LLMRequest.system`
488
+ * prompt. Keep raw retrieved, tool, and web content out of privileged system
489
+ * updates; pass that untrusted content through ordinary user/tool channels.
490
+ */
491
+ const system: (content: SystemContentInput) => Message;
492
+ const tool: (result: ToolResultPart | Parameters<typeof ToolResultPart.make>[0]) => Message;
493
+ }
494
+ declare const toolDefinitionFields: {
495
+ name: Schema.String;
496
+ description: Schema.String;
497
+ inputSchema: Schema.$Record<Schema.String, Schema.Unknown>;
498
+ outputSchema: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
499
+ cache: Schema.optional<typeof CacheHint>;
500
+ metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
501
+ native: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
502
+ };
503
+ export type ToolDefinitionInput = Schema.Struct.Type<typeof toolDefinitionFields>;
504
+ declare const ToolDefinition_base: Schema.Class<ToolDefinition, Schema.Struct<{
505
+ readonly name: Schema.String;
506
+ readonly description: Schema.String;
507
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Unknown>;
508
+ readonly outputSchema: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
509
+ readonly cache: Schema.optional<typeof CacheHint>;
510
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
511
+ readonly native: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
512
+ readonly type: Schema.Literal<"tool">;
513
+ }>, {}>;
514
+ export declare class ToolDefinition extends ToolDefinition_base {
515
+ constructor(input: ToolDefinitionInput);
516
+ }
517
+ export declare namespace ToolDefinition {
518
+ type Input = ToolDefinition | ToolDefinitionInput;
519
+ /** Normalize tool definition input into the canonical `ToolDefinition` class. */
520
+ const make: (input: Input) => ToolDefinition;
521
+ }
522
+ export type ToolNamespace = {
523
+ readonly type: "namespace";
524
+ readonly name: string;
525
+ readonly description?: string;
526
+ readonly tools: ReadonlyArray<ToolEntry>;
527
+ };
528
+ export type ToolNamespaceInput = Omit<ToolNamespace, "type" | "tools"> & {
529
+ readonly tools: ReadonlyArray<ToolEntryInput>;
530
+ };
531
+ export type ToolNamespaceEntryInput = ToolNamespaceInput & {
532
+ readonly type: "namespace";
533
+ };
534
+ export declare const ToolNamespace: Schema.Codec<ToolNamespace> & {
535
+ readonly make: (input: ToolNamespace | ToolNamespaceInput) => ToolNamespace;
536
+ };
537
+ export type ToolEntry = ToolDefinition | ToolNamespace;
538
+ export type ToolEntryInput = ToolDefinition.Input | ToolNamespaceEntryInput;
539
+ export declare const ToolEntry: Schema.Codec<ToolEntry> & {
540
+ readonly make: (input: ToolEntryInput) => ToolEntry;
541
+ };
542
+ declare const ToolChoice_base: Schema.Class<ToolChoice, Schema.Struct<{
543
+ readonly type: Schema.Literals<readonly ["auto", "none", "required", "tool"]>;
544
+ readonly name: Schema.optional<Schema.String>;
545
+ readonly disableParallelToolUse: Schema.optional<Schema.Boolean>;
546
+ }>, {}>;
547
+ export declare class ToolChoice extends ToolChoice_base {
548
+ }
549
+ export declare namespace ToolChoice {
550
+ type Mode = Exclude<ToolChoice["type"], "tool">;
551
+ type Input = ToolChoice | ConstructorParameters<typeof ToolChoice>[0] | ToolDefinition | string;
552
+ /** Select a specific named tool. */
553
+ const named: (value: string) => ToolChoice;
554
+ /** Normalize ergonomic tool-choice inputs into the canonical `ToolChoice` class. */
555
+ const make: (input: Input) => ToolChoice;
556
+ }
557
+ declare const requestSchema: Schema.Struct<{
558
+ readonly id: Schema.optional<Schema.String>;
559
+ readonly model: Schema.declare<LanguageModel<{
560
+ readonly [x: string]: unknown;
561
+ }, import("../route.js").CompactionOperations | undefined>, LanguageModel<{
562
+ readonly [x: string]: unknown;
563
+ }, import("../route.js").CompactionOperations | undefined>>;
564
+ readonly system: Schema.$Array<Schema.Struct<{
565
+ readonly type: Schema.Literal<"text">;
566
+ readonly text: Schema.String;
567
+ readonly cache: Schema.optional<typeof CacheHint>;
568
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
569
+ }> & {
570
+ make: (text: string) => SystemPart;
571
+ content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
572
+ }>;
573
+ readonly messages: Schema.$Array<typeof Message>;
574
+ readonly tools: Schema.$Array<Schema.Codec<ToolEntry, ToolEntry, never, never> & {
575
+ readonly make: (input: ToolEntryInput) => ToolEntry;
576
+ }>;
577
+ readonly toolChoice: Schema.optional<typeof ToolChoice>;
578
+ readonly generation: Schema.optional<typeof GenerationOptions>;
579
+ readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
580
+ readonly http: Schema.optional<typeof HttpOptions>;
581
+ readonly cache: Schema.optional<Schema.Union<readonly [Schema.Literal<"auto">, Schema.Literal<"none">, Schema.Struct<{
582
+ readonly tools: Schema.optional<Schema.Boolean>;
583
+ readonly system: Schema.optional<Schema.Boolean>;
584
+ readonly messages: Schema.optional<Schema.Union<readonly [Schema.Literal<"latest-user-message">, Schema.Literal<"latest-assistant">, Schema.Struct<{
585
+ readonly tail: Schema.Natural;
586
+ }>]>>;
587
+ readonly ttlSeconds: Schema.optional<Schema.Number>;
588
+ }>]>>;
589
+ readonly promptCacheKey: Schema.optional<Schema.String>;
590
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
591
+ }>;
592
+ declare const LLMRequest_base: Schema.Class<LLMRequest<LanguageModel<{
593
+ readonly [x: string]: unknown;
594
+ }, import("../route.js").CompactionOperations | undefined>>, Schema.Struct<{
595
+ readonly id: Schema.optional<Schema.String>;
596
+ readonly model: Schema.declare<LanguageModel<{
597
+ readonly [x: string]: unknown;
598
+ }, import("../route.js").CompactionOperations | undefined>, LanguageModel<{
599
+ readonly [x: string]: unknown;
600
+ }, import("../route.js").CompactionOperations | undefined>>;
601
+ readonly system: Schema.$Array<Schema.Struct<{
602
+ readonly type: Schema.Literal<"text">;
603
+ readonly text: Schema.String;
604
+ readonly cache: Schema.optional<typeof CacheHint>;
605
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
606
+ }> & {
607
+ make: (text: string) => SystemPart;
608
+ content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
609
+ }>;
610
+ readonly messages: Schema.$Array<typeof Message>;
611
+ readonly tools: Schema.$Array<Schema.Codec<ToolEntry, ToolEntry, never, never> & {
612
+ readonly make: (input: ToolEntryInput) => ToolEntry;
613
+ }>;
614
+ readonly toolChoice: Schema.optional<typeof ToolChoice>;
615
+ readonly generation: Schema.optional<typeof GenerationOptions>;
616
+ readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
617
+ readonly http: Schema.optional<typeof HttpOptions>;
618
+ readonly cache: Schema.optional<Schema.Union<readonly [Schema.Literal<"auto">, Schema.Literal<"none">, Schema.Struct<{
619
+ readonly tools: Schema.optional<Schema.Boolean>;
620
+ readonly system: Schema.optional<Schema.Boolean>;
621
+ readonly messages: Schema.optional<Schema.Union<readonly [Schema.Literal<"latest-user-message">, Schema.Literal<"latest-assistant">, Schema.Struct<{
622
+ readonly tail: Schema.Natural;
623
+ }>]>>;
624
+ readonly ttlSeconds: Schema.optional<Schema.Number>;
625
+ }>]>>;
626
+ readonly promptCacheKey: Schema.optional<Schema.String>;
627
+ readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
628
+ }>, {}>;
629
+ export declare class LLMRequest<Model extends LanguageModel = LanguageModel> extends LLMRequest_base {
630
+ readonly model: Model;
631
+ constructor(input: LLMRequest.Input<Model>);
632
+ }
633
+ export declare namespace LLMRequest {
634
+ type Input<Model extends LanguageModel = LanguageModel> = Omit<typeof requestSchema.Type, "model"> & {
635
+ readonly model: Model;
636
+ };
637
+ const input: <Model extends LanguageModel>(request: LLMRequest<Model>) => Input<Model>;
638
+ function update<Model extends LanguageModel>(request: LLMRequest, patch: Partial<Input<Model>> & {
639
+ readonly model: Model;
640
+ }): LLMRequest<Model>;
641
+ function update<Model extends LanguageModel>(request: LLMRequest<Model>, patch: Partial<Omit<Input, "model">> & {
642
+ readonly model?: undefined;
643
+ }): LLMRequest<Model>;
644
+ function update(request: LLMRequest, patch: Partial<Input>): LLMRequest;
645
+ }
646
+ export {};