@acosmi/sdk-ts 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +27 -2
- package/dist/browser/index.mjs +103 -19
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.mjs +103 -19
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +105 -18
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +63 -6
- package/dist/node/index.d.ts +63 -6
- package/dist/node/index.mjs +103 -19
- package/dist/node/index.mjs.map +1 -1
- package/package.json +4 -1
package/dist/node/index.d.cts
CHANGED
|
@@ -421,8 +421,8 @@ interface CreateWebAuthorizationRequestOptions {
|
|
|
421
421
|
/**
|
|
422
422
|
* 构造 Web OAuth 授权请求。
|
|
423
423
|
*
|
|
424
|
-
* 生成 PKCE verifier + S256 challenge + CSRF state,按 OAuth 2.1 拼装授权 URL
|
|
425
|
-
* (
|
|
424
|
+
* 生成 PKCE verifier + S256 challenge + CSRF state,按 OAuth 2.1 拼装授权 URL。
|
|
425
|
+
* (自 2026-08-14 起桌面 `authorize` 同样带 state 并在回调时校验; Web 流程本就必须带。)
|
|
426
426
|
*
|
|
427
427
|
* 返回的 `WebAuthorizationRequest` 应整体持久化为 pending 状态,
|
|
428
428
|
* callback 阶段交给 `completeWebAuthorizationRequest`。
|
|
@@ -777,6 +777,33 @@ type BrowserRefreshMode = 'direct' | 'server-proxy' | 'none';
|
|
|
777
777
|
declare const ErrOAuthCORSBlocked: "oauth_cors_blocked";
|
|
778
778
|
declare const ErrRefreshProxyFailed: "refresh_proxy_failed";
|
|
779
779
|
declare const ErrTokenExpired: "token_expired";
|
|
780
|
+
/**
|
|
781
|
+
* v1.6.0: chat / chatMessages / chatStream / chatMessagesStream 的 per-request 超时上限。
|
|
782
|
+
*
|
|
783
|
+
* 上游 (如 DeepSeek) 在开始推理前可能持续保活长达 10 分钟; SDK 必须容纳
|
|
784
|
+
* "首字节前等待 + 推理 + 流式传输" 全程, 否则会在等待阶段误超时切断。
|
|
785
|
+
* 单值覆盖, 不区分首字节 vs 总耗时 (AbortController 是总耗时上限)。
|
|
786
|
+
*
|
|
787
|
+
* 2026-08-06 导出: 供回归闸门按**符号**断言, 避免测试抄字面量后与本常量各自漂移
|
|
788
|
+
* (抄件断言恒绿 = 零覆盖)。消费方若要自定义更短预算, 传 signal 即可 —
|
|
789
|
+
* withRequestTimeout 取二者先到者, 无需读本值。
|
|
790
|
+
*/
|
|
791
|
+
declare const CHAT_REQUEST_TIMEOUT_MS: number;
|
|
792
|
+
/**
|
|
793
|
+
* 流式链路的"对端还活着"回调 (2026-08-06)。
|
|
794
|
+
*
|
|
795
|
+
* **为什么需要它**: 消费方 (如 CrabCode) 自带流空闲看门狗, 判据是"多久没收到事件"。
|
|
796
|
+
* 但 SSE 上有两类**有字节、无事件**的情形, 看门狗对它们完全失明:
|
|
797
|
+
* 1. 上游/网关在推理前发的保活注释行 (": keep-alive") — 被 isSSECommentLine 吞掉
|
|
798
|
+
* 2. OpenAI 格式下 converter.convert() 对某些 data 行返回零事件
|
|
799
|
+
* 两种情形下连接都健康、字节在流动, 看门狗却会掐流。心跳只有在**抵达做判决的那一层**
|
|
800
|
+
* 时才叫心跳 —— 网关补心跳而 SDK 吞掉, 等于没补。
|
|
801
|
+
*
|
|
802
|
+
* 本回调对**每一条** SSE 行触发一次 (含注释行), 早于任何过滤与解析。语义是
|
|
803
|
+
* "链路刚刚有动静", 不是"来了一个事件" —— 消费方拿它重置自己的空闲计时器即可。
|
|
804
|
+
* 回调抛错会被吞掉且不中断流 (它是旁路信号, 不该有能力杀死主链路)。
|
|
805
|
+
*/
|
|
806
|
+
type UpstreamActivityCallback = () => void;
|
|
780
807
|
/**
|
|
781
808
|
* 非流式 JSON API 请求的默认超时 (毫秒)。
|
|
782
809
|
*
|
|
@@ -1084,14 +1111,18 @@ declare class Client {
|
|
|
1084
1111
|
/**
|
|
1085
1112
|
* 流式聊天 (SSE), 通过 async generator 返回事件
|
|
1086
1113
|
* v0.5.0: 根据 adapter 路由端点
|
|
1114
|
+
*
|
|
1115
|
+
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1087
1116
|
*/
|
|
1088
|
-
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
1117
|
+
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback): AsyncIterable<StreamEvent>;
|
|
1089
1118
|
/**
|
|
1090
1119
|
* Anthropic 原生格式流式聊天 (SSE)
|
|
1091
1120
|
* 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
|
|
1092
1121
|
* 无 started/settled/failed 自定义事件, 无 data: [DONE], message_stop 为自然结束
|
|
1122
|
+
*
|
|
1123
|
+
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1093
1124
|
*/
|
|
1094
|
-
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
1125
|
+
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback): AsyncIterable<StreamEvent>;
|
|
1095
1126
|
private chatStreamGen;
|
|
1096
1127
|
private chatMessagesStreamGen;
|
|
1097
1128
|
/**
|
|
@@ -1133,7 +1164,19 @@ declare class Client {
|
|
|
1133
1164
|
headers: Headers;
|
|
1134
1165
|
}>;
|
|
1135
1166
|
private doJSONFullInternal;
|
|
1136
|
-
/**
|
|
1167
|
+
/**
|
|
1168
|
+
* doJSONFull 的 raw bytes 变体 (chat 用, 不立即 JSON.parse)
|
|
1169
|
+
*
|
|
1170
|
+
* ⚠️ 契约 (2026-08-06): `timeoutMs` 的 30s 默认值只适用于**控制面**端点 (列目录 /
|
|
1171
|
+
* 查配额 / 取任务状态)。凡走**模型推理或生成**的端点 —— chat / anthropic /
|
|
1172
|
+
* embeddings / rerank / images / videos —— 一律必须显式传入 `CHAT_REQUEST_TIMEOUT_MS`,
|
|
1173
|
+
* 哪怕调用方已经用 `withRequestTimeout` 建了外层预算: 外层只约束 `signal`, 内层
|
|
1174
|
+
* 会**另建**一个 `timeoutMs` 计时器, 30s 恒先于任何更长的外层预算触发。
|
|
1175
|
+
*
|
|
1176
|
+
* 这不是假设 —— 2026-08-06 事故里 chat 路径正因漏传本参数而被恒定钉死在 30s,
|
|
1177
|
+
* 且上方 v1.6.0 的注释还声称它已是 11min。回归闸门见
|
|
1178
|
+
* `tests/chat-timeout-budget.test.ts`。
|
|
1179
|
+
*/
|
|
1137
1180
|
doJSONFullRaw(method: string, path: string, body: unknown | null, signal?: AbortSignal, timeoutMs?: number): Promise<{
|
|
1138
1181
|
result: Uint8Array;
|
|
1139
1182
|
headers: Headers;
|
|
@@ -1720,6 +1763,15 @@ declare const ScopeChatBridgeRead = "chat_bridge:read";
|
|
|
1720
1763
|
declare const ScopeChatBridgeWrite = "chat_bridge:write";
|
|
1721
1764
|
/** 轮换 / 吊销凭证 (高风险)。 */
|
|
1722
1765
|
declare const ScopeChatBridgeRotate = "chat_bridge:rotate";
|
|
1766
|
+
/**
|
|
1767
|
+
* 会员委托 Key 控制面 scope (2026-08-14 开放 API 方案)。
|
|
1768
|
+
*
|
|
1769
|
+
* 高风险且**刻意不进 allScopes()**: 持有它即可签发"长期代表本人会员权益调用模型"的静态凭证,
|
|
1770
|
+
* 桌面登录不应自动获得该能力 —— 调用方必须显式申请, 用户才会在同意页看到这项授权。
|
|
1771
|
+
* 服务端三条约束一起才闭合 (见 Go desktop_oauth.go): 不并入任何分组展开、不得签进 sk- Key、
|
|
1772
|
+
* 签发接口只接受有同意页的 desktop OAuth 或同源登录态。
|
|
1773
|
+
*/
|
|
1774
|
+
declare const ScopeAgentAccessManage = "agent_access:manage";
|
|
1723
1775
|
/** @deprecated 旧细粒度 scope, 保留向后兼容, 新代码请用分组 scope */
|
|
1724
1776
|
declare const ScopeModels = "models";
|
|
1725
1777
|
/** @deprecated */
|
|
@@ -1757,6 +1809,11 @@ declare function remoteControlScopes(): string[];
|
|
|
1757
1809
|
* 聊天桥接 scope (推荐). 仅返回分组 ScopeChatBridge; 服务端展开为 3 子 scope。调用方需显式申请, allScopes() 不含。
|
|
1758
1810
|
*/
|
|
1759
1811
|
declare function chatBridgeScopes(): string[];
|
|
1812
|
+
/**
|
|
1813
|
+
* 会员委托 Key 控制面 scope (需显式申请; allScopes() 不含本项)。
|
|
1814
|
+
* 典型用法: `authorize({ scopes: [...allScopes(), ...agentAccessScopes()] })`
|
|
1815
|
+
*/
|
|
1816
|
+
declare function agentAccessScopes(): string[];
|
|
1760
1817
|
|
|
1761
1818
|
interface OpenAIChatResponse {
|
|
1762
1819
|
id: string;
|
|
@@ -5186,4 +5243,4 @@ declare class ChatBridgeClient {
|
|
|
5186
5243
|
revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
|
|
5187
5244
|
}
|
|
5188
5245
|
|
|
5189
|
-
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, 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 CredentialRef, 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 FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, type GateQuota, 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 RequestInvoiceInput, type RequestRefundInput, RerankRequest, RerankResponse, type RetryAdvice, type RetryAdviceReason, type RetryPolicy, type RetryRequestInfo, type RolloverPolicy, type RunnerKind, ScopeAI, ScopeAccount, 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 UserSubscription, type VerifyStatus, type VerifyTimestampRequest, VideoGenerationRequest, VideoTaskResponse, type VoidEnvelopeRequest, type WSConfig, type WSEvent, type WalletStats, type WebAuthorizationCallbackParams, type WebAuthorizationPending, type WebAuthorizationRequest, WindowResetSummary, type WorkspacePolicy, type YudaoPageResult, 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, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|
|
5246
|
+
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 CredentialRef, 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 FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, type GateQuota, 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 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 VerifyStatus, type VerifyTimestampRequest, 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, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -421,8 +421,8 @@ interface CreateWebAuthorizationRequestOptions {
|
|
|
421
421
|
/**
|
|
422
422
|
* 构造 Web OAuth 授权请求。
|
|
423
423
|
*
|
|
424
|
-
* 生成 PKCE verifier + S256 challenge + CSRF state,按 OAuth 2.1 拼装授权 URL
|
|
425
|
-
* (
|
|
424
|
+
* 生成 PKCE verifier + S256 challenge + CSRF state,按 OAuth 2.1 拼装授权 URL。
|
|
425
|
+
* (自 2026-08-14 起桌面 `authorize` 同样带 state 并在回调时校验; Web 流程本就必须带。)
|
|
426
426
|
*
|
|
427
427
|
* 返回的 `WebAuthorizationRequest` 应整体持久化为 pending 状态,
|
|
428
428
|
* callback 阶段交给 `completeWebAuthorizationRequest`。
|
|
@@ -777,6 +777,33 @@ type BrowserRefreshMode = 'direct' | 'server-proxy' | 'none';
|
|
|
777
777
|
declare const ErrOAuthCORSBlocked: "oauth_cors_blocked";
|
|
778
778
|
declare const ErrRefreshProxyFailed: "refresh_proxy_failed";
|
|
779
779
|
declare const ErrTokenExpired: "token_expired";
|
|
780
|
+
/**
|
|
781
|
+
* v1.6.0: chat / chatMessages / chatStream / chatMessagesStream 的 per-request 超时上限。
|
|
782
|
+
*
|
|
783
|
+
* 上游 (如 DeepSeek) 在开始推理前可能持续保活长达 10 分钟; SDK 必须容纳
|
|
784
|
+
* "首字节前等待 + 推理 + 流式传输" 全程, 否则会在等待阶段误超时切断。
|
|
785
|
+
* 单值覆盖, 不区分首字节 vs 总耗时 (AbortController 是总耗时上限)。
|
|
786
|
+
*
|
|
787
|
+
* 2026-08-06 导出: 供回归闸门按**符号**断言, 避免测试抄字面量后与本常量各自漂移
|
|
788
|
+
* (抄件断言恒绿 = 零覆盖)。消费方若要自定义更短预算, 传 signal 即可 —
|
|
789
|
+
* withRequestTimeout 取二者先到者, 无需读本值。
|
|
790
|
+
*/
|
|
791
|
+
declare const CHAT_REQUEST_TIMEOUT_MS: number;
|
|
792
|
+
/**
|
|
793
|
+
* 流式链路的"对端还活着"回调 (2026-08-06)。
|
|
794
|
+
*
|
|
795
|
+
* **为什么需要它**: 消费方 (如 CrabCode) 自带流空闲看门狗, 判据是"多久没收到事件"。
|
|
796
|
+
* 但 SSE 上有两类**有字节、无事件**的情形, 看门狗对它们完全失明:
|
|
797
|
+
* 1. 上游/网关在推理前发的保活注释行 (": keep-alive") — 被 isSSECommentLine 吞掉
|
|
798
|
+
* 2. OpenAI 格式下 converter.convert() 对某些 data 行返回零事件
|
|
799
|
+
* 两种情形下连接都健康、字节在流动, 看门狗却会掐流。心跳只有在**抵达做判决的那一层**
|
|
800
|
+
* 时才叫心跳 —— 网关补心跳而 SDK 吞掉, 等于没补。
|
|
801
|
+
*
|
|
802
|
+
* 本回调对**每一条** SSE 行触发一次 (含注释行), 早于任何过滤与解析。语义是
|
|
803
|
+
* "链路刚刚有动静", 不是"来了一个事件" —— 消费方拿它重置自己的空闲计时器即可。
|
|
804
|
+
* 回调抛错会被吞掉且不中断流 (它是旁路信号, 不该有能力杀死主链路)。
|
|
805
|
+
*/
|
|
806
|
+
type UpstreamActivityCallback = () => void;
|
|
780
807
|
/**
|
|
781
808
|
* 非流式 JSON API 请求的默认超时 (毫秒)。
|
|
782
809
|
*
|
|
@@ -1084,14 +1111,18 @@ declare class Client {
|
|
|
1084
1111
|
/**
|
|
1085
1112
|
* 流式聊天 (SSE), 通过 async generator 返回事件
|
|
1086
1113
|
* v0.5.0: 根据 adapter 路由端点
|
|
1114
|
+
*
|
|
1115
|
+
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1087
1116
|
*/
|
|
1088
|
-
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
1117
|
+
chatStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback): AsyncIterable<StreamEvent>;
|
|
1089
1118
|
/**
|
|
1090
1119
|
* Anthropic 原生格式流式聊天 (SSE)
|
|
1091
1120
|
* 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
|
|
1092
1121
|
* 无 started/settled/failed 自定义事件, 无 data: [DONE], message_stop 为自然结束
|
|
1122
|
+
*
|
|
1123
|
+
* @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
|
|
1093
1124
|
*/
|
|
1094
|
-
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal): AsyncIterable<StreamEvent>;
|
|
1125
|
+
chatMessagesStream(modelID: string, req: ChatRequest, signal?: AbortSignal, onUpstreamActivity?: UpstreamActivityCallback): AsyncIterable<StreamEvent>;
|
|
1095
1126
|
private chatStreamGen;
|
|
1096
1127
|
private chatMessagesStreamGen;
|
|
1097
1128
|
/**
|
|
@@ -1133,7 +1164,19 @@ declare class Client {
|
|
|
1133
1164
|
headers: Headers;
|
|
1134
1165
|
}>;
|
|
1135
1166
|
private doJSONFullInternal;
|
|
1136
|
-
/**
|
|
1167
|
+
/**
|
|
1168
|
+
* doJSONFull 的 raw bytes 变体 (chat 用, 不立即 JSON.parse)
|
|
1169
|
+
*
|
|
1170
|
+
* ⚠️ 契约 (2026-08-06): `timeoutMs` 的 30s 默认值只适用于**控制面**端点 (列目录 /
|
|
1171
|
+
* 查配额 / 取任务状态)。凡走**模型推理或生成**的端点 —— chat / anthropic /
|
|
1172
|
+
* embeddings / rerank / images / videos —— 一律必须显式传入 `CHAT_REQUEST_TIMEOUT_MS`,
|
|
1173
|
+
* 哪怕调用方已经用 `withRequestTimeout` 建了外层预算: 外层只约束 `signal`, 内层
|
|
1174
|
+
* 会**另建**一个 `timeoutMs` 计时器, 30s 恒先于任何更长的外层预算触发。
|
|
1175
|
+
*
|
|
1176
|
+
* 这不是假设 —— 2026-08-06 事故里 chat 路径正因漏传本参数而被恒定钉死在 30s,
|
|
1177
|
+
* 且上方 v1.6.0 的注释还声称它已是 11min。回归闸门见
|
|
1178
|
+
* `tests/chat-timeout-budget.test.ts`。
|
|
1179
|
+
*/
|
|
1137
1180
|
doJSONFullRaw(method: string, path: string, body: unknown | null, signal?: AbortSignal, timeoutMs?: number): Promise<{
|
|
1138
1181
|
result: Uint8Array;
|
|
1139
1182
|
headers: Headers;
|
|
@@ -1720,6 +1763,15 @@ declare const ScopeChatBridgeRead = "chat_bridge:read";
|
|
|
1720
1763
|
declare const ScopeChatBridgeWrite = "chat_bridge:write";
|
|
1721
1764
|
/** 轮换 / 吊销凭证 (高风险)。 */
|
|
1722
1765
|
declare const ScopeChatBridgeRotate = "chat_bridge:rotate";
|
|
1766
|
+
/**
|
|
1767
|
+
* 会员委托 Key 控制面 scope (2026-08-14 开放 API 方案)。
|
|
1768
|
+
*
|
|
1769
|
+
* 高风险且**刻意不进 allScopes()**: 持有它即可签发"长期代表本人会员权益调用模型"的静态凭证,
|
|
1770
|
+
* 桌面登录不应自动获得该能力 —— 调用方必须显式申请, 用户才会在同意页看到这项授权。
|
|
1771
|
+
* 服务端三条约束一起才闭合 (见 Go desktop_oauth.go): 不并入任何分组展开、不得签进 sk- Key、
|
|
1772
|
+
* 签发接口只接受有同意页的 desktop OAuth 或同源登录态。
|
|
1773
|
+
*/
|
|
1774
|
+
declare const ScopeAgentAccessManage = "agent_access:manage";
|
|
1723
1775
|
/** @deprecated 旧细粒度 scope, 保留向后兼容, 新代码请用分组 scope */
|
|
1724
1776
|
declare const ScopeModels = "models";
|
|
1725
1777
|
/** @deprecated */
|
|
@@ -1757,6 +1809,11 @@ declare function remoteControlScopes(): string[];
|
|
|
1757
1809
|
* 聊天桥接 scope (推荐). 仅返回分组 ScopeChatBridge; 服务端展开为 3 子 scope。调用方需显式申请, allScopes() 不含。
|
|
1758
1810
|
*/
|
|
1759
1811
|
declare function chatBridgeScopes(): string[];
|
|
1812
|
+
/**
|
|
1813
|
+
* 会员委托 Key 控制面 scope (需显式申请; allScopes() 不含本项)。
|
|
1814
|
+
* 典型用法: `authorize({ scopes: [...allScopes(), ...agentAccessScopes()] })`
|
|
1815
|
+
*/
|
|
1816
|
+
declare function agentAccessScopes(): string[];
|
|
1760
1817
|
|
|
1761
1818
|
interface OpenAIChatResponse {
|
|
1762
1819
|
id: string;
|
|
@@ -5186,4 +5243,4 @@ declare class ChatBridgeClient {
|
|
|
5186
5243
|
revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
|
|
5187
5244
|
}
|
|
5188
5245
|
|
|
5189
|
-
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, 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 CredentialRef, 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 FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, type GateQuota, 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 RequestInvoiceInput, type RequestRefundInput, RerankRequest, RerankResponse, type RetryAdvice, type RetryAdviceReason, type RetryPolicy, type RetryRequestInfo, type RolloverPolicy, type RunnerKind, ScopeAI, ScopeAccount, 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 UserSubscription, type VerifyStatus, type VerifyTimestampRequest, VideoGenerationRequest, VideoTaskResponse, type VoidEnvelopeRequest, type WSConfig, type WSEvent, type WalletStats, type WebAuthorizationCallbackParams, type WebAuthorizationPending, type WebAuthorizationRequest, WindowResetSummary, type WorkspacePolicy, type YudaoPageResult, 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, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|
|
5246
|
+
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 CredentialRef, 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 FeatureGateState, type FeatureGateStatus, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, type GateQuota, 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 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 VerifyStatus, type VerifyTimestampRequest, 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, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|