@zihanw/pi-forge 0.4.1 → 0.5.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 (372) hide show
  1. package/CHANGELOG.md +79 -1
  2. package/README.md +12 -11
  3. package/README.zh-CN.md +3 -5
  4. package/SUBAGENT_ADAPTER_CONTRACT.md +3 -1
  5. package/dist/agent-profile.d.ts +18 -62
  6. package/dist/agent-profile.d.ts.map +1 -1
  7. package/dist/agent-profile.js +27 -249
  8. package/dist/agent-profile.js.map +1 -1
  9. package/dist/codecs/agent-profile.d.ts +53 -0
  10. package/dist/codecs/agent-profile.d.ts.map +1 -0
  11. package/dist/codecs/agent-profile.js +176 -0
  12. package/dist/codecs/agent-profile.js.map +1 -0
  13. package/dist/codecs/index.d.ts +5 -0
  14. package/dist/codecs/index.d.ts.map +1 -0
  15. package/dist/codecs/index.js +3 -0
  16. package/dist/codecs/index.js.map +1 -0
  17. package/dist/codecs/prompt-stack.d.ts +18 -0
  18. package/dist/codecs/prompt-stack.d.ts.map +1 -0
  19. package/dist/codecs/prompt-stack.js +479 -0
  20. package/dist/codecs/prompt-stack.js.map +1 -0
  21. package/dist/compile-cycle.d.ts +18 -0
  22. package/dist/compile-cycle.d.ts.map +1 -0
  23. package/dist/compile-cycle.js +13 -0
  24. package/dist/compile-cycle.js.map +1 -0
  25. package/dist/compiler.d.ts +10 -4
  26. package/dist/compiler.d.ts.map +1 -1
  27. package/dist/compiler.js +53 -19
  28. package/dist/compiler.js.map +1 -1
  29. package/dist/context-diff-history.d.ts +61 -0
  30. package/dist/context-diff-history.d.ts.map +1 -0
  31. package/dist/context-diff-history.js +84 -0
  32. package/dist/context-diff-history.js.map +1 -0
  33. package/dist/context-diff-snapshot.d.ts +19 -0
  34. package/dist/context-diff-snapshot.d.ts.map +1 -0
  35. package/dist/context-diff-snapshot.js +146 -0
  36. package/dist/context-diff-snapshot.js.map +1 -0
  37. package/dist/context-diff.d.ts +70 -0
  38. package/dist/context-diff.d.ts.map +1 -0
  39. package/dist/context-diff.js +259 -0
  40. package/dist/context-diff.js.map +1 -0
  41. package/dist/extension-registry.d.ts.map +1 -1
  42. package/dist/extension-registry.js +5 -2
  43. package/dist/extension-registry.js.map +1 -1
  44. package/dist/forge-config.d.ts +0 -105
  45. package/dist/forge-config.d.ts.map +1 -1
  46. package/dist/forge-config.js +1 -313
  47. package/dist/forge-config.js.map +1 -1
  48. package/dist/forge-v1/analyzer.d.ts +3 -0
  49. package/dist/forge-v1/analyzer.d.ts.map +1 -0
  50. package/dist/forge-v1/analyzer.js +50 -0
  51. package/dist/forge-v1/analyzer.js.map +1 -0
  52. package/dist/forge-v1/index.d.ts +6 -0
  53. package/dist/forge-v1/index.d.ts.map +1 -0
  54. package/dist/forge-v1/index.js +13 -0
  55. package/dist/forge-v1/index.js.map +1 -0
  56. package/dist/forge-v1/parser.d.ts +3 -0
  57. package/dist/forge-v1/parser.d.ts.map +1 -0
  58. package/dist/forge-v1/parser.js +186 -0
  59. package/dist/forge-v1/parser.js.map +1 -0
  60. package/dist/forge-v1/renderer.d.ts +9 -0
  61. package/dist/forge-v1/renderer.d.ts.map +1 -0
  62. package/dist/forge-v1/renderer.js +181 -0
  63. package/dist/forge-v1/renderer.js.map +1 -0
  64. package/dist/forge-v1/types.d.ts +87 -0
  65. package/dist/forge-v1/types.d.ts.map +1 -0
  66. package/dist/forge-v1/types.js +4 -0
  67. package/dist/forge-v1/types.js.map +1 -0
  68. package/dist/index.d.ts +12 -12
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +54 -83
  71. package/dist/index.js.map +1 -1
  72. package/dist/lifecycle.d.ts +8 -5
  73. package/dist/lifecycle.d.ts.map +1 -1
  74. package/dist/lifecycle.js +45 -112
  75. package/dist/lifecycle.js.map +1 -1
  76. package/dist/loader.d.ts +5 -8
  77. package/dist/loader.d.ts.map +1 -1
  78. package/dist/loader.js +10 -467
  79. package/dist/loader.js.map +1 -1
  80. package/dist/macro-engine.d.ts +9 -14
  81. package/dist/macro-engine.d.ts.map +1 -1
  82. package/dist/macro-engine.js +5 -238
  83. package/dist/macro-engine.js.map +1 -1
  84. package/dist/payload-capture.d.ts +10 -0
  85. package/dist/payload-capture.d.ts.map +1 -1
  86. package/dist/payload-capture.js +39 -9
  87. package/dist/payload-capture.js.map +1 -1
  88. package/dist/payload-command.d.ts +8 -6
  89. package/dist/payload-command.d.ts.map +1 -1
  90. package/dist/payload-command.js +36 -6
  91. package/dist/payload-command.js.map +1 -1
  92. package/dist/payload-state.d.ts +19 -0
  93. package/dist/payload-state.d.ts.map +1 -0
  94. package/dist/payload-state.js +19 -0
  95. package/dist/payload-state.js.map +1 -0
  96. package/dist/preset-command.d.ts +4 -4
  97. package/dist/preset-command.d.ts.map +1 -1
  98. package/dist/preset-command.js +33 -104
  99. package/dist/preset-command.js.map +1 -1
  100. package/dist/preview.d.ts +4 -4
  101. package/dist/preview.d.ts.map +1 -1
  102. package/dist/preview.js +34 -11
  103. package/dist/preview.js.map +1 -1
  104. package/dist/profile-command.d.ts +2 -2
  105. package/dist/profile-command.d.ts.map +1 -1
  106. package/dist/profile-command.js +15 -14
  107. package/dist/profile-command.js.map +1 -1
  108. package/dist/profile-service.d.ts.map +1 -1
  109. package/dist/profile-service.js +23 -39
  110. package/dist/profile-service.js.map +1 -1
  111. package/dist/prompt-analysis.d.ts +24 -0
  112. package/dist/prompt-analysis.d.ts.map +1 -0
  113. package/dist/prompt-analysis.js +84 -0
  114. package/dist/prompt-analysis.js.map +1 -0
  115. package/dist/prompt-runtime.d.ts +19 -0
  116. package/dist/prompt-runtime.d.ts.map +1 -0
  117. package/dist/prompt-runtime.js +30 -0
  118. package/dist/prompt-runtime.js.map +1 -0
  119. package/dist/regex.js +6 -12
  120. package/dist/regex.js.map +1 -1
  121. package/dist/render-helpers.d.ts +2 -10
  122. package/dist/render-helpers.d.ts.map +1 -1
  123. package/dist/render-helpers.js +3 -53
  124. package/dist/render-helpers.js.map +1 -1
  125. package/dist/repositories/agent-profile.d.ts +36 -0
  126. package/dist/repositories/agent-profile.d.ts.map +1 -0
  127. package/dist/repositories/agent-profile.js +153 -0
  128. package/dist/repositories/agent-profile.js.map +1 -0
  129. package/dist/repositories/index.d.ts +3 -0
  130. package/dist/repositories/index.d.ts.map +1 -0
  131. package/dist/repositories/index.js +3 -0
  132. package/dist/repositories/index.js.map +1 -0
  133. package/dist/repositories/prompt-stack.d.ts +57 -0
  134. package/dist/repositories/prompt-stack.d.ts.map +1 -0
  135. package/dist/repositories/prompt-stack.js +175 -0
  136. package/dist/repositories/prompt-stack.js.map +1 -0
  137. package/dist/runtime/profile-runtime.d.ts +2 -2
  138. package/dist/runtime/profile-runtime.d.ts.map +1 -1
  139. package/dist/runtime/profile-runtime.js +13 -10
  140. package/dist/runtime/profile-runtime.js.map +1 -1
  141. package/dist/runtime/prompt-stack-runtime.d.ts +4 -3
  142. package/dist/runtime/prompt-stack-runtime.d.ts.map +1 -1
  143. package/dist/runtime/prompt-stack-runtime.js +42 -57
  144. package/dist/runtime/prompt-stack-runtime.js.map +1 -1
  145. package/dist/runtime/tool-policy-runtime.d.ts +2 -2
  146. package/dist/runtime/tool-policy-runtime.d.ts.map +1 -1
  147. package/dist/runtime/tool-policy-runtime.js +16 -6
  148. package/dist/runtime/tool-policy-runtime.js.map +1 -1
  149. package/dist/runtime/web-editor-runtime.d.ts +2 -1
  150. package/dist/runtime/web-editor-runtime.d.ts.map +1 -1
  151. package/dist/runtime/web-editor-runtime.js +8 -3
  152. package/dist/runtime/web-editor-runtime.js.map +1 -1
  153. package/dist/session-adapter.d.ts +17 -0
  154. package/dist/session-adapter.d.ts.map +1 -0
  155. package/dist/session-adapter.js +57 -0
  156. package/dist/session-adapter.js.map +1 -0
  157. package/dist/slot-renderers.d.ts +16 -3
  158. package/dist/slot-renderers.d.ts.map +1 -1
  159. package/dist/slot-renderers.js +15 -63
  160. package/dist/slot-renderers.js.map +1 -1
  161. package/dist/stack-migration.d.ts +6 -0
  162. package/dist/stack-migration.d.ts.map +1 -1
  163. package/dist/stack-migration.js +49 -52
  164. package/dist/stack-migration.js.map +1 -1
  165. package/dist/subagent/fingerprints.d.ts +24 -0
  166. package/dist/subagent/fingerprints.d.ts.map +1 -0
  167. package/dist/subagent/fingerprints.js +81 -0
  168. package/dist/subagent/fingerprints.js.map +1 -0
  169. package/dist/subagent/host-port.d.ts +296 -0
  170. package/dist/subagent/host-port.d.ts.map +1 -0
  171. package/dist/subagent/host-port.js +560 -0
  172. package/dist/subagent/host-port.js.map +1 -0
  173. package/dist/subagent/index.d.ts +10 -10
  174. package/dist/subagent/index.d.ts.map +1 -1
  175. package/dist/subagent/index.js +9 -10
  176. package/dist/subagent/index.js.map +1 -1
  177. package/dist/subagent-host.d.ts +99 -18
  178. package/dist/subagent-host.d.ts.map +1 -1
  179. package/dist/subagent-host.js +143 -146
  180. package/dist/subagent-host.js.map +1 -1
  181. package/dist/template-render.d.ts +18 -0
  182. package/dist/template-render.d.ts.map +1 -0
  183. package/dist/template-render.js +232 -0
  184. package/dist/template-render.js.map +1 -0
  185. package/dist/types.d.ts +40 -27
  186. package/dist/types.d.ts.map +1 -1
  187. package/dist/types.js.map +1 -1
  188. package/dist/ui-contribution/contrib-port.d.ts +170 -0
  189. package/dist/ui-contribution/contrib-port.d.ts.map +1 -0
  190. package/dist/ui-contribution/contrib-port.js +640 -0
  191. package/dist/ui-contribution/contrib-port.js.map +1 -0
  192. package/dist/ui-contribution/index.d.ts +3 -0
  193. package/dist/ui-contribution/index.d.ts.map +1 -0
  194. package/dist/ui-contribution/index.js +2 -0
  195. package/dist/ui-contribution/index.js.map +1 -0
  196. package/dist/web-editor/client-script.generated.d.ts.map +1 -1
  197. package/dist/web-editor/client-script.generated.js +1 -1
  198. package/dist/web-editor/client-script.generated.js.map +1 -1
  199. package/dist/web-editor/client-styles.generated.d.ts.map +1 -1
  200. package/dist/web-editor/client-styles.generated.js +1 -1
  201. package/dist/web-editor/client-styles.generated.js.map +1 -1
  202. package/dist/web-editor/contrib-service.d.ts +41 -0
  203. package/dist/web-editor/contrib-service.d.ts.map +1 -0
  204. package/dist/web-editor/contrib-service.js +174 -0
  205. package/dist/web-editor/contrib-service.js.map +1 -0
  206. package/dist/web-editor/line-diff.d.ts +28 -0
  207. package/dist/web-editor/line-diff.d.ts.map +1 -0
  208. package/dist/web-editor/line-diff.js +216 -0
  209. package/dist/web-editor/line-diff.js.map +1 -0
  210. package/dist/web-editor/schema-form.d.ts +63 -0
  211. package/dist/web-editor/schema-form.d.ts.map +1 -0
  212. package/dist/web-editor/schema-form.js +213 -0
  213. package/dist/web-editor/schema-form.js.map +1 -0
  214. package/dist/web-editor/server.d.ts.map +1 -1
  215. package/dist/web-editor/server.js +72 -74
  216. package/dist/web-editor/server.js.map +1 -1
  217. package/dist/web-editor/styles.d.ts.map +1 -1
  218. package/dist/web-editor/styles.js +201 -21
  219. package/dist/web-editor/styles.js.map +1 -1
  220. package/dist/web-editor/types.d.ts +12 -35
  221. package/dist/web-editor/types.d.ts.map +1 -1
  222. package/dist/web-host.d.ts +6 -2
  223. package/dist/web-host.d.ts.map +1 -1
  224. package/dist/web-host.js +33 -103
  225. package/dist/web-host.js.map +1 -1
  226. package/dist/workspace.d.ts +74 -0
  227. package/dist/workspace.d.ts.map +1 -0
  228. package/dist/workspace.js +351 -0
  229. package/dist/workspace.js.map +1 -0
  230. package/docs/README.md +7 -4
  231. package/docs/concepts/agent-profiles.md +1 -1
  232. package/docs/concepts/prompt-stacks.md +5 -5
  233. package/docs/design/0.5.1-plan.md +237 -0
  234. package/docs/design/README.md +21 -3
  235. package/docs/design/architecture-0.5.md +222 -0
  236. package/docs/design/archive/0.5-full-proposal/0.5-consumer-audit.md +62 -0
  237. package/docs/design/archive/0.5-full-proposal/0.5-inventory.md +208 -0
  238. package/docs/design/archive/0.5-full-proposal/0.5-phase0-decision-drafts.md +237 -0
  239. package/docs/design/archive/0.5-full-proposal/README.md +12 -0
  240. package/docs/design/archive/0.5-full-proposal/architecture-0.5.md +423 -0
  241. package/docs/design/archive/0.5-full-proposal/host-discovery-spike.md +103 -0
  242. package/docs/design/archive/0.5-full-proposal/template-language-spike.md +156 -0
  243. package/docs/design/context-diff-plan.md +78 -0
  244. package/docs/design/decision-template.md +33 -0
  245. package/docs/design/roadmap-0.4-archive.md +1 -1
  246. package/docs/design/subagents/interface-design.md +1 -1
  247. package/docs/development/architecture-rules.md +148 -0
  248. package/docs/development/release.md +7 -1
  249. package/docs/development/roadmap.md +37 -5
  250. package/docs/development/scoped-global-profiles-stacks.md +1 -1
  251. package/docs/development/setup.md +6 -4
  252. package/docs/getting-started.md +5 -4
  253. package/docs/guides/custom-macros-and-slots.md +8 -7
  254. package/docs/guides/debugging.md +1 -1
  255. package/docs/guides/delegation.md +18 -22
  256. package/docs/guides/migrating-to-0.5.md +107 -0
  257. package/docs/guides/use-cases.md +7 -11
  258. package/docs/guides/web-editor.md +6 -10
  259. package/docs/reference/commands.md +4 -3
  260. package/docs/reference/configuration.md +17 -18
  261. package/docs/reference/features.md +34 -80
  262. package/docs/reference/macros-and-slots.md +70 -49
  263. package/docs/reference/public-api.md +76 -17
  264. package/docs/reference/stack-schema.md +15 -10
  265. package/docs/reference/subagent-host-port.md +49 -0
  266. package/docs/reference/ui-contribution-port.md +51 -0
  267. package/docs/zh-CN/README.md +3 -3
  268. package/docs/zh-CN/concepts/agent-profiles.md +1 -1
  269. package/docs/zh-CN/concepts/prompt-stacks.md +5 -5
  270. package/docs/zh-CN/getting-started.md +3 -2
  271. package/docs/zh-CN/guides/delegation.md +10 -12
  272. package/docs/zh-CN/guides/migrating-to-0.5.md +92 -0
  273. package/docs/zh-CN/guides/web-editor.md +4 -4
  274. package/docs/zh-CN/reference/commands.md +3 -2
  275. package/examples/custom-system-status-extension/README.md +3 -3
  276. package/examples/custom-system-status-extension/index.ts +2 -1
  277. package/examples/custom-system-status-extension/prompt-stack.json +4 -3
  278. package/examples/default-prompt-stack.json +9 -4
  279. package/examples/image-reader-prompt-stack.json +16 -26
  280. package/examples/reviewer-prompt-stack.json +13 -24
  281. package/package.json +106 -120
  282. package/dist/runtime/subagent-runtime.d.ts +0 -45
  283. package/dist/runtime/subagent-runtime.d.ts.map +0 -1
  284. package/dist/runtime/subagent-runtime.js +0 -343
  285. package/dist/runtime/subagent-runtime.js.map +0 -1
  286. package/dist/runtime-state.d.ts +0 -30
  287. package/dist/runtime-state.d.ts.map +0 -1
  288. package/dist/runtime-state.js +0 -17
  289. package/dist/runtime-state.js.map +0 -1
  290. package/dist/sillytavern-importer/items.d.ts +0 -3
  291. package/dist/sillytavern-importer/items.d.ts.map +0 -1
  292. package/dist/sillytavern-importer/items.js +0 -88
  293. package/dist/sillytavern-importer/items.js.map +0 -1
  294. package/dist/sillytavern-importer/macros.d.ts +0 -15
  295. package/dist/sillytavern-importer/macros.d.ts.map +0 -1
  296. package/dist/sillytavern-importer/macros.js +0 -141
  297. package/dist/sillytavern-importer/macros.js.map +0 -1
  298. package/dist/sillytavern-importer/prompt-order.d.ts +0 -6
  299. package/dist/sillytavern-importer/prompt-order.d.ts.map +0 -1
  300. package/dist/sillytavern-importer/prompt-order.js +0 -38
  301. package/dist/sillytavern-importer/prompt-order.js.map +0 -1
  302. package/dist/sillytavern-importer/regex.d.ts +0 -3
  303. package/dist/sillytavern-importer/regex.d.ts.map +0 -1
  304. package/dist/sillytavern-importer/regex.js +0 -275
  305. package/dist/sillytavern-importer/regex.js.map +0 -1
  306. package/dist/sillytavern-importer/report.d.ts +0 -21
  307. package/dist/sillytavern-importer/report.d.ts.map +0 -1
  308. package/dist/sillytavern-importer/report.js +0 -166
  309. package/dist/sillytavern-importer/report.js.map +0 -1
  310. package/dist/sillytavern-importer/types.d.ts +0 -106
  311. package/dist/sillytavern-importer/types.d.ts.map +0 -1
  312. package/dist/sillytavern-importer/types.js +0 -2
  313. package/dist/sillytavern-importer/types.js.map +0 -1
  314. package/dist/sillytavern-importer.d.ts +0 -5
  315. package/dist/sillytavern-importer.d.ts.map +0 -1
  316. package/dist/sillytavern-importer.js +0 -117
  317. package/dist/sillytavern-importer.js.map +0 -1
  318. package/dist/subagent/canonical.d.ts +0 -22
  319. package/dist/subagent/canonical.d.ts.map +0 -1
  320. package/dist/subagent/canonical.js +0 -24
  321. package/dist/subagent/canonical.js.map +0 -1
  322. package/dist/subagent/context.d.ts +0 -8
  323. package/dist/subagent/context.d.ts.map +0 -1
  324. package/dist/subagent/context.js +0 -125
  325. package/dist/subagent/context.js.map +0 -1
  326. package/dist/subagent/contract.d.ts +0 -10
  327. package/dist/subagent/contract.d.ts.map +0 -1
  328. package/dist/subagent/contract.js +0 -10
  329. package/dist/subagent/contract.js.map +0 -1
  330. package/dist/subagent/plan.d.ts +0 -18
  331. package/dist/subagent/plan.d.ts.map +0 -1
  332. package/dist/subagent/plan.js +0 -157
  333. package/dist/subagent/plan.js.map +0 -1
  334. package/dist/subagent/preflight.d.ts +0 -4
  335. package/dist/subagent/preflight.d.ts.map +0 -1
  336. package/dist/subagent/preflight.js +0 -108
  337. package/dist/subagent/preflight.js.map +0 -1
  338. package/dist/subagent/request.d.ts +0 -4
  339. package/dist/subagent/request.d.ts.map +0 -1
  340. package/dist/subagent/request.js +0 -154
  341. package/dist/subagent/request.js.map +0 -1
  342. package/dist/subagent/response.d.ts +0 -8
  343. package/dist/subagent/response.d.ts.map +0 -1
  344. package/dist/subagent/response.js +0 -155
  345. package/dist/subagent/response.js.map +0 -1
  346. package/dist/subagent/tools.d.ts +0 -4
  347. package/dist/subagent/tools.d.ts.map +0 -1
  348. package/dist/subagent/tools.js +0 -42
  349. package/dist/subagent/tools.js.map +0 -1
  350. package/dist/subagent/types.d.ts +0 -272
  351. package/dist/subagent/types.d.ts.map +0 -1
  352. package/dist/subagent/types.js +0 -3
  353. package/dist/subagent/types.js.map +0 -1
  354. package/dist/subagent/validation.d.ts +0 -35
  355. package/dist/subagent/validation.d.ts.map +0 -1
  356. package/dist/subagent/validation.js +0 -314
  357. package/dist/subagent/validation.js.map +0 -1
  358. package/dist/subagent-command.d.ts +0 -5
  359. package/dist/subagent-command.d.ts.map +0 -1
  360. package/dist/subagent-command.js +0 -249
  361. package/dist/subagent-command.js.map +0 -1
  362. package/dist/subagent-profile-tool.d.ts +0 -49
  363. package/dist/subagent-profile-tool.d.ts.map +0 -1
  364. package/dist/subagent-profile-tool.js +0 -125
  365. package/dist/subagent-profile-tool.js.map +0 -1
  366. package/dist/subagent-tool.d.ts +0 -77
  367. package/dist/subagent-tool.d.ts.map +0 -1
  368. package/dist/subagent-tool.js +0 -559
  369. package/dist/subagent-tool.js.map +0 -1
  370. package/docs/guides/sillytavern-import.md +0 -47
  371. package/docs/reference/subagent-adapter.md +0 -204
  372. package/examples/sillytavern-dm-writer-prompt-stack.json +0 -190
