personal-bot 0.2.20 → 0.3.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.
Files changed (343) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -5
  3. package/.mcp.json +11 -0
  4. package/CONTEXT.md +17 -73
  5. package/README.md +41 -120
  6. package/README.zh-CN.md +41 -120
  7. package/docs/README.md +31 -23
  8. package/docs/architecture/design.md +74 -0
  9. package/docs/architecture/extensibility.md +78 -0
  10. package/docs/architecture/model-context.md +31 -0
  11. package/docs/architecture/model-instruction-guidelines.md +34 -0
  12. package/docs/architecture/principles.md +33 -0
  13. package/docs/guides/capabilities.md +36 -0
  14. package/docs/guides/cross-harness-workers.md +83 -0
  15. package/docs/guides/history.md +25 -0
  16. package/docs/guides/workspace-configuration.md +102 -0
  17. package/docs/hosts/antigravity.md +52 -0
  18. package/docs/hosts/claude-code.md +47 -0
  19. package/docs/hosts/dsh.md +67 -0
  20. package/docs/hosts/pi.md +49 -0
  21. package/docs/maintainers/release.md +59 -0
  22. package/hooks/hooks.json +0 -3
  23. package/lib/antigravity-plugin/hooks.json +23 -0
  24. package/lib/antigravity-plugin/lib/claude.d.ts +1 -0
  25. package/lib/antigravity-plugin/lib/claude.js +13 -0
  26. package/lib/antigravity-plugin/lib/common/json.d.ts +6 -0
  27. package/lib/antigravity-plugin/lib/common/json.js +16 -0
  28. package/lib/antigravity-plugin/lib/common/paths.d.ts +1 -0
  29. package/lib/antigravity-plugin/lib/common/paths.js +2 -0
  30. package/lib/antigravity-plugin/lib/common/validation.d.ts +3 -0
  31. package/lib/antigravity-plugin/lib/common/validation.js +8 -0
  32. package/lib/antigravity-plugin/lib/common/version.d.ts +3 -0
  33. package/lib/antigravity-plugin/lib/common/version.js +13 -0
  34. package/lib/antigravity-plugin/lib/extension/acp-worker.js +11597 -0
  35. package/lib/antigravity-plugin/lib/extension/mcp.js +2715 -0
  36. package/lib/antigravity-plugin/lib/extension/plugin-runtime.d.ts +10 -0
  37. package/lib/antigravity-plugin/lib/extension/plugin-runtime.js +67 -0
  38. package/lib/antigravity-plugin/lib/integrations/agent-resources.d.ts +16 -0
  39. package/lib/antigravity-plugin/lib/integrations/agent-resources.js +56 -0
  40. package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.d.ts +4 -0
  41. package/lib/antigravity-plugin/lib/integrations/hosts/antigravity.js +79 -0
  42. package/lib/antigravity-plugin/lib/integrations/hosts/claude.d.ts +3 -0
  43. package/lib/antigravity-plugin/lib/integrations/hosts/claude.js +60 -0
  44. package/lib/antigravity-plugin/lib/integrations/hosts/registry.d.ts +15 -0
  45. package/lib/antigravity-plugin/lib/integrations/hosts/registry.js +34 -0
  46. package/lib/antigravity-plugin/lib/model/acp.d.ts +164 -0
  47. package/lib/antigravity-plugin/lib/model/acp.js +12 -0
  48. package/lib/antigravity-plugin/lib/model/plugin-host.d.ts +48 -0
  49. package/lib/antigravity-plugin/lib/model/workspace-config.d.ts +24 -0
  50. package/lib/antigravity-plugin/lib/model/workspace-config.js +1 -0
  51. package/lib/antigravity-plugin/lib/model/workspace-mcp.d.ts +51 -0
  52. package/lib/antigravity-plugin/lib/model/workspace-mcp.js +4 -0
  53. package/lib/antigravity-plugin/lib/plugin.d.ts +1 -0
  54. package/lib/antigravity-plugin/lib/plugin.js +17 -0
  55. package/lib/antigravity-plugin/lib/services/workspace/workspace-config.d.ts +8 -0
  56. package/lib/antigravity-plugin/lib/services/workspace/workspace-config.js +95 -0
  57. package/lib/antigravity-plugin/lib/services/workspace/workspace-preparation.d.ts +3 -0
  58. package/lib/antigravity-plugin/lib/services/workspace/workspace-preparation.js +26 -0
  59. package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.d.ts +8 -0
  60. package/lib/antigravity-plugin/lib/services/workspace/workspace-skills.js +91 -0
  61. package/lib/antigravity-plugin/lib/storage/atomic-json.d.ts +11 -0
  62. package/lib/antigravity-plugin/lib/storage/atomic-json.js +101 -0
  63. package/lib/antigravity-plugin/mcp_config.json +13 -0
  64. package/lib/antigravity-plugin/package.json +6 -0
  65. package/lib/antigravity-plugin/plugin.json +7 -0
  66. package/lib/antigravity-plugin/resources/agents/coordinator.md +11 -0
  67. package/{resources/claude → lib/antigravity-plugin/resources}/agents/general-purpose.md +0 -5
  68. package/lib/antigravity-plugin/resources/prompts/plugin-coordinator.md +1 -0
  69. package/lib/antigravity-plugin/resources/prompts/workspace.md +31 -0
  70. package/lib/antigravity-plugin/resources/references/compute-finance.md +22 -0
  71. package/lib/antigravity-plugin/resources/references/compute.md +16 -0
  72. package/lib/antigravity-plugin/resources/references/task-conductor.md +25 -0
  73. package/lib/antigravity-plugin/resources/templates/workspace-agents.md +21 -0
  74. package/lib/antigravity-plugin/skills/pbot/SKILL.md +16 -0
  75. package/lib/antigravity-plugin/skills/project-maintenance/SKILL.md +35 -0
  76. package/lib/antigravity-plugin/skills/provider-connections/SKILL.md +42 -0
  77. package/lib/claude.js +4 -11
  78. package/lib/client.js +14 -531
  79. package/lib/common/markdown.js +2 -3
  80. package/lib/common/validation.d.ts +2 -0
  81. package/lib/common/validation.js +4 -0
  82. package/lib/extension/acp-member.d.ts +2 -0
  83. package/lib/extension/acp-member.js +9 -8
  84. package/lib/extension/acp-worker.js +11578 -121
  85. package/lib/extension/dsh/acp-member.js +26 -2
  86. package/lib/extension/dsh/command.js +19 -57
  87. package/lib/extension/dsh/history.js +2 -4
  88. package/lib/extension/dsh/management.d.ts +0 -2
  89. package/lib/extension/dsh/management.js +27 -126
  90. package/lib/extension/dsh/workspace.d.ts +5 -47
  91. package/lib/extension/dsh/workspace.js +76 -108
  92. package/lib/extension/mcp-bridge.d.ts +41 -0
  93. package/lib/extension/mcp-bridge.js +412 -0
  94. package/lib/extension/mcp-workers.d.ts +980 -0
  95. package/lib/extension/mcp-workers.js +882 -0
  96. package/lib/extension/mcp.js +2715 -0
  97. package/lib/extension/plugin-runtime.d.ts +10 -0
  98. package/lib/extension/plugin-runtime.js +67 -0
  99. package/lib/extension/setup-cli.js +215 -2
  100. package/lib/integrations/acp/agents.d.ts +10 -11
  101. package/lib/integrations/acp/agents.js +65 -33
  102. package/lib/integrations/acp/claude.d.ts +2 -2
  103. package/lib/integrations/acp/claude.js +5 -3
  104. package/lib/integrations/acp/connection.d.ts +17 -4
  105. package/lib/integrations/acp/connection.js +53 -27
  106. package/lib/integrations/acp/executable.d.ts +3 -0
  107. package/lib/integrations/acp/executable.js +42 -0
  108. package/lib/integrations/acp/harnesses/claude.d.ts +2 -0
  109. package/lib/integrations/acp/harnesses/claude.js +49 -0
  110. package/lib/integrations/acp/harnesses/dsh.d.ts +2 -0
  111. package/lib/integrations/acp/harnesses/dsh.js +35 -0
  112. package/lib/integrations/acp/harnesses/generic.d.ts +13 -0
  113. package/lib/integrations/acp/harnesses/generic.js +37 -0
  114. package/lib/integrations/acp/harnesses/pi.d.ts +2 -0
  115. package/lib/integrations/acp/harnesses/pi.js +34 -0
  116. package/lib/integrations/acp/harnesses/presets.d.ts +3 -0
  117. package/lib/integrations/acp/harnesses/presets.js +20 -0
  118. package/lib/integrations/acp/launch.d.ts +33 -4
  119. package/lib/integrations/acp/launch.js +60 -48
  120. package/lib/integrations/acp/mcp.d.ts +6 -0
  121. package/lib/integrations/acp/mcp.js +40 -0
  122. package/lib/integrations/acp/model-selection.d.ts +9 -2
  123. package/lib/integrations/acp/model-selection.js +73 -27
  124. package/lib/integrations/acp/registry.d.ts +18 -0
  125. package/lib/integrations/acp/registry.js +50 -0
  126. package/lib/integrations/agent-resources.d.ts +16 -1
  127. package/lib/integrations/agent-resources.js +45 -9
  128. package/lib/integrations/dsh/mcp.d.ts +4 -0
  129. package/lib/integrations/dsh/mcp.js +28 -0
  130. package/lib/integrations/dsh/resources.d.ts +3 -3
  131. package/lib/integrations/dsh/resources.js +21 -12
  132. package/lib/integrations/dsh/skills.d.ts +5 -1
  133. package/lib/integrations/dsh/skills.js +10 -6
  134. package/lib/integrations/hosts/antigravity.d.ts +4 -0
  135. package/lib/integrations/hosts/antigravity.js +79 -0
  136. package/lib/integrations/hosts/claude.d.ts +3 -0
  137. package/lib/integrations/hosts/claude.js +60 -0
  138. package/lib/integrations/hosts/registry.d.ts +15 -0
  139. package/lib/integrations/hosts/registry.js +34 -0
  140. package/lib/model/acp.d.ts +107 -2
  141. package/lib/model/acp.js +12 -1
  142. package/lib/model/agent.d.ts +35 -33
  143. package/lib/model/plugin-host.d.ts +48 -0
  144. package/lib/model/plugin-host.js +1 -0
  145. package/lib/model/workspace-config.d.ts +12 -0
  146. package/lib/model/workspace-mcp.d.ts +51 -0
  147. package/lib/model/workspace-mcp.js +4 -0
  148. package/lib/plugin.d.ts +1 -0
  149. package/lib/plugin.js +17 -0
  150. package/lib/services/agents/acp-run.d.ts +13 -1
  151. package/lib/services/agents/acp-run.js +30 -2
  152. package/lib/services/agents/agent-service.d.ts +35 -120
  153. package/lib/services/agents/agent-service.js +156 -160
  154. package/lib/services/installation/setup-service.js +17 -1
  155. package/lib/services/workspace/workspace-config.d.ts +2 -1
  156. package/lib/services/workspace/workspace-config.js +43 -9
  157. package/lib/services/workspace/workspace-mcp.d.ts +14 -0
  158. package/lib/services/workspace/workspace-mcp.js +200 -0
  159. package/lib/services/workspace/workspace-skills.d.ts +8 -0
  160. package/lib/services/workspace/workspace-skills.js +91 -0
  161. package/lib/storage/acp-files.d.ts +3 -1
  162. package/lib/storage/acp-files.js +32 -2
  163. package/lib/storage/acp-history.d.ts +3 -2
  164. package/lib/storage/acp-history.js +19 -7
  165. package/lib/storage/agent-files.d.ts +8 -8
  166. package/lib/storage/agent-files.js +27 -47
  167. package/lib/tools/history/contract.d.ts +1 -1
  168. package/lib/tools/history/contract.js +17 -11
  169. package/lib/ui/dsh/index.js +8 -3
  170. package/lib/ui/dsh/management.d.ts +1 -1
  171. package/lib/ui/dsh/management.js +24 -456
  172. package/lib/ui/dsh/remote.d.ts +0 -2
  173. package/lib/ui/dsh/remote.js +1 -1
  174. package/package.json +12 -7
  175. package/resources/agents/coordinator.md +2 -2
  176. package/resources/antigravity/skills/pbot/SKILL.md +16 -0
  177. package/resources/claude/skills/pbot/SKILL.md +1 -1
  178. package/resources/prompts/history-coordinator.md +1 -0
  179. package/resources/prompts/plugin-coordinator.md +1 -0
  180. package/resources/prompts/workspace.md +9 -8
  181. package/resources/references/compute.md +9 -11
  182. package/resources/references/task-conductor.md +12 -26
  183. package/resources/skills/project-maintenance/SKILL.md +16 -21
  184. package/resources/skills/provider-connections/SKILL.md +24 -40
  185. package/resources/templates/workspace-agents.md +4 -0
  186. package/scripts/README.md +17 -34
  187. package/src/claude.ts +4 -8
  188. package/src/common/markdown.ts +2 -3
  189. package/src/common/validation.ts +6 -0
  190. package/src/extension/acp-member.ts +9 -8
  191. package/src/extension/acp-worker.ts +239 -97
  192. package/src/extension/command.ts +38 -36
  193. package/src/extension/dsh/acp-member.ts +21 -2
  194. package/src/extension/dsh/command.ts +21 -51
  195. package/src/extension/dsh/files.ts +1 -0
  196. package/src/extension/dsh/history.ts +9 -6
  197. package/src/extension/dsh/management.ts +27 -58
  198. package/src/extension/dsh/workspace.ts +88 -99
  199. package/src/extension/events.ts +13 -10
  200. package/src/extension/history.ts +2 -50
  201. package/src/extension/lifecycle.ts +37 -22
  202. package/src/extension/mcp-bridge.ts +412 -0
  203. package/src/extension/mcp-workers.ts +941 -0
  204. package/src/extension/pi-acp-member.ts +29 -5
  205. package/src/extension/plugin-runtime.ts +63 -0
  206. package/src/extension/setup-cli.ts +186 -2
  207. package/src/integrations/acp/agents.ts +70 -24
  208. package/src/integrations/acp/claude.ts +11 -4
  209. package/src/integrations/acp/connection.ts +63 -25
  210. package/src/integrations/acp/executable.ts +41 -0
  211. package/src/integrations/acp/harnesses/claude.ts +50 -0
  212. package/src/integrations/acp/harnesses/dsh.ts +40 -0
  213. package/src/integrations/acp/harnesses/generic.ts +52 -0
  214. package/src/integrations/acp/harnesses/pi.ts +35 -0
  215. package/src/integrations/acp/harnesses/presets.ts +22 -0
  216. package/src/integrations/acp/launch.ts +69 -47
  217. package/src/integrations/acp/mcp.ts +43 -0
  218. package/src/integrations/acp/model-selection.ts +68 -25
  219. package/src/integrations/acp/registry.ts +60 -0
  220. package/src/integrations/agent-resources.ts +70 -6
  221. package/src/integrations/dsh/mcp.ts +30 -0
  222. package/src/integrations/dsh/resources.ts +28 -13
  223. package/src/integrations/dsh/skills.ts +16 -6
  224. package/src/integrations/hosts/antigravity.ts +83 -0
  225. package/src/integrations/hosts/claude.ts +62 -0
  226. package/src/integrations/hosts/registry.ts +42 -0
  227. package/src/integrations/pi/mcp.ts +26 -0
  228. package/src/mcp.ts +14 -0
  229. package/src/model/acp.ts +113 -3
  230. package/src/model/agent.ts +18 -14
  231. package/src/model/plugin-host.ts +39 -0
  232. package/src/model/workspace-config.ts +14 -0
  233. package/src/model/workspace-mcp.ts +64 -0
  234. package/src/pbot.ts +69 -20
  235. package/src/plugin.ts +19 -0
  236. package/src/services/agents/acp-run.ts +35 -3
  237. package/src/services/agents/agent-service.ts +180 -160
  238. package/src/services/installation/setup-service.ts +17 -2
  239. package/src/services/workspace/workspace-config.ts +46 -8
  240. package/src/services/workspace/workspace-mcp.ts +242 -0
  241. package/src/services/workspace/workspace-skills.ts +78 -0
  242. package/src/storage/acp-files.ts +32 -3
  243. package/src/storage/acp-history.ts +18 -7
  244. package/src/storage/agent-files.ts +27 -41
  245. package/src/tools/history/contract.ts +17 -11
  246. package/src/tools/register.ts +4 -8
  247. package/src/ui/dsh/index.ts +8 -3
  248. package/src/ui/dsh/management.ts +40 -282
  249. package/src/ui/dsh/remote.ts +2 -2
  250. package/docs/adr/0001-claude-skill-discovery.md +0 -3
  251. package/docs/adr/0002-claude-native-collaboration.md +0 -3
  252. package/docs/agent-collaboration.md +0 -190
  253. package/docs/architecture-guidelines.md +0 -37
  254. package/docs/capability-design.md +0 -55
  255. package/docs/claude-code-design.md +0 -44
  256. package/docs/claude-code.md +0 -57
  257. package/docs/dsh.md +0 -337
  258. package/docs/file-storage.md +0 -97
  259. package/docs/history.md +0 -54
  260. package/docs/installation-design.md +0 -86
  261. package/docs/interaction-design.md +0 -21
  262. package/docs/model-context.md +0 -76
  263. package/docs/model-instruction-guidelines.md +0 -51
  264. package/docs/release.md +0 -108
  265. package/docs/technical-design.md +0 -163
  266. package/docs/workspace-configuration.md +0 -79
  267. package/lib/extension/claude-hooks.d.ts +0 -9
  268. package/lib/extension/claude-hooks.js +0 -78
  269. package/lib/extension/dsh/agent-events.d.ts +0 -24
  270. package/lib/extension/dsh/agent-events.js +0 -242
  271. package/lib/extension/dsh/agent-runtime.d.ts +0 -49
  272. package/lib/extension/dsh/agent-runtime.js +0 -351
  273. package/lib/integrations/dsh/dsh-agents.d.ts +0 -30
  274. package/lib/integrations/dsh/dsh-agents.js +0 -104
  275. package/lib/integrations/dsh/input.d.ts +0 -21
  276. package/lib/integrations/dsh/input.js +0 -62
  277. package/lib/integrations/dsh/notifications.d.ts +0 -8
  278. package/lib/integrations/dsh/notifications.js +0 -55
  279. package/lib/integrations/dsh/session.d.ts +0 -14
  280. package/lib/integrations/dsh/session.js +0 -60
  281. package/lib/integrations/team-context.d.ts +0 -18
  282. package/lib/integrations/team-context.js +0 -61
  283. package/lib/model/team.d.ts +0 -85
  284. package/lib/services/agents/agent-notices.d.ts +0 -13
  285. package/lib/services/agents/agent-notices.js +0 -25
  286. package/lib/services/agents/start-options.d.ts +0 -4
  287. package/lib/services/agents/start-options.js +0 -20
  288. package/lib/services/agents/team-service.d.ts +0 -168
  289. package/lib/services/agents/team-service.js +0 -345
  290. package/lib/storage/team-files.d.ts +0 -16
  291. package/lib/storage/team-files.js +0 -111
  292. package/lib/tools/agents/actions.d.ts +0 -62
  293. package/lib/tools/agents/actions.js +0 -62
  294. package/lib/tools/agents/contract.d.ts +0 -181
  295. package/lib/tools/agents/contract.js +0 -84
  296. package/lib/tools/agents/dsh-tool.d.ts +0 -5
  297. package/lib/tools/agents/dsh-tool.js +0 -34
  298. package/lib/tools/result.d.ts +0 -18
  299. package/lib/tools/result.js +0 -10
  300. package/lib/tools/teams/actions.d.ts +0 -23
  301. package/lib/tools/teams/actions.js +0 -40
  302. package/lib/tools/teams/contract.d.ts +0 -201
  303. package/lib/tools/teams/contract.js +0 -91
  304. package/lib/tools/teams/dsh-tool.d.ts +0 -8
  305. package/lib/tools/teams/dsh-tool.js +0 -39
  306. package/lib/ui/dsh/attachments.d.ts +0 -5
  307. package/lib/ui/dsh/attachments.js +0 -39
  308. package/resources/prompts/claude-coordinator.md +0 -1
  309. package/resources/prompts/native-coordinator.md +0 -1
  310. package/resources/prompts/team-member.md +0 -7
  311. package/src/extension/agent-events.ts +0 -210
  312. package/src/extension/agents-command.ts +0 -89
  313. package/src/extension/claude-hooks.ts +0 -74
  314. package/src/extension/dsh/agent-events.ts +0 -148
  315. package/src/extension/dsh/agent-runtime.ts +0 -252
  316. package/src/extension/subagent-entry.ts +0 -270
  317. package/src/extension/teams-command.ts +0 -67
  318. package/src/integrations/dsh/dsh-agents.ts +0 -97
  319. package/src/integrations/dsh/input.ts +0 -66
  320. package/src/integrations/dsh/notifications.ts +0 -46
  321. package/src/integrations/pi/agent-context.ts +0 -18
  322. package/src/integrations/pi/agent-input.ts +0 -19
  323. package/src/integrations/pi/pi-agents.ts +0 -84
  324. package/src/integrations/pi/team-context.ts +0 -26
  325. package/src/integrations/team-context.ts +0 -64
  326. package/src/model/team.ts +0 -29
  327. package/src/services/agents/agent-notices.ts +0 -28
  328. package/src/services/agents/start-options.ts +0 -19
  329. package/src/services/agents/team-service.ts +0 -275
  330. package/src/storage/team-files.ts +0 -93
  331. package/src/tools/agents/actions.ts +0 -57
  332. package/src/tools/agents/contract.ts +0 -101
  333. package/src/tools/agents/dsh-tool.ts +0 -37
  334. package/src/tools/agents/tool.ts +0 -20
  335. package/src/tools/teams/actions.ts +0 -34
  336. package/src/tools/teams/contract.ts +0 -109
  337. package/src/tools/teams/dsh-tool.ts +0 -45
  338. package/src/tools/teams/tool.ts +0 -29
  339. package/src/ui/agent-display.ts +0 -14
  340. package/src/ui/dsh/attachments.ts +0 -42
  341. package/src/ui/pi/menu.ts +0 -37
  342. package/src/ui/pi/reader.ts +0 -46
  343. /package/lib/{model/team.js → antigravity-plugin/lib/model/plugin-host.js} +0 -0
