pi-agent-ide 0.5.1 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +82 -50
  3. package/assets/social-preview.png +0 -0
  4. package/dist/{chunk-LY6U5EAD.js → chunk-2527OQ4Y.js} +1 -1
  5. package/dist/chunk-4KUFOHWP.js +2 -0
  6. package/dist/chunk-4LDOV7QS.js +28 -0
  7. package/dist/chunk-5JELU6RV.js +7 -0
  8. package/dist/chunk-FA6BKC5Y.js +1 -0
  9. package/dist/chunk-FEDVTZJG.js +1 -0
  10. package/dist/chunk-I6Y3W4X6.js +27 -0
  11. package/dist/chunk-K5G4FDXD.js +1 -0
  12. package/dist/chunk-M5IVSCR2.js +1 -0
  13. package/dist/chunk-MPT3R4BL.js +0 -0
  14. package/dist/chunk-PZFOOHY2.js +15 -0
  15. package/dist/chunk-S6QRG3TQ.js +1 -0
  16. package/dist/chunk-T7I2VX3J.js +1 -0
  17. package/dist/chunk-VCTK4JSN.js +3 -0
  18. package/dist/chunk-W7CASEO3.js +1 -0
  19. package/dist/chunk-YEQOQMU7.js +5 -0
  20. package/dist/chunk-YT42LKFV.js +16 -0
  21. package/dist/entry-10.js +1 -1
  22. package/dist/entry-11.js +1 -1
  23. package/dist/entry-12.js +1 -1
  24. package/dist/entry-13.js +1 -1
  25. package/dist/entry-14.js +1 -1
  26. package/dist/entry-15.js +1 -1
  27. package/dist/entry-16.js +1 -0
  28. package/dist/entry-17.js +1 -1
  29. package/dist/entry-19.js +1 -1
  30. package/dist/entry-20.js +1 -1
  31. package/dist/entry-21.js +1 -1
  32. package/dist/entry-22.js +1 -2
  33. package/dist/entry-23.js +1 -1
  34. package/dist/entry-24.js +1 -1
  35. package/dist/entry-25.js +2 -1
  36. package/dist/entry-26.js +1 -1
  37. package/dist/entry-27.js +2 -12
  38. package/dist/entry-28.js +1 -1
  39. package/dist/entry-29.js +1 -1
  40. package/dist/entry-30.js +1 -1
  41. package/dist/entry-31.js +12 -1
  42. package/dist/entry-32.js +1 -4
  43. package/dist/entry-33.js +1 -9
  44. package/dist/entry-34.js +1 -1
  45. package/dist/entry-35.js +1 -1
  46. package/dist/entry-36.js +4 -1
  47. package/dist/entry-37.js +9 -1
  48. package/dist/entry-38.js +1 -1
  49. package/dist/entry-39.js +1 -1
  50. package/dist/entry-40.js +1 -1
  51. package/dist/entry-41.js +1 -18
  52. package/dist/entry-42.js +1 -1
  53. package/dist/entry-43.js +1 -1
  54. package/dist/entry-44.js +1 -1
  55. package/dist/entry-45.js +17 -1
  56. package/dist/entry-46.js +1 -7
  57. package/dist/entry-47.js +1 -11
  58. package/dist/entry-48.js +1 -1
  59. package/dist/entry-49.js +1 -1
  60. package/dist/entry-50.js +6 -1
  61. package/dist/entry-51.js +11 -1
  62. package/dist/entry-52.js +1 -1
  63. package/dist/entry-53.js +1 -1
  64. package/dist/entry-54.js +1 -1
  65. package/dist/entry-55.js +1 -1
  66. package/dist/entry-56.js +1 -0
  67. package/dist/entry-57.js +1 -1
  68. package/dist/entry-58.js +1 -0
  69. package/dist/entry-59.js +1 -1
  70. package/dist/entry-60.js +0 -1
  71. package/dist/entry-61.js +1 -1
  72. package/dist/entry-62.js +0 -1
  73. package/dist/entry-63.js +1 -1
  74. package/dist/entry-64.js +1 -1
  75. package/dist/entry-65.js +1 -0
  76. package/dist/entry-66.js +1 -1
  77. package/dist/entry-67.js +1 -0
  78. package/dist/entry-68.js +1 -1
  79. package/dist/entry-69.js +0 -1
  80. package/dist/entry-70.js +1 -1
  81. package/dist/entry-71.js +0 -203
  82. package/dist/entry-72.js +1 -30
  83. package/dist/entry-73.js +1 -2
  84. package/dist/entry-74.js +1 -1
  85. package/dist/entry-75.js +315 -1
  86. package/dist/entry-76.js +30 -3
  87. package/dist/entry-77.js +2 -3
  88. package/dist/entry-78.js +1 -1
  89. package/dist/entry-79.js +1 -1
  90. package/dist/entry-80.js +3 -1
  91. package/dist/entry-81.js +3 -0
  92. package/dist/entry-82.js +1 -0
  93. package/dist/entry-83.js +1 -0
  94. package/dist/entry-84.js +1 -0
  95. package/dist/entry-9.js +1 -1
  96. package/dist/pi-agent-ide.js +3 -3
  97. package/docs/agent-guides/apply.md +333 -0
  98. package/docs/agent-guides/debugger.md +5 -0
  99. package/docs/agent-guides/diagnostics.md +5 -0
  100. package/docs/agent-guides/editing.md +44 -0
  101. package/docs/agent-guides/git-changes.md +5 -0
  102. package/docs/agent-guides/json-reading.md +41 -0
  103. package/docs/agent-guides/read-resources.md +44 -0
  104. package/docs/agent-guides/search-code.md +29 -0
  105. package/docs/agent-guides/terminal.md +7 -0
  106. package/docs/agent-guides/vision.md +5 -0
  107. package/docs/configuration.md +9 -15
  108. package/docs/research/apply-read-latency.md +219 -0
  109. package/docs/tools.md +12 -0
  110. package/node_modules/pi-agent-doctor/package.json +6 -6
  111. package/node_modules/pi-agent-doctor/runtime/entry-22.js +1 -0
  112. package/node_modules/pi-agent-doctor/runtime/entry-23.js +1 -0
  113. package/node_modules/pi-agent-documentation/package.json +15 -0
  114. package/node_modules/pi-agent-documentation/runtime/entry-24.js +1 -0
  115. package/node_modules/pi-agent-documentation/src/index.ts +69 -0
  116. package/node_modules/pi-agent-filesystem/index.ts +0 -4
  117. package/node_modules/pi-agent-filesystem/package.json +7 -7
  118. package/node_modules/pi-agent-filesystem-image/package.json +4 -4
  119. package/node_modules/pi-agent-filesystem-image/runtime/entry-26.js +2 -0
  120. package/node_modules/pi-agent-filesystem-jq/index.ts +134 -0
  121. package/node_modules/pi-agent-filesystem-jq/package.json +23 -0
  122. package/node_modules/pi-agent-filesystem-jq/src/jq.ts +107 -0
  123. package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
  124. package/node_modules/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
  125. package/node_modules/pi-agent-filesystem-text/package.json +4 -4
  126. package/node_modules/pi-agent-ide-ast/package.json +12 -11
  127. package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +1 -0
  128. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  129. package/node_modules/pi-agent-ide-changes/index.ts +8 -0
  130. package/node_modules/pi-agent-ide-changes/package.json +9 -8
  131. package/node_modules/pi-agent-ide-changes/runtime/entry-32.js +1 -0
  132. package/node_modules/pi-agent-ide-formatter/package.json +4 -4
  133. package/node_modules/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
  134. package/node_modules/pi-agent-ide-formatter/src/formatter.ts +1 -1
  135. package/node_modules/pi-agent-ide-languages/package.json +3 -3
  136. package/node_modules/pi-agent-ide-languages/runtime/entry-35.js +2 -0
  137. package/node_modules/pi-agent-ide-lint/index.ts +1 -1
  138. package/node_modules/pi-agent-ide-lint/package.json +8 -8
  139. package/node_modules/pi-agent-ide-lint/runtime/entry-36.js +2 -0
  140. package/node_modules/pi-agent-ide-lint/src/command-linter.ts +20 -2
  141. package/node_modules/pi-agent-ide-lsp/index.ts +0 -3
  142. package/node_modules/pi-agent-ide-lsp/package.json +10 -10
  143. package/node_modules/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
  144. package/node_modules/pi-agent-image/package.json +3 -3
  145. package/node_modules/pi-agent-invariant/package.json +2 -2
  146. package/node_modules/pi-agent-pdf/package.json +3 -3
  147. package/node_modules/pi-agent-read/package.json +12 -11
  148. package/node_modules/pi-agent-read/runtime/entry-41.js +0 -1
  149. package/node_modules/pi-agent-read/runtime/entry-45.js +2 -0
  150. package/node_modules/pi-agent-read/src/api/read-parameters.ts +4 -4
  151. package/node_modules/pi-agent-read/src/core/extension.ts +16 -2
  152. package/node_modules/pi-agent-read/src/core/read-core.ts +4 -5
  153. package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
  154. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +29 -17
  155. package/node_modules/pi-agent-resource/package.json +2 -2
  156. package/node_modules/pi-agent-resource/runtime/entry-46.js +1 -0
  157. package/node_modules/pi-agent-search/package.json +8 -7
  158. package/node_modules/pi-agent-search/runtime/entry-47.js +1 -0
  159. package/node_modules/pi-agent-search/src/core/extension.ts +29 -10
  160. package/node_modules/pi-agent-search-text/package.json +9 -9
  161. package/node_modules/pi-agent-search-text/runtime/entry-51.js +2 -0
  162. package/node_modules/pi-agent-search-text/runtime/entry-52.js +1 -0
  163. package/node_modules/pi-agent-text/package.json +3 -3
  164. package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
  165. package/node_modules/pi-agent-text-anchor-exact/index.ts +3 -3
  166. package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
  167. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
  168. package/node_modules/pi-agent-text-anchor-exact/src/config.ts +2 -2
  169. package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
  170. package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
  171. package/node_modules/pi-agent-text-editor/index.ts +15 -0
  172. package/node_modules/pi-agent-text-editor/package.json +26 -25
  173. package/node_modules/pi-agent-text-editor/runtime/entry-71.js +0 -1
  174. package/node_modules/pi-agent-text-editor/runtime/entry-72.js +1 -0
  175. package/node_modules/pi-agent-text-editor/runtime/entry-73.js +1 -0
  176. package/node_modules/pi-agent-text-editor/runtime/entry-75.js +2 -0
  177. package/node_modules/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
  178. package/node_modules/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  179. package/node_modules/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  180. package/node_modules/pi-agent-text-editor/src/core/apply/output.ts +36 -5
  181. package/node_modules/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
  182. package/node_modules/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
  183. package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
  184. package/node_modules/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
  185. package/node_modules/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
  186. package/node_modules/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
  187. package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
  188. package/node_modules/pi-agent-text-editor/src/core/extension.ts +0 -11
  189. package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  190. package/node_modules/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
  191. package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  192. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
  193. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  194. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  195. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  196. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  197. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  198. package/node_modules/pi-agent-text-editor-renderer/index.ts +17 -4
  199. package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
  200. package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
  201. package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
  202. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
  203. package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
  204. package/node_modules/pi-agent-tool-call-interception/runtime/entry-78.js +1 -0
  205. package/node_modules/pi-agent-tool-ui/package.json +2 -2
  206. package/node_modules/pi-agent-tool-ui/runtime/entry-79.js +1 -0
  207. package/node_modules/pi-agent-web/package.json +7 -7
  208. package/node_modules/pi-agent-web-html/package.json +3 -3
  209. package/node_modules/pi-agent-web-html/runtime/entry-81.js +2 -0
  210. package/node_modules/pi-agent-web-image/package.json +4 -4
  211. package/node_modules/pi-agent-web-image/runtime/entry-82.js +2 -0
  212. package/node_modules/pi-agent-web-pdf/package.json +4 -4
  213. package/node_modules/pi-agent-web-pdf/runtime/entry-83.js +2 -0
  214. package/node_modules/pi-agent-web-text/package.json +4 -4
  215. package/node_modules/pi-agent-web-text/runtime/entry-84.js +2 -0
  216. package/package.json +112 -43
  217. package/src/api/documentation.ts +2 -0
  218. package/src/api/path-identity.ts +15 -0
  219. package/src/composite/builtin-extensions.ts +14 -2
  220. package/src/composite/extensions-config.ts +6 -0
  221. package/src/composite/module-labels.ts +9 -0
  222. package/src/composite/module-settings-store.ts +3 -0
  223. package/src/composite/module-settings.ts +71 -17
  224. package/src/composite/preferences.ts +83 -3
  225. package/src/composite/presentation.ts +14 -0
  226. package/src/composite/presets.ts +57 -0
  227. package/src/composite/selection.ts +5 -1
  228. package/src/doctor/inventory.ts +7 -2
  229. package/src/documentation/extension.ts +295 -0
  230. package/src/documentation/registry.ts +98 -0
  231. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +0 -4
  232. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  233. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
  234. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-26.js +2 -0
  235. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +134 -0
  236. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +23 -0
  237. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +2 -0
  238. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +107 -0
  239. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
  240. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-28.js +2 -0
  241. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
  242. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-29.js +2 -0
  243. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +2 -0
  244. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  245. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
  246. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-81.js +2 -0
  247. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
  248. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-82.js +2 -0
  249. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
  250. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-83.js +2 -0
  251. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
  252. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-84.js +2 -0
  253. package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-80.js +2 -0
  254. package/src/extensions/pi-agent-read/package.json +12 -11
  255. package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
  256. package/src/extensions/pi-agent-read/runtime/entry-42.js +1 -0
  257. package/src/extensions/pi-agent-read/runtime/entry-45.js +2 -0
  258. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +4 -4
  259. package/src/extensions/pi-agent-read/src/core/extension.ts +16 -2
  260. package/src/extensions/pi-agent-read/src/core/read-core.ts +4 -5
  261. package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +62 -8
  262. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +29 -17
  263. package/src/extensions/pi-agent-search/package.json +8 -7
  264. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +9 -9
  265. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +2 -0
  266. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +1 -0
  267. package/src/extensions/pi-agent-search/runtime/entry-47.js +1 -0
  268. package/src/extensions/pi-agent-search/runtime/entry-48.js +1 -0
  269. package/src/extensions/pi-agent-search/runtime/entry-49.js +1 -0
  270. package/src/extensions/pi-agent-search/runtime/entry-50.js +2 -0
  271. package/src/extensions/pi-agent-search/src/core/extension.ts +29 -10
  272. package/src/extensions/pi-agent-text-editor/index.ts +15 -0
  273. package/src/extensions/pi-agent-text-editor/package.json +26 -25
  274. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
  275. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +3 -3
  276. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
  277. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-55.js +1 -0
  278. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-56.js +2 -0
  279. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/config.ts +2 -2
  280. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
  281. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-57.js +1 -0
  282. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-58.js +2 -0
  283. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +17 -4
  284. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
  285. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +23 -11
  286. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +21 -16
  287. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
  288. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-77.js +2 -0
  289. package/src/extensions/pi-agent-text-editor/runtime/entry-71.js +0 -1
  290. package/src/extensions/pi-agent-text-editor/runtime/entry-72.js +1 -0
  291. package/src/extensions/pi-agent-text-editor/runtime/entry-73.js +1 -0
  292. package/src/extensions/pi-agent-text-editor/runtime/entry-74.js +1 -0
  293. package/src/extensions/pi-agent-text-editor/runtime/entry-75.js +2 -0
  294. package/src/extensions/pi-agent-text-editor/src/core/apply/execution.ts +131 -3
  295. package/src/extensions/pi-agent-text-editor/src/core/apply/mixed-source.ts +1 -1
  296. package/src/extensions/pi-agent-text-editor/src/core/apply/mutation-outcome.ts +14 -0
  297. package/src/extensions/pi-agent-text-editor/src/core/apply/output.ts +36 -5
  298. package/src/extensions/pi-agent-text-editor/src/core/apply/prompt.ts +5 -42
  299. package/src/extensions/pi-agent-text-editor/src/core/apply/renderer.ts +50 -5
  300. package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +187 -38
  301. package/src/extensions/pi-agent-text-editor/src/core/apply/tool.ts +3 -8
  302. package/src/extensions/pi-agent-text-editor/src/core/apply/transaction.ts +770 -237
  303. package/src/extensions/pi-agent-text-editor/src/core/builtin-edit-filter.ts +1 -1
  304. package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +2 -2
  305. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +0 -11
  306. package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +5 -0
  307. package/src/extensions/pi-agent-text-editor/src/core/text-editor-config.ts +4 -4
  308. package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +9 -1
  309. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +0 -2
  310. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +53 -0
  311. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +11 -41
  312. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +8 -18
  313. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +11 -41
  314. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +9 -19
  315. package/src/pi-agent-ide.ts +21 -11
  316. package/src/plugins/pi-agent-ide-ast/package.json +12 -11
  317. package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +1 -0
  318. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +8 -6
  319. package/src/plugins/pi-agent-ide-changes/index.ts +8 -0
  320. package/src/plugins/pi-agent-ide-changes/package.json +9 -8
  321. package/src/plugins/pi-agent-ide-changes/runtime/entry-32.js +1 -0
  322. package/src/plugins/pi-agent-ide-debugger/index.ts +13 -11
  323. package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +31 -0
  324. package/src/plugins/pi-agent-ide-debugger/src/breakpoint-view.ts +3 -1
  325. package/src/plugins/pi-agent-ide-debugger/src/catalog.ts +24 -23
  326. package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +5 -2
  327. package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +55 -17
  328. package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +55 -22
  329. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +9 -4
  330. package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
  331. package/src/plugins/pi-agent-ide-formatter/runtime/entry-34.js +2 -0
  332. package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +1 -1
  333. package/src/plugins/pi-agent-ide-languages/package.json +3 -3
  334. package/src/plugins/pi-agent-ide-languages/runtime/entry-35.js +2 -0
  335. package/src/plugins/pi-agent-ide-lint/index.ts +1 -1
  336. package/src/plugins/pi-agent-ide-lint/package.json +8 -8
  337. package/src/plugins/pi-agent-ide-lint/runtime/entry-36.js +2 -0
  338. package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +20 -2
  339. package/src/plugins/pi-agent-ide-lsp/index.ts +0 -3
  340. package/src/plugins/pi-agent-ide-lsp/package.json +10 -10
  341. package/src/plugins/pi-agent-ide-lsp/runtime/entry-37.js +2 -0
  342. package/src/plugins/pi-agent-ide-processes/src/registry.ts +4 -0
  343. package/src/plugins/pi-agent-ide-processes/src/ui.ts +18 -9
  344. package/src/plugins/pi-agent-ide-terminal/index.ts +27 -2
  345. package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +1 -0
  346. package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +27 -2
  347. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +1 -4
  348. package/src/plugins/pi-agent-ide-terminal/src/search.ts +0 -3
  349. package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +1 -0
  350. package/src/plugins/pi-agent-ide-terminal/src/tools.ts +8 -5
  351. package/src/plugins/pi-agent-ide-terminal/src/types.ts +1 -0
  352. package/src/plugins/pi-agent-ide-vision/index.ts +234 -0
  353. package/src/plugins/pi-agent-ide-vision/src/vision.ts +530 -0
  354. package/src/plugins/pi-agent-ide-vision/src/windows-display-capture.ps1 +30 -0
  355. package/src/plugins/pi-agent-ide-vision/src/windows-window-capture.ps1 +33 -0
  356. package/dist/chunk-526E364R.js +0 -3
  357. package/dist/chunk-5PLV4HLG.js +0 -1
  358. package/dist/chunk-7ALCBKCW.js +0 -26
  359. package/dist/chunk-DQXPQOF7.js +0 -2
  360. package/dist/chunk-EJ5OACQM.js +0 -1
  361. package/dist/chunk-G725MARR.js +0 -16
  362. package/dist/chunk-HKXDP2FD.js +0 -7
  363. package/dist/chunk-IRECDTJG.js +0 -27
  364. package/dist/chunk-J4RTW44E.js +0 -1
  365. package/dist/chunk-NZYDMBM6.js +0 -1
  366. package/dist/chunk-WGGIQ7IJ.js +0 -1
  367. package/dist/entry-18.js +0 -1
  368. package/node_modules/pi-agent-doctor/runtime/entry-17.js +0 -1
  369. package/node_modules/pi-agent-doctor/runtime/entry-18.js +0 -1
  370. package/node_modules/pi-agent-filesystem/runtime/entry-22.js +0 -2
  371. package/node_modules/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
  372. package/node_modules/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
  373. package/node_modules/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  374. package/node_modules/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  375. package/node_modules/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
  376. package/node_modules/pi-agent-ide-lint/runtime/entry-32.js +0 -2
  377. package/node_modules/pi-agent-image/runtime/entry-34.js +0 -1
  378. package/node_modules/pi-agent-invariant/runtime/entry-35.js +0 -1
  379. package/node_modules/pi-agent-pdf/runtime/entry-36.js +0 -1
  380. package/node_modules/pi-agent-read/runtime/entry-37.js +0 -1
  381. package/node_modules/pi-agent-search/runtime/entry-45.js +0 -1
  382. package/node_modules/pi-agent-search/runtime/entry-46.js +0 -2
  383. package/node_modules/pi-agent-search-text/runtime/entry-47.js +0 -2
  384. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  385. package/node_modules/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
  386. package/node_modules/pi-agent-text-editor/runtime/entry-56.js +0 -1
  387. package/node_modules/pi-agent-text-editor/runtime/entry-58.js +0 -1
  388. package/node_modules/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
  389. package/node_modules/pi-agent-text-editor-renderer/src/config.ts +0 -73
  390. package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  391. package/node_modules/pi-agent-tool-ui/runtime/entry-75.js +0 -1
  392. package/node_modules/pi-agent-web-image/runtime/entry-78.js +0 -2
  393. package/node_modules/pi-agent-web-pdf/runtime/entry-79.js +0 -2
  394. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-23.js +0 -2
  395. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-24.js +0 -2
  396. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-25.js +0 -2
  397. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-22.js +0 -2
  398. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-77.js +0 -2
  399. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-78.js +0 -2
  400. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-79.js +0 -2
  401. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-80.js +0 -2
  402. package/src/extensions/pi-agent-read/runtime/entry-37.js +0 -1
  403. package/src/extensions/pi-agent-read/runtime/entry-38.js +0 -1
  404. package/src/extensions/pi-agent-read/runtime/entry-39.js +0 -1
  405. package/src/extensions/pi-agent-read/runtime/entry-40.js +0 -1
  406. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-47.js +0 -2
  407. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-48.js +0 -1
  408. package/src/extensions/pi-agent-search/runtime/entry-45.js +0 -1
  409. package/src/extensions/pi-agent-search/runtime/entry-46.js +0 -2
  410. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-50.js +0 -2
  411. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-51.js +0 -1
  412. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-52.js +0 -2
  413. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-53.js +0 -1
  414. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-72.js +0 -2
  415. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/config.ts +0 -73
  416. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-73.js +0 -2
  417. package/src/extensions/pi-agent-text-editor/runtime/entry-55.js +0 -1
  418. package/src/extensions/pi-agent-text-editor/runtime/entry-56.js +0 -1
  419. package/src/extensions/pi-agent-text-editor/runtime/entry-57.js +0 -1
  420. package/src/extensions/pi-agent-text-editor/runtime/entry-58.js +0 -1
  421. package/src/plugins/pi-agent-ide-ast/runtime/entry-26.js +0 -1
  422. package/src/plugins/pi-agent-ide-ast/runtime/entry-27.js +0 -2
  423. package/src/plugins/pi-agent-ide-changes/runtime/entry-28.js +0 -1
  424. package/src/plugins/pi-agent-ide-changes/runtime/entry-29.js +0 -2
  425. package/src/plugins/pi-agent-ide-formatter/runtime/entry-30.js +0 -2
  426. package/src/plugins/pi-agent-ide-lint/runtime/entry-32.js +0 -2
  427. /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem}/runtime/entry-25.js +0 -0
  428. /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-jq}/runtime/entry-27.js +0 -0
  429. /package/node_modules/{pi-agent-ide-changes → pi-agent-filesystem-text}/runtime/entry-29.js +0 -0
  430. /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
  431. /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
  432. /package/node_modules/{pi-agent-read → pi-agent-image}/runtime/entry-38.js +0 -0
  433. /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-39.js +0 -0
  434. /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-40.js +0 -0
  435. /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-42.js +0 -0
  436. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
  437. /package/node_modules/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
  438. /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-48.js +0 -0
  439. /package/node_modules/{pi-agent-text → pi-agent-search}/runtime/entry-49.js +0 -0
  440. /package/node_modules/{pi-agent-text-anchor-constant → pi-agent-search}/runtime/entry-50.js +0 -0
  441. /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text}/runtime/entry-53.js +0 -0
  442. /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
  443. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-exact}/runtime/entry-55.js +0 -0
  444. /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-57.js +0 -0
  445. /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-74.js +0 -0
  446. /package/node_modules/{pi-agent-web → pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
  447. /package/node_modules/{pi-agent-web-html → pi-agent-text-editor-stale-anchor}/runtime/entry-77.js +0 -0
  448. /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-80.js +0 -0
  449. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-43.js +0 -0
  450. /package/src/extensions/{pi-agent-search → pi-agent-read}/runtime/entry-44.js +0 -0
  451. /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-constant}/runtime/entry-54.js +0 -0
  452. /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-renderer}/runtime/entry-76.js +0 -0
  453. /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-ast}/runtime/entry-31.js +0 -0
  454. /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-changes}/runtime/entry-33.js +0 -0