@@ -4,33 +4,31 @@
4
4
 
5
5
  > **Experimental:** This API and its backends may change independently of stable prompt-stack and profile behavior.
6
6
 
7
- pi-forge can execute an explicitly authorized agent profile as a separate, clean, one-shot Pi process. It runs in the foreground and returns a bounded report to the parent conversation.
7
+ The optional `@zihanw/pi-forge-subagents` package executes an explicitly authorized agent profile as a separate, clean, one-shot Pi process. It runs in the foreground and returns a bounded report to the parent conversation.
8
8
 
9
9
  ## Enable a profile
10
10
 
11
- Profiles are not delegatable by default. Enable each eligible ID in the trusted project's `.pi/forge/config.json`, or use the profile's delegation card in `/preset ui`:
11
+ Profiles are not delegatable by default. Enable each eligible ID in the trusted project's `.pi/forge/subagents.json`:
12
12
 
13
13
  ```json
14
14
  {
15
- "subagents": {
16
- "backend": "pi-subprocess-readonly",
17
- "timeoutMs": 60000,
18
- "profiles": {
19
- "reviewer": {
20
- "enabled": true,
21
- "timeoutMs": 300000
22
- },
23
- "rpc-reviewer": {
24
- "enabled": true,
25
- "backend": "pi-rpc-readonly",
26
- "timeoutMs": 180000
27
- }
15
+ "backend": "pi-subprocess-readonly",
16
+ "timeoutMs": 60000,
17
+ "profiles": {
18
+ "project:reviewer": {
19
+ "enabled": true,
20
+ "timeoutMs": 300000
21
+ },
22
+ "project:rpc-reviewer": {
23
+ "enabled": true,
24
+ "backend": "pi-rpc-readonly",
25
+ "timeoutMs": 180000
28
26
  }
29
27
  }
30
28
  }
31
29
  ```
