@arcships/aimux 0.2.1 → 0.3.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 (146) hide show
  1. package/dist/error.d.ts +71 -0
  2. package/dist/error.js +173 -0
  3. package/dist/index.d.ts +132 -5
  4. package/dist/index.js +281 -24
  5. package/dist/types/AiMuxError.d.ts +29 -15
  6. package/dist/types/AiMuxError.js +0 -1
  7. package/dist/types/ApiCallError.d.ts +65 -0
  8. package/dist/types/ApiCallError.js +3 -0
  9. package/dist/types/BreakKind.d.ts +1 -0
  10. package/dist/types/BreakKind.js +3 -0
  11. package/dist/types/CallOptions.d.ts +27 -1
  12. package/dist/types/CatalogueSource.d.ts +4 -0
  13. package/dist/types/CatalogueSource.js +3 -0
  14. package/dist/types/ChatCompletion.d.ts +16 -0
  15. package/dist/types/ChatCompletion.js +2 -0
  16. package/dist/types/ChatCompletionChoice.d.ts +8 -0
  17. package/dist/types/ChatCompletionChoice.js +2 -0
  18. package/dist/types/ChatCompletionChunk.d.ts +15 -0
  19. package/dist/types/ChatCompletionChunk.js +2 -0
  20. package/dist/types/ChatCompletionChunkChoice.d.ts +8 -0
  21. package/dist/types/ChatCompletionChunkChoice.js +2 -0
  22. package/dist/types/ChatCompletionChunkFunction.d.ts +4 -0
  23. package/dist/types/ChatCompletionChunkFunction.js +3 -0
  24. package/dist/types/ChatCompletionChunkToolCall.d.ts +7 -0
  25. package/dist/types/ChatCompletionChunkToolCall.js +2 -0
  26. package/dist/types/ChatCompletionDelta.d.ts +7 -0
  27. package/dist/types/ChatCompletionDelta.js +2 -0
  28. package/dist/types/ChatCompletionFunction.d.ts +4 -0
  29. package/dist/types/ChatCompletionFunction.js +3 -0
  30. package/dist/types/ChatCompletionMessage.d.ts +9 -0
  31. package/dist/types/ChatCompletionMessage.js +2 -0
  32. package/dist/types/ChatCompletionToolCall.d.ts +6 -0
  33. package/dist/types/ChatCompletionToolCall.js +2 -0
  34. package/dist/types/ChatCompletionUsage.d.ts +9 -0
  35. package/dist/types/ChatCompletionUsage.js +2 -0
  36. package/dist/types/CompletionTokensDetails.d.ts +3 -0
  37. package/dist/types/CompletionTokensDetails.js +3 -0
  38. package/dist/types/FilePart.d.ts +8 -0
  39. package/dist/types/FilePart.js +2 -0
  40. package/dist/types/Fingerprint.d.ts +21 -0
  41. package/dist/types/Fingerprint.js +3 -0
  42. package/dist/types/GenerateObjectResult.d.ts +48 -0
  43. package/dist/types/GenerateObjectResult.js +2 -0
  44. package/dist/types/GenerateTextOptions.d.ts +12 -1
  45. package/dist/types/GenerateTextResult.d.ts +47 -0
  46. package/dist/types/HttpExchange.d.ts +23 -0
  47. package/dist/types/HttpExchange.js +2 -0
  48. package/dist/types/HttpRecord.d.ts +12 -0
  49. package/dist/types/HttpRecord.js +3 -0
  50. package/dist/types/ImageCallOptions.d.ts +1 -1
  51. package/dist/types/InputRecord.d.ts +16 -0
  52. package/dist/types/InputRecord.js +2 -0
  53. package/dist/types/Modality.d.ts +4 -0
  54. package/dist/types/Modality.js +3 -0
  55. package/dist/types/ModelCapabilities.d.ts +21 -0
  56. package/dist/types/ModelCapabilities.js +3 -0
  57. package/dist/types/ModelCost.d.ts +10 -0
  58. package/dist/types/ModelCost.js +3 -0
  59. package/dist/types/ModelLimits.d.ts +17 -0
  60. package/dist/types/ModelLimits.js +3 -0
  61. package/dist/types/ModelModalities.d.ts +8 -0
  62. package/dist/types/ModelModalities.js +2 -0
  63. package/dist/types/ModelSpec.d.ts +33 -0
  64. package/dist/types/ModelSpec.js +2 -0
  65. package/dist/types/ModelType.d.ts +4 -0
  66. package/dist/types/ModelType.js +3 -0
  67. package/dist/types/OutcomeRecord.d.ts +14 -0
  68. package/dist/types/OutcomeRecord.js +2 -0
  69. package/dist/types/OutcomeStatus.d.ts +4 -0
  70. package/dist/types/OutcomeStatus.js +3 -0
  71. package/dist/types/PrefixBreak.d.ts +11 -0
  72. package/dist/types/PrefixBreak.js +2 -0
  73. package/dist/types/PromptTokensDetails.d.ts +4 -0
  74. package/dist/types/PromptTokensDetails.js +3 -0
  75. package/dist/types/ProviderAuditSpec.d.ts +33 -0
  76. package/dist/types/ProviderAuditSpec.js +2 -0
  77. package/dist/types/ProviderFamily.d.ts +5 -0
  78. package/dist/types/ProviderFamily.js +3 -0
  79. package/dist/types/ProviderRecord.d.ts +30 -0
  80. package/dist/types/ProviderRecord.js +2 -0
  81. package/dist/types/ReasoningMode.d.ts +4 -0
  82. package/dist/types/ReasoningMode.js +3 -0
  83. package/dist/types/ReasoningPart.d.ts +9 -0
  84. package/dist/types/ReasoningPart.js +3 -0
  85. package/dist/types/ReasoningSpec.d.ts +39 -0
  86. package/dist/types/ReasoningSpec.js +2 -0
  87. package/dist/types/ReasoningVisibility.d.ts +4 -0
  88. package/dist/types/ReasoningVisibility.js +3 -0
  89. package/dist/types/Recording.d.ts +56 -0
  90. package/dist/types/Recording.js +2 -0
  91. package/dist/types/RequestCacheHints.d.ts +9 -0
  92. package/dist/types/RequestCacheHints.js +3 -0
  93. package/dist/types/ResponseRecord.d.ts +13 -0
  94. package/dist/types/ResponseRecord.js +3 -0
  95. package/dist/types/RuntimeModel.d.ts +22 -0
  96. package/dist/types/RuntimeModel.js +3 -0
  97. package/dist/types/SessionCall.d.ts +20 -0
  98. package/dist/types/SessionCall.js +3 -0
  99. package/dist/types/SessionChainView.d.ts +10 -0
  100. package/dist/types/SessionChainView.js +2 -0
  101. package/dist/types/SessionSource.d.ts +4 -0
  102. package/dist/types/SessionSource.js +3 -0
  103. package/dist/types/SessionStepStat.d.ts +27 -0
  104. package/dist/types/SessionStepStat.js +2 -0
  105. package/dist/types/SessionView.d.ts +16 -0
  106. package/dist/types/SessionView.js +2 -0
  107. package/dist/types/SourcePart.d.ts +9 -0
  108. package/dist/types/SourcePart.js +3 -0
  109. package/dist/types/StreamTextResultAggregated.d.ts +74 -0
  110. package/dist/types/StreamTextResultAggregated.js +2 -0
  111. package/dist/types/TimeoutConfiguration.d.ts +10 -0
  112. package/dist/types/TimeoutConfiguration.js +1 -0
  113. package/dist/types/TimingRecord.d.ts +7 -0
  114. package/dist/types/TimingRecord.js +3 -0
  115. package/dist/types/TraceFilter.d.ts +9 -0
  116. package/dist/types/TraceFilter.js +3 -0
  117. package/dist/types/TraceRecord.d.ts +54 -0
  118. package/dist/types/TraceRecord.js +2 -0
  119. package/dist/types/TraceStats.d.ts +20 -0
  120. package/dist/types/TraceStats.js +3 -0
  121. package/dist/types/TranscriptionCallOptions.d.ts +29 -0
  122. package/dist/types/TranscriptionCallOptions.js +2 -0
  123. package/dist/types/TranscriptionRequest.d.ts +9 -0
  124. package/dist/types/TranscriptionRequest.js +3 -0
  125. package/dist/types/TranscriptionResponse.d.ts +24 -0
  126. package/dist/types/TranscriptionResponse.js +2 -0
  127. package/dist/types/TranscriptionResult.d.ts +46 -0
  128. package/dist/types/TranscriptionResult.js +2 -0
  129. package/dist/types/TranscriptionSegment.d.ts +17 -0
  130. package/dist/types/TranscriptionSegment.js +3 -0
  131. package/dist/types/TranscriptionStreamPart.d.ts +70 -0
  132. package/dist/types/TranscriptionStreamPart.js +2 -0
  133. package/dist/types/UsageSnapshot.d.ts +18 -0
  134. package/dist/types/UsageSnapshot.js +2 -0
  135. package/dist/types/Verdict.d.ts +23 -0
  136. package/dist/types/Verdict.js +2 -0
  137. package/dist/types/VerdictConfidence.d.ts +4 -0
  138. package/dist/types/VerdictConfidence.js +3 -0
  139. package/dist/types/VerdictKind.d.ts +4 -0
  140. package/dist/types/VerdictKind.js +3 -0
  141. package/dist/types/VideoCallOptions.d.ts +1 -1
  142. package/dist/types.d.ts +66 -1
  143. package/dist/types.js +3 -3
  144. package/index.d.ts +256 -25
  145. package/index.js +72 -54
  146. package/package.json +9 -8
