@acosmi/sdk-ts 2.19.4 → 2.19.6

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.
@@ -1,7 +1,7 @@
1
- import { a as AnthropicResponse } from './openai-Cuu_DPxM.cjs';
2
- export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-Cuu_DPxM.cjs';
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.cjs';
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.cjs';
1
+ import { a as AnthropicResponse } from './openai-ByUO-cSR.cjs';
2
+ export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-ByUO-cSR.cjs';
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-CKpXSSqY.cjs';
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-CKpXSSqY.cjs';
5
5
  import { M as MinimalSanitizeConfig } from './index-Bah9A83R.cjs';
6
6
  export { A as sanitize } from './index-Bah9A83R.cjs';
7
7
  export { AnthropicAdapter } from './adapters/anthropic.cjs';
@@ -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
  *
@@ -913,7 +916,7 @@ declare const ErrOAuthCORSBlocked: "oauth_cors_blocked";
913
916
  declare const ErrRefreshProxyFailed: "refresh_proxy_failed";
914
917
  declare const ErrTokenExpired: "token_expired";
915
918
  /**
916
- * v1.6.0: chat / chatMessages / chatStream / chatMessagesStream 的 per-request 超时上限。
919
+ * v1.6.0: **非流式** chat / chatMessages (及 generateVideo 等生成端点) 的 per-request 超时上限。
917
920
  *
918
921
  * 上游 (如 DeepSeek) 在开始推理前可能持续保活长达 10 分钟; SDK 必须容纳
919
922
  * "首字节前等待 + 推理 + 流式传输" 全程, 否则会在等待阶段误超时切断。
@@ -922,6 +925,12 @@ declare const ErrTokenExpired: "token_expired";
922
925
  * 2026-08-06 导出: 供回归闸门按**符号**断言, 避免测试抄字面量后与本常量各自漂移
923
926
  * (抄件断言恒绿 = 零覆盖)。消费方若要自定义更短预算, 传 signal 即可 —
924
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 逐字一致。
925
934
  */
926
935
  declare const CHAT_REQUEST_TIMEOUT_MS: number;
927
936
  /**
@@ -965,6 +974,37 @@ declare const GATEWAY_REQUEST_ID_HEADER = "X-Acosmi-Request-Id";
965
974
  * 触发** —— 绝不合成占位值。回调抛错会被吞掉且不中断流 (旁路信号不该有能力杀死主链路)。
966
975
  */
967
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
+ }
968
1008
  /**
969
1009
  * 非流式 JSON API 请求的默认超时 (毫秒)。
970
1010
  *
@@ -1315,8 +1355,9 @@ declare class Client {
1315
1355
  *
1316
1356
  * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
1317
1357
  * @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
1358
+ * @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
1318
1359
  */
1319
- 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>;
1320
1361
  /**
1321
1362
  * Anthropic 原生格式流式聊天 (SSE)
1322
1363
  * 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
@@ -1324,8 +1365,9 @@ declare class Client {
1324
1365
  *
1325
1366
  * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
1326
1367
  * @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
1368
+ * @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
1327
1369
  */
1328
- 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>;
1329
1371
  private chatStreamGen;
1330
1372
  private chatMessagesStreamGen;
1331
1373
  /**
@@ -1572,8 +1614,10 @@ declare class NetworkError extends Error {
1572
1614
  /**
1573
1615
  * 流式失败事件的结构化表示。
1574
1616
  *
1575
- * 由 gateway 的 `managed_model_stream_failed` 事件解析得到。客户端可通过
1576
- * instanceof 提取并按 code/retryable 决策。
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 决策。
1577
1621
  */
