personal-bot 0.3.6 → 0.4.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.
Files changed (143) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +5 -8
  4. package/README.zh-CN.md +5 -8
  5. package/bin/pbot-pi-acp.mjs +1 -1
  6. package/docs/README.md +1 -1
  7. package/docs/architecture/design.md +2 -2
  8. package/docs/architecture/extensibility.md +1 -1
  9. package/docs/architecture/model-context.md +1 -2
  10. package/docs/guides/capabilities.md +4 -8
  11. package/docs/guides/cross-harness-workers.md +4 -4
  12. package/docs/guides/history.md +1 -3
  13. package/docs/guides/workspace-configuration.md +4 -4
  14. package/docs/hosts/claude-code.md +2 -2
  15. package/docs/hosts/codex-qoder.md +1 -1
  16. package/lib/antigravity-plugin/bin/pbot-pi-acp.mjs +1 -1
  17. package/lib/antigravity-plugin/lib/extension/acp/member.d.ts +1 -1
  18. package/lib/antigravity-plugin/lib/extension/acp/member.js +11 -10
  19. package/lib/antigravity-plugin/lib/extension/acp-worker.js +348 -203
  20. package/lib/antigravity-plugin/lib/extension/cli.js +574 -549
  21. package/lib/antigravity-plugin/lib/extension/hosts/dsh/acp-member.js +1 -1
  22. package/lib/antigravity-plugin/lib/extension/hosts/pi/acp-member.js +3 -4
  23. package/lib/antigravity-plugin/lib/extension/hosts/plugin-runtime.js +0 -11
  24. package/lib/antigravity-plugin/lib/extension/mcp.js +462 -326
  25. package/lib/antigravity-plugin/lib/integrations/agent-resources.js +2 -2
  26. package/lib/antigravity-plugin/lib/model/acp.d.ts +29 -35
  27. package/lib/antigravity-plugin/lib/model/agent.d.ts +33 -17
  28. package/lib/antigravity-plugin/lib/model/agent.js +0 -1
  29. package/lib/antigravity-plugin/lib/storage/acp-files.d.ts +5 -8
  30. package/lib/antigravity-plugin/lib/storage/acp-files.js +34 -40
  31. package/lib/antigravity-plugin/lib/storage/agent-files.d.ts +19 -10
  32. package/lib/antigravity-plugin/lib/storage/agent-files.js +147 -43
  33. package/lib/antigravity-plugin/package.json +1 -1
  34. package/lib/antigravity-plugin/plugin.json +1 -1
  35. package/lib/antigravity-plugin/resources/agents/coordinator.md +3 -7
  36. package/lib/antigravity-plugin/resources/agents/general-purpose.md +3 -3
  37. package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -2
  38. package/lib/antigravity-plugin/resources/prompts/workspace.md +12 -16
  39. package/lib/antigravity-plugin/resources/skills/provider-connections/SKILL.md +7 -6
  40. package/lib/antigravity-plugin/resources/templates/workspace-agents.md +0 -4
  41. package/lib/antigravity-plugin/skills/pbot/SKILL.md +14 -6
  42. package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +7 -6
  43. package/lib/codex-marketplace/plugins/personal-bot/.codex-plugin/plugin.json +1 -1
  44. package/lib/codex-marketplace/plugins/personal-bot/.mcp.json +2 -2
  45. package/lib/codex-marketplace/plugins/personal-bot/hooks/hooks.json +3 -3
  46. package/lib/codex-marketplace/plugins/personal-bot/skills/pbot/SKILL.md +2 -2
  47. package/lib/extension/acp/member.d.ts +1 -1
  48. package/lib/extension/acp/member.js +11 -10
  49. package/lib/extension/acp/worker.js +34 -33
  50. package/lib/extension/acp-worker.js +348 -203
  51. package/lib/extension/cli.js +574 -549
  52. package/lib/extension/hosts/dsh/acp-member.js +1 -1
  53. package/lib/extension/hosts/dsh/command.js +1 -1
  54. package/lib/extension/hosts/dsh/workspace.js +1 -3
  55. package/lib/extension/hosts/pi/acp-member.js +3 -4
  56. package/lib/extension/hosts/plugin-runtime.js +0 -11
  57. package/lib/extension/mcp/tool-contract.d.ts +8 -50
  58. package/lib/extension/mcp/tool-contract.js +48 -62
  59. package/lib/extension/mcp/workers.d.ts +13 -27
  60. package/lib/extension/mcp/workers.js +60 -25
  61. package/lib/extension/mcp.js +462 -326
  62. package/lib/integrations/acp/agents.d.ts +2 -3
  63. package/lib/integrations/acp/agents.js +22 -22
  64. package/lib/integrations/acp/harnesses/claude.js +1 -1
  65. package/lib/integrations/agent-resources.js +2 -2
  66. package/lib/model/acp.d.ts +29 -35
  67. package/lib/model/agent.d.ts +33 -17
  68. package/lib/model/agent.js +0 -1
  69. package/lib/qoder-plugin/.mcp.json +2 -2
  70. package/lib/qoder-plugin/.qoder-plugin/plugin.json +1 -1
  71. package/lib/qoder-plugin/hooks/hooks.json +3 -3
  72. package/lib/qoder-plugin/skills/pbot/SKILL.md +2 -2
  73. package/lib/services/agents/acp-run.d.ts +6 -4
  74. package/lib/services/agents/acp-run.js +62 -43
  75. package/lib/services/agents/agent-run.d.ts +10 -6
  76. package/lib/services/agents/agent-run.js +142 -65
  77. package/lib/services/agents/agent-service.d.ts +3 -21
  78. package/lib/services/agents/agent-service.js +180 -126
  79. package/lib/storage/acp-files.d.ts +5 -8
  80. package/lib/storage/acp-files.js +34 -40
  81. package/lib/storage/agent-files.d.ts +19 -10
  82. package/lib/storage/agent-files.js +147 -43
  83. package/lib/tools/history/contract.js +12 -12
  84. package/package.json +1 -1
  85. package/resources/agents/coordinator.md +3 -7
  86. package/resources/agents/general-purpose.md +3 -3
  87. package/resources/antigravity/skills/pbot/SKILL.md +14 -6
  88. package/resources/claude/skills/pbot/SKILL.md +14 -6
  89. package/resources/plugin/skills/pbot/SKILL.md +2 -2
  90. package/resources/prompts/history-coordinator.md +1 -2
  91. package/resources/prompts/plugin-coordinator.md +1 -2
  92. package/resources/prompts/workspace.md +12 -16
  93. package/resources/skills/provider-connections/SKILL.md +7 -6
  94. package/resources/templates/workspace-agents.md +0 -4
  95. package/src/extension/acp/member.ts +14 -11
  96. package/src/extension/acp/worker.ts +31 -28
  97. package/src/extension/cli/commands/upgrade.ts +8 -36
  98. package/src/extension/cli/commands/workspace.ts +3 -8
  99. package/src/extension/cli/index.ts +1 -2
  100. package/src/extension/hosts/dsh/acp-member.ts +1 -1
  101. package/src/extension/hosts/dsh/command.ts +1 -1
  102. package/src/extension/hosts/dsh/workspace.ts +1 -3
  103. package/src/extension/hosts/pi/acp-member.ts +3 -4
  104. package/src/extension/hosts/pi/command.ts +1 -1
  105. package/src/extension/hosts/pi/lifecycle.ts +0 -2
  106. package/src/extension/hosts/plugin-runtime.ts +0 -10
  107. package/src/extension/mcp/tool-contract.ts +48 -62
  108. package/src/extension/mcp/workers.ts +66 -27
  109. package/src/integrations/acp/agents.ts +28 -27
  110. package/src/integrations/acp/harnesses/claude.ts +1 -1
  111. package/src/integrations/agent-resources.ts +2 -2
  112. package/src/integrations/hosts/dsh/session.ts +2 -2
  113. package/src/integrations/installation/cli-update.ts +2 -2
  114. package/src/integrations/installation/installers/claude.ts +4 -4
  115. package/src/integrations/installation/installers/qoder.ts +5 -5
  116. package/src/integrations/installation/upgraders/antigravity.ts +57 -15
  117. package/src/integrations/installation/upgraders/claude.ts +1 -4
  118. package/src/integrations/installation/upgraders/codex.ts +85 -15
  119. package/src/integrations/installation/upgraders/dsh.ts +46 -24
  120. package/src/integrations/installation/upgraders/pi.ts +18 -11
  121. package/src/integrations/installation/upgraders/qoder.ts +95 -20
  122. package/src/model/acp.ts +27 -29
  123. package/src/model/agent.ts +80 -16
  124. package/src/model/installation.ts +0 -2
  125. package/src/pbot.ts +2 -2
  126. package/src/services/agents/acp-run.ts +81 -49
  127. package/src/services/agents/agent-run.ts +154 -56
  128. package/src/services/agents/agent-service.ts +204 -133
  129. package/src/services/installation/upgrade-service.ts +1 -5
  130. package/src/storage/acp-files.ts +50 -45
  131. package/src/storage/agent-files.ts +159 -46
  132. package/src/tools/history/contract.ts +12 -12
  133. package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.d.ts +0 -15
  134. package/lib/antigravity-plugin/lib/services/workspace/plugin-releases.js +0 -126
  135. package/lib/antigravity-plugin/resources/references/compute-finance.md +0 -22
  136. package/lib/antigravity-plugin/resources/references/compute.md +0 -16
  137. package/lib/antigravity-plugin/resources/references/task-conductor.md +0 -25
  138. package/lib/services/workspace/plugin-releases.d.ts +0 -15
  139. package/lib/services/workspace/plugin-releases.js +0 -126
  140. package/resources/references/compute-finance.md +0 -22
  141. package/resources/references/compute.md +0 -16
  142. package/resources/references/task-conductor.md +0 -25
  143. package/src/services/workspace/plugin-releases.ts +0 -121
