@acosmi/sdk-ts 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -0
- package/README.md +190 -20
- package/dist/browser/index.mjs +1091 -349
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.mjs +1091 -349
- package/dist/index.mjs.map +1 -1
- package/dist/node/adapters/anthropic.cjs.map +1 -1
- package/dist/node/adapters/anthropic.d.cts +1 -1
- package/dist/node/adapters/anthropic.d.ts +1 -1
- package/dist/node/adapters/anthropic.mjs.map +1 -1
- package/dist/node/adapters/openai.cjs.map +1 -1
- package/dist/node/adapters/openai.d.cts +1 -1
- package/dist/node/adapters/openai.d.ts +1 -1
- package/dist/node/adapters/openai.mjs.map +1 -1
- package/dist/node/{index-BI8EgBXu.d.cts → index-28x02ITB.d.cts} +36 -1
- package/dist/node/{index-BI8EgBXu.d.ts → index-28x02ITB.d.ts} +36 -1
- package/dist/node/index.cjs +1128 -348
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +730 -193
- package/dist/node/index.d.ts +730 -193
- package/dist/node/index.mjs +1091 -349
- package/dist/node/index.mjs.map +1 -1
- package/docs/compliance.md +265 -0
- package/examples/compliance-envelope.ts +112 -0
- package/examples/compliance-evidence-timestamp.ts +130 -0
- package/examples/compliance-read.ts +72 -0
- package/package.json +2 -2
package/dist/node/index.d.cts
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
|
-
import { S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration,
|
|
2
|
-
export {
|
|
1
|
+
import { M as ManagedModel, I as InputModality, S as ServerMetadata, T as TokenResponse, a as TokenSet, C as ClientRegistration, B as BusinessError, b as ModelCoefficient, Q as QuotaSummary, c as ModelCapabilities, d as ChatRequest, P as ProviderAdapter, e as ChatResponse, A as AnthropicResponse, f as StreamEvent, g as SourcesEvent, h as StreamSettlement, E as EntitlementBalance, i as BalanceDetail, j as EntitlementItem, k as ConsumeRecordPage, l as ModelByQuotaResponse, m as ModelBucket, n as TokenPackage, o as PayPayload, O as Order, p as OrderStatus, W as WalletStats, q as Transaction, r as SkillStoreQuery, s as SkillStoreItem, t as SkillBrowseResponse, u as SkillBrowseListResponse, v as SkillSummary, w as CertificationStatus, G as GenerateSkillRequest, x as GenerateSkillResult, y as OptimizeSkillRequest, z as OptimizeSkillResult, D as ToolView, N as NotificationList, F as DeviceRegistration, H as NotificationPreference, J as WSEvent } from './index-28x02ITB.cjs';
|
|
2
|
+
export { K as APIResponse, L as AnthropicContentBlock, R as AnthropicUsage, U as BucketClassCommercial, V as BucketClassGeneric, X as BucketInfo, Y as BucketRow, Z as ChatContentBlock, _ as ChatMessage, $ as ChatUsage, a0 as ConsumeRecord, a1 as EffortConfig, a2 as GeoLoc, a3 as HTTPError, a4 as ModelNotFoundError, a5 as NetworkError, a6 as Notification, a7 as NotificationUnreadCount, a8 as OpenAIChatChoice, a9 as OpenAIChatMessage, aa as OpenAIChatResponse, ab as OpenAIFunctionCall, ac as OpenAIStreamChoice, ad as OpenAIStreamChunk, ae as OpenAIStreamDelta, af as OpenAIStreamToolCall, ag as OpenAIToolCall, ah as OpenAIUsage, ai as OrderTerminalError, aj as OutputConfig, ak as ProviderFormat, al as RateLimitError, am as ServerTool, an as ServerToolTypeWebSearch, ao as SkillStoreListItem, ap as StreamError, aq as ThinkingConfig, ar as ThinkingHigh, as as ThinkingHighMinMaxTokens, at as ThinkingMax, au as ThinkingMaxFallbackMaxTokens, av as ThinkingOff, aw as ToolListResponse, ax as ToolProvider, ay as WebSearchConfig, az as WebSearchSource, aA as YudaoPageResult, aB as anthropicResponseTextContent, aC as anthropicResponseThinkingContent, aD as anthropicResponseToolUseBlocks, aE as apiResponseBusinessError, aF as apiResponseGetMessage, aG as bucketInfoIsCommercial, aH as bucketRowIsCommercial, aI as getAdapter, aJ as getAdapterForModel, aK as newThinkingConfig, aL as newWebSearchTool, aM as parseNotificationEvent, aN as parseSettlement, aO as parseSourcesEvent, aP as tokenSetIsExpired } from './index-28x02ITB.cjs';
|
|
3
3
|
import { M as MinimalSanitizeConfig } from './index-nvLKgCm9.cjs';
|
|
4
4
|
export { i as sanitize } from './index-nvLKgCm9.cjs';
|
|
5
5
|
export { AnthropicAdapter } from './adapters/anthropic.cjs';
|
|
6
6
|
export { OpenAIAdapter } from './adapters/openai.cjs';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 判断 ManagedModel 是否声明支持指定输入模态.
|
|
10
|
+
*
|
|
11
|
+
* 语义:
|
|
12
|
+
* - model 为 null/undefined → false
|
|
13
|
+
* - model.inputModalities 缺失或非数组 → false (保守, 未声明不当支持)
|
|
14
|
+
* - 大小写敏感 (上游契约即小写 'text' | 'image')
|
|
15
|
+
*/
|
|
16
|
+
declare function modelSupportsInputModality(model: ManagedModel | null | undefined, modality: InputModality): boolean;
|
|
17
|
+
/** 等价 modelSupportsInputModality(model, 'image') — 调用方常见快捷判定. */
|
|
18
|
+
declare function modelSupportsImageInput(model: ManagedModel | null | undefined): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 在 catalog 中按 catalog 顺序查找首个支持指定模态的模型.
|
|
21
|
+
*
|
|
22
|
+
* 选择规则:
|
|
23
|
+
* 1. isEnabled !== false (默认开, 显式 false 才剔除)
|
|
24
|
+
* 2. inputModalities 包含指定模态
|
|
25
|
+
* 3. 命中后按 catalog 顺序返回第一个; 未命中返 null
|
|
26
|
+
*
|
|
27
|
+
* 注意: 该 helper 不读 isDefault, 调用方需要 "默认优先" 请用
|
|
28
|
+
* findDesktopVisualUnderstandingModel 或自行排序.
|
|
29
|
+
*/
|
|
30
|
+
declare function findFirstModelByInputModality(models: ManagedModel[], modality: InputModality): ManagedModel | null;
|
|
31
|
+
/**
|
|
32
|
+
* 在 catalog 中选出最适合做 "桌面视觉理解 sidecar" 的模型.
|
|
33
|
+
*
|
|
34
|
+
* 设计目的: CrabCode desktop automation 链路里, 主模型不一定多模态;
|
|
35
|
+
* 截图先送 sidecar 解析成结构化 UI 描述, 再喂主模型. 这里选 sidecar 模型
|
|
36
|
+
* 严格走运营标注的 supports_desktop_visual_understanding capability, 不靠
|
|
37
|
+
* 模型名猜.
|
|
38
|
+
*
|
|
39
|
+
* 选择规则 (按用户指定顺序):
|
|
40
|
+
* 1. isEnabled !== false
|
|
41
|
+
* 2. capabilities.supports_desktop_visual_understanding === true
|
|
42
|
+
* 3. inputModalities 包含 'image' (必须真能吃图)
|
|
43
|
+
* 4. 命中集合中优先 isDefault === true; 否则返回 catalog 顺序第一个
|
|
44
|
+
*
|
|
45
|
+
* 全部不满足返 null. 调用方收到 null 应:
|
|
46
|
+
* - 提示用户在管理后台/网关侧开启桌面视觉 sidecar 模型, 或
|
|
47
|
+
* - 降级停掉依赖截图的工作流, 而不是硬选一个非视觉模型送图.
|
|
48
|
+
*/
|
|
49
|
+
declare function findDesktopVisualUnderstandingModel(models: ManagedModel[]): ManagedModel | null;
|
|
50
|
+
|
|
8
51
|
/**
|
|
9
52
|
* 从 well-known 端点获取 Desktop OAuth 服务元数据。
|
|
10
53
|
*
|
|
@@ -105,8 +148,24 @@ declare const ScopeWallet = "wallet";
|
|
|
105
148
|
declare const ScopeWalletReadonly = "wallet:readonly";
|
|
106
149
|
/** @deprecated */
|
|
107
150
|
declare const ScopeProfile = "profile";
|
|
151
|
+
declare const ScopeComplianceEvidenceRead = "compliance:evidence:read";
|
|
152
|
+
declare const ScopeComplianceEvidenceWrite = "compliance:evidence:write";
|
|
153
|
+
declare const ScopeComplianceTimestampIssue = "compliance:timestamp:issue";
|
|
154
|
+
declare const ScopeComplianceTimestampVerify = "compliance:timestamp:verify";
|
|
155
|
+
declare const ScopeComplianceContractSigningRead = "compliance:contract_signing:read";
|
|
156
|
+
declare const ScopeComplianceContractSigningWrite = "compliance:contract_signing:write";
|
|
157
|
+
declare const ScopeComplianceSealManage = "compliance:seal:manage";
|
|
158
|
+
declare const ScopeComplianceSealApprovalRequest = "compliance:seal_approval:request";
|
|
159
|
+
declare const ScopeComplianceSealApprovalApprove = "compliance:seal_approval:approve";
|
|
160
|
+
declare const ScopeComplianceSealUseExecute = "compliance:seal_use:execute";
|
|
161
|
+
declare const ScopeComplianceReportsRead = "compliance:reports:read";
|
|
162
|
+
declare const ScopeComplianceReportsPublish = "compliance:reports:publish";
|
|
163
|
+
/** 类型联合:合规域细粒度 scope。Java compliance verifier 只按细粒度匹配, 不做分组展开。 */
|
|
164
|
+
type ComplianceScope = typeof ScopeComplianceEvidenceRead | typeof ScopeComplianceEvidenceWrite | typeof ScopeComplianceTimestampIssue | typeof ScopeComplianceTimestampVerify | typeof ScopeComplianceContractSigningRead | typeof ScopeComplianceContractSigningWrite | typeof ScopeComplianceSealManage | typeof ScopeComplianceSealApprovalRequest | typeof ScopeComplianceSealApprovalApprove | typeof ScopeComplianceSealUseExecute | typeof ScopeComplianceReportsRead | typeof ScopeComplianceReportsPublish;
|
|
108
165
|
/** 全部分组 scope (推荐) */
|
|
109
166
|
declare function allScopes(): string[];
|
|
167
|
+
/** 全部合规域 scope。OAuth 申请合规权限时使用; 谨慎一次性申请全部, 推荐按业务最小集合申请。 */
|
|
168
|
+
declare function complianceScopes(): ComplianceScope[];
|
|
110
169
|
/** 模型服务相关 scope */
|
|
111
170
|
declare function modelScopes(): string[];
|
|
112
171
|
/** 商城/钱包 scope */
|
|
@@ -114,6 +173,340 @@ declare function commerceScopes(): string[];
|
|
|
114
173
|
/** 技能/工具 scope */
|
|
115
174
|
declare function skillScopes(): string[];
|
|
116
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Compliance envelope 稳定业务状态。
|
|
178
|
+
*
|
|
179
|
+
* 字面量与 Java {@code EnvelopeStatusEnum} 的 `name()` 一致(这是 enum,是 wire 上的实际
|
|
180
|
+
* 字符串);前端按这些字符串分支展示文案。
|
|
181
|
+
*/
|
|
182
|
+
type ComplianceEnvelopeStatus = 'DRAFT' | 'CONTRACT_READY' | 'APPROVED' | 'SIGN_PENDING' | 'PENDING_EVIDENCE' | 'PENDING_RECONCILIATION' | 'SUCCESS' | 'FAILED' | 'CANCELED';
|
|
183
|
+
/** Compliance 用印审批稳定状态。 */
|
|
184
|
+
type ComplianceSealApprovalStatus = 'DRAFT' | 'SUBMITTED' | 'APPROVED' | 'REJECTED' | 'CANCELED' | 'USED' | 'EXPIRED';
|
|
185
|
+
/** Provider 业务状态(前端可见的脱敏视图,不暴露下游内部字段)。 */
|
|
186
|
+
type ComplianceProviderStatus = 'pending' | 'success' | 'failed' | 'unknown' | 'retrying';
|
|
187
|
+
/**
|
|
188
|
+
* 计费 / 履约的对外稳定状态视图。distribution compliance-billing 内部 API
|
|
189
|
+
* (quote/reserve/commit/cancel/reconcile) 不暴露给前端 — 前端只能看见这 4 个语义。
|
|
190
|
+
*/
|
|
191
|
+
type ComplianceBillingDisplayStatus = 'reserved' | 'committed' | 'canceled' | 'pending_reconciliation';
|
|
192
|
+
/** 高风险动作 step-up — 重新做 OAuth introspection 或重新登录,提升 token 等级后再尝试。 */
|
|
193
|
+
declare const ErrComplianceStepUpRequired = "COMPLIANCE_STEP_UP_REQUIRED";
|
|
194
|
+
/** envelope 闸门关闭 — 审批 gate 等条件未同时就绪,前端展示"功能开放中"。 */
|
|
195
|
+
declare const ErrEnvelopeGateClosed = "ENVELOPE_GATE_CLOSED";
|
|
196
|
+
/** 履约 provider 未配置 — 受控环境材料缺失时业务路径会一致拒绝,不要前端重试。 */
|
|
197
|
+
declare const ErrProviderNotConfigured = "PROVIDER_NOT_CONFIGURED";
|
|
198
|
+
/** Provider 返回 unknown / retrying — 客户必须等待对账,前端展示"处理中(人工核对)"。 */
|
|
199
|
+
declare const ErrProviderUnknownNoRetry = "PROVIDER_REQUEST_UNKNOWN_NO_RETRY";
|
|
200
|
+
/** callback 不能直接确认扣费 — 后端守门,前端无需处理,记录到审计日志展示即可。 */
|
|
201
|
+
declare const ErrBillingCallbackCannotCommit = "BILLING_CALLBACK_CANNOT_COMMIT";
|
|
202
|
+
/** provider 成功但本地未验证通过,不允许扣费。 */
|
|
203
|
+
declare const ErrBillingCommitRequiresLocalVerify = "BILLING_COMMIT_REQUIRES_LOCAL_VERIFY";
|
|
204
|
+
/** distribution compliance-billing 必须 S2S — 前端误调用时拿到该错误码,禁止 retry。 */
|
|
205
|
+
declare const ErrBillingS2sForbidden = "BILLING_S2S_FORBIDDEN";
|
|
206
|
+
/** 审批 gate 各类失败语义(前端展示"审批中 / 审批已用 / 审批失效")。 */
|
|
207
|
+
declare const ErrSealApprovalNotApproved = "SEAL_APPROVAL_STATE_NOT_APPROVED";
|
|
208
|
+
declare const ErrSealApprovalExpired = "SEAL_APPROVAL_EXPIRED";
|
|
209
|
+
declare const ErrSealApprovalNonceUsed = "SEAL_APPROVAL_NONCE_USED";
|
|
210
|
+
declare const ErrSealApprovalContractHashMismatch = "SEAL_APPROVAL_CONTRACT_HASH_MISMATCH";
|
|
211
|
+
declare const ErrSealApprovalSealMismatch = "SEAL_APPROVAL_SEAL_MISMATCH";
|
|
212
|
+
declare const ErrSealApprovalLocationMismatch = "SEAL_APPROVAL_LOCATION_MISMATCH";
|
|
213
|
+
declare const ErrSealApprovalTransactorMismatch = "SEAL_APPROVAL_TRANSACTOR_MISMATCH";
|
|
214
|
+
/** 用印重复消费防护 — 前端遇到该错误必须刷新审批单状态,不允许"换一次 nonce 再试"。 */
|
|
215
|
+
declare const ErrSealUseAlreadyConsumed = "SEAL_USE_ALREADY_CONSUMED";
|
|
216
|
+
/** 该错误码联合用于前端选择性展示文案;非穷举式 enum,后端保留新增空间。 */
|
|
217
|
+
type ComplianceClientErrorCode = typeof ErrComplianceStepUpRequired | typeof ErrEnvelopeGateClosed | typeof ErrProviderNotConfigured | typeof ErrProviderUnknownNoRetry | typeof ErrBillingCallbackCannotCommit | typeof ErrBillingCommitRequiresLocalVerify | typeof ErrBillingS2sForbidden | typeof ErrSealApprovalNotApproved | typeof ErrSealApprovalExpired | typeof ErrSealApprovalNonceUsed | typeof ErrSealApprovalContractHashMismatch | typeof ErrSealApprovalSealMismatch | typeof ErrSealApprovalLocationMismatch | typeof ErrSealApprovalTransactorMismatch | typeof ErrSealUseAlreadyConsumed;
|
|
218
|
+
/**
|
|
219
|
+
* 判定一个错误码是否属于"需要前端引导用户重新认证/审批"的高级语义,
|
|
220
|
+
* 而不是简单 retry。这类错误前端不允许在 UI 层做自动重试。
|
|
221
|
+
*/
|
|
222
|
+
declare function isComplianceTerminalError(code: string): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* "是否允许在 UI 上呈现为'扣费已确认'"的判定。
|
|
225
|
+
* provider 状态为 unknown / retrying / pending 时一律不展示为已确认。
|
|
226
|
+
*/
|
|
227
|
+
declare function isBillingConfirmable(providerStatus: ComplianceProviderStatus | undefined, billingStatus: ComplianceBillingDisplayStatus | undefined): boolean;
|
|
228
|
+
|
|
229
|
+
type ComplianceAssetType = 'CONTRACT' | 'CODE' | 'IMAGE' | 'DOCUMENT' | 'ARCHIVE' | 'HASH_ONLY' | 'URL_SNAPSHOT' | 'RELEASE' | 'LOG' | 'OTHER';
|
|
230
|
+
type ComplianceHashAlgorithm = 'sha256' | 'sha512' | 'sm3';
|
|
231
|
+
type ComplianceDigestSource = 'CLIENT' | 'COMPLIANCE_SERVICE' | 'PROVIDER';
|
|
232
|
+
type CompliancePrivacyLevel = 'public' | 'private';
|
|
233
|
+
/** 证据资产对外稳定视图。对应后端 EvidenceAssetRespVO。 */
|
|
234
|
+
interface EvidenceAsset {
|
|
235
|
+
id: number;
|
|
236
|
+
/** 业务编号;SDK / 前端引用时优先使用 evidenceNo。 */
|
|
237
|
+
evidenceNo: string;
|
|
238
|
+
/** publish 后的公开 verify code;DRAFT / 非 public privacy 时为 null。 */
|
|
239
|
+
publicVerifyCode?: string | null;
|
|
240
|
+
assetType: ComplianceAssetType | string;
|
|
241
|
+
name: string;
|
|
242
|
+
mimeType?: string | null;
|
|
243
|
+
size?: number | null;
|
|
244
|
+
hashAlgorithm: ComplianceHashAlgorithm | string;
|
|
245
|
+
/** 资产 hash(hex 字符串)。 */
|
|
246
|
+
contentHash: string;
|
|
247
|
+
canonicalizationProfile?: string | null;
|
|
248
|
+
digestSource: ComplianceDigestSource | string;
|
|
249
|
+
privacyLevel: CompliancePrivacyLevel | string;
|
|
250
|
+
status: string;
|
|
251
|
+
}
|
|
252
|
+
/** 创建证据资产请求;与 Java EvidenceAssetCreateReq 对齐。 */
|
|
253
|
+
interface CreateEvidenceAssetRequest {
|
|
254
|
+
/** AssetTypeEnum.name()。 */
|
|
255
|
+
assetType: ComplianceAssetType | string;
|
|
256
|
+
name: string;
|
|
257
|
+
mimeType?: string;
|
|
258
|
+
/** 'sha256' / 'sha512' / 'sm3'。 */
|
|
259
|
+
hashAlgorithm: ComplianceHashAlgorithm | string;
|
|
260
|
+
/** hex 字符串;hash-only 资产必填。 */
|
|
261
|
+
declaredHash?: string;
|
|
262
|
+
/** CLIENT / COMPLIANCE_SERVICE / PROVIDER。 */
|
|
263
|
+
digestSource?: ComplianceDigestSource | string;
|
|
264
|
+
/** 原文 base64;hash-only 时缺省即可。 */
|
|
265
|
+
contentBase64?: string;
|
|
266
|
+
/** public / private(默认 private)。 */
|
|
267
|
+
privacyLevel?: CompliancePrivacyLevel | string;
|
|
268
|
+
source?: string;
|
|
269
|
+
}
|
|
270
|
+
/** 公开 verify 结果。隐私边界:不暴露 PII / 合同原文 / storage / provider raw。 */
|
|
271
|
+
interface PublicEvidenceVerifyResult {
|
|
272
|
+
evidenceNo: string;
|
|
273
|
+
assetType: string;
|
|
274
|
+
hashAlgorithm: string;
|
|
275
|
+
contentHash: string;
|
|
276
|
+
size?: number | null;
|
|
277
|
+
canonicalizationProfile?: string | null;
|
|
278
|
+
verifiedAt: string;
|
|
279
|
+
packageId?: number | null;
|
|
280
|
+
manifestHash?: string | null;
|
|
281
|
+
packageHash?: string | null;
|
|
282
|
+
manifestOfflineVerify: boolean;
|
|
283
|
+
}
|
|
284
|
+
type ComplianceTimestampVerificationStatus = 'PENDING' | 'VERIFIED' | 'FAILED' | 'LOCAL_VERIFY_FAILED' | 'UNKNOWN' | 'RETRYING';
|
|
285
|
+
/** 时间章 token 对外视图(不含 provider/object/tsa 内部字段)。 */
|
|
286
|
+
interface TimestampToken {
|
|
287
|
+
id: number;
|
|
288
|
+
assetId: number;
|
|
289
|
+
policyOid?: string | null;
|
|
290
|
+
serialNumber?: string | null;
|
|
291
|
+
/** gen_time ISO-8601;UNKNOWN/PENDING 状态可能为 null。 */
|
|
292
|
+
genTime?: string | null;
|
|
293
|
+
accuracy?: string | null;
|
|
294
|
+
verificationStatus: ComplianceTimestampVerificationStatus | string;
|
|
295
|
+
verifiedAt?: string | null;
|
|
296
|
+
verificationError?: string | null;
|
|
297
|
+
}
|
|
298
|
+
/** 申请时间章请求。`provider` 字段已从服务端契约下线;SDK 永远不传。 */
|
|
299
|
+
interface IssueTimestampRequest {
|
|
300
|
+
name?: string;
|
|
301
|
+
mimeType?: string;
|
|
302
|
+
hashAlgorithm: ComplianceHashAlgorithm | string;
|
|
303
|
+
/** 客户端声明 digest(hex);contentBase64 非空时作为校验值。 */
|
|
304
|
+
digest?: string;
|
|
305
|
+
contentBase64?: string;
|
|
306
|
+
}
|
|
307
|
+
/** verify 请求 / 结果。 */
|
|
308
|
+
interface VerifyTimestampRequest {
|
|
309
|
+
tokenId: number;
|
|
310
|
+
}
|
|
311
|
+
interface TimestampVerifyResult {
|
|
312
|
+
passed: boolean;
|
|
313
|
+
reason: string;
|
|
314
|
+
}
|
|
315
|
+
interface EvidencePackage {
|
|
316
|
+
id: number;
|
|
317
|
+
assetId: number;
|
|
318
|
+
timestampTokenId?: number | null;
|
|
319
|
+
chainId: string;
|
|
320
|
+
packageVersion: string;
|
|
321
|
+
hashAlgorithm: string;
|
|
322
|
+
manifestHash: string;
|
|
323
|
+
packageHash: string;
|
|
324
|
+
status: string;
|
|
325
|
+
}
|
|
326
|
+
interface ComplianceReport {
|
|
327
|
+
id: number;
|
|
328
|
+
reportNo: string;
|
|
329
|
+
reportType: string;
|
|
330
|
+
status: string;
|
|
331
|
+
assetId?: number | null;
|
|
332
|
+
packageId?: number | null;
|
|
333
|
+
publicUrlToken?: string | null;
|
|
334
|
+
publishedAt?: string | null;
|
|
335
|
+
bodyHash?: string | null;
|
|
336
|
+
}
|
|
337
|
+
interface CreateReportRequest {
|
|
338
|
+
assetId: number;
|
|
339
|
+
packageId: number;
|
|
340
|
+
}
|
|
341
|
+
/** 离线复核下载 VO;建议调用方持久化作为长期可重复验证依据。 */
|
|
342
|
+
interface ReportDownload {
|
|
343
|
+
id: number;
|
|
344
|
+
reportNo: string;
|
|
345
|
+
reportType: string;
|
|
346
|
+
status: string;
|
|
347
|
+
bodyHash?: string | null;
|
|
348
|
+
publishedAt?: string | null;
|
|
349
|
+
assetEvidenceNo?: string | null;
|
|
350
|
+
assetHashAlgorithm?: string | null;
|
|
351
|
+
assetContentHash?: string | null;
|
|
352
|
+
packageManifestHash?: string | null;
|
|
353
|
+
packageHash?: string | null;
|
|
354
|
+
packageHashAlgorithm?: string | null;
|
|
355
|
+
timestampSerialNumber?: string | null;
|
|
356
|
+
timestampGenTime?: string | null;
|
|
357
|
+
timestampVerificationStatus?: string | null;
|
|
358
|
+
}
|
|
359
|
+
interface SigningEnvelope {
|
|
360
|
+
id: number;
|
|
361
|
+
envelopeNo: string;
|
|
362
|
+
applicantUserId?: string | null;
|
|
363
|
+
status: string;
|
|
364
|
+
primaryContractId?: number | null;
|
|
365
|
+
contractHash?: string | null;
|
|
366
|
+
hashAlgorithm?: string | null;
|
|
367
|
+
billingGroupId?: string | null;
|
|
368
|
+
chainId?: string | null;
|
|
369
|
+
requestId?: string | null;
|
|
370
|
+
pendingReason?: string | null;
|
|
371
|
+
signedAt?: string | null;
|
|
372
|
+
evidenceReadyAt?: string | null;
|
|
373
|
+
committedAt?: string | null;
|
|
374
|
+
}
|
|
375
|
+
/** 创建 envelope 请求;只保留调用方业务字段,内部主体快照和履约通道由后端推导。 */
|
|
376
|
+
interface CreateSigningEnvelopeRequest {
|
|
377
|
+
envelopeNo?: string;
|
|
378
|
+
requestId?: string;
|
|
379
|
+
/** 调用方稳定 idempotency-key(不传则由 Idempotency-Key header 兜底)。 */
|
|
380
|
+
idempotencyKey?: string;
|
|
381
|
+
billingGroupId?: string;
|
|
382
|
+
chainId?: string;
|
|
383
|
+
}
|
|
384
|
+
/** sign 请求;service 默认闸门关闭,SDK 写示例必须处理 ENVELOPE_GATE_CLOSED 错误。 */
|
|
385
|
+
interface SignEnvelopeRequest {
|
|
386
|
+
approvalRequestId?: number;
|
|
387
|
+
contractId?: number;
|
|
388
|
+
contractHash?: string;
|
|
389
|
+
sealId?: number;
|
|
390
|
+
signLocationType?: string;
|
|
391
|
+
signLocationPayload?: string;
|
|
392
|
+
transactorId?: number;
|
|
393
|
+
requestId?: string;
|
|
394
|
+
idempotencyKey?: string;
|
|
395
|
+
}
|
|
396
|
+
/** H5 短链请求。 */
|
|
397
|
+
interface CreateH5SigningUrlRequest extends SignEnvelopeRequest {
|
|
398
|
+
}
|
|
399
|
+
interface SealApproval {
|
|
400
|
+
id: number;
|
|
401
|
+
envelopeId?: number | null;
|
|
402
|
+
contractId?: number | null;
|
|
403
|
+
contractHash?: string | null;
|
|
404
|
+
hashAlgorithm?: string | null;
|
|
405
|
+
sealId?: number | null;
|
|
406
|
+
applicantUserId?: string | null;
|
|
407
|
+
approverUserId?: string | null;
|
|
408
|
+
transactorId?: number | null;
|
|
409
|
+
signLocationType?: string | null;
|
|
410
|
+
signLocationPayload?: string | null;
|
|
411
|
+
reason?: string | null;
|
|
412
|
+
expiresAt?: string | null;
|
|
413
|
+
status: string;
|
|
414
|
+
approvedAt?: string | null;
|
|
415
|
+
rejectedAt?: string | null;
|
|
416
|
+
canceledAt?: string | null;
|
|
417
|
+
}
|
|
418
|
+
/** 提交审批;provider 侧字段由后端归一,SDK 调用方不传。 */
|
|
419
|
+
interface SubmitSealApprovalRequest {
|
|
420
|
+
envelopeId?: number;
|
|
421
|
+
contractId?: number;
|
|
422
|
+
contractHash?: string;
|
|
423
|
+
hashAlgorithm?: string;
|
|
424
|
+
sealId?: number;
|
|
425
|
+
approverUserId?: string;
|
|
426
|
+
transactorId?: number;
|
|
427
|
+
signLocationType?: string;
|
|
428
|
+
signLocationPayload?: string;
|
|
429
|
+
reason?: string;
|
|
430
|
+
}
|
|
431
|
+
interface ApproveSealApprovalQuery {
|
|
432
|
+
expiresAt?: string;
|
|
433
|
+
note?: string;
|
|
434
|
+
}
|
|
435
|
+
interface RejectSealApprovalQuery {
|
|
436
|
+
reason?: string;
|
|
437
|
+
}
|
|
438
|
+
interface CancelSealApprovalQuery {
|
|
439
|
+
reason?: string;
|
|
440
|
+
}
|
|
441
|
+
type ComplianceProviderRequestStatus = 'PENDING' | 'SUCCESS' | 'FAILED' | 'UNKNOWN' | 'RETRYING';
|
|
442
|
+
interface ProviderRequestStatusView {
|
|
443
|
+
id: number;
|
|
444
|
+
status: ComplianceProviderRequestStatus | string;
|
|
445
|
+
/** SUCCESS / FAILED 终态。 */
|
|
446
|
+
terminal: boolean;
|
|
447
|
+
/** 当前状态是否允许 SDK 安全重试请求(仅对 RETRYING 为 true)。 */
|
|
448
|
+
retryable: boolean;
|
|
449
|
+
businessNo?: string | null;
|
|
450
|
+
contractNo?: string | null;
|
|
451
|
+
sealId?: string | null;
|
|
452
|
+
attemptCount?: number | null;
|
|
453
|
+
reconciliationStatus?: string | null;
|
|
454
|
+
nextRetryAt?: string | null;
|
|
455
|
+
requestedAt?: string | null;
|
|
456
|
+
respondedAt?: string | null;
|
|
457
|
+
}
|
|
458
|
+
/** Compliance 写操作选项;写操作不自动 retry,不自动 401 重放。 */
|
|
459
|
+
interface ComplianceWriteOptions {
|
|
460
|
+
/**
|
|
461
|
+
* 调用方稳定的幂等键。写操作强烈建议持久化;缺省时服务端按 UUID 兜底,但调用方
|
|
462
|
+
* 在重试 / 恢复时无法对账。
|
|
463
|
+
*/
|
|
464
|
+
idempotencyKey?: string;
|
|
465
|
+
signal?: AbortSignal;
|
|
466
|
+
}
|
|
467
|
+
/** 轮询参数(exponential backoff)。 */
|
|
468
|
+
interface CompliancePollOptions {
|
|
469
|
+
/** 总超时(ms),缺省 60s。 */
|
|
470
|
+
timeoutMs?: number;
|
|
471
|
+
/** 初始 interval(ms),缺省 1000。 */
|
|
472
|
+
initialIntervalMs?: number;
|
|
473
|
+
/** interval 倍增上限(ms),缺省 5000。 */
|
|
474
|
+
maxIntervalMs?: number;
|
|
475
|
+
/** 倍增系数,缺省 1.5。 */
|
|
476
|
+
multiplier?: number;
|
|
477
|
+
signal?: AbortSignal;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* SDK 内部 symbolic key;用于代码分支判断与文档。**不是 wire contract**。
|
|
482
|
+
*/
|
|
483
|
+
type ComplianceErrorKey = 'COMPLIANCE_UNAUTHORIZED' | 'COMPLIANCE_INSUFFICIENT_SCOPE' | 'COMPLIANCE_STEP_UP_REQUIRED' | 'COMPLIANCE_TOKEN_INVALID' | 'SUBJECT_SNAPSHOT_REQUIRED' | 'SUBJECT_SNAPSHOT_NOT_FOUND' | 'SUBJECT_SNAPSHOT_TENANT_MISMATCH' | 'EVIDENCE_ASSET_NOT_FOUND' | 'EVIDENCE_ASSET_HASH_MISMATCH' | 'EVIDENCE_ASSET_PAYLOAD_REQUIRED' | 'TIMESTAMP_TOKEN_NOT_FOUND' | 'TIMESTAMP_PROVIDER_FAILED' | 'TIMESTAMP_PROVIDER_UNKNOWN' | 'TIMESTAMP_LOCAL_VERIFY_FAILED' | 'TIMESTAMP_PROVIDER_NOT_AVAILABLE' | 'EVIDENCE_PACKAGE_NOT_FOUND' | 'EVIDENCE_PACKAGE_TIMESTAMP_REQUIRED' | 'EVIDENCE_PACKAGE_MANIFEST_HASH_MISMATCH' | 'REPORT_NOT_FOUND' | 'REPORT_ALREADY_PUBLISHED' | 'REPORT_DRAFT_REQUIRED' | 'EVIDENCE_VERIFY_TARGET_REQUIRED' | 'EVIDENCE_VERIFY_TARGET_NOT_FOUND' | 'PROVIDER_REQUEST_UNKNOWN_NO_RETRY' | 'PROVIDER_CALLBACK_SOURCE_INVALID' | 'PROVIDER_NOT_CONFIGURED' | 'PROVIDER_REQUEST_NOT_FOUND' | 'PROVIDER_REQUEST_IDEMPOTENCY_REQUIRED' | 'PROVIDER_REQUEST_STATUS_NOT_TERMINAL' | 'ENVELOPE_NOT_FOUND' | 'ENVELOPE_TENANT_MISMATCH' | 'ENVELOPE_STATE_NOT_ALLOWED' | 'ENVELOPE_GATE_CLOSED' | 'CONTRACT_NOT_FOUND' | 'CONTRACT_HASH_MISMATCH' | 'PROVIDER_AUTHORIZATION_NOT_CONFIRMED' | 'ENVELOPE_EVIDENCE_NOT_READY' | 'SEAL_ASSET_NOT_FOUND' | 'SEAL_APPROVAL_NOT_FOUND' | 'SEAL_APPROVAL_STATE_NOT_APPROVED' | 'SEAL_APPROVAL_EXPIRED' | 'SEAL_APPROVAL_ALREADY_USED' | 'SEAL_APPROVAL_NONCE_USED' | 'SEAL_APPROVAL_SEAL_MISMATCH' | 'SEAL_APPROVAL_LOCATION_MISMATCH' | 'SEAL_APPROVAL_TRANSACTOR_MISMATCH' | 'SEAL_APPROVAL_CONTRACT_HASH_MISMATCH' | 'SEAL_APPROVAL_INVALID_TRANSITION' | 'SEAL_USE_ALREADY_CONSUMED' | 'AUDIT_CHAIN_TAMPER_DETECTED' | 'BILLING_COMMIT_REQUIRES_LOCAL_VERIFY' | 'BILLING_COMMIT_REQUIRES_PROVIDER_SUCCESS' | 'BILLING_CALLBACK_CANNOT_COMMIT' | 'BILLING_PROVIDER_UNKNOWN_NOT_COMMITTABLE' | 'BILLING_S2S_FORBIDDEN' | 'UNKNOWN_COMPLIANCE_ERROR';
|
|
484
|
+
/** 单个错误的 SDK 视图。 */
|
|
485
|
+
interface ComplianceErrorInfo {
|
|
486
|
+
/** Java numeric error code (wire contract)。 */
|
|
487
|
+
code: number;
|
|
488
|
+
/** 服务端原始 message(中文,可变);仅用于日志/展示。 */
|
|
489
|
+
message: string;
|
|
490
|
+
/** SDK 分支判断用 symbolic key。 */
|
|
491
|
+
key: ComplianceErrorKey;
|
|
492
|
+
/** 是否安全自动重试 — compliance 写接口几乎全为 false。 */
|
|
493
|
+
retryable: boolean;
|
|
494
|
+
/** 是否已经是终态 — 用户必须用新 idempotency-key 重新发起。 */
|
|
495
|
+
terminal: boolean;
|
|
496
|
+
/** 高风险动作需要 step-up / introspection。 */
|
|
497
|
+
stepUpRequired: boolean;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* 把一个 BusinessError 分类为 compliance 视图。
|
|
501
|
+
* 非 compliance 段位的错误码会回退到 UNKNOWN_COMPLIANCE_ERROR,调用方应该当作业务错误处理。
|
|
502
|
+
*/
|
|
503
|
+
declare function classifyComplianceError(err: BusinessError): ComplianceErrorInfo;
|
|
504
|
+
/**
|
|
505
|
+
* 判断 BusinessError 是否属于 compliance 段位(1-031-xxx-xxx)。
|
|
506
|
+
* 不在段位的错误码可能来自其它 yudao 模块,按通用业务错误处理即可。
|
|
507
|
+
*/
|
|
508
|
+
declare function isComplianceBusinessError(err: BusinessError): boolean;
|
|
509
|
+
|
|
117
510
|
/**
|
|
118
511
|
* Token 持久化接口
|
|
119
512
|
* 桌面智能体可自行实现 (如 macOS Keychain / Windows Credential Manager)
|
|
@@ -284,196 +677,6 @@ declare function effectivePolicy(p: RetryPolicy | null | undefined): Required<Re
|
|
|
284
677
|
*/
|
|
285
678
|
declare function computeBackoff(p: Required<RetryPolicy>, attempt: number, err: unknown): number;
|
|
286
679
|
|
|
287
|
-
/** SDK 为单个 content block 缓存的元数据 */
|
|
288
|
-
interface BlockMeta {
|
|
289
|
-
type: string;
|
|
290
|
-
ephemeral: boolean;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* 按 Anthropic SSE 事件类型解析 data, 更新 blockTypeMap, 返回 [index, type, ephemeral]。
|
|
294
|
-
*
|
|
295
|
-
* 仅当事件为 content_block_start / content_block_delta / content_block_stop
|
|
296
|
-
* 时返回非空 type; 其他事件返回空 type, 调用方据此判别是否填充 StreamEvent 元数据字段。
|
|
297
|
-
*/
|
|
298
|
-
declare function extractAnthropicBlockMeta(eventType: string, data: string, blockTypeMap: Map<number, BlockMeta>): [number, string, boolean];
|
|
299
|
-
|
|
300
|
-
type AgentRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
301
|
-
interface AgentRunLocalContextPolicy {
|
|
302
|
-
enabled?: boolean;
|
|
303
|
-
readonly?: boolean;
|
|
304
|
-
maxBytes?: number;
|
|
305
|
-
allowedTools?: string[];
|
|
306
|
-
}
|
|
307
|
-
interface AgentRunArtifactPolicy {
|
|
308
|
-
enabled?: boolean;
|
|
309
|
-
maxFiles?: number;
|
|
310
|
-
}
|
|
311
|
-
interface AgentRunCreateRequest {
|
|
312
|
-
appId: string;
|
|
313
|
-
mode?: string;
|
|
314
|
-
sessionId?: string;
|
|
315
|
-
input: string;
|
|
316
|
-
messages?: unknown[];
|
|
317
|
-
model?: string;
|
|
318
|
-
activeSkillIds?: string[];
|
|
319
|
-
knowledgeBaseIds?: string[];
|
|
320
|
-
metadata?: Record<string, string>;
|
|
321
|
-
localContextPolicy?: AgentRunLocalContextPolicy;
|
|
322
|
-
artifactPolicy?: AgentRunArtifactPolicy;
|
|
323
|
-
}
|
|
324
|
-
interface AgentRun {
|
|
325
|
-
runId: string;
|
|
326
|
-
sessionId: string;
|
|
327
|
-
appId?: string;
|
|
328
|
-
mode?: string;
|
|
329
|
-
status: AgentRunStatus;
|
|
330
|
-
createdAt?: string;
|
|
331
|
-
startedAt?: string;
|
|
332
|
-
completedAt?: string;
|
|
333
|
-
error?: AgentRunErrorPayload;
|
|
334
|
-
metadata?: Record<string, string>;
|
|
335
|
-
}
|
|
336
|
-
interface AgentRunCreateResponse {
|
|
337
|
-
runId: string;
|
|
338
|
-
sessionId: string;
|
|
339
|
-
status: AgentRunStatus;
|
|
340
|
-
}
|
|
341
|
-
interface AgentRunArtifact {
|
|
342
|
-
id: string;
|
|
343
|
-
filename: string;
|
|
344
|
-
contentType?: string;
|
|
345
|
-
size?: number;
|
|
346
|
-
type?: string;
|
|
347
|
-
metadata?: Record<string, string>;
|
|
348
|
-
}
|
|
349
|
-
interface AgentRunArtifactList {
|
|
350
|
-
artifacts: AgentRunArtifact[];
|
|
351
|
-
}
|
|
352
|
-
interface AgentRunDownload {
|
|
353
|
-
data: Uint8Array;
|
|
354
|
-
filename: string;
|
|
355
|
-
contentType?: string;
|
|
356
|
-
}
|
|
357
|
-
interface AgentRunUsage {
|
|
358
|
-
inputTokens?: number;
|
|
359
|
-
outputTokens?: number;
|
|
360
|
-
totalTokens?: number;
|
|
361
|
-
cacheReadTokens?: number;
|
|
362
|
-
cacheCreateTokens?: number;
|
|
363
|
-
exact?: boolean;
|
|
364
|
-
source?: string;
|
|
365
|
-
[key: string]: unknown;
|
|
366
|
-
}
|
|
367
|
-
interface AgentRunSettlement {
|
|
368
|
-
requestId?: string;
|
|
369
|
-
status?: string;
|
|
370
|
-
consumeStatus?: string;
|
|
371
|
-
inputTokens?: number;
|
|
372
|
-
outputTokens?: number;
|
|
373
|
-
totalTokens?: number;
|
|
374
|
-
cacheReadTokens?: number;
|
|
375
|
-
cacheCreateTokens?: number;
|
|
376
|
-
tokenRemaining?: number;
|
|
377
|
-
callRemaining?: number;
|
|
378
|
-
retryQueued?: boolean;
|
|
379
|
-
exact?: boolean;
|
|
380
|
-
[key: string]: unknown;
|
|
381
|
-
}
|
|
382
|
-
interface AgentRunErrorPayload {
|
|
383
|
-
code?: string;
|
|
384
|
-
message: string;
|
|
385
|
-
stage?: string;
|
|
386
|
-
retryable?: boolean;
|
|
387
|
-
raw?: unknown;
|
|
388
|
-
}
|
|
389
|
-
interface AgentRunLocalToolResult {
|
|
390
|
-
requestId: string;
|
|
391
|
-
ok: boolean;
|
|
392
|
-
content?: unknown;
|
|
393
|
-
error?: string;
|
|
394
|
-
}
|
|
395
|
-
interface AgentRunLocalToolHandlerContext {
|
|
396
|
-
runId: string;
|
|
397
|
-
requestId: string;
|
|
398
|
-
name: string;
|
|
399
|
-
signal: AbortSignal;
|
|
400
|
-
}
|
|
401
|
-
type AgentRunLocalToolHandler = (input: unknown, context: AgentRunLocalToolHandlerContext) => Promise<unknown> | unknown;
|
|
402
|
-
interface AgentRunStreamOptions {
|
|
403
|
-
/**
|
|
404
|
-
* true by default. When enabled, an error event is converted into
|
|
405
|
-
* AgentRunStreamError after the event has been parsed.
|
|
406
|
-
*/
|
|
407
|
-
throwOnError?: boolean;
|
|
408
|
-
}
|
|
409
|
-
interface AgentRunRunOptions extends AgentRunStreamOptions {
|
|
410
|
-
}
|
|
411
|
-
interface AgentRunWithLocalToolsOptions extends AgentRunRunOptions {
|
|
412
|
-
timeoutMs?: number;
|
|
413
|
-
onEvent?: (event: AgentRunStreamEvent) => void | Promise<void>;
|
|
414
|
-
}
|
|
415
|
-
type AgentRunStreamEvent = {
|
|
416
|
-
type: 'run_started';
|
|
417
|
-
runId: string;
|
|
418
|
-
sessionId: string;
|
|
419
|
-
} | {
|
|
420
|
-
type: 'status';
|
|
421
|
-
status: AgentRunStatus | string;
|
|
422
|
-
message?: string;
|
|
423
|
-
} | {
|
|
424
|
-
type: 'text_delta';
|
|
425
|
-
text: string;
|
|
426
|
-
} | {
|
|
427
|
-
type: 'reasoning_delta';
|
|
428
|
-
text: string;
|
|
429
|
-
} | {
|
|
430
|
-
type: 'tool_call';
|
|
431
|
-
id: string;
|
|
432
|
-
name: string;
|
|
433
|
-
input?: unknown;
|
|
434
|
-
} | {
|
|
435
|
-
type: 'tool_result';
|
|
436
|
-
id: string;
|
|
437
|
-
name?: string;
|
|
438
|
-
result?: unknown;
|
|
439
|
-
error?: string;
|
|
440
|
-
} | {
|
|
441
|
-
type: 'local_tool_request';
|
|
442
|
-
requestId: string;
|
|
443
|
-
name: string;
|
|
444
|
-
input: unknown;
|
|
445
|
-
} | {
|
|
446
|
-
type: 'artifact';
|
|
447
|
-
artifact: AgentRunArtifact;
|
|
448
|
-
} | {
|
|
449
|
-
type: 'sources';
|
|
450
|
-
sources: unknown;
|
|
451
|
-
} | {
|
|
452
|
-
type: 'usage';
|
|
453
|
-
usage: AgentRunUsage;
|
|
454
|
-
} | {
|
|
455
|
-
type: 'settle';
|
|
456
|
-
settlement: AgentRunSettlement;
|
|
457
|
-
} | {
|
|
458
|
-
type: 'error';
|
|
459
|
-
error: AgentRunErrorPayload;
|
|
460
|
-
} | {
|
|
461
|
-
type: 'done';
|
|
462
|
-
runId: string;
|
|
463
|
-
status: AgentRunStatus | string;
|
|
464
|
-
};
|
|
465
|
-
declare class AgentRunStreamError extends Error {
|
|
466
|
-
event: Extract<AgentRunStreamEvent, {
|
|
467
|
-
type: 'error';
|
|
468
|
-
}>;
|
|
469
|
-
code: string;
|
|
470
|
-
stage: string;
|
|
471
|
-
retryable: boolean;
|
|
472
|
-
constructor(event: Extract<AgentRunStreamEvent, {
|
|
473
|
-
type: 'error';
|
|
474
|
-
}>);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
680
|
type FilterStatus = 'ok' | 'admin-bypass' | 'internal-bypass' | 'disabled-by-flag' | 'fallback-tkdist-error' | 'fallback-tkdist-deployment-skew' | 'fallback-no-buckets' | 'fallback-missing-userid' | '';
|
|
478
681
|
declare const FilterStatusOK: FilterStatus;
|
|
479
682
|
declare const FilterStatusAdminBypass: FilterStatus;
|
|
@@ -505,6 +708,17 @@ interface Config {
|
|
|
505
708
|
* 计费安全: 自定义 SafeToRetry 时, 严禁让 POST chat/messages 通过, 否则双扣
|
|
506
709
|
*/
|
|
507
710
|
retryPolicy?: RetryPolicy;
|
|
711
|
+
/**
|
|
712
|
+
* Compliance (时间章 / 电子证据 / 合同签署) API 根地址。
|
|
713
|
+
*
|
|
714
|
+
* Java compliance 模块的 controller 注册在 `/compliance/...` 下,部署到
|
|
715
|
+
* `/admin-api/*` 前缀。未配置时默认 `${serverURL}/admin-api`,也可显式覆盖到
|
|
716
|
+
* 独立 ingress(如 `https://compliance.example.com`)。
|
|
717
|
+
*
|
|
718
|
+
* 该地址不被 `/api/v4` 拼接路径复用,compliance 调用走自己的子 client
|
|
719
|
+
* `client.compliance.*`,不与既有模型网关 API 冲突。
|
|
720
|
+
*/
|
|
721
|
+
complianceBaseURL?: string;
|
|
508
722
|
}
|
|
509
723
|
interface Deferred<T> {
|
|
510
724
|
promise: Promise<T>;
|
|
@@ -529,6 +743,8 @@ declare class Client {
|
|
|
529
743
|
/** SDK 内部使用 — 业务方法 (mixin) 通过 this.* 访问以下字段 */
|
|
530
744
|
/** 服务器根地址 (已 trim 尾随 /) */
|
|
531
745
|
serverURL: string;
|
|
746
|
+
/** Compliance API 根地址 (已 trim 尾随 /); null = 走默认 ${serverURL}/admin-api */
|
|
747
|
+
complianceBaseURL: string | null;
|
|
532
748
|
/** OAuth metadata (lazy loaded) */
|
|
533
749
|
meta: ServerMetadata | null;
|
|
534
750
|
/** 当前 token (内存) */
|
|
@@ -714,6 +930,16 @@ declare class Client {
|
|
|
714
930
|
event: StreamSettlement;
|
|
715
931
|
}, void, void>;
|
|
716
932
|
apiURL(path: string): string;
|
|
933
|
+
/**
|
|
934
|
+
* Compliance API URL 拼接。
|
|
935
|
+
*
|
|
936
|
+
* `complianceBaseURL` 已配置时直接拼接;未配置时默认
|
|
937
|
+
* `${serverURL}/admin-api` + path,匹配 Java compliance controller 的
|
|
938
|
+
* `/compliance/...` 路径。
|
|
939
|
+
*
|
|
940
|
+
* 不复用 `apiURL`:apiURL 强制追加 `/api/v4`,与 compliance 路径不同。
|
|
941
|
+
*/
|
|
942
|
+
complianceURL(path: string): string;
|
|
717
943
|
/** GET/POST/... 通用 JSON 调用 (返回 result 已 typed) */
|
|
718
944
|
doJSON<T>(method: string, path: string, body: unknown | null, signal?: AbortSignal): Promise<T>;
|
|
719
945
|
/** 与 doJSON 相同, 但返回响应 Headers (用于提取 X-Token-Remaining 等) */
|
|
@@ -762,6 +988,317 @@ declare class Client {
|
|
|
762
988
|
}, signal?: AbortSignal): Promise<Response>;
|
|
763
989
|
}
|
|
764
990
|
|
|
991
|
+
declare module '@acosmi/sdk-ts' {
|
|
992
|
+
interface Client {
|
|
993
|
+
/** SDK-facing 时间章与电子证据 / 合同签署能力。 */
|
|
994
|
+
readonly compliance: ComplianceClient;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* 当 compliance polling 检测到终态失败 / 已过 timeout / step-up 时抛出。
|
|
999
|
+
*
|
|
1000
|
+
* 分类逻辑:终态失败优先于 timeout;timeout 不算 retryable,调用方必须用新 idempotency-key
|
|
1001
|
+
* 重新发起整条链路。
|
|
1002
|
+
*/
|
|
1003
|
+
declare class CompliancePollError extends Error {
|
|
1004
|
+
readonly kind: 'timeout' | 'terminal_failure' | 'step_up_required' | 'unknown';
|
|
1005
|
+
readonly lastInfo?: ComplianceErrorInfo;
|
|
1006
|
+
constructor(message: string, kind: 'timeout' | 'terminal_failure' | 'step_up_required' | 'unknown', lastInfo?: ComplianceErrorInfo);
|
|
1007
|
+
}
|
|
1008
|
+
declare class ComplianceClient {
|
|
1009
|
+
private readonly client;
|
|
1010
|
+
constructor(client: Client);
|
|
1011
|
+
/** 创建证据资产(写)。 */
|
|
1012
|
+
createEvidenceAsset(req: CreateEvidenceAssetRequest, opts?: ComplianceWriteOptions): Promise<EvidenceAsset>;
|
|
1013
|
+
/** 读 — 证据资产详情。 */
|
|
1014
|
+
getEvidenceAsset(id: number, signal?: AbortSignal): Promise<EvidenceAsset>;
|
|
1015
|
+
/**
|
|
1016
|
+
* 公开 verify。隐私边界:返回字段不含 PII / 合同原文 / storage / provider raw。
|
|
1017
|
+
* 服务端不要求 compliance scope(公开端点);但 SDK 仍带上 token 以便审计。
|
|
1018
|
+
*/
|
|
1019
|
+
verifyEvidencePublic(params: {
|
|
1020
|
+
evidenceNo?: string;
|
|
1021
|
+
publicVerifyCode?: string;
|
|
1022
|
+
}, signal?: AbortSignal): Promise<PublicEvidenceVerifyResult>;
|
|
1023
|
+
/** 申请时间章(写)。SDK 永远不传 provider 字段。 */
|
|
1024
|
+
issueTimestamp(req: IssueTimestampRequest, opts?: ComplianceWriteOptions): Promise<TimestampToken>;
|
|
1025
|
+
/** 给已有资产申请时间章。SDK 永远不传 provider 字段。 */
|
|
1026
|
+
issueTimestampForAsset(assetId: number, opts?: ComplianceWriteOptions): Promise<TimestampToken>;
|
|
1027
|
+
/** 读 — 时间章 token 详情。 */
|
|
1028
|
+
getTimestamp(id: number, signal?: AbortSignal): Promise<TimestampToken>;
|
|
1029
|
+
/** verify — 本地离线校验已申请的时间章。 */
|
|
1030
|
+
verifyTimestamp(req: VerifyTimestampRequest, opts?: ComplianceWriteOptions): Promise<TimestampVerifyResult>;
|
|
1031
|
+
/**
|
|
1032
|
+
* 轮询到 VERIFIED 终态。
|
|
1033
|
+
* - VERIFIED → 返回 token;
|
|
1034
|
+
* - FAILED / LOCAL_VERIFY_FAILED → 抛 {@link CompliancePollError} kind='terminal_failure';
|
|
1035
|
+
* - UNKNOWN / RETRYING / PENDING → 继续轮询直到 timeout;
|
|
1036
|
+
* - timeout → 抛 {@link CompliancePollError} kind='timeout'。
|
|
1037
|
+
*/
|
|
1038
|
+
waitForTimestampVerified(id: number, opts?: CompliancePollOptions): Promise<TimestampToken>;
|
|
1039
|
+
/** 构建证据包(写)。 */
|
|
1040
|
+
buildEvidencePackage(assetId: number, timestampTokenId?: number, opts?: ComplianceWriteOptions): Promise<EvidencePackage>;
|
|
1041
|
+
/** 创建证据报告(写)。 */
|
|
1042
|
+
createReport(req: CreateReportRequest, opts?: ComplianceWriteOptions): Promise<ComplianceReport>;
|
|
1043
|
+
/** 读 — 报告详情。 */
|
|
1044
|
+
getReport(id: number, signal?: AbortSignal): Promise<ComplianceReport>;
|
|
1045
|
+
/**
|
|
1046
|
+
* 发布报告(写,step-up 必须)。
|
|
1047
|
+
*
|
|
1048
|
+
* 缺少 step-up 时服务端会返回 `COMPLIANCE_STEP_UP_REQUIRED`(数值码
|
|
1049
|
+
* 1031000013)。SDK 不会自动重试;调用方需要引导用户重新做 OAuth introspection 或
|
|
1050
|
+
* 重新登录后再次调用本方法(使用同一 idempotency-key)。
|
|
1051
|
+
*/
|
|
1052
|
+
publishReport(id: number, opts?: ComplianceWriteOptions): Promise<ComplianceReport>;
|
|
1053
|
+
/**
|
|
1054
|
+
* 下载报告(读)。返回 {@link ReportDownload}:报告 hash + 资产 hash + 证据包 hash +
|
|
1055
|
+
* 时间章 serial/genTime,足以离线复核。
|
|
1056
|
+
* 不返回 bodyCanonicalJson / storage key / subject snapshot id。
|
|
1057
|
+
*/
|
|
1058
|
+
downloadReport(id: number, signal?: AbortSignal): Promise<ReportDownload>;
|
|
1059
|
+
/** 创建 envelope(写)。返回 envelope id。 */
|
|
1060
|
+
createSigningEnvelope(req: CreateSigningEnvelopeRequest, opts?: ComplianceWriteOptions): Promise<number>;
|
|
1061
|
+
/** 读 — envelope 详情。租户由服务端从 compliance token principal 推导。 */
|
|
1062
|
+
getSigningEnvelope(envelopeId: number, signal?: AbortSignal): Promise<SigningEnvelope>;
|
|
1063
|
+
/**
|
|
1064
|
+
* 正式签署(写,step-up 必须)。
|
|
1065
|
+
*
|
|
1066
|
+
* 服务端闸门关闭时会一致返回 `ENVELOPE_GATE_CLOSED` (1031004004)。
|
|
1067
|
+
* SDK 不重试、不伪成功;调用方应该将该错误展示为"功能未开放"。
|
|
1068
|
+
*/
|
|
1069
|
+
signEnvelope(envelopeId: number, req: SignEnvelopeRequest, opts?: ComplianceWriteOptions): Promise<void>;
|
|
1070
|
+
/**
|
|
1071
|
+
* 创建 H5 签署短链(写,step-up 必须)。
|
|
1072
|
+
*
|
|
1073
|
+
* 同上:服务端闸门关闭时 SDK 不重试。
|
|
1074
|
+
*/
|
|
1075
|
+
createH5SigningUrl(envelopeId: number, req: CreateH5SigningUrlRequest, opts?: ComplianceWriteOptions): Promise<string>;
|
|
1076
|
+
/** 同步 provider 状态(写但只读对账,不创建新 provider 请求)。 */
|
|
1077
|
+
syncSigningEnvelopeStatus(envelopeId: number, opts?: ComplianceWriteOptions): Promise<void>;
|
|
1078
|
+
submitSealApproval(req: SubmitSealApprovalRequest, opts?: ComplianceWriteOptions): Promise<number>;
|
|
1079
|
+
approveSealApproval(id: number, query: ApproveSealApprovalQuery, opts?: ComplianceWriteOptions): Promise<void>;
|
|
1080
|
+
rejectSealApproval(id: number, query: RejectSealApprovalQuery, opts?: ComplianceWriteOptions): Promise<void>;
|
|
1081
|
+
cancelSealApproval(id: number, query: CancelSealApprovalQuery, opts?: ComplianceWriteOptions): Promise<void>;
|
|
1082
|
+
listPendingSealApprovals(signal?: AbortSignal): Promise<SealApproval[]>;
|
|
1083
|
+
getSealApproval(id: number, signal?: AbortSignal): Promise<SealApproval>;
|
|
1084
|
+
getProviderRequest(id: number, signal?: AbortSignal): Promise<ProviderRequestStatusView>;
|
|
1085
|
+
/**
|
|
1086
|
+
* 轮询 provider request 到 SUCCESS / FAILED 终态。
|
|
1087
|
+
* - SUCCESS / FAILED → 返回最后视图;
|
|
1088
|
+
* - UNKNOWN / RETRYING / PENDING → 继续轮询;
|
|
1089
|
+
* - timeout → 抛 {@link CompliancePollError} kind='timeout',不自动重发原 provider 请求。
|
|
1090
|
+
*
|
|
1091
|
+
* SUCCESS 不代表 billing 已 commit;调用方仍需通过业务侧 envelope / asset 终态判断。
|
|
1092
|
+
*/
|
|
1093
|
+
waitForProviderRequestTerminal(id: number, opts?: CompliancePollOptions): Promise<ProviderRequestStatusView>;
|
|
1094
|
+
classifyError(err: unknown): ComplianceErrorInfo | null;
|
|
1095
|
+
/**
|
|
1096
|
+
* 读路径:GET / 公开 verify。允许 401 单次刷新后重放(GET 幂等安全)。
|
|
1097
|
+
* 与 client.doJSONFullInternal 行为一致;不复用其代码因为 base URL 不同。
|
|
1098
|
+
*/
|
|
1099
|
+
private read;
|
|
1100
|
+
/**
|
|
1101
|
+
* 写路径:POST。
|
|
1102
|
+
* - 发送前 ensureToken 一次确保 token fresh。
|
|
1103
|
+
* - 不自动 401 重放:401 → 抛 HTTPError;调用方必须自己刷新 token 后用同一
|
|
1104
|
+
* idempotency-key 重新发起,避免 provider 侧重复请求。
|
|
1105
|
+
* - 不走 doRequestWithRetry:写操作不允许 5xx/timeout 自动重试。
|
|
1106
|
+
*/
|
|
1107
|
+
private write;
|
|
1108
|
+
private executeJson;
|
|
1109
|
+
private poll;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/** SDK 为单个 content block 缓存的元数据 */
|
|
1113
|
+
interface BlockMeta {
|
|
1114
|
+
type: string;
|
|
1115
|
+
ephemeral: boolean;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* 按 Anthropic SSE 事件类型解析 data, 更新 blockTypeMap, 返回 [index, type, ephemeral]。
|
|
1119
|
+
*
|
|
1120
|
+
* 仅当事件为 content_block_start / content_block_delta / content_block_stop
|
|
1121
|
+
* 时返回非空 type; 其他事件返回空 type, 调用方据此判别是否填充 StreamEvent 元数据字段。
|
|
1122
|
+
*/
|
|
1123
|
+
declare function extractAnthropicBlockMeta(eventType: string, data: string, blockTypeMap: Map<number, BlockMeta>): [number, string, boolean];
|
|
1124
|
+
|
|
1125
|
+
type AgentRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1126
|
+
interface AgentRunLocalContextPolicy {
|
|
1127
|
+
enabled?: boolean;
|
|
1128
|
+
readonly?: boolean;
|
|
1129
|
+
maxBytes?: number;
|
|
1130
|
+
allowedTools?: string[];
|
|
1131
|
+
}
|
|
1132
|
+
interface AgentRunArtifactPolicy {
|
|
1133
|
+
enabled?: boolean;
|
|
1134
|
+
maxFiles?: number;
|
|
1135
|
+
}
|
|
1136
|
+
interface AgentRunCreateRequest {
|
|
1137
|
+
appId: string;
|
|
1138
|
+
mode?: string;
|
|
1139
|
+
sessionId?: string;
|
|
1140
|
+
input: string;
|
|
1141
|
+
messages?: unknown[];
|
|
1142
|
+
model?: string;
|
|
1143
|
+
activeSkillIds?: string[];
|
|
1144
|
+
knowledgeBaseIds?: string[];
|
|
1145
|
+
metadata?: Record<string, string>;
|
|
1146
|
+
localContextPolicy?: AgentRunLocalContextPolicy;
|
|
1147
|
+
artifactPolicy?: AgentRunArtifactPolicy;
|
|
1148
|
+
}
|
|
1149
|
+
interface AgentRun {
|
|
1150
|
+
runId: string;
|
|
1151
|
+
sessionId: string;
|
|
1152
|
+
appId?: string;
|
|
1153
|
+
mode?: string;
|
|
1154
|
+
status: AgentRunStatus;
|
|
1155
|
+
createdAt?: string;
|
|
1156
|
+
startedAt?: string;
|
|
1157
|
+
completedAt?: string;
|
|
1158
|
+
error?: AgentRunErrorPayload;
|
|
1159
|
+
metadata?: Record<string, string>;
|
|
1160
|
+
}
|
|
1161
|
+
interface AgentRunCreateResponse {
|
|
1162
|
+
runId: string;
|
|
1163
|
+
sessionId: string;
|
|
1164
|
+
status: AgentRunStatus;
|
|
1165
|
+
}
|
|
1166
|
+
interface AgentRunArtifact {
|
|
1167
|
+
id: string;
|
|
1168
|
+
filename: string;
|
|
1169
|
+
contentType?: string;
|
|
1170
|
+
size?: number;
|
|
1171
|
+
type?: string;
|
|
1172
|
+
metadata?: Record<string, string>;
|
|
1173
|
+
}
|
|
1174
|
+
interface AgentRunArtifactList {
|
|
1175
|
+
artifacts: AgentRunArtifact[];
|
|
1176
|
+
}
|
|
1177
|
+
interface AgentRunDownload {
|
|
1178
|
+
data: Uint8Array;
|
|
1179
|
+
filename: string;
|
|
1180
|
+
contentType?: string;
|
|
1181
|
+
}
|
|
1182
|
+
interface AgentRunUsage {
|
|
1183
|
+
inputTokens?: number;
|
|
1184
|
+
outputTokens?: number;
|
|
1185
|
+
totalTokens?: number;
|
|
1186
|
+
cacheReadTokens?: number;
|
|
1187
|
+
cacheCreateTokens?: number;
|
|
1188
|
+
exact?: boolean;
|
|
1189
|
+
source?: string;
|
|
1190
|
+
[key: string]: unknown;
|
|
1191
|
+
}
|
|
1192
|
+
interface AgentRunSettlement {
|
|
1193
|
+
requestId?: string;
|
|
1194
|
+
status?: string;
|
|
1195
|
+
consumeStatus?: string;
|
|
1196
|
+
inputTokens?: number;
|
|
1197
|
+
outputTokens?: number;
|
|
1198
|
+
totalTokens?: number;
|
|
1199
|
+
cacheReadTokens?: number;
|
|
1200
|
+
cacheCreateTokens?: number;
|
|
1201
|
+
tokenRemaining?: number;
|
|
1202
|
+
callRemaining?: number;
|
|
1203
|
+
retryQueued?: boolean;
|
|
1204
|
+
exact?: boolean;
|
|
1205
|
+
[key: string]: unknown;
|
|
1206
|
+
}
|
|
1207
|
+
interface AgentRunErrorPayload {
|
|
1208
|
+
code?: string;
|
|
1209
|
+
message: string;
|
|
1210
|
+
stage?: string;
|
|
1211
|
+
retryable?: boolean;
|
|
1212
|
+
raw?: unknown;
|
|
1213
|
+
}
|
|
1214
|
+
interface AgentRunLocalToolResult {
|
|
1215
|
+
requestId: string;
|
|
1216
|
+
ok: boolean;
|
|
1217
|
+
content?: unknown;
|
|
1218
|
+
error?: string;
|
|
1219
|
+
}
|
|
1220
|
+
interface AgentRunLocalToolHandlerContext {
|
|
1221
|
+
runId: string;
|
|
1222
|
+
requestId: string;
|
|
1223
|
+
name: string;
|
|
1224
|
+
signal: AbortSignal;
|
|
1225
|
+
}
|
|
1226
|
+
type AgentRunLocalToolHandler = (input: unknown, context: AgentRunLocalToolHandlerContext) => Promise<unknown> | unknown;
|
|
1227
|
+
interface AgentRunStreamOptions {
|
|
1228
|
+
/**
|
|
1229
|
+
* true by default. When enabled, an error event is converted into
|
|
1230
|
+
* AgentRunStreamError after the event has been parsed.
|
|
1231
|
+
*/
|
|
1232
|
+
throwOnError?: boolean;
|
|
1233
|
+
}
|
|
1234
|
+
interface AgentRunRunOptions extends AgentRunStreamOptions {
|
|
1235
|
+
}
|
|
1236
|
+
interface AgentRunWithLocalToolsOptions extends AgentRunRunOptions {
|
|
1237
|
+
timeoutMs?: number;
|
|
1238
|
+
onEvent?: (event: AgentRunStreamEvent) => void | Promise<void>;
|
|
1239
|
+
}
|
|
1240
|
+
type AgentRunStreamEvent = {
|
|
1241
|
+
type: 'run_started';
|
|
1242
|
+
runId: string;
|
|
1243
|
+
sessionId: string;
|
|
1244
|
+
} | {
|
|
1245
|
+
type: 'status';
|
|
1246
|
+
status: AgentRunStatus | string;
|
|
1247
|
+
message?: string;
|
|
1248
|
+
} | {
|
|
1249
|
+
type: 'text_delta';
|
|
1250
|
+
text: string;
|
|
1251
|
+
} | {
|
|
1252
|
+
type: 'reasoning_delta';
|
|
1253
|
+
text: string;
|
|
1254
|
+
} | {
|
|
1255
|
+
type: 'tool_call';
|
|
1256
|
+
id: string;
|
|
1257
|
+
name: string;
|
|
1258
|
+
input?: unknown;
|
|
1259
|
+
} | {
|
|
1260
|
+
type: 'tool_result';
|
|
1261
|
+
id: string;
|
|
1262
|
+
name?: string;
|
|
1263
|
+
result?: unknown;
|
|
1264
|
+
error?: string;
|
|
1265
|
+
} | {
|
|
1266
|
+
type: 'local_tool_request';
|
|
1267
|
+
requestId: string;
|
|
1268
|
+
name: string;
|
|
1269
|
+
input: unknown;
|
|
1270
|
+
} | {
|
|
1271
|
+
type: 'artifact';
|
|
1272
|
+
artifact: AgentRunArtifact;
|
|
1273
|
+
} | {
|
|
1274
|
+
type: 'sources';
|
|
1275
|
+
sources: unknown;
|
|
1276
|
+
} | {
|
|
1277
|
+
type: 'usage';
|
|
1278
|
+
usage: AgentRunUsage;
|
|
1279
|
+
} | {
|
|
1280
|
+
type: 'settle';
|
|
1281
|
+
settlement: AgentRunSettlement;
|
|
1282
|
+
} | {
|
|
1283
|
+
type: 'error';
|
|
1284
|
+
error: AgentRunErrorPayload;
|
|
1285
|
+
} | {
|
|
1286
|
+
type: 'done';
|
|
1287
|
+
runId: string;
|
|
1288
|
+
status: AgentRunStatus | string;
|
|
1289
|
+
};
|
|
1290
|
+
declare class AgentRunStreamError extends Error {
|
|
1291
|
+
event: Extract<AgentRunStreamEvent, {
|
|
1292
|
+
type: 'error';
|
|
1293
|
+
}>;
|
|
1294
|
+
code: string;
|
|
1295
|
+
stage: string;
|
|
1296
|
+
retryable: boolean;
|
|
1297
|
+
constructor(event: Extract<AgentRunStreamEvent, {
|
|
1298
|
+
type: 'error';
|
|
1299
|
+
}>);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
765
1302
|
declare module '@acosmi/sdk-ts' {
|
|
766
1303
|
interface Client {
|
|
767
1304
|
/** SDK-facing cloud agent run gateway. */
|
|
@@ -1036,4 +1573,4 @@ declare module '@acosmi/sdk-ts' {
|
|
|
1036
1573
|
}
|
|
1037
1574
|
}
|
|
1038
1575
|
|
|
1039
|
-
export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type Config, ConsumeRecordPage, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBrowserOpen, ErrDiscovery, ErrRegistration, ErrSSLProxy, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, QuotaSummary, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerMetadata, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, commerceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, isSSLError, modelScopes, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
|
|
1576
|
+
export { type AgentRun, type AgentRunArtifact, type AgentRunArtifactList, type AgentRunArtifactPolicy, type AgentRunCreateRequest, type AgentRunCreateResponse, type AgentRunDownload, type AgentRunErrorPayload, type AgentRunLocalContextPolicy, type AgentRunLocalToolHandler, type AgentRunLocalToolHandlerContext, type AgentRunLocalToolResult, type AgentRunRunOptions, type AgentRunSettlement, type AgentRunStatus, AgentRunStreamError, type AgentRunStreamEvent, type AgentRunStreamOptions, type AgentRunUsage, type AgentRunWithLocalToolsOptions, AgentRunsClient, AnthropicResponse, type ApproveSealApprovalQuery, type AuthorizeResult, BalanceDetail, type BlockMeta, type BugReportResult, type BugView, BusinessError, type CancelSealApprovalQuery, CertificationStatus, ChatRequest, ChatResponse, Client, ClientRegistration, type ComplianceAssetType, type ComplianceBillingDisplayStatus, ComplianceClient, type ComplianceClientErrorCode, type ComplianceDigestSource, type ComplianceEnvelopeStatus, type ComplianceErrorInfo, type ComplianceErrorKey, type ComplianceHashAlgorithm, CompliancePollError, type CompliancePollOptions, type CompliancePrivacyLevel, type ComplianceProviderRequestStatus, type ComplianceProviderStatus, type ComplianceReport, type ComplianceScope, type ComplianceSealApprovalStatus, type ComplianceTimestampVerificationStatus, type ComplianceWriteOptions, type Config, ConsumeRecordPage, type CreateEvidenceAssetRequest, type CreateH5SigningUrlRequest, type CreateReportRequest, type CreateSigningEnvelopeRequest, DefaultRetryPolicy, DeviceRegistration, EntitlementBalance, EntitlementItem, ErrAuthDenied, ErrBillingCallbackCannotCommit, ErrBillingCommitRequiresLocalVerify, ErrBillingS2sForbidden, ErrBrowserOpen, ErrComplianceStepUpRequired, ErrDiscovery, ErrEnvelopeGateClosed, ErrProviderNotConfigured, ErrProviderUnknownNoRetry, ErrRegistration, ErrSSLProxy, ErrSealApprovalContractHashMismatch, ErrSealApprovalExpired, ErrSealApprovalLocationMismatch, ErrSealApprovalNonceUsed, ErrSealApprovalNotApproved, ErrSealApprovalSealMismatch, ErrSealApprovalTransactorMismatch, ErrSealUseAlreadyConsumed, ErrTimeout, ErrTokenExchange, EventAuthURL, EventComplete, EventError, type EvidenceAsset, type EvidencePackage, FileTokenStore, type FilterStatus, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, GenerateSkillRequest, GenerateSkillResult, InMemoryTokenStore, InputModality, type IssueTimestampRequest, LocalStorageTokenStore, type LoginErrCode, type LoginEvent, type LoginEventType, type LoginOptions, ManagedModel, ModelBucket, ModelByQuotaResponse, ModelCapabilities, ModelCoefficient, NotificationList, NotificationPreference, OptimizeSkillRequest, OptimizeSkillResult, Order, OrderStatus, PayPayload, ProviderAdapter, type ProviderRequestStatusView, type PublicEvidenceVerifyResult, QuotaSummary, type RejectSealApprovalQuery, type ReportDownload, type RetryPolicy, type RetryRequestInfo, ScopeAI, ScopeAccount, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, type SealApproval, ServerMetadata, type SignEnvelopeRequest, type SigningEnvelope, SkillBrowseListResponse, SkillBrowseResponse, SkillStoreItem, SkillStoreQuery, SkillSummary, SourcesEvent, StreamEvent, StreamSettlement, type SubmitSealApprovalRequest, type TimestampToken, type TimestampVerifyResult, TokenPackage, TokenResponse, TokenSet, type TokenStore, ToolView, Transaction, type VerifyTimestampRequest, type WSConfig, WSEvent, WalletStats, allScopes, authorize, buildBetas, classifyComplianceError, commerceScopes, complianceScopes, computeBackoff, defaultRetryable, defaultSafeToRetry, discover, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, isBillingConfirmable, isComplianceBusinessError, isComplianceTerminalError, isSSLError, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, refreshToken, register, revokeToken, skillScopes, uniqueMerge };
|