@esso0428/pi-subagents 0.17.16 → 0.17.17

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 (359) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/ROADMAP.md +87 -0
  3. package/docs/post-0.17.6-agents-roster-viewer-spec.md +42 -0
  4. package/docs/post-0.17.6-durable-history-spec.md +41 -0
  5. package/docs/post-0.17.6-feature-specs.md +50 -0
  6. package/docs/post-0.17.6-nested-agents-spec.md +38 -0
  7. package/docs/post-0.17.6-recovery-shutdown-spec.md +46 -0
  8. package/docs/post-0.17.6-ui-latency-baseline-spec.md +46 -0
  9. package/docs/post-0.17.6-workflow-rpc-lifecycle-spec.md +54 -0
  10. package/package.json +1 -1
  11. package/src/agent-history.ts +2 -54
  12. package/src/agent-manager.ts +406 -1288
  13. package/src/agent-runner.ts +27 -251
  14. package/src/agent-types.ts +32 -188
  15. package/src/cross-extension-rpc.ts +20 -96
  16. package/src/custom-agents.ts +13 -170
  17. package/src/index.ts +480 -1920
  18. package/src/invocation-config.ts +3 -118
  19. package/src/model-resolver.ts +0 -18
  20. package/src/output-file.ts +6 -61
  21. package/src/prompts.ts +2 -45
  22. package/src/schedule.ts +14 -35
  23. package/src/settings.ts +2 -301
  24. package/src/status-note.ts +1 -66
  25. package/src/types.ts +10 -177
  26. package/src/ui/agent-widget.ts +57 -278
  27. package/src/ui/conversation-blocks.ts +0 -6
  28. package/src/ui/conversation-timeline.ts +25 -139
  29. package/src/ui/conversation-viewer.ts +48 -212
  30. package/src/ui/schedule-menu.ts +8 -9
  31. package/src/usage.ts +2 -109
  32. package/src/worktree.ts +55 -69
  33. package/dist/abortable.d.ts +0 -13
  34. package/dist/abortable.d.ts.map +0 -1
  35. package/dist/abortable.js +0 -43
  36. package/dist/abortable.js.map +0 -1
  37. package/dist/agent-color.d.ts +0 -36
  38. package/dist/agent-color.d.ts.map +0 -1
  39. package/dist/agent-color.js +0 -124
  40. package/dist/agent-color.js.map +0 -1
  41. package/dist/agent-file-toggle.d.ts +0 -126
  42. package/dist/agent-file-toggle.d.ts.map +0 -1
  43. package/dist/agent-file-toggle.js +0 -259
  44. package/dist/agent-file-toggle.js.map +0 -1
  45. package/dist/agent-history-list.d.ts +0 -19
  46. package/dist/agent-history-list.d.ts.map +0 -1
  47. package/dist/agent-history-list.js +0 -69
  48. package/dist/agent-history-list.js.map +0 -1
  49. package/dist/agent-history.d.ts +0 -35
  50. package/dist/agent-history.d.ts.map +0 -1
  51. package/dist/agent-history.js +0 -188
  52. package/dist/agent-history.js.map +0 -1
  53. package/dist/agent-manager.d.ts +0 -503
  54. package/dist/agent-manager.d.ts.map +0 -1
  55. package/dist/agent-manager.js +0 -1572
  56. package/dist/agent-manager.js.map +0 -1
  57. package/dist/agent-recovery.d.ts +0 -37
  58. package/dist/agent-recovery.d.ts.map +0 -1
  59. package/dist/agent-recovery.js +0 -171
  60. package/dist/agent-recovery.js.map +0 -1
  61. package/dist/agent-runner.d.ts +0 -303
  62. package/dist/agent-runner.d.ts.map +0 -1
  63. package/dist/agent-runner.js +0 -1003
  64. package/dist/agent-runner.js.map +0 -1
  65. package/dist/agent-types.d.ts +0 -120
  66. package/dist/agent-types.d.ts.map +0 -1
  67. package/dist/agent-types.js +0 -301
  68. package/dist/agent-types.js.map +0 -1
  69. package/dist/child-context.d.ts +0 -3
  70. package/dist/child-context.d.ts.map +0 -1
  71. package/dist/child-context.js +0 -13
  72. package/dist/child-context.js.map +0 -1
  73. package/dist/context.d.ts +0 -13
  74. package/dist/context.d.ts.map +0 -1
  75. package/dist/context.js +0 -57
  76. package/dist/context.js.map +0 -1
  77. package/dist/cross-extension-rpc.d.ts +0 -67
  78. package/dist/cross-extension-rpc.d.ts.map +0 -1
  79. package/dist/cross-extension-rpc.js +0 -139
  80. package/dist/cross-extension-rpc.js.map +0 -1
  81. package/dist/custom-agents.d.ts +0 -55
  82. package/dist/custom-agents.d.ts.map +0 -1
  83. package/dist/custom-agents.js +0 -309
  84. package/dist/custom-agents.js.map +0 -1
  85. package/dist/default-agents.d.ts +0 -8
  86. package/dist/default-agents.d.ts.map +0 -1
  87. package/dist/default-agents.js +0 -123
  88. package/dist/default-agents.js.map +0 -1
  89. package/dist/enabled-models.d.ts +0 -50
  90. package/dist/enabled-models.d.ts.map +0 -1
  91. package/dist/enabled-models.js +0 -146
  92. package/dist/enabled-models.js.map +0 -1
  93. package/dist/env.d.ts +0 -7
  94. package/dist/env.d.ts.map +0 -1
  95. package/dist/env.js +0 -29
  96. package/dist/env.js.map +0 -1
  97. package/dist/group-join.d.ts +0 -33
  98. package/dist/group-join.d.ts.map +0 -1
  99. package/dist/group-join.js +0 -117
  100. package/dist/group-join.js.map +0 -1
  101. package/dist/index.d.ts +0 -51
  102. package/dist/index.d.ts.map +0 -1
  103. package/dist/index.js +0 -3687
  104. package/dist/index.js.map +0 -1
  105. package/dist/invocation-config.d.ts +0 -108
  106. package/dist/invocation-config.d.ts.map +0 -1
  107. package/dist/invocation-config.js +0 -84
  108. package/dist/invocation-config.js.map +0 -1
  109. package/dist/memory.d.ts +0 -54
  110. package/dist/memory.d.ts.map +0 -1
  111. package/dist/memory.js +0 -166
  112. package/dist/memory.js.map +0 -1
  113. package/dist/mention-clone.d.ts +0 -88
  114. package/dist/mention-clone.d.ts.map +0 -1
  115. package/dist/mention-clone.js +0 -154
  116. package/dist/mention-clone.js.map +0 -1
  117. package/dist/mention.d.ts +0 -82
  118. package/dist/mention.d.ts.map +0 -1
  119. package/dist/mention.js +0 -132
  120. package/dist/mention.js.map +0 -1
  121. package/dist/model-resolver.d.ts +0 -37
  122. package/dist/model-resolver.d.ts.map +0 -1
  123. package/dist/model-resolver.js +0 -96
  124. package/dist/model-resolver.js.map +0 -1
  125. package/dist/model-scope.d.ts +0 -50
  126. package/dist/model-scope.d.ts.map +0 -1
  127. package/dist/model-scope.js +0 -49
  128. package/dist/model-scope.js.map +0 -1
  129. package/dist/nested-tools.d.ts +0 -57
  130. package/dist/nested-tools.d.ts.map +0 -1
  131. package/dist/nested-tools.js +0 -301
  132. package/dist/nested-tools.js.map +0 -1
  133. package/dist/nico-overrides.d.ts +0 -54
  134. package/dist/nico-overrides.d.ts.map +0 -1
  135. package/dist/nico-overrides.js +0 -170
  136. package/dist/nico-overrides.js.map +0 -1
  137. package/dist/output-file.d.ts +0 -44
  138. package/dist/output-file.d.ts.map +0 -1
  139. package/dist/output-file.js +0 -156
  140. package/dist/output-file.js.map +0 -1
  141. package/dist/prompts.d.ts +0 -56
  142. package/dist/prompts.d.ts.map +0 -1
  143. package/dist/prompts.js +0 -92
  144. package/dist/prompts.js.map +0 -1
  145. package/dist/schedule-store.d.ts +0 -39
  146. package/dist/schedule-store.d.ts.map +0 -1
  147. package/dist/schedule-store.js +0 -156
  148. package/dist/schedule-store.js.map +0 -1
  149. package/dist/schedule.d.ts +0 -110
  150. package/dist/schedule.d.ts.map +0 -1
  151. package/dist/schedule.js +0 -360
  152. package/dist/schedule.js.map +0 -1
  153. package/dist/settings.d.ts +0 -354
  154. package/dist/settings.d.ts.map +0 -1
  155. package/dist/settings.js +0 -247
  156. package/dist/settings.js.map +0 -1
  157. package/dist/skill-loader.d.ts +0 -25
  158. package/dist/skill-loader.d.ts.map +0 -1
  159. package/dist/skill-loader.js +0 -94
  160. package/dist/skill-loader.js.map +0 -1
  161. package/dist/status-note.d.ts +0 -62
  162. package/dist/status-note.d.ts.map +0 -1
  163. package/dist/status-note.js +0 -86
  164. package/dist/status-note.js.map +0 -1
  165. package/dist/structured-output.d.ts +0 -62
  166. package/dist/structured-output.d.ts.map +0 -1
  167. package/dist/structured-output.js +0 -113
  168. package/dist/structured-output.js.map +0 -1
  169. package/dist/types.d.ts +0 -372
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/types.js +0 -6
  172. package/dist/types.js.map +0 -1
  173. package/dist/ui/agent-mention.d.ts +0 -83
  174. package/dist/ui/agent-mention.d.ts.map +0 -1
  175. package/dist/ui/agent-mention.js +0 -188
  176. package/dist/ui/agent-mention.js.map +0 -1
  177. package/dist/ui/agent-widget.d.ts +0 -241
  178. package/dist/ui/agent-widget.d.ts.map +0 -1
  179. package/dist/ui/agent-widget.js +0 -992
  180. package/dist/ui/agent-widget.js.map +0 -1
  181. package/dist/ui/ccstyle/diff/ansi-utils.d.ts +0 -11
  182. package/dist/ui/ccstyle/diff/ansi-utils.d.ts.map +0 -1
  183. package/dist/ui/ccstyle/diff/ansi-utils.js +0 -145
  184. package/dist/ui/ccstyle/diff/ansi-utils.js.map +0 -1
  185. package/dist/ui/ccstyle/diff/diff-presentation.d.ts +0 -12
  186. package/dist/ui/ccstyle/diff/diff-presentation.d.ts.map +0 -1
  187. package/dist/ui/ccstyle/diff/diff-presentation.js +0 -48
  188. package/dist/ui/ccstyle/diff/diff-presentation.js.map +0 -1
  189. package/dist/ui/ccstyle/diff/diff-renderer.d.ts +0 -46
  190. package/dist/ui/ccstyle/diff/diff-renderer.d.ts.map +0 -1
  191. package/dist/ui/ccstyle/diff/diff-renderer.js +0 -2049
  192. package/dist/ui/ccstyle/diff/diff-renderer.js.map +0 -1
  193. package/dist/ui/ccstyle/diff/line-width-safety.d.ts +0 -12
  194. package/dist/ui/ccstyle/diff/line-width-safety.d.ts.map +0 -1
  195. package/dist/ui/ccstyle/diff/line-width-safety.js +0 -58
  196. package/dist/ui/ccstyle/diff/line-width-safety.js.map +0 -1
  197. package/dist/ui/ccstyle/diff/render-utils.d.ts +0 -6
  198. package/dist/ui/ccstyle/diff/render-utils.d.ts.map +0 -1
  199. package/dist/ui/ccstyle/diff/render-utils.js +0 -25
  200. package/dist/ui/ccstyle/diff/render-utils.js.map +0 -1
  201. package/dist/ui/ccstyle/diff/shiki-highlight.d.ts +0 -19
  202. package/dist/ui/ccstyle/diff/shiki-highlight.d.ts.map +0 -1
  203. package/dist/ui/ccstyle/diff/shiki-highlight.js +0 -85
  204. package/dist/ui/ccstyle/diff/shiki-highlight.js.map +0 -1
  205. package/dist/ui/ccstyle/diff/types.d.ts +0 -22
  206. package/dist/ui/ccstyle/diff/types.d.ts.map +0 -1
  207. package/dist/ui/ccstyle/diff/types.js +0 -10
  208. package/dist/ui/ccstyle/diff/types.js.map +0 -1
  209. package/dist/ui/ccstyle/diff/write-display-utils.d.ts +0 -2
  210. package/dist/ui/ccstyle/diff/write-display-utils.d.ts.map +0 -1
  211. package/dist/ui/ccstyle/diff/write-display-utils.js +0 -12
  212. package/dist/ui/ccstyle/diff/write-display-utils.js.map +0 -1
  213. package/dist/ui/ccstyle/tool-renderer.d.ts +0 -17
  214. package/dist/ui/ccstyle/tool-renderer.d.ts.map +0 -1
  215. package/dist/ui/ccstyle/tool-renderer.js +0 -74
  216. package/dist/ui/ccstyle/tool-renderer.js.map +0 -1
  217. package/dist/ui/ccstyle/tool-result.d.ts +0 -44
  218. package/dist/ui/ccstyle/tool-result.d.ts.map +0 -1
  219. package/dist/ui/ccstyle/tool-result.js +0 -423
  220. package/dist/ui/ccstyle/tool-result.js.map +0 -1
  221. package/dist/ui/conversation-blocks.d.ts +0 -46
  222. package/dist/ui/conversation-blocks.d.ts.map +0 -1
  223. package/dist/ui/conversation-blocks.js +0 -313
  224. package/dist/ui/conversation-blocks.js.map +0 -1
  225. package/dist/ui/conversation-nvim.d.ts +0 -8
  226. package/dist/ui/conversation-nvim.d.ts.map +0 -1
  227. package/dist/ui/conversation-nvim.js +0 -117
  228. package/dist/ui/conversation-nvim.js.map +0 -1
  229. package/dist/ui/conversation-role.d.ts +0 -13
  230. package/dist/ui/conversation-role.d.ts.map +0 -1
  231. package/dist/ui/conversation-role.js +0 -39
  232. package/dist/ui/conversation-role.js.map +0 -1
  233. package/dist/ui/conversation-search.d.ts +0 -39
  234. package/dist/ui/conversation-search.d.ts.map +0 -1
  235. package/dist/ui/conversation-search.js +0 -124
  236. package/dist/ui/conversation-search.js.map +0 -1
  237. package/dist/ui/conversation-timeline.d.ts +0 -102
  238. package/dist/ui/conversation-timeline.d.ts.map +0 -1
  239. package/dist/ui/conversation-timeline.js +0 -555
  240. package/dist/ui/conversation-timeline.js.map +0 -1
  241. package/dist/ui/conversation-viewer.d.ts +0 -138
  242. package/dist/ui/conversation-viewer.d.ts.map +0 -1
  243. package/dist/ui/conversation-viewer.js +0 -1175
  244. package/dist/ui/conversation-viewer.js.map +0 -1
  245. package/dist/ui/schedule-menu.d.ts +0 -17
  246. package/dist/ui/schedule-menu.d.ts.map +0 -1
  247. package/dist/ui/schedule-menu.js +0 -95
  248. package/dist/ui/schedule-menu.js.map +0 -1
  249. package/dist/ui/select-item.d.ts +0 -28
  250. package/dist/ui/select-item.d.ts.map +0 -1
  251. package/dist/ui/select-item.js +0 -35
  252. package/dist/ui/select-item.js.map +0 -1
  253. package/dist/ui/viewer-keys.d.ts +0 -21
  254. package/dist/ui/viewer-keys.d.ts.map +0 -1
  255. package/dist/ui/viewer-keys.js +0 -18
  256. package/dist/ui/viewer-keys.js.map +0 -1
  257. package/dist/ui/workflow-card.d.ts +0 -176
  258. package/dist/ui/workflow-card.d.ts.map +0 -1
  259. package/dist/ui/workflow-card.js +0 -333
  260. package/dist/ui/workflow-card.js.map +0 -1
  261. package/dist/ui/workflow-dialog.d.ts +0 -306
  262. package/dist/ui/workflow-dialog.d.ts.map +0 -1
  263. package/dist/ui/workflow-dialog.js +0 -844
  264. package/dist/ui/workflow-dialog.js.map +0 -1
  265. package/dist/ui/workflow-menu.d.ts +0 -42
  266. package/dist/ui/workflow-menu.d.ts.map +0 -1
  267. package/dist/ui/workflow-menu.js +0 -127
  268. package/dist/ui/workflow-menu.js.map +0 -1
  269. package/dist/usage.d.ts +0 -136
  270. package/dist/usage.d.ts.map +0 -1
  271. package/dist/usage.js +0 -121
  272. package/dist/usage.js.map +0 -1
  273. package/dist/workflow/collisions.d.ts +0 -96
  274. package/dist/workflow/collisions.d.ts.map +0 -1
  275. package/dist/workflow/collisions.js +0 -89
  276. package/dist/workflow/collisions.js.map +0 -1
  277. package/dist/workflow/entry.d.ts +0 -33
  278. package/dist/workflow/entry.d.ts.map +0 -1
  279. package/dist/workflow/entry.js +0 -30
  280. package/dist/workflow/entry.js.map +0 -1
  281. package/dist/workflow/host.d.ts +0 -63
  282. package/dist/workflow/host.d.ts.map +0 -1
  283. package/dist/workflow/host.js +0 -363
  284. package/dist/workflow/host.js.map +0 -1
  285. package/dist/workflow/journal.d.ts +0 -98
  286. package/dist/workflow/journal.d.ts.map +0 -1
  287. package/dist/workflow/journal.js +0 -121
  288. package/dist/workflow/journal.js.map +0 -1
  289. package/dist/workflow/json-schema.d.ts +0 -52
  290. package/dist/workflow/json-schema.d.ts.map +0 -1
  291. package/dist/workflow/json-schema.js +0 -112
  292. package/dist/workflow/json-schema.js.map +0 -1
  293. package/dist/workflow/meta.d.ts +0 -68
  294. package/dist/workflow/meta.d.ts.map +0 -1
  295. package/dist/workflow/meta.js +0 -318
  296. package/dist/workflow/meta.js.map +0 -1
  297. package/dist/workflow/progress.d.ts +0 -225
  298. package/dist/workflow/progress.d.ts.map +0 -1
  299. package/dist/workflow/progress.js +0 -362
  300. package/dist/workflow/progress.js.map +0 -1
  301. package/dist/workflow/runtime.d.ts +0 -335
  302. package/dist/workflow/runtime.d.ts.map +0 -1
  303. package/dist/workflow/runtime.js +0 -831
  304. package/dist/workflow/runtime.js.map +0 -1
  305. package/dist/workflow/saved.d.ts +0 -91
  306. package/dist/workflow/saved.d.ts.map +0 -1
  307. package/dist/workflow/saved.js +0 -204
  308. package/dist/workflow/saved.js.map +0 -1
  309. package/dist/workflow/task.d.ts +0 -137
  310. package/dist/workflow/task.d.ts.map +0 -1
  311. package/dist/workflow/task.js +0 -208
  312. package/dist/workflow/task.js.map +0 -1
  313. package/dist/workflow/tool-description.d.ts +0 -39
  314. package/dist/workflow/tool-description.d.ts.map +0 -1
  315. package/dist/workflow/tool-description.js +0 -200
  316. package/dist/workflow/tool-description.js.map +0 -1
  317. package/dist/workflow/worker-source.d.ts +0 -48
  318. package/dist/workflow/worker-source.d.ts.map +0 -1
  319. package/dist/workflow/worker-source.js +0 -779
  320. package/dist/workflow/worker-source.js.map +0 -1
  321. package/dist/worktree.d.ts +0 -53
  322. package/dist/worktree.d.ts.map +0 -1
  323. package/dist/worktree.js +0 -165
  324. package/dist/worktree.js.map +0 -1
  325. package/dist/write-execution.d.ts +0 -42
  326. package/dist/write-execution.d.ts.map +0 -1
  327. package/dist/write-execution.js +0 -138
  328. package/dist/write-execution.js.map +0 -1
  329. package/dist/xml.d.ts +0 -11
  330. package/dist/xml.d.ts.map +0 -1
  331. package/dist/xml.js +0 -13
  332. package/dist/xml.js.map +0 -1
  333. package/src/abortable.ts +0 -43
  334. package/src/agent-color.ts +0 -161
  335. package/src/agent-file-toggle.ts +0 -269
  336. package/src/child-context.ts +0 -15
  337. package/src/mention-clone.ts +0 -196
  338. package/src/mention.ts +0 -141
  339. package/src/model-scope.ts +0 -70
  340. package/src/nested-tools.ts +0 -424
  341. package/src/structured-output.ts +0 -130
  342. package/src/ui/agent-mention.ts +0 -216
  343. package/src/ui/select-item.ts +0 -45
  344. package/src/ui/workflow-card.ts +0 -470
  345. package/src/ui/workflow-dialog.ts +0 -1115
  346. package/src/ui/workflow-menu.ts +0 -166
  347. package/src/workflow/collisions.ts +0 -123
  348. package/src/workflow/entry.ts +0 -47
  349. package/src/workflow/host.ts +0 -403
  350. package/src/workflow/journal.ts +0 -164
  351. package/src/workflow/json-schema.ts +0 -128
  352. package/src/workflow/meta.ts +0 -325
  353. package/src/workflow/progress.ts +0 -550
  354. package/src/workflow/runtime.ts +0 -1219
  355. package/src/workflow/saved.ts +0 -217
  356. package/src/workflow/task.ts +0 -302
  357. package/src/workflow/tool-description.ts +0 -200
  358. package/src/workflow/worker-source.ts +0 -781
  359. package/src/xml.ts +0 -13
