personal-bot 0.3.3 → 0.3.5

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.
Files changed (71) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +2 -2
  4. package/README.zh-CN.md +2 -2
  5. package/bin/pbot.mjs +3 -17
  6. package/docs/architecture/design.md +8 -6
  7. package/docs/architecture/extensibility.md +21 -0
  8. package/docs/architecture/principles.md +1 -1
  9. package/docs/guides/workspace-configuration.md +13 -0
  10. package/lib/antigravity-plugin/lib/common/paths.d.ts +1 -0
  11. package/lib/antigravity-plugin/lib/common/paths.js +2 -0
  12. package/lib/antigravity-plugin/lib/extension/acp-worker.js +26 -24
  13. package/lib/antigravity-plugin/lib/extension/cli.js +22596 -0
  14. package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +9 -2
  15. package/lib/antigravity-plugin/lib/extension/mcp.js +22 -20
  16. package/lib/antigravity-plugin/lib/extension/workspace-cli.js +5 -20121
  17. package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +12 -0
  18. package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +52 -4
  19. package/lib/antigravity-plugin/package.json +1 -1
  20. package/lib/antigravity-plugin/plugin.json +1 -1
  21. package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
  22. package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
  23. package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
  24. package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +1 -1
  25. package/lib/common/paths.d.ts +1 -0
  26. package/lib/common/paths.js +2 -0
  27. package/lib/extension/acp-worker.js +26 -24
  28. package/lib/extension/cli.js +22596 -0
  29. package/lib/extension/hosts/plugin-runtime.js +9 -2
  30. package/lib/extension/mcp.js +22 -20
  31. package/lib/extension/workspace-cli.js +5 -20121
  32. package/lib/qoder-plugin/.mcp.json +2 -2
  33. package/lib/qoder-plugin/.qoder-plugin/plugin.json +1 -1
  34. package/lib/qoder-plugin/hooks/hooks.json +3 -3
  35. package/lib/qoder-plugin/skills/pbot/SKILL.md +1 -1
  36. package/lib/services/workspace/plugin-releases.d.ts +12 -0
  37. package/lib/services/workspace/plugin-releases.js +52 -4
  38. package/package.json +1 -1
  39. package/scripts/README.md +1 -1
  40. package/src/common/paths.ts +2 -0
  41. package/src/extension/cli/args.ts +104 -0
  42. package/src/extension/cli/commands/history.ts +81 -0
  43. package/src/extension/cli/commands/mcp.ts +165 -0
  44. package/src/extension/cli/commands/plugin.ts +33 -0
  45. package/src/extension/cli/commands/setup.ts +159 -0
  46. package/src/extension/cli/commands/upgrade.ts +158 -0
  47. package/src/extension/cli/commands/workspace.ts +71 -0
  48. package/src/extension/cli/index.ts +193 -0
  49. package/src/extension/cli/types.ts +30 -0
  50. package/src/extension/hosts/plugin-runtime.ts +9 -2
  51. package/src/integrations/installation/cli-update.ts +31 -3
  52. package/src/integrations/installation/pi-setup.ts +6 -3
  53. package/src/integrations/installation/upgraders/antigravity.ts +68 -0
  54. package/src/integrations/installation/upgraders/claude.ts +123 -0
  55. package/src/integrations/installation/upgraders/codex.ts +73 -0
  56. package/src/integrations/installation/upgraders/dsh.ts +63 -0
  57. package/src/integrations/installation/upgraders/pi.ts +87 -0
  58. package/src/integrations/installation/upgraders/qoder.ts +68 -0
  59. package/src/integrations/installation/upgraders/registry.ts +48 -0
  60. package/src/model/installation.ts +45 -0
  61. package/src/services/installation/setup-service.ts +0 -30
  62. package/src/services/installation/upgrade-service.ts +127 -0
  63. package/src/services/workspace/plugin-releases.ts +57 -4
  64. package/lib/extension/setup/cli.js +0 -352
  65. package/lib/integrations/installation/pi-setup.js +0 -193
  66. package/lib/integrations/installation/processes.js +0 -140
  67. package/lib/integrations/installation/workspace.js +0 -21
  68. package/lib/services/installation/setup-service.js +0 -137
  69. package/lib/ui/setup.js +0 -52
  70. package/src/extension/setup/cli.ts +0 -296
  71. package/src/extension/setup/workspace-cli.ts +0 -159
@@ -1,3 +1,15 @@
1
1
  /** Each host owns its file, including when two hosts activate the same canonical workspace concurrently. */
