@herbertgao/pi-extensions 2026.10.6 → 2026.10.8

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 (511) hide show
  1. package/README.md +11 -15
  2. package/THIRD_PARTY_NOTICES.md +2 -54
  3. package/extensions/clef-format.mjs +113 -0
  4. package/extensions/clef.mjs +112 -0
  5. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +1 -1
  6. package/node_modules/@dietrichgebert/ponytail/.opencode/plugins/ponytail.mjs +30 -6
  7. package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
  8. package/node_modules/@dietrichgebert/ponytail/README.md +5 -1
  9. package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +3 -3
  10. package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +4 -4
  11. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +158 -127
  12. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-config.js +5 -0
  13. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +8 -3
  14. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-runtime.js +14 -8
  15. package/node_modules/@dietrichgebert/ponytail/package.json +1 -1
  16. package/node_modules/@dietrichgebert/ponytail/pi-extension/index.js +16 -3
  17. package/node_modules/@dietrichgebert/ponytail/scripts/cursor-hooks.js +13 -3
  18. package/node_modules/@dietrichgebert/ponytail/scripts/uninstall.js +3 -2
  19. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +3 -3
  20. package/node_modules/@herbertgao/pi-agency/package.json +2 -2
  21. package/node_modules/@herbertgao/pi-bark/package.json +2 -2
  22. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +29 -28
  23. package/node_modules/@herbertgao/pi-cc-extensions/README.md +7 -7
  24. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +16 -27
  25. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +49 -48
  26. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +2 -3
  27. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +228 -141
  28. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/reference/index.ts +2 -3
  29. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer-layout.ts +105 -23
  30. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +59 -43
  31. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/prompt-editor.ts +96 -0
  32. package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +6 -0
  33. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +124 -54
  34. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +7 -4
  35. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +69 -28
  36. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +23 -8
  37. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +2 -2
  38. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +24 -12
  39. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +121 -6
  40. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-limits.ts +3 -2
  41. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-palette.ts +39 -8
  42. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +2 -2
  43. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +13 -13
  44. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/message-display.ts +3 -2
  45. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/names.ts +49 -49
  46. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +24 -0
  47. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-state.ts +51 -2
  48. package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -5
  49. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json +71 -70
  50. package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json +71 -70
  51. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
  52. package/node_modules/@herbertgao/pi-subagents/docs/packages.md +211 -0
  53. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +61 -63
  54. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +24 -16
  55. package/node_modules/@herbertgao/pi-subagents/package.json +5 -5
  56. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +51 -14
  57. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +123 -55
  58. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +144 -13
  59. package/node_modules/@herbertgao/pi-subagents/src/agent-source-badge.ts +78 -0
  60. package/node_modules/@herbertgao/pi-subagents/src/completion-outbox.ts +122 -0
  61. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +171 -79
  62. package/node_modules/@herbertgao/pi-subagents/src/index.ts +597 -296
  63. package/node_modules/@herbertgao/pi-subagents/src/package-resources.ts +724 -0
  64. package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +1 -1
  65. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +66 -0
  66. package/node_modules/@herbertgao/pi-subagents/src/types.ts +26 -4
  67. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +2 -0
  68. package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +354 -32
  69. package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +33 -15
  70. package/node_modules/@herbertgao/pi-subagents/src/workflow/host.ts +6 -0
  71. package/node_modules/@herbertgao/pi-subagents/src/workflow/saved.ts +48 -2
  72. package/node_modules/@herbertgao/sol-pi/package.json +2 -2
  73. package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +3 -3
  74. package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +89 -39
  75. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +1 -1
  76. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +4 -4
  77. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +56 -23
  78. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +6 -3
  79. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +3 -1
  80. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +3 -1
  81. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +3 -1
  82. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +3 -1
  83. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +3 -1
  84. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +3 -1
  85. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +3 -1
  86. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +3 -1
  87. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +3 -1
  88. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +5 -2
  89. package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +122 -0
  90. package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +73 -36
  91. package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +10 -1
  92. package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +15 -13
  93. package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +5 -1
  94. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +15 -0
  95. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +4 -1
  96. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +29 -18
  97. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +1 -1
  98. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +5 -2
  99. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +46 -0
  100. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +19 -8
  101. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +9 -2
  102. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -2
  103. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +56 -25
  104. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +131 -46
  105. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +94 -106
  106. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +51 -0
  107. package/node_modules/@juicesharp/rpiv-ask-user-question/view/scroll-window.ts +73 -0
  108. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +31 -10
  109. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  110. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +474 -93
  111. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  112. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  113. package/node_modules/@tifan/pi-inline-skills/package.json +5 -1
  114. package/node_modules/@tifan/pi-inline-skills/src/index.ts +5 -2
  115. package/node_modules/pi-lens/CHANGELOG.md +88 -0
  116. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -1
  117. package/node_modules/pi-lens/dist/{chunk-BJF25SUG.js → chunk-23WOO7TX.js} +11 -10
  118. package/node_modules/pi-lens/dist/{chunk-WATC3IQR.js → chunk-2B73ZPOK.js} +3 -3
  119. package/node_modules/pi-lens/dist/{chunk-N2IRDBZI.js → chunk-2BBLFX75.js} +101 -11
  120. package/node_modules/pi-lens/dist/{chunk-TA5L5KWQ.js → chunk-2CD5RS6M.js} +2 -2
  121. package/node_modules/pi-lens/dist/{chunk-3TTPKMEF.js → chunk-2VUQMUMT.js} +38 -37
  122. package/node_modules/pi-lens/dist/{chunk-5JHXUETW.js → chunk-3EFKIGZN.js} +3 -3
  123. package/node_modules/pi-lens/dist/chunk-3JNKMP3B.js +17 -0
  124. package/node_modules/pi-lens/dist/{chunk-6P54TMWL.js → chunk-3VPVG5SU.js} +6 -6
  125. package/node_modules/pi-lens/dist/{chunk-ZETYB3XG.js → chunk-3W7IEVVL.js} +44 -28
  126. package/node_modules/pi-lens/dist/chunk-3YN6V5TV.js +85 -0
  127. package/node_modules/pi-lens/dist/chunk-466Z26MG.js +30 -0
  128. package/node_modules/pi-lens/dist/{chunk-PCHDGUKT.js → chunk-4UNXBNE2.js} +12 -11
  129. package/node_modules/pi-lens/dist/{chunk-J7WJZ6W7.js → chunk-4W4VLAPJ.js} +12 -11
  130. package/node_modules/pi-lens/dist/{chunk-F5VLZHUW.js → chunk-52FUZI6K.js} +4 -2
  131. package/node_modules/pi-lens/dist/{chunk-H5EV3VMF.js → chunk-5NGR67U5.js} +2 -2
  132. package/node_modules/pi-lens/dist/{chunk-CBD2B5CP.js → chunk-5UCAH366.js} +21 -20
  133. package/node_modules/pi-lens/dist/{chunk-BHWHXMQ2.js → chunk-67WMNWEE.js} +9 -8
  134. package/node_modules/pi-lens/dist/{chunk-USHG4DLH.js → chunk-6C7JWPCP.js} +7 -7
  135. package/node_modules/pi-lens/dist/{chunk-VPWKF3GN.js → chunk-6GFRNVYR.js} +11 -10
  136. package/node_modules/pi-lens/dist/{chunk-3JL6IFD7.js → chunk-6SDEP3AJ.js} +9 -8
  137. package/node_modules/pi-lens/dist/{chunk-NJF2X5XF.js → chunk-6STA6Z7I.js} +19 -17
  138. package/node_modules/pi-lens/dist/{chunk-KJCWXUUS.js → chunk-724UL2TJ.js} +6 -4
  139. package/node_modules/pi-lens/dist/{chunk-MQA2YBAH.js → chunk-76MWC2K6.js} +3 -3
  140. package/node_modules/pi-lens/dist/{chunk-YLN4K6WD.js → chunk-77M37OKR.js} +10 -8
  141. package/node_modules/pi-lens/dist/{chunk-XHSCVSOL.js → chunk-7DYBLXYA.js} +3 -3
  142. package/node_modules/pi-lens/dist/{chunk-OC7LYAU5.js → chunk-AB3YYG6N.js} +24 -10
  143. package/node_modules/pi-lens/dist/{chunk-LD7WFTRX.js → chunk-ACXEQZOU.js} +16 -16
  144. package/node_modules/pi-lens/dist/{chunk-VSMJK3ZJ.js → chunk-AOHZU2BM.js} +1 -1
  145. package/node_modules/pi-lens/dist/{chunk-T4QZ6FEH.js → chunk-AW7R2GWG.js} +65 -8
  146. package/node_modules/pi-lens/dist/{chunk-GAYGGICG.js → chunk-BKE7E7TC.js} +10 -9
  147. package/node_modules/pi-lens/dist/{chunk-EUT3B22Y.js → chunk-BRGDSBJE.js} +13 -12
  148. package/node_modules/pi-lens/dist/{chunk-T54VJRAD.js → chunk-C34ZXZ7O.js} +55 -11
  149. package/node_modules/pi-lens/dist/{chunk-UGSMCQ4D.js → chunk-CHOW74WE.js} +1 -1
  150. package/node_modules/pi-lens/dist/{chunk-H2W2AXD3.js → chunk-CMMHNUZ2.js} +66 -58
  151. package/node_modules/pi-lens/dist/chunk-CSHFH5IN.js +17 -0
  152. package/node_modules/pi-lens/dist/chunk-EC47DWFA.js +56 -0
  153. package/node_modules/pi-lens/dist/{chunk-KJN4IOEJ.js → chunk-EJIUXPBX.js} +1 -1
  154. package/node_modules/pi-lens/dist/{chunk-IQZXOZ7S.js → chunk-EU63SDCG.js} +720 -334
  155. package/node_modules/pi-lens/dist/{chunk-LNOMA3MP.js → chunk-FCSOVF55.js} +107 -3
  156. package/node_modules/pi-lens/dist/{chunk-CFYISHUW.js → chunk-FLKWCIZH.js} +8 -5
  157. package/node_modules/pi-lens/dist/{chunk-OYTMZXRF.js → chunk-FMSO6RDZ.js} +16 -14
  158. package/node_modules/pi-lens/dist/{chunk-IUKPRZER.js → chunk-GAEGEPOC.js} +2 -2
  159. package/node_modules/pi-lens/dist/{chunk-6XX5HCLK.js → chunk-GBPP5P7X.js} +4 -4
  160. package/node_modules/pi-lens/dist/{chunk-TQFBZVCG.js → chunk-GXW6K4YJ.js} +1 -1
  161. package/node_modules/pi-lens/dist/{chunk-ZZUFZUQZ.js → chunk-H6MF6EVN.js} +331 -107
  162. package/node_modules/pi-lens/dist/{chunk-3JSEWUWI.js → chunk-IBGIOBEE.js} +3 -3
  163. package/node_modules/pi-lens/dist/chunk-IZSHAIJ7.js +26 -0
  164. package/node_modules/pi-lens/dist/{chunk-7ELY2CSM.js → chunk-JAU72XNY.js} +16 -14
  165. package/node_modules/pi-lens/dist/chunk-JMYYOTQG.js +77 -0
  166. package/node_modules/pi-lens/dist/{chunk-ELVWJYRV.js → chunk-JSQFTSC6.js} +12 -11
  167. package/node_modules/pi-lens/dist/{chunk-J6DFZDFA.js → chunk-KBG47GHP.js} +4 -4
  168. package/node_modules/pi-lens/dist/chunk-KDERNTCQ.js +28 -0
  169. package/node_modules/pi-lens/dist/chunk-KSX3TXSZ.js +69 -0
  170. package/node_modules/pi-lens/dist/{chunk-XGUL4SLQ.js → chunk-L3BLXZG7.js} +2 -2
  171. package/node_modules/pi-lens/dist/chunk-LOP6GRPH.js +31 -0
  172. package/node_modules/pi-lens/dist/{chunk-MTDRLSI7.js → chunk-M6HSLBWY.js} +1064 -986
  173. package/node_modules/pi-lens/dist/chunk-MQLUAEOC.js +162 -0
  174. package/node_modules/pi-lens/dist/{chunk-3MRXIJ6I.js → chunk-MRXKYPCS.js} +2 -2
  175. package/node_modules/pi-lens/dist/{chunk-D65GOCJB.js → chunk-MXGY6KPT.js} +19 -16
  176. package/node_modules/pi-lens/dist/{chunk-G3RLJYA2.js → chunk-N2H3ZPZY.js} +47 -1
  177. package/node_modules/pi-lens/dist/{chunk-HREZQCT3.js → chunk-N3X6Q4YT.js} +3 -3
  178. package/node_modules/pi-lens/dist/{chunk-HSIRMK2D.js → chunk-OCAGUNBC.js} +15 -15
  179. package/node_modules/pi-lens/dist/{chunk-ZOEYVXSV.js → chunk-OXXKQCSV.js} +6 -6
  180. package/node_modules/pi-lens/dist/{chunk-S6AMWKPC.js → chunk-P7266HLM.js} +2 -2
  181. package/node_modules/pi-lens/dist/{chunk-64LU2OVH.js → chunk-PHDMFAKM.js} +12 -2
  182. package/node_modules/pi-lens/dist/{chunk-IMSQR4WO.js → chunk-PNQDPDRC.js} +1 -1
  183. package/node_modules/pi-lens/dist/{chunk-IUR76K6A.js → chunk-Q7DUK4LX.js} +5 -5
  184. package/node_modules/pi-lens/dist/{chunk-CULQYFLU.js → chunk-QGQ5CCCG.js} +2 -2
  185. package/node_modules/pi-lens/dist/{chunk-UEAHAMEI.js → chunk-QHJ6DQ2R.js} +11 -11
  186. package/node_modules/pi-lens/dist/{chunk-BNKLYOOO.js → chunk-QILIYSJF.js} +1 -1
  187. package/node_modules/pi-lens/dist/{chunk-VYKKMYVT.js → chunk-QOBUHWHX.js} +11 -6
  188. package/node_modules/pi-lens/dist/{chunk-3PNFWVHT.js → chunk-QQNQ7SJW.js} +2 -75
  189. package/node_modules/pi-lens/dist/{chunk-7M4T5N3V.js → chunk-R3PCY3YS.js} +14 -13
  190. package/node_modules/pi-lens/dist/{chunk-MGIWSROG.js → chunk-RPLINGVB.js} +7 -7
  191. package/node_modules/pi-lens/dist/{chunk-CMU4RMJB.js → chunk-RWWYJ623.js} +10 -1
  192. package/node_modules/pi-lens/dist/{chunk-3FERWMCH.js → chunk-RXCOMYPY.js} +27 -26
  193. package/node_modules/pi-lens/dist/{chunk-7BX5DWSA.js → chunk-SAEFPSB6.js} +11 -11
  194. package/node_modules/pi-lens/dist/{chunk-N7YNJE5R.js → chunk-SQ4TVJBR.js} +10 -10
  195. package/node_modules/pi-lens/dist/{chunk-DMS52BEP.js → chunk-SS36ZX4J.js} +9 -7
  196. package/node_modules/pi-lens/dist/{chunk-JONGANYH.js → chunk-T6CPIZNT.js} +32 -30
  197. package/node_modules/pi-lens/dist/{chunk-6UYA642J.js → chunk-TYM6OUIT.js} +13 -12
  198. package/node_modules/pi-lens/dist/{chunk-ALQRYH6O.js → chunk-UXGETRP4.js} +13 -12
  199. package/node_modules/pi-lens/dist/{chunk-FGALODG3.js → chunk-UZ3TUTRV.js} +1 -1
  200. package/node_modules/pi-lens/dist/{chunk-J3FZR3YY.js → chunk-VCHXCQFG.js} +3 -3
  201. package/node_modules/pi-lens/dist/{chunk-3P4PF2BX.js → chunk-VCO24T4L.js} +34 -22
  202. package/node_modules/pi-lens/dist/{chunk-O7HZX7CA.js → chunk-VRZP76YM.js} +1 -1
  203. package/node_modules/pi-lens/dist/{chunk-VZHJS6DR.js → chunk-VSSBEUFT.js} +16 -15
  204. package/node_modules/pi-lens/dist/{chunk-U52SAGRM.js → chunk-VWCXW2E7.js} +1 -1
  205. package/node_modules/pi-lens/dist/{chunk-WW5BLB74.js → chunk-WOA4LN2R.js} +2 -2
  206. package/node_modules/pi-lens/dist/{chunk-ZMOMPX2Z.js → chunk-WU567RSC.js} +11 -10
  207. package/node_modules/pi-lens/dist/{chunk-N77WFUL7.js → chunk-XAGLWMJ4.js} +23 -22
  208. package/node_modules/pi-lens/dist/{chunk-WSEWKCXU.js → chunk-XCJN5IJU.js} +4 -4
  209. package/node_modules/pi-lens/dist/{chunk-IR6XFA5P.js → chunk-XIJZVPD5.js} +16 -14
  210. package/node_modules/pi-lens/dist/{chunk-OYOB3ZFG.js → chunk-XMSXXAHW.js} +2 -2
  211. package/node_modules/pi-lens/dist/{chunk-34OCDWOS.js → chunk-XTMJ7XDT.js} +1 -1
  212. package/node_modules/pi-lens/dist/{chunk-Z6BB4JLQ.js → chunk-XVF2VVXP.js} +5 -3
  213. package/node_modules/pi-lens/dist/{chunk-AFZYMAIV.js → chunk-YIUAVF7E.js} +37 -35
  214. package/node_modules/pi-lens/dist/{chunk-NFXP47RV.js → chunk-YSZNHOBY.js} +85 -31
  215. package/node_modules/pi-lens/dist/{chunk-V5MEBST3.js → chunk-YYOIQFRS.js} +21 -21
  216. package/node_modules/pi-lens/dist/chunk-Z527N6YQ.js +28 -0
  217. package/node_modules/pi-lens/dist/{chunk-D6YF5HKX.js → chunk-ZANLILYD.js} +22 -2
  218. package/node_modules/pi-lens/dist/{chunk-2UMYMRI3.js → chunk-ZGDGW2V3.js} +2 -2
  219. package/node_modules/pi-lens/dist/{chunk-6B5I6ICN.js → chunk-ZHFZWTZV.js} +12 -11
  220. package/node_modules/pi-lens/dist/{chunk-OEX24ECI.js → chunk-ZWFS3OEF.js} +51 -41
  221. package/node_modules/pi-lens/dist/{chunk-AXKPQ6ZI.js → chunk-ZXYDQ3TZ.js} +5 -5
  222. package/node_modules/pi-lens/dist/index.js +73783 -71033
  223. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +18 -8
  224. package/node_modules/pi-lens/dist/mcp/cli.js +48 -37
  225. package/node_modules/pi-lens/dist/mcp/server.js +568 -397
  226. package/node_modules/pi-lens/dist/mcp/worker.js +67 -55
  227. package/node_modules/pi-lens/dist/probes/installer.js +20 -19
  228. package/node_modules/pi-lens/docs/astplayground.md +1 -1
  229. package/node_modules/pi-lens/docs/configuration.md +29 -0
  230. package/node_modules/pi-lens/docs/dependencies.md +3 -0
  231. package/node_modules/pi-lens/docs/features.md +2 -2
  232. package/node_modules/pi-lens/docs/globalconfig.md +2 -0
  233. package/node_modules/pi-lens/docs/language-coverage.md +2 -1
  234. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +29 -7
  235. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +38 -47
  236. package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
  237. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +17 -4
  238. package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -1
  239. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +18 -0
  240. package/node_modules/pi-lens/docs/pi-lens-subagent.md +7 -0
  241. package/node_modules/pi-lens/docs/real-harness.md +17 -0
  242. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +37 -2
  243. package/node_modules/pi-lens/docs/servercapabilities.md +15 -4
  244. package/node_modules/pi-lens/docs/settings.md +2 -1
  245. package/node_modules/pi-lens/package.json +1 -1
  246. package/node_modules/pi-provider-qoder/dist/index.js +166 -33
  247. package/node_modules/pi-provider-qoder/package.json +1 -1
  248. package/node_modules/pi-typesafe/README.md +3 -3
  249. package/node_modules/pi-typesafe/dist/backends.d.ts +7 -2
  250. package/node_modules/pi-typesafe/dist/backends.js +42 -0
  251. package/node_modules/pi-typesafe/dist/batch.d.ts +10 -6
  252. package/node_modules/pi-typesafe/dist/batch.js +20 -9
  253. package/node_modules/pi-typesafe/dist/client.d.ts +4 -1
  254. package/node_modules/pi-typesafe/dist/client.js +5 -4
  255. package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
  256. package/node_modules/pi-typesafe/dist/index.js +1 -1
  257. package/node_modules/pi-typesafe/dist/schema.d.ts +18 -3
  258. package/node_modules/pi-typesafe/dist/schema.js +29 -3
  259. package/node_modules/pi-typesafe/package.json +1 -1
  260. package/node_modules/pi-web-access/CHANGELOG.md +66 -0
  261. package/node_modules/pi-web-access/README.md +17 -8
  262. package/node_modules/pi-web-access/brave.ts +20 -2
  263. package/node_modules/pi-web-access/content-find.ts +2 -1
  264. package/node_modules/pi-web-access/dist/index.js +668 -408
  265. package/node_modules/pi-web-access/dist/mcp-cli.js +666 -418
  266. package/node_modules/pi-web-access/duckduckgo.ts +5 -1
  267. package/node_modules/pi-web-access/endpoint-pdf-extract.ts +225 -0
  268. package/node_modules/pi-web-access/extract.ts +54 -14
  269. package/node_modules/pi-web-access/fetch-params.ts +10 -0
  270. package/node_modules/pi-web-access/gemini-api.ts +15 -0
  271. package/node_modules/pi-web-access/gemini-search.ts +32 -152
  272. package/node_modules/pi-web-access/github-issue-pr.ts +80 -68
  273. package/node_modules/pi-web-access/index.ts +3 -0
  274. package/node_modules/pi-web-access/package.json +1 -1
  275. package/node_modules/pi-web-access/pdf-extract.ts +38 -4
  276. package/node_modules/pi-web-access/perplexity.ts +19 -2
  277. package/node_modules/pi-web-access/searxng.ts +2 -1
  278. package/node_modules/pi-web-access/ssrf-protection.ts +35 -4
  279. package/node_modules/pi-web-access/summary-review.ts +10 -0
  280. package/node_modules/pi-web-access/tool-arguments.ts +5 -2
  281. package/node_modules/pi-web-access/video-extract.ts +6 -2
  282. package/node_modules/pi-web-access/web-tool-core.ts +53 -13
  283. package/package.json +21 -26
  284. package/node_modules/pi-jev-auto-mode/CHANGELOG.md +0 -118
  285. package/node_modules/pi-jev-auto-mode/LICENSE +0 -21
  286. package/node_modules/pi-jev-auto-mode/README.md +0 -292
  287. package/node_modules/pi-jev-auto-mode/SECURITY.md +0 -32
  288. package/node_modules/pi-jev-auto-mode/docs/calibration.md +0 -154
  289. package/node_modules/pi-jev-auto-mode/docs/design.md +0 -164
  290. package/node_modules/pi-jev-auto-mode/docs/security.md +0 -124
  291. package/node_modules/pi-jev-auto-mode/index.ts +0 -1
  292. package/node_modules/pi-jev-auto-mode/package.json +0 -72
  293. package/node_modules/pi-jev-auto-mode/src/call.ts +0 -180
  294. package/node_modules/pi-jev-auto-mode/src/decide.ts +0 -86
  295. package/node_modules/pi-jev-auto-mode/src/extension.ts +0 -881
  296. package/node_modules/pi-jev-auto-mode/src/intent.ts +0 -71
  297. package/node_modules/pi-jev-auto-mode/src/jev/availability.ts +0 -53
  298. package/node_modules/pi-jev-auto-mode/src/jev/criteria.ts +0 -19
  299. package/node_modules/pi-jev-auto-mode/src/jev/decide.ts +0 -187
  300. package/node_modules/pi-jev-auto-mode/src/jev/engine.ts +0 -165
  301. package/node_modules/pi-jev-auto-mode/src/jev/index.ts +0 -20
  302. package/node_modules/pi-jev-auto-mode/src/jev/questions.ts +0 -273
  303. package/node_modules/pi-jev-auto-mode/src/jev/response.ts +0 -64
  304. package/node_modules/pi-jev-auto-mode/src/jev/state.ts +0 -20
  305. package/node_modules/pi-jev-auto-mode/src/jev/transport.ts +0 -117
  306. package/node_modules/pi-jev-auto-mode/src/jev/types.ts +0 -46
  307. package/node_modules/pi-jev-auto-mode/src/policy.ts +0 -558
  308. package/node_modules/pi-jev-auto-mode/src/records.ts +0 -184
  309. package/node_modules/pi-jev-auto-mode/src/settings.ts +0 -349
  310. package/node_modules/pi-jev-auto-mode/src/ui.ts +0 -243
  311. package/node_modules/pi-lens/dist/chunk-2FQ62SPM.js +0 -83
  312. package/node_modules/pi-lens/dist/chunk-7AXO3ZDF.js +0 -30
  313. package/node_modules/pi-lens/dist/chunk-KMGPUKFD.js +0 -25
  314. package/node_modules/pi-lens/dist/chunk-OZJINN4O.js +0 -84
  315. package/node_modules/pi-lens/dist/chunk-RJFED73B.js +0 -79
  316. package/node_modules/pi-lens/dist/chunk-RTQNRM5X.js +0 -27
  317. package/node_modules/pi-lens/dist/chunk-VGEVL5EQ.js +0 -29
  318. package/node_modules/pi-lens/dist/chunk-WPE5FPGR.js +0 -54
  319. package/node_modules/pi-lens/dist/chunk-Z7QQA2KT.js +0 -27
  320. package/node_modules/resume-from/LICENSE +0 -21
  321. package/node_modules/resume-from/README.md +0 -167
  322. package/node_modules/resume-from/dist/adapters/claude-code/adapter.d.ts +0 -20
  323. package/node_modules/resume-from/dist/adapters/claude-code/adapter.js +0 -59
  324. package/node_modules/resume-from/dist/adapters/claude-code/contract.d.ts +0 -8
  325. package/node_modules/resume-from/dist/adapters/claude-code/contract.js +0 -4
  326. package/node_modules/resume-from/dist/adapters/claude-code/entries.d.ts +0 -30
  327. package/node_modules/resume-from/dist/adapters/claude-code/entries.js +0 -107
  328. package/node_modules/resume-from/dist/adapters/claude-code/index.d.ts +0 -3
  329. package/node_modules/resume-from/dist/adapters/claude-code/index.js +0 -2
  330. package/node_modules/resume-from/dist/adapters/claude-code/layout.d.ts +0 -29
  331. package/node_modules/resume-from/dist/adapters/claude-code/layout.js +0 -80
  332. package/node_modules/resume-from/dist/adapters/claude-code/readback.d.ts +0 -9
  333. package/node_modules/resume-from/dist/adapters/claude-code/readback.js +0 -39
  334. package/node_modules/resume-from/dist/adapters/claude-code/reader.d.ts +0 -40
  335. package/node_modules/resume-from/dist/adapters/claude-code/reader.js +0 -436
  336. package/node_modules/resume-from/dist/adapters/claude-code/redaction.d.ts +0 -26
  337. package/node_modules/resume-from/dist/adapters/claude-code/redaction.js +0 -145
  338. package/node_modules/resume-from/dist/adapters/claude-code/validation.d.ts +0 -4
  339. package/node_modules/resume-from/dist/adapters/claude-code/validation.js +0 -39
  340. package/node_modules/resume-from/dist/adapters/claude-code/writer.d.ts +0 -21
  341. package/node_modules/resume-from/dist/adapters/claude-code/writer.js +0 -306
  342. package/node_modules/resume-from/dist/adapters/codex/contract.d.ts +0 -13
  343. package/node_modules/resume-from/dist/adapters/codex/contract.js +0 -4
  344. package/node_modules/resume-from/dist/adapters/codex/index.d.ts +0 -6
  345. package/node_modules/resume-from/dist/adapters/codex/index.js +0 -43
  346. package/node_modules/resume-from/dist/adapters/codex/read.d.ts +0 -44
  347. package/node_modules/resume-from/dist/adapters/codex/read.js +0 -723
  348. package/node_modules/resume-from/dist/adapters/codex/readback.d.ts +0 -9
  349. package/node_modules/resume-from/dist/adapters/codex/readback.js +0 -47
  350. package/node_modules/resume-from/dist/adapters/codex/redaction.d.ts +0 -26
  351. package/node_modules/resume-from/dist/adapters/codex/redaction.js +0 -145
  352. package/node_modules/resume-from/dist/adapters/codex/rollout.d.ts +0 -115
  353. package/node_modules/resume-from/dist/adapters/codex/rollout.js +0 -269
  354. package/node_modules/resume-from/dist/adapters/codex/validation.d.ts +0 -7
  355. package/node_modules/resume-from/dist/adapters/codex/validation.js +0 -78
  356. package/node_modules/resume-from/dist/adapters/codex/write.d.ts +0 -17
  357. package/node_modules/resume-from/dist/adapters/codex/write.js +0 -141
  358. package/node_modules/resume-from/dist/adapters/contract.d.ts +0 -78
  359. package/node_modules/resume-from/dist/adapters/contract.js +0 -4
  360. package/node_modules/resume-from/dist/adapters/pi/adapter.d.ts +0 -15
  361. package/node_modules/resume-from/dist/adapters/pi/adapter.js +0 -213
  362. package/node_modules/resume-from/dist/adapters/pi/contract.d.ts +0 -24
  363. package/node_modules/resume-from/dist/adapters/pi/contract.js +0 -4
  364. package/node_modules/resume-from/dist/adapters/pi/format.d.ts +0 -162
  365. package/node_modules/resume-from/dist/adapters/pi/format.js +0 -223
  366. package/node_modules/resume-from/dist/adapters/pi/index.d.ts +0 -7
  367. package/node_modules/resume-from/dist/adapters/pi/index.js +0 -10
  368. package/node_modules/resume-from/dist/adapters/pi/parse.d.ts +0 -41
  369. package/node_modules/resume-from/dist/adapters/pi/parse.js +0 -371
  370. package/node_modules/resume-from/dist/adapters/pi/redaction.d.ts +0 -26
  371. package/node_modules/resume-from/dist/adapters/pi/redaction.js +0 -145
  372. package/node_modules/resume-from/dist/adapters/pi/serialize.d.ts +0 -20
  373. package/node_modules/resume-from/dist/adapters/pi/serialize.js +0 -87
  374. package/node_modules/resume-from/dist/adapters/pi/validate.d.ts +0 -14
  375. package/node_modules/resume-from/dist/adapters/pi/validate.js +0 -134
  376. package/node_modules/resume-from/dist/bin.d.ts +0 -35
  377. package/node_modules/resume-from/dist/bin.js +0 -135
  378. package/node_modules/resume-from/dist/contract.d.ts +0 -10
  379. package/node_modules/resume-from/dist/contract.js +0 -4
  380. package/node_modules/resume-from/dist/host/agents.d.ts +0 -29
  381. package/node_modules/resume-from/dist/host/agents.js +0 -20
  382. package/node_modules/resume-from/dist/host/cli/args.d.ts +0 -21
  383. package/node_modules/resume-from/dist/host/cli/args.js +0 -187
  384. package/node_modules/resume-from/dist/host/cli/contract.d.ts +0 -27
  385. package/node_modules/resume-from/dist/host/cli/contract.js +0 -4
  386. package/node_modules/resume-from/dist/host/cli/index.d.ts +0 -2
  387. package/node_modules/resume-from/dist/host/cli/index.js +0 -1
  388. package/node_modules/resume-from/dist/host/cli/presentation.d.ts +0 -2
  389. package/node_modules/resume-from/dist/host/cli/presentation.js +0 -11
  390. package/node_modules/resume-from/dist/host/cli/render.d.ts +0 -3
  391. package/node_modules/resume-from/dist/host/cli/render.js +0 -70
  392. package/node_modules/resume-from/dist/host/cli/runner.d.ts +0 -8
  393. package/node_modules/resume-from/dist/host/cli/runner.js +0 -125
  394. package/node_modules/resume-from/dist/host/contract.d.ts +0 -42
  395. package/node_modules/resume-from/dist/host/contract.js +0 -4
  396. package/node_modules/resume-from/dist/host/entry.d.ts +0 -52
  397. package/node_modules/resume-from/dist/host/entry.js +0 -91
  398. package/node_modules/resume-from/dist/host/index.d.ts +0 -11
  399. package/node_modules/resume-from/dist/host/index.js +0 -10
  400. package/node_modules/resume-from/dist/host/pi-extension/command.d.ts +0 -18
  401. package/node_modules/resume-from/dist/host/pi-extension/command.js +0 -126
  402. package/node_modules/resume-from/dist/host/pi-extension/contract.d.ts +0 -34
  403. package/node_modules/resume-from/dist/host/pi-extension/contract.js +0 -4
  404. package/node_modules/resume-from/dist/host/pi-extension/index.d.ts +0 -6
  405. package/node_modules/resume-from/dist/host/pi-extension/index.js +0 -4
  406. package/node_modules/resume-from/dist/host/pi-extension/picker.d.ts +0 -16
  407. package/node_modules/resume-from/dist/host/pi-extension/picker.js +0 -35
  408. package/node_modules/resume-from/dist/host/pi-extension/presentation.d.ts +0 -2
  409. package/node_modules/resume-from/dist/host/pi-extension/presentation.js +0 -11
  410. package/node_modules/resume-from/dist/host/pi-extension/register.d.ts +0 -25
  411. package/node_modules/resume-from/dist/host/pi-extension/register.js +0 -11
  412. package/node_modules/resume-from/dist/host/pi-extension/ui.d.ts +0 -20
  413. package/node_modules/resume-from/dist/host/pi-extension/ui.js +0 -1
  414. package/node_modules/resume-from/dist/host/profile.d.ts +0 -8
  415. package/node_modules/resume-from/dist/host/profile.js +0 -31
  416. package/node_modules/resume-from/dist/host/registry.d.ts +0 -8
  417. package/node_modules/resume-from/dist/host/registry.js +0 -33
  418. package/node_modules/resume-from/dist/host/wiring.d.ts +0 -41
  419. package/node_modules/resume-from/dist/host/wiring.js +0 -66
  420. package/node_modules/resume-from/dist/import/confirmation.d.ts +0 -9
  421. package/node_modules/resume-from/dist/import/confirmation.js +0 -27
  422. package/node_modules/resume-from/dist/import/contract.d.ts +0 -43
  423. package/node_modules/resume-from/dist/import/contract.js +0 -4
  424. package/node_modules/resume-from/dist/import/discovery/contract.d.ts +0 -63
  425. package/node_modules/resume-from/dist/import/discovery/contract.js +0 -4
  426. package/node_modules/resume-from/dist/import/discovery/errors.d.ts +0 -9
  427. package/node_modules/resume-from/dist/import/discovery/errors.js +0 -12
  428. package/node_modules/resume-from/dist/import/discovery/finder.d.ts +0 -11
  429. package/node_modules/resume-from/dist/import/discovery/finder.js +0 -269
  430. package/node_modules/resume-from/dist/import/discovery/homes.d.ts +0 -23
  431. package/node_modules/resume-from/dist/import/discovery/homes.js +0 -83
  432. package/node_modules/resume-from/dist/import/discovery/index.d.ts +0 -2
  433. package/node_modules/resume-from/dist/import/discovery/index.js +0 -2
  434. package/node_modules/resume-from/dist/import/discovery/ordering.d.ts +0 -3
  435. package/node_modules/resume-from/dist/import/discovery/ordering.js +0 -21
  436. package/node_modules/resume-from/dist/import/errors.d.ts +0 -22
  437. package/node_modules/resume-from/dist/import/errors.js +0 -20
  438. package/node_modules/resume-from/dist/import/index.d.ts +0 -3
  439. package/node_modules/resume-from/dist/import/index.js +0 -5
  440. package/node_modules/resume-from/dist/import/landing/contract.d.ts +0 -44
  441. package/node_modules/resume-from/dist/import/landing/contract.js +0 -4
  442. package/node_modules/resume-from/dist/import/landing/errors.d.ts +0 -15
  443. package/node_modules/resume-from/dist/import/landing/errors.js +0 -15
  444. package/node_modules/resume-from/dist/import/landing/handover.d.ts +0 -5
  445. package/node_modules/resume-from/dist/import/landing/handover.js +0 -12
  446. package/node_modules/resume-from/dist/import/landing/index.d.ts +0 -4
  447. package/node_modules/resume-from/dist/import/landing/index.js +0 -4
  448. package/node_modules/resume-from/dist/import/landing/lander.d.ts +0 -7
  449. package/node_modules/resume-from/dist/import/landing/lander.js +0 -133
  450. package/node_modules/resume-from/dist/import/landing/marker.d.ts +0 -9
  451. package/node_modules/resume-from/dist/import/landing/marker.js +0 -46
  452. package/node_modules/resume-from/dist/import/pipeline.d.ts +0 -28
  453. package/node_modules/resume-from/dist/import/pipeline.js +0 -154
  454. package/node_modules/resume-from/dist/import/preview/builder.d.ts +0 -6
  455. package/node_modules/resume-from/dist/import/preview/builder.js +0 -80
  456. package/node_modules/resume-from/dist/import/preview/contract.d.ts +0 -39
  457. package/node_modules/resume-from/dist/import/preview/contract.js +0 -4
  458. package/node_modules/resume-from/dist/import/preview/format.d.ts +0 -19
  459. package/node_modules/resume-from/dist/import/preview/format.js +0 -45
  460. package/node_modules/resume-from/dist/import/preview/index.d.ts +0 -2
  461. package/node_modules/resume-from/dist/import/preview/index.js +0 -1
  462. package/node_modules/resume-from/dist/import/preview/warnings.d.ts +0 -14
  463. package/node_modules/resume-from/dist/import/preview/warnings.js +0 -86
  464. package/node_modules/resume-from/dist/import/transfer/contract.d.ts +0 -48
  465. package/node_modules/resume-from/dist/import/transfer/contract.js +0 -4
  466. package/node_modules/resume-from/dist/import/transfer/index.d.ts +0 -2
  467. package/node_modules/resume-from/dist/import/transfer/index.js +0 -1
  468. package/node_modules/resume-from/dist/import/transfer/rules.d.ts +0 -3
  469. package/node_modules/resume-from/dist/import/transfer/rules.js +0 -228
  470. package/node_modules/resume-from/dist/import/wiring.d.ts +0 -24
  471. package/node_modules/resume-from/dist/import/wiring.js +0 -37
  472. package/node_modules/resume-from/dist/index.d.ts +0 -36
  473. package/node_modules/resume-from/dist/index.js +0 -36
  474. package/node_modules/resume-from/dist/platform/config/contract.d.ts +0 -35
  475. package/node_modules/resume-from/dist/platform/config/contract.js +0 -4
  476. package/node_modules/resume-from/dist/platform/config/defaults.d.ts +0 -16
  477. package/node_modules/resume-from/dist/platform/config/defaults.js +0 -22
  478. package/node_modules/resume-from/dist/platform/config/errors.d.ts +0 -9
  479. package/node_modules/resume-from/dist/platform/config/errors.js +0 -12
  480. package/node_modules/resume-from/dist/platform/config/index.d.ts +0 -5
  481. package/node_modules/resume-from/dist/platform/config/index.js +0 -6
  482. package/node_modules/resume-from/dist/platform/config/loader.d.ts +0 -10
  483. package/node_modules/resume-from/dist/platform/config/loader.js +0 -47
  484. package/node_modules/resume-from/dist/platform/config/paths.d.ts +0 -13
  485. package/node_modules/resume-from/dist/platform/config/paths.js +0 -37
  486. package/node_modules/resume-from/dist/platform/config/validate.d.ts +0 -9
  487. package/node_modules/resume-from/dist/platform/config/validate.js +0 -117
  488. package/node_modules/resume-from/dist/platform/repo/contract.d.ts +0 -36
  489. package/node_modules/resume-from/dist/platform/repo/contract.js +0 -4
  490. package/node_modules/resume-from/dist/platform/repo/git.d.ts +0 -21
  491. package/node_modules/resume-from/dist/platform/repo/git.js +0 -77
  492. package/node_modules/resume-from/dist/platform/repo/index.d.ts +0 -2
  493. package/node_modules/resume-from/dist/platform/repo/index.js +0 -1
  494. package/node_modules/resume-from/dist/platform/repo/reader.d.ts +0 -3
  495. package/node_modules/resume-from/dist/platform/repo/reader.js +0 -170
  496. package/node_modules/resume-from/dist/platform/store/contract.d.ts +0 -31
  497. package/node_modules/resume-from/dist/platform/store/contract.js +0 -4
  498. package/node_modules/resume-from/dist/platform/store/file-committer.d.ts +0 -3
  499. package/node_modules/resume-from/dist/platform/store/file-committer.js +0 -391
  500. package/node_modules/resume-from/dist/platform/store/index.d.ts +0 -2
  501. package/node_modules/resume-from/dist/platform/store/index.js +0 -2
  502. package/node_modules/resume-from/dist/platform/tokens/contract.d.ts +0 -12
  503. package/node_modules/resume-from/dist/platform/tokens/contract.js +0 -4
  504. package/node_modules/resume-from/dist/platform/tokens/estimator.d.ts +0 -12
  505. package/node_modules/resume-from/dist/platform/tokens/estimator.js +0 -111
  506. package/node_modules/resume-from/dist/platform/tokens/index.d.ts +0 -2
  507. package/node_modules/resume-from/dist/platform/tokens/index.js +0 -1
  508. package/node_modules/resume-from/dist/session/contract.d.ts +0 -116
  509. package/node_modules/resume-from/dist/session/contract.js +0 -4
  510. package/node_modules/resume-from/package.json +0 -83
  511. package/node_modules/resume-from/shims/pi/extensions/resume-from.js +0 -118
@@ -24,6 +24,7 @@ import type {
24
24
  ExtensionContext,
25
25
  } from "@earendil-works/pi-coding-agent"
26
26
  import { resumeAgent, runAgent, type ToolActivity } from "./agent-runner.js"
27
+ import { getAgentConfig } from "./agent-types.js"
27
28
  import { assignHandle, handleBase } from "./mention.js"
28
29
  import { describeModel } from "./model-resolver.js"
29
30
  import type {
@@ -32,6 +33,7 @@ import type {
32
33
  AgentTombstone,
33
34
  IsolationMode,
34
35
  MentionResolution,
36
+ Pool,
35
37
  SubagentType,
36
38
  ThinkingLevel,
37
39
  } from "./types.js"
@@ -191,9 +193,6 @@ function occupiesForegroundSlot(
191
193
  return !!record.blocking && isTopLevelAgent(record)
192
194
  }
193
195
 
194
- /** Which concurrency pool a spawn is charged to, if any. */
195
- type Pool = "background" | "foreground"
196
-
197
196
  interface SpawnArgs {
198
197
  pi: ExtensionAPI
199
198
  ctx: ExtensionContext
@@ -658,10 +657,9 @@ export class AgentManager {
658
657
  * an aborted signal, so a `spawnAndWait` on it would wait forever — pi has no
659
658
  * tool-execution timeout to bail it out.
660
659
  *
661
- * The listener is left in place when the agent starts. `startAgent` adds its
662
- * own, so both fire on a later abort, but `abort()` on an already-stopped
663
- * record is a no-op — so detaching would only be tidiness, and tidiness the
664
- * `abortAll`/`dispose` paths could not offer anyway.
660
+ * The listener is removable (`record.detachParentAbort`): `startAgent`
661
+ * replaces it with its own, and `sendToBackground` must be able to take it
662
+ * off, or the caller that armed it could stop a run it no longer owns.
665
663
  */
666
664
  private armQueuedAbort(id: string, signal?: AbortSignal): boolean {
667
665
  if (signal === undefined) return true
@@ -673,10 +671,39 @@ export class AgentManager {
673
671
  }
674
672
  return false
675
673
  }
676
- signal.addEventListener("abort", () => this.abort(id), { once: true })
674
+ const record = this.agents.get(id)
675
+ if (record) this.armParentAbort(record, signal)
677
676
  return true
678
677
  }
679
678
 
679
+ /**
680
+ * Stop `record` when its caller's `signal` aborts, replacing any listener an
681
+ * earlier stage armed — at most one is live per record, so one call to
682
+ * `detachParentAbort` cuts the run loose from its caller.
683
+ */
684
+ private armParentAbort(
685
+ record: AgentRecord,
686
+ signal: AbortSignal | undefined,
687
+ ): void {
688
+ this.detachParentAbort(record)
689
+ if (signal === undefined) return
690
+ const onParentAbort = () => this.abort(record.id)
691
+ signal.addEventListener("abort", onParentAbort, { once: true })
692
+ record.detachParentAbort = () =>
693
+ signal.removeEventListener("abort", onParentAbort)
694
+ }
695
+
696
+ private detachParentAbort(record: AgentRecord): void {
697
+ record.detachParentAbort?.()
698
+ record.detachParentAbort = undefined
699
+ }
700
+
701
+ /** Add `delta` to the running count of `pool`; no pool, no count. */
702
+ private chargePool(pool: Pool | undefined, delta: 1 | -1): void {
703
+ if (pool === "background") this.runningBackground += delta
704
+ else if (pool === "foreground") this.runningForeground += delta
705
+ }
706
+
680
707
  /**
681
708
  * Kick off an agent's startup and register it under `startups`. The returned
682
709
  * promise never rejects — the failure is delivered through `awaitStartup`,
@@ -762,23 +789,19 @@ export class AgentManager {
762
789
  // still copying its repo. Claiming "running" here also keeps abort() and
763
790
  // abortAll() able to reach an agent whose worktree is still being created.
764
791
  //
765
- // The pool is resolved ONCE, here, and carried to `settleRun` below:
792
+ // The pool is resolved ONCE, here, and recorded for `settleRun`:
766
793
  // `poolFor` reads `maxConcurrentForeground`, which the user can change from
767
794
  // `/agents → Settings` mid-run, so recomputing it at settle time would
768
795
  // decrement a pool this run never charged (counter underflow, limit
769
796
  // silently lifted) or skip the decrement for one it did (leaked slot —
770
- // every later blocking spawn queues forever). The two startup exits below
771
- // never reach `settleRun`, so they hand the slot back themselves.
772
- const pool = this.poolFor(record)
773
- const releaseSlot = () => {
774
- if (pool === "background") this.runningBackground--
775
- else if (pool === "foreground") this.runningForeground--
776
- }
797
+ // every later blocking spawn queues forever). Only `sendToBackground`
798
+ // changes it afterwards, moving the counters with it. The two startup exits
799
+ // below never reach `settleRun`, so they hand the slot back themselves.
800
+ record.chargedPool = this.poolFor(record)
777
801
  record.status = "running"
778
802
  record.startedAt = Date.now()
779
803
  record.startGate = undefined
780
- if (pool === "background") this.runningBackground++
781
- else if (pool === "foreground") this.runningForeground++
804
+ this.chargePool(record.chargedPool, 1)
782
805
 
783
806
  // Worktree isolation: try to create a temporary git worktree. Strict —
784
807
  // fail loud if not possible (no silent fallback to main tree). Done BEFORE
@@ -786,11 +809,19 @@ export class AgentManager {
786
809
  // The project switch is enforced here as well as at the tool boundary
787
810
  // because cross-extension RPC forwards its options unvalidated — a schema
788
811
  // that omits the field can't stop a caller that never saw the schema.
812
+ // The agent file's `isolation:` is resolved here too, not by each caller:
813
+ // mentions pass none, and RPC forwards only its caller's value. Workflow
814
+ // children are the exception, as in Claude Code, whose workflow agent()
815
+ // reads only the script's option and ignores the definition's.
816
+ const isolation =
817
+ options.workflowId !== undefined
818
+ ? options.isolation
819
+ : (getAgentConfig(type)?.isolation ?? options.isolation)
789
820
  let worktreeCwd: string | undefined
790
- if (options.isolation === "worktree" && isWorktreeIsolationEnabled()) {
821
+ if (isolation === "worktree" && isWorktreeIsolationEnabled()) {
791
822
  const wt = await createWorktree(pi, baseCwd, id)
792
823
  if (!wt) {
793
- releaseSlot()
824
+ this.chargePool(record.chargedPool, -1)
794
825
  throw new Error(
795
826
  'Cannot run with isolation: "worktree" — not a git repo, no commits yet, or `git worktree add` failed. ' +
796
827
  "Initialize git and commit at least once, or omit `isolation`.",
@@ -805,6 +836,10 @@ export class AgentManager {
805
836
  // subdirectory, silently dropping extensions/skills.
806
837
  worktreeCwd = customCwd !== undefined ? wt.workPath : wt.path
807
838
  this.worktreeRepos.add(baseCwd)
839
+ // The widget's "worktree" tag reads this; only callers that resolve the
840
+ // agent file themselves seed it.
841
+ record.invocation ??= {}
842
+ record.invocation.isolation = "worktree"
808
843
 
809
844
  // No longer "running" means a stop landed while the copy was being made
810
845
  // (abort(), abortAll()) — a window that did not exist when creation was
@@ -812,7 +847,7 @@ export class AgentManager {
812
847
  // burn tokens on work nobody is waiting for: discard the fresh (and by
813
848
  // definition unchanged) worktree instead.
814
849
  if (record.status !== "running") {
815
- releaseSlot()
850
+ this.chargePool(record.chargedPool, -1)
816
851
  record.worktreeResult = await cleanupWorktree(
817
852
  pi,
818
853
  baseCwd,
@@ -829,24 +864,13 @@ export class AgentManager {
829
864
 
830
865
  this.onStart?.(record)
831
866
 
832
- // Wire parent abort signal to stop the subagent when the parent is interrupted
833
- let detachParentSignal: (() => void) | undefined
834
- if (options.signal) {
835
- // A queued spawn can start minutes after the caller handed us its signal,
836
- // by which time it may already be aborted — and `addEventListener` would
837
- // never fire, leaving a child the parent can no longer reach.
838
- if (options.signal.aborted) this.abort(id)
839
- else {
840
- const onParentAbort = () => this.abort(id)
841
- options.signal.addEventListener("abort", onParentAbort, { once: true })
842
- detachParentSignal = () =>
843
- options.signal!.removeEventListener("abort", onParentAbort)
844
- }
845
- }
846
- const detach = () => {
847
- detachParentSignal?.()
848
- detachParentSignal = undefined
849
- }
867
+ // Wire parent abort signal to stop the subagent when the parent is interrupted.
868
+ // A queued spawn can start minutes after the caller handed us its signal,
869
+ // by which time it may already be aborted — and `addEventListener` would
870
+ // never fire, leaving a child the parent can no longer reach.
871
+ if (options.signal?.aborted) this.abort(id)
872
+ else this.armParentAbort(record, options.signal)
873
+ const detach = () => this.detachParentAbort(record)
850
874
 
851
875
  const promise = runAgent(ctx, type, prompt, {
852
876
  pi,
@@ -1019,7 +1043,7 @@ export class AgentManager {
1019
1043
 
1020
1044
  this.abortOwnedChildren(id)
1021
1045
 
1022
- this.settleRun(record, true, pool)
1046
+ this.settleRun(record, true)
1023
1047
  return responseText
1024
1048
  },
1025
1049
  )
@@ -1061,7 +1085,7 @@ export class AgentManager {
1061
1085
 
1062
1086
  this.abortOwnedChildren(id)
1063
1087
 
1064
- this.settleRun(record, false, pool)
1088
+ this.settleRun(record, false)
1065
1089
  return ""
1066
1090
  })
1067
1091
 
@@ -1089,18 +1113,19 @@ export class AgentManager {
1089
1113
  *
1090
1114
  * @param guardCallback swallow a throwing `onComplete` (the success path does;
1091
1115
  * the error path historically did not, and keeps not doing so).
1092
- * @param pool the pool this run was CHARGED TO at start time — passed in, not
1093
- * recomputed, so a mid-run change to `maxConcurrentForeground` can't make
1094
- * the release disagree with the acquire.
1116
+ *
1117
+ * Releases `record.chargedPool` — the pool the run was charged to at start
1118
+ * (or moved to by `sendToBackground`), never a recomputed one, so a mid-run
1119
+ * change to `maxConcurrentForeground` can't make the release disagree with
1120
+ * the acquire.
1095
1121
  */
1096
- private settleRun(
1097
- record: AgentRecord,
1098
- guardCallback: boolean,
1099
- pool: Pool | undefined,
1100
- ): void {
1122
+ private settleRun(record: AgentRecord, guardCallback: boolean): void {
1101
1123
  if (!record.isBackground) record.resultConsumed = true
1102
- if (pool === "background") this.runningBackground--
1103
- else if (pool === "foreground") this.runningForeground--
1124
+ // Nobody waits on a settled run; a later foreground resume must not look
1125
+ // like a spawn `sendToBackground` could hand off.
1126
+ record.blocking = false
1127
+ const pool = record.chargedPool
1128
+ this.chargePool(pool, -1)
1104
1129
 
1105
1130
  if (guardCallback) {
1106
1131
  try {
@@ -1222,10 +1247,10 @@ export class AgentManager {
1222
1247
  // The run promise only exists once startup is past its awaited repo copy —
1223
1248
  // without this the call would return before the agent had started at all.
1224
1249
  // A startup failure (strict worktree isolation) rejects here, which is what
1225
- // the immediate path owes its caller: pi only marks a tool result failed
1226
- // when `execute` throws. A queued spawn's failure landed on the record
1227
- // instead (nobody was awaiting `startups` at drain time) and is rethrown
1228
- // below, so the contract is the same either way.
1250
+ // the immediate path owes its caller: the Agent tool reports failure by
1251
+ // letting this throw out of `execute`. A queued spawn's failure landed on
1252
+ // the record instead (nobody was awaiting `startups` at drain time) and is
1253
+ // rethrown below, so the contract is the same either way.
1229
1254
  await this.awaitStartup(id)
1230
1255
 
1231
1256
  // undefined when it was aborted while queued, or stopped mid-copy, and so
@@ -1243,6 +1268,49 @@ export class AgentManager {
1243
1268
  return { id, record }
1244
1269
  }
1245
1270
 
1271
+ /**
1272
+ * Hand a live run to the background without restarting it. The session,
1273
+ * promise, in-flight turn, transcript and worktree all continue under the
1274
+ * same id; what changes is who answers for it. The caller's parent-abort
1275
+ * listener comes off (its Esc no longer reaches the run — `abort()` and
1276
+ * `/agents` still do), the slot moves to the background pool, and the run
1277
+ * then settles through the ordinary background path, since `settleRun`
1278
+ * reads the live `isBackground` and `chargedPool`.
1279
+ *
1280
+ * Releasing the caller is the caller's job — the `Agent` tool races its own
1281
+ * wake-up against `spawnAndWait`. This only refuses what it can see: a run
1282
+ * nobody is blocking on (a background or detached spawn, one already handed
1283
+ * off, or a foreground RESUME — `blocking` is cleared when the spawned run
1284
+ * settles, and a resume never charged the slot this would move), and one
1285
+ * that reports through something other than the session (a nested child, a
1286
+ * workflow's agent).
1287
+ *
1288
+ * The background slot is taken even when the pool is full: suspending a
1289
+ * live run is not an option, so it runs over the limit and queued
1290
+ * background work waits for the count to drop, as with `bypassQueue`.
1291
+ */
1292
+ sendToBackground(id: string): boolean {
1293
+ const record = this.agents.get(id)
1294
+ if (
1295
+ !record?.blocking ||
1296
+ !isTopLevelAgent(record) ||
1297
+ record.status !== "running" ||
1298
+ !record.promise
1299
+ )
1300
+ return false
1301
+
1302
+ this.detachParentAbort(record)
1303
+ this.chargePool(record.chargedPool, -1)
1304
+ record.chargedPool = "background"
1305
+ this.chargePool(record.chargedPool, 1)
1306
+ record.blocking = false
1307
+ record.isBackground = true
1308
+ record.resultConsumed = false
1309
+ // A freed foreground slot may have unblocked a queued blocking spawn.
1310
+ this.drainQueue()
1311
+ return true
1312
+ }
1313
+
1246
1314
  /**
1247
1315
  * Resume an existing agent session with a new prompt.
1248
1316
  */
@@ -14,9 +14,13 @@ import {
14
14
  type AgentSession,
15
15
  type AgentSessionEvent,
16
16
  createAgentSession,
17
+ createCodemodeExtension,
18
+ createMcpExtension,
19
+ createToolSearchExtension,
17
20
  DefaultResourceLoader,
18
21
  type ExtensionAPI,
19
22
  getAgentDir,
23
+ type InlineExtension,
20
24
  SessionManager,
21
25
  SettingsManager,
22
26
  } from "@earendil-works/pi-coding-agent"
@@ -101,6 +105,8 @@ export function extensionCanonicalName(extPath: string): string {
101
105
  * co-located file to `pi-subagents`.
102
106
  */
103
107
  function extensionPackageName(extPath: string): string | undefined {
108
+ // `builtin:<name>` names no file; climbing from it would read the process cwd's manifest.
109
+ if (extPath.startsWith("builtin:")) return undefined
104
110
  const entry = resolve(extPath)
105
111
  let dir = dirname(extPath)
106
112
  for (;;) {
@@ -269,6 +275,8 @@ export function installExtensionToolScope(
269
275
  * seeded from `toolNames`.
270
276
  */
271
277
  readmitToolNames: Set<string>
278
+ /** Receives the scope check the child's nested-call gate extension applies. */
279
+ nestedCallGate: NestedCallGate
272
280
  },
273
281
  ): void {
274
282
  const {
@@ -278,6 +286,7 @@ export function installExtensionToolScope(
278
286
  extNames,
279
287
  narrowing,
280
288
  readmitToolNames,
289
+ nestedCallGate,
281
290
  } = ctx
282
291
 
283
292
  // The names allowed right now. Mirrors the `ext:` opt-in flip: when any `ext:`
@@ -308,13 +317,36 @@ export function installExtensionToolScope(
308
317
  return keep
309
318
  }
310
319
 
320
+ // Names this agent selects explicitly: its built-ins, injected tools, and
321
+ // `ext:foo/bar` narrowings. pi activates a named tool even when it is
322
+ // `defaultActive: false`, as `--tools` does.
323
+ const named = new Set([
324
+ ...toolNames,
325
+ ...readmitToolNames,
326
+ ...[...narrowing.values()].flatMap((s) => [...s]),
327
+ ])
328
+
329
+ // Activate what pi itself would: only tools declared to the model (`direct`/
330
+ // `model-only` exposure), and of those only named ones or ones not opted out
331
+ // with `defaultActive: false`. `codemode`/`deferred` tools (pi's MCP tools by
332
+ // default) stay undeclared until their extension or `tool_search` activates
333
+ // them — so an already-active tool is kept, or turn_end would undo that.
311
334
  const renarrow = () => {
312
335
  const allowed = inScope()
336
+ const current = session.getActiveToolNames()
337
+ const active = new Set(current)
313
338
  const next = session
314
339
  .getAllTools()
340
+ .filter(({ name, exposure = "direct" }) => {
341
+ if (!allowed.has(name)) return false
342
+ if (active.has(name)) return true
343
+ if (exposure !== "direct" && exposure !== "model-only") return false
344
+ return (
345
+ named.has(name) ||
346
+ session.getToolDefinition(name)?.defaultActive !== false
347
+ )
348
+ })
315
349
  .map((t) => t.name)
316
- .filter((n) => allowed.has(n))
317
- const current = session.getActiveToolNames()
318
350
  // setActiveToolsByName unconditionally rebuilds the system prompt, so skip
319
351
  // the no-op that steady-state turns would otherwise pay for every turn.
320
352
  if (
@@ -333,6 +365,8 @@ export function installExtensionToolScope(
333
365
  if (event.type === "turn_end") renarrow()
334
366
  })
335
367
 
368
+ nestedCallGate.allows = (name) => inScope().has(name)
369
+
336
370
  const priorBeforeToolCall = session.agent.beforeToolCall
337
371
  session.agent.beforeToolCall = async (context, signal) => {
338
372
  if (!inScope().has(context.toolCall.name)) {
@@ -345,6 +379,35 @@ export function installExtensionToolScope(
345
379
  }
346
380
  }
347
381
 
382
+ /** Set once the child's tool scope is installed; until then the gate admits everything. */
383
+ type NestedCallGate = { allows?: (name: string) => boolean }
384
+
385
+ /**
386
+ * Inline extension that applies the subagent's tool scope to calls a tool makes
387
+ * through `ctx.executeTool()` — codemode scripts calling MCP tools. pi runs those
388
+ * past extensions' `tool_call` handlers only, never `agent.beforeToolCall`, and
389
+ * every registered `codemode`/`deferred` tool is callable there whether or not
390
+ * it is in scope.
391
+ */
392
+ const SCOPE_GATE_NAME = "pi-subagents-scope"
393
+
394
+ function scopeGateExtension(gate: NestedCallGate): InlineExtension {
395
+ return {
396
+ name: SCOPE_GATE_NAME,
397
+ hidden: true,
398
+ factory: (ext) => {
399
+ ext.on("tool_call", (event) =>
400
+ gate.allows?.(event.toolName) === false
401
+ ? {
402
+ block: true,
403
+ reason: `Tool "${event.toolName}" is not available to this subagent.`,
404
+ }
405
+ : undefined,
406
+ )
407
+ },
408
+ }
409
+ }
410
+
348
411
  /** Default max turns. undefined = unlimited (no turn limit). */
349
412
  let defaultMaxTurns: number | undefined
350
413
 
@@ -459,6 +522,7 @@ export interface RunOptions {
459
522
  model?: Model<any>
460
523
  maxTurns?: number
461
524
  signal?: AbortSignal
525
+ /** Applies only when the agent file leaves `isolated:` unset — frontmatter is authoritative. */
462
526
  isolated?: boolean
463
527
  inheritContext?: boolean
464
528
  thinkingLevel?: ThinkingLevel
@@ -708,14 +772,15 @@ export async function runAgent(
708
772
  if (options.worktreeBase) extras.worktreeBase = options.worktreeBase
709
773
  if (options.workflow && !options.structuredOutput) extras.workflowChild = true
710
774
 
775
+ // Resolved here, not by each caller: mention and RPC spawns pass no `isolated`,
776
+ // and the agent file's value must hold on every path.
777
+ const isolated = agentConfig?.isolated ?? options.isolated
711
778
  // Resolve extensions/skills: isolated overrides to false
712
- const extensions = options.isolated ? false : config.extensions
779
+ const extensions = isolated ? false : config.extensions
713
780
  // Nulling excludes under isolated also suppresses the orphaned-exclude warning —
714
781
  // isolation is an intentional override, not a misconfiguration.
715
- const excludeExtensions = options.isolated
716
- ? undefined
717
- : config.excludeExtensions
718
- const skills = options.isolated ? false : config.skills
782
+ const excludeExtensions = isolated ? undefined : config.excludeExtensions
783
+ const skills = isolated ? false : config.skills
719
784
 
720
785
  // Skill preloading: when skills is string[], preload their content into prompt
721
786
  if (Array.isArray(skills)) {
@@ -808,7 +873,7 @@ export async function runAgent(
808
873
  // which extensions load. `ext:foo` against an extension that `extensions:` excluded
809
874
  // is an orphan and warns after reload. `isolated` means no extension tools at all.
810
875
  const { extNames, narrowing } = parseExtSelectors(
811
- options.isolated ? [] : (agentConfig?.extSelectors ?? []),
876
+ isolated ? [] : (agentConfig?.extSelectors ?? []),
812
877
  )
813
878
  const noExtensions = extensions === false
814
879
 
@@ -847,6 +912,7 @@ export async function runAgent(
847
912
  return {
848
913
  ...base,
849
914
  extensions: base.extensions.filter((e) => {
915
+ if (e.path === `<inline:${SCOPE_GATE_NAME}>`) return true // ours, not the agent's
850
916
  const canons = extensionCanonicalNames(e.path)
851
917
  if (canons.some((n) => excludeNames.has(n))) return false // exclude wins
852
918
  return loadAll || canons.some((n) => keepNames.has(n))
@@ -854,7 +920,68 @@ export async function runAgent(
854
920
  }
855
921
  }
856
922
 
923
+ // The child inherits the parent's project-trust decision. pi's SettingsManager
924
+ // defaults to trusted, so without this a subagent in a project the user declined
925
+ // to trust would load its `.pi` extensions and settings, and pi's built-in MCP
926
+ // would start the stdio servers in its `.pi/mcp.json`.
927
+ const projectTrusted = ctx.isProjectTrusted()
928
+ const settingsManager = SettingsManager.create(configCwd, agentDir, {
929
+ projectTrusted,
930
+ })
931
+ // That trust covers the parent's project (`configCwd`), not a directory a spawn
932
+ // was sent into. The session answers `ctx.isProjectTrusted()` for its own cwd,
933
+ // which pi's MCP uses to read `<cwd>/.pi/mcp.json` — so a cross-directory session
934
+ // keeps the parent project's settings but reports its cwd as untrusted. The
935
+ // loader keeps the trusted manager: it loads the parent project's extensions.
936
+ const sessionSettingsManager =
937
+ resolve(effectiveCwd) === resolve(configCwd)
938
+ ? settingsManager
939
+ : Object.assign(
940
+ SettingsManager.create(configCwd, agentDir, { projectTrusted }),
941
+ {
942
+ isProjectTrusted: () => false,
943
+ },
944
+ )
945
+ const nestedCallGate: NestedCallGate = {}
946
+
857
947
  const loader = new DefaultResourceLoader({
948
+ settingsManager,
949
+ // pi's CLI hands its built-in extensions to the loader it builds; this one starts
950
+ // with none. Forwarded as `builtin:` resources they load as in the main session —
951
+ // default-on, disabled by `-builtin:<name>` in settings — and the per-agent
952
+ // allowlist filters them like any other extension. pi's `llama.cpp` built-in is
953
+ // CLI-only (not exported). Fresh factories per spawn: MCP state lives in the closure.
954
+ extensionFactories: [
955
+ {
956
+ name: "codemode",
957
+ factory: createCodemodeExtension(),
958
+ builtin: true,
959
+ replaceable: true,
960
+ },
961
+ {
962
+ name: "tool-search",
963
+ factory: createToolSearchExtension(),
964
+ builtin: true,
965
+ replaceable: true,
966
+ },
967
+ {
968
+ name: "mcp",
969
+ factory: createMcpExtension(),
970
+ builtin: true,
971
+ replaceable: true,
972
+ },
973
+ // Under `noExtensions` the static allowlist gates the registry itself.
974
+ ...(noExtensions ? [] : [scopeGateExtension(nestedCallGate)]),
975
+ ],
976
+ // Mirrors pi's CLI: `--no-mcp` keeps MCP out of subagents too, and `--no-extensions`
977
+ // keeps all the built-ins out. Discovered extensions still follow `extensions:`.
978
+ disabledBuiltinExtensions: process.argv.some(
979
+ (a) => a === "--no-extensions" || a === "-ne",
980
+ )
981
+ ? ["codemode", "tool-search", "mcp"]
982
+ : process.argv.includes("--no-mcp")
983
+ ? ["mcp"]
984
+ : undefined,
858
985
  cwd: configCwd,
859
986
  agentDir,
860
987
  noExtensions,
@@ -967,7 +1094,7 @@ export async function runAgent(
967
1094
  ? options.nestedRuntime
968
1095
  : undefined
969
1096
  const nestedTools =
970
- agentConfig?.allowedSubagents && nestedRuntime && !options.isolated
1097
+ agentConfig?.allowedSubagents && nestedRuntime && !isolated
971
1098
  ? createNestedSubagentTools({
972
1099
  manager: nestedRuntime.manager,
973
1100
  pi: options.pi,
@@ -1075,7 +1202,6 @@ export async function runAgent(
1075
1202
  sessionExcludeTools = [...denyTools]
1076
1203
  }
1077
1204
 
1078
- const settingsManager = SettingsManager.create(configCwd, agentDir)
1079
1205
  const configuredSessionDir = resolveConfiguredSessionDir(
1080
1206
  agentConfig?.sessionDir,
1081
1207
  effectiveCwd,
@@ -1125,7 +1251,7 @@ export async function runAgent(
1125
1251
  cwd: effectiveCwd,
1126
1252
  agentDir,
1127
1253
  sessionManager,
1128
- settingsManager,
1254
+ settingsManager: sessionSettingsManager,
1129
1255
  modelRegistry: ctx.modelRegistry,
1130
1256
  // `as never` is what keeps this assignable across the supported Pi range:
1131
1257
  // pre-0.80.8 the field exists only via the `modelRuntime?: unknown` shim
@@ -1184,6 +1310,7 @@ export async function runAgent(
1184
1310
  extNames,
1185
1311
  narrowing,
1186
1312
  readmitToolNames,
1313
+ nestedCallGate,
1187
1314
  })
1188
1315
  }
1189
1316
 
@@ -1267,7 +1394,10 @@ export async function runAgent(
1267
1394
  const startLen = session.messages.length
1268
1395
  let structuredRetried = false
1269
1396
  try {
1270
- await session.prompt(effectivePrompt)
1397
+ // A signal that fired before this point never calls the listener above, and
1398
+ // pi's `session.abort()` is a no-op until a run is active — so a child whose
1399
+ // parent is already gone is not prompted at all.
1400
+ if (options.signal?.aborted !== true) await session.prompt(effectivePrompt)
1271
1401
 
1272
1402
  // One more prompt when a schema was asked for and nothing usable came back
1273
1403
  // — the model answered in prose, or only ever called the tool invalidly.
@@ -1374,7 +1504,8 @@ export async function resumeAgent(
1374
1504
  : () => {}
1375
1505
 
1376
1506
  try {
1377
- await session.prompt(prompt)
1507
+ // Already aborted: not prompted, as in `runAgent`.
1508
+ if (options.signal?.aborted !== true) await session.prompt(prompt)
1378
1509
  } finally {
1379
1510
  collector.unsubscribe()
1380
1511
  unsubEvents()
@@ -0,0 +1,78 @@
1
+ /**
2
+ * agent-source-badge.ts — How `/agents → Agent types` shows where an agent came
3
+ * from: the per-row badge, the legend that explains the badges actually on
4
+ * screen, and the description line under the highlighted row.
5
+ *
6
+ * These live outside src/index.ts for the same reason as agent-file-toggle.ts:
7
+ * the `/agents` handler is a large closure reached only through
8
+ * `registerCommand`, which every test mocks, so nothing inside it can be
9
+ * asserted on directly.
10
+ *
11
+ * The badges are deliberately terse — the list is one row per agent and the
12
+ * model already occupies the right-hand column. Anything wordier than a glyph
13
+ * (the package's name, in particular) goes on the description line, which
14
+ * `SettingsList` renders for the highlighted row only.
15
+ */
16
+
17
+ import type { AgentConfig } from "./types.js"
18
+
19
+ /**
20
+ * The badge column: a two-cell glyph plus a space, so every label starts at the
21
+ * same offset whether or not the agent is badged.
22
+ *
23
+ * Built-in defaults are unmarked. They are the majority of the list, and a
24
+ * badge on them would make the three that matter — the agents the user or a
25
+ * package put there — harder to pick out, not easier.
26
+ */
27
+ export function sourceIndicator(cfg: AgentConfig | undefined): string {
28
+ const disabled = cfg?.enabled === false
29
+ if (cfg?.source === "project") return disabled ? "✕• " : "• "
30
+ if (cfg?.source === "global") return disabled ? "✕◦ " : "◦ "
31
+ if (cfg?.source === "package") return disabled ? "✕▪ " : "▪ "
32
+ if (disabled) return "✕ "
33
+ return " "
34
+ }
35
+
36
+ /**
37
+ * The legend line, naming only the badges the given roster actually renders.
38
+ *
39
+ * Keyed on what `sourceIndicator` would emit, so the two cannot drift into a
40
+ * glyph with no key (which is what `▪` was) or a key for a glyph that is not on
41
+ * screen. A defaults-only roster returns "", and the caller omits the line.
42
+ *
43
+ * `source` is undefined for built-in defaults — the `"default"` member of the
44
+ * union is declared but never assigned, since default-agents.ts sets only
45
+ * `isDefault` — so they contribute no key, matching their blank badge.
46
+ */
47
+ export function sourceLegend(
48
+ cfgs: readonly (AgentConfig | undefined)[],
49
+ ): string {
50
+ const parts: string[] = []
51
+ if (cfgs.some((c) => c?.source === "project")) parts.push("• = project")
52
+ if (cfgs.some((c) => c?.source === "global")) parts.push("◦ = global")
53
+ if (cfgs.some((c) => c?.source === "package")) parts.push("▪ = package")
54
+ if (cfgs.some((c) => c?.enabled === false)) parts.push("✕ = disabled")
55
+ return parts.join(" ")
56
+ }
57
+
58
+ /**
59
+ * The description line under the highlighted row.
60
+ *
61
+ * `packageName` is the one piece of provenance a badge cannot carry: with two
62
+ * agent-providing packages installed, `▪` says only that *some* package won.
63
+ * It is prefixed rather than appended so it stays visible when a long
64
+ * description wraps, and it prefixes "(disabled)" too — a disabled package
65
+ * agent is exactly the case where you want to know whose it was.
66
+ *
67
+ * Falls back to the agent's own name when it has no description, which is what
68
+ * a hand-written agent file without one already showed.
69
+ */
70
+ export function rowDescription(
71
+ name: string,
72
+ cfg: AgentConfig | undefined,
73
+ packageName?: string,
74
+ ): string {
75
+ const base =
76
+ cfg?.enabled === false ? "(disabled)" : (cfg?.description ?? name)
77
+ return packageName ? `${packageName} · ${base}` : base
78
+ }