pi-antigravity-bridge 0.1.0 → 0.1.1

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,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.1] - 2026-11-21
4
+
5
+ ### Changed
6
+
7
+ - 改进多步工具调用期间的流式事件采样与分步 Token 归因,支持实时与单步 TPS 统计并在工具执行途中持续保持缓存命中率与上下文窗口进度同步。
8
+ - 校准 Gemini 系列模型的初始上下文窗口上限,并在收到实时窗口回报时立即更新活跃模型窗口容量。
9
+ - 对齐 `/agy mode` 命令补全及选择列表中的默认模式提示说明。
10
+
11
+ ### Fixed
12
+
13
+ - 修复多步工具调用结束时将整轮累计 Token 写入单条消息导致上下文窗口占用率虚高及误触发自动压缩的问题。
14
+ - 修复 `agy-tools` 模式下开启 `bridgePiMcp` 时宿主 MCP 相关工具未被纳入激活列表的问题。
15
+ - 修复 `agy-tools` 模式下省略显式完成事件时的镜像工具等待挂起问题,以及 `hybrid` 模式下省略标题的工具更新事件路由偏差。
16
+ - 修复交互式 TUI 下执行 `/agy login` 未先释放终端的问题。
17
+ - 修复 `processPerSession: false` 时 Stdio 转发桥串行阻塞并发工具调用的问题。
18
+ - 修复跨模型切换同名思考档位漏同步、导入历史会话首次恢复未命中、辅助请求进程复用及子进程管道异常防护等边界问题。
19
+
3
20
  ## [0.1.0] - 2026-11-21
4
21
 
5
22
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-antigravity-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Google Antigravity CLI (agy acp) agent backend bridge for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,6 +3,7 @@ import * as crypto from "node:crypto";
3
3
  import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
5
  import { StringDecoder } from "node:string_decoder";
6
+ import { fileURLToPath } from "node:url";
6
7
  import type { BridgeConfig } from "../config.ts";
7
8
  import { resolveEffectiveFlags } from "../config.ts";
8
9
  import { type ResolvedBinary, resolveAgyBinary } from "./binary-resolver.ts";