2
2
  export declare function bindWorkspacePlugin(root: string, host: string, binding?: string): void;
3
+ export interface WorkspacePluginBinding {
4
+ version: string;
5
+ bindingPath?: string;
6
+ }
7
+ export interface WorkspacePluginDrift {
8
+ outOfSync: boolean;
9
+ highest?: string;
10
+ lowest?: string;
11
+ versions: Record<string, string>;
12
+ }
13
+ export declare function workspacePluginBindings(root: string): Record<string, WorkspacePluginBinding>;
3
14
  export declare function workspacePluginReleases(root: string): Record<string, string>;
15
+ export declare function workspacePluginDrift(releases: Record<string, string>): WorkspacePluginDrift;
@@ -7,6 +7,31 @@ import { resourceRoot } from "../../common/paths.js";
7
7
  import { requireThat } from "../../common/validation.js";
8
8
  import { releaseLine } from "../../common/version.js";
9
9
  import { readJsonFile, writeJsonFile } from "../../storage/atomic-json.js";
10
+ function compareSemver(a, b) {
11
+ const parse = (value) => {
12
+ const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?/.exec(value);
13
+ return match
14
+ ? { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]), pre: match[4] ?? "" }
15
+ : undefined;
16
+ };
17
+ const left = parse(a);
18
+ const right = parse(b);
19
+ if (!left || !right)
20
+ return a.localeCompare(b);
21
+ if (left.major !== right.major)
22
+ return left.major - right.major;
23
+ if (left.minor !== right.minor)
24
+ return left.minor - right.minor;
25
+ if (left.patch !== right.patch)
26
+ return left.patch - right.patch;
27
+ if (left.pre === right.pre)
28
+ return 0;
29
+ if (!left.pre)
30
+ return 1;
31
+ if (!right.pre)
32
+ return -1;
33
+ return left.pre.localeCompare(right.pre);
34
+ }
10
35
  function bindingDirectory(root) {
11
36
  const key = createHash("sha256").update(root).digest("hex");
12
37
  return join(homedir(), ".pbot", "workspaces", key);
@@ -44,7 +69,7 @@ export function bindWorkspacePlugin(root, host, binding = resolve(resourceRoot,
44
69
  throw error;
45
70
  }
46
71
  }
47
- export function workspacePluginReleases(root) {
72
+ export function workspacePluginBindings(root) {
48
73
  const directory = bindingDirectory(root);
49
74
  let files;
50
75
  try {
@@ -55,24 +80,47 @@ export function workspacePluginReleases(root) {
55
80
  return {};
56
81
  throw error;
57
82
  }
58
- const releases = Object.create(null);
83
+ const bindings = Object.create(null);
59
84
  for (const file of files.filter(name => name.endsWith(".json"))) {
60
85
  const host = decodeURIComponent(file.slice(0, -5));
61
86
  try {
62
87
  const binding = readJsonFile(directory, file, pluginBinding);
63
88
  if (!isAbsolute(binding)) {
64
- releases[host] = binding;
89
+ bindings[host] = { version: binding };
65
90
  continue;
66
91
  }
67
92
  const manifest = JSON.parse(readFileSync(binding, "utf8"));
68
93
  requireThat(object(manifest) && typeof manifest.version === "string", "无效的插件安装清单:" + binding);
69
94
  releaseLine(manifest.version);
70
- releases[host] = manifest.version;
95
+ bindings[host] = { version: manifest.version, bindingPath: binding };
71
96
  }
72
97
  catch (error) {
73
98
  if (error.code !== "ENOENT" && !permissionDenied(error))
74
99
  throw error;
75
100
  }
76
101
  }
102
+ return bindings;
103
+ }
104
+ export function workspacePluginReleases(root) {
105
+ const bindings = workspacePluginBindings(root);
106
+ const releases = Object.create(null);
107
+ for (const [host, entry] of Object.entries(bindings))
108
+ releases[host] = entry.version;
77
109
  return releases;
78
110
  }
111
+ export function workspacePluginDrift(releases) {
112
+ let highest;
113
+ let lowest;
114
+ for (const version of Object.values(releases)) {
115
+ if (!highest || compareSemver(version, highest) > 0)
116
+ highest = version;
117
+ if (!lowest || compareSemver(version, lowest) < 0)
118
+ lowest = version;
119
+ }
120
+ return {
121
+ outOfSync: Boolean(highest && lowest && highest !== lowest),
122
+ ...(highest ? { highest } : {}),
123
+ ...(lowest ? { lowest } : {}),
124
+ versions: releases,
125
+ };
126
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "personal-bot-antigravity-plugin",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "private": true
6
6
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "personal-bot",
3
3
  "displayName": "Personal Bot",
4
- "version": "0.3.3",
4
+ "version": "0.3.5",
5
5
  "description": "Workspace materials, skills, and cross-harness MCP worker delegation.",
6
6
  "repository": "https://github.com/realqiyan/personal-bot"
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "personal-bot",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Personal Bot workspace context and cross-harness workers.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./.mcp.json"
@@ -4,13 +4,13 @@
4
4
  "command": "sh",
5
5
  "args": [
6
6
  "-c",
7
- "if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"",
7
+ "if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.5 \"$@\"",
8
8
  "pbot",
9
9
  "mcp"
10
10
  ],
11
11
  "env": {
12
12
  "PBOT_HOST": "codex",
13
- "PBOT_PLUGIN_VERSION": "0.3.3"
13
+ "PBOT_PLUGIN_VERSION": "0.3.5"
14
14
  }
15
15
  }
16
16
  }
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin codex hook",
8
+ "command": "PBOT_PLUGIN_VERSION=0.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.5 \"$@\"' pbot plugin codex hook",
9
9
  "timeout": 120
10
10
  }
11
11
  ]
