@herbertgao/pi-extensions 2026.10.6 → 2026.10.7

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 (473) hide show
  1. package/README.md +9 -13
  2. package/THIRD_PARTY_NOTICES.md +1 -53
  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 +1 -1
  23. package/node_modules/@herbertgao/pi-cc-extensions/README.md +1 -1
  24. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +283 -136
  25. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +90 -22
  26. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +66 -26
  27. package/node_modules/@herbertgao/pi-cc-extensions/package.json +5 -5
  28. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
  29. package/node_modules/@herbertgao/pi-subagents/docs/packages.md +211 -0
  30. package/node_modules/@herbertgao/pi-subagents/docs/rpc.md +61 -63
  31. package/node_modules/@herbertgao/pi-subagents/docs/workflows.md +24 -16
  32. package/node_modules/@herbertgao/pi-subagents/package.json +5 -5
  33. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +51 -14
  34. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +123 -55
  35. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +144 -13
  36. package/node_modules/@herbertgao/pi-subagents/src/agent-source-badge.ts +78 -0
  37. package/node_modules/@herbertgao/pi-subagents/src/completion-outbox.ts +122 -0
  38. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +171 -79
  39. package/node_modules/@herbertgao/pi-subagents/src/index.ts +597 -296
  40. package/node_modules/@herbertgao/pi-subagents/src/package-resources.ts +724 -0
  41. package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +1 -1
  42. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +66 -0
  43. package/node_modules/@herbertgao/pi-subagents/src/types.ts +26 -4
  44. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +2 -0
  45. package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +354 -32
  46. package/node_modules/@herbertgao/pi-subagents/src/ui/fleet-list.ts +33 -15
  47. package/node_modules/@herbertgao/pi-subagents/src/workflow/host.ts +6 -0
  48. package/node_modules/@herbertgao/pi-subagents/src/workflow/saved.ts +48 -2
  49. package/node_modules/@herbertgao/sol-pi/package.json +2 -2
  50. package/node_modules/@juicesharp/rpiv-ask-user-question/README.md +3 -3
  51. package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +89 -39
  52. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/configuration.md +1 -1
  53. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +4 -4
  54. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +56 -23
  55. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +6 -3
  56. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/de.json +3 -1
  57. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/en.json +3 -1
  58. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/es.json +3 -1
  59. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/fr.json +3 -1
  60. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt-BR.json +3 -1
  61. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/pt.json +3 -1
  62. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/ru.json +3 -1
  63. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/uk.json +3 -1
  64. package/node_modules/@juicesharp/rpiv-ask-user-question/locales/zh.json +3 -1
  65. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +5 -2
  66. package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +122 -0
  67. package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +73 -36
  68. package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +10 -1
  69. package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +15 -13
  70. package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +5 -1
  71. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +15 -0
  72. package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +4 -1
  73. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +29 -18
  74. package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +1 -1
  75. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +5 -2
  76. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +46 -0
  77. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +19 -8
  78. package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +9 -2
  79. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -2
  80. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +56 -25
  81. package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +131 -46
  82. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +94 -106
  83. package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +51 -0
  84. package/node_modules/@juicesharp/rpiv-ask-user-question/view/scroll-window.ts +73 -0
  85. package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +31 -10
  86. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  87. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +474 -93
  88. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  89. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  90. package/node_modules/pi-lens/CHANGELOG.md +88 -0
  91. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +3 -1
  92. package/node_modules/pi-lens/dist/{chunk-BJF25SUG.js → chunk-23WOO7TX.js} +11 -10
  93. package/node_modules/pi-lens/dist/{chunk-WATC3IQR.js → chunk-2B73ZPOK.js} +3 -3
  94. package/node_modules/pi-lens/dist/{chunk-N2IRDBZI.js → chunk-2BBLFX75.js} +101 -11
  95. package/node_modules/pi-lens/dist/{chunk-TA5L5KWQ.js → chunk-2CD5RS6M.js} +2 -2
  96. package/node_modules/pi-lens/dist/{chunk-3TTPKMEF.js → chunk-2VUQMUMT.js} +38 -37
  97. package/node_modules/pi-lens/dist/{chunk-5JHXUETW.js → chunk-3EFKIGZN.js} +3 -3
  98. package/node_modules/pi-lens/dist/chunk-3JNKMP3B.js +17 -0
  99. package/node_modules/pi-lens/dist/{chunk-6P54TMWL.js → chunk-3VPVG5SU.js} +6 -6
  100. package/node_modules/pi-lens/dist/{chunk-ZETYB3XG.js → chunk-3W7IEVVL.js} +44 -28
  101. package/node_modules/pi-lens/dist/chunk-3YN6V5TV.js +85 -0
  102. package/node_modules/pi-lens/dist/chunk-466Z26MG.js +30 -0
  103. package/node_modules/pi-lens/dist/{chunk-PCHDGUKT.js → chunk-4UNXBNE2.js} +12 -11
  104. package/node_modules/pi-lens/dist/{chunk-J7WJZ6W7.js → chunk-4W4VLAPJ.js} +12 -11
  105. package/node_modules/pi-lens/dist/{chunk-F5VLZHUW.js → chunk-52FUZI6K.js} +4 -2
  106. package/node_modules/pi-lens/dist/{chunk-H5EV3VMF.js → chunk-5NGR67U5.js} +2 -2
  107. package/node_modules/pi-lens/dist/{chunk-CBD2B5CP.js → chunk-5UCAH366.js} +21 -20
  108. package/node_modules/pi-lens/dist/{chunk-BHWHXMQ2.js → chunk-67WMNWEE.js} +9 -8
  109. package/node_modules/pi-lens/dist/{chunk-USHG4DLH.js → chunk-6C7JWPCP.js} +7 -7
  110. package/node_modules/pi-lens/dist/{chunk-VPWKF3GN.js → chunk-6GFRNVYR.js} +11 -10
  111. package/node_modules/pi-lens/dist/{chunk-3JL6IFD7.js → chunk-6SDEP3AJ.js} +9 -8
  112. package/node_modules/pi-lens/dist/{chunk-NJF2X5XF.js → chunk-6STA6Z7I.js} +19 -17
  113. package/node_modules/pi-lens/dist/{chunk-KJCWXUUS.js → chunk-724UL2TJ.js} +6 -4
  114. package/node_modules/pi-lens/dist/{chunk-MQA2YBAH.js → chunk-76MWC2K6.js} +3 -3
  115. package/node_modules/pi-lens/dist/{chunk-YLN4K6WD.js → chunk-77M37OKR.js} +10 -8
  116. package/node_modules/pi-lens/dist/{chunk-XHSCVSOL.js → chunk-7DYBLXYA.js} +3 -3
  117. package/node_modules/pi-lens/dist/{chunk-OC7LYAU5.js → chunk-AB3YYG6N.js} +24 -10
  118. package/node_modules/pi-lens/dist/{chunk-LD7WFTRX.js → chunk-ACXEQZOU.js} +16 -16
  119. package/node_modules/pi-lens/dist/{chunk-VSMJK3ZJ.js → chunk-AOHZU2BM.js} +1 -1
  120. package/node_modules/pi-lens/dist/{chunk-T4QZ6FEH.js → chunk-AW7R2GWG.js} +65 -8
  121. package/node_modules/pi-lens/dist/{chunk-GAYGGICG.js → chunk-BKE7E7TC.js} +10 -9
  122. package/node_modules/pi-lens/dist/{chunk-EUT3B22Y.js → chunk-BRGDSBJE.js} +13 -12
  123. package/node_modules/pi-lens/dist/{chunk-T54VJRAD.js → chunk-C34ZXZ7O.js} +55 -11
  124. package/node_modules/pi-lens/dist/{chunk-UGSMCQ4D.js → chunk-CHOW74WE.js} +1 -1
  125. package/node_modules/pi-lens/dist/{chunk-H2W2AXD3.js → chunk-CMMHNUZ2.js} +66 -58
  126. package/node_modules/pi-lens/dist/chunk-CSHFH5IN.js +17 -0
  127. package/node_modules/pi-lens/dist/chunk-EC47DWFA.js +56 -0
  128. package/node_modules/pi-lens/dist/{chunk-KJN4IOEJ.js → chunk-EJIUXPBX.js} +1 -1
  129. package/node_modules/pi-lens/dist/{chunk-IQZXOZ7S.js → chunk-EU63SDCG.js} +720 -334
  130. package/node_modules/pi-lens/dist/{chunk-LNOMA3MP.js → chunk-FCSOVF55.js} +107 -3
  131. package/node_modules/pi-lens/dist/{chunk-CFYISHUW.js → chunk-FLKWCIZH.js} +8 -5
  132. package/node_modules/pi-lens/dist/{chunk-OYTMZXRF.js → chunk-FMSO6RDZ.js} +16 -14
  133. package/node_modules/pi-lens/dist/{chunk-IUKPRZER.js → chunk-GAEGEPOC.js} +2 -2
  134. package/node_modules/pi-lens/dist/{chunk-6XX5HCLK.js → chunk-GBPP5P7X.js} +4 -4
  135. package/node_modules/pi-lens/dist/{chunk-TQFBZVCG.js → chunk-GXW6K4YJ.js} +1 -1
  136. package/node_modules/pi-lens/dist/{chunk-ZZUFZUQZ.js → chunk-H6MF6EVN.js} +331 -107
  137. package/node_modules/pi-lens/dist/{chunk-3JSEWUWI.js → chunk-IBGIOBEE.js} +3 -3
  138. package/node_modules/pi-lens/dist/chunk-IZSHAIJ7.js +26 -0
  139. package/node_modules/pi-lens/dist/{chunk-7ELY2CSM.js → chunk-JAU72XNY.js} +16 -14
  140. package/node_modules/pi-lens/dist/chunk-JMYYOTQG.js +77 -0
  141. package/node_modules/pi-lens/dist/{chunk-ELVWJYRV.js → chunk-JSQFTSC6.js} +12 -11
  142. package/node_modules/pi-lens/dist/{chunk-J6DFZDFA.js → chunk-KBG47GHP.js} +4 -4
  143. package/node_modules/pi-lens/dist/chunk-KDERNTCQ.js +28 -0
  144. package/node_modules/pi-lens/dist/chunk-KSX3TXSZ.js +69 -0
  145. package/node_modules/pi-lens/dist/{chunk-XGUL4SLQ.js → chunk-L3BLXZG7.js} +2 -2
  146. package/node_modules/pi-lens/dist/chunk-LOP6GRPH.js +31 -0
  147. package/node_modules/pi-lens/dist/{chunk-MTDRLSI7.js → chunk-M6HSLBWY.js} +1064 -986
  148. package/node_modules/pi-lens/dist/chunk-MQLUAEOC.js +162 -0
  149. package/node_modules/pi-lens/dist/{chunk-3MRXIJ6I.js → chunk-MRXKYPCS.js} +2 -2
  150. package/node_modules/pi-lens/dist/{chunk-D65GOCJB.js → chunk-MXGY6KPT.js} +19 -16
  151. package/node_modules/pi-lens/dist/{chunk-G3RLJYA2.js → chunk-N2H3ZPZY.js} +47 -1
  152. package/node_modules/pi-lens/dist/{chunk-HREZQCT3.js → chunk-N3X6Q4YT.js} +3 -3
  153. package/node_modules/pi-lens/dist/{chunk-HSIRMK2D.js → chunk-OCAGUNBC.js} +15 -15
  154. package/node_modules/pi-lens/dist/{chunk-ZOEYVXSV.js → chunk-OXXKQCSV.js} +6 -6
  155. package/node_modules/pi-lens/dist/{chunk-S6AMWKPC.js → chunk-P7266HLM.js} +2 -2
  156. package/node_modules/pi-lens/dist/{chunk-64LU2OVH.js → chunk-PHDMFAKM.js} +12 -2
  157. package/node_modules/pi-lens/dist/{chunk-IMSQR4WO.js → chunk-PNQDPDRC.js} +1 -1
  158. package/node_modules/pi-lens/dist/{chunk-IUR76K6A.js → chunk-Q7DUK4LX.js} +5 -5
  159. package/node_modules/pi-lens/dist/{chunk-CULQYFLU.js → chunk-QGQ5CCCG.js} +2 -2
  160. package/node_modules/pi-lens/dist/{chunk-UEAHAMEI.js → chunk-QHJ6DQ2R.js} +11 -11
  161. package/node_modules/pi-lens/dist/{chunk-BNKLYOOO.js → chunk-QILIYSJF.js} +1 -1
  162. package/node_modules/pi-lens/dist/{chunk-VYKKMYVT.js → chunk-QOBUHWHX.js} +11 -6
  163. package/node_modules/pi-lens/dist/{chunk-3PNFWVHT.js → chunk-QQNQ7SJW.js} +2 -75
  164. package/node_modules/pi-lens/dist/{chunk-7M4T5N3V.js → chunk-R3PCY3YS.js} +14 -13
  165. package/node_modules/pi-lens/dist/{chunk-MGIWSROG.js → chunk-RPLINGVB.js} +7 -7
  166. package/node_modules/pi-lens/dist/{chunk-CMU4RMJB.js → chunk-RWWYJ623.js} +10 -1
  167. package/node_modules/pi-lens/dist/{chunk-3FERWMCH.js → chunk-RXCOMYPY.js} +27 -26
  168. package/node_modules/pi-lens/dist/{chunk-7BX5DWSA.js → chunk-SAEFPSB6.js} +11 -11
  169. package/node_modules/pi-lens/dist/{chunk-N7YNJE5R.js → chunk-SQ4TVJBR.js} +10 -10
  170. package/node_modules/pi-lens/dist/{chunk-DMS52BEP.js → chunk-SS36ZX4J.js} +9 -7
  171. package/node_modules/pi-lens/dist/{chunk-JONGANYH.js → chunk-T6CPIZNT.js} +32 -30
  172. package/node_modules/pi-lens/dist/{chunk-6UYA642J.js → chunk-TYM6OUIT.js} +13 -12
  173. package/node_modules/pi-lens/dist/{chunk-ALQRYH6O.js → chunk-UXGETRP4.js} +13 -12
  174. package/node_modules/pi-lens/dist/{chunk-FGALODG3.js → chunk-UZ3TUTRV.js} +1 -1
  175. package/node_modules/pi-lens/dist/{chunk-J3FZR3YY.js → chunk-VCHXCQFG.js} +3 -3
  176. package/node_modules/pi-lens/dist/{chunk-3P4PF2BX.js → chunk-VCO24T4L.js} +34 -22
  177. package/node_modules/pi-lens/dist/{chunk-O7HZX7CA.js → chunk-VRZP76YM.js} +1 -1
  178. package/node_modules/pi-lens/dist/{chunk-VZHJS6DR.js → chunk-VSSBEUFT.js} +16 -15
  179. package/node_modules/pi-lens/dist/{chunk-U52SAGRM.js → chunk-VWCXW2E7.js} +1 -1
  180. package/node_modules/pi-lens/dist/{chunk-WW5BLB74.js → chunk-WOA4LN2R.js} +2 -2
  181. package/node_modules/pi-lens/dist/{chunk-ZMOMPX2Z.js → chunk-WU567RSC.js} +11 -10
  182. package/node_modules/pi-lens/dist/{chunk-N77WFUL7.js → chunk-XAGLWMJ4.js} +23 -22
  183. package/node_modules/pi-lens/dist/{chunk-WSEWKCXU.js → chunk-XCJN5IJU.js} +4 -4
  184. package/node_modules/pi-lens/dist/{chunk-IR6XFA5P.js → chunk-XIJZVPD5.js} +16 -14
  185. package/node_modules/pi-lens/dist/{chunk-OYOB3ZFG.js → chunk-XMSXXAHW.js} +2 -2
  186. package/node_modules/pi-lens/dist/{chunk-34OCDWOS.js → chunk-XTMJ7XDT.js} +1 -1
  187. package/node_modules/pi-lens/dist/{chunk-Z6BB4JLQ.js → chunk-XVF2VVXP.js} +5 -3
  188. package/node_modules/pi-lens/dist/{chunk-AFZYMAIV.js → chunk-YIUAVF7E.js} +37 -35
  189. package/node_modules/pi-lens/dist/{chunk-NFXP47RV.js → chunk-YSZNHOBY.js} +85 -31
  190. package/node_modules/pi-lens/dist/{chunk-V5MEBST3.js → chunk-YYOIQFRS.js} +21 -21
  191. package/node_modules/pi-lens/dist/chunk-Z527N6YQ.js +28 -0
  192. package/node_modules/pi-lens/dist/{chunk-D6YF5HKX.js → chunk-ZANLILYD.js} +22 -2
  193. package/node_modules/pi-lens/dist/{chunk-2UMYMRI3.js → chunk-ZGDGW2V3.js} +2 -2
  194. package/node_modules/pi-lens/dist/{chunk-6B5I6ICN.js → chunk-ZHFZWTZV.js} +12 -11
  195. package/node_modules/pi-lens/dist/{chunk-OEX24ECI.js → chunk-ZWFS3OEF.js} +51 -41
  196. package/node_modules/pi-lens/dist/{chunk-AXKPQ6ZI.js → chunk-ZXYDQ3TZ.js} +5 -5
  197. package/node_modules/pi-lens/dist/index.js +73783 -71033
  198. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +18 -8
  199. package/node_modules/pi-lens/dist/mcp/cli.js +48 -37
  200. package/node_modules/pi-lens/dist/mcp/server.js +568 -397
  201. package/node_modules/pi-lens/dist/mcp/worker.js +67 -55
  202. package/node_modules/pi-lens/dist/probes/installer.js +20 -19
  203. package/node_modules/pi-lens/docs/astplayground.md +1 -1
  204. package/node_modules/pi-lens/docs/configuration.md +29 -0
  205. package/node_modules/pi-lens/docs/dependencies.md +3 -0
  206. package/node_modules/pi-lens/docs/features.md +2 -2
  207. package/node_modules/pi-lens/docs/globalconfig.md +2 -0
  208. package/node_modules/pi-lens/docs/language-coverage.md +2 -1
  209. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +29 -7
  210. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +38 -47
  211. package/node_modules/pi-lens/docs/pi-lens-fixer.md +4 -0
  212. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +17 -4
  213. package/node_modules/pi-lens/docs/pi-lens-retro.md +2 -1
  214. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +18 -0
  215. package/node_modules/pi-lens/docs/pi-lens-subagent.md +7 -0
  216. package/node_modules/pi-lens/docs/real-harness.md +17 -0
  217. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +37 -2
  218. package/node_modules/pi-lens/docs/servercapabilities.md +15 -4
  219. package/node_modules/pi-lens/docs/settings.md +2 -1
  220. package/node_modules/pi-lens/package.json +1 -1
  221. package/node_modules/pi-provider-qoder/dist/index.js +30 -2
  222. package/node_modules/pi-provider-qoder/package.json +1 -1
  223. package/node_modules/pi-web-access/CHANGELOG.md +50 -0
  224. package/node_modules/pi-web-access/README.md +13 -7
  225. package/node_modules/pi-web-access/brave.ts +20 -2
  226. package/node_modules/pi-web-access/content-find.ts +2 -1
  227. package/node_modules/pi-web-access/dist/index.js +655 -406
  228. package/node_modules/pi-web-access/dist/mcp-cli.js +653 -416
  229. package/node_modules/pi-web-access/duckduckgo.ts +5 -1
  230. package/node_modules/pi-web-access/endpoint-pdf-extract.ts +225 -0
  231. package/node_modules/pi-web-access/extract.ts +51 -13
  232. package/node_modules/pi-web-access/fetch-params.ts +10 -0
  233. package/node_modules/pi-web-access/gemini-api.ts +15 -0
  234. package/node_modules/pi-web-access/gemini-search.ts +32 -152
  235. package/node_modules/pi-web-access/github-issue-pr.ts +80 -68
  236. package/node_modules/pi-web-access/index.ts +3 -0
  237. package/node_modules/pi-web-access/package.json +1 -1
  238. package/node_modules/pi-web-access/pdf-extract.ts +38 -4
  239. package/node_modules/pi-web-access/perplexity.ts +19 -2
  240. package/node_modules/pi-web-access/ssrf-protection.ts +24 -4
  241. package/node_modules/pi-web-access/summary-review.ts +10 -0
  242. package/node_modules/pi-web-access/tool-arguments.ts +5 -2
  243. package/node_modules/pi-web-access/video-extract.ts +6 -2
  244. package/node_modules/pi-web-access/web-tool-core.ts +53 -13
  245. package/package.json +19 -24
  246. package/node_modules/pi-jev-auto-mode/CHANGELOG.md +0 -118
  247. package/node_modules/pi-jev-auto-mode/LICENSE +0 -21
  248. package/node_modules/pi-jev-auto-mode/README.md +0 -292
  249. package/node_modules/pi-jev-auto-mode/SECURITY.md +0 -32
  250. package/node_modules/pi-jev-auto-mode/docs/calibration.md +0 -154
  251. package/node_modules/pi-jev-auto-mode/docs/design.md +0 -164
  252. package/node_modules/pi-jev-auto-mode/docs/security.md +0 -124
  253. package/node_modules/pi-jev-auto-mode/index.ts +0 -1
  254. package/node_modules/pi-jev-auto-mode/package.json +0 -72
  255. package/node_modules/pi-jev-auto-mode/src/call.ts +0 -180
  256. package/node_modules/pi-jev-auto-mode/src/decide.ts +0 -86
  257. package/node_modules/pi-jev-auto-mode/src/extension.ts +0 -881
  258. package/node_modules/pi-jev-auto-mode/src/intent.ts +0 -71
  259. package/node_modules/pi-jev-auto-mode/src/jev/availability.ts +0 -53
  260. package/node_modules/pi-jev-auto-mode/src/jev/criteria.ts +0 -19
  261. package/node_modules/pi-jev-auto-mode/src/jev/decide.ts +0 -187
  262. package/node_modules/pi-jev-auto-mode/src/jev/engine.ts +0 -165
  263. package/node_modules/pi-jev-auto-mode/src/jev/index.ts +0 -20
  264. package/node_modules/pi-jev-auto-mode/src/jev/questions.ts +0 -273
  265. package/node_modules/pi-jev-auto-mode/src/jev/response.ts +0 -64
  266. package/node_modules/pi-jev-auto-mode/src/jev/state.ts +0 -20
  267. package/node_modules/pi-jev-auto-mode/src/jev/transport.ts +0 -117
  268. package/node_modules/pi-jev-auto-mode/src/jev/types.ts +0 -46
  269. package/node_modules/pi-jev-auto-mode/src/policy.ts +0 -558
  270. package/node_modules/pi-jev-auto-mode/src/records.ts +0 -184
  271. package/node_modules/pi-jev-auto-mode/src/settings.ts +0 -349
  272. package/node_modules/pi-jev-auto-mode/src/ui.ts +0 -243
  273. package/node_modules/pi-lens/dist/chunk-2FQ62SPM.js +0 -83
  274. package/node_modules/pi-lens/dist/chunk-7AXO3ZDF.js +0 -30
  275. package/node_modules/pi-lens/dist/chunk-KMGPUKFD.js +0 -25
  276. package/node_modules/pi-lens/dist/chunk-OZJINN4O.js +0 -84
  277. package/node_modules/pi-lens/dist/chunk-RJFED73B.js +0 -79
  278. package/node_modules/pi-lens/dist/chunk-RTQNRM5X.js +0 -27
  279. package/node_modules/pi-lens/dist/chunk-VGEVL5EQ.js +0 -29
  280. package/node_modules/pi-lens/dist/chunk-WPE5FPGR.js +0 -54
  281. package/node_modules/pi-lens/dist/chunk-Z7QQA2KT.js +0 -27
  282. package/node_modules/resume-from/LICENSE +0 -21
  283. package/node_modules/resume-from/README.md +0 -167
  284. package/node_modules/resume-from/dist/adapters/claude-code/adapter.d.ts +0 -20
  285. package/node_modules/resume-from/dist/adapters/claude-code/adapter.js +0 -59
  286. package/node_modules/resume-from/dist/adapters/claude-code/contract.d.ts +0 -8
  287. package/node_modules/resume-from/dist/adapters/claude-code/contract.js +0 -4
  288. package/node_modules/resume-from/dist/adapters/claude-code/entries.d.ts +0 -30
  289. package/node_modules/resume-from/dist/adapters/claude-code/entries.js +0 -107
  290. package/node_modules/resume-from/dist/adapters/claude-code/index.d.ts +0 -3
  291. package/node_modules/resume-from/dist/adapters/claude-code/index.js +0 -2
  292. package/node_modules/resume-from/dist/adapters/claude-code/layout.d.ts +0 -29
  293. package/node_modules/resume-from/dist/adapters/claude-code/layout.js +0 -80
  294. package/node_modules/resume-from/dist/adapters/claude-code/readback.d.ts +0 -9
  295. package/node_modules/resume-from/dist/adapters/claude-code/readback.js +0 -39
  296. package/node_modules/resume-from/dist/adapters/claude-code/reader.d.ts +0 -40
  297. package/node_modules/resume-from/dist/adapters/claude-code/reader.js +0 -436
  298. package/node_modules/resume-from/dist/adapters/claude-code/redaction.d.ts +0 -26
  299. package/node_modules/resume-from/dist/adapters/claude-code/redaction.js +0 -145
  300. package/node_modules/resume-from/dist/adapters/claude-code/validation.d.ts +0 -4
  301. package/node_modules/resume-from/dist/adapters/claude-code/validation.js +0 -39
  302. package/node_modules/resume-from/dist/adapters/claude-code/writer.d.ts +0 -21
  303. package/node_modules/resume-from/dist/adapters/claude-code/writer.js +0 -306
  304. package/node_modules/resume-from/dist/adapters/codex/contract.d.ts +0 -13
  305. package/node_modules/resume-from/dist/adapters/codex/contract.js +0 -4
  306. package/node_modules/resume-from/dist/adapters/codex/index.d.ts +0 -6
  307. package/node_modules/resume-from/dist/adapters/codex/index.js +0 -43
  308. package/node_modules/resume-from/dist/adapters/codex/read.d.ts +0 -44
  309. package/node_modules/resume-from/dist/adapters/codex/read.js +0 -723
  310. package/node_modules/resume-from/dist/adapters/codex/readback.d.ts +0 -9
  311. package/node_modules/resume-from/dist/adapters/codex/readback.js +0 -47
  312. package/node_modules/resume-from/dist/adapters/codex/redaction.d.ts +0 -26
  313. package/node_modules/resume-from/dist/adapters/codex/redaction.js +0 -145
  314. package/node_modules/resume-from/dist/adapters/codex/rollout.d.ts +0 -115
  315. package/node_modules/resume-from/dist/adapters/codex/rollout.js +0 -269
  316. package/node_modules/resume-from/dist/adapters/codex/validation.d.ts +0 -7
  317. package/node_modules/resume-from/dist/adapters/codex/validation.js +0 -78
  318. package/node_modules/resume-from/dist/adapters/codex/write.d.ts +0 -17
  319. package/node_modules/resume-from/dist/adapters/codex/write.js +0 -141
  320. package/node_modules/resume-from/dist/adapters/contract.d.ts +0 -78
  321. package/node_modules/resume-from/dist/adapters/contract.js +0 -4
  322. package/node_modules/resume-from/dist/adapters/pi/adapter.d.ts +0 -15
  323. package/node_modules/resume-from/dist/adapters/pi/adapter.js +0 -213
  324. package/node_modules/resume-from/dist/adapters/pi/contract.d.ts +0 -24
  325. package/node_modules/resume-from/dist/adapters/pi/contract.js +0 -4
  326. package/node_modules/resume-from/dist/adapters/pi/format.d.ts +0 -162
  327. package/node_modules/resume-from/dist/adapters/pi/format.js +0 -223
  328. package/node_modules/resume-from/dist/adapters/pi/index.d.ts +0 -7
  329. package/node_modules/resume-from/dist/adapters/pi/index.js +0 -10
  330. package/node_modules/resume-from/dist/adapters/pi/parse.d.ts +0 -41
  331. package/node_modules/resume-from/dist/adapters/pi/parse.js +0 -371
  332. package/node_modules/resume-from/dist/adapters/pi/redaction.d.ts +0 -26
  333. package/node_modules/resume-from/dist/adapters/pi/redaction.js +0 -145
  334. package/node_modules/resume-from/dist/adapters/pi/serialize.d.ts +0 -20
  335. package/node_modules/resume-from/dist/adapters/pi/serialize.js +0 -87
  336. package/node_modules/resume-from/dist/adapters/pi/validate.d.ts +0 -14
  337. package/node_modules/resume-from/dist/adapters/pi/validate.js +0 -134
  338. package/node_modules/resume-from/dist/bin.d.ts +0 -35
  339. package/node_modules/resume-from/dist/bin.js +0 -135
  340. package/node_modules/resume-from/dist/contract.d.ts +0 -10
  341. package/node_modules/resume-from/dist/contract.js +0 -4
  342. package/node_modules/resume-from/dist/host/agents.d.ts +0 -29
  343. package/node_modules/resume-from/dist/host/agents.js +0 -20
  344. package/node_modules/resume-from/dist/host/cli/args.d.ts +0 -21
  345. package/node_modules/resume-from/dist/host/cli/args.js +0 -187
  346. package/node_modules/resume-from/dist/host/cli/contract.d.ts +0 -27
  347. package/node_modules/resume-from/dist/host/cli/contract.js +0 -4
  348. package/node_modules/resume-from/dist/host/cli/index.d.ts +0 -2
  349. package/node_modules/resume-from/dist/host/cli/index.js +0 -1
  350. package/node_modules/resume-from/dist/host/cli/presentation.d.ts +0 -2
  351. package/node_modules/resume-from/dist/host/cli/presentation.js +0 -11
  352. package/node_modules/resume-from/dist/host/cli/render.d.ts +0 -3
  353. package/node_modules/resume-from/dist/host/cli/render.js +0 -70
  354. package/node_modules/resume-from/dist/host/cli/runner.d.ts +0 -8
  355. package/node_modules/resume-from/dist/host/cli/runner.js +0 -125
  356. package/node_modules/resume-from/dist/host/contract.d.ts +0 -42
  357. package/node_modules/resume-from/dist/host/contract.js +0 -4
  358. package/node_modules/resume-from/dist/host/entry.d.ts +0 -52
  359. package/node_modules/resume-from/dist/host/entry.js +0 -91
  360. package/node_modules/resume-from/dist/host/index.d.ts +0 -11
  361. package/node_modules/resume-from/dist/host/index.js +0 -10
  362. package/node_modules/resume-from/dist/host/pi-extension/command.d.ts +0 -18
  363. package/node_modules/resume-from/dist/host/pi-extension/command.js +0 -126
  364. package/node_modules/resume-from/dist/host/pi-extension/contract.d.ts +0 -34
  365. package/node_modules/resume-from/dist/host/pi-extension/contract.js +0 -4
  366. package/node_modules/resume-from/dist/host/pi-extension/index.d.ts +0 -6
  367. package/node_modules/resume-from/dist/host/pi-extension/index.js +0 -4
  368. package/node_modules/resume-from/dist/host/pi-extension/picker.d.ts +0 -16
  369. package/node_modules/resume-from/dist/host/pi-extension/picker.js +0 -35
  370. package/node_modules/resume-from/dist/host/pi-extension/presentation.d.ts +0 -2
  371. package/node_modules/resume-from/dist/host/pi-extension/presentation.js +0 -11
  372. package/node_modules/resume-from/dist/host/pi-extension/register.d.ts +0 -25
  373. package/node_modules/resume-from/dist/host/pi-extension/register.js +0 -11
  374. package/node_modules/resume-from/dist/host/pi-extension/ui.d.ts +0 -20
  375. package/node_modules/resume-from/dist/host/pi-extension/ui.js +0 -1
  376. package/node_modules/resume-from/dist/host/profile.d.ts +0 -8
  377. package/node_modules/resume-from/dist/host/profile.js +0 -31
  378. package/node_modules/resume-from/dist/host/registry.d.ts +0 -8
  379. package/node_modules/resume-from/dist/host/registry.js +0 -33
  380. package/node_modules/resume-from/dist/host/wiring.d.ts +0 -41
  381. package/node_modules/resume-from/dist/host/wiring.js +0 -66
  382. package/node_modules/resume-from/dist/import/confirmation.d.ts +0 -9
  383. package/node_modules/resume-from/dist/import/confirmation.js +0 -27
  384. package/node_modules/resume-from/dist/import/contract.d.ts +0 -43
  385. package/node_modules/resume-from/dist/import/contract.js +0 -4
  386. package/node_modules/resume-from/dist/import/discovery/contract.d.ts +0 -63
  387. package/node_modules/resume-from/dist/import/discovery/contract.js +0 -4
  388. package/node_modules/resume-from/dist/import/discovery/errors.d.ts +0 -9
  389. package/node_modules/resume-from/dist/import/discovery/errors.js +0 -12
  390. package/node_modules/resume-from/dist/import/discovery/finder.d.ts +0 -11
  391. package/node_modules/resume-from/dist/import/discovery/finder.js +0 -269
  392. package/node_modules/resume-from/dist/import/discovery/homes.d.ts +0 -23
  393. package/node_modules/resume-from/dist/import/discovery/homes.js +0 -83
  394. package/node_modules/resume-from/dist/import/discovery/index.d.ts +0 -2
  395. package/node_modules/resume-from/dist/import/discovery/index.js +0 -2
  396. package/node_modules/resume-from/dist/import/discovery/ordering.d.ts +0 -3
  397. package/node_modules/resume-from/dist/import/discovery/ordering.js +0 -21
  398. package/node_modules/resume-from/dist/import/errors.d.ts +0 -22
  399. package/node_modules/resume-from/dist/import/errors.js +0 -20
  400. package/node_modules/resume-from/dist/import/index.d.ts +0 -3
  401. package/node_modules/resume-from/dist/import/index.js +0 -5
  402. package/node_modules/resume-from/dist/import/landing/contract.d.ts +0 -44
  403. package/node_modules/resume-from/dist/import/landing/contract.js +0 -4
  404. package/node_modules/resume-from/dist/import/landing/errors.d.ts +0 -15
  405. package/node_modules/resume-from/dist/import/landing/errors.js +0 -15
  406. package/node_modules/resume-from/dist/import/landing/handover.d.ts +0 -5
  407. package/node_modules/resume-from/dist/import/landing/handover.js +0 -12
  408. package/node_modules/resume-from/dist/import/landing/index.d.ts +0 -4
  409. package/node_modules/resume-from/dist/import/landing/index.js +0 -4
  410. package/node_modules/resume-from/dist/import/landing/lander.d.ts +0 -7
  411. package/node_modules/resume-from/dist/import/landing/lander.js +0 -133
  412. package/node_modules/resume-from/dist/import/landing/marker.d.ts +0 -9
  413. package/node_modules/resume-from/dist/import/landing/marker.js +0 -46
  414. package/node_modules/resume-from/dist/import/pipeline.d.ts +0 -28
  415. package/node_modules/resume-from/dist/import/pipeline.js +0 -154
  416. package/node_modules/resume-from/dist/import/preview/builder.d.ts +0 -6
  417. package/node_modules/resume-from/dist/import/preview/builder.js +0 -80
  418. package/node_modules/resume-from/dist/import/preview/contract.d.ts +0 -39
  419. package/node_modules/resume-from/dist/import/preview/contract.js +0 -4
  420. package/node_modules/resume-from/dist/import/preview/format.d.ts +0 -19
  421. package/node_modules/resume-from/dist/import/preview/format.js +0 -45
  422. package/node_modules/resume-from/dist/import/preview/index.d.ts +0 -2
  423. package/node_modules/resume-from/dist/import/preview/index.js +0 -1
  424. package/node_modules/resume-from/dist/import/preview/warnings.d.ts +0 -14
  425. package/node_modules/resume-from/dist/import/preview/warnings.js +0 -86
  426. package/node_modules/resume-from/dist/import/transfer/contract.d.ts +0 -48
  427. package/node_modules/resume-from/dist/import/transfer/contract.js +0 -4
  428. package/node_modules/resume-from/dist/import/transfer/index.d.ts +0 -2
  429. package/node_modules/resume-from/dist/import/transfer/index.js +0 -1
  430. package/node_modules/resume-from/dist/import/transfer/rules.d.ts +0 -3
  431. package/node_modules/resume-from/dist/import/transfer/rules.js +0 -228
  432. package/node_modules/resume-from/dist/import/wiring.d.ts +0 -24
  433. package/node_modules/resume-from/dist/import/wiring.js +0 -37
  434. package/node_modules/resume-from/dist/index.d.ts +0 -36
  435. package/node_modules/resume-from/dist/index.js +0 -36
  436. package/node_modules/resume-from/dist/platform/config/contract.d.ts +0 -35
  437. package/node_modules/resume-from/dist/platform/config/contract.js +0 -4
  438. package/node_modules/resume-from/dist/platform/config/defaults.d.ts +0 -16
  439. package/node_modules/resume-from/dist/platform/config/defaults.js +0 -22
  440. package/node_modules/resume-from/dist/platform/config/errors.d.ts +0 -9
  441. package/node_modules/resume-from/dist/platform/config/errors.js +0 -12
  442. package/node_modules/resume-from/dist/platform/config/index.d.ts +0 -5
  443. package/node_modules/resume-from/dist/platform/config/index.js +0 -6
  444. package/node_modules/resume-from/dist/platform/config/loader.d.ts +0 -10
  445. package/node_modules/resume-from/dist/platform/config/loader.js +0 -47
  446. package/node_modules/resume-from/dist/platform/config/paths.d.ts +0 -13
  447. package/node_modules/resume-from/dist/platform/config/paths.js +0 -37
  448. package/node_modules/resume-from/dist/platform/config/validate.d.ts +0 -9
  449. package/node_modules/resume-from/dist/platform/config/validate.js +0 -117
  450. package/node_modules/resume-from/dist/platform/repo/contract.d.ts +0 -36
  451. package/node_modules/resume-from/dist/platform/repo/contract.js +0 -4
  452. package/node_modules/resume-from/dist/platform/repo/git.d.ts +0 -21
  453. package/node_modules/resume-from/dist/platform/repo/git.js +0 -77
  454. package/node_modules/resume-from/dist/platform/repo/index.d.ts +0 -2
  455. package/node_modules/resume-from/dist/platform/repo/index.js +0 -1
  456. package/node_modules/resume-from/dist/platform/repo/reader.d.ts +0 -3
  457. package/node_modules/resume-from/dist/platform/repo/reader.js +0 -170
  458. package/node_modules/resume-from/dist/platform/store/contract.d.ts +0 -31
  459. package/node_modules/resume-from/dist/platform/store/contract.js +0 -4
  460. package/node_modules/resume-from/dist/platform/store/file-committer.d.ts +0 -3
  461. package/node_modules/resume-from/dist/platform/store/file-committer.js +0 -391
  462. package/node_modules/resume-from/dist/platform/store/index.d.ts +0 -2
  463. package/node_modules/resume-from/dist/platform/store/index.js +0 -2
  464. package/node_modules/resume-from/dist/platform/tokens/contract.d.ts +0 -12
  465. package/node_modules/resume-from/dist/platform/tokens/contract.js +0 -4
  466. package/node_modules/resume-from/dist/platform/tokens/estimator.d.ts +0 -12
  467. package/node_modules/resume-from/dist/platform/tokens/estimator.js +0 -111
  468. package/node_modules/resume-from/dist/platform/tokens/index.d.ts +0 -2
  469. package/node_modules/resume-from/dist/platform/tokens/index.js +0 -1
  470. package/node_modules/resume-from/dist/session/contract.d.ts +0 -116
  471. package/node_modules/resume-from/dist/session/contract.js +0 -4
  472. package/node_modules/resume-from/package.json +0 -83
  473. package/node_modules/resume-from/shims/pi/extensions/resume-from.js +0 -118