@@ -22,7 +23,7 @@ import {
22
23
 
23
24
  export const BRIDGE_AGENT_NAME = "pi-bridge";
24
25
  export const CLIENT_INFO_NAME = "pi-antigravity-bridge";
25
- export const CLIENT_INFO_VERSION = "0.1.0";
26
+ export const CLIENT_INFO_VERSION = "0.1.1";
26
27
 
27
28
  export class AcpRpcError extends Error {
28
29
  readonly code: number;
@@ -161,12 +162,36 @@ function resolveManagedAgentMaterialization(
161
162
  }
162
163
  yamlLines.push("---", "");
163
164
 
164
- const desired = yamlLines.join("\n");
165
+ let desired = yamlLines.join("\n");
166
+ if (agentName === BRIDGE_AGENT_NAME) {
167
+ try {
168
+ const bundledAssetPath = path.resolve(
169
+ path.dirname(fileURLToPath(import.meta.url)),
170
+ "..",
171
+ "..",
172
+ "assets",
173
+ "agents",
174
+ "pi-bridge.md",
175
+ );
176
+ if (fs.existsSync(bundledAssetPath)) {
177
+ desired = fs.readFileSync(bundledAssetPath, "utf8");
178
+ }
179
+ } catch {
180
+ // 回退内存生成的同构 YAML
181
+ }
182
+ }
183
+
184
+ const agentsRoot = path.join(profile.geminiDir, "config", "agents");
165
185
  try {
166
186
  if (!fs.existsSync(agentFile) || fs.readFileSync(agentFile, "utf8") !== desired) {
167
187
  fs.mkdirSync(agentDir, { recursive: true });
168
188
  fs.writeFileSync(agentFile, desired, "utf8");
189
+ } else {
190
+ // 刷新目录修改时间供惰性 LRU 保留近期活跃配置
191
+ const now = new Date();
192
+ fs.utimesSync(agentDir, now, now);
169
193
  }
194
+ pruneOldManagedAgentDirs(agentsRoot, agentName);
170
195
  } catch {
171
196
  // 目录只读时忽略写入异常
172
197
  }
@@ -177,6 +202,37 @@ function resolveManagedAgentMaterialization(
177
202
  };
178
203
  }
179
204
 
205
+ function pruneOldManagedAgentDirs(agentsRoot: string, activeName: string, maxHashedDirs = 16): void {
206
+ try {
207
+ if (!fs.existsSync(agentsRoot)) return;
208
+ const prefix = `${BRIDGE_AGENT_NAME}-`;
209
+ const entries = fs
210
+ .readdirSync(agentsRoot, { withFileTypes: true })
211
+ .filter((e) => e.isDirectory() && e.name.startsWith(prefix) && e.name !== activeName)
212
+ .map((e) => {
213
+ const full = path.join(agentsRoot, e.name);
214
+ let mtimeMs = 0;
215
+ try {
216
+ mtimeMs = fs.statSync(full).mtimeMs;
217
+ } catch {
218
+ // 忽略
219
+ }
220
+ return { full, mtimeMs };
221
+ })
222
+ .sort((a, b) => b.mtimeMs - a.mtimeMs);
223
+
224
+ for (let i = maxHashedDirs; i < entries.length; i++) {
225
+ try {
226
+ fs.rmSync(entries[i].full, { recursive: true, force: true });
227
+ } catch {
228
+ // 忽略
229
+ }
230
+ }
231
+ } catch {
232
+ // 忽略
233
+ }
234
+ }
235
+
180
236
  function appendNoProxyLoopback(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
181
237
  const result: NodeJS.ProcessEnv = { ...env };
182
238
  const existing = env.NO_PROXY || env.no_proxy || "";
@@ -253,9 +309,14 @@ export class AcpClientConnection {
253
309
  env: appendNoProxyLoopback(env),
254
310
  stdio: ["pipe", "pipe", "pipe"],
255
311
  shell: binary.isWindowsWrapperScript,
312
+ detached: process.platform !== "win32",
256
313
  windowsHide: true,
257
314
  });
258
315
 
316
+ this.proc.stdin.on("error", () => {
317
+ // 子进程意外退出时忽略底层管道异步 EPIPE,交由 proc close/error 统一拒绝在途请求
318
+ });
319
+
259
320
  const stdoutDecoder = new StringDecoder("utf8");
260
321
  const parser = new NdjsonLineParser((msg) => this.handleIncomingMessage(msg));
261
322
 
@@ -415,7 +476,6 @@ export class AcpClientConnection {
415
476
  /** 优雅关闭连接、清理临时挂载 Agent 描述并在超时后回收跨平台子进程树 */
416
477
  async dispose(): Promise<void> {
417
478
  if (this.closed) {
418
- this.cleanupManagedAgentDir();
419
479
  return;
420
480
  }
421
481
  const sessions = Array.from(this.activeSessions);
@@ -451,16 +511,16 @@ export class AcpClientConnection {
451
511
  }
452
512
 
453
513
  this.closed = true;
454
- this.cleanupManagedAgentDir();
455
- }
456
-
457
- private cleanupManagedAgentDir(): void {
458
- if (!this.managedAgentDir) return;
459
514
  try {
460
- fs.rmSync(this.managedAgentDir, { recursive: true, force: true });
515
+ this.proc.stdin.destroy();
516
+ this.proc.stdout.destroy();
517
+ this.proc.stderr.destroy();
518
+ this.proc.unref();
461
519
  } catch {
462
- // 忽略清理异常
520
+ // 忽略流释放异常
463
521
  }
522
+ // 保留确定性哈希目录 pi-bridge-<hash>,避免并发运行的多个 Pi 进程误删彼此正在使用的配置目录
523
+ void this.managedAgentDir;
464
524
  }
465
525
 
466
526
  private forceKillProcessTree(): void {
@@ -484,24 +544,32 @@ export class AcpClientConnection {
484
544
  return;
485
545
  }
486
546
 
487
- try {
488
- this.proc.kill("SIGTERM");
489
- setTimeout(() => {
547
+ const sendPosixGroupOrPid = (sig: NodeJS.Signals) => {
548
+ try {
549
+ process.kill(-pid, sig);
550
+ } catch {
490
551
  try {
491
- if (this.proc.exitCode === null) {
492
- this.proc.kill("SIGKILL");
493
- }
552
+ this.proc.kill(sig);
494
553
  } catch {
495
- // 忽略
554
+ // 忽略已退出进程
496
555
  }
497
- }, 500).unref();
498
- } catch {
499
- // 忽略
500
- }
556
+ }
557
+ };
558
+
559
+ sendPosixGroupOrPid("SIGTERM");
560
+ setTimeout(() => {
561
+ if (this.proc.exitCode === null) {
562
+ sendPosixGroupOrPid("SIGKILL");
563
+ }
564
+ }, 500).unref();
501
565
  }
502
566
 
503
567
  private writeJson(payload: unknown): void {
504
568
  try {
569
+ if (this.closed || this.proc.stdin.destroyed || !this.proc.stdin.writable) {
570
+ this.failAllPending(new Error("Antigravity ACP stdin 不可写"));
571
+ return;
572
+ }
505
573
  this.proc.stdin.write(`${JSON.stringify(payload)}\n`);
506
574
  } catch (error) {
507
575
  this.failAllPending(error);
@@ -84,16 +84,13 @@ export function inferModelSpecs(modelId: string): {
84
84
  supportsImage: true,
85
85
  };
86
86
  }
87
- if (lower.includes("gemini-4-neon") || lower.includes("gemini-4-hydrogen")) {
87
+ if (
88
+ lower.includes("gemini-4-") ||
89
+ lower.includes("gemini-3") ||
90
+ lower.includes("orchestrator")
91
+ ) {
88
92
  return {
89
- contextWindow: observed ?? 512_000,
90
- maxTokens: 65_536,
91
- supportsImage: true,
92
- };
93
- }
94
- if (lower.includes("gemini-4-") || lower.includes("gemini-3") || lower.includes("orchestrator")) {
95
- return {
96
- contextWindow: observed ?? 1_000_000,
93
+ contextWindow: observed ?? 1_048_576,
97
94
  maxTokens: 65_536,
98
95
  supportsImage: true,
99
96
  };
@@ -319,7 +316,7 @@ export function writeCachedCatalog(
319
316
  }
320
317
  }
321
318
 
322
- function removeEmptyProbeSessionFiles(config: BridgeConfig, sessionId: string): void {
319
+ export function removeEmptyProbeSessionFiles(config: BridgeConfig, sessionId: string): void {
323
320
  const convDir = resolveAgyConversationsDir(config);
324
321
  for (const suffix of [".db", ".db-wal", ".db-shm", ".db-journal"]) {
325
322
  try {
package/src/index.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
+ import * as fs from "node:fs";
3
+ import * as path from "node:path";
2
4
  import type { OAuthCredentials, OAuthLoginCallbacks } from "@earendil-works/pi-ai";
3
5
  import type {
4
6
  ExtensionAPI,
@@ -17,7 +19,7 @@ import {
17
19
  probeLiveAntigravityCatalog,
18
20
  readCachedCatalog,
19
21
  } from "./catalog/model-discovery.ts";
20
- import { loadBridgeConfig } from "./config.ts";
22
+ import { loadBridgeConfig, resolvePiAgentDir } from "./config.ts";
21
23
  import { discoverAgySkillDirectoriesForPi } from "./session/customization-mounter.ts";
22
24
  import { extractVisibleMessages } from "./session/reconcile.ts";
23
25
  import { TurnCoordinator } from "./session/turn-coordinator.ts";
@@ -35,6 +37,49 @@ import { updateAntigravityStatusBar } from "./ui/status-bar.ts";
35
37
  const SENTINEL_API_KEY = "agy-managed";
36
38
  const TEN_YEARS_MS = 10 * 365 * 24 * 60 * 60 * 1000;
37
39
 
40
+ /**
41
+ * 读取 Pi 的 `trust.json` 判断指定工作目录在 `resources_discover` 早期阶段是否已被授予项目信任。
42
+ */
43
+ function checkProjectTrustedFromStore(cwd: string): boolean {
44
+ try {
45
+ const trustFile = path.join(resolvePiAgentDir(), "trust.json");
46
+ if (!fs.existsSync(trustFile)) return false;
47
+ const parsed: unknown = JSON.parse(fs.readFileSync(trustFile, "utf8"));
48
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return false;
49
+ const store = parsed as Record<string, unknown>;
50
+ const isWin = process.platform === "win32";
51
+ const norm = (p: string) => {
52
+ let resolved = p;
53
+ try {
54
+ resolved = fs.realpathSync(p);
55
+ } catch {
56
+ resolved = path.resolve(p);
57
+ }
58
+ return isWin ? resolved.toLowerCase() : resolved;
59
+ };
60
+
61
+ const normalizedStore = new Map<string, boolean>();
62
+ for (const [k, v] of Object.entries(store)) {
63
+ if (typeof v === "boolean") {
64
+ normalizedStore.set(norm(k), v);
65
+ }
66
+ }
67
+
68
+ let current = norm(cwd);
69
+ while (true) {
70
+ const decision = normalizedStore.get(current);
71
+ if (typeof decision === "boolean") {
72
+ return decision;
73
+ }
74
+ const parent = path.dirname(current);
75
+ if (parent === current) return false;
76
+ current = parent;
77
+ }
78
+ } catch {
79
+ return false;
80
+ }
81
+ }
82
+
38
83
  /**
39
84
  * Pi × Antigravity ACP 桥接扩展主入口。
40
85
  */
@@ -104,11 +149,22 @@ export default function antigravityBridgeExtension(pi: ExtensionAPI): void {
104
149
  };
105
150
  }
106
151
  } catch {
107
- // 未登录或探测失败时引导终端登录
152
+ // 未登录或探测失败时继续后续引导
153
+ }
154
+
155
+ const activeCtx = coordinator.getActiveContext();
156
+ if (activeCtx?.mode === "tui") {
157
+ throw new Error(
158
+ "当前处于交互式 TUI 面板,请按 Esc 返回后执行 `/agy login`(自动安全释放并恢复终端完成登录),或在独立终端运行 `agy acp --login`。",
159
+ );
108
160
  }
109
161
 
162
+ const spawnCmd =
163
+ bin.isWindowsWrapperScript && bin.binPath.includes(" ")
164
+ ? `"${bin.binPath}"`
165
+ : bin.binPath;
110
166
  const res = spawnSync(
111
- bin.binPath,
167
+ spawnCmd,
112
168
  ["acp", "--login", "--gemini-dir", coordinator.config.geminiDir],
113
169
  {
114
170
  stdio: "inherit",
@@ -177,7 +233,11 @@ export default function antigravityBridgeExtension(pi: ExtensionAPI): void {
177
233
 
178
234
  // 4. 注册可选的反向 AGY Skills 发现钩子
179
235
  pi.on("resources_discover", (event) => {
180
- const cfg = loadBridgeConfig({ cwd: event.cwd, isProjectTrusted: false });
236
+ const isTrusted =
237
+ coordinator.getActiveContext()?.cwd === event.cwd
238
+ ? (coordinator.getActiveContext()?.isProjectTrusted() ?? false)
239
+ : checkProjectTrustedFromStore(event.cwd);
240
+ const cfg = loadBridgeConfig({ cwd: event.cwd, isProjectTrusted: isTrusted });
181
241
  const skillDirs = discoverAgySkillDirectoriesForPi(cfg, event.cwd);
182
242
  if (skillDirs.length === 0) {
183
243
  return undefined;
@@ -5,10 +5,12 @@ import { fileURLToPath } from "node:url";
5
5
  /**
6
6
  * 纯 Node.js 标准库实现的跨平台 Stdio-to-HTTP MCP 转发桥。
7
7
  * 当用户显式设置 `processPerSession: false` 时,作为零 `nc` 依赖的跨平台 Stdio MCP 入口回连宿主本地 HTTP MCP 服务。
8
+ * 支持多路并发 JSON-RPC 请求同时在途,避免单个 Park-and-Yield 工具挂起阻塞并发工具调用或心跳。
8
9
  */
9
10
  export async function runStdioToHttpMcpShim(targetUrl: string, bearerToken: string): Promise<void> {
10
11
  const decoder = new StringDecoder("utf8");
11
12
  let buffer = "";
13
+ const inflight = new Set<Promise<void>>();
12
14
 
13
15
  const forwardLine = async (line: string): Promise<void> => {
14
16
  let parsed: Record<string, unknown>;
@@ -48,7 +50,13 @@ export async function runStdioToHttpMcpShim(targetUrl: string, bearerToken: stri
48
50
  }
49
51
  };
50
52
 
51
- let chain = Promise.resolve();
53
+ const dispatchLine = (line: string): void => {
54
+ const task = forwardLine(line).finally(() => {
55
+ inflight.delete(task);
56
+ });
57
+ inflight.add(task);
58
+ };
59
+
52
60
  process.stdin.on("data", (chunk: Buffer) => {
53
61
  buffer += decoder.write(chunk);
54
62
  let idx = buffer.indexOf("\n");
@@ -56,7 +64,7 @@ export async function runStdioToHttpMcpShim(targetUrl: string, bearerToken: stri
56
64
  const line = buffer.slice(0, idx).trim();
57
65
  buffer = buffer.slice(idx + 1);
58
66
  if (line.length > 0) {
59
- chain = chain.then(() => forwardLine(line));
67
+ dispatchLine(line);
60
68
  }
61
69
  idx = buffer.indexOf("\n");
62
70
  }
@@ -65,12 +73,12 @@ export async function runStdioToHttpMcpShim(targetUrl: string, bearerToken: stri
65
73
  process.stdin.on("end", () => {
66
74
  const rest = (buffer + decoder.end()).trim();
67
75
  if (rest.length > 0) {
68
- chain = chain.then(() => forwardLine(rest));
76
+ dispatchLine(rest);
69
77
  }
70
78
  });
71
79
  }
72
80
 
73
- /** 生成一段内联 Node.js 启动脚本参数,使宿主无需依赖额外编译产物即可在任意平台启动 Stdio 转发桥 */
81
+ /** 生成一段内联 Node.js 启动脚本参数,使宿主无需依赖额外编译产物即可在任意平台启动并发 Stdio 转发桥 */
74
82
  export function buildInlineStdioShimCommand(
75
83
  targetUrl: string,
76
84
  bearerToken: string,
@@ -79,7 +87,6 @@ export function buildInlineStdioShimCommand(
79
87
  'const url = process.env.PI_AGY_MCP_URL;',
80
88
  'const token = process.env.PI_AGY_MCP_TOKEN;',
81
89
  'let buf = "";',
82
- 'let q = Promise.resolve();',
83
90
  'async function send(line) {',
84
91
  ' let msg; try { msg = JSON.parse(line); } catch { return; }',
85
92
  ' const hasId = msg && msg.id !== undefined;',
@@ -91,14 +98,17 @@ export function buildInlineStdioShimCommand(
91
98
  ' if (hasId) process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id: msg.id, error: { code: -32603, message: String(e) } }) + "\\n");',
92
99
  ' }',
93
100
  '}',
94
- 'process.stdin.setEncoding("utf8");',
95
- 'process.stdin.on("data", (c) => {',
96
- ' buf += c; let i;',
101
+ 'function drain(flushAll) {',
102
+ ' let i;',
97
103
  ' while ((i = buf.indexOf("\\n")) !== -1) {',
98
104
  ' const l = buf.slice(0, i).trim(); buf = buf.slice(i + 1);',
99
- ' if (l) q = q.then(() => send(l));',
105
+ ' if (l) void send(l);',
100
106
  ' }',
101
- '});',
107
+ ' if (flushAll) { const r = buf.trim(); buf = ""; if (r) void send(r); }',
108
+ '}',
109
+ 'process.stdin.setEncoding("utf8");',
110
+ 'process.stdin.on("data", (c) => { buf += c; drain(false); });',
111
+ 'process.stdin.on("end", () => drain(true));',
102
112
  ].join(" ");
103
113
 
104
114
  return {
@@ -107,7 +117,8 @@ export function buildInlineStdioShimCommand(
107
117
  env: [
108
118
  { name: "PI_AGY_MCP_URL", value: targetUrl },
109
119
  { name: "PI_AGY_MCP_TOKEN", value: bearerToken },
110
- { name: "NO_PROXY", value: "127.0.0.1,localhost" },
120
+ { name: "NO_PROXY", value: "127.0.0.1,localhost,::1" },
121
+ { name: "no_proxy", value: "127.0.0.1,localhost,::1" },
111
122
  ],
112
123
  };
113
124
  }
@@ -33,6 +33,8 @@ export interface AgySessionAnchor {
33
33
  mountDigest: string;
34
34
  /** 暴露给宿主的 MCP 工具表指纹 */
35
35
  toolsDigest: string;
36
+ /** 是否为通过 `/agy sessions` 刚导入尚未经历首轮请求对齐的原始会话锚点 */
37
+ importedRaw?: boolean;
36
38
  /** 可选的本地 SQLite 会话数据库检查点水位 */
37
39
  dbCheckpoint?: SqliteDbCheckpoint;
38
40
  }
@@ -87,7 +89,8 @@ export function findBranchAnchorForHistory(options: {
87
89
 
88
90
  const anchor = custom.data;
89
91
  if (anchor.version !== 1 || !anchor.agySessionId) continue;
90
- if (anchor.toolMode !== toolMode || anchor.mountDigest !== mountDigest) continue;
92
+ if (anchor.toolMode !== toolMode) continue;
93
+ if (!anchor.importedRaw && anchor.mountDigest !== mountDigest) continue;
91
94
  if (!hasLocalConversationDb(config, anchor.agySessionId)) continue;
92
95
 
93
96
  if (
@@ -380,10 +380,41 @@ function buildPureModeWorkspaceContextBlock(params: {
380
380
  }
381
381
  }
382
382
 
383
- blocks.push("</workspace_context>");
383
+ blocks.push("</workspace_context>", "");
384
384
  return blocks.join("\n");
385
385
  }
386
386
 
387
+ function pruneOldMountCacheDirs(mountsRoot: string, keepDirName: string, maxEntries = 16): void {
388
+ try {
389
+ if (!fs.existsSync(mountsRoot)) return;
390
+ const entries = fs
391
+ .readdirSync(mountsRoot, { withFileTypes: true })
392
+ .filter((e) => e.isDirectory() && e.name.startsWith("pi-mount-") && e.name !== keepDirName)
393
+ .map((e) => {
394
+ const full = path.join(mountsRoot, e.name);
395
+ let mtimeMs = 0;
396
+ try {
397
+ mtimeMs = fs.statSync(full).mtimeMs;
398
+ } catch {
399
+ // 忽略
400
+ }
401
+ return { full, mtimeMs };
402
+ })
403
+ .sort((a, b) => b.mtimeMs - a.mtimeMs);
404
+
405
+ for (let i = maxEntries - 1; i < entries.length; i++) {
406
+ if (i < 0) continue;
407
+ try {
408
+ fs.rmSync(entries[i].full, { recursive: true, force: true });
409
+ } catch {
410
+ // 忽略并发清理异常
411
+ }
412
+ }
413
+ } catch {
414
+ // 忽略
415
+ }
416
+ }
417
+
387
418
  /**
388
419
  * 构建会话级规则与技能挂载状态:
389
420
  * - `pi-tools` 纯净模式:生成结构化 `workspaceContextBlock` 供首条用户消息携带,并授权外部技能目录可读。
@@ -486,17 +517,19 @@ export function prepareCustomizationMount(
486
517
 
487
518
  const shortHash = mountDigest.slice(0, 12);
488
519
  const mountsRoot = path.join(resolvePiAgentDir(env), "cache", "antigravity-mounts");
489
- const pluginDir = path.join(mountsRoot, `pi-mount-${shortHash}`);
520
+ const pluginDirName = `pi-mount-${shortHash}`;
521
+ const pluginDir = path.join(mountsRoot, pluginDirName);
490
522
 
491
523
  const manifestJson = `${JSON.stringify(
492
524
  {
493
- name: `pi-mount-${shortHash}`,
494
- version: "0.1.0",
525
+ name: pluginDirName,
526
+ version: "0.1.1",
495
527
  },
496
528
  null,
497
529
  2,
498
530
  )}\n`;
499
531
  writeFileIfChanged(path.join(pluginDir, "plugin.json"), manifestJson);
532
+ pruneOldMountCacheDirs(mountsRoot, pluginDirName);
500
533
 
501
534
  const skillsJsonPath = path.join(pluginDir, "skills.json");
502
535
  if (skillEntries.length > 0) {