@@ -0,0 +1,980 @@
1
+ import { type AcpCommands, type McpWorkerToolName } from "../model/acp.js";
2
+ export type ProgressReporter = (message: string) => void;
3
+ export declare const mcpInstructions: string;
4
+ export declare function buildPbotWorkerTools(commands?: AcpCommands, defaultBackend?: string, workspaceBound?: boolean): ({
5
+ name: string;
6
+ description: string;
7
+ annotations: {
8
+ title: string;
9
+ readOnlyHint: boolean;
10
+ destructiveHint: boolean;
11
+ idempotentHint: boolean;
12
+ openWorldHint: boolean;
13
+ };
14
+ inputSchema: {
15
+ type: string;
16
+ additionalProperties: boolean;
17
+ required: string[];
18
+ properties: {
19
+ backend: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ model: {
24
+ type: string;
25
+ description: string;
26
+ };
27
+ thinking: {
28
+ type: string;
29
+ description: string;
30
+ };
31
+ cwd: {
32
+ type: string;
33
+ description: string;
34
+ };
35
+ workspace: {
36
+ type: string;
37
+ description: string;
38
+ };
39
+ workerId?: never;
40
+ message?: never;
41
+ waitMs?: never;
42
+ action?: never;
43
+ requestId?: never;
44
+ optionId?: never;
45
+ content?: never;
46
+ offset?: never;
47
+ target?: never;
48
+ };
49
+ };
50
+ } | {
51
+ name: string;
52
+ description: string;
53
+ annotations: {
54
+ title: string;
55
+ readOnlyHint: boolean;
56
+ destructiveHint: boolean;
57
+ idempotentHint: boolean;
58
+ openWorldHint: boolean;
59
+ };
60
+ inputSchema: {
61
+ type: string;
62
+ additionalProperties: boolean;
63
+ required: string[];
64
+ properties: {
65
+ workerId: {
66
+ type: string;
67
+ description: string;
68
+ };
69
+ workspace: {
70
+ type: string;
71
+ description: string;
72
+ };
73
+ backend?: never;
74
+ model?: never;
75
+ thinking?: never;
76
+ cwd?: never;
77
+ message?: never;
78
+ waitMs?: never;
79
+ action?: never;
80
+ requestId?: never;
81
+ optionId?: never;
82
+ content?: never;
83
+ offset?: never;
84
+ target?: never;
85
+ };
86
+ };
87
+ } | {
88
+ name: string;
89
+ description: string;
90
+ annotations: {
91
+ title: string;
92
+ readOnlyHint: boolean;
93
+ destructiveHint: boolean;
94
+ idempotentHint: boolean;
95
+ openWorldHint: boolean;
96
+ };
97
+ inputSchema: {
98
+ type: string;
99
+ additionalProperties: boolean;
100
+ required: string[];
101
+ properties: {
102
+ workerId: {
103
+ type: string;
104
+ description: string;
105
+ };
106
+ message: {
107
+ type: string;
108
+ description: string;
109
+ };
110
+ waitMs: {
111
+ type: string;
112
+ minimum: number;
113
+ maximum: number;
114
+ description: string;
115
+ };
116
+ workspace: {
117
+ type: string;
118
+ description: string;
119
+ };
120
+ backend?: never;
121
+ model?: never;
122
+ thinking?: never;
123
+ cwd?: never;
124
+ action?: never;
125
+ requestId?: never;
126
+ optionId?: never;
127
+ content?: never;
128
+ offset?: never;
129
+ target?: never;
130
+ };
131
+ };
132
+ } | {
133
+ name: string;
134
+ description: string;
135
+ annotations: {
136
+ title: string;
137
+ readOnlyHint: boolean;
138
+ destructiveHint: boolean;
139
+ idempotentHint: boolean;
140
+ openWorldHint: boolean;
141
+ };
142
+ inputSchema: {
143
+ type: string;
144
+ additionalProperties: boolean;
145
+ required: string[];
146
+ properties: {
147
+ workerId: {
148
+ type: string;
149
+ description: string;
150
+ };
151
+ action: {
152
+ type: string;
153
+ enum: ("accept" | "decline" | "cancel")[];
154
+ description: string;
155
+ };
156
+ requestId: {
157
+ type: string;
158
+ description: string;
159
+ };
160
+ optionId: {
161
+ type: string;
162
+ description: string;
163
+ };
164
+ content: {
165
+ type: string;
166
+ additionalProperties: boolean;
167
+ description: string;
168
+ };
169
+ waitMs: {
170
+ type: string;
171
+ minimum: number;
172
+ maximum: number;
173
+ description: string;
174
+ };
175
+ workspace: {
176
+ type: string;
177
+ description: string;
178
+ };
179
+ backend?: never;
180
+ model?: never;
181
+ thinking?: never;
182
+ cwd?: never;
183
+ message?: never;
184
+ offset?: never;
185
+ target?: never;
186
+ };
187
+ };
188
+ } | {
189
+ name: string;
190
+ description: string;
191
+ annotations: {
192
+ title: string;
193
+ readOnlyHint: boolean;
194
+ destructiveHint: boolean;
195
+ idempotentHint: boolean;
196
+ openWorldHint: boolean;
197
+ };
198
+ inputSchema: {
199
+ type: string;
200
+ additionalProperties: boolean;
201
+ required: string[];
202
+ properties: {
203
+ workerId: {
204
+ type: string;
205
+ description: string;
206
+ };
207
+ offset: {
208
+ type: string;
209
+ minimum: number;
210
+ description: string;
211
+ };
212
+ waitMs: {
213
+ type: string;
214
+ minimum: number;
215
+ maximum: number;
216
+ description: string;
217
+ };
218
+ workspace: {
219
+ type: string;
220
+ description: string;
221
+ };
222
+ backend?: never;
223
+ model?: never;
224
+ thinking?: never;
225
+ cwd?: never;
226
+ message?: never;
227
+ action?: never;
228
+ requestId?: never;
229
+ optionId?: never;
230
+ content?: never;
231
+ target?: never;
232
+ };
233
+ };
234
+ } | {
235
+ name: string;
236
+ description: string;
237
+ annotations: {
238
+ title: string;
239
+ readOnlyHint: boolean;
240
+ destructiveHint: boolean;
241
+ idempotentHint: boolean;
242
+ openWorldHint: boolean;
243
+ };
244
+ inputSchema: {
245
+ type: string;
246
+ additionalProperties: boolean;
247
+ required: never[];
248
+ properties: {
249
+ target: {
250
+ type: string;
251
+ enum: ("models" | "overview" | "workers" | "backends")[];
252
+ description: string;
253
+ };
254
+ workerId: {
255
+ type: string;
256
+ description: string;
257
+ };
258
+ backend: {
259
+ type: string;
260
+ description: string;
261
+ };
262
+ model: {
263
+ type: string;
264
+ description: string;
265
+ };
266
+ workspace: {
267
+ type: string;
268
+ description: string;
269
+ };
270
+ thinking?: never;
271
+ cwd?: never;
272
+ message?: never;
273
+ waitMs?: never;
274
+ action?: never;
275
+ requestId?: never;
276
+ optionId?: never;
277
+ content?: never;
278
+ offset?: never;
279
+ };
280
+ };
281
+ })[];
282
+ export declare function buildWorkspaceMcpTools(workspaceBound?: boolean): ({
283
+ name: string;
284
+ description: string;
285
+ annotations: {
286
+ title: string;
287
+ readOnlyHint: boolean;
288
+ destructiveHint: boolean;
289
+ idempotentHint: boolean;
290
+ openWorldHint: boolean;
291
+ };
292
+ inputSchema: {
293
+ type: string;
294
+ additionalProperties: boolean;
295
+ required: never[];
296
+ properties: {
297
+ server: {
298
+ type: string;
299
+ description: string;
300
+ };
301
+ workspace: {
302
+ type: string;
303
+ description: string;
304
+ };
305
+ tool?: never;
306
+ arguments?: never;
307
+ };
308
+ };
309
+ } | {
310
+ name: string;
311
+ description: string;
312
+ annotations: {
313
+ title: string;
314
+ readOnlyHint: boolean;
315
+ destructiveHint: boolean;
316
+ idempotentHint: boolean;
317
+ openWorldHint: boolean;
318
+ };
319
+ inputSchema: {
320
+ type: string;
321
+ additionalProperties: boolean;
322
+ required: string[];
323
+ properties: {
324
+ server: {
325
+ type: string;
326
+ description: string;
327
+ };
328
+ tool: {
329
+ type: string;
330
+ description: string;
331
+ };
332
+ arguments: {
333
+ type: string;
334
+ additionalProperties: boolean;
335
+ description: string;
336
+ };
337
+ workspace: {
338
+ type: string;
339
+ description: string;
340
+ };
341
+ };
342
+ };
343
+ })[];
344
+ export declare const pbotWorkerTools: ({
345
+ name: string;
346
+ description: string;
347
+ annotations: {
348
+ title: string;
349
+ readOnlyHint: boolean;
350
+ destructiveHint: boolean;
351
+ idempotentHint: boolean;
352
+ openWorldHint: boolean;
353
+ };
354
+ inputSchema: {
355
+ type: string;
356
+ additionalProperties: boolean;
357
+ required: string[];
358
+ properties: {
359
+ backend: {
360
+ type: string;
361
+ description: string;
362
+ };
363
+ model: {
364
+ type: string;
365
+ description: string;
366
+ };
367
+ thinking: {
368
+ type: string;
369
+ description: string;
370
+ };
371
+ cwd: {
372
+ type: string;
373
+ description: string;
374
+ };
375
+ workspace: {
376
+ type: string;
377
+ description: string;
378
+ };
379
+ workerId?: never;
380
+ message?: never;
381
+ waitMs?: never;
382
+ action?: never;
383
+ requestId?: never;
384
+ optionId?: never;
385
+ content?: never;
386
+ offset?: never;
387
+ target?: never;
388
+ };
389
+ };
390
+ } | {
391
+ name: string;
392
+ description: string;
393
+ annotations: {
394
+ title: string;
395
+ readOnlyHint: boolean;
396
+ destructiveHint: boolean;
397
+ idempotentHint: boolean;
398
+ openWorldHint: boolean;
399
+ };
400
+ inputSchema: {
401
+ type: string;
402
+ additionalProperties: boolean;
403
+ required: string[];
404
+ properties: {
405
+ workerId: {
406
+ type: string;
407
+ description: string;
408
+ };
409
+ workspace: {
410
+ type: string;
411
+ description: string;
412
+ };
413
+ backend?: never;
414
+ model?: never;
415
+ thinking?: never;
416
+ cwd?: never;
417
+ message?: never;
418
+ waitMs?: never;
419
+ action?: never;
420
+ requestId?: never;
421
+ optionId?: never;
422
+ content?: never;
423
+ offset?: never;
424
+ target?: never;
425
+ };
426
+ };
427
+ } | {
428
+ name: string;
429
+ description: string;
430
+ annotations: {
431
+ title: string;
432
+ readOnlyHint: boolean;
433
+ destructiveHint: boolean;
434
+ idempotentHint: boolean;
435
+ openWorldHint: boolean;
436
+ };
437
+ inputSchema: {
438
+ type: string;
439
+ additionalProperties: boolean;
440
+ required: string[];
441
+ properties: {
442
+ workerId: {
443
+ type: string;
444
+ description: string;
445
+ };
446
+ message: {
447
+ type: string;
448
+ description: string;
449
+ };
450
+ waitMs: {
451
+ type: string;
452
+ minimum: number;
453
+ maximum: number;
454
+ description: string;
455
+ };
456
+ workspace: {
457
+ type: string;
458
+ description: string;
459
+ };
460
+ backend?: never;
461
+ model?: never;
462
+ thinking?: never;
463
+ cwd?: never;
464
+ action?: never;
465
+ requestId?: never;
466
+ optionId?: never;
467
+ content?: never;
468
+ offset?: never;
469
+ target?: never;
470
+ };
471
+ };
472
+ } | {
473
+ name: string;
474
+ description: string;
475
+ annotations: {
476
+ title: string;
477
+ readOnlyHint: boolean;
478
+ destructiveHint: boolean;
479
+ idempotentHint: boolean;
480
+ openWorldHint: boolean;
481
+ };
482
+ inputSchema: {
483
+ type: string;
484
+ additionalProperties: boolean;
485
+ required: string[];
486
+ properties: {
487
+ workerId: {
488
+ type: string;
489
+ description: string;
490
+ };
491
+ action: {
492
+ type: string;
493
+ enum: ("accept" | "decline" | "cancel")[];
494
+ description: string;
495
+ };
496
+ requestId: {
497
+ type: string;
498
+ description: string;
499
+ };
500
+ optionId: {
501
+ type: string;
502
+ description: string;
503
+ };
504
+ content: {
505
+ type: string;
506
+ additionalProperties: boolean;
507
+ description: string;
508
+ };
509
+ waitMs: {
510
+ type: string;
511
+ minimum: number;
512
+ maximum: number;
513
+ description: string;
514
+ };
515
+ workspace: {
516
+ type: string;
517
+ description: string;
518
+ };
519
+ backend?: never;
520
+ model?: never;
521
+ thinking?: never;
522
+ cwd?: never;
523
+ message?: never;
524
+ offset?: never;
525
+ target?: never;
526
+ };
527
+ };
528
+ } | {
529
+ name: string;
530
+ description: string;
531
+ annotations: {
532
+ title: string;
533
+ readOnlyHint: boolean;
534
+ destructiveHint: boolean;
535
+ idempotentHint: boolean;
536
+ openWorldHint: boolean;
537
+ };
538
+ inputSchema: {
539
+ type: string;
540
+ additionalProperties: boolean;
541
+ required: string[];
542
+ properties: {
543
+ workerId: {
544
+ type: string;
545
+ description: string;
546
+ };
547
+ offset: {
548
+ type: string;
549
+ minimum: number;
550
+ description: string;
551
+ };
552
+ waitMs: {
553
+ type: string;
554
+ minimum: number;
555
+ maximum: number;
556
+ description: string;
557
+ };
558
+ workspace: {
559
+ type: string;
560
+ description: string;
561
+ };
562
+ backend?: never;
563
+ model?: never;
564
+ thinking?: never;
565
+ cwd?: never;
566
+ message?: never;
567
+ action?: never;
568
+ requestId?: never;
569
+ optionId?: never;
570
+ content?: never;
571
+ target?: never;
572
+ };
573
+ };
574
+ } | {
575
+ name: string;
576
+ description: string;
577
+ annotations: {
578
+ title: string;
579
+ readOnlyHint: boolean;
580
+ destructiveHint: boolean;
581
+ idempotentHint: boolean;
582
+ openWorldHint: boolean;
583
+ };
584
+ inputSchema: {
585
+ type: string;
586
+ additionalProperties: boolean;
587
+ required: never[];
588
+ properties: {
589
+ target: {
590
+ type: string;
591
+ enum: ("models" | "overview" | "workers" | "backends")[];
592
+ description: string;
593
+ };
594
+ workerId: {
595
+ type: string;
596
+ description: string;
597
+ };
598
+ backend: {
599
+ type: string;
600
+ description: string;
601
+ };
602
+ model: {
603
+ type: string;
604
+ description: string;
605
+ };
606
+ workspace: {
607
+ type: string;
608
+ description: string;
609
+ };
610
+ thinking?: never;
611
+ cwd?: never;
612
+ message?: never;
613
+ waitMs?: never;
614
+ action?: never;
615
+ requestId?: never;
616
+ optionId?: never;
617
+ content?: never;
618
+ offset?: never;
619
+ };
620
+ };
621
+ })[];
622
+ export declare function defaultWorkerDirectory(): string;
623
+ /** Parse Pi/dsh `/pbot worker ...` CLI arguments into a canonical MCP tool call. */
624
+ export declare function parseWorkerCommand(raw: string): {
625
+ tool: McpWorkerToolName;
626
+ args: Record<string, unknown>;
627
+ };
628
+ export declare class McpWorkerRuntime {
629
+ #private;
630
+ constructor(directory?: string, sessionId?: string, defaultBackend?: string | undefined);
631
+ private resolveBackend;
632
+ private resolveWorkspace;
633
+ private workspace;
634
+ toolDefinitions(): Promise<({
635
+ name: string;
636
+ description: string;
637
+ annotations: {
638
+ title: string;
639
+ readOnlyHint: boolean;
640
+ destructiveHint: boolean;
641
+ idempotentHint: boolean;
642
+ openWorldHint: boolean;
643
+ };
644
+ inputSchema: {
645
+ type: string;
646
+ additionalProperties: boolean;
647
+ required: string[];
648
+ properties: {
649
+ backend: {
650
+ type: string;
651
+ description: string;
652
+ };
653
+ model: {
654
+ type: string;
655
+ description: string;
656
+ };
657
+ thinking: {
658
+ type: string;
659
+ description: string;
660
+ };
661
+ cwd: {
662
+ type: string;
663
+ description: string;
664
+ };
665
+ workspace: {
666
+ type: string;
667
+ description: string;
668
+ };
669
+ workerId?: never;
670
+ message?: never;
671
+ waitMs?: never;
672
+ action?: never;
673
+ requestId?: never;
674
+ optionId?: never;
675
+ content?: never;
676
+ offset?: never;
677
+ target?: never;
678
+ };
679
+ };
680
+ } | {
681
+ name: string;
682
+ description: string;
683
+ annotations: {
684
+ title: string;
685
+ readOnlyHint: boolean;
686
+ destructiveHint: boolean;
687
+ idempotentHint: boolean;
688
+ openWorldHint: boolean;
689
+ };
690
+ inputSchema: {
691
+ type: string;
692
+ additionalProperties: boolean;
693
+ required: string[];
694
+ properties: {
695
+ workerId: {
696
+ type: string;
697
+ description: string;
698
+ };
699
+ workspace: {
700
+ type: string;
701
+ description: string;
702
+ };
703
+ backend?: never;
704
+ model?: never;
705
+ thinking?: never;
706
+ cwd?: never;
707
+ message?: never;
708
+ waitMs?: never;
709
+ action?: never;
710
+ requestId?: never;
711
+ optionId?: never;
712
+ content?: never;
713
+ offset?: never;
714
+ target?: never;
715
+ };
716
+ };
717
+ } | {
718
+ name: string;
719
+ description: string;
720
+ annotations: {
721
+ title: string;
722
+ readOnlyHint: boolean;
723
+ destructiveHint: boolean;
724
+ idempotentHint: boolean;
725
+ openWorldHint: boolean;
726
+ };
727
+ inputSchema: {
728
+ type: string;
729
+ additionalProperties: boolean;
730
+ required: string[];
731
+ properties: {
732
+ workerId: {
733
+ type: string;
734
+ description: string;
735
+ };
736
+ message: {
737
+ type: string;
738
+ description: string;
739
+ };
740
+ waitMs: {
741
+ type: string;
742
+ minimum: number;
743
+ maximum: number;
744
+ description: string;
745
+ };
746
+ workspace: {
747
+ type: string;
748
+ description: string;
749
+ };
750
+ backend?: never;
751
+ model?: never;
752
+ thinking?: never;
753
+ cwd?: never;
754
+ action?: never;
755
+ requestId?: never;
756
+ optionId?: never;
757
+ content?: never;
758
+ offset?: never;
759
+ target?: never;
760
+ };
761
+ };
762
+ } | {
763
+ name: string;
764
+ description: string;
765
+ annotations: {
766
+ title: string;
767
+ readOnlyHint: boolean;
768
+ destructiveHint: boolean;
769
+ idempotentHint: boolean;
770
+ openWorldHint: boolean;
771
+ };
772
+ inputSchema: {
773
+ type: string;
774
+ additionalProperties: boolean;
775
+ required: string[];
776
+ properties: {
777
+ workerId: {
778
+ type: string;
779
+ description: string;
780
+ };
781
+ action: {
782
+ type: string;
783
+ enum: ("accept" | "decline" | "cancel")[];
784
+ description: string;
785
+ };
786
+ requestId: {
787
+ type: string;
788
+ description: string;
789
+ };
790
+ optionId: {
791
+ type: string;
792
+ description: string;
793
+ };
794
+ content: {
795
+ type: string;
796
+ additionalProperties: boolean;
797
+ description: string;
798
+ };
799
+ waitMs: {
800
+ type: string;
801
+ minimum: number;
802
+ maximum: number;
803
+ description: string;
804
+ };
805
+ workspace: {
806
+ type: string;
807
+ description: string;
808
+ };
809
+ backend?: never;
810
+ model?: never;
811
+ thinking?: never;
812
+ cwd?: never;
813
+ message?: never;
814
+ offset?: never;
815
+ target?: never;
816
+ };
817
+ };
818
+ } | {
819
+ name: string;
820
+ description: string;
821
+ annotations: {
822
+ title: string;
823
+ readOnlyHint: boolean;
824
+ destructiveHint: boolean;
825
+ idempotentHint: boolean;
826
+ openWorldHint: boolean;
827
+ };
828
+ inputSchema: {
829
+ type: string;
830
+ additionalProperties: boolean;
831
+ required: string[];
832
+ properties: {
833
+ workerId: {
834
+ type: string;
835
+ description: string;
836
+ };
837
+ offset: {
838
+ type: string;
839
+ minimum: number;
840
+ description: string;
841
+ };
842
+ waitMs: {
843
+ type: string;
844
+ minimum: number;
845
+ maximum: number;
846
+ description: string;
847
+ };
848
+ workspace: {
849
+ type: string;
850
+ description: string;
851
+ };
852
+ backend?: never;
853
+ model?: never;
854
+ thinking?: never;
855
+ cwd?: never;
856
+ message?: never;
857
+ action?: never;
858
+ requestId?: never;
859
+ optionId?: never;
860
+ content?: never;
861
+ target?: never;
862
+ };
863
+ };
864
+ } | {
865
+ name: string;
866
+ description: string;
867
+ annotations: {
868
+ title: string;
869
+ readOnlyHint: boolean;
870
+ destructiveHint: boolean;
871
+ idempotentHint: boolean;
872
+ openWorldHint: boolean;
873
+ };
874
+ inputSchema: {
875
+ type: string;
876
+ additionalProperties: boolean;
877
+ required: never[];
878
+ properties: {
879
+ target: {
880
+ type: string;
881
+ enum: ("models" | "overview" | "workers" | "backends")[];
882
+ description: string;
883
+ };
884
+ workerId: {
885
+ type: string;
886
+ description: string;
887
+ };
888
+ backend: {
889
+ type: string;
890
+ description: string;
891
+ };
892
+ model: {
893
+ type: string;
894
+ description: string;
895
+ };
896
+ workspace: {
897
+ type: string;
898
+ description: string;
899
+ };
900
+ thinking?: never;
901
+ cwd?: never;
902
+ message?: never;
903
+ waitMs?: never;
904
+ action?: never;
905
+ requestId?: never;
906
+ optionId?: never;
907
+ content?: never;
908
+ offset?: never;
909
+ };
910
+ };
911
+ } | {
912
+ name: string;
913
+ description: string;
914
+ annotations: {
915
+ title: string;
916
+ readOnlyHint: boolean;
917
+ destructiveHint: boolean;
918
+ idempotentHint: boolean;
919
+ openWorldHint: boolean;
920
+ };
921
+ inputSchema: {
922
+ type: string;
923
+ additionalProperties: boolean;
924
+ required: never[];
925
+ properties: {
926
+ server: {
927
+ type: string;
928
+ description: string;
929
+ };
930
+ workspace: {
931
+ type: string;
932
+ description: string;
933
+ };
934
+ tool?: never;
935
+ arguments?: never;
936
+ };
937
+ };
938
+ } | {
939
+ name: string;
940
+ description: string;
941
+ annotations: {
942
+ title: string;
943
+ readOnlyHint: boolean;
944
+ destructiveHint: boolean;
945
+ idempotentHint: boolean;
946
+ openWorldHint: boolean;
947
+ };
948
+ inputSchema: {
949
+ type: string;
950
+ additionalProperties: boolean;
951
+ required: string[];
952
+ properties: {
953
+ server: {
954
+ type: string;
955
+ description: string;
956
+ };
957
+ tool: {
958
+ type: string;
959
+ description: string;
960
+ };
961
+ arguments: {
962
+ type: string;
963
+ additionalProperties: boolean;
964
+ description: string;
965
+ };
966
+ workspace: {
967
+ type: string;
968
+ description: string;
969
+ };
970
+ };
971
+ };
972
+ })[]>;
973
+ /** Wait until ACP handshake and model/thinking configuration finish so invalid options fail synchronously on create/resume. */
974
+ private waitReady;
975
+ private waitFor;
976
+ callTool(name: string, rawArgs: unknown, progress?: ProgressReporter): Promise<unknown>;
977
+ close(preserve?: boolean): Promise<void>;
978
+ }
979
+ export declare function handleMcpRequest(runtime: McpWorkerRuntime, message: unknown, notify?: (notification: Record<string, unknown>) => void): Promise<Record<string, unknown> | null>;
980
+ export declare function serveMcpStdio(runtime?: McpWorkerRuntime): Promise<void>;