@estebanforge/pi-antigravity-bridge 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.4.3] - 2026-09-04
6
+
7
+ ### Added
8
+
9
+ - AskAntigravity tool toggle: `/agy ask on|off`, an "AskAntigravity tool" row in the bare-`/agy` picker, and the `askTool` config key (env `AGY_ASK_TOOL`). Default on; `off` skips registering the AskAntigravity one-shot delegation tool entirely, for users who want only the provider and its models and no delegation tool in the model's window context. When the separate pi-ask-antigravity package is also installed, `off` means no delegation tool from either package (no fallback). Takes effect on the next pi start (or /reload); `/agy status` shows the state.
10
+
11
+ ### Changed
12
+ ### Changed
13
+
14
+ - The bare-`/agy` settings picker gains a Turn engine row (`stream-json`/`acp`). Saving `acp` persists the switch, then runs the same self-service setup as `/agy engine acp` (binary install + auth bootstrap, `acp.bin` updated). The plan+acp RC01 guard now evaluates the effective engine AND mode after the save, so a config already in `plan` plus a fresh `acp` pick is refused instead of persisting an invalid combination (peer-review find).
15
+ - "Tool default model/thinking" renamed to "AskAntigravity model/thinking" across the picker, `/agy status`, and toasts; descriptions and README now state the values are fallbacks that callers may override per call.
16
+ - All ACP login-pending messages share one wording that names the antigravity-acp server and its place in Google's Antigravity suite (agy desktop, agy editor, agy cli, agy acp), and clarifies the login: same Google account as the agy CLI, separate login with its own token file.
17
+
5
18
  ## [1.4.2] - 2026-09-04
6
19
 
7
20
  ### Changed
package/README.md CHANGED
@@ -104,11 +104,12 @@ If `agy models` fails at load (binary missing, auth not done, network stall), a
104
104
 
105
105
  | Key | Values | Default |
106
106
  | --- | --- | --- |
107
+ | `askTool` | `on` (register the AskAntigravity delegation tool), `off` (no delegation tool; provider and models only) | `on` |
107
108
  | `bridgeTools` | `none` (bridge off), `all` (every non-builtin tool, incl. other `Ask*` delegations), `mcp` (pi-mcp-adapter tools + skills bridge only) | `all` |
