@acosmi/sdk-ts 2.15.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,7 +1,12 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
3
+ var __esm = (fn, res, err) => function __init() {
4
+ if (err) throw err[0];
5
+ try {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ } catch (e) {
8
+ throw err = [e], e;
9
+ }
5
10
  };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
@@ -1322,6 +1327,7 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1322
1327
  };
1323
1328
  const verifier = await generateCodeVerifier();
1324
1329
  const challenge = await codeChallenge(verifier);
1330
+ const state = await generateState();
1325
1331
  const http = await import('http');
1326
1332
  const server = http.createServer();
1327
1333
  await new Promise((resolve, reject) => {
@@ -1337,6 +1343,8 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1337
1343
  codeResolver = resolve;
1338
1344
  codeRejecter = reject;
1339
1345
  });
1346
+ codePromise.catch(() => {
1347
+ });
1340
1348
  server.on("request", (req, res) => {
1341
1349
  const url = new URL(req.url ?? "/", `http://127.0.0.1:${port}`);
1342
1350
  if (url.pathname !== "/callback") {
@@ -1344,6 +1352,16 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1344
1352
  res.end();
1345
1353
  return;
1346
1354
  }
1355
+ const states = url.searchParams.getAll("state");
1356
+ const stateFailure = states.length === 0 ? "callback missing state" : states.length > 1 ? "callback carried multiple state values" : states[0] !== state ? "callback state does not match pending state" : null;
1357
+ if (stateFailure !== null) {
1358
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
1359
+ res.end(
1360
+ `<!DOCTYPE html><html><head><meta charset="utf-8"><title>\u6388\u6743\u5931\u8D25</title></head><body style="font-family:system-ui,sans-serif;text-align:center;padding:60px 20px"><h2>\u6388\u6743\u5931\u8D25</h2><p>\u56DE\u8C03\u6821\u9A8C\u672A\u901A\u8FC7, \u5DF2\u4E2D\u6B62\u767B\u5F55\u3002</p><p style="color:#888;font-size:14px">\u53EF\u4EE5\u5173\u95ED\u6B64\u7A97\u53E3\u3002</p></body></html>`
1361
+ );
1362
+ codeRejecter(new Error(`authorize: ${ErrStateMismatch}: ${stateFailure} (possible CSRF)`));
1363
+ return;
1364
+ }
1347
1365
  const code = url.searchParams.get("code");
1348
1366
  if (!code) {
1349
1367
  const errMsg = url.searchParams.get("error_description") || url.searchParams.get("error") || "";
@@ -1374,6 +1392,7 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1374
1392
  authURL.searchParams.set("response_type", "code");
1375
1393
  authURL.searchParams.set("code_challenge", challenge);
1376
1394
  authURL.searchParams.set("code_challenge_method", "S256");
1395
+ authURL.searchParams.set("state", state);
1377
1396
  if (scopes.length > 0) {
1378
1397
  authURL.searchParams.set("scope", scopes.join(" "));
1379
1398
  }
@@ -1411,7 +1430,9 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1411
1430
  return { result: { code, redirectURI }, verifier };
1412
1431
  } catch (e) {
1413
1432
  const msg = e instanceof Error ? e.message : String(e);
1414
- if (msg.includes("denied")) {
1433
+ if (msg.includes(ErrStateMismatch)) {
1434
+ emit({ type: EventError, err_code: ErrStateMismatch, error: msg });
1435
+ } else if (msg.includes("denied")) {
1415
1436
  emit({ type: EventError, err_code: ErrAuthDenied, error: msg });
1416
1437
  } else if (msg.includes("timed out")) {
1417
1438
  emit({ type: EventError, err_code: ErrTimeout, error: msg });
@@ -1422,6 +1443,7 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1422
1443
  } finally {
1423
1444
  if (abortHandler && signal) signal.removeEventListener("abort", abortHandler);
1424
1445
  server.close();
1446
+ server.closeIdleConnections?.();
1425
1447
  }
1426
1448
  }
1427
1449
  function htmlEscape(s) {
@@ -2288,6 +2310,13 @@ var ErrOAuthCORSBlocked = "oauth_cors_blocked";
2288
2310
  var ErrRefreshProxyFailed = "refresh_proxy_failed";
2289
2311
  var ErrTokenExpired = "token_expired";
2290
2312
  var CHAT_REQUEST_TIMEOUT_MS = 11 * 60 * 1e3;
2313
+ function notifyUpstreamActivity(cb) {
2314
+ if (!cb) return;
2315
+ try {
2316
+ cb();
2317
+ } catch {
2318
+ }
2319
+ }
2291
2320
  var DEFAULT_API_TIMEOUT_MS = 6e4;
2292
2321
  function newDeferred() {
2293
2322
  let resolve;
@@ -3001,7 +3030,13 @@ var Client = class _Client {
3001
3030
  try {
3002
3031
  const { body, adapter } = await this.buildChatRequest(modelID, r, ctl.signal);
3003
3032
  const endpoint = `/managed-models/${encodeURIComponent(modelID)}${adapter.endpointSuffix()}`;
3004
- const { result, headers } = await this.doJSONFullRaw("POST", endpoint, body, ctl.signal);
3033
+ const { result, headers } = await this.doJSONFullRaw(
3034
+ "POST",
3035
+ endpoint,
3036
+ body,
3037
+ ctl.signal,
3038
+ CHAT_REQUEST_TIMEOUT_MS
3039
+ );
3005
3040
  const resp = adapter.parseResponse(result);
3006
3041
  const v1 = headers.get("X-Token-Remaining");
3007
3042
  if (v1) {
@@ -3066,7 +3101,13 @@ var Client = class _Client {
3066
3101
  */
3067
3102
  async generateVideo(modelID, req, signal) {
3068
3103
  const endpoint = `/managed-models/${encodeURIComponent(modelID)}/videos/generations`;
3069
- const { result } = await this.doJSONFullRaw("POST", endpoint, req, signal);
3104
+ const { result } = await this.doJSONFullRaw(
3105
+ "POST",
3106
+ endpoint,
3107
+ req,
3108
+ signal,
3109
+ CHAT_REQUEST_TIMEOUT_MS
3110
+ );
3070
3111
  return this.unwrapAPIResponse(result);
3071
3112
  }
3072
3113
  /**
@@ -3135,7 +3176,8 @@ var Client = class _Client {
3135
3176
  "POST",
3136
3177
  `/managed-models/${encodeURIComponent(modelID)}/anthropic`,
3137
3178
  data,
3138
- ctl.signal
3179
+ ctl.signal,
3180
+ CHAT_REQUEST_TIMEOUT_MS
3139
3181
  );
3140
3182
  const rawStr = new TextDecoder().decode(result);
3141
3183
  try {
@@ -3169,7 +3211,13 @@ var Client = class _Client {
3169
3211
  const body = adapter.buildRequestBody(caps, r);
3170
3212
  const data = JSON.stringify(body);
3171
3213
  const endpoint = `/managed-models/${encodeURIComponent(modelID)}${adapter.endpointSuffix()}`;
3172
- const { result } = await this.doJSONFullRaw("POST", endpoint, data, ctl.signal);
3214
+ const { result } = await this.doJSONFullRaw(
3215
+ "POST",
3216
+ endpoint,
3217
+ data,
3218
+ ctl.signal,
3219
+ CHAT_REQUEST_TIMEOUT_MS
3220
+ );
3173
3221
  const { parseOpenAIResponseToAnthropic: parseOpenAIResponseToAnthropic2 } = await Promise.resolve().then(() => (init_openai(), openai_exports));
3174
3222
  return parseOpenAIResponseToAnthropic2(result);
3175
3223
  } finally {
@@ -3179,23 +3227,27 @@ var Client = class _Client {
3179
3227
  /**
3180
3228
  * 流式聊天 (SSE), 通过 async generator 返回事件
3181
3229
  * v0.5.0: 根据 adapter 路由端点
3230
+ *
3231
+ * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
3182
3232
  */
3183
- chatStream(modelID, req, signal) {
3233
+ chatStream(modelID, req, signal, onUpstreamActivity) {
3184
3234
  return {
3185
- [Symbol.asyncIterator]: () => this.chatStreamGen(modelID, req, signal, false)
3235
+ [Symbol.asyncIterator]: () => this.chatStreamGen(modelID, req, signal, false, onUpstreamActivity)
3186
3236
  };
3187
3237
  }
3188
3238
  /**
3189
3239
  * Anthropic 原生格式流式聊天 (SSE)
3190
3240
  * 调用 POST /managed-models/:id/anthropic, SSE 事件为 Anthropic 协议格式
3191
3241
  * 无 started/settled/failed 自定义事件, 无 data: [DONE], message_stop 为自然结束
3242
+ *
3243
+ * @param onUpstreamActivity 见 {@link UpstreamActivityCallback}
3192
3244
  */
3193
- chatMessagesStream(modelID, req, signal) {
3245
+ chatMessagesStream(modelID, req, signal, onUpstreamActivity) {
3194
3246
  return {
3195
- [Symbol.asyncIterator]: () => this.chatMessagesStreamGen(modelID, req, signal, false)
3247
+ [Symbol.asyncIterator]: () => this.chatMessagesStreamGen(modelID, req, signal, false, onUpstreamActivity)
3196
3248
  };
3197
3249
  }
3198
- async *chatStreamGen(modelID, req, signal, retried) {
3250
+ async *chatStreamGen(modelID, req, signal, retried, onUpstreamActivity) {
3199
3251
  const r = { ...req, stream: true };
3200
3252
  const { body, adapter } = await this.buildChatRequest(modelID, r, signal);
3201
3253
  const token = await this.ensureToken(signal);
@@ -3228,7 +3280,7 @@ var Client = class _Client {
3228
3280
  `stream: unauthorized and refresh failed: ${refreshErr instanceof Error ? refreshErr.message : String(refreshErr)}`
3229
3281
  );
3230
3282
  }
3231
- yield* this.chatStreamGen(modelID, req, signal, true);
3283
+ yield* this.chatStreamGen(modelID, req, signal, true, onUpstreamActivity);
3232
3284
  return;
3233
3285
  }
3234
3286
  if (!resp.ok) {
@@ -3244,6 +3296,7 @@ var Client = class _Client {
3244
3296
  }
3245
3297
  let currentEvent = "";
3246
3298
  for await (const line of iterSSELines(resp.body)) {
3299
+ notifyUpstreamActivity(onUpstreamActivity);
3247
3300
  if (isSSECommentLine(line)) continue;
3248
3301
  if (line.startsWith("event:")) {
3249
3302
  currentEvent = line.slice("event:".length).trim();
@@ -3264,7 +3317,7 @@ var Client = class _Client {
3264
3317
  }
3265
3318
  }
3266
3319
  }
3267
- async *chatMessagesStreamGen(modelID, req, signal, retried) {
3320
+ async *chatMessagesStreamGen(modelID, req, signal, retried, onUpstreamActivity) {
3268
3321
  const r = { ...req, stream: true };
3269
3322
  const { body, adapter } = await this.buildChatRequest(modelID, r, signal);
3270
3323
  const token = await this.ensureToken(signal);
@@ -3297,7 +3350,7 @@ var Client = class _Client {
3297
3350
  `messages stream: unauthorized and refresh failed: ${refreshErr instanceof Error ? refreshErr.message : String(refreshErr)}`
3298
3351
  );
3299
3352
  }
3300
- yield* this.chatMessagesStreamGen(modelID, req, signal, true);
3353
+ yield* this.chatMessagesStreamGen(modelID, req, signal, true, onUpstreamActivity);
3301
3354
  return;
3302
3355
  }
3303
3356
  if (!resp.ok) {
@@ -3310,6 +3363,7 @@ var Client = class _Client {
3310
3363
  if (adapter.format() === 1 /* OpenAI */) {
3311
3364
  const converter = newOpenAIStreamConverter();
3312
3365
  for await (const line of iterSSELines(resp.body)) {
3366
+ notifyUpstreamActivity(onUpstreamActivity);
3313
3367
  if (isSSECommentLine(line)) continue;
3314
3368
  if (line.startsWith("event:")) {
3315
3369
  line.slice("event:".length).trim();
@@ -3324,6 +3378,7 @@ var Client = class _Client {
3324
3378
  const blockTypeMap = /* @__PURE__ */ new Map();
3325
3379
  let currentEvent = "";
3326
3380
  for await (const line of iterSSELines(resp.body)) {
3381
+ notifyUpstreamActivity(onUpstreamActivity);
3327
3382
  if (isSSECommentLine(line)) continue;
3328
3383
  if (line.startsWith("event:")) {
3329
3384
  currentEvent = line.slice("event:".length).trim();
@@ -3456,7 +3511,19 @@ var Client = class _Client {
3456
3511
  ctl.dispose();
3457
3512
  }
3458
3513
  }
3459
- /** doJSONFull 的 raw bytes 变体 (chat 用, 不立即 JSON.parse) */
3514
+ /**
3515
+ * doJSONFull 的 raw bytes 变体 (chat 用, 不立即 JSON.parse)
3516
+ *
3517
+ * ⚠️ 契约 (2026-08-06): `timeoutMs` 的 30s 默认值只适用于**控制面**端点 (列目录 /
3518
+ * 查配额 / 取任务状态)。凡走**模型推理或生成**的端点 —— chat / anthropic /
3519
+ * embeddings / rerank / images / videos —— 一律必须显式传入 `CHAT_REQUEST_TIMEOUT_MS`,
3520
+ * 哪怕调用方已经用 `withRequestTimeout` 建了外层预算: 外层只约束 `signal`, 内层
3521
+ * 会**另建**一个 `timeoutMs` 计时器, 30s 恒先于任何更长的外层预算触发。
3522
+ *
3523
+ * 这不是假设 —— 2026-08-06 事故里 chat 路径正因漏传本参数而被恒定钉死在 30s,
3524
+ * 且上方 v1.6.0 的注释还声称它已是 11min。回归闸门见
3525
+ * `tests/chat-timeout-budget.test.ts`。
3526
+ */
3460
3527
  async doJSONFullRaw(method, path, body, signal, timeoutMs = 3e4) {
3461
3528
  return this.doJSONFullRawInternal(method, path, body, signal, false, timeoutMs);
3462
3529
  }
@@ -4124,6 +4191,7 @@ var ScopeChatBridge = "chat_bridge";
4124
4191
  var ScopeChatBridgeRead = "chat_bridge:read";
4125
4192
  var ScopeChatBridgeWrite = "chat_bridge:write";
4126
4193
  var ScopeChatBridgeRotate = "chat_bridge:rotate";
4194
+ var ScopeAgentAccessManage = "agent_access:manage";
4127
4195
  var ScopeModels = "models";
4128
4196
  var ScopeModelsChat = "models:chat";
4129
4197
  var ScopeEntitlements = "entitlements";
@@ -4152,6 +4220,9 @@ function remoteControlScopes() {
4152
4220
  function chatBridgeScopes() {
4153
4221
  return [ScopeChatBridge];
4154
4222
  }
4223
+ function agentAccessScopes() {
4224
+ return [ScopeAgentAccessManage];
4225
+ }
4155
4226
 
4156
4227
  // src/models/index.ts
4157
4228
  init_types();
@@ -7117,6 +7188,15 @@ function sleep2(ms, signal) {
7117
7188
  }
7118
7189
 
7119
7190
  // src/support/bug-report.ts
7191
+ function unwrapBugReport(raw, op, isComplete) {
7192
+ if (raw && isComplete(raw)) return raw;
7193
+ const inner = raw?.data;
7194
+ if (inner && isComplete(inner)) return inner;
7195
+ const keys = raw && typeof raw === "object" ? Object.keys(raw) : [];
7196
+ throw new Error(
7197
+ `acosmi: ${op}: gateway accepted the request but the response is missing required fields (observed keys: ${keys.length > 0 ? keys.join(",") : "<none>"})`
7198
+ );
7199
+ }
7120
7200
  Client.prototype.submitBugReport = async function(reportData, signal) {
7121
7201
  if (reportData == null) {
7122
7202
  throw new Error("acosmi: reportData required");
@@ -7133,7 +7213,11 @@ Client.prototype.submitBugReport = async function(reportData, signal) {
7133
7213
  { content: contentStr },
7134
7214
  signal
7135
7215
  );
7136
- return result.data;
7216
+ return unwrapBugReport(
7217
+ result,
7218
+ "submitBugReport",
7219
+ (r) => typeof r.feedback_id === "string" && r.feedback_id.length > 0
7220
+ );
7137
7221
  };
7138
7222
  Client.prototype.getBugReport = async function(bugID, signal) {
7139
7223
  const trimmed = bugID.trim();
@@ -7146,7 +7230,7 @@ Client.prototype.getBugReport = async function(bugID, signal) {
7146
7230
  null,
7147
7231
  signal
7148
7232
  );
7149
- return resp.data;
7233
+ return unwrapBugReport(resp, "getBugReport", (r) => typeof r.id === "string");
7150
7234
  };
7151
7235
 
7152
7236
  // src/subscription/client.ts
@@ -7728,6 +7812,6 @@ function brandCredential(c) {
7728
7812
  return c;
7729
7813
  }
7730
7814
 
7731
- export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, AgentRunStreamError, AgentRunsClient, AnthropicAdapter, AudienceEnum, BillingModeEnum, BucketClassCommercial, BucketClassGeneric, BusinessError, ChatBridgeClient, Client, ComplianceClient, CompliancePollError, CrabCodeByokClient, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, 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, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, HTTPError, IdempotencyKeyHeader, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OAuthTokenEndpointError, OpenAIAdapter, OrderTerminalError, ProductFamilyEnum, ProviderFormat, RETRY_ADVICE_REASONS, RateLimitError, RegionScopeEnum, 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, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, chatBridgeScopes, classifyComplianceError, classifySourcesEvent, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, parseSettlement, parseSourcesEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
7815
+ export { AGENT_RUN_META_TITLE, AGENT_RUN_META_WORKSPACE, ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, AgentRunStreamError, AgentRunsClient, AnthropicAdapter, AudienceEnum, BillingModeEnum, BucketClassCommercial, BucketClassGeneric, BusinessError, CHAT_REQUEST_TIMEOUT_MS, ChatBridgeClient, Client, ComplianceClient, CompliancePollError, CrabCodeByokClient, DEFAULT_API_TIMEOUT_MS, DEFAULT_GATEWAY_BASE_URL, DefaultRetryPolicy, 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, FileTokenStore, FilterStatusAdminBypass, FilterStatusDisabledByFlag, FilterStatusFallbackMissingUser, FilterStatusFallbackNoBuckets, FilterStatusFallbackTkdistError, FilterStatusFallbackTkdistSkew, FilterStatusInternalBypass, FilterStatusOK, FilterStatusUnknown, HTTPError, IdempotencyKeyHeader, InMemoryTokenStore, LocalStorageTokenStore, ModelNotFoundError, NetworkError, OAuthTokenEndpointError, OpenAIAdapter, OrderTerminalError, ProductFamilyEnum, ProviderFormat, RETRY_ADVICE_REASONS, RateLimitError, RegionScopeEnum, ScopeAI, ScopeAccount, ScopeAgentAccessManage, ScopeChatBridge, ScopeChatBridgeRead, ScopeChatBridgeRotate, ScopeChatBridgeWrite, ScopeComplianceContractSigningRead, ScopeComplianceContractSigningWrite, ScopeComplianceContractTemplateRead, ScopeComplianceContractTemplateWrite, ScopeComplianceEvidenceRead, ScopeComplianceEvidenceWrite, ScopeComplianceReportsPublish, ScopeComplianceReportsRead, ScopeComplianceReportsWrite, ScopeComplianceSealApprovalApprove, ScopeComplianceSealApprovalRequest, ScopeComplianceSealManage, ScopeComplianceSealUseExecute, ScopeComplianceTimestampIssue, ScopeComplianceTimestampVerify, ScopeEntitlements, ScopeModels, ScopeModelsChat, ScopeProfile, ScopeRemoteControl, ScopeRemoteControlAgentRun, ScopeRemoteControlPermissionResponse, ScopeRemoteControlSessionControl, ScopeSkillStore, ScopeSkills, ScopeTokenPackages, ScopeTools, ScopeToolsExecute, ScopeWallet, ScopeWalletReadonly, ServerToolTypeWebSearch, StreamError, ThinkingHigh, ThinkingHighMinMaxTokens, ThinkingMax, ThinkingMaxFallbackMaxTokens, ThinkingOff, agentAccessScopes, allScopes, anthropicResponseTextContent, anthropicResponseThinkingContent, anthropicResponseToolUseBlocks, apiResponseBusinessError, apiResponseGetMessage, asCredentialRef, authorize, bucketInfoIsCommercial, bucketRowIsCommercial, buildBetas, chatBridgeScopes, classifyComplianceError, classifySourcesEvent, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, getWindowLimitStreamDetails, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isContinuableWindowLimitError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isValidTokenSet, isWindowLimitError, isWindowLimitStreamError, maxEndUserIdLength, modelScopes, modelSupportsImageInput, modelSupportsInputModality, newFileTokenStore, newThinkingConfig, newTokenSet, newWebSearchTool, normalizeGatewayBaseURL, normalizeOverrideBaseURL, parseNotificationEvent, parseRemoteControlEvent, parseSettlement, parseSourcesEvent, refreshToken, register, registerWebOAuthClient, remoteControlScopes, retryReasonForComplianceKey, retryReasonForOAuthError, revokeToken, sanitize_exports as sanitize, skillScopes, tokenSetIsExpired, uniqueMerge, validateEndUserId };
7732
7816
  //# sourceMappingURL=index.mjs.map
7733
7817
  //# sourceMappingURL=index.mjs.map