@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
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # Node ops binding
2
+
3
+ > **0.6.0.** This binding uses ABI 1 / ops 1.0. The 0.5 top-level
4
+ > `openai`/`generateText` helpers are removed. See
5
+ > [Upgrading to 0.6](../../docs/upgrading-to-0.6.md).
6
+
7
+ The napi adapter awaits `aimux_ops::dispatch` on napi-rs's Tokio runtime. It does
8
+ not use the C ABI, create a blocking runtime, retry calls, or accept JavaScript
9
+ fetch/model/token/telemetry implementations.
10
+
11
+ ```ts
12
+ import { Client, LanguageModel } from '@arcships/aimux'
13
+
14
+ const client = new Client()
15
+ const provider = await client.provider({ package: 'openai', settings: { apiKey: '...' } })
16
+ const model = await provider.model('gpt-4o-mini', 'languageModel')
17
+ try {
18
+ if (!(model instanceof LanguageModel)) throw new Error('Expected Language')
19
+ console.log((await model.generate('Hello')).text)
20
+ const controller = new AbortController()
21
+ for await (const frame of await model.stream('Hello', {}, { signal: controller.signal })) {
22
+ // Data errors remain data. Only the explicit end frame describes termination.
23
+ if (frame.type === 'event') console.log(frame.event)
24
+ else console.log(frame.outcome, frame.error)
25
+ }
26
+ } finally {
27
+ await model.close()
28
+ await provider.close()
29
+ }
30
+ ```
31
+
32
+ The raw entrypoint `@arcships/aimux/raw` exposes the `Runtime` class with
33
+ `runtime.call(handle, op, paramsJson, abort?)` and
34
+ `runtime.stream(...)`. It transports the same DTOs and
35
+ frames as the typed facade. `runtime.abort(signal?)` creates a native Abort.
36
+ `runtime.operationPush(handle, bytes)` admits bytes before returning a Promise.
37
+ A full input queue rejects immediately with ResourceLimit (305); it never waits
38
+ for capacity. Accepted bytes are copied before the caller can mutate the buffer.
39
+ Handle IDs and sequence numbers are decimal strings, including beyond 2^53.
40
+ Resources belong to their Node Env; they cannot be transferred to workers.
41
+
42
+ Streams have a 64-item / 8 MiB data bridge and a 1 MiB serialized frame limit.
43
+ They stop pulling upstream when full. The terminal has a separate slot, so
44
+ cancellation cannot lose its outcome behind a full queue. `return()`, `throw()`,
45
+ `readable(iterator).getReader().cancel()`, object collection, and Env teardown
46
+ cancel the underlying work. Explicit cancellation can interrupt pending reads
47
+ and capacity waits. A forgotten live iterator can retain its bounded queue;
48
+ close it explicitly when it is no longer needed.
49
+
50
+ Errors expose the shared `kind`, numeric `code`, `message` and `error` payload.
51
+ The AI SDK payload retains `name`, `isRetryable`, `responseHeaders` (read
52
+ `retry-after` there, as with the AI SDK) and other variant fields. Data error events and end-frame error envelopes stay
53
+ plain DTOs. Raw and typed call/next rejections use `AimuxError`.
54
+ The payload's `cause` is also the standard `error.cause`: an
55
+ `AimuxCauseError` for a nested AI SDK error (`name` and the whole `error`
56
+ payload) or an `AimuxSourceError` for an underlying OS, TLS or parser error,
57
+ each with its own `cause` down the chain. A retry error's `cause` is its last
58
+ attempt, the AI SDK `lastError`.
59
+
60
+ `close()` is idempotent. Recorder persistence is explicit: await `flush()` and
61
+ inspect its result before closing; finalization does not flush. Dropping a
62
+ provider does not revoke a model's strong reference. Dropping an Operation
63
+ cancels it; dropping an Abort releases the handle without signalling shared work.
64
+
65
+ The binding requires the exact generated ABI version, ops version and manifest
66
+ `digest` at load, and exposes the verified manifest and digest.
67
+
68
+ Run `npm run test:facade` for the JSON-transport facade tests (Node with TypeScript stripping,
69
+ 22.18+). These tests use a transport double. Run `npm run test:native` after
70
+ building a real napi binary for owner/error/Env integration checks. `npm run test:lifecycle` runs local HTTP timer, slow-consumer, cancellation and
71
+ shutdown scenarios; it requires permission to listen on loopback sockets. `npm test`
72
+ also replays all 11 JSON scenarios from `AIMUX_CONTRACT_VECTORS/scenarios`
73
+ (default: `contract-tests/ops/scenarios` in the repository) through the native call
74
+ boundary, real Dispatcher, framing and bounded queue. It builds an isolated addon
75
+ with the `contract-tests` feature for the scripted source; release builds do not
76
+ expose test operations. Set `AIMUX_BUILD_COMMAND` to a Cargo build wrapper if
77
+ needed. The scenario driver does not read expected output. `npm test` requires
78
+ the production binary for the other native suites. Rust bridge
79
+ unit tests exercise real channel/byte limits and cancellation with synthetic
80
+ streams. Build the addon with `npm run build:debug` and the typed facade with
81
+ `npm run build:typed`. Run Rust unit tests with
82
+ `cargo test --manifest-path bindings/node/Cargo.toml --lib`.
83
+
84
+ For C ABI parity, build `aimux-ffi`, set `AIMUX_FFI_LIBRARY` to its absolute library
85
+ path, and run `npm run test:c-parity` (Python 3 is required). This compares the
86
+ same provider, registry, trace, recorder, session, replay and error vectors.
87
+
88
+ Recorder, session storage and inference state are process-wide. Trace middleware
89
+ wraps language models using a TraceStore. Credential resolver creation and replay
90
+ transport capabilities report UnsupportedFunctionality. Recording schemas
91
+ are unchanged; business type schema generation and per-platform installation
92
+ verification are separate release work.
package/dist/error.d.ts CHANGED
@@ -1,71 +1,30 @@
1
+ import type { ErrorDomain, ErrorEnvelope } from './generated/types.ts';
2
+ export type { ErrorDomain, ErrorEnvelope } from './generated/types.ts';
1
3
  /**
2
- * Aimux error hierarchy (aligned with Vercel AI SDK style).
3
- *
4
- * ```ts
5
- * try {
6
- * await generateText(model, '...')
7
- * } catch (e) {
8
- * if (e instanceof APICallError) {
9
- * // Classification is the status field (AI SDK APICallError.statusCode):
10
- * // e.status === 429 → rate limited (e.retryMs), 401 → auth, 404 → model
11
- * } else if (e instanceof AimuxError) {
12
- * // any engine / binding failure
13
- * }
14
- * }
15
- * ```
16
- *
17
- * Distinct from the ts-rs wire type `AiMuxError` used inside `StreamPart`.
4
+ * The exact shared ErrorEnvelope, including the AI SDK payload in `error`.
5
+ * The payload's `cause` is also the standard `Error.cause`, restored as an
6
+ * `AimuxCauseError` (a nested AI SDK error) or an `AimuxSourceError` (an
7
+ * underlying OS, TLS or parser error), each with its own `cause` down the
8
+ * chain. A retry error's `cause` is its last attempt, the AI SDK `lastError`.
18
9
  */
