pi-agent-ide 0.6.2 → 0.6.3
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/entry-77.js +61 -52
- package/docs/agent-guides/apply.md +1 -1
- package/docs/agent-guides/editing.md +4 -0
- 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/package.json +6 -6
- package/node_modules/pi-agent-filesystem-image/package.json +3 -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 +10 -10
- package/node_modules/pi-agent-ide-changes/package.json +7 -7
- 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/package.json +9 -9
- 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-resource/package.json +1 -1
- package/node_modules/pi-agent-search/package.json +4 -4
- package/node_modules/pi-agent-search-text/package.json +6 -6
- 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/package.json +3 -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/core/apply/prompt.ts +1 -1
- package/node_modules/pi-agent-text-editor/src/core/apply/runtime.ts +20 -11
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +52 -11
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +24 -3
- 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-ui/package.json +1 -1
- package/node_modules/pi-agent-web/package.json +6 -6
- 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/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +6 -6
- 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/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/package.json +6 -6
- 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-search/package.json +4 -4
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +6 -6
- 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/package.json +3 -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/core/apply/prompt.ts +1 -1
- package/src/extensions/pi-agent-text-editor/src/core/apply/runtime.ts +20 -11
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +52 -11
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +24 -3
- package/src/plugins/pi-agent-ide-ast/package.json +10 -10
- package/src/plugins/pi-agent-ide-changes/package.json +7 -7
- 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/package.json +9 -9
|
@@ -204,7 +204,7 @@ Use them to insert text immediately before each selected range.
|
|
|
204
204
|
insertBefore(file.linesOf(file.find("function run")), "// Entry point\n");
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
Effect: keeps the selected text and inserts before it. For linewise selections, Apply supplies the needed line boundary.
|
|
207
|
+
Effect: keeps the selected text and inserts before it. For linewise selections, Apply supplies the needed line boundary. Pass `{ separation: "blank-line" }` as a third argument to add only missing blank lines around a separate block; the default is `"line"`. An empty insert is rejected.
|
|
208
208
|
|
|
209
209
|
### `insertAfter(selection, text)` and `file.insertAfter(target, text)`
|
|
210
210
|
|
|
@@ -23,6 +23,10 @@ With an `end` selector, the operation covers complete lines from the first line
|
|
|
23
23
|
|
|
24
24
|
Selections are revision-sensitive. Re-read after a mutation before reusing a single-file line, scope, or search anchor. Complete `SEARCH#...:all` selections can refresh their original query.
|
|
25
25
|
|
|
26
|
+
## Choosing line separation
|
|
27
|
+
|
|
28
|
+
Use `separation: "blank-line"` for a separate paragraph or section; use the default line mode for adjacent code lines, list items, or a continuation of the current block. For example, inserting `X` after `A` in `A\nB` with blank-line separation produces `A\n\nX\n\nB`. In Apply, pass `{ separation: "blank-line" }` as the third argument to a linewise `insertAfter` or `insertBefore`.
|
|
29
|
+
|
|
26
30
|
## Standalone mutation behavior
|
|
27
31
|
|
|
28
32
|
Batch independent mutations as separate tool calls in one assistant response. Every call in that batch is evaluated against the original file contents. Combine overlapping changes into one mutation. A rejected call does not cancel successful independent calls; retry only what was not applied.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.6.
|
|
10
|
-
"pi-agent-read": "0.6.
|
|
11
|
-
"pi-agent-resource": "0.6.
|
|
12
|
-
"pi-agent-text": "0.6.
|
|
13
|
-
"pi-agent-text-editor": "0.6.
|
|
9
|
+
"pi-agent-image": "0.6.3",
|
|
10
|
+
"pi-agent-read": "0.6.3",
|
|
11
|
+
"pi-agent-resource": "0.6.3",
|
|
12
|
+
"pi-agent-text": "0.6.3",
|
|
13
|
+
"pi-agent-text-editor": "0.6.3"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-image",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.6.
|
|
10
|
-
"pi-agent-resource": "0.6.
|
|
9
|
+
"pi-agent-image": "0.6.3",
|
|
10
|
+
"pi-agent-resource": "0.6.3"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-jq",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"cross-spawn": "^7.0.6",
|
|
10
|
-
"pi-agent-doctor": "0.6.
|
|
11
|
-
"pi-agent-documentation": "0.6.
|
|
12
|
-
"pi-agent-read": "0.6.
|
|
13
|
-
"pi-agent-text": "0.6.
|
|
10
|
+
"pi-agent-doctor": "0.6.3",
|
|
11
|
+
"pi-agent-documentation": "0.6.3",
|
|
12
|
+
"pi-agent-read": "0.6.3",
|
|
13
|
+
"pi-agent-text": "0.6.3"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-pdf",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.6.
|
|
7
|
-
"pi-agent-resource": "0.6.
|
|
6
|
+
"pi-agent-pdf": "0.6.3",
|
|
7
|
+
"pi-agent-resource": "0.6.3"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-resource": "0.6.
|
|
10
|
-
"pi-agent-text": "0.6.
|
|
9
|
+
"pi-agent-resource": "0.6.3",
|
|
10
|
+
"pi-agent-text": "0.6.3"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-ast",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
|
|
32
32
|
"@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
|
|
33
33
|
"cross-spawn": "^7.0.6",
|
|
34
|
-
"pi-agent-doctor": "0.6.
|
|
35
|
-
"pi-agent-invariant": "0.6.
|
|
36
|
-
"pi-agent-read": "0.6.
|
|
37
|
-
"pi-agent-resource": "0.6.
|
|
38
|
-
"pi-agent-search": "0.6.
|
|
39
|
-
"pi-agent-search-text": "0.6.
|
|
40
|
-
"pi-agent-text": "0.6.
|
|
41
|
-
"pi-agent-text-editor": "0.6.
|
|
34
|
+
"pi-agent-doctor": "0.6.3",
|
|
35
|
+
"pi-agent-invariant": "0.6.3",
|
|
36
|
+
"pi-agent-read": "0.6.3",
|
|
37
|
+
"pi-agent-resource": "0.6.3",
|
|
38
|
+
"pi-agent-search": "0.6.3",
|
|
39
|
+
"pi-agent-search-text": "0.6.3",
|
|
40
|
+
"pi-agent-text": "0.6.3",
|
|
41
|
+
"pi-agent-text-editor": "0.6.3",
|
|
42
42
|
"tree-sitter-cpp": "^0.23.4",
|
|
43
43
|
"tree-sitter-javascript": "^0.25.0",
|
|
44
44
|
"tree-sitter-json": "^0.24.8",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@earendil-works/pi-coding-agent": "*",
|
|
57
|
-
"pi-agent-ide": "0.6.
|
|
57
|
+
"pi-agent-ide": "0.6.3"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"pi-agent-ide": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-changes",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"diff": "^9.0.0",
|
|
16
|
-
"pi-agent-doctor": "0.6.
|
|
17
|
-
"pi-agent-documentation": "0.6.
|
|
18
|
-
"pi-agent-invariant": "0.6.
|
|
19
|
-
"pi-agent-read": "0.6.
|
|
20
|
-
"pi-agent-text": "0.6.
|
|
21
|
-
"pi-agent-text-editor": "0.6.
|
|
16
|
+
"pi-agent-doctor": "0.6.3",
|
|
17
|
+
"pi-agent-documentation": "0.6.3",
|
|
18
|
+
"pi-agent-invariant": "0.6.3",
|
|
19
|
+
"pi-agent-read": "0.6.3",
|
|
20
|
+
"pi-agent-text": "0.6.3",
|
|
21
|
+
"pi-agent-text-editor": "0.6.3"
|
|
22
22
|
},
|
|
23
23
|
"pi": {
|
|
24
24
|
"extensions": [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-formatter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.3"
|
|
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.6.
|
|
15
|
+
"pi-agent-ide": "0.6.3"
|
|
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.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-doctor": "0.6.
|
|
7
|
-
"pi-agent-invariant": "0.6.
|
|
8
|
-
"pi-agent-read": "0.6.
|
|
9
|
-
"pi-agent-resource": "0.6.
|
|
10
|
-
"pi-agent-text": "0.6.
|
|
6
|
+
"pi-agent-doctor": "0.6.3",
|
|
7
|
+
"pi-agent-invariant": "0.6.3",
|
|
8
|
+
"pi-agent-read": "0.6.3",
|
|
9
|
+
"pi-agent-resource": "0.6.3",
|
|
10
|
+
"pi-agent-text": "0.6.3"
|
|
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.6.
|
|
19
|
+
"pi-agent-ide": "0.6.3"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"pi-agent-ide": {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-lsp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"cross-spawn": "^7.0.6",
|
|
7
|
-
"pi-agent-doctor": "0.6.
|
|
8
|
-
"pi-agent-invariant": "0.6.
|
|
9
|
-
"pi-agent-read": "0.6.
|
|
10
|
-
"pi-agent-resource": "0.6.
|
|
11
|
-
"pi-agent-search": "0.6.
|
|
12
|
-
"pi-agent-text": "0.6.
|
|
13
|
-
"pi-agent-text-editor": "0.6.
|
|
7
|
+
"pi-agent-doctor": "0.6.3",
|
|
8
|
+
"pi-agent-invariant": "0.6.3",
|
|
9
|
+
"pi-agent-read": "0.6.3",
|
|
10
|
+
"pi-agent-resource": "0.6.3",
|
|
11
|
+
"pi-agent-search": "0.6.3",
|
|
12
|
+
"pi-agent-text": "0.6.3",
|
|
13
|
+
"pi-agent-text-editor": "0.6.3",
|
|
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.6.
|
|
24
|
+
"pi-agent-ide": "0.6.3"
|
|
25
25
|
},
|
|
26
26
|
"peerDependenciesMeta": {
|
|
27
27
|
"pi-agent-ide": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-image",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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.6.
|
|
13
|
+
"pi-agent-resource": "0.6.3"
|
|
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.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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.6.
|
|
14
|
+
"pi-agent-resource": "0.6.3"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-read",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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.6.
|
|
28
|
-
"pi-agent-invariant": "0.6.
|
|
29
|
-
"pi-agent-resource": "0.6.
|
|
30
|
-
"pi-agent-text": "0.6.
|
|
31
|
-
"pi-agent-tool-call-interception": "0.6.
|
|
32
|
-
"pi-agent-tool-ui": "0.6.
|
|
27
|
+
"pi-agent-documentation": "0.6.3",
|
|
28
|
+
"pi-agent-invariant": "0.6.3",
|
|
29
|
+
"pi-agent-resource": "0.6.3",
|
|
30
|
+
"pi-agent-text": "0.6.3",
|
|
31
|
+
"pi-agent-tool-call-interception": "0.6.3",
|
|
32
|
+
"pi-agent-tool-ui": "0.6.3"
|
|
33
33
|
},
|
|
34
34
|
"pi": {
|
|
35
35
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"pi-agent-documentation": "0.6.
|
|
24
|
-
"pi-agent-tool-call-interception": "0.6.
|
|
25
|
-
"pi-agent-tool-ui": "0.6.
|
|
23
|
+
"pi-agent-documentation": "0.6.3",
|
|
24
|
+
"pi-agent-tool-call-interception": "0.6.3",
|
|
25
|
+
"pi-agent-tool-ui": "0.6.3"
|
|
26
26
|
},
|
|
27
27
|
"pi": {
|
|
28
28
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-search-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"pi-agent-doctor": "0.6.
|
|
28
|
-
"pi-agent-invariant": "0.6.
|
|
29
|
-
"pi-agent-search": "0.6.
|
|
30
|
-
"pi-agent-text": "0.6.
|
|
31
|
-
"pi-agent-text-editor": "0.6.
|
|
27
|
+
"pi-agent-doctor": "0.6.3",
|
|
28
|
+
"pi-agent-invariant": "0.6.3",
|
|
29
|
+
"pi-agent-search": "0.6.3",
|
|
30
|
+
"pi-agent-text": "0.6.3",
|
|
31
|
+
"pi-agent-text-editor": "0.6.3"
|
|
32
32
|
},
|
|
33
33
|
"pi": {
|
|
34
34
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"imports": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"pi-agent-resource": "0.6.
|
|
16
|
+
"pi-agent-resource": "0.6.3"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"typebox": "*"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-text": "0.6.
|
|
10
|
-
"pi-agent-text-editor": "0.6.
|
|
9
|
+
"pi-agent-text": "0.6.3",
|
|
10
|
+
"pi-agent-text-editor": "0.6.3"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"fast-fuzzy": "1.12.0",
|
|
16
|
-
"pi-agent-text": "0.6.
|
|
17
|
-
"pi-agent-text-editor": "0.6.
|
|
16
|
+
"pi-agent-text": "0.6.3",
|
|
17
|
+
"pi-agent-text-editor": "0.6.3"
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
|
20
20
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-line-hash",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.6.
|
|
16
|
-
"pi-agent-read": "0.6.
|
|
17
|
-
"pi-agent-text": "0.6.
|
|
18
|
-
"pi-agent-text-editor": "0.6.
|
|
15
|
+
"pi-agent-invariant": "0.6.3",
|
|
16
|
+
"pi-agent-read": "0.6.3",
|
|
17
|
+
"pi-agent-text": "0.6.3",
|
|
18
|
+
"pi-agent-text-editor": "0.6.3"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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.6.
|
|
83
|
-
"pi-agent-invariant": "0.6.
|
|
84
|
-
"pi-agent-read": "0.6.
|
|
85
|
-
"pi-agent-resource": "0.6.
|
|
86
|
-
"pi-agent-search": "0.6.
|
|
87
|
-
"pi-agent-text": "0.6.
|
|
88
|
-
"pi-agent-tool-call-interception": "0.6.
|
|
89
|
-
"pi-agent-tool-ui": "0.6.
|
|
82
|
+
"pi-agent-documentation": "0.6.3",
|
|
83
|
+
"pi-agent-invariant": "0.6.3",
|
|
84
|
+
"pi-agent-read": "0.6.3",
|
|
85
|
+
"pi-agent-resource": "0.6.3",
|
|
86
|
+
"pi-agent-search": "0.6.3",
|
|
87
|
+
"pi-agent-text": "0.6.3",
|
|
88
|
+
"pi-agent-tool-call-interception": "0.6.3",
|
|
89
|
+
"pi-agent-tool-ui": "0.6.3",
|
|
90
90
|
"run": "2.1.4",
|
|
91
91
|
"typebox-guard": "npm:typebox@^1.1.38"
|
|
92
92
|
},
|
|
@@ -2,7 +2,7 @@ const editorGuide = `
|
|
|
2
2
|
Read-only helpers use the standalone-tool arguments: read({...}), search({...}), and diff({before, after}). Their results are recorded automatically.
|
|
3
3
|
|
|
4
4
|
Transactional helpers:
|
|
5
|
-
open(path | {path, views?}); file.find(text); file.select(searchMatch); file.between(start, end, {inside?, lines?}); file.line(first, last?); file.start(); file.end(); file.before(selection); file.after(selection); file.slice(selection, start?, end?); file.union(...selections); file.within(candidates, scopes); file.linesOf(selection); file.replace(selection, text); file.remove(selection); file.insertBefore(selection, text); file.insertAfter(selection, text); file.flush(); file.delete(); replace(selection, text); remove(selection); insertBefore(selection, text); insertAfter(selection, text); copy(source, destination); move(source, destination); createFile(path, content); deleteFile(path); copyFile(path, target, {overwrite?}); moveFile(path, target, {overwrite?}); flush().
|
|
5
|
+
open(path | {path, views?}); file.find(text); file.select(searchMatch); file.between(start, end, {inside?, lines?}); file.line(first, last?); file.start(); file.end(); file.before(selection); file.after(selection); file.slice(selection, start?, end?); file.union(...selections); file.within(candidates, scopes); file.linesOf(selection); file.replace(selection, text); file.remove(selection); file.insertBefore(selection, text, {separation?: "line" | "blank-line"}); file.insertAfter(selection, text, {separation?: "line" | "blank-line"}); file.flush(); file.delete(); replace(selection, text); remove(selection); insertBefore(selection, text, {separation?: "line" | "blank-line"}); insertAfter(selection, text, {separation?: "line" | "blank-line"}); copy(source, destination); move(source, destination); createFile(path, content); deleteFile(path); copyFile(path, target, {overwrite?}); moveFile(path, target, {overwrite?}); flush().
|
|
6
6
|
|
|
7
7
|
Selections are immutable and snapshot-bound. Use slice to select occurrences by position, union to combine non-overlapping sets, within to keep candidates contained by scopes, and linesOf to expand matches to whole lines. between accepts strings or SelectionSets as either boundary; {lines:true} expands through both containing lines. Prefer it for blocks identified by content; use line(first,last) only for exact verified line bounds. Use start/end or before/after as zero-width destinations when copy or move should insert instead of replace. Normal completion commits staged operations once; a thrown script commits none. flush() commits every staged operation; file.flush() commits only independent operations for that file while cross-file transfers stay pending. Successful checkpoints can return an APPLY# receipt. Failed operations report structured errors and do not silently guess a recovery.
|
|
8
8
|
`;
|
|
@@ -170,7 +170,9 @@ function guestBindings(enabledOperations: readonly ApplyOperation[]): string {
|
|
|
170
170
|
const resolved = invoke("editorResolve", {snapshot: {id: document.id, source: document.source, content: document.content}, query: target});
|
|
171
171
|
return selectionSet(document, resolved.selections, {kind: "exact", query: target, warning: resolved.warning});
|
|
172
172
|
};
|
|
173
|
-
const stage = (document, target, text, edge) => {
|
|
173
|
+
const stage = (document, target, text, edge, options = {}) => {
|
|
174
|
+
if (edge !== undefined && text.length === 0) throw new Error("Insert text must not be empty.");
|
|
175
|
+
if (options.separation !== undefined && options.separation !== "line" && options.separation !== "blank-line") throw new Error("Invalid separation mode.");
|
|
174
176
|
const selected = targetSet(document, target);
|
|
175
177
|
if (!Array.isArray(selected) || selected.document !== document.id) throw new Error("SelectionSet belongs to another file");
|
|
176
178
|
if (selected.generation !== document.generation) throw Object.assign(new Error("SelectionSet belongs to a stale snapshot"), {code:"STALE_SELECTION"});
|
|
@@ -179,10 +181,17 @@ function guestBindings(enabledOperations: readonly ApplyOperation[]): string {
|
|
|
179
181
|
const point = edge === "before" ? range.from : edge === "after" ? range.to : undefined;
|
|
180
182
|
let insert = text;
|
|
181
183
|
if (point !== undefined && range.linewise === true) {
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
const separator = document.content.includes("\\r\\n") ? "\\r\\n" : "\\n";
|
|
185
|
+
const before = document.content.slice(0, point);
|
|
186
|
+
const after = document.content.slice(point);
|
|
187
|
+
const prefix = edge === "after" && before.length > 0 && !before.endsWith("\\n") ? separator : "";
|
|
188
|
+
const following = after.length > 0;
|
|
189
|
+
insert = prefix + insert;
|
|
190
|
+
if (options.separation === "blank-line") {
|
|
191
|
+
if (before.length > 0 && !before.endsWith(separator + separator) && !insert.slice(prefix.length).startsWith(separator)) insert = separator + insert;
|
|
192
|
+
if (following && !insert.endsWith(separator + separator) && !after.startsWith(separator)) insert += insert.endsWith(separator) ? separator : separator + separator;
|
|
193
|
+
}
|
|
194
|
+
if (following && !insert.endsWith("\\n")) insert += separator;
|
|
186
195
|
}
|
|
187
196
|
operations.push({kind: "replace", selection: point === undefined ? range : selection(document, point, point), text: insert});
|
|
188
197
|
}
|
|
@@ -196,10 +205,10 @@ function guestBindings(enabledOperations: readonly ApplyOperation[]): string {
|
|
|
196
205
|
if (empty !== undefined) { operations.push({kind:"warning", document:empty.document, query:empty.provenance?.query, warning:empty.provenance?.warning}); return; }
|
|
197
206
|
operations.push({kind, sources:[...source], destinations:[...destination], text:source.map((item) => item.text).join("")});
|
|
198
207
|
};
|
|
199
|
-
const stageSet = (target, text, edge) => {
|
|
208
|
+
const stageSet = (target, text, edge, options) => {
|
|
200
209
|
const document = snapshots.get(target?.document);
|
|
201
210
|
if (document === undefined) throw selectionError("STALE_SELECTION", "SelectionSet belongs to a stale or unopened snapshot");
|
|
202
|
-
stage(document, target, text, edge);
|
|
211
|
+
stage(document, target, text, edge, options);
|
|
203
212
|
};
|
|
204
213
|
const refreshSnapshots = (value) => {
|
|
205
214
|
for (const refreshed of value?.snapshots ?? []) {
|
|
@@ -326,8 +335,8 @@ function guestBindings(enabledOperations: readonly ApplyOperation[]): string {
|
|
|
326
335
|
after: (set) => { assertCurrent(document); const selected = assertSet(document, set); return selectionSet(document, selected.map((item) => ({from: item.to, to: item.to, linewise: item.linewise === true})), {kind: "after", source: selected.provenance}); },
|
|
327
336
|
replace: (target, text) => { assertCurrent(document); stage(document, target, String(text)); },
|
|
328
337
|
remove: (target) => { assertCurrent(document); stage(document, target, ""); },
|
|
329
|
-
insertBefore: (target, text) => { assertCurrent(document); stage(document, target, String(text), "before"); },
|
|
330
|
-
insertAfter: (target, text) => { assertCurrent(document); stage(document, target, String(text), "after"); },
|
|
338
|
+
insertBefore: (target, text, options) => { assertCurrent(document); stage(document, target, String(text), "before", options); },
|
|
339
|
+
insertAfter: (target, text, options) => { assertCurrent(document); stage(document, target, String(text), "after", options); },
|
|
331
340
|
flush: () => flushDocument(document),
|
|
332
341
|
delete: () => { assertCurrent(document); operations.push({kind: "delete", path: document.source}); },
|
|
333
342
|
};
|
|
@@ -342,8 +351,8 @@ function guestBindings(enabledOperations: readonly ApplyOperation[]): string {
|
|
|
342
351
|
moveFile: (path, target, options = {}) => operations.push({kind: "move", path, target, overwrite: options.overwrite === true}),
|
|
343
352
|
replace: (target, text) => stageSet(target, String(text)),
|
|
344
353
|
remove: (target) => stageSet(target, ""),
|
|
345
|
-
insertBefore: (target, text) => stageSet(target, String(text), "before"),
|
|
346
|
-
insertAfter: (target, text) => stageSet(target, String(text), "after"),
|
|
354
|
+
insertBefore: (target, text, options) => stageSet(target, String(text), "before", options),
|
|
355
|
+
insertAfter: (target, text, options) => stageSet(target, String(text), "after", options),
|
|
347
356
|
copy: (source, destination) => stageTransfer("text-copy", source, destination),
|
|
348
357
|
move: (source, destination) => stageTransfer("text-move", source, destination),
|
|
349
358
|
flush: () => {
|