pi-agent-ide 0.7.0 → 0.7.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 (218) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/chunk-2TRHFMCZ.js +11 -0
  3. package/dist/{chunk-FXNKMNSJ.js → chunk-4GCWGE2C.js} +1 -1
  4. package/dist/chunk-4XMY4H4V.js +1 -0
  5. package/dist/{chunk-3HYXQ4YA.js → chunk-76ZK5ODR.js} +2 -2
  6. package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
  7. package/dist/chunk-CWD4O5PM.js +3 -0
  8. package/dist/chunk-D3WTDA6V.js +2 -0
  9. package/dist/chunk-GXEGY7GV.js +1 -0
  10. package/dist/{chunk-GBLKIB6O.js → chunk-HZEY4GT4.js} +1 -1
  11. package/dist/{chunk-S5LXX32D.js → chunk-LEEQIQ7D.js} +6 -6
  12. package/dist/chunk-NRZO5KJT.js +9 -0
  13. package/dist/chunk-OMVRLWMX.js +5 -0
  14. package/dist/{chunk-KR36BT5E.js → chunk-PGIVHICI.js} +1 -1
  15. package/dist/{chunk-YRF7OATP.js → chunk-PKKDDIWW.js} +1 -1
  16. package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
  17. package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
  18. package/dist/chunk-VMTR74FF.js +2 -0
  19. package/dist/{chunk-PYPPV2F5.js → chunk-WMO6RNE2.js} +1 -1
  20. package/dist/{chunk-3JO7QFIL.js → chunk-WU6ZK6YD.js} +1 -1
  21. package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
  22. package/dist/{chunk-AJRIASPQ.js → chunk-YP46DVVP.js} +1 -1
  23. package/dist/entry-11.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-17.js +1 -1
  28. package/dist/entry-25.js +2 -2
  29. package/dist/entry-26.js +1 -1
  30. package/dist/entry-27.js +2 -2
  31. package/dist/entry-28.js +1 -1
  32. package/dist/entry-29.js +1 -1
  33. package/dist/entry-31.js +13 -12
  34. package/dist/entry-33.js +1 -1
  35. package/dist/entry-37.js +6 -6
  36. package/dist/entry-41.js +1 -1
  37. package/dist/entry-43.js +1 -1
  38. package/dist/entry-44.js +1 -1
  39. package/dist/entry-45.js +13 -14
  40. package/dist/entry-46.js +1 -1
  41. package/dist/entry-49.js +1 -1
  42. package/dist/entry-50.js +1 -1
  43. package/dist/entry-51.js +2 -2
  44. package/dist/entry-53.js +1 -1
  45. package/dist/entry-54.js +1 -1
  46. package/dist/entry-56.js +1 -1
  47. package/dist/entry-57.js +1 -1
  48. package/dist/entry-58.js +1 -1
  49. package/dist/entry-60.js +1 -1
  50. package/dist/entry-62.js +1 -1
  51. package/dist/entry-65.js +1 -1
  52. package/dist/entry-68.js +1 -1
  53. package/dist/entry-70.js +1 -1
  54. package/dist/entry-75.js +1 -1
  55. package/dist/entry-77.js +33 -34
  56. package/dist/entry-78.js +1 -1
  57. package/dist/entry-79.js +1 -1
  58. package/dist/entry-80.js +1 -1
  59. package/dist/entry-82.js +2 -2
  60. package/dist/entry-83.js +1 -1
  61. package/dist/entry-84.js +1 -1
  62. package/dist/entry-85.js +1 -1
  63. package/dist/entry-86.js +1 -1
  64. package/dist/pi-agent-ide.js +14 -9
  65. package/docs/agent-guides/editing.md +35 -46
  66. package/docs/agent-guides/read-resources.md +5 -9
  67. package/docs/agent-guides/search-code.md +12 -17
  68. package/docs/agent-guides/select-code.md +61 -140
  69. package/docs/structured-results.md +27 -62
  70. package/docs/tools.md +6 -10
  71. package/node_modules/pi-agent-doctor/package.json +1 -1
  72. package/node_modules/pi-agent-documentation/package.json +1 -1
  73. package/node_modules/pi-agent-filesystem/index.ts +7 -6
  74. package/node_modules/pi-agent-filesystem/package.json +7 -7
  75. package/node_modules/pi-agent-filesystem-image/package.json +3 -3
  76. package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
  77. package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
  78. package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
  79. package/node_modules/pi-agent-filesystem-text/package.json +3 -3
  80. package/node_modules/pi-agent-ide-ast/package.json +13 -13
  81. package/node_modules/pi-agent-ide-ast/src/extension.ts +7 -4
  82. package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -6
  83. package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
  84. package/node_modules/pi-agent-ide-ast/src/select-schema.ts +2 -2
  85. package/node_modules/pi-agent-ide-ast/src/tool-select.ts +18 -1
  86. package/node_modules/pi-agent-ide-changes/index.ts +4 -3
  87. package/node_modules/pi-agent-ide-changes/package.json +8 -8
  88. package/node_modules/pi-agent-ide-formatter/package.json +3 -3
  89. package/node_modules/pi-agent-ide-languages/package.json +2 -2
  90. package/node_modules/pi-agent-ide-lint/package.json +7 -7
  91. package/node_modules/pi-agent-ide-lsp/index.ts +3 -3
  92. package/node_modules/pi-agent-ide-lsp/package.json +9 -9
  93. package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -1
  94. package/node_modules/pi-agent-image/package.json +2 -2
  95. package/node_modules/pi-agent-invariant/package.json +1 -1
  96. package/node_modules/pi-agent-pdf/package.json +2 -2
  97. package/node_modules/pi-agent-read/package.json +7 -7
  98. package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  99. package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
  100. package/node_modules/pi-agent-read/src/api/tools/read.ts +7 -1
  101. package/node_modules/pi-agent-read/src/core/extension.ts +7 -1
  102. package/node_modules/pi-agent-read/src/core/read-core.ts +50 -35
  103. package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
  104. package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +9 -2
  105. package/node_modules/pi-agent-resource/package.json +1 -1
  106. package/node_modules/pi-agent-resource/src/result-targets.ts +183 -9
  107. package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
  108. package/node_modules/pi-agent-search/package.json +5 -5
  109. package/node_modules/pi-agent-search/src/api/search-parameters.ts +1 -1
  110. package/node_modules/pi-agent-search-text/index.ts +1 -1
  111. package/node_modules/pi-agent-search-text/package.json +7 -7
  112. package/node_modules/pi-agent-text/package.json +2 -2
  113. package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
  114. package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
  115. package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
  116. package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  117. package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
  118. package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
  119. package/node_modules/pi-agent-text-editor/package.json +9 -9
  120. package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  121. package/node_modules/pi-agent-text-editor/src/core/extension.ts +10 -3
  122. package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
  123. package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +18 -11
  124. package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +43 -209
  125. package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +37 -31
  126. package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  127. package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -7
  128. package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
  129. package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
  130. package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  131. package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
  132. package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
  133. package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
  134. package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
  135. package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
  136. package/node_modules/pi-agent-tool-ui/package.json +1 -1
  137. package/node_modules/pi-agent-web/index.ts +4 -3
  138. package/node_modules/pi-agent-web/package.json +7 -7
  139. package/node_modules/pi-agent-web-html/package.json +2 -2
  140. package/node_modules/pi-agent-web-image/package.json +3 -3
  141. package/node_modules/pi-agent-web-pdf/package.json +3 -3
  142. package/node_modules/pi-agent-web-text/package.json +3 -3
  143. package/package.json +35 -35
  144. package/src/composite/text-results.ts +221 -0
  145. package/src/documentation/extension.ts +11 -9
  146. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
  147. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
  148. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
  149. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
  150. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
  151. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
  152. package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
  153. package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +4 -3
  154. package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
  155. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
  156. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
  157. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
  158. package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
  159. package/src/extensions/pi-agent-read/package.json +7 -7
  160. package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
  161. package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
  162. package/src/extensions/pi-agent-read/src/api/tools/read.ts +7 -1
  163. package/src/extensions/pi-agent-read/src/core/extension.ts +7 -1
  164. package/src/extensions/pi-agent-read/src/core/read-core.ts +50 -35
  165. package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
  166. package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +9 -2
  167. package/src/extensions/pi-agent-search/package.json +5 -5
  168. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
  169. package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -7
  170. package/src/extensions/pi-agent-search/src/api/search-parameters.ts +1 -1
  171. package/src/extensions/pi-agent-text-editor/package.json +9 -9
  172. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
  173. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
  174. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
  175. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
  176. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
  177. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
  178. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
  179. package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
  180. package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
  181. package/src/extensions/pi-agent-text-editor/src/core/extension.ts +10 -3
  182. package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
  183. package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +18 -11
  184. package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +43 -209
  185. package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +37 -31
  186. package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
  187. package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -7
  188. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
  189. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
  190. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
  191. package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
  192. package/src/pi-agent-ide.ts +4 -1
  193. package/src/plugins/pi-agent-ide-ast/package.json +13 -13
  194. package/src/plugins/pi-agent-ide-ast/src/extension.ts +7 -4
  195. package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -6
  196. package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
  197. package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +2 -2
  198. package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +18 -1
  199. package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
  200. package/src/plugins/pi-agent-ide-changes/package.json +8 -8
  201. package/src/plugins/pi-agent-ide-debugger/index.ts +5 -3
  202. package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +5 -3
  203. package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
  204. package/src/plugins/pi-agent-ide-languages/package.json +2 -2
  205. package/src/plugins/pi-agent-ide-lint/package.json +7 -7
  206. package/src/plugins/pi-agent-ide-lsp/index.ts +3 -3
  207. package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
  208. package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -1
  209. package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
  210. package/src/plugins/pi-agent-ide-vision/index.ts +12 -4
  211. package/dist/chunk-4NIFBFFR.js +0 -11
  212. package/dist/chunk-7LZKOHH2.js +0 -1
  213. package/dist/chunk-FK42RSF4.js +0 -1
  214. package/dist/chunk-KBP3QUDT.js +0 -2
  215. package/dist/chunk-OE7QVAI2.js +0 -5
  216. package/dist/chunk-SILJ3OL4.js +0 -9
  217. package/dist/chunk-SQKAXYIR.js +0 -2
  218. package/dist/chunk-VCGNVTXQ.js +0 -1
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-pdf",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.7.0",
7
- "pi-agent-resource": "0.7.0"
6
+ "pi-agent-pdf": "0.7.1",
7
+ "pi-agent-resource": "0.7.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-filesystem-text",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#extension": "./index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-resource": "0.7.0",
10
- "pi-agent-text": "0.7.0"
9
+ "pi-agent-resource": "0.7.1",
10
+ "pi-agent-text": "0.7.1"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [
@@ -35,9 +35,10 @@ export default async function registerWeb(pi: ExtensionAPI): Promise<void> {
35
35
  renderResult: renderWebResult,
36
36
  preserveTruncatedOutput: true,
37
37
  });
38
- api.describe(() =>
39
- renderContentDescription("HTTP(S) URL — remote content.", readHost.listDescriptions()),
40
- );
38
+ api.describe({
39
+ path: () =>
40
+ renderContentDescription("HTTP(S) URL — remote content.", readHost.listDescriptions()),
41
+ });
41
42
  },
42
43
  } satisfies ReadPlugin;
43
44
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-web",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,12 +8,12 @@
8
8
  "dependencies": {
9
9
  "defuddle": "^0.19.1",
10
10
  "linkedom": "^0.18.12",
11
- "pi-agent-doctor": "0.7.0",
12
- "pi-agent-image": "0.7.0",
13
- "pi-agent-read": "0.7.0",
14
- "pi-agent-resource": "0.7.0",
15
- "pi-agent-search": "0.7.0",
16
- "pi-agent-text": "0.7.0",
11
+ "pi-agent-doctor": "0.7.1",
12
+ "pi-agent-image": "0.7.1",
13
+ "pi-agent-read": "0.7.1",
14
+ "pi-agent-resource": "0.7.1",
15
+ "pi-agent-search": "0.7.1",
16
+ "pi-agent-text": "0.7.1",
17
17
  "playwright-core": "^1.62.1"
18
18
  },
19
19
  "pi": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-web-html",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "defuddle": "^0.19.1",
10
10
  "linkedom": "^0.18.12",
11
- "pi-agent-resource": "0.7.0"
11
+ "pi-agent-resource": "0.7.1"
12
12
  },
13
13
  "pi": {
14
14
  "extensions": [
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-web-image",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-image": "0.7.0",
7
- "pi-agent-resource": "0.7.0"
6
+ "pi-agent-image": "0.7.1",
7
+ "pi-agent-resource": "0.7.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-web-pdf",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-pdf": "0.7.0",
7
- "pi-agent-resource": "0.7.0"
6
+ "pi-agent-pdf": "0.7.1",
7
+ "pi-agent-resource": "0.7.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "pi-agent-web-text",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "pi-agent-resource": "0.7.0",
7
- "pi-agent-text": "0.7.0"
6
+ "pi-agent-resource": "0.7.1",
7
+ "pi-agent-text": "0.7.1"
8
8
  },
9
9
  "pi": {
10
10
  "extensions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-read",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -24,12 +24,12 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "pi-agent-documentation": "0.7.0",
28
- "pi-agent-invariant": "0.7.0",
29
- "pi-agent-resource": "0.7.0",
30
- "pi-agent-text": "0.7.0",
31
- "pi-agent-tool-call-interception": "0.7.0",
32
- "pi-agent-tool-ui": "0.7.0"
27
+ "pi-agent-documentation": "0.7.1",
28
+ "pi-agent-invariant": "0.7.1",
29
+ "pi-agent-resource": "0.7.1",
30
+ "pi-agent-text": "0.7.1",
31
+ "pi-agent-tool-call-interception": "0.7.1",
32
+ "pi-agent-tool-ui": "0.7.1"
33
33
  },
34
34
  "pi": {
35
35
  "extensions": [
@@ -5,7 +5,7 @@ import type { ReadToolPluginApi } from "#src/api/tools/read.js";
5
5
 
6
6
  export const READ_PROTOCOL = "pi-agent-read";
7
7
 
8
- export const READ_API_VERSION = 13;
8
+ export const READ_API_VERSION = 14;
9
9
 
10
10
  export const READ_CORE_READY_EVENT = `${READ_PROTOCOL}/core/ready`;
11
11
 
@@ -1,4 +1,5 @@
1
- import { Type } from "typebox";
1
+ import { Type, type TSchema } from "typebox";
2
+ import type { ReadRequest } from "#src/api/tools/read.js";
2
3
 
3
4
  /** Canonical arguments shared by standalone and composed operations. */
4
5
  export const readParameters = Type.Object({
@@ -27,3 +28,39 @@ export const readParameters = Type.Object({
27
28
  }),
28
29
  ),
29
30
  });
31
+
32
+ /** Rendered plugin syntax grouped by Read parameter. */
33
+ export type ReadParameterText = Partial<Record<keyof ReadRequest, string>>;
34
+
35
+ // Keep the shared schema's metadata stable for Diff; these descriptions belong to Read.
36
+ const coreDescriptions: Record<keyof ReadRequest, string> = {
37
+ path: "What to read: a resource path, unchanged source result or its UUID. Pass the whole result to compose tools. Supply a source; an empty call cannot select one. temp:<id> reads saved complete output until this runtime is disposed. raw:<local-file> reads original bytes from a regular file (relative, absolute or file:// path); raw: does not accept views.",
38
+ offset:
39
+ "For raw: sources, a zero-based integer byte offset; negative offsets count from the file end. For text sources, the 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.",
40
+ limit:
41
+ "For raw: sources, a non-negative integer byte count (0 reads no bytes). For text sources, the maximum lines from the selected starting position. Omit for the bounded default read. Explicit ranges on other content require a source-specific handler; otherwise they fail.",
42
+ views:
43
+ "Optional source-specific presentations. Omit for the source's default presentation. Values may include settings after a colon; use the syntax below. Combine views only when their contracts allow it. Unknown views can be ignored and reported in ignoredViews; they do not add capabilities. raw: sources reject views.",
44
+ };
45
+
46
+ /** Build a fresh Read schema snapshot without changing the shared schema or accepted types. */
47
+ export function describeReadParameters(descriptions: ReadParameterText): typeof readParameters {
48
+ const describe = <Schema extends TSchema>(
49
+ schema: Schema,
50
+ parameter: keyof ReadRequest,
51
+ ): Schema => ({
52
+ ...schema,
53
+ description: [coreDescriptions[parameter], descriptions[parameter]]
54
+ .filter((value) => value !== undefined)
55
+ .join("\n"),
56
+ });
57
+ return {
58
+ ...readParameters,
59
+ properties: {
60
+ path: describe(readParameters.properties.path, "path"),
61
+ offset: describe(readParameters.properties.offset, "offset"),
62
+ limit: describe(readParameters.properties.limit, "limit"),
63
+ views: describe(readParameters.properties.views, "views"),
64
+ },
65
+ };
66
+ }
@@ -269,6 +269,11 @@ export type ReadHandlerRegistration =
269
269
 
270
270
  export type PromptDescriptionSource = string | (() => string | undefined);
271
271
 
272
+ /** Source and view syntax attached to the matching Read parameter. Callbacks are evaluated for each schema snapshot; undefined omits that contribution. */
273
+ export type ReadParameterDescriptions = {
274
+ readonly [Parameter in keyof ReadRequest]?: PromptDescriptionSource;
275
+ };
276
+
272
277
  /** Remaining text budget for a format-aware view of already-read data. */
273
278
  export interface ReadOutputBudget {
274
279
  readonly maxBytes: number;
@@ -325,7 +330,8 @@ export interface ReadToolPluginApi {
325
330
  /** Registers a named view whose presenter runs when a request lists the view. */
326
331
  addView(registration: ReadViewRegistration): void;
327
332
  addFragmentResolver(registration: FragmentResolverRegistration): void;
328
- describe(description: PromptDescriptionSource): void;
333
+ /** Adds one parameter-description map per plugin. This documents capabilities without changing validation or registering them. */
334
+ describe(descriptions: ReadParameterDescriptions): void;
329
335
 
330
336
  /** Adds an operational rule to the read tool's system-prompt guidelines. */
331
337
  addPromptGuideline(guideline: PromptDescriptionSource): void;
@@ -60,7 +60,13 @@ export default async function registerReadCore(
60
60
  });
61
61
 
62
62
  const interceptionRendering = new ToolCallInterceptionRenderStore();
63
- pi.registerTool(withToolCallInterceptionRendering(core.read.tool, interceptionRendering));
63
+ const definition = withToolCallInterceptionRendering(core.read.tool, interceptionRendering);
64
+ pi.registerTool(definition);
65
+ pi.on("before_agent_start", async () => {
66
+ await core.waitForPendingPlugins();
67
+ // Pi snapshots schemas when it wraps definitions. Refresh current plugin metadata for this run.
68
+ if (pi.getActiveTools().includes("read")) pi.registerTool(definition);
69
+ });
64
70
  pi.on("tool_result", (event) => {
65
71
  if (event.toolName !== "read" || !isRecord(event.details)) {
66
72
  return;
@@ -12,6 +12,7 @@ import {
12
12
  isTextTargetResolverRegistration,
13
13
  type FragmentResolverRegistration,
14
14
  type PromptDescriptionSource,
15
+ type ReadParameterDescriptions,
15
16
  type ReadHandlerRegistration,
16
17
  type ReadOutputReducer,
17
18
  type ReadResourceGuardRegistration,
@@ -20,6 +21,7 @@ import {
20
21
  type TextTargetResolverRegistration,
21
22
  } from "#src/api/tools/read.js";
22
23
  import { createReadTool, type ReadTool } from "#src/core/tools/tool-read.js";
24
+ import { readParameters, type ReadParameterText } from "#src/api/read-parameters.js";
23
25
 
24
26
  type PluginStatus = "active" | "pending";
25
27
 
@@ -30,7 +32,7 @@ interface PluginLifecycle {
30
32
  interface RegisteredPlugin {
31
33
  readonly lifecycle: PluginLifecycle;
32
34
  readonly plugin: ReadPlugin;
33
- readonly promptContributions: PromptDescriptionSource[];
35
+ readonly parameterDescriptions: ReadParameterDescriptions[];
34
36
 
35
37
  readonly promptGuidelines: PromptDescriptionSource[];
36
38
  readonly ready: Promise<void>;
@@ -46,7 +48,6 @@ export interface ReadCore {
46
48
  readonly read: ReadTool;
47
49
  registerPlugin(plugin: ReadPlugin): Promise<void>;
48
50
  waitForPendingPlugins(): Promise<void>;
49
- renderPluginPromptGuideline(): string | undefined;
50
51
  }
51
52
 
52
53
  export function createReadCore(
@@ -55,7 +56,11 @@ export function createReadCore(
55
56
  const outputReducers: ReadOutputReducer[] = [];
56
57
  const pendingPlugins = new Set<Promise<void>>();
57
58
  const plugins = new Map<string, RegisteredPlugin>();
58
- const read = createReadTool(() => renderPromptGuidelines(plugins), presentation);
59
+ const read = createReadTool(
60
+ () => renderPromptGuidelines(plugins),
61
+ presentation,
62
+ () => renderParameterDescriptions(plugins),
63
+ );
59
64
  let registrationQueue = Promise.resolve();
60
65
 
61
66
  return {
@@ -78,14 +83,14 @@ export function createReadCore(
78
83
  }
79
84
 
80
85
  const lifecycle: PluginLifecycle = { status: "pending" };
81
- const promptContributions: PromptDescriptionSource[] = [];
86
+ const parameterDescriptions: ReadParameterDescriptions[] = [];
82
87
 
83
88
  const promptGuidelines: PromptDescriptionSource[] = [];
84
89
  const contributions = createPluginContributionController(
85
90
  plugin.id,
86
91
  read,
87
92
  promptGuidelines,
88
- promptContributions,
93
+ parameterDescriptions,
89
94
  outputReducers,
90
95
  );
91
96
  const ready = registrationQueue.then(async () => {
@@ -103,7 +108,7 @@ export function createReadCore(
103
108
  lifecycle,
104
109
  plugin,
105
110
  promptGuidelines,
106
- promptContributions,
111
+ parameterDescriptions,
107
112
  ready,
108
113
  };
109
114
 
@@ -128,7 +133,6 @@ export function createReadCore(
128
133
 
129
134
  return ready;
130
135
  },
131
- renderPluginPromptGuideline: () => renderPluginPromptGuideline(plugins),
132
136
  async waitForPendingPlugins(): Promise<void> {
133
137
  await Promise.all(pendingPlugins);
134
138
  },
@@ -159,11 +163,11 @@ function createPluginContributionController(
159
163
  pluginId: string,
160
164
  read: ReadTool,
161
165
  promptGuidelines: PromptDescriptionSource[],
162
- promptContributions: PromptDescriptionSource[],
166
+ parameterDescriptions: ReadParameterDescriptions[],
163
167
  outputReducers: ReadOutputReducer[],
164
168
  ): PluginContributionController {
165
169
  const setupOutputReducers: ReadOutputReducer[] = [];
166
- const setupPromptContributions: PromptDescriptionSource[] = [];
170
+ const setupParameterDescriptions: ReadParameterDescriptions[] = [];
167
171
 
168
172
  const setupPromptGuidelines: PromptDescriptionSource[] = [];
169
173
  const setupResourceGuards: ReadResourceGuardRegistration[] = [];
@@ -273,18 +277,18 @@ function createPluginContributionController(
273
277
  describe(description): void {
274
278
  assertAvailable();
275
279
 
276
- if (setupPromptContributions.length > 0 || promptContributions.length > 0) {
280
+ if (setupParameterDescriptions.length > 0 || parameterDescriptions.length > 0) {
277
281
  throw new Error(`Plugin ${pluginId} provides more than one description`);
278
282
  }
279
283
 
280
- const normalized = normalizeDescriptionSource(description);
284
+ const normalized = normalizeParameterDescriptions(description);
281
285
 
282
286
  if (state === "setup") {
283
- setupPromptContributions.push(normalized);
287
+ setupParameterDescriptions.push(normalized);
284
288
  return;
285
289
  }
286
290
 
287
- promptContributions.push(normalized);
291
+ parameterDescriptions.push(normalized);
288
292
  },
289
293
 
290
294
  addPromptGuideline(guideline): void {
@@ -318,7 +322,7 @@ function createPluginContributionController(
318
322
  views: setupViews,
319
323
  fragments: setupFragmentResolvers,
320
324
  });
321
- promptContributions.push(...setupPromptContributions);
325
+ parameterDescriptions.push(...setupParameterDescriptions);
322
326
  outputReducers.push(...setupOutputReducers);
323
327
 
324
328
  promptGuidelines.push(...setupPromptGuidelines);
@@ -346,32 +350,43 @@ function renderPromptGuidelines(plugins: ReadonlyMap<string, RegisteredPlugin>):
346
350
  return guidelines;
347
351
  }
348
352
 
349
- function renderPluginPromptGuideline(
353
+ function renderParameterDescriptions(
350
354
  plugins: ReadonlyMap<string, RegisteredPlugin>,
351
- ): string | undefined {
352
- const entries: string[] = [];
353
-
354
- for (const registeredPlugin of plugins.values()) {
355
- if (registeredPlugin.lifecycle.status !== "active") {
356
- continue;
357
- }
358
-
359
- const source = registeredPlugin.promptContributions[0];
360
-
361
- if (source === undefined) {
362
- continue;
355
+ ): ReadParameterText {
356
+ const entries: Partial<Record<keyof ReadParameterDescriptions, string[]>> = {};
357
+ for (const plugin of plugins.values()) {
358
+ if (plugin.lifecycle.status !== "active") continue;
359
+ for (const descriptions of plugin.parameterDescriptions) {
360
+ for (const parameter of Object.keys(descriptions) as (keyof ReadParameterDescriptions)[]) {
361
+ const source = descriptions[parameter];
362
+ if (source === undefined) continue;
363
+ const description = renderDescriptionSource(source);
364
+ if (description !== undefined) (entries[parameter] ??= []).push(description);
365
+ }
363
366
  }
367
+ }
368
+ return Object.fromEntries(
369
+ Object.entries(entries).map(([parameter, descriptions]) => [
370
+ parameter,
371
+ [...new Set(descriptions)].join("\n"),
372
+ ]),
373
+ );
374
+ }
364
375
 
365
- const description = renderDescriptionSource(source);
366
-
367
- if (description !== undefined) {
368
- entries.push(description);
376
+ function normalizeParameterDescriptions(value: unknown): ReadParameterDescriptions {
377
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
378
+ throw new TypeError("Read plugin parameter descriptions must be an object");
379
+ }
380
+ const entries = Object.entries(value);
381
+ if (entries.length === 0) throw new Error("Read plugin parameter descriptions are empty");
382
+ const normalized: Partial<Record<keyof ReadParameterDescriptions, PromptDescriptionSource>> = {};
383
+ for (const [parameter, source] of entries) {
384
+ if (!Object.hasOwn(readParameters.properties, parameter)) {
385
+ throw new Error(`Read plugin description names an unknown parameter: ${parameter}`);
369
386
  }
387
+ normalized[parameter as keyof ReadParameterDescriptions] = normalizeDescriptionSource(source);
370
388
  }
371
-
372
- return entries.length === 0
373
- ? undefined
374
- : [...new Set(entries.flatMap((entry) => entry.split("\n")))].join("\n");
389
+ return normalized;
375
390
  }
376
391
 
377
392
  function normalizeDescriptionSource(value: unknown): PromptDescriptionSource {
@@ -53,7 +53,7 @@ const bytes = Type.Object(
53
53
  const block = Type.Union([
54
54
  Type.Object({ type: Type.Literal("text"), text: Type.String() }, { additionalProperties: false }),
55
55
  Type.Object(
56
- { type: Type.Literal("image"), data: Type.String(), mimeType: Type.String() },
56
+ { type: Type.Literal("image"), mimeType: Type.String() },
57
57
  { additionalProperties: false },
58
58
  ),
59
59
  ]);
@@ -127,6 +127,7 @@ function publicData(value: ReadScriptData): unknown {
127
127
  : {}),
128
128
  };
129
129
  }
130
+ // Image bytes belong to native content, not the composable result record.
130
131
  if (value.kind === "native")
131
132
  return {
132
133
  kind: value.kind,
@@ -134,8 +135,7 @@ function publicData(value: ReadScriptData): unknown {
134
135
  truncated: false,
135
136
  blocks: value.blocks.map((block) => {
136
137
  if (block.type === "text") return { type: block.type, text: block.text };
137
- if (block.type === "image")
138
- return { type: block.type, data: block.data, mimeType: block.mimeType };
138
+ if (block.type === "image") return { type: block.type, mimeType: block.mimeType };
139
139
  throw new TypeError("Custom content requires a structured adapter");
140
140
  }),
141
141
  };
@@ -56,7 +56,11 @@ import {
56
56
  } from "#src/core/tools/read/read-result.js";
57
57
  import { TempResourceStore } from "#src/core/tools/read/temp-resource-store.js";
58
58
 
59
- import { readParameters } from "#src/api/read-parameters.js";
59
+ import {
60
+ type readParameters,
61
+ describeReadParameters,
62
+ type ReadParameterText,
63
+ } from "#src/api/read-parameters.js";
60
64
  import { readRaw } from "#src/core/tools/read/raw-read.js";
61
65
  import { readOutputSchema, structuredRead } from "./read/structured-result.js";
62
66
 
@@ -126,6 +130,7 @@ export interface ReadTool {
126
130
  export function createReadTool(
127
131
  pluginPromptGuidelines?: () => readonly string[],
128
132
  presentation: "full" | "compact" | "disabled" = "compact",
133
+ parameterDescriptions?: () => ReadParameterText,
129
134
  ): ReadTool {
130
135
  const temporaryResources = new TempResourceStore();
131
136
  const resolvers: RegisteredResolver[] = [
@@ -172,7 +177,9 @@ export function createReadTool(
172
177
  ...(pluginPromptGuidelines?.() ?? []),
173
178
  ];
174
179
  },
175
- parameters: readParameters,
180
+ get parameters() {
181
+ return describeReadParameters(parameterDescriptions?.() ?? {});
182
+ },
176
183
  outputSchema: readOutputSchema,
177
184
  renderCall(arguments_, theme, context) {
178
185
  const source = typeof arguments_.path === "string" ? arguments_.path : undefined;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-search",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -20,10 +20,10 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "pi-agent-documentation": "0.7.0",
24
- "pi-agent-resource": "0.7.0",
25
- "pi-agent-tool-call-interception": "0.7.0",
26
- "pi-agent-tool-ui": "0.7.0"
23
+ "pi-agent-documentation": "0.7.1",
24
+ "pi-agent-resource": "0.7.1",
25
+ "pi-agent-tool-call-interception": "0.7.1",
26
+ "pi-agent-tool-ui": "0.7.1"
27
27
  },
28
28
  "pi": {
29
29
  "extensions": [
@@ -108,7 +108,7 @@ export default async function registerTextSearch(pi: ExtensionAPI): Promise<void
108
108
  api.describe(
109
109
  [
110
110
  "Local queries try literal terms first, then unquoted terms as regex when no literal results exist, then separate words for ordinary multi-word queries. Quoted terms stay literal. Boolean conditions stay intact across fallback. Uppercase AND/OR, infix NOT, ||, and space-separated | are Boolean operators; unspaced | and regex groups/classes belong to regex terms. Parentheses containing Boolean operators group Boolean conditions. regex:<pattern> forces regex-only matching; files:<pattern> searches file paths: glob patterns use *, **, ?, character classes and braces; other queries use case-insensitive subsequence matching. Slash-containing globs match cwd-relative paths; basename globs match at any depth.",
111
- "After a complete zero result, a single unquoted ASCII identifier may produce separate possible-name groups: naming-style changes, one leading/trailing component, then small typos. Each group reports a verified case-sensitive whole-identifier alternative in the same scope, its count/completeness, and Read references. Budget skips are explicit. A candidate all-reference refreshes that exact alternative, not the fuzzy ranking. Registered local candidate selections also expose strict snapshot targets. Structured result scopes stay exact and do not run this extra branch.",
111
+ "After a complete zero result, a single unquoted ASCII identifier may produce separate possible-name groups: naming-style changes, one leading/trailing component, then small typos. Each group reports a verified case-sensitive whole-identifier alternative in the same scope, its count/completeness, and Read references. Budget skips are explicit. A candidate all-reference refreshes that exact alternative, not the fuzzy ranking. Registered local candidate selections also expose strict snapshot targets. Result scopes stay exact and do not run this extra branch.",
112
112
  "The result says when a query was broadened. Empty or unknown prefixes are searched as plain text. A recognized prefixed query returns its own results or error; it does not silently become a text search.",
113
113
  "SEARCH#HASH:N:line selects one containing line; :match selects its exact match. :all:line selects all unique containing lines and :all:match selects all matches. Read returns containing lines for both forms. A SEARCH resource can be used as a read path or mutation path/anchor; omit the file path for an all-selection spanning files.",
114
114
  "Use SEARCH references exactly as returned to select the matching content. A single-result reference becomes stale when its file changes; obtain a fresh result before using it again. An :all reference refreshes the original query when a selected file changes. Search compacts noisy files when the detail limit is exceeded; narrow the query to that file to see individual matches. Compaction does not remove complete :all selections.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-search-text",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -24,12 +24,12 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "pi-agent-doctor": "0.7.0",
28
- "pi-agent-invariant": "0.7.0",
29
- "pi-agent-search": "0.7.0",
30
- "pi-agent-text": "0.7.0",
31
- "pi-agent-text-editor": "0.7.0",
32
- "pi-agent-tool-ui": "0.7.0"
27
+ "pi-agent-doctor": "0.7.1",
28
+ "pi-agent-invariant": "0.7.1",
29
+ "pi-agent-search": "0.7.1",
30
+ "pi-agent-text": "0.7.1",
31
+ "pi-agent-text-editor": "0.7.1",
32
+ "pi-agent-tool-ui": "0.7.1"
33
33
  },
34
34
  "pi": {
35
35
  "extensions": [
@@ -12,7 +12,7 @@ export const searchSchema = Type.Object(
12
12
  path: Type.Optional({
13
13
  ...resultInputSchema,
14
14
  description:
15
- "File, directory, URL, or a source-aware Read/Search/Select/mutation result with a live target, RESULT# reference, or array of returned targets. Result scopes search only their exact ranges unless symbols: navigation explicitly follows external references; plain preview text is not a source.",
15
+ "File, directory, URL, unchanged Read/Search/Select/edit result, its UUID, or an array of such results. Results select only their registered ranges unless symbols: navigation follows external references.",
16
16
  }),
17
17
  navigation: Type.Optional(
18
18
  Type.Literal("references", {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-text-editor",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
@@ -79,14 +79,14 @@
79
79
  "fs-extra": "^11.4.0",
80
80
  "oxfmt": "0.64.0",
81
81
  "partial-json": "^0.1.7",
82
- "pi-agent-documentation": "0.7.0",
83
- "pi-agent-invariant": "0.7.0",
84
- "pi-agent-read": "0.7.0",
85
- "pi-agent-resource": "0.7.0",
86
- "pi-agent-search": "0.7.0",
87
- "pi-agent-text": "0.7.0",
88
- "pi-agent-tool-call-interception": "0.7.0",
89
- "pi-agent-tool-ui": "0.7.0",
82
+ "pi-agent-documentation": "0.7.1",
83
+ "pi-agent-invariant": "0.7.1",
84
+ "pi-agent-read": "0.7.1",
85
+ "pi-agent-resource": "0.7.1",
86
+ "pi-agent-search": "0.7.1",
87
+ "pi-agent-text": "0.7.1",
88
+ "pi-agent-tool-call-interception": "0.7.1",
89
+ "pi-agent-tool-ui": "0.7.1",
90
90
  "typebox-guard": "npm:typebox@^1.1.38"
91
91
  },
92
92
  "pi": {
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pi-agent-text-anchor-constant",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#src/*": "./src/*"
7
7
  },
8
8
  "dependencies": {
9
- "pi-agent-text": "0.7.0",
10
- "pi-agent-text-editor": "0.7.0"
9
+ "pi-agent-text": "0.7.1",
10
+ "pi-agent-text-editor": "0.7.1"
11
11
  },
12
12
  "pi": {
13
13
  "extensions": [