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.
- package/CHANGELOG.md +7 -0
- package/dist/chunk-2TRHFMCZ.js +11 -0
- package/dist/{chunk-FXNKMNSJ.js → chunk-4GCWGE2C.js} +1 -1
- package/dist/chunk-4XMY4H4V.js +1 -0
- package/dist/{chunk-3HYXQ4YA.js → chunk-76ZK5ODR.js} +2 -2
- package/dist/{chunk-6CZO43OH.js → chunk-BU7IZLKB.js} +1 -1
- package/dist/chunk-CWD4O5PM.js +3 -0
- package/dist/chunk-D3WTDA6V.js +2 -0
- package/dist/chunk-GXEGY7GV.js +1 -0
- package/dist/{chunk-GBLKIB6O.js → chunk-HZEY4GT4.js} +1 -1
- package/dist/{chunk-S5LXX32D.js → chunk-LEEQIQ7D.js} +6 -6
- package/dist/chunk-NRZO5KJT.js +9 -0
- package/dist/chunk-OMVRLWMX.js +5 -0
- package/dist/{chunk-KR36BT5E.js → chunk-PGIVHICI.js} +1 -1
- package/dist/{chunk-YRF7OATP.js → chunk-PKKDDIWW.js} +1 -1
- package/dist/{chunk-EDURPQAV.js → chunk-QRJLIV6P.js} +6 -6
- package/dist/{chunk-OBNING2A.js → chunk-S5PL5DFQ.js} +1 -1
- package/dist/chunk-VMTR74FF.js +2 -0
- package/dist/{chunk-PYPPV2F5.js → chunk-WMO6RNE2.js} +1 -1
- package/dist/{chunk-3JO7QFIL.js → chunk-WU6ZK6YD.js} +1 -1
- package/dist/{chunk-F5YZG77W.js → chunk-XH5WN5XA.js} +1 -1
- package/dist/{chunk-AJRIASPQ.js → chunk-YP46DVVP.js} +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-25.js +2 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +1 -1
- package/dist/entry-31.js +13 -12
- package/dist/entry-33.js +1 -1
- package/dist/entry-37.js +6 -6
- package/dist/entry-41.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +13 -14
- package/dist/entry-46.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +2 -2
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-56.js +1 -1
- package/dist/entry-57.js +1 -1
- package/dist/entry-58.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-77.js +33 -34
- package/dist/entry-78.js +1 -1
- package/dist/entry-79.js +1 -1
- package/dist/entry-80.js +1 -1
- package/dist/entry-82.js +2 -2
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -1
- package/dist/pi-agent-ide.js +14 -9
- package/docs/agent-guides/editing.md +35 -46
- package/docs/agent-guides/read-resources.md +5 -9
- package/docs/agent-guides/search-code.md +12 -17
- package/docs/agent-guides/select-code.md +61 -140
- package/docs/structured-results.md +27 -62
- package/docs/tools.md +6 -10
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/index.ts +7 -6
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem-image/package.json +3 -3
- package/node_modules/pi-agent-filesystem-jq/index.ts +4 -3
- package/node_modules/pi-agent-filesystem-jq/package.json +5 -5
- package/node_modules/pi-agent-filesystem-pdf/package.json +3 -3
- package/node_modules/pi-agent-filesystem-text/package.json +3 -3
- package/node_modules/pi-agent-ide-ast/package.json +13 -13
- package/node_modules/pi-agent-ide-ast/src/extension.ts +7 -4
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +35 -6
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/select-schema.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +18 -1
- package/node_modules/pi-agent-ide-changes/index.ts +4 -3
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-languages/package.json +2 -2
- package/node_modules/pi-agent-ide-lint/package.json +7 -7
- package/node_modules/pi-agent-ide-lsp/index.ts +3 -3
- package/node_modules/pi-agent-ide-lsp/package.json +9 -9
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +5 -1
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-invariant/package.json +1 -1
- package/node_modules/pi-agent-pdf/package.json +2 -2
- package/node_modules/pi-agent-read/package.json +7 -7
- package/node_modules/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/node_modules/pi-agent-read/src/api/tools/read.ts +7 -1
- package/node_modules/pi-agent-read/src/core/extension.ts +7 -1
- package/node_modules/pi-agent-read/src/core/read-core.ts +50 -35
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +9 -2
- package/node_modules/pi-agent-resource/package.json +1 -1
- package/node_modules/pi-agent-resource/src/result-targets.ts +183 -9
- package/node_modules/pi-agent-resource/src/tool-result.ts +13 -1
- package/node_modules/pi-agent-search/package.json +5 -5
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/node_modules/pi-agent-search-text/index.ts +1 -1
- package/node_modules/pi-agent-search-text/package.json +7 -7
- package/node_modules/pi-agent-text/package.json +2 -2
- package/node_modules/pi-agent-text-anchor-constant/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/index.ts +65 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +3 -3
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/node_modules/pi-agent-text-editor/package.json +9 -9
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +18 -11
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +43 -209
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +37 -31
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -7
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/node_modules/pi-agent-tool-call-interception/package.json +2 -2
- package/node_modules/pi-agent-tool-call-interception/src/index.ts +3 -0
- package/node_modules/pi-agent-tool-ui/package.json +1 -1
- package/node_modules/pi-agent-web/index.ts +4 -3
- package/node_modules/pi-agent-web/package.json +7 -7
- package/node_modules/pi-agent-web-html/package.json +2 -2
- package/node_modules/pi-agent-web-image/package.json +3 -3
- package/node_modules/pi-agent-web-pdf/package.json +3 -3
- package/node_modules/pi-agent-web-text/package.json +3 -3
- package/package.json +35 -35
- package/src/composite/text-results.ts +221 -0
- package/src/documentation/extension.ts +11 -9
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/index.ts +7 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +5 -5
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +4 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +7 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +2 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +3 -3
- package/src/extensions/pi-agent-read/package.json +7 -7
- package/src/extensions/pi-agent-read/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-read/src/api/read-parameters.ts +38 -1
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +7 -1
- package/src/extensions/pi-agent-read/src/core/extension.ts +7 -1
- package/src/extensions/pi-agent-read/src/core/read-core.ts +50 -35
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +3 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +9 -2
- package/src/extensions/pi-agent-search/package.json +5 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +1 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +7 -7
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +1 -1
- package/src/extensions/pi-agent-text-editor/package.json +9 -9
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +65 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +3 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +12 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +3 -1
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +10 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +3 -13
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +18 -11
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +43 -209
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +37 -31
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +2 -7
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +1 -1
- package/src/pi-agent-ide.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +7 -4
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +35 -6
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/select-schema.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +18 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +4 -3
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-debugger/index.ts +5 -3
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +5 -3
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-languages/package.json +2 -2
- package/src/plugins/pi-agent-ide-lint/package.json +7 -7
- package/src/plugins/pi-agent-ide-lsp/index.ts +3 -3
- package/src/plugins/pi-agent-ide-lsp/package.json +9 -9
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +5 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +8 -6
- package/src/plugins/pi-agent-ide-vision/index.ts +12 -4
- package/dist/chunk-4NIFBFFR.js +0 -11
- package/dist/chunk-7LZKOHH2.js +0 -1
- package/dist/chunk-FK42RSF4.js +0 -1
- package/dist/chunk-KBP3QUDT.js +0 -2
- package/dist/chunk-OE7QVAI2.js +0 -5
- package/dist/chunk-SILJ3OL4.js +0 -9
- package/dist/chunk-SQKAXYIR.js +0 -2
- package/dist/chunk-VCGNVTXQ.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.7.
|
|
17
|
-
"pi-agent-documentation": "0.7.
|
|
18
|
-
"pi-agent-invariant": "0.7.
|
|
19
|
-
"pi-agent-read": "0.7.
|
|
20
|
-
"pi-agent-resource": "0.7.
|
|
21
|
-
"pi-agent-text": "0.7.
|
|
22
|
-
"pi-agent-text-editor": "0.7.
|
|
16
|
+
"pi-agent-doctor": "0.7.1",
|
|
17
|
+
"pi-agent-documentation": "0.7.1",
|
|
18
|
+
"pi-agent-invariant": "0.7.1",
|
|
19
|
+
"pi-agent-read": "0.7.1",
|
|
20
|
+
"pi-agent-resource": "0.7.1",
|
|
21
|
+
"pi-agent-text": "0.7.1",
|
|
22
|
+
"pi-agent-text-editor": "0.7.1"
|
|
23
23
|
},
|
|
24
24
|
"pi": {
|
|
25
25
|
"extensions": [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.7.
|
|
6
|
+
"pi-agent-doctor": "0.7.1"
|
|
7
7
|
},
|
|
8
8
|
"pi": {
|
|
9
9
|
"extensions": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@earendil-works/pi-coding-agent": "*",
|
|
15
|
-
"pi-agent-ide": "0.7.
|
|
15
|
+
"pi-agent-ide": "0.7.1"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"pi-agent-ide": {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lint",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.7.
|
|
7
|
-
"pi-agent-invariant": "0.7.
|
|
8
|
-
"pi-agent-read": "0.7.
|
|
9
|
-
"pi-agent-resource": "0.7.
|
|
10
|
-
"pi-agent-text": "0.7.
|
|
6
|
+
"pi-agent-doctor": "0.7.1",
|
|
7
|
+
"pi-agent-invariant": "0.7.1",
|
|
8
|
+
"pi-agent-read": "0.7.1",
|
|
9
|
+
"pi-agent-resource": "0.7.1",
|
|
10
|
+
"pi-agent-text": "0.7.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@earendil-works/pi-coding-agent": "*",
|
|
19
|
-
"pi-agent-ide": "0.7.
|
|
19
|
+
"pi-agent-ide": "0.7.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|
|
@@ -112,9 +112,9 @@ export default async function registerLsp(pi: ExtensionAPI): Promise<void> {
|
|
|
112
112
|
when: { resolvedBy: "any", contentKind: "text" },
|
|
113
113
|
handler: createSourceMappedTextReadHandler(),
|
|
114
114
|
});
|
|
115
|
-
api.describe(
|
|
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
|
-
);
|
|
115
|
+
api.describe({
|
|
116
|
+
path: "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
|
+
});
|
|
118
118
|
},
|
|
119
119
|
} satisfies ReadPlugin;
|
|
120
120
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.7.
|
|
8
|
-
"pi-agent-invariant": "0.7.
|
|
9
|
-
"pi-agent-read": "0.7.
|
|
10
|
-
"pi-agent-resource": "0.7.
|
|
11
|
-
"pi-agent-search": "0.7.
|
|
12
|
-
"pi-agent-text": "0.7.
|
|
13
|
-
"pi-agent-text-editor": "0.7.
|
|
7
|
+
"pi-agent-doctor": "0.7.1",
|
|
8
|
+
"pi-agent-invariant": "0.7.1",
|
|
9
|
+
"pi-agent-read": "0.7.1",
|
|
10
|
+
"pi-agent-resource": "0.7.1",
|
|
11
|
+
"pi-agent-search": "0.7.1",
|
|
12
|
+
"pi-agent-text": "0.7.1",
|
|
13
|
+
"pi-agent-text-editor": "0.7.1",
|
|
14
14
|
"vscode-jsonrpc": "^9.0.0",
|
|
15
15
|
"vscode-uri": "^3.1.0"
|
|
16
16
|
},
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@earendil-works/pi-coding-agent": "*",
|
|
24
|
-
"pi-agent-ide": "0.7.
|
|
24
|
+
"pi-agent-ide": "0.7.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependenciesMeta": {
|
|
27
27
|
"pi-agent-ide": {
|
|
@@ -52,6 +52,7 @@ export function createLspSearchResolver(
|
|
|
52
52
|
payload: {
|
|
53
53
|
query,
|
|
54
54
|
hits: found.hits,
|
|
55
|
+
sessionId: session.id,
|
|
55
56
|
complete: found.complete,
|
|
56
57
|
navigation: request.navigation,
|
|
57
58
|
data: {
|
|
@@ -87,6 +88,7 @@ export function createLspSearchResolver(
|
|
|
87
88
|
format(payload, context) {
|
|
88
89
|
const result = payload as {
|
|
89
90
|
readonly query: string;
|
|
91
|
+
readonly sessionId: string;
|
|
90
92
|
readonly hits: readonly SymbolHit[];
|
|
91
93
|
readonly complete: boolean;
|
|
92
94
|
readonly navigation?: "references";
|
|
@@ -102,8 +104,10 @@ export function createLspSearchResolver(
|
|
|
102
104
|
.slice(0, 100)
|
|
103
105
|
.map(
|
|
104
106
|
(hit, index) =>
|
|
105
|
-
|
|
107
|
+
`SEARCH#${result.sessionId}:${index + 1}:match ${path.relative(context.cwd, hit.source)}:${hit.lineNumber}:${hit.startColumn + 1} ${hit.role} ${hit.symbol.name} · declared at ${path.relative(context.cwd, hit.symbol.source)}:${hit.symbol.range.startLine}:${hit.symbol.range.startColumn + 1}`,
|
|
106
108
|
);
|
|
109
|
+
if (result.complete && result.hits.length)
|
|
110
|
+
lines.unshift(`SEARCH#${result.sessionId}:all:match selects all exact symbol matches.`);
|
|
107
111
|
if (!result.complete) lines.push("Incomplete results; not a complete edit scope.");
|
|
108
112
|
if (result.hits.length > 100) lines.push("Preview shortened; full source targets retained.");
|
|
109
113
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-image",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pi-agent-resource": "0.7.
|
|
13
|
+
"pi-agent-resource": "0.7.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@earendil-works/pi-coding-agent": "*"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-pdf",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"pdfjs-dist": "^6.2.108",
|
|
14
|
-
"pi-agent-resource": "0.7.
|
|
14
|
+
"pi-agent-resource": "0.7.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-read",
|
|
3
|
-
"version": "0.7.
|
|
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.
|
|
28
|
-
"pi-agent-invariant": "0.7.
|
|
29
|
-
"pi-agent-resource": "0.7.
|
|
30
|
-
"pi-agent-text": "0.7.
|
|
31
|
-
"pi-agent-tool-call-interception": "0.7.
|
|
32
|
-
"pi-agent-tool-ui": "0.7.
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
166
|
+
parameterDescriptions: ReadParameterDescriptions[],
|
|
163
167
|
outputReducers: ReadOutputReducer[],
|
|
164
168
|
): PluginContributionController {
|
|
165
169
|
const setupOutputReducers: ReadOutputReducer[] = [];
|
|
166
|
-
const
|
|
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 (
|
|
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 =
|
|
284
|
+
const normalized = normalizeParameterDescriptions(description);
|
|
281
285
|
|
|
282
286
|
if (state === "setup") {
|
|
283
|
-
|
|
287
|
+
setupParameterDescriptions.push(normalized);
|
|
284
288
|
return;
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
|
|
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
|
-
|
|
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
|
|
353
|
+
function renderParameterDescriptions(
|
|
350
354
|
plugins: ReadonlyMap<string, RegisteredPlugin>,
|
|
351
|
-
):
|
|
352
|
-
const entries: string[] =
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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"),
|
|
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 {
|
|
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
|
|
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;
|