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
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "pi-agent-ide-formatter",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-doctor": "0.5.1"
6
+ "pi-agent-doctor": "0.6.1"
7
7
  },
8
8
  "pi": {
9
9
  "extensions": [
10
- "./runtime/entry-30.js"
10
+ "./runtime/entry-34.js"
11
11
  ]
12
12
  },
13
13
  "peerDependencies": {
14
14
  "@earendil-works/pi-coding-agent": "*",
15
- "pi-agent-ide": "0.5.1"
15
+ "pi-agent-ide": "0.6.1"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "pi-agent-ide": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-34.js";
2
+ export { default } from "../../../../dist/entry-34.js";
@@ -62,7 +62,7 @@ async function loadRegistry(cwd: string, external = false): Promise<FormatterCom
62
62
  if (registry === undefined) {
63
63
  registry = FormatterCommandRegistry.fromDirectory(cwd, {
64
64
  includeGlobal: !external,
65
- requireBuiltInEvidence: external,
65
+ requireBuiltInEvidence: true,
66
66
  });
67
67
  registries.set(key, registry);
68
68
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-ide-languages",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-doctor": "0.5.1"
6
+ "pi-agent-doctor": "0.6.1"
7
7
  },
8
8
  "pi": {
9
9
  "extensions": [
10
- "./runtime/entry-31.js"
10
+ "./runtime/entry-35.js"
11
11
  ]
12
12
  },
13
13
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-35.js";
2
+ export { default } from "../../../../dist/entry-35.js";
@@ -105,6 +105,6 @@ async function loadRegistry(cwd: string, external: boolean): Promise<LintCommand
105
105
  const configDirectory = external ? cwd : (process.env.PI_AGENT_IDE_CONFIG_DIR ?? cwd);
106
106
  return LintCommandRegistry.fromDirectory(configDirectory, {
107
107
  includeGlobal: !external,
108
- requireBuiltInEvidence: external,
108
+ requireBuiltInEvidence: true,
109
109
  });
110
110
  }
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "pi-agent-ide-lint",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-doctor": "0.5.1",
7
- "pi-agent-invariant": "0.5.1",
8
- "pi-agent-read": "0.5.1",
9
- "pi-agent-resource": "0.5.1",
10
- "pi-agent-text": "0.5.1"
6
+ "pi-agent-doctor": "0.6.1",
7
+ "pi-agent-invariant": "0.6.1",
8
+ "pi-agent-read": "0.6.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-32.js"
14
+ "./runtime/entry-36.js"
15
15
  ]
16
16
  },