@@ -0,0 +1,17 @@
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
+ };
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,70 @@
1
+ import type { TranscriptionSegment } from "./TranscriptionSegment";
2
+ import type { Warning } from "./Warning";
3
+ import type { JsonValue } from "./serde_json/JsonValue";
4
+ /**
5
+ * A single chunk in the stream returned by `do_stream`.
6
+ *
7
+ * Aligned with V4 `TranscriptionModelV4StreamPart`.
8
+ */
9
+ export type TranscriptionStreamPart = {
10
+ "StreamStart": {
11
+ warnings: Array<Warning>;
12
+ };
13
+ } | {
14
+ "TranscriptDelta": {
15
+ id: string | null;
16
+ delta: string;
17
+ provider_metadata: {
18
+ [key in string]: JsonValue;
19
+ } | null;
20
+ };
21
+ } | {
22
+ "TranscriptPartial": {
23
+ id: string | null;
24
+ text: string;
25
+ start_second: number | null;
26
+ duration_in_seconds: number | null;
27
+ channel_index: number | null;
28
+ provider_metadata: {
29
+ [key in string]: JsonValue;
30
+ } | null;
31
+ };
32
+ } | {
33
+ "TranscriptFinal": {
34
+ id: string | null;
35
+ text: string;
36
+ start_second: number | null;
37
+ end_second: number | null;
38
+ channel_index: number | null;
39
+ provider_metadata: {
40
+ [key in string]: JsonValue;
41
+ } | null;
42
+ };
43
+ } | {
44
+ "ResponseMetadata": {
45
+ timestamp: string | null;
46
+ model_id: string | null;
47
+ headers: {
48
+ [key in string]: string;
49
+ } | null;
50
+ body: JsonValue | null;
51
+ };
52
+ } | {
53
+ "Finish": {
54
+ text: string;
55
+ segments: Array<TranscriptionSegment>;
56
+ language: string | null;
57
+ duration_in_seconds: number | null;
58
+ provider_metadata: {
59
+ [key in string]: JsonValue;
60
+ } | null;
61
+ };
62
+ } | {
63
+ "Raw": {
64
+ raw_value: JsonValue;
65
+ };
66
+ } | {
67
+ "Error": {
68
+ error: JsonValue;
69
+ };
70
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import type { JsonValue } from "./serde_json/JsonValue";
2
+ /**
3
+ * Token usage snapshot (7 flat fields + raw passthrough).
4
+ */
5
+ export type UsageSnapshot = {
6
+ input_total: bigint | null;
7
+ input_no_cache: bigint | null;
8
+ cache_read: bigint | null;
9
+ cache_write: bigint | null;
10
+ output_total: bigint | null;
11
+ output_text: bigint | null;
12
+ output_reasoning: bigint | null;
13
+ /**
14
+ * Raw provider usage payload (opaque passthrough; numbers only — no
15
+ * prompt text).
16
+ */
17
+ raw?: JsonValue | null;
18
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import type { VerdictConfidence } from "./VerdictConfidence";
2
+ import type { VerdictKind } from "./VerdictKind";
3
+ /**
4
+ * A verdict for one call.
5
+ */
6
+ export type Verdict = {
7
+ kind: VerdictKind;
8
+ confidence: VerdictConfidence;
9
+ /**
10
+ * Violated rule ids (R-1.1 / R-1.2 / …).
11
+ */
12
+ violated: Array<string>;
13
+ /**
14
+ * Expected upper bound U (tokens).
15
+ */
16
+ expected_max: bigint;
17
+ claimed: bigint;
18
+ /**
19
+ * Client-side LCP (bytes).
20
+ */
21
+ lcp_bytes: bigint;
22
+ notes: Array<string>;
23
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Confidence level.
3
+ */
4
+ export type VerdictConfidence = "High" | "Medium" | "Low";
@@ -0,0 +1,3 @@
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 });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Verdict kinds (RFC-0015 §4.1).
3
+ */
4
+ export type VerdictKind = "Trusted" | "SuspectOverclaim" | "SuspectUnderclaim" | "Unknown";
@@ -0,0 +1,3 @@
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 });
@@ -37,7 +37,7 @@ export type VideoCallOptions = {
37
37
  /**
38
38
  * Seed for deterministic generation. `None` uses a random seed.
39
39
  */
40
- seed: bigint | null;
40
+ seed: number | null;
41
41
  /**
42
42
  * Input image for image-to-video generation (the starting frame).
43
43
  */
package/dist/types.d.ts CHANGED
@@ -1,9 +1,24 @@
1
1
  export type * from './types/AiMuxError';
2
+ export type * from './types/ApiCallError';
2
3
  export type * from './types/AspectRatio';
3
4
  export type * from './types/AudioChunk';
4
5
  export type * from './types/AudioData';
5
6
  export type * from './types/AudioInput';
7
+ export type * from './types/BreakKind';
6
8
  export type * from './types/CallOptions';
9
+ export type * from './types/CatalogueSource';
10
+ export type * from './types/ChatCompletion';
11
+ export type * from './types/ChatCompletionChoice';
12
+ export type * from './types/ChatCompletionChunk';
13
+ export type * from './types/ChatCompletionChunkChoice';
14
+ export type * from './types/ChatCompletionChunkFunction';
15
+ export type * from './types/ChatCompletionChunkToolCall';
16
+ export type * from './types/ChatCompletionDelta';
17
+ export type * from './types/ChatCompletionFunction';
18
+ export type * from './types/ChatCompletionMessage';
19
+ export type * from './types/ChatCompletionToolCall';
20
+ export type * from './types/ChatCompletionUsage';
21
+ export type * from './types/CompletionTokensDetails';
7
22
  export type * from './types/ContentPart';
8
23
  export type * from './types/EmbeddingCallOptions';
9
24
  export type * from './types/EmbeddingResponse';
@@ -11,13 +26,18 @@ export type * from './types/EmbeddingResult';
11
26
  export type * from './types/EmbeddingUsage';
12
27
  export type * from './types/FileBytes';
13
28
  export type * from './types/FileData';
29
+ export type * from './types/FilePart';
30
+ export type * from './types/Fingerprint';
14
31
  export type * from './types/FinishReason';
15
32
  export type * from './types/FinishReasonUnified';
16
33
  export type * from './types/FunctionTool';
17
34
  export type * from './types/GenerateContent';
35
+ export type * from './types/GenerateObjectResult';
18
36
  export type * from './types/GenerateResult';
19
37
  export type * from './types/GenerateTextOptions';
20
38
  export type * from './types/GenerateTextResult';
39
+ export type * from './types/HttpExchange';
40
+ export type * from './types/HttpRecord';
21
41
  export type * from './types/ImageCallOptions';
22
42
  export type * from './types/ImageFile';
23
43
  export type * from './types/ImageFileData';
@@ -26,13 +46,35 @@ export type * from './types/ImageResponse';
26
46
  export type * from './types/ImageResult';
27
47
  export type * from './types/ImageUsage';
28
48
  export type * from './types/InputAudioFormat';
49
+ export type * from './types/InputRecord';
29
50
  export type * from './types/LanguageModelPromptMessage';
30
51
  export type * from './types/MessageContent';
52
+ export type * from './types/Modality';
53
+ export type * from './types/ModelCapabilities';
54
+ export type * from './types/ModelCost';
31
55
  export type * from './types/ModelId';
56
+ export type * from './types/ModelLimits';
32
57
  export type * from './types/ModelMessage';
58
+ export type * from './types/ModelModalities';
33
59
  export type * from './types/ModelPrompt';
60
+ export type * from './types/ModelSpec';
61
+ export type * from './types/ModelType';
62
+ export type * from './types/OutcomeRecord';
63
+ export type * from './types/OutcomeStatus';
64
+ export type * from './types/PrefixBreak';
65
+ export type * from './types/PromptTokensDetails';
66
+ export type * from './types/ProviderAuditSpec';
67
+ export type * from './types/ProviderFamily';
68
+ export type * from './types/ProviderRecord';
34
69
  export type * from './types/ProviderTool';
35
70
  export type * from './types/ReasoningEffort';
71
+ export type * from './types/ReasoningMode';
72
+ export type * from './types/ReasoningPart';
73
+ export type * from './types/ReasoningSpec';
74
+ export type * from './types/ReasoningVisibility';
75
+ export type * from './types/Recording';
76
+ export type * from './types/RequestCacheHints';
77
+ export type * from './types/RequestInfo';
36
78
  export type * from './types/RerankingCallOptions';
37
79
  export type * from './types/RerankingDocuments';
38
80
  export type * from './types/RerankingRank';
@@ -41,27 +83,50 @@ export type * from './types/RerankingResult';
41
83
  export type * from './types/ResponseFormat';
42
84
  export type * from './types/ResponseInfo';
43
85
  export type * from './types/ResponseMetadata';
86
+ export type * from './types/ResponseRecord';
44
87
  export type * from './types/Role';
88
+ export type * from './types/RuntimeModel';
45
89
  export type * from './types/SearchCallOptions';
46
90
  export type * from './types/SearchResponse';
47
91
  export type * from './types/SearchResult';
48
92
  export type * from './types/SearchResultItem';
93
+ export type * from './types/SessionCall';
94
+ export type * from './types/SessionChainView';
95
+ export type * from './types/SessionSource';
96
+ export type * from './types/SessionStepStat';
97
+ export type * from './types/SessionView';
49
98
  export type * from './types/Size';
99
+ export type * from './types/SourcePart';
50
100
  export type * from './types/SpeechCallOptions';
51
101
  export type * from './types/SpeechRequest';
52
102
  export type * from './types/SpeechResponse';
53
103
  export type * from './types/SpeechResult';
54
104
  export type * from './types/StreamPart';
105
+ export type * from './types/StreamTextResultAggregated';
55
106
  export type * from './types/TimeoutConfiguration';
107
+ export type * from './types/TimingRecord';
56
108
  export type * from './types/TokenUsage';
57
109
  export type * from './types/Tool';
58
110
  export type * from './types/ToolCall';
59
111
  export type * from './types/ToolChoice';
60
112
  export type * from './types/ToolResult';
113
+ export type * from './types/TraceFilter';
114
+ export type * from './types/TraceRecord';
115
+ export type * from './types/TraceStats';
116
+ export type * from './types/TranscriptionCallOptions';
117
+ export type * from './types/TranscriptionRequest';
118
+ export type * from './types/TranscriptionResponse';
119
+ export type * from './types/TranscriptionResult';
120
+ export type * from './types/TranscriptionSegment';
121
+ export type * from './types/TranscriptionStreamPart';
61
122
  export type * from './types/UploadFileCallOptions';
62
123
  export type * from './types/UploadFileData';
63
124
  export type * from './types/UploadFileResult';
64
125
  export type * from './types/Usage';
126
+ export type * from './types/UsageSnapshot';
127
+ export type * from './types/Verdict';
128
+ export type * from './types/VerdictConfidence';
129
+ export type * from './types/VerdictKind';
65
130
  export type * from './types/VideoCallOptions';
66
131
  export type * from './types/VideoData';
67
132
  export type * from './types/VideoFile';
@@ -71,4 +136,4 @@ export type * from './types/VideoFrameType';
71
136
  export type * from './types/VideoResponse';
72
137
  export type * from './types/VideoResult';
73
138
  export type * from './types/Warning';
74
- export type * from './types/RequestInfo';
139
+ export type * from './types/serde_json/JsonValue';
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Re-export all ts-rs generated types.
3
- // These are auto-generated from the Rust core types via ts-rs.
4
- // Run `cargo test -p aimux-core` to regenerate after Rust type changes.
2
+ // Re-export all ts-rs generated types from bindings/node/src/types/.
3
+ // Generated by scripts/gen_ts_types.py — do not edit manually.
4
+ // Run scripts/gen_ts_types.py to regenerate after Rust type changes.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });