@acosmi/sdk-ts 2.6.0 → 2.8.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
@@ -1259,10 +1259,17 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1259
1259
  codeRejecter(new Error(`authorization denied: ${errMsg}`));
1260
1260
  return;
1261
1261
  }
1262
- res.setHeader("Content-Type", "text/html; charset=utf-8");
1263
- res.end(
1264
- `<!DOCTYPE html><html><head><meta charset="utf-8"><title>\u6388\u6743\u6210\u529F</title></head><body style="font-family:system-ui,sans-serif;text-align:center;padding:60px 20px"><h2>\u6388\u6743\u6210\u529F</h2><p>\u5DF2\u5B8C\u6210\u8EAB\u4EFD\u8BA4\u8BC1, \u8BF7\u8FD4\u56DE\u5E94\u7528\u7EE7\u7EED\u4F7F\u7528\u3002</p><p style="color:#888;font-size:14px">\u6B64\u7A97\u53E3\u5C06\u5728 3 \u79D2\u540E\u81EA\u52A8\u5173\u95ED\u2026</p><script>setTimeout(function(){window.close()},3000)</script></body></html>`
1265
- );
1262
+ const successRedirect = resolveSuccessRedirect(opts.successRedirectURL);
1263
+ if (successRedirect) {
1264
+ res.statusCode = 302;
1265
+ res.setHeader("Location", successRedirect);
1266
+ res.end();
1267
+ } else {
1268
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
1269
+ res.end(
1270
+ `<!DOCTYPE html><html><head><meta charset="utf-8"><title>\u6388\u6743\u6210\u529F</title></head><body style="font-family:system-ui,sans-serif;text-align:center;padding:60px 20px"><h2>\u6388\u6743\u6210\u529F</h2><p>\u5DF2\u5B8C\u6210\u8EAB\u4EFD\u8BA4\u8BC1, \u8BF7\u8FD4\u56DE\u5E94\u7528\u7EE7\u7EED\u4F7F\u7528\u3002</p><p style="color:#888;font-size:14px">\u6B64\u7A97\u53E3\u5C06\u5728 3 \u79D2\u540E\u81EA\u52A8\u5173\u95ED\u2026</p><script>setTimeout(function(){window.close()},3000)</script></body></html>`
1271
+ );
1272
+ }
1266
1273
  codeResolver(code);
1267
1274
  });
1268
1275
  const authURL = new URL(meta.authorization_endpoint);