17
17
  "peerDependencies": {
18
18
  "@earendil-works/pi-coding-agent": "*",
19
- "pi-agent-ide": "0.5.1"
19
+ "pi-agent-ide": "0.6.1"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "pi-agent-ide": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-36.js";
2
+ export { default } from "../../../../dist/entry-36.js";
@@ -1,5 +1,8 @@
1
1
  import path from "node:path";
2
+ import os from "node:os";
2
3
  import { fileURLToPath } from "node:url";
4
+
5
+ import { sameFilePath } from "pi-agent-ide/api/path-identity";
3
6
  import { runConfiguredProcess } from "pi-agent-ide/api/tool-config";
4
7
 
5
8
  import { parseDiagnostics } from "./diagnostics.js";
@@ -29,7 +32,22 @@ export async function runConfiguredLinter(
29
32
  let result: ProcessResult;
30
33
 
31
34
  try {
32
- result = await runConfiguredProcess(config.check, context);
35
+ const executable = path.basename(config.check.command[0] ?? "").toLocaleLowerCase();
36
+ const isRuff = executable === "ruff" || executable === "ruff.exe";
37
+ const inheritedEnvironment = context.env ?? process.env;
38
+ result = await runConfiguredProcess(config.check, {
39
+ ...context,
40
+ ...(isRuff
41
+ ? {
42
+ env: {
43
+ ...inheritedEnvironment,
44
+ RUFF_CACHE_DIR:
45
+ inheritedEnvironment.RUFF_CACHE_DIR ??
46
+ path.join(os.tmpdir(), "pi-agent-ide", "ruff-cache"),
47
+ },
48
+ }
49
+ : {}),
50
+ });
33
51
  } catch (error) {
34
52
  return {
35
53
  ok: false,
@@ -66,7 +84,7 @@ export async function runConfiguredLinter(
66
84
  const file = diagnostic.file.startsWith("file:")
67
85
  ? fileURLToPath(diagnostic.file)
68
86
  : diagnostic.file;
69
- return path.resolve(workingDirectory, file) === path.resolve(context.filePath);
87
+ return sameFilePath(path.resolve(workingDirectory, file), context.filePath);
70
88
  })
71
89
  .map(({ file: _file, ...diagnostic }) => diagnostic);
72
90
  return {
@@ -115,9 +115,6 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
115
115
  api.describe(
116
116
  "symbol:<file>#<selector> — declaration source, e.g. symbol:src/catalog.ts#Catalog/find. graph:<file> — top-level declarations, references and calls; members include selectors. graph:<file>#<selector> — references and incoming/outgoing calls for that declaration or member.",
117
117
  );
118
- api.addPromptGuideline(
119
- "Use semantic code views first when exploring code supported by a configured language server. Use `symbols:<query>` to locate named declaration and reference candidates when the file is unknown. Use `graph:<file>` to map the declarations and relationships in a known file before reading implementation bodies. Use `graph:<file>#<selector>` to inspect references and incoming/outgoing calls for one declaration. Use `symbol:<file>#<selector>` to read that declaration’s source. Use text search for exact text, non-code files, or when semantic views are unavailable.",
120
- );
121
118
  },
122
119
  } satisfies ReadPlugin;
123
120
 
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "pi-agent-ide-lsp",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "cross-spawn": "^7.0.6",
7
- "pi-agent-doctor": "0.5.1",
8
- "pi-agent-invariant": "0.5.1",
9
- "pi-agent-read": "0.5.1",
10
- "pi-agent-resource": "0.5.1",
11
- "pi-agent-search": "0.5.1",
12
- "pi-agent-text": "0.5.1",
13
- "pi-agent-text-editor": "0.5.1",
7
+ "pi-agent-doctor": "0.6.1",
8
+ "pi-agent-invariant": "0.6.1",
9
+ "pi-agent-read": "0.6.1",
10
+ "pi-agent-resource": "0.6.1",
11
+ "pi-agent-search": "0.6.1",
12
+ "pi-agent-text": "0.6.1",
13
+ "pi-agent-text-editor": "0.6.1",
14
14
  "vscode-jsonrpc": "^9.0.0",
15
15
  "vscode-uri": "^3.1.0"
16
16
  },
17
17
  "pi": {
18
18
  "extensions": [
19
- "./runtime/entry-33.js"
19
+ "./runtime/entry-37.js"
20
20
  ]
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@earendil-works/pi-coding-agent": "*",
24
- "pi-agent-ide": "0.5.1"
24
+ "pi-agent-ide": "0.6.1"
25
25
  },
26
26
  "peerDependenciesMeta": {
27
27
  "pi-agent-ide": {
@@ -0,0 +1,2 @@
1
+ export * from "../../../../dist/entry-37.js";
2
+ export { default } from "../../../../dist/entry-37.js";
@@ -10,6 +10,10 @@ export interface AgentIdeProcess {
10
10
  readonly title: string;
11
11
  readonly description: string;
12
12
  readonly status: AgentIdeProcessStatus;
13
+ /** Native process ID when the provider owns the process. */
14
+ readonly pid?: number;
15
+ /** True only when Agent IDE created and controls this process. */
16
+ readonly owned?: boolean;
13
17
  renderSummary(theme: Theme): readonly string[];
14
18
  renderDetail(theme: Theme): Component;
15
19
  stop(): Promise<void>;
@@ -1,5 +1,4 @@
1
1
  import {
2
- DynamicBorder,
3
2
  type ExtensionAPI,
4
3
  type ExtensionContext,
5
4
  type Theme,
@@ -148,19 +147,24 @@ export class AgentIdeProcessesUi {
148
147
  invalidate: () => list.invalidate(),
149
148
  render(width: number) {
150
149
  const container = new Container();
151
- container.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
150
+
152
151
  if (page === "list") {
153
- container.addChild(
154
- new Text(theme.fg("accent", theme.bold("Agent IDE processes")), 1, 0),
155
- );
156
152
  container.addChild(list);
157
153
  container.addChild(
158
- new Text(theme.fg("dim", "enter view · d stop · esc close"), 1, 0),
154
+ new Text(
155
+ theme.fg(
156
+ "dim",
157
+ active.length === 0 ? "esc close" : "enter view · d stop · esc close",
158
+ ),
159
+ 1,
160
+ 0,
161
+ ),
159
162
  );
160
163
  } else if (selected === undefined) {
161
164
  container.addChild(
162
165
  new Text(theme.fg("warning", "Process is no longer active."), 1, 0),
163
166
  );
167
+ container.addChild(new Text(theme.fg("dim", "esc back"), 1, 0));
164
168
  } else {
165
169
  container.addChild(selected.renderDetail(theme));
166
170
  container.addChild(
@@ -180,8 +184,13 @@ export class AgentIdeProcessesUi {
180
184
  ),
181
185
  );
182
186
  }
183
- container.addChild(new DynamicBorder((text) => theme.fg("accent", text)));
184
- return container.render(width);
187
+ const accent = (text: string): string => theme.fg("accent", text);
188
+ const innerWidth = Math.max(1, width - 2);
189
+ return [
190
+ borderTop("Agent IDE Processes", `${active.length} active`, width, accent),
191
+ ...container.render(innerWidth).map((line) => borderLine(line, width, accent)),
192
+ borderBottom(width, accent),
193
+ ];
185
194
  },
186
195
  handleInput(data: string) {
187
196
  if (page === "list") {
@@ -193,7 +202,7 @@ export class AgentIdeProcessesUi {
193
202
  } else list.handleInput(data);
194
203
  } else if (page === "detail") {
195
204
  if (matchesKey(data, Key.escape)) page = "list";
196
- else if (data === "d") page = "confirm";
205
+ else if (data === "d" && selected !== undefined) page = "confirm";
197
206
  else if (data === "i" && selected?.sendInput !== undefined) page = "input";
198
207
  } else if (page === "input") {
199
208
  if (matchesKey(data, Key.escape)) page = "detail";
@@ -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
  forgetReloadResource,
4
5
  retainReloadResource,
@@ -12,9 +13,27 @@ import { TerminalSessionManager } from "#src/plugins/pi-agent-ide-terminal/src/s
12
13
  import { resolveShellProfile } from "#src/plugins/pi-agent-ide-terminal/src/shell-profile.js";
13
14
  import { registerTerminalTools } from "#src/plugins/pi-agent-ide-terminal/src/tools.js";
14
15
  import { TerminalUi } from "#src/plugins/pi-agent-ide-terminal/src/ui.js";
16
+ import { toolPresentation } from "#src/composite/presentation.js";
17
+ import type { BuiltinExtensionContext } from "#src/composite/selection.js";
15
18
 
16
19
  /** Register the platform-aware terminal runner and shell session resources. */
17
- export default async function registerTerminal(pi: ExtensionAPI): Promise<void> {
20
+ export default async function registerTerminal(
21
+ pi: ExtensionAPI,
22
+ context?: BuiltinExtensionContext,
23
+ ): Promise<void> {
24
+ connectAgentDocumentation(pi, [
25
+ await loadPackagedAgentGuide({
26
+ id: "terminal",
27
+ description: "Foreground and background commands, shell resources, and processes",
28
+ triggers: [
29
+ { tool: "bash" },
30
+ ...["read", "write", "insert", "delete"].map((tool) => ({
31
+ tool,
32
+ resourcePrefixes: ["shell:", "process:"],
33
+ })),
34
+ ],
35
+ }),
36
+ ]);
18
37
  const manager =
19
38
  (takeReloadResource("terminal") as TerminalSessionManager | undefined) ??
20
39
  new TerminalSessionManager();
@@ -23,7 +42,13 @@ export default async function registerTerminal(pi: ExtensionAPI): Promise<void>
23
42
  const removeProcessProvider = agentIdeProcessRegistry(pi).add(terminalProcessProvider(manager));
24
43
 
25
44
  await Promise.all([registerTerminalResources(pi, manager), registerTerminalSearch(pi, manager)]);
26
- registerTerminalTools(pi, manager, profile, ui);
45
+ registerTerminalTools(
46
+ pi,
47
+ manager,
48
+ profile,
49
+ ui,
50
+ toolPresentation(context?.preferences["ui.terminal"]),
51
+ );
27
52
 
28
53
  pi.on("session_start", (_event, context) => ui.bind(context));
29
54
  pi.on("agent_settled", (_event, context) => ui.onAgentSettled(context));
@@ -21,6 +21,7 @@ export function terminalProcessProvider(manager: TerminalSessionManager): AgentI
21
21
  title: snapshot.shell.toLocaleLowerCase(),
22
22
  description: snapshot.command,
23
23
  status: snapshot.status === "stopping" ? ("stopping" as const) : ("running" as const),
24
+ ...(snapshot.pid === undefined ? {} : { pid: snapshot.pid, owned: true }),
24
25
  renderSummary: (theme) => renderActiveTerminal(snapshot, theme).split("\n"),
25
26
  renderDetail: (theme) => renderTerminalResult(snapshot, true, theme),
26
27
  sendInput: (data) => manager.write(snapshot.source, data),
@@ -72,10 +72,35 @@ export function renderTerminalResult(
72
72
  /** Render the result beneath the already-visible run prompt without repeating the command. */
73
73
  export function renderRunResult(
74
74
  snapshot: Partial<TerminalSessionSnapshot>,
75
- expanded: boolean,
75
+ presentation: "full" | "compact" | "disabled" | boolean,
76
76
  theme: TerminalTheme,
77
77
  ): Component {
78
- if (expanded) return renderTerminalResult(snapshot, true, theme);
78
+ if (presentation === true) presentation = "full";
79
+ else if (presentation === false) presentation = "compact";
80
+ if (presentation === "disabled") {
81
+ const failed =
82
+ (snapshot.status !== undefined && !["running", "completed"].includes(snapshot.status)) ||
83
+ (snapshot.exitCode !== undefined && snapshot.exitCode !== 0) ||
84
+ snapshot.error !== undefined;
85
+ if (!failed)
86
+ return new Text(
87
+ statusLine(snapshot, (name, text) => theme.fg(name, text)),
88
+ 0,
89
+ 0,
90
+ );
91
+ const window = outputWindow(snapshot.output ?? "", COMPACT_READ_ROWS);
92
+ const lines = [
93
+ ...(window.omission === undefined ? [] : [` ${theme.fg("muted", window.omission)}`]),
94
+ ...window.lines.map((line) => ` ${theme.fg("dim", line)}`),
95
+ ...(snapshot.error === undefined ? [] : [` ${theme.fg("error", snapshot.error)}`]),
96
+ statusLine(snapshot, (name, text) => theme.fg(name, text)),
97
+ ];
98
+ return new Text(lines.join("\n"), 0, 0);
99
+ }
100
+ if (presentation === "full") {
101
+ const lines = terminalCardLines(snapshot, Number.POSITIVE_INFINITY, theme).slice(2);
102
+ return new Text(lines.join("\n"), 0, 0);
103
+ }
79
104
  const window = outputWindow(snapshot.output ?? "", COMPACT_READ_ROWS);
80
105
  const lines = [
81
106
  ...(window.omission === undefined ? [] : [` ${theme.fg("muted", window.omission)}`]),
@@ -104,10 +104,7 @@ export async function registerTerminalResources(
104
104
  },
105
105
  });
106
106
  api.describe(
107
- 'shell:<session> — terminal session status and a bounded output tail with a full-log path when truncated. Use views: ["image"] to read the current virtual terminal screen as a PNG.',
108
- );
109
- api.addPromptGuideline(
110
- "Use read with a returned shell:<session> source to inspect terminal status and output. Add the image view when cursor movement, ANSI layout, or a full-screen terminal interface matters.",
107
+ 'shell:<session> — terminal status and a bounded output tail with a full-log path when truncated. views: ["image"] returns the virtual terminal screen as a PNG.',
111
108
  );
112
109
  },
113
110
  } satisfies ReadPlugin;
@@ -33,9 +33,6 @@ export async function registerTerminalSearch(
33
33
  api.describe(
34
34
  "path shell:<session> searches the retained text output of that terminal, including rows outside its current screen.",
35
35
  );
36
- api.addPromptGuideline(
37
- "Use search with path shell:<session> to find text in retained terminal output. Read the same shell source with the returned line number when more context is needed.",
38
- );
39
36
  },
40
37
  } satisfies SearchPlugin;
41
38
  await connectSearchPlugin(pi, plugin);
@@ -65,6 +65,7 @@ export class TerminalSessionManager {
65
65
  cwd: session.cwd,
66
66
  shell: session.shell.displayName,
67
67
  shellFamily: session.shell.family,
68
+ ...(session.process === undefined ? {} : { pid: session.process.pid }),
68
69
  background: session.background,
69
70
  status: session.status,
70
71
  ...(session.waitReason === undefined ? {} : { waitReason: session.waitReason }),
@@ -3,6 +3,7 @@ import { stripVTControlCharacters } from "node:util";
3
3
 
4
4
  import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
5
5
  import { Type } from "typebox";
6
+ import { Text } from "@earendil-works/pi-tui";
6
7
 
7
8
  import { COMPACT_READ_ROWS } from "#src/extensions/pi-agent-read/src/core/tools/read/read-renderer.js";
8
9
  import { formatAgentTerminalSnapshot } from "#src/plugins/pi-agent-ide-terminal/src/output-limits.js";
@@ -56,6 +57,7 @@ export function registerTerminalTools(
56
57
  manager: TerminalSessionManager,
57
58
  profile: ShellProfile,
58
59
  ui: Pick<TerminalUi, "bind" | "notifyWaitTransition">,
60
+ presentation: "full" | "compact" | "disabled" = "compact",
59
61
  ): void {
60
62
  const toolName = process.platform === "win32" ? "powershell" : "bash";
61
63
  pi.registerTool(
@@ -64,10 +66,9 @@ export function registerTerminalTools(
64
66
  label: profile.displayName,
65
67
  promptSnippet: `Execute ${profile.displayName} commands in synchronous or background terminal sessions`,
66
68
  promptGuidelines: [
67
- `Write commands for ${profile.displayName}; commands are not translated between shell languages.`,
68
- `Use ${toolName} with background for servers, watchers, and long builds. Foreground waits become background after timeoutSeconds (60 by default), on a stable interactive prompt, or when the turn is aborted. After a session enters background, do not poll it continuously; continue other work or wait for its automatic completion notification. Keep a short task in foreground wait when it should finish soon and no independent work remains. A background session with no output for two minutes wakes an idle agent so it can be inspected. Sessions survive extension reloads and keep the same shell: source. Large output returns a bounded tail and a fullOutput file path. Use the returned shell: source with read, write, insert, and delete.`,
69
+ `Do not use ${toolName} commands or scripts to edit files. Use Apply or the standalone editing tools instead. Commands that inherently generate files, such as formatters and code generators, are allowed.`,
69
70
  ],
70
- description: `Use ${toolName} to execute a command in the user's configured ${profile.displayName} shell (${profile.executable}). Every call creates an addressable terminal session. Set background to true to continue without waiting. A foreground wait automatically returns the live session as background on timeout, a stable interactive prompt, or turn abort. Background completion is delivered automatically and wakes the agent, so background sessions do not need continuous polling. Keep short tasks in foreground wait when they should finish soon and no independent work remains. Sessions survive extension reloads and keep the same shell: source. Output uses the shared Read limits, keeps the tail, and links a complete log file when truncated. ${shellSyntaxGuidance(profile)}`,
71
+ description: `Use ${toolName} to execute a command in the user's configured ${profile.displayName} shell (${profile.executable}). Every call creates an addressable terminal session. Set background to true to continue without waiting. A foreground wait automatically returns the live session as background on timeout, a stable interactive prompt, or turn abort. Background completion is delivered automatically and wakes the agent. Silent background sessions are treated as potentially stale after two minutes and wake an idle agent for inspection. Sessions survive extension reloads and keep the same shell: source. Output uses the shared Read limits, keeps the tail, and links a complete log file when truncated. ${shellSyntaxGuidance(profile)}`,
71
72
  parameters: runParameters,
72
73
  async execute(_toolCallId, input, signal, onUpdate, context) {
73
74
  ui.bind(context);
@@ -93,7 +94,9 @@ export function registerTerminalTools(
93
94
  if (outcome.reason === "aborted") ui.notifyWaitTransition(outcome.session);
94
95
  return terminalResult(manager.snapshot(outcome.session));
95
96
  },
96
- renderCall(args, theme) {
97
+ renderCall(args, theme, context) {
98
+ const mode = context.expanded ? "full" : presentation;
99
+ if (mode === "disabled") return new Text(theme.fg("toolTitle", toolName), 0, 0);
97
100
  const command = typeof args.command === "string" ? args.command : "";
98
101
  const cwd =
99
102
  typeof args.cwd === "string" ? path.resolve(process.cwd(), args.cwd) : process.cwd();
@@ -102,7 +105,7 @@ export function registerTerminalTools(
102
105
  renderResult(result, options, theme) {
103
106
  return renderRunResult(
104
107
  result.details as Partial<TerminalSessionSnapshot>,
105
- options.expanded,
108
+ options.expanded ? "full" : presentation,
106
109
  theme,
107
110
  );
108
111
  },
@@ -57,6 +57,7 @@ export interface TerminalSessionSnapshot {
57
57
  readonly cwd: string;
58
58
  readonly shell: string;
59
59
  readonly shellFamily: ShellProfile["family"];
60
+ readonly pid?: number;
60
61
  readonly background: boolean;
61
62
  readonly status: TerminalSessionStatus;
62
63
  readonly waitReason?: TerminalWaitReason;