@juanbenjumea/pi-agy 0.7.13 → 0.7.14

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.14
4
+
5
+ - Keep model discovery off Pi's session-start critical path and load the MCP bridge only when needed.
6
+ - Add regression coverage confirming the extension starts without loading the bridge dependencies.
7
+ - Full 491-test suite, typecheck, and package checks pass.
8
+
3
9
  ## 0.7.13
4
10
 
5
11
  - Refresh the separate `/agy` delegation picker with every discovered concrete model ID, not just fixed aliases; preserve exact names and Gemini tier variants.
@@ -128,14 +128,21 @@ function registerAgyProvider(pi: ExtensionAPI): void {
128
128
  shutdown.abort();
129
129
  return;
130
130
  }
131
- pi.on?.("session_start", async (_event, ctx) => {
131
+ pi.on?.("session_start", (_event, ctx) => {
132
132
  const signal = AbortSignal.any([shutdown.signal, AbortSignal.timeout(10_000)]);
133
- const result = await ctx.modelRegistry.refresh({
133
+ // Keep provider discovery off Pi's session-start critical path. The model
134
+ // picker also refreshes on demand, so startup can use the cached catalog.
135
+ void ctx.modelRegistry.refresh({
134
136
  providers: [AGY_PROVIDER_ID], allowNetwork: true, signal,
137
+ }).then((result) => {
138
+ if (!signal.aborted && result.errors.has(AGY_PROVIDER_ID)) {
139
+ ctx.ui.notify("Could not refresh Antigravity models; showing cached models. Reopen /model to retry.", "warning");
140
+ }
141
+ }).catch(() => {
142
+ if (!signal.aborted) {
143
+ ctx.ui.notify("Could not refresh Antigravity models; showing cached models. Reopen /model to retry.", "warning");
144
+ }
135
145
  });
136
- if (!signal.aborted && result.errors.has(AGY_PROVIDER_ID)) {
137
- ctx.ui.notify("Could not refresh Antigravity models; showing cached models. Reopen /model to retry.", "warning");
138
- }
139
146
  });
140
147
  }
141
148
 
@@ -35,6 +35,7 @@ import {
35
35
 
36
36
  import { getDefaultConfigPath } from "./config.js";
37
37
  import { isBridgeInputWithinBudget } from "./bridge-input-budget.js";
38
+ import type { BridgeToolDef } from "./provider-tools.js";
38
39
  import { checkAgyUsage, formatAgyUsage } from "./cli.js";
39
40
  import {
40
41
  FALLBACK_PROVIDER_MODELS,
@@ -180,16 +181,6 @@ export interface McpBridgeHandle {
180
181
  describe: () => { configDir: string; url: string; toolCount: number; pendingResults: number };
181
182
  }
182
183
 
183
- /** A Pi tool projected for agy: MCP-safe advertised name, real Pi identity. */
184
- export interface BridgeToolDef {
185
- /** MCP-safe name as advertised to agy. */
186
- name: string;
187
- /** Real Pi tool name (invoked via shadow toolUse). */
188
- piName: string;
189
- description: string;
190
- inputSchema: Record<string, unknown>;
191
- }
192
-
193
184
  export interface BridgePark {
194
185
  callId: string;
195
186
  /** Real Pi tool name. */
@@ -204,15 +195,6 @@ export interface BridgeToolResult {
204
195
 
205
196
  export type BridgeParkHandler = (park: BridgePark) => boolean;
206
197
 
207
- /** MCP tool names: [a-zA-Z0-9_-]{1,64}. Pi names are sanitized into that. */
208
- export function toSafeBridgeName(name: string): string {
209
- const safe = name
210
- .replace(/[^a-zA-Z0-9_-]+/g, "_")
211
- .replace(/^_+|_+$/g, "")
212
- .slice(0, 64);
213
- return safe || "tool";
214
- }
215
-
216
198
  interface CatalogCache {
217
199
  raw: string;
218
200
  at: number;
@@ -1,4 +1,19 @@
1
- import { toSafeBridgeName, type BridgeToolDef } from "./provider-mcp.js";
1
+ /** A Pi tool projected for agy: MCP-safe advertised name, real Pi identity. */
2
+ export interface BridgeToolDef {
3
+ name: string;
4
+ piName: string;
5
+ description: string;
6
+ inputSchema: Record<string, unknown>;
7
+ }
8
+
9
+ /** MCP tool names: [a-zA-Z0-9_-]{1,64}. Pi names are sanitized into that. */
10
+ function toSafeBridgeName(name: string): string {
11
+ const safe = name
12
+ .replace(/[^a-zA-Z0-9_-]+/g, "_")
13
+ .replace(/^_+|_+$/g, "")
14
+ .slice(0, 64);
15
+ return safe || "tool";
16
+ }
2
17
 
3
18
  /** Pi tool source shape (structural subset of Pi's ToolInfo). */
4
19
  export interface ProviderToolSource {
@@ -42,11 +42,8 @@ export {
42
42
  } from "./provider-prompt.js";
43
43
 
44
44
  import { withDirLock } from "./lock.js";
45
- import {
46
- startMcpBridge,
47
- type BridgeToolDef,
48
- type McpBridgeHandle,
49
- } from "./provider-mcp.js";
45
+ import type { McpBridgeHandle } from "./provider-mcp.js";
46
+ import type { BridgeToolDef } from "./provider-tools.js";
50
47
  import { getSession, saveSession } from "./sessions.js";
51
48
  import { AgyProviderDriver, PROVIDER_TURN_TIMEOUT_MS } from "./provider-driver.js";
52
49
  import {
@@ -303,6 +300,8 @@ async function ensureProviderBridge(dir: string): Promise<McpBridgeHandle | unde
303
300
  try {
304
301
  const config = await loadAgyConfig();
305
302
  if (config.providerBridge !== false) {
303
+ // Keep the bridge and its MCP SDK off the extension startup path.
304
+ const { startMcpBridge } = await import("./provider-mcp.js");
306
305
  handle = await startMcpBridge(dir);
307
306
  }
308
307
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juanbenjumea/pi-agy",
3
- "version": "0.7.13",
3
+ "version": "0.7.14",
4
4
  "description": "Antigravity (agy) provider and delegation for Pi — /model picker, background tasks, loopback MCP tool bridge, quota awareness, and repo verification.",
5
5
  "type": "module",
6
6
  "license": "MIT",