1578
1622
  declare class StreamError extends Error {
1579
1623
  /** 例: "empty_response" / "rate_limit" / "overloaded" / "" */
@@ -1586,8 +1630,23 @@ declare class StreamError extends Error {
1586
1630
  userMessage: string;
1587
1631
  /** gateway 原始 error 字符串 */
1588
1632
  rawError: string;
1589
- /** 客户端是否值得重试 */
1633
+ /** 客户端是否值得重试 (= 服务端 `retryable` **且** `requestDisposition === 'not_accepted'`) */
1590
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;
1591
1650
  errorContractVersion?: number;
1592
1651
  faultDomain?: FaultDomain;
1593
1652
  requestDisposition?: RequestDisposition;
@@ -1600,6 +1659,7 @@ declare class StreamError extends Error {
1600
1659
  message?: string;
1601
1660
  rawError?: string;
1602
1661
  retryable?: boolean;
1662
+ retryAfterSecs?: number | null;
1603
1663
  errorContractVersion?: number;
1604
1664
  faultDomain?: FaultDomain;
1605
1665
  requestDisposition?: RequestDisposition;
@@ -1608,6 +1668,18 @@ declare class StreamError extends Error {
1608
1668
  providerRequestId?: string | null;
1609
1669
  });
1610
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;
1611
1683
  type RequestDisposition = 'not_accepted' | 'accepted' | 'unknown';
1612
1684
  type FaultDomain = 'user_auth' | 'caller_credentials' | 'account_quota' | 'account_permission' | 'provider' | 'gateway' | 'transport' | 'stream_ticket' | 'protocol';
1613
1685
  interface GatewayErrorContract {
@@ -5540,4 +5612,4 @@ declare class ChatBridgeClient {
5540
5612
  revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
5541
5613
  }
5542
5614
 
5543
- 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 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, 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 };
@@ -1,7 +1,7 @@
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';
1
+ import { a as AnthropicResponse } from './openai-CH0wnJXv.js';
2
+ export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-CH0wnJXv.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-CKpXSSqY.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-CKpXSSqY.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
  *
@@ -913,7 +916,7 @@ declare const ErrOAuthCORSBlocked: "oauth_cors_blocked";
913
916
  declare const ErrRefreshProxyFailed: "refresh_proxy_failed";
914
917
  declare const ErrTokenExpired: "token_expired";
915
918
  /**
916
- * v1.6.0: chat / chatMessages / chatStream / chatMessagesStream 的 per-request 超时上限。
919
+ * v1.6.0: **非流式** chat / chatMessages (及 generateVideo 等生成端点) 的 per-request 超时上限。
917
920
  *
918
921
  * 上游 (如 DeepSeek) 在开始推理前可能持续保活长达 10 分钟; SDK 必须容纳
919
922
  * "首字节前等待 + 推理 + 流式传输" 全程, 否则会在等待阶段误超时切断。
@@ -922,6 +925,12 @@ declare const ErrTokenExpired: "token_expired";
922
925
  * 2026-08-06 导出: 供回归闸门按**符号**断言, 避免测试抄字面量后与本常量各自漂移
923
926
  * (抄件断言恒绿 = 零覆盖)。消费方若要自定义更短预算, 传 signal 即可 —
924
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 逐字一致。
925
934
  */
926
935
  declare const CHAT_REQUEST_TIMEOUT_MS: number;
927
936
  /**
@@ -965,6 +974,37 @@ declare const GATEWAY_REQUEST_ID_HEADER = "X-Acosmi-Request-Id";
965
974
  * 触发** —— 绝不合成占位值。回调抛错会被吞掉且不中断流 (旁路信号不该有能力杀死主链路)。
966
975
  */
967
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
+ }
968
1008
  /**
969
1009
  * 非流式 JSON API 请求的默认超时 (毫秒)。
970
1010
  *
@@ -1315,8 +1355,9 @@ declare class Client {
1315
1355
  *
1316
1356
  * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
1317
1357
  * @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
1358
+ * @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
1318
1359
  */
1319
- 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>;
1320
1361
  /**
1321
1362
  * Anthropic 原生格式流式聊天 (SSE)
1322
1363
  * 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
@@ -1324,8 +1365,9 @@ declare class Client {
1324
1365
  *
1325
1366
  * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
1326
1367
  * @param onGatewayRequestID 见 {@link GatewayRequestIDCallback}
1368
+ * @param opts 见 {@link ChatStreamOptions} (2.19.5 起)
1327
1369
  */
1328
- 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>;
1329
1371
  private chatStreamGen;
1330
1372
  private chatMessagesStreamGen;
1331
1373
  /**
@@ -1572,8 +1614,10 @@ declare class NetworkError extends Error {
1572
1614
  /**
1573
1615
  * 流式失败事件的结构化表示。
1574
1616
  *
1575
- * 由 gateway 的 `managed_model_stream_failed` 事件解析得到。客户端可通过
1576
- * instanceof 提取并按 code/retryable 决策。
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 决策。
1577
1621
  */
1578
1622
  declare class StreamError extends Error {
1579
1623
  /** 例: "empty_response" / "rate_limit" / "overloaded" / "" */
@@ -1586,8 +1630,23 @@ declare class StreamError extends Error {
1586
1630
  userMessage: string;
1587
1631
  /** gateway 原始 error 字符串 */
1588
1632
  rawError: string;
1589
- /** 客户端是否值得重试 */
1633
+ /** 客户端是否值得重试 (= 服务端 `retryable` **且** `requestDisposition === 'not_accepted'`) */
1590
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;
1591
1650
  errorContractVersion?: number;
1592
1651
  faultDomain?: FaultDomain;
1593
1652
  requestDisposition?: RequestDisposition;
@@ -1600,6 +1659,7 @@ declare class StreamError extends Error {
1600
1659
  message?: string;
1601
1660
  rawError?: string;
1602
1661
  retryable?: boolean;
1662
+ retryAfterSecs?: number | null;
1603
1663
  errorContractVersion?: number;
1604
1664
  faultDomain?: FaultDomain;
1605
1665
  requestDisposition?: RequestDisposition;
@@ -1608,6 +1668,18 @@ declare class StreamError extends Error {
1608
1668
  providerRequestId?: string | null;
1609
1669
  });
1610
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;
1611
1683
  type RequestDisposition = 'not_accepted' | 'accepted' | 'unknown';
1612
1684
  type FaultDomain = 'user_auth' | 'caller_credentials' | 'account_quota' | 'account_permission' | 'provider' | 'gateway' | 'transport' | 'stream_ticket' | 'protocol';
1613
1685
  interface GatewayErrorContract {
@@ -5540,4 +5612,4 @@ declare class ChatBridgeClient {
5540
5612
  revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
5541
5613
  }
5542
5614
 
5543
- 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 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, 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 };