claude-use 11.8.2 → 11.10.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.cjs CHANGED
@@ -222,9 +222,15 @@ function expandAllCategoryKey(pairs) {
222
222
  const expanded = Object.fromEntries(OVERRIDABLE_CATEGORIES.filter((category) => !all || category !== "runtime").map((category) => [category, all]));
223
223
  return { ...expanded, ...rest };
224
224
  }
225
+ function isHttpProvider(provider) {
226
+ return provider.kind === void 0 || provider.kind === "http";
227
+ }
225
228
  function isCodexProvider(provider) {
226
229
  return provider.kind === "codex";
227
230
  }
231
+ function isAntigravityProvider(provider) {
232
+ return provider.kind === "antigravity";
233
+ }
228
234
  function poolMemberIdentity(member) {
229
235
  return typeof member === "string" ? member : member.identity;
230
236
  }
@@ -236,7 +242,7 @@ function isTimeZone(name) {
236
242
  return false;
237
243
  }
238
244
  }
239
- var import_node_path2, import_zod, import_trilean, CATEGORY_NAMES, OVERRIDABLE_CATEGORIES, CategoryMapSchema, DURATION_RE, DurationSchema, WhenConditionObjectSchema, WhenSchema, EntryValueSchema, ENTRY_KEY_RE, EntriesSchema, LaunchSchema, CREDENTIAL_TARGETS, PROVIDER_CREDENTIAL_TARGETS, CREDENTIAL_TARGET_VARS, ArgvSchema, CommandSourceOptions, EnvCredentialSourceSchema, FileCredentialSourceSchema, CommandCredentialSourceSchema, OpCredentialSourceSchema, KeychainCredentialSourceSchema, LiteralCredentialSourceSchema, CredentialSourceSchema, RemoteCredentialSourceSchema, CREDENTIAL_CACHE_STORES, CredentialCacheSchema, CredentialSchema, ProviderCredentialSchema, RESERVED_PROVIDER_ENV_KEYS, ProviderEnvSchema, PROVIDER_KINDS, CODEX_EFFORTS, CODEX_LOGINS, CODEX_DEFAULT_TIER_MODELS, CodexProviderConfigSchema, ProviderRouteSchema, HttpProviderSchema, CodexProviderSchema, ProviderSchema, ConfigProfileSchema, POOL_SELECTOR_PREFIX, POOL_NAME_PATTERN, IDENTITY_NAME_PATTERN, PoolNameSchema, SELECTOR_RE, IdentitySelectorSchema, PoolMemberSchema, POOL_PREFERENCES, PoolPreferenceSchema, PoolSchema, WEEKDAYS, AnchorSchema, JOB_WINDOWS, JobTriggerSchema, JobTargetSchema, JobSchema, DirectoryRuleSchema, DirectoryRulesSchema, PortableConfigSchema, HEADROOM_MODES, HEADROOM_CCR_MODES, HEADROOM_ROLLOUT_CHANNELS, INTERCEPT_CHANNELS, READ_MATURATION_CHANNELS, HeadroomGlobalConfigObjectSchema, HeadroomGlobalConfigSchema, HEADROOM_DEFAULT_SOURCE, HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES, FrontDoorGlobalConfigSchema, UPDATE_MODES, UpdateGlobalConfigSchema, GlobalConfigSchema, IdentitySchema, CategoryClassificationSchema, CategoryClassificationOverlaySchema, SHIPPED_CATEGORY_DEFAULTS;
245
+ var import_node_path2, import_zod, import_trilean, CATEGORY_NAMES, OVERRIDABLE_CATEGORIES, CategoryMapSchema, DURATION_RE, DurationSchema, WhenConditionObjectSchema, WhenSchema, EntryValueSchema, ENTRY_KEY_RE, EntriesSchema, LaunchSchema, CREDENTIAL_TARGETS, PROVIDER_CREDENTIAL_TARGETS, CREDENTIAL_TARGET_VARS, ArgvSchema, CommandSourceOptions, EnvCredentialSourceSchema, FileCredentialSourceSchema, CommandCredentialSourceSchema, OpCredentialSourceSchema, KeychainCredentialSourceSchema, LiteralCredentialSourceSchema, CredentialSourceSchema, RemoteCredentialSourceSchema, CREDENTIAL_CACHE_STORES, CredentialCacheSchema, CredentialSchema, ProviderCredentialSchema, RESERVED_PROVIDER_ENV_KEYS, ProviderEnvSchema, PROVIDER_KINDS, ANTIGRAVITY_MODES, ANTIGRAVITY_EFFORTS, ANTIGRAVITY_DEFAULT_MODE, ANTIGRAVITY_DEFAULT_TIER_MODELS, AntigravityProviderConfigSchema, CODEX_EFFORTS, CODEX_LOGINS, CODEX_DEFAULT_TIER_MODELS, CodexProviderConfigSchema, ProviderRouteSchema, HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema, ProviderSchema, ConfigProfileSchema, POOL_SELECTOR_PREFIX, POOL_NAME_PATTERN, IDENTITY_NAME_PATTERN, PoolNameSchema, SELECTOR_RE, IdentitySelectorSchema, PoolMemberSchema, POOL_PREFERENCES, PoolPreferenceSchema, PoolSchema, WEEKDAYS, AnchorSchema, JOB_WINDOWS, JobTriggerSchema, JobTargetSchema, JobSchema, DirectoryRuleSchema, DirectoryRulesSchema, PortableConfigSchema, HEADROOM_MODES, HEADROOM_CCR_MODES, HEADROOM_ROLLOUT_CHANNELS, INTERCEPT_CHANNELS, READ_MATURATION_CHANNELS, HeadroomGlobalConfigObjectSchema, HeadroomGlobalConfigSchema, HEADROOM_DEFAULT_SOURCE, HEADROOM_DEFAULT_IDLE_SHUTDOWN_MINUTES, FrontDoorGlobalConfigSchema, UPDATE_MODES, UpdateGlobalConfigSchema, GlobalConfigSchema, IdentitySchema, CategoryClassificationSchema, CategoryClassificationOverlaySchema, SHIPPED_CATEGORY_DEFAULTS;
240
246
  var init_schema = __esm({
241
247
  "src/config/schema.ts"() {
242
248
  "use strict";
@@ -335,7 +341,47 @@ var init_schema = __esm({
335
341
  ProviderEnvSchema = import_zod.z.record(import_zod.z.string().min(1), import_zod.z.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
336
342
  message: `env may not set ${RESERVED_PROVIDER_ENV_KEYS.join(", ")}: the credential block's target sets one and agent-shim removes the others`
337
343
  });
338
- PROVIDER_KINDS = ["http", "codex"];
344
+ PROVIDER_KINDS = ["http", "codex", "antigravity"];
345
+ ANTIGRAVITY_MODES = ["cloud", "local"];
346
+ ANTIGRAVITY_EFFORTS = ["none", "low", "medium", "high", "xhigh", "max"];
347
+ ANTIGRAVITY_DEFAULT_MODE = "cloud";
348
+ ANTIGRAVITY_DEFAULT_TIER_MODELS = Object.freeze({
349
+ fable: "gemini-3.8-flash-high",
350
+ opus: "gemini-3.8-flash-high",
351
+ sonnet: "gemini-3.8-flash-medium",
352
+ haiku: "gemini-3.8-flash-low"
353
+ });
354
+ AntigravityProviderConfigSchema = import_zod.z.strictObject({
355
+ /** Operational mode: direct cloud endpoint or local ACP daemon. Defaults to `cloud`. */
356
+ mode: import_zod.z.enum(ANTIGRAVITY_MODES).optional(),
357
+ /** The model a request maps to when no tier matches its model name. */
358
+ defaultModel: import_zod.z.string().min(1).optional(),
359
+ /** Per-tier overrides of the shipped mapping, matched by substring of the requested model name in `ANTIGRAVITY_TIERS` order. */
360
+ models: import_zod.z.strictObject({
361
+ fable: import_zod.z.string().min(1).optional(),
362
+ opus: import_zod.z.string().min(1).optional(),
363
+ sonnet: import_zod.z.string().min(1).optional(),
364
+ haiku: import_zod.z.string().min(1).optional()
365
+ }).optional(),
366
+ /** The reasoning effort used when the request's own effort is not one the backend accepts. */
367
+ effort: import_zod.z.enum(ANTIGRAVITY_EFFORTS).optional(),
368
+ /** Cloud-specific settings (for `mode: "cloud"`). */
369
+ cloud: import_zod.z.strictObject({
370
+ /** Google Gemini API or custom gateway endpoint. Defaults to `https://generativelanguage.googleapis.com`. */
371
+ endpoint: import_zod.z.url().optional(),
372
+ /** Google Cloud Project ID (when using Vertex AI). */
373
+ projectId: import_zod.z.string().min(1).optional(),
374
+ /** Google Cloud location/region (when using Vertex AI). */
375
+ location: import_zod.z.string().min(1).optional()
376
+ }).optional(),
377
+ /** Local-specific settings (for `mode: "local"`). */
378
+ local: import_zod.z.strictObject({
379
+ /** Command and arguments to spawn the ACP server process. */
380
+ command: import_zod.z.array(import_zod.z.string().min(1)).min(1).optional(),
381
+ /** Path to an existing Unix domain socket to connect to instead of spawning a process. */
382
+ socketPath: import_zod.z.string().min(1).optional()
383
+ }).optional()
384
+ });
339
385
  CODEX_EFFORTS = ["none", "low", "medium", "high"];
340
386
  CODEX_LOGINS = ["codex-cli", "chatgpt-sign-in"];
341
387
  CODEX_DEFAULT_TIER_MODELS = Object.freeze({
@@ -385,7 +431,15 @@ var init_schema = __esm({
385
431
  env: ProviderEnvSchema.optional(),
386
432
  codex: CodexProviderConfigSchema.optional()
387
433
  });
388
- ProviderSchema = import_zod.z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema]);
434
+ AntigravityProviderSchema = import_zod.z.strictObject({
435
+ $schema: import_zod.z.string().optional(),
436
+ kind: import_zod.z.literal("antigravity"),
437
+ displayName: import_zod.z.string().min(1),
438
+ credential: ProviderCredentialSchema,
439
+ env: ProviderEnvSchema.optional(),
440
+ antigravity: AntigravityProviderConfigSchema.optional()
441
+ });
442
+ ProviderSchema = import_zod.z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema]);
389
443
  ConfigProfileSchema = import_zod.z.strictObject({
390
444
  $schema: import_zod.z.string().optional(),
391
445
  description: import_zod.z.string().optional(),
@@ -2787,7 +2841,7 @@ var init_package = __esm({
2787
2841
  "package.json"() {
2788
2842
  package_default = {
2789
2843
  name: "claude-use",
2790
- version: "11.8.2",
2844
+ version: "11.10.0",
2791
2845
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
2792
2846
  license: "MIT",
2793
2847
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -3215,7 +3269,7 @@ function daemonIdentity(commandLine, socketPath) {
3215
3269
  function earlierReleaseAllowlistHash(providers, doorOrigin) {
3216
3270
  const entries = /* @__PURE__ */ new Set([EARLIER_RELEASE_ANTHROPIC_UPSTREAM]);
3217
3271
  for (const provider of providers) {
3218
- if (!isCodexProvider(provider)) {
3272
+ if (isHttpProvider(provider)) {
3219
3273
  entries.add(provider.baseUrl);
3220
3274
  }
3221
3275
  }
@@ -6143,11 +6197,33 @@ function formatCredentialSummary(summary) {
6143
6197
  function describeCredential(credential) {
6144
6198
  return formatCredentialSummary(summariseCredential(credential));
6145
6199
  }
6200
+ function isRecord5(value) {
6201
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6202
+ }
6203
+ function unpackKeyringToken(raw) {
6204
+ const trimmed = raw.trim();
6205
+ if (!trimmed.startsWith(GO_KEYRING_BASE64_PREFIX)) {
6206
+ return trimmed;
6207
+ }
6208
+ try {
6209
+ const base64Str = trimmed.slice(GO_KEYRING_BASE64_PREFIX.length);
6210
+ const decoded = Buffer.from(base64Str, "base64").toString("utf8");
6211
+ const parsed = JSON.parse(decoded);
6212
+ if (isRecord5(parsed) && isRecord5(parsed.token)) {
6213
+ const accessToken = parsed.token.access_token;
6214
+ if (typeof accessToken === "string" && accessToken.trim() !== "") {
6215
+ return accessToken.trim();
6216
+ }
6217
+ }
6218
+ } catch {
6219
+ }
6220
+ return trimmed;
6221
+ }
6146
6222
  function trySource(source, params) {
6147
6223
  const none = (reason, warn = false) => ({ ok: false, reason, warn });
6148
6224
  if ("env" in source) {
6149
6225
  const value = params.env[source.env];
6150
- return value === void 0 || value === "" ? none("is unset or empty") : { ok: true, token: value };
6226
+ return value === void 0 || value === "" ? none("is unset or empty") : { ok: true, token: unpackKeyringToken(value) };
6151
6227
  }
6152
6228
  if ("literal" in source) {
6153
6229
  return { ok: true, token: source.literal };
@@ -6163,7 +6239,7 @@ function trySource(source, params) {
6163
6239
  true
6164
6240
  );
6165
6241
  }
6166
- const token2 = read.content.trim();
6242
+ const token2 = unpackKeyringToken(read.content.trim());
6167
6243
  return token2 === "" ? none("is empty") : { ok: true, token: token2 };
6168
6244
  }
6169
6245
  const argv = commandArgv(source);
@@ -6181,7 +6257,7 @@ function trySource(source, params) {
6181
6257
  const outcome = result.status === null ? "could not be run or was killed by a signal" : `exited with status ${String(result.status)}`;
6182
6258
  return none(`${outcome}${stderr === "" ? "" : `: ${stderr}`}`);
6183
6259
  }
6184
- const token = result.stdout.trim();
6260
+ const token = unpackKeyringToken(result.stdout.trim());
6185
6261
  return token === "" ? none("printed no token") : { ok: true, token };
6186
6262
  }
6187
6263
  function warmCommandFor(subject) {
@@ -6225,7 +6301,7 @@ function credentialVariables(target, token) {
6225
6301
  CLAUDE_CODE_OAUTH_TOKEN: target === "oauthToken" ? token : void 0
6226
6302
  };
6227
6303
  }
6228
- var CREDENTIAL_UNAVAILABLE_EXIT, CREDENTIAL_COMMAND_TIMEOUT_MS, CREDENTIAL_INTERACTIVE_TIMEOUT_MS, GROUP_OTHER_PERMISSION_BITS, PERMISSION_BITS2, OCTAL_RADIX2;
6304
+ var CREDENTIAL_UNAVAILABLE_EXIT, CREDENTIAL_COMMAND_TIMEOUT_MS, CREDENTIAL_INTERACTIVE_TIMEOUT_MS, GROUP_OTHER_PERMISSION_BITS, PERMISSION_BITS2, OCTAL_RADIX2, GO_KEYRING_BASE64_PREFIX;
6229
6305
  var init_credential = __esm({
6230
6306
  "src/credential.ts"() {
6231
6307
  "use strict";
@@ -6236,6 +6312,7 @@ var init_credential = __esm({
6236
6312
  GROUP_OTHER_PERMISSION_BITS = 63;
6237
6313
  PERMISSION_BITS2 = 511;
6238
6314
  OCTAL_RADIX2 = 8;
6315
+ GO_KEYRING_BASE64_PREFIX = "go-keyring-base64:";
6239
6316
  }
6240
6317
  });
6241
6318
 
@@ -6246,14 +6323,14 @@ function providerJsonPath(paths, name) {
6246
6323
  function providerExists(paths, name) {
6247
6324
  return import_node_fs6.default.existsSync(providerJsonPath(paths, name));
6248
6325
  }
6249
- function isRecord5(value) {
6326
+ function isRecord6(value) {
6250
6327
  return typeof value === "object" && value !== null && !Array.isArray(value);
6251
6328
  }
6252
6329
  function legacyProviderConversion(raw) {
6253
- if (!isRecord5(raw) || "credential" in raw) {
6330
+ if (!isRecord6(raw) || "credential" in raw) {
6254
6331
  return void 0;
6255
6332
  }
6256
- const env = isRecord5(raw.env) ? raw.env : void 0;
6333
+ const env = isRecord6(raw.env) ? raw.env : void 0;
6257
6334
  const legacyEnvKeys = env === void 0 ? [] : Object.keys(env).filter((key) => LEGACY_ENV_CREDENTIAL_KEYS.includes(key));
6258
6335
  const fields = [...LEGACY_PROVIDER_FIELDS.filter((field) => field in raw), ...legacyEnvKeys.map((key) => `env.${key}`)];
6259
6336
  if (fields.length === 0) {
@@ -6338,11 +6415,20 @@ function listProviderNames(readdir, providersDir) {
6338
6415
  return entries.filter((entry) => entry.endsWith(".json")).map((entry) => entry.slice(0, -".json".length)).sort();
6339
6416
  }
6340
6417
  function describeProviderEndpoint(provider) {
6341
- return isCodexProvider(provider) ? "codex translation daemon" : provider.baseUrl;
6418
+ if (isCodexProvider(provider)) {
6419
+ return "codex translation daemon";
6420
+ }
6421
+ if (isAntigravityProvider(provider)) {
6422
+ return (provider.antigravity?.mode ?? ANTIGRAVITY_DEFAULT_MODE) === "local" ? "antigravity local (ACP daemon)" : "antigravity cloud (Gemini API)";
6423
+ }
6424
+ return provider.baseUrl;
6342
6425
  }
6343
6426
  function isEmptyCodexConfig(config) {
6344
6427
  return config === void 0 || config.defaultModel === void 0 && config.effort === void 0 && config.login === void 0 && (config.models === void 0 || Object.keys(config.models).length === 0);
6345
6428
  }
6429
+ function isEmptyAntigravityConfig(config) {
6430
+ return config === void 0 || config.mode === void 0 && config.defaultModel === void 0 && config.effort === void 0 && config.cloud === void 0 && config.local === void 0 && (config.models === void 0 || Object.keys(config.models).length === 0);
6431
+ }
6346
6432
  function addProvider(paths, name, input) {
6347
6433
  if (providerExists(paths, name)) {
6348
6434
  throw new ProviderAlreadyExistsError(name);
@@ -6354,19 +6440,25 @@ function addProvider(paths, name, input) {
6354
6440
  if (kind === "codex" && input.baseUrl !== void 0) {
6355
6441
  throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6356
6442
  }
6443
+ if (kind === "antigravity" && input.baseUrl !== void 0) {
6444
+ throw new ProviderKindMismatchError("An antigravity provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6445
+ }
6357
6446
  if (kind === "http" && input.baseUrl === void 0) {
6358
6447
  throw new ProviderKindMismatchError("An http provider needs --base-url.");
6359
6448
  }
6360
- if (kind === "http" && !isEmptyCodexConfig(input.codex)) {
6449
+ if (kind !== "codex" && !isEmptyCodexConfig(input.codex)) {
6361
6450
  throw new ProviderKindMismatchError("Codex settings apply only to a codex provider (--kind codex).");
6362
6451
  }
6452
+ if (kind !== "antigravity" && !isEmptyAntigravityConfig(input.antigravity)) {
6453
+ throw new ProviderKindMismatchError("Antigravity settings apply only to an antigravity provider (--kind antigravity).");
6454
+ }
6363
6455
  const shared = {
6364
6456
  displayName: input.displayName,
6365
6457
  credential: { sources: input.sources, ...input.target === void 0 ? {} : { target: input.target } },
6366
6458
  ...input.env === void 0 || Object.keys(input.env).length === 0 ? {} : { env: input.env }
6367
6459
  };
6368
6460
  const parsed = ProviderSchema.safeParse(
6369
- kind === "codex" ? { kind, ...shared, ...isEmptyCodexConfig(input.codex) ? {} : { codex: input.codex } } : { ...shared, baseUrl: input.baseUrl }
6461
+ kind === "codex" ? { kind, ...shared, ...isEmptyCodexConfig(input.codex) ? {} : { codex: input.codex } } : kind === "antigravity" ? { kind, ...shared, ...isEmptyAntigravityConfig(input.antigravity) ? {} : { antigravity: input.antigravity } } : { ...shared, baseUrl: input.baseUrl }
6370
6462
  );
6371
6463
  if (!parsed.success) {
6372
6464
  throw new ConfigValidationError(providerJsonPath(paths, name), parsed.error.issues);
@@ -6386,8 +6478,14 @@ function updateProvider(paths, name, input) {
6386
6478
  if (isCodexProvider(existing) && input.baseUrl !== void 0) {
6387
6479
  throw new ProviderKindMismatchError(`Provider "${name}" is a codex provider, which has no base URL.`);
6388
6480
  }
6481
+ if (isAntigravityProvider(existing) && input.baseUrl !== void 0) {
6482
+ throw new ProviderKindMismatchError(`Provider "${name}" is an antigravity provider, which has no base URL.`);
6483
+ }
6389
6484
  if (!isCodexProvider(existing) && !isEmptyCodexConfig(input.codex)) {
6390
- throw new ProviderKindMismatchError(`Provider "${name}" is an http provider; codex settings apply only to a codex provider.`);
6485
+ throw new ProviderKindMismatchError(`Provider "${name}" is not a codex provider; codex settings apply only to a codex provider.`);
6486
+ }
6487
+ if (!isAntigravityProvider(existing) && !isEmptyAntigravityConfig(input.antigravity)) {
6488
+ throw new ProviderKindMismatchError(`Provider "${name}" is not an antigravity provider; antigravity settings apply only to an antigravity provider.`);
6391
6489
  }
6392
6490
  const shared = {
6393
6491
  ...input.displayName === void 0 ? {} : { displayName: input.displayName },
@@ -6406,6 +6504,13 @@ function updateProvider(paths, name, input) {
6406
6504
  ...existing.codex?.models === void 0 && input.codex?.models === void 0 ? {} : { models: { ...existing.codex?.models, ...input.codex?.models } }
6407
6505
  };
6408
6506
  candidate = { ...existing, ...shared, codex: isEmptyCodexConfig(codex) ? void 0 : codex };
6507
+ } else if (isAntigravityProvider(existing)) {
6508
+ const antigravity = {
6509
+ ...existing.antigravity,
6510
+ ...input.antigravity,
6511
+ ...existing.antigravity?.models === void 0 && input.antigravity?.models === void 0 ? {} : { models: { ...existing.antigravity?.models, ...input.antigravity?.models } }
6512
+ };
6513
+ candidate = { ...existing, ...shared, antigravity: isEmptyAntigravityConfig(antigravity) ? void 0 : antigravity };
6409
6514
  } else {
6410
6515
  candidate = { ...existing, ...shared, ...input.baseUrl === void 0 ? {} : { baseUrl: input.baseUrl } };
6411
6516
  }
@@ -15253,7 +15358,7 @@ function providerValue(name, provider) {
15253
15358
  name,
15254
15359
  kind: provider.kind ?? "http",
15255
15360
  displayName: provider.displayName,
15256
- ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : { baseUrl: provider.baseUrl },
15361
+ ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : isAntigravityProvider(provider) ? provider.antigravity === void 0 ? {} : { antigravity: provider.antigravity } : { baseUrl: provider.baseUrl },
15257
15362
  credential: summariseCredential(provider.credential),
15258
15363
  ...provider.env === void 0 ? {} : { env: provider.env }
15259
15364
  };
@@ -15432,7 +15537,7 @@ function createConfigApiRouter(deps) {
15432
15537
  throw new ProviderNotFoundError(input.name);
15433
15538
  }
15434
15539
  const credential = input.credential;
15435
- if (input.baseUrl !== void 0 && !isCodexProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15540
+ if (input.baseUrl !== void 0 && isHttpProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15436
15541
  throw new import_client2.ORPCError("BAD_REQUEST", { message: `Changing the base URL of provider "${input.name}" requires a credential block in the same call: the stored credential is not sent to a different endpoint.` });
15437
15542
  }
15438
15543
  const cache = credential?.cache === void 0 ? void 0 : mergeCredentialCache(credential.cache === false ? { enabled: false } : { ...credential.cache, enabled: true }, existing.credential.cache);
@@ -16172,15 +16277,15 @@ function createQuotaExpiringPublisher(hub, deps) {
16172
16277
 
16173
16278
  // src/frontdoor/rcLiveUsage.ts
16174
16279
  var RC_RATE_LIMIT_EVENT_TYPE = "rate_limit_event";
16175
- function isRecord6(value) {
16280
+ function isRecord7(value) {
16176
16281
  return typeof value === "object" && value !== null && !Array.isArray(value);
16177
16282
  }
16178
16283
  function rcRateLimitInfoOf(event) {
16179
16284
  const payload = event.envelope.payload;
16180
- if (!isRecord6(payload) || payload.type !== RC_RATE_LIMIT_EVENT_TYPE) {
16285
+ if (!isRecord7(payload) || payload.type !== RC_RATE_LIMIT_EVENT_TYPE) {
16181
16286
  return void 0;
16182
16287
  }
16183
- if (!isRecord6(payload.rate_limit_info)) {
16288
+ if (!isRecord7(payload.rate_limit_info)) {
16184
16289
  return void 0;
16185
16290
  }
16186
16291
  const parsed = RcRateLimitInfoSchema.safeParse(payload.rate_limit_info);
@@ -16268,7 +16373,7 @@ function createSseParser() {
16268
16373
  }
16269
16374
  };
16270
16375
  }
16271
- function isRecord7(value) {
16376
+ function isRecord8(value) {
16272
16377
  return typeof value === "object" && value !== null && !Array.isArray(value);
16273
16378
  }
16274
16379
  function sequenceNumOf(value) {
@@ -16290,7 +16395,7 @@ function parseRcStreamEnvelope(parsed) {
16290
16395
  } catch {
16291
16396
  return void 0;
16292
16397
  }
16293
- if (!isRecord7(data)) {
16398
+ if (!isRecord8(data)) {
16294
16399
  return void 0;
16295
16400
  }
16296
16401
  const eventType = data.event_type;
@@ -16531,7 +16636,7 @@ init_capability();
16531
16636
  // src/frontdoor/rcSelfHostEndpoints.ts
16532
16637
  var RC_SOURCE_WORKER = "worker";
16533
16638
  var RC_SOURCE_CLIENT = "client";
16534
- function isRecord8(value) {
16639
+ function isRecord9(value) {
16535
16640
  return typeof value === "object" && value !== null && !Array.isArray(value);
16536
16641
  }
16537
16642
  function parseJsonObject2(body) {
@@ -16541,7 +16646,7 @@ function parseJsonObject2(body) {
16541
16646
  } catch {
16542
16647
  return void 0;
16543
16648
  }
16544
- return isRecord8(parsed) ? parsed : void 0;
16649
+ return isRecord9(parsed) ? parsed : void 0;
16545
16650
  }
16546
16651
  function nonEmptyString2(record, field) {
16547
16652
  const value = record === void 0 ? void 0 : record[field];
@@ -16615,7 +16720,7 @@ async function serveRcClientChannels(ctx, tail, method, maxBatchEvents) {
16615
16720
  }
16616
16721
  const results = [];
16617
16722
  for (const event of events) {
16618
- if (!isRecord8(event) || !isRecord8(event.payload)) {
16723
+ if (!isRecord9(event) || !isRecord9(event.payload)) {
16619
16724
  await ctx.answerJson(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "every event in a teleport write is an object carrying one payload object" } });
16620
16725
  return true;
16621
16726
  }
@@ -16715,7 +16820,7 @@ async function serveRcCompatSessions(ctx, pathname, compatPath) {
16715
16820
  // src/frontdoor/rcSelfHostConversations.ts
16716
16821
  var RC_CONVERSATIONS_PATH_PREFIX = "/v1/code/conversations";
16717
16822
  var RC_CONVERSATION_ID_PREFIX = "conv_";
16718
- function isRecord9(value) {
16823
+ function isRecord10(value) {
16719
16824
  return typeof value === "object" && value !== null && !Array.isArray(value);
16720
16825
  }
16721
16826
  function parseJsonObject3(body) {
@@ -16725,7 +16830,7 @@ function parseJsonObject3(body) {
16725
16830
  } catch {
16726
16831
  return void 0;
16727
16832
  }
16728
- return isRecord9(parsed) ? parsed : void 0;
16833
+ return isRecord10(parsed) ? parsed : void 0;
16729
16834
  }
16730
16835
  function nonEmptyString3(record, field) {
16731
16836
  const value = record === void 0 ? void 0 : record[field];
@@ -16779,7 +16884,7 @@ async function serveRcConversations(ctx, pathname, method) {
16779
16884
  }
16780
16885
  const results = [];
16781
16886
  for (const event of events) {
16782
- if (!isRecord9(event) || !isRecord9(event.payload)) {
16887
+ if (!isRecord10(event) || !isRecord10(event.payload)) {
16783
16888
  await ctx.answerJson(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "every event in a write is an object carrying one payload object" } });
16784
16889
  return;
16785
16890
  }
@@ -16811,7 +16916,7 @@ var RC_SELF_HOST_SCOPE_LIST = ["user:profile", "user:inference", "user:sessions:
16811
16916
  var RC_SELF_HOST_OAUTH_TOKEN_TTL_SECONDS = 3600;
16812
16917
  var MS_PER_SECOND5 = 1e3;
16813
16918
  var HTTP_SERVICE_UNAVAILABLE = 503;
16814
- function isRecord10(value) {
16919
+ function isRecord11(value) {
16815
16920
  return typeof value === "object" && value !== null && !Array.isArray(value);
16816
16921
  }
16817
16922
  function parseJsonObject4(body) {
@@ -16821,7 +16926,7 @@ function parseJsonObject4(body) {
16821
16926
  } catch {
16822
16927
  return void 0;
16823
16928
  }
16824
- return isRecord10(parsed) ? parsed : void 0;
16929
+ return isRecord11(parsed) ? parsed : void 0;
16825
16930
  }
16826
16931
  function growthBookFeatures() {
16827
16932
  return {
@@ -17175,7 +17280,7 @@ var RC_SELF_HOST_WORKER_EPOCH = 1;
17175
17280
  var RC_STREAM_EVENT_NAME2 = "client_event";
17176
17281
  var CONFLICT_REASON_HEADER2 = "x-ccr-conflict-reason";
17177
17282
  var CONFLICT_REASON_EPOCH_STALE = "epoch_stale";
17178
- function isRecord11(value) {
17283
+ function isRecord12(value) {
17179
17284
  return typeof value === "object" && value !== null && !Array.isArray(value);
17180
17285
  }
17181
17286
  function isWebSearchRefusal(value) {
@@ -17259,7 +17364,7 @@ function parseJsonObject5(body) {
17259
17364
  } catch {
17260
17365
  return void 0;
17261
17366
  }
17262
- return isRecord11(parsed) ? parsed : void 0;
17367
+ return isRecord12(parsed) ? parsed : void 0;
17263
17368
  }
17264
17369
  function mintWorkerJwt(randomToken, issuedAt) {
17265
17370
  const encode = (value) => Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
@@ -17519,7 +17624,7 @@ data: ${JSON.stringify(envelope)}
17519
17624
  if (status !== void 0) {
17520
17625
  session.workerStatus = status;
17521
17626
  }
17522
- if (isRecord11(body?.external_metadata)) {
17627
+ if (isRecord12(body?.external_metadata)) {
17523
17628
  session.externalMetadata = body.external_metadata;
17524
17629
  }
17525
17630
  await answerJson2(response, HTTP_STATUS.ok, {});
@@ -17549,7 +17654,7 @@ data: ${JSON.stringify(envelope)}
17549
17654
  }
17550
17655
  const results = [];
17551
17656
  for (const event of events) {
17552
- if (!isRecord11(event) || !isRecord11(event.payload)) {
17657
+ if (!isRecord12(event) || !isRecord12(event.payload)) {
17553
17658
  await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "every event in a batch is an object carrying one payload object" } });
17554
17659
  return;
17555
17660
  }
@@ -17582,7 +17687,7 @@ data: ${JSON.stringify(envelope)}
17582
17687
  return;
17583
17688
  }
17584
17689
  for (const event of events) {
17585
- if (isRecord11(event)) {
17690
+ if (isRecord12(event)) {
17586
17691
  session.internalEvents.push({ eventId: deps.newUuid(), body: event });
17587
17692
  }
17588
17693
  }
@@ -17678,7 +17783,7 @@ data: ${JSON.stringify(envelope)}
17678
17783
  }
17679
17784
  const results = [];
17680
17785
  for (const event of events) {
17681
- if (!isRecord11(event) || !isRecord11(event.payload)) {
17786
+ if (!isRecord12(event) || !isRecord12(event.payload)) {
17682
17787
  await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "every event in a write is an object carrying one payload object" } });
17683
17788
  return;
17684
17789
  }
@@ -17815,7 +17920,7 @@ var RC_SELF_HOST_RECORD_DIR = "rc-selfhost";
17815
17920
  var RC_SELF_HOST_RECORD_FILE = "credential.json";
17816
17921
  var SELF_HOST_EMAIL = "selfhost@agent-shim.invalid";
17817
17922
  var SELF_HOST_SUBSCRIPTION_TYPE = "max";
17818
- function isRecord12(value) {
17923
+ function isRecord13(value) {
17819
17924
  return typeof value === "object" && value !== null && !Array.isArray(value);
17820
17925
  }
17821
17926
  function readJsonObject(fs13, file) {
@@ -17829,7 +17934,7 @@ function readJsonObject(fs13, file) {
17829
17934
  } catch {
17830
17935
  return void 0;
17831
17936
  }
17832
- return isRecord12(parsed) ? parsed : void 0;
17937
+ return isRecord13(parsed) ? parsed : void 0;
17833
17938
  }
17834
17939
  function readRcSelfHostRecord(fs13, frontdoorDir) {
17835
17940
  const parsed = readJsonObject(fs13, import_node_path33.default.join(frontdoorDir, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE));
@@ -17853,7 +17958,7 @@ function mintRcSelfHostCredential(deps) {
17853
17958
  const recordFile = import_node_path33.default.join(recordDir, RC_SELF_HOST_RECORD_FILE);
17854
17959
  const previousRecord = readRcSelfHostRecord(deps.fs, deps.frontdoorDir);
17855
17960
  const existingCredentials = readJsonObject(deps.fs, credentialsFile);
17856
- const existingOauth = isRecord12(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
17961
+ const existingOauth = isRecord13(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
17857
17962
  const existingToken = typeof existingOauth?.accessToken === "string" && existingOauth.accessToken !== "" ? existingOauth.accessToken : void 0;
17858
17963
  const existingIsOwn = existingToken !== void 0 && previousRecord?.accessToken === existingToken;
17859
17964
  if (existingToken !== void 0 && !existingIsOwn && !deps.force) {
@@ -17870,7 +17975,7 @@ function mintRcSelfHostCredential(deps) {
17870
17975
  deps.fs.writeFilePrivate(credentialsFile, `${JSON.stringify({ ...existingCredentials, claudeAiOauth: { accessToken, refreshToken, expiresAt: null, scopes: [...RC_SELF_HOST_SCOPE_LIST], subscriptionType: SELF_HOST_SUBSCRIPTION_TYPE, rateLimitTier: null } }, null, 2)}
17871
17976
  `);
17872
17977
  const claudeJson = readJsonObject(deps.fs, claudeJsonFile) ?? {};
17873
- const existingBlock = (value) => isRecord12(value) ? value : {};
17978
+ const existingBlock = (value) => isRecord13(value) ? value : {};
17874
17979
  deps.fs.writeFilePrivate(claudeJsonFile, `${JSON.stringify({
17875
17980
  ...claudeJson,
17876
17981
  oauthAccount: {