@@ -1,47 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { dirname } from "node:path";
3
- import { defaultConfig } from "./defaults.js";
4
- import { ConfigLoadError } from "./errors.js";
5
- import { defaultConfigPath } from "./paths.js";
6
- import { buildConfig } from "./validate.js";
7
- /**
8
- * A loader that reads one JSON file and fills every missing setting with its default.
9
- * It never writes: a missing file is a missing file, not something to create (T-CFG-13).
10
- */
11
- export function createConfigLoader(options = {}) {
12
- const configPath = options.configPath ?? defaultConfigPath();
13
- return {
14
- async load() {
15
- const text = await readConfigFile(configPath);
16
- // No file, or a file the user emptied: both mean "nothing set", not "nothing works".
17
- if (text === undefined || text.trim() === "")
18
- return defaultConfig();
19
- let parsed;
20
- try {
21
- parsed = JSON.parse(text);
22
- }
23
- catch (cause) {
24
- // Not a fallback to defaults: a file the user wrote and the tool ignored is worse
25
- // than an error.
26
- throw new ConfigLoadError(configPath, `${configPath} is not valid JSON: ${reason(cause)}. Fix the syntax, or delete the ` +
27
- "file to use the defaults.");
28
- }
29
- return buildConfig(parsed, dirname(configPath), configPath);
30
- },
31
- };
32
- }
33
- /** The file's text, or undefined when there is no file to read. */
34
- async function readConfigFile(configPath) {
35
- try {
36
- return await readFile(configPath, "utf8");
37
- }
38
- catch (cause) {
39
- const code = cause.code;
40
- if (code === "ENOENT")
41
- return undefined;
42
- throw new ConfigLoadError(configPath, `${configPath} cannot be read: ${reason(cause)}. Check the path and its permissions.`);
43
- }
44
- }
45
- function reason(cause) {
46
- return cause instanceof Error ? cause.message : String(cause);
47
- }
@@ -1,13 +0,0 @@
1
- import type { HomePath } from "./contract.js";
2
- /** Where the configuration lives when the caller names no other file. */
3
- export declare function defaultConfigPath(): string;
4
- /**
5
- * Turns a home as written into an absolute, symlink-free path: a leading `~` becomes the
6
- * user's home, a relative path is resolved against the configuration file's own directory
7
- * (an invocation's working directory would make the same file mean different things), and
8
- * symlinks are followed so `src/import/discovery/` deduplicates locations, not spellings.
9
- *
10
- * A home that does not exist keeps its resolved spelling. Existence is not checked here —
11
- * a home may be created between the load and the search.
12
- */
13
- export declare function resolveHomePath(raw: string, baseDir: string): Promise<HomePath>;
@@ -1,37 +0,0 @@
1
- import { realpath } from "node:fs/promises";
2
- import { homedir } from "node:os";
3
- import { isAbsolute, resolve } from "node:path";
4
- const CONFIG_DIR = ".config";
5
- const APP_DIR = "resume-from";
6
- const CONFIG_FILE = "config.json";
7
- /** Where the configuration lives when the caller names no other file. */
8
- export function defaultConfigPath() {
9
- return resolve(homedir(), CONFIG_DIR, APP_DIR, CONFIG_FILE);
10
- }
11
- /**
12
- * Turns a home as written into an absolute, symlink-free path: a leading `~` becomes the
13
- * user's home, a relative path is resolved against the configuration file's own directory
14
- * (an invocation's working directory would make the same file mean different things), and
15
- * symlinks are followed so `src/import/discovery/` deduplicates locations, not spellings.
16
- *
17
- * A home that does not exist keeps its resolved spelling. Existence is not checked here —
18
- * a home may be created between the load and the search.
19
- */
20
- export async function resolveHomePath(raw, baseDir) {
21
- const expanded = expandTilde(raw);
22
- const absolute = isAbsolute(expanded) ? resolve(expanded) : resolve(baseDir, expanded);
23
- try {
24
- return await realpath(absolute);
25
- }
26
- catch {
27
- return absolute;
28
- }
29
- }
30
- function expandTilde(raw) {
31
- if (raw === "~")
32
- return homedir();
33
- // Only "~/": "~other" is another user's home to a shell, and a plain segment here.
34
- if (raw.startsWith("~/"))
35
- return resolve(homedir(), raw.slice(2));
36
- return raw;
37
- }
@@ -1,9 +0,0 @@
1
- import type { ImportConfig } from "./contract.js";
2
- /**
3
- * Completes and checks one parsed configuration file. Absent settings keep their default;
4
- * a present but unusable one rejects with the field named (FR-56).
5
- *
6
- * @param baseDir directory a relative home is resolved against — the file's own directory.
7
- * @param source the file's path, used as the field of a whole-file complaint.
8
- */
9
- export declare function buildConfig(raw: unknown, baseDir: string, source: string): Promise<ImportConfig>;
@@ -1,117 +0,0 @@
1
- import { defaultConfig } from "./defaults.js";
2
- import { ConfigLoadError } from "./errors.js";
3
- import { resolveHomePath } from "./paths.js";
4
- // Exhaustive by construction: adding an agent (FR-57) fails to compile here until it is listed,
5
- // instead of silently rejecting the new value at run time.
6
- const AGENTS = { pi: true, codex: true, "claude-code": true };
7
- const SETTINGS = {
8
- extraHomes: true,
9
- budgetShare: true,
10
- pinnedRecentTurns: true,
11
- windowOverrides: true,
12
- };
13
- /**
14
- * Completes and checks one parsed configuration file. Absent settings keep their default;
15
- * a present but unusable one rejects with the field named (FR-56).
16
- *
17
- * @param baseDir directory a relative home is resolved against — the file's own directory.
18
- * @param source the file's path, used as the field of a whole-file complaint.
19
- */
20
- export async function buildConfig(raw, baseDir, source) {
21
- const settings = asRecord(raw, source, `${source} must hold a JSON object of settings, such as { "budgetShare": 0.5 }.`);
22
- for (const key of Object.keys(settings)) {
23
- if (!Object.hasOwn(SETTINGS, key)) {
24
- throw new ConfigLoadError(key, `${key} is not a setting. The settings are ${Object.keys(SETTINGS).join(", ")}. ` +
25
- "Correct the spelling or remove the line.");
26
- }
27
- }
28
- const config = defaultConfig();
29
- if (settings.budgetShare !== undefined) {
30
- config.budgetShare = asShare("budgetShare", settings.budgetShare);
31
- }
32
- if (settings.pinnedRecentTurns !== undefined) {
33
- config.pinnedRecentTurns = asTurnCount("pinnedRecentTurns", settings.pinnedRecentTurns);
34
- }
35
- if (settings.extraHomes !== undefined) {
36
- config.extraHomes = await asHomeEntries(settings.extraHomes, baseDir);
37
- }
38
- if (settings.windowOverrides !== undefined) {
39
- config.windowOverrides = asWindowOverrides(settings.windowOverrides);
40
- }
41
- return config;
42
- }
43
- function asShare(field, value) {
44
- // 0 is refused: it would make FR-33 block every import, which is a mistake, not a choice.
45
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0 || value > 1) {
46
- throw new ConfigLoadError(field, `${field} must be a number greater than 0 and at most 1, for example 0.5. Found ${show(value)}.`);
47
- }
48
- return value;
49
- }
50
- function asTurnCount(field, value) {
51
- if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
52
- throw new ConfigLoadError(field, `${field} must be a whole number of turns, zero or more, for example 8. Found ${show(value)}.`);
53
- }
54
- return value;
55
- }
56
- async function asHomeEntries(value, baseDir) {
57
- const items = asArray(value, "extraHomes");
58
- const entries = [];
59
- for (const [index, item] of items.entries()) {
60
- const field = `extraHomes[${index}]`;
61
- const entry = asRecord(item, field, `${field} must be an object with an agent and a home, such as ` +
62
- '{ "agent": "pi", "home": "~/.pi-work" }.');
63
- entries.push({
64
- agent: asAgentId(`${field}.agent`, entry.agent),
65
- home: await resolveHomePath(asPath(`${field}.home`, entry.home), baseDir),
66
- });
67
- }
68
- // Duplicates are kept: deduplication belongs to the search, which alone sees the
69
- // adapter defaults an extra home may repeat.
70
- return entries;
71
- }
72
- function asWindowOverrides(value) {
73
- const items = asArray(value, "windowOverrides");
74
- return items.map((item, index) => {
75
- const field = `windowOverrides[${index}]`;
76
- const entry = asRecord(item, field, `${field} must be an object with an agent and a windowTokens count, such as ` +
77
- '{ "agent": "claude-code", "windowTokens": 200000 }.');
78
- return {
79
- agent: asAgentId(`${field}.agent`, entry.agent),
80
- windowTokens: asWindowTokens(`${field}.windowTokens`, entry.windowTokens),
81
- };
82
- });
83
- }
84
- function asWindowTokens(field, value) {
85
- if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) {
86
- throw new ConfigLoadError(field, `${field} must be a whole number of tokens greater than zero, for example 200000. ` +
87
- `Found ${show(value)}.`);
88
- }
89
- return value;
90
- }
91
- function asAgentId(field, value) {
92
- if (typeof value !== "string" || !Object.hasOwn(AGENTS, value)) {
93
- throw new ConfigLoadError(field, `${field} must name a known agent: ${Object.keys(AGENTS).join(", ")}. Found ${show(value)}.`);
94
- }
95
- return value;
96
- }
97
- function asPath(field, value) {
98
- if (typeof value !== "string" || value.trim() === "") {
99
- throw new ConfigLoadError(field, `${field} must be a path to an agent profile directory. Found ${show(value)}.`);
100
- }
101
- return value;
102
- }
103
- function asArray(value, field) {
104
- if (!Array.isArray(value)) {
105
- throw new ConfigLoadError(field, `${field} must be a list. Found ${show(value)}.`);
106
- }
107
- return value;
108
- }
109
- function asRecord(value, field, message) {
110
- if (typeof value !== "object" || value === null || Array.isArray(value)) {
111
- throw new ConfigLoadError(field, message);
112
- }
113
- return value;
114
- }
115
- function show(value) {
116
- return typeof value === "string" ? JSON.stringify(value) : String(value);
117
- }
@@ -1,36 +0,0 @@
1
- /** The repository the command runs in (FR-13). */
2
- export interface RepoIdentity {
3
- /** Canonical checkout root, or null when unresolved or bare (not an import destination). */
4
- root: string | null;
5
- /** Canonical Git common directory shared by linked worktrees, or null when unresolved. */
6
- commonDir: string | null;
7
- /** True only for a resolved bare repository; its linked working trees report false. */
8
- isBare: boolean;
9
- /** Current HEAD commit, or null when unresolved or the repository has no commit yet. */
10
- head: string | null;
11
- branch: string | null;
12
- }
13
- /** How far the tree moved since the source session ran (FR-38). */
14
- export interface CommitDistance {
15
- /** False when the source commit is unknown, or absent from this repository. */
16
- known: boolean;
17
- /** Commits on HEAD that the source commit does not have. */
18
- ahead: number;
19
- /** Commits the source commit has that HEAD does not. */
20
- behind: number;
21
- }
22
- /** Process controls applied to every git command issued by one reader. */
23
- export interface RepoReaderOptions {
24
- /** Maximum duration of one git command. Defaults to a finite module-owned limit. */
25
- timeoutMs?: number | undefined;
26
- /** Cancels the current command and every later command issued by this reader. */
27
- signal?: AbortSignal | undefined;
28
- }
29
- /** Reads git state. It never writes to the repository. */
30
- export interface RepoReader {
31
- /** Throws AbortError with the signal reason as cause when cancelled; performs no I/O. */
32
- checkCancellation(): void;
33
- identify(cwd: string): Promise<RepoIdentity>;
34
- /** Compares HEAD with a commit of a source session (FR-37). */
35
- distanceFrom(cwd: string, sourceCommit: string): Promise<CommitDistance>;
36
- }
@@ -1,4 +0,0 @@
1
- // GENERATED from src/platform/repo/module.md — the Public Contract section is the normative home.
2
- // Declarations only: no behaviour, no defaults. If this file and module.md disagree,
3
- // the document wins and this file is corrected.
4
- export {};
@@ -1,21 +0,0 @@
1
- import type { RepoReaderOptions } from "./contract.js";
2
- export interface GitResult {
3
- /** True when git exited 0. A completed nonzero exit leaves the requested fact unresolved. */
4
- ok: boolean;
5
- stdout: string;
6
- stderr: string;
7
- }
8
- /**
9
- * Runs a read-only git command in `cwd`.
10
- *
11
- * Rejects operational failures, including spawn failures, timeout and cancellation. A completed
12
- * nonzero exit is reported in `ok`: callers leave the requested fact unresolved without trying
13
- * to classify localized stderr (which need not mean the directory is outside Git).
14
- */
15
- export declare function runGit(cwd: string, args: readonly string[], options?: RepoReaderOptions): Promise<GitResult>;
16
- interface NormalizedOptions {
17
- timeoutMs: number;
18
- signal?: AbortSignal | undefined;
19
- }
20
- export declare function normalizeGitOptions(options: RepoReaderOptions): NormalizedOptions;
21
- export {};
@@ -1,77 +0,0 @@
1
- // The only place in this module that reaches git. The binary is spawned with an argument array and
2
- // never through a shell, so no revision string can ever be interpreted as a command.
3
- import { execFile } from "node:child_process";
4
- /** 1 MB. Every command here prints a line or two; more than this means something is wrong. */
5
- const MAX_OUTPUT_BYTES = 1024 * 1024;
6
- /** Long enough for local repositories while still bounding a wedged filesystem or git process. */
7
- const DEFAULT_GIT_TIMEOUT_MS = 10_000;
8
- /**
9
- * Runs a read-only git command in `cwd`.
10
- *
11
- * Rejects operational failures, including spawn failures, timeout and cancellation. A completed
12
- * nonzero exit is reported in `ok`: callers leave the requested fact unresolved without trying
13
- * to classify localized stderr (which need not mean the directory is outside Git).
14
- */
15
- export function runGit(cwd, args, options = {}) {
16
- const processOptions = normalizeGitOptions(options);
17
- return new Promise((resolve, reject) => {
18
- const execOptions = {
19
- encoding: "utf8",
20
- env: gitEnv(),
21
- maxBuffer: MAX_OUTPUT_BYTES,
22
- timeout: processOptions.timeoutMs,
23
- windowsHide: true,
24
- };
25
- if (processOptions.signal !== undefined)
26
- execOptions.signal = processOptions.signal;
27
- execFile("git", ["-C", cwd, ...args], execOptions, (error, stdout, stderr) => {
28
- if (error === null) {
29
- resolve({ ok: true, stdout, stderr });
30
- return;
31
- }
32
- // execFile reports an exit code as a number and a genuine failure to run as a string code
33
- // (ENOENT, EACCES) or a signal.
34
- const exited = typeof error.code === "number" && !error.signal;
35
- if (exited) {
36
- resolve({ ok: false, stdout, stderr });
37
- return;
38
- }
39
- reject(processError(cwd, processOptions, error));
40
- });
41
- });
42
- }
43
- export function normalizeGitOptions(options) {
44
- const timeoutMs = options.timeoutMs ?? DEFAULT_GIT_TIMEOUT_MS;
45
- if (!Number.isSafeInteger(timeoutMs) || timeoutMs <= 0) {
46
- throw new RangeError("git timeoutMs must be a positive, finite integer");
47
- }
48
- return options.signal === undefined ? { timeoutMs } : { timeoutMs, signal: options.signal };
49
- }
50
- function processError(cwd, options, cause) {
51
- if (options.signal?.aborted === true || cause.name === "AbortError") {
52
- const error = new Error(`git command aborted while reading ${cwd}`, { cause });
53
- error.name = "AbortError";
54
- return error;
55
- }
56
- if (cause.killed === true && cause.signal !== undefined) {
57
- return new Error(`git command timed out after ${options.timeoutMs} ms while reading ${cwd}`, {
58
- cause,
59
- });
60
- }
61
- return new Error(`git could not run while reading ${cwd}: ${cause.message}`, {
62
- cause,
63
- });
64
- }
65
- function gitEnv() {
66
- const env = { ...process.env };
67
- // Never take the index lock: a read must not be able to leave a lock file behind or rewrite the
68
- // index of a repository the user owns.
69
- env.GIT_OPTIONAL_LOCKS = "0";
70
- // These would override `-C` and point git at a repository other than the one being asked about,
71
- // for example when the tool runs inside a git hook.
72
- delete env.GIT_DIR;
73
- delete env.GIT_COMMON_DIR;
74
- delete env.GIT_WORK_TREE;
75
- delete env.GIT_INDEX_FILE;
76
- return env;
77
- }
@@ -1,2 +0,0 @@
1
- export type { CommitDistance, RepoIdentity, RepoReader, RepoReaderOptions, } from "./contract.js";
2
- export { createRepoReader } from "./reader.js";
@@ -1 +0,0 @@
1
- export { createRepoReader } from "./reader.js";
@@ -1,3 +0,0 @@
1
- import type { RepoReader, RepoReaderOptions } from "./contract.js";
2
- /** A reader with process controls only; every lookup names its directory explicitly. */
3
- export declare function createRepoReader(options?: RepoReaderOptions): RepoReader;
@@ -1,170 +0,0 @@
1
- import { realpath } from "node:fs/promises";
2
- import { resolve } from "node:path";
3
- import { normalizeGitOptions, runGit } from "./git.js";
4
- /** Nothing is known: `ahead` and `behind` are 0 so a caller cannot print a fabricated distance. */
5
- function unknownDistance() {
6
- return { known: false, ahead: 0, behind: 0 };
7
- }
8
- function unresolvedIdentity() {
9
- return { root: null, commonDir: null, isBare: false, head: null, branch: null };
10
- }
11
- /**
12
- * Longer than any revision git can resolve: a full commit is 40 characters, a tag or a ref
13
- * expression a few more. A longer string is a mistake or an attack, and is not sent to git.
14
- */
15
- const MAX_REVISION_LENGTH = 256;
16
- /** A reader with process controls only; every lookup names its directory explicitly. */
17
- export function createRepoReader(options = {}) {
18
- const processOptions = normalizeGitOptions(options);
19
- const git = (directory, args) => runGit(directory, args, processOptions);
20
- const checkCancellation = () => {
21
- if (processOptions.signal?.aborted) {
22
- const error = new Error("Repository read aborted", { cause: processOptions.signal.reason });
23
- error.name = "AbortError";
24
- throw error;
25
- }
26
- };
27
- return {
28
- checkCancellation,
29
- identify: async (directory) => {
30
- checkCancellation();
31
- const identity = await identify(directory, git);
32
- checkCancellation();
33
- return identity;
34
- },
35
- distanceFrom: async (cwd, sourceCommit) => {
36
- checkCancellation();
37
- const distance = await distanceFrom(cwd, sourceCommit, git);
38
- checkCancellation();
39
- return distance;
40
- },
41
- };
42
- }
43
- /** Git terminates path records with LF; all preceding whitespace belongs to the path. */
44
- function pathOutput(stdout) {
45
- return stdout.endsWith("\n") ? stdout.slice(0, -1) : stdout;
46
- }
47
- async function identify(directory, git) {
48
- // Resolve the input itself: a missing worktree must never inherit its parent's identity.
49
- const dir = await resolveFully(resolve(directory));
50
- if (dir === null)
51
- return unresolvedIdentity();
52
- const common = await git(dir, ["rev-parse", "--git-common-dir"]);
53
- const commonPath = pathOutput(common.stdout);
54
- if (!common.ok || commonPath === "")
55
- return unresolvedIdentity();
56
- const commonDir = await resolveFully(resolve(dir, commonPath));
57
- if (commonDir === null)
58
- return unresolvedIdentity();
59
- const bare = await git(dir, ["rev-parse", "--is-bare-repository"]);
60
- if (!bare.ok)
61
- return unresolvedIdentity();
62
- const isBare = bare.stdout.trim() === "true";
63
- // Bare repositories have a shared identity but no checkout usable as an import destination.
64
- let root = null;
65
- if (!isBare) {
66
- const toplevel = await git(dir, ["rev-parse", "--show-toplevel"]);
67
- const checkoutPath = pathOutput(toplevel.stdout);
68
- if (!toplevel.ok || checkoutPath === "")
69
- return unresolvedIdentity();
70
- root = await resolveFully(resolve(dir, checkoutPath));
71
- if (root === null)
72
- return unresolvedIdentity();
73
- }
74
- return {
75
- root,
76
- commonDir,
77
- isBare,
78
- head: await commitOf(dir, "HEAD", git),
79
- branch: await branch(dir, git),
80
- };
81
- }
82
- async function distanceFrom(cwd, sourceCommit, git) {
83
- const revision = plausibleRevision(sourceCommit);
84
- if (revision === null)
85
- return unknownDistance();
86
- const dir = resolve(cwd);
87
- const source = await commitOf(dir, revision, git);
88
- if (source === null)
89
- return unknownDistance();
90
- const from = await commitOf(dir, "HEAD", git);
91
- if (from === null)
92
- return unknownDistance();
93
- // Both sides are commits git itself printed, so the range holds no caller input.
94
- const counts = await git(dir, [
95
- "rev-list",
96
- "--left-right",
97
- "--count",
98
- `${from}...${source}`,
99
- "--",
100
- ]);
101
- if (!counts.ok)
102
- return unknownDistance();
103
- const parts = counts.stdout.trim().split(/\s+/);
104
- if (parts.length !== 2)
105
- return unknownDistance();
106
- const ahead = Number(parts[0]);
107
- const behind = Number(parts[1]);
108
- if (!Number.isInteger(ahead) || !Number.isInteger(behind))
109
- return unknownDistance();
110
- return { known: true, ahead, behind };
111
- }
112
- /** The commit a revision names, or null when this repository does not have it. */
113
- async function commitOf(dir, revision, git) {
114
- // `--end-of-options` stops git reading the revision as an option, and `^{commit}` rejects a
115
- // revision that exists but is not a commit.
116
- const result = await git(dir, [
117
- "rev-parse",
118
- "--verify",
119
- "--quiet",
120
- "--end-of-options",
121
- `${revision}^{commit}`,
122
- ]);
123
- const commit = result.stdout.trim();
124
- return result.ok && commit !== "" ? commit : null;
125
- }
126
- /** The branch HEAD is on, or null when HEAD is detached. An unborn branch still has a name. */
127
- async function branch(dir, git) {
128
- const result = await git(dir, ["symbolic-ref", "--quiet", "--short", "HEAD"]);
129
- const name = result.stdout.trim();
130
- return result.ok && name !== "" ? name : null;
131
- }
132
- /**
133
- * A revision worth sending to git, trimmed, or null.
134
- *
135
- * A string that starts with `-` would be read as an option, an empty one names nothing, and a
136
- * control character or an absurd length is never a revision. Rejecting them here means the hostile
137
- * cases of T-REP-11 never reach a process at all.
138
- */
139
- function plausibleRevision(sourceCommit) {
140
- if (typeof sourceCommit !== "string")
141
- return null;
142
- const revision = sourceCommit.trim();
143
- if (revision === "" || revision.length > MAX_REVISION_LENGTH)
144
- return null;
145
- if (revision.startsWith("-"))
146
- return null;
147
- if (hasControlCharacter(revision))
148
- return null;
149
- return revision;
150
- }
151
- /** A NUL cannot be passed to a process at all, and no control character belongs in a revision. */
152
- function hasControlCharacter(value) {
153
- for (let i = 0; i < value.length; i += 1) {
154
- const code = value.charCodeAt(i);
155
- if (code < 0x20 || code === 0x7f)
156
- return true;
157
- }
158
- return false;
159
- }
160
- /** The real path of a directory, following symlinks, so paths compare as locations. */
161
- async function resolveFully(directory) {
162
- try {
163
- return await realpath(directory);
164
- }
165
- catch (error) {
166
- if (error.code === "ENOENT")
167
- return null;
168
- throw error;
169
- }
170
- }
@@ -1,31 +0,0 @@
1
- /** Raw file content. */
2
- export type Bytes = Buffer;
3
- /** A file to create. Its path must not already exist (FR-49). */
4
- export interface PendingFile {
5
- absolutePath: string;
6
- bytes: Bytes;
7
- }
8
- /** Why a commit refused to run, or failed (FR-56). */
9
- export type CommitRefusal = "path-exists" | "not-writable" | "write-failed";
10
- /** A commit that succeeded and reports the paths it created (FR-52, FR-53). */
11
- export interface CommitHandle {
12
- createdPaths: string[];
13
- }
14
- /** Raised when a commit refuses to run or fails. Carries an actionable message (FR-56). */
15
- export interface CommitError {
16
- refusal: CommitRefusal;
17
- /** The path that caused the refusal, when there is one. */
18
- path: string | null;
19
- /** What failed, and what the user can do next (FR-56). */
20
- message: string;
21
- /** Paths retained for safety or not removed by cleanup, when manual inspection may be required. */
22
- remainingPaths?: string[];
23
- }
24
- /** Atomically adds zero or one file to a home (FR-49, FR-53). */
25
- export interface FileCommitter {
26
- /**
27
- * Creates zero or one file. Rejects with a CommitError before filesystem access when more than one
28
- * file is supplied, or before writing bytes when the destination already exists.
29
- */
30
- commit(root: string, files: PendingFile[]): Promise<CommitHandle>;
31
- }
@@ -1,4 +0,0 @@
1
- // GENERATED from src/platform/store/module.md — the Public Contract section is the normative home.
2
- // Declarations only: no behaviour, no defaults. If this file and module.md disagree,
3
- // the document wins and this file is corrected.
4
- export {};
@@ -1,3 +0,0 @@
1
- import type { FileCommitter } from "./contract.js";
2
- /** Creates the guarded store. It holds no state between commits. */
3
- export declare function createFileCommitter(): FileCommitter;