@acosmi/sdk-ts 2.5.1 → 2.7.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 +59 -0
- package/README.md +101 -20
- package/dist/browser/index.mjs +351 -10
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.mjs +351 -10
- 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 +2 -2
- package/dist/node/adapters/openai.d.ts +2 -2
- package/dist/node/adapters/openai.mjs.map +1 -1
- package/dist/node/{index-BdzF9tmA.d.cts → index-BrbgHn0E.d.cts} +12 -0
- package/dist/node/{index-BdzF9tmA.d.ts → index-BrbgHn0E.d.ts} +12 -0
- package/dist/node/index.cjs +359 -9
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +387 -56
- package/dist/node/index.d.ts +387 -56
- package/dist/node/index.mjs +351 -10
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{openai-B5xWiGMs.d.cts → openai-CeM2k04b.d.cts} +1 -1
- package/dist/node/{openai-C3DcaljC.d.ts → openai-DoPpzZmv.d.ts} +1 -1
- package/docs//345/274/200/345/217/221/344/270/216/345/217/221/345/270/203/346/211/213/345/206/214.md +13 -4
- package/package.json +1 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as AnthropicResponse } from './openai-
|
|
2
|
-
export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-
|
|
3
|
-
import { M as ManagedModel, Q as QuotaSummary, j as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, h as ImageGenerationResponse, V as VideoGenerationRequest, u as VideoTaskResponse, n as StreamEvent, m as SourcesEvent, o as StreamSettlement, i as InputModality } from './index-
|
|
4
|
-
export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, G as GeoLoc, O as OutputConfig, k as ProviderFormat, S as ServerTool, l as ServerToolTypeWebSearch, T as ThinkingConfig, p as ThinkingHigh, q as ThinkingHighMinMaxTokens, r as ThinkingMax, s as ThinkingMaxFallbackMaxTokens, t as ThinkingOff, W as WebSearchConfig, v as WebSearchSource, w as bucketInfoIsCommercial, x as bucketRowIsCommercial, y as getAdapter, z as getAdapterForModel, A as newThinkingConfig, D as newWebSearchTool, F as parseSettlement, H as parseSourcesEvent } from './index-
|
|
1
|
+
import { a as AnthropicResponse } from './openai-DoPpzZmv.js';
|
|
2
|
+
export { A as AnthropicContentBlock, b as AnthropicUsage, O as OpenAIAdapter, d as anthropicResponseTextContent, e as anthropicResponseThinkingContent, f as anthropicResponseToolUseBlocks } from './openai-DoPpzZmv.js';
|
|
3
|
+
import { M as ManagedModel, Q as QuotaSummary, j as ModelCapabilities, e as ChatRequest, P as ProviderAdapter, f as ChatResponse, I as ImageGenerationRequest, h as ImageGenerationResponse, V as VideoGenerationRequest, u as VideoTaskResponse, n as StreamEvent, m as SourcesEvent, o as StreamSettlement, i as InputModality } from './index-BrbgHn0E.js';
|
|
4
|
+
export { B as BucketClassCommercial, a as BucketClassGeneric, b as BucketInfo, c as BucketRow, C as ChatContentBlock, d as ChatMessage, g as ChatUsage, E as EffortConfig, G as GeoLoc, O as OutputConfig, k as ProviderFormat, S as ServerTool, l as ServerToolTypeWebSearch, T as ThinkingConfig, p as ThinkingHigh, q as ThinkingHighMinMaxTokens, r as ThinkingMax, s as ThinkingMaxFallbackMaxTokens, t as ThinkingOff, W as WebSearchConfig, v as WebSearchSource, w as bucketInfoIsCommercial, x as bucketRowIsCommercial, y as getAdapter, z as getAdapterForModel, A as newThinkingConfig, D as newWebSearchTool, F as parseSettlement, H as parseSourcesEvent } from './index-BrbgHn0E.js';
|
|
5
5
|
import { M as MinimalSanitizeConfig } from './index-Bah9A83R.js';
|
|
6
6
|
export { A as sanitize } from './index-Bah9A83R.js';
|
|
7
7
|
export { AnthropicAdapter } from './adapters/anthropic.js';
|
|
8
8
|
|
|
9
|
-
/** 权益余额 (聚合) */
|
|
9
|
+
/** 权益余额 (聚合)。token* 单位双体系: 免费=Token / 付费(TOKEN_PACKAGE,SUBSCRIPTION)=微Credits(÷1000=Credits)。 */
|
|
10
10
|
interface EntitlementBalance {
|
|
11
11
|
totalTokenQuota: number;
|
|
12
12
|
totalTokenUsed: number;
|
|
@@ -16,9 +16,10 @@ interface EntitlementBalance {
|
|
|
16
16
|
totalCallRemaining: number;
|
|
17
17
|
activeEntitlements: number;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
19
|
+
/** 单条权益明细。token* 单位由 type 决定: TOKEN_PACKAGE/SUBSCRIPTION=微Credits(÷1000=Credits), 其余=原始Token。 */
|
|
20
20
|
interface EntitlementItem {
|
|
21
21
|
id: string;
|
|
22
|
+
/** 权益类型, 也是额度单位判据: TOKEN_PACKAGE/SUBSCRIPTION → 付费(Credits 体系), 其余 → 免费(Token 体系)。 */
|
|
22
23
|
type: string;
|
|
23
24
|
status: string;
|
|
24
25
|
tokenQuota: number;
|
|
@@ -31,18 +32,27 @@ interface EntitlementItem {
|
|
|
31
32
|
sourceId?: string;
|
|
32
33
|
sourceType?: string;
|
|
33
34
|
remark?: string;
|
|
34
|
-
|
|
35
|
+
/** 仅出现在 /grants map (toEntitlementMap 之外的 grants 端点)。 */
|
|
36
|
+
createdAt?: string;
|
|
37
|
+
/** list (toEntitlementMap) 与 grants 均返回 activatedAt。 */
|
|
38
|
+
activatedAt?: string;
|
|
39
|
+
}
|
|
40
|
+
interface BalanceDetailEntitlement {
|
|
41
|
+
id: string;
|
|
42
|
+
sourceOrderId?: string;
|
|
43
|
+
status: string;
|
|
44
|
+
tokenQuota: number;
|
|
45
|
+
tokenUsed: number;
|
|
46
|
+
expiresAt?: string;
|
|
35
47
|
}
|
|
36
|
-
/** 详细余额 (含每条权益明细) */
|
|
48
|
+
/** 详细余额 (含每条权益明细)。token* 单位双体系: 免费=Token / 付费=微Credits(÷1000=Credits), 按 entitlements[].id 对应权益 type 区分, 勿跨单位求和。 */
|
|
37
49
|
interface BalanceDetail {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
activeEntitlements: number;
|
|
45
|
-
entitlements: EntitlementItem[];
|
|
50
|
+
userId: string;
|
|
51
|
+
tokenRemaining: number;
|
|
52
|
+
tokenTotal: number;
|
|
53
|
+
callRemaining: number;
|
|
54
|
+
callTotal: number;
|
|
55
|
+
entitlements: BalanceDetailEntitlement[];
|
|
46
56
|
}
|
|
47
57
|
/** 核销记录 */
|
|
48
58
|
interface ConsumeRecord {
|
|
@@ -53,6 +63,12 @@ interface ConsumeRecord {
|
|
|
53
63
|
tokensConsumed: number;
|
|
54
64
|
status: string;
|
|
55
65
|
createdAt: string;
|
|
66
|
+
reservedTokens?: number;
|
|
67
|
+
callsConsumed?: number;
|
|
68
|
+
inputTokens?: number;
|
|
69
|
+
outputTokens?: number;
|
|
70
|
+
cacheReadTokens?: number;
|
|
71
|
+
cacheCreateTokens?: number;
|
|
56
72
|
}
|
|
57
73
|
/** 核销记录分页响应 */
|
|
58
74
|
interface ConsumeRecordPage {
|
|
@@ -92,6 +108,7 @@ interface ModelByQuotaResponse {
|
|
|
92
108
|
primaryBucket?: ModelBucket;
|
|
93
109
|
}
|
|
94
110
|
/** 单条模型系数 (SDK TTL 8s 缓存源) */
|
|
111
|
+
/** @deprecated 系数管理已退役 (raw 1:1 计费)。网关 /entitlements/coefficients 永久返回 []。本类型仅为向后兼容保留。 */
|
|
95
112
|
interface ModelCoefficient {
|
|
96
113
|
modelId: string;
|
|
97
114
|
tenantId: string;
|
|
@@ -102,49 +119,84 @@ interface ModelCoefficient {
|
|
|
102
119
|
version: number;
|
|
103
120
|
effectiveAt: string;
|
|
104
121
|
}
|
|
105
|
-
/**
|
|
122
|
+
/** 流量包商品。形状对齐 ConsumerPublicController.toProductView (/api/products 端点, /token-packages 代理转发)。 */
|
|
106
123
|
interface TokenPackage {
|
|
107
124
|
id: string;
|
|
108
125
|
name: string;
|
|
109
126
|
description?: string;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
/** 订单状态 */
|
|
128
|
-
interface OrderStatus {
|
|
129
|
-
orderId: string;
|
|
130
|
-
status: string;
|
|
131
|
-
}
|
|
127
|
+
originalPriceCent: number;
|
|
128
|
+
campaignPriceCent: number;
|
|
129
|
+
renewalPriceCent: number;
|
|
130
|
+
/** 折扣率 0~1 (BigDecimal, JSON 数字); 0 表示无折扣 */
|
|
131
|
+
discountRate: number;
|
|
132
|
+
modelsJson?: string;
|
|
133
|
+
productImage?: string;
|
|
134
|
+
features?: string[];
|
|
135
|
+
billingCycle: string;
|
|
136
|
+
featured: boolean;
|
|
137
|
+
eyebrow?: string;
|
|
138
|
+
promo?: string;
|
|
139
|
+
usage?: string;
|
|
140
|
+
sortOrder: number;
|
|
141
|
+
}
|
|
142
|
+
/** 支付方式枚举字面量 (来自 /payment-options)。 */
|
|
143
|
+
type PaymentMethod = 'WECHAT_NATIVE' | 'ALIPAY_PRECREATE' | 'BANK_TRANSFER';
|
|
132
144
|
/** 下单请求 */
|
|
133
145
|
interface PayPayload {
|
|
134
|
-
|
|
146
|
+
/** 支付方式枚举字面量 (来自 /payment-options)。字段名必须是 paymentMethod (后端 BuyRequest.paymentMethod)。 */
|
|
147
|
+
paymentMethod?: PaymentMethod;
|
|
148
|
+
deviceId?: string;
|
|
149
|
+
/** 幂等请求 ID */
|
|
150
|
+
clientRequestId?: string;
|
|
151
|
+
}
|
|
152
|
+
/** 下单 / 订单状态响应 (OrderPaymentService.BuyResponse, buy 与状态查询共用)。 */
|
|
153
|
+
interface BuyResponse {
|
|
154
|
+
orderId: number;
|
|
155
|
+
orderNo: string;
|
|
156
|
+
productId?: string;
|
|
157
|
+
productName?: string;
|
|
158
|
+
amountFen: number;
|
|
159
|
+
orderStatus: string;
|
|
160
|
+
paymentMethod: string;
|
|
161
|
+
paymentStatus: string;
|
|
162
|
+
qrCodeContent?: string;
|
|
163
|
+
payUrl?: string;
|
|
164
|
+
paymentExpiresAt?: string;
|
|
165
|
+
/** 对公转账信息 (BANK_TRANSFER 时), 形状为后端嵌套对象 */
|
|
166
|
+
bankTransferInfo?: Record<string, unknown>;
|
|
167
|
+
}
|
|
168
|
+
/** 我的订单列表行 (toOrderMap)。 */
|
|
169
|
+
interface OrderListItem {
|
|
170
|
+
id: string;
|
|
171
|
+
bizOrderId?: string;
|
|
172
|
+
productName?: string;
|
|
173
|
+
amountCent: number;
|
|
174
|
+
originalPriceCent?: number;
|
|
175
|
+
discountRate?: string;
|
|
176
|
+
paymentMethod?: string;
|
|
177
|
+
payStatus: string;
|
|
178
|
+
commissionStatus?: string;
|
|
179
|
+
issueStatus?: string;
|
|
180
|
+
channelCode?: string;
|
|
181
|
+
createdAt?: string;
|
|
182
|
+
payTime?: string;
|
|
135
183
|
}
|
|
136
|
-
/**
|
|
184
|
+
/** @deprecated 旧形状与任何真实端点都不符; buy/状态查询改用 BuyResponse, 列表用 OrderListItem。 */
|
|
185
|
+
type Order = BuyResponse;
|
|
186
|
+
/** @deprecated getOrderStatus 现返回 BuyResponse (无 status 字段)。 */
|
|
187
|
+
type OrderStatus = BuyResponse;
|
|
188
|
+
/** 钱包统计。 */
|
|
137
189
|
interface WalletStats {
|
|
138
|
-
balance:
|
|
139
|
-
monthlyConsumption:
|
|
140
|
-
monthlyRecharge:
|
|
190
|
+
balance: number;
|
|
191
|
+
monthlyConsumption: number;
|
|
192
|
+
monthlyRecharge: number;
|
|
141
193
|
transactionCount: number;
|
|
142
194
|
}
|
|
143
195
|
/** 交易记录 */
|
|
144
196
|
interface Transaction {
|
|
145
197
|
id: string;
|
|
146
198
|
type: string;
|
|
147
|
-
amount:
|
|
199
|
+
amount: number;
|
|
148
200
|
remark?: string;
|
|
149
201
|
createdAt: string;
|
|
150
202
|
}
|
|
@@ -1511,6 +1563,14 @@ declare const ScopeRemoteControlAgentRun = "remote_control:agent-run";
|
|
|
1511
1563
|
declare const ScopeRemoteControlSessionControl = "remote_control:session-control";
|
|
1512
1564
|
/** 代表用户提交远控权限审批响应 (allow / deny / timeout). */
|
|
1513
1565
|
declare const ScopeRemoteControlPermissionResponse = "remote_control:permission-response";
|
|
1566
|
+
/** 第三方聊天集成桥接 (分组 scope, 服务端 ScopeExpansion 展开为 read/write/rotate)。凭证管理高风险, 不进 allScopes()。 */
|
|
1567
|
+
declare const ScopeChatBridge = "chat_bridge";
|
|
1568
|
+
/** 查询 integration / session / 凭证元数据 (仅 ref+fingerprint)。 */
|
|
1569
|
+
declare const ScopeChatBridgeRead = "chat_bridge:read";
|
|
1570
|
+
/** 创建 / 更新 integration 与凭证。 */
|
|
1571
|
+
declare const ScopeChatBridgeWrite = "chat_bridge:write";
|
|
1572
|
+
/** 轮换 / 吊销凭证 (高风险)。 */
|
|
1573
|
+
declare const ScopeChatBridgeRotate = "chat_bridge:rotate";
|
|
1514
1574
|
/** @deprecated 旧细粒度 scope, 保留向后兼容, 新代码请用分组 scope */
|
|
1515
1575
|
declare const ScopeModels = "models";
|
|
1516
1576
|
/** @deprecated */
|
|
@@ -1544,6 +1604,10 @@ declare function skillScopes(): string[];
|
|
|
1544
1604
|
* 为 3 个子 scope. 调用方需显式申请, allScopes() 不包含本项 (避免桌面登录自动获权).
|
|
1545
1605
|
*/
|
|
1546
1606
|
declare function remoteControlScopes(): string[];
|
|
1607
|
+
/**
|
|
1608
|
+
* 聊天桥接 scope (推荐). 仅返回分组 ScopeChatBridge; 服务端展开为 3 子 scope。调用方需显式申请, allScopes() 不含。
|
|
1609
|
+
*/
|
|
1610
|
+
declare function chatBridgeScopes(): string[];
|
|
1547
1611
|
|
|
1548
1612
|
interface OpenAIChatResponse {
|
|
1549
1613
|
id: string;
|
|
@@ -1707,8 +1771,10 @@ declare module '@acosmi/sdk-ts' {
|
|
|
1707
1771
|
getByModel(modelID: string, signal?: AbortSignal): Promise<ModelByQuotaResponse>;
|
|
1708
1772
|
/** 列出当前用户的全部桶 */
|
|
1709
1773
|
listBuckets(signal?: AbortSignal): Promise<ModelBucket[]>;
|
|
1774
|
+
/** @deprecated 系数已退役, 网关恒返回 []。*/
|
|
1710
1775
|
/** 拉取模型系数表; SDK 自带 8s TTL 内存缓存以减小调用风暴. */
|
|
1711
1776
|
listCoefficients(signal?: AbortSignal): Promise<ModelCoefficient[]>;
|
|
1777
|
+
/** @deprecated 系数已退役, 网关恒返回 []。*/
|
|
1712
1778
|
/** 手动失效系数缓存 (admin 调价后建议立即调一次) */
|
|
1713
1779
|
invalidateCoefficientCache(): void;
|
|
1714
1780
|
}
|
|
@@ -1721,17 +1787,18 @@ declare module '@acosmi/sdk-ts' {
|
|
|
1721
1787
|
/** 获取流量包详情 */
|
|
1722
1788
|
getTokenPackageDetail(packageID: string, signal?: AbortSignal): Promise<TokenPackage>;
|
|
1723
1789
|
/** 购买流量包 (创建订单) */
|
|
1724
|
-
buyTokenPackage(packageID: string, payload: PayPayload | null, signal?: AbortSignal): Promise<
|
|
1790
|
+
buyTokenPackage(packageID: string, payload: PayPayload | null, signal?: AbortSignal): Promise<BuyResponse>;
|
|
1725
1791
|
/** 查询订单支付状态 */
|
|
1726
|
-
getOrderStatus(orderID: string, signal?: AbortSignal): Promise<
|
|
1792
|
+
getOrderStatus(orderID: string, signal?: AbortSignal): Promise<BuyResponse>;
|
|
1727
1793
|
/** 查询我的订单列表 */
|
|
1728
|
-
listMyOrders(signal?: AbortSignal): Promise<
|
|
1794
|
+
listMyOrders(signal?: AbortSignal): Promise<OrderListItem[]>;
|
|
1729
1795
|
/**
|
|
1730
1796
|
* 轮询订单支付状态直到终态
|
|
1731
|
-
* 成功支付返回
|
|
1797
|
+
* 成功支付返回 BuyResponse; 终态失败抛 OrderTerminalError
|
|
1798
|
+
* 终态判定基于 paymentStatus (回退 orderStatus)
|
|
1732
1799
|
* pollIntervalMs <= 0 时默认 2 秒
|
|
1733
1800
|
*/
|
|
1734
|
-
waitForPayment(orderID: string, pollIntervalMs: number, signal?: AbortSignal): Promise<
|
|
1801
|
+
waitForPayment(orderID: string, pollIntervalMs: number, signal?: AbortSignal): Promise<BuyResponse>;
|
|
1735
1802
|
}
|
|
1736
1803
|
}
|
|
1737
1804
|
|
|
@@ -2015,12 +2082,16 @@ declare module '@acosmi/sdk-ts' {
|
|
|
2015
2082
|
/** 删除通知 */
|
|
2016
2083
|
deleteNotification(id: string, signal?: AbortSignal): Promise<void>;
|
|
2017
2084
|
/** 注册推送设备 token */
|
|
2085
|
+
/** @experimental 网关尚未提供 /devices/* 与 /notification-preferences/* 端点, 调用将 404。后端实现落地前请勿在生产使用。 */
|
|
2018
2086
|
registerDevice(reg: DeviceRegistration, signal?: AbortSignal): Promise<void>;
|
|
2019
2087
|
/** 注销推送设备 token */
|
|
2088
|
+
/** @experimental 网关尚未提供 /devices/* 与 /notification-preferences/* 端点, 调用将 404。后端实现落地前请勿在生产使用。 */
|
|
2020
2089
|
unregisterDevice(token: string, signal?: AbortSignal): Promise<void>;
|
|
2021
2090
|
/** 获取通知偏好设置 */
|
|
2091
|
+
/** @experimental 网关尚未提供 /devices/* 与 /notification-preferences/* 端点, 调用将 404。后端实现落地前请勿在生产使用。 */
|
|
2022
2092
|
listNotificationPreferences(signal?: AbortSignal): Promise<NotificationPreference[]>;
|
|
2023
2093
|
/** 更新通知偏好 */
|
|
2094
|
+
/** @experimental 网关尚未提供 /devices/* 与 /notification-preferences/* 端点, 调用将 404。后端实现落地前请勿在生产使用。 */
|
|
2024
2095
|
updateNotificationPreference(typeCode: string, pref: NotificationPreference, signal?: AbortSignal): Promise<void>;
|
|
2025
2096
|
}
|
|
2026
2097
|
}
|
|
@@ -2180,6 +2251,53 @@ declare function parseRemoteControlEvent(raw: unknown): RemoteControlEvent | nul
|
|
|
2180
2251
|
* 因此 `error` 本身不算 terminal, `done` 才是。
|
|
2181
2252
|
*/
|
|
2182
2253
|
declare function isTerminalRemoteEvent(ev: RemoteControlEvent): boolean;
|
|
2254
|
+
/**
|
|
2255
|
+
* C 端/平台可下达的 permission 决策 (契约 §14)。
|
|
2256
|
+
*
|
|
2257
|
+
* 仅 `approved` | `rejected` — `timeout` / `cancelled` 由服务端 reaper/cancel
|
|
2258
|
+
* 路径产生, 客户端不可下达。
|
|
2259
|
+
*/
|
|
2260
|
+
type RemotePermissionDecision = 'approved' | 'rejected';
|
|
2261
|
+
/** `agentRuns.submitPermissionResult()` 请求 — 回写 permission_request 的决策。 */
|
|
2262
|
+
interface RemotePermissionResultRequest {
|
|
2263
|
+
/** 对应 permission_request 事件的 requestId。 */
|
|
2264
|
+
requestId: string;
|
|
2265
|
+
decision: RemotePermissionDecision;
|
|
2266
|
+
/** 可选决策理由 (透传给 CrabCode control_response)。 */
|
|
2267
|
+
reason?: string;
|
|
2268
|
+
}
|
|
2269
|
+
/** `agentRuns.submitUserMessage()` 请求 — 会话中途追加用户消息 (Phase 5C 输入框)。 */
|
|
2270
|
+
interface RemoteUserMessageRequest {
|
|
2271
|
+
/** 消息正文; 服务端上限 64KB。Role 由服务端硬编码 'user' (契约 §6 #5 防注入)。 */
|
|
2272
|
+
content: string;
|
|
2273
|
+
/** 幂等键; 缺省由服务端生成并在 ack 中返回。 */
|
|
2274
|
+
requestId?: string;
|
|
2275
|
+
}
|
|
2276
|
+
/** `agentRuns.submitUserMessage()` 确认。 */
|
|
2277
|
+
interface RemoteUserMessageAck {
|
|
2278
|
+
ok: boolean;
|
|
2279
|
+
/** 服务端最终采用的幂等键 (请求未带时为服务端生成值)。 */
|
|
2280
|
+
requestId: string;
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* `agentRuns.revealRemoteToken()` 响应 — desktop launcher 一次性 session token
|
|
2284
|
+
* (Phase 5B; 仅 runner='desktop')。
|
|
2285
|
+
*
|
|
2286
|
+
* 安全红线 (契约 §6): token 一次性消费 (重复调用 409), TTL ≤ 1h; 永不落
|
|
2287
|
+
* 浏览器存储 (localStorage/cookie), 应由 native 层接收后只注入 CrabCode
|
|
2288
|
+
* 子进程 env。
|
|
2289
|
+
*/
|
|
2290
|
+
interface RemoteSessionTokenGrant {
|
|
2291
|
+
accessToken: string;
|
|
2292
|
+
/** CrabCode 回连的 RemoteIO WS 完整地址 (公网 wss 基址 + run 路径 + tenant_id)。 */
|
|
2293
|
+
sessionUrl: string;
|
|
2294
|
+
tenantId: string;
|
|
2295
|
+
/**
|
|
2296
|
+
* 用户在 metadata.workspace 声明的期望项目目录 (契约 §18.3 r4); 缺省 undefined。
|
|
2297
|
+
* 桌面端决定是否 chdir 采纳 (路径不存在/越权时回退并提示)。
|
|
2298
|
+
*/
|
|
2299
|
+
workspace?: string;
|
|
2300
|
+
}
|
|
2183
2301
|
|
|
2184
2302
|
type AgentRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
2185
2303
|
/**
|
|
@@ -2198,6 +2316,17 @@ interface AgentRunArtifactPolicy {
|
|
|
2198
2316
|
enabled?: boolean;
|
|
2199
2317
|
maxFiles?: number;
|
|
2200
2318
|
}
|
|
2319
|
+
/**
|
|
2320
|
+
* Run metadata 约定键 (契约 §18.3 r4, additive)。
|
|
2321
|
+
*
|
|
2322
|
+
* 服务端防滥用上限: ≤32 条 / 键 ≤64B / 值 ≤2KB (`validateAgentRunMetadata`)。
|
|
2323
|
+
* - `title` 列表显示标题; 缺省由服务端从 input 首行派生 (60 rune 截断)。
|
|
2324
|
+
* - `workspace` 用户声明的期望项目目录; desktop runner 经
|
|
2325
|
+
* `revealRemoteToken()` 响应的 `workspace` 字段回传, 由桌面 launcher
|
|
2326
|
+
* 决定是否 chdir 采纳 (路径不存在/越权时回退本机当前目录并提示)。
|
|
2327
|
+
*/
|
|
2328
|
+
declare const AGENT_RUN_META_TITLE = "title";
|
|
2329
|
+
declare const AGENT_RUN_META_WORKSPACE = "workspace";
|
|
2201
2330
|
interface AgentRunCreateRequest {
|
|
2202
2331
|
appId: string;
|
|
2203
2332
|
mode?: string;
|
|
@@ -2207,6 +2336,10 @@ interface AgentRunCreateRequest {
|
|
|
2207
2336
|
model?: string;
|
|
2208
2337
|
activeSkillIds?: string[];
|
|
2209
2338
|
knowledgeBaseIds?: string[];
|
|
2339
|
+
/**
|
|
2340
|
+
* 自由 KV 元数据。远控 run 的约定键见 {@link AGENT_RUN_META_TITLE} /
|
|
2341
|
+
* {@link AGENT_RUN_META_WORKSPACE} (契约 §18.3 r4)。
|
|
2342
|
+
*/
|
|
2210
2343
|
metadata?: Record<string, string>;
|
|
2211
2344
|
localContextPolicy?: AgentRunLocalContextPolicy;
|
|
2212
2345
|
artifactPolicy?: AgentRunArtifactPolicy;
|
|
@@ -2215,6 +2348,12 @@ interface AgentRunCreateRequest {
|
|
|
2215
2348
|
adapter?: AdapterKind;
|
|
2216
2349
|
permissionPolicy?: PermissionPolicy;
|
|
2217
2350
|
workspacePolicy?: WorkspacePolicy;
|
|
2351
|
+
/**
|
|
2352
|
+
* BYO 模型密钥公开引用 (契约 §18.2; 仅远控 runtime + runner='cloud')。
|
|
2353
|
+
* 只传 `crabcodeByok.create()` 返回的 credentialRef; 明文/密文绝不过此请求 —
|
|
2354
|
+
* 解密只发生在网关 launchCloudRunner 的子进程 env 注入点。
|
|
2355
|
+
*/
|
|
2356
|
+
byokCredentialRef?: string;
|
|
2218
2357
|
}
|
|
2219
2358
|
/**
|
|
2220
2359
|
* Narrow type for `agentRuns.createRemoteRun(req)`:
|
|
@@ -2238,6 +2377,27 @@ interface AgentRun {
|
|
|
2238
2377
|
completedAt?: string;
|
|
2239
2378
|
error?: AgentRunErrorPayload;
|
|
2240
2379
|
metadata?: Record<string, string>;
|
|
2380
|
+
runtime?: AgentRunRuntime | string;
|
|
2381
|
+
runner?: RunnerKind | string;
|
|
2382
|
+
adapter?: AdapterKind | string;
|
|
2383
|
+
}
|
|
2384
|
+
/** `agentRuns.list()` 过滤/分页参数 (GET /agent-runs, Phase 5C 控制台)。 */
|
|
2385
|
+
interface AgentRunListOptions {
|
|
2386
|
+
/** 按 runtime 过滤, 例 'crabcode_remote' (远控控制台列表)。 */
|
|
2387
|
+
runtime?: AgentRunRuntime | string;
|
|
2388
|
+
/** 按状态过滤, 例 'running'。 */
|
|
2389
|
+
status?: AgentRunStatus | string;
|
|
2390
|
+
/** 页码, 1 起; 缺省 1。 */
|
|
2391
|
+
page?: number;
|
|
2392
|
+
/** 每页条数; 缺省 20, 服务端上限 100。 */
|
|
2393
|
+
pageSize?: number;
|
|
2394
|
+
}
|
|
2395
|
+
/** `agentRuns.list()` 结果 — 分页形状对齐 listConsumeRecords ({records,total,page,pageSize})。 */
|
|
2396
|
+
interface AgentRunListResult {
|
|
2397
|
+
records: AgentRun[];
|
|
2398
|
+
total: number;
|
|
2399
|
+
page: number;
|
|
2400
|
+
pageSize: number;
|
|
2241
2401
|
}
|
|
2242
2402
|
interface AgentRunCreateResponse {
|
|
2243
2403
|
runId: string;
|
|
@@ -2390,6 +2550,13 @@ declare class AgentRunsClient {
|
|
|
2390
2550
|
private readonly client;
|
|
2391
2551
|
constructor(client: Client);
|
|
2392
2552
|
create(req: AgentRunCreateRequest, signal?: AbortSignal): Promise<AgentRunCreateResponse>;
|
|
2553
|
+
/**
|
|
2554
|
+
* List the caller's own agent runs, newest first (GET /agent-runs, Phase 5C
|
|
2555
|
+
* console). Returns view metadata only — never session tokens, policies or
|
|
2556
|
+
* messages (contract §6). Filter remote-control runs with
|
|
2557
|
+
* `{ runtime: 'crabcode_remote' }`.
|
|
2558
|
+
*/
|
|
2559
|
+
list(opts?: AgentRunListOptions, signal?: AbortSignal): Promise<AgentRunListResult>;
|
|
2393
2560
|
get(runId: string, signal?: AbortSignal): Promise<AgentRun>;
|
|
2394
2561
|
stream(runId: string, opts?: AgentRunStreamOptions, signal?: AbortSignal): AsyncIterable<AgentRunStreamEvent>;
|
|
2395
2562
|
cancel(runId: string, signal?: AbortSignal): Promise<AgentRun>;
|
|
@@ -2420,6 +2587,35 @@ declare class AgentRunsClient {
|
|
|
2420
2587
|
* matching `parseRemoteControlEvent`'s null-return contract.
|
|
2421
2588
|
*/
|
|
2422
2589
|
streamRemoteControl(runId: string, signal?: AbortSignal): AsyncIterable<RemoteControlEvent>;
|
|
2590
|
+
/**
|
|
2591
|
+
* Submit a permission decision for a pending `permission_request` event
|
|
2592
|
+
* (POST /agent-runs/:runId/permission-results, contract §4/§9/§14).
|
|
2593
|
+
*
|
|
2594
|
+
* Only `approved` | `rejected` may be submitted by clients — `timeout` /
|
|
2595
|
+
* `cancelled` are produced server-side. Requires an OAuth token with the
|
|
2596
|
+
* explicit `remote_control` scope (or a web JWT). 409 means the remote
|
|
2597
|
+
* session is gone (e.g. already terminated).
|
|
2598
|
+
*/
|
|
2599
|
+
submitPermissionResult(runId: string, result: RemotePermissionResultRequest, signal?: AbortSignal): Promise<void>;
|
|
2600
|
+
/**
|
|
2601
|
+
* Append a mid-session user message to a remote run
|
|
2602
|
+
* (POST /agent-runs/:runId/messages, Phase 5C). The message role is
|
|
2603
|
+
* hard-coded to 'user' server-side (contract §6 #5 prompt-injection
|
|
2604
|
+
* defence); content is limited to 64KB. Requires the explicit
|
|
2605
|
+
* `remote_control` scope (or a web JWT).
|
|
2606
|
+
*/
|
|
2607
|
+
submitUserMessage(runId: string, message: RemoteUserMessageRequest, signal?: AbortSignal): Promise<RemoteUserMessageAck>;
|
|
2608
|
+
/**
|
|
2609
|
+
* Reveal the one-shot remote session token for a desktop-runner run
|
|
2610
|
+
* (POST /agent-runs/:runId/remote-token, Phase 5B; contract §18.1).
|
|
2611
|
+
*
|
|
2612
|
+
* Desktop launcher only: the token is single-consumption (a second call
|
|
2613
|
+
* returns 409) and must never touch browser storage — receive it in the
|
|
2614
|
+
* native layer and inject it into the CrabCode child-process env only
|
|
2615
|
+
* (contract §6). Cloud / local_embedded runners never expose tokens over
|
|
2616
|
+
* HTTP (403). Requires the explicit `remote_control` scope.
|
|
2617
|
+
*/
|
|
2618
|
+
revealRemoteToken(runId: string, signal?: AbortSignal): Promise<RemoteSessionTokenGrant>;
|
|
2423
2619
|
private streamRemoteControlGen;
|
|
2424
2620
|
listArtifacts(runId: string, signal?: AbortSignal): Promise<AgentRunArtifact[]>;
|
|
2425
2621
|
downloadArtifact(runId: string, artifactId: string, signal?: AbortSignal): Promise<AgentRunDownload>;
|
|
@@ -2435,6 +2631,54 @@ declare class AgentRunsClient {
|
|
|
2435
2631
|
private requestRawInner;
|
|
2436
2632
|
}
|
|
2437
2633
|
|
|
2634
|
+
/** 允许的第三方提供商 (与网关 byokAllowedProviders / managed_model Provider 谱系对齐)。 */
|
|
2635
|
+
type ByokProvider = 'anthropic' | 'openai' | 'deepseek' | 'dashscope' | 'zhipu' | 'volcengine' | 'custom';
|
|
2636
|
+
type ByokCredentialStatus = 'active' | 'revoked';
|
|
2637
|
+
/** BYOK 密钥 masked 视图 — 永不含明文/密文。 */
|
|
2638
|
+
interface ByokCredential {
|
|
2639
|
+
credentialRef: string;
|
|
2640
|
+
provider: ByokProvider | string;
|
|
2641
|
+
name?: string;
|
|
2642
|
+
/** 仅 provider='custom' 时存在 (https:// 起始)。 */
|
|
2643
|
+
baseUrl?: string;
|
|
2644
|
+
/** 明文指纹 (轮换后变化; 用于"是否同一把钥匙"的人工核对)。 */
|
|
2645
|
+
fingerprint?: string;
|
|
2646
|
+
status: ByokCredentialStatus | string;
|
|
2647
|
+
createdAt?: string;
|
|
2648
|
+
lastUsedAt?: string;
|
|
2649
|
+
}
|
|
2650
|
+
/** `crabcodeByok.create()` 请求。明文一次性提交, 服务端加密落库后即弃。 */
|
|
2651
|
+
interface ByokCreateRequest {
|
|
2652
|
+
provider: ByokProvider;
|
|
2653
|
+
/** API key 明文; ≤4KB, 不得含换行。 */
|
|
2654
|
+
plaintext: string;
|
|
2655
|
+
/** 显示名; ≤100 字符。 */
|
|
2656
|
+
name?: string;
|
|
2657
|
+
/** 仅 provider='custom' 必填 (必须 https://); 其他 provider 不可设。 */
|
|
2658
|
+
baseUrl?: string;
|
|
2659
|
+
}
|
|
2660
|
+
declare module '@acosmi/sdk-ts' {
|
|
2661
|
+
interface Client {
|
|
2662
|
+
/** CrabCode 远控 BYO 模型密钥管理面 (契约 §18.2)。 */
|
|
2663
|
+
readonly crabcodeByok: CrabCodeByokClient;
|
|
2664
|
+
}
|
|
2665
|
+
}
|
|
2666
|
+
declare class CrabCodeByokClient {
|
|
2667
|
+
private readonly client;
|
|
2668
|
+
constructor(client: Client);
|
|
2669
|
+
/** 列出调用者自己的密钥 (masked; 新→旧, 服务端上限 100 条)。 */
|
|
2670
|
+
list(signal?: AbortSignal): Promise<ByokCredential[]>;
|
|
2671
|
+
/**
|
|
2672
|
+
* 创建密钥 — 明文一次性提交, 返回 masked 视图。
|
|
2673
|
+
* 单用户上限 20 把; provider='custom' 必须带 https:// baseUrl。
|
|
2674
|
+
*/
|
|
2675
|
+
create(req: ByokCreateRequest, signal?: AbortSignal): Promise<ByokCredential>;
|
|
2676
|
+
/** 轮换密钥明文 — credentialRef 不变, fingerprint 更新。已吊销的密钥不可轮换 (400)。 */
|
|
2677
|
+
rotate(credentialRef: string, newPlaintext: string, signal?: AbortSignal): Promise<ByokCredential>;
|
|
2678
|
+
/** 吊销密钥 (软状态 + 服务端抹密文, 不可恢复; 幂等 — 重复吊销返回当前视图)。 */
|
|
2679
|
+
revoke(credentialRef: string, signal?: AbortSignal): Promise<ByokCredential>;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2438
2682
|
declare const ScopeComplianceEvidenceRead = "compliance:evidence:read";
|
|
2439
2683
|
declare const ScopeComplianceEvidenceWrite = "compliance:evidence:write";
|
|
2440
2684
|
declare const ScopeComplianceTimestampIssue = "compliance:timestamp:issue";
|
|
@@ -3757,6 +4001,7 @@ interface SubscriptionPlan {
|
|
|
3757
4001
|
planDesc: string;
|
|
3758
4002
|
billingCycle: string;
|
|
3759
4003
|
basePriceFen: number;
|
|
4004
|
+
/** 档位标准额度。付费档单位 = 微 Credits (÷1000 = Credits): BASIC 0.6亿 / PRO 3亿 / PRO_MAX 9亿 / ULTRA 24亿 Credits。 */
|
|
3760
4005
|
tokenQuota: number;
|
|
3761
4006
|
seatMin?: number | null;
|
|
3762
4007
|
seatMax?: number | null;
|
|
@@ -3769,7 +4014,31 @@ interface SubscriptionPlan {
|
|
|
3769
4014
|
/** grant_policy 摘要 (P3 商品中心补) */
|
|
3770
4015
|
grantPolicyDigest?: Record<string, unknown> | null;
|
|
3771
4016
|
}
|
|
3772
|
-
/**
|
|
4017
|
+
/** C 端会员中心订阅概览 — 严格对齐网关 GET /entitlements/membership (membership.go membershipResponse)。 */
|
|
4018
|
+
interface Membership {
|
|
4019
|
+
hasActive: boolean;
|
|
4020
|
+
planCode: string;
|
|
4021
|
+
planName: string;
|
|
4022
|
+
tier: string;
|
|
4023
|
+
billingCycle: string;
|
|
4024
|
+
status: string;
|
|
4025
|
+
expiresAt: string;
|
|
4026
|
+
priceFen: number;
|
|
4027
|
+
/** 周期总额度。有活跃付费订阅 (hasActive=true) 时单位 = 微 Credits (÷1000 = Credits 代币); 免费档 = 原始 Token。 */
|
|
4028
|
+
tokenQuota: number;
|
|
4029
|
+
/** 当前周期已用 (后端 float64)。单位同 tokenQuota: 付费=微Credits / 免费=Token。 */
|
|
4030
|
+
tokenUsed: number;
|
|
4031
|
+
periodStart: string;
|
|
4032
|
+
/** isFree = !hasActive (无活跃付费订阅即免费档) */
|
|
4033
|
+
isFree: boolean;
|
|
4034
|
+
}
|
|
4035
|
+
/** 由活跃权益推导的订阅层级 — 对齐网关 GET /entitlements/subscription (entitlement.go GetSubscription)。 */
|
|
4036
|
+
interface SubscriptionTier {
|
|
4037
|
+
/** "free" | "pro" (后端按权益类型推导) */
|
|
4038
|
+
subscriptionType: string;
|
|
4039
|
+
activeEntitlementTypes: string[];
|
|
4040
|
+
}
|
|
4041
|
+
/** @deprecated 网关未暴露订阅列表端点; 该形状不对应任何真实响应。请改用 Membership + getMembership()。保留仅为向后兼容。 */
|
|
3773
4042
|
interface UserSubscription {
|
|
3774
4043
|
id: number;
|
|
3775
4044
|
userId: string;
|
|
@@ -3787,8 +4056,18 @@ declare module '@acosmi/sdk-ts' {
|
|
|
3787
4056
|
interface Client {
|
|
3788
4057
|
/** 列出当前可售订阅计划; audience='PERSONAL'|'ENTERPRISE' 可选过滤 */
|
|
3789
4058
|
listPlans(audience?: SubscriptionAudience, signal?: AbortSignal): Promise<SubscriptionPlan[]>;
|
|
3790
|
-
/**
|
|
3791
|
-
|
|
4059
|
+
/** 查询当前用户会员/订阅概览 (C 端会员中心)。无活跃订阅时 hasActive=false/isFree=true。 */
|
|
4060
|
+
getMembership(signal?: AbortSignal): Promise<Membership>;
|
|
4061
|
+
/** 由活跃权益推导订阅层级 (free/pro)。 */
|
|
4062
|
+
getSubscriptionTier(signal?: AbortSignal): Promise<SubscriptionTier>;
|
|
4063
|
+
/** 订阅支付前绑定硬闸。返回 {ok:true} 表示已绑定手机/邮箱可放行支付。
|
|
4064
|
+
* 未绑定时网关返回 HTTP 403 + 业务码 41001 (doJSON 抛 HTTPError), 调用方应据此引导用户先绑定联系方式再支付。 */
|
|
4065
|
+
subscriptionPrecheck(signal?: AbortSignal): Promise<{
|
|
4066
|
+
ok: boolean;
|
|
4067
|
+
}>;
|
|
4068
|
+
/** @deprecated 网关无订阅列表端点; 旧实现打 /distribution/user/subscriptions 恒 404。改用 getMembership()。
|
|
4069
|
+
* 本方法现委托 getMembership(): 有活跃订阅返回单元素数组, 否则空数组。 */
|
|
4070
|
+
listUserSubscriptions(signal?: AbortSignal): Promise<Membership[]>;
|
|
3792
4071
|
/**
|
|
3793
4072
|
* 按 planCode 精确取单个可售订阅计划 (V41 起 planCode 在 active 内唯一)。
|
|
3794
4073
|
* 复用 listPlans 客户端过滤, 未命中返回 null。减少 C 端按字段手筛 (deep-review §12.3)。
|
|
@@ -4590,8 +4869,7 @@ interface BridgeThreadRef {
|
|
|
4590
4869
|
/**
|
|
4591
4870
|
* ChatIntegration — 平台安装记录的 SDK 只读视图.
|
|
4592
4871
|
*
|
|
4593
|
-
*
|
|
4594
|
-
* Phase 7B handler 落地后, SDK admin 子客户端会按此型号 GET。
|
|
4872
|
+
* Phase 7B 起由 `client.chatBridge` 按此型号 GET (响应 camelCase, 契约 §12)。
|
|
4595
4873
|
*/
|
|
4596
4874
|
interface ChatIntegration {
|
|
4597
4875
|
id: string;
|
|
@@ -4602,6 +4880,10 @@ interface ChatIntegration {
|
|
|
4602
4880
|
workspaceIdHash?: string;
|
|
4603
4881
|
botIdHash?: string;
|
|
4604
4882
|
status: IntegrationStatus;
|
|
4883
|
+
/**
|
|
4884
|
+
* @deprecated 服务端从不返回此字段 (model ConfigJSON json:"-", 防 secret 误入
|
|
4885
|
+
* 后整体不外发) — 读取恒为 undefined。写入走 createIntegration({ configJson })。
|
|
4886
|
+
*/
|
|
4605
4887
|
configJson?: string;
|
|
4606
4888
|
installedByUserId?: string;
|
|
4607
4889
|
lastUsedAt?: string;
|
|
@@ -4697,4 +4979,53 @@ declare function isChannelInboundEvent(v: unknown): v is ChannelInboundEvent;
|
|
|
4697
4979
|
*/
|
|
4698
4980
|
declare function asCredentialRef(s: string): CredentialRef;
|
|
4699
4981
|
|
|
4700
|
-
|
|
4982
|
+
/** `chatBridge.createIntegration()` 请求 (wire snake_case 由 SDK 转换)。 */
|
|
4983
|
+
interface CreateIntegrationRequest {
|
|
4984
|
+
/** 绑定的 Acosmi app。 */
|
|
4985
|
+
appId: string;
|
|
4986
|
+
platform: Platform;
|
|
4987
|
+
region: Region;
|
|
4988
|
+
/** 平台 workspace/企业 原始 ID; 服务端只存 SHA256 hash。 */
|
|
4989
|
+
workspaceId?: string;
|
|
4990
|
+
/** 平台 bot 原始 ID; 服务端只存 SHA256 hash。 */
|
|
4991
|
+
botId?: string;
|
|
4992
|
+
/** 仅非敏感配置 (rate limit / feature toggles); 严禁含 secret。 */
|
|
4993
|
+
configJson?: string;
|
|
4994
|
+
}
|
|
4995
|
+
/** `chatBridge.storeCredential()` 请求 — 明文一次性提交。 */
|
|
4996
|
+
interface StoreCredentialRequest {
|
|
4997
|
+
/** 凭证种类 (平台相关, 例: app_secret / signing_secret / bot_token)。 */
|
|
4998
|
+
secretKind: string;
|
|
4999
|
+
/** 凭证明文; 加密落库后即弃, 响应只回 masked 视图。 */
|
|
5000
|
+
plaintext: string;
|
|
5001
|
+
region?: Region;
|
|
5002
|
+
platform?: Platform;
|
|
5003
|
+
}
|
|
5004
|
+
declare module '@acosmi/sdk-ts' {
|
|
5005
|
+
interface Client {
|
|
5006
|
+
/** 第三方聊天 bridge 控制面 (Phase 7B; 契约 §6/§12/ADR-8)。 */
|
|
5007
|
+
readonly chatBridge: ChatBridgeClient;
|
|
5008
|
+
}
|
|
5009
|
+
}
|
|
5010
|
+
declare class ChatBridgeClient {
|
|
5011
|
+
private readonly client;
|
|
5012
|
+
constructor(client: Client);
|
|
5013
|
+
/** 创建平台集成 (chat_bridge:write)。云端控制台与下游 (CrabCode) 调的是同一端点/同一份数据。 */
|
|
5014
|
+
createIntegration(req: CreateIntegrationRequest, signal?: AbortSignal): Promise<ChatIntegration>;
|
|
5015
|
+
/** 列出本租户集成 (chat_bridge:read; masked 视图)。可按 appId 过滤。 */
|
|
5016
|
+
listIntegrations(appId?: string, signal?: AbortSignal): Promise<ChatIntegration[]>;
|
|
5017
|
+
/** 取单个集成 (chat_bridge:read)。不存在/跨租户一律 404。 */
|
|
5018
|
+
getIntegration(id: string, signal?: AbortSignal): Promise<ChatIntegration>;
|
|
5019
|
+
/** 更新集成状态 (chat_bridge:write): pending | active | suspended | revoked。 */
|
|
5020
|
+
updateIntegrationStatus(id: string, status: IntegrationStatus, signal?: AbortSignal): Promise<void>;
|
|
5021
|
+
/** 存凭证 (chat_bridge:write) — 明文一次性提交, 返回 masked 记录 (ref+fingerprint)。 */
|
|
5022
|
+
storeCredential(integrationId: string, req: StoreCredentialRequest, signal?: AbortSignal): Promise<ChatCredentialPublic>;
|
|
5023
|
+
/** 列出集成的凭证 (chat_bridge:read; masked, 永不含明文/密文)。 */
|
|
5024
|
+
listCredentials(integrationId: string, signal?: AbortSignal): Promise<ChatCredentialPublic[]>;
|
|
5025
|
+
/** 轮换凭证 (chat_bridge:rotate, 高风险) — ref 不变, fingerprint 更新。 */
|
|
5026
|
+
rotateCredential(integrationId: string, secretKind: string, newPlaintext: string, signal?: AbortSignal): Promise<ChatCredentialPublic>;
|
|
5027
|
+
/** 吊销凭证 (chat_bridge:rotate) — 软吊销 + 服务端抹密文。 */
|
|
5028
|
+
revokeCredential(credentialRef: string, signal?: AbortSignal): Promise<void>;
|
|
5029
|
+
}
|
|
5030
|
+
|
|
5031
|
+
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, 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, 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, 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, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isValidTokenSet, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newTokenSet, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
|