@acosmi/sdk-ts 2.19.3 → 2.19.5
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/CHANGELOG.md +22 -0
- package/README.md +27 -2
- package/dist/browser/index.mjs +537 -372
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.mjs +537 -372
- package/dist/index.mjs.map +1 -1
- package/dist/node/adapters/anthropic.cjs +0 -7
- package/dist/node/adapters/anthropic.cjs.map +1 -1
- package/dist/node/adapters/anthropic.d.cts +1 -1
- package/dist/node/adapters/anthropic.d.ts +1 -1
- package/dist/node/adapters/anthropic.mjs +0 -7
- package/dist/node/adapters/anthropic.mjs.map +1 -1
- package/dist/node/adapters/openai.cjs +114 -24
- package/dist/node/adapters/openai.cjs.map +1 -1
- package/dist/node/adapters/openai.d.cts +2 -2
- package/dist/node/adapters/openai.d.ts +2 -2
- package/dist/node/adapters/openai.mjs +114 -24
- package/dist/node/adapters/openai.mjs.map +1 -1
- package/dist/node/{index-CqxPqbsl.d.cts → format-DWA12pVT.d.cts} +35 -27
- package/dist/node/{index-CqxPqbsl.d.ts → format-DWA12pVT.d.ts} +35 -27
- package/dist/node/index.cjs +538 -371
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +157 -16
- package/dist/node/index.d.ts +157 -16
- package/dist/node/index.mjs +537 -372
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{openai-mkTSir6E.d.ts → openai-Cuu_DPxM.d.cts} +34 -4
- package/dist/node/{openai-Ce85qh14.d.cts → openai-DsbJUOOW.d.ts} +34 -4
- package/package.json +1 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as AnthropicResponse } from './openai-
|
|
2
|
-
export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-
|
|
3
|
-
import { M as ManagedModel, Q as QuotaSummary,
|
|
4
|
-
export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, R as RerankDocument,
|
|
1
|
+
import { a as AnthropicResponse } from './openai-DsbJUOOW.js';
|
|
2
|
+
export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-DsbJUOOW.js';
|
|
3
|
+
import { P as ProviderAdapter, M as ManagedModel, Q as QuotaSummary, Y as WindowResetSummary, n as ModelCapabilities, e as ChatRequest, f as ChatResponse, I as ImageGenerationRequest, k as ImageGenerationResponse, V as VideoGenerationRequest, N as VideoTaskResponse, i as EmbeddingRequest, j as EmbeddingResponse, s as RerankRequest, t as RerankResponse, z as StreamEvent, w as SourcesEvent, A as StreamSettlement, l as InputModality } from './format-DWA12pVT.js';
|
|
4
|
+
export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, h as EmbeddingData, G as GeoLoc, m as InputModalityTag, o as MultimodalContent, O as OutputConfig, p as ProviderFormat, q as QuotaSummarySubscriptionPool, R as RerankDocument, r as RerankQuery, u as RerankResult, S as ServerTool, v as ServerToolTypeWebSearch, x as SourcesEventIssueCode, y as SourcesEventParseResult, T as ThinkingConfig, D as ThinkingHigh, F as ThinkingHighMinMaxTokens, H as ThinkingLow, J as ThinkingMax, K as ThinkingMaxFallbackMaxTokens, L as ThinkingOff, W as WebSearchConfig, U as WebSearchSource, X as WindowLimitStatus, Z as bucketInfoIsCommercial, _ as bucketRowIsCommercial, $ as classifySourcesEvent, a0 as newThinkingConfig, a1 as newWebSearchTool, a2 as parseSettlement, a3 as parseSourcesEvent } from './format-DWA12pVT.js';
|
|
5
5
|
import { M as MinimalSanitizeConfig } from './index-Bah9A83R.js';
|
|
6
6
|
export { A as sanitize } from './index-Bah9A83R.js';
|
|
7
7
|
export { AnthropicAdapter } from './adapters/anthropic.js';
|
|
@@ -190,7 +190,10 @@ declare class FileTokenStore implements TokenStore {
|
|
|
190
190
|
/**
|
|
191
191
|
* 跨进程临界区. 用 sidecar `<path>.lock` 文件 + O_EXCL 创建语义实现互斥:
|
|
192
192
|
* - 创建成功 = 持有锁; 写入 pid+timestamp 便于诊断
|
|
193
|
-
* - 创建失败 (EEXIST) = 别的进程持锁, backoff 重试
|
|
193
|
+
* - 创建失败 (EEXIST) = 别的进程持锁, stale 检测后 backoff 重试
|
|
194
|
+
* - 创建失败 (Windows 的 EPERM / EBUSY) = 前一持有者的 unlink 处于 delete-pending,
|
|
195
|
+
* 同属争用; 跳过 stale 检测直接 backoff 重试 (见 catch 内注释)。EACCES 不在其中 —
|
|
196
|
+
* 它是真权限错误, 立即抛
|
|
194
197
|
* - 锁文件 mtime > staleMs = 进程崩溃残留, unlink 后重试
|
|
195
198
|
* - acquireTimeoutMs 超时 = 抛错 (caller 应作为 transient error 处理, 上层 retry)
|
|
196
199
|
*
|
|
@@ -730,6 +733,32 @@ declare function effectivePolicy(p: RetryPolicy | null | undefined): Required<Re
|
|
|
730
733
|
*/
|
|
731
734
|
declare function computeBackoff(p: Required<RetryPolicy>, attempt: number, err: unknown): number;
|
|
732
735
|
|
|
736
|
+
/**
|
|
737
|
+
* 根据 provider 返回对应的 adapter (v0.5.0 遗留 API, 向后兼容)
|
|
738
|
+
* 新代码应使用 getAdapterForModel
|
|
739
|
+
*/
|
|
740
|
+
declare function getAdapter(provider: string): ProviderAdapter;
|
|
741
|
+
/**
|
|
742
|
+
* 按 ManagedModel 的 preferred_format / supported_formats 选择 adapter
|
|
743
|
+
*
|
|
744
|
+
* 决策顺序:
|
|
745
|
+
* 1. preferred_format 非空 **且** 该格式在 supported_formats 内 (或 supported_formats 未声明)
|
|
746
|
+
* → 按其值返回 (anthropic | openai)
|
|
747
|
+
* 2. supported_formats 含 "anthropic" → AnthropicAdapter
|
|
748
|
+
* 3. supported_formats 含 "openai" → OpenAIAdapter
|
|
749
|
+
* 4. 两字段均空 (旧上游) → 回落 provider 名硬编码 (原 getAdapter 行为)
|
|
750
|
+
*
|
|
751
|
+
* 这使得 dashscope / zhipu / deepseek 等 provider 的模型如果上游启用了
|
|
752
|
+
* Anthropic 兼容端点, 也能走 /anthropic 路径, 不再被 provider 字符串硬编码到 /chat
|
|
753
|
+
* 导致 tool_reference 400.
|
|
754
|
+
*
|
|
755
|
+
* [格式一致性护栏 2026-05-29] preferred_format 仅在确被 supported_formats 收录时才采信:
|
|
756
|
+
* 防止上游元数据漂移 (preferred_format=anthropic 但 supported_formats=[openai]) 把 SDK
|
|
757
|
+
* 路由到模型并不支持的格式端点 (撞 /anthropic "未绑定 Anthropic" 4xx)。这是网关侧
|
|
758
|
+
* "同 model_id 双 profile 选行" 根因修复在 SDK 侧的同构护栏。
|
|
759
|
+
*/
|
|
760
|
+
declare function getAdapterForModel(m: ManagedModel): ProviderAdapter;
|
|
761
|
+
|
|
733
762
|
type FilterStatus = 'ok' | 'admin-bypass' | 'internal-bypass' | 'disabled-by-flag' | 'fallback-tkdist-error' | 'fallback-tkdist-deployment-skew' | 'fallback-no-buckets' | 'fallback-missing-userid' | '';
|
|
734
763
|
declare const FilterStatusOK: FilterStatus;
|
|
735
764
|
declare const FilterStatusAdminBypass: FilterStatus;
|
|
@@ -887,7 +916,7 @@ declare const ErrOAuthCORSBlocked: "oauth_cors_blocked";
|
|
|
887
916
|
declare const ErrRefreshProxyFailed: "refresh_proxy_failed";
|
|
888
917
|
declare const ErrTokenExpired: "token_expired";
|
|
889
918
|
/**
|
|
890
|
-
* v1.6.0: chat / chatMessages
|
|
919
|
+
* v1.6.0: **非流式** chat / chatMessages (及 generateVideo 等生成端点) 的 per-request 超时上限。
|
|
891
920
|
*
|
|
892
921
|
* 上游 (如 DeepSeek) 在开始推理前可能持续保活长达 10 分钟; SDK 必须容纳
|
|
893
922
|
* "首字节前等待 + 推理 + 流式传输" 全程, 否则会在等待阶段误超时切断。
|
|
@@ -896,6 +925,12 @@ declare const ErrTokenExpired: "token_expired";
|
|
|
896
925
|
* 2026-08-06 导出: 供回归闸门按**符号**断言, 避免测试抄字面量后与本常量各自漂移
|
|
897
926
|
* (抄件断言恒绿 = 零覆盖)。消费方若要自定义更短预算, 传 signal 即可 —
|
|
898
927
|
* withRequestTimeout 取二者先到者, 无需读本值。
|
|
928
|
+
*
|
|
929
|
+
* ⚠️ 2.19.5 勘误: 本注释此前把 `chatStream` / `chatMessagesStream` 也列了进来, 但那两条
|
|
930
|
+
* 流式链路从来没有武装过这个预算 —— `chatStreamGen` / `chatMessagesStreamGen` 把调用方的
|
|
931
|
+
* `signal` 直接交给 fetch, 全程零 SDK 计时器 (这正是 `DEFAULT_API_TIMEOUT_MS` 注释里
|
|
932
|
+
* "流式 / 下载等长连接路径**不**套此超时"的那条规矩)。流式的总预算现在由调用方用
|
|
933
|
+
* {@link ChatStreamOptions.requestTimeoutMs} 显式声明; 不声明 = 不武装, 与 2.19.4 逐字一致。
|
|
899
934
|
*/
|
|
900
935
|
declare const CHAT_REQUEST_TIMEOUT_MS: number;
|
|
901
936
|
/**
|
|
@@ -939,6 +974,37 @@ declare const GATEWAY_REQUEST_ID_HEADER = "X-Acosmi-Request-Id";
|
|
|
939
974
|
* 触发** —— 绝不合成占位值。回调抛错会被吞掉且不中断流 (旁路信号不该有能力杀死主链路)。
|
|
940
975
|
*/
|
|
941
976
|
type GatewayRequestIDCallback = (requestID: string) => void;
|
|
977
|
+
/**
|
|
978
|
+
* `chatStream` / `chatMessagesStream` 的可选项 (2.19.5 起)。
|
|
979
|
+
*
|
|
980
|
+
* 追加式: 作为两个方法的**末位**可选实参, 2.19.4 的调用方式一字不改仍然成立。
|
|
981
|
+
*/
|
|
982
|
+
interface ChatStreamOptions {
|
|
983
|
+
/**
|
|
984
|
+
* 这一次流的**总时长**预算 (毫秒), 从开始迭代算到流结束。
|
|
985
|
+
*
|
|
986
|
+
* **缺席 / 非有限正数 = 不武装任何计时器**, 与 2.19.4 逐字一致 (流式链路历来只受
|
|
987
|
+
* 调用方 `signal` 约束, 见 {@link CHAT_REQUEST_TIMEOUT_MS} 的勘误段)。
|
|
988
|
+
*
|
|
989
|
+
* 什么时候该传: 消费方自己按活性判死 (见 {@link UpstreamActivityCallback}) 时,
|
|
990
|
+
* 这一条是**安全网**而不是主判据 —— 它的职责是给"看门狗本身坏掉"兜底, 因此应当显著
|
|
991
|
+
* 长于活性预算。拿它当主判据 = 用"活得太久"杀一个健康的长任务。
|
|
992
|
+
*
|
|
993
|
+
* 与 `signal` 是"先到者生效", 不覆盖调用方自己的取消。
|
|
994
|
+
*/
|
|
995
|
+
requestTimeoutMs?: number;
|
|
996
|
+
/**
|
|
997
|
+
* 响应头回调 —— 在拿到响应之后、判断 `resp.ok` **之前**触发, 因此 HTTP 错误响应上同样
|
|
998
|
+
* 触发。位置与 `notifyGatewayRequestID` 逐行相同, 语义也相同 = **至多一次**: 触发了刷新
|
|
999
|
+
* 重试的那次 401 不算 (它在这一行之前就把控制权交给重试腿了), 真正开始流的那次响应算。
|
|
1000
|
+
*
|
|
1001
|
+
* 用途: 读网关随响应头下发的流控提示 (如 `X-Acosmi-Stream-Keepalive`, 秒) 来标定自己的
|
|
1002
|
+
* 空闲预算 —— 那个数只在头里, 等到流内事件时已经晚了 (最需要它的恰恰是零事件的流)。
|
|
1003
|
+
*
|
|
1004
|
+
* 与其它两个流式回调同构: 旁路信号, 回调抛错被吞掉且不中断流。
|
|
1005
|
+
*/
|
|
1006
|
+
onResponseHeaders?: (headers: Headers) => void;
|
|
1007
|
+
}
|
|
942
1008
|
/**
|
|
943
1009
|
* 非流式 JSON API 请求的默认超时 (毫秒)。
|
|
944
1010
|
*
|
|
@@ -1289,8 +1355,9 @@ declare class Client {
|
|
|
1289
1355
|
*
|
|
1290
1356
|
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1291
1357
|
* @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
|
|
1358
|
+
* @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
|
|
1292
1359
|
*/
|
|
1293
|
-
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback, onGatewayRequestID?: GatewayRequestIDCallback): AsyncIterable<StreamEvent>;
|
|
1360
|
+
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback, onGatewayRequestID?: GatewayRequestIDCallback, opts?: ChatStreamOptions): AsyncIterable<StreamEvent>;
|
|
1294
1361
|
/**
|
|
1295
1362
|
* Anthropic 原生格式流式聊天 (SSE)
|
|
1296
1363
|
* 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
|
|
@@ -1298,8 +1365,9 @@ declare class Client {
|
|
|
1298
1365
|
*
|
|
1299
1366
|
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1300
1367
|
* @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
|
|
1368
|
+
* @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
|
|
1301
1369
|
*/
|
|
1302
|
-
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback, onGatewayRequestID?: GatewayRequestIDCallback): AsyncIterable<StreamEvent>;
|
|
1370
|
+
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback, onGatewayRequestID?: GatewayRequestIDCallback, opts?: ChatStreamOptions): AsyncIterable<StreamEvent>;
|
|
1303
1371
|
private chatStreamGen;
|
|
1304
1372
|
private chatMessagesStreamGen;
|
|
1305
1373
|
/**
|
|
@@ -1546,8 +1614,10 @@ declare class NetworkError extends Error {
|
|
|
1546
1614
|
/**
|
|
1547
1615
|
* 流式失败事件的结构化表示。
|
|
1548
1616
|
*
|
|
1549
|
-
* 由 gateway 的 `managed_model_stream_failed`
|
|
1550
|
-
*
|
|
1617
|
+
* 由 gateway 的 `managed_model_stream_failed` 事件 (/chat 线 `event: failed`) 与
|
|
1618
|
+
* Anthropic 线的 `event: error` 帧解析得到 —— 两条线同一张字段表, 同一个解析点
|
|
1619
|
+
* (`core/http.ts::parseStreamError`)。客户端可通过 instanceof (同 realm) 或
|
|
1620
|
+
* `isStreamError` (跨 realm) 提取, 并按 code/retryable 决策。
|
|
1551
1621
|
*/
|
|
1552
1622
|
declare class StreamError extends Error {
|
|
1553
1623
|
/** 例: "empty_response" / "rate_limit" / "overloaded" / "" */
|
|
@@ -1560,8 +1630,23 @@ declare class StreamError extends Error {
|
|
|
1560
1630
|
userMessage: string;
|
|
1561
1631
|
/** gateway 原始 error 字符串 */
|
|
1562
1632
|
rawError: string;
|
|
1563
|
-
/** 客户端是否值得重试 */
|
|
1633
|
+
/** 客户端是否值得重试 (= 服务端 `retryable` **且** `requestDisposition === 'not_accepted'`) */
|
|
1564
1634
|
retryable: boolean;
|
|
1635
|
+
/**
|
|
1636
|
+
* 服务端在帧上声明的 `retryable` **原值** (2.19.5 起) —— 不与 requestDisposition 合取,
|
|
1637
|
+
* 缺席即 undefined。
|
|
1638
|
+
*
|
|
1639
|
+
* 为什么要并列存一份: 上面的 `retryable` 是两个判据的合取, 网关的流内错误帧并不总是
|
|
1640
|
+
* 下发 `requestDisposition`, 于是"服务端明说可重试"会被合取成 false —— 两端各自正确,
|
|
1641
|
+
* 合起来恒否。消费方要区分**「服务端明说不可重试」**(false, 一票否决) 与**「服务端没说」**
|
|
1642
|
+
* (undefined, 回落到自己的本地分类表) 时, 只能读这个原值; 读 `retryable` 两种情形不可分。
|
|
1643
|
+
*/
|
|
1644
|
+
serverRetryable?: boolean;
|
|
1645
|
+
/**
|
|
1646
|
+
* 服务端建议的等待秒数 (2.19.5 起)。**有限非负数**才收, 其余 (null / 负数 /
|
|
1647
|
+
* NaN / Infinity / 非数字) 一律 undefined —— 宁可不给, 绝不编造等待时间。
|
|
1648
|
+
*/
|
|
1649
|
+
retryAfterSecs?: number;
|
|
1565
1650
|
errorContractVersion?: number;
|
|
1566
1651
|
faultDomain?: FaultDomain;
|
|
1567
1652
|
requestDisposition?: RequestDisposition;
|
|
@@ -1574,6 +1659,7 @@ declare class StreamError extends Error {
|
|
|
1574
1659
|
message?: string;
|
|
1575
1660
|
rawError?: string;
|
|
1576
1661
|
retryable?: boolean;
|
|
1662
|
+
retryAfterSecs?: number | null;
|
|
1577
1663
|
errorContractVersion?: number;
|
|
1578
1664
|
faultDomain?: FaultDomain;
|
|
1579
1665
|
requestDisposition?: RequestDisposition;
|
|
@@ -1582,6 +1668,18 @@ declare class StreamError extends Error {
|
|
|
1582
1668
|
providerRequestId?: string | null;
|
|
1583
1669
|
});
|
|
1584
1670
|
}
|
|
1671
|
+
/**
|
|
1672
|
+
* StreamError 的**结构**判据 (2.19.5 起) —— 跨 realm 可用。
|
|
1673
|
+
*
|
|
1674
|
+
* 为什么不用 `instanceof`: 消费方 (如 CrabCode) 会在 worker / `vm` 上下文里消费这条错误,
|
|
1675
|
+
* 或者把 SDK 打进第二份 bundle; 两种情形下 `instanceof StreamError` 都静默为 false ——
|
|
1676
|
+
* 症状与"这段分类代码压根没写"逐字相同, 且不报错。
|
|
1677
|
+
*
|
|
1678
|
+
* 判据只认这条错误**自己**产生的两个不变量: `name === 'StreamError'` 与
|
|
1679
|
+
* `errorCode` 是字符串 (构造函数恒赋值, 缺 code 时为 `''`)。`HTTPError` 也有可选的
|
|
1680
|
+
* `errorCode`, 但 name 不同, 因此不会被误收。
|
|
1681
|
+
*/
|
|
1682
|
+
declare function isStreamError(err: unknown): err is StreamError;
|
|
1585
1683
|
type RequestDisposition = 'not_accepted' | 'accepted' | 'unknown';
|
|
1586
1684
|
type FaultDomain = 'user_auth' | 'caller_credentials' | 'account_quota' | 'account_permission' | 'provider' | 'gateway' | 'transport' | 'stream_ticket' | 'protocol';
|
|
1587
1685
|
interface GatewayErrorContract {
|
|
@@ -2043,8 +2141,20 @@ interface OpenAIChatResponse {
|
|
|
2043
2141
|
/** "chat.completion" */
|
|
2044
2142
|
object: string;
|
|
2045
2143
|
model: string;
|
|
2046
|
-
|
|
2047
|
-
|
|
2144
|
+
/**
|
|
2145
|
+
* [W-SDK-OPENAI-PARITY] 可空。与下面的 {@link OpenAIChatResponse.usage} 和
|
|
2146
|
+
* {@link OpenAIStreamChunk.choices} 是同一族「类型说它一定在、运行时它不在」——
|
|
2147
|
+
* 消费处 `oai.choices.length` 抛的 TypeError 会把整条响应打死, 连 `id` / `model` /
|
|
2148
|
+
* `usage` 这些确实到手的字段一起丢掉。缺席按空数组处理, 见 adapters/openai.ts。
|
|
2149
|
+
*/
|
|
2150
|
+
choices?: OpenAIChatChoice[];
|
|
2151
|
+
/**
|
|
2152
|
+
* [W-SDK-OPENAI-PARITY] 可空。类型此前声明为必填, 但线上确实存在不带 usage 的同步响应
|
|
2153
|
+
* (部分兼容实现不计量、网关裁剪过的响应)。与 {@link OpenAIStreamChunk.choices} 同一类
|
|
2154
|
+
* 「类型说它一定在、运行时它不在」—— 消费处 `oai.usage.prompt_tokens` 抛的 TypeError
|
|
2155
|
+
* 会把一个本可正常转换的响应整条打死。缺席时计数按 0, 见 adapters/openai.ts。
|
|
2156
|
+
*/
|
|
2157
|
+
usage?: OpenAIUsage;
|
|
2048
2158
|
}
|
|
2049
2159
|
interface OpenAIChatChoice {
|
|
2050
2160
|
index: number;
|
|
@@ -2085,11 +2195,42 @@ interface OpenAIStreamChunk {
|
|
|
2085
2195
|
* 正是那句 `chunk.choices.length` TypeError 的来源。消费处必须先判 Array.isArray。
|
|
2086
2196
|
*/
|
|
2087
2197
|
choices?: OpenAIStreamChoice[];
|
|
2088
|
-
|
|
2198
|
+
/**
|
|
2199
|
+
* [W-QUAD-CHAIN-20260914] 可空。按 `stream_options.include_usage: true` 的帧序, 非尾帧上为
|
|
2200
|
+
* null 或整个缺失, 带值的是 `[DONE]` 之前的尾帧 `{"choices":[],"usage":{...}}`;
|
|
2201
|
+
* 转换器同样接受 usage 与 finish_reason 同帧的形态。形状见 {@link OpenAIStreamUsage}。
|
|
2202
|
+
*/
|
|
2203
|
+
usage?: OpenAIStreamUsage | null;
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* 流式 chunk 上的 usage 对象。与同步响应的 {@link OpenAIUsage} 分开声明: 流式帧上各计数都可能
|
|
2207
|
+
* 缺席, 线上还带明细对象; 沿用 OpenAIUsage 等于把「三个计数一定在」的承诺强加给流式帧。
|
|
2208
|
+
*
|
|
2209
|
+
* SDK 只把 `prompt_tokens` / `completion_tokens` 搬成 `input_tokens` / `output_tokens`,
|
|
2210
|
+
* 与同步路径逐字相同。明细字段仅作类型声明: SDK 不映射、不做净额换算 —— usage 的语义归一只在网关。
|
|
2211
|
+
*/
|
|
2212
|
+
interface OpenAIStreamUsage {
|
|
2213
|
+
prompt_tokens?: number;
|
|
2214
|
+
completion_tokens?: number;
|
|
2215
|
+
total_tokens?: number;
|
|
2216
|
+
/** 上游输入明细 (如 `cached_tokens`); SDK 不读取 */
|
|
2217
|
+
prompt_tokens_details?: {
|
|
2218
|
+
cached_tokens?: number;
|
|
2219
|
+
};
|
|
2220
|
+
/** 上游输出明细 (如 `reasoning_tokens`); SDK 不读取 */
|
|
2221
|
+
completion_tokens_details?: {
|
|
2222
|
+
reasoning_tokens?: number;
|
|
2223
|
+
};
|
|
2089
2224
|
}
|
|
2090
2225
|
interface OpenAIStreamChoice {
|
|
2091
2226
|
index: number;
|
|
2092
|
-
|
|
2227
|
+
/**
|
|
2228
|
+
* [W-SDK-OPENAI-PARITY] 可空。与 {@link OpenAIStreamChunk.choices} 同一类问题: 兼容实现会发
|
|
2229
|
+
* `{"choices":[{"index":0}]}` 这种空心 choice。此前声明为必填, 消费处直接读
|
|
2230
|
+
* `choice.delta.reasoning_content` ⇒ TypeError 撕开整条 for-await 链, 整个回合失败。
|
|
2231
|
+
* 缺席按空 delta 处理 (零事件、不报错、不终止流), 见 adapters/openai.ts。
|
|
2232
|
+
*/
|
|
2233
|
+
delta?: OpenAIStreamDelta;
|
|
2093
2234
|
finish_reason: string | null;
|
|
2094
2235
|
}
|
|
2095
2236
|
interface OpenAIStreamDelta {
|
|
@@ -5471,4 +5612,4 @@ declare class ChatBridgeClient {
|
|
|
5471
5612
|
revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
|
|
5472
5613
|
}
|
|
5473
5614
|
|
|
5474
|
-
export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, type APIResponse, type AdapterKind, type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunListOptions, type AgentRunListResult, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRemoteCreateRequest, type AgentRunRunOptions, type AgentRunRuntime, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type ApiClientRef, type ApproveSealApprovalQuery, type AssignSeatRequest, type Audience, AudienceEnum, type AuthorizeResult, type BalanceDetail, type BalanceDetailEntitlement, type BillingMode, BillingModeEnum, type BillingPreflightResult, type BlockMeta, type BookConsultationRequest, type BridgeThreadRef, type BrowserRefreshMode, type BugReportResult, type BugView, BusinessError, type BuyResponse, type ByokCreateRequest, type ByokCredential, type ByokCredentialStatus, type ByokProvider, CHAT_REQUEST_TIMEOUT_MS, type CancelSealApprovalQuery, type CaseLead, type CaseMatter, type CertificationStatus, type ChannelAttachment, type ChannelCard, type ChannelCardAction, type ChannelInboundEvent, type ChannelOutboundEvent, ChatBridgeClient, type ChatBridgeSession, type ChatCredentialPublic, type ChatIntegration, ChatRequest, ChatResponse, type ChatThread, Client, type ClientRegistration, type ComplianceAssetType, type ComplianceBenefitType, type ComplianceBillingDisplayStatus, type ComplianceCapability, ComplianceClient, type ComplianceClientErrorCode, type ComplianceDigestSource, type ComplianceEnvelopeStatus, type ComplianceErrorInfo, type ComplianceErrorKey, type ComplianceHashAlgorithm, CompliancePollError, type CompliancePollOptions, type CompliancePrivacyLevel, type ComplianceProviderRequestStatus, type ComplianceProviderStatus, type ComplianceQuoteResponse, type ComplianceReport, type ComplianceScope, type ComplianceSealApprovalStatus, type ComplianceSku, type ComplianceTimestampVerificationStatus, type ComplianceWriteOptions, type Config, type ConsumeRecord, type ConsumeRecordPage, type ContractTemplateField, type ContractTemplateFieldType, type ContractTemplatePageItem, type ContractTemplateResp, type ContractTemplateStatus, type ContractTemplateVersion, type CorporateTransfer, CrabCodeByokClient, type CreateContractTemplateRequest, type CreateEvidenceAssetRequest, type CreateH5SigningUrlRequest, type CreateIntegrationRequest, type CreateReportRequest, type CreateSigningEnvelopeRequest, type CreateWebAuthorizationRequestOptions, type CredentialAuthorityConfig, type CredentialCASExpected, type CredentialCASResult, type CredentialLoginAttempt, type CredentialMutationReceipt, type CredentialPrincipal, type CredentialReason, type CredentialRef, type CredentialRefreshOperation, type CredentialRequestOwner, type CredentialSnapshot, type CredentialState, type CredentialStateNotification, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, type DeviceRegistration, EmbeddingRequest, EmbeddingResponse, type EnterpriseKycMyStatusView, type EnterpriseMember, type EnterpriseSummary, type EntitlementBalance, type EntitlementItem, type EnvelopeContractItem, ErrAuthDenied, ErrBillingCallbackCannotCommit, ErrBillingCommitRequiresLocalVerify, ErrBillingS2sForbidden, ErrBrowserOpen, ErrComplianceStepUpRequired, ErrDiscovery, ErrEnvelopeGateClosed, ErrOAuthCORSBlocked, ErrProviderNotConfigured, ErrProviderUnknownNoRetry, ErrRefreshProxyFailed, ErrRegistration, ErrSSLProxy, ErrSealApprovalContractHashMismatch, ErrSealApprovalExpired, ErrSealApprovalLocationMismatch, ErrSealApprovalNonceUsed, ErrSealApprovalNotApproved, ErrSealApprovalSealMismatch, ErrSealApprovalTransactorMismatch, ErrSealUseAlreadyConsumed, ErrStateMismatch, ErrTimeout, ErrTokenExchange, ErrTokenExpired, EventAuthURL, EventComplete, EventError, type EvidenceAsset, type EvidenceAssetPageItem, type EvidencePackage, type EvidencePackagePageItem, type FaultDomain, type FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GATEWAY_REQUEST_ID_HEADER, type GateQuota, type GatewayErrorContract, type GatewayRequestIDCallback, type GenerateSkillRequest, type GenerateSkillResult, HTTPError, type IdempotencyKey, IdempotencyKeyHeader, ImageGenerationRequest, ImageGenerationResponse, InMemoryTokenStore, type InitiateCorporateTransferInput, type InitiateCorporateTransferResult, InputModality, type IntegrationStatus, type InviteMemberRequest, type Invoice, type IssueTimestampRequest, type LawyerCredentialMyView, type LawyerSummary, type LegalConsultation, type LegalServiceOrder, type LegalServiceSku, type LegalSkuCode, type ListContractTemplatesRequest, type ListEvidenceAssetsRequest, type ListEvidencePackagesRequest, type ListOperationsRequest, type ListReportsRequest, type ListSealApprovalsRequest, type ListSealUsesRequest, type ListSigningEnvelopesRequest, type ListTimestampsRequest, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, type Membership, type ModelBucket, type ModelByQuotaResponse, ModelCapabilities, type ModelCoefficient, ModelNotFoundError, NetworkError, type Notification, type NotificationList, type NotificationPreference, type NotificationUnreadCount, type OAuthMetadataProfile, OAuthTokenEndpointError, type OpenAIChatChoice, type OpenAIChatMessage, type OpenAIChatResponse, type OpenAIFunctionCall, type OpenAIStreamChoice, type OpenAIStreamChunk, type OpenAIStreamDelta, type OpenAIStreamToolCall, type OpenAIToolCall, type OpenAIUsage, type OperationDetail, type OperationId, type OperationPageItem, type OperationSource, type OperationStatus, type OptimizeSkillRequest, type OptimizeSkillResult, type Order, type OrderListItem, type OrderStatus, OrderTerminalError, type OrgConsumeReport, type OrgSeat, type OrgSubscription, type PageRequest, type PageResult, type PayPayload, type PaymentMethod, type PermissionPolicy, type Platform, type PricingConfig, type PrincipalRef, type Product, type ProductFamily, ProductFamilyEnum, ProviderAdapter, type ProviderRequestStatus, type ProviderRequestStatusView, type PublicEvidenceVerifyResult, type PublicModelSummary, QuotaSummary, RETRY_ADVICE_REASONS, RateLimitError, type RefundPolicy, type RefundRecord, type Region, type RegionScope, RegionScopeEnum, type RegisterWebOAuthClientOptions, type RejectSealApprovalQuery, type RemoteControlDone, type RemoteControlError, type RemoteControlEvent, type RemoteControlEventType, type RemoteControlPermissionRequest, type RemoteControlPermissionResult, type RemoteControlReasoningDelta, type RemoteControlSettle, type RemoteControlStatus, type RemoteControlTextDelta, type RemoteControlToolCall, type RemoteControlToolResult, type RemoteControlUsage, type RemotePermissionDecision, type RemotePermissionResultRequest, type RemoteSessionPlacement, type RemoteSessionRef, type RemoteSessionTokenGrant, type RemoteUserMessageAck, type RemoteUserMessageRequest, type ReportDownload, type ReportPageItem, type ReqTimeoutCtl, type RequestDisposition, type RequestInvoiceInput, type RequestRefundInput, RerankRequest, RerankResponse, type RetryAdvice, type RetryAdviceReason, type RetryPolicy, type RetryRequestInfo, type RolloverPolicy, type RunnerKind, ScopeAI, ScopeAccount, ScopeAgentAccessManage, ScopeChatBridge, ScopeChatBridgeRead, ScopeChatBridgeRotate, ScopeChatBridgeWrite, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceContractTemplateRead, ScopeComplianceContractTemplateWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceReportsWrite, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeRemoteControl, ScopeRemoteControlAgentRun, ScopeRemoteControlPermissionResponse, ScopeRemoteControlSessionControl, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, type SealApproval, type SealApprovalPageItem, type SealUsePageItem, type ServerMetadata, type SignEnvelopeRequest, type SigningEnvelope, type SigningEnvelopePageItem, type SkillBrowseListResponse, type SkillBrowseResponse, type SkillStoreItem, type SkillStoreListItem, type SkillStoreQuery, type SkillSummary, type SortDirection, SourcesEvent, type StepUpStatus, type StoreCredentialRequest, StreamError, StreamEvent, StreamSettlement, type SubmitCaseLeadRequest, type SubmitSealApprovalRequest, type SubscriptionAudience, type SubscriptionPlan, type SubscriptionTier, type TenantRef, type TimestampPageItem, type TimestampToken, type TimestampVerifyResult, type TokenPackage, type TokenResponse, type TokenSet, type TokenStore, type ToolListResponse, type ToolProvider, type ToolView, type Transaction, type TsaProvider, type TsaStats, type UpdateContractTemplateRequest, type UploadContractTemplatePdfRequest, type UpstreamActivityCallback, type UserSubscription, type VerifiedCredentialIdentity, type VerifyStatus, type VerifyTimestampRequest, type VersionedCredentialStore, VideoGenerationRequest, VideoTaskResponse, type VoidEnvelopeRequest, type WSConfig, type WSEvent, type WalletStats, type WebAuthorizationCallbackParams, type WebAuthorizationPending, type WebAuthorizationRequest, WindowResetSummary, type WorkspacePolicy, type YudaoPageResult, agentAccessScopes, allScopes, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, buildBetas, chatBridgeScopes, classifyComplianceError, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isUserAccessTokenRejected, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, readGatewayErrorContract, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|
|
5615
|
+
export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, type APIResponse, type AdapterKind, type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunListOptions, type AgentRunListResult, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRemoteCreateRequest, type AgentRunRunOptions, type AgentRunRuntime, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type ApiClientRef, type ApproveSealApprovalQuery, type AssignSeatRequest, type Audience, AudienceEnum, type AuthorizeResult, type BalanceDetail, type BalanceDetailEntitlement, type BillingMode, BillingModeEnum, type BillingPreflightResult, type BlockMeta, type BookConsultationRequest, type BridgeThreadRef, type BrowserRefreshMode, type BugReportResult, type BugView, BusinessError, type BuyResponse, type ByokCreateRequest, type ByokCredential, type ByokCredentialStatus, type ByokProvider, CHAT_REQUEST_TIMEOUT_MS, type CancelSealApprovalQuery, type CaseLead, type CaseMatter, type CertificationStatus, type ChannelAttachment, type ChannelCard, type ChannelCardAction, type ChannelInboundEvent, type ChannelOutboundEvent, ChatBridgeClient, type ChatBridgeSession, type ChatCredentialPublic, type ChatIntegration, ChatRequest, ChatResponse, type ChatStreamOptions, type ChatThread, Client, type ClientRegistration, type ComplianceAssetType, type ComplianceBenefitType, type ComplianceBillingDisplayStatus, type ComplianceCapability, ComplianceClient, type ComplianceClientErrorCode, type ComplianceDigestSource, type ComplianceEnvelopeStatus, type ComplianceErrorInfo, type ComplianceErrorKey, type ComplianceHashAlgorithm, CompliancePollError, type CompliancePollOptions, type CompliancePrivacyLevel, type ComplianceProviderRequestStatus, type ComplianceProviderStatus, type ComplianceQuoteResponse, type ComplianceReport, type ComplianceScope, type ComplianceSealApprovalStatus, type ComplianceSku, type ComplianceTimestampVerificationStatus, type ComplianceWriteOptions, type Config, type ConsumeRecord, type ConsumeRecordPage, type ContractTemplateField, type ContractTemplateFieldType, type ContractTemplatePageItem, type ContractTemplateResp, type ContractTemplateStatus, type ContractTemplateVersion, type CorporateTransfer, CrabCodeByokClient, type CreateContractTemplateRequest, type CreateEvidenceAssetRequest, type CreateH5SigningUrlRequest, type CreateIntegrationRequest, type CreateReportRequest, type CreateSigningEnvelopeRequest, type CreateWebAuthorizationRequestOptions, type CredentialAuthorityConfig, type CredentialCASExpected, type CredentialCASResult, type CredentialLoginAttempt, type CredentialMutationReceipt, type CredentialPrincipal, type CredentialReason, type CredentialRef, type CredentialRefreshOperation, type CredentialRequestOwner, type CredentialSnapshot, type CredentialState, type CredentialStateNotification, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, type DeviceRegistration, EmbeddingRequest, EmbeddingResponse, type EnterpriseKycMyStatusView, type EnterpriseMember, type EnterpriseSummary, type EntitlementBalance, type EntitlementItem, type EnvelopeContractItem, ErrAuthDenied, ErrBillingCallbackCannotCommit, ErrBillingCommitRequiresLocalVerify, ErrBillingS2sForbidden, ErrBrowserOpen, ErrComplianceStepUpRequired, ErrDiscovery, ErrEnvelopeGateClosed, ErrOAuthCORSBlocked, ErrProviderNotConfigured, ErrProviderUnknownNoRetry, ErrRefreshProxyFailed, ErrRegistration, ErrSSLProxy, ErrSealApprovalContractHashMismatch, ErrSealApprovalExpired, ErrSealApprovalLocationMismatch, ErrSealApprovalNonceUsed, ErrSealApprovalNotApproved, ErrSealApprovalSealMismatch, ErrSealApprovalTransactorMismatch, ErrSealUseAlreadyConsumed, ErrStateMismatch, ErrTimeout, ErrTokenExchange, ErrTokenExpired, EventAuthURL, EventComplete, EventError, type EvidenceAsset, type EvidenceAssetPageItem, type EvidencePackage, type EvidencePackagePageItem, type FaultDomain, type FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GATEWAY_REQUEST_ID_HEADER, type GateQuota, type GatewayErrorContract, type GatewayRequestIDCallback, type GenerateSkillRequest, type GenerateSkillResult, HTTPError, type IdempotencyKey, IdempotencyKeyHeader, ImageGenerationRequest, ImageGenerationResponse, InMemoryTokenStore, type InitiateCorporateTransferInput, type InitiateCorporateTransferResult, InputModality, type IntegrationStatus, type InviteMemberRequest, type Invoice, type IssueTimestampRequest, type LawyerCredentialMyView, type LawyerSummary, type LegalConsultation, type LegalServiceOrder, type LegalServiceSku, type LegalSkuCode, type ListContractTemplatesRequest, type ListEvidenceAssetsRequest, type ListEvidencePackagesRequest, type ListOperationsRequest, type ListReportsRequest, type ListSealApprovalsRequest, type ListSealUsesRequest, type ListSigningEnvelopesRequest, type ListTimestampsRequest, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, type Membership, type ModelBucket, type ModelByQuotaResponse, ModelCapabilities, type ModelCoefficient, ModelNotFoundError, NetworkError, type Notification, type NotificationList, type NotificationPreference, type NotificationUnreadCount, type OAuthMetadataProfile, OAuthTokenEndpointError, type OpenAIChatChoice, type OpenAIChatMessage, type OpenAIChatResponse, type OpenAIFunctionCall, type OpenAIStreamChoice, type OpenAIStreamChunk, type OpenAIStreamDelta, type OpenAIStreamToolCall, type OpenAIStreamUsage, type OpenAIToolCall, type OpenAIUsage, type OperationDetail, type OperationId, type OperationPageItem, type OperationSource, type OperationStatus, type OptimizeSkillRequest, type OptimizeSkillResult, type Order, type OrderListItem, type OrderStatus, OrderTerminalError, type OrgConsumeReport, type OrgSeat, type OrgSubscription, type PageRequest, type PageResult, type PayPayload, type PaymentMethod, type PermissionPolicy, type Platform, type PricingConfig, type PrincipalRef, type Product, type ProductFamily, ProductFamilyEnum, ProviderAdapter, type ProviderRequestStatus, type ProviderRequestStatusView, type PublicEvidenceVerifyResult, type PublicModelSummary, QuotaSummary, RETRY_ADVICE_REASONS, RateLimitError, type RefundPolicy, type RefundRecord, type Region, type RegionScope, RegionScopeEnum, type RegisterWebOAuthClientOptions, type RejectSealApprovalQuery, type RemoteControlDone, type RemoteControlError, type RemoteControlEvent, type RemoteControlEventType, type RemoteControlPermissionRequest, type RemoteControlPermissionResult, type RemoteControlReasoningDelta, type RemoteControlSettle, type RemoteControlStatus, type RemoteControlTextDelta, type RemoteControlToolCall, type RemoteControlToolResult, type RemoteControlUsage, type RemotePermissionDecision, type RemotePermissionResultRequest, type RemoteSessionPlacement, type RemoteSessionRef, type RemoteSessionTokenGrant, type RemoteUserMessageAck, type RemoteUserMessageRequest, type ReportDownload, type ReportPageItem, type ReqTimeoutCtl, type RequestDisposition, type RequestInvoiceInput, type RequestRefundInput, RerankRequest, RerankResponse, type RetryAdvice, type RetryAdviceReason, type RetryPolicy, type RetryRequestInfo, type RolloverPolicy, type RunnerKind, ScopeAI, ScopeAccount, ScopeAgentAccessManage, ScopeChatBridge, ScopeChatBridgeRead, ScopeChatBridgeRotate, ScopeChatBridgeWrite, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceContractTemplateRead, ScopeComplianceContractTemplateWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceReportsWrite, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeRemoteControl, ScopeRemoteControlAgentRun, ScopeRemoteControlPermissionResponse, ScopeRemoteControlSessionControl, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, type SealApproval, type SealApprovalPageItem, type SealUsePageItem, type ServerMetadata, type SignEnvelopeRequest, type SigningEnvelope, type SigningEnvelopePageItem, type SkillBrowseListResponse, type SkillBrowseResponse, type SkillStoreItem, type SkillStoreListItem, type SkillStoreQuery, type SkillSummary, type SortDirection, SourcesEvent, type StepUpStatus, type StoreCredentialRequest, StreamError, StreamEvent, StreamSettlement, type SubmitCaseLeadRequest, type SubmitSealApprovalRequest, type SubscriptionAudience, type SubscriptionPlan, type SubscriptionTier, type TenantRef, type TimestampPageItem, type TimestampToken, type TimestampVerifyResult, type TokenPackage, type TokenResponse, type TokenSet, type TokenStore, type ToolListResponse, type ToolProvider, type ToolView, type Transaction, type TsaProvider, type TsaStats, type UpdateContractTemplateRequest, type UploadContractTemplatePdfRequest, type UpstreamActivityCallback, type UserSubscription, type VerifiedCredentialIdentity, type VerifyStatus, type VerifyTimestampRequest, type VersionedCredentialStore, VideoGenerationRequest, VideoTaskResponse, type VoidEnvelopeRequest, type WSConfig, type WSEvent, type WalletStats, type WebAuthorizationCallbackParams, type WebAuthorizationPending, type WebAuthorizationRequest, WindowResetSummary, type WorkspacePolicy, type YudaoPageResult, agentAccessScopes, allScopes, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, buildBetas, chatBridgeScopes, classifyComplianceError, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isStreamError, isTerminalRemoteEvent, isUserAccessTokenRejected, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, readGatewayErrorContract, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|