@@ -0,0 +1,107 @@
1
+ import spawn from "cross-spawn";
2
+ import { projectProcessEnvironment } from "pi-agent-doctor/api/executable";
3
+
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const JQ_TIMEOUT_MS = 5_000;
7
+ const JQ_MAX_OUTPUT_BYTES = 10 * 1024 * 1024;
8
+ const JQ_MODULE_DIRECTORY = fileURLToPath(new URL(".", import.meta.url));
9
+
10
+ export interface JqView {
11
+ readonly filter: string;
12
+ }
13
+
14
+ /** Parse one exclusive parameterized jq view from a Read request. */
15
+ export function parseJqView(views: readonly string[] | undefined): JqView | undefined {
16
+ const jqViews = views?.filter((view) => view === "jq" || view.startsWith("jq:")) ?? [];
17
+ if (jqViews.length === 0) return undefined;
18
+ if (jqViews.length > 1) throw new Error("Read accepts only one jq view");
19
+ if (views?.length !== 1) throw new Error("The jq view cannot be combined with other views");
20
+ const selected = jqViews[0];
21
+ if (selected === undefined || selected === "jq" || selected.slice(3).trim().length === 0)
22
+ throw new Error('The jq view requires a filter, for example views: ["jq:.scripts"]');
23
+ return { filter: selected.slice(3) };
24
+ }
25
+
26
+ /** Run the real jq executable over one JSON text with bounded output and no shell. */
27
+ export function executeJq(
28
+ filter: string,
29
+ input: string,
30
+ options: { readonly cwd: string; readonly signal?: AbortSignal; readonly command?: string },
31
+ ): Promise<string> {
32
+ if (options.signal?.aborted === true)
33
+ return Promise.reject(new Error("jq execution was cancelled"));
34
+ return new Promise((resolve, reject) => {
35
+ const child = spawn(options.command ?? "jq", ["-L", JQ_MODULE_DIRECTORY, "--", filter], {
36
+ cwd: options.cwd,
37
+ env: safeEnvironment(options.cwd),
38
+ shell: false,
39
+ stdio: ["pipe", "pipe", "pipe"],
40
+ windowsHide: true,
41
+ });
42
+ let stdout = "";
43
+ let stderr = "";
44
+ let settled = false;
45
+ let outputBytes = 0;
46
+ const finish = (error?: Error): void => {
47
+ if (settled) return;
48
+ settled = true;
49
+ clearTimeout(timeout);
50
+ options.signal?.removeEventListener("abort", abort);
51
+ if (error === undefined) resolve(stdout);
52
+ else reject(error);
53
+ };
54
+ const stop = (error: Error): void => {
55
+ child.kill();
56
+ finish(error);
57
+ };
58
+ const abort = (): void => stop(new Error("jq execution was cancelled"));
59
+ const timeout = setTimeout(
60
+ () => stop(new Error(`jq did not finish within ${JQ_TIMEOUT_MS / 1_000} seconds`)),
61
+ JQ_TIMEOUT_MS,
62
+ );
63
+ timeout.unref();
64
+ options.signal?.addEventListener("abort", abort, { once: true });
65
+
66
+ child.stdout?.setEncoding("utf8");
67
+ child.stderr?.setEncoding("utf8");
68
+ child.stdout?.on("data", (chunk: string) => {
69
+ outputBytes += Buffer.byteLength(chunk);
70
+ if (outputBytes > JQ_MAX_OUTPUT_BYTES) {
71
+ stop(new Error(`jq output exceeded ${JQ_MAX_OUTPUT_BYTES / 1024 / 1024}MB`));
72
+ return;
73
+ }
74
+ stdout += chunk;
75
+ });
76
+ child.stderr?.on("data", (chunk: string) => {
77
+ if (Buffer.byteLength(stderr) < 16_384) stderr += chunk;
78
+ });
79
+ child.once("error", (error) => finish(new Error(`Cannot start jq: ${error.message}`)));
80
+ child.once("close", (code, signal) => {
81
+ if (settled) return;
82
+ if (code === 0) finish();
83
+ else {
84
+ const detail = stderr.trim().split(/\r?\n/u).slice(0, 8).join("\n");
85
+ finish(
86
+ new Error(
87
+ detail ||
88
+ `jq exited ${signal === null ? `with code ${String(code)}` : `after signal ${signal}`}`,
89
+ ),
90
+ );
91
+ }
92
+ });
93
+ child.stdin?.once("error", (error) =>
94
+ finish(new Error(`Cannot send JSON to jq: ${error.message}`)),
95
+ );
96
+ child.stdin?.end(input);
97
+ });
98
+ }
99
+
100
+ function safeEnvironment(cwd: string): NodeJS.ProcessEnv {
101
+ const source = projectProcessEnvironment(cwd, process.env);
102
+ const environment: NodeJS.ProcessEnv = {};
103
+ for (const key of ["PATH", "PATHEXT", "SystemRoot", "SYSTEMROOT", "WINDIR"]) {
104
+ if (source[key] !== undefined) environment[key] = source[key];
105
+ }
106
+ return environment;
107
+ }
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-pdf",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.5.1",
7
- "pi-agent-resource": "0.5.1"
6
+ "pi-agent-pdf": "0.6.1",
7
+ "pi-agent-resource": "0.6.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
11
- "./runtime/entry-24.js"
11
+ "./runtime/entry-28.js"
12
12
  ]