@@ -1324,6 +1331,16 @@ async function authorize(meta, clientID, scopes, opts = {}) {
1324
1331
  function htmlEscape(s) {
1325
1332
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1326
1333
  }
1334
+ function resolveSuccessRedirect(raw) {
1335
+ if (!raw) return null;
1336
+ try {
1337
+ const u = new URL(raw);
1338
+ if (u.protocol !== "http:" && u.protocol !== "https:") return null;
1339
+ return u.toString();
1340
+ } catch {
1341
+ return null;
1342
+ }
1343
+ }
1327
1344
  async function createWebAuthorizationRequest(meta, opts) {
1328
1345
  const verifier = await generateCodeVerifier();
1329
1346
  const challenge = await codeChallenge(verifier);
@@ -4763,6 +4780,8 @@ async function sleepWithSignal2(ms, signal) {
4763
4780
  }
4764
4781
 
4765
4782
  // src/agent-runs/types.ts
4783
+ var AGENT_RUN_META_TITLE = "title";
4784
+ var AGENT_RUN_META_WORKSPACE = "workspace";
4766
4785
  var AgentRunStreamError = class extends Error {
4767
4786
  event;
4768
4787
  code;
@@ -4938,6 +4957,33 @@ var AgentRunsClient = class {
4938
4957
  );
4939
4958
  return fromWireCreateResponse(resp);
4940
4959
  }
4960
+ /**
4961
+ * List the caller's own agent runs, newest first (GET /agent-runs, Phase 5C
4962
+ * console). Returns view metadata only — never session tokens, policies or
4963
+ * messages (contract §6). Filter remote-control runs with
4964
+ * `{ runtime: 'crabcode_remote' }`.
4965
+ */
4966
+ async list(opts = {}, signal) {
4967
+ const params = new URLSearchParams();
4968
+ if (opts.runtime) params.set("runtime", opts.runtime);
4969
+ if (opts.status) params.set("status", opts.status);
4970
+ if (opts.page != null) params.set("page", String(opts.page));
4971
+ if (opts.pageSize != null) params.set("page_size", String(opts.pageSize));
4972
+ const qs = params.toString();
4973
+ const resp = await this.requestAPI(
4974
+ "GET",
4975
+ `/agent-runs${qs ? `?${qs}` : ""}`,
4976
+ null,
4977
+ signal,
4978
+ { retryOn401: true }
4979
+ );
4980
+ return {
4981
+ records: (resp.records ?? []).map(fromWireRun),
4982
+ total: typeof resp.total === "number" ? resp.total : 0,
4983
+ page: typeof resp.page === "number" ? resp.page : 1,
4984
+ pageSize: typeof resp.pageSize === "number" ? resp.pageSize : 20
4985
+ };
4986
+ }
4941
4987
  get(runId, signal) {
4942
4988
  return this.requestAPI(
4943
4989
  "GET",
@@ -4999,6 +5045,73 @@ var AgentRunsClient = class {
4999
5045
  [Symbol.asyncIterator]: () => this.streamRemoteControlGen(runId, signal)
5000
5046
  };
5001
5047
  }
5048
+ /**
5049
+ * Submit a permission decision for a pending `permission_request` event
5050
+ * (POST /agent-runs/:runId/permission-results, contract §4/§9/§14).
5051
+ *
5052
+ * Only `approved` | `rejected` may be submitted by clients — `timeout` /
5053
+ * `cancelled` are produced server-side. Requires an OAuth token with the
5054
+ * explicit `remote_control` scope (or a web JWT). 409 means the remote
5055
+ * session is gone (e.g. already terminated).
5056
+ */
5057
+ async submitPermissionResult(runId, result, signal) {
5058
+ await this.requestAPI(
5059
+ "POST",
5060
+ `/agent-runs/${encodeURIComponent(runId)}/permission-results`,
5061
+ {
5062
+ request_id: result.requestId,
5063
+ decision: result.decision,
5064
+ reason: result.reason
5065
+ },
5066
+ signal,
5067
+ { retryOn401: false }
5068
+ );
5069
+ }
5070
+ /**
5071
+ * Append a mid-session user message to a remote run
5072
+ * (POST /agent-runs/:runId/messages, Phase 5C). The message role is
5073
+ * hard-coded to 'user' server-side (contract §6 #5 prompt-injection
5074
+ * defence); content is limited to 64KB. Requires the explicit
5075
+ * `remote_control` scope (or a web JWT).
5076
+ */
5077
+ async submitUserMessage(runId, message, signal) {
5078
+ const resp = await this.requestAPI(
5079
+ "POST",
5080
+ `/agent-runs/${encodeURIComponent(runId)}/messages`,
5081
+ { request_id: message.requestId, content: message.content },
5082
+ signal,
5083
+ { retryOn401: false }
5084
+ );
5085
+ return {
5086
+ ok: resp?.ok === true,
5087
+ requestId: resp?.request_id ?? message.requestId ?? ""
5088
+ };
5089
+ }
5090
+ /**
5091
+ * Reveal the one-shot remote session token for a desktop-runner run
5092
+ * (POST /agent-runs/:runId/remote-token, Phase 5B; contract §18.1).
5093
+ *
5094
+ * Desktop launcher only: the token is single-consumption (a second call
5095
+ * returns 409) and must never touch browser storage — receive it in the
5096
+ * native layer and inject it into the CrabCode child-process env only
5097
+ * (contract §6). Cloud / local_embedded runners never expose tokens over
5098
+ * HTTP (403). Requires the explicit `remote_control` scope.
5099
+ */
5100
+ async revealRemoteToken(runId, signal) {
5101
+ const resp = await this.requestAPI(
5102
+ "POST",
5103
+ `/agent-runs/${encodeURIComponent(runId)}/remote-token`,
5104
+ {},
5105
+ signal,
5106
+ { retryOn401: false }
5107
+ );
5108
+ return {
5109
+ accessToken: resp?.access_token ?? "",
5110
+ sessionUrl: resp?.session_url ?? "",
5111
+ tenantId: resp?.tenant_id ?? "",
5112
+ workspace: resp?.workspace || void 0
5113
+ };
5114
+ }
5002
5115
  async *streamRemoteControlGen(runId, signal) {
5003
5116
  const resp = await this.requestRaw(
5004
5117
  "GET",
@@ -5249,6 +5362,7 @@ function toWireCreateRequest(req) {
5249
5362
  adapter: req.adapter,
5250
5363
  permission_policy: req.permissionPolicy ? toWirePermissionPolicy(req.permissionPolicy) : void 0,
5251
5364
  workspace_policy: req.workspacePolicy ? toWireWorkspacePolicy(req.workspacePolicy) : void 0,
5365
+ byok_credential_ref: req.byokCredentialRef,
5252
5366
  artifact_policy: req.artifactPolicy ? {
5253
5367
  enabled: req.artifactPolicy.enabled,
5254
5368
  max_files: req.artifactPolicy.maxFiles
@@ -5281,7 +5395,10 @@ function fromWireRun(resp) {
5281
5395
  startedAt: resp.started_at,
5282
5396
  completedAt: resp.completed_at,
5283
5397
  error: normalizeError(resp.error),
5284
- metadata: resp.metadata
5398
+ metadata: resp.metadata,
5399
+ runtime: resp.runtime,
5400
+ runner: resp.runner,
5401
+ adapter: resp.adapter
5285
5402
  };
5286
5403
  }
5287
5404
  function fromWireArtifact(resp) {
@@ -5539,6 +5656,87 @@ function errorMessage(e) {
5539
5656
  return e instanceof Error ? e.message : String(e);
5540
5657
  }
5541
5658
 
5659
+ // src/agent-runs/byok.ts
5660
+ function fromWireByok(v) {
5661
+ return {
5662
+ credentialRef: v.credential_ref ?? "",
5663
+ provider: v.provider ?? "",
5664
+ name: v.name || void 0,
5665
+ baseUrl: v.base_url || void 0,
5666
+ fingerprint: v.fingerprint || void 0,
5667
+ status: v.status ?? "",
5668
+ createdAt: v.created_at || void 0,
5669
+ lastUsedAt: v.last_used_at || void 0
5670
+ };
5671
+ }
5672
+ var byokByClient = /* @__PURE__ */ new WeakMap();
5673
+ Object.defineProperty(Client.prototype, "crabcodeByok", {
5674
+ configurable: true,
5675
+ enumerable: false,
5676
+ get() {
5677
+ let existing = byokByClient.get(this);
5678
+ if (!existing) {
5679
+ existing = new CrabCodeByokClient(this);
5680
+ byokByClient.set(this, existing);
5681
+ }
5682
+ return existing;
5683
+ }
5684
+ });
5685
+ var CrabCodeByokClient = class {
5686
+ constructor(client) {
5687
+ this.client = client;
5688
+ }
5689
+ client;
5690
+ /** 列出调用者自己的密钥 (masked; 新→旧, 服务端上限 100 条)。 */
5691
+ async list(signal) {
5692
+ const resp = await this.client.doJSON(
5693
+ "GET",
5694
+ "/crabcode/byok-credentials",
5695
+ null,
5696
+ signal
5697
+ );
5698
+ return (resp.data?.items ?? []).map(fromWireByok);
5699
+ }
5700
+ /**
5701
+ * 创建密钥 — 明文一次性提交, 返回 masked 视图。
5702
+ * 单用户上限 20 把; provider='custom' 必须带 https:// baseUrl。
5703
+ */
5704
+ async create(req, signal) {
5705
+ const resp = await this.client.doJSON(
5706
+ "POST",
5707
+ "/crabcode/byok-credentials",
5708
+ {
5709
+ provider: req.provider,
5710
+ name: req.name,
5711
+ base_url: req.baseUrl,
5712
+ plaintext: req.plaintext
5713
+ },
5714
+ signal
5715
+ );
5716
+ return fromWireByok(resp.data ?? {});
5717
+ }
5718
+ /** 轮换密钥明文 — credentialRef 不变, fingerprint 更新。已吊销的密钥不可轮换 (400)。 */
5719
+ async rotate(credentialRef, newPlaintext, signal) {
5720
+ const resp = await this.client.doJSON(
5721
+ "POST",
5722
+ `/crabcode/byok-credentials/${encodeURIComponent(credentialRef)}/rotate`,
5723
+ { new_plaintext: newPlaintext },
5724
+ signal
5725
+ );
5726
+ return fromWireByok(resp.data ?? {});
5727
+ }
5728
+ /** 吊销密钥 (软状态 + 服务端抹密文, 不可恢复; 幂等 — 重复吊销返回当前视图)。 */
5729
+ async revoke(credentialRef, signal) {
5730
+ const resp = await this.client.doJSON(
5731
+ "POST",
5732
+ `/crabcode/byok-credentials/${encodeURIComponent(credentialRef)}/revoke`,
5733
+ {},
5734
+ signal
5735
+ );
5736
+ return fromWireByok(resp.data ?? {});
5737
+ }
5738
+ };
5739
+
5542
5740
  // src/compliance/scopes.ts
5543
5741
  var ScopeComplianceEvidenceRead = "compliance:evidence:read";
5544
5742
  var ScopeComplianceEvidenceWrite = "compliance:evidence:write";
@@ -7192,6 +7390,130 @@ function asCredentialRef(s) {
7192
7390
  return s;
7193
7391
  }
7194
7392
 
7195
- export { ALL_INTEGRATION_STATUS, ALL_PLATFORMS, ALL_REGIONS, AgentRunStreamError, AgentRunsClient, AnthropicAdapter, AudienceEnum, BillingModeEnum, BucketClassCommercial, BucketClassGeneric, BusinessError, Client, ComplianceClient, CompliancePollError, 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, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isValidTokenSet, 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 };
7393
+ // src/chatbridge/client.ts
7394
+ var chatBridgeByClient = /* @__PURE__ */ new WeakMap();
7395
+ Object.defineProperty(Client.prototype, "chatBridge", {
7396
+ configurable: true,
7397
+ enumerable: false,
7398
+ get() {
7399
+ let existing = chatBridgeByClient.get(this);
7400
+ if (!existing) {
7401
+ existing = new ChatBridgeClient(this);
7402
+ chatBridgeByClient.set(this, existing);
7403
+ }
7404
+ return existing;
7405
+ }
7406
+ });
7407
+ var ChatBridgeClient = class {
7408
+ constructor(client) {
7409
+ this.client = client;
7410
+ }
7411
+ client;
7412
+ // ---------------------------------------------------------------------------
7413
+ // Integration 管理面
7414
+ // ---------------------------------------------------------------------------
7415
+ /** 创建平台集成 (chat_bridge:write)。云端控制台与下游 (CrabCode) 调的是同一端点/同一份数据。 */
7416
+ async createIntegration(req, signal) {
7417
+ const resp = await this.client.doJSON(
7418
+ "POST",
7419
+ "/chat-bridge/integrations",
7420
+ {
7421
+ app_id: req.appId,
7422
+ platform: req.platform,
7423
+ region: req.region,
7424
+ workspace_id: req.workspaceId,
7425
+ bot_id: req.botId,
7426
+ config_json: req.configJson
7427
+ },
7428
+ signal
7429
+ );
7430
+ return resp.data;
7431
+ }
7432
+ /** 列出本租户集成 (chat_bridge:read; masked 视图)。可按 appId 过滤。 */
7433
+ async listIntegrations(appId, signal) {
7434
+ const qs = appId ? `?app_id=${encodeURIComponent(appId)}` : "";
7435
+ const resp = await this.client.doJSON(
7436
+ "GET",
7437
+ `/chat-bridge/integrations${qs}`,
7438
+ null,
7439
+ signal
7440
+ );
7441
+ return resp.data?.items ?? [];
7442
+ }
7443
+ /** 取单个集成 (chat_bridge:read)。不存在/跨租户一律 404。 */
7444
+ async getIntegration(id, signal) {
7445
+ const resp = await this.client.doJSON(
7446
+ "GET",
7447
+ `/chat-bridge/integrations/${encodeURIComponent(id)}`,
7448
+ null,
7449
+ signal
7450
+ );
7451
+ return resp.data;
7452
+ }
7453
+ /** 更新集成状态 (chat_bridge:write): pending | active | suspended | revoked。 */
7454
+ async updateIntegrationStatus(id, status, signal) {
7455
+ await this.client.doJSON(
7456
+ "PATCH",
7457
+ `/chat-bridge/integrations/${encodeURIComponent(id)}/status`,
7458
+ { status },
7459
+ signal
7460
+ );
7461
+ }
7462
+ // ---------------------------------------------------------------------------
7463
+ // Credential 管理面 (vault)
7464
+ // ---------------------------------------------------------------------------
7465
+ /** 存凭证 (chat_bridge:write) — 明文一次性提交, 返回 masked 记录 (ref+fingerprint)。 */
7466
+ async storeCredential(integrationId, req, signal) {
7467
+ const resp = await this.client.doJSON(
7468
+ "POST",
7469
+ `/chat-bridge/integrations/${encodeURIComponent(integrationId)}/credentials`,
7470
+ {
7471
+ secret_kind: req.secretKind,
7472
+ plaintext: req.plaintext,
7473
+ region: req.region,
7474
+ platform: req.platform
7475
+ },
7476
+ signal
7477
+ );
7478
+ return brandCredential(resp.data);
7479
+ }
7480
+ /** 列出集成的凭证 (chat_bridge:read; masked, 永不含明文/密文)。 */
7481
+ async listCredentials(integrationId, signal) {
7482
+ const resp = await this.client.doJSON(
7483
+ "GET",
7484
+ `/chat-bridge/integrations/${encodeURIComponent(integrationId)}/credentials`,
7485
+ null,
7486
+ signal
7487
+ );
7488
+ return (resp.data?.items ?? []).map(brandCredential);
7489
+ }
7490
+ /** 轮换凭证 (chat_bridge:rotate, 高风险) — ref 不变, fingerprint 更新。 */
7491
+ async rotateCredential(integrationId, secretKind, newPlaintext, signal) {
7492
+ const resp = await this.client.doJSON(
7493
+ "POST",
7494
+ `/chat-bridge/integrations/${encodeURIComponent(integrationId)}/credentials/rotate`,
7495
+ { secret_kind: secretKind, new_plaintext: newPlaintext },
7496
+ signal
7497
+ );
7498
+ return brandCredential(resp.data);
7499
+ }
7500
+ /** 吊销凭证 (chat_bridge:rotate) — 软吊销 + 服务端抹密文。 */
7501
+ async revokeCredential(credentialRef, signal) {
7502
+ await this.client.doJSON(
7503
+ "POST",
7504
+ `/chat-bridge/credentials/${encodeURIComponent(credentialRef)}/revoke`,
7505
+ {},
7506
+ signal
7507
+ );
7508
+ }
7509
+ };
7510
+ function brandCredential(c) {
7511
+ if (c && typeof c.credentialRef === "string") {
7512
+ return { ...c, credentialRef: asCredentialRef(c.credentialRef) };
7513
+ }
7514
+ return c;
7515
+ }
7516
+
7517
+ 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, commerceScopes, completeWebAuthorizationRequest, complianceErrorToRetryAdvice, complianceScopes, computeBackoff, createWebAuthorizationRequest, defaultRetryable, defaultSafeToRetry, discover, discoverWebOAuthMetadata, discoverWithProfile, effectivePolicy, exchangeCode, extractAnthropicBlockMeta, fileLockDefaults, findDesktopVisualUnderstandingModel, findFirstModelByInputModality, generateState, getAdapter, getAdapterForModel, isBillingConfirmable, isChannelInboundEvent, isComplianceBusinessError, isComplianceTerminalError, isIntegrationStatus, isInvalidGrantError, isPlatform, isRegion, isSSECommentLine, isSSLError, isTerminalRemoteEvent, isValidTokenSet, 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 };
7196
7518
  //# sourceMappingURL=index.mjs.map
7197
7519
  //# sourceMappingURL=index.mjs.map