@arcships/aimux 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +92 -0
  2. package/dist/error.d.ts +28 -69
  3. package/dist/error.js +72 -160
  4. package/dist/generated/ops.d.ts +75 -0
  5. package/dist/generated/ops.js +80 -0
  6. package/dist/generated/types.d.ts +5607 -0
  7. package/dist/{types/CallOptions.js → generated/types.js} +1 -0
  8. package/dist/index.d.ts +144 -184
  9. package/dist/index.js +314 -295
  10. package/dist/native.d.ts +30 -0
  11. package/dist/native.js +116 -0
  12. package/dist/types.d.ts +1 -139
  13. package/dist/types.js +0 -3
  14. package/index.d.ts +21 -469
  15. package/index.js +57 -107
  16. package/package.json +20 -17
  17. package/dist/types/AiMuxError.d.ts +0 -48
  18. package/dist/types/AiMuxError.js +0 -2
  19. package/dist/types/ApiCallError.d.ts +0 -65
  20. package/dist/types/ApiCallError.js +0 -3
  21. package/dist/types/AspectRatio.d.ts +0 -11
  22. package/dist/types/AspectRatio.js +0 -3
  23. package/dist/types/AudioChunk.d.ts +0 -8
  24. package/dist/types/AudioChunk.js +0 -3
  25. package/dist/types/AudioData.d.ts +0 -11
  26. package/dist/types/AudioData.js +0 -3
  27. package/dist/types/AudioInput.d.ts +0 -8
  28. package/dist/types/AudioInput.js +0 -3
  29. package/dist/types/BreakKind.d.ts +0 -1
  30. package/dist/types/BreakKind.js +0 -3
  31. package/dist/types/CallOptions.d.ts +0 -117
  32. package/dist/types/CatalogueSource.d.ts +0 -4
  33. package/dist/types/CatalogueSource.js +0 -3
  34. package/dist/types/ChatCompletion.d.ts +0 -16
  35. package/dist/types/ChatCompletion.js +0 -2
  36. package/dist/types/ChatCompletionChoice.d.ts +0 -8
  37. package/dist/types/ChatCompletionChoice.js +0 -2
  38. package/dist/types/ChatCompletionChunk.d.ts +0 -15
  39. package/dist/types/ChatCompletionChunk.js +0 -2
  40. package/dist/types/ChatCompletionChunkChoice.d.ts +0 -8
  41. package/dist/types/ChatCompletionChunkChoice.js +0 -2
  42. package/dist/types/ChatCompletionChunkFunction.d.ts +0 -4
  43. package/dist/types/ChatCompletionChunkFunction.js +0 -3
  44. package/dist/types/ChatCompletionChunkToolCall.d.ts +0 -7
  45. package/dist/types/ChatCompletionChunkToolCall.js +0 -2
  46. package/dist/types/ChatCompletionDelta.d.ts +0 -7
  47. package/dist/types/ChatCompletionDelta.js +0 -2
  48. package/dist/types/ChatCompletionFunction.d.ts +0 -4
  49. package/dist/types/ChatCompletionFunction.js +0 -3
  50. package/dist/types/ChatCompletionMessage.d.ts +0 -9
  51. package/dist/types/ChatCompletionMessage.js +0 -2
  52. package/dist/types/ChatCompletionToolCall.d.ts +0 -6
  53. package/dist/types/ChatCompletionToolCall.js +0 -2
  54. package/dist/types/ChatCompletionUsage.d.ts +0 -9
  55. package/dist/types/ChatCompletionUsage.js +0 -2
  56. package/dist/types/CompletionTokensDetails.d.ts +0 -3
  57. package/dist/types/CompletionTokensDetails.js +0 -3
  58. package/dist/types/ContentPart.d.ts +0 -106
  59. package/dist/types/ContentPart.js +0 -2
  60. package/dist/types/EmbeddingCallOptions.d.ts +0 -24
  61. package/dist/types/EmbeddingCallOptions.js +0 -2
  62. package/dist/types/EmbeddingResponse.d.ts +0 -16
  63. package/dist/types/EmbeddingResponse.js +0 -2
  64. package/dist/types/EmbeddingResult.d.ts +0 -33
  65. package/dist/types/EmbeddingResult.js +0 -2
  66. package/dist/types/EmbeddingUsage.d.ts +0 -9
  67. package/dist/types/EmbeddingUsage.js +0 -3
  68. package/dist/types/FileBytes.d.ts +0 -12
  69. package/dist/types/FileBytes.js +0 -3
  70. package/dist/types/FileData.d.ts +0 -25
  71. package/dist/types/FileData.js +0 -2
  72. package/dist/types/FilePart.d.ts +0 -8
  73. package/dist/types/FilePart.js +0 -2
  74. package/dist/types/Fingerprint.d.ts +0 -21
  75. package/dist/types/Fingerprint.js +0 -3
  76. package/dist/types/FinishReason.d.ts +0 -14
  77. package/dist/types/FinishReason.js +0 -2
  78. package/dist/types/FinishReasonUnified.d.ts +0 -4
  79. package/dist/types/FinishReasonUnified.js +0 -3
  80. package/dist/types/FunctionTool.d.ts +0 -35
  81. package/dist/types/FunctionTool.js +0 -2
  82. package/dist/types/GenerateContent.d.ts +0 -77
  83. package/dist/types/GenerateContent.js +0 -2
  84. package/dist/types/GenerateObjectResult.d.ts +0 -48
  85. package/dist/types/GenerateObjectResult.js +0 -2
  86. package/dist/types/GenerateResult.d.ts +0 -45
  87. package/dist/types/GenerateResult.js +0 -2
  88. package/dist/types/GenerateTextOptions.d.ts +0 -62
  89. package/dist/types/GenerateTextOptions.js +0 -2
  90. package/dist/types/GenerateTextResult.d.ts +0 -81
  91. package/dist/types/GenerateTextResult.js +0 -2
  92. package/dist/types/HttpExchange.d.ts +0 -23
  93. package/dist/types/HttpExchange.js +0 -2
  94. package/dist/types/HttpRecord.d.ts +0 -12
  95. package/dist/types/HttpRecord.js +0 -3
  96. package/dist/types/ImageCallOptions.d.ts +0 -54
  97. package/dist/types/ImageCallOptions.js +0 -2
  98. package/dist/types/ImageFile.d.ts +0 -25
  99. package/dist/types/ImageFile.js +0 -2
  100. package/dist/types/ImageFileData.d.ts +0 -8
  101. package/dist/types/ImageFileData.js +0 -3
  102. package/dist/types/ImageOutputs.d.ts +0 -14
  103. package/dist/types/ImageOutputs.js +0 -3
  104. package/dist/types/ImageResponse.d.ts +0 -19
  105. package/dist/types/ImageResponse.js +0 -3
  106. package/dist/types/ImageResult.d.ts +0 -34
  107. package/dist/types/ImageResult.js +0 -2
  108. package/dist/types/ImageUsage.d.ts +0 -19
  109. package/dist/types/ImageUsage.js +0 -3
  110. package/dist/types/InputAudioFormat.d.ts +0 -13
  111. package/dist/types/InputAudioFormat.js +0 -3
  112. package/dist/types/InputRecord.d.ts +0 -16
  113. package/dist/types/InputRecord.js +0 -2
  114. package/dist/types/LanguageModelPromptMessage.d.ts +0 -20
  115. package/dist/types/LanguageModelPromptMessage.js +0 -2
  116. package/dist/types/MessageContent.d.ts +0 -5
  117. package/dist/types/MessageContent.js +0 -2
  118. package/dist/types/Modality.d.ts +0 -4
  119. package/dist/types/Modality.js +0 -3
  120. package/dist/types/ModelCapabilities.d.ts +0 -21
  121. package/dist/types/ModelCapabilities.js +0 -3
  122. package/dist/types/ModelCost.d.ts +0 -10
  123. package/dist/types/ModelCost.js +0 -3
  124. package/dist/types/ModelId.d.ts +0 -7
  125. package/dist/types/ModelId.js +0 -3
  126. package/dist/types/ModelLimits.d.ts +0 -17
  127. package/dist/types/ModelLimits.js +0 -3
  128. package/dist/types/ModelMessage.d.ts +0 -9
  129. package/dist/types/ModelMessage.js +0 -2
  130. package/dist/types/ModelModalities.d.ts +0 -8
  131. package/dist/types/ModelModalities.js +0 -2
  132. package/dist/types/ModelPrompt.d.ts +0 -7
  133. package/dist/types/ModelPrompt.js +0 -2
  134. package/dist/types/ModelSpec.d.ts +0 -33
  135. package/dist/types/ModelSpec.js +0 -2
  136. package/dist/types/ModelType.d.ts +0 -4
  137. package/dist/types/ModelType.js +0 -3
  138. package/dist/types/OutcomeRecord.d.ts +0 -14
  139. package/dist/types/OutcomeRecord.js +0 -2
  140. package/dist/types/OutcomeStatus.d.ts +0 -4
  141. package/dist/types/OutcomeStatus.js +0 -3
  142. package/dist/types/PrefixBreak.d.ts +0 -11
  143. package/dist/types/PrefixBreak.js +0 -2
  144. package/dist/types/PromptTokensDetails.d.ts +0 -4
  145. package/dist/types/PromptTokensDetails.js +0 -3
  146. package/dist/types/ProviderAuditSpec.d.ts +0 -33
  147. package/dist/types/ProviderAuditSpec.js +0 -2
  148. package/dist/types/ProviderFamily.d.ts +0 -5
  149. package/dist/types/ProviderFamily.js +0 -3
  150. package/dist/types/ProviderName.d.ts +0 -258
  151. package/dist/types/ProviderName.js +0 -262
  152. package/dist/types/ProviderRecord.d.ts +0 -30
  153. package/dist/types/ProviderRecord.js +0 -2
  154. package/dist/types/ProviderTool.d.ts +0 -24
  155. package/dist/types/ProviderTool.js +0 -2
  156. package/dist/types/ReasoningEffort.d.ts +0 -7
  157. package/dist/types/ReasoningEffort.js +0 -3
  158. package/dist/types/ReasoningMode.d.ts +0 -4
  159. package/dist/types/ReasoningMode.js +0 -3
  160. package/dist/types/ReasoningPart.d.ts +0 -9
  161. package/dist/types/ReasoningPart.js +0 -3
  162. package/dist/types/ReasoningSpec.d.ts +0 -39
  163. package/dist/types/ReasoningSpec.js +0 -2
  164. package/dist/types/ReasoningVisibility.d.ts +0 -4
  165. package/dist/types/ReasoningVisibility.js +0 -3
  166. package/dist/types/Recording.d.ts +0 -56
  167. package/dist/types/Recording.js +0 -2
  168. package/dist/types/RequestCacheHints.d.ts +0 -9
  169. package/dist/types/RequestCacheHints.js +0 -3
  170. package/dist/types/RequestInfo.d.ts +0 -12
  171. package/dist/types/RequestInfo.js +0 -2
  172. package/dist/types/RerankingCallOptions.d.ts +0 -33
  173. package/dist/types/RerankingCallOptions.js +0 -2
  174. package/dist/types/RerankingDocuments.d.ts +0 -15
  175. package/dist/types/RerankingDocuments.js +0 -2
  176. package/dist/types/RerankingRank.d.ts +0 -13
  177. package/dist/types/RerankingRank.js +0 -3
  178. package/dist/types/RerankingResponse.d.ts +0 -28
  179. package/dist/types/RerankingResponse.js +0 -2
  180. package/dist/types/RerankingResult.d.ts +0 -31
  181. package/dist/types/RerankingResult.js +0 -2
  182. package/dist/types/ResponseFormat.d.ts +0 -11
  183. package/dist/types/ResponseFormat.js +0 -2
  184. package/dist/types/ResponseInfo.d.ts +0 -30
  185. package/dist/types/ResponseInfo.js +0 -2
  186. package/dist/types/ResponseMetadata.d.ts +0 -8
  187. package/dist/types/ResponseMetadata.js +0 -3
  188. package/dist/types/ResponseRecord.d.ts +0 -13
  189. package/dist/types/ResponseRecord.js +0 -3
  190. package/dist/types/Role.d.ts +0 -4
  191. package/dist/types/Role.js +0 -3
  192. package/dist/types/RuntimeModel.d.ts +0 -22
  193. package/dist/types/RuntimeModel.js +0 -3
  194. package/dist/types/SearchCallOptions.d.ts +0 -46
  195. package/dist/types/SearchCallOptions.js +0 -2
  196. package/dist/types/SearchResponse.d.ts +0 -16
  197. package/dist/types/SearchResponse.js +0 -2
  198. package/dist/types/SearchResult.d.ts +0 -32
  199. package/dist/types/SearchResult.js +0 -2
  200. package/dist/types/SearchResultItem.d.ts +0 -33
  201. package/dist/types/SearchResultItem.js +0 -2
  202. package/dist/types/SessionCall.d.ts +0 -20
  203. package/dist/types/SessionCall.js +0 -3
  204. package/dist/types/SessionChainView.d.ts +0 -10
  205. package/dist/types/SessionChainView.js +0 -2
  206. package/dist/types/SessionSource.d.ts +0 -4
  207. package/dist/types/SessionSource.js +0 -3
  208. package/dist/types/SessionStepStat.d.ts +0 -27
  209. package/dist/types/SessionStepStat.js +0 -2
  210. package/dist/types/SessionView.d.ts +0 -16
  211. package/dist/types/SessionView.js +0 -2
  212. package/dist/types/Size.d.ts +0 -11
  213. package/dist/types/Size.js +0 -3
  214. package/dist/types/SourcePart.d.ts +0 -9
  215. package/dist/types/SourcePart.js +0 -3
  216. package/dist/types/SpeechCallOptions.d.ts +0 -47
  217. package/dist/types/SpeechCallOptions.js +0 -2
  218. package/dist/types/SpeechRequest.d.ts +0 -10
  219. package/dist/types/SpeechRequest.js +0 -2
  220. package/dist/types/SpeechResponse.d.ts +0 -24
  221. package/dist/types/SpeechResponse.js +0 -2
  222. package/dist/types/SpeechResult.d.ts +0 -34
  223. package/dist/types/SpeechResult.js +0 -2
  224. package/dist/types/StreamPart.d.ts +0 -161
  225. package/dist/types/StreamPart.js +0 -2
  226. package/dist/types/StreamTextResultAggregated.d.ts +0 -74
  227. package/dist/types/StreamTextResultAggregated.js +0 -2
  228. package/dist/types/TimeoutConfiguration.d.ts +0 -23
  229. package/dist/types/TimeoutConfiguration.js +0 -3
  230. package/dist/types/TimingRecord.d.ts +0 -7
  231. package/dist/types/TimingRecord.js +0 -3
  232. package/dist/types/TokenUsage.d.ts +0 -29
  233. package/dist/types/TokenUsage.js +0 -3
  234. package/dist/types/Tool.d.ts +0 -12
  235. package/dist/types/Tool.js +0 -2
  236. package/dist/types/ToolCall.d.ts +0 -33
  237. package/dist/types/ToolCall.js +0 -2
  238. package/dist/types/ToolChoice.d.ts +0 -12
  239. package/dist/types/ToolChoice.js +0 -3
  240. package/dist/types/ToolResult.d.ts +0 -22
  241. package/dist/types/ToolResult.js +0 -2
  242. package/dist/types/TraceFilter.d.ts +0 -9
  243. package/dist/types/TraceFilter.js +0 -3
  244. package/dist/types/TraceRecord.d.ts +0 -54
  245. package/dist/types/TraceRecord.js +0 -2
  246. package/dist/types/TraceStats.d.ts +0 -20
  247. package/dist/types/TraceStats.js +0 -3
  248. package/dist/types/TranscriptionCallOptions.d.ts +0 -29
  249. package/dist/types/TranscriptionCallOptions.js +0 -2
  250. package/dist/types/TranscriptionRequest.d.ts +0 -9
  251. package/dist/types/TranscriptionRequest.js +0 -3
  252. package/dist/types/TranscriptionResponse.d.ts +0 -24
  253. package/dist/types/TranscriptionResponse.js +0 -2
  254. package/dist/types/TranscriptionResult.d.ts +0 -46
  255. package/dist/types/TranscriptionResult.js +0 -2
  256. package/dist/types/TranscriptionSegment.d.ts +0 -17
  257. package/dist/types/TranscriptionSegment.js +0 -3
  258. package/dist/types/TranscriptionStreamPart.d.ts +0 -70
  259. package/dist/types/TranscriptionStreamPart.js +0 -2
  260. package/dist/types/UploadFileCallOptions.d.ts +0 -27
  261. package/dist/types/UploadFileCallOptions.js +0 -2
  262. package/dist/types/UploadFileData.d.ts +0 -17
  263. package/dist/types/UploadFileData.js +0 -2
  264. package/dist/types/UploadFileResult.d.ts +0 -35
  265. package/dist/types/UploadFileResult.js +0 -2
  266. package/dist/types/Usage.d.ts +0 -13
  267. package/dist/types/Usage.js +0 -2
  268. package/dist/types/UsageSnapshot.d.ts +0 -18
  269. package/dist/types/UsageSnapshot.js +0 -2
  270. package/dist/types/Verdict.d.ts +0 -23
  271. package/dist/types/Verdict.js +0 -2
  272. package/dist/types/VerdictConfidence.d.ts +0 -4
  273. package/dist/types/VerdictConfidence.js +0 -3
  274. package/dist/types/VerdictKind.d.ts +0 -4
  275. package/dist/types/VerdictKind.js +0 -3
  276. package/dist/types/VideoCallOptions.d.ts +0 -69
  277. package/dist/types/VideoCallOptions.js +0 -2
  278. package/dist/types/VideoData.d.ts +0 -22
  279. package/dist/types/VideoData.js +0 -3
  280. package/dist/types/VideoFile.d.ts +0 -29
  281. package/dist/types/VideoFile.js +0 -2
  282. package/dist/types/VideoFileData.d.ts +0 -8
  283. package/dist/types/VideoFileData.js +0 -3
  284. package/dist/types/VideoFrameImage.d.ts +0 -17
  285. package/dist/types/VideoFrameImage.js +0 -2
  286. package/dist/types/VideoFrameType.d.ts +0 -6
  287. package/dist/types/VideoFrameType.js +0 -3
  288. package/dist/types/VideoResponse.d.ts +0 -19
  289. package/dist/types/VideoResponse.js +0 -3
  290. package/dist/types/VideoResult.d.ts +0 -29
  291. package/dist/types/VideoResult.js +0 -2
  292. package/dist/types/Warning.d.ts +0 -23
  293. package/dist/types/Warning.js +0 -3
  294. package/dist/types/serde_json/JsonValue.d.ts +0 -3
  295. package/dist/types/serde_json/JsonValue.js +0 -3