@@ -1,67 +0,0 @@
1
- /**
2
- * Cross-extension RPC handlers for the subagents extension.
3
- *
4
- * Exposes ping, spawn, stop, and consume RPCs over the pi.events event bus,
5
- * using per-request scoped reply channels.
6
- *
7
- * Reply envelope follows pi-mono convention:
8
- * success → { success: true, data?: T }
9
- * error → { success: false, error: string }
10
- *
11
- * @see docs/rpc.md — the caller-facing integration reference: spawn options
12
- * (including the fields spawnTopLevel strips), every error string, the
13
- * completion-notification race, and what protocol version 2 does not promise.
14
- */
15
- import type { AgentRecord } from "./types.js";
16
- /** Minimal event bus interface needed by the RPC handlers. */
17
- export interface EventBus {
18
- on(event: string, handler: (data: unknown) => void): () => void;
19
- emit(event: string, data: unknown): void;
20
- }
21
- /** RPC reply envelope — matches pi-mono's RpcResponse shape. */
22
- export type RpcReply<T = void> = {
23
- success: true;
24
- data?: T;
25
- } | {
26
- success: false;
27
- error: string;
28
- };
29
- /** RPC protocol version — bumped when the envelope or method contracts change. */
30
- export declare const PROTOCOL_VERSION = 2;
31
- /** Minimal AgentManager interface needed by the spawn/stop/consume RPCs. */
32
- export interface SpawnCapable {
33
- spawn(pi: unknown, ctx: unknown, type: string, prompt: string, options: any): string;
34
- /** Resolves once the spawned agent is running; rejects on a startup failure. */
35
- awaitStartup(id: string): Promise<void>;
36
- abort(id: string): boolean;
37
- /**
38
- * The record behind an id, for the stop handler's ownership check. Narrowed
39
- * to the two fields `isTopLevelAgent` reads, so the RPC layer keeps its
40
- * deliberately shallow view of the manager.
41
- */
42
- getRecord(id: string): Pick<AgentRecord, "parentAgentId" | "workflowId"> | undefined;
43
- /**
44
- * Mark a settled agent's result as read by the caller, suppressing the
45
- * completion notification — what `get_subagent_result` does when it returns
46
- * one. False when there is no such agent, or it has not settled yet.
47
- */
48
- consumeResult(id: string): boolean;
49
- }
50
- export interface RpcDeps {
51
- events: EventBus;
52
- pi: unknown;
53
- getCtx: () => unknown | undefined;
54
- manager: SpawnCapable;
55
- }
56
- export interface RpcHandle {
57
- unsubPing: () => void;
58
- unsubSpawn: () => void;
59
- unsubStop: () => void;
60
- unsubConsume: () => void;
61
- }
62
- /**
63
- * Register ping, spawn, stop, and consume RPC handlers on the event bus.
64
- * Returns unsub functions for cleanup.
65
- */
66
- export declare function registerRpcHandlers(deps: RpcDeps): RpcHandle;
67
- //# sourceMappingURL=cross-extension-rpc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-extension-rpc.d.ts","sourceRoot":"","sources":["../src/cross-extension-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAChE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1C;AAED,gEAAgE;AAChE,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,IAAI,IACzB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,CAAC;IACrF,gFAAgF;IAChF,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,YAAY,CAAC,GAAG,SAAS,CAAC;IACrF;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AA0BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAqG5D"}
@@ -1,139 +0,0 @@
1
- /**
2
- * Cross-extension RPC handlers for the subagents extension.
3
- *
4
- * Exposes ping, spawn, stop, and consume RPCs over the pi.events event bus,
5
- * using per-request scoped reply channels.
6
- *
7
- * Reply envelope follows pi-mono convention:
8
- * success → { success: true, data?: T }
9
- * error → { success: false, error: string }
10
- *
11
- * @see docs/rpc.md — the caller-facing integration reference: spawn options
12
- * (including the fields spawnTopLevel strips), every error string, the
13
- * completion-notification race, and what protocol version 2 does not promise.
14
- */
15
- import { isTopLevelAgent } from "./agent-manager.js";
16
- import { resolveModel } from "./model-resolver.js";
17
- import { checkModelScope } from "./model-scope.js";
18
- /** RPC protocol version — bumped when the envelope or method contracts change. */
19
- export const PROTOCOL_VERSION = 2;
20
- /**
21
- * Wire a single RPC handler: listen on `channel`, run `fn(params)`,
22
- * emit the reply envelope on `channel:reply:${requestId}`.
23
- */
24
- function handleRpc(events, channel, fn) {
25
- return events.on(channel, async (raw) => {
26
- const params = raw;
27
- try {
28
- const data = await fn(params);
29
- const reply = { success: true };
30
- if (data !== undefined)
31
- reply.data = data;
32
- events.emit(`${channel}:reply:${params.requestId}`, reply);
33
- }
34
- catch (err) {
35
- events.emit(`${channel}:reply:${params.requestId}`, {
36
- success: false, error: err?.message ?? String(err),
37
- });
38
- }
39
- });
40
- }
41
- /**
42
- * Register ping, spawn, stop, and consume RPC handlers on the event bus.
43
- * Returns unsub functions for cleanup.
44
- */
45
- export function registerRpcHandlers(deps) {
46
- const { events, pi, getCtx, manager } = deps;
47
- const unsubPing = handleRpc(events, "subagents:rpc:ping", () => {
48
- return { version: PROTOCOL_VERSION };
49
- });
50
- const unsubSpawn = handleRpc(events, "subagents:rpc:spawn", async ({ type, prompt, options }) => {
51
- const ctx = getCtx();
52
- if (!ctx)
53
- throw new Error("No active session");
54
- // Cross-extension RPC callers (e.g. pi-tasks TaskExecute) naturally
55
- // forward serializable values, so options.model can be a string like
56
- // "openai-codex/gpt-5.5". Resolve it to a real Model instance here
57
- // — same pattern the scheduler path already uses — so the spawned
58
- // agent's auth lookup doesn't crash with "No API key found for
59
- // undefined".
60
- let normalizedOptions = options ?? {};
61
- // `!= null` on purpose: a JSON-forwarding caller can serialize an unset
62
- // field as null, and the runner reads `options.model ?? default`, so null
63
- // means "inherit" — not an override to resolve or scope-check.
64
- const override = normalizedOptions.model;
65
- if (override != null) {
66
- const { modelRegistry, cwd } = ctx;
67
- // Names the override the same way in both messages below; an object
68
- // override would otherwise interpolate as "[object Object]".
69
- const label = typeof override === "string" ? override : `${override.provider}/${override.id}`;
70
- if (!modelRegistry) {
71
- throw new Error(`Model override "${label}" provided but ctx.modelRegistry is unavailable`);
72
- }
73
- let model = override;
74
- if (typeof override === "string") {
75
- const resolved = resolveModel(override, modelRegistry);
76
- if (typeof resolved === "string") {
77
- // resolveModel returns a human-readable error string when the
78
- // input doesn't match any available model. Surface it instead of
79
- // silently falling back so the caller sees the auth/typo issue.
80
- throw new Error(resolved);
81
- }
82
- model = resolved;
83
- normalizedOptions = { ...normalizedOptions, model: resolved };
84
- }
85
- // A model on the RPC payload is an orchestrator-level choice, exactly
86
- // like Agent({ model }) — so it gets the Agent tool's hard error, never
87
- // the frontmatter warn (#240). The check reads the RESOLVED model:
88
- // resolveModel is fuzzy, so a bare "sonnet" can land on a provider the
89
- // caller never named. Frontmatter-pinned and parent-inherited models are
90
- // resolved later, in agent-runner, and keep warn-and-proceed.
91
- const verdict = checkModelScope({
92
- model,
93
- cwd: cwd ?? process.cwd(),
94
- modelRegistry,
95
- callerSupplied: true,
96
- agentLabel: type,
97
- modelInput: label,
98
- });
99
- if (verdict.kind === "error")
100
- throw new Error(verdict.message);
101
- }
102
- const id = manager.spawn(pi, ctx, type, prompt, normalizedOptions);
103
- // With isolation: "worktree" the agent starts asynchronously — wait for
104
- // it, so a strict-isolation failure is still an error envelope rather
105
- // than an id for an agent that never ran.
106
- await manager.awaitStartup(id);
107
- return { id };
108
- });
109
- const unsubStop = handleRpc(events, "subagents:rpc:stop", ({ agentId }) => {
110
- const record = manager.getRecord(agentId);
111
- if (!record)
112
- throw new Error("Agent not found");
113
- // Only the session's own agents are this RPC's to stop. A nested child or
114
- // a workflow's agent is owned by something that is *waiting on it*, and
115
- // aborting it out from under that owner turns another extension's stop
116
- // into a failed step here. Defence in depth rather than a live hole: no
117
- // RPC hands out agent ids, so a caller has no ordinary way to name one it
118
- // does not own — but the guard is cheap and the id may leak some other
119
- // way. Same refuse-what-we-should-not-touch stance as `consume` below.
120
- if (!isTopLevelAgent(record))
121
- throw new Error("Agent is owned by another agent or workflow");
122
- // Not "not found" — the lookup above already proved it exists. `abort`
123
- // returns false only for a record that is neither running nor queued,
124
- // which is an agent that has already finished.
125
- if (!manager.abort(agentId))
126
- throw new Error("Agent is not running");
127
- });
128
- // A caller that has already shown the model an agent's result — pi-tasks'
129
- // TaskOutput is the one in practice — says so here, so the completion
130
- // notification for that same result is not delivered on top of it and does
131
- // not cost the parent a turn. Deliberately outside the ping version
132
- // handshake: an extension built against protocol v2 simply never calls it.
133
- const unsubConsume = handleRpc(events, "subagents:rpc:consume", ({ agentId }) => {
134
- if (!manager.consumeResult(agentId))
135
- throw new Error("Agent not found or still running");
136
- });
137
- return { unsubPing, unsubSpawn, unsubStop, unsubConsume };
138
- }
139
- //# sourceMappingURL=cross-extension-rpc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-extension-rpc.js","sourceRoot":"","sources":["../src/cross-extension-rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAsB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAcnD,kFAAkF;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAoClC;;;GAGG;AACH,SAAS,SAAS,CAChB,MAAgB,EAChB,OAAe,EACf,EAA6C;IAE7C,OAAO,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,GAAY,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,GAAQ,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;YAC9B,MAAM,KAAK,GAAsC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACnE,IAAI,IAAI,KAAK,SAAS;gBAAE,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,UAAU,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,UAAU,MAAM,CAAC,SAAS,EAAE,EAAE;gBAClD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC;aACnD,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC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AK,CAAC,iBAAiB,CAAC,CAAC;QAChD,0EAA0E;QAC1E,wEAAwE;QACxE,uEAAuE;QACvE,wEAAwE;QACxE,0EAA0E;QAC1E,uEAAuE;QACvE,uEAAuE;QACvE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC7F,uEAAuE;QACvE,sEAAsE;QACtE,+CAA+C;QAC/C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACvE,CAAC,CACF,CAAC;IAEF,0EAA0E;IAC1E,sEAAsE;IACtE,2EAA2E;IAC3E,oEAAoE;IACpE,2EAA2E;IAC3E,MAAM,YAAY,GAAG,SAAS,CAC5B,MAAM,EAAE,uBAAuB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC3F,CAAC,CACF,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAC5D,CAAC"}
@@ -1,55 +0,0 @@
1
- /**
2
- * custom-agents.ts — Load user-defined agents from project (.pi/agents/, plus the shared .agents/agents/ workspace) and global ($PI_CODING_AGENT_DIR/agents/, default ~/.pi/agent/agents/) locations.
3
- */
4
- import type { AgentConfig } from "./types.js";
5
- /**
6
- * Scan for custom agent .md files from multiple locations.
7
- * Discovery hierarchy (higher priority wins):
8
- * 1. Project: <cwd>/.pi/agents/*.md (authoritative — also where /agents writes)
9
- * 2. Workspace: <cwd>/.agents/agents/*.md (shared cross-tool .agents workspace, read-only)
10
- * 3. Global: $PI_CODING_AGENT_DIR/agents/*.md (default: ~/.pi/agent/agents/*.md)
11
- *
12
- * Project-level agents override global ones with the same name. On a name clash
13
- * between the two project locations, .pi/agents wins — .pi stays the project
14
- * authority; .agents/agents is an additional read location.
15
- * Any name is allowed — names matching defaults (e.g. "Explore") override them.
16
- *
17
- * An agent's type comes from its frontmatter `name:`, falling back to the
18
- * filename — Claude Code's rule, where "the filename doesn't have to match".
19
- * Because the type is now declared rather than derived from a unique path, two
20
- * files can claim the same one; the later load wins, as it always has for a
21
- * filename clash, and `warnSkippedOverride` reports the substitution.
22
- */
23
- export declare function loadCustomAgents(cwd: string, strict?: boolean): Map<string, AgentConfig>;
24
- /**
25
- * Read and parse one agent file, or warn and return undefined for the caller to
26
- * skip. One bad file must not take the whole extension down with it — an
27
- * unparseable `.md` used to abort activation, so pi exited before the TUI.
28
- *
29
- * The path is as much of the fix as the recovery: a bare YAML error ("line 2,
30
- * column 14") is unactionable when agents come from three directories at once,
31
- * and the only other symptom is `Unknown agent type`, which reads like a typo.
32
- *
33
- * Under `strict` the same failure rethrows, still naming the path, so callers
34
- * that opted into failing closed stop rather than run a substituted agent.
35
- */
36
- /**
37
- * Parse an agent file's frontmatter, tolerating a leading UTF-8 BOM.
38
- *
39
- * Editors across the Windows/CJK world write UTF-8 with a BOM by default, and
40
- * pi's parser did not look past one before 0.84.3: the fence never matched, so
41
- * the frontmatter came back empty and the *whole file* — YAML and all — became
42
- * the body. An agent authored that way silently lost every field. `tools: none`
43
- * going missing is the sharp edge: the agent registers with the default
44
- * toolset rather than none, which is a wider grant than its author wrote.
45
- *
46
- * Stripped here rather than detected per pi version, because this is the only
47
- * place agent files are read and the BOM is a file-encoding artifact, not
48
- * content — normalising it at the boundary keeps one behaviour across the whole
49
- * supported peer range instead of forking on what happens to be installed.
50
- */
51
- export declare function parseAgentFrontmatter<T extends Record<string, unknown>>(content: string): {
52
- frontmatter: T;
53
- body: string;
54
- };
55
- //# sourceMappingURL=custom-agents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-agents.d.ts","sourceRoot":"","sources":["../src/custom-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,WAAW,EAA6C,MAAM,YAAY,CAAC;AAiBzF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAatF;AAqFD;;;;;;;;;;;GAWG;AACH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,WAAW,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAE1H"}
@@ -1,309 +0,0 @@
1
- /**
2
- * custom-agents.ts — Load user-defined agents from project (.pi/agents/, plus the shared .agents/agents/ workspace) and global ($PI_CODING_AGENT_DIR/agents/, default ~/.pi/agent/agents/) locations.
3
- */
4
- import { existsSync, readdirSync, readFileSync } from "node:fs";
5
- import { basename, join } from "node:path";
6
- import { getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
7
- import { BUILTIN_TOOL_NAMES } from "./agent-types.js";
8
- /**
9
- * The one thing a declared `name:` may not contain, matching Claude Code
10
- * exactly: it reserves `:` for plugin-scoped identifiers (`my-plugin:reviewer`)
11
- * and refuses to load a file whose name uses one.
12
- *
13
- * Nothing else is rejected. Claude Code's docs describe names as "lowercase
14
- * letters and hyphens", but that is guidance — the only stated load failure is
15
- * the colon, so `name: Code Reviewer` must work here too. (The stricter
16
- * letters/digits/underscore/hyphen regex in Claude Code applies to the Agent
17
- * tool's spawn-time `name` parameter, which is a different field.) Mixed case
18
- * has to be allowed regardless: the built-in types `Explore` and `Plan` use it,
19
- * and a file must be able to override one.
20
- */
21
- const RESERVED_IN_TYPE = ":";
22
- /**
23
- * Scan for custom agent .md files from multiple locations.
24
- * Discovery hierarchy (higher priority wins):
25
- * 1. Project: <cwd>/.pi/agents/*.md (authoritative — also where /agents writes)
26
- * 2. Workspace: <cwd>/.agents/agents/*.md (shared cross-tool .agents workspace, read-only)
27
- * 3. Global: $PI_CODING_AGENT_DIR/agents/*.md (default: ~/.pi/agent/agents/*.md)
28
- *
29
- * Project-level agents override global ones with the same name. On a name clash
30
- * between the two project locations, .pi/agents wins — .pi stays the project
31
- * authority; .agents/agents is an additional read location.
32
- * Any name is allowed — names matching defaults (e.g. "Explore") override them.
33
- *
34
- * An agent's type comes from its frontmatter `name:`, falling back to the
35
- * filename — Claude Code's rule, where "the filename doesn't have to match".
36
- * Because the type is now declared rather than derived from a unique path, two
37
- * files can claim the same one; the later load wins, as it always has for a
38
- * filename clash, and `warnSkippedOverride` reports the substitution.
39
- */
40
- export function loadCustomAgents(cwd, strict = false) {
41
- const globalDir = join(getAgentDir(), "agents");
42
- const workspaceProjectDir = join(cwd, ".agents", "agents");
43
- const projectDir = join(cwd, ".pi", "agents");
44
- const agents = new Map();
45
- loadFromDir(globalDir, agents, "global", strict); // lowest priority
46
- loadFromDir(workspaceProjectDir, agents, "project", strict); // shared workspace
47
- loadFromDir(projectDir, agents, "project", strict); // highest priority (overwrites)
48
- warnedLastLoad = warnedThisLoad;
49
- warnedThisLoad = new Set();
50
- return agents;
51
- }
52
- /** Load agent configs from a directory into the map. */
53
- function loadFromDir(dir, agents, source, strict) {
54
- if (!existsSync(dir))
55
- return;
56
- let files;
57
- try {
58
- files = readdirSync(dir).filter(f => f.endsWith(".md"));
59
- }
60
- catch {
61
- return;
62
- }
63
- for (const file of files) {
64
- const filenameType = basename(file, ".md");
65
- const path = join(dir, file);
66
- const parsed = readAgentFile(path, strict);
67
- if (!parsed) {
68
- warnSkippedOverride(filenameType, agents);
69
- continue;
70
- }
71
- const { frontmatter: fm, body } = parsed;
72
- // Claude Code's rule: `name:` IS the agent type, and the filename need not
73
- // match. Absent, the filename stands in — Claude Code requires the field,
74
- // but most files here predate it and must keep loading.
75
- const declared = str(fm.name)?.trim();
76
- if (declared?.includes(RESERVED_IN_TYPE)) {
77
- // Refusing beats silently substituting: the file would otherwise load
78
- // under its filename, so `Agent({subagent_type})` would succeed against
79
- // an agent whose declared identity nothing honoured.
80
- warnIfNew(`Agent file ${path} declares name "${declared}", which contains "${RESERVED_IN_TYPE}" — reserved for `
81
- + "plugin-scoped identifiers. Rename it, or move the label to `display_name:`. Skipping.");
82
- // No `warnSkippedOverride`: this file would have registered under its
83
- // *declared* name, which nothing else can hold (a colon keeps it out of
84
- // the registry), so it shadowed nothing. Passing the filename instead
85
- // would report a substitution of an unrelated agent that never happened.
86
- continue;
87
- }
88
- // `||`, not `??`: a quoted empty or all-whitespace `name:` would otherwise
89
- // register the agent under the empty type — unspawnable, and it takes the
90
- // filename-derived one down with it.
91
- const name = declared || filenameType;
92
- const { builtinToolNames, extSelectors } = parseToolsField(fm.tools);
93
- agents.set(name, {
94
- name,
95
- // Only `display_name` now: `name` is the type, and `getConfig` already
96
- // falls back to the type when no label is set — so a Claude Code file
97
- // with `name: code-reviewer` still badges as "code-reviewer".
98
- displayName: str(fm.display_name),
99
- color: str(fm.color),
100
- description: str(fm.description) ?? name,
101
- builtinToolNames,
102
- extSelectors,
103
- disallowedTools: csvListOptional(fm.disallowed_tools),
104
- extensions: inheritField(fm.extensions ?? fm.inherit_extensions),
105
- excludeExtensions: csvListOptional(fm.exclude_extensions),
106
- skills: inheritField(fm.skills ?? fm.inherit_skills),
107
- model: str(fm.model),
108
- thinking: str(fm.thinking),
109
- maxTurns: nonNegativeInt(fm.max_turns),
110
- persistSession: fm.persist_session != null ? fm.persist_session === true : undefined,
111
- outputTranscript: fm.output_transcript != null ? fm.output_transcript !== false : undefined,
112
- sessionDir: str(fm.session_dir),
113
- allowedSubagents: parseAllowedSubagents(fm.allowed_subagents),
114
- systemPrompt: body.trim(),
115
- promptMode: fm.prompt_mode === "append" ? "append" : "replace",
116
- inheritContext: fm.inherit_context != null ? fm.inherit_context === true : undefined,
117
- runInBackground: fm.run_in_background != null ? fm.run_in_background === true : undefined,
118
- isolated: fm.isolated != null ? fm.isolated === true : undefined,
119
- memory: parseMemory(fm.memory),
120
- isolation: parseIsolation(fm.isolation),
121
- enabled: fm.enabled !== false, // default true; explicitly false disables
122
- source,
123
- sourcePath: path,
124
- });
125
- }
126
- }
127
- /**
128
- * Read and parse one agent file, or warn and return undefined for the caller to
129
- * skip. One bad file must not take the whole extension down with it — an
130
- * unparseable `.md` used to abort activation, so pi exited before the TUI.
131
- *
132
- * The path is as much of the fix as the recovery: a bare YAML error ("line 2,
133
- * column 14") is unactionable when agents come from three directories at once,
134
- * and the only other symptom is `Unknown agent type`, which reads like a typo.
135
- *
136
- * Under `strict` the same failure rethrows, still naming the path, so callers
137
- * that opted into failing closed stop rather than run a substituted agent.
138
- */
139
- /**
140
- * Parse an agent file's frontmatter, tolerating a leading UTF-8 BOM.
141
- *
142
- * Editors across the Windows/CJK world write UTF-8 with a BOM by default, and
143
- * pi's parser did not look past one before 0.84.3: the fence never matched, so
144
- * the frontmatter came back empty and the *whole file* — YAML and all — became
145
- * the body. An agent authored that way silently lost every field. `tools: none`
146
- * going missing is the sharp edge: the agent registers with the default
147
- * toolset rather than none, which is a wider grant than its author wrote.
148
- *
149
- * Stripped here rather than detected per pi version, because this is the only
150
- * place agent files are read and the BOM is a file-encoding artifact, not
151
- * content — normalising it at the boundary keeps one behaviour across the whole
152
- * supported peer range instead of forking on what happens to be installed.
153
- */
154
- export function parseAgentFrontmatter(content) {
155
- return parseFrontmatter(content.startsWith("\uFEFF") ? content.slice(1) : content);
156
- }
157
- function readAgentFile(path, strict) {
158
- try {
159
- return parseAgentFrontmatter(readFileSync(path, "utf-8"));
160
- }
161
- catch (err) {
162
- const reason = err instanceof Error ? err.message : String(err);
163
- if (strict)
164
- throw new Error(`${path}: ${reason}`);
165
- warnIfNew(`Skipping agent file ${path}: ${reason}`);
166
- return undefined;
167
- }
168
- }
169
- /**
170
- * A skipped file that was overriding an already-loaded agent leaves the name
171
- * pointing at a *different* file — its own prompt, model and tools. Nothing
172
- * downstream can flag that: unlike an unknown type, the `Agent` call succeeds.
173
- */
174
- function warnSkippedOverride(name, agents) {
175
- const surviving = agents.get(name);
176
- // Nothing shadowed, or what it shadowed is disabled: dispatch refuses the type
177
- // either way (see resolveEnabledTypeIn), so there is no substitution to report.
178
- if (!surviving?.sourcePath || surviving.enabled === false)
179
- return;
180
- warnIfNew(`Agent "${name}" now loads from ${surviving.sourcePath} instead`);
181
- }
182
- let warnedLastLoad = new Set();
183
- let warnedThisLoad = new Set();
184
- /**
185
- * Agents reload on activation and again on every `Agent` call, so an unchanged
186
- * problem would re-warn all session — over a painted TUI, since pi does not
187
- * redirect console output. Compare against the previous load rather than every
188
- * load ever, so a file that is fixed and then broken again still reports.
189
- */
190
- function warnIfNew(message) {
191
- warnedThisLoad.add(message);
192
- if (warnedLastLoad.has(message))
193
- return;
194
- console.warn(`[pi-subagents] ${message}`);
195
- }
196
- // ---- Field parsers ----
197
- // All follow the same convention: omitted → default, "none"/empty → nothing, value → exact.
198
- /** Extract a string or undefined. */
199
- function str(val) {
200
- return typeof val === "string" ? val : undefined;
201
- }
202
- /** Extract a non-negative integer or undefined. 0 means unlimited for max_turns. */
203
- function nonNegativeInt(val) {
204
- return typeof val === "number" && val >= 0 ? val : undefined;
205
- }
206
- /**
207
- * Parse a raw CSV field value into items, or undefined if absent/empty/"none".
208
- */
209
- function parseCsvField(val) {
210
- if (val === undefined || val === null)
211
- return undefined;
212
- const s = String(val).trim();
213
- if (!s || s === "none")
214
- return undefined;
215
- const items = s.split(",").map(t => t.trim()).filter(Boolean);
216
- return items.length > 0 ? items : undefined;
217
- }
218
- /**
219
- * Parse the nested-delegation allowlist. Single field, default-off:
220
- * omitted/empty/"none"/`false` → undefined (no nested tools); "all"/"*"/`true`
221
- * → "all" (any enabled agent); csv → only the listed types.
222
- *
223
- * Booleans are accepted because `extensions:`/`skills:` take them and users
224
- * generalize: without this, YAML's `true` stringifies into an agent type
225
- * literally named "true", so the tools appear and every spawn is refused.
226
- */
227
- function parseAllowedSubagents(val) {
228
- if (typeof val === "boolean")
229
- return val ? "all" : undefined;
230
- const items = parseCsvField(val);
231
- if (!items)
232
- return undefined;
233
- return items.some(i => i === "*" || i.toLowerCase() === "all") ? "all" : items;
234
- }
235
- /**
236
- * Parse a comma-separated list field with defaults.
237
- * omitted → defaults; "none"/empty → []; csv → listed items.
238
- */
239
- function csvList(val, defaults) {
240
- if (val === undefined || val === null)
241
- return defaults;
242
- return parseCsvField(val) ?? [];
243
- }
244
- /**
245
- * Partition the `tools:` CSV into the built-in tool allowlist and raw `ext:` selectors.
246
- * `*` (and the case-insensitive alias `all`, for `tools: all`) expands to all
247
- * built-ins; plain entries are built-in names; `ext:` entries are extension-tool
248
- * selectors parsed later by the runner. omitted → all built-ins, no selectors.
249
- * `tools:` present with only `ext:` entries → zero built-ins (use `*`).
250
- */
251
- function parseToolsField(val) {
252
- const entries = csvList(val, BUILTIN_TOOL_NAMES);
253
- const isWildcard = (e) => e === "*" || e.toLowerCase() === "all";
254
- const hasWildcard = entries.some(isWildcard);
255
- const plain = entries.filter(e => !isWildcard(e) && !e.startsWith("ext:"));
256
- const extEntries = entries.filter(e => e.startsWith("ext:"));
257
- return {
258
- builtinToolNames: hasWildcard ? [...new Set([...BUILTIN_TOOL_NAMES, ...plain])] : plain,
259
- extSelectors: extEntries.length > 0 ? extEntries : undefined,
260
- };
261
- }
262
- /**
263
- * Parse an optional comma-separated list field.
264
- * omitted → undefined; "none"/empty → undefined; csv → listed items.
265
- */
266
- function csvListOptional(val) {
267
- return parseCsvField(val);
268
- }
269
- /**
270
- * Parse a memory scope field.
271
- * omitted → undefined; "user"/"project"/"local" → MemoryScope.
272
- */
273
- function parseMemory(val) {
274
- if (val === "user" || val === "project" || val === "local")
275
- return val;
276
- return undefined;
277
- }
278
- /**
279
- * Parse the `isolation` frontmatter field.
280
- *
281
- * `off` is kept as a value rather than folded into `undefined` because the two
282
- * do not mean the same thing here: agent config outranks tool-call params, so
283
- * `off` vetoes a caller's `worktree` while an absent field lets it through.
284
- *
285
- * pi's frontmatter parser is not YAML 1.1 — bare `off` and `no` arrive as
286
- * strings and only `false` becomes a boolean — so all three spellings are
287
- * accepted rather than leaving an author's intent silently dropped. Anything
288
- * else stays `undefined`, as before.
289
- */
290
- function parseIsolation(val) {
291
- if (val === "worktree")
292
- return "worktree";
293
- if (val === "off" || val === "none" || val === "no" || val === false)
294
- return "off";
295
- return undefined;
296
- }
297
- /**
298
- * Parse an inherit field (extensions, skills).
299
- * omitted/true → true (inherit all); false/"none"/empty → false; csv → listed names.
300
- */
301
- function inheritField(val) {
302
- if (val === undefined || val === null || val === true)
303
- return true;
304
- if (val === false || val === "none")
305
- return false;
306
- const items = csvList(val, []);
307
- return items.length > 0 ? items : false;
308
- }
309
- //# sourceMappingURL=custom-agents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-agents.js","sourceRoot":"","sources":["../src/custom-agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;;;;;;;;GAYG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAM,GAAG,KAAK;IAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChD,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK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AK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;QACvF,YAAY,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;KAC7D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,GAAY;IAC/B,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,OAAO;QAAE,OAAO,GAAG,CAAC;IACvE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,GAAG,KAAK,UAAU;QAAE,OAAO,UAAU,CAAC;IAC1C,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACnF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,GAAY;IAChC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnE,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAC1C,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * default-agents.ts — Embedded default agent configurations.
3
- *
4
- * These are always available but can be overridden by user .md files with the same name.
5
- */
6
- import type { AgentConfig } from "./types.js";
7
- export declare const DEFAULT_AGENTS: Map<string, AgentConfig>;
8
- //# sourceMappingURL=default-agents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-agents.d.ts","sourceRoot":"","sources":["../src/default-agents.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAmHlD,CAAC"}