pi-agent-ide 0.9.7 → 1.0.0
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 +68 -0
- package/README.md +5 -3
- package/dist/chunk-2EY3LEZ7.js +1 -0
- package/dist/chunk-2QCE7GOV.js +1 -0
- package/dist/chunk-3V3OQO5S.js +118 -0
- package/dist/chunk-45EJ4762.js +33 -0
- package/dist/chunk-4AEYLVSR.js +5 -0
- package/dist/chunk-4DLSZYUO.js +1 -0
- package/dist/chunk-54EFJYUB.js +1 -0
- package/dist/{chunk-5DN2XBVI.js → chunk-5TPYHUJV.js} +1 -1
- package/dist/{chunk-KQV2ZXLP.js → chunk-6DC2Q5BI.js} +1 -1
- package/dist/chunk-72WO7H5T.js +1 -0
- package/dist/chunk-72X24ARV.js +2 -0
- package/dist/chunk-AB6RSWMB.js +23 -0
- package/dist/chunk-AKUBFJAR.js +1 -0
- package/dist/chunk-ASVMQMPX.js +10 -0
- package/dist/chunk-BW3XONMZ.js +1 -0
- package/dist/{chunk-R2U5WXYR.js → chunk-D23NS4VV.js} +1 -1
- package/dist/chunk-DSB6A5P5.js +53 -0
- package/dist/chunk-E4V4VNRM.js +3 -0
- package/dist/chunk-E6G3UVS7.js +1 -0
- package/dist/chunk-E7JBYW43.js +1 -0
- package/dist/chunk-FVWMI4GP.js +1 -0
- package/dist/chunk-GDIF3WT6.js +12 -0
- package/dist/chunk-GNYFA6FS.js +2 -0
- package/dist/{chunk-DHOIQZUF.js → chunk-GQXZEOND.js} +1 -1
- package/dist/chunk-GT2JPOBM.js +1 -0
- package/dist/chunk-GTZOIJCH.js +1 -0
- package/dist/chunk-HRZAIZGR.js +1 -0
- package/dist/{chunk-H6FEBUAP.js → chunk-HSAGZWPO.js} +1 -1
- package/dist/chunk-HUICUICD.js +3 -0
- package/dist/{chunk-2DSY4U73.js → chunk-I3G6K7QU.js} +1 -1
- package/dist/chunk-IRLWXPL4.js +7 -0
- package/dist/chunk-IZTOXSTR.js +6 -0
- package/dist/chunk-J5CKSIH7.js +1 -0
- package/dist/chunk-JKM4E5VB.js +5 -0
- package/dist/chunk-JMCI2ZE2.js +3 -0
- package/dist/{chunk-YZTVC7ME.js → chunk-JY63UUC2.js} +1 -1
- package/dist/chunk-KJ6HZC6L.js +7 -0
- package/dist/chunk-LG22ELG4.js +2 -0
- package/dist/chunk-LRAMFOUP.js +37 -0
- package/dist/chunk-MJMRV76H.js +1 -0
- package/dist/chunk-MMQIHUU5.js +1 -0
- package/dist/chunk-MNAIMZRO.js +9 -0
- package/dist/chunk-NGWQRV25.js +13 -0
- package/dist/chunk-NKI4TZSS.js +2 -0
- package/dist/chunk-NWCTAVGR.js +4 -0
- package/dist/chunk-O2C3F3MA.js +1 -0
- package/dist/chunk-OA26FH5G.js +1 -0
- package/dist/chunk-OEEE5BLN.js +16 -0
- package/dist/chunk-OLMACWQX.js +11 -0
- package/dist/{chunk-72FL5FHZ.js → chunk-PBMHSK6J.js} +1 -1
- package/dist/chunk-QC6VFZSB.js +2 -0
- package/dist/chunk-QCAGAJHJ.js +1 -0
- package/dist/{chunk-P7FUD4WY.js → chunk-QR7JR3P2.js} +1 -1
- package/dist/chunk-QSU5AEKW.js +1 -0
- package/dist/chunk-R7576HPO.js +25 -0
- package/dist/{chunk-B5UJCNQU.js → chunk-RNDSWVJF.js} +1 -1
- package/dist/chunk-S4GTWS2J.js +6 -0
- package/dist/chunk-SF44YQCB.js +2 -0
- package/dist/chunk-SJQGFUXR.js +6 -0
- package/dist/chunk-SKHD2QIT.js +1 -0
- package/dist/chunk-SKZTIAE4.js +4 -0
- package/dist/chunk-SZRC24OB.js +1 -0
- package/dist/chunk-T5PXAYWC.js +1 -0
- package/dist/chunk-TIZ4QDF3.js +1 -0
- package/dist/chunk-UHGHVYAW.js +4 -0
- package/dist/chunk-V2LLMBTA.js +1 -0
- package/dist/chunk-VB5P3TXJ.js +111 -0
- package/dist/chunk-VNG4QPPT.js +12 -0
- package/dist/chunk-VNNAVC4S.js +15 -0
- package/dist/chunk-VPBGKSFI.js +3 -0
- package/dist/chunk-WZ7MNISG.js +5 -0
- package/dist/chunk-X4CU7CMR.js +19 -0
- package/dist/chunk-X7CHS7JB.js +1 -0
- package/dist/chunk-XEPCURYZ.js +1 -0
- package/dist/chunk-XKVU6AAS.js +7 -0
- package/dist/chunk-XLTAP5YC.js +24 -0
- package/dist/chunk-XQMNVPNS.js +1 -0
- package/dist/chunk-YI32H7Z2.js +4 -0
- package/dist/chunk-YSGPCH52.js +18 -0
- package/dist/chunk-ZYG5E3DI.js +9 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-12.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -1
- package/dist/entry-19.js +1 -1
- package/dist/entry-20.js +1 -1
- package/dist/entry-21.js +1 -1
- package/dist/entry-22.js +1 -1
- package/dist/entry-27.js +1 -1
- package/dist/entry-28.js +1 -1
- package/dist/entry-31.js +2 -2
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +1 -1
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -1
- package/dist/entry-37.js +1 -1
- package/dist/entry-38.js +19 -13
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- 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 +1 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -1
- package/dist/entry-51.js +1 -1
- package/dist/entry-52.js +1 -1
- package/dist/entry-53.js +1 -1
- package/dist/entry-54.js +1 -1
- package/dist/entry-55.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-59.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -1
- package/dist/entry-62.js +1 -1
- package/dist/entry-63.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +1 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -0
- package/dist/entry-69.js +1 -1
- package/dist/entry-71.js +1 -1
- package/dist/entry-72.js +0 -1
- package/dist/entry-73.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +1 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -1
- package/dist/entry-78.js +1 -0
- package/dist/entry-79.js +1 -1
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +1 -0
- package/dist/entry-81.js +0 -1
- package/dist/entry-82.js +1 -1
- package/dist/entry-83.js +1 -1
- package/dist/entry-84.js +0 -1
- package/dist/entry-85.js +1 -1
- package/dist/entry-86.js +1 -2
- package/dist/entry-87.js +1 -1
- package/dist/entry-88.js +1 -1
- package/dist/entry-89.js +1 -1
- package/dist/entry-90.js +1 -1
- package/dist/entry-91.js +1 -3
- package/dist/entry-92.js +1 -1
- package/dist/entry-93.js +1 -1
- package/dist/entry-94.js +1 -1
- package/dist/entry-95.js +3 -0
- package/dist/entry-96.js +1 -0
- package/dist/entry-97.js +1 -0
- package/dist/entry-98.js +1 -0
- package/dist/pi-agent-ide.js +26 -13
- package/docs/agent-guides/ast-search.md +15 -4
- package/docs/agent-guides/debugger.md +1 -1
- package/docs/agent-guides/git-changes.md +1 -0
- package/docs/agent-guides/ssh.md +27 -7
- package/docs/agent-guides/terminal.md +4 -0
- package/docs/configuration.md +65 -11
- package/docs/development.md +4 -0
- package/docs/extensions.md +6 -4
- package/docs/structured-results.md +29 -15
- package/docs/tools.md +95 -29
- package/docs/user-hooks.md +1 -1
- package/node_modules/pi-agent-doctor/package.json +1 -1
- package/node_modules/pi-agent-doctor/src/catalog.ts +2 -0
- package/node_modules/pi-agent-doctor/src/executable.ts +1 -1
- package/node_modules/pi-agent-documentation/package.json +1 -1
- package/node_modules/pi-agent-filesystem/package.json +7 -7
- package/node_modules/pi-agent-filesystem/src/file-write-lock.ts +6 -4
- package/node_modules/pi-agent-filesystem/src/replace-file.ts +5 -2
- package/node_modules/pi-agent-filesystem/src/resolver.ts +26 -10
- 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 +13 -13
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +56 -65
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +197 -130
- package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +2 -1
- package/node_modules/pi-agent-ide-ast/src/ast-grep-binary.ts +46 -0
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +119 -97
- package/node_modules/pi-agent-ide-ast/src/extension.ts +9 -24
- package/node_modules/pi-agent-ide-ast/src/outline-page.ts +96 -0
- package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +42 -78
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +5 -1
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +2 -1
- package/node_modules/pi-agent-ide-ast/src/scope-resolver.ts +24 -5
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +2 -1
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +406 -200
- package/node_modules/pi-agent-ide-ast/src/tool-ast-search.ts +27 -9
- package/node_modules/pi-agent-ide-ast/src/tool-outline.ts +191 -0
- package/node_modules/pi-agent-ide-changes/package.json +8 -8
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +63 -20
- package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +1 -0
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +25 -0
- package/node_modules/pi-agent-ide-changes/src/changes/git-paths.ts +13 -6
- package/node_modules/pi-agent-ide-changes/src/index-mutation-queue.ts +12 -8
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +88 -78
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +29 -3
- package/node_modules/pi-agent-ide-formatter/package.json +3 -3
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +39 -3
- package/node_modules/pi-agent-ide-formatter/src/rustfmt.ts +101 -0
- 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-lint/src/catalog.ts +20 -14
- package/node_modules/pi-agent-ide-lint/src/registry.ts +2 -2
- package/node_modules/pi-agent-ide-lsp/index.ts +15 -88
- package/node_modules/pi-agent-ide-lsp/package.json +12 -12
- package/node_modules/pi-agent-ide-lsp/src/catalog.ts +21 -9
- package/node_modules/pi-agent-ide-lsp/src/lsp/clang-coverage.ts +265 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/clangd-launch.ts +48 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +66 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +514 -207
- package/node_modules/pi-agent-ide-lsp/src/lsp/corrected-names.ts +211 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostics.ts +20 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/files-containing.ts +70 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/index.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/line-breaks.ts +16 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +60 -16
- package/node_modules/pi-agent-ide-lsp/src/lsp/missing-sources.ts +21 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +44 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/range-match.ts +49 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/rename.ts +16 -5
- package/node_modules/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +7 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +133 -37
- package/node_modules/pi-agent-ide-lsp/src/lsp/shared-servers.ts +164 -13
- package/node_modules/pi-agent-ide-lsp/src/lsp/source-changes.ts +18 -6
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +346 -164
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +376 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +6 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +10 -0
- package/node_modules/pi-agent-ide-lsp/src/name-captures.ts +66 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +383 -92
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +305 -77
- package/node_modules/pi-agent-ide-lsp/src/tool-lsp-search.ts +33 -11
- package/node_modules/pi-agent-image/package.json +2 -2
- package/node_modules/pi-agent-image/src/image-converter.ts +13 -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 +51 -12
- package/node_modules/pi-agent-read/src/api/tools/read.ts +39 -3
- package/node_modules/pi-agent-read/src/core/extension.ts +80 -3
- package/node_modules/pi-agent-read/src/core/read-core.ts +6 -0
- package/node_modules/pi-agent-read/src/core/tools/read/list-result.ts +79 -0
- package/node_modules/pi-agent-read/src/core/tools/read/output-truncation.ts +45 -4
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +18 -9
- package/node_modules/pi-agent-read/src/core/tools/read/read-renderer.ts +16 -3
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +37 -9
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +15 -4
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +49 -18
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +158 -51
- package/node_modules/pi-agent-resource/package.json +5 -1
- package/node_modules/pi-agent-resource/src/file-text-read.ts +86 -0
- package/node_modules/pi-agent-resource/src/index.ts +54 -0
- package/node_modules/pi-agent-resource/src/json-structured-arguments.ts +131 -0
- package/node_modules/pi-agent-resource/src/line-map.ts +750 -0
- package/node_modules/pi-agent-resource/src/resolver.ts +2 -0
- package/node_modules/pi-agent-resource/src/resource-scheduler.ts +63 -23
- package/node_modules/pi-agent-resource/src/resource.ts +5 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +693 -66
- package/node_modules/pi-agent-resource/src/script-calls.ts +21 -0
- package/node_modules/pi-agent-resource/src/tool-deadline.ts +199 -0
- package/node_modules/pi-agent-resource/src/tool-result.ts +14 -5
- package/node_modules/pi-agent-resource/src/unchanged-read.ts +62 -0
- package/node_modules/pi-agent-search/package.json +8 -9
- package/node_modules/pi-agent-search/runtime/entry-57.js +0 -1
- package/node_modules/pi-agent-search/src/api/fuzzy.ts +2 -1
- package/node_modules/pi-agent-search/src/api/null-fields.ts +50 -0
- package/node_modules/pi-agent-search/src/api/path-list.ts +68 -0
- package/node_modules/pi-agent-search/src/api/presentation.ts +2 -1
- package/node_modules/pi-agent-search/src/api/search-call-policy.ts +16 -0
- package/node_modules/pi-agent-search/src/api/search-capture.ts +56 -0
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +26 -4
- package/node_modules/pi-agent-search/src/api/search-scope.ts +38 -2
- package/node_modules/pi-agent-search/src/api/search.ts +46 -3
- package/node_modules/pi-agent-search/src/api/structured-result.ts +96 -25
- package/node_modules/pi-agent-search/src/core/extension.ts +75 -42
- package/node_modules/pi-agent-search/src/core/search-config.ts +2 -2
- package/node_modules/pi-agent-search/src/core/search-core.ts +103 -39
- package/node_modules/pi-agent-search-text/index.ts +62 -20
- package/node_modules/pi-agent-search-text/package.json +15 -15
- package/node_modules/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/node_modules/pi-agent-search-text/src/current-matches.ts +314 -0
- package/node_modules/pi-agent-search-text/src/file-search.ts +178 -99
- package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +40 -17
- package/node_modules/pi-agent-search-text/src/persisted-result.ts +3 -8
- package/node_modules/pi-agent-search-text/src/resolvers.ts +395 -103
- package/node_modules/pi-agent-search-text/src/ripgrep.ts +142 -0
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +24 -12
- package/node_modules/pi-agent-search-text/src/search-backend.ts +333 -108
- package/node_modules/pi-agent-search-text/src/search-presentation.ts +6 -0
- package/node_modules/pi-agent-search-text/src/search-query.ts +69 -34
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +80 -8
- package/node_modules/pi-agent-search-text/src/search-renderer.ts +2 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +10 -1
- package/node_modules/pi-agent-search-text/src/search-session.ts +449 -58
- package/node_modules/pi-agent-search-text/src/tool-file-search.ts +51 -6
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/runtime/entry-63.js +1 -0
- package/node_modules/pi-agent-text/src/index.ts +18 -0
- package/node_modules/pi-agent-text/src/line-anchors.ts +211 -0
- package/node_modules/pi-agent-text/src/no-final-line-break.ts +12 -0
- package/node_modules/pi-agent-text/src/search-highlight.ts +8 -0
- package/node_modules/pi-agent-text/src/source-line.ts +7 -1
- package/node_modules/pi-agent-text/src/text-anchor.ts +34 -3
- package/node_modules/pi-agent-text/src/text-converter.ts +2 -1
- package/node_modules/pi-agent-text/src/text-document.ts +9 -23
- package/node_modules/pi-agent-text/src/text-target.ts +14 -6
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-64.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/index.ts +1 -65
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -5
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-65.js +0 -1
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-66.js +2 -0
- package/node_modules/pi-agent-text-anchor-exact/src/anchor.ts +185 -184
- package/node_modules/pi-agent-text-anchor-exact/src/anchored-literal-view.ts +122 -0
- package/node_modules/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +2 -1
- package/node_modules/pi-agent-text-anchor-exact/src/literal-match.ts +359 -0
- package/node_modules/pi-agent-text-anchor-exact/src/recovery.ts +1 -0
- package/node_modules/pi-agent-text-anchor-line-hash/index.ts +5 -3
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-67.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-68.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/anchor.ts +92 -67
- package/node_modules/pi-agent-text-anchor-line-hash/src/range-history.ts +105 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +22 -17
- package/node_modules/pi-agent-text-editor/index.ts +0 -10
- package/node_modules/pi-agent-text-editor/package.json +37 -26
- package/node_modules/pi-agent-text-editor/runtime/entry-84.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-85.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-86.js +1 -0
- package/node_modules/pi-agent-text-editor/runtime/entry-88.js +2 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-excerpt.ts +7 -0
- package/node_modules/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -1
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/api/edit-pipeline.ts +40 -8
- package/node_modules/pi-agent-text-editor/src/api/mutation-result.ts +6 -1
- package/node_modules/pi-agent-text-editor/src/api/mutation-tool.ts +37 -2
- package/node_modules/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/node_modules/pi-agent-text-editor/src/api/native-files.ts +16 -2
- package/node_modules/pi-agent-text-editor/src/api/pi-edit-text.ts +82 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +9 -2
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/stale-anchor-message.ts +13 -2
- package/node_modules/pi-agent-text-editor/src/api/text-selector-fields.ts +210 -0
- package/node_modules/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/core/already-done.ts +123 -0
- package/node_modules/pi-agent-text-editor/src/core/anchor-candidates.ts +116 -0
- package/node_modules/pi-agent-text-editor/src/core/anchor-preview.ts +32 -0
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +109 -23
- package/node_modules/pi-agent-text-editor/src/core/diff-tool.ts +19 -5
- package/node_modules/pi-agent-text-editor/src/core/editing-guidelines.ts +6 -5
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +54 -21
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +7 -3
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +14 -5
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +32 -11
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +67 -38
- package/node_modules/pi-agent-text-editor/src/core/file-write-observations.ts +287 -0
- package/node_modules/pi-agent-text-editor/src/core/image-write.ts +16 -4
- package/node_modules/pi-agent-text-editor/src/core/lookalike-bytes.ts +254 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +29 -12
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/compact-receipt.ts +48 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/diff.ts +2 -1
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +24 -34
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +13 -20
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +32 -3
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +36 -2
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +26 -19
- package/node_modules/pi-agent-text-editor/src/core/native-snapshot-source.ts +13 -0
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +526 -148
- package/node_modules/pi-agent-text-editor/src/core/post-edit-scope.ts +28 -3
- package/node_modules/pi-agent-text-editor/src/core/read-fragment-resolver.ts +34 -14
- package/node_modules/pi-agent-text-editor/src/core/reference-list.ts +95 -0
- package/node_modules/pi-agent-text-editor/src/core/result-scope.ts +129 -0
- package/node_modules/pi-agent-text-editor/src/core/result-target-anchors.ts +20 -8
- package/node_modules/pi-agent-text-editor/src/core/result-transfer.ts +86 -69
- package/node_modules/pi-agent-text-editor/src/core/source-aliases.ts +92 -0
- package/node_modules/pi-agent-text-editor/src/core/source-change-retry.ts +92 -7
- package/node_modules/pi-agent-text-editor/src/core/structured-result.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/text-anchor-registry.ts +162 -47
- package/node_modules/pi-agent-text-editor/src/core/text-change-engine.ts +321 -101
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +206 -134
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -2
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +133 -18
- package/node_modules/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +13 -0
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +823 -226
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +51 -1
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/tools/display-marker.ts +15 -0
- package/node_modules/pi-agent-text-editor/src/tools/text-selection.ts +268 -159
- package/node_modules/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +37 -32
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-copy.ts +24 -70
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-delete.ts +23 -36
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-insert.ts +31 -45
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-move.ts +33 -65
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-replace.ts +80 -42
- package/node_modules/pi-agent-text-editor/src/tools/tool-text-write.ts +27 -16
- package/node_modules/pi-agent-text-editor-renderer/index.ts +0 -14
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -6
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-89.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/diff-model.ts +204 -78
- package/node_modules/pi-agent-text-editor-renderer/src/diff-renderer.ts +75 -8
- package/node_modules/pi-agent-text-editor-renderer/src/frozen-viewport.ts +4 -1
- package/node_modules/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -3
- package/node_modules/pi-agent-text-editor-renderer/src/persisted-result.ts +44 -30
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +170 -26
- package/node_modules/pi-agent-text-editor-stale-anchor/index.ts +83 -83
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -6
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-91.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +3 -3
- package/node_modules/pi-agent-tool-ui/runtime/entry-92.js +1 -0
- package/node_modules/pi-agent-tool-ui/runtime/entry-93.js +1 -0
- package/node_modules/pi-agent-web/index.ts +0 -3
- package/node_modules/pi-agent-web/package.json +8 -8
- package/node_modules/pi-agent-web/src/search.ts +1 -2
- package/node_modules/pi-agent-web-html/package.json +3 -3
- package/node_modules/pi-agent-web-html/runtime/entry-95.js +2 -0
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-image/runtime/entry-96.js +2 -0
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-97.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-98.js +2 -0
- package/package.json +39 -38
- package/skills/capture-code-review-rule/SKILL.md +1 -1
- package/skills/configure-agent-ide/SKILL.md +1 -1
- package/src/api/code-view.ts +0 -2
- package/src/api/tool-config/linters.json +1 -0
- package/src/api/tool-config/lsp-servers.json +5 -0
- package/src/api/tool-config.ts +23 -2
- package/src/backend/config.ts +2 -0
- package/src/backend/configured-process.ts +1 -0
- package/src/backend/dap-java-transport.ts +4 -2
- package/src/backend/dap-java-worker.py +11 -4
- package/src/backend/dap-node-transport.ts +4 -2
- package/src/backend/dap-tcp-transport.ts +2 -3
- package/src/backend/debugger-workspace-owner.ts +6 -6
- package/src/backend/doctor-probe-worker.py +23 -15
- package/src/backend/doctor-workspace.ts +19 -18
- package/src/backend/file-transfer.ts +160 -56
- package/src/backend/formatter-registration.ts +54 -2
- package/src/backend/identity.ts +81 -12
- package/src/backend/lsp-file-watchers.ts +7 -9
- package/src/backend/lsp-workspace-owner.ts +25 -1
- package/src/backend/object-transfer.ts +28 -15
- package/src/backend/owned-command.ts +2 -1
- package/src/backend/owned-read-command.ts +2 -1
- package/src/backend/packaged-source.ts +12 -0
- package/src/backend/process-environment.ts +7 -9
- package/src/backend/process-metadata.ts +5 -5
- package/src/backend/recipe-evidence-worker.py +2 -0
- package/src/backend/recipe-evidence.ts +7 -8
- package/src/backend/registration.ts +2 -1
- package/src/backend/registry.ts +12 -2
- package/src/backend/resource-resolver.ts +11 -32
- package/src/backend/search-environment.ts +61 -4
- package/src/backend/ssh-channel-worker.py +6 -304
- package/src/backend/ssh-channel.ts +287 -36
- package/src/backend/ssh-connection-loss.ts +123 -0
- package/src/backend/ssh-file-stream.ts +216 -0
- package/src/backend/ssh-master.ts +443 -0
- package/src/backend/ssh-transfer-worker-windows.py +84 -0
- package/src/backend/ssh-transfer-worker.py +43 -10
- package/src/backend/ssh-transport.ts +238 -24
- package/src/backend/ssh-worker.py +7 -728
- package/src/backend/ssh.ts +83 -35
- package/src/backend/ssh_channel_common.py +68 -0
- package/src/backend/ssh_channel_posix.py +324 -0
- package/src/backend/ssh_channel_windows.py +527 -0
- package/src/backend/ssh_paths.py +23 -0
- package/src/backend/ssh_windows_files.py +254 -0
- package/src/backend/ssh_worker_common.py +96 -0
- package/src/backend/ssh_worker_posix.py +780 -0
- package/src/backend/ssh_worker_windows.py +687 -0
- package/src/backend/tool-config-access.ts +14 -11
- package/src/backend/tool-project.ts +4 -3
- package/src/backend/web-browser.ts +2 -3
- package/src/backend/web-http.ts +5 -5
- package/src/code-view/diagnostic-view.ts +12 -30
- package/src/code-view/reference.ts +9 -18
- package/src/code-view/source-view.ts +2 -1
- package/src/composite/codemode-tool-names.ts +79 -0
- package/src/composite/detached-results.ts +25 -6
- package/src/composite/ide-alias-rendering.ts +26 -4
- package/src/composite/module-labels.ts +2 -2
- package/src/composite/module-settings.ts +1 -0
- package/src/composite/nested-tool-rendering.ts +70 -24
- package/src/composite/output-limits.ts +12 -5
- package/src/composite/parallel-tool-guidance.ts +38 -0
- package/src/composite/script-values/ast-search.ts +56 -0
- package/src/composite/script-values/copy.ts +8 -0
- package/src/composite/script-values/delete.ts +5 -0
- package/src/composite/script-values/diff.ts +28 -0
- package/src/composite/script-values/edit-selection.ts +48 -0
- package/src/composite/script-values/failures.ts +170 -0
- package/src/composite/script-values/file-receipts.ts +63 -0
- package/src/composite/script-values/file-search.ts +10 -0
- package/src/composite/script-values/index.ts +55 -0
- package/src/composite/script-values/insert.ts +5 -0
- package/src/composite/script-values/lsp-search.ts +92 -0
- package/src/composite/script-values/match.ts +53 -0
- package/src/composite/script-values/move.ts +8 -0
- package/src/composite/script-values/path-list.ts +25 -0
- package/src/composite/script-values/provider-value.ts +21 -0
- package/src/composite/script-values/read.ts +206 -0
- package/src/composite/script-values/replace.ts +5 -0
- package/src/composite/script-values/result-reference.ts +9 -0
- package/src/composite/script-values/search-matches.ts +113 -0
- package/src/composite/script-values/search.ts +64 -0
- package/src/composite/script-values/semantic-search.ts +8 -0
- package/src/composite/script-values/terminal.ts +112 -0
- package/src/composite/script-values/text.ts +7 -0
- package/src/composite/script-values/types.ts +56 -0
- package/src/composite/script-values/undo.ts +5 -0
- package/src/composite/script-values/write.ts +8 -0
- package/src/composite/settings-panel.ts +18 -2
- package/src/composite/text-results.ts +488 -175
- package/src/composite/tool-availability.ts +29 -16
- package/src/composite/tool-discovery-guidance.ts +97 -0
- package/src/documentation/attachment.ts +31 -0
- package/src/documentation/extension.ts +6 -2
- package/src/documentation/search.ts +1 -7
- 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/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-filesystem/src/file-write-lock.ts +6 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/replace-file.ts +5 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +26 -10
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +0 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -3
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-95.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-96.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-97.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-98.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-94.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +1 -2
- 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 +51 -12
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +39 -3
- package/src/extensions/pi-agent-read/src/core/extension.ts +80 -3
- package/src/extensions/pi-agent-read/src/core/read-core.ts +6 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/list-result.ts +79 -0
- package/src/extensions/pi-agent-read/src/core/tools/read/output-truncation.ts +45 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +18 -9
- package/src/extensions/pi-agent-read/src/core/tools/read/read-renderer.ts +16 -3
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +37 -9
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +15 -4
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +49 -18
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +158 -51
- package/src/extensions/pi-agent-search/package.json +8 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +62 -20
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +15 -15
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-59.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-62.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/current-matches.ts +314 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +178 -99
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +40 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/persisted-result.ts +3 -8
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +395 -103
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/ripgrep.ts +142 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +24 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +333 -108
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-presentation.ts +6 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-query.ts +69 -34
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +80 -8
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-renderer.ts +2 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +10 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +449 -58
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/tool-file-search.ts +51 -6
- package/src/extensions/pi-agent-search/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-58.js +2 -0
- package/src/extensions/pi-agent-search/src/api/fuzzy.ts +2 -1
- package/src/extensions/pi-agent-search/src/api/null-fields.ts +50 -0
- package/src/extensions/pi-agent-search/src/api/path-list.ts +68 -0
- package/src/extensions/pi-agent-search/src/api/presentation.ts +2 -1
- package/src/extensions/pi-agent-search/src/api/search-call-policy.ts +16 -0
- package/src/extensions/pi-agent-search/src/api/search-capture.ts +56 -0
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +26 -4
- package/src/extensions/pi-agent-search/src/api/search-scope.ts +38 -2
- package/src/extensions/pi-agent-search/src/api/search.ts +46 -3
- package/src/extensions/pi-agent-search/src/api/structured-result.ts +96 -25
- package/src/extensions/pi-agent-search/src/core/extension.ts +75 -42
- package/src/extensions/pi-agent-search/src/core/search-config.ts +2 -2
- package/src/extensions/pi-agent-search/src/core/search-core.ts +103 -39
- package/src/extensions/pi-agent-text-editor/index.ts +0 -10
- package/src/extensions/pi-agent-text-editor/package.json +37 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/package.json +4 -4
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-64.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/index.ts +1 -65
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-65.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-66.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchor.ts +185 -184
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/anchored-literal-view.ts +122 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/fuzzy-worker.ts +2 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/literal-match.ts +359 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/src/recovery.ts +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/index.ts +5 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-67.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-68.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/anchor.ts +92 -67
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/range-history.ts +105 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +22 -17
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/index.ts +0 -14
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -6
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-89.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-model.ts +204 -78
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/diff-renderer.ts +75 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/frozen-viewport.ts +4 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/mutation-panel.ts +4 -3
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/persisted-result.ts +44 -30
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +170 -26
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/index.ts +83 -83
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -6
- package/src/extensions/pi-agent-text-editor/runtime/entry-84.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-85.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-86.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-87.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-88.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-excerpt.ts +7 -0
- package/src/extensions/pi-agent-text-editor/src/api/anchor-inspection.ts +2 -1
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/edit-pipeline.ts +40 -8
- package/src/extensions/pi-agent-text-editor/src/api/mutation-result.ts +6 -1
- package/src/extensions/pi-agent-text-editor/src/api/mutation-tool.ts +37 -2
- package/src/extensions/pi-agent-text-editor/src/api/native-edit-batch-event.ts +2 -2
- package/src/extensions/pi-agent-text-editor/src/api/native-files.ts +16 -2
- package/src/extensions/pi-agent-text-editor/src/api/pi-edit-text.ts +82 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +9 -2
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/stale-anchor-message.ts +13 -2
- package/src/extensions/pi-agent-text-editor/src/api/text-selector-fields.ts +210 -0
- package/src/extensions/pi-agent-text-editor/src/api/tool-call-interceptor.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/api/tool-renderer.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/core/already-done.ts +123 -0
- package/src/extensions/pi-agent-text-editor/src/core/anchor-candidates.ts +116 -0
- package/src/extensions/pi-agent-text-editor/src/core/anchor-preview.ts +32 -0
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +109 -23
- package/src/extensions/pi-agent-text-editor/src/core/diff-tool.ts +19 -5
- package/src/extensions/pi-agent-text-editor/src/core/editing-guidelines.ts +6 -5
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +54 -21
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +7 -3
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +14 -5
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +32 -11
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +67 -38
- package/src/extensions/pi-agent-text-editor/src/core/file-write-observations.ts +287 -0
- package/src/extensions/pi-agent-text-editor/src/core/image-write.ts +16 -4
- package/src/extensions/pi-agent-text-editor/src/core/lookalike-bytes.ts +254 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/agent-diff.ts +29 -12
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/compact-receipt.ts +48 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/diff.ts +2 -1
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-agent-result.ts +24 -34
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +13 -20
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/final-state-fragment.ts +32 -3
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +36 -2
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +26 -19
- package/src/extensions/pi-agent-text-editor/src/core/native-snapshot-source.ts +13 -0
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +526 -148
- package/src/extensions/pi-agent-text-editor/src/core/post-edit-scope.ts +28 -3
- package/src/extensions/pi-agent-text-editor/src/core/read-fragment-resolver.ts +34 -14
- package/src/extensions/pi-agent-text-editor/src/core/reference-list.ts +95 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-scope.ts +129 -0
- package/src/extensions/pi-agent-text-editor/src/core/result-target-anchors.ts +20 -8
- package/src/extensions/pi-agent-text-editor/src/core/result-transfer.ts +86 -69
- package/src/extensions/pi-agent-text-editor/src/core/source-aliases.ts +92 -0
- package/src/extensions/pi-agent-text-editor/src/core/source-change-retry.ts +92 -7
- package/src/extensions/pi-agent-text-editor/src/core/structured-result.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-anchor-registry.ts +162 -47
- package/src/extensions/pi-agent-text-editor/src/core/text-change-engine.ts +321 -101
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +206 -134
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +4 -2
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +133 -18
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation-anchor-error.ts +13 -0
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +823 -226
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +51 -1
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/tools/display-marker.ts +15 -0
- package/src/extensions/pi-agent-text-editor/src/tools/text-selection.ts +268 -159
- package/src/extensions/pi-agent-text-editor/src/tools/text-tool-schema-properties.ts +37 -32
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-copy.ts +24 -70
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-delete.ts +23 -36
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-insert.ts +31 -45
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-move.ts +33 -65
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-replace.ts +80 -42
- package/src/extensions/pi-agent-text-editor/src/tools/tool-text-write.ts +27 -16
- package/src/pi-agent-ide.ts +41 -32
- package/src/plugins/pi-agent-ide-ast/package.json +13 -13
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +56 -65
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +197 -130
- package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/src/ast-grep-binary.ts +46 -0
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +119 -97
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +9 -24
- package/src/plugins/pi-agent-ide-ast/src/outline-page.ts +96 -0
- package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +42 -78
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +5 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/src/scope-resolver.ts +24 -5
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +406 -200
- package/src/plugins/pi-agent-ide-ast/src/tool-ast-search.ts +27 -9
- package/src/plugins/pi-agent-ide-ast/src/tool-outline.ts +191 -0
- package/src/plugins/pi-agent-ide-changes/package.json +8 -8
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +63 -20
- package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +1 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +25 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/git-paths.ts +13 -6
- package/src/plugins/pi-agent-ide-changes/src/index-mutation-queue.ts +12 -8
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +88 -78
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +29 -3
- package/src/plugins/pi-agent-ide-debugger/index.ts +42 -32
- package/src/plugins/pi-agent-ide-debugger/src/string-enum.ts +14 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +124 -79
- package/src/plugins/pi-agent-ide-formatter/package.json +3 -3
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +39 -3
- package/src/plugins/pi-agent-ide-formatter/src/rustfmt.ts +101 -0
- 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-lint/src/catalog.ts +20 -14
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +2 -2
- package/src/plugins/pi-agent-ide-lsp/index.ts +15 -88
- package/src/plugins/pi-agent-ide-lsp/package.json +12 -12
- package/src/plugins/pi-agent-ide-lsp/src/catalog.ts +21 -9
- package/src/plugins/pi-agent-ide-lsp/src/lsp/clang-coverage.ts +265 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/clangd-launch.ts +48 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +66 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +514 -207
- package/src/plugins/pi-agent-ide-lsp/src/lsp/corrected-names.ts +211 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostics.ts +20 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/files-containing.ts +70 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/index.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/line-breaks.ts +16 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +60 -16
- package/src/plugins/pi-agent-ide-lsp/src/lsp/missing-sources.ts +21 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +44 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/range-match.ts +49 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/rename.ts +16 -5
- package/src/plugins/pi-agent-ide-lsp/src/lsp/server-request-handlers.mjs +7 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-server-host.mjs +133 -37
- package/src/plugins/pi-agent-ide-lsp/src/lsp/shared-servers.ts +164 -13
- package/src/plugins/pi-agent-ide-lsp/src/lsp/source-changes.ts +18 -6
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +346 -164
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +376 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +6 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +10 -0
- package/src/plugins/pi-agent-ide-lsp/src/name-captures.ts +66 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +383 -92
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +305 -77
- package/src/plugins/pi-agent-ide-lsp/src/tool-lsp-search.ts +33 -11
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +64 -3
- package/src/plugins/pi-agent-ide-processes/src/ui.ts +57 -1
- package/src/plugins/pi-agent-ide-semantic/src/backend.ts +18 -6
- package/src/plugins/pi-agent-ide-semantic/src/vera-backend.ts +16 -9
- package/src/plugins/pi-agent-ide-terminal/index.ts +23 -7
- package/src/plugins/pi-agent-ide-terminal/src/list.ts +79 -0
- package/src/plugins/pi-agent-ide-terminal/src/output-limits.ts +22 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +3 -0
- package/src/plugins/pi-agent-ide-terminal/src/renderer.ts +18 -6
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +132 -18
- package/src/plugins/pi-agent-ide-terminal/src/search.ts +117 -50
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +94 -10
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +24 -1
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/terminal-text.ts +173 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +266 -112
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +6 -1
- package/src/plugins/pi-agent-ide-terminal/src/ui.ts +11 -6
- package/src/plugins/pi-agent-ide-terminal/src/unix-pty-output.ts +47 -0
- package/src/post-edit/gate.ts +16 -1
- package/src/semantic/extension.ts +8 -2
- package/src/standalone/scoped-api.ts +85 -18
- package/src/toolchain/types.ts +4 -0
- package/dist/chunk-2AANEKFS.js +0 -1
- package/dist/chunk-33U3RUM3.js +0 -12
- package/dist/chunk-34IYWKY5.js +0 -1
- package/dist/chunk-4CSNQX54.js +0 -23
- package/dist/chunk-53IV6EKV.js +0 -1
- package/dist/chunk-5AROEOJB.js +0 -1
- package/dist/chunk-5D4C225L.js +0 -1
- package/dist/chunk-5W6QQZFI.js +0 -2
- package/dist/chunk-6W4OJLCJ.js +0 -1
- package/dist/chunk-6ZYCTWQE.js +0 -1
- package/dist/chunk-756K3LJY.js +0 -1
- package/dist/chunk-AMSNDWBT.js +0 -2
- package/dist/chunk-APWMLLSE.js +0 -17
- package/dist/chunk-BMSAVDRD.js +0 -13
- package/dist/chunk-BRJIXNFU.js +0 -5
- package/dist/chunk-C2GZLLSP.js +0 -5
- package/dist/chunk-ECSMTGVM.js +0 -6
- package/dist/chunk-EWTVVPUA.js +0 -11
- package/dist/chunk-FBR7ZLLN.js +0 -1
- package/dist/chunk-FGN2ZMEN.js +0 -1
- package/dist/chunk-FJSYWOE6.js +0 -1
- package/dist/chunk-FTECKRK6.js +0 -1
- package/dist/chunk-GRZTKMXQ.js +0 -1
- package/dist/chunk-HFCHOFLV.js +0 -2
- package/dist/chunk-HFF4GY7R.js +0 -3
- package/dist/chunk-HJXSEPO7.js +0 -111
- package/dist/chunk-HSEDKYH4.js +0 -1
- package/dist/chunk-II7AOJNH.js +0 -9
- package/dist/chunk-J34VKQGJ.js +0 -1
- package/dist/chunk-J6CDIH3S.js +0 -84
- package/dist/chunk-JHWLRL4U.js +0 -1
- package/dist/chunk-JMQ67UNK.js +0 -3
- package/dist/chunk-JRIP33PC.js +0 -13
- package/dist/chunk-K5M65CAF.js +0 -1
- package/dist/chunk-KJAR2WDO.js +0 -1
- package/dist/chunk-KX7MG72M.js +0 -1
- package/dist/chunk-L2B4DTVS.js +0 -1
- package/dist/chunk-LEKC4GQK.js +0 -5
- package/dist/chunk-LIGOOMJS.js +0 -10
- package/dist/chunk-LY2UANKU.js +0 -6
- package/dist/chunk-M7P7V4WI.js +0 -25
- package/dist/chunk-MXLSGMRZ.js +0 -3
- package/dist/chunk-N2NEFXHB.js +0 -13
- package/dist/chunk-NF74ITWT.js +0 -2
- package/dist/chunk-NQYUIQRH.js +0 -1
- package/dist/chunk-OCU6NW5Y.js +0 -1
- package/dist/chunk-OIEA4QWF.js +0 -4
- package/dist/chunk-ON5HDFNL.js +0 -10
- package/dist/chunk-P43GGKUC.js +0 -28
- package/dist/chunk-PPCWY4BB.js +0 -1
- package/dist/chunk-QGXZ4RWX.js +0 -1
- package/dist/chunk-S3T5NOSL.js +0 -1
- package/dist/chunk-S7E2D5K7.js +0 -5
- package/dist/chunk-SIYPD5MM.js +0 -3
- package/dist/chunk-STUZZM5B.js +0 -1
- package/dist/chunk-T4FTT3U4.js +0 -1
- package/dist/chunk-T5ACAOKJ.js +0 -4
- package/dist/chunk-TILMPAF2.js +0 -1
- package/dist/chunk-TSNY2FSU.js +0 -1
- package/dist/chunk-TWJINFQB.js +0 -9
- package/dist/chunk-TWQ6ACOI.js +0 -1
- package/dist/chunk-UDVVKVG4.js +0 -1
- package/dist/chunk-V2D5MLGE.js +0 -1
- package/dist/chunk-VDSSAP6Y.js +0 -1
- package/dist/chunk-VHYJTAXX.js +0 -1
- package/dist/chunk-WCSWQDJ2.js +0 -22
- package/dist/chunk-WQTF6Q2X.js +0 -3
- package/dist/chunk-XE4W5YTE.js +0 -2
- package/dist/chunk-YFPU2LRR.js +0 -23
- package/dist/chunk-YLEERRX3.js +0 -33
- package/dist/chunk-YOJHCARZ.js +0 -1
- package/dist/chunk-YPTDPMK5.js +0 -1
- package/docs/agent-guides/editing.md +0 -43
- package/docs/agent-guides/search.md +0 -38
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +0 -73
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-63.js +0 -2
- package/node_modules/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-85.js +0 -2
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +0 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-88.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-89.js +0 -1
- package/node_modules/pi-agent-web-html/runtime/entry-91.js +0 -2
- package/node_modules/pi-agent-web-image/runtime/entry-92.js +0 -2
- package/node_modules/pi-agent-web-pdf/runtime/entry-93.js +0 -2
- package/src/composite/search-facts.ts +0 -45
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-91.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-92.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-93.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-text/runtime/entry-94.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-58.js +0 -2
- package/src/extensions/pi-agent-search/runtime/entry-54.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-63.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-64.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-66.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-85.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-86.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-68.js +0 -1
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +0 -73
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-54.js +0 -0
- /package/node_modules/{pi-agent-search-text → pi-agent-search}/runtime/entry-58.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-62.js +0 -0
- /package/node_modules/{pi-agent-tool-call-interception → pi-agent-text-editor}/runtime/entry-87.js +0 -0
- /package/node_modules/{pi-agent-web → pi-agent-text-editor-stale-anchor}/runtime/entry-90.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web}/runtime/entry-94.js +0 -0
- /package/src/extensions/{pi-agent-read/extensions/pi-agent-web → pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor}/runtime/entry-90.js +0 -0
package/docs/tools.md
CHANGED
|
@@ -4,13 +4,23 @@ 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
|
+
## Tool discovery
|
|
8
|
+
|
|
9
|
+
Read, Diagnostics, Search, File Search and the common editing and terminal tools are declared initially. AST Search, LSP Search, Diff and Undo are deferred, alongside Stage, Unstage and Debug. Use `tool_search({ query })` for direct calls. Inside Codemode, call known tools through `tools`, such as `tools.ast_search(args)`, without loading them first. Use `await searchTools(query)` to find other script tools and `await describeTool(name)` to see their arguments.
|
|
10
|
+
|
|
11
|
+
Use AST Search for syntax patterns, captures and enclosing code. Use LSP Search for symbol definitions, references and call graphs through language servers.
|
|
12
|
+
|
|
7
13
|
## Readable results and composition
|
|
8
14
|
|
|
9
|
-
IDE tools return readable text in direct calls
|
|
15
|
+
IDE tools return readable text in direct calls. 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. In Codemode, several tools return values instead, such as Read's `{ text, id }`. Source parameters take any object whose `id` is such a reference, including these values; its other fields are ignored. 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 automatic commit boundaries.
|
|
10
16
|
|
|
11
17
|
## Shared output limits
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
Readable IDE results, including nested panels and the combined Codemode result, share a useful-text limit of 50 KiB or 2,000 lines. Images share a limit of 20 frames, 4,000,000 pixels and 20 MiB of image bytes per result. Notices, guides and composition references are added afterward and are not part of these budgets. Codemode values can contain more than a readable result: Search returns every match it found, for example, and file_search returns all paths unless given a limit.
|
|
20
|
+
|
|
21
|
+
A text Read inside a Codemode script likewise returns its complete requested text: the script receives `{ text, id }` with the whole requested text, so it can parse a large file or write it back. Explicit `offset` and `limit` select exactly that window. Notices and continuation hints stay out of `text`, and large files are not replaced with a code overview. The script's own output is still bounded: the combined Codemode result shares the limit above. The Read panel inside the Codemode card shows the first 2,000 lines or 50 KiB of such a result and says that the script received all of it.
|
|
22
|
+
|
|
23
|
+
Diff is another exception: in a Codemode script it returns the complete unified diff as a string, without the system-result envelope, and `""` when the sources are equal. A direct Diff call shows the bounded diff and saves the full one as a temporary result that its truncation notice names.
|
|
14
24
|
|
|
15
25
|
When the shared text limit truncates a result, the complete useful text is saved to a private temporary file. The result names that file. Use Read with `offset` and `limit` to continue, or `raw:` byte windows for a line that is too large. The file is removed when its owning runtime is disposed. Media is resized or omitted, not archived.
|
|
16
26
|
|
|
@@ -20,11 +30,13 @@ An explicit request limit still selects what the tool produces; the saved file d
|
|
|
20
30
|
|
|
21
31
|
Tool source fields take one complete resource reference. A filesystem path is the common case, but it is not the only kind of reference. Depending on the tool and loaded resolvers, a reference may name a file, URL, protocol source, temporary result, or a typed text selection.
|
|
22
32
|
|
|
33
|
+
Read accepts a file or directory path, resource address, or issued result. Pass an array to read each source independently in order. Unsupported sources return an error. Built-in address forms include `raw:<file>` for bytes, `temp:<id>` for saved output, and `docs:<id>` for a guide. HTTP(S) URLs are fetched locally; `web:ssh://<target>/https://…` fetches on that target. Extensions register further resource addresses.
|
|
34
|
+
|
|
23
35
|
A typed `SEARCH#...` value is both an anchor and a resource reference. It carries its source or sources and its selected ranges. Pass it by itself in either role:
|
|
24
36
|
|
|
25
37
|
```ts
|
|
26
38
|
replace({ path: "SEARCH#19AF:all:match", text: "new" });
|
|
27
|
-
replace({
|
|
39
|
+
replace({ at: "SEARCH#19AF:all:match", text: "new" });
|
|
28
40
|
```
|
|
29
41
|
|
|
30
42
|
Do not append it to a filesystem path:
|
|
@@ -41,6 +53,14 @@ Configure a Linux SSH target, then use `ssh://target/path` with the supported ex
|
|
|
41
53
|
|
|
42
54
|
Authentication stays in OpenSSH. Target programs require their dependencies on that machine; missing support does not fall back to local execution. See [SSH configuration](./configuration.md#ssh-targets) and the [SSH guide](./agent-guides/ssh.md) for setup, prerequisites and supported sources.
|
|
43
55
|
|
|
56
|
+
## Outline
|
|
57
|
+
|
|
58
|
+
Use `outline({ path: "src/file.ts" })` for a compressed declaration outline without implementation bodies. The path can also be a configured `ssh://` file. The result maps visible declarations back to the original source, so you can reuse it in Read, Search, AST Search or editing tools.
|
|
59
|
+
|
|
60
|
+
`offset` is the first projected outline row (1-based), not a source line number. `limit` is the maximum number of projected rows (default and maximum: 100). A page can end earlier to stay within its output budget. Follow the continuation in the result to get the next page. In Codemode, `outline` returns `{ text, id }` for the current page; its reference covers only the source rows on that page. If a single projected row is too wide to show, use Read to inspect that source line.
|
|
61
|
+
|
|
62
|
+
Outline parses the whole file on each call and accepts up to 4 MiB of normalized UTF-8 text and 100,000 lines. Beyond those limits, use Search to find declarations or Read with source-line `offset` and `limit`. Read with `views: ["ast"]` still shows the original text with scope markers.
|
|
63
|
+
|
|
44
64
|
## Read
|
|
45
65
|
|
|
46
66
|
`read` resolves a source and returns agent-ready content. Built-in resolvers currently cover:
|
|
@@ -50,27 +70,35 @@ Authentication stays in OpenSSH. Target programs require their dependencies on t
|
|
|
50
70
|
- HTTP and HTTPS resources;
|
|
51
71
|
- HTML converted to readable Markdown;
|
|
52
72
|
- AST-aware code views;
|
|
53
|
-
-
|
|
73
|
+
- diagnostic overlays beside file text.
|
|
54
74
|
|
|
55
75
|
A read result may include anchors, diagnostics, Git changes, or structural markers. Large text results are bounded. The shared limiter retains complete truncated text in a temporary file.
|
|
56
76
|
|
|
57
77
|
Read sources are not assumed to be writable. The read and text-editor cores keep separate resolver registries so a derived view cannot be edited by accident.
|
|
58
78
|
|
|
79
|
+
When a read of a local or SSH text file reaches the last line and the file does not end with a line break, the output ends with the line ``, the marker that mutation results use. It follows every view of file lines. The marker is not a line of the file: it has no anchor or line number, it does not count toward `offset`, `limit` or the line totals, and Codemode script data does not hold it. A read that stops before the last line, a file that ends with a line break and an empty file show no marker. `replace` and `insert` refuse text whose last line is exactly the marker with `END_OF_FILE_MARKER` and change nothing, because the tools keep the end of the file as it is.
|
|
80
|
+
|
|
59
81
|
HTTP(S) pages use a fast direct request first. Failed requests (including HTTP 403 and timeouts), failed HTML conversion, and empty HTML automatically trigger one retry through local Chrome or Chromium within the same `read` call. The browser gets a fresh timeout; caller cancellation stops both attempts. If the browser also fails or is not installed, the read reports both failures. Successful non-HTML reads and non-HTML conversion errors keep their normal behavior. Browser rendering removes hidden elements before the same HTML-to-Markdown conversion runs.
|
|
60
82
|
|
|
61
83
|
Browser reads discover `google-chrome`, `google-chrome-stable`, `chromium`, or `chromium-browser` on `PATH` and in common Linux locations. Set `PI_AGENT_IDE_BROWSER_PATH` to use another executable. Missing browser support returns a normal read failure and `/agent-ide-doctor` reports it as an optional warning. Browser reads execute page JavaScript. When Pi runs as root, Chromium is launched without its process sandbox; only open sources you trust in that mode.
|
|
62
84
|
|
|
63
85
|
When `path` is a typed text resource, `read` returns one independent chunk for each selected range, in resolver order. Each chunk starts at the range's containing line. `offset` and `limit` are applied to every chunk, not across the combined result. The chunks are then joined and the normal aggregate limit of 2,000 lines or 50 KiB is applied.
|
|
64
86
|
|
|
87
|
+
When `path` is an array, `read` reads each source on its own with the same `offset`, `limit` and `views`, and shows each result under its source. The call fails as a whole when any source fails; the other sources' results are still shown. In Codemode it returns an array of values in the same order, with `null` for each source that failed, and the Codemode result lists only the failed sources.
|
|
88
|
+
|
|
65
89
|
### Original bytes
|
|
66
90
|
|
|
67
91
|
Use `read({path: "raw:sample.bin", offset: 0, limit: 64})` to inspect original file bytes, including PDF and image headers. For remote bytes, use `raw:ssh://target/path`. 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.
|
|
68
92
|
|
|
69
|
-
Codemode
|
|
93
|
+
In Codemode, a `raw:` Read returns `{ bytes }`, the base64 of every requested byte; the Read panel shows the bounded hex view. This is read-only; byte editing and byte diff are not included.
|
|
70
94
|
|
|
71
|
-
|
|
95
|
+
## Diagnostics
|
|
72
96
|
|
|
73
|
-
|
|
97
|
+
`diagnostics({ path: "src/app.ts" })` checks one local or `ssh://` file. It accepts only `path`, not Read's `offset`, `limit` or `views`. The tool is available initially. It returns lint and language-server findings with nearby source context and reports pending, unavailable or snapshot states without treating them as completed clean checks. A repeated call checks the current file; an issued report remains a snapshot.
|
|
98
|
+
|
|
99
|
+
Pass the unchanged report or its UUID to Read or Search. In Codemode, the value is `{ text, id }`; reuse it unchanged. Report selections are read-only, including derived reads and searches: read the source file before editing it. Use Read with `views: ["diagnostics"]` when you need findings beside the file text rather than a focused report.
|
|
100
|
+
|
|
101
|
+
Edits save before background diagnostics finish. Automatic notifications show only sources with findings, in the chat as soon as they arrive, with a matching hidden message sent to the agent. A new finding wakes an idle agent; during a run it is queued as steering input for the next model call. Each source names the actual reporting command, such as `eslint_d` or `typescript-language-server`, rather than a wrapper extension. Chat summaries show that name in parentheses beside its counts. Pending, unavailable, and empty reports stay silent, including updates that clear earlier findings. Silence does not mean checks passed. The `diagnostics` tool and the diagnostics view return details and readiness.
|
|
74
102
|
|
|
75
103
|
LSP reads prefer standard pull reports. Servers that advertise a supported completed-request command can use an adapter; TypeScript language server uses one adapter for both TypeScript and JavaScript. Adapter selection uses server capabilities, not language names. All requests remain tied to the synchronized document revision and are canceled when it becomes stale.
|
|
76
104
|
|
|
@@ -78,20 +106,25 @@ Other push-only servers return a `snapshot`: the latest publication, with no pro
|
|
|
78
106
|
|
|
79
107
|
## Terminal sessions
|
|
80
108
|
|
|
81
|
-
Codemode
|
|
109
|
+
In Codemode, `bash`, `powershell`, `remote_bash` and `remote_powershell` resolve to the fields of Pi's own `bash`, plus the session: `{ output, exit_code, truncated, full_output_path, wall_time_seconds, session }`. `output` holds up to 1 MiB; longer output keeps its first and last 512 KiB around an omission marker such as `[... 351432 bytes omitted ...]`, with `truncated` set. `full_output_path` is the complete log. `session` is the `shell:<session>` source, which stays readable after the command ends. A background command, or one still running when its wait times out, has no `exit_code` yet. A non-zero exit code is a value, not a failure: the script gets it, and the Codemode result does not list the call as failed. Only a command that cannot start, such as one with an unknown SSH target, resolves to `null`; the Codemode result lists it with its reason. A direct call still shows readable status and output and reports a non-zero exit code as an error.
|
|
82
110
|
|
|
83
111
|
```ts
|
|
84
112
|
const result = await tools.bash({ command: "your-command" });
|
|
85
|
-
text(result);
|
|
86
|
-
|
|
113
|
+
if (result !== null && result.exit_code !== 0) text(result.output);
|
|
114
|
+
const server = await tools.bash({ command: "npm run dev", background: true });
|
|
115
|
+
if (server !== null) {
|
|
116
|
+
const status = await tools.read({ path: server.session });
|
|
117
|
+
if (status !== null && "text" in status) text(status.text);
|
|
118
|
+
}
|
|
87
119
|
```
|
|
88
120
|
|
|
89
121
|
`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.
|
|
122
|
+
A native Windows session offers only `powershell` for local commands; Pi's built-in `bash` (Git Bash) is withdrawn, also after a Teleport from Linux, a reload or a resume.
|
|
90
123
|
|
|
91
124
|
Every run returns a stable `shell:<session>` source. Synchronous runs wait for the real exit status. Background runs return immediately, remain visible below the editor, and send one completion message that wakes the agent; nearby completions are combined without losing individual results. `/terminals` opens the active and recent session overlay.
|
|
92
125
|
The UI tab in `/agent-ide-settings` controls persistent active-terminal presentation: Detailed cards (default), Compact count, or Off. Detailed cards replace the separate active count instead of showing both. This setting does not hide ordinary run results or completion messages.
|
|
93
126
|
|
|
94
|
-
Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen
|
|
127
|
+
Use `read` on the returned source for status and bounded output. Compact cards show the latest 12 output rows and count omitted earlier rows; expanded cards show all retained rows. Add `views: ["image"]` to receive a PNG of the ANSI-aware virtual terminal screen. Use `write` to send exact text without Enter. Use `insert` for named keys and chords such as `Enter`, `Ctrl+C`, `Ctrl+Shift+Left`, or Unix caret controls such as `^U`; separate multiple keys with spaces or commas. A native Codemode script can send several terminal inputs without file formatting or diagnostics. Use `search` with the `shell:<session>` path to search retained output, including rows outside the current screen; the query is literal text, or a regular expression when it starts with `regex:`. `delete` terminates the owned process tree when needed, disposes the virtual screen, and removes the session. `replace` does not apply to terminal sessions.
|
|
95
128
|
|
|
96
129
|
For a bounded terminal sequence, use `views: ["sequence:duration=2,interval=0.5,scale=1"]`. This returns five PNG frames over two seconds. Duration is capped at 10 seconds and each sequence at 20 frames. Terminal images and sequences support scale from greater than 0 through 1; they do not support region or grid-cell selection.
|
|
97
130
|
|
|
@@ -105,20 +138,26 @@ Deleting an active session first requests graceful termination, then forcefully
|
|
|
105
138
|
|
|
106
139
|
A resolver decides whether it understands a query. The first successful resolver returns the result. Search plugins can add new query forms without adding another agent tool.
|
|
107
140
|
|
|
108
|
-
Local text search tries literal
|
|
141
|
+
A local text query is literal text, quotes included, unless it contains a Boolean operator. Local text search tries the literal text first. If there are no matches, it retries the text, or a Boolean query's unquoted terms, as regex. If that also finds nothing, a multi-word query without Boolean operators falls back to separate words. Each fallback is reported. Invalid optional regex is skipped, while I/O errors, cancellation, and regex runtime errors stay errors. The exception is a path that ripgrep cannot read while it searches the rest of the scope, such as a WSL symlink seen from Windows through `\\wsl.localhost`: the search returns the matches it found with one notice that counts the skipped paths and names the first. `regex:<pattern>` forces regex-only matching and reports invalid patterns.
|
|
109
142
|
|
|
110
|
-
After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior.
|
|
143
|
+
After all ordinary attempts finish with zero matches, a single unquoted ASCII identifier can return separate possible-name groups. They cover naming-style changes, one extra or missing edge component, and small typos, strongest first. Each name is verified exactly in the same scope. These are spelling suggestions, not synonyms, automatic corrections, or proof of equivalent behavior. Queries with quotes, Boolean operators or `regex:` do not use this branch.
|
|
111
144
|
|
|
112
145
|
Local groups provide current Read selections; a complete candidate all-reference refreshes only its exact alternative. URL groups reuse the already converted page text and provide URL line ranges without editable Search references. Name collection, capture and output have fixed budgets; a skip or limited capture is explicit. Narrow the scope if a budget is reached.
|
|
113
146
|
|
|
114
|
-
|
|
147
|
+
A query becomes Boolean only when it contains an operator: uppercase `AND`, `OR`, `NOT`, `||`, or space-separated `|`. Quotes alone never make a query Boolean. Boolean queries keep their conditions across literal and regex attempts. Adjacent terms imply `AND`; `AND` and `NOT` bind more tightly than `OR`. `NOT` excludes lines from its conjunction wherever it appears, so `a NOT b`, `a AND NOT b`, and `NOT b AND a` are the same query; a conjunction needs at least one term without `NOT`. Parentheses containing Boolean operators group conditions. Regex groups, classes, and escapes stay inside terms: `(?:foo|bar)\d+ AND "keep.me" NOT ignored`. An unspaced `foo|bar` is searched as literal text first, then as regex alternatives. In a Boolean query, single or double quotes group a literal phrase in every attempt, and an operator inside quotes is literal text: `"a || b"` finds `a || b`. Boolean queries never fall back to separate words. Invalid Boolean expressions report the source column and expected syntax.
|
|
115
148
|
Boolean text searches also work with registered result scopes. Each selected range is searched on its own: terms outside it, in sparse gaps, or on another line cannot satisfy a condition.
|
|
116
149
|
|
|
117
|
-
|
|
150
|
+
A Boolean search can select individual tokens instead of one phrase. Search warns about these selections and prevents editing or transferring the whole result or an `all` anchor. Read or search the result to inspect it, edit a numbered match, or quote the text to search for it as one phrase.
|
|
151
|
+
|
|
152
|
+
Separate-word fallback matches are read-only location hints. Search refuses every edit or transfer through them: the whole result, an `all` anchor, a numbered `:line` or `:match` anchor and each match's handle. Read them or search inside them, then edit through a Read anchor or a search for the exact current text.
|
|
153
|
+
|
|
154
|
+
A colon does not make a query a resource reference. Plain text such as `docs:debugger` or `status:` follows normal text matching without a protocol fallback notice. Supported query forms such as `regex:<pattern>` stay with their resolver; `regex:` without a pattern is an error. Resolver failures and successful searches with no results do not launch another text search. Plugins mark a text fallback resolver with `fallback: true`; these resolvers run after specialists regardless of numeric priority.
|
|
155
|
+
|
|
156
|
+
An omitted or empty `path` searches the session directory. An explicit `null` argument fails the call in `search`, `file_search`, `ast_search` and `lsp_search` instead of counting as omitted. A null source such as `path: null` means the call that produced it failed or selected no text, such as a directory copy or a `delete`, and searching everything instead would hide that; the same holds for `include`, `exclude`, `query`, `pattern` and the other text arguments. In Codemode the failed call resolves to `null` and is listed in the script's failure block. A null in a number, boolean or object argument, such as `limit: null`, is rejected as invalid arguments. Pi drops a null optional property before a tool runs, so each tool keeps the null visible in `prepareArguments` and refuses it in `execute`.
|
|
118
157
|
|
|
119
158
|
A complete search call times out after 30 seconds by default, including resolver work and result formatting. The timeout cancels the active resolver and tells the agent to retry with a smaller `path` scope. Global and project `search.json` files can change or disable the timeout as described in [Configuration](./configuration.md#search-timeout).
|
|
120
159
|
|
|
121
|
-
|
|
160
|
+
Direct local text and regex results can expose four reusable forms:
|
|
122
161
|
|
|
123
162
|
- `SEARCH#HASH:N:line` selects result `N` as a whole line;
|
|
124
163
|
- `SEARCH#HASH:N:match` selects the exact match for result `N`;
|
|
@@ -129,21 +168,32 @@ Every response that includes these values includes an `Anchors:` syntax legend a
|
|
|
129
168
|
|
|
130
169
|
These values are both edit anchors and typed text resources. `read` and mutation `path` fields accept each complete `SEARCH#...` value directly; no filesystem path is added before or around it. The text search resolver turns them into ordered Resource sources and character ranges; consumers use that typed result and do not parse the `SEARCH#` string themselves.
|
|
131
170
|
|
|
132
|
-
|
|
171
|
+
For text reads, a `:line` range includes the line text and its LF if present; in CRLF text, the range includes the CR too. A final unterminated line selects through EOF. A `:match` range contains only the matched characters. Edits use the same boundary rules for both forms; see [Editing](#editing).
|
|
133
172
|
|
|
134
|
-
Per-result forms keep the search-time snapshot and fail as stale after their matched file changes. Complete `:all` forms rerun the original search recipe when a matched file changes, then select the current complete result set. Limited or otherwise incomplete searches omit the `:all` forms. A forged `:all` value for an incomplete search is rejected.
|
|
173
|
+
Per-result forms keep the search-time snapshot and fail as stale after their matched file changes. Complete `:all` forms rerun the original search recipe when a matched file changes, then select the current complete result set. A search that ran inside a Read or Search result reruns inside that result as its file is now, also for `ast_search` and `lsp_search`. Limited or otherwise incomplete searches omit the `:all` forms. A forged `:all` value for an incomplete search is rejected.
|
|
174
|
+
|
|
175
|
+
When an `:all` form cannot be used, the error says why and what to do: the search was limited, the rerun found more matches than its limit, the result it ran inside is no longer in the file, the file kept changing while the search ran again, or the rerun failed with its own reason. An edit retries a file that changed during the rerun, like any other change by another process. A retry of the same edit does not search again when it can avoid it: it moves the matches the earlier attempt found onto the newer text through unchanged lines. It searches again when a match's own line changed or moved, or when an added or changed line contains a matched text and so may hold a new match.
|
|
135
176
|
|
|
136
177
|
## File search
|
|
137
178
|
|
|
138
|
-
`file_search` finds file paths under `path` (default: the session directory), locally or on an SSH target. A `pattern` with glob syntax (`*`, `**`, `?`, character classes, braces) matches paths relative to `path` when it contains `/`, and file names at any depth otherwise. Other patterns match as a case-insensitive subsequence of the relative path. `include` and `exclude` narrow the scan; `.git` is skipped and ignore files are honored.
|
|
179
|
+
`file_search` finds file paths under `path` (default: the session directory), locally or on an SSH target. A `pattern` with glob syntax (`*`, `**`, `?`, character classes, braces) matches paths relative to `path` when it contains `/`, and file names at any depth otherwise. Other patterns match as a case-insensitive subsequence of the relative path. `include` and `exclude` narrow the scan; `.git` is skipped and ignore files are honored. The tool walks paths in a deterministic order and stops as soon as it finds `limit` distinct matches (default 100). Reaching the limit or the 30-second deadline leaves an incomplete list. In Codemode, the value is a `string[]` with no default match limit. If the call times out, the array contains the paths found so far and the Codemode failure summary marks it incomplete. Narrow `path` if you need a complete list.
|
|
139
180
|
|
|
140
181
|
## Syntax search
|
|
141
182
|
|
|
142
|
-
`ast_search` runs [ast-grep](https://ast-grep.github.io/) in files or inside a returned Read, Search or edit result, for every language ast-grep supports. It takes either a `pattern` in source-code syntax, with `$NAME` and `$$$ARGS` captures, or an ast-grep `rule` object with a `language`. Rules add relations such as `inside`, `has`, `not`, `follows` and `precedes`. With a result as `path`, `relation: "enclosing"` returns the innermost match that contains each range, for example the function around a text match. Matches and captures are guarded `SEARCH#` and `RESULT#` selections like text search results. The agent guide is `docs:ast-search`.
|
|
183
|
+
`ast_search` runs [ast-grep](https://ast-grep.github.io/) in files or inside a returned Read, Search or edit result, for every language ast-grep supports. It takes either a `pattern` in source-code syntax, with `$NAME` and `$$$ARGS` captures, or an ast-grep `rule` object with a `language`. Rules add relations such as `inside`, `has`, `not`, `follows` and `precedes`. With a result as `path`, `relation: "enclosing"` returns the innermost match that contains each range, for example the function around a text match. Matches and captures are guarded `SEARCH#` and `RESULT#` selections like text search results. Pi Agent IDE ships its own ast-grep for local projects, so no system-wide install is needed; SSH targets still use the `ast-grep` on their own PATH. If the bundled ast-grep cannot start, the tool is not offered and the doctor names the reason. The agent guide is `docs:ast-search`.
|
|
143
184
|
|
|
144
185
|
## Language-server search
|
|
145
186
|
|
|
146
|
-
`lsp_search` asks the project's language servers. `query` finds declarations and references by symbol name in the workspace, a path or a returned result; `references: true` follows symbols found inside that scope to references elsewhere in the workspace. `declaration: "file#selector"` returns one declaration as a guarded `SEARCH#` selection. `calls: "file"` or `calls: "file#selector"` lists references and incoming and outgoing calls.
|
|
187
|
+
`lsp_search` asks the project's language servers. `query` finds declarations and references by symbol name in the workspace, a path or a returned result; `references: true` follows symbols found inside that scope to references elsewhere in the workspace. `declaration: "file#selector"` returns one declaration as a guarded `SEARCH#` selection; a selector segment with parameter types, such as `clamp(int, float)`, names one overload, and each definition in a `query` result shows its selector. `calls: "file"` or `calls: "file#selector"` lists references and incoming and outgoing calls. Pass the returned declaration or its match to an editing tool to edit its complete lines as text. The result also exposes `capture name: RESULT#…`, available in Codemode as `matches[0].captures.name[0]`. Replace that capture with a new identifier to rename through the language server, including references, imports and shorthand forms. A rename takes one capture without start/end; replacing the whole declaration remains a text edit.
|
|
188
|
+
|
|
189
|
+
In Codemode, `query` and `declaration` resolve to `{ id, complete, matches }` like Search, with every match unless `limit` is set; a declaration's one match holds the whole declaration. `calls` resolves to `{ id, complete, matches, incoming, outgoing }`: references in `matches`, and each caller and callee as its whole declaration, in whole lines like `declaration`. A call at module level has the whole file as its caller in TypeScript, so that `incoming` entry selects the whole file. A file's calls merge the lists of its top-level declarations. `id` selects the references, and each match's `id` selects that match. `complete: false` marks C and C++ answers that can miss references, as below, and calls in a direction the server does not support.
|
|
190
|
+
|
|
191
|
+
For C and C++, clangd needs extra handling. After a fatal clang error, clang stops instantiating templates. The 20-error limit is one such error and a missing `#include` is another. Code after it that needs a new instantiation then has no references, and clang reports nothing there.
|
|
192
|
+
|
|
193
|
+
- Pi starts clangd through a small POSIX launcher. The launcher writes a clangd user config that adds `-ferror-limit=0`, followed by the user's own `clangd/config.yaml`, to `~/.cache/pi-agent-ide/clangd-config`, or to a private temporary directory when that is not writable. User config takes precedence over a project's `.clangd`, so only a limit in the user's own config still applies. clangd reads this config on Linux and other non-Apple Unix systems.
|
|
194
|
+
- Before references, the calls of one symbol and a rename, Pi opens up to 32 workspace files whose text contains the name. It finds them with `rg` on the machine that owns the files. Their references then come from a fresh parse instead of clangd's background index, which parses whole files and lags behind edits.
|
|
195
|
+
- A fatal clang error in a file the answer depends on, or more files than the limit, marks `lsp_search` and the calls view incomplete and names the files. An LSP rename in that case changes nothing and says why.
|
|
196
|
+
- The calls of a whole file check only files that are already open.
|
|
147
197
|
|
|
148
198
|
## Narrowing a result
|
|
149
199
|
|
|
@@ -166,19 +216,35 @@ They share the same Resource and anchor contracts. A mutation can resolve one or
|
|
|
166
216
|
|
|
167
217
|
Use an ordinary path without text selectors for whole-file Write or whole-object Delete, Copy, and Move. Copy and Move require an explicit destination path. They support regular files, directories and symlink objects, including local/SSH transfers. Directory merge/replace behavior, safety checks and uncertain effects are described in [directory operations](./directory-operations.md).
|
|
168
218
|
|
|
169
|
-
To save an image a Read returned, such as a terminal screenshot or image file, pass that Read result as Write `content`: the image value itself in Codemode, or the result's UUID or `RESULT#` reference in a direct call. Write saves the exact image bytes, and the file extension must match the image type (`.png`, `.jpg`/`.jpeg`, `.webp`, `.gif`). Several frames become numbered files: `<name>-01.png`, `<name>-02.png`… beside the path, or `frame-01.png`… inside a folder path.
|
|
219
|
+
Write `content` is a plain string and is saved exactly as given, including JSON text such as `{"a": 1.0}`. Images use a separate parameter. To save an image a Read returned, such as a terminal screenshot or image file, pass that Read result as Write `image` instead of `content`: the image value itself in Codemode, or the result's UUID or `RESULT#` reference in a direct call. Write saves the exact image bytes, and the file extension must match the image type (`.png`, `.jpg`/`.jpeg`, `.webp`, `.gif`). Several frames become numbered files: `<name>-01.png`, `<name>-02.png`… beside the path, or `frame-01.png`… inside a folder path. A call takes exactly one of `content` and `image`. Text in `content` is never treated as an image, even when it is an image result's UUID; `image` refuses anything other than an image result, including the reference of a result without images. Images are written to local files only.
|
|
220
|
+
|
|
221
|
+
Whole-file text Write refuses to replace a file if it changed since the current Pi process last read or wrote it. Read the whole current file and rebuild the replacement, or use a targeted edit. A partial Read can establish the first observation, but does not clear a conflict. For large files, Read inside Codemode to get the full text. Creating a new file does not require a prior Read.
|
|
170
222
|
|
|
171
|
-
For selected-text work, a path identifies the source and anchors identify the span. Pass an unchanged Read, Search or mutation result when it already selects the wanted text. `replace` changes each selected range; `delete` removes those ranges while keeping the file; `insert` adds text at the selected range's start or end.
|
|
223
|
+
For selected-text work, a path identifies the source and anchors identify the span. Pass an unchanged Read, Search or mutation result when it already selects the wanted text. `replace` changes each selected range; `delete` removes those ranges while keeping the file; `insert` adds text at the selected range's start or end. A directory listing or read-only view does not grant text-edit authority.
|
|
172
224
|
|
|
173
|
-
|
|
225
|
+
Selectors only locate the span. A span covers whole lines if it starts at a line start (after any BOM) and ends before or after the last line's ending. `delete` and empty `replace` remove whole lines with their separators; nonempty `replace` keeps the last selected line's ending, including none at EOF. At a line edge, use text containing a line break to insert separate lines, or `separation: "blank-line"` to separate a paragraph. The first break at each edge of an inserted text block is a separator; additional breaks add empty lines and count toward `blank-line` separation. Text made only of breaks inserts one empty line per break. Single-line text with default separation and mid-line insertions go at the selected boundary. Copy and Move land whole lines separately at line edges or over whole-line targets; partial targets use the copied content as characters. [Editing principles](https://github.com/alexshpunt/pi-agent-ide/blob/main/src/extensions/pi-agent-text-editor/docs/editing-principles.md) give the byte rules for BOMs, line endings and look-alike characters.
|
|
174
226
|
|
|
175
|
-
|
|
227
|
+
A result passed together with selectors limits them to its ranges: they resolve in the result's file, exact text needs to be unique only inside those ranges, and a selector outside them, or a pair in two different ranges, fails and names the result's selection, such as `task.txt line 2`. With a result of several files, the edit goes to the one file whose selection holds the selector. Selector parameters also take a value with an id, such as a Search match in Codemode, as source parameters do.
|
|
228
|
+
|
|
229
|
+
Narrow a result with Search rather than reconstructing boundaries from previews.
|
|
230
|
+
|
|
231
|
+
For Replace, Delete, Copy and Move, use `at` or `from` alone for one source selection, or omit source selectors when `path` is an issued selection. For a range, pass one opening selector (`from` includes its match; `after` excludes it) and one closing selector (`through` includes its match; `before` excludes it). The closing selector must match once among the matches from the opening match on: several matches are refused, with each candidate's line number and line anchor and one ready call, and nothing changes. With `from` and `through`, the closing match can start inside the opening match. The range includes both matches in full. Use `through` for a block's own closing line. When a block has no closing line and ends at the next block's start, use `before` with that opening line, such as the next heading. Do not combine `at` with boundaries. Snapshot-backed selectors reject changed files; the tools refuse missing or ambiguous exact text.
|
|
232
|
+
|
|
233
|
+
Copy and Move use the same words for their destinations: `targetAt` or `targetFrom` alone replaces one span; `targetFrom` or `targetAfter` with `targetThrough` or `targetBefore` replaces a range. Pass only `targetAfter` or only `targetBefore` to insert next to a match. Omit destination selectors when an issued `target` already selects the span to replace. Source and destination selections can be paired when their counts match. Text selectors do not apply to whole-object transfers.
|
|
234
|
+
|
|
235
|
+
For text Insert, pass either `after` or `before` with the match next to the insertion. Set neither when `path` already selects the text and the insertion should follow it.
|
|
176
236
|
|
|
177
237
|
Independent standalone edits in one tool-call batch use their original snapshots. Inside native Codemode, run dependent edits in order and independent resources concurrently. Dependent source-tool calls commit eligible pending edits before consuming their results; script completion saves the remaining batch. Write saves its file and finishes post-edit processing before returning. No Apply or Flush tool is needed.
|
|
178
238
|
|
|
179
|
-
|
|
239
|
+
In native Codemode, Search selections for one local file share the pending snapshot batch with content-anchor edits. Pass the Search value, a match or its ID, or an issued `SEARCH#` selector; an owned selector can supply an omitted source or target path. Remote/provider sources, multi-file Search selections and pending-edit result references still end the batch. A vanished Search match fails only its own edit at commit; inspect the script's final effects to see which peers were saved.
|
|
240
|
+
|
|
241
|
+
In Codemode, `replace`, `insert`, `write`, `copy`, `move` and `undo` resolve to the `RESULT#<uuid>` id of the text they produced when the selection is verified; a whole-file Copy, Move or Undo of a text file selects the whole new file. Pass it to the next tool's source parameter: `tools.search({ path: await tools.replace(…), query })`. An id of an edit still pending in the script's batch works too; that call commits the batch first. An edit whose targets already have the text writes nothing and still resolves to the id of that text. An edit that selects no text, such as a directory or binary copy, terminal input or an image Write, resolves to `null`; filesystem and text `delete` resolves to `null`; a provider action keeps its value or receipt. A successful edit also resolves to `null` when its output selection cannot be verified, for example if another process changes the file before publication. Check the Codemode result's failure block to distinguish failed calls, and read the file before further edits when there is no verified selection. A resource provider's semantic action, such as a computer-use action, resolves to the value the provider returns. The Codemode result reports the text changes of the script's edits and lists every failed edit in its failure block.
|
|
242
|
+
|
|
243
|
+
Several Pi processes on one machine can edit the same file. Their reads and writes of a file run one at a time, and a write replaces the file in one step, so neither Pi nor other programs such as ripgrep or a language server read a half-written file, and a write never replaces text that changed after its edit read the file. Such an edit runs again on the current text: exact text, line anchors, AST scope markers and complete `SEARCH#…:all` forms resolve again, and `RESULT#…` and numbered `SEARCH#…` references, also those of `move` and `copy`, move to their new positions or fail with their current lines when their own text changed, in every source, destination and selector field and in the check before a direct call alike, always in the text the edit reads; a line anchor fails when its own line changed, the anchor of a repeated line also when the lines between it and the nearest unique line of its own block changed or a copy of its text appeared or went away before the nearest unique line on the other side, and the anchor of a blank line also when a neighbouring block moved. An ordinary edit tries at most 8 times and starts no new attempt more than 10 seconds after its first attempt found newer text, so the first attempt can take longer and still be retried; then it fails without writing and says that another process kept writing the file. The edits a native Codemode script has accepted also run again on the current text. A call whose anchor no longer resolves fails alone, the others are saved, and the script result names the failed call. When another process rewrites the file before a Codemode batch's final post-processing, the batch's edits stay saved, post-processing of the newer text is skipped, and the result says so. When a language server answered for an older version of the file, `lsp_search` results move with their unchanged lines; a declaration whose own lines changed is resolved again, and one the server cannot answer for because the file keeps changing fails with a clear message. An `lsp_search` whose file another process writes while the server answers runs again on the current text. References are asked for at the position the declaration has in the text the server holds, so a reference list stays complete while another process keeps writing the file. `ast_search` parses the same bytes it reports on. A `search` registers its anchors from the text it read itself, so a file another process writes in between keeps the anchors of the matches that text holds and the whole result stays usable as an edit source; a matched file that can no longer be read is left out with a notice naming the reason, and a search left with nothing to register fails with that reason instead of showing matches it cannot anchor. An empty list of incoming calls notes that the server's index can miss callers added in the last seconds.
|
|
244
|
+
|
|
245
|
+
When a rename through a declaration's name capture detects newer text, `replace` retries within the same call. Recovery allows up to nine retries in one 12-second window and cancels any refresh still planning after four seconds. Initial server startup for a fresh selection is outside that window. A C-family rename can carry identifier edits across changes to blank lines and simple comments. It can also follow indentation changes when the source has no signs of preprocessing. Changes that can affect symbol lookup or introduce references require a fresh server plan. If recovery runs out of attempts or time, no files change and `replace` reports how long the call ran. Repeat `replace` with the same capture and new name to start a new recovery window. If the capture no longer identifies the declaration, run `lsp_search` again.
|
|
180
246
|
|
|
181
|
-
Check the final reported effects after failures or interruptions. An error does not prove rollback: earlier accepted edits can remain, and recursive operations have no atomic undo. Use text undo or Git-change undo deliberately; neither is a script-wide transaction. See [result composition](./structured-results.md)
|
|
247
|
+
Check the final reported effects after failures or interruptions. An error does not prove rollback: earlier accepted edits can remain, and recursive operations have no atomic undo. Use text undo or Git-change undo deliberately; neither is a script-wide transaction. See [result composition](./structured-results.md) for reference lifetime and recovery.
|
|
182
248
|
|
|
183
249
|
An omitted path can reuse the last resolved source when it is unambiguous. Supply the path when several resources could be meant.
|
|
184
250
|
|
|
@@ -189,8 +255,8 @@ Anchors are opaque references owned by registered resolvers. The editor does not
|
|
|
189
255
|
Common built-in forms include:
|
|
190
256
|
|
|
191
257
|
```text
|
|
192
|
-
|
|
193
|
-
scope-begin-
|
|
258
|
+
K7M2QX4 a line, named by its content
|
|
259
|
+
scope-begin-K7M2QX4 a structural boundary
|
|
194
260
|
SEARCH#19AF:3:line one result's full line
|
|
195
261
|
SEARCH#19AF:3:match one exact match
|
|
196
262
|
SEARCH#19AF:all:line each unique containing line
|
package/docs/user-hooks.md
CHANGED
|
@@ -67,7 +67,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
67
67
|
|
|
68
68
|
This hook covers whole-object Delete calls for regular files, directories, and symlinks, plus directory/symlink Move source removal and existing destination removal. Both standalone and native Codemode calls use it. It does not cover selected-text removal, terminal/debugger actions, Copy, or ordinary-file Move. The event provides `path` (absolute requested path, or canonical SSH URI), `resolvedPath` (parent symlinks resolved, final symlink left alone), `cwd`, `kind`, `recursive`, and an optional abort `signal`. SSH events keep the target owner on all three paths; filesystem and Git checks run on that target. It runs once before removal and any user dialog. A denial or thrown error blocks removal; allowing does not override another hook or built-in protection.
|
|
69
69
|
|
|
70
|
-
Delete removes directories recursively and unlinks symlinks, including broken ones, without traversing their targets. The built-in policy uses the Git worktree containing Pi's cwd. For SSH it uses the selected target's project directory, not the controller's cwd.
|
|
70
|
+
Delete removes directories recursively and unlinks symlinks, including broken ones, without traversing their targets. The built-in policy uses the Git worktree containing Pi's cwd. For SSH it uses the selected target's project directory, not the controller's cwd. Directories and symlinks that are tracked or contain tracked or newly staged entries require host permission. External directories and symlinks and targets without a Git worktree also require permission unless they are eligible [temporary directories](./configuration.md#temporary-directory-deletion), including the temporary root itself. SSH temporary roots and settings come from that target's account and project. Failed Git checks inside the current project still require permission. Untracked directories and symlinks inside that worktree need no dialog. Deleting a regular file needs no dialog, even when Git tracks it; hooks and protected paths still apply to it.
|
|
71
71
|
|
|
72
72
|
The shared dialog names the exact target, reason, and operation. User-configured YOLO or a matching session grant can supply permission without a dialog; see [Operation confirmations and YOLO](configuration.md#operation-confirmations-and-yolo). Otherwise refusal, dismissal, cancellation or an unavailable dialog prevents removal. Project roots, their ancestors, filesystem roots, and current Git control paths are always blocked, even when a hook or YOLO allows. Git control protection also covers regular-file `.git` markers. Without Git, cwd and its ancestors are protected.
|
|
73
73
|
|
|
@@ -56,6 +56,8 @@ export interface ToolRecipe {
|
|
|
56
56
|
readonly output: "in-place" | "stdout";
|
|
57
57
|
};
|
|
58
58
|
readonly linter?: {
|
|
59
|
+
/** False requires an explicit enabled override before automatic lint selection. */
|
|
60
|
+
readonly enabled?: boolean;
|
|
59
61
|
readonly extensions: readonly string[];
|
|
60
62
|
|
|
61
63
|
/** Exact basenames accepted in addition to the file extensions. */
|
|
@@ -65,7 +65,7 @@ export async function isExecutableAvailable(
|
|
|
65
65
|
]
|
|
66
66
|
: [];
|
|
67
67
|
const candidates = locations.flatMap((location) => [
|
|
68
|
-
location,
|
|
68
|
+
...(process.platform !== "win32" || path.extname(location) ? [location] : []),
|
|
69
69
|
...suffixes.map((suffix) => `${location}${suffix}`),
|
|
70
70
|
]);
|
|
71
71
|
for (const candidate of candidates) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.
|
|
10
|
-
"pi-agent-invariant": "0.
|
|
11
|
-
"pi-agent-read": "0.
|
|
12
|
-
"pi-agent-resource": "0.
|
|
13
|
-
"pi-agent-text": "0.
|
|
14
|
-
"pi-agent-text-editor": "0.
|
|
9
|
+
"pi-agent-image": "1.0.0",
|
|
10
|
+
"pi-agent-invariant": "1.0.0",
|
|
11
|
+
"pi-agent-read": "1.0.0",
|
|
12
|
+
"pi-agent-resource": "1.0.0",
|
|
13
|
+
"pi-agent-text": "1.0.0",
|
|
14
|
+
"pi-agent-text-editor": "1.0.0"
|
|
15
15
|
},
|
|
16
16
|
"pi": {
|
|
17
17
|
"extensions": [
|
|
@@ -2,10 +2,10 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { mkdir, rm, stat } from "node:fs/promises";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { EDIT_WAIT_TIMEOUT_MS } from "pi-agent-resource";
|
|
5
6
|
|
|
6
7
|
/** A lock older than this belongs to a process that died while holding it. */
|
|
7
8
|
const STALE_LOCK_MS = 10_000;
|
|
8
|
-
const WAIT_TIMEOUT_MS = 30_000;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Runs `action` while no other Pi process on this machine reads or writes the same file through
|
|
@@ -46,9 +46,13 @@ async function acquire(
|
|
|
46
46
|
} catch {
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const deadline = performance.now() + EDIT_WAIT_TIMEOUT_MS;
|
|
50
50
|
for (;;) {
|
|
51
51
|
signal?.throwIfAborted();
|
|
52
|
+
if (performance.now() >= deadline)
|
|
53
|
+
throw Object.assign(new Error(`Timed out waiting for the write lock on ${filePath}`), {
|
|
54
|
+
code: "LOCK_TIMEOUT",
|
|
55
|
+
});
|
|
52
56
|
try {
|
|
53
57
|
await mkdir(lock);
|
|
54
58
|
return true;
|
|
@@ -63,8 +67,6 @@ async function acquire(
|
|
|
63
67
|
await rm(lock, { recursive: true, force: true });
|
|
64
68
|
continue;
|
|
65
69
|
}
|
|
66
|
-
if (Date.now() - started > WAIT_TIMEOUT_MS)
|
|
67
|
-
throw new Error(`Timed out waiting for another Pi process to finish with ${filePath}`);
|
|
68
70
|
await new Promise((resolve) => setTimeout(resolve, 5 + Math.random() * 20));
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
import { realpath, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
2
|
+
import { chmod, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -29,11 +29,14 @@ export async function replaceFileContent(
|
|
|
29
29
|
`.${path.basename(target)}.${randomBytes(6).toString("hex")}.pi-tmp`,
|
|
30
30
|
);
|
|
31
31
|
try {
|
|
32
|
+
const mode = existing.mode & 0o7777;
|
|
32
33
|
await writeFile(temporary, bytes, {
|
|
33
|
-
mode
|
|
34
|
+
mode,
|
|
34
35
|
flag: "wx",
|
|
35
36
|
...(signal !== undefined && { signal }),
|
|
36
37
|
});
|
|
38
|
+
// The process umask narrows the mode a file is created with; the replacement keeps the original.
|
|
39
|
+
await chmod(temporary, mode);
|
|
37
40
|
await rename(temporary, target);
|
|
38
41
|
} catch (error) {
|
|
39
42
|
await rm(temporary, { force: true });
|
|
@@ -70,21 +70,32 @@ function resolveFilesystemSource(
|
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
72
|
})();
|
|
73
|
-
|
|
73
|
+
// undefined is unread; null is an observed absence.
|
|
74
|
+
let sourceBytes: Uint8Array | null | undefined;
|
|
75
|
+
let entries: readonly string[] | undefined;
|
|
74
76
|
const read = async ({ signal }: { readonly signal?: AbortSignal }) => {
|
|
75
77
|
sourceBytes = undefined;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
entries = undefined;
|
|
79
|
+
if (isDirectory)
|
|
80
|
+
return readDirectoryContent(filePath, signal, (names) => {
|
|
81
|
+
entries = names;
|
|
82
|
+
});
|
|
83
|
+
return readFilesystemContent(filePath, contentHost, signal, (bytes) => {
|
|
84
|
+
sourceBytes = bytes;
|
|
85
|
+
}).catch((error: unknown) => {
|
|
86
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") sourceBytes = null;
|
|
87
|
+
throw error;
|
|
88
|
+
});
|
|
81
89
|
};
|
|
82
90
|
const resource = {
|
|
83
91
|
source: filePath,
|
|
84
92
|
link,
|
|
85
93
|
read,
|
|
86
94
|
get sourceBytes() {
|
|
87
|
-
return sourceBytes;
|
|
95
|
+
return sourceBytes ?? undefined;
|
|
96
|
+
},
|
|
97
|
+
get entries() {
|
|
98
|
+
return entries;
|
|
88
99
|
},
|
|
89
100
|
};
|
|
90
101
|
|
|
@@ -97,7 +108,7 @@ function resolveFilesystemSource(
|
|
|
97
108
|
resource: {
|
|
98
109
|
...resource,
|
|
99
110
|
get sourceBytes() {
|
|
100
|
-
return sourceBytes;
|
|
111
|
+
return sourceBytes ?? undefined;
|
|
101
112
|
},
|
|
102
113
|
async write(content, operationContext) {
|
|
103
114
|
throwIfAborted(operationContext.signal);
|
|
@@ -113,7 +124,7 @@ function resolveFilesystemSource(
|
|
|
113
124
|
if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
|
|
114
125
|
throw error;
|
|
115
126
|
});
|
|
116
|
-
if (
|
|
127
|
+
if (expected === null ? current !== undefined : !current?.equals(expected))
|
|
117
128
|
throw new ResourceError("RESOURCE_CHANGED", filePath, "not-applied");
|
|
118
129
|
}
|
|
119
130
|
const bytes = Buffer.from(text, "utf8");
|
|
@@ -125,7 +136,11 @@ function resolveFilesystemSource(
|
|
|
125
136
|
};
|
|
126
137
|
}
|
|
127
138
|
|
|
128
|
-
function readDirectoryContent(
|
|
139
|
+
function readDirectoryContent(
|
|
140
|
+
filePath: string,
|
|
141
|
+
signal: AbortSignal | undefined,
|
|
142
|
+
capture: (entries: readonly string[]) => void,
|
|
143
|
+
) {
|
|
129
144
|
throwIfAborted(signal);
|
|
130
145
|
|
|
131
146
|
const entries = readdirSync(filePath, { withFileTypes: true });
|
|
@@ -140,6 +155,7 @@ function readDirectoryContent(filePath: string, signal: AbortSignal | undefined)
|
|
|
140
155
|
lines.push(` ${icon} ${entry.name}`);
|
|
141
156
|
}
|
|
142
157
|
|
|
158
|
+
capture(entries.map((entry) => (entry.isDirectory() ? `${entry.name}/` : entry.name)));
|
|
143
159
|
return [{ type: "text" as const, text: lines.join("\n") }] as const;
|
|
144
160
|
}
|
|
145
161
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#extension": "./index.ts"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-image": "0.
|
|
10
|
-
"pi-agent-resource": "0.
|
|
9
|
+
"pi-agent-image": "1.0.0",
|
|
10
|
+
"pi-agent-resource": "1.0.0"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-jq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
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-doctor": "0.
|
|
16
|
-
"pi-agent-documentation": "0.
|
|
17
|
-
"pi-agent-read": "0.
|
|
18
|
-
"pi-agent-text": "0.
|
|
15
|
+
"pi-agent-doctor": "1.0.0",
|
|
16
|
+
"pi-agent-documentation": "1.0.0",
|
|
17
|
+
"pi-agent-read": "1.0.0",
|
|
18
|
+
"pi-agent-text": "1.0.0"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-filesystem-pdf",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"pi-agent-pdf": "0.
|
|
7
|
-
"pi-agent-resource": "0.
|
|
6
|
+
"pi-agent-pdf": "1.0.0",
|
|
7
|
+
"pi-agent-resource": "1.0.0"
|
|
8
8
|
},
|
|
9
9
|
"pi": {
|
|
10
10
|
"extensions": [
|