agent-shim 11.8.1 → 11.9.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-2.5-pro",
350
+ opus: "gemini-2.5-pro",
351
+ sonnet: "gemini-2.5-flash",
352
+ haiku: "gemini-2.5-flash"
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: "agent-shim",
2790
- version: "11.8.1",
2844
+ version: "11.9.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
  }
@@ -6338,11 +6392,20 @@ function listProviderNames(readdir, providersDir) {
6338
6392
  return entries.filter((entry) => entry.endsWith(".json")).map((entry) => entry.slice(0, -".json".length)).sort();
6339
6393
  }
6340
6394
  function describeProviderEndpoint(provider) {
6341
- return isCodexProvider(provider) ? "codex translation daemon" : provider.baseUrl;
6395
+ if (isCodexProvider(provider)) {
6396
+ return "codex translation daemon";
6397
+ }
6398
+ if (isAntigravityProvider(provider)) {
6399
+ return (provider.antigravity?.mode ?? ANTIGRAVITY_DEFAULT_MODE) === "local" ? "antigravity local (ACP daemon)" : "antigravity cloud (Gemini API)";
6400
+ }
6401
+ return provider.baseUrl;
6342
6402
  }
6343
6403
  function isEmptyCodexConfig(config) {
6344
6404
  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
6405
  }
6406
+ function isEmptyAntigravityConfig(config) {
6407
+ 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);
6408
+ }
6346
6409
  function addProvider(paths, name, input) {
6347
6410
  if (providerExists(paths, name)) {
6348
6411
  throw new ProviderAlreadyExistsError(name);
@@ -6354,19 +6417,25 @@ function addProvider(paths, name, input) {
6354
6417
  if (kind === "codex" && input.baseUrl !== void 0) {
6355
6418
  throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6356
6419
  }
6420
+ if (kind === "antigravity" && input.baseUrl !== void 0) {
6421
+ throw new ProviderKindMismatchError("An antigravity provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6422
+ }
6357
6423
  if (kind === "http" && input.baseUrl === void 0) {
6358
6424
  throw new ProviderKindMismatchError("An http provider needs --base-url.");
6359
6425
  }
6360
- if (kind === "http" && !isEmptyCodexConfig(input.codex)) {
6426
+ if (kind !== "codex" && !isEmptyCodexConfig(input.codex)) {
6361
6427
  throw new ProviderKindMismatchError("Codex settings apply only to a codex provider (--kind codex).");
6362
6428
  }
6429
+ if (kind !== "antigravity" && !isEmptyAntigravityConfig(input.antigravity)) {
6430
+ throw new ProviderKindMismatchError("Antigravity settings apply only to an antigravity provider (--kind antigravity).");
6431
+ }
6363
6432
  const shared = {
6364
6433
  displayName: input.displayName,
6365
6434
  credential: { sources: input.sources, ...input.target === void 0 ? {} : { target: input.target } },
6366
6435
  ...input.env === void 0 || Object.keys(input.env).length === 0 ? {} : { env: input.env }
6367
6436
  };
6368
6437
  const parsed = ProviderSchema.safeParse(
6369
- kind === "codex" ? { kind, ...shared, ...isEmptyCodexConfig(input.codex) ? {} : { codex: input.codex } } : { ...shared, baseUrl: input.baseUrl }
6438
+ 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
6439
  );
6371
6440
  if (!parsed.success) {
6372
6441
  throw new ConfigValidationError(providerJsonPath(paths, name), parsed.error.issues);
@@ -6386,8 +6455,14 @@ function updateProvider(paths, name, input) {
6386
6455
  if (isCodexProvider(existing) && input.baseUrl !== void 0) {
6387
6456
  throw new ProviderKindMismatchError(`Provider "${name}" is a codex provider, which has no base URL.`);
6388
6457
  }
6458
+ if (isAntigravityProvider(existing) && input.baseUrl !== void 0) {
6459
+ throw new ProviderKindMismatchError(`Provider "${name}" is an antigravity provider, which has no base URL.`);
6460
+ }
6389
6461
  if (!isCodexProvider(existing) && !isEmptyCodexConfig(input.codex)) {
6390
- throw new ProviderKindMismatchError(`Provider "${name}" is an http provider; codex settings apply only to a codex provider.`);
6462
+ throw new ProviderKindMismatchError(`Provider "${name}" is not a codex provider; codex settings apply only to a codex provider.`);
6463
+ }
6464
+ if (!isAntigravityProvider(existing) && !isEmptyAntigravityConfig(input.antigravity)) {
6465
+ throw new ProviderKindMismatchError(`Provider "${name}" is not an antigravity provider; antigravity settings apply only to an antigravity provider.`);
6391
6466
  }
6392
6467
  const shared = {
6393
6468
  ...input.displayName === void 0 ? {} : { displayName: input.displayName },
@@ -6406,6 +6481,13 @@ function updateProvider(paths, name, input) {
6406
6481
  ...existing.codex?.models === void 0 && input.codex?.models === void 0 ? {} : { models: { ...existing.codex?.models, ...input.codex?.models } }
6407
6482
  };
6408
6483
  candidate = { ...existing, ...shared, codex: isEmptyCodexConfig(codex) ? void 0 : codex };
6484
+ } else if (isAntigravityProvider(existing)) {
6485
+ const antigravity = {
6486
+ ...existing.antigravity,
6487
+ ...input.antigravity,
6488
+ ...existing.antigravity?.models === void 0 && input.antigravity?.models === void 0 ? {} : { models: { ...existing.antigravity?.models, ...input.antigravity?.models } }
6489
+ };
6490
+ candidate = { ...existing, ...shared, antigravity: isEmptyAntigravityConfig(antigravity) ? void 0 : antigravity };
6409
6491
  } else {
6410
6492
  candidate = { ...existing, ...shared, ...input.baseUrl === void 0 ? {} : { baseUrl: input.baseUrl } };
6411
6493
  }
@@ -15253,7 +15335,7 @@ function providerValue(name, provider) {
15253
15335
  name,
15254
15336
  kind: provider.kind ?? "http",
15255
15337
  displayName: provider.displayName,
15256
- ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : { baseUrl: provider.baseUrl },
15338
+ ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : isAntigravityProvider(provider) ? provider.antigravity === void 0 ? {} : { antigravity: provider.antigravity } : { baseUrl: provider.baseUrl },
15257
15339
  credential: summariseCredential(provider.credential),
15258
15340
  ...provider.env === void 0 ? {} : { env: provider.env }
15259
15341
  };
@@ -15432,7 +15514,7 @@ function createConfigApiRouter(deps) {
15432
15514
  throw new ProviderNotFoundError(input.name);
15433
15515
  }
15434
15516
  const credential = input.credential;
15435
- if (input.baseUrl !== void 0 && !isCodexProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15517
+ if (input.baseUrl !== void 0 && isHttpProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15436
15518
  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
15519
  }
15438
15520
  const cache = credential?.cache === void 0 ? void 0 : mergeCredentialCache(credential.cache === false ? { enabled: false } : { ...credential.cache, enabled: true }, existing.credential.cache);
package/dist/index.mjs CHANGED
@@ -203,9 +203,15 @@ function expandAllCategoryKey(pairs) {
203
203
  const expanded = Object.fromEntries(OVERRIDABLE_CATEGORIES.filter((category) => !all || category !== "runtime").map((category) => [category, all]));
204
204
  return { ...expanded, ...rest };
205
205
  }
206
+ function isHttpProvider(provider) {
207
+ return provider.kind === void 0 || provider.kind === "http";
208
+ }
206
209
  function isCodexProvider(provider) {
207
210
  return provider.kind === "codex";
208
211
  }
212
+ function isAntigravityProvider(provider) {
213
+ return provider.kind === "antigravity";
214
+ }
209
215
  function poolMemberIdentity(member) {
210
216
  return typeof member === "string" ? member : member.identity;
211
217
  }
@@ -217,7 +223,7 @@ function isTimeZone(name) {
217
223
  return false;
218
224
  }
219
225
  }
220
- var 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;
226
+ var 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;
221
227
  var init_schema = __esm({
222
228
  "src/config/schema.ts"() {
223
229
  "use strict";
@@ -313,7 +319,47 @@ var init_schema = __esm({
313
319
  ProviderEnvSchema = z.record(z.string().min(1), z.string()).refine((env) => !Object.keys(env).some((key) => RESERVED_PROVIDER_ENV_KEYS.includes(key)), {
314
320
  message: `env may not set ${RESERVED_PROVIDER_ENV_KEYS.join(", ")}: the credential block's target sets one and agent-shim removes the others`
315
321
  });
316
- PROVIDER_KINDS = ["http", "codex"];
322
+ PROVIDER_KINDS = ["http", "codex", "antigravity"];
323
+ ANTIGRAVITY_MODES = ["cloud", "local"];
324
+ ANTIGRAVITY_EFFORTS = ["none", "low", "medium", "high", "xhigh", "max"];
325
+ ANTIGRAVITY_DEFAULT_MODE = "cloud";
326
+ ANTIGRAVITY_DEFAULT_TIER_MODELS = Object.freeze({
327
+ fable: "gemini-2.5-pro",
328
+ opus: "gemini-2.5-pro",
329
+ sonnet: "gemini-2.5-flash",
330
+ haiku: "gemini-2.5-flash"
331
+ });
332
+ AntigravityProviderConfigSchema = z.strictObject({
333
+ /** Operational mode: direct cloud endpoint or local ACP daemon. Defaults to `cloud`. */
334
+ mode: z.enum(ANTIGRAVITY_MODES).optional(),
335
+ /** The model a request maps to when no tier matches its model name. */
336
+ defaultModel: z.string().min(1).optional(),
337
+ /** Per-tier overrides of the shipped mapping, matched by substring of the requested model name in `ANTIGRAVITY_TIERS` order. */
338
+ models: z.strictObject({
339
+ fable: z.string().min(1).optional(),
340
+ opus: z.string().min(1).optional(),
341
+ sonnet: z.string().min(1).optional(),
342
+ haiku: z.string().min(1).optional()
343
+ }).optional(),
344
+ /** The reasoning effort used when the request's own effort is not one the backend accepts. */
345
+ effort: z.enum(ANTIGRAVITY_EFFORTS).optional(),
346
+ /** Cloud-specific settings (for `mode: "cloud"`). */
347
+ cloud: z.strictObject({
348
+ /** Google Gemini API or custom gateway endpoint. Defaults to `https://generativelanguage.googleapis.com`. */
349
+ endpoint: z.url().optional(),
350
+ /** Google Cloud Project ID (when using Vertex AI). */
351
+ projectId: z.string().min(1).optional(),
352
+ /** Google Cloud location/region (when using Vertex AI). */
353
+ location: z.string().min(1).optional()
354
+ }).optional(),
355
+ /** Local-specific settings (for `mode: "local"`). */
356
+ local: z.strictObject({
357
+ /** Command and arguments to spawn the ACP server process. */
358
+ command: z.array(z.string().min(1)).min(1).optional(),
359
+ /** Path to an existing Unix domain socket to connect to instead of spawning a process. */
360
+ socketPath: z.string().min(1).optional()
361
+ }).optional()
362
+ });
317
363
  CODEX_EFFORTS = ["none", "low", "medium", "high"];
318
364
  CODEX_LOGINS = ["codex-cli", "chatgpt-sign-in"];
319
365
  CODEX_DEFAULT_TIER_MODELS = Object.freeze({
@@ -363,7 +409,15 @@ var init_schema = __esm({
363
409
  env: ProviderEnvSchema.optional(),
364
410
  codex: CodexProviderConfigSchema.optional()
365
411
  });
366
- ProviderSchema = z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema]);
412
+ AntigravityProviderSchema = z.strictObject({
413
+ $schema: z.string().optional(),
414
+ kind: z.literal("antigravity"),
415
+ displayName: z.string().min(1),
416
+ credential: ProviderCredentialSchema,
417
+ env: ProviderEnvSchema.optional(),
418
+ antigravity: AntigravityProviderConfigSchema.optional()
419
+ });
420
+ ProviderSchema = z.discriminatedUnion("kind", [HttpProviderSchema, CodexProviderSchema, AntigravityProviderSchema]);
367
421
  ConfigProfileSchema = z.strictObject({
368
422
  $schema: z.string().optional(),
369
423
  description: z.string().optional(),
@@ -2763,7 +2817,7 @@ var init_package = __esm({
2763
2817
  "package.json"() {
2764
2818
  package_default = {
2765
2819
  name: "agent-shim",
2766
- version: "11.8.1",
2820
+ version: "11.9.0",
2767
2821
  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.",
2768
2822
  license: "MIT",
2769
2823
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -3191,7 +3245,7 @@ function daemonIdentity(commandLine, socketPath) {
3191
3245
  function earlierReleaseAllowlistHash(providers, doorOrigin) {
3192
3246
  const entries = /* @__PURE__ */ new Set([EARLIER_RELEASE_ANTHROPIC_UPSTREAM]);
3193
3247
  for (const provider of providers) {
3194
- if (!isCodexProvider(provider)) {
3248
+ if (isHttpProvider(provider)) {
3195
3249
  entries.add(provider.baseUrl);
3196
3250
  }
3197
3251
  }
@@ -6313,11 +6367,20 @@ function listProviderNames(readdir, providersDir) {
6313
6367
  return entries.filter((entry) => entry.endsWith(".json")).map((entry) => entry.slice(0, -".json".length)).sort();
6314
6368
  }
6315
6369
  function describeProviderEndpoint(provider) {
6316
- return isCodexProvider(provider) ? "codex translation daemon" : provider.baseUrl;
6370
+ if (isCodexProvider(provider)) {
6371
+ return "codex translation daemon";
6372
+ }
6373
+ if (isAntigravityProvider(provider)) {
6374
+ return (provider.antigravity?.mode ?? ANTIGRAVITY_DEFAULT_MODE) === "local" ? "antigravity local (ACP daemon)" : "antigravity cloud (Gemini API)";
6375
+ }
6376
+ return provider.baseUrl;
6317
6377
  }
6318
6378
  function isEmptyCodexConfig(config) {
6319
6379
  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);
6320
6380
  }
6381
+ function isEmptyAntigravityConfig(config) {
6382
+ 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);
6383
+ }
6321
6384
  function addProvider(paths, name, input) {
6322
6385
  if (providerExists(paths, name)) {
6323
6386
  throw new ProviderAlreadyExistsError(name);
@@ -6329,19 +6392,25 @@ function addProvider(paths, name, input) {
6329
6392
  if (kind === "codex" && input.baseUrl !== void 0) {
6330
6393
  throw new ProviderKindMismatchError("A codex provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6331
6394
  }
6395
+ if (kind === "antigravity" && input.baseUrl !== void 0) {
6396
+ throw new ProviderKindMismatchError("An antigravity provider has no base URL: the launcher points its sessions at the front-door daemon. Drop --base-url.");
6397
+ }
6332
6398
  if (kind === "http" && input.baseUrl === void 0) {
6333
6399
  throw new ProviderKindMismatchError("An http provider needs --base-url.");
6334
6400
  }
6335
- if (kind === "http" && !isEmptyCodexConfig(input.codex)) {
6401
+ if (kind !== "codex" && !isEmptyCodexConfig(input.codex)) {
6336
6402
  throw new ProviderKindMismatchError("Codex settings apply only to a codex provider (--kind codex).");
6337
6403
  }
6404
+ if (kind !== "antigravity" && !isEmptyAntigravityConfig(input.antigravity)) {
6405
+ throw new ProviderKindMismatchError("Antigravity settings apply only to an antigravity provider (--kind antigravity).");
6406
+ }
6338
6407
  const shared = {
6339
6408
  displayName: input.displayName,
6340
6409
  credential: { sources: input.sources, ...input.target === void 0 ? {} : { target: input.target } },
6341
6410
  ...input.env === void 0 || Object.keys(input.env).length === 0 ? {} : { env: input.env }
6342
6411
  };
6343
6412
  const parsed = ProviderSchema.safeParse(
6344
- kind === "codex" ? { kind, ...shared, ...isEmptyCodexConfig(input.codex) ? {} : { codex: input.codex } } : { ...shared, baseUrl: input.baseUrl }
6413
+ kind === "codex" ? { kind, ...shared, ...isEmptyCodexConfig(input.codex) ? {} : { codex: input.codex } } : kind === "antigravity" ? { kind, ...shared, ...isEmptyAntigravityConfig(input.antigravity) ? {} : { antigravity: input.antigravity } } : { ...shared, baseUrl: input.baseUrl }
6345
6414
  );
6346
6415
  if (!parsed.success) {
6347
6416
  throw new ConfigValidationError(providerJsonPath(paths, name), parsed.error.issues);
@@ -6361,8 +6430,14 @@ function updateProvider(paths, name, input) {
6361
6430
  if (isCodexProvider(existing) && input.baseUrl !== void 0) {
6362
6431
  throw new ProviderKindMismatchError(`Provider "${name}" is a codex provider, which has no base URL.`);
6363
6432
  }
6433
+ if (isAntigravityProvider(existing) && input.baseUrl !== void 0) {
6434
+ throw new ProviderKindMismatchError(`Provider "${name}" is an antigravity provider, which has no base URL.`);
6435
+ }
6364
6436
  if (!isCodexProvider(existing) && !isEmptyCodexConfig(input.codex)) {
6365
- throw new ProviderKindMismatchError(`Provider "${name}" is an http provider; codex settings apply only to a codex provider.`);
6437
+ throw new ProviderKindMismatchError(`Provider "${name}" is not a codex provider; codex settings apply only to a codex provider.`);
6438
+ }
6439
+ if (!isAntigravityProvider(existing) && !isEmptyAntigravityConfig(input.antigravity)) {
6440
+ throw new ProviderKindMismatchError(`Provider "${name}" is not an antigravity provider; antigravity settings apply only to an antigravity provider.`);
6366
6441
  }
6367
6442
  const shared = {
6368
6443
  ...input.displayName === void 0 ? {} : { displayName: input.displayName },
@@ -6381,6 +6456,13 @@ function updateProvider(paths, name, input) {
6381
6456
  ...existing.codex?.models === void 0 && input.codex?.models === void 0 ? {} : { models: { ...existing.codex?.models, ...input.codex?.models } }
6382
6457
  };
6383
6458
  candidate = { ...existing, ...shared, codex: isEmptyCodexConfig(codex) ? void 0 : codex };
6459
+ } else if (isAntigravityProvider(existing)) {
6460
+ const antigravity = {
6461
+ ...existing.antigravity,
6462
+ ...input.antigravity,
6463
+ ...existing.antigravity?.models === void 0 && input.antigravity?.models === void 0 ? {} : { models: { ...existing.antigravity?.models, ...input.antigravity?.models } }
6464
+ };
6465
+ candidate = { ...existing, ...shared, antigravity: isEmptyAntigravityConfig(antigravity) ? void 0 : antigravity };
6384
6466
  } else {
6385
6467
  candidate = { ...existing, ...shared, ...input.baseUrl === void 0 ? {} : { baseUrl: input.baseUrl } };
6386
6468
  }
@@ -14840,7 +14922,7 @@ function providerValue(name, provider) {
14840
14922
  name,
14841
14923
  kind: provider.kind ?? "http",
14842
14924
  displayName: provider.displayName,
14843
- ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : { baseUrl: provider.baseUrl },
14925
+ ...isCodexProvider(provider) ? provider.codex === void 0 ? {} : { codex: provider.codex } : isAntigravityProvider(provider) ? provider.antigravity === void 0 ? {} : { antigravity: provider.antigravity } : { baseUrl: provider.baseUrl },
14844
14926
  credential: summariseCredential(provider.credential),
14845
14927
  ...provider.env === void 0 ? {} : { env: provider.env }
14846
14928
  };
@@ -15019,7 +15101,7 @@ function createConfigApiRouter(deps) {
15019
15101
  throw new ProviderNotFoundError(input.name);
15020
15102
  }
15021
15103
  const credential = input.credential;
15022
- if (input.baseUrl !== void 0 && !isCodexProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15104
+ if (input.baseUrl !== void 0 && isHttpProvider(existing) && input.baseUrl !== existing.baseUrl && credential?.sources === void 0) {
15023
15105
  throw new ORPCError2("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.` });
15024
15106
  }
15025
15107
  const cache = credential?.cache === void 0 ? void 0 : mergeCredentialCache(credential.cache === false ? { enabled: false } : { ...credential.cache, enabled: true }, existing.credential.cache);