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,86 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Readable IDE results and private records
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
IDE tools expose readable text in direct calls and native Codemode. The existing Read views, Search anchors, edit effects and diffs remain the agent-facing output. Select shows its selected text and item references. Agents do not receive the private result records or need to inspect their fields.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Composition
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
{ status: "success", data: /* tool data */, errors: [] }
|
|
9
|
-
{ status: "error" | "partial", data?: /* observed data */, errors: [{ code, message, source? }] }
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
`success` means the requested operation completed, including a search with no matches. `partial` means some work completed while other work failed. Output clipping is reported separately; it does not make a successful read an execution failure. `error` and `partial` set native `isError`.
|
|
13
|
-
|
|
14
|
-
Check `status` before using data. Domain errors with structured results resolve in native Codemode; they do not automatically throw. Invalid arguments, blocked calls, and cancellation can still reject. A mutation error does not imply rollback. Check its observed effects before retrying.
|
|
15
|
-
|
|
16
|
-
## Data by tool
|
|
17
|
-
|
|
18
|
-
- **Read:** `kind` is `text`, `bytes`, `native`, or `resources`. Text has original numbered `lines`, line endings, optional editable `anchors`, and source-level `references`. Bytes have exact `bytes: number[]`, byte offset, selected length, and total size. Native content has ordered text/image `blocks`; pass an image block to `image(...)`. Multi-source selections keep separate child resources.
|
|
19
|
-
- **Search:** `matches` have a source, exact line/column range, optional matched text, and optional `references.line` / `references.match` selectors. Columns are zero-based UTF-16 offsets. `complete` describes the backend search; `truncated` describes the public window. `all` selectors exist only for complete registered selections. File searches return paths. Other resolvers return their documented JSON domain data under `kind: "custom"`.
|
|
20
|
-
- **Mutations:** `operationId` identifies the call. `effect` and per-source `files` distinguish `pending`, `applied`, `not-applied`, and `unknown`. Recovery candidates and semantic action fields are included when available. `files[].state` reports present/absent/unknown when known. `changes` records exact removed/inserted text and before-snapshot UTF-16 offsets; it is inspection data, not a selector. If that record exceeds 512 KiB serialized, it is omitted with `changesUnavailable`, without clipping text or losing applied effects. Full before/after documents are not copied into receipts.
|
|
21
|
-
- **Flush:** `operations` link final effects and errors to accepted child call IDs. It also returns per-source effects. An empty flush succeeds with no operations. A failed flush retains writes that happened and never replays accepted edits.
|
|
22
|
-
- **Diff:** returns source identities, equality, added/removed counts, and bounded unified diff text. It does not repeat both source documents.
|
|
23
|
-
- **Git index tools:** return action, change selector, file, index state, observed effect, and whether it was already in the requested state.
|
|
24
|
-
- **Debugger:** creation returns session, source, and breakpoint resource references plus configuration and status. Debugger mutation actions return selected breakpoint or evaluation fields, not full session snapshots.
|
|
25
|
-
|
|
26
|
-
## Source result composition
|
|
27
|
-
|
|
28
|
-
Exact filesystem text Read results and local text/regex, AST, and LSP Search results expose an optional `target: "RESULT#..."`. Each public Search match also has its own target. These handles resolve backend-owned source ranges and snapshots; serializable preview fields do not grant or change write authority.
|
|
29
|
-
|
|
30
|
-
Native `search.path`, `replace.path`, `delete.path`, and copy/move `path` / `target` accept a successful result envelope, its data, a target handle, or arrays of compatible results/matches. `write.path` and `undo.file` accept only a single whole-file target; partial scopes never widen to a whole file. A whole result retains its complete stored scope even when its public window is shortened. Pass a matches array to narrow the scope explicitly. Read lines projected to strings or arbitrary coordinates are not editable targets.
|
|
7
|
+
Each result starts with a labelled system-result envelope containing a random UUID. It is not part of a file and must not be edited or inserted into file contents.
|
|
31
8
|
|
|
32
9
|
```js
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const changed = await tools.replace({ path: found.data.matches.slice(0, 1), text: "new" });
|
|
38
|
-
if (changed.status !== "success") throw new Error(JSON.stringify(changed.errors));
|
|
39
|
-
text(changed);
|
|
10
|
+
const source = await tools.read({ path: "notes.txt" });
|
|
11
|
+
const matches = await tools.search({ path: source, query: "old" });
|
|
12
|
+
const selected = await tools.select({ path: matches, operation: { kind: "trim", side: "both" } });
|
|
13
|
+
text(await tools.replace({ path: selected, text: "new" }));
|
|
40
14
|
```
|
|
41
15
|
|
|
42
|
-
|
|
16
|
+
Pass the unchanged result to a supported source parameter. Direct calls also accept its UUID. Store/load retains the result string across scripts in the same session. Displayed item and capture references allow narrower selections without inspecting private arrays.
|
|
43
17
|
|
|
44
|
-
|
|
18
|
+
A result identifies its backend-owned ranges, not the text in its preview. Shortened output does not clip a complete selection or make an incomplete selection complete. Read around a selection may show context without granting authority to edit it.
|
|
45
19
|
|
|
46
|
-
|
|
20
|
+
## Reference ownership
|
|
47
21
|
|
|
48
|
-
|
|
22
|
+
The session registry issues UUIDs and maps them to source handles. A guessed or computed hash has no authority unless the registry issued that reference. UUIDs are opaque references, not content hashes or signatures.
|
|
49
23
|
|
|
50
|
-
|
|
24
|
+
The registry validates session/worktree ownership, exact full-output identity, successful source status and live snapshots. Copying a valid ID within its session is intentional reuse, not forgery. Altering the body while keeping the envelope is rejected. An ID cannot grant wider ranges than its original selection.
|
|
51
25
|
|
|
52
|
-
|
|
26
|
+
Changed files permanently retire old source and derived references. Restoring the old bytes does not revive them. Actual edit completions and script boundaries observe filesystem generations; retained source bytes are verified before use. Reload and session changes clear the registry.
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
Pending edits reserve source handles without granting authority to unconfirmed writes. A dependent source operation commits the batch before using such a handle. Failed or cancelled edits cannot confirm it. Independent peer edits retain their original snapshots until the common commit.
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
const found = await tools.search({ query: "old", path: "note.txt" });
|
|
60
|
-
if (found.status !== "success") throw new Error(found.errors[0].message);
|
|
61
|
-
const changed = await tools.replace({ path: found.data.matches[0].references.match, text: "new" });
|
|
62
|
-
if (changed.status !== "success") throw new Error(changed.errors[0].message);
|
|
63
|
-
const saved = await tools.flush({});
|
|
64
|
-
text(saved);
|
|
65
|
-
```
|
|
30
|
+
Read-only views, raw bytes, images and directory listings do not acquire text-edit authority. Their IDs can identify the resource for another read. Live shell/debugger references can be used only with their owning resource operations. File deletion supplies no reusable text selection.
|
|
66
31
|
|
|
67
|
-
|
|
32
|
+
## Internal records
|
|
68
33
|
|
|
69
|
-
|
|
34
|
+
Each tool owns its validated record. Read, Search, Select, Diff, terminals, Git and debugger operations keep their own domain adapters. File edit receipts contain only operation, observed effect, file states and an optional verified selection handle. Delete omits selection fields. Flush separately records committed operation effects and errors; it does not reuse a giant resource-action schema.
|
|
70
35
|
|
|
71
|
-
|
|
36
|
+
The text registry stores only ownership, a digest of the issued text, source references, resource identities and whether the result can be consumed. It does not copy line arrays, removed file contents, image bytes or debugger records into a second ledger. Source ranges and snapshots remain in the source-target store.
|
|
72
37
|
|
|
73
|
-
|
|
38
|
+
The unified registration adapter omits public outputSchema. Pi's supported Codemode execution path therefore returns each tool's existing text instead of structuredContent. Public tool_result hooks register the private source metadata and return the readable text with its envelope. This does not modify Pi, rewrite scripts, add VM methods, or recognize JSON in Codemode output.
|
|
74
39
|
|
|
75
|
-
|
|
76
|
-
|
|
40
|
+
Nested image blocks are delivered on the parent Codemode result; their bytes are not printed as text. Images remain ordinary native image content.
|
|
41
|
+
Read's private native record contains image type and MIME metadata, not another copy of the image bytes. Large images therefore do not overflow the JSON-record budget while their native content stays unchanged.
|
|
77
42
|
|
|
78
|
-
##
|
|
43
|
+
## Errors and writes
|
|
79
44
|
|
|
80
|
-
|
|
45
|
+
Failed tools reject in Codemode. Use try/catch or Promise.allSettled when independent calls may fail. Inspect the readable file/operation effects and final parent result before retrying. An error does not prove rollback.
|
|
81
46
|
|
|
82
|
-
|
|
47
|
+
Flush commits writes, not final formatting. Final post-edit processing can retire earlier snapshots. Ordinary script errors keep accepted edits; abort/deadline discards pending writes, not already committed batches.
|
|
83
48
|
|
|
84
|
-
|
|
49
|
+
After an exact-text selector fails, the tool returns current anchors and blocks further exact-text edits for that file. Use a current anchor for the next successful edit. Exact text is then available again.
|
|
85
50
|
|
|
86
|
-
|
|
51
|
+
See [editing](./agent-guides/editing.md), [Read](./agent-guides/read-resources.md) and [Select](./agent-guides/select-code.md) for their source and boundary contracts.
|
package/docs/tools.md
CHANGED
|
@@ -4,9 +4,9 @@ Pi Agent IDE explores a small tool surface for coding agents. The goal is to kee
|
|
|
4
4
|
|
|
5
5
|
The project is experimental. The behavior below describes the current implementation, not a performance guarantee.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Readable results and composition
|
|
8
8
|
|
|
9
|
-
IDE tools
|
|
9
|
+
IDE tools return readable text in direct calls and Codemode. A leading system-result envelope carries a registered UUID; it is not file content. Pass the unchanged result to another source parameter, or use its UUID in a direct call. The system resolves the private source records. Check the readable file effects before retrying failed edits. See [IDE result composition](./structured-results.md) for reference lifetime and `tools.flush({})`.
|
|
10
10
|
|
|
11
11
|
## Resource references
|
|
12
12
|
|
|
@@ -52,7 +52,7 @@ When `path` is a typed text resource, `read` returns one independent chunk for e
|
|
|
52
52
|
|
|
53
53
|
Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original local file bytes, including PDF and image headers. In `raw:` mode only, offset is zero-based in bytes (negative from EOF), and limit is a non-negative byte count. The output shows hexadecimal offsets, hex bytes, and printable ASCII. Follow its returned byte offset to continue. No views or text anchors apply.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Codemode receives the same bounded hex view as a direct call. Use `text(result)` or return it to display that view. Follow the displayed offset or continuation reference. This is read-only; byte editing and byte diff are not included.
|
|
56
56
|
|
|
57
57
|
### Diagnostic completion
|
|
58
58
|
|
|
@@ -76,16 +76,12 @@ Window and display capture use `node-screenshots` on Linux and macOS. Desktop or
|
|
|
76
76
|
|
|
77
77
|
## Terminal sessions
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
The native fields `exit_code` and `wall_time_seconds` describe the process, not tool transport. `exit_code` is absent until known. IDE fields `session`, `source`, `status`, `background`, `wait_reason`, `completion_reason`, `signal`, and `error` describe the persistent session. A wait timeout leaves a running session, not a failed command. Nonzero exits and shell startup failures still return structured data to scripts. Normal model output and stored renderer details keep the shorter terminal preview limits.
|
|
79
|
+
Codemode receives the same readable shell status and output as direct calls. The result includes its session source and a reference to the complete log when output is shortened. A wait timeout leaves a running session, not a failed command. Inspect the reported exit status and effects; failed tools can reject.
|
|
82
80
|
|
|
83
81
|
```ts
|
|
84
82
|
const result = await tools.bash({ command: "your-command" });
|
|
85
|
-
text(
|
|
86
|
-
|
|
87
|
-
errors: result.output.split("\n").filter((line) => line.includes("error")),
|
|
88
|
-
});
|
|
83
|
+
text(result);
|
|
84
|
+
text(await tools.read({ path: result }));
|
|
89
85
|
```
|
|
90
86
|
|
|
91
87
|
`bash` (Linux/WSL) or `powershell` (Windows) starts a command in the user's configured system shell. Its schema and prompt guidance name that shell at runtime, so the agent writes Bash, zsh, PowerShell, or Command Prompt syntax as appropriate. Commands are not translated between shell languages.
|
|
@@ -36,12 +36,13 @@ export default async function registerFilesystemPlugin(pi: ExtensionAPI): Promis
|
|
|
36
36
|
renderResult: renderReadResult,
|
|
37
37
|
recoverFailure: recoverFilesystemPath,
|
|
38
38
|
});
|
|
39
|
-
api.describe(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
api.describe({
|
|
40
|
+
path: () =>
|
|
41
|
+
renderContentDescription(
|
|
42
|
+
"File path — file content; directory path — entry listing. Relative, absolute and file:// paths accepted.",
|
|
43
|
+
readHost.listDescriptions(),
|
|
44
|
+
),
|
|
45
|
+
});
|
|
45
46
|
},
|
|
46
47
|
} satisfies ReadPlugin;
|
|
47
48
|
const textEditorPlugin = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.7.
|
|
10
|
-
"pi-agent-invariant": "0.7.
|
|
11
|
-
"pi-agent-read": "0.7.
|
|
12
|
-
"pi-agent-resource": "0.7.
|
|
13
|
-
"pi-agent-text": "0.7.
|
|
14
|
-
"pi-agent-text-editor": "0.7.
|
|
9
|
+
"pi-agent-image": "0.7.1",
|
|
10
|
+
"pi-agent-invariant": "0.7.1",
|
|
11
|
+
"pi-agent-read": "0.7.1",
|
|
12
|
+
"pi-agent-resource": "0.7.1",
|
|
13
|
+
"pi-agent-text": "0.7.1",
|
|
14
|
+
"pi-agent-text-editor": "0.7.1"
|
|
15
15
|
},
|
|
16
16
|
"pi": {
|
|
17
17
|
"extensions": [
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-image",
|
|
3
|
-
"version": "0.7.
|
|
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-image": "0.7.
|
|
10
|
-
"pi-agent-resource": "0.7.
|
|
9
|
+
"pi-agent-image": "0.7.1",
|
|
10
|
+
"pi-agent-resource": "0.7.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -71,9 +71,10 @@ const readPlugin = {
|
|
|
71
71
|
return { kind: "continue", context: { ...context, state: transformed } };
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
|
-
api.describe(
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
api.describe({
|
|
75
|
+
views:
|
|
76
|
+
'jq:<filter> — query local JSON text with the installed jq executable, e.g. ["jq:.scripts | keys"]. Exactly one non-empty jq filter is required; it cannot be combined with other views. offset/limit apply to the transformed output, not original source lines.',
|
|
77
|
+
});
|
|
77
78
|
},
|
|
78
79
|
} satisfies ReadPlugin;
|
|
79
80
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-jq",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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.7.
|
|
11
|
-
"pi-agent-documentation": "0.7.
|
|
12
|
-
"pi-agent-read": "0.7.
|
|
13
|
-
"pi-agent-text": "0.7.
|
|
10
|
+
"pi-agent-doctor": "0.7.1",
|
|
11
|
+
"pi-agent-documentation": "0.7.1",
|
|
12
|
+
"pi-agent-read": "0.7.1",
|
|
13
|
+
"pi-agent-text": "0.7.1"
|
|
14
14
|
},
|
|
15
15
|
"pi": {
|
|
16
16
|
"extensions": [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-pdf",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.7.
|
|
7
|
-
"pi-agent-resource": "0.7.
|
|
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.
|
|
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.
|
|
10
|
-
"pi-agent-text": "0.7.
|
|
9
|
+
"pi-agent-resource": "0.7.1",
|
|
10
|
+
"pi-agent-text": "0.7.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-ide-ast",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -31,17 +31,17 @@
|
|
|
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.7.
|
|
35
|
-
"pi-agent-documentation": "0.7.
|
|
36
|
-
"pi-agent-invariant": "0.7.
|
|
37
|
-
"pi-agent-read": "0.7.
|
|
38
|
-
"pi-agent-resource": "0.7.
|
|
39
|
-
"pi-agent-search": "0.7.
|
|
40
|
-
"pi-agent-search-text": "0.7.
|
|
41
|
-
"pi-agent-text": "0.7.
|
|
42
|
-
"pi-agent-text-editor": "0.7.
|
|
43
|
-
"pi-agent-tool-call-interception": "0.7.
|
|
44
|
-
"pi-agent-tool-ui": "0.7.
|
|
34
|
+
"pi-agent-doctor": "0.7.1",
|
|
35
|
+
"pi-agent-documentation": "0.7.1",
|
|
36
|
+
"pi-agent-invariant": "0.7.1",
|
|
37
|
+
"pi-agent-read": "0.7.1",
|
|
38
|
+
"pi-agent-resource": "0.7.1",
|
|
39
|
+
"pi-agent-search": "0.7.1",
|
|
40
|
+
"pi-agent-search-text": "0.7.1",
|
|
41
|
+
"pi-agent-text": "0.7.1",
|
|
42
|
+
"pi-agent-text-editor": "0.7.1",
|
|
43
|
+
"pi-agent-tool-call-interception": "0.7.1",
|
|
44
|
+
"pi-agent-tool-ui": "0.7.1",
|
|
45
45
|
"tree-sitter-cpp": "^0.23.4",
|
|
46
46
|
"tree-sitter-javascript": "^0.25.0",
|
|
47
47
|
"tree-sitter-json": "^0.24.8",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@earendil-works/pi-coding-agent": "*",
|
|
60
60
|
"@earendil-works/pi-tui": "*",
|
|
61
|
-
"pi-agent-ide": "0.7.
|
|
61
|
+
"pi-agent-ide": "0.7.1",
|
|
62
62
|
"typebox": "*"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
@@ -55,9 +55,12 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
55
55
|
return result.kind === "return" ? result : scopes(result.context);
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
|
-
api.describe(
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
api.describe({
|
|
59
|
+
path: "ast:<path> — compact declaration outline for a code file.",
|
|
60
|
+
views: "ast — scope boundaries alongside source text.",
|
|
61
|
+
offset:
|
|
62
|
+
"Oversized code reads may return an outline with source line numbers; offset/limit select a smaller source range.",
|
|
63
|
+
});
|
|
61
64
|
await registerSelect(pi, api);
|
|
62
65
|
},
|
|
63
66
|
} satisfies ReadPlugin;
|
|
@@ -86,7 +89,7 @@ export default async function registerAst(pi: ExtensionAPI): Promise<void> {
|
|
|
86
89
|
setup(api): void {
|
|
87
90
|
api.addResolver({ resolver: createAstSearchResolver(api.registerSelection) });
|
|
88
91
|
api.describe(
|
|
89
|
-
"Search code structure with ast:<pattern>, using source-code syntax and placeholders such as $NAME for one node and $$$BODY for several nodes. path, include and exclude narrow the search. Use returned SEARCH# references to read, replace, copy, move or delete exact AST matches, including multiline nodes. A single :match reference becomes stale after its file changes; :all:match reruns the original structural query. Incomplete results do not provide all selections. Use
|
|
92
|
+
"Search code structure with ast:<pattern>, using source-code syntax and placeholders such as $NAME for one node and $$$BODY for several nodes. path, include and exclude narrow the search. Use returned SEARCH# references to read, replace, copy, move or delete exact AST matches, including multiline nodes. A single :match reference becomes stale after its file changes; :all:match reruns the original structural query. Incomplete results do not provide all selections. Use the displayed capture NAME reference as a Search/Select/edit source. Single captures contain one node; multi captures retain provider nodes, including punctuation. Strict result scopes return only wholly contained matches. These edits do not update imports or references.",
|
|
90
93
|
);
|
|
91
94
|
},
|
|
92
95
|
}),
|
|
@@ -109,6 +109,7 @@ export function createAstSearchResolver(
|
|
|
109
109
|
);
|
|
110
110
|
const data = selectionData(selected.matches, selected.complete, session.id, session);
|
|
111
111
|
const captures: Record<string, ReturnType<typeof selectionData>["matches"]>[] = [];
|
|
112
|
+
const captureGroups: Record<string, { target: string; nodes: number }>[] = [];
|
|
112
113
|
for (const raw of selected.raw.slice(0, data.matches.length)) {
|
|
113
114
|
const groups = Object.entries({
|
|
114
115
|
...Object.fromEntries(
|
|
@@ -117,6 +118,7 @@ export function createAstSearchResolver(
|
|
|
117
118
|
...raw.metaVariables?.multi,
|
|
118
119
|
});
|
|
119
120
|
const projected = [];
|
|
121
|
+
const groupsForMatch: Record<string, { target: string; nodes: number }> = {};
|
|
120
122
|
for (const [name, nodes] of groups) {
|
|
121
123
|
for (const node of nodes) {
|
|
122
124
|
if (
|
|
@@ -130,6 +132,23 @@ export function createAstSearchResolver(
|
|
|
130
132
|
context.cwd,
|
|
131
133
|
context.signal,
|
|
132
134
|
);
|
|
135
|
+
const group = await registerSelection(
|
|
136
|
+
{
|
|
137
|
+
request,
|
|
138
|
+
matches,
|
|
139
|
+
complete: selected.complete,
|
|
140
|
+
refresh: async () => {
|
|
141
|
+
throw new Error("Capture snapshots cannot refresh; repeat the AST search.");
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
context,
|
|
145
|
+
);
|
|
146
|
+
groupsForMatch[name] = {
|
|
147
|
+
target: requiredValue(
|
|
148
|
+
selectionData(matches, selected.complete, undefined, group).target,
|
|
149
|
+
),
|
|
150
|
+
nodes: matches.length,
|
|
151
|
+
};
|
|
133
152
|
const nodesData: ReturnType<typeof selectionData>["matches"] = [];
|
|
134
153
|
// Shared Search previews hold 100 nodes. Register every capture chunk without dropping nodes.
|
|
135
154
|
for (let offset = 0; offset < matches.length; offset += 100) {
|
|
@@ -150,6 +169,7 @@ export function createAstSearchResolver(
|
|
|
150
169
|
projected.push([name, nodesData] as const);
|
|
151
170
|
}
|
|
152
171
|
captures.push(Object.fromEntries(projected));
|
|
172
|
+
captureGroups.push(groupsForMatch);
|
|
153
173
|
}
|
|
154
174
|
if (context.scope !== undefined) await verifyResultTargets(context.scope, context.signal);
|
|
155
175
|
return {
|
|
@@ -159,6 +179,7 @@ export function createAstSearchResolver(
|
|
|
159
179
|
...data,
|
|
160
180
|
matches: data.matches.map((match, index) => ({ ...match, captures: captures[index] })),
|
|
161
181
|
},
|
|
182
|
+
captureGroups,
|
|
162
183
|
pattern,
|
|
163
184
|
matches: selected.raw.map((match, index) => ({
|
|
164
185
|
...match,
|
|
@@ -181,7 +202,11 @@ export function createAstSearchResolver(
|
|
|
181
202
|
},
|
|
182
203
|
format(payload) {
|
|
183
204
|
const result = payload as {
|
|
205
|
+
readonly data: {
|
|
206
|
+
matches: { captures?: Record<string, ReturnType<typeof selectionData>["matches"]> }[];
|
|
207
|
+
};
|
|
184
208
|
readonly pattern: string;
|
|
209
|
+
readonly captureGroups: Record<string, { target: string; nodes: number }>[];
|
|
185
210
|
readonly sessionId: string;
|
|
186
211
|
readonly matches: readonly AstGrepMatch[];
|
|
187
212
|
readonly complete: boolean;
|
|
@@ -195,12 +220,16 @@ export function createAstSearchResolver(
|
|
|
195
220
|
};
|
|
196
221
|
}
|
|
197
222
|
|
|
198
|
-
const lines = result.matches.flatMap((match, index) =>
|
|
199
|
-
|
|
200
|
-
match.range.start.column + 1
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
223
|
+
const lines = result.matches.flatMap((match, index) => {
|
|
224
|
+
const rows = [
|
|
225
|
+
`SEARCH#${result.sessionId}:${index + 1}:match ${match.file}:${match.range.start.line + 1}:${match.range.start.column + 1} ${match.language}`,
|
|
226
|
+
` ${match.lines.trim()}`,
|
|
227
|
+
];
|
|
228
|
+
for (const [name, group] of Object.entries(result.captureGroups[index] ?? {})) {
|
|
229
|
+
rows.push(` capture ${name}: ${group.target} ${group.nodes} node(s)`);
|
|
230
|
+
}
|
|
231
|
+
return rows;
|
|
232
|
+
});
|
|
204
233
|
|
|
205
234
|
if (result.complete)
|
|
206
235
|
lines.unshift(`SEARCH#${result.sessionId}:all:match selects all exact AST matches.`);
|
|
@@ -120,7 +120,7 @@ function scopedOperation<const Kind extends "within" | "intersection" | "differe
|
|
|
120
120
|
scopes: {
|
|
121
121
|
...resultInputSchema,
|
|
122
122
|
description:
|
|
123
|
-
"Comparison scopes:
|
|
123
|
+
"Comparison scopes: unchanged results, issued UUIDs or item references, arrays of those strings, or a readable source path. Match sets by source, not array position.",
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
126
|
{ additionalProperties: false, description },
|
|
@@ -287,7 +287,7 @@ export const selectSchema = Type.Object(
|
|
|
287
287
|
path: {
|
|
288
288
|
...resultInputSchema,
|
|
289
289
|
description:
|
|
290
|
-
"
|
|
290
|
+
"File path, unchanged Read/Search/Select/edit result, its UUID, or an array of such results. Pass the whole result; do not rebuild it from preview text.",
|
|
291
291
|
},
|
|
292
292
|
operation: Type.Union([
|
|
293
293
|
structuralOperationSchema,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
withToolCallInterceptionRendering,
|
|
10
10
|
} from "pi-agent-tool-call-interception";
|
|
11
11
|
import { selectPresentation } from "./select-presentation.js";
|
|
12
|
+
|
|
12
13
|
import { selectStructuralRegions } from "./ast/selection.js";
|
|
13
14
|
import { publicRange } from "./selection-region.js";
|
|
14
15
|
import { selectTextRegions } from "./text-selection.js";
|
|
@@ -21,6 +22,22 @@ import {
|
|
|
21
22
|
type SelectParameters,
|
|
22
23
|
type GeometrySelectOperation,
|
|
23
24
|
} from "./select-schema.js";
|
|
25
|
+
/** Show selected text and opaque item references, never the internal selection record. */
|
|
26
|
+
function selectionText(data: SelectionData): string {
|
|
27
|
+
const rows = [`${data.totalItems} selection(s)${data.complete ? "" : " · incomplete input"}`];
|
|
28
|
+
if (data.missingInputs) rows.push(`${data.missingInputs} input(s) without a selection`);
|
|
29
|
+
for (const item of data.items) {
|
|
30
|
+
const range = item.range;
|
|
31
|
+
rows.push(
|
|
32
|
+
`${item.target} ${item.source}:${range.startLine}:${range.startColumn}–${range.endLine}:${range.endColumn}${item.syntax ? ` ${item.syntax.object}${item.syntax.part ? `/${item.syntax.part}` : ""}` : ""}`,
|
|
33
|
+
item.preview,
|
|
34
|
+
);
|
|
35
|
+
if (item.textTruncated)
|
|
36
|
+
rows.push("… preview shortened; reference retains the complete selection");
|
|
37
|
+
}
|
|
38
|
+
if (data.truncated) rows.push("… more selections retained in the whole result");
|
|
39
|
+
return rows.join("\n");
|
|
40
|
+
}
|
|
24
41
|
|
|
25
42
|
function operationLabel(operation: SelectParameters["operation"]): string {
|
|
26
43
|
switch (operation.kind) {
|
|
@@ -219,7 +236,7 @@ export async function registerSelect(pi: ExtensionAPI, read: ReadPluginApi): Pro
|
|
|
219
236
|
};
|
|
220
237
|
return withStructuredResult(
|
|
221
238
|
{
|
|
222
|
-
content: [{ type: "text", text:
|
|
239
|
+
content: [{ type: "text", text: selectionText(data) }],
|
|
223
240
|
details: selectPresentation(
|
|
224
241
|
selected.regions,
|
|
225
242
|
verified.complete,
|
|
@@ -42,9 +42,10 @@ export default async function registerGitChanges(pi: ExtensionAPI): Promise<void
|
|
|
42
42
|
id: "current-git-changes",
|
|
43
43
|
setup(api) {
|
|
44
44
|
api.addView({ view: "changes", presenter });
|
|
45
|
-
api.describe(
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
api.describe({
|
|
46
|
+
views:
|
|
47
|
+
"changes — uncommitted edits in tracked files, staged/unstaged state, and CHANGE# anchors for stage, unstage and undo.",
|
|
48
|
+
});
|
|
48
49
|
},
|
|
49
50
|
} satisfies ReadPlugin;
|
|
50
51
|
const editorPlugin = {
|