19
- export declare class AimuxError extends Error {
20
- /** Core variant name, e.g. `'InvalidArgument'`. */
21
- readonly code: string;
22
- readonly status: number;
23
- readonly retryMs: number;
24
- /** Stored retry verdict (`APICallError.isRetryable` analogue). */
25
- readonly retryable: boolean;
26
- /** Provider's machine-readable error code (e.g. `'rate_limit_exceeded'`). */
27
- readonly providerCode?: string;
28
- /** Raw error response body, verbatim (AI SDK `APICallError.responseBody`). */
29
- readonly responseBody?: string;
30
- /** Provider-assigned request id (`x-request-id` / `request-id` header). */
31
- readonly requestId?: string;
32
- /**
33
- * Lossless externally-tagged serde JSON of the core `AiMuxError`,
34
- * e.g. `'{"ApiCall":{"status_code":429,"retry_after_ms":1500,...}}'`.
35
- * Absent when the error did not originate from a core `AiMuxError`.
36
- */
37
- readonly errorValue?: string;
38
- constructor(message: string, status?: number, retryMs?: number, retryable?: boolean);
39
- /** Rebuild from a native throw (or already-wrapped instance). */
40
- static fromNative(err: unknown): AimuxError;
41
- }
42
- export declare class APICallError extends AimuxError {
43
- }
44
- export declare class JSONParseError extends AimuxError {
45
- }
46
- export declare class InvalidResponseDataError extends AimuxError {
47
- }
48
- export declare class ToolError extends AimuxError {
49
- }
50
- export declare class InvalidArgumentError extends AimuxError {
51
- }
52
- export declare class InvalidPromptError extends AimuxError {
53
- }
54
- export declare class TokenExpiredError extends AimuxError {
55
- }
56
- export declare class UnsupportedFunctionalityError extends AimuxError {
57
- }
58
- export declare class NoSuchModelError extends AimuxError {
59
- }
60
- export declare class NoSuchProviderError extends AimuxError {
61
- }
62
- export declare class TimeoutError extends AimuxError {
63
- }
64
- /** Request aborted (not DOM `AbortError`). */
65
- export declare class RequestAbortedError extends AimuxError {
66
- constructor(message?: string, status?: number, retryMs?: number, retryable?: boolean);
67
- }
68
- export declare class OtherError extends AimuxError {
69
- }
70
- /** Wrap an async native call so throws are typed `AimuxError` subclasses. */
71
- export declare function withAimuxError<T>(fn: () => Promise<T>): Promise<T>;
10
+ export declare class AimuxError extends Error implements ErrorEnvelope {
11
+ readonly kind: ErrorDomain;
12
+ readonly code: number;
13
+ readonly error: ErrorEnvelope['error'];
14
+ readonly cause?: unknown;
15
+ constructor(envelope: ErrorEnvelope);
16
+ }
17
+ /** A nested AI SDK error: `name` is its AI SDK name and `error` its whole payload. */
18
+ export declare class AimuxCauseError extends Error {
19
+ readonly error: Record<string, unknown>;
20
+ readonly cause?: unknown;
21
+ constructor(payload: Record<string, unknown>);
22
+ }
23
+ /** An underlying OS, TLS or parser error, from `{ message, cause? }`. */
24
+ export declare class AimuxSourceError extends Error {
25
+ readonly cause?: unknown;
26
+ constructor(payload: Record<string, unknown>);
27
+ }
28
+ export declare function rethrow(error: unknown): never;
29
+ export declare function isEnvelope(value: unknown): value is ErrorEnvelope;
30
+ export declare function protocolError(code: number, name: string, message: string): AimuxError;
package/dist/error.js CHANGED
@@ -1,173 +1,85 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AimuxSourceError = exports.AimuxCauseError = exports.AimuxError = void 0;
4
+ exports.rethrow = rethrow;
5
+ exports.isEnvelope = isEnvelope;
6
+ exports.protocolError = protocolError;
2
7
  /**
3
- * Aimux error hierarchy (aligned with Vercel AI SDK style).
4
- *
5
- * ```ts
6
- * try {
7
- * await generateText(model, '...')
8
- * } catch (e) {
9
- * if (e instanceof APICallError) {
10
- * // Classification is the status field (AI SDK APICallError.statusCode):
11
- * // e.status === 429 → rate limited (e.retryMs), 401 → auth, 404 → model
12
- * } else if (e instanceof AimuxError) {
13
- * // any engine / binding failure
14
- * }
15
- * }
16
- * ```
17
- *
18
- * Distinct from the ts-rs wire type `AiMuxError` used inside `StreamPart`.
8
+ * The exact shared ErrorEnvelope, including the AI SDK payload in `error`.
9
+ * The payload's `cause` is also the standard `Error.cause`, restored as an
10
+ * `AimuxCauseError` (a nested AI SDK error) or an `AimuxSourceError` (an
11
+ * underlying OS, TLS or parser error), each with its own `cause` down the
12
+ * chain. A retry error's `cause` is its last attempt, the AI SDK `lastError`.
19
13
  */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.OtherError = exports.RequestAbortedError = exports.TimeoutError = exports.NoSuchProviderError = exports.NoSuchModelError = exports.UnsupportedFunctionalityError = exports.TokenExpiredError = exports.InvalidPromptError = exports.InvalidArgumentError = exports.ToolError = exports.InvalidResponseDataError = exports.JSONParseError = exports.APICallError = exports.AimuxError = void 0;
