pi-agent-ide 0.7.3 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -35
- package/README.md +70 -19
- package/dist/chunk-246NTPOS.js +1 -0
- package/dist/chunk-2ITKAXHO.js +1 -0
- package/dist/chunk-3WO2NOEQ.js +1 -0
- package/dist/{chunk-ZTYWHL2F.js → chunk-47SPPIXK.js} +1 -1
- package/dist/chunk-4HWKBCBH.js +1 -0
- package/dist/chunk-4W7GH3T7.js +10 -0
- package/dist/{chunk-JMVDFOTQ.js → chunk-57F5GTHO.js} +1 -1
- package/dist/chunk-6EDOLYOV.js +1 -0
- package/dist/chunk-756K3LJY.js +1 -0
- package/dist/chunk-7LOVUWNI.js +1 -0
- package/dist/chunk-A64JRDZK.js +1 -0
- package/dist/chunk-AIT3YWR5.js +3 -0
- package/dist/chunk-AKNHSDGV.js +1 -0
- package/dist/chunk-AUL5FGGK.js +2 -0
- package/dist/chunk-BB4A5UI3.js +5 -0
- package/dist/chunk-BQAKA3FU.js +1 -0
- package/dist/chunk-BR7GRH4A.js +5 -0
- package/dist/chunk-BXGMMZT3.js +1 -0
- package/dist/{chunk-ZIWPKIBZ.js → chunk-D4IA2MTA.js} +1 -1
- package/dist/chunk-DUUOCBS3.js +3 -0
- package/dist/chunk-DXONCYWF.js +3 -0
- package/dist/chunk-E2PHA4SQ.js +1 -0
- package/dist/{chunk-H445SHSJ.js → chunk-EMRJP6EM.js} +1 -1
- package/dist/chunk-GEMDU6XW.js +1 -0
- package/dist/chunk-GNACBJM3.js +1 -0
- package/dist/chunk-HCK7OIQ3.js +1 -0
- package/dist/chunk-HFJGCYFO.js +11 -0
- package/dist/chunk-ID4RJIVZ.js +9 -0
- package/dist/chunk-IMGIDBCC.js +1 -0
- package/dist/chunk-JKMXND6V.js +1 -0
- package/dist/chunk-L2B4DTVS.js +1 -0
- package/dist/chunk-LAJQSHEI.js +4 -0
- package/dist/chunk-LEKC4GQK.js +5 -0
- package/dist/chunk-LLRUJD62.js +1 -0
- package/dist/{chunk-2ZMMRINH.js → chunk-M4TVRCMZ.js} +1 -1
- package/dist/chunk-MKEC3U2M.js +4 -0
- package/dist/chunk-N56WAVYA.js +1 -0
- package/dist/chunk-OFILFO6D.js +1 -0
- package/dist/chunk-OI3HBIPK.js +2 -0
- package/dist/{chunk-S6QRG3TQ.js → chunk-OM4LYD3S.js} +1 -1
- package/dist/{chunk-WLZIUMJL.js → chunk-PRLIHLCS.js} +1 -1
- package/dist/chunk-Q5X6OXNS.js +2 -0
- package/dist/chunk-R2U5WXYR.js +1 -0
- package/dist/chunk-S72FVLUX.js +1 -0
- package/dist/chunk-SWA5B5B2.js +9 -0
- package/dist/chunk-T4FTT3U4.js +1 -0
- package/dist/chunk-T7MWQQIF.js +3 -0
- package/dist/chunk-TGC2ZACO.js +1 -0
- package/dist/chunk-TOYN4W4F.js +1 -0
- package/dist/chunk-TXG2H7YQ.js +9 -0
- package/dist/{chunk-QFTBY67N.js → chunk-UEVGZUII.js} +3 -3
- package/dist/{chunk-7UGNGK7Y.js → chunk-VAXLSPPU.js} +1 -1
- package/dist/chunk-VDP5CQHM.js +3 -0
- package/dist/chunk-VMGZMXEM.js +10 -0
- package/dist/chunk-VNTY7BKC.js +1 -0
- package/dist/chunk-W3YFF6OO.js +1 -0
- package/dist/chunk-W7M3V7FR.js +28 -0
- package/dist/chunk-WMHSVEIT.js +29 -0
- package/dist/chunk-WPBQ45ZL.js +1 -0
- package/dist/chunk-WXGTU2M6.js +1 -0
- package/dist/chunk-XSIKDVAR.js +25 -0
- package/dist/chunk-YHREORHH.js +2 -0
- package/dist/chunk-YJ6T3PEP.js +1 -0
- package/dist/chunk-YTYLS2UM.js +1 -0
- package/dist/chunk-Z2QGNTGQ.js +1 -0
- package/dist/{chunk-QDLTO5PH.js → chunk-ZAWRSA7N.js} +1 -1
- package/dist/chunk-ZV5ETNLQ.js +1 -0
- package/dist/entry-0.js +1 -1
- package/dist/entry-1.js +1 -1
- package/dist/entry-10.js +1 -1
- package/dist/entry-11.js +1 -1
- package/dist/entry-13.js +1 -1
- package/dist/entry-14.js +1 -1
- package/dist/entry-15.js +1 -1
- package/dist/entry-16.js +1 -1
- package/dist/entry-17.js +1 -1
- package/dist/entry-18.js +1 -0
- package/dist/entry-2.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-23.js +1 -1
- package/dist/entry-24.js +1 -1
- package/dist/entry-25.js +1 -2
- package/dist/entry-26.js +1 -1
- package/dist/entry-27.js +2 -2
- package/dist/entry-28.js +1 -1
- package/dist/entry-29.js +4 -1
- package/dist/entry-30.js +1 -1
- package/dist/entry-31.js +1 -17
- package/dist/entry-32.js +1 -1
- package/dist/entry-33.js +18 -3
- package/dist/entry-34.js +1 -1
- package/dist/entry-35.js +1 -1
- package/dist/entry-36.js +1 -4
- package/dist/entry-37.js +1 -9
- package/dist/entry-38.js +1 -1
- package/dist/entry-39.js +1 -1
- package/dist/entry-4.js +1 -1
- package/dist/entry-40.js +1 -1
- package/dist/entry-41.js +1 -1
- package/dist/entry-42.js +1 -1
- package/dist/entry-43.js +1 -1
- package/dist/entry-44.js +1 -1
- package/dist/entry-45.js +1 -25
- package/dist/entry-46.js +1 -1
- package/dist/entry-47.js +25 -1
- package/dist/entry-48.js +1 -1
- package/dist/entry-49.js +1 -1
- package/dist/entry-50.js +1 -3
- package/dist/entry-51.js +1 -13
- package/dist/entry-52.js +3 -1
- package/dist/entry-53.js +13 -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-6.js +1 -1
- package/dist/entry-60.js +1 -1
- package/dist/entry-61.js +1 -0
- package/dist/entry-62.js +1 -1
- package/dist/entry-64.js +1 -1
- package/dist/entry-65.js +0 -1
- package/dist/entry-66.js +1 -1
- package/dist/entry-67.js +1 -1
- package/dist/entry-68.js +1 -1
- package/dist/entry-69.js +1 -1
- package/dist/entry-7.js +1 -1
- package/dist/entry-70.js +1 -1
- package/dist/entry-71.js +1 -0
- package/dist/entry-72.js +1 -1
- package/dist/entry-74.js +1 -1
- package/dist/entry-75.js +0 -1
- package/dist/entry-76.js +1 -1
- package/dist/entry-77.js +1 -80
- package/dist/entry-78.js +1 -19
- package/dist/entry-79.js +80 -2
- package/dist/entry-8.js +1 -1
- package/dist/entry-80.js +22 -1
- package/dist/entry-81.js +2 -1
- package/dist/entry-82.js +1 -5
- package/dist/entry-83.js +1 -3
- package/dist/entry-84.js +1 -1
- package/dist/entry-85.js +3 -1
- package/dist/entry-86.js +1 -1
- package/dist/entry-87.js +1 -0
- package/dist/entry-88.js +1 -0
- package/dist/pi-agent-ide.js +53 -24
- package/docs/agent-guides/debugger.md +2 -0
- package/docs/agent-guides/editing.md +1 -1
- package/docs/agent-guides/search-code.md +7 -2
- package/docs/agent-guides/ssh.md +58 -0
- package/docs/agent-guides/vision.md +6 -0
- package/docs/configuration.md +51 -5
- package/docs/development.md +1 -13
- package/docs/extensions.md +1 -1
- package/docs/releases.md +1 -1
- package/docs/settings-help.md +39 -0
- package/docs/tools.md +22 -14
- package/docs/user-hooks.md +7 -3
- package/node_modules/pi-agent-doctor/package.json +10 -9
- package/node_modules/pi-agent-doctor/runtime/entry-25.js +1 -0
- package/node_modules/pi-agent-doctor/src/evidence.ts +49 -4
- package/node_modules/pi-agent-doctor/src/executable.ts +46 -16
- package/node_modules/pi-agent-doctor/src/fixtures/executable-probe.ts +78 -0
- package/node_modules/pi-agent-doctor/src/fixtures/probe-executable-wait.mjs +10 -0
- package/node_modules/pi-agent-doctor/src/plugin-protocol.ts +6 -0
- package/node_modules/pi-agent-doctor/src/project-probes.ts +73 -0
- package/node_modules/pi-agent-doctor/src/workspace.ts +106 -0
- package/node_modules/pi-agent-documentation/package.json +2 -2
- package/node_modules/pi-agent-documentation/runtime/entry-26.js +1 -0
- package/node_modules/pi-agent-filesystem/package.json +8 -8
- package/node_modules/pi-agent-filesystem/src/resolver.ts +23 -7
- package/node_modules/pi-agent-filesystem-image/package.json +4 -4
- package/node_modules/pi-agent-filesystem-jq/index.ts +33 -6
- package/node_modules/pi-agent-filesystem-jq/package.json +6 -7
- package/node_modules/pi-agent-filesystem-jq/src/jq.ts +67 -0
- package/node_modules/pi-agent-filesystem-pdf/package.json +4 -4
- package/node_modules/pi-agent-filesystem-pdf/runtime/entry-30.js +2 -0
- package/node_modules/pi-agent-filesystem-text/package.json +4 -4
- package/node_modules/pi-agent-ide-ast/package.json +15 -41
- package/node_modules/pi-agent-ide-ast/src/ast/manager.ts +2 -1
- package/node_modules/pi-agent-ide-ast/src/ast/outline.ts +10 -3
- package/node_modules/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
- package/node_modules/pi-agent-ide-ast/src/ast/selection.ts +3 -3
- package/node_modules/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
- package/node_modules/pi-agent-ide-ast/src/extension.ts +17 -1
- package/node_modules/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
- package/node_modules/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/node_modules/pi-agent-ide-ast/src/scope-handler.ts +1 -1
- package/node_modules/pi-agent-ide-ast/src/search-presentation.ts +4 -3
- package/node_modules/pi-agent-ide-ast/src/search-resolver.ts +100 -42
- package/node_modules/pi-agent-ide-ast/src/select-presentation.ts +3 -2
- package/node_modules/pi-agent-ide-ast/src/tool-select.ts +2 -1
- package/node_modules/pi-agent-ide-changes/index.ts +10 -2
- package/node_modules/pi-agent-ide-changes/package.json +10 -11
- package/node_modules/pi-agent-ide-changes/runtime/entry-34.js +1 -0
- package/node_modules/pi-agent-ide-changes/src/change-anchor.ts +7 -2
- package/node_modules/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
- package/node_modules/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
- package/node_modules/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
- package/node_modules/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
- package/node_modules/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
- package/node_modules/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
- package/node_modules/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
- package/node_modules/pi-agent-ide-changes/src/tool-index-change.ts +47 -11
- package/node_modules/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
- package/node_modules/pi-agent-ide-formatter/index.ts +14 -2
- package/node_modules/pi-agent-ide-formatter/package.json +4 -4
- package/node_modules/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
- package/node_modules/pi-agent-ide-formatter/src/formatter.ts +41 -11
- package/node_modules/pi-agent-ide-formatter/src/registry.ts +9 -28
- package/node_modules/pi-agent-ide-languages/package.json +3 -3
- package/node_modules/pi-agent-ide-lint/index.ts +35 -4
- package/node_modules/pi-agent-ide-lint/package.json +8 -8
- package/node_modules/pi-agent-ide-lint/runtime/entry-38.js +2 -0
- package/node_modules/pi-agent-ide-lint/src/command-linter.ts +14 -10
- package/node_modules/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
- package/node_modules/pi-agent-ide-lint/src/registry.ts +9 -25
- package/node_modules/pi-agent-ide-lsp/index.ts +107 -25
- package/node_modules/pi-agent-ide-lsp/package.json +10 -13
- package/node_modules/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/node_modules/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
- package/node_modules/pi-agent-ide-lsp/src/declaration-targets.ts +5 -1
- package/node_modules/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
- package/node_modules/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
- package/node_modules/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
- package/node_modules/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
- package/node_modules/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
- package/node_modules/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
- package/node_modules/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
- package/node_modules/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
- package/node_modules/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
- package/node_modules/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
- package/node_modules/pi-agent-image/package.json +3 -3
- package/node_modules/pi-agent-invariant/package.json +2 -2
- package/node_modules/pi-agent-pdf/package.json +3 -4
- package/node_modules/pi-agent-read/package.json +12 -12
- package/node_modules/pi-agent-read/runtime/entry-45.js +0 -1
- package/node_modules/pi-agent-read/runtime/entry-47.js +2 -0
- package/node_modules/pi-agent-read/src/api/tools/read.ts +4 -2
- package/node_modules/pi-agent-read/src/core/extension.ts +4 -1
- package/node_modules/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
- package/node_modules/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
- package/node_modules/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
- package/node_modules/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
- package/node_modules/pi-agent-read/src/core/tools/tool-read.ts +20 -5
- package/node_modules/pi-agent-resource/package.json +2 -2
- package/node_modules/pi-agent-resource/src/content-conversion/content-host.ts +75 -16
- package/node_modules/pi-agent-resource/src/index.ts +3 -0
- package/node_modules/pi-agent-resource/src/resource-error.ts +17 -0
- package/node_modules/pi-agent-resource/src/resource.ts +23 -0
- package/node_modules/pi-agent-resource/src/result-targets.ts +25 -2
- package/node_modules/pi-agent-resource/src/validation.ts +2 -1
- package/node_modules/pi-agent-search/package.json +9 -9
- package/node_modules/pi-agent-search/runtime/entry-50.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-51.js +1 -0
- package/node_modules/pi-agent-search/runtime/entry-52.js +2 -0
- package/node_modules/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/node_modules/pi-agent-search/src/api/presentation.ts +10 -2
- package/node_modules/pi-agent-search/src/api/search-parameters.ts +7 -3
- package/node_modules/pi-agent-search/src/api/search.ts +51 -2
- package/node_modules/pi-agent-search/src/core/extension.ts +2 -3
- package/node_modules/pi-agent-search/src/core/search-core.ts +98 -8
- package/node_modules/pi-agent-search-text/index.ts +37 -1
- package/node_modules/pi-agent-search-text/package.json +14 -12
- package/node_modules/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/node_modules/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/node_modules/pi-agent-search-text/src/doctor-plugin.ts +10 -5
- package/node_modules/pi-agent-search-text/src/file-search.ts +26 -3
- package/node_modules/pi-agent-search-text/src/fuzzy-search.ts +54 -3
- package/node_modules/pi-agent-search-text/src/resolvers.ts +22 -5
- package/node_modules/pi-agent-search-text/src/scoped-search.ts +4 -5
- package/node_modules/pi-agent-search-text/src/search-backend.ts +123 -17
- package/node_modules/pi-agent-search-text/src/search-recipe.ts +5 -1
- package/node_modules/pi-agent-search-text/src/search-result.ts +1 -0
- package/node_modules/pi-agent-search-text/src/search-session.ts +166 -31
- package/node_modules/pi-agent-text/package.json +3 -3
- package/node_modules/pi-agent-text/src/text-document.ts +2 -0
- package/node_modules/pi-agent-text-anchor-constant/package.json +4 -4
- package/node_modules/pi-agent-text-anchor-exact/package.json +5 -6
- package/node_modules/pi-agent-text-anchor-line-hash/package.json +7 -7
- package/node_modules/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/node_modules/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
- package/node_modules/pi-agent-text-editor/package.json +26 -34
- package/node_modules/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/node_modules/pi-agent-text-editor/runtime/entry-78.js +1 -0
- package/node_modules/pi-agent-text-editor/src/api/delete-guard.ts +29 -2
- package/node_modules/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
- package/node_modules/pi-agent-text-editor/src/api/file-operations.ts +55 -0
- package/node_modules/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
- package/node_modules/pi-agent-text-editor/src/api/mutation-guard.ts +2 -0
- 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 +127 -0
- package/node_modules/pi-agent-text-editor/src/api/plugin-protocol.ts +20 -1
- package/node_modules/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/node_modules/pi-agent-text-editor/src/core/delete-policy.ts +93 -85
- package/node_modules/pi-agent-text-editor/src/core/extension.ts +15 -2
- package/node_modules/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
- package/node_modules/pi-agent-text-editor/src/core/file-operation-tools.ts +70 -25
- package/node_modules/pi-agent-text-editor/src/core/file-operations.ts +123 -27
- package/node_modules/pi-agent-text-editor/src/core/file-result-targets.ts +30 -1
- package/node_modules/pi-agent-text-editor/src/core/file-transfers.ts +147 -105
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/node_modules/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/node_modules/pi-agent-text-editor/src/core/mutation-result-targets.ts +91 -14
- package/node_modules/pi-agent-text-editor/src/core/native-text-edit-batch.ts +74 -9
- package/node_modules/pi-agent-text-editor/src/core/temporary-directories.ts +49 -25
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +122 -39
- package/node_modules/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/node_modules/pi-agent-text-editor/src/core/text-editor-core.ts +307 -32
- package/node_modules/pi-agent-text-editor/src/core/text-mutation.ts +85 -31
- package/node_modules/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/node_modules/pi-agent-text-editor/src/core/write-agent-result.ts +4 -1
- package/node_modules/pi-agent-text-editor-renderer/package.json +6 -8
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-80.js +2 -0
- package/node_modules/pi-agent-text-editor-renderer/src/renderer.ts +139 -27
- package/node_modules/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/node_modules/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/node_modules/pi-agent-tool-call-interception/package.json +3 -3
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-82.js +1 -0
- package/node_modules/pi-agent-tool-ui/package.json +2 -2
- package/node_modules/pi-agent-tool-ui/runtime/entry-83.js +1 -0
- package/node_modules/pi-agent-web/index.ts +28 -4
- package/node_modules/pi-agent-web/package.json +8 -11
- package/node_modules/pi-agent-web/src/doctor-plugin.ts +21 -6
- package/node_modules/pi-agent-web/src/resolver.ts +12 -2
- package/node_modules/pi-agent-web/src/search.ts +2 -1
- package/node_modules/pi-agent-web-html/package.json +3 -5
- package/node_modules/pi-agent-web-image/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/package.json +4 -4
- package/node_modules/pi-agent-web-pdf/runtime/entry-87.js +2 -0
- package/node_modules/pi-agent-web-text/package.json +4 -4
- package/node_modules/pi-agent-web-text/runtime/entry-88.js +2 -0
- package/package.json +43 -39
- package/skills/configure-agent-ide/SKILL.md +38 -0
- package/src/api/content.ts +6 -0
- package/src/api/doctor-runtime.ts +80 -0
- package/src/api/doctor.ts +6 -0
- package/src/api/hooks.ts +3 -0
- package/src/api/plugin-protocol.ts +11 -1
- package/src/api/tips.ts +3 -0
- package/src/api/tool-config.ts +143 -24
- package/src/backend/config.ts +85 -0
- package/src/backend/configured-process.ts +59 -0
- package/src/backend/dap-java-transport.ts +112 -0
- package/src/backend/dap-java-worker.py +218 -0
- package/src/backend/dap-node-transport.ts +112 -0
- package/src/backend/dap-powershell-worker.py +44 -0
- package/src/backend/dap-r-worker.py +210 -0
- package/src/backend/dap-tcp-transport.ts +42 -0
- package/src/backend/dap-tcp-worker.py +125 -0
- package/src/backend/dap-transport.ts +69 -0
- package/src/backend/dap-unix-worker.py +63 -0
- package/src/backend/debugger-registration.ts +62 -0
- package/src/backend/debugger-workspace-owner.ts +413 -0
- package/src/backend/doctor-inventory-worker.py +54 -0
- package/src/backend/doctor-probe-worker.py +140 -0
- package/src/backend/doctor-registration.ts +18 -0
- package/src/backend/doctor-workspace.ts +381 -0
- package/src/backend/file-operation-resolver.ts +58 -0
- package/src/backend/file-revision.ts +13 -0
- package/src/backend/file-transfer.ts +302 -0
- package/src/backend/file-watch-worker.py +119 -0
- package/src/backend/formatter-registration.ts +114 -0
- package/src/backend/git-registration.ts +60 -0
- package/src/backend/identity.ts +47 -0
- package/src/backend/index.ts +12 -0
- package/src/backend/lint-registration.ts +102 -0
- package/src/backend/lsp-file-watchers.ts +220 -0
- package/src/backend/lsp-registration.ts +83 -0
- package/src/backend/lsp-transport.ts +87 -0
- package/src/backend/lsp-workspace-owner.ts +50 -0
- package/src/backend/object-transfer.ts +299 -0
- package/src/backend/owned-command.ts +105 -0
- package/src/backend/owned-process-stop.ts +36 -0
- package/src/backend/owned-read-command.ts +20 -0
- package/src/backend/process-environment.ts +77 -0
- package/src/backend/process-metadata-worker.py +98 -0
- package/src/backend/process-metadata.ts +99 -0
- package/src/backend/recipe-evidence-worker.py +26 -0
- package/src/backend/recipe-evidence.ts +77 -0
- package/src/backend/registration.ts +124 -0
- package/src/backend/registry.ts +29 -0
- package/src/backend/resource-resolver.ts +147 -0
- package/src/backend/search-environment.ts +100 -0
- package/src/backend/ssh-channel-worker.py +306 -0
- package/src/backend/ssh-channel.ts +376 -0
- package/src/backend/ssh-transfer-worker.py +99 -0
- package/src/backend/ssh-transport.ts +54 -0
- package/src/backend/ssh-worker.py +730 -0
- package/src/backend/ssh.ts +610 -0
- package/src/backend/tool-config-access.ts +63 -0
- package/src/backend/tool-project.ts +71 -0
- package/src/backend/vision-capture-worker.py +319 -0
- package/src/backend/vision-capture.ts +165 -0
- package/src/backend/vision-registration.ts +104 -0
- package/src/backend/web-browser-worker.mjs +182 -0
- package/src/backend/web-browser.ts +128 -0
- package/src/backend/web-http-worker.py +62 -0
- package/src/backend/web-http.ts +79 -0
- package/src/backend/web-owner.ts +68 -0
- package/src/backend/web-registration.ts +14 -0
- package/src/code-view/diagnostic-view.ts +2 -2
- package/src/code-view/reference.ts +9 -0
- package/src/composite/builtin-extensions.ts +9 -14
- package/src/composite/module-labels.ts +1 -0
- package/src/composite/nested-tool-rendering.ts +26 -6
- package/src/composite/preferences.ts +13 -0
- package/src/composite/settings-documentation.ts +59 -0
- package/src/composite/settings-help.ts +106 -0
- package/src/composite/text-results.ts +50 -22
- package/src/core/diagnostic-store.ts +32 -10
- package/src/core/ide-core.ts +22 -2
- package/src/doctor/arguments.ts +19 -0
- package/src/doctor/config-writer.ts +72 -29
- package/src/doctor/discovery.ts +53 -15
- package/src/doctor/extension.ts +27 -10
- package/src/doctor/run.ts +42 -7
- package/src/documentation/extension.ts +12 -0
- package/src/documentation/search.ts +166 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/package.json +8 -8
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/index.ts +33 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/package.json +6 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/src/jq.ts +67 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-pdf/runtime/entry-30.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-text/runtime/entry-31.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-27.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/src/resolver.ts +23 -7
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/index.ts +28 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/package.json +8 -11
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/package.json +3 -5
- 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-pdf/package.json +4 -4
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-pdf/runtime/entry-87.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-88.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-84.js +2 -0
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/doctor-plugin.ts +21 -6
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/resolver.ts +12 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/src/search.ts +2 -1
- package/src/extensions/pi-agent-read/package.json +12 -12
- package/src/extensions/pi-agent-read/runtime/entry-45.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-46.js +1 -0
- package/src/extensions/pi-agent-read/runtime/entry-47.js +2 -0
- package/src/extensions/pi-agent-read/src/api/tools/read.ts +4 -2
- package/src/extensions/pi-agent-read/src/core/extension.ts +4 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/raw-read.ts +143 -69
- package/src/extensions/pi-agent-read/src/core/tools/read/read-result.ts +25 -1
- package/src/extensions/pi-agent-read/src/core/tools/read/result-target.ts +67 -44
- package/src/extensions/pi-agent-read/src/core/tools/read/structured-result.ts +8 -3
- package/src/extensions/pi-agent-read/src/core/tools/tool-read.ts +20 -5
- package/src/extensions/pi-agent-search/package.json +9 -9
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/index.ts +37 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/package.json +14 -12
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-53.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-55.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-56.js +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/doctor-plugin.ts +10 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/file-search.ts +26 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/fuzzy-search.ts +54 -3
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/resolvers.ts +22 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/scoped-search.ts +4 -5
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-backend.ts +123 -17
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-recipe.ts +5 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-result.ts +1 -0
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/src/search-session.ts +166 -31
- package/src/extensions/pi-agent-search/runtime/entry-50.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-51.js +1 -0
- package/src/extensions/pi-agent-search/runtime/entry-52.js +2 -0
- package/src/extensions/pi-agent-search/src/api/plugin-protocol.ts +1 -1
- package/src/extensions/pi-agent-search/src/api/presentation.ts +10 -2
- package/src/extensions/pi-agent-search/src/api/search-parameters.ts +7 -3
- package/src/extensions/pi-agent-search/src/api/search.ts +51 -2
- package/src/extensions/pi-agent-search/src/core/extension.ts +2 -3
- package/src/extensions/pi-agent-search/src/core/search-core.ts +98 -8
- package/src/extensions/pi-agent-text-editor/package.json +26 -34
- 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-exact/package.json +5 -6
- 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-61.js +1 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/runtime/entry-62.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-line-hash/src/read-handler.ts +3 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/package.json +6 -8
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-80.js +2 -0
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/src/renderer.ts +139 -27
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/package.json +5 -5
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-81.js +2 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-77.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-78.js +1 -0
- package/src/extensions/pi-agent-text-editor/runtime/entry-79.js +2 -0
- package/src/extensions/pi-agent-text-editor/src/api/delete-guard.ts +29 -2
- package/src/extensions/pi-agent-text-editor/src/api/edit-completion.ts +3 -0
- package/src/extensions/pi-agent-text-editor/src/api/file-operations.ts +55 -0
- package/src/extensions/pi-agent-text-editor/src/api/file-transfers.ts +41 -0
- package/src/extensions/pi-agent-text-editor/src/api/mutation-guard.ts +2 -0
- 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 +127 -0
- package/src/extensions/pi-agent-text-editor/src/api/plugin-protocol.ts +20 -1
- package/src/extensions/pi-agent-text-editor/src/api/post-edit.ts +1 -0
- package/src/extensions/pi-agent-text-editor/src/core/delete-policy.ts +93 -85
- package/src/extensions/pi-agent-text-editor/src/core/extension.ts +15 -2
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-guards.ts +81 -0
- package/src/extensions/pi-agent-text-editor/src/core/file-operation-tools.ts +70 -25
- package/src/extensions/pi-agent-text-editor/src/core/file-operations.ts +123 -27
- package/src/extensions/pi-agent-text-editor/src/core/file-result-targets.ts +30 -1
- package/src/extensions/pi-agent-text-editor/src/core/file-transfers.ts +147 -105
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/file-mutation-result.ts +2 -0
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result/grouped-replacements.ts +18 -9
- package/src/extensions/pi-agent-text-editor/src/core/mutation-result-targets.ts +91 -14
- package/src/extensions/pi-agent-text-editor/src/core/native-text-edit-batch.ts +74 -9
- package/src/extensions/pi-agent-text-editor/src/core/temporary-directories.ts +49 -25
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-coordinator.ts +16 -8
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch-registrar.ts +122 -39
- package/src/extensions/pi-agent-text-editor/src/core/text-edit-batch.ts +7 -4
- package/src/extensions/pi-agent-text-editor/src/core/text-editor-core.ts +307 -32
- package/src/extensions/pi-agent-text-editor/src/core/text-mutation.ts +85 -31
- package/src/extensions/pi-agent-text-editor/src/core/tool-call-interceptor/coordinator.ts +22 -1
- package/src/extensions/pi-agent-text-editor/src/core/write-agent-result.ts +4 -1
- package/src/pi-agent-ide.ts +14 -2
- package/src/plugins/pi-agent-ide-ast/package.json +15 -41
- package/src/plugins/pi-agent-ide-ast/src/ast/manager.ts +2 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/outline.ts +10 -3
- package/src/plugins/pi-agent-ide-ast/src/ast/read-text.ts +4 -1
- package/src/plugins/pi-agent-ide-ast/src/ast/selection.ts +3 -3
- package/src/plugins/pi-agent-ide-ast/src/doctor-plugin.ts +13 -10
- package/src/plugins/pi-agent-ide-ast/src/extension.ts +17 -1
- package/src/plugins/pi-agent-ide-ast/src/outline-resolver.ts +32 -4
- package/src/plugins/pi-agent-ide-ast/src/overflow-handler.ts +2 -2
- package/src/plugins/pi-agent-ide-ast/src/scope-handler.ts +1 -1
- package/src/plugins/pi-agent-ide-ast/src/search-presentation.ts +4 -3
- package/src/plugins/pi-agent-ide-ast/src/search-resolver.ts +100 -42
- package/src/plugins/pi-agent-ide-ast/src/select-presentation.ts +3 -2
- package/src/plugins/pi-agent-ide-ast/src/tool-select.ts +2 -1
- package/src/plugins/pi-agent-ide-changes/index.ts +10 -2
- package/src/plugins/pi-agent-ide-changes/package.json +10 -11
- package/src/plugins/pi-agent-ide-changes/runtime/entry-34.js +1 -0
- package/src/plugins/pi-agent-ide-changes/src/change-anchor.ts +7 -2
- package/src/plugins/pi-agent-ide-changes/src/changes/change-service.ts +18 -1
- package/src/plugins/pi-agent-ide-changes/src/changes/change-types.ts +3 -0
- package/src/plugins/pi-agent-ide-changes/src/changes/git-changes-backend.ts +59 -7
- package/src/plugins/pi-agent-ide-changes/src/changes/git-paths.ts +49 -0
- package/src/plugins/pi-agent-ide-changes/src/current-change-presenter.ts +10 -2
- package/src/plugins/pi-agent-ide-changes/src/doctor-plugin.ts +13 -14
- package/src/plugins/pi-agent-ide-changes/src/last-text-transaction-store.ts +2 -1
- package/src/plugins/pi-agent-ide-changes/src/tool-index-change.ts +47 -11
- package/src/plugins/pi-agent-ide-changes/src/tool-text-undo.ts +6 -1
- package/src/plugins/pi-agent-ide-debugger/index.ts +62 -25
- package/src/plugins/pi-agent-ide-debugger/src/adapter-executables.ts +3 -1
- package/src/plugins/pi-agent-ide-debugger/src/dap-client.ts +33 -0
- package/src/plugins/pi-agent-ide-debugger/src/doctor-plugin.ts +150 -171
- package/src/plugins/pi-agent-ide-debugger/src/process-provider.ts +2 -0
- package/src/plugins/pi-agent-ide-debugger/src/session-manager.ts +152 -58
- package/src/plugins/pi-agent-ide-debugger/src/workspace-owner.ts +28 -0
- package/src/plugins/pi-agent-ide-diagnostics/src/extension.ts +4 -1
- package/src/plugins/pi-agent-ide-formatter/index.ts +14 -2
- package/src/plugins/pi-agent-ide-formatter/package.json +4 -4
- package/src/plugins/pi-agent-ide-formatter/src/doctor-plugin.ts +47 -35
- package/src/plugins/pi-agent-ide-formatter/src/formatter.ts +41 -11
- package/src/plugins/pi-agent-ide-formatter/src/registry.ts +9 -28
- package/src/plugins/pi-agent-ide-languages/package.json +3 -3
- package/src/plugins/pi-agent-ide-lint/index.ts +35 -4
- package/src/plugins/pi-agent-ide-lint/package.json +8 -8
- package/src/plugins/pi-agent-ide-lint/runtime/entry-38.js +2 -0
- package/src/plugins/pi-agent-ide-lint/src/command-linter.ts +14 -10
- package/src/plugins/pi-agent-ide-lint/src/doctor-plugin.ts +47 -39
- package/src/plugins/pi-agent-ide-lint/src/registry.ts +9 -25
- package/src/plugins/pi-agent-ide-lsp/index.ts +107 -25
- package/src/plugins/pi-agent-ide-lsp/package.json +10 -13
- package/src/plugins/pi-agent-ide-lsp/runtime/entry-39.js +2 -0
- package/src/plugins/pi-agent-ide-lsp/src/code-view-resolvers.ts +6 -2
- package/src/plugins/pi-agent-ide-lsp/src/declaration-targets.ts +5 -1
- package/src/plugins/pi-agent-ide-lsp/src/diagnostic-source.ts +5 -3
- package/src/plugins/pi-agent-ide-lsp/src/doctor-plugin.ts +27 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/abort.ts +62 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/client.ts +245 -103
- package/src/plugins/pi-agent-ide-lsp/src/lsp/code-views.ts +26 -45
- package/src/plugins/pi-agent-ide-lsp/src/lsp/diagnostic-adapters.ts +1 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/document-uri.ts +40 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/file-watchers.ts +8 -1
- package/src/plugins/pi-agent-ide-lsp/src/lsp/lsp-compiler.ts +24 -17
- package/src/plugins/pi-agent-ide-lsp/src/lsp/manager.ts +255 -56
- package/src/plugins/pi-agent-ide-lsp/src/lsp/navigation.ts +51 -11
- package/src/plugins/pi-agent-ide-lsp/src/lsp/owner-transport.ts +67 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/registry.ts +149 -18
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-search.ts +79 -31
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +15 -12
- package/src/plugins/pi-agent-ide-lsp/src/lsp/workspace-owner.ts +16 -0
- package/src/plugins/pi-agent-ide-lsp/src/rename-plan.ts +67 -46
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +50 -19
- package/src/plugins/pi-agent-ide-processes/src/registry.ts +8 -1
- package/src/plugins/pi-agent-ide-terminal/index.ts +7 -0
- package/src/plugins/pi-agent-ide-terminal/src/process-provider.ts +5 -1
- package/src/plugins/pi-agent-ide-terminal/src/resources.ts +5 -2
- package/src/plugins/pi-agent-ide-terminal/src/session-manager.ts +161 -42
- package/src/plugins/pi-agent-ide-terminal/src/shell-profile.ts +7 -0
- package/src/plugins/pi-agent-ide-terminal/src/shell-result.ts +11 -0
- package/src/plugins/pi-agent-ide-terminal/src/tools.ts +33 -8
- package/src/plugins/pi-agent-ide-terminal/src/types.ts +5 -0
- package/src/plugins/pi-agent-ide-vision/index.ts +170 -9
- package/src/plugins/pi-agent-ide-vision/src/doctor-plugin.ts +47 -0
- package/src/plugins/pi-agent-ide-vision/src/vision.ts +42 -1
- package/src/post-edit/gate.ts +4 -1
- package/src/tips/core.ts +5 -2
- package/src/tips/extension.ts +30 -2
- package/src/tips/persistence.ts +29 -27
- package/src/tips/setup-hint.ts +19 -0
- package/src/toolchain/types.ts +2 -0
- package/dist/chunk-3YK4XMWB.js +0 -0
- package/dist/chunk-5JELU6RV.js +0 -7
- package/dist/chunk-6U5OU77O.js +0 -3
- package/dist/chunk-7LD2OQH3.js +0 -14
- package/dist/chunk-BMOJTJJJ.js +0 -3
- package/dist/chunk-BYZSBXUK.js +0 -2
- package/dist/chunk-CEX73RI5.js +0 -28
- package/dist/chunk-DZWTKF2K.js +0 -1
- package/dist/chunk-EOKEQ3YH.js +0 -25
- package/dist/chunk-HZ5BNF3A.js +0 -1
- package/dist/chunk-IG56UGSO.js +0 -2
- package/dist/chunk-KVHDMIZS.js +0 -3
- package/dist/chunk-M5IVSCR2.js +0 -1
- package/dist/chunk-M5MJP7Z2.js +0 -1
- package/dist/chunk-MGCHOGQD.js +0 -1
- package/dist/chunk-N34ATN52.js +0 -1
- package/dist/chunk-NHKPP2AI.js +0 -28
- package/dist/chunk-NRZO5KJT.js +0 -9
- package/dist/chunk-OB46OPMZ.js +0 -1
- package/dist/chunk-Q6CZ6GBR.js +0 -3
- package/dist/chunk-QIK2E64R.js +0 -1
- package/dist/chunk-SBP3ABH4.js +0 -5
- package/dist/chunk-STBJO3Z3.js +0 -2
- package/dist/chunk-T6LX2RX5.js +0 -1
- package/dist/chunk-TXOTNK6B.js +0 -11
- package/dist/chunk-WZI4YC2O.js +0 -1
- package/dist/entry-19.js +0 -1
- package/docs/research/apply-native-capability-matrix.md +0 -174
- package/docs/research/apply-read-latency.md +0 -221
- package/docs/research/codemode-write-context.md +0 -56
- package/docs/research/lpt-393-fuzzy-results/file.json +0 -152
- package/docs/research/lpt-393-fuzzy-results/repo.json +0 -122
- package/docs/research/lpt-393-search-fuzzy-fallback.md +0 -97
- package/docs/research/native-codemode-batch-decision.md +0 -31
- package/docs/research/native-codemode-batching.md +0 -65
- package/node_modules/pi-agent-doctor/runtime/entry-19.js +0 -1
- package/node_modules/pi-agent-filesystem/runtime/entry-25.js +0 -2
- package/node_modules/pi-agent-filesystem-image/runtime/entry-26.js +0 -2
- package/node_modules/pi-agent-ide-ast/runtime/entry-30.js +0 -1
- package/node_modules/pi-agent-ide-formatter/runtime/entry-34.js +0 -2
- package/node_modules/pi-agent-image/runtime/entry-38.js +0 -1
- package/node_modules/pi-agent-invariant/runtime/entry-39.js +0 -1
- package/node_modules/pi-agent-search/runtime/entry-47.js +0 -1
- package/node_modules/pi-agent-search-text/runtime/entry-51.js +0 -2
- package/node_modules/pi-agent-search-text/runtime/entry-52.js +0 -1
- package/node_modules/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
- package/node_modules/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/node_modules/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
- package/node_modules/pi-agent-tool-call-interception/runtime/entry-80.js +0 -1
- package/node_modules/pi-agent-tool-ui/runtime/entry-81.js +0 -1
- package/node_modules/pi-agent-web/runtime/entry-82.js +0 -2
- package/node_modules/pi-agent-web-html/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-image/runtime/entry-26.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/pi-agent-filesystem-jq/runtime/entry-27.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/runtime/entry-25.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-html/runtime/entry-83.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/pi-agent-web-image/runtime/entry-84.js +0 -2
- package/src/extensions/pi-agent-read/extensions/pi-agent-web/runtime/entry-82.js +0 -2
- package/src/extensions/pi-agent-read/runtime/entry-41.js +0 -1
- package/src/extensions/pi-agent-read/runtime/entry-42.js +0 -1
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-51.js +0 -2
- package/src/extensions/pi-agent-search/plugins/pi-agent-search-text/runtime/entry-52.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-47.js +0 -1
- package/src/extensions/pi-agent-search/runtime/entry-48.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-constant/runtime/entry-56.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-anchor-exact/runtime/entry-57.js +0 -1
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-renderer/runtime/entry-78.js +0 -2
- package/src/extensions/pi-agent-text-editor/plugins/pi-agent-text-editor-stale-anchor/runtime/entry-79.js +0 -2
- package/src/extensions/pi-agent-text-editor/runtime/entry-61.js +0 -1
- package/src/extensions/pi-agent-text-editor/runtime/entry-62.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-30.js +0 -1
- package/src/plugins/pi-agent-ide-ast/runtime/entry-31.js +0 -2
- package/src/plugins/pi-agent-ide-formatter/runtime/entry-34.js +0 -2
- /package/node_modules/{pi-agent-documentation → pi-agent-doctor}/runtime/entry-24.js +0 -0
- /package/node_modules/{pi-agent-filesystem-jq → pi-agent-filesystem}/runtime/entry-27.js +0 -0
- /package/node_modules/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/node_modules/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/node_modules/{pi-agent-ide-ast → pi-agent-filesystem-text}/runtime/entry-31.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-32.js +0 -0
- /package/node_modules/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-33.js +0 -0
- /package/node_modules/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/node_modules/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/node_modules/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
- /package/node_modules/{pi-agent-pdf → pi-agent-image}/runtime/entry-40.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-invariant}/runtime/entry-41.js +0 -0
- /package/node_modules/{pi-agent-read → pi-agent-pdf}/runtime/entry-42.js +0 -0
- /package/node_modules/{pi-agent-resource → pi-agent-read}/runtime/entry-46.js +0 -0
- /package/node_modules/{pi-agent-search → pi-agent-resource}/runtime/entry-48.js +0 -0
- /package/node_modules/{pi-agent-text → pi-agent-search-text}/runtime/entry-55.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text}/runtime/entry-57.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-58.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-59.js +0 -0
- /package/node_modules/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-60.js +0 -0
- /package/node_modules/{pi-agent-text-editor → pi-agent-text-anchor-line-hash}/runtime/entry-61.js +0 -0
- /package/node_modules/{pi-agent-text-editor-stale-anchor → pi-agent-text-editor}/runtime/entry-79.js +0 -0
- /package/node_modules/{pi-agent-web-image → pi-agent-web}/runtime/entry-84.js +0 -0
- /package/node_modules/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/node_modules/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-pdf → pi-agent-filesystem-image}/runtime/entry-28.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-filesystem/plugins/{pi-agent-filesystem-text → pi-agent-filesystem-jq}/runtime/entry-29.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-pdf → pi-agent-web-html}/runtime/entry-85.js +0 -0
- /package/src/extensions/pi-agent-read/extensions/pi-agent-web/plugins/{pi-agent-web-text → pi-agent-web-image}/runtime/entry-86.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-exact → pi-agent-text-anchor-constant}/runtime/entry-58.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-59.js +0 -0
- /package/src/extensions/pi-agent-text-editor/plugins/{pi-agent-text-anchor-line-hash → pi-agent-text-anchor-exact}/runtime/entry-60.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-32.js +0 -0
- /package/src/plugins/{pi-agent-ide-changes → pi-agent-ide-ast}/runtime/entry-33.js +0 -0
- /package/src/plugins/{pi-agent-ide-languages → pi-agent-ide-changes}/runtime/entry-35.js +0 -0
- /package/src/plugins/{pi-agent-ide-lint → pi-agent-ide-formatter}/runtime/entry-36.js +0 -0
- /package/src/plugins/{pi-agent-ide-lsp → pi-agent-ide-languages}/runtime/entry-37.js +0 -0
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { requiredValue } from "pi-agent-invariant";
|
|
2
|
-
import type { ResultTargetStore } from "pi-agent-resource";
|
|
3
|
-
import type {
|
|
2
|
+
import type { ResultTargetStore, ResolvedResultTargets } from "pi-agent-resource";
|
|
3
|
+
import type {
|
|
4
|
+
SearchSelectionMatch,
|
|
5
|
+
SearchSelectionRegistration,
|
|
6
|
+
SearchContext,
|
|
7
|
+
} from "pi-agent-search/api/search";
|
|
4
8
|
import { createHash } from "node:crypto";
|
|
5
9
|
import { open, readFile } from "node:fs/promises";
|
|
6
10
|
import path from "node:path";
|
|
11
|
+
import type { SearchEnvironment } from "pi-agent-search/api/search";
|
|
7
12
|
|
|
8
13
|
import {
|
|
9
14
|
createTextDocument,
|
|
@@ -27,11 +32,12 @@ export type TextSearchMatch = SearchSelectionMatch;
|
|
|
27
32
|
|
|
28
33
|
export interface TextSearchSession {
|
|
29
34
|
readonly id: string;
|
|
30
|
-
readonly target?: string;
|
|
31
|
-
readonly matchTargets?: readonly string[];
|
|
32
35
|
readonly query: string;
|
|
33
36
|
readonly matches: readonly TextSearchMatch[];
|
|
34
37
|
readonly complete: boolean;
|
|
38
|
+
/** Strict source handles stay separate from legacy refreshing SEARCH references. */
|
|
39
|
+
readonly target?: string;
|
|
40
|
+
readonly matchTargets?: readonly string[];
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
interface SearchSnapshot {
|
|
@@ -40,7 +46,11 @@ interface SearchSnapshot {
|
|
|
40
46
|
readonly contentBySource: ReadonlyMap<string, string>;
|
|
41
47
|
}
|
|
42
48
|
|
|
49
|
+
type SnapshotReader = (source: string, signal?: AbortSignal) => Promise<string>;
|
|
50
|
+
|
|
43
51
|
interface StoredSearchSession extends TextSearchSession, SearchSnapshot {
|
|
52
|
+
readonly read?: SnapshotReader;
|
|
53
|
+
readonly environment?: SearchEnvironment;
|
|
44
54
|
readonly refresh?: SearchSelectionRegistration["refresh"];
|
|
45
55
|
readonly recipe: SearchRecipe;
|
|
46
56
|
readonly snapshotByteBudget?: number;
|
|
@@ -77,11 +87,13 @@ export function createSearchSessionIdentity(
|
|
|
77
87
|
const root =
|
|
78
88
|
cwd === undefined
|
|
79
89
|
? commonSourceDirectory(matches.map((match) => match.source))
|
|
80
|
-
:
|
|
90
|
+
: canonicalSource(cwd);
|
|
81
91
|
const identity = matches
|
|
82
92
|
.map((match) => ({
|
|
83
93
|
match,
|
|
84
|
-
source:
|
|
94
|
+
source: match.source.includes("://")
|
|
95
|
+
? canonicalSource(match.source)
|
|
96
|
+
: path.relative(root, path.resolve(match.source)),
|
|
85
97
|
}))
|
|
86
98
|
.sort(
|
|
87
99
|
(left, right) =>
|
|
@@ -126,7 +138,7 @@ export function allocateSearchSessionId(
|
|
|
126
138
|
function normalizeRecipe(recipe: SearchRecipe, cwd: string): Record<string, unknown> {
|
|
127
139
|
return {
|
|
128
140
|
query: recipe.query,
|
|
129
|
-
path:
|
|
141
|
+
path: resolveScope(cwd, recipe.path ?? "."),
|
|
130
142
|
include: recipe.include ?? "",
|
|
131
143
|
exclude: recipe.exclude ?? "",
|
|
132
144
|
caseSensitive: recipe.caseSensitive === true,
|
|
@@ -154,6 +166,11 @@ export class SearchSessionStore {
|
|
|
154
166
|
public constructor(
|
|
155
167
|
private readonly createIdentity: typeof createSearchSessionIdentity = createSearchSessionIdentity,
|
|
156
168
|
private readonly resultTargets?: ResultTargetStore,
|
|
169
|
+
private readonly readSource?: (
|
|
170
|
+
source: string,
|
|
171
|
+
cwd: string,
|
|
172
|
+
signal?: AbortSignal,
|
|
173
|
+
) => Promise<string>,
|
|
157
174
|
) {}
|
|
158
175
|
|
|
159
176
|
/** Capture current files; an optional byte budget also bounds reads if a file grows during capture. */
|
|
@@ -169,11 +186,21 @@ export class SearchSessionStore {
|
|
|
169
186
|
},
|
|
170
187
|
refresh?: SearchSelectionRegistration["refresh"],
|
|
171
188
|
snapshotByteBudget?: number,
|
|
189
|
+
environment?: SearchEnvironment,
|
|
172
190
|
): Promise<TextSearchSession> {
|
|
173
191
|
const matches = sourceMatches
|
|
174
|
-
.map((match) => ({ ...match, source:
|
|
192
|
+
.map((match) => ({ ...match, source: canonicalSource(match.source) }))
|
|
175
193
|
.sort(compareMatches);
|
|
176
|
-
const
|
|
194
|
+
const readSource = this.readSource;
|
|
195
|
+
const read: SnapshotReader | undefined =
|
|
196
|
+
readSource === undefined ? undefined : (source, abort) => readSource(source, cwd, abort);
|
|
197
|
+
const contentBySource = await snapshotContents(
|
|
198
|
+
matches,
|
|
199
|
+
signal,
|
|
200
|
+
snapshotByteBudget,
|
|
201
|
+
environment,
|
|
202
|
+
read,
|
|
203
|
+
);
|
|
177
204
|
const identity = this.createIdentity(query, matches, cwd, recipe);
|
|
178
205
|
const knownId = this.#idsByIdentity.get(identity);
|
|
179
206
|
const id = knownId ?? allocateSearchSessionId(identity, new Set<string>(this.#sessions.keys()));
|
|
@@ -183,11 +210,21 @@ export class SearchSessionStore {
|
|
|
183
210
|
matches,
|
|
184
211
|
complete,
|
|
185
212
|
contentBySource,
|
|
186
|
-
|
|
213
|
+
read,
|
|
214
|
+
...registerResultReferences(
|
|
215
|
+
this.resultTargets,
|
|
216
|
+
id,
|
|
217
|
+
matches,
|
|
218
|
+
contentBySource,
|
|
219
|
+
cwd,
|
|
220
|
+
complete,
|
|
221
|
+
(source, abort) => readOwnedText(source, abort, environment, read),
|
|
222
|
+
),
|
|
187
223
|
...(snapshotByteBudget === undefined ? {} : { snapshotByteBudget }),
|
|
188
224
|
recipe,
|
|
225
|
+
environment,
|
|
189
226
|
...(refresh !== undefined && { refresh }),
|
|
190
|
-
cwd:
|
|
227
|
+
cwd: canonicalSource(cwd),
|
|
191
228
|
};
|
|
192
229
|
this.#idsByIdentity.set(identity, id);
|
|
193
230
|
this.#sessions.set(id, session);
|
|
@@ -204,6 +241,7 @@ export class SearchSessionStore {
|
|
|
204
241
|
recipe?: SearchRecipe,
|
|
205
242
|
refresh?: SearchSelectionRegistration["refresh"],
|
|
206
243
|
snapshotByteBudget?: number,
|
|
244
|
+
environment?: SearchEnvironment,
|
|
207
245
|
): Promise<TextSearchSession | undefined> {
|
|
208
246
|
try {
|
|
209
247
|
return await this.register(
|
|
@@ -215,6 +253,7 @@ export class SearchSessionStore {
|
|
|
215
253
|
recipe,
|
|
216
254
|
refresh,
|
|
217
255
|
snapshotByteBudget,
|
|
256
|
+
environment,
|
|
218
257
|
);
|
|
219
258
|
} catch (error) {
|
|
220
259
|
if (error instanceof SearchSnapshotChangedError) return undefined;
|
|
@@ -255,7 +294,7 @@ export class SearchSessionStore {
|
|
|
255
294
|
try {
|
|
256
295
|
const result =
|
|
257
296
|
session.refresh === undefined
|
|
258
|
-
? await runSearchRecipe(session.recipe, session.cwd, signal)
|
|
297
|
+
? await runSearchRecipe(session.recipe, session.cwd, signal, session.environment)
|
|
259
298
|
: await session.refresh(signal);
|
|
260
299
|
observations.push({
|
|
261
300
|
...base,
|
|
@@ -300,6 +339,42 @@ export class SearchSessionStore {
|
|
|
300
339
|
};
|
|
301
340
|
}
|
|
302
341
|
|
|
342
|
+
/** Resolve Search input with the same numbered-snapshot and all-query refresh authority as edits. */
|
|
343
|
+
public async resolveSearchScope(
|
|
344
|
+
value: string,
|
|
345
|
+
context: SearchContext,
|
|
346
|
+
): Promise<ResolvedResultTargets | undefined> {
|
|
347
|
+
if (!value.startsWith("SEARCH#")) return undefined;
|
|
348
|
+
const result = await this.#resolveResources(value, context.cwd, context.signal, true);
|
|
349
|
+
if (result.kind !== "resolved")
|
|
350
|
+
throw new Error(
|
|
351
|
+
result.kind === "rejected" ? result.rejection.reason : "Invalid Search reference.",
|
|
352
|
+
);
|
|
353
|
+
const parsed = requiredValue(parseSearchAnchor(value));
|
|
354
|
+
const session = requiredValue(this.#sessions.get(parsed.id));
|
|
355
|
+
return {
|
|
356
|
+
complete: true,
|
|
357
|
+
targets: result.targets.map((target) => {
|
|
358
|
+
if (target.expectedContent === undefined)
|
|
359
|
+
throw new Error("Search snapshot is unavailable.");
|
|
360
|
+
return {
|
|
361
|
+
source: target.source,
|
|
362
|
+
expectedContent: target.expectedContent,
|
|
363
|
+
ranges: target.ranges ?? [],
|
|
364
|
+
readCurrent: async (signal?: AbortSignal) => {
|
|
365
|
+
const current = await readCurrent(
|
|
366
|
+
target.source,
|
|
367
|
+
signal,
|
|
368
|
+
session.environment,
|
|
369
|
+
session.read,
|
|
370
|
+
);
|
|
371
|
+
if (current === undefined) throw new Error("Search source is unavailable.");
|
|
372
|
+
return current;
|
|
373
|
+
},
|
|
374
|
+
};
|
|
375
|
+
}),
|
|
376
|
+
};
|
|
377
|
+
}
|
|
303
378
|
public resourceResolver(): TextAnchorResourceResolver {
|
|
304
379
|
return {
|
|
305
380
|
id: "search-targets",
|
|
@@ -317,7 +392,7 @@ export class SearchSessionStore {
|
|
|
317
392
|
let session = this.#sessions.get(parsed.id);
|
|
318
393
|
if (session === undefined) return staleAnchor();
|
|
319
394
|
if (parsed.selector === "all" && !session.complete) return missingCompleteAnchor();
|
|
320
|
-
const source =
|
|
395
|
+
const source = canonicalSource(contextSource);
|
|
321
396
|
let snapshot: SearchSnapshot = session;
|
|
322
397
|
if (parsed.selector === "all") {
|
|
323
398
|
if (session.refreshedComplete?.complete === true) {
|
|
@@ -335,7 +410,7 @@ export class SearchSessionStore {
|
|
|
335
410
|
rejection: { code: "missing", reason: "search anchor does not select this resource" },
|
|
336
411
|
};
|
|
337
412
|
}
|
|
338
|
-
const current = await readCurrent(source, signal);
|
|
413
|
+
const current = await readCurrent(source, signal, session.environment, session.read);
|
|
339
414
|
if (current === undefined) return staleAnchor(requiredValue(sourceMatches[0]).lineNumber);
|
|
340
415
|
if (parsed.selector === "all" && current !== snapshot.contentBySource.get(source)) {
|
|
341
416
|
snapshot = await this.#refresh(session, signal);
|
|
@@ -362,27 +437,32 @@ export class SearchSessionStore {
|
|
|
362
437
|
};
|
|
363
438
|
}
|
|
364
439
|
|
|
365
|
-
async #resolveResources(
|
|
440
|
+
async #resolveResources(
|
|
441
|
+
value: string,
|
|
442
|
+
cwd: string,
|
|
443
|
+
signal?: AbortSignal,
|
|
444
|
+
allowEmpty = false,
|
|
445
|
+
): Promise<TextTargetResolutionAttempt> {
|
|
366
446
|
const parsed = parseSearchAnchor(value);
|
|
367
447
|
if (parsed === undefined) return { kind: "not-handled" };
|
|
368
448
|
const session = this.#sessions.get(parsed.id);
|
|
369
|
-
if (session === undefined) return staleAnchor();
|
|
449
|
+
if (session === undefined || session.cwd !== canonicalSource(cwd)) return staleAnchor();
|
|
370
450
|
if (parsed.selector === "all" && !session.complete) return missingCompleteAnchor();
|
|
371
451
|
let snapshot: SearchSnapshot = session;
|
|
372
452
|
if (parsed.selector === "all") {
|
|
373
453
|
if (session.refreshedComplete?.complete === true) {
|
|
374
454
|
snapshot = session.refreshedComplete;
|
|
375
455
|
} else if (session.refreshedComplete !== undefined) {
|
|
376
|
-
snapshot = await this.#refresh(session);
|
|
456
|
+
snapshot = await this.#refresh(session, signal);
|
|
377
457
|
if (!snapshot.complete) return missingCompleteAnchor();
|
|
378
458
|
}
|
|
379
459
|
const sources = new Set(
|
|
380
460
|
selectMatches(snapshot, parsed.selector, parsed.mode).map((match) => match.source),
|
|
381
461
|
);
|
|
382
462
|
for (const source of sources) {
|
|
383
|
-
const current = await readCurrent(source);
|
|
463
|
+
const current = await readCurrent(source, signal, session.environment, session.read);
|
|
384
464
|
if (current !== snapshot.contentBySource.get(source)) {
|
|
385
|
-
snapshot = await this.#refresh(session);
|
|
465
|
+
snapshot = await this.#refresh(session, signal);
|
|
386
466
|
if (!snapshot.complete) return missingCompleteAnchor();
|
|
387
467
|
break;
|
|
388
468
|
}
|
|
@@ -393,7 +473,8 @@ export class SearchSessionStore {
|
|
|
393
473
|
const source = selected[0]?.source;
|
|
394
474
|
if (
|
|
395
475
|
source !== undefined &&
|
|
396
|
-
(await readCurrent(source
|
|
476
|
+
(await readCurrent(source, signal, session.environment, session.read)) !==
|
|
477
|
+
snapshot.contentBySource.get(source)
|
|
397
478
|
) {
|
|
398
479
|
return staleAnchor(selected[0]?.lineNumber);
|
|
399
480
|
}
|
|
@@ -418,7 +499,7 @@ export class SearchSessionStore {
|
|
|
418
499
|
ranges,
|
|
419
500
|
expectedContent: snapshot.contentBySource.get(source),
|
|
420
501
|
}));
|
|
421
|
-
return targets.length === 0
|
|
502
|
+
return targets.length === 0 && !(allowEmpty && parsed.selector === "all")
|
|
422
503
|
? { kind: "rejected", rejection: { code: "missing", reason: "search anchor has no matches" } }
|
|
423
504
|
: { kind: "resolved", targets };
|
|
424
505
|
}
|
|
@@ -426,15 +507,21 @@ export class SearchSessionStore {
|
|
|
426
507
|
async #refresh(session: StoredSearchSession, signal?: AbortSignal): Promise<SearchSnapshot> {
|
|
427
508
|
const result =
|
|
428
509
|
session.refresh === undefined
|
|
429
|
-
? await runSearchRecipe(session.recipe, session.cwd, signal)
|
|
510
|
+
? await runSearchRecipe(session.recipe, session.cwd, signal, session.environment)
|
|
430
511
|
: await session.refresh(signal);
|
|
431
512
|
const matches = result.matches
|
|
432
|
-
.map((match) => ({ ...match, source:
|
|
513
|
+
.map((match) => ({ ...match, source: canonicalSource(match.source) }))
|
|
433
514
|
.sort(compareMatches);
|
|
434
515
|
const refreshed: SearchSnapshot = {
|
|
435
516
|
matches,
|
|
436
517
|
complete: result.complete,
|
|
437
|
-
contentBySource: await snapshotContents(
|
|
518
|
+
contentBySource: await snapshotContents(
|
|
519
|
+
matches,
|
|
520
|
+
signal,
|
|
521
|
+
session.snapshotByteBudget,
|
|
522
|
+
session.environment,
|
|
523
|
+
session.read,
|
|
524
|
+
),
|
|
438
525
|
};
|
|
439
526
|
this.#sessions.set(session.id, { ...session, refreshedComplete: refreshed });
|
|
440
527
|
return refreshed;
|
|
@@ -443,10 +530,12 @@ export class SearchSessionStore {
|
|
|
443
530
|
|
|
444
531
|
function registerResultReferences(
|
|
445
532
|
store: ResultTargetStore | undefined,
|
|
533
|
+
sessionId: string,
|
|
446
534
|
matches: readonly TextSearchMatch[],
|
|
447
535
|
contents: ReadonlyMap<string, string>,
|
|
448
536
|
cwd: string,
|
|
449
537
|
complete: boolean,
|
|
538
|
+
read: SnapshotReader,
|
|
450
539
|
): Pick<TextSearchSession, "target" | "matchTargets"> {
|
|
451
540
|
if (store === undefined) return {};
|
|
452
541
|
const documents = new Map(
|
|
@@ -456,7 +545,20 @@ function registerResultReferences(
|
|
|
456
545
|
source: match.source,
|
|
457
546
|
expectedContent: requiredValue(contents.get(match.source)),
|
|
458
547
|
ranges: [selectionRange(requiredValue(documents.get(match.source)), match, "match")],
|
|
548
|
+
readCurrent: (signal?: AbortSignal) => read(match.source, signal),
|
|
459
549
|
}));
|
|
550
|
+
for (const [index, match] of matches.slice(0, 100).entries()) {
|
|
551
|
+
const lineTarget = store.register(
|
|
552
|
+
[
|
|
553
|
+
{
|
|
554
|
+
...requiredValue(targets[index]),
|
|
555
|
+
ranges: [selectionRange(requiredValue(documents.get(match.source)), match, "line")],
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
cwd,
|
|
559
|
+
);
|
|
560
|
+
store.registerSearchReference(`SEARCH#${sessionId}:${index + 1}:line`, lineTarget, cwd);
|
|
561
|
+
}
|
|
460
562
|
return {
|
|
461
563
|
target: store.register(targets, cwd, complete),
|
|
462
564
|
matchTargets: targets.slice(0, 100).map((target) => store.register([target], cwd, complete)),
|
|
@@ -563,13 +665,15 @@ async function snapshotContents(
|
|
|
563
665
|
matches: readonly TextSearchMatch[],
|
|
564
666
|
signal?: AbortSignal,
|
|
565
667
|
byteBudget?: number,
|
|
668
|
+
environment?: SearchEnvironment,
|
|
669
|
+
read?: SnapshotReader,
|
|
566
670
|
): Promise<ReadonlyMap<string, string>> {
|
|
567
671
|
const sources = [...new Set(matches.map((match) => match.source))];
|
|
568
672
|
if (byteBudget !== undefined) {
|
|
569
673
|
const contents = new Map<string, string>();
|
|
570
674
|
let remaining = byteBudget;
|
|
571
675
|
for (const source of sources) {
|
|
572
|
-
const content = await readBoundedSnapshot(source, remaining, signal);
|
|
676
|
+
const content = await readBoundedSnapshot(source, remaining, signal, environment, read);
|
|
573
677
|
remaining -= Buffer.byteLength(content);
|
|
574
678
|
validateSnapshot(source, content, matches);
|
|
575
679
|
contents.set(source, content);
|
|
@@ -578,10 +682,7 @@ async function snapshotContents(
|
|
|
578
682
|
}
|
|
579
683
|
const snapshots = await Promise.allSettled(
|
|
580
684
|
sources.map(async (source) => {
|
|
581
|
-
const content = await
|
|
582
|
-
encoding: "utf8",
|
|
583
|
-
...(signal !== undefined && { signal }),
|
|
584
|
-
});
|
|
685
|
+
const content = await readOwnedText(source, signal, environment, read);
|
|
585
686
|
validateSnapshot(source, content, matches);
|
|
586
687
|
return [source, content] as const;
|
|
587
688
|
}),
|
|
@@ -610,8 +711,16 @@ async function readBoundedSnapshot(
|
|
|
610
711
|
source: string,
|
|
611
712
|
budget: number,
|
|
612
713
|
signal?: AbortSignal,
|
|
714
|
+
environment?: SearchEnvironment,
|
|
715
|
+
read?: SnapshotReader,
|
|
613
716
|
): Promise<string> {
|
|
614
717
|
signal?.throwIfAborted();
|
|
718
|
+
if (source.includes("://")) {
|
|
719
|
+
const content = await readOwnedText(source, signal, environment, read);
|
|
720
|
+
if (Buffer.byteLength(content) > budget)
|
|
721
|
+
throw new Error("Candidate snapshot byte budget reached.");
|
|
722
|
+
return content;
|
|
723
|
+
}
|
|
615
724
|
const file = await open(source, "r");
|
|
616
725
|
try {
|
|
617
726
|
const info = await file.stat();
|
|
@@ -633,14 +742,40 @@ async function readBoundedSnapshot(
|
|
|
633
742
|
await file.close();
|
|
634
743
|
}
|
|
635
744
|
}
|
|
636
|
-
async function readCurrent(
|
|
745
|
+
async function readCurrent(
|
|
746
|
+
source: string,
|
|
747
|
+
signal?: AbortSignal,
|
|
748
|
+
environment?: SearchEnvironment,
|
|
749
|
+
read?: SnapshotReader,
|
|
750
|
+
): Promise<string | undefined> {
|
|
637
751
|
try {
|
|
638
|
-
return await
|
|
752
|
+
return await readOwnedText(source, signal, environment, read);
|
|
639
753
|
} catch {
|
|
640
754
|
return undefined;
|
|
641
755
|
}
|
|
642
756
|
}
|
|
643
757
|
|
|
758
|
+
function canonicalSource(source: string): string {
|
|
759
|
+
return source.includes("://") ? source : path.resolve(source);
|
|
760
|
+
}
|
|
761
|
+
function resolveScope(cwd: string, source: string): string {
|
|
762
|
+
if (source.includes("://")) return source;
|
|
763
|
+
return cwd.includes("://")
|
|
764
|
+
? new URL(source, cwd.endsWith("/") ? cwd : cwd + "/").href
|
|
765
|
+
: path.resolve(cwd, source);
|
|
766
|
+
}
|
|
767
|
+
async function readOwnedText(
|
|
768
|
+
source: string,
|
|
769
|
+
signal?: AbortSignal,
|
|
770
|
+
environment?: SearchEnvironment,
|
|
771
|
+
read?: SnapshotReader,
|
|
772
|
+
): Promise<string> {
|
|
773
|
+
signal?.throwIfAborted();
|
|
774
|
+
if (read !== undefined) return read(source, signal);
|
|
775
|
+
if (environment !== undefined) return environment.readText(source, signal);
|
|
776
|
+
if (source.includes("://")) throw new Error("No search snapshot owner for this source.");
|
|
777
|
+
return readFile(source, { encoding: "utf8", ...(signal !== undefined && { signal }) });
|
|
778
|
+
}
|
|
644
779
|
function staleAnchor(
|
|
645
780
|
lineNumber = 1,
|
|
646
781
|
): Extract<TextAnchorResolutionAttempt, { readonly kind: "rejected" }> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"imports": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./src/index.ts",
|
|
12
|
-
"default": "./runtime/entry-
|
|
12
|
+
"default": "./runtime/entry-57.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"pi-agent-resource": "0.
|
|
16
|
+
"pi-agent-resource": "0.8.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"typebox": "*"
|
|
@@ -42,6 +42,8 @@ export interface TextDocument {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export interface TextPresentationContext {
|
|
45
|
+
/** Physical file snapshot retained by Read. Derived views clear it; edit-diff callers may omit it. */
|
|
46
|
+
readonly sourceText?: string;
|
|
45
47
|
readonly purpose: "read" | "edit-diff";
|
|
46
48
|
/** Script data enrichment differs from explicitly requested views. */
|
|
47
49
|
readonly audience?: "agent" | "script";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-constant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"pi-agent-text": "0.
|
|
10
|
-
"pi-agent-text-editor": "0.
|
|
9
|
+
"pi-agent-text": "0.8.1",
|
|
10
|
+
"pi-agent-text-editor": "0.8.1"
|
|
11
11
|
},
|
|
12
12
|
"pi": {
|
|
13
13
|
"extensions": [
|
|
14
|
-
"./runtime/entry-
|
|
14
|
+
"./runtime/entry-58.js"
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-exact",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,17 +8,16 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-59.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"pi-agent-text": "0.
|
|
17
|
-
"pi-agent-text-editor": "0.7.3"
|
|
15
|
+
"pi-agent-text": "0.8.1",
|
|
16
|
+
"pi-agent-text-editor": "0.8.1"
|
|
18
17
|
},
|
|
19
18
|
"pi": {
|
|
20
19
|
"extensions": [
|
|
21
|
-
"./runtime/entry-
|
|
20
|
+
"./runtime/entry-60.js"
|
|
22
21
|
]
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-anchor-line-hash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor": {
|
|
10
10
|
"types": "./src/anchor.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-61.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"pi-agent-invariant": "0.
|
|
16
|
-
"pi-agent-read": "0.
|
|
17
|
-
"pi-agent-text": "0.
|
|
18
|
-
"pi-agent-text-editor": "0.
|
|
15
|
+
"pi-agent-invariant": "0.8.1",
|
|
16
|
+
"pi-agent-read": "0.8.1",
|
|
17
|
+
"pi-agent-text": "0.8.1",
|
|
18
|
+
"pi-agent-text-editor": "0.8.1"
|
|
19
19
|
},
|
|
20
20
|
"pi": {
|
|
21
21
|
"extensions": [
|
|
22
|
-
"./runtime/entry-
|
|
22
|
+
"./runtime/entry-62.js"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -8,7 +8,9 @@ export function createLineHashPresenter(): TextLinePresenter {
|
|
|
8
8
|
present(document, context) {
|
|
9
9
|
const presented = document.lines.map((line) => {
|
|
10
10
|
const sourceLine =
|
|
11
|
-
context.resolvedBy === "filesystem"
|
|
11
|
+
(context.resolvedBy === "filesystem" || context.resolvedBy === "ssh") &&
|
|
12
|
+
((context.purpose === "edit-diff" && context.sourceText === undefined) ||
|
|
13
|
+
context.sourceText === document.content)
|
|
12
14
|
? { lineNumber: line.lineNumber, content: line.content }
|
|
13
15
|
: getTextSourceLine(line);
|
|
14
16
|
return sourceLine === undefined
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agent-text-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#src/*": "./src/*"
|
|
@@ -8,90 +8,82 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/anchor-inspection": {
|
|
10
10
|
"types": "./src/api/anchor-inspection.ts",
|
|
11
|
-
"default": "./runtime/entry-
|
|
11
|
+
"default": "./runtime/entry-63.js"
|
|
12
12
|
},
|
|
13
13
|
"./api/connect-plugin": {
|
|
14
14
|
"types": "./src/api/connect-plugin.ts",
|
|
15
|
-
"default": "./runtime/entry-
|
|
15
|
+
"default": "./runtime/entry-64.js"
|
|
16
16
|
},
|
|
17
17
|
"./api/edit-completion": {
|
|
18
18
|
"types": "./src/api/edit-completion.ts",
|
|
19
|
-
"default": "./runtime/entry-
|
|
19
|
+
"default": "./runtime/entry-65.js"
|
|
20
20
|
},
|
|
21
21
|
"./api/edit-pipeline": {
|
|
22
22
|
"types": "./src/api/edit-pipeline.ts",
|
|
23
|
-
"default": "./runtime/entry-
|
|
23
|
+
"default": "./runtime/entry-66.js"
|
|
24
24
|
},
|
|
25
25
|
"./api/plugin-protocol": {
|
|
26
26
|
"types": "./src/api/plugin-protocol.ts",
|
|
27
|
-
"default": "./runtime/entry-
|
|
27
|
+
"default": "./runtime/entry-67.js"
|
|
28
28
|
},
|
|
29
29
|
"./api/stale-anchor-message": {
|
|
30
30
|
"types": "./src/api/stale-anchor-message.ts",
|
|
31
|
-
"default": "./runtime/entry-
|
|
31
|
+
"default": "./runtime/entry-68.js"
|
|
32
32
|
},
|
|
33
33
|
"./api/text-selection-anchor": {
|
|
34
34
|
"types": "./src/api/text-selection-anchor.ts",
|
|
35
|
-
"default": "./runtime/entry-
|
|
35
|
+
"default": "./runtime/entry-69.js"
|
|
36
36
|
},
|
|
37
37
|
"./api/post-edit": {
|
|
38
38
|
"types": "./src/api/post-edit.ts",
|
|
39
|
-
"default": "./runtime/entry-
|
|
39
|
+
"default": "./runtime/entry-70.js"
|
|
40
40
|
},
|
|
41
41
|
"./api/native-edit-batch-event": {
|
|
42
42
|
"types": "./src/api/native-edit-batch-event.ts",
|
|
43
|
-
"default": "./runtime/entry-
|
|
43
|
+
"default": "./runtime/entry-71.js"
|
|
44
44
|
},
|
|
45
45
|
"./api/mutation-result": {
|
|
46
46
|
"types": "./src/api/mutation-result.ts",
|
|
47
|
-
"default": "./runtime/entry-
|
|
47
|
+
"default": "./runtime/entry-72.js"
|
|
48
48
|
},
|
|
49
49
|
"./api/mutation-guard": {
|
|
50
50
|
"types": "./src/api/mutation-guard.ts",
|
|
51
|
-
"default": "./runtime/entry-
|
|
51
|
+
"default": "./runtime/entry-73.js"
|
|
52
52
|
},
|
|
53
53
|
"./api/mutation-tool": {
|
|
54
54
|
"types": "./src/api/mutation-tool.ts",
|
|
55
|
-
"default": "./runtime/entry-
|
|
55
|
+
"default": "./runtime/entry-74.js"
|
|
56
56
|
},
|
|
57
57
|
"./api/mutation-preview": {
|
|
58
58
|
"types": "./src/api/mutation-preview.ts",
|
|
59
|
-
"default": "./runtime/entry-
|
|
59
|
+
"default": "./runtime/entry-75.js"
|
|
60
60
|
},
|
|
61
61
|
"./api/last-resolved-resource": {
|
|
62
62
|
"types": "./src/api/last-resolved-resource.ts",
|
|
63
|
-
"default": "./runtime/entry-
|
|
63
|
+
"default": "./runtime/entry-76.js"
|
|
64
64
|
},
|
|
65
65
|
"./api/tool-call-interceptor": {
|
|
66
66
|
"types": "./src/api/tool-call-interceptor.ts",
|
|
67
|
-
"default": "./runtime/entry-
|
|
67
|
+
"default": "./runtime/entry-77.js"
|
|
68
68
|
},
|
|
69
69
|
"./api/tool-renderer": {
|
|
70
70
|
"types": "./src/api/tool-renderer.ts",
|
|
71
|
-
"default": "./runtime/entry-
|
|
71
|
+
"default": "./runtime/entry-78.js"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"pi-agent-
|
|
83
|
-
"pi-agent-invariant": "0.7.3",
|
|
84
|
-
"pi-agent-read": "0.7.3",
|
|
85
|
-
"pi-agent-resource": "0.7.3",
|
|
86
|
-
"pi-agent-search": "0.7.3",
|
|
87
|
-
"pi-agent-text": "0.7.3",
|
|
88
|
-
"pi-agent-tool-call-interception": "0.7.3",
|
|
89
|
-
"pi-agent-tool-ui": "0.7.3",
|
|
90
|
-
"typebox-guard": "npm:typebox@^1.1.38"
|
|
75
|
+
"pi-agent-documentation": "0.8.1",
|
|
76
|
+
"pi-agent-invariant": "0.8.1",
|
|
77
|
+
"pi-agent-read": "0.8.1",
|
|
78
|
+
"pi-agent-resource": "0.8.1",
|
|
79
|
+
"pi-agent-search": "0.8.1",
|
|
80
|
+
"pi-agent-text": "0.8.1",
|
|
81
|
+
"pi-agent-tool-call-interception": "0.8.1",
|
|
82
|
+
"pi-agent-tool-ui": "0.8.1"
|
|
91
83
|
},
|
|
92
84
|
"pi": {
|
|
93
85
|
"extensions": [
|
|
94
|
-
"./runtime/entry-
|
|
86
|
+
"./runtime/entry-79.js"
|
|
95
87
|
]
|
|
96
88
|
},
|
|
97
89
|
"peerDependencies": {
|