@@ -16,7 +16,7 @@
16
16
  "hooks": [
17
17
  {
18
18
  "type": "command",
19
- "command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin codex hook",
19
+ "command": "PBOT_PLUGIN_VERSION=0.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.5 \"$@\"' pbot plugin codex hook",
20
20
  "timeout": 120
21
21
  }
22
22
  ]
@@ -27,7 +27,7 @@
27
27
  "hooks": [
28
28
  {
29
29
  "type": "command",
30
- "command": "PBOT_PLUGIN_VERSION=0.3.3 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.3 \"$@\"' pbot plugin codex hook",
30
+ "command": "PBOT_PLUGIN_VERSION=0.3.5 PBOT_PLUGIN_MANIFEST=\"${PLUGIN_ROOT:+$PLUGIN_ROOT/.codex-plugin/plugin.json}\" sh -c 'if pbot --at-least 0.3.3 </dev/null >/dev/null 2>&1; then exec pbot \"$@\"; fi\nexec npx --yes --ignore-scripts --prefer-offline personal-bot@0.3.5 \"$@\"' pbot plugin codex hook",
31
31
  "timeout": 120
32
32
  }
33
33
  ]
@@ -6,4 +6,4 @@ disable-model-invocation: true
6
6
 
7
7
  使用当前会话的 `workspaceRoot` 作为 `--workspace`。省略子命令时使用 `status`。可执行 `init`、`status`、`history status|list|summary|migrate|search|read`。保留用户指定的维度、模型和筛选参数。
8
8
 
9
- 运行 `npx --yes personal-bot@0.3.3 <子命令> --workspace "<workspaceRoot>"`。如果 `pbot --at-least 0.3.3` 返回 0,也可以用 `pbot` 执行同一条命令。返回实际结果。
9
+ 运行 `npx --yes personal-bot@0.3.5 <子命令> --workspace "<workspaceRoot>"`。如果 `pbot --at-least 0.3.5` 返回 0,也可以用 `pbot` 执行同一条命令。返回实际结果。
@@ -1 +1,2 @@
1
1
  export declare const resourceRoot: string;
2
+ export declare const packageRoot: string;
@@ -1,2 +1,4 @@
1
+ import { resolve } from "node:path";
1
2
  import { fileURLToPath } from "node:url";
2
3
  export const resourceRoot = fileURLToPath(new URL("../../resources/", import.meta.url));
4
+ export const packageRoot = resolve(resourceRoot, "..");
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/extension/acp/worker.ts
8
8
  import { randomUUID as randomUUID5 } from "node:crypto";
9
- import { dirname as dirname4, join as join11, resolve as resolve5 } from "node:path";
9
+ import { dirname as dirname4, join as join11, resolve as resolve6 } from "node:path";
10
10
 
11
11
  // src/storage/agent-files.ts
12
12
  import { existsSync, mkdirSync as mkdirSync3, readdirSync, rmSync } from "node:fs";
@@ -4000,7 +4000,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
4000
4000
  var NONE = 0;
4001
4001
  var ASSUMED = 1;