32
30
 
33
- Enablement follows the profile's scope. A global `~/.pi/forge/config.json` may define general `backend` and `timeoutMs` defaults and may authorize `global:<id>` profiles through its own `profiles` map. The trusted project's `.pi/forge/config.json` authorizes `project:<id>` profiles. Same-ID global and project profiles never inherit enablement, backend, or timeout policy from one another. Disabled or unlisted profiles are hidden from discovery and rejected even if guessed.
31
+ Legacy `.pi/forge/config.json.subagents` is accepted as read-only fallback with a warning. Authorization keys should be canonical selectors: `project:<id>` or `global:<id>`. Bare keys remain a compatibility spelling for project profiles only, even inside `~/.pi/forge/subagents.json`; use an explicit key such as `global:reviewer` to authorize a global profile. Same-ID global and project profiles never inherit enablement, backend, or timeout policy from one another. Disabled or unlisted profiles are hidden from discovery and rejected even if guessed.
34
32
 
35
33
  ## Discover, plan, and run
36
34
 
@@ -49,7 +47,7 @@ Profile selectors accept the same grammar everywhere: `reviewer` (project first)
49
47
 
50
48
  The parent model uses `forge_subagent_profiles` to discover enabled profiles and `forge_subagent` to invoke one. A restrictive parent stack must allow both tool names. Discovery is local/no-egress and reports metadata, resolution readiness, effective backend/timeout, approval mode, and whether parent tool policy permits invocation.
51
49
 
52
- Projects with only a few frequently used profiles can set `subagents.summaryInToolDescription: true` (global or trusted-project config). The `forge_subagent` tool description then carries a compact summary of enabled profiles—id, model, thinking level, stack, backend, and timeout—so the parent model does not need a discovery call to pick a profile. Ready profiles appear first; unavailable enabled profiles remain visible with their first resolution error so the model knows not to invoke them. The summary rides in every request, is capped at 8 profiles and 1,000 characters, and refreshes with profiles, stacks, and configuration; `forge_subagent_profiles` remains the authoritative full-detail surface.
50
+ Projects with only a few frequently used profiles can set `summaryInToolDescription: true` (global or trusted-project `subagents.json`). The `forge_subagent` tool description then carries a compact summary of enabled profiles—id, model, thinking level, stack, backend, and timeout—so the parent model does not need a discovery call to pick a profile. Ready profiles appear first; unavailable enabled profiles remain visible with their first resolution error so the model knows not to invoke them. The summary rides in every request, is capped at 8 profiles and 1,000 characters, and refreshes with profiles, stacks, and configuration; `forge_subagent_profiles` remains the authoritative full-detail surface.
53
51
 
54
52
  ## Parallel invocation
55
53
 
@@ -74,13 +72,11 @@ To authorize the parent model without per-run approval:
74
72
 
75
73
  ```json
76
74
  {
77
- "subagents": {
78
- "allowAgentInvocationWithoutApproval": true
79
- }
75
+ "allowAgentInvocationWithoutApproval": true
80
76
  }
81
77
  ```
82
78
 
83
- This affects only `forge_subagent`; `/forge-agent run` remains interactive. It is ignored in untrusted projects and malformed values fail closed. Treat this project config as an authorization file: do not enable or commit it unless every parent agent allowed to call `forge_subagent` may send the compiled prompt and readable file contents to the selected provider without asking again.
79
+ This affects only `forge_subagent`; `/forge-agent run` remains interactive. It is ignored in untrusted projects and malformed values fail closed. Treat this project `subagents.json` as an authorization file: do not enable or commit it unless every parent agent allowed to call `forge_subagent` may send the compiled prompt and readable file contents to the selected provider without asking again.
84
80
 