22
- exports.withAimuxError = withAimuxError;
23
14
  class AimuxError extends Error {
24
- constructor(message, status = -1, retryMs = -1, retryable = false) {
25
- super(message);
26
- this.name = new.target.name;
27
- this.code = CODE_BY_NAME.get(this.name) ?? 'Other';
28
- this.status = status;
29
- this.retryMs = retryMs;
30
- this.retryable = retryable;
31
- Object.setPrototypeOf(this, new.target.prototype);
32
- const capture = Error
33
- .captureStackTrace;
34
- if (capture)
35
- capture(this, new.target);
36
- }
37
- /** Rebuild from a native throw (or already-wrapped instance). */
38
- static fromNative(err) {
39
- if (err instanceof AimuxError) {
40
- return err;
41
- }
42
- let message = String(err);
43
- let code = 'Other';
44
- let status = -1;
45
- let retryMs = -1;
46
- let retryable = false;
47
- let providerCode;
48
- let responseBody;
49
- let requestId;
50
- let errorValue;
51
- if (err instanceof Error) {
52
- message = err.message;
53
- const any = err;
54
- if (typeof any.status === 'number')
55
- status = any.status;
56
- if (typeof any.retryMs === 'number')
57
- retryMs = any.retryMs;
58
- if (typeof any.retryable === 'boolean')
59
- retryable = any.retryable;
60
- if (typeof any.providerCode === 'string')
61
- providerCode = any.providerCode;
62
- if (typeof any.responseBody === 'string')
63
- responseBody = any.responseBody;
64
- if (typeof any.requestId === 'string')
65
- requestId = any.requestId;
66
- if (typeof any.errorValue === 'string')
67
- errorValue = any.errorValue;
68
- if (typeof any.code === 'string' && any.code.length > 0) {
69
- code = any.code;
70
- }
71
- else if (typeof any.name === 'string') {
72
- // Native sets name to e.g. "APICallError"
73
- code = CODE_BY_NAME.get(any.name) ?? 'Other';
74
- }
75
- }
76
- const wrapped = createByCode(code, message, status, retryMs, retryable);
77
- if (providerCode !== undefined) {
78
- ;
79
- wrapped.providerCode = providerCode;
80
- }
81
- if (responseBody !== undefined) {
82
- ;
83
- wrapped.responseBody = responseBody;
84
- }
85
- if (requestId !== undefined) {
86
- ;
87
- wrapped.requestId = requestId;
88
- }
89
- if (errorValue !== undefined) {
90
- ;
91
- wrapped.errorValue = errorValue;
92
- }
93
- if (err instanceof Error) {
94
- ;
95
- wrapped.cause = err;
96
- }
97
- return wrapped;
15
+ constructor(envelope) {
16
+ super(envelope.message);
17
+ this.name = 'AimuxError';
18
+ this.kind = envelope.kind;
19
+ this.code = envelope.code;
20
+ this.error = envelope.error;
21
+ attachCause(this, this.error);
98
22
  }
99
23
  }
100
24
  exports.AimuxError = AimuxError;
101
- class APICallError extends AimuxError {
102
- }
103
- exports.APICallError = APICallError;
104
- class JSONParseError extends AimuxError {
105
- }
106
- exports.JSONParseError = JSONParseError;
107
- class InvalidResponseDataError extends AimuxError {
108
- }
109
- exports.InvalidResponseDataError = InvalidResponseDataError;
110
- class ToolError extends AimuxError {
111
- }
112
- exports.ToolError = ToolError;
113
- class InvalidArgumentError extends AimuxError {
114
- }
115
- exports.InvalidArgumentError = InvalidArgumentError;
116
- class InvalidPromptError extends AimuxError {
117
- }
118
- exports.InvalidPromptError = InvalidPromptError;
119
- class TokenExpiredError extends AimuxError {
120
- }
121
- exports.TokenExpiredError = TokenExpiredError;
122
- class UnsupportedFunctionalityError extends AimuxError {
123
- }
124
- exports.UnsupportedFunctionalityError = UnsupportedFunctionalityError;
125
- class NoSuchModelError extends AimuxError {
126
- }
127
- exports.NoSuchModelError = NoSuchModelError;
128
- class NoSuchProviderError extends AimuxError {
129
- }
130
- exports.NoSuchProviderError = NoSuchProviderError;
131
- class TimeoutError extends AimuxError {
132
- }
133
- exports.TimeoutError = TimeoutError;
134
- /** Request aborted (not DOM `AbortError`). */
135
- class RequestAbortedError extends AimuxError {
136
- constructor(message = 'request aborted', status = -1, retryMs = -1, retryable = false) {
137
- super(message, status, retryMs, retryable);
25
+ /** A nested AI SDK error: `name` is its AI SDK name and `error` its whole payload. */
26
+ class AimuxCauseError extends Error {
27
+ constructor(payload) {
28
+ super(typeof payload.message === 'string' ? payload.message : String(payload.name));
29
+ this.name = String(payload.name);
30
+ this.error = payload;
31
+ attachCause(this, payload);
138
32
  }
139
33
  }
140
- exports.RequestAbortedError = RequestAbortedError;
141
- class OtherError extends AimuxError {
142
- }
143
- exports.OtherError = OtherError;
144
- /** Core variant name → error class (single source for lookups below). */
145
- const CLASS_BY_CODE = {
146
- ApiCall: APICallError,
147
- JsonParse: JSONParseError,
148
- InvalidResponseData: InvalidResponseDataError,
149
- Tool: ToolError,
150
- InvalidArgument: InvalidArgumentError,
151
- InvalidPrompt: InvalidPromptError,
152
- TokenExpired: TokenExpiredError,
153
- UnsupportedFunctionality: UnsupportedFunctionalityError,
154
- NoSuchModel: NoSuchModelError,
155
- NoSuchProvider: NoSuchProviderError,
156
- Timeout: TimeoutError,
157
- Aborted: RequestAbortedError,
158
- Other: OtherError,
159
- };
160
- const CODE_BY_NAME = new Map(Object.entries(CLASS_BY_CODE).map(([code, cls]) => [cls.name, code]));
161
- function createByCode(code, message, status, retryMs, retryable) {
162
- const Cls = CLASS_BY_CODE[code] ?? AimuxError;
163
- return new Cls(message, status, retryMs, retryable);
34
+ exports.AimuxCauseError = AimuxCauseError;
35
+ /** An underlying OS, TLS or parser error, from `{ message, cause? }`. */
36
+ class AimuxSourceError extends Error {
37
+ constructor(payload) {
38
+ super(typeof payload.message === 'string' ? payload.message : '');
39
+ this.name = 'AimuxSourceError';
40
+ attachCause(this, payload);
41
+ }
164
42
  }
165
- /** Wrap an async native call so throws are typed `AimuxError` subclasses. */
166
- async function withAimuxError(fn) {
167
- try {
168
- return await fn();
43
+ exports.AimuxSourceError = AimuxSourceError;
44
+ function causeOf(payload) {
45
+ if ('cause' in payload)
46
+ return payload.cause;
47
+ // The AI SDK's `lastError`, as Rust's `source()` of a retry error.
48
+ if (payload.name === 'AI_RetryError' && Array.isArray(payload.errors))
49
+ return payload.errors[payload.errors.length - 1];
50
+ return undefined;
51
+ }
52
+ function restore(cause) {
53
+ if (cause === null || typeof cause !== 'object')
54
+ return cause;
55
+ const payload = cause;
56
+ return typeof payload.name === 'string' ? new AimuxCauseError(payload) : new AimuxSourceError(payload);
57
+ }
58
+ // Like `new Error(message, { cause })`: an own, non-enumerable property.
59
+ function attachCause(error, payload) {
60
+ if (payload === null || typeof payload !== 'object')
61
+ return;
62
+ const cause = causeOf(payload);
63
+ if (cause !== undefined) {
64
+ Object.defineProperty(error, 'cause', { value: restore(cause), writable: true, configurable: true });
169
65
  }
170
- catch (e) {
171
- throw AimuxError.fromNative(e);
66
+ }
67
+ function rethrow(error) {
68
+ if (isEnvelope(error)) {
69
+ // Preserve the original native error's stack and all payload fields.
70
+ Object.setPrototypeOf(error, AimuxError.prototype);
71
+ attachCause(error, error.error);
172
72
  }
73
+ throw error;
74
+ }
75
+ function isEnvelope(value) {
76
+ if (value === null || typeof value !== 'object')
77
+ return false;
78
+ const e = value;
79
+ return ['aimux', 'recording', 'binding', 'protocol'].includes(e.kind)
80
+ && typeof e.code === 'number' && typeof e.message === 'string'
81
+ && e.error !== null && typeof e.error === 'object' && 'name' in e.error && typeof e.error.name === 'string';
82
+ }
83
+ function protocolError(code, name, message) {
84
+ return new AimuxError({ kind: 'protocol', code, message, error: { name, message } });
173
85
  }
@@ -0,0 +1,75 @@
1
+ export declare const ABI_VERSION: 65536;
2
+ export declare const OPS_VERSION: "1.0";
3
+ export declare const MANIFEST_DIGEST: "f9dfc54b56ca53561ae73e11fa84ff4dd7371f7a4082e1adf9c2c389183de6f4";
4
+ export declare const OP_ABORT_CREATE: "abort.create";
5
+ export declare const OP_ABORT_SIGNAL: "abort.signal";
6
+ export declare const OP_AUTH_CODEX_REFRESH: "auth.codexRefresh";
7
+ export declare const OP_CATALOGUE_FETCH: "catalogue.fetch";
8
+ export declare const OP_COMPOSITE_MOA: "composite.moa";
9
+ export declare const OP_COMPOSITE_ROUTER: "composite.router";
10
+ export declare const OP_CREDENTIAL_CREATE: "credential.create";
11
+ export declare const OP_DECISION_CAPABILITIES: "decision.capabilities";
12
+ export declare const OP_DECISION_DECIDE: "decision.decide";
13
+ export declare const OP_EMBEDDING_EMBED: "embedding.embed";
14
+ export declare const OP_EMBEDDING_EMBED_MANY: "embedding.embedMany";
15
+ export declare const OP_FILES_UPLOAD: "files.upload";
16
+ export declare const OP_HANDLE_DROP: "handle.drop";
17
+ export declare const OP_IMAGE_GENERATE: "image.generate";
18
+ export declare const OP_MIDDLEWARE_CREATE: "middleware.create";
19
+ export declare const OP_MODEL_INFO: "model.info";
20
+ export declare const OP_MODEL_RESOLVE: "model.resolve";
21
+ export declare const OP_MODEL_WRAP: "model.wrap";
22
+ export declare const OP_OPERATION_CANCEL: "operation.cancel";
23
+ export declare const OP_OPERATION_INPUT_DONE: "operation.inputDone";
24
+ export declare const OP_OPERATION_NEXT: "operation.next";
25
+ export declare const OP_OPERATION_PUSH: "operation.push";
26
+ export declare const OP_OPERATION_STATUS: "operation.status";
27
+ export declare const OP_OUTPUT_TO_OPEN_AI: "output.toOpenAI";
28
+ export declare const OP_PROVIDER_CREATE: "provider.create";
29
+ export declare const OP_PROVIDER_CUSTOM: "provider.custom";
30
+ export declare const OP_PROVIDER_DEFAULT: "provider.default";
31
+ export declare const OP_PROVIDER_FILES: "provider.files";
32
+ export declare const OP_PROVIDER_INVOKE: "provider.invoke";
33
+ export declare const OP_PROVIDER_MODEL: "provider.model";
34
+ export declare const OP_PROVIDER_WRAP: "provider.wrap";
35
+ export declare const OP_RECORDER_ATTACH: "recorder.attach";
36
+ export declare const OP_RECORDER_CREATE: "recorder.create";
37
+ export declare const OP_RECORDER_EXPORT: "recorder.export";
38
+ export declare const OP_RECORDER_FLUSH: "recorder.flush";
39
+ export declare const OP_RECORDER_STATS: "recorder.stats";
40
+ export declare const OP_RECORDER_STOP: "recorder.stop";
41
+ export declare const OP_REGISTRY_CREATE: "registry.create";
42
+ export declare const OP_REGISTRY_PROVIDER: "registry.provider";
43
+ export declare const OP_REPLAY_CAPABILITIES: "replay.capabilities";
44
+ export declare const OP_REPLAY_CREATE: "replay.create";
45
+ export declare const OP_REPLAY_DRY_RUN: "replay.dryRun";
46
+ export declare const OP_REPLAY_INSPECT: "replay.inspect";
47
+ export declare const OP_REPLAY_LIVE: "replay.live";
48
+ export declare const OP_RERANKING_RERANK: "reranking.rerank";
49
+ export declare const OP_RUNTIME_CONFIGURE: "runtime.configure";
50
+ export declare const OP_RUNTIME_DESCRIBE: "runtime.describe";
51
+ export declare const OP_SEARCH_SEARCH: "search.search";
52
+ export declare const OP_SESSION_STORE_ATTACH: "sessionStore.attach";
53
+ export declare const OP_SESSION_STORE_CALLS: "sessionStore.calls";
54
+ export declare const OP_SESSION_STORE_CREATE: "sessionStore.create";
55
+ export declare const OP_SESSION_STORE_LIST: "sessionStore.list";
56
+ export declare const OP_SPEECH_GENERATE: "speech.generate";
57
+ export declare const OP_TEXT_CONSUME: "text.consume";
58
+ export declare const OP_TEXT_GENERATE: "text.generate";
59
+ export declare const OP_TEXT_GENERATE_OBJECT: "text.generateObject";
60
+ export declare const OP_TEXT_GENERATE_OPEN_AI: "text.generateOpenAI";
61
+ export declare const OP_TEXT_STREAM: "text.stream";
62
+ export declare const OP_TEXT_STREAM_OPEN_AI: "text.streamOpenAI";
63
+ export declare const OP_TOOL_REPAIR_APPLY: "toolRepair.apply";
64
+ export declare const OP_TOOL_REPAIR_APPLY_RESULT: "toolRepair.applyResult";
65
+ export declare const OP_TOOL_REPAIR_CONTEXT: "toolRepair.context";
66
+ export declare const OP_TRACE_AGGREGATE: "trace.aggregate";
67
+ export declare const OP_TRACE_CLEAR: "trace.clear";
68
+ export declare const OP_TRACE_CREATE: "trace.create";
69
+ export declare const OP_TRACE_EXPORT: "trace.export";
70
+ export declare const OP_TRACE_SESSION_CHAIN: "trace.sessionChain";
71
+ export declare const OP_TRACE_SESSION_TRAJECTORY: "trace.sessionTrajectory";
72
+ export declare const OP_TRANSCRIPTION_GENERATE: "transcription.generate";
73
+ export declare const OP_TRANSCRIPTION_START: "transcription.start";
74
+ export declare const OP_TRANSPORT_CREATE: "transport.create";
75
+ export declare const OP_VIDEO_GENERATE: "video.generate";
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OP_RUNTIME_DESCRIBE = exports.OP_RUNTIME_CONFIGURE = exports.OP_RERANKING_RERANK = exports.OP_REPLAY_LIVE = exports.OP_REPLAY_INSPECT = exports.OP_REPLAY_DRY_RUN = exports.OP_REPLAY_CREATE = exports.OP_REPLAY_CAPABILITIES = exports.OP_REGISTRY_PROVIDER = exports.OP_REGISTRY_CREATE = exports.OP_RECORDER_STOP = exports.OP_RECORDER_STATS = exports.OP_RECORDER_FLUSH = exports.OP_RECORDER_EXPORT = exports.OP_RECORDER_CREATE = exports.OP_RECORDER_ATTACH = exports.OP_PROVIDER_WRAP = exports.OP_PROVIDER_MODEL = exports.OP_PROVIDER_INVOKE = exports.OP_PROVIDER_FILES = exports.OP_PROVIDER_DEFAULT = exports.OP_PROVIDER_CUSTOM = exports.OP_PROVIDER_CREATE = exports.OP_OUTPUT_TO_OPEN_AI = exports.OP_OPERATION_STATUS = exports.OP_OPERATION_PUSH = exports.OP_OPERATION_NEXT = exports.OP_OPERATION_INPUT_DONE = exports.OP_OPERATION_CANCEL = exports.OP_MODEL_WRAP = exports.OP_MODEL_RESOLVE = exports.OP_MODEL_INFO = exports.OP_MIDDLEWARE_CREATE = exports.OP_IMAGE_GENERATE = exports.OP_HANDLE_DROP = exports.OP_FILES_UPLOAD = exports.OP_EMBEDDING_EMBED_MANY = exports.OP_EMBEDDING_EMBED = exports.OP_DECISION_DECIDE = exports.OP_DECISION_CAPABILITIES = exports.OP_CREDENTIAL_CREATE = exports.OP_COMPOSITE_ROUTER = exports.OP_COMPOSITE_MOA = exports.OP_CATALOGUE_FETCH = exports.OP_AUTH_CODEX_REFRESH = exports.OP_ABORT_SIGNAL = exports.OP_ABORT_CREATE = exports.MANIFEST_DIGEST = exports.OPS_VERSION = exports.ABI_VERSION = void 0;
4
+ exports.OP_VIDEO_GENERATE = exports.OP_TRANSPORT_CREATE = exports.OP_TRANSCRIPTION_START = exports.OP_TRANSCRIPTION_GENERATE = exports.OP_TRACE_SESSION_TRAJECTORY = exports.OP_TRACE_SESSION_CHAIN = exports.OP_TRACE_EXPORT = exports.OP_TRACE_CREATE = exports.OP_TRACE_CLEAR = exports.OP_TRACE_AGGREGATE = exports.OP_TOOL_REPAIR_CONTEXT = exports.OP_TOOL_REPAIR_APPLY_RESULT = exports.OP_TOOL_REPAIR_APPLY = exports.OP_TEXT_STREAM_OPEN_AI = exports.OP_TEXT_STREAM = exports.OP_TEXT_GENERATE_OPEN_AI = exports.OP_TEXT_GENERATE_OBJECT = exports.OP_TEXT_GENERATE = exports.OP_TEXT_CONSUME = exports.OP_SPEECH_GENERATE = exports.OP_SESSION_STORE_LIST = exports.OP_SESSION_STORE_CREATE = exports.OP_SESSION_STORE_CALLS = exports.OP_SESSION_STORE_ATTACH = exports.OP_SEARCH_SEARCH = void 0;
5
+ // Generated by aimux-codegen. Do not edit. Manifest SHA-256: f9dfc54b56ca53561ae73e11fa84ff4dd7371f7a4082e1adf9c2c389183de6f4
6
+ exports.ABI_VERSION = 65536;
7
+ exports.OPS_VERSION = "1.0";
8
+ exports.MANIFEST_DIGEST = "f9dfc54b56ca53561ae73e11fa84ff4dd7371f7a4082e1adf9c2c389183de6f4";
9
+ exports.OP_ABORT_CREATE = "abort.create";
10
+ exports.OP_ABORT_SIGNAL = "abort.signal";
11
+ exports.OP_AUTH_CODEX_REFRESH = "auth.codexRefresh";
12
+ exports.OP_CATALOGUE_FETCH = "catalogue.fetch";
13
+ exports.OP_COMPOSITE_MOA = "composite.moa";
14
+ exports.OP_COMPOSITE_ROUTER = "composite.router";
15
+ exports.OP_CREDENTIAL_CREATE = "credential.create";
16
+ exports.OP_DECISION_CAPABILITIES = "decision.capabilities";
17
+ exports.OP_DECISION_DECIDE = "decision.decide";
18
+ exports.OP_EMBEDDING_EMBED = "embedding.embed";
19
+ exports.OP_EMBEDDING_EMBED_MANY = "embedding.embedMany";
20
+ exports.OP_FILES_UPLOAD = "files.upload";
21
+ exports.OP_HANDLE_DROP = "handle.drop";
22
+ exports.OP_IMAGE_GENERATE = "image.generate";
23
+ exports.OP_MIDDLEWARE_CREATE = "middleware.create";
24
+ exports.OP_MODEL_INFO = "model.info";
25
+ exports.OP_MODEL_RESOLVE = "model.resolve";
26
+ exports.OP_MODEL_WRAP = "model.wrap";
27
+ exports.OP_OPERATION_CANCEL = "operation.cancel";
28
+ exports.OP_OPERATION_INPUT_DONE = "operation.inputDone";
29
+ exports.OP_OPERATION_NEXT = "operation.next";
30
+ exports.OP_OPERATION_PUSH = "operation.push";
31
+ exports.OP_OPERATION_STATUS = "operation.status";
32
+ exports.OP_OUTPUT_TO_OPEN_AI = "output.toOpenAI";
33
+ exports.OP_PROVIDER_CREATE = "provider.create";
34
+ exports.OP_PROVIDER_CUSTOM = "provider.custom";
35
+ exports.OP_PROVIDER_DEFAULT = "provider.default";
36
+ exports.OP_PROVIDER_FILES = "provider.files";
37
+ exports.OP_PROVIDER_INVOKE = "provider.invoke";
38
+ exports.OP_PROVIDER_MODEL = "provider.model";
39
+ exports.OP_PROVIDER_WRAP = "provider.wrap";
40
+ exports.OP_RECORDER_ATTACH = "recorder.attach";
41
+ exports.OP_RECORDER_CREATE = "recorder.create";
42
+ exports.OP_RECORDER_EXPORT = "recorder.export";
43
+ exports.OP_RECORDER_FLUSH = "recorder.flush";
44
+ exports.OP_RECORDER_STATS = "recorder.stats";
45
+ exports.OP_RECORDER_STOP = "recorder.stop";
46
+ exports.OP_REGISTRY_CREATE = "registry.create";
47
+ exports.OP_REGISTRY_PROVIDER = "registry.provider";
48
+ exports.OP_REPLAY_CAPABILITIES = "replay.capabilities";
49
+ exports.OP_REPLAY_CREATE = "replay.create";
50
+ exports.OP_REPLAY_DRY_RUN = "replay.dryRun";
51
+ exports.OP_REPLAY_INSPECT = "replay.inspect";
52
+ exports.OP_REPLAY_LIVE = "replay.live";
53
+ exports.OP_RERANKING_RERANK = "reranking.rerank";
54
+ exports.OP_RUNTIME_CONFIGURE = "runtime.configure";
55
+ exports.OP_RUNTIME_DESCRIBE = "runtime.describe";
56
+ exports.OP_SEARCH_SEARCH = "search.search";
57
+ exports.OP_SESSION_STORE_ATTACH = "sessionStore.attach";
58
+ exports.OP_SESSION_STORE_CALLS = "sessionStore.calls";
59
+ exports.OP_SESSION_STORE_CREATE = "sessionStore.create";
60
+ exports.OP_SESSION_STORE_LIST = "sessionStore.list";
61
+ exports.OP_SPEECH_GENERATE = "speech.generate";
62
+ exports.OP_TEXT_CONSUME = "text.consume";
63
+ exports.OP_TEXT_GENERATE = "text.generate";
64
+ exports.OP_TEXT_GENERATE_OBJECT = "text.generateObject";
65
+ exports.OP_TEXT_GENERATE_OPEN_AI = "text.generateOpenAI";
66
+ exports.OP_TEXT_STREAM = "text.stream";
67
+ exports.OP_TEXT_STREAM_OPEN_AI = "text.streamOpenAI";
68
+ exports.OP_TOOL_REPAIR_APPLY = "toolRepair.apply";
69
+ exports.OP_TOOL_REPAIR_APPLY_RESULT = "toolRepair.applyResult";
70
+ exports.OP_TOOL_REPAIR_CONTEXT = "toolRepair.context";
71
+ exports.OP_TRACE_AGGREGATE = "trace.aggregate";
72
+ exports.OP_TRACE_CLEAR = "trace.clear";
73
+ exports.OP_TRACE_CREATE = "trace.create";
74
+ exports.OP_TRACE_EXPORT = "trace.export";
75
+ exports.OP_TRACE_SESSION_CHAIN = "trace.sessionChain";
76
+ exports.OP_TRACE_SESSION_TRAJECTORY = "trace.sessionTrajectory";
77
+ exports.OP_TRANSCRIPTION_GENERATE = "transcription.generate";
78
+ exports.OP_TRANSCRIPTION_START = "transcription.start";
79
+ exports.OP_TRANSPORT_CREATE = "transport.create";
80
+ exports.OP_VIDEO_GENERATE = "video.generate";