@@ -1,161 +0,0 @@
1
- import type { AiMuxError } from "./AiMuxError";
2
- import type { FileData } from "./FileData";
3
- import type { FinishReason } from "./FinishReason";
4
- import type { Usage } from "./Usage";
5
- import type { Warning } from "./Warning";
6
- import type { JsonValue } from "./serde_json/JsonValue";
7
- /**
8
- * A single chunk in the stream returned by `do_stream`.
9
- */
10
- export type StreamPart = {
11
- "TextStart": {
12
- id: string;
13
- provider_metadata?: JsonValue | null;
14
- };
15
- } | {
16
- "TextDelta": {
17
- id: string;
18
- delta: string;
19
- provider_metadata?: JsonValue | null;
20
- };
21
- } | {
22
- "TextEnd": {
23
- id: string;
24
- provider_metadata?: JsonValue | null;
25
- };
26
- } | {
27
- "StreamStart": {
28
- warnings: Array<Warning>;
29
- };
30
- } | {
31
- "Finish": {
32
- finish_reason: FinishReason;
33
- usage: Usage;
34
- provider_metadata: JsonValue | null;
35
- };
36
- } | {
37
- "Error": {
38
- error: AiMuxError;
39
- };
40
- } | {
41
- "ToolInputStart": {
42
- id: string;
43
- tool_name: string;
44
- /**
45
- * Whether the tool call will be executed by the provider.
46
- */
47
- provider_executed?: boolean | null;
48
- /**
49
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
50
- */
51
- dynamic?: boolean | null;
52
- /**
53
- * Optional title for the tool call.
54
- */
55
- title?: string | null;
56
- provider_metadata?: JsonValue | null;
57
- };
58
- } | {
59
- "ToolInputDelta": {
60
- id: string;
61
- delta: string;
62
- provider_metadata?: JsonValue | null;
63
- };
64
- } | {
65
- "ToolInputEnd": {
66
- id: string;
67
- provider_metadata?: JsonValue | null;
68
- };
69
- } | {
70
- "ToolCall": {
71
- tool_call_id: string;
72
- tool_name: string;
73
- input: JsonValue;
74
- /**
75
- * Whether the tool call will be executed by the provider.
76
- */
77
- provider_executed?: boolean | null;
78
- /**
79
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
80
- */
81
- dynamic?: boolean | null;
82
- /**
83
- * Provider-assigned thought signature (e.g. Google Gemini
84
- * `thoughtSignature`). Must be echoed back verbatim on the follow-up
85
- * turn when the tool result is sent.
86
- */
87
- thought_signature?: string | null;
88
- provider_metadata?: JsonValue | null;
89
- };
90
- } | {
91
- "ToolResult": {
92
- tool_call_id: string;
93
- tool_name: string;
94
- result: JsonValue;
95
- /**
96
- * Whether the result is an error or error message.
97
- */
98
- is_error?: boolean | null;
99
- /**
100
- * Whether the result is preliminary (replaces prior, e.g. image previews).
101
- */
102
- preliminary?: boolean | null;
103
- /**
104
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
105
- */
106
- dynamic?: boolean | null;
107
- /**
108
- * Additional provider-specific metadata for the tool result.
109
- */
110
- provider_metadata?: JsonValue | null;
111
- };
112
- } | {
113
- "File": {
114
- data: FileData;
115
- media_type: string;
116
- provider_metadata?: JsonValue | null;
117
- };
118
- } | {
119
- "ReasoningStart": {
120
- id: string;
121
- /**
122
- * Provider-specific metadata (e.g. xAI `itemId`).
123
- */
124
- provider_metadata: JsonValue | null;
125
- };
126
- } | {
127
- "ReasoningDelta": {
128
- id: string;
129
- delta: string;
130
- /**
131
- * Provider-specific metadata (e.g. xAI `itemId`).
132
- */
133
- provider_metadata: JsonValue | null;
134
- };
135
- } | {
136
- "ReasoningEnd": {
137
- id: string;
138
- /**
139
- * Provider-specific metadata (e.g. xAI `itemId`, `reasoningEncryptedContent`).
140
- */
141
- provider_metadata: JsonValue | null;
142
- };
143
- } | {
144
- "ResponseMetadata": {
145
- id: string | null;
146
- timestamp: string | null;
147
- model_id: string | null;
148
- };
149
- } | {
150
- "Source": {
151
- id: string;
152
- source_type: string;
153
- url: string | null;
154
- title: string | null;
155
- provider_metadata?: JsonValue | null;
156
- };
157
- } | {
158
- "Raw": {
159
- raw_value: JsonValue;
160
- };
161
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,74 +0,0 @@
1
- import type { FilePart } from "./FilePart";
2
- import type { FinishReason } from "./FinishReason";
3
- import type { ModelMessage } from "./ModelMessage";
4
- import type { ReasoningPart } from "./ReasoningPart";
5
- import type { ResponseMetadata } from "./ResponseMetadata";
6
- import type { SourcePart } from "./SourcePart";
7
- import type { ToolCall } from "./ToolCall";
8
- import type { Usage } from "./Usage";
9
- import type { Warning } from "./Warning";
10
- import type { JsonValue } from "./serde_json/JsonValue";
11
- /**
12
- * Aggregated result of `stream_text().consume()` (M11). Mirrors
13
- * `GenerateTextResult`'s user-facing fields (without `raw`, since streaming
14
- * has no `GenerateResult` equivalent).
15
- */
16
- export type StreamTextResultAggregated = {
17
- /**
18
- * The generated text (concatenated `TextDelta`).
19
- */
20
- text: string;
21
- /**
22
- * Reasoning / thinking segments.
23
- */
24
- reasoning: Array<ReasoningPart>;
25
- /**
26
- * Concatenated reasoning text.
27
- */
28
- reasoning_text: string;
29
- /**
30
- * Tool calls requested by the model.
31
- */
32
- tool_calls: Array<ToolCall>;
33
- /**
34
- * Sources / citations.
35
- */
36
- sources: Array<SourcePart>;
37
- /**
38
- * Files generated by the model.
39
- */
40
- files: Array<FilePart>;
41
- /**
42
- * Why generation stopped.
43
- */
44
- finish_reason: FinishReason;
45
- /**
46
- * Raw provider-specific finish reason string.
47
- */
48
- raw_finish_reason: string | null;
49
- /**
50
- * Token usage.
51
- */
52
- usage: Usage;
53
- /**
54
- * Total token usage across all steps. In single-step mode (aimux's
55
- * default), `total_usage` equals `usage`. Provided for AI SDK parity.
56
- */
57
- total_usage: Usage;
58
- /**
59
- * Warnings from the provider.
60
- */
61
- warnings: Array<Warning>;
62
- /**
63
- * Provider-specific metadata from the Finish chunk.
64
- */
65
- provider_metadata: JsonValue | null;
66
- /**
67
- * Response metadata (id, timestamp, model_id) if emitted by the stream.
68
- */
69
- response: ResponseMetadata | null;
70
- /**
71
- * Assistant messages ready to append for the next turn.
72
- */
73
- response_messages: Array<ModelMessage>;
74
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,23 +0,0 @@
1
- /**
2
- * Per-call timeout configuration.
3
- *
4
- * Aligned with V4 `LanguageModelV4CallOptions.timeout`
5
- * (`TimeoutConfiguration`). All values are milliseconds; `None` disables the
6
- * corresponding limit. A `total` timeout also covers retry backoff and the
7
- * whole streamed response.
8
- */
9
- export type TimeoutConfiguration = {
10
- /**
11
- * Overall timeout for the entire call (including retries and, for
12
- * streaming, the whole stream), in milliseconds.
13
- */
14
- total_ms: number | null;
15
- /**
16
- * Timeout waiting for the first stream chunk (streaming only).
17
- */
18
- first_chunk_ms: number | null;
19
- /**
20
- * Maximum idle time between consecutive stream chunks (streaming only).
21
- */
22
- chunk_ms: number | null;
23
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- export type TimingRecord = {
2
- /**
3
- * ms 级延迟,TS 用 number(远小于 2^53,避免 bigint)。
4
- */
5
- latency_ms: number;
6
- ttfb_ms: number | null;
7
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +0,0 @@
1
- /**
2
- * Token usage detail (with cache breakdown).
3
- */
4
- export type TokenUsage = {
5
- /**
6
- * Total tokens.
7
- */
8
- total: number | null;
9
- /**
10
- * Tokens that were not served from cache.
11
- */
12
- no_cache: number | null;
13
- /**
14
- * Tokens served from cache (read).
15
- */
16
- cache_read: number | null;
17
- /**
18
- * Tokens written to cache.
19
- */
20
- cache_write: number | null;
21
- /**
22
- * Text (non-reasoning) tokens (output side).
23
- */
24
- text: number | null;
25
- /**
26
- * Reasoning tokens (output side).
27
- */
28
- reasoning: number | null;
29
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- import type { FunctionTool } from "./FunctionTool";
2
- import type { ProviderTool } from "./ProviderTool";
3
- /**
4
- * A tool that can be either a user-defined function tool or a
5
- * provider-defined tool. Mirrors the V4
6
- * `Array<LanguageModelV4FunctionTool | LanguageModelV4ProviderTool>`.
7
- */
8
- export type Tool = {
9
- "type": "function";
10
- } & FunctionTool | {
11
- "type": "provider";
12
- } & ProviderTool;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,33 +0,0 @@
1
- import type { JsonValue } from "./serde_json/JsonValue";
2
- /**
3
- * A tool call requested by the model.
4
- */
5
- export type ToolCall = {
6
- /**
7
- * Provider-assigned call id.
8
- */
9
- tool_call_id: string;
10
- /**
11
- * Tool name.
12
- */
13
- tool_name: string;
14
- /**
15
- * Arguments as a JSON value (usually an object).
16
- */
17
- input: JsonValue;
18
- /**
19
- * Whether the tool call will be executed by the provider.
20
- */
21
- provider_executed?: boolean | null;
22
- /**
23
- * Whether the tool is dynamic (defined at runtime, e.g. MCP tools).
24
- */
25
- dynamic?: boolean | null;
26
- /**
27
- * Provider-assigned thought signature (e.g. Google Gemini
28
- * `thoughtSignature`). Must be echoed back verbatim on the follow-up turn
29
- * when the tool result is sent; thinking models reject the request
30
- * otherwise.
31
- */
32
- thought_signature?: string | null;
33
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- /**
2
- * How the model should choose tools.
3
- *
4
- * Wire format aligns with Vercel AI SDK `toolChoice`:
5
- * `"auto" | "none" | "required" | { "type": "tool", "toolName": "..." }`.
6
- * This is a mixed tagged/untagged shape (unit variants as bare strings,
7
- * `Tool` variant as a tagged object), so serde is implemented by hand.
8
- */
9
- export type ToolChoice = "auto" | "none" | "required" | {
10
- type: "tool";
11
- toolName: string;
12
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
1
- import type { JsonValue } from "./serde_json/JsonValue";
2
- /**
3
- * The result of executing a tool call, to be sent back to the model.
4
- */
5
- export type ToolResult = {
6
- /**
7
- * Must match the corresponding `ToolCall::tool_call_id`.
8
- */
9
- tool_call_id: string;
10
- /**
11
- * The tool's output (usually a JSON-serializable value or plain text).
12
- */
13
- result: JsonValue;
14
- /**
15
- * Whether the result is an error or error message.
16
- */
17
- is_error?: boolean | null;
18
- /**
19
- * Whether the result is preliminary (replaces prior, e.g. image previews).
20
- */
21
- preliminary?: boolean | null;
22
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- /**
2
- * Query filter (RFC-0015 §5.3).
3
- */
4
- export type TraceFilter = {
5
- provider: string | null;
6
- model: string | null;
7
- session_id: string | null;
8
- since_unix_ms: bigint | null;
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,54 +0,0 @@
1
- import type { Fingerprint } from "./Fingerprint";
2
- import type { RequestCacheHints } from "./RequestCacheHints";
3
- import type { UsageSnapshot } from "./UsageSnapshot";
4
- import type { Verdict } from "./Verdict";
5
- /**
6
- * One probed call. Plaintext never persists — fingerprints only.
7
- */
8
- export type TraceRecord = {
9
- provider: string;
10
- model: string;
11
- request_id: string | null;
12
- /**
13
- * From `CallOptions.session_id` (RFC-0024) — explicit first, inference
14
- * fallback; may also be the layer's default session.
15
- */
16
- session_id: string | null;
17
- /**
18
- * Call-level unique id (association key for Recording / replay,
19
- * RFC-0023).
20
- */
21
- call_id: string;
22
- /**
23
- * When the call was sent (epoch ms).
24
- */
25
- sent_at_unix_ms: number;
26
- /**
27
- * Client-side LCP token upper bound (block upper bound, byte-proxy
28
- * len/4). `None` when no history matched. Consumed by `TraceStats`
29
- * aggregation.
30
- */
31
- lcp_token_upper?: bigint | null;
32
- /**
33
- * Time to first streamed token (ms). Non-streaming: `None`.
34
- */
35
- ttft_ms: number | null;
36
- fingerprint: Fingerprint;
37
- usage: UsageSnapshot;
38
- /**
39
- * Response-side cache headers (e.g. `x-openrouter-cache-status`).
40
- */
41
- response_cache_headers?: {
42
- [key in string]: string;
43
- } | null;
44
- request_cache_hints?: RequestCacheHints | null;
45
- /**
46
- * Audit verdict (`None` when no auditor is attached — the default).
47
- */
48
- verdict?: Verdict | null;
49
- /**
50
- * Error string when the call failed (still recorded: failures are part
51
- * of the session).
52
- */
53
- error?: string | null;
54
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,20 +0,0 @@
1
- /**
2
- * Aggregated statistics (RFC-0015 §5.2 — the two hit rates are reported
3
- * side by side, never merged into a single number).
4
- */
5
- export type TraceStats = {
6
- provider: string;
7
- model: string;
8
- requests: bigint;
9
- input_tokens_total: bigint;
10
- claimed_cache_read_total: bigint;
11
- claimed_cache_write_total: bigint;
12
- reported_hit_rate: number | null;
13
- client_upper_bound_hit_rate: number | null;
14
- verdict_counts: {
15
- [key in string]: bigint;
16
- };
17
- ttft_p50_ms: bigint | null;
18
- ttft_p95_ms: bigint | null;
19
- errors: bigint;
20
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +0,0 @@
1
- import type { AudioInput } from "./AudioInput";
2
- import type { JsonValue } from "./serde_json/JsonValue";
3
- /**
4
- * Options passed to [`TranscriptionModel::do_generate`].
5
- *
6
- * Aligned with V4 `TranscriptionModelV4CallOptions`.
7
- */
8
- export type TranscriptionCallOptions = {
9
- /**
10
- * Audio data to transcribe (raw bytes or a base64-encoded string).
11
- */
12
- audio: AudioInput;
13
- /**
14
- * The IANA media type of the audio data, e.g. `"audio/mp3"`.
15
- */
16
- media_type: string;
17
- /**
18
- * Additional provider-specific options, keyed by provider name.
19
- */
20
- provider_options: {
21
- [key in string]: JsonValue;
22
- } | null;
23
- /**
24
- * Additional HTTP headers to send with the request.
25
- */
26
- headers: {
27
- [key in string]: string;
28
- } | null;
29
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- /**
2
- * Optional request information for a transcription call.
3
- */
4
- export type TranscriptionRequest = {
5
- /**
6
- * Raw request HTTP body that was sent (JSON stringified).
7
- */
8
- body: string | null;
9
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,24 +0,0 @@
1
- import type { JsonValue } from "./serde_json/JsonValue";
2
- /**
3
- * Response information for a transcription call.
4
- */
5
- export type TranscriptionResponse = {
6
- /**
7
- * Timestamp for the start of the generated response (ISO 8601 string).
8
- */
9
- timestamp: string | null;
10
- /**
11
- * The ID of the model that was used to generate the response.
12
- */
13
- model_id: string | null;
14
- /**
15
- * Response headers.
16
- */
17
- headers: {
18
- [key in string]: string;
19
- } | null;
20
- /**
21
- * Response body (opaque JSON).
22
- */
23
- body: JsonValue | null;
24
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,46 +0,0 @@
1
- import type { TranscriptionRequest } from "./TranscriptionRequest";
2
- import type { TranscriptionResponse } from "./TranscriptionResponse";
3
- import type { TranscriptionSegment } from "./TranscriptionSegment";
4
- import type { Warning } from "./Warning";
5
- import type { JsonValue } from "./serde_json/JsonValue";
6
- /**
7
- * The result of [`TranscriptionModel::do_generate`].
8
- *
9
- * Aligned with V4 `TranscriptionModelV4Result`.
10
- */
11
- export type TranscriptionResult = {
12
- /**
13
- * The complete transcribed text from the audio.
14
- */
15
- text: string;
16
- /**
17
- * Transcript segments with timing information.
18
- */
19
- segments: Array<TranscriptionSegment>;
20
- /**
21
- * The detected language (ISO 639-1 code, e.g. `"en"`), if detected.
22
- */
23
- language: string | null;
24
- /**
25
- * The total duration of the audio in seconds, if determined.
26
- */
27
- duration_in_seconds: number | null;
28
- /**
29
- * Warnings for the call, e.g. unsupported settings.
30
- */
31
- warnings: Array<Warning>;
32
- /**
33
- * Optional request information for telemetry and debugging.
34
- */
35
- request: TranscriptionRequest | null;
36
- /**
37
- * Response information for telemetry and debugging.
38
- */
39
- response: TranscriptionResponse;
40
- /**
41
- * Additional provider-specific metadata, keyed by provider name.
42
- */
43
- provider_metadata: {
44
- [key in string]: JsonValue;
45
- } | null;
46
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- /**
2
- * A transcript segment with timing information.
3
- */
4
- export type TranscriptionSegment = {
5
- /**
6
- * The text content of this segment.
7
- */
8
- text: string;
9
- /**
10
- * The start time of this segment in seconds.
11
- */
12
- start_second: number;
13
- /**
14
- * The end time of this segment in seconds.
15
- */
16
- end_second: number;
17
- };