4002
4002
  var PROVEN = 2;
4003
- function isRecursive(inst, stack, resolve6) {
4003
+ function isRecursive(inst, stack, resolve7) {
4004
4004
  const cached2 = recursive.get(inst);
4005
4005
  if (cached2 !== void 0)
4006
4006
  return cached2 ? PROVEN : NONE;
@@ -4010,7 +4010,7 @@ function isRecursive(inst, stack, resolve6) {
4010
4010
  let result = NONE;
4011
4011
  const check = (child) => {
4012
4012
  if (result !== PROVEN && child?._zod) {
4013
- const answer = isRecursive(child, stack, resolve6);
4013
+ const answer = isRecursive(child, stack, resolve7);
4014
4014
  if (answer > result)
4015
4015
  result = answer;
4016
4016
  }
@@ -4021,7 +4021,7 @@ function isRecursive(inst, stack, resolve6) {
4021
4021
  const desc = Object.getOwnPropertyDescriptor(sh, key);
4022
4022
  if (spread && !desc.enumerable)
4023
4023
  continue;
4024
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve6) : NONE;
4024
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve7) : NONE;
4025
4025
  if (child > answer)
4026
4026
  answer = child;
4027
4027
  }
@@ -4085,7 +4085,7 @@ function isRecursive(inst, stack, resolve6) {
4085
4085
  break;
4086
4086
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
4087
4087
  case "lazy": {
4088
- const inner = def._cachedInner ?? (resolve6 ? inst._zod.innerType : void 0);
4088
+ const inner = def._cachedInner ?? (resolve7 ? inst._zod.innerType : void 0);
4089
4089
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
4090
4090
  break;
4091
4091
  }
@@ -8536,11 +8536,11 @@ var Connection = class {
8536
8536
  const id = this.nextRequestId++;
8537
8537
  let cancel = () => {
8538
8538
  };
8539
- const response = new Promise((resolve6, reject) => {
8539
+ const response = new Promise((resolve7, reject) => {
8540
8540
  const pendingResponse = {
8541
8541
  resolve: (value) => {
8542
8542
  try {
8543
- resolve6(mapResponse ? mapResponse(value) : value);
8543
+ resolve7(mapResponse ? mapResponse(value) : value);
8544
8544
  } catch (error2) {
8545
8545
  reject(error2);
8546
8546
  }
@@ -8601,8 +8601,8 @@ var Connection = class {
8601
8601
  this.stream = stream;
8602
8602
  this.staticHandlers = handlers;
8603
8603
  this.fallbackHandlers = [...options?.fallbackHandlers ?? []];
8604
- this.closedPromise = new Promise((resolve6) => {
8605
- this.abortController.signal.addEventListener("abort", () => resolve6());
8604
+ this.closedPromise = new Promise((resolve7) => {
8605
+ this.abortController.signal.addEventListener("abort", () => resolve7());
8606
8606
  });
8607
8607
  void this.receive();
8608
8608
  }
@@ -9667,8 +9667,8 @@ var AsyncQueue = class {
9667
9667
  if (this.failed) {
9668
9668
  return Promise.reject(this.failure);
9669
9669
  }
9670
- return new Promise((resolve6, reject) => {
9671
- this.waiters.push({ resolve: resolve6, reject });
9670
+ return new Promise((resolve7, reject) => {
9671
+ this.waiters.push({ resolve: resolve7, reject });
9672
9672
  });
9673
9673
  }
9674
9674
  };
@@ -10357,11 +10357,13 @@ releaseLine(packageVersion);
10357
10357
  // src/integrations/acp/claude-settings.ts
10358
10358
  import { createRequire } from "node:module";
10359
10359
  import { pathToFileURL } from "node:url";
10360
- import { basename, join as join4, resolve } from "node:path";
10360
+ import { basename, join as join4, resolve as resolve2 } from "node:path";
10361
10361
 
10362
10362
  // src/common/paths.ts
10363
+ import { resolve } from "node:path";
10363
10364
  import { fileURLToPath } from "node:url";
10364
10365
  var resourceRoot = fileURLToPath(new URL("../../resources/", import.meta.url));
10366
+ var packageRoot = resolve(resourceRoot, "..");
10365
10367
 
10366
10368
  // src/integrations/acp/claude-settings.ts
10367
10369
  var levels = ["low", "medium", "high", "xhigh", "max"];
@@ -10369,7 +10371,7 @@ async function claudeOptions(command, cwd, supplied, includeSkills = true) {
10369
10371
  const normalized = supplied?.trim().toLowerCase().replace(/[^a-z0-9]+/g, "");
10370
10372
  const requested = normalized === "extrahigh" ? "xhigh" : normalized;
10371
10373
  const script = command.args[0];
10372
- const anchor2 = ["node", "node.exe"].includes(basename(command.command)) && script && !script.startsWith("-") ? resolve(cwd, script) : command.command;
10374
+ const anchor2 = ["node", "node.exe"].includes(basename(command.command)) && script && !script.startsWith("-") ? resolve2(cwd, script) : command.command;
10373
10375
  const require2 = createRequire(pathToFileURL(anchor2));
10374
10376
  const sdk = await import(pathToFileURL(require2.resolve("@anthropic-ai/claude-agent-sdk")).href);
10375
10377
  requireThat(object(sdk) && typeof sdk.resolveSettings === "function", "Claude ACP \u9700\u8981\u63D0\u4F9B resolveSettings \u7684\u539F\u751F SDK\u3002");
@@ -10520,9 +10522,9 @@ import { join as join6 } from "node:path";
10520
10522
 
10521
10523
  // src/integrations/acp/executable.ts
10522
10524
  import { accessSync, constants as constants2, realpathSync as realpathSync2, statSync } from "node:fs";
10523
- import { delimiter, isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
10525
+ import { delimiter, isAbsolute as isAbsolute2, resolve as resolve3 } from "node:path";
10524
10526
  function findAcpExecutable(command) {
10525
- const candidates = isAbsolute2(command) ? [command] : (process.env.PATH ?? "").split(delimiter).filter(Boolean).map((directory) => resolve2(directory, command));
10527
+ const candidates = isAbsolute2(command) ? [command] : (process.env.PATH ?? "").split(delimiter).filter(Boolean).map((directory) => resolve3(directory, command));
10526
10528
  for (const candidate of candidates) {
10527
10529
  try {
10528
10530
  accessSync(candidate, constants2.X_OK);
@@ -10749,10 +10751,10 @@ function acpChoices(options) {
10749
10751
  }
10750
10752
 
10751
10753
  // src/integrations/acp/mcp.ts
10752
- import { isAbsolute as isAbsolute3, resolve as resolve3 } from "node:path";
10754
+ import { isAbsolute as isAbsolute3, resolve as resolve4 } from "node:path";
10753
10755
  function resolveStdioCommand(command, cwd) {
10754
10756
  if (isAbsolute3(command)) return command;
10755
- if (command.includes("/") || command.includes("\\")) return resolve3(cwd, command);
10757
+ if (command.includes("/") || command.includes("\\")) return resolve4(cwd, command);
10756
10758
  return findAcpExecutable(command) ?? command;
10757
10759
  }
10758
10760
  function toAcpMcpServers(servers) {
@@ -10792,7 +10794,7 @@ async function openAcp(reference, cwd, env, callbacks, signal, openOptions = {})
10792
10794
  const child = spawn(reference.command, reference.args, { cwd, env, stdio: ["pipe", "pipe", "pipe"] });
10793
10795
  const lifetime = new AbortController();
10794
10796
  const cancel = AbortSignal.any([signal, lifetime.signal]);
10795
- const exited = new Promise((resolve6) => child.once("close", () => resolve6()));
10797
+ const exited = new Promise((resolve7) => child.once("close", () => resolve7()));
10796
10798
  child.once("error", (error2) => lifetime.abort(error2));
10797
10799
  child.once("exit", (code, termination) => lifetime.abort(new Error("ACP \u8FDB\u7A0B\u9000\u51FA\uFF1A" + (termination ?? code))));
10798
10800
  child.stderr.resume();
@@ -11159,7 +11161,7 @@ async function readWorkspaceConfig(root) {
11159
11161
 
11160
11162
  // src/services/workspace/workspace-mcp.ts
11161
11163
  import { mkdir as mkdir2, readFile as readFile3 } from "node:fs/promises";
11162
- import { dirname as dirname3, join as join9, resolve as resolve4 } from "node:path";
11164
+ import { dirname as dirname3, join as join9, resolve as resolve5 } from "node:path";
11163
11165
  var serverNamePattern = /^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$/;
11164
11166
  var reservedServerNames = /* @__PURE__ */ new Set(["pbot"]);
11165
11167
  var stdioKeys = /* @__PURE__ */ new Set(["command", "args", "env", "cwd", "description", "timeout", "enabled"]);
@@ -11313,7 +11315,7 @@ function resolveWorkspaceMcpServer(root, name, server, env = process.env) {
11313
11315
  }
11314
11316
  const command = expandEnvTemplate(server.command, env, `MCP \u670D\u52A1 "${name}" \u7684 command`);
11315
11317
  const args2 = (server.args ?? []).map((arg, index) => expandEnvTemplate(arg, env, `MCP \u670D\u52A1 "${name}" \u7684 args[${index}]`));
11316
- const cwd = server.cwd ? resolve4(root, expandEnvTemplate(server.cwd, env, `MCP \u670D\u52A1 "${name}" \u7684 cwd`)) : root;
11318
+ const cwd = server.cwd ? resolve5(root, expandEnvTemplate(server.cwd, env, `MCP \u670D\u52A1 "${name}" \u7684 cwd`)) : root;
11317
11319
  return {
11318
11320
  transport: "stdio",
11319
11321
  name,
@@ -11515,7 +11517,7 @@ async function runWorker(args2) {
11515
11517
  requireThat(files.read(id, "launch.json", launch).generation === generation, "ACP worker \u542F\u52A8\u4EE3\u6B21\u5DF2\u5931\u6548\u3002");
11516
11518
  const harness = resolveAcpHarness(reference.backend);
11517
11519
  const exactAnswer = Boolean(harness.exactAnswer);
11518
- const packageRoot = resolve5(resourceRoot, "..");
11520
+ const packageRoot2 = resolve6(resourceRoot, "..");
11519
11521
  const configuration = await readWorkspaceConfig(d.workspace);
11520
11522
  const features = workspaceFeatures(configuration);
11521
11523
  const baseEnv = {
@@ -11525,7 +11527,7 @@ async function runWorker(args2) {
11525
11527
  PBOT_SUBAGENT_GENERATION: generation,
11526
11528
  ...validating ? { PBOT_ACP_VALIDATE: "1" } : {}
11527
11529
  };
11528
- const prepared = harness.prepareLaunch ? await harness.prepareLaunch({ reference, cwd: d.cwd, directory, packageRoot, options: d.options, env: baseEnv, features }) : { command: { ...reference, args: [...reference.args] }, env: { ...baseEnv, ...reference.env ?? {} } };
11530
+ const prepared = harness.prepareLaunch ? await harness.prepareLaunch({ reference, cwd: d.cwd, directory, packageRoot: packageRoot2, options: d.options, env: baseEnv, features }) : { command: { ...reference, args: [...reference.args] }, env: { ...baseEnv, ...reference.env ?? {} } };
11529
11531
  let prompt;
11530
11532
  if (!exactAnswer) {
11531
11533
  const workspaceSkills = features.skills && !harness.nativeWorkspaceSkills && !d.options.noSkills ? await discoverWorkspaceSkills(d.workspace) : [];
@@ -11686,7 +11688,7 @@ async function runOneShotPrompt() {
11686
11688
  requireThat(typeof payload.cwd === "string" && payload.cwd.length > 0, "\u7F3A\u5C11 ACP \u6458\u8981\u5DE5\u4F5C\u76EE\u5F55\u3002");
11687
11689
  requireThat(typeof payload.prompt === "string" && payload.prompt.trim().length > 0, "\u7F3A\u5C11 ACP \u6458\u8981\u8F93\u5165\u5185\u5BB9\u3002");
11688
11690
  const harness = resolveAcpHarness(reference.backend);
11689
- const packageRoot = resolve5(resourceRoot, "..");
11691
+ const packageRoot2 = resolve6(resourceRoot, "..");
11690
11692
  const env = {
11691
11693
  ...process.env,
11692
11694
  ...reference.env ?? {},
@@ -11695,7 +11697,7 @@ async function runOneShotPrompt() {
11695
11697
  PBOT_SUMMARY_WORKER: "1",
11696
11698
  PI_OFFLINE: "1",
11697
11699
  PBOT_ACP_PI_COMMAND: process.env.PI_ACP_PI_COMMAND ?? acpExecutable("pi", "pi"),
11698
- PI_ACP_PI_COMMAND: join11(packageRoot, "bin/pbot-pi-acp.mjs")
11700
+ PI_ACP_PI_COMMAND: join11(packageRoot2, "bin/pbot-pi-acp.mjs")
11699
11701
  } : {}
11700
11702
  };
11701
11703
  let collecting = false;