@@ -24,7 +24,7 @@ export async function apply(ctx) {
24
24
  if (source === "resume")
25
25
  agent.inbox.clear();
26
26
  const reference = member.files.reference(member.id);
27
- requireThat(reference.host === "acp" && reference.backend === "dsh" && agent.session.header.cwd === member.d.cwd &&
27
+ requireThat(reference.host === "acp" && reference.backend === "dsh" && agent.session.header.cwd === member.d.workspace &&
28
28
  (reference.sessionId === null || reference.sessionId === agent.id), "dsh ACP 会话身份或工作目录不匹配。");
29
29
  await agent.ctx.plugin({ name: "pbot-acp-expert", inject, apply: async (scope) => {
30
30
  if (member.features.skills)
@@ -29,7 +29,7 @@ export function registerDshCommand(ctx, workspaces) {
29
29
  switch (verb) {
30
30
  case "worker": {
31
31
  const { tool, args } = parseWorkerCommand(rest);
32
- result = await workspace.workers.callTool(tool, { workspace: workspace.root, ...args });
32
+ result = await workspace.workers.callTool(tool, args, undefined, workspace.root);
33
33
  break;
34
34
  }
35
35
  case "history": {
@@ -8,7 +8,6 @@ import { registerDshHistoryTool } from "../../../tools/history/dsh-tool.js";
8
8
  import { requireThat } from "../../../common/validation.js";
9
9
  import { toDshMcpConfig } from "../../../integrations/hosts/dsh/mcp.js";
10
10
  import { registerDshSkills } from "../../../integrations/hosts/dsh/skills.js";
11
- import { bindWorkspacePlugin } from "../../../services/workspace/plugin-releases.js";
12
11
  import { readWorkspaceConfig, workspaceDisabledMessage, workspaceFeatures } from "../../../services/workspace/workspace-config.js";
13
12
  import { loadNativeWorkspaceServers } from "../workspace-mcp.js";
14
13
  import { initializeWorkspace } from "../../../services/workspace/workspace-preparation.js";
@@ -31,7 +30,7 @@ export class DshWorkspace {
31
30
  this.agent = agent;
32
31
  this.component = component;
33
32
  this.features = features;
34
- this.workers = new McpWorkerRuntime(defaultWorkerDirectory(), agent.id, "dsh");
33
+ this.workers = new McpWorkerRuntime(defaultWorkerDirectory(root), agent.id, "dsh");
35
34
  }
36
35
  check = () => { this.component.throwIfAborted(); this.lifetime.signal.throwIfAborted(); };
37
36
  async open() {
@@ -137,7 +136,6 @@ export class DshWorkspaces {
137
136
  }
138
137
  let workspace;
139
138
  try {
140
- bindWorkspacePlugin(root, "dsh");
141
139
  workspace = new DshWorkspace(this.ctx, root, agent, this.#lifetime.signal, workspaceFeatures(configuration));
142
140
  const owned = workspace;
143
141
  const dispose = agent.ctx.effect(() => async () => {
@@ -8,7 +8,6 @@ import { toPiMcpConfig } from "../../../integrations/hosts/pi/mcp.js";
8
8
  import { authorizeMutation } from "../../../services/workspace/workspace-files.js";
9
9
  import { loadNativeWorkspaceServers } from "../workspace-mcp.js";
10
10
  import { resourceRoot } from "../../../common/paths.js";
11
- import { launch } from "../../../storage/agent-files.js";
12
11
  import { requireThat } from "../../../common/validation.js";
13
12
  const isBlockedTool = (name) => name === "pbot_history" || isMcpWorkerTool(name);
14
13
  /** Member resources and authoritative final answers; ACP owns input delivery. */
@@ -18,7 +17,7 @@ export default async function piAcpMember(pi) {
18
17
  let input, startLeaf = null;
19
18
  const checkSession = (ctx) => {
20
19
  const reference = member.files.reference(member.id);
21
- requireThat(reference.host === "acp" && reference.backend === "pi" && realpathSync(ctx.cwd) === member.d.cwd &&
20
+ requireThat(reference.host === "acp" && reference.backend === "pi" && realpathSync(ctx.cwd) === member.d.workspace &&
22
21
  (reference.sessionId === null || reference.sessionId === ctx.sessionManager.getSessionId()), "Pi ACP 会话身份或工作目录不匹配。");
23
22
  };
24
23
  const workspaceMcpServers = [];
@@ -42,7 +41,7 @@ export default async function piAcpMember(pi) {
42
41
  pi.on("session_start", (_event, ctx) => {
43
42
  checkSession(ctx);
44
43
  const active = pi.getActiveTools();
45
- for (const tool of agentFileTools(member.d.cwd, lifetime.signal, async (path, change, signal) => {
44
+ for (const tool of agentFileTools(member.d.workspace, lifetime.signal, async (path, change, signal) => {
46
45
  member.check();
47
46
  await authorizeMutation(member.d.workspace, path, change, async () => false, signal);
48
47
  member.check();
@@ -53,7 +52,7 @@ export default async function piAcpMember(pi) {
53
52
  registeredMcp.push(server.name);
54
53
  }
55
54
  pi.setActiveTools(active.filter(name => !isBlockedTool(name)));
56
- pi.setSessionName(member.files.read(member.id, "launch.json", launch).name);
55
+ pi.setSessionName(member.id.slice(0, 8));
57
56
  startLeaf = ctx.sessionManager.getLeafId();
58
57
  });
59
58
  pi.on("before_agent_start", async (event, ctx) => {
@@ -5,7 +5,6 @@ import { requireThat } from "../../common/validation.js";
5
5
  import { loadWorkspaceContext } from "../../integrations/agent-resources.js";
6
6
  import { recordHistoryCapture } from "../../services/history/history-capture.js";
7
7
  import { historyStartupNotices } from "../../services/history/summary-runner.js";
8
- import { bindWorkspacePlugin, workspacePluginDrift, workspacePluginReleases } from "../../services/workspace/plugin-releases.js";
9
8
  import { readWorkspaceConfig, workspaceFeatures } from "../../services/workspace/workspace-config.js";
10
9
  import { initializeWorkspace } from "../../services/workspace/workspace-preparation.js";
11
10
  import { discoverSkills, discoverWorkspaceSkills } from "../../services/workspace/workspace-skills.js";
@@ -18,7 +17,6 @@ export async function pluginCommand(adapter, args, cwd) {
18
17
  requireThat(["init", "status"].includes(action), adapter.usage);
19
18
  if (action === "init") {
20
19
  await initializeWorkspace(root);
21
- bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
22
20
  }
23
21
  const configuration = await readWorkspaceConfig(root);
24
22
  return { version: packageVersion, workspaceRoot: root, resourceRoot, configuration };
@@ -62,8 +60,6 @@ export async function pluginHook(adapter, payload, replay) {
62
60
  }
63
61
  if (!configuration.enabled)
64
62
  return adapter.formatPass(payload);
65
- if (event.kind === "inject-context")
66
- bindWorkspacePlugin(root, adapter.host, process.env.PBOT_PLUGIN_MANIFEST || process.env.PBOT_PLUGIN_VERSION);
67
63
  if (features.history && adapter.extractHistory) {
68
64
  try {
69
65
  const capture = await adapter.extractHistory(event);
@@ -84,13 +80,6 @@ export async function pluginHook(adapter, payload, replay) {
84
80
  workspaceSkills.push(...await discoverSkills(directory, directory));
85
81
  }
86
82
  const notices = event.isSessionStart && features.history ? [...historyStartupNotices(root)] : [];
87
- if (event.isSessionStart) {
88
- const drift = workspacePluginDrift(workspacePluginReleases(root));
89
- if (drift.outOfSync) {
90
- const summary = Object.entries(drift.versions).map(([host, version]) => `${host}=${version}`).join(", ");
91
- notices.push(`检测到当前工作区各宿主 Personal Bot 插件版本不一致(${summary}),可在终端运行 pbot upgrade 统一升级。`);
92
- }
93
- }
94
83
  if (!includePrompts && !workspaceSkills.length && !notices.length)
95
84
  return adapter.formatPass(payload);
96
85
  const context = await loadWorkspaceContext({
@@ -29,10 +29,6 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
29
29
  type: string;
30
30
  description: string;
31
31
  };
32
- cwd: {
33
- type: string;
34
- description: string;
35
- };
36
32
  workspace: {
37
33
  type: string;
38
34
  description: string;
@@ -67,14 +63,10 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
67
63
  type: string;
68
64
  description: string;
69
65
  };
70
- workspace: {
71
- type: string;
72
- description: string;
73
- };
74
66
  backend?: never;
75
67
  model?: never;
76
68
  thinking?: never;
77
- cwd?: never;
69
+ workspace?: never;
78
70
  message?: never;
79
71
  waitMs?: never;
80
72
  action?: never;
@@ -114,14 +106,10 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
114
106
  maximum: number;
115
107
  description: string;
116
108
  };
117
- workspace: {
118
- type: string;
119
- description: string;
120
- };
121
109
  backend?: never;
122
110
  model?: never;
123
111
  thinking?: never;
124
- cwd?: never;
112
+ workspace?: never;
125
113
  action?: never;
126
114
  requestId?: never;
127
115
  optionId?: never;
@@ -173,14 +161,10 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
173
161
  maximum: number;
174
162
  description: string;
175
163
  };
176
- workspace: {
177
- type: string;
178
- description: string;
179
- };
180
164
  backend?: never;
181
165
  model?: never;
182
166
  thinking?: never;
183
- cwd?: never;
167
+ workspace?: never;
184
168
  message?: never;
185
169
  offset?: never;
186
170
  target?: never;
@@ -216,14 +200,10 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
216
200
  maximum: number;
217
201
  description: string;
218
202
  };
219
- workspace: {
220
- type: string;
221
- description: string;
222
- };
223
203
  backend?: never;
224
204
  model?: never;
225
205
  thinking?: never;
226
- cwd?: never;
206
+ workspace?: never;
227
207
  message?: never;
228
208
  action?: never;
229
209
  requestId?: never;
@@ -269,7 +249,6 @@ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBack
269
249
  description: string;
270
250
  };
271
251
  thinking?: never;
272
- cwd?: never;
273
252
  message?: never;
274
253
  waitMs?: never;
275
254
  action?: never;
@@ -478,10 +457,6 @@ export declare const pbotWorkerTools: ({
478
457
  type: string;
479
458
  description: string;
480
459
  };
481
- cwd: {
482
- type: string;
483
- description: string;
484
- };
485
460
  workspace: {
486
461
  type: string;
487
462
  description: string;
@@ -516,14 +491,10 @@ export declare const pbotWorkerTools: ({
516
491
  type: string;
517
492
  description: string;
518
493
  };
519
- workspace: {
520
- type: string;
521
- description: string;
522
- };
523
494
  backend?: never;
524
495
  model?: never;
525
496
  thinking?: never;
526
- cwd?: never;
497
+ workspace?: never;
527
498
  message?: never;
528
499
  waitMs?: never;
529
500
  action?: never;
@@ -563,14 +534,10 @@ export declare const pbotWorkerTools: ({
563
534
  maximum: number;
564
535
  description: string;
565
536
  };
566
- workspace: {
567
- type: string;
568
- description: string;
569
- };
570
537
  backend?: never;
571
538
  model?: never;
572
539
  thinking?: never;
573
- cwd?: never;
540
+ workspace?: never;
574
541
  action?: never;
575
542
  requestId?: never;
576
543
  optionId?: never;
@@ -622,14 +589,10 @@ export declare const pbotWorkerTools: ({
622
589
  maximum: number;
623
590
  description: string;
624
591
  };
625
- workspace: {
626
- type: string;
627
- description: string;
628
- };
629
592
  backend?: never;
630
593
  model?: never;
631
594
  thinking?: never;
632
- cwd?: never;
595
+ workspace?: never;
633
596
  message?: never;
634
597
  offset?: never;
635
598
  target?: never;
@@ -665,14 +628,10 @@ export declare const pbotWorkerTools: ({
665
628
  maximum: number;
666
629
  description: string;
667
630
  };
668
- workspace: {
669
- type: string;
670
- description: string;
671
- };
672
631
  backend?: never;
673
632
  model?: never;
674
633
  thinking?: never;
675
- cwd?: never;
634
+ workspace?: never;
676
635
  message?: never;
677
636
  action?: never;
678
637
  requestId?: never;
@@ -718,7 +677,6 @@ export declare const pbotWorkerTools: ({
718
677
  description: string;
719
678
  };
720
679
  thinking?: never;
721
- cwd?: never;
722
680
  message?: never;
723
681
  waitMs?: never;
724
682
  action?: never;
@@ -11,7 +11,7 @@ function formatBackendItem(entry, defaultBackend) {
11
11
  if (entry.label)
12
12
  tags.push(entry.label);
13
13
  if (entry.backend === defaultBackend)
14
- tags.push("当前");
14
+ tags.push("当前宿主");
15
15
  return tags.length ? `${entry.backend}(${tags.join(",")})` : entry.backend;
16
16
  }
17
17
  function summarizeBackends(commands = {}, defaultBackend) {
@@ -32,8 +32,8 @@ function workspaceProperty(workspaceBound) {
32
32
  return {
33
33
  type: "string",
34
34
  description: workspaceBound
35
- ? "目标工作区根目录的绝对路径;默认使用当前工作区,通常省略。"
36
- : "目标工作区根目录的绝对路径(如上下文中提供了 workspaceRoot 则传该路径);请显式传入。",
35
+ ? "工作区根目录绝对路径;默认当前工作区,通常省略。"
36
+ : "目标工作区根目录绝对路径;请传入环境中的 workspaceRoot。",
37
37
  };
38
38
  }
39
39
  export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBound = false) {
@@ -45,8 +45,7 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
45
45
  return [
46
46
  {
47
47
  name: "worker_create",
48
- description: "启动一个独立的外部 AI 助手会话(worker),用于将任务委派给其他助手或指定模型/思考深度来独立处理(如按用户要求切换助手、获取独立审查或第二意见、并行分担子任务)。" +
49
- "本工具仅建立会话并返回 workerId,随后通过 worker_request 发送具体任务。不需要借助其他助手时,优先自行完成或使用当前内置子代理。\n" +
48
+ description: "启动独立的外部助手会话并返回 workerId(不发送任务,随后用 worker_request 派发)。未指定其他助手或特定模型时,优先自行完成或使用当前内置子代理。\n" +
50
49
  overview,
51
50
  annotations: {
52
51
  title: "Create Worker",
@@ -62,19 +61,15 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
62
61
  properties: {
63
62
  backend: {
64
63
  type: "string",
65
- description: "要启动的外部助手标识(不区分大小写,支持常见别名,如 claude-code、agy)。",
64
+ description: "目标外部助手标识(不区分大小写,支持常见别名如 claude-code、agy)。",
66
65
  },
67
66
  model: {
68
67
  type: "string",
69
- description: "仅用户明确要求特定模型时指定(支持模型 ID、显示名或 provider/model,不区分大小写);不确定可用值时先用 worker_discover(target=\"models\") 查询;不填则使用该助手默认模型。",
68
+ description: "目标模型(模型 ID、显示名或 provider/model,不区分大小写);未明确指定时省略以用默认模型,不确定可选值时先查 worker_discover(target=\"models\")。",
70
69
  },
71
70
  thinking: {
72
71
  type: "string",
73
- description: "仅用户明确要求思考深度时指定(如 low / medium / high / xhigh / max,不区分大小写);不填则使用默认设置。",
74
- },
75
- cwd: {
76
- type: "string",
77
- description: "助手执行任务时的工作目录(绝对路径或相对工作区的路径),默认为当前工作区根目录。",
72
+ description: "思考深度(如 low / medium / high / xhigh / max,不区分大小写);未明确指定时省略以用默认设置。",
78
73
  },
79
74
  workspace,
80
75
  },
@@ -82,7 +77,7 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
82
77
  },
83
78
  {
84
79
  name: "worker_close",
85
- description: "结束不再需要的外部助手会话并释放资源。若该助手支持会话恢复,后续仍可直接用 worker_request 在原上下文中继续对话。",
80
+ description: "结束外部助手会话并释放进程。若该会话支持恢复(capabilities.resume),后续仍可直接用 worker_request 续接。",
86
81
  annotations: {
87
82
  title: "Close Worker",
88
83
  readOnlyHint: false,
@@ -97,17 +92,15 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
97
92
  properties: {
98
93
  workerId: {
99
94
  type: "string",
100
- description: "要结束的助手会话 ID(来自 worker_create 或 worker_discover)。",
95
+ description: "助手会话 ID(来自 worker_create 或 worker_discover)。",
101
96
  },
102
- workspace,
103
97
  },
104
98
  },
105
99
  },
106
100
  {
107
101
  name: "worker_request",
108
- description: "向指定的外部助手派发任务,或在同一上下文中追问与补充要求,并获取执行结果(已关闭但支持恢复的会话会自动续接)。" +
109
- `默认最多等待 ${defaultWaitMs / 1000} 秒返回结果;将 waitMs 设为 0 可立即返回并转入后台执行,适合耗时任务或多助手并行。` +
110
- "若返回 timedOut 或结果含 nextOffset,用 worker_output 继续等待或翻页;若返回 needsResponse,先向用户确认再用 worker_response 回复。",
102
+ description: "向外部助手派发任务或在同一上下文中追问(已关闭且支持恢复的会话会自动续接)。" +
103
+ `默认最多等待 ${defaultWaitMs / 1000} 秒(waitMs 设为 0 可立即转后台并行);返回 timedOut 或 nextOffset 用 worker_output,返回 needsResponse 先向用户确认再用 worker_response。`,
111
104
  annotations: {
112
105
  title: "Send Request to Worker",
113
106
  readOnlyHint: false,
@@ -122,27 +115,25 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
122
115
  properties: {
123
116
  workerId: {
124
117
  type: "string",
125
- description: "目标助手会话 ID(来自 worker_create 或 worker_discover)。",
118
+ description: "助手会话 ID(来自 worker_create 或 worker_discover)。",
126
119
  },
127
120
  message: {
128
121
  type: "string",
129
- description: "要发送的任务说明或追问内容。外部助手看不到你与用户的对话历史,首次派发时请写清背景、目标、相关文件路径、约束条件和期望产出。",
122
+ description: "任务说明或追问内容。外部助手看不到当前会话历史,首次派发需写清背景、目标、相关文件路径、约束和期望产出。",
130
123
  },
131
124
  waitMs: {
132
125
  type: "integer",
133
126
  minimum: 0,
134
127
  maximum: maxWaitMs,
135
- description: `最多等待结果的毫秒数(默认 ${defaultWaitMs});设为 0 可立即返回并在后台执行。`,
128
+ description: `最多等待毫秒数(默认 ${defaultWaitMs});0 表示立即返回转后台执行。`,
136
129
  },
137
- workspace,
138
130
  },
139
131
  },
140
132
  },
141
133
  {
142
134
  name: "worker_response",
143
- description: "当外部助手在执行过程中暂停并请求确认或补充信息(返回 needsResponse: true)时,向其提交决定以继续执行。" +
144
- "支持三类请求:操作授权(kind=\"permission\")、问答表单(kind=\"form\")和链接确认(kind=\"url\")。" +
145
- `提交前先向用户确认;提交后默认最多等待 ${defaultWaitMs / 1000} 秒返回后续结果(waitMs 设为 0 立即返回)。`,
135
+ description: "回复外部助手暂停时发出的待处理请求(needsResponse: true),支持操作授权、表单问答与链接确认。" +
136
+ `提交前先向用户确认;提交后默认等待最多 ${defaultWaitMs / 1000} 秒返回后续结果。`,
146
137
  annotations: {
147
138
  title: "Respond to Worker Request",
148
139
  readOnlyHint: false,
@@ -162,35 +153,33 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
162
153
  action: {
163
154
  type: "string",
164
155
  enum: [...acpElicitationActions],
165
- description: "处理方式:accept 表示同意授权、提交表单回答或确认链接;decline 表示拒绝;cancel 表示取消本次请求。",
156
+ description: "accept 同意/提交表单/确认链接;decline 拒绝;cancel 取消请求。",
166
157
  },
167
158
  requestId: {
168
159
  type: "string",
169
- description: "要回复的请求 ID(来自 pendingRequests[].requestId);仅一条待处理请求时可省略,多条时必填。",
160
+ description: "请求 ID(pendingRequests[].requestId);仅一条待处理请求时可省略,多条时必填。",
170
161
  },
171
162
  optionId: {
172
163
  type: "string",
173
- description: "仅授权请求(kind=\"permission\")且 action 不为 cancel 时可用:指定选项 ID(来自 pendingRequests[].options[].optionId),省略时默认单次允许或拒绝。",
164
+ description: "仅 permission 请求且 action≠cancel 时可用:指定 pendingRequests[].options[].optionId,省略则按 action 单次允许或拒绝。",
174
165
  },
175
166
  content: {
176
167
  type: "object",
177
168
  additionalProperties: true,
178
- description: "仅表单提问(kind=\"form\")且 action=\"accept\" 时可用:按 pendingRequests[].schema.properties 填写的回答对象(值为字符串、数字、布尔值或字符串数组)。",
169
+ description: "仅 form 请求且 action=\"accept\" 时可用:按 pendingRequests[].schema.properties 填写回答对象(值为字符串、数字、布尔值或字符串数组)。",
179
170
  },
180
171
  waitMs: {
181
172
  type: "integer",
182
173
  minimum: 0,
183
174
  maximum: maxWaitMs,
184
- description: `提交回复后最多等待后续结果的毫秒数(默认 ${defaultWaitMs});设为 0 立即返回。`,
175
+ description: `提交后最多等待毫秒数(默认 ${defaultWaitMs});0 表示立即返回。`,
185
176
  },
186
- workspace,
187
177
  },
188
178
  },
189
179
  },
190
180
  {
191
181
  name: "worker_output",
192
- description: "获取或等待外部助手的最新执行结果。用于收取后台任务的产出、在等待超时(timedOut)后继续等待,或在长结果分页(含 nextOffset)时读取后续内容。" +
193
- "任务仍在运行时会等待其完成(也可能返回 timedOut 或 needsResponse),已结束则立即返回。",
182
+ description: "获取或等待外部助手的最新结果,用于收取后台产出、timedOut 后继续等待,或按 nextOffset 分页续读。任务已结束时立即返回,运行中最多等待 waitMs。",
194
183
  annotations: {
195
184
  title: "Get Worker Output",
196
185
  readOnlyHint: true,
@@ -205,27 +194,25 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
205
194
  properties: {
206
195
  workerId: {
207
196
  type: "string",
208
- description: "要等待或获取结果的助手会话 ID。",
197
+ description: "助手会话 ID。",
209
198
  },
210
199
  offset: {
211
200
  type: "integer",
212
201
  minimum: 0,
213
- description: "结果读取起始位置(默认 0);翻页读取剩余内容时传入上次返回的 nextOffset。",
202
+ description: "读取起始位置(默认 0);翻页续读时传上次返回的 nextOffset。",
214
203
  },
215
204
  waitMs: {
216
205
  type: "integer",
217
206
  minimum: 0,
218
207
  maximum: maxWaitMs,
219
- description: `任务仍在运行时最多等待的毫秒数(默认 ${defaultWaitMs});任务已结束或翻页读取时会立即返回。`,
208
+ description: `运行中最多等待毫秒数(默认 ${defaultWaitMs});已结束或翻页时立即返回。`,
220
209
  },
221
- workspace,
222
210
  },
223
211
  },
224
212
  },
225
213
  {
226
214
  name: "worker_discover",
227
- description: "了解当前可以委派哪些外部助手、查看已有助手会话的运行状态以便复用,或查询某个助手支持的模型与思考深度选项。" +
228
- "默认(target=\"overview\")同时返回可用助手与已有会话;仅在需要核对模型或思考深度可选值时再查 target=\"models\"(耗时较长)。",
215
+ description: "查询可用外部助手、已有会话状态,或某个助手支持的模型与思考深度。默认(overview)返回可用助手与已有会话;仅需核对模型或思考深度可选值时再查 models(需启动探测,耗时较长)。",
229
216
  annotations: {
230
217
  title: "Discover Workers, Backends & Models",
231
218
  readOnlyHint: true,
@@ -241,21 +228,21 @@ export function buildPbotWorkerTools(commands = {}, defaultBackend, workspaceBou
241
228
  target: {
242
229
  type: "string",
243
230
  enum: [...discoverTargets],
244
- description: "查询范围,默认 \"overview\"(同时返回可用助手与已有会话);\"workers\" 查全部或单个会话状态;\"backends\" 查可用助手列表;\"models\" 查指定助手支持的模型与思考深度。",
231
+ description: "overview(默认,可用助手与已有会话)、workers(全部或单个会话状态)、backends(可用助手)、models(指定助手的模型与思考深度)。",
245
232
  },
246
233
  workerId: {
247
234
  type: "string",
248
- description: "仅 target=\"workers\" 可用:指定单个助手会话 ID;不填则列出全部。",
235
+ description: "仅 target=\"workers\" 可用:指定单个会话 ID,省略列全部。",
249
236
  },
250
237
  backend: {
251
238
  type: "string",
252
239
  description: availableIds
253
- ? `仅 target="models" 可用(${modelsBackendHint}):目标外部助手标识,支持常见别名;当前可用:${availableIds}。`
254
- : `仅 target="models" 可用(${modelsBackendHint}):目标外部助手标识,支持常见别名。`,
240
+ ? `仅 target="models" 可用(${modelsBackendHint}):目标助手标识,支持别名;当前可用:${availableIds}。`
241
+ : `仅 target="models" 可用(${modelsBackendHint}):目标助手标识,支持别名。`,
255
242
  },
256
243
  model: {
257
244
  type: "string",
258
- description: "仅 target=\"models\" 可用:指定模型以查看该模型支持的思考深度选项。",
245
+ description: "仅 target=\"models\" 可用:指定模型以查看其支持的思考深度选项。",
259
246
  },
260
247
  workspace,
261
248
  },
@@ -268,7 +255,7 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
268
255
  return [
269
256
  {
270
257
  name: "workspace_mcp_discover",
271
- description: "发现当前工作区共享的外部工具服务(MCP)及其可用工具。不传 server 时列出可用服务;传入 server 时返回该服务提供的工具清单与参数说明。",
258
+ description: "查询当前工作区共享 MCP 服务(.pbot/mcp.json)。省略 server 列出服务;传入 server 返回其工具列表与参数说明。",
272
259
  annotations: {
273
260
  title: "Discover Workspace MCP Servers & Tools",
274
261
  readOnlyHint: true,
@@ -283,7 +270,7 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
283
270
  properties: {
284
271
  server: {
285
272
  type: "string",
286
- description: "目标工具服务名称;不填时列出工作区全部可用服务。",
273
+ description: "服务名称;省略列出工作区全部已配置服务。",
287
274
  },
288
275
  workspace,
289
276
  },
@@ -291,8 +278,7 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
291
278
  },
292
279
  {
293
280
  name: "workspace_mcp_call",
294
- description: "调用当前工作区共享的外部工具服务(MCP)中的指定工具,用于访问工作区接入的外部能力与数据源。" +
295
- "不确定工具名或参数格式时,先用 workspace_mcp_discover(server) 查询。",
281
+ description: "调用工作区共享 MCP 服务中的指定工具。不确定工具名或参数时先用 workspace_mcp_discover(server) 查询。",
296
282
  annotations: {
297
283
  title: "Call Workspace MCP Tool",
298
284
  readOnlyHint: false,
@@ -307,16 +293,16 @@ export function buildWorkspaceMcpTools(workspaceBound = false) {
307
293
  properties: {
308
294
  server: {
309
295
  type: "string",
310
- description: "目标工具服务名称(可通过 workspace_mcp_discover 获取)。",
296
+ description: "服务名称(来自 workspace_mcp_discover)。",
311
297
  },
312
298
  tool: {
313
299
  type: "string",
314
- description: "要调用的工具名称。",
300
+ description: "工具名称。",
315
301
  },
316
302
  arguments: {
317
303
  type: "object",
318
304
  additionalProperties: true,
319
- description: "传给目标工具的参数对象,不填则为空对象。",
305
+ description: "传给目标工具的参数对象,默认空对象。",
320
306
  },
321
307
  workspace,
322
308
  },
@@ -329,7 +315,7 @@ export function buildHistoryMcpTools(workspaceBound = false) {
329
315
  return [
330
316
  {
331
317
  name: "history_search",
332
- description: "搜索当前工作区跨宿主(pi、dsh、claude、antigravity 等)的历史问答与摘要归档。省略 query 时列出各会话;传入 query 按不区分大小写的连续关键词匹配原文与摘要。",
318
+ description: "搜索当前工作区跨宿主历史问答与摘要归档(不含工具调用日志)。省略 query 列出各会话或指定维度摘要;传入 query 按不区分大小写的连续关键词匹配。",
333
319
  annotations: {
334
320
  title: "Search Workspace History",
335
321
  readOnlyHint: true,
@@ -344,15 +330,15 @@ export function buildHistoryMcpTools(workspaceBound = false) {
344
330
  properties: {
345
331
  host: {
346
332
  type: "string",
347
- description: "可选来源筛选(如 pi、dsh、claude、antigravity);省略查全部宿主。",
333
+ description: "来源宿主筛选(如 pi、dsh、claude、antigravity、codex、qoder);省略查全部。",
348
334
  },
349
335
  dimension: {
350
336
  type: "string",
351
- description: "可选范围筛选:raw 表示仅搜原文,或指定摘要维度(如 monthly、session);省略查全部原文与维度摘要。",
337
+ description: "范围筛选:raw 仅原文,或指定摘要维度(如 monthly、session);省略查全部。",
352
338
  },
353
339
  query: {
354
340
  type: "string",
355
- description: "不区分大小写的连续关键词;省略时列出各会话(或指定维度摘要)。",
341
+ description: "连续关键词(不区分大小写);省略列会话或指定维度摘要。",
356
342
  },
357
343
  sessionId: {
358
344
  type: "string",
@@ -369,13 +355,13 @@ export function buildHistoryMcpTools(workspaceBound = false) {
369
355
  offset: {
370
356
  type: "integer",
371
357
  minimum: 0,
372
- description: "匹配结果偏移,默认 0。",
358
+ description: "结果偏移,默认 0。",
373
359
  },
374
360
  limit: {
375
361
  type: "integer",
376
362
  minimum: 1,
377
363
  maximum: historyPageLimits.search.max,
378
- description: `最多返回条数(1–${historyPageLimits.search.max}),默认 ${historyPageLimits.search.default}。`,
364
+ description: `返回条数(1–${historyPageLimits.search.max}),默认 ${historyPageLimits.search.default}。`,
379
365
  },
380
366
  workspace,
381
367
  },
@@ -383,7 +369,7 @@ export function buildHistoryMcpTools(workspaceBound = false) {
383
369
  },
384
370
  {
385
371
  name: "history_read",
386
- description: "按节点 id 读取当前工作区历史归档的正文与上下级节点(monthly、session、summary、exchange),支持从月度汇总下钻至单会话摘要与原始问答。正文过长时用 nextOffset 续读,子节点过多时用 nextChildrenOffset 续读。",
372
+ description: "按节点 id 读取历史正文与上下级(可从 monthly 汇总下钻至 session 摘要和 exchange 原文)。正文分页传 nextOffset,子节点分页传 nextChildrenOffset。",
387
373
  annotations: {
388
374
  title: "Read Workspace History Node",
389
375
  readOnlyHint: true,
@@ -398,16 +384,16 @@ export function buildHistoryMcpTools(workspaceBound = false) {
398
384
  properties: {
399
385
  id: {
400
386
  type: "string",
401
- description: "history_search 或上下级返回的节点 id。",
387
+ description: "节点 id(来自 history_search 或上下级)。",
402
388
  },
403
389
  host: {
404
390
  type: "string",
405
- description: "跨来源 ID 冲突时显式指定来源宿主。",
391
+ description: "跨宿主 id 冲突时指定来源宿主。",
406
392
  },
407
393
  offset: {
408
394
  type: "integer",
409
395
  minimum: 0,
410
- description: "正文字符偏移,默认 0。",
396
+ description: "正文字符偏移,默认 0;续读传上次 nextOffset。",
411
397
  },
412
398
  limit: {
413
399
  type: "integer",
@@ -418,7 +404,7 @@ export function buildHistoryMcpTools(workspaceBound = false) {
418
404
  childrenOffset: {
419
405
  type: "integer",
420
406
  minimum: 0,
421
- description: "子节点列表偏移,默认 0;续读传上页 nextChildrenOffset。",
407
+ description: "子节点偏移,默认 0;续读传上次 nextChildrenOffset。",
422
408
  },
423
409
  workspace,
424
410
  },