13
13
  },
14
14
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-28.js";
2
+ export { default } from "../../../../../../../../dist/entry-28.js";
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-text",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-resource": "0.5.1",
10
- "pi-agent-text": "0.5.1"
9
+ "pi-agent-resource": "0.6.1",
10
+ "pi-agent-text": "0.6.1"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
14
- "./runtime/entry-25.js"
14
+ "./runtime/entry-29.js"
15
15
  ]
16
16
  },
17
17
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-29.js";
2
+ export { default } from "../../../../../../../../dist/entry-29.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../dist/entry-25.js";
2
+ export { default } from "../../../../../../dist/entry-25.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-web",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,16 +8,16 @@
8
8
  "dependencies": {
9
9
  "defuddle": "^0.19.1",
10
10
  "linkedom": "^0.18.12",
11
- "pi-agent-doctor": "0.5.1",
12
- "pi-agent-image": "0.5.1",
13
- "pi-agent-read": "0.5.1",
14
- "pi-agent-resource": "0.5.1",
15
- "pi-agent-text": "0.5.1",
11
+ "pi-agent-doctor": "0.6.1",
12
+ "pi-agent-image": "0.6.1",
13
+ "pi-agent-read": "0.6.1",
14
+ "pi-agent-resource": "0.6.1",
15
+ "pi-agent-text": "0.6.1",
16
16
  "playwright-core": "^1.62.1"
17
17
  },