85
81
  ## Child context and output
86
82
 
@@ -104,4 +100,4 @@ The current backends are **shared-user, not operating-system sandboxes**.
104
100
 
105
101
  The default tools intentionally provide no mutation path. Do not add write, edit, or shell access to this shared-user design. OS isolation and separately approved staged writes remain future work.
106
102
 
107
- For integration authors, see the [experimental adapter contract](../reference/subagent-adapter.md).
103
+ For integration authors, see the [subagent host port contract](../reference/subagent-host-port.md).
@@ -0,0 +1,107 @@
1
+ # Migrating to pi-forge 0.5
2
+
3
+ [Documentation](../README.md)
4
+
5
+ 0.5.0 is a breaking cleanup release. This page is the migration note for the
6
+ changes landed so far (Lane 1a-1c plus the compiler/extension conformance
7
+ pass in Lane 1d).
8
+
9
+ ## What was removed
10
+
11
+ - SillyTavern importer (`/preset import-silly`), its reports, guide, example,
12
+ and tests. Convert SillyTavern presets with pi-forge 0.4 before upgrading.
13
+ - Mutable turn/session variables, variable mutation macros,
14
+ `pi-forge-variable-state` session entries, and the `variables` slot.
15
+ - Regex `display` and `both` effects; `outgoing` and `finalize` remain.
16
+
17
+ ## Template syntax changes
18
+
19
+ Prompt text now compiles with the closed `forge-v1` grammar.
20
+
21
+ | 0.4 construct | 0.5 forge-v1 |
22
+ |---|---|
23
+ | `{{name}}` (static) | `{{ parameters.name }}` |
24
+ | `{{lastUserMessage}}` | `{{ runtime.lastUserMessage }}` |
25
+ | `{{date}}` / `{{time}}` / `{{cwd}}` | `{{ runtime.date }}` / `{{ runtime.time }}` / `{{ runtime.cwd }}` |
26
+ | `{{tools}}` | `{{ runtime.selectedToolsText }}` |
27
+ | `{{upper::x}}` | `{{ x \| upper }}` |
28
+ | `{{iftools::bash::A::B}}` | `{% if runtime.tool.bash %}A{% else %}B{% endif %}` |
29
+ | custom `{{myMacro}}` | `{{ extensions.myMacro }}` |
30
+
31
+ Unknown paths, unknown filters, parse errors, cycles, and output-limit breaches
32
+ are compile errors; a failing block is omitted instead of re-injecting raw
33
+ template text.
34
+
35
+ ## Schema v2
36
+
37
+ Schema v2 stacks store immutable static values in `parameters` (JSON-compatible)
38
+ instead of the legacy string-only `variables` field:
39
+
40
+ ```json
41
+ {
42
+ "schemaVersion": 2,
43
+ "parameters": { "char": "Konata" }
44
+ }
45
+ ```
46
+
47
+ Unversioned / v1 stacks continue to load through the legacy `variables` reader.
48
+
49
+ ## Running the migration utility
50
+
51
+ A mechanical, diagnostics-first script converts a saved stack file:
52
+
53
+ ```bash
54
+ node scripts/migrate-stack-v2.mjs .pi/forge/prompt-stacks/default.json --dry-run
55
+ node scripts/migrate-stack-v2.mjs .pi/forge/prompt-stacks/default.json --write
56
+ ```
57
+
58
+ It renames `variables` to `parameters`, maps runtime/parameter paths, and
59
+ converts simple filter pipelines. Non-mechanical constructs are reported and
60
+ the file is only written when they are absent. A schema v2 file that still
61
+ contains a legacy `variables` field is left untouched and only warned about.
62
+
63
+ ## Preview and finalize
64
+
65
+ Preview never applies `finalize`; it now reports an informational diagnostic.
66
+ `finalize` remains a destructive, lifecycle-owned transform that replaces the
67
+ stored assistant message.
68
+
69
+ ## Lane 2: scoped global profiles and prompt stacks
70
+
71
+ - User-global resources now live in `~/.pi/forge/prompt-stacks` and `~/.pi/forge/agent-profiles` alongside the project stores. Profile and stack selectors accept explicit scopes: `project:<id>`, `global:<id>`, with bare IDs resolving project-first.
72
+ - Same-ID project resources shadow their global counterparts; global stacks cannot reference project resources (and vice versa) — references resolve within the referenced resource's scope.
73
+ - Untrusted projects fail closed: only global resources load, all mutation routes are rejected, and `session_shutdown` no longer disposes a trusted workspace while sessions may still be active (idle workspaces are swept after an hour; hosts stop independently).
74
+ - The web editor gained scope selectors for creating stacks/profiles into either store and routes global mutations through explicit `global:<id>` selectors.
75
+
76
+ ## Lane 3: subagent package split
77
+
78
+ Subagent execution moved out of the main package into the optional `@zihanw/pi-forge-subagents` package (requires `@zihanw/pi-forge@^0.5.0`). Install it separately to keep foreground delegation.
79
+
80
+ - **Commands:** `/subagents` and `/subagent-run` were removed from the main package. The optional package registers `/forge-agent backends|plan|run`.
81
+ - **Model tools:** `forge_subagent_profiles` and `forge_subagent` are registered by the optional package.
82
+ - **Configuration:** `subagents.*` moved out of `.pi/forge/config.json` into dedicated `.pi/forge/subagents.json` (trusted project) and `~/.pi/forge/subagents.json` (user defaults). The optional package reads legacy `config.json.subagents` sections as a read-only fallback with a warning; it never writes them. Copy the values into `subagents.json` to silence the warning.
83
+ - **Web editor:** the delegation card was removed from the main editor; edit `subagents.json` directly.
84
+ - **Architecture:** the main package's prompt compiler is host-neutral (no subagent assumptions), and `ForgeWorkspace` is the single owner of resource state and compilation contexts.
85
+
86
+ ## Lane 4: Forge-native host contract and public surface
87
+
88
+ - The main package no longer depends on `@zihanw/pi-subagent-runtime` and no longer exports the 0.4 execution contract. That contract (`AgentRequest`, `createAgentExecutionPlan`, `validateAgentRequest`, `negotiateSubagentTools`, preflight/plan/response validators, …) now lives in `@zihanw/pi-forge-subagents` for its own runtime wiring; it is not a public surface of either package for third-party consumers.
89
+ - `@zihanw/pi-forge/subagent` now exports only the versioned host port: wire DTOs and validators, `ForgeHostTransport`, `ForgeHost`/`ForgeHostClient`, lifecycle constants, and the Forge-owned canonical fingerprint helpers. `resolveSubagentHostProfile` / `prepareSubagentHostPlan` were replaced by the host-port operations `resolveProfile` and `prepare`.
90
+ - The package root exports only the default extension factory, `registerMacro`/`registerSlot`, and their contract types. All other root re-exports (loader, agent-profile, profile-service, catalog, resource-identity, render-helper values, the `forge-v1` engine, registry readers) were removed.
91
+ - All `@zihanw/pi-forge/src/*` subpath aliases and the `./examples/*` export were removed; `check-package` rejects them.
92
+
93
+ ### Import migration table
94
+
95
+ | 0.4 import | 0.5 replacement |
96
+ |---|---|
97
+ | `@zihanw/pi-forge` (default, `registerMacro`, `registerSlot`) | unchanged |
98
+ | `@zihanw/pi-forge/subagent` host-port names (`ForgeHost*`, validators, fingerprints) | unchanged |
99
+ | `@zihanw/pi-forge/subagent` execution contract (`AgentRequest`, `createAgentExecutionPlan`, …) | internal to `@zihanw/pi-forge-subagents`; no public replacement |
100
+ | `@zihanw/pi-forge/subagent` `resolveSubagentHostProfile` / `prepareSubagentHostPlan` | host-port operations via `ForgeHostClient` |
101
+ | `@zihanw/pi-forge/src/*` aliases | removed; no replacement (internals) |
102
+ | root loader/profile/catalog/engine re-exports | removed; no replacement (internals) |
103
+
104
+ ## Compatibility notes
105
+
106
+ - The wire shape of the host port is additive across `FORGE_HOST_PORT_VERSION = 1`; unknown operations are rejected with a plain `{ ok: false, error }` result (`"Unknown Forge host operation: …"`), not a thrown error, and optional packages must treat any operation failure as terminal for that request.
107
+ - Vendored fingerprint helpers in the main package are pinned by golden vectors to stay byte-compatible with `@zihanw/pi-subagent-runtime` canonical serialization; plan sealing still happens only in the optional package.
@@ -9,21 +9,21 @@ Use these as starting patterns rather than rigid templates. The [default Pi mirr
9
9
  Put long-lived character rules in a system block, runtime context in appropriate slots, and the current user action in an explicit final user block:
10
10
 
11
11
  1. System character/personality block.
12
- 2. Tools, project context, variables, and other runtime slots.
12
+ 2. Tools, project context, and other runtime slots.
13
13
  3. `chat-history` with `includeLastUserMessage: false`.
14
- 4. Final user block containing `{{lastUserMessage}}`.
14
+ 4. Final user block containing `{{ runtime.lastUserMessage }}`.
15
15
 
16
- This keeps the latest request clear and avoids duplication. Static `{{char}}` / `{{user}}` variables work well for character constants; turn/session macros can track temporary scene state. Durable project memory belongs in project files, not prompt variables.
16
+ This keeps the latest request clear and avoids duplication. Static `{{ parameters.char }}` / `{{ parameters.user }}` values work well for character constants. Durable project memory belongs in project files, not parameters.
17
17
 
18
18
  ## Focused code review
19
19
 
20
20
  Start from [the reviewer example](../../examples/reviewer-prompt-stack.json). It denies writing tools, wraps prior history as background, omits the latest user message from history, then reinserts it as the explicit review target.
21
21
 
22
- Use a rule such as “prioritize correctness, regressions, security, and missing tests.” Keep tools, project context, variables, and history when the reviewer must inspect the repository. Use `append` to retain Pi's normal coding prompt, or `replace` when the stack must fully control prompt and skill visibility.
22
+ Use a rule such as “prioritize correctness, regressions, security, and missing tests.” Keep tools, project context, and history when the reviewer must inspect the repository. Use `append` to retain Pi's normal coding prompt, or `replace` when the stack must fully control prompt and skill visibility.
23
23
 
24
24
  ## Translation mode
25
25
 
26
- Create a small stack with a system block for target language, register/tone, and terminology rules. Retain history and a final `{{lastUserMessage}}`. Separate literal translation, localization review, and bilingual editing into different stacks when their rules conflict.
26
+ Create a small stack with a system block for target language, register/tone, and terminology rules. Retain history and a final `{{ runtime.lastUserMessage }}`. Separate literal translation, localization review, and bilingual editing into different stacks when their rules conflict.
27
27
 
28
28
  ## Multi-mode switching
29
29
 
@@ -48,13 +48,9 @@ Tool policy constrains model tool calls but is not an operating-system sandbox.
48
48
 
49
49
  Keep the Pi mirror, require the tools needed for the workflow, strip prior assistant thinking from inserted history, and move project context near the current user turn. This reduces distracting prompt material without removing relevant repository instructions.
50
50
 
51
- ## SillyTavern DM writer
52
-
53
- [The DM-writer example](../../examples/sillytavern-dm-writer-prompt-stack.json) defines a Dungeon Master through `{{char}}` / `{{user}}`, wraps prior adventure history, reinserts the current action, and uses deterministic regex cleanup for OOC notes, secret-roll markers, dice notation, and `Player:` prefixes.
54
-
55
51
  ## Payload lab
56
52
 
57
- Include `active-model`, `date-cwd`, and `variables`, then add compiled regex rules for deterministic redaction or formatting. Pair the stack with `/payload next` or the web editor's capture view to audit exactly what changed.
53
+ Include `active-model` and `date-cwd`, then add compiled regex rules for deterministic redaction or formatting. Pair the stack with `/payload next` or the web editor's capture view to audit exactly what changed.
58
54
 
59
55
  ## Pi-docs expert
60
56
 
@@ -62,4 +58,4 @@ Allow read/search tools, include the `pi-docs` and project-context slots, and ke
62
58
 
63
59
  ## Trusted runtime status
64
60
 
65
- The [custom system-status example](../../examples/custom-system-status-extension/README.md) registers `{{cpuLoad}}` and a `machine-status` slot from trusted project code. Use this pattern for deterministic host data that cannot be represented as static stack JSON.
61
+ The [custom system-status example](../../examples/custom-system-status-extension/README.md) registers `{{ extensions.cpuLoad }}` and a `machine-status` slot from trusted project code. Use this pattern for deterministic host data that cannot be represented as static stack JSON.
@@ -38,30 +38,26 @@ The stack workspace provides:
38
38
  - validation and a full compiled preview;
39
39
  - registered-tool and loaded-skill search with exact-name chips and wildcard patterns;
40
40
  - raw JSON recovery for advanced or unknown fields;
41
- - native pi-forge and SillyTavern JSON import;
41
+ - native pi-forge JSON import;
42
42
  - export, fork, and deletion;
43
43
  - payload arming and redacted captured-payload inspection;
44
44
  - light and dark themes.
45
45
 
46
- Existing IDs are immutable during edit. Use **Fork** to create a different ID without breaking profile references or the active selection. The toolbar scope selector (default `project`) chooses where new stacks, imports, and forks are written: `global` targets the user-global `~/.pi/forge/prompt-stacks`, `project` targets `.pi/forge/prompt-stacks`. Stack rows show a `global` badge, and save/delete routes use `global:<id>` for exact global mutations. Legacy stacks remain editable in place.
46
+ Existing IDs are immutable during edit. Use **More → Fork** to create a different ID without breaking profile references or the active selection. The compact selector attached to **New stack** (default `Project`) chooses where new stacks, imports, and forks are written: `Global` targets the user-global `~/.pi/forge/prompt-stacks`, `Project` targets `.pi/forge/prompt-stacks`. Less-used capture, fork, import, export, and delete actions live under **More** so the stack and Preview/Diff panes keep the available viewport. Stack rows show a `global` badge, and save/delete routes use `global:<id>` for exact global mutations. Legacy stacks remain editable in place.
47
47
 
48
- Saves, imports, forks, and deletes reload stack state into the current Pi session. When another surface changes a referenced stack, returning to profiles refreshes profile resolution without discarding unsaved delegation fields.
48
+ Saves, imports, forks, and deletes reload stack state into the current Pi session. When another surface changes a referenced stack, returning to profiles refreshes profile resolution.
49
49
 
50
50
  ## Agent-profile workspace
51
51
 
52
- The profile list shows each profile's ID, display metadata, model, thinking level, stack, resolution state, auto-activation, last-applied provenance, delegation status, and a `project`/`global` scope badge. Same-ID shadow pairs are marked `shadows global:<id>` or `shadowed by project:<id>`.
52
+ The profile list shows each profile's ID, display metadata, model, thinking level, stack, resolution state, auto-activation, last-applied provenance, and a `project`/`global` scope badge. Same-ID shadow pairs are marked `shadows global:<id>` or `shadowed by project:<id>`.
53
53
 
54
54
  Trusted projects can create profiles in either scope: the scope selector beside **New profile** (default `project`) chooses whether to write the user-global `~/.pi/forge/agent-profiles` or the project `.pi/forge/agent-profiles`. Global profiles can be edited, validated, saved, applied once, and deleted through explicit `global:<id>` routes; unqualified routes stay project-only. When editing a global profile, the prompt-stack dropdown offers only global stacks. Model choices come from Pi's model registry, thinking choices reflect model support, and stack choices come from the shared repository. The editor rejects a second auto-activation profile within the same scope.
55
55
 
56
56
  The runtime/provenance card separates current runtime state, last-applied snapshot, source-definition changes, and field-level runtime drift.
57
57
 
58
- ## Delegation card
58
+ ## Delegation
59
59
 
60
- The profile delegation card edits the `subagents.profiles.<id>` values for the selected profile's scope: project profiles write to `.pi/forge/config.json`, global profiles write to `~/.pi/forge/config.json`. General defaults and `allowAgentInvocationWithoutApproval` remain config-file-only because they affect broader authorization.
61
-
62
- Unsaved delegation changes are guarded when selecting another profile, starting another profile operation, refreshing, deleting, or leaving/reloading the page. The card shows effective values and the source of each inherited or overridden setting.
63
-
64
- Read [foreground delegation](delegation.md) before enabling a profile.
60
+ Delegation configuration is not part of the main editor. The optional `@zihanw/pi-forge-subagents` package owns the dedicated `.pi/forge/subagents.json` and `~/.pi/forge/subagents.json` files. Read [foreground delegation](delegation.md) before enabling a profile.
65
61
 
66
62
  ## Migration
67
63
 
@@ -23,9 +23,8 @@ Arguments in brackets are optional. Commands that write project files require a
23
23
  | Command | Behavior |
24
24
  |---|---|
25
25
  | `/preset migrate-stacks [--dry-run] [--overwrite] [--delete-legacy]` | Copy legacy `.pi/prompt-stacks` files into `.pi/forge/prompt-stacks`. |
26
- | `/preset import-silly <path> [character_id] [--dry-run] [--overwrite]` | Convert a SillyTavern preset and write a migration report. |
27
26
 
28
- Use migration/import dry runs before overwriting or deleting anything. See [SillyTavern import](../guides/sillytavern-import.md).
27
+ Use migration dry runs before overwriting or deleting anything.
29
28
 
30
29
  ## Agent profiles
31
30
 
@@ -42,13 +41,15 @@ Use migration/import dry runs before overwriting or deleting anything. See [Sill
42
41
 
43
42
  ## Experimental foreground delegation
44
43
 
44
+ The commands below are provided by the optional `@zihanw/pi-forge-subagents` package.
45
+
45
46
  | Command | Behavior |
46
47
  |---|---|
47
48
  | `/forge-agent backends` | List registered experimental backends, capabilities, and effective defaults. |
48
49
  | `/forge-agent plan <profile> [--backend <id>] <task>` | Prepare, validate, display, and discard an exact plan without provider transport. |
49
50
  | `/forge-agent run <profile> [--backend <id>] <task>` | Review and approve an exact foreground read-only run. |
50
51
 
51
- Only project-authorized delegation profiles are accepted. The model-callable equivalents are `forge_subagent_profiles` (local discovery) and `forge_subagent` (execution). See the [delegation safety guide](../guides/delegation.md).
52
+ Only explicitly scoped profiles are accepted: use `project:<id>` or `global:<id>` keys in `subagents.json`. A bare authorization key always means `project:<id>`, even in the global file; `.pi/forge/config.json.subagents` remains a read-only legacy fallback. The model-callable equivalents are `forge_subagent_profiles` (local discovery) and `forge_subagent` (execution). See the [delegation safety guide](../guides/delegation.md).
52
53
 
53
54
  ## Payload inspection
54
55
 
@@ -18,31 +18,30 @@ The port is preferred, not guaranteed. The editor binds only to `127.0.0.1` and
18
18
 
19
19
  ## Experimental subagents
20
20
 
21
- User configuration may set general defaults:
21
+ Subagent configuration is owned by the optional `@zihanw/pi-forge-subagents` package. Dedicated files are `.pi/forge/subagents.json` for a trusted project and `~/.pi/forge/subagents.json` for user defaults. Legacy `.pi/forge/config.json` / `~/.pi/forge/config.json` `subagents` sections are read-only fallback material and emit a warning.
22
+
23
+ User defaults may set general settings:
22
24
 
23
25
  ```json
24
26
  {
25
- "subagents": {
26
- "backend": "pi-subprocess-readonly",
27
- "timeoutMs": 60000
28
- }
27
+ "backend": "pi-subprocess-readonly",
28
+ "timeoutMs": 60000
29
29
  }
30
30
  ```
31
31
 
32
- Trusted project configuration may override defaults, authorize individual project profile IDs, and authorize unattended model invocation:
32
+ Trusted project `subagents.json` may override defaults, authorize individual project profile IDs, and authorize unattended model invocation:
33
33
 
34
34
  ```json
35
35
  {
36
- "subagents": {
37
- "backend": "pi-subprocess-readonly",
38
- "timeoutMs": 60000,
39
- "allowAgentInvocationWithoutApproval": false,
40
- "profiles": {
41
- "reviewer": {
42
- "enabled": true,
43
- "backend": "pi-rpc-readonly",
44
- "timeoutMs": 180000
45
- }
36
+ "backend": "pi-subprocess-readonly",
37
+ "timeoutMs": 60000,
38
+ "allowAgentInvocationWithoutApproval": false,
39
+ "summaryInToolDescription": false,
40
+ "profiles": {
41
+ "project:reviewer": {
42
+ "enabled": true,
43
+ "backend": "pi-rpc-readonly",
44
+ "timeoutMs": 180000
46
45
  }
47
46
  }
48
47
  }
@@ -50,9 +49,9 @@ Trusted project configuration may override defaults, authorize individual projec
50
49
 
51
50
  Valid timeouts are 1,000–3,600,000 ms. Invalid fields warn and fall back to the preceding applicable default. General backend precedence is project then user then built-in; an interactive run and a project profile entry can further override it as described in [delegation](../guides/delegation.md#backends-and-precedence).
52
51
 
53
- `subagents.summaryInToolDescription` (default `false`) embeds a compact, bounded summary of enabled subagent profiles directly in the `forge_subagent` tool description so the parent model can pick a profile without a discovery call. Ready profiles appear first, and unavailable enabled profiles include their first resolution error. It may be set in user or trusted-project configuration and applies wherever it is enabled.
52
+ `summaryInToolDescription` (default `false`) embeds a compact, bounded summary of enabled subagent profiles directly in the `forge_subagent` tool description so the parent model can pick a profile without a discovery call. Ready profiles appear first, and unavailable enabled profiles include their first resolution error. It may be set in user or trusted-project `subagents.json` and applies wherever it is enabled.
54
53
 
55
- `profiles` in global configuration authorizes `global:<id>` profiles; the trusted project's `profiles` authorizes `project:<id>` profiles. Same-ID profiles never inherit enablement, backend, or timeout policy from each other. `allowAgentInvocationWithoutApproval` is project-only, requires trust, and fails closed when malformed. Deleting a profile clears delegation policy only from the matching scope's config.
54
+ Profile authorization keys should use canonical selectors: `project:<id>` or `global:<id>`. A bare key is a compatibility spelling for `project:<id>` regardless of which config file contains it; it never authorizes a global profile. Therefore a global profile must be written explicitly as `"global:reviewer": { "enabled": true }` in `~/.pi/forge/subagents.json`. Same-ID profiles never inherit enablement, backend, or timeout policy from each other. `allowAgentInvocationWithoutApproval` is project-only, requires trust, and fails closed when malformed. Deleting a profile does not modify `subagents.json`; remove any enabled entry for the deleted profile manually.
56
55
 
57
56
  Treat project configuration as an authorization boundary. In particular, do not commit unattended delegation unless every permitted parent agent may transmit compiled prompt and readable project content without another human approval.
58
57
 
@@ -1,6 +1,6 @@
1
1
  # Implemented feature inventory
2
2
 
3
- This file tracks the currently implemented feature surface for agent profiles, the prompt-stack runtime, template variables, web editor, SillyTavern importer, storage migration, payload inspector, and regex MVP.
3
+ This file tracks the currently implemented feature surface for agent profiles, the prompt-stack runtime, static stack variables, web editor, storage migration, payload inspector, and regex MVP.
4
4
 
5
5
  ## Package and Runtime
6
6
 
@@ -33,31 +33,16 @@ This file tracks the currently implemented feature surface for agent profiles, t
33
33
  - Project trust gates profile loading, application, and writes.
34
34
  - Shared typed profile services own capture, protected write/update/delete, application/rollback, immutable preview data, provenance changes, and runtime-drift calculation so command, web-editor, and adapter consumers do not duplicate behavior.
35
35
 
36
- ## Subagent Adapter Contract
36
+ ## Subagent Host Port
37
37
 
38
- - Dedicated experimental `@zihanw/pi-forge/subagent` entry point, with the existing package-root exports retained for 0.4 compatibility.
39
- - Subagent types, canonicalization, request/preflight validation, tool negotiation, context preparation, plan construction, response validation, and diagnostics live in focused modules behind a compatibility contract barrel.
40
- - Exported pure v1 `AgentRequest`, profile snapshot, backend preflight, execution-plan, enforcement-receipt, and discriminated response types without registering or shipping a runner.
38
+ - Experimental versioned `@zihanw/pi-forge/subagent` entry point: the minimal Forge DTO host contract (wire messages, recursive exact-field validators, transport-neutral `ForgeHostTransport`, `ForgeHost`/`ForgeHostClient` lifecycle) plus Forge-owned canonical `sha256:v1` fingerprint helpers byte-compatible with the runtime's canonical JSON.
39
+ - Mandatory lifecycle semantics: bounded discovery timeouts, explicit duplicate-host failure, `hostId`+`generation`-bound request/reply with stale/foreign rejection, disposal with `unavailable` and full listener cleanup. The host starts only after the first workspace snapshot exists, so an advertised host implies a loaded workspace; reload honors project trust (untrusted workspaces expose global resources only).
40
+ - Three minimal operations: `listProfiles` (loaded profile summaries with diagnostics), `resolveProfile` (immutable host-owned profile snapshot artifact with content fingerprints), and `prepare` (host-owned prompt compilation).
41
+ - Host-owned preparation: the client sends only a profile selector, the task text, prompt-compilation access facts (`level`/`network`/`allowProcess`), and backend facts (model, thinking level, tool catalog). The workspace resolves the profile and stack from its snapshot, filters the tool catalog through stack policy and access facts, and compiles through the same compilation context as runtime and preview. Responses return the system prompt, messages ending with the protected delegated task, effective tool IDs/names, diagnostics, the profile snapshot, and `preparedAt`.
42
+ - The port never exposes live contexts, internal registries, or execution/runtime material (access workspace model, limits, `resultProjection`, `parent`, `remoteEgressConsent`, base system prompt). The delegated-task base system prompt is host-owned and intentionally empty; the prompt stack composes the system prompt.
41
43
  - Backend-independent host profile resolution produces path-free declarative snapshots and does not consult the parent model registry or authentication state.
42
44
  - Host dependency scanning detects custom macro and slot references, records registration source identities, and fails resolution when required registrations are missing.
43
- - Backend tool negotiation intersects prompt-stack name policy with declared filesystem/process/network effects and per-request access.
44
- - Optional empty-by-default backend registry validates registration and preflight identity, requires the backend to supply a complete fingerprinted prompt runtime, binds the exact host preparation to execution, routes dry-plan discard, rejects unbound or refingerprinted substitute plans, arbitrates cancellation and host timeouts, normalizes failures, and protects opaque trace routing behind authorization-scoped handles.
45
- - Experimental `pi-subprocess-readonly` backend reuses the host Pi runtime for authenticated preparation, then runs a clean foreground Pi subprocess with the exact profile model, thinking level, and compiled prompt. Its candidate model tools are limited to `read`, `grep`, `find`, and `ls`, further filtered by prompt-stack policy; it loads no write/shell tools, skills, prompt templates, context files, or third-party extensions. Host-coupled capability mismatches fail closed during preflight.
46
- - Delegation is an explicit per-profile opt-in under the trusted project's `subagents.profiles`; ordinary profile loading/application remains independent. Global profile entries warn and are ignored so project-local profile IDs cannot silently authorize unrelated projects. Disabled and unlisted profiles are omitted from `forge_subagent_profiles` and rejected before preparation by the command, model-callable tool, and concrete runtime.
47
- - The no-egress `forge_subagent_profiles` tool gives the main agent a live catalog of enabled profile IDs, names, descriptions, model/thinking/stack metadata, effective backend/timeout and sources, and ready/unavailable resolution status. It also reports whether the parent tool policy currently permits `forge_subagent`.
48
- - `subagents.summaryInToolDescription` (default `false`) embeds a compact, bounded summary of enabled profiles directly in the `forge_subagent` tool description, so the main agent can pick a frequently used profile without a discovery call. Ready profiles sort first, unavailable enabled profiles include their first resolution error, and the summary is capped at 8 profiles and 1,000 characters. It refreshes whenever profiles, stacks, or configuration change and keeps `forge_subagent_profiles` as the authoritative full-detail surface.
49
- - The model-callable `forge_subagent` tool and `/forge-agent run` prepare an immutable plan before provider transport. `/forge-agent run` and the default tool path require explicit human approval; a trusted-project `subagents.allowAgentInvocationWithoutApproval` option may authorize only the model-callable tool without a per-run prompt. The default review shows the task, profile/stack, provider/model/thinking level, effective tools, working directory, shared-user boundary, payload size, and fingerprint; the complete provider-bound prompt can be opened on demand.
50
- - Backend selection is layered configuration rather than profile schema: `subagents.backend` supplies global/project defaults, the trusted project's `subagents.profiles.<id>.backend` supplies a per-profile override, and `/forge-agent plan|run --backend <id>` or the interactive `forge_subagent` `backend` parameter overrides one run. Both the `pi-subprocess-readonly` and `pi-rpc-readonly` backends are registered; there is no fallback when the selected backend is unavailable, and unattended tool invocation is pinned to the effective configured profile backend.
51
- - Foreground timeout is layered host configuration rather than profile schema: `subagents.timeoutMs` supplies a 60,000-millisecond default and `subagents.profiles.<id>.timeoutMs` can override it per profile; values must be from 1,000 through 3,600,000 milliseconds. Invalid values warn and preserve the preceding valid/default value; discovery, planning, and approval surfaces show the effective best-effort timeout and source.
52
- - Foreground progress and the bounded final report enter the normal tool-call result. A dedicated child report channel retains the normalized response, complete text transcript, tool calls/results, diagnostics, usage, approval receipt, and execution report without persisting the full prompt or inline image data; omitted images retain MIME and encoded-size metadata.
53
- - The subprocess backend is explicitly shared-user rather than OS-sandboxed: read-only is a tool policy, host timeout/cancellation are best effort, and `/tree` reverts conversation state rather than provider egress, billing, or external side effects.
54
- - `/forge-agent backends` and `/forge-agent plan <profile> <task>` expose backend discovery and provider-free exact dry planning to a human.
55
- - Deterministic fake-backend conformance coverage exercises accepted/rejected preflight, tool effects, access/limit refusal, exact preparation, success/failure, cancellation races, timeout, media, artifacts, and traces. An offline faux-provider test additionally executes the concrete SDK backend through a real Pi `AgentSession` without network traffic.
56
- - Selected parent context uses explicit provenance and deterministic exact UTF-8 budgeting; required items survive, optional items are selected newest-first, and the complete delegated text/media task remains the protected final user message.
57
- - Granular validators cover request access/depth/media/limits, backend capabilities and enforcement, prompt-runtime fidelity, plan correlation, all response terminal statuses, usage units, artifact namespaces/paths, and authorized trace handles.
58
- - Portable profile, prompt-stack, and complete execution fingerprints use canonical `sha256:v1` serialization without changing legacy branch-provenance fingerprints.
59
- - The opt-in internal Pi SDK spike remains available for broader live diagnostics, including media and trusted custom registrations beyond the shipped text-only walking skeleton.
60
- - Adapter responsibilities and unsupported runner behavior are documented in the [subagent adapter contract](subagent-adapter.md).
45
+ - Execution ownership (delegation authorization in `subagents.json`, the 0.4 execution contract, backend preflight/plan sealing via `@zihanw/pi-subagent-runtime`, approval UX, `forge_subagent`/`forge_subagent_profiles`, and `/forge-agent`) lives in the optional `@zihanw/pi-forge-subagents` package, which consumes this port and never imports main-package internals. See the [subagent host port contract](subagent-host-port.md).
61
46
 
62
47
  ## Prompt Stack Loading and Storage
63
48
 
@@ -70,7 +55,6 @@ This file tracks the currently implemented feature surface for agent profiles, t
70
55
  - `/preset migrate-stacks [--dry-run] [--overwrite] [--delete-legacy]` copies legacy stacks into the forge storage location.
71
56
  - `default.json` auto-activation unless `autoActivate` is `false`.
72
57
  - Branch-aware persisted active stack restore from session entries.
73
- - Branch-aware macro session variable restore when navigating the session tree.
74
58
  - Persisted `/preset use none` / `off` opt-out.
75
59
  - Invalid stacks with error diagnostics are skipped by automatic selection.
76
60
  - Raw stack fields are shape-checked before recovery normalization, including behavior-changing booleans/enums, defaults, context, variables, and item fields.
@@ -105,7 +89,7 @@ This file tracks the currently implemented feature surface for agent profiles, t
105
89
  - `effect: "outgoing"` is active for model-bound prompt text.
106
90
  - `effect: "finalize"` is active for completed assistant messages at `stage: "compiled"` / `targets: ["messages"]`.
107
91
  - `effect: "finalize"` is destructive: it replaces the finalized assistant message in Pi's stored transcript, so the original model output is not preserved.
108
- - `effect: "display"` and `"both"` validate with warnings and are ignored until true display transforms are implemented.
92
+ - `effect: "outgoing"` and `"finalize"` are the only valid effects; `"display"` and `"both"` are rejected during validation.
109
93
  - Streaming display is not transformed; raw text may be visible until the final message replacement happens.
110
94
  - Message transforms support role filters, `maxMessages`, `maxChars`, `minDepth`, `maxDepth`, and `trimStrings`. `$0` is supported as a full-match alias for `$&` in replacements.
111
95
  - Compiled-stage transforms support `targets: ["system"]`, `["messages"]`, or both.
@@ -125,7 +109,6 @@ This file tracks the currently implemented feature surface for agent profiles, t
125
109
  - `date-cwd`
126
110
  - `active-model`
127
111
  - `pi-docs`
128
- - `variables`
129
112
  - `date` and `date-cwd` slots can include `Current time: HH:MM:SS` with `includeTime: true`.
130
113
  - Runtime slots are registered through the same `registerSlot` definition interface used by trusted custom slots.
131
114
  - Trusted `~/.pi/forge/extensions` / `.pi/forge/extensions` modules and reusable Pi packages can register additional runtime slots through `registerSlot`, with declarative option schemas and shared render helpers.
@@ -139,36 +122,29 @@ This file tracks the currently implemented feature surface for agent profiles, t
139
122
  - Tool policy is enforced with `pi.setActiveTools()` and restored when prompt stacks are disabled or switched to an unrestricted stack.
140
123
  - Tool policy preserves later extension tool additions in the restorable baseline while keeping them filtered from an active restrictive stack.
141
124
  - A `tool_call` guard blocks tools outside the active stack policy even if another extension later changes Pi's active tool list.
142
- - Rendered `tools` slots, tool macros such as `{{tools}}`, and `tool-guidelines` respect stack tool policy.
125
+ - Rendered `tools` slots, template paths such as `{{ runtime.selectedToolsText }}`, and `tool-guidelines` respect stack tool policy.
143
126
  - Rendered `skills` slots respect stack skill policy and continue to hide skills marked `disableModelInvocation`.
144
127
  - Skill policy controls model-visible skill listings rendered by pi-forge; it does not disable explicit skill invocation and is not a security boundary.
145
128
  - Validation warns when skill policy is used with `append` or `prepend` mode because Pi's base prompt may already include unfiltered skills.
146
129
 
147
- ## Macros
130
+ ## Macros (forge-v1)
148
131
 
149
- - Built-in macros: `{{cwd}}`, `{{date}}`, `{{time}}`, `{{lastUserMessage}}`, `{{selectedTools}}`, `{{tools}}`, `{{activeModel}}`.
150
- - Built-in macros are registered through the same `registerMacro` definition interface used by trusted custom macros.
151
- - Parser-backed macro expansion supports nested `{{...}}` expressions and `::` argument splitting at the current macro depth.
152
- - Filter macros: `{{trim::value}}`, `{{upper::value}}`, `{{lower::value}}`, `{{json::value}}`, and `{{xml::value}}`.
153
- - Lazy conditional macros: `{{ifvar::name::then::else}}`, `{{ifeq::name::expected::then::else}}`, `{{iftools::tool::then::else}}`, and `{{ifslot::slot::then::else}}`. Only the selected branch is expanded.
154
- - Trusted `~/.pi/forge/extensions` / `.pi/forge/extensions` modules and reusable Pi packages can register additional macros through `registerMacro`, with argument metadata and shared runtime/variable/helper access.
155
- - `getRegisteredMacros()` and `getRegisteredSlots()` expose the active macro/slot definitions for implementation references and UI/resource inspection.
156
- - Static stack variables from `stack.variables`.
157
- - Turn/session/static lookup through `{{getvar::name}}`, `{{var::name}}`, and bare `{{name}}`.
158
- - Turn variable mutation through `{{setvar::name::value}}`, `{{setturnvar::name::value}}`, and `{{clearvar::name}}`.
159
- - Session variable mutation through `{{setsessionvar::name::value}}`, `{{setvar::session::name::value}}`, and `{{clearsessionvar::name}}`.
160
- - Unknown macro diagnostics with configurable keep/warn/error policy.
161
- - Non-string variable values stringify as JSON during macro substitution.
132
+ - Prompt text is compiled with the closed `forge-v1` template engine (parse → analyze → render).
133
+ - Runtime facts resolve through `{{ runtime.* }}` (cwd, date, time, lastUserMessage, selectedToolsText, activeModel, tool/slot booleans).
134
+ - Static values resolve through `{{ parameters.* }}`; schema v2 stores them in `parameters` while v1 stacks read legacy `variables`.
135
+ - Custom macros resolve through `{{ extensions.<name> }}` and are registered via the pure `registerMacro` extension port with declared dependencies and bounded output.
136
+ - Filters: `trim`, `upper`, `lower`, `json`, `xml`, composed with `|` pipelines.
137
+ - Conditionals: `{% if path %}...{% else %}...{% endif %}` with `==` / `!=` string comparisons over template paths.
138
+ - Undefined paths, unknown filters, parse errors, cycles, and output-limit breaches are compile errors; a failing block is omitted rather than re-injected.
139
+ - Legacy v1 stacks keep a bare-name compatibility fallback (`{{name}}`, `{{lastUserMessage}}`, `{{date}}`, ...) that maps to the corresponding parameter/runtime path.
140
+ - `getRegisteredMacros()` and `getRegisteredSlots()` expose active definitions for inspection.
162
141
 
163
- ## Template Variables
142
+ ## Parameters
164
143
 
165
- - Static string variables from `stack.variables`.
166
- - JSON-compatible session variable values: string, number, boolean, null, arrays, and objects.
167
- - Session variable snapshots restore from the current session tree branch, so tree navigation rolls macro variables back/forward with history.
168
- - Valid `<variables>` rendering from the `variables` slot.
169
- - XML variable entries rendered as `<var name="...">...</var>`.
170
- - Optional `format: "plain"` variables slot rendering.
171
- - Scope toggles with `includeStatic`, `includeSession`, and `includeTurn`.
144
+ - Schema v2 stacks store immutable JSON-compatible values in top-level `parameters`.
145
+ - Schema v1 / unversioned stacks read the legacy string-only `variables` field and support bare `{{name}}` fallback.
146
+ - Parameters resolve through `{{ parameters.<name> }}` and are available to trusted custom macros/slots through the frozen environment.
147
+ - Mutable turn/session stores, variable mutation macros, session variable entries, and the `variables` slot are removed in 0.5.0.
172
148
 
173
149
  ## Commands
174
150
 
@@ -180,9 +156,9 @@ This file tracks the currently implemented feature surface for agent profiles, t
180
156
  - `/profile validate [id]`
181
157
  - `/profile reload`
182
158
  - `/profile forget`
183
- - `/forge-agent backends`
184
- - `/forge-agent plan <profile> <task>`
185
- - `/forge-agent run <profile> <task>`
159
+ - `/forge-agent backends` (optional `@zihanw/pi-forge-subagents` package)
160
+ - `/forge-agent plan <profile> <task>` (optional package)
161
+ - `/forge-agent run <profile> <task>` (optional package)
186
162
  - `/preset list`
187
163
  - `/preset status`
188
164
  - `/preset use <id|none>`
@@ -192,29 +168,9 @@ This file tracks the currently implemented feature surface for agent profiles, t
192
168
  - `/preset reload`
193
169
  - `/preset ui [stop|restart]`
194
170
  - `/preset migrate-stacks [--dry-run] [--overwrite] [--delete-legacy]`
195
- - `/preset import-silly <path> [character_id] [--dry-run] [--overwrite]`
196
171
  - `/intercept`
197
172
  - `/payload next [save=<path>]`
198
173
 
199
- ## SillyTavern Import
200
-
201
- - Import SillyTavern preset JSON into `.pi/forge/prompt-stacks/<id>.json`.
202
- - Generate import reports under `.pi/forge/import-reports/<id>.md`.
203
- - Select a specific `character_id` when multiple prompt orders exist.
204
- - Protect existing generated stack/report files from accidental overwrite, with confirmation or `--overwrite`.
205
- - Preview generated output without writing files via `--dry-run`.
206
- - Convert prompt order into prompt stack items.
207
- - Preserve original SillyTavern identifiers in item source metadata.
208
- - Convert `chatHistory` marker to a movable `chat-history` slot.
209
- - Skip unsupported SillyTavern marker items and report omissions.
210
- - Detect `{{lastUserMessage}}` and configure chat history accordingly.
211
- - Strip SillyTavern comments and `{{trim}}` markers.
212
- - Report macros that need manual migration, including normalized camelCase SillyTavern macro names.
213
- - Report supported SillyTavern-style variable macros such as `setvar` and `getvar` as handled by pi-forge.
214
- - Report SillyTavern `extensions.regex_scripts` counts, prompt/display classification, script names, and migration notes.
215
- - Convert safe SillyTavern `promptOnly` regex scripts into pi-forge `regex.rules` with `stage: "history"`, `effect: "outgoing"`, JavaScript replacement syntax, trim strings, depth limits, clear placement role mappings, and preserved `source.sillytavern` metadata. History-stage depth is relative to the filtered chat history, matching SillyTavern's chat-relative depth.
216
- - Leave SillyTavern display-only, mixed prompt/display, DOM/browser, CSS/HTML decoration, JavaScript, unsupported-placement, unsupported-flag, and invalid regex scripts as report-only migration notes.
217
-
218
174
  ## Debugging and Tests
219
175
 
220
176
  - `/intercept` displays the next provider payload with redaction/truncation for secrets and large data.
@@ -223,10 +179,9 @@ This file tracks the currently implemented feature surface for agent profiles, t
223
179
  - The web editor can arm, poll, clear, and inspect the next redacted provider payload in a full-screen collapsible JSON inspector.
224
180
  - Runtime compile diagnostics are visible through a footer status and `/preset diagnostics`.
225
181
  - `/preset ui` starts a token-protected localhost web editor for stack management.
226
- - Node built-in tests cover agent-profile resolution/application/provenance, compiler, loader, SillyTavern importer, and the command/event harness.
227
- - Tests cover variable rendering, XML escaping, macro persistence, and typed macro stringification.
182
+ - Node built-in tests cover agent-profile resolution/application/provenance, compiler, loader, regex, and the command/event harness.
228
183
  - Tests cover regex validation, history-stage transforms, compiled-stage transforms, finalize transforms, replacement syntax, trim strings, depth limits, role/message/char limits, and preservation of non-text message parts.
229
- - Tests cover subagent host resolution, custom dependency detection, all access/required-limit/terminal-status matrices, effect-aware tool negotiation, context budgeting, protected media tasks, canonical fingerprint tamper detection, and malformed external contract values.
184
+ - Tests cover subagent host resolution, custom dependency detection, effect-aware tool negotiation, golden canonical fingerprint vectors, and malformed host-port wire values. Execution-contract matrices (access/required-limit/terminal-status, context budgeting, protected media tasks) moved to the optional package's contract tests.
230
185
  - A real headless-Chrome smoke test covers editor load, dirty state, metadata editing, policy and regex editing, validation, save, disk persistence, export, import, and browser-console errors.
231
186
  - TypeScript strict typecheck passes.
232
187
  - Package dry-run verifies published tarball contents.
@@ -265,16 +220,15 @@ This file tracks the currently implemented feature surface for agent profiles, t
265
220
  - Save existing stack JSON and immediately reload pi-forge stack data.
266
221
  - Save rejects attempts to change an existing stack ID before writing or changing active selection.
267
222
  - Keyboard shortcuts for new stack, save, validate, preview, and closing dialogs/inspectors.
268
- - Import native stack JSON or SillyTavern preset JSON into `.pi/forge/prompt-stacks`; SillyTavern uploads are converted automatically.
269
- - Show the SillyTavern import report in the web editor after import, with copy support.
223
+ - Import native pi-forge stack JSON into `.pi/forge/prompt-stacks`.
270
224
  - Export the current edited stack JSON from the browser, with clipboard fallback when download is unavailable.
271
225
  - Fork the current stack into a new stack file, with optional activation.
272
226
  - Delete stack files, disabling prompt-stack replacement if the deleted stack was active.
273
227
  - Trust and path guardrails for save/import/fork/delete writes.
274
228
  - Top-level navigation between prompt stacks and project agent profiles; stack drafts, selection, and active state survive surface switches.
275
- - Profile list shows ID, name, model/thinking/stack targets, validation state, `autoActivate` and last-applied badges, and a `subagent` badge for delegation-enabled profiles.
229
+ - Profile list shows ID, name, model/thinking/stack targets, validation state, and `autoActivate` and last-applied badges.
276
230
  - Profile create, edit, validate, save, one-shot apply, and delete reuse the shared resolver, transactional application service, and guarded repository; save rejects a second auto-activation profile and on-disk conflicts.
277
231
  - Profile form populates provider/model choices from the model registry and stack choices from the shared stack repository, and shows resolution diagnostics for missing models, authentication, unsupported thinking levels, invalid stacks, and unmatched tool policy.
278
232
  - A runtime/provenance card distinguishes current runtime, last-applied provenance, source-definition state, and per-field runtime drift after external model, thinking-level, or stack changes.
279
- - Per-profile delegation card toggles the trusted project's `subagents.profiles.<id>` opt-in with backend and timeout overrides, writing `.pi/forge/config.json` while preserving unrelated keys and removing emptied entries; the card reports the effective backend/timeout and source, warns about unregistered backends, and keeps project defaults and the unattended-invocation setting read-only.
280
- - Smoke tests cover editor server token checks, bundled page/script markers, save, payload arm/capture/clear, create/fork, SillyTavern JSON import conversion, collision handling, delete, and stop behavior.
233
+ - The main web editor no longer ships a delegation card; delegation configuration is owned by the optional `@zihanw/pi-forge-subagents` package through `.pi/forge/subagents.json`.
234
+ - Smoke tests cover editor server token checks, bundled page/script markers, save, payload arm/capture/clear, create/fork, native JSON import, collision handling, delete, and stop behavior.