108
109
  | `digest` | `off` (stable prompts; agy's prompt cache hits) or `on` (inject a delta of pi-side context - compaction summaries, other-provider turns - into each agy prompt; the delta changes every turn, so agy re-bills the full context). Enable for mixed-provider sessions where agy must see pi-side context | `off` |
109
110
  | `systemPrompt` | `on` (prepend pi's system prompt - operating instructions plus the global agent-dir `AGENTS.md` and ancestor `AGENTS.md`/`CLAUDE.md` - to the first prompt of each new agy conversation) or `off` (agy-native behavior) | `on` |
110
111
 
111
- Env overrides: `AGY_BRIDGE_TOOLS`, `AGY_DIGEST`, `AGY_SYSTEM_PROMPT`. Env wins over the file, so while `AGY_DIGEST` or `AGY_SYSTEM_PROMPT` is set, the matching `/agy digest` or `/agy system-prompt` toggle persists a value that never takes effect.
112
+ Env overrides: `AGY_BRIDGE_TOOLS`, `AGY_ASK_TOOL`, `AGY_DIGEST`, `AGY_SYSTEM_PROMPT`. Env wins over the file, so while `AGY_DIGEST` or `AGY_SYSTEM_PROMPT` is set, the matching `/agy digest` or `/agy system-prompt` toggle persists a value that never takes effect.
112
113
 
113
114
  The `activate_skill` catalog mirrors pi's directory-based skill discovery: the two global dirs plus project dirs, the latter only when pi has trusted the project (same gate pi itself applies). Pi's other skill sources - the `skills` settings array, `package.json` entries, and `--skill` CLI paths - are not mirrored and won't appear in the catalog.
114
115
 
@@ -123,8 +124,9 @@ The `activate_skill` catalog mirrors pi's directory-based skill discovery: the t
123
124
  /agy mode plan review-only: agy plans but writes nothing
124
125
  /agy mode accept-edits agy applies edits directly (default)
125
126
  /agy permissions on|off auto-approve / prompt for tool calls (see warning)
126
- /agy model flash|pro|gemini default model alias for the AskAntigravity tool
127
- /agy thinking low|medium|high default thinking tier for the AskAntigravity tool
127
+ /agy ask on|off register the AskAntigravity delegation tool (default on; off keeps only the provider and models, even with pi-ask-antigravity installed)
128
+ /agy model flash|pro|gemini fallback model for the AskAntigravity tool; callers may override per call
129
+ /agy thinking low|medium|high fallback thinking tier for the AskAntigravity tool; callers may override per call
128
130
  /agy digest on|off inject pi-side context into agy prompts (default off; see table above)
129
131
  /agy system-prompt on|off send pi's system prompt + AGENTS.md to new agy conversations (default on)
130
132
  /agy bridge all|mcp|none which pi tools the MCP bridge exposes to agy (default all; none = bridge off)
@@ -209,8 +209,13 @@ export default async function (pi: ExtensionAPI): Promise<void> {
209
209
  // AskAntigravity tool: one-shot delegation to agy (ported from
210
210
  // pi-ask-antigravity). When both extensions are installed, the bridge wins
211
211
  // and pi-ask-antigravity registers nothing (its load-time defer guard
212
- // detects this package via import.meta.resolve).
213
- await registerAskAntigravityTool(pi, toolModels);
212
+ // detects this package via import.meta.resolve). Opt-out: askTool=false
213
+ // (config file, AGY_ASK_TOOL, /agy ask, or the picker) skips registration
214
+ // entirely - users who want only the provider keep a clean tool list.
215
+ // Note: the active flag below is set regardless of askTool, so
216
+ // pi-ask-antigravity keeps deferring even then: off means NO delegation
217
+ // tool from either package, not a fallback to pi-ask-antigravity.
218
+ if (loadConfig().askTool) await registerAskAntigravityTool(pi, toolModels);
214
219
 
215
220
  // Display-only wrapper tool: the provider emits mutating agy steps as
216
221
  // toolCalls against it (never re-executed - execute() replays the output
@@ -265,8 +270,7 @@ export default async function (pi: ExtensionAPI): Promise<void> {
265
270
  saveConfig({ acp: { bin: status.bin, permissions: loadConfig().acp.permissions } });
266
271
  }
267
272
  if (status.needsLogin) {
268
- const msg =
269
- "ACP: one-time Google login pending. Your next antigravity message opens the browser; sign in with your Antigravity subscription account (the same login as the agy CLI). Tokens stay on your machine.";
273
+ const msg = acpLoginPending("Your next antigravity message opens the browser;");
270
274
  if (ctx.hasUI) ctx.ui.notify(msg, "info");
271
275
  else console.error(`[antigravity-bridge] ${msg}`);
272
276
  }
@@ -379,6 +383,14 @@ export default async function (pi: ExtensionAPI): Promise<void> {
379
383
 
380
384
  // --- /agy command -----------------------------------------------------------
381
385
 
386
+ /** Shared body for every ACP-login-pending moment (session_start self-heal,
387
+ * /agy engine acp, picker): names the component so users know WHAT they are
388
+ * logging into, and that it is the same Google account as the agy CLI with
389
+ * its own token file. `browserTrigger` says when the browser opens. */
390
+ function acpLoginPending(browserTrigger: string): string {
391
+ return `One-time Google login pending for the antigravity-acp server, Google's own ACP binary and a separate component of the Antigravity suite (agy desktop, agy editor, agy cli, agy acp). ${browserTrigger} Sign in with your Antigravity subscription account: the same Google account as your agy CLI login, but its own login and token file. One-time; tokens stay on your machine and this extension never sees them.`;
392
+ }
393
+
382
394
  interface AgyCommandCtx {
383
395
  entries: AgyModelEntry[];
384
396
  store: SessionStore;
@@ -391,10 +403,12 @@ interface AgyCommandCtx {
391
403
  }
392
404
 
393
405
  interface PendingConfig {
406
+ engine?: Engine;
394
407
  mode?: AgyMode;
395
408
  skipPermissions?: boolean;
396
409
  defaultModel?: string;
397
410
  defaultThinking?: ThinkingTier;
411
+ askTool?: boolean;
398
412
  bridgeTools?: BridgeTools;
399
413
  digest?: boolean;
400
414
  systemPrompt?: boolean;
@@ -404,21 +418,25 @@ function statusText(ctx: AgyCommandCtx): string {
404
418
  const config = loadConfig();
405
419
  const source = ctx.usingFallback ? "fallback (agy models failed)" : "discovered";
406
420
  const perm = config.skipPermissions ? "auto-approved (DANGEROUS)" : "prompt (hangs in -p)";
421
+ // padEnd keyed to the longest label ("AskAntigravity thinking:") so the
422
+ // value column stays aligned as labels grow.
423
+ const row = (label: string, value: string) => ` ${label.padEnd(24)} ${value}`;
407
424
  return [
408
425
  "Antigravity bridge",
409
- ` engine: ${config.engine}${config.engine === "acp" ? " (official server, opt-in)" : ""}`,
410
- ` models: ${ctx.entries.length} ${source}`,
411
- ` mode: ${config.mode}`,
412
- ` permissions: ${perm}`,
413
- ` tool model: ${config.defaultModel}`,
414
- ` tool thinking: ${config.defaultThinking}`,
415
- ` sessions: ${ctx.store.size} bound`,
416
- ` config: ${CONFIG_PATH}`,
417
- ` bridge tools: ${config.bridgeTools}`,
418
- ` digest: ${config.digest ? "on" : "off"}`,
419
- ` system prompt: ${config.systemPrompt ? "on" : "off"}`,
426
+ row("engine:", `${config.engine}${config.engine === "acp" ? " (official server, opt-in)" : ""}`),
427
+ row("models:", `${ctx.entries.length} ${source}`),
428
+ row("mode:", config.mode),
429
+ row("permissions:", perm),
430
+ row("AskAntigravity tool:", config.askTool ? "on" : "off"),
431
+ row("AskAntigravity model:", config.defaultModel),
432
+ row("AskAntigravity thinking:", config.defaultThinking),
433
+ row("sessions:", `${ctx.store.size} bound`),
434
+ row("config:", CONFIG_PATH),
435
+ row("bridge tools:", config.bridgeTools),
436
+ row("digest:", config.digest ? "on" : "off"),
437
+ row("system prompt:", config.systemPrompt ? "on" : "off"),
420
438
  "",
421
- "Subcommands: /agy engine stream-json|acp, /agy mode plan|accept-edits, /agy permissions on|off, /agy bridge all|mcp|none, /agy model <alias>, /agy thinking low|medium|high, /agy digest on|off, /agy system-prompt on|off, /agy acp-bin <path|auto>, /agy acp-auth, /agy patch-cleanup, /agy clear",
439
+ "Subcommands: /agy engine stream-json|acp, /agy mode plan|accept-edits, /agy permissions on|off, /agy ask on|off, /agy model <alias>, /agy thinking low|medium|high, /agy bridge all|mcp|none, /agy digest on|off, /agy system-prompt on|off, /agy acp-bin <path|auto>, /agy acp-auth, /agy patch-cleanup, /agy clear",
422
440
  ].join("\n");
423
441
  }
424
442
 
@@ -426,7 +444,7 @@ function statusText(ctx: AgyCommandCtx): string {
426
444
  function registerAgyCommand(pi: ExtensionAPI, ctx: AgyCommandCtx): void {
427
445
  pi.registerCommand("agy", {
428
446
  description:
429
- "Antigravity provider: status, doctor, settings picker, clear sessions. Usage: /agy [status|doctor|engine stream-json|acp|mode plan|accept-edits|permissions on|off|bridge all|mcp|none|model <alias>|thinking low|medium|high|digest on|off|system-prompt on|off|acp-bin <path|auto>|acp-auth|patch-cleanup|clear]",
447
+ "Antigravity provider: status, doctor, settings picker, clear sessions. Usage: /agy [status|doctor|engine stream-json|acp|mode plan|accept-edits|permissions on|off|ask on|off|model <alias>|thinking low|medium|high|bridge all|mcp|none|digest on|off|system-prompt on|off|acp-bin <path|auto>|acp-auth|patch-cleanup|clear]",
430
448
  handler: async (args, cmdCtx: ExtensionCommandContext) => {
431
449
  const ui = cmdCtx.ui;
432
450
  const mode = cmdCtx.mode;
@@ -485,7 +503,7 @@ function registerAgyCommand(pi: ExtensionAPI, ctx: AgyCommandCtx): void {
485
503
  saveConfig({ acp: { bin: status.bin, permissions: loadConfig().acp.permissions } });
486
504
  ui?.notify(
487
505
  status.needsLogin
488
- ? "ACP engine ready. Your first ACP message opens the Google login in your browser: sign in with the account of your Antigravity subscription (the same login as the Antigravity CLI, agy). One-time; tokens stay on your machine and this extension never sees them. Takes effect on the next pi start (or /reload)."
506
+ ? `ACP engine ready. ${acpLoginPending("Your first ACP message (after the next pi start or /reload) opens the browser;")}`
489
507
  : `ACP engine ready (auth: ${status.auth}). Takes effect on the next pi start (or /reload).`,
490
508
  "info",
491
509
  );
@@ -617,9 +635,23 @@ function registerAgyCommand(pi: ExtensionAPI, ctx: AgyCommandCtx): void {
617
635
  if (sub === "model") {
618
636
  if (val && val.length > 0) {
619
637
  const next = saveConfig({ defaultModel: val });
620
- ui?.notify(`tool default model set to ${next.defaultModel}`, "info");
638
+ ui?.notify(`AskAntigravity default model set to ${next.defaultModel}`, "info");
639
+ } else {
640
+ ui?.notify(`AskAntigravity model: ${loadConfig().defaultModel} (fallback; callers may override per call)\nusage: /agy model flash|pro|gemini|<exact>`, "info");
641
+ }
642
+ return;
643
+ }
644
+ if (sub === "ask") {
645
+ if (val === "on" || val === "off") {
646
+ const next = saveConfig({ askTool: val === "on" });
647
+ ui?.notify(
648
+ next.askTool
649
+ ? "AskAntigravity tool on. Registered on the next pi start (or /reload)."
650
+ : "AskAntigravity tool off. It is removed from the model's tool list on the next pi start (or /reload). Provider and models stay.",
651
+ "info",
652
+ );
621
653
  } else {
622
- ui?.notify(`tool model: ${loadConfig().defaultModel}\nusage: /agy model flash|pro|gemini|<exact>`, "info");
654
+ ui?.notify(`AskAntigravity tool: ${loadConfig().askTool ? "on" : "off"}\nusage: /agy ask on|off`, "info");
623
655
  }
624
656
  return;
625
657
  }
@@ -655,9 +687,9 @@ function registerAgyCommand(pi: ExtensionAPI, ctx: AgyCommandCtx): void {
655
687
  if (sub === "thinking") {
656
688
  if (val === "low" || val === "medium" || val === "high") {
657
689
  const next = saveConfig({ defaultThinking: val as ThinkingTier });
658
- ui?.notify(`tool default thinking set to ${next.defaultThinking}`, "info");
690
+ ui?.notify(`AskAntigravity default thinking set to ${next.defaultThinking}`, "info");
659
691
  } else {
660
- ui?.notify(`tool thinking: ${loadConfig().defaultThinking}\nusage: /agy thinking low|medium|high`, "info");
692
+ ui?.notify(`AskAntigravity thinking: ${loadConfig().defaultThinking} (fallback; callers may override per call)\nusage: /agy thinking low|medium|high`, "info");
661
693
  }
662
694
  return;
663
695
  }
@@ -680,14 +712,22 @@ function registerAgyCommand(pi: ExtensionAPI, ctx: AgyCommandCtx): void {
680
712
  }
681
713
 
682
714
  /** Interactive settings picker (TUI only). Rows: the full runtime config
683
- * surface (mode, permissions, model, thinking, bridge, digest, system
684
- * prompt). Engine stays a subcommand: switching runs install + auth setup
685
- * and needs a restart. */
715
+ * surface (engine, mode, permissions, model, thinking, bridge, digest,
716
+ * system prompt). Picking acp runs the same self-service setup as
717
+ * `/agy engine acp` (binary + auth) right after the save. */
686
718
  async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promise<void> {
687
719
  const config = loadConfig();
688
720
  const pending: PendingConfig = {};
689
721
 
690
722
  const items: SettingItem[] = [
723
+ {
724
+ id: "engine",
725
+ label: "Turn engine",
726
+ description:
727
+ "stream-json: the streaming engine (default, supported). acp: Google's official ACP server (experimental, opt-in). Switch takes effect on the next pi start (or /reload); acp also runs binary + auth setup on save.",
728
+ currentValue: config.engine,
729
+ values: ["stream-json", "acp"],
730
+ },
691
731
  {
692
732
  id: "mode",
693
733
  label: "Execution mode",
@@ -704,19 +744,27 @@ async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promis
704
744
  currentValue: config.skipPermissions ? "auto-approved" : "prompt",
705
745
  values: ["auto-approved", "prompt"],
706
746
  },
747
+ {
748
+ id: "ask",
749
+ label: "AskAntigravity tool",
750
+ description:
751
+ "Register the AskAntigravity one-shot delegation tool. off removes it from the model's tool list (provider and models stay, even with the separate pi-ask-antigravity package installed). Takes effect on the next pi start (or /reload).",
752
+ currentValue: config.askTool ? "on" : "off",
753
+ values: ["on", "off"],
754
+ },
707
755
  {
708
756
  id: "model",
709
- label: "Tool default model",
757
+ label: "AskAntigravity model",
710
758
  description:
711
- "Alias used when the AskAntigravity tool omits its model param. flash/pro/gemini, or an exact id.",
759
+ "AskAntigravity one-shot delegation tool: model used when its caller omits the model param. Callers may override per call; this is only the fallback. flash/pro/gemini, or an exact id. Does not affect the provider model you pick in /model.",
712
760
  currentValue: config.defaultModel,
713
761
  values: ["flash", "pro", "gemini"],
714
762
  },
715
763
  {
716
764
  id: "thinking",
717
- label: "Tool default thinking",
765
+ label: "AskAntigravity thinking",
718
766
  description:
719
- "Thinking tier used when the model alias names none. Pro has no Medium; it falls back to nearest.",
767
+ "AskAntigravity one-shot delegation tool: thinking tier used when the call names none. Callers may override per call; this is only the fallback. Pro has no Medium; it falls back to nearest.",
720
768
  currentValue: config.defaultThinking,
721
769
  values: ["low", "medium", "high"],
722
770
  },
@@ -756,7 +804,9 @@ async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promis
756
804
  Math.min(items.length + 4, 15),
757
805
  getSettingsListTheme(),
758
806
  (id, newValue) => {
759
- if (id === "mode") {
807
+ if (id === "engine") {
808
+ pending.engine = newValue as Engine;
809
+ } else if (id === "mode") {
760
810
  pending.mode = newValue as AgyMode;
761
811
  } else if (id === "permissions") {
762
812
  pending.skipPermissions = newValue === "auto-approved";
@@ -764,6 +814,8 @@ async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promis
764
814
  pending.defaultModel = newValue;
765
815
  } else if (id === "thinking") {
766
816
  pending.defaultThinking = newValue as ThinkingTier;
817
+ } else if (id === "ask") {
818
+ pending.askTool = newValue === "on";
767
819
  } else if (id === "bridge") {
768
820
  pending.bridgeTools = newValue as BridgeTools;
769
821
  } else if (id === "digest") {
@@ -788,20 +840,32 @@ async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promis
788
840
 
789
841
  if (Object.keys(pending).length === 0) return;
790
842
 
791
- if (pending.mode === "plan" && ctx.engine === "acp") {
792
- ui.notify("the ACP engine has no plan mode (RC01). Switch /agy engine stream-json first.", "warning");
843
+ // The engine latches at load: a plan mode active while the effective
844
+ // engine is (or will be) acp would silently run non-plan. ACP has no
845
+ // review-only mode (RC01); refuse the combination. Both sides fall back
846
+ // to the on-disk config so a fresh engine pick over a saved plan (and
847
+ // vice versa) is caught too.
848
+ const nextEngine = pending.engine ?? ctx.engine;
849
+ const nextMode = pending.mode ?? config.mode;
850
+ if (nextMode === "plan" && nextEngine === "acp") {
851
+ ui.notify(
852
+ "plan + acp is not supported (RC01): the ACP engine has no review-only mode. Save mode accept-edits or pick the stream-json engine first.",
853
+ "warning",
854
+ );
793
855
  return;
794
856
  }
795
857
 
796
858
  try {
797
859
  const next = saveConfig(pending);
798
860
  const changed = [
861
+ pending.engine !== undefined ? `engine=${next.engine}` : null,
799
862
  pending.mode ? `mode=${next.mode}` : null,
800
863
  pending.skipPermissions !== undefined
801
864
  ? `permissions=${next.skipPermissions ? "auto-approved" : "prompt"}`
802
865
  : null,
803
- pending.defaultModel !== undefined ? `tool model=${next.defaultModel}` : null,
804
- pending.defaultThinking !== undefined ? `tool thinking=${next.defaultThinking}` : null,
866
+ pending.askTool !== undefined ? `AskAntigravity tool=${next.askTool ? "on" : "off"}` : null,
867
+ pending.defaultModel !== undefined ? `AskAntigravity model=${next.defaultModel}` : null,
868
+ pending.defaultThinking !== undefined ? `AskAntigravity thinking=${next.defaultThinking}` : null,
805
869
  pending.bridgeTools !== undefined ? `bridge=${next.bridgeTools}` : null,
806
870
  pending.digest !== undefined ? `digest=${next.digest ? "on" : "off"}` : null,
807
871
  pending.systemPrompt !== undefined ? `system-prompt=${next.systemPrompt ? "on" : "off"}` : null,
@@ -809,11 +873,30 @@ async function openAgyPicker(ui: ExtensionUIContext, ctx: AgyCommandCtx): Promis
809
873
  .filter(Boolean)
810
874
  .join(", ");
811
875
  ui.notify(`Saved: ${changed}`, "info");
876
+ if (pending.engine === "acp") {
877
+ // Same flow as /agy engine acp: persist the switch, then prepare
878
+ // the server so the restart just works.
879
+ ui.notify("Preparing the ACP server (binary + auth)…", "info");
880
+ const status = await ensureAcpReady({
881
+ configBin: loadConfig().acp.bin,
882
+ onProgress: (m) => ui.notify(m, "info"),
883
+ });
884
+ if (status.ok) {
885
+ saveConfig({ acp: { bin: status.bin, permissions: loadConfig().acp.permissions } });
886
+ ui.notify(
887
+ status.needsLogin
888
+ ? `ACP server ready. ${acpLoginPending("Your first ACP message (after the restart) opens the browser;")}`
889
+ : `ACP server ready (auth: ${status.auth}).`,
890
+ "info",
891
+ );
892
+ } else {
893
+ ui.notify(`ACP auto-setup failed (${status.error}).\n${status.manual}`, "warning");
894
+ }
895
+ }
812
896
  } catch (err) {
813
897
  ui.notify(
814
898
  `Failed to save config: ${err instanceof Error ? err.message : String(err)}`,
815
899
  "error",
816
900
  );
817
901
  }
818
- void ctx;
819
902
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estebanforge/pi-antigravity-bridge",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Gemini provider for Pi on the Antigravity ACP server (official Google ACP) or the stream-json agy CLI. antigravity/* models in Pi's /model picker, no-patch MCP bridge: agy runs Pi's tools. ToS safe to use.",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/config.ts CHANGED
@@ -54,6 +54,11 @@ export interface AgyConfig {
54
54
  defaultModel: string;
55
55
  /** AskAntigravity tool: default thinking tier when the alias names none. */
56
56
  defaultThinking: ThinkingTier;
57
+ /** Register the AskAntigravity one-shot delegation tool. Default on.
58
+ * off removes the tool entirely for users who want only the provider
59
+ * and models (no delegation tool in the model's window context).
60
+ * Takes effect at pi start (or /reload). */
61
+ askTool: boolean;
57
62
  /** Set after the one-time notice about a leftover legacy invokeTool patch
58
63
  * on the installed pi. The notice never repeats; /agy patch-cleanup is
59
64
  * always available. */
@@ -96,6 +101,7 @@ const DEFAULTS: AgyConfig = {
96
101
  skipPermissions: true,
97
102
  defaultModel: "flash",
98
103
  defaultThinking: "medium",
104
+ askTool: true,
99
105
  bridgeTools: "all",
100
106
  digest: false,
101
107
  systemPrompt: true,
@@ -149,6 +155,10 @@ export function loadConfig(configPath: string = CONFIG_PATH): AgyConfig {
149
155
  const defaultThinking: ThinkingTier =
150
156
  thinkRaw === "low" || thinkRaw === "high" ? thinkRaw : "medium";
151
157
 
158
+ const askTool = process.env.AGY_ASK_TOOL !== undefined
159
+ ? ["1", "true", "on"].includes(process.env.AGY_ASK_TOOL.toLowerCase())
160
+ : file.askTool ?? DEFAULTS.askTool;
161
+
152
162
  const bridgeRaw = (process.env.AGY_BRIDGE_TOOLS ?? file.bridgeTools ?? DEFAULTS.bridgeTools).toLowerCase();
153
163
  const bridgeTools: BridgeTools =
154
164
  bridgeRaw === "none" || bridgeRaw === "all" || bridgeRaw === "mcp"
@@ -179,6 +189,7 @@ export function loadConfig(configPath: string = CONFIG_PATH): AgyConfig {
179
189
  skipPermissions,
180
190
  defaultModel,
181
191
  defaultThinking,
192
+ askTool,
182
193
  bridgeTools,
183
194
  digest,
184
195
  systemPrompt,