@arcships/aimux 0.2.0 → 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.
- package/LICENSE +21 -0
- package/dist/error.d.ts +71 -0
- package/dist/error.js +173 -0
- package/dist/index.d.ts +132 -5
- package/dist/index.js +282 -24
- package/dist/types/AiMuxError.d.ts +29 -15
- package/dist/types/AiMuxError.js +0 -1
- package/dist/types/ApiCallError.d.ts +65 -0
- package/dist/types/ApiCallError.js +3 -0
- package/dist/types/BreakKind.d.ts +1 -0
- package/dist/types/BreakKind.js +3 -0
- package/dist/types/CallOptions.d.ts +27 -1
- package/dist/types/CatalogueSource.d.ts +4 -0
- package/dist/types/CatalogueSource.js +3 -0
- package/dist/types/ChatCompletion.d.ts +16 -0
- package/dist/types/ChatCompletion.js +2 -0
- package/dist/types/ChatCompletionChoice.d.ts +8 -0
- package/dist/types/ChatCompletionChoice.js +2 -0
- package/dist/types/ChatCompletionChunk.d.ts +15 -0
- package/dist/types/ChatCompletionChunk.js +2 -0
- package/dist/types/ChatCompletionChunkChoice.d.ts +8 -0
- package/dist/types/ChatCompletionChunkChoice.js +2 -0
- package/dist/types/ChatCompletionChunkFunction.d.ts +4 -0
- package/dist/types/ChatCompletionChunkFunction.js +3 -0
- package/dist/types/ChatCompletionChunkToolCall.d.ts +7 -0
- package/dist/types/ChatCompletionChunkToolCall.js +2 -0
- package/dist/types/ChatCompletionDelta.d.ts +7 -0
- package/dist/types/ChatCompletionDelta.js +2 -0
- package/dist/types/ChatCompletionFunction.d.ts +4 -0
- package/dist/types/ChatCompletionFunction.js +3 -0
- package/dist/types/ChatCompletionMessage.d.ts +9 -0
- package/dist/types/ChatCompletionMessage.js +2 -0
- package/dist/types/ChatCompletionToolCall.d.ts +6 -0
- package/dist/types/ChatCompletionToolCall.js +2 -0
- package/dist/types/ChatCompletionUsage.d.ts +9 -0
- package/dist/types/ChatCompletionUsage.js +2 -0
- package/dist/types/CompletionTokensDetails.d.ts +3 -0
- package/dist/types/CompletionTokensDetails.js +3 -0
- package/dist/types/FilePart.d.ts +8 -0
- package/dist/types/FilePart.js +2 -0
- package/dist/types/Fingerprint.d.ts +21 -0
- package/dist/types/Fingerprint.js +3 -0
- package/dist/types/GenerateObjectResult.d.ts +48 -0
- package/dist/types/GenerateObjectResult.js +2 -0
- package/dist/types/GenerateTextOptions.d.ts +12 -1
- package/dist/types/GenerateTextResult.d.ts +47 -0
- package/dist/types/HttpExchange.d.ts +23 -0
- package/dist/types/HttpExchange.js +2 -0
- package/dist/types/HttpRecord.d.ts +12 -0
- package/dist/types/HttpRecord.js +3 -0
- package/dist/types/ImageCallOptions.d.ts +1 -1
- package/dist/types/InputRecord.d.ts +16 -0
- package/dist/types/InputRecord.js +2 -0
- package/dist/types/Modality.d.ts +4 -0
- package/dist/types/Modality.js +3 -0
- package/dist/types/ModelCapabilities.d.ts +21 -0
- package/dist/types/ModelCapabilities.js +3 -0
- package/dist/types/ModelCost.d.ts +10 -0
- package/dist/types/ModelCost.js +3 -0
- package/dist/types/ModelLimits.d.ts +17 -0
- package/dist/types/ModelLimits.js +3 -0
- package/dist/types/ModelModalities.d.ts +8 -0
- package/dist/types/ModelModalities.js +2 -0
- package/dist/types/ModelSpec.d.ts +33 -0
- package/dist/types/ModelSpec.js +2 -0
- package/dist/types/ModelType.d.ts +4 -0
- package/dist/types/ModelType.js +3 -0
- package/dist/types/OutcomeRecord.d.ts +14 -0
- package/dist/types/OutcomeRecord.js +2 -0
- package/dist/types/OutcomeStatus.d.ts +4 -0
- package/dist/types/OutcomeStatus.js +3 -0
- package/dist/types/PrefixBreak.d.ts +11 -0
- package/dist/types/PrefixBreak.js +2 -0
- package/dist/types/PromptTokensDetails.d.ts +4 -0
- package/dist/types/PromptTokensDetails.js +3 -0
- package/dist/types/ProviderAuditSpec.d.ts +33 -0
- package/dist/types/ProviderAuditSpec.js +2 -0
- package/dist/types/ProviderFamily.d.ts +5 -0
- package/dist/types/ProviderFamily.js +3 -0
- package/dist/types/ProviderName.d.ts +1 -0
- package/dist/types/ProviderName.js +1 -0
- package/dist/types/ProviderRecord.d.ts +30 -0
- package/dist/types/ProviderRecord.js +2 -0
- package/dist/types/ReasoningMode.d.ts +4 -0
- package/dist/types/ReasoningMode.js +3 -0
- package/dist/types/ReasoningPart.d.ts +9 -0
- package/dist/types/ReasoningPart.js +3 -0
- package/dist/types/ReasoningSpec.d.ts +39 -0
- package/dist/types/ReasoningSpec.js +2 -0
- package/dist/types/ReasoningVisibility.d.ts +4 -0
- package/dist/types/ReasoningVisibility.js +3 -0
- package/dist/types/Recording.d.ts +56 -0
- package/dist/types/Recording.js +2 -0
- package/dist/types/RequestCacheHints.d.ts +9 -0
- package/dist/types/RequestCacheHints.js +3 -0
- package/dist/types/ResponseRecord.d.ts +13 -0
- package/dist/types/ResponseRecord.js +3 -0
- package/dist/types/RuntimeModel.d.ts +22 -0
- package/dist/types/RuntimeModel.js +3 -0
- package/dist/types/SessionCall.d.ts +20 -0
- package/dist/types/SessionCall.js +3 -0
- package/dist/types/SessionChainView.d.ts +10 -0
- package/dist/types/SessionChainView.js +2 -0
- package/dist/types/SessionSource.d.ts +4 -0
- package/dist/types/SessionSource.js +3 -0
- package/dist/types/SessionStepStat.d.ts +27 -0
- package/dist/types/SessionStepStat.js +2 -0
- package/dist/types/SessionView.d.ts +16 -0
- package/dist/types/SessionView.js +2 -0
- package/dist/types/SourcePart.d.ts +9 -0
- package/dist/types/SourcePart.js +3 -0
- package/dist/types/StreamTextResultAggregated.d.ts +74 -0
- package/dist/types/StreamTextResultAggregated.js +2 -0
- package/dist/types/TimeoutConfiguration.d.ts +10 -0
- package/dist/types/TimeoutConfiguration.js +1 -0
- package/dist/types/TimingRecord.d.ts +7 -0
- package/dist/types/TimingRecord.js +3 -0
- package/dist/types/TraceFilter.d.ts +9 -0
- package/dist/types/TraceFilter.js +3 -0
- package/dist/types/TraceRecord.d.ts +54 -0
- package/dist/types/TraceRecord.js +2 -0
- package/dist/types/TraceStats.d.ts +20 -0
- package/dist/types/TraceStats.js +3 -0
- package/dist/types/TranscriptionCallOptions.d.ts +29 -0
- package/dist/types/TranscriptionCallOptions.js +2 -0
- package/dist/types/TranscriptionRequest.d.ts +9 -0
- package/dist/types/TranscriptionRequest.js +3 -0
- package/dist/types/TranscriptionResponse.d.ts +24 -0
- package/dist/types/TranscriptionResponse.js +2 -0
- package/dist/types/TranscriptionResult.d.ts +46 -0
- package/dist/types/TranscriptionResult.js +2 -0
- package/dist/types/TranscriptionSegment.d.ts +17 -0
- package/dist/types/TranscriptionSegment.js +3 -0
- package/dist/types/TranscriptionStreamPart.d.ts +70 -0
- package/dist/types/TranscriptionStreamPart.js +2 -0
- package/dist/types/UsageSnapshot.d.ts +18 -0
- package/dist/types/UsageSnapshot.js +2 -0
- package/dist/types/Verdict.d.ts +23 -0
- package/dist/types/Verdict.js +2 -0
- package/dist/types/VerdictConfidence.d.ts +4 -0
- package/dist/types/VerdictConfidence.js +3 -0
- package/dist/types/VerdictKind.d.ts +4 -0
- package/dist/types/VerdictKind.js +3 -0
- package/dist/types/VideoCallOptions.d.ts +1 -1
- package/dist/types.d.ts +66 -1
- package/dist/types.js +3 -3
- package/index.d.ts +322 -53
- package/index.js +81 -54
- package/package.json +9 -8
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChatCompletionToolCall } from "./ChatCompletionToolCall";
|
|
2
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
+
export type ChatCompletionMessage = {
|
|
4
|
+
role: string;
|
|
5
|
+
content: string | null;
|
|
6
|
+
reasoning_content: string | null;
|
|
7
|
+
tool_calls: Array<ChatCompletionToolCall> | null;
|
|
8
|
+
annotations: Array<JsonValue> | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CompletionTokensDetails } from "./CompletionTokensDetails";
|
|
2
|
+
import type { PromptTokensDetails } from "./PromptTokensDetails";
|
|
3
|
+
export type ChatCompletionUsage = {
|
|
4
|
+
prompt_tokens: number;
|
|
5
|
+
completion_tokens: number;
|
|
6
|
+
total_tokens: number;
|
|
7
|
+
prompt_tokens_details: PromptTokensDetails | null;
|
|
8
|
+
completion_tokens_details: CompletionTokensDetails | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialized-wire fingerprint stored in a `TraceRecord` (hex strings —
|
|
3
|
+
* `u128` is not JSON-serializable).
|
|
4
|
+
*/
|
|
5
|
+
export type Fingerprint = {
|
|
6
|
+
/**
|
|
7
|
+
* 128-bit hash of the whole denoised body (hex).
|
|
8
|
+
*/
|
|
9
|
+
body_hash: string;
|
|
10
|
+
len_bytes: bigint;
|
|
11
|
+
block_size: bigint;
|
|
12
|
+
/**
|
|
13
|
+
* Block-hash chain (hex), one entry per block.
|
|
14
|
+
*/
|
|
15
|
+
block_hashes: Array<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Token estimate — byte proxy `len_bytes / 4` when no tokenizer is
|
|
18
|
+
* attached (RFC-0015 §4.1: W capped at one block in this mode).
|
|
19
|
+
*/
|
|
20
|
+
token_estimate: bigint;
|
|
21
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FinishReason } from "./FinishReason";
|
|
2
|
+
import type { GenerateTextResult } from "./GenerateTextResult";
|
|
3
|
+
import type { ResponseMetadata } from "./ResponseMetadata";
|
|
4
|
+
import type { Usage } from "./Usage";
|
|
5
|
+
import type { Warning } from "./Warning";
|
|
6
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
7
|
+
/**
|
|
8
|
+
* Result of `generate_object` (user-facing, M12). The parsed JSON object plus
|
|
9
|
+
* convenience fields from the underlying `generate_text` call.
|
|
10
|
+
*/
|
|
11
|
+
export type GenerateObjectResult = {
|
|
12
|
+
/**
|
|
13
|
+
* The parsed JSON object returned by the model.
|
|
14
|
+
*/
|
|
15
|
+
object: JsonValue;
|
|
16
|
+
/**
|
|
17
|
+
* Why generation stopped.
|
|
18
|
+
*/
|
|
19
|
+
finish_reason: FinishReason;
|
|
20
|
+
/**
|
|
21
|
+
* Raw provider-specific finish reason string.
|
|
22
|
+
*/
|
|
23
|
+
raw_finish_reason: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Token usage.
|
|
26
|
+
*/
|
|
27
|
+
usage: Usage;
|
|
28
|
+
/**
|
|
29
|
+
* Warnings from the provider.
|
|
30
|
+
*/
|
|
31
|
+
warnings: Array<Warning>;
|
|
32
|
+
/**
|
|
33
|
+
* Concatenated reasoning text (if the model produced reasoning/thinking).
|
|
34
|
+
*/
|
|
35
|
+
reasoning: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Provider-specific metadata (e.g. Anthropic cache info).
|
|
38
|
+
*/
|
|
39
|
+
provider_metadata: JsonValue | null;
|
|
40
|
+
/**
|
|
41
|
+
* Response metadata (id, timestamp, model_id).
|
|
42
|
+
*/
|
|
43
|
+
response: ResponseMetadata;
|
|
44
|
+
/**
|
|
45
|
+
* The full `generate_text` result (for advanced use).
|
|
46
|
+
*/
|
|
47
|
+
raw: GenerateTextResult;
|
|
48
|
+
};
|
|
@@ -19,7 +19,7 @@ export type GenerateTextOptions = {
|
|
|
19
19
|
presence_penalty: number | null;
|
|
20
20
|
frequency_penalty: number | null;
|
|
21
21
|
response_format: ResponseFormat | null;
|
|
22
|
-
seed:
|
|
22
|
+
seed: number | null;
|
|
23
23
|
tools: Array<Tool> | null;
|
|
24
24
|
tool_choice: ToolChoice | null;
|
|
25
25
|
headers: {
|
|
@@ -48,4 +48,15 @@ export type GenerateTextOptions = {
|
|
|
48
48
|
* Per-call timeout configuration (total / first-chunk / chunk idle).
|
|
49
49
|
*/
|
|
50
50
|
timeout: TimeoutConfiguration | null;
|
|
51
|
+
/**
|
|
52
|
+
* Session identifier, for grouping consecutive calls into a session
|
|
53
|
+
* (observability, see RFC-0024). Orthogonal to RFC-0019 session-affinity
|
|
54
|
+
* headers. When `None` and the optional session inferer is enabled, one
|
|
55
|
+
* may be inferred from prompt-prefix continuation.
|
|
56
|
+
*/
|
|
57
|
+
session_id: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Emit raw provider stream chunks as `StreamPart::Raw` (debugging aid).
|
|
60
|
+
*/
|
|
61
|
+
include_raw_chunks: boolean | null;
|
|
51
62
|
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { FilePart } from "./FilePart";
|
|
1
2
|
import type { FinishReason } from "./FinishReason";
|
|
2
3
|
import type { GenerateResult } from "./GenerateResult";
|
|
4
|
+
import type { ModelMessage } from "./ModelMessage";
|
|
5
|
+
import type { ReasoningPart } from "./ReasoningPart";
|
|
6
|
+
import type { ResponseMetadata } from "./ResponseMetadata";
|
|
7
|
+
import type { SourcePart } from "./SourcePart";
|
|
3
8
|
import type { ToolCall } from "./ToolCall";
|
|
4
9
|
import type { Usage } from "./Usage";
|
|
5
10
|
import type { Warning } from "./Warning";
|
|
11
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
6
12
|
/**
|
|
7
13
|
* Result of `generate_text` (user-facing).
|
|
8
14
|
*/
|
|
@@ -31,4 +37,45 @@ export type GenerateTextResult = {
|
|
|
31
37
|
* Raw provider result (for advanced use).
|
|
32
38
|
*/
|
|
33
39
|
raw: GenerateResult;
|
|
40
|
+
/**
|
|
41
|
+
* Reasoning / thinking segments from the model.
|
|
42
|
+
*/
|
|
43
|
+
reasoning: Array<ReasoningPart>;
|
|
44
|
+
/**
|
|
45
|
+
* Concatenated reasoning text (convenience for `reasoning.iter().map(text).join("")`).
|
|
46
|
+
*/
|
|
47
|
+
reasoning_text: string;
|
|
48
|
+
/**
|
|
49
|
+
* Sources / citations (search-preview models).
|
|
50
|
+
*/
|
|
51
|
+
sources: Array<SourcePart>;
|
|
52
|
+
/**
|
|
53
|
+
* Files generated by the model.
|
|
54
|
+
*/
|
|
55
|
+
files: Array<FilePart>;
|
|
56
|
+
/**
|
|
57
|
+
* Assistant messages ready to append to the prompt for the next turn
|
|
58
|
+
* (solves the multi-turn "manually build assistant message" footgun).
|
|
59
|
+
*/
|
|
60
|
+
response_messages: Array<ModelMessage>;
|
|
61
|
+
/**
|
|
62
|
+
* The raw provider-specific finish reason string (e.g. "stop",
|
|
63
|
+
* "end_turn", "safety"). Useful when `finish_reason.unified` is `Other`.
|
|
64
|
+
*/
|
|
65
|
+
raw_finish_reason: string | null;
|
|
66
|
+
/**
|
|
67
|
+
* Provider-specific metadata (e.g. Anthropic cache info). Mirrored from
|
|
68
|
+
* `raw.provider_metadata` for top-level convenience.
|
|
69
|
+
*/
|
|
70
|
+
provider_metadata: JsonValue | null;
|
|
71
|
+
/**
|
|
72
|
+
* Response metadata (id, timestamp, model_id). Mirrored from
|
|
73
|
+
* `raw.response` for top-level convenience.
|
|
74
|
+
*/
|
|
75
|
+
response: ResponseMetadata;
|
|
76
|
+
/**
|
|
77
|
+
* Total token usage across all steps. In single-step mode (aimux's
|
|
78
|
+
* default), `total_usage` equals `usage`. Provided for AI SDK parity.
|
|
79
|
+
*/
|
|
80
|
+
total_usage: Usage;
|
|
34
81
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HttpRecord } from "./HttpRecord";
|
|
2
|
+
import type { ResponseRecord } from "./ResponseRecord";
|
|
3
|
+
import type { TimingRecord } from "./TimingRecord";
|
|
4
|
+
/**
|
|
5
|
+
* ③ HTTP 侧:单次 attempt 的 wire 交换。
|
|
6
|
+
*/
|
|
7
|
+
export type HttpExchange = {
|
|
8
|
+
/**
|
|
9
|
+
* 第几次重试(0=首次);per-attempt 递增。
|
|
10
|
+
*/
|
|
11
|
+
attempt: number;
|
|
12
|
+
request: HttpRecord;
|
|
13
|
+
/**
|
|
14
|
+
* None = 请求失败未获响应。
|
|
15
|
+
*/
|
|
16
|
+
response: ResponseRecord | null;
|
|
17
|
+
timing: TimingRecord;
|
|
18
|
+
error: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* 流式:该 exchange 是否已终结(收到 response 补全)。非流式恒 true。
|
|
21
|
+
*/
|
|
22
|
+
finalized: boolean;
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type HttpRecord = {
|
|
2
|
+
method: string;
|
|
3
|
+
url: string;
|
|
4
|
+
/**
|
|
5
|
+
* 敏感头(authorization/cookie/含 api-key/key/x-amz-security-token 等)已脱敏为 "\[REDACTED\]"。
|
|
6
|
+
*/
|
|
7
|
+
headers: Array<[string, string]>;
|
|
8
|
+
/**
|
|
9
|
+
* 明文(脱敏后);None = 无 body。
|
|
10
|
+
*/
|
|
11
|
+
body: string | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LanguageModelPromptMessage } from "./LanguageModelPromptMessage";
|
|
2
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
+
/**
|
|
4
|
+
* ① 输入侧:完整调用参数,足以重建 generate_text 调用。
|
|
5
|
+
*/
|
|
6
|
+
export type InputRecord = {
|
|
7
|
+
/**
|
|
8
|
+
* 完整 prompt(消息数组,含 ContentPart::Image 等多模态)。
|
|
9
|
+
*/
|
|
10
|
+
prompt: Array<LanguageModelPromptMessage>;
|
|
11
|
+
/**
|
|
12
|
+
* 序列化的 CallOptions(abort_signal/call_id 已 serde skip);
|
|
13
|
+
* headers/provider_options/body_overrides 已递归脱敏。
|
|
14
|
+
*/
|
|
15
|
+
options: JsonValue;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-level capability flags (more precise than provider-level `supports_*`).
|
|
3
|
+
*/
|
|
4
|
+
export type ModelCapabilities = {
|
|
5
|
+
/**
|
|
6
|
+
* Supports function/tool calling.
|
|
7
|
+
*/
|
|
8
|
+
tool_call: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Supports structured / JSON-schema output.
|
|
11
|
+
*/
|
|
12
|
+
structured_output: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Accepts a `temperature` parameter.
|
|
15
|
+
*/
|
|
16
|
+
temperature: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Accepts multimodal attachments (image/audio/pdf input).
|
|
19
|
+
*/
|
|
20
|
+
attachment: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing (advisory, read-only metadata). Units follow the source catalog
|
|
3
|
+
* (anya2a uses USD per 1M tokens).
|
|
4
|
+
*/
|
|
5
|
+
export type ModelCost = {
|
|
6
|
+
input?: number | null;
|
|
7
|
+
output?: number | null;
|
|
8
|
+
cache_read?: number | null;
|
|
9
|
+
cache_write?: number | null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token / request limits for a model.
|
|
3
|
+
*/
|
|
4
|
+
export type ModelLimits = {
|
|
5
|
+
/**
|
|
6
|
+
* Maximum total context window (input + output), in tokens.
|
|
7
|
+
*/
|
|
8
|
+
context?: number | null;
|
|
9
|
+
/**
|
|
10
|
+
* Maximum output tokens.
|
|
11
|
+
*/
|
|
12
|
+
output?: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum input tokens (when distinct from `context`).
|
|
15
|
+
*/
|
|
16
|
+
input?: number | null;
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CatalogueSource } from "./CatalogueSource";
|
|
2
|
+
import type { ModelCapabilities } from "./ModelCapabilities";
|
|
3
|
+
import type { ModelCost } from "./ModelCost";
|
|
4
|
+
import type { ModelLimits } from "./ModelLimits";
|
|
5
|
+
import type { ModelModalities } from "./ModelModalities";
|
|
6
|
+
import type { ModelType } from "./ModelType";
|
|
7
|
+
import type { ReasoningSpec } from "./ReasoningSpec";
|
|
8
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
9
|
+
/**
|
|
10
|
+
* The full static portrait for a model, supplemented from community knowledge.
|
|
11
|
+
*
|
|
12
|
+
* All fields are advisory — aimux never auto-applies them in the request path.
|
|
13
|
+
* The caller reads them to decide how to configure `GenerateTextOptions` /
|
|
14
|
+
* `bodyOverrides`.
|
|
15
|
+
*/
|
|
16
|
+
export type ModelSpec = {
|
|
17
|
+
display_name?: string | null;
|
|
18
|
+
type: ModelType;
|
|
19
|
+
limits: ModelLimits;
|
|
20
|
+
modalities: ModelModalities;
|
|
21
|
+
capabilities: ModelCapabilities;
|
|
22
|
+
reasoning?: ReasoningSpec | null;
|
|
23
|
+
cost?: ModelCost | null;
|
|
24
|
+
source: CatalogueSource;
|
|
25
|
+
/**
|
|
26
|
+
* Provider name (normalized to aimux registry spelling).
|
|
27
|
+
*/
|
|
28
|
+
provider?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Verbatim source entry, preserved for forward compatibility / debugging.
|
|
31
|
+
*/
|
|
32
|
+
raw?: JsonValue | null;
|
|
33
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OutcomeStatus } from "./OutcomeStatus";
|
|
2
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
3
|
+
/**
|
|
4
|
+
* 最终结果摘要。
|
|
5
|
+
*/
|
|
6
|
+
export type OutcomeRecord = {
|
|
7
|
+
status: OutcomeStatus;
|
|
8
|
+
finish_reason: string | null;
|
|
9
|
+
error: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* 序列化的 Usage。
|
|
12
|
+
*/
|
|
13
|
+
usage: JsonValue | null;
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BreakKind } from "./BreakKind";
|
|
2
|
+
/**
|
|
3
|
+
* A prefix break between two consecutive records of a session.
|
|
4
|
+
*/
|
|
5
|
+
export type PrefixBreak = {
|
|
6
|
+
at_record_id: string;
|
|
7
|
+
prev_record_id: string;
|
|
8
|
+
lcp_bytes: bigint;
|
|
9
|
+
expected_break: boolean;
|
|
10
|
+
kind: BreakKind;
|
|
11
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ProviderFamily } from "./ProviderFamily";
|
|
2
|
+
/**
|
|
3
|
+
* Provider audit parameters (RFC-0015 §7 matrix — the part that lives in
|
|
4
|
+
* core; display logic belongs to the CLI).
|
|
5
|
+
*/
|
|
6
|
+
export type ProviderAuditSpec = {
|
|
7
|
+
/**
|
|
8
|
+
* Provider family for family-specific invariants.
|
|
9
|
+
*/
|
|
10
|
+
family: ProviderFamily;
|
|
11
|
+
/**
|
|
12
|
+
* Token quantization granularity; `None` = no quantization.
|
|
13
|
+
*/
|
|
14
|
+
gran: bigint | null;
|
|
15
|
+
/**
|
|
16
|
+
* Minimum cache threshold (tokens): below it `claimed` must be 0.
|
|
17
|
+
*/
|
|
18
|
+
threshold: bigint;
|
|
19
|
+
/**
|
|
20
|
+
* TTL_idle (ms), conservative upper bound.
|
|
21
|
+
*/
|
|
22
|
+
ttl_ms: bigint;
|
|
23
|
+
/**
|
|
24
|
+
* gpt-5.6+ semantics (no quantization, implicit-breakpoint whitelist,
|
|
25
|
+
* write/read equality).
|
|
26
|
+
*/
|
|
27
|
+
model56plus: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Claimed-hit ceiling: above this multiple of the client upper bound
|
|
30
|
+
* the verdict is overclaim (W) even in shared mode. `None` = use U+τ.
|
|
31
|
+
*/
|
|
32
|
+
shared_ceiling_mult: number | null;
|
|
33
|
+
};
|
|
@@ -109,6 +109,7 @@ export declare const ProviderName: {
|
|
|
109
109
|
readonly inception: "inception";
|
|
110
110
|
readonly inceptron: "inceptron";
|
|
111
111
|
readonly inference_net: "inference_net";
|
|
112
|
+
readonly inferencehub: "inferencehub";
|
|
112
113
|
readonly inferx: "inferx";
|
|
113
114
|
readonly infinity: "infinity";
|
|
114
115
|
readonly io_net: "io_net";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JsonValue } from "./serde_json/JsonValue";
|
|
2
|
+
/**
|
|
3
|
+
* ② 配置侧:provider 身份(请求回放重建用)。
|
|
4
|
+
*/
|
|
5
|
+
export type ProviderRecord = {
|
|
6
|
+
/**
|
|
7
|
+
* `model.provider()`,如 "openai"。
|
|
8
|
+
*/
|
|
9
|
+
provider: string;
|
|
10
|
+
/**
|
|
11
|
+
* `model.model_id()`,如 "gpt-4o"。
|
|
12
|
+
*/
|
|
13
|
+
model_id: string;
|
|
14
|
+
/**
|
|
15
|
+
* provider 的 base_url。
|
|
16
|
+
*/
|
|
17
|
+
base_url: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* api_key 来源(不存明文):"env:OPENAI_API_KEY" / "explicit" / "none" / "unknown"。
|
|
20
|
+
*/
|
|
21
|
+
api_key_source: string;
|
|
22
|
+
/**
|
|
23
|
+
* OpenAICompatProfile(能力差异)。
|
|
24
|
+
*/
|
|
25
|
+
profile: JsonValue | null;
|
|
26
|
+
/**
|
|
27
|
+
* ProviderOptions(headers/org/project/...;已脱敏)。
|
|
28
|
+
*/
|
|
29
|
+
provider_options: JsonValue | null;
|
|
30
|
+
};
|