18
18
  "pi": {
19
19
  "extensions": [
20
- "./runtime/entry-76.js"
20
+ "./runtime/entry-80.js"
21
21
  ]
22
22
  },
23
23
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-web-html",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,11 +8,11 @@
8
8
  "dependencies": {
9
9
  "defuddle": "^0.19.1",
10
10
  "linkedom": "^0.18.12",
11
- "pi-agent-resource": "0.5.1"
11
+ "pi-agent-resource": "0.6.1"
12
12
  },
13
13
  "pi": {
14
14
  "extensions": [
15
- "./runtime/entry-77.js"
15
+ "./runtime/entry-81.js"
16
16
  ]
17
17
  },
18
18
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-81.js";
2
+ export { default } from "../../../../../../../../dist/entry-81.js";
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pi-agent-web-image",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-image": "0.5.1",
7
- "pi-agent-resource": "0.5.1"
6
+ "pi-agent-image": "0.6.1",
7
+ "pi-agent-resource": "0.6.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
11
- "./runtime/entry-78.js"
11
+ "./runtime/entry-82.js"
12
12
  ]
13
13
  },
14
14
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-82.js";
2
+ export { default } from "../../../../../../../../dist/entry-82.js";
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pi-agent-web-pdf",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.5.1",
7
- "pi-agent-resource": "0.5.1"
6
+ "pi-agent-pdf": "0.6.1",
7
+ "pi-agent-resource": "0.6.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
11
- "./runtime/entry-79.js"
11
+ "./runtime/entry-83.js"
12
12
  ]
13
13
  },
14
14
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-83.js";
2
+ export { default } from "../../../../../../../../dist/entry-83.js";
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pi-agent-web-text",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-resource": "0.5.1",
7
- "pi-agent-text": "0.5.1"
6
+ "pi-agent-resource": "0.6.1",
7
+ "pi-agent-text": "0.6.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
11
- "./runtime/entry-80.js"
11
+ "./runtime/entry-84.js"
12
12
  ]
13
13
  },
14
14
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../../../dist/entry-84.js";
2
+ export { default } from "../../../../../../../../dist/entry-84.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../../../../../dist/entry-80.js";
2
+ export { default } from "../../../../../../dist/entry-80.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-read",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,31 +8,32 @@
8
8
  "exports": {
9
9
  "./api/connect-plugin": {
10
10
  "types": "./src/api/connect-plugin.ts",
11
- "default": "./runtime/entry-37.js"
11
+ "default": "./runtime/entry-41.js"
12
12
  },
13
13
  "./api/rendering": {
14
14
  "types": "./src/api/rendering.ts",
15
- "default": "./runtime/entry-38.js"
15
+ "default": "./runtime/entry-42.js"
16
16
  },
17
17
  "./api/plugin-protocol": {
18
18
  "types": "./src/api/plugin-protocol.ts",
19
- "default": "./runtime/entry-39.js"
19
+ "default": "./runtime/entry-43.js"
20
20
  },
21
21
  "./api/tools/read": {
22
22
  "types": "./src/api/tools/read.ts",
23
- "default": "./runtime/entry-40.js"
23
+ "default": "./runtime/entry-44.js"
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "pi-agent-invariant": "0.5.1",
28
- "pi-agent-resource": "0.5.1",
29
- "pi-agent-text": "0.5.1",
30
- "pi-agent-tool-call-interception": "0.5.1",
31
- "pi-agent-tool-ui": "0.5.1"
27
+ "pi-agent-documentation": "0.6.1",
28
+ "pi-agent-invariant": "0.6.1",
29
+ "pi-agent-resource": "0.6.1",
30
+ "pi-agent-text": "0.6.1",
31
+ "pi-agent-tool-call-interception": "0.6.1",
32
+ "pi-agent-tool-ui": "0.6.1"
32
33
  },
33
34
  "pi": {
34
35
  "extensions": [
35
- "./runtime/entry-41.js"
36
+ "./runtime/entry-45.js"
36
37
  ]
37
38
  },
38
39
  "peerDependencies": {
@@ -1,2 +1 @@
1
1
  export * from "../../../../dist/entry-41.js";
2
- export { default } from "../../../../dist/entry-41.js";
@@ -0,0 +1 @@
1
+ export * from "../../../../dist/entry-42.js";
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-45.js";
2
+ export { default } from "../../../../dist/entry-45.js";
@@ -5,25 +5,25 @@ export const readParameters = Type.Object({
5
5
  path: Type.Optional(
6
6
  Type.String({
7
7
  description:
8
- "What to read: a file or directory path, URL, returned temp: or SEARCH# reference, or one of the source forms listed in the description. Supply a path; an empty call cannot select a source.",
8
+ "What to read: a supported resource such as a file or directory path, URL, returned temp: reference, SEARCH# reference, or registered protocol source. Supply a path; an empty call cannot select a source.",
9
9
  }),
10
10
  ),
11
11
  offset: Type.Optional(
12
12
  Type.Number({
13
13
  description:
14
- "For raw: sources, use a zero-based byte offset; negative offsets count from the file end. For other sources: first line to return, numbered from 1. Omit or use 0 to start at line 1; -1 starts at the last line, -10 at the tenth line from the end. For path#anchor or a SEARCH selection, count from its containing line instead: 0 or 1 starts there, 2 starts one line later, -1 one line earlier.",
14
+ "For raw: sources, use a zero-based byte offset; negative offsets count from the file end. For other sources: first line to return, numbered from 1. Omit or use 0 to start at line 1; -1 starts at the last line, -10 at the tenth line from the end. For path#anchor or a SEARCH selection, count from its containing line instead: 0 or 1 starts there, 2 starts one line later, -1 one line earlier. For image and sequence views, offset is a zero-based row-major grid cell index and requires limit.",
15
15
  }),
16
16
  ),
17
17
  limit: Type.Optional(
18
18
  Type.Number({
19
19
  description:
20
- "For raw: sources, use a non-negative byte count (0 reads no bytes). Otherwise, maximum lines from the selected starting position. Output is bounded; omit for the default read.",
20
+ "For raw: sources, use a non-negative byte count (0 reads no bytes). Otherwise, maximum lines from the selected starting position. Output is bounded; omit for the default read. For image and sequence views, limit is the square grid cell size in pixels; omit offset to select cell 0, or omit both for the bounded full image.",
21
21
  }),
22
22
  ),
23
23
  views: Type.Optional(
24
24
  Type.Array(Type.String(), {
25
25
  description:
26
- 'Optional additions to the returned text. Use the views listed in the tool description. Combine views when needed, for example ["anchors", "ast"] for source text with editable line references and scope boundaries. Omit for the source\'s default presentation.',
26
+ 'Optional source-specific presentations. Combine views when both presentations are needed, for example ["anchors", "ast"]. Omit for the source\'s default presentation.',
27
27
  }),
28
28
  ),
29
29
  });
@@ -1,4 +1,5 @@
1
1
  import { type ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import { connectAgentDocumentation, loadPackagedAgentGuide } from "pi-agent-documentation";
2
3
  import {
3
4
  ToolCallInterceptionRenderStore,
4
5
  withToolCallInterceptionRendering,
@@ -19,8 +20,21 @@ function isRecord(value: unknown): value is Record<string, unknown> {
19
20
  return typeof value === "object" && value !== null;
20
21
  }
21
22
 
22
- export default async function registerReadCore(pi: ExtensionAPI): Promise<void> {
23
- const core = createReadCore();
23
+ function parsePresentation(value: string | undefined): "full" | "compact" | "disabled" {
24
+ return value === "full" || value === "disabled" ? value : "compact";
25
+ }
26
+ export default async function registerReadCore(
27
+ pi: ExtensionAPI,
28
+ context?: { readonly preferences: Readonly<Record<string, string>> },
29
+ ): Promise<void> {
30
+ connectAgentDocumentation(pi, [
31
+ await loadPackagedAgentGuide({
32
+ id: "read-resources",
33
+ description: "Resource selection, windows, views, raw bytes, and continuation",
34
+ triggers: [{ tool: "read" }],
35
+ }),
36
+ ]);
37
+ const core = createReadCore(parsePresentation(context?.preferences["ui.read"]));
24
38
 
25
39
  const unsubscribeRegistration = pi.events.on(READ_PLUGIN_REGISTER_EVENT, (request) => {
26
40
  if (!isReadPluginRegistrationRequest(request)) {
@@ -49,14 +49,13 @@ export interface ReadCore {
49
49
  renderPluginPromptGuideline(): string | undefined;
50
50
  }
51
51
 
52
- export function createReadCore(): ReadCore {
52
+ export function createReadCore(
53
+ presentation: "full" | "compact" | "disabled" = "compact",
54
+ ): ReadCore {
53
55
  const outputReducers: ReadOutputReducer[] = [];
54
56
  const pendingPlugins = new Set<Promise<void>>();
55
57
  const plugins = new Map<string, RegisteredPlugin>();
56
- const read = createReadTool(
57
- () => renderPromptGuidelines(plugins),
58
- () => renderPluginPromptGuideline(plugins),
59
- );
58
+ const read = createReadTool(() => renderPromptGuidelines(plugins), presentation);
60
59
  let registrationQueue = Promise.resolve();
61
60
 
62
61
  return {
@@ -228,10 +228,16 @@ export class ReadResultPanel implements Component {
228
228
 
229
229
  const innerWidth = width - 2;
230
230
  const contentWidth = Math.max(1, innerWidth - 2);
231
- const renderedRows = renderContentRows(this.state, contentWidth).flatMap((row) =>
231
+ const compactInput = compactRenderInput(this.state, contentWidth);
232
+ const renderedRows = renderContentRows(compactInput.state, contentWidth).flatMap((row) =>
232
233
  wrapTextWithAnsi(row, contentWidth),
233
234
  );
234
- const rows = compactRows(renderedRows, this.state.expanded, this.state.theme);
235
+ const rows = compactRows(
236
+ renderedRows,
237
+ this.state.expanded,
238
+ this.state.theme,
239
+ compactInput.hasHiddenRows,
240
+ );
235
241
  const lines = [renderTopBorder(this.state, innerWidth, this.state.theme)];
236
242
 
237
243
  for (const row of rows) {
@@ -257,6 +263,49 @@ export class ReadResultPanel implements Component {
257
263
  }
258
264
  }
259
265
 
266
+ const COMPACT_SOURCE_RENDER_THRESHOLD = 100;
267
+ const MAX_COMPACT_SOURCE_LINES = COMPACT_READ_ROWS;
268
+ const MAX_COMPACT_CHARACTERS_PER_ROW = 4;
269
+
270
+ interface CompactRenderInput {
271
+ readonly state: ReadPanelState;
272
+ readonly hasHiddenRows: boolean;
273
+ }
274
+
275
+ function compactRenderInput(state: ReadPanelState, width: number): CompactRenderInput {
276
+ if (state.expanded) return { state, hasHiddenRows: false };
277
+
278
+ const lines = readLines(state.details);
279
+ if (lines !== undefined && lines.length > COMPACT_SOURCE_RENDER_THRESHOLD) {
280
+ return {
281
+ state: {
282
+ ...state,
283
+ details: { ...state.details, lines: lines.slice(0, MAX_COMPACT_SOURCE_LINES) },
284
+ },
285
+ hasHiddenRows: true,
286
+ };
287
+ }
288
+
289
+ if (lines !== undefined) return { state, hasHiddenRows: false };
290
+
291
+ const characterLimit = Math.max(
292
+ COMPACT_READ_ROWS,
293
+ width * COMPACT_READ_ROWS * MAX_COMPACT_CHARACTERS_PER_ROW,
294
+ );
295
+ const content = state.result.content.map((block) => {
296
+ if (block.type !== "text" || block.text.length <= characterLimit) return block;
297
+ return { ...block, text: block.text.slice(0, characterLimit) };
298
+ });
299
+ const hasHiddenRows = content.some((block, index) => {
300
+ const original = state.result.content[index];
301
+ return (
302
+ block.type === "text" && original?.type === "text" && block.text.length < original.text.length
303
+ );
304
+ });
305
+ return hasHiddenRows
306
+ ? { state: { ...state, result: { ...state.result, content } }, hasHiddenRows }
307
+ : { state, hasHiddenRows: false };
308
+ }
260
309
  function renderContentRows(state: ReadPanelState, width: number): string[] {
261
310
  const lines = readLines(state.details);
262
311
  const text = cleanText(state.result, lines, state.details, !state.expanded);
@@ -390,19 +439,24 @@ function renderCodeViewLabel(value: string, theme: Theme, stripMarkers = true):
390
439
  return theme.fg("toolOutput", line);
391
440
  }
392
441
 
393
- function compactRows(rows: readonly string[], expanded: boolean, theme: Theme): readonly string[] {
394
- if (expanded || rows.length <= COMPACT_READ_ROWS) {
442
+ function compactRows(
443
+ rows: readonly string[],
444
+ expanded: boolean,
445
+ theme: Theme,
446
+ hasHiddenRows = false,
447
+ ): readonly string[] {
448
+ if (expanded || (rows.length <= COMPACT_READ_ROWS && !hasHiddenRows)) {
395
449
  return rows;
396
450
  }
397
451
 
398
452
  const shown = rows.slice(0, COMPACT_READ_ROWS - 1);
399
453
  const omitted = rows.length - shown.length;
454
+ const count = hasHiddenRows
455
+ ? "more rows"
456
+ : `${String(omitted)} more ${omitted === 1 ? "row" : "rows"}`;
400
457
  return [
401
458
  ...shown,
402
- `${theme.fg("dim", `… ${String(omitted)} more ${omitted === 1 ? "row" : "rows"} · `)}${keyHint(
403
- "app.tools.expand",
404
- "to expand",
405
- )}`,
459
+ `${theme.fg("dim", `… ${count} · `)}${keyHint("app.tools.expand", "to expand")}`,
406
460
  ];
407
461
  }
408
462
 
@@ -1,4 +1,5 @@
1
1
  import { requiredValue } from "pi-agent-invariant";
2
+ import { Text } from "@earendil-works/pi-tui";
2
3
  import { type ToolDefinition } from "@earendil-works/pi-coding-agent";
3
4
  import {
4
5
  isAgentContent,
@@ -120,7 +121,7 @@ export interface ReadTool {
120
121
  /** Creates a read pipeline whose prompt contributions reflect the currently installed plugins. */
121
122
  export function createReadTool(
122
123
  pluginPromptGuidelines?: () => readonly string[],
123
- pluginDescription?: () => string | undefined,
124
+ presentation: "full" | "compact" | "disabled" = "compact",
124
125
  ): ReadTool {
125
126
  const temporaryResources = new TempResourceStore();
126
127
  const resolvers: RegisteredResolver[] = [
@@ -148,21 +149,13 @@ export function createReadTool(
148
149
  name: toolId,
149
150
  label: toolId,
150
151
 
151
- promptSnippet:
152
- "Read files, original bytes with raw:, URLs, temporary resources, search selections, and protocol sources, with optional views projected onto text content",
152
+ promptSnippet: "Read supported sources as text or bytes, with optional views",
153
153
  get description(): string {
154
- return [
155
- `Use read to inspect files, directories, URLs and supported sources without changing them. path selects the source; offset/limit select a text window; views add annotations. Text limit: ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB. Continuation: returned offset, or returned temp: reference as path. Temporary references remain available until their owning runtime is disposed.`,
156
- "Use raw:<local-file> to inspect original bytes without decoding or conversion, including PDFs and images. In raw: mode offset is a zero-based byte position (negative from EOF), limit is a non-negative byte count, and 0 reads no bytes. Output uses hexadecimal offsets, hex bytes and printable ASCII; dots stand for nonprintable bytes. Follow the returned byte offset to continue. Raw sources do not accept views or text anchors.",
157
- pluginDescription?.() ?? "",
158
- ]
159
- .filter(Boolean)
160
- .join("\n");
154
+ return `Use read to inspect supported resources. path selects the source; offset and limit select a bounded window; views request source-specific presentations. Text output is limited to ${READ_OUTPUT_MAX_LINES} lines or ${READ_OUTPUT_MAX_BYTES / 1024}KB; follow a returned continuation offset or temp: reference when present.`;
161
155
  },
162
156
  get promptGuidelines(): string[] {
163
157
  return [
164
- "Use read to examine supported sources instead of cat, sed, head or tail. Use search to locate workspace text and paths instead of grep, rg or find.",
165
- "Use read with raw:<local-file> instead of xxd, od or hexdump to inspect original bytes. In raw: mode offset/limit count bytes, not lines; omit text views.",
158
+ "Use read to inspect supported sources and search to locate workspace content.",
166
159
  ...(pluginPromptGuidelines?.() ?? []),
167
160
  ];
168
161
  },
@@ -173,7 +166,12 @@ export function createReadTool(
173
166
  source === undefined
174
167
  ? undefined
175
168
  : resolvers.find(({ matchesCall }) => matchesCall?.(source) === true)?.renderCall;
176
- return (renderer ?? renderReadCall)(arguments_, theme, context);
169
+ const mode = context.expanded ? "full" : presentation;
170
+ if (mode === "disabled") return new Text(theme.fg("toolTitle", "read"), 0, 0);
171
+ return (renderer ?? renderReadCall)(arguments_, theme, {
172
+ ...context,
173
+ expanded: mode === "full",
174
+ });
177
175
  },
178
176
  renderResult(result, options, theme, context) {
179
177
  const resolvedBy = result.details.resolvedBy;
@@ -181,7 +179,15 @@ export function createReadTool(
181
179
  resolvedBy === undefined
182
180
  ? undefined
183
181
  : resolvers.find(({ resolver }) => resolver.id === resolvedBy)?.renderResult;
184
- return (renderer ?? fallbackReadRenderer)(result, options, theme, context);
182
+ const mode = options.expanded ? "full" : presentation;
183
+ if (mode === "disabled" && !context.isError && !options.isPartial)
184
+ return new Text(theme.fg("success", "✓ read"), 0, 0);
185
+ return (renderer ?? fallbackReadRenderer)(
186
+ result,
187
+ { ...options, expanded: mode === "full" },
188
+ theme,
189
+ context,
190
+ );
185
191
  },
186
192
  async execute(_toolCallId, parameters, signal, _onUpdate, context) {
187
193
  const resolverContext: ResourceResolverContext = {
@@ -349,12 +355,13 @@ async function executeRead(
349
355
  const targetSnapshot = [...targetResolvers].sort(
350
356
  (left, right) => left.priority - right.priority || left.order - right.order,
351
357
  );
352
- const requestedViews = new Set([
358
+ const rawRequestedViews = [
353
359
  ...(request.views ?? []),
354
360
  ...(audience === "script" ? viewSnapshot.map(({ registration }) => registration.view) : []),
355
- ]);
361
+ ];
362
+ const requestedViews = new Set(rawRequestedViews.map(viewName));
356
363
  const knownViews = new Set([...viewSnapshot.map(({ registration }) => registration.view)]);
357
- const ignoredViews = [...requestedViews].filter((view) => !knownViews.has(view));
364
+ const ignoredViews = rawRequestedViews.filter((view) => !knownViews.has(viewName(view)));
358
365
  if (request.path !== undefined && targetSnapshot.length > 0) {
359
366
  const targeted = await resolveTextTargets(
360
367
  request,
@@ -1053,6 +1060,11 @@ async function runTextPresenters(
1053
1060
  return { ...context, state: { ...state, text: presented } };
1054
1061
  }
1055
1062
 
1063
+ function viewName(view: string): string {
1064
+ const separator = view.indexOf(":");
1065
+ return separator < 0 ? view : view.slice(0, separator);
1066
+ }
1067
+
1056
1068
  /** Prepends a note listing unknown view names so the agent can correct the request. */
1057
1069
  function withIgnoredViews(result: ReadToolResult, ignoredViews: readonly string[]): ReadToolResult {
1058
1070
  if (ignoredViews.length === 0) {