pi-agent-ide 0.9.8 → 1.0.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 +72 -0
- package/README.md +5 -3
- package/dist/chunk-26SMC6OS.js +2 -0
- package/dist/chunk-2EY3LEZ7.js +1 -0
- package/dist/chunk-2QCE7GOV.js +1 -0
- package/dist/chunk-3BRGWFEI.js +2 -0
- package/dist/chunk-3JBQYLJ4.js +5 -0
- package/dist/chunk-3KM5DSWL.js +37 -0
- package/dist/chunk-3V3OQO5S.js +118 -0
- package/dist/chunk-45EJ4762.js +33 -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-7OAAM5FL.js +1 -0
- package/dist/chunk-AB6RSWMB.js +23 -0
- package/dist/chunk-ASVMQMPX.js +10 -0
- package/dist/chunk-BW3XONMZ.js +1 -0
- package/dist/chunk-C327T6YP.js +19 -0
- package/dist/{chunk-R2U5WXYR.js → chunk-D23NS4VV.js} +1 -1
- package/dist/chunk-E4V4VNRM.js +3 -0
- package/dist/chunk-E7JBYW43.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-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-KM4NOIOB.js +5 -0
- package/dist/chunk-L2YDUMZC.js +13 -0
- package/dist/chunk-MCHU3BLO.js +53 -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-NKI4TZSS.js +2 -0
- package/dist/chunk-NSBRKTZ7.js +1 -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-QCAGAJHJ.js +1 -0
- package/dist/{chunk-P7FUD4WY.js → chunk-QR7JR3P2.js} +1 -1
- package/dist/chunk-QSU5AEKW.js +1 -0
- package/dist/chunk-QUK5ZEYX.js +1 -0
- package/dist/chunk-R7576HPO.js +25 -0
- package/dist/{chunk-B5UJCNQU.js → chunk-RNDSWVJF.js} +1 -1
- package/dist/chunk-RYJEEBET.js +1 -0
- package/dist/chunk-S4GTWS2J.js +6 -0
- package/dist/chunk-SF44YQCB.js +2 -0
- package/dist/chunk-SJQGFUXR.js +6 -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-UN3XLVPR.js +18 -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-VQ2RA43A.js +7 -0
- package/dist/chunk-VWYI4WF7.js +3 -0
- package/dist/chunk-W25HNEMR.js +4 -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-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/nightly.md +7 -1
- package/docs/releases.md +1 -1
- 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 +94 -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 +222 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/declaration-scan.ts +116 -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/initialization-options.ts +37 -0
- 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 +185 -131
- 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 +45 -24
- package/node_modules/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/project.ts +40 -12
- 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 +414 -174
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +424 -0
- package/node_modules/pi-agent-ide-lsp/src/lsp/symbols.ts +67 -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 +384 -93
- package/node_modules/pi-agent-ide-lsp/src/search-resolver.ts +356 -79
- 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 +121 -26
- 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 +38 -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 +136 -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 +121 -26
- 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 +94 -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 +222 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/declaration-scan.ts +116 -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/initialization-options.ts +37 -0
- 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 +185 -131
- 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 +45 -24
- package/src/plugins/pi-agent-ide-lsp/src/lsp/position-map.ts +17 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/project.ts +40 -12
- 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 +414 -174
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbol-selectors.ts +424 -0
- package/src/plugins/pi-agent-ide-lsp/src/lsp/symbols.ts +67 -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 +384 -93
- package/src/plugins/pi-agent-ide-lsp/src/search-resolver.ts +356 -79
- 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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as Z,c as Oe}from"./chunk-QSU5AEKW.js";import{a as Re}from"./chunk-54EFJYUB.js";import{a as ke}from"./chunk-4DLSZYUO.js";import{a as Ae,b as xe}from"./chunk-VPBGKSFI.js";import"./chunk-T5PXAYWC.js";import{b as Ee}from"./chunk-V2LLMBTA.js";import{b as X,c as Q,f as V,h as Pe,j as D,k as Ie,l as Ce,m as Te}from"./chunk-S4GTWS2J.js";import{c as Se}from"./chunk-XHFAV2NI.js";import{a as be,b as ve,c as De}from"./chunk-JYITLCXC.js";import"./chunk-PBMHSK6J.js";import{d as we,e as L}from"./chunk-OA26FH5G.js";import{a as ye}from"./chunk-BXGMMZT3.js";import{a as K,b as le,c as ue,d as fe,e as ge,g as he}from"./chunk-MLFJU2US.js";import"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import{d as me}from"./chunk-2EY3LEZ7.js";import{a as N}from"./chunk-ZC65Z3CK.js";import{a as s}from"./chunk-EI7MMDWY.js";import{mkdir as Xe,readFile as Qe,writeFile as Ze}from"node:fs/promises";async function $e(n,r,t,o){if(o?.throwIfAborted(),n.includes("://")&&!t||t&&t.source!==n)throw Object.assign(new Error("Doctor configuration needs its project owner"),{code:"UNSUPPORTED_SOURCE"});t||await Xe(we(n),{recursive:!0});let e=[],i=r.filter(f=>f.recipe.formatter!==void 0),a=r.filter(f=>f.recipe.linter!==void 0),l=r.filter(f=>f.recipe.lsp!==void 0);if(i.length>0){let f=t?(await t.configPaths("formatters",o)).project:L(n,"formatters"),{config:h,previous:d}=await q(f,{version:1,formatters:{}},t,o),m=ee(h,"formatters");for(let w of i)m[w.recipe.id]??=w.recipe.formatter;await te(f,h,d,t,o)&&e.push(f)}if(a.length>0){let f=t?(await t.configPaths("linters",o)).project:L(n,"linters"),{config:h,previous:d}=await q(f,{version:1,linters:{}},t,o),m=ee(h,"linters");for(let w of a)m[w.recipe.id]??=w.recipe.linter;await te(f,h,d,t,o)&&e.push(f)}if(l.length>0){let f=t?(await t.configPaths("lsp-servers",o)).project:L(n,"lsp-servers"),{config:h,previous:d}=await q(f,{version:1,servers:{}},t,o),m=ee(h,"servers");for(let w of l){let g=N(w.recipe.lsp);m[w.recipe.id]??={command:g.command,transport:"stdio",rootMarkers:g.rootMarkers,...g.initializationOptions!==void 0&&{initializationOptions:g.initializationOptions},...g.settings!==void 0&&{settings:g.settings},...g.requireRootMarker!==void 0&&{requireRootMarker:g.requireRootMarker},languages:Object.fromEntries(Object.entries(g.languageIds).map(([y,C])=>[y,{extensions:C,...g.fileNames?.[y]&&{fileNames:g.fileNames[y]}}])),capabilities:["diagnostics"]}}await te(f,h,d,t,o)&&e.push(f)}return e}s($e,"writeSuggestedConfigs");async function q(n,r,t,o){let e;try{e=t?await t.readText(n,o):await Qe(n,{encoding:"utf8",signal:o})}catch(a){if(o?.throwIfAborted(),!(typeof a=="object"&&a!==null&&"code"in a&&a.code==="ENOENT"))throw a}if(o?.throwIfAborted(),e===void 0)return{config:r,previous:e};let i=JSON.parse(e);if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`${n} must contain an object`);return{config:i,previous:e}}s(q,"readObject");function ee(n,r){let t=n[r];if(typeof t!="object"||t===null||Array.isArray(t))throw new Error(`${r} must be an object`);return t}s(ee,"objectMember");async function te(n,r,t,o,e){e?.throwIfAborted();let i=`${JSON.stringify(r,null,2)}
|
|
2
|
+
`;return t===i?!1:(o?await o.writeText(n,i,t,e):await Ze(n,i,{encoding:"utf8",signal:e}),!0)}s(te,"writeJson");function je(n,r){let t=new Set,o;for(let e of n.trim().split(/\s+/u).filter(Boolean))if(["--apply","--no-apply","--agent"].includes(e))t.add(e);else if(e.startsWith("ssh://")&&o===void 0)o=e;else throw new TypeError("Use /agent-ide-doctor [ssh://target/path] [--apply | --no-apply] [--agent]");if(t.has("--apply")&&t.has("--no-apply"))throw new TypeError("Choose --apply or --no-apply, not both");return{cwd:o??r,flags:t}}s(je,"parseDoctorArguments");var Y=class{static{s(this,"DoctorCore")}plugins=new Map;languages=[];recipes=[];setupChecks=[];checks=[];queue=Promise.resolve();registerPlugin(r){let t=this.plugins.get(r.id);if(t!==void 0)return t;let o=this.queue.then(async()=>{let e=!0,i=[],a=[],l=[],f=[],h={addLanguage:s(d=>{z(d,i,r.id,"language",()=>e)},"addLanguage"),addToolRecipe:s(d=>{z(d,a,r.id,"tool recipe",()=>e)},"addToolRecipe"),addSetupCheck:s(d=>{z(d,l,r.id,"setup check",()=>e)},"addSetupCheck"),addCheck:s(d=>{z(d,f,r.id,"check",()=>e)},"addCheck")};try{await r.setup(h)}finally{e=!1}Ne(this.languages,i,"language"),Ne(this.recipes,a,"tool recipe"),this.languages.push(...i),this.recipes.push(...a),this.setupChecks.push(...l),this.checks.push(...f)});return this.plugins.set(r.id,o),this.queue=o.catch(()=>{}),o.catch(()=>{this.plugins.delete(r.id)}),o}async waitForPlugins(){await Promise.all(this.plugins.values())}snapshot(){return{languages:[...this.languages],recipes:[...this.recipes],setupChecks:[...this.setupChecks],checks:[...this.checks]}}};async function Le(n,r){let t=[],o=[];for(let e of n.setupChecks)try{let i=await e.value.inspect(r);t.push(...(i.selections??[]).map(a=>({...a,pluginId:e.pluginId}))),o.push(...(i.actions??[]).map(a=>({...a,pluginId:e.pluginId})))}catch{}return{selections:t,actions:o}}s(Le,"runContributedSetupChecks");async function _e(n,r){let t=[];for(let o of n.checks)try{t.push({pluginId:o.pluginId,title:o.value.title,findings:await o.value.run(r)})}catch(e){t.push({pluginId:o.pluginId,title:o.value.title,findings:[{status:"fail",message:e instanceof Error?e.message:String(e)}]})}return t}s(_e,"runContributedChecks");function Ne(n,r,t){for(let o of r){let e=n.find(i=>i.value.id===o.value.id)?.pluginId;if(e!==void 0)throw new Error(`${t} ${o.value.id} is already owned by doctor plugin ${e}`)}}s(Ne,"assertAvailable");function z(n,r,t,o,e){if(!e())throw new Error(`Doctor plugin ${t} setup is complete`);if(!/^[a-z0-9][a-z0-9.-]*$/u.test(n.id))throw new Error(`Invalid ${o} ID: ${n.id}`);if(r.some(i=>i.value.id===n.id))throw new Error(`Doctor plugin ${t} registered ${o} ${n.id} twice`);r.push({pluginId:t,value:n})}s(z,"add");import at from"node:path";import{readFile as qe}from"node:fs/promises";async function Ue(n,r,t,o=process.env,e,i){e?.throwIfAborted();let a=t.filter(({value:g})=>g.languages.some(y=>r.has(y))),l=a.map(g=>g.value),f=i?await i.evidence(l,e):await ye(n,l,void 0,e),h=await tt(n,e,i),d=[...new Set(l.flatMap(g=>g.executables))],m=i?await i.executableAvailability(d.map(g=>({command:[g]})),e):void 0;if(e?.throwIfAborted(),m&&(m.length!==d.length||m.some(g=>typeof g!="boolean")))throw new TypeError("Invalid Doctor executable availability report");let w=[];for(let g of a){e?.throwIfAborted();let y=g.value,C=[],I=1,b=f.get(y.id),O=b?.config;O!==void 0&&(I+=6,C.push(`project config: ${O}`)),h.has(`${y.kind}:${y.id}`)&&(I+=6,C.push("Pi Agent IDE config"));let p=b?.dependency;p!==void 0&&(I+=4,C.push(`project dependency: ${p}`));let c=m?y.executables.find(u=>m[d.indexOf(u)]===!0):await et(n,y.executables,o,e);c!==void 0&&(I+=3,C.push(`executable: ${c}`)),w.push({pluginId:g.pluginId,recipe:y,score:I,evidence:C,...c&&{executable:c}})}return w.sort((g,y)=>y.score-g.score||g.recipe.id.localeCompare(y.recipe.id))}s(Ue,"discoverRecipeCandidates");function Be(n,r,t=[]){let o=new Map,e=new Map(t.map(i=>[`${i.kind}:${i.languageId}`,i.toolId]));for(let i of r)for(let a of["formatter","linter","lsp"]){let l=e.get(`${a}:${i}`),f=l===void 0?4:7,h=n.filter(m=>m.recipe.kind===a&&m.recipe.languages.includes(i)&&m.executable!==void 0&&m.recipe.id!==l&&m.score>=f),d=h[0];d!==void 0&&(h.filter(m=>m.score===d.score).length>1||o.set(`${d.recipe.kind}:${d.recipe.id}`,d))}return[...o.values()]}s(Be,"selectSuggestedRecipes");async function et(n,r,t,o){for(let e of r)if(await me(e,n,t,o))return e}s(et,"firstExecutable");async function tt(n,r,t){let o=new Set;for(let[e,i,a]of[["formatters","formatters","formatter"],["linters","linters","linter"],["lsp-servers","servers","lsp"]])try{r?.throwIfAborted();let l=t?(await t.configPaths(e,r)).project:L(n,e),f=t?await t.readText(l,r):await qe(l,{encoding:"utf8",signal:r});if(r?.throwIfAborted(),f===void 0)continue;let h=JSON.parse(f);if(typeof h!="object"||h===null||Array.isArray(h))continue;let m=h[i];if(typeof m=="object"&&m!==null&&!Array.isArray(m))for(let w of Object.keys(m))o.add(`${a}:${w}`)}catch(l){if(r?.throwIfAborted(),!(l instanceof SyntaxError)&&!(typeof l=="object"&&l!==null&&"code"in l&&l.code==="ENOENT"))throw l}return o}s(tt,"managedRecipeIds");import{execFile as ot}from"node:child_process";import{readdir as nt}from"node:fs/promises";import _ from"node:path";import{promisify as rt}from"node:util";var it=rt(ot),st=new Set([".git",".hg",".svn","node_modules","vendor","build","dist","coverage",".cache",".next","target"]);async function Fe(n,r){r?.throwIfAborted();try{let o=(await it("git",["ls-files","--cached","--others","--exclude-standard","-z"],{cwd:n,encoding:"utf8",maxBuffer:16777216,signal:r})).stdout.split("\0").filter(Boolean).map(e=>_.resolve(n,e)).filter(e=>!We(e));return r?.throwIfAborted(),o.length>0?o:await oe(n,r)}catch{return r?.throwIfAborted(),oe(n,r)}}s(Fe,"collectProjectFiles");function Me(n,r,t=process.platform){let o=new Map,e=t==="win32"?_.win32:_;for(let i of r){let a=new Set(i.extensions.map(d=>d.toLowerCase())),l=s(d=>t==="win32"?d.toLowerCase():d,"normalizeName"),f=new Set(i.fileNames?.map(l)),h=n.filter(d=>!d.split(_.sep).join("/").includes("/.pi/pi-agent-ide/")&&(a.has(e.extname(d).toLowerCase())||f.has(l(e.basename(d)))));h.length>0&&o.set(i.id,h)}return o}s(Me,"detectProjectLanguages");async function oe(n,r){r?.throwIfAborted();let t=[];for(let o of await nt(n,{withFileTypes:!0})){if(o.isDirectory()&&st.has(o.name))continue;let e=_.join(n,o.name);We(e)||(o.isDirectory()?t.push(...await oe(e,r)):o.isFile()&&t.push(e))}return t}s(oe,"walk");function We(n){return n.split(_.sep).join("/").includes("/.pi/pi-agent-ide/")}s(We,"isManagedIdeConfig");function ct(n,r){if(n.includes("://")&&!r||r&&r.source!==n)throw Object.assign(new Error(`Doctor requires the owner of ${n}`),{code:"UNSUPPORTED_SOURCE"})}s(ct,"assertWorkspace");async function ne(n,r,t=process.env,o,e){o?.throwIfAborted(),ct(r,e);let i=e?await e.files(o):await Fe(r,o);o?.throwIfAborted();let a=Me(i,n.languages.map(w=>w.value),e?.platform),l=new Set(a.keys()),f={cwd:r,files:i,detectedLanguageIds:l,detectedLanguages:a,env:e?{...e.toolPaths}:t,signal:o,workspace:e},[h,d]=await Promise.all([Ue(r,l,n.recipes,e?{...e.toolPaths}:t,o,e),Le(n,f)]);o?.throwIfAborted();let m=new Map;for(let w of l)for(let g of["formatter","linter","lsp"]){if(d.selections.some(b=>b.languageId===w&&b.kind===g))continue;let y=h.filter(b=>b.recipe.kind===g&&b.recipe.languages.includes(w)),C=s(b=>b.score-(b.executable===void 0?0:3),"nativeScore"),I=Math.max(1,...y.map(C));for(let b of y){if(b.executable!==void 0||C(b)!==I||I<=1)continue;let O=`${g}-${b.recipe.id}-unavailable`;m.set(O,{id:O,pluginId:b.pluginId,message:`Native project setup selects ${b.recipe.id}, but its executable is unavailable. Install ${b.recipe.executables.join(" or ")} and run Doctor again.`})}}return{cwd:r,files:i,detectedLanguages:a,candidates:h,selections:d.selections,actions:[...d.actions,...m.values()],suggestions:Be(h,l,d.selections)}}s(ne,"inspectDoctorSetup");async function G(n,r,t=process.env,o,e){let i=await ne(n,r,t,o,e),a=new Set(i.detectedLanguages.keys()),l={cwd:r,files:i.files,detectedLanguageIds:a,detectedLanguages:i.detectedLanguages,env:e?{...e.toolPaths}:t,signal:o,workspace:e},f=await _e(n,l);o?.throwIfAborted();let h=[{status:"pass",message:`Project: ${r}`},i.files.length>0?{status:"pass",message:`${i.files.length} project files inspected`}:{status:"warn",message:"No project files found"},a.size>0?{status:"pass",message:`Detected: ${[...a].join(", ")}`}:{status:"warn",message:"No registered project languages detected"}];return{...i,sections:[{title:"Project",pluginId:"doctor",findings:h},...f]}}s(G,"runDoctor");function M(n){let r=["Agent IDE doctor",""];for(let t of n.sections){r.push(`${t.title} (${t.pluginId})`);for(let o of t.findings)r.push(` ${o.status.toUpperCase().padEnd(4)} ${o.message}`),o.detail!==void 0&&r.push(` \`${o.detail}\``);r.push("")}if(n.actions.length>0){r.push("Setup needs attention");for(let t of n.actions)r.push(` ${t.message} [${t.pluginId}]`);r.push("")}if(n.suggestions.length>0){r.push("Suggested configuration");for(let t of n.suggestions){let o=t.evidence.length>0?` \u2014 ${t.evidence.join(", ")}`:"";r.push(` ${t.recipe.kind.padEnd(9)} ${t.recipe.id} [${t.pluginId}]${o}`)}r.push("")}return r.join(`
|
|
3
|
+
`).trimEnd()}s(M,"formatDoctorReport");function re(n){return n.actions.length>0||n.suggestions.length>0||n.sections.some(r=>r.findings.some(t=>t.status==="fail"))}s(re,"doctorNeedsWork");function Je(n){let r=n.candidates.map(t=>({owner:t.pluginId,id:t.recipe.id,kind:t.recipe.kind,languages:t.recipe.languages,evidence:t.evidence,documentation:t.recipe.documentation}));return["Finish configuring Pi Agent IDE for this project.","Preserve existing formatter, linter, compiler, and style rules. Do not invent or replace native project settings.","Do not install packages, write credentials, or change source files without the user's normal confirmation.","Pi Agent IDE project configs live in .pi/pi-agent-ide/.","Use only the relevant plugin contributions listed below; each owner remains responsible for its own scope.","",M(n),"","Relevant registered recipes:",JSON.stringify(r,null,2),"",`Project root: ${n.cwd.includes("://")?n.cwd:at.resolve(n.cwd)}`].join(`
|
|
4
|
+
`)}s(Je,"buildDoctorAgentPrompt");import{createHash as dt}from"node:crypto";var pt="doctor",ie=3;function Ve(n,r){let t=be(n,lt(r));t!==void 0&&t.catch(()=>{})}s(Ve,"registerDoctorTipProvider");function lt(n){return{protocol:ve,apiVersion:De,id:pt,async getTip(r){let t=await n(r),o=ut(t);if(o.length===0)return;let e=o.slice(0,ie).map(i=>`\u2022 ${i.message}`);return o.length>ie&&e.push(`\u2022 ${o.length-ie} more`),{id:`doctor-setup-${ft(o)}`,title:o.length===1?"Project setup needs attention":`${o.length} project setup items`,body:[...e,"Run /agent-ide-doctor"].join(`
|
|
5
|
+
`)}}}}s(lt,"createDoctorTipProvider");function ut(n){let r=n.actions.map(o=>({id:`action:${o.pluginId}:${o.id}`,message:o.message})),t=n.suggestions.map(o=>{let e=o.recipe.languages.filter(a=>n.detectedLanguages.has(a)).join(", "),i={debugger:"debugging",formatter:"formatting",linter:"linting",lsp:"language support"}[o.recipe.kind];return{id:`suggestion:${o.pluginId}:${o.recipe.kind}:${o.recipe.id}`,message:`Use ${o.recipe.name} for ${e} ${i}`}});return[...r,...t].sort((o,e)=>o.id.localeCompare(e.id))}s(ut,"setupItems");function ft(n){return dt("sha256").update(n.map(r=>`${r.id}\0${r.message}`).join("\0")).digest("hex").slice(0,12)}s(ft,"fingerprint");async function ze(n,r){let t=new Y;Ve(n,async i=>(await t.waitForPlugins(),ne(t.snapshot(),i.cwd,process.env,i.signal)));let o,e=n.events.on(ge,i=>{if(!he(i))throw new Error("Invalid doctor plugin registration request");i.accept(t.registerPlugin(i.plugin))});n.on("session_shutdown",e),n.registerCommand("agent-ide-doctor",{description:"Check and configure this project or an explicit ssh://target/path",handler:s(async(i,a)=>{let{cwd:l,flags:f}=je(i,a.cwd),h=await r?.(l);await t.waitForPlugins();let d=await G(t.snapshot(),l,process.env,void 0,h);if(se(n,M(d)),d.suggestions.length>0&&!f.has("--no-apply")&&(f.has("--apply")||a.hasUI&&await a.ui.confirm("Apply suggested configuration?","Add detected tools to .pi/pi-agent-ide/. Existing entries and native tool settings are kept."))){let g=await $e(l,d.suggestions,h),y=g.length===0?"Pi Agent IDE configs are already up to date":`Updated ${g.length} Pi Agent IDE config ${g.length===1?"file":"files"}`;a.ui.notify(y,"info"),d=await G(t.snapshot(),l,process.env,void 0,h),se(n,M(d))}if(!re(d)&&!f.has("--agent"))return;(f.has("--agent")||a.hasUI&&await a.ui.confirm("Ask the agent to finish setup?","The agent will receive this redacted report and relevant plugin recipes."))&&(o={cwd:l,workspace:h},n.sendUserMessage(Je(d)))},"handler")}),n.on("agent_end",async(i,a)=>{let l=o;if(l===void 0)return;o=void 0;let f=await G(t.snapshot(),l.cwd,process.env,void 0,l.workspace);se(n,`Doctor recheck after agent setup
|
|
6
|
+
|
|
7
|
+
${M(f)}`),re(f)?a.ui.notify("Pi Agent IDE setup still needs attention","warning"):a.ui.notify("Pi Agent IDE setup is ready","info")}),n.events.emit(fe,{protocol:le,apiVersion:ue}),await t.waitForPlugins()}s(ze,"registerDoctorWithOwner");function se(n,r){n.sendMessage({customType:"agent-ide-doctor",content:r,display:!0},{triggerTurn:!1})}s(se,"sendReport");import U from"node:path";import{Type as E}from"typebox";import{Value as ae}from"typebox/value";var Ye={"doctor-inventory-worker.py":Q(new URL("./doctor-inventory-worker.py",new URL("../src/backend/doctor-workspace.ts",import.meta.url).href)),"doctor-probe-worker.py":Q(new URL("./doctor-probe-worker.py",new URL("../src/backend/doctor-workspace.ts",import.meta.url).href))},gt=E.Object({directory:E.String(),device:E.String({pattern:"^[0-9]+$"}),inode:E.String({pattern:"^[0-9]+$"}),containerCreated:E.Boolean(),containerDevice:E.String({pattern:"^[0-9]+$"}),containerInode:E.String({pattern:"^[0-9]+$"})});async function Ge(n,r,t){t?.throwIfAborted();let o=n.resolve(r);if(!o)throw new D("UNSUPPORTED_SOURCE",r,"not-applied");let e=o.location,i=o.backend;if((await i.stat(e.path,{signal:t})).kind!=="directory")throw new D("NOT_DIRECTORY",e.source,"not-applied");let a=s(p=>{let c=n.resolve(p);if(!c||c.location.target!==e.target)throw new D("UNSUPPORTED_SOURCE",p,"not-applied");return c.location.path},"resolve"),l=await Z({...i.target,workspace:e.path},V("import json,os,sys; keys=json.loads(sys.argv[1]); print(json.dumps({k:os.environ[k] for k in keys if k in os.environ}))"),[JSON.stringify(K)],e.source,{signal:t,timeoutMs:5e3,maxBytes:128*1024});if(l.exitCode!==0)throw new D("DEPENDENCY_UNAVAILABLE",e.source,"not-applied");let f=JSON.parse(l.stdout.toString("utf8")),h=E.Object(Object.fromEntries(K.map(p=>[p,E.Optional(E.String({maxLength:4096}))])),{additionalProperties:!1});if(!ae.Check(h,f))throw new D("INVALID_RESPONSE",e.source,"not-applied");let d=Ae(n),m=Re(n),w=ke(n,e.source),g=new Map,y=s(async(p,c,u)=>{u?.throwIfAborted();let S=await Ye[p],P=await Z(i.target,V(S),c,e.source,{signal:u,timeoutMs:3e4,maxBytes:32*1024*1024});if(P.exitCode!==0)throw new D("DOCTOR_FAILED",e.source,"not-applied");return JSON.parse(P.stdout.toString("utf8"))},"executeWorker"),C=s(async(p,c,u)=>{u?.throwIfAborted();let S=await Ye["doctor-probe-worker.py"],P=new AbortController,$=u?AbortSignal.any([u,P.signal]):P.signal,j=setTimeout(()=>P.abort(new D("TIMEOUT",e.source,"not-applied")),3e4),R,x=!1,T,k;try{R=await Pe(i.target,V(S),[JSON.stringify({operation:"create",source:p})],i.target.workspace,{signal:$});let v=0,B=s(A=>(v+=A.length,v<=128*1024?!0:(P.abort(new D("BYTE_LIMIT",e.source,"not-applied")),!1)),"consume");R.stderr.on("data",A=>{B(A)});let H=R,W=new Promise((A,He)=>{let F=Buffer.alloc(0),ce=!1;H.stdout.on("data",de=>{if(!B(de)||ce)return;F=Buffer.concat([F,de]);let pe=F.indexOf(`
|
|
8
|
+
`);if(!(pe<0)){ce=!0;try{A(JSON.parse(F.subarray(0,pe).toString("utf8")))}catch(Ke){He(Ke)}F=Buffer.alloc(0)}})}),J=await Promise.race([W,R.completion.then(()=>{throw new D("PROBE_FAILED",e.source,"not-applied")})]);if(u?.throwIfAborted(),!ae.Check(gt,J))throw new D("PROBE_FAILED",e.source,"not-applied");if(k=J,await R.write(Buffer.from(`retain
|
|
9
|
+
`)),await R.end(),(await R.completion).exitCode!==0)throw new D("PROBE_FAILED",e.source,"not-applied")}catch(v){x=!0,T=u?.aborted?u.reason:P.signal.aborted?P.signal.reason:v}finally{clearTimeout(j)}try{let v=await R?.stop();if(v?.exitCode===0&&k&&c(k),v?.exitCode===2)throw new D("PROBE_CLEANUP_FAILED",e.source,"unknown")}catch(v){throw new AggregateError(x?[T,v]:[v],"Doctor allocation cleanup failed",{cause:v})}if(x)throw T},"allocateProbe"),I=new Map,b=s(async p=>{for(;;){let c=I.get(p);if(c?.cleanup){await c.cleanup;continue}let u=c??{users:0};return u.users++,I.set(p,u),u}},"acquireContainer"),O=s(async(p,c)=>{c.users--,c.users===0&&(c.cleanup=Promise.resolve().then(async()=>{if(c.created&&await y("doctor-probe-worker.py",[JSON.stringify({operation:"remove-container",...c.created})])!==null)throw new D("PROBE_CLEANUP_FAILED",e.source,"unknown")}).finally(()=>{I.get(p)===c&&I.delete(p)}),await c.cleanup)},"releaseContainer");return{source:e.source,platform:"linux",toolPaths:f,async probeBrowser(p){return await Oe({...i.target,workspace:e.path},e.source,p),{ok:!0,detail:"Target Playwright and Chromium started without navigation"}},async files(p){let c=await y("doctor-inventory-worker.py",[e.path],p);if(!ae.Check(E.Array(E.String()),c))throw new D(typeof c=="object"&&c!==null&&"error"in c&&c.error==="BYTE_LIMIT"?"BYTE_LIMIT":"INVENTORY_FAILED",e.source,"not-applied");return c.map(u=>{let S=U.posix.resolve(e.path,u);if(U.posix.isAbsolute(u)||!(S.startsWith(`${e.path}/`)||e.path==="/"))throw new D("INVALID_RESPONSE",e.source,"not-applied");return X(e.target,S).source})},async readText(p,c){try{let u=await i.read(a(p),{signal:c}),S=u.bytes.toString("utf8");return g.set(p,{content:S,version:u.version}),S}catch(u){if(u instanceof D&&u.code==="ENOENT")return;throw u}},async writeText(p,c,u,S){let P=g.get(p);if(u!==void 0&&(!P||P.content!==u))throw new D("CONFLICT",p,"not-applied");await i.write(a(p),Buffer.from(c),u===void 0?null:P?.version??null,{signal:S})},configPaths:s((p,c)=>d.paths(e.source,p,c),"configPaths"),async exists(p,c){try{return await i.stat(a(p),{signal:c}),!0}catch(u){if(u instanceof D&&u.code==="ENOENT")return!1;throw u}},evidence:s((p,c)=>xe(i,e.path,p,c),"evidence"),executableAvailability:s((p,c)=>Ee(i,e.path,p,c),"executableAvailability"),run:s((p,c,u)=>m.run(p,{projectRoot:e.source,filePath:c,signal:u}),"run"),async withProbeCopy(p,c,u){u?.throwIfAborted();let S=a(p),P=U.posix.join(U.posix.dirname(S),".tmp"),$=await b(P),j,R=U.posix.basename(S),x=[],T;try{let v=$.allocation,B={};$.allocation=new Promise(A=>{B.resolve=A});let H=N(B.resolve);try{await v,u?.throwIfAborted(),await C(S,A=>{j=A,A.containerCreated&&($.created={container:P,device:A.containerDevice,inode:A.containerInode})},u)}finally{H()}let W=U.posix.join(N(j).directory,R),J=await i.lstat(S,{signal:u});await i.copy(S,W,J.revision,null,{signal:u}),u?.throwIfAborted(),x.push({value:await c(X(e.target,W).source)})}catch(v){T=v}let k=[];if(j)try{if(await y("doctor-probe-worker.py",[JSON.stringify({operation:"remove",...j,name:R})])!==null)throw new D("PROBE_CLEANUP_FAILED",p,"unknown")}catch(v){k.push(v)}try{await O(P,$)}catch(v){k.push(v)}if(k.length>0)throw new AggregateError(x.length===0?[T,...k]:k,"Doctor probe cleanup failed",{cause:k[0]});if(x.length===0)throw T;return N(x[0]).value},start:s((p,c,u)=>w.start({rootUri:e.source,command:p,env:c,signal:u}),"start"),toNativeUri:s(p=>w.toServerUri(p),"toNativeUri"),fromNativeUri:s(p=>w.fromServerUri(p),"fromNativeUri")}}s(Ge,"createSshDoctorWorkspace");async function ht(n){let r=new Te(await Ce(Ie(Se())));await ze(n,t=>t.startsWith("ssh://")?Ge(r,t):Promise.resolve(void 0))}s(ht,"registerOwnedDoctor");export{ht as default};
|
package/dist/entry-0.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-ON5HDFNL.js";import{c as te,d as re}from"./chunk-J6CDIH3S.js";import"./chunk-J34VKQGJ.js";import{a as ie}from"./chunk-WCSWQDJ2.js";import{b as oe}from"./chunk-YHADTHQM.js";import"./chunk-EWTVVPUA.js";import"./chunk-MXLSGMRZ.js";import"./chunk-UDVVKVG4.js";import{a as ae}from"./chunk-YOJHCARZ.js";import"./chunk-HJXSEPO7.js";import{a as ne}from"./chunk-TWQ6ACOI.js";import"./chunk-FGN2ZMEN.js";import"./chunk-STUZZM5B.js";import{a as q}from"./chunk-WQTF6Q2X.js";import{b as ee}from"./chunk-APWMLLSE.js";import"./chunk-OCU6NW5Y.js";import"./chunk-ECSMTGVM.js";import"./chunk-K5M65CAF.js";import"./chunk-P7FUD4WY.js";import{a as se}from"./chunk-B5UJCNQU.js";import{a as K,b as Z}from"./chunk-YFPU2LRR.js";import"./chunk-NF74ITWT.js";import"./chunk-5D4C225L.js";import"./chunk-JXULBI4S.js";import"./chunk-R2U5WXYR.js";import"./chunk-HFCHOFLV.js";import"./chunk-5AROEOJB.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import{a as F}from"./chunk-M7P7V4WI.js";import"./chunk-33U3RUM3.js";import"./chunk-YGGKGZO2.js";import"./chunk-N2NEFXHB.js";import"./chunk-KQV2ZXLP.js";import"./chunk-MPT3R4BL.js";import"./chunk-KN6VPARZ.js";import"./chunk-2YO6RVX4.js";import"./chunk-MLFJU2US.js";import"./chunk-C2GZLLSP.js";import"./chunk-LY2UANKU.js";import{e as Q}from"./chunk-PS2B6THP.js";import"./chunk-QGXZ4RWX.js";import"./chunk-YZTVC7ME.js";import{c as B,d as Y}from"./chunk-VDSSAP6Y.js";import{a as X}from"./chunk-2DSY4U73.js";import{a as V,b as J}from"./chunk-H6FEBUAP.js";import{N as k}from"./chunk-SIYPD5MM.js";import"./chunk-756K3LJY.js";import{c as G}from"./chunk-RQ7JJ7GV.js";import"./chunk-S7E2D5K7.js";import"./chunk-ZC65Z3CK.js";import{a as n}from"./chunk-EI7MMDWY.js";import{Type as Re}from"typebox";var ce=["read","search","write","replace","insert","delete","copy","move","diff"],de={read:["path"],search:["path"],write:["path"],replace:["path"],insert:["path"],delete:["path"],copy:["path","target"],move:["path","target"],diff:["before","after"]},ue=new Set(["read","search","diff"]),pe="pi-agent-ide/standalone-reservation/v1",m=n(a=>a!==null&&typeof a=="object"&&!Array.isArray(a),"record"),fe=n(a=>a.startsWith("pi-agent-ide/operation-approval/")||a.startsWith("pi-agent-ide/settings/"),"shared");function me(a,h){let d=h.namespace.name;if(!/^[a-z][a-z0-9_]*$/u.test(d))throw new Error("Resource host namespace must be a lowercase identifier.");let w=new Set(h.tools??ce);if([...w].some(e=>!ce.includes(e)))throw new Error("Unsupported resource host tool.");let p={namespace:d,claimed:!1};if(a.events.emit(pe,p),p.claimed)throw new Error(`Resource host namespace already registered: ${d}`);let A=a.events.on(pe,e=>{m(e)&&e.namespace===d&&(e.claimed=!0)}),R=new Map,u=new Set,g=[A],S=new Map,I=new Map,C=new Set,E=!1,D,_,y=n(e=>`${d}_${e}`,"publicName"),b=n(e=>typeof e=="string"&&e.startsWith(d+"_")&&w.has(e.slice(d.length+1))?e.slice(d.length+1):void 0,"localName"),H=n(e=>e.replace(/\b(?:read|search|select|write|replace|insert|delete|copy|move|diff)\b/gu,(o,t)=>{let s=e.slice(0,t),r=e.slice(t+o.length);return s.endsWith("tools.")||s.endsWith("`")&&/^[`.]/u.test(r)||/(?:\bUse|\band) $/u.test(s)&&r.startsWith(" to ")?y(o):o}),"words");function U(e,o){let t=e.startsWith("raw:")&&!o?e.slice(4):e;return!o&&(t.startsWith("docs:")||t.startsWith("temp:"))?!0:/^[a-z][a-z\d+.-]*:\/\//iu.test(t)&&!/^(?:file:|[a-z]:[/\\])/iu.test(t)&&h.ownsSource(t)}n(U,"owns");let j=n(()=>k(_),"targets");async function x(e,o,t){let s=j().source(e,o.cwd,!t);if(Array.isArray(s)){for(let r of s)await x(r,o,t);return}if(m(s)&&"path"in s){await x(s.path,o,t);return}if(typeof s!="string")throw new Error("Use an owned resource URI or an issued source result.");if(s.startsWith("RESULT#")){let r=j().resolve(s,o.cwd);if(r.targets.some(f=>!U(f.source,t)))throw new Error("Source selection belongs outside this resource host.");await j().verify(r,o.signal);return}if(s.startsWith("SEARCH#")){let r=await D?.read({path:s},{cwd:o.cwd,signal:o.signal},"script");if(r?.isError||r?.script?.kind!=="text"||!r.script.target)throw new Error("Unknown or expired resource search selection.");await x(r.script.target,o,t);return}if(!U(s,t))throw new Error("Use this host only for its provider-owned resource URIs; local paths are not supported.")}n(x,"checkSource");async function M(e,o,t){if(E)throw new Error("Standalone resource host is closed.");if(!m(o))throw new Error("Resource tool arguments must be an object.");let s=!ue.has(e),r=de[e]??[];if(["read","search"].includes(e)&&o.path===void 0)throw new Error("Supply an explicit owned resource or source result.");if(s&&o.path===void 0){let f=oe(_)?.source;if(!f)throw new Error("Supply an owned source before editing.");await x(f,t,!0)}for(let f of r)o[f]!==void 0&&await x(o[f],t,s);for(let f of["start","end","anchor","targetStart","targetEnd"]){let c=o[f];typeof c=="string"&&/^(?:RESULT#|SEARCH#|<system-result)/u.test(c)&&await x(c,t,s)}if(e==="write"&&typeof o.content!="string")throw new Error("Standalone resource Write accepts text/JSON content, not filesystem image writes.")}n(M,"validate");let P=n((e,o)=>a.on(e,async(t,s)=>await o({...t},s)),"subscribe");g.push(P("tool_call",async(e,o)=>{let t=b(e.toolName);if(t)try{await M(t,e.input,o)}catch(s){return{block:!0,reason:s instanceof Error?s.message:String(s)}}}));let ge=n((e,o)=>{let t=o;if(e==="session_shutdown")return u.add(t),()=>{u.delete(t)};let s=P(e,async(r,f)=>{if(E)return;let c=r;if(e.startsWith("tool_")){let i=b(r.toolName);if(i)typeof r.parentToolCallId=="string"&&C.add(r.parentToolCallId),c={...r,toolName:i};else if(typeof r.toolCallId=="string"&&C.has(r.toolCallId))c={...r,toolName:r.toolName==="codemode"?"codemode":"__standalone_parent"};else return}if(e==="message_end"){if(!m(r.message)||r.message.role!=="toolResult")return;let i=b(r.message.toolName);if(!i)return;c={...r,message:{...r.message,toolName:i}}}e==="context"&&Array.isArray(r.messages)&&(c={...r,messages:r.messages.map(i=>m(i)&&typeof i.toolName=="string"?{...i,toolName:b(i.toolName)??"__outside_resource_host"}:i)});let l=await t(c,f);if(!m(l))return l;if(e==="message_end"&&m(l.message)&&m(r.message))return{...l,message:{...l.message,toolName:r.message.toolName}};if(e==="context"&&Array.isArray(l.messages)&&Array.isArray(r.messages)){let i=r.messages;if(l.messages.length!==i.length)throw new Error("Resource host context handlers must preserve message positions.");return{...l,messages:l.messages.map((N,O)=>{let T=i[O];return m(N)&&m(T)&&typeof T.toolName=="string"?{...N,toolName:T.toolName}:N})}}return l});return g.push(s),s},"on"),he={emit(e,o){if(E)throw new Error("Standalone resource host is closed.");if(fe(e))a.events.emit(e,o);else for(let t of R.get(e)??[])t(o)},on(e,o){if(fe(e)){let s=a.events.on(e,o);return g.push(s),s}let t=R.get(e);return t||R.set(e,t=new Set),t.add(o),()=>{t.delete(o)}}};function W(e){return Array.isArray(e)?e.map(W):m(e)?Object.fromEntries(Object.entries(e).map(([o,t])=>[o,o==="description"&&typeof t=="string"?H(t):W(t)])):e}n(W,"descriptions");function we(e){return{...e,tools:e.tools.flatMap(o=>{let t=b(o.name);return t?[{...o,name:t}]:[]}),executeTool(o,t,s){if(!w.has(o))throw new Error("Tool is not owned by this resource host.");return e.executeTool(y(o),t,s)}}}n(we,"toolContext"),_={...a,events:he,on:ge,registerTool:n(e=>{let o=e.name;if(!w.has(o))return;let t=Object.getOwnPropertyDescriptors(e);t.name={value:y(o),enumerable:!0,configurable:!0},t.label={value:y(o),enumerable:!0,configurable:!0},t.namespace={value:h.namespace,enumerable:!0,configurable:!0},t.exposure={value:"deferred",enumerable:!0,configurable:!0},t.description={get:n(()=>`Use ${y(o)} to ${o==="read"?"inspect provider-owned resources and packaged guides":o==="search"?"find objects or text within an explicit provider-owned resource":`${o} provider-owned text resources`}.`,"get"),enumerable:!0,configurable:!0},t.promptSnippet={get:n(()=>H(e.promptSnippet??""),"get"),enumerable:!0,configurable:!0},t.promptGuidelines={get:n(()=>[...(e.promptGuidelines??[]).map(H),"Use only this namespace's owned resource URIs and issued results. Local filesystem paths are not supported."],"get"),enumerable:!0,configurable:!0},t.parameters={get:n(()=>{let c=W(e.parameters),l=m(c.properties)?{...c.properties}:{};for(let i of de[o]??[])m(l[i])&&(l[i]={...l[i],description:"Provider-owned resource URI, unchanged source result, or an issued reference."});return o==="write"&&(l.content=Re.String({description:"Complete text/Markdown or JSON payload for the selected provider resource."})),Object.assign({},e.parameters,c,{properties:l})},"get"),enumerable:!0,configurable:!0};let s=n(async(c,l,i,N,O)=>{if(E)throw new Error("Standalone resource host is closed.");let T=new AbortController,L=n(()=>{},"finish"),ye=new Promise(v=>{L=v});S.set(T,ye);let be=[i,O.signal,T.signal].filter(v=>v!==void 0),$=AbortSignal.any(be);try{let v={...we(O),signal:$};return await M(o,l,v),$.throwIfAborted(),await e.execute(c,l,$,N,v)}finally{S.delete(T),L()}},"execute");t.execute={value:s,enumerable:!0,configurable:!0};let r=n((c,l,i)=>!ue.has(o)&&e.renderCall?e.renderCall(c,l,i):Q(i.lastComponent,{tool:y(o),primary:{text:m(c)?String(c.path??c.query??"owned resource"):"owned resource",truncate:"end"},expanded:i.expanded},l),"renderCall");t.renderCall={value:r,enumerable:!0,configurable:!0};let f=Object.defineProperties({},t);I.set(o,()=>a.registerTool({...f,exposure:"hidden"})),a.registerTool(f)},"registerTool"),getActiveTools:n(()=>a.getActiveTools().flatMap(e=>{let o=b(e);return o?[o]:[]}),"getActiveTools"),getAllTools:n(()=>a.getAllTools().flatMap(e=>{let o=b(e.name);return o?[{...e,name:o}]:[]}),"getAllTools"),setActiveTools(e){let o=a.getActiveTools().filter(t=>!b(t));a.setActiveTools([...o,...e.filter(t=>w.has(t)).map(y)])}},g.push(P("session_start",()=>{C.clear(),!(a.getSettings().defaultTools??[]).includes("-tool_search")&&a.getAllTools().some(e=>e.name==="tool_search"&&e.exposure!=="hidden")&&!a.getActiveTools().includes("tool_search")&&a.setActiveTools([...a.getActiveTools(),"tool_search"])})),g.push(P("agent_end",()=>{C.clear()}));async function z(e,o=!0){if(E)return;E=!0;for(let r of S.keys())r.abort();await Promise.all(S.values());let t=await Promise.allSettled([...u].map(r=>r({type:"session_shutdown"},e)));for(let r of g)r();if(R.clear(),u.clear(),C.clear(),o)for(let r of I.values())r();I.clear();let s=t.find(r=>r.status==="rejected");if(s?.status==="rejected")throw s.reason}return n(z,"dispose"),g.push(P("session_shutdown",(e,o)=>z(o,!1))),{api:_,owns:U,tools:[...w].map(y),dispose:z,setApi(e){_=e},setRead(e){D=e}}}n(me,"createResourceHostApi");async function Se(a,h){G(a);let d=me(a,h),w=F(d.api,{resourceOutput:!0,promptSection:`resource_${h.namespace.name}_results`}),p=w.api;d.setApi(p);try{await Z(p);let A;await X(p,{protocol:V,apiVersion:J,id:"standalone-resource-boundary",setup(u){A=u,d.setRead(u),u.addResourceGuard({id:"standalone-resource-boundary",guard:n(g=>d.owns(g.resourceSource,!1)?{kind:"accepted"}:{kind:"rejected",reason:"Resource belongs outside this standalone host."},"guard")}),u.addHandler({stage:"post-read",handler:K(k(p),u.read,g=>d.owns(g,!0))})}}),await q(p);let R=await te(p);if(await R.registerPlugin({protocol:B,apiVersion:Y,id:"standalone-resource-boundary",setup(u){u.addMutationGuard({id:"standalone-resource-boundary",guard:n(g=>g.resources.every(S=>d.owns(S.source,!0)&&S.binary===void 0)?{kind:"accepted"}:{kind:"rejected",rejection:{code:"RESOURCE_HOST_BOUNDARY",reason:"Resource belongs outside this standalone host.",message:"Use this host only for its provider-owned text resources.",effect:"not-applied"}},"guard")})}}),await se(p),await ne(p),await ae(p),await ee(p),!A)throw new Error("Standalone Read host did not initialize.");return await le(p,{recordType:`agent-documentation-read/${h.namespace.name}`,ownsTool:n(u=>typeof u=="string"&&d.tools.includes(u),"ownsTool")}),await ie(p,{preferences:{},toolName:n(u=>`${h.namespace.name}_${u}`,"toolName")}),re(p,R),w.finalize(),{api:p,tools:d.tools,dispose:n(u=>d.dispose(u),"dispose")}}catch(A){throw await d.dispose(),A}}n(Se,"createStandaloneResourceHost");export{Se as createStandaloneResourceHost};
|
|
1
|
+
import{a as he}from"./chunk-W25HNEMR.js";import{c as de,d as ue}from"./chunk-VB5P3TXJ.js";import{a as ge}from"./chunk-XLTAP5YC.js";import{b as ce}from"./chunk-YHADTHQM.js";import"./chunk-J5CKSIH7.js";import"./chunk-TIZ4QDF3.js";import"./chunk-JMCI2ZE2.js";import{a as pe}from"./chunk-RNDSWVJF.js";import{a as me}from"./chunk-HRZAIZGR.js";import"./chunk-3V3OQO5S.js";import"./chunk-ASVMQMPX.js";import{a as fe}from"./chunk-E7JBYW43.js";import"./chunk-MJMRV76H.js";import"./chunk-72WO7H5T.js";import{a as ie}from"./chunk-VWYI4WF7.js";import{b as le}from"./chunk-C327T6YP.js";import"./chunk-3BRGWFEI.js";import"./chunk-VQ2RA43A.js";import"./chunk-SF44YQCB.js";import"./chunk-QR7JR3P2.js";import{a as ae}from"./chunk-R7576HPO.js";import"./chunk-26SMC6OS.js";import"./chunk-QUK5ZEYX.js";import"./chunk-D23NS4VV.js";import"./chunk-3JBQYLJ4.js";import"./chunk-47SPPIXK.js";import"./chunk-VAXLSPPU.js";import{a as se}from"./chunk-MCHU3BLO.js";import"./chunk-XKVU6AAS.js";import"./chunk-E4V4VNRM.js";import"./chunk-GDIF3WT6.js";import"./chunk-VNG4QPPT.js";import"./chunk-YGGKGZO2.js";import"./chunk-VNNAVC4S.js";import"./chunk-6DC2Q5BI.js";import{d as oe}from"./chunk-BW3XONMZ.js";import"./chunk-GTZOIJCH.js";import"./chunk-JXULBI4S.js";import"./chunk-MPT3R4BL.js";import"./chunk-KN6VPARZ.js";import"./chunk-2YO6RVX4.js";import"./chunk-MLFJU2US.js";import{a as ne}from"./chunk-SJQGFUXR.js";import"./chunk-IZTOXSTR.js";import"./chunk-QCAGAJHJ.js";import"./chunk-JY63UUC2.js";import{a as Z}from"./chunk-I3G6K7QU.js";import{a as K,b as Q}from"./chunk-HSAGZWPO.js";import{e as re}from"./chunk-PS2B6THP.js";import{d as ee,e as te}from"./chunk-XEPCURYZ.js";import{G as J,H as X,ma as B,ta as k}from"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import"./chunk-2EY3LEZ7.js";import{c as Y}from"./chunk-RQ7JJ7GV.js";import"./chunk-IRLWXPL4.js";import"./chunk-ZC65Z3CK.js";import{a as n}from"./chunk-EI7MMDWY.js";import{Type as we}from"typebox";var ye=["read","search","write","replace","insert","delete","copy","move","diff"],Re={read:["path"],search:["path"],write:["path"],replace:["path"],insert:["path"],delete:["path"],copy:["path","target"],move:["path","target"],diff:["before","after"]},be=new Set(["read","search","diff"]),Se="pi-agent-ide/standalone-reservation/v1",g=n(a=>a!==null&&typeof a=="object"&&!Array.isArray(a),"record"),Ee=n(a=>a.startsWith("pi-agent-ide/operation-approval/")||a.startsWith("pi-agent-ide/settings/"),"shared"),H=class extends Error{constructor(d,w){super(w?"Local filesystem paths are not supported by this standalone host. Use a provider-owned resource URI.":"This resource URI is not owned by this standalone host. Use a resource owned by this namespace.");this.source=d;this.code=w?"RESOURCE_HOST_LOCAL_PATH":"RESOURCE_HOST_FOREIGN_SOURCE"}static{n(this,"ResourceHostSourceError")}code};function Te(a,y){let d=y.namespace.name;if(!/^[a-z][a-z0-9_]*$/u.test(d))throw new Error("Resource host namespace must be a lowercase identifier.");let w=new Set(y.tools??ye);if([...w].some(e=>!ye.includes(e)))throw new Error("Unsupported resource host tool.");let p={namespace:d,claimed:!1};if(a.events.emit(Se,p),p.claimed)throw new Error(`Resource host namespace already registered: ${d}`);let _=a.events.on(Se,e=>{g(e)&&e.namespace===d&&(e.claimed=!0)}),E=new Map,u=new Set,h=[_],T=new Map,U=new Map,v=new Set,C=!1,z,P,b=n(e=>`${d}_${e}`,"publicName"),S=n(e=>typeof e=="string"&&e.startsWith(d+"_")&&w.has(e.slice(d.length+1))?e.slice(d.length+1):void 0,"localName"),$=n(e=>e.replace(/\b(?:read|search|select|write|replace|insert|delete|copy|move|diff)\b/gu,(t,o)=>{let s=e.slice(0,o),r=e.slice(o+t.length);return s.endsWith("tools.")||s.endsWith("`")&&/^[`.]/u.test(r)||/(?:\bUse|\band) $/u.test(s)&&r.startsWith(" to ")?b(t):t}),"words");function j(e,t){let o=e.startsWith("raw:")&&!t?e.slice(4):e;return!t&&(o.startsWith("docs:")||o.startsWith("temp:"))?!0:/^[a-z][a-z\d+.-]*:\/\//iu.test(o)&&!/^(?:file:|[a-z]:[/\\])/iu.test(o)&&y.ownsSource(o)}n(j,"owns");let M=n((e,t)=>{let o=e.startsWith("raw:")&&!t?e.slice(4):e,s=!/^[a-z][a-z\d+.-]*:/iu.test(o)||/^(?:file:|[a-z]:)/iu.test(o);return new H(e,s)},"sourceError"),W=n(()=>k(P),"targets");async function O(e,t,o){let s=W().source(e,t.cwd,!o);if(Array.isArray(s)){for(let r of s)await O(r,t,o);return}if(g(s)&&"path"in s){await O(s.path,t,o);return}if(typeof s!="string")throw new Error("Use an owned resource URI or an issued source result.");if(s.startsWith("RESULT#")){let r=W().resolve(s,t.cwd),m=r.targets.find(i=>!j(i.source,o));if(m)throw M(m.source,o);await W().verify(r,t.signal);return}if(s.startsWith("SEARCH#")){let r=await z?.read({path:s},{cwd:t.cwd,signal:t.signal},"script");if(r?.isError||r?.script?.kind!=="text"||!r.script.target)throw new Error("Unknown or expired resource search selection.");await O(r.script.target,t,o);return}if(!j(s,o))throw M(s,o)}n(O,"checkSource");async function G(e,t,o){if(C)throw new Error("Standalone resource host is closed.");if(!g(t))throw new Error("Resource tool arguments must be an object.");let s=!be.has(e),r=Re[e]??[];if(["read","search"].includes(e)&&t.path===void 0)throw new Error("Supply an explicit owned resource or source result.");if(s&&t.path===void 0){let m=ce(P)?.source;if(!m)throw new Error("Supply an owned source before editing.");await O(m,o,!0)}for(let m of r)t[m]!==void 0&&await O(t[m],o,s);for(let m of oe(e)){let i=t[m];(B(i)!==void 0||typeof i=="string"&&/^(?:RESULT#|SEARCH#|<system-result)/u.test(i))&&await O(i,o,s)}if(e==="write"&&typeof t.content!="string")throw new Error("Standalone resource Write accepts text/JSON content, not filesystem image writes.")}n(G,"validate");let I=n((e,t)=>a.on(e,async(o,s)=>await t({...o},s)),"subscribe"),A=new Map;h.push(I("tool_call",async(e,t)=>{let o=S(e.toolName);if(o)try{await G(o,e.input,t)}catch(s){if(typeof e.toolCallId=="string")A.set(e.toolCallId,s instanceof Error?s:new Error(String(s)));else return{block:!0,reason:s instanceof Error?s.message:String(s)}}}));let Ae=n((e,t)=>{let o=t;if(e==="session_shutdown")return u.add(o),()=>{u.delete(o)};let s=I(e,async(r,m)=>{if(C||e==="tool_call"&&typeof r.toolCallId=="string"&&A.has(r.toolCallId))return;let i=r;if(e.startsWith("tool_")){let c=S(r.toolName);if(c)typeof r.parentToolCallId=="string"&&v.add(r.parentToolCallId),i={...r,toolName:c};else if(typeof r.toolCallId=="string"&&v.has(r.toolCallId))i={...r,toolName:r.toolName==="codemode"?"codemode":"__standalone_parent"};else return}if(e==="message_end"){if(!g(r.message)||r.message.role!=="toolResult")return;let c=S(r.message.toolName);if(!c)return;i={...r,message:{...r.message,toolName:c}}}e==="context"&&Array.isArray(r.messages)&&(i={...r,messages:r.messages.map(c=>g(c)&&typeof c.toolName=="string"?{...c,toolName:S(c.toolName)??"__outside_resource_host"}:c)});let l=await o(i,m);if(!g(l))return l;if(e==="message_end"&&g(l.message)&&g(r.message))return{...l,message:{...l.message,toolName:r.message.toolName}};if(e==="context"&&Array.isArray(l.messages)&&Array.isArray(r.messages)){let c=r.messages;if(l.messages.length!==c.length)throw new Error("Resource host context handlers must preserve message positions.");return{...l,messages:l.messages.map((R,N)=>{let x=c[N];return g(R)&&g(x)&&typeof x.toolName=="string"?{...R,toolName:x.toolName}:R})}}return l});return h.push(s),s},"on"),xe={emit(e,t){if(C)throw new Error("Standalone resource host is closed.");if(Ee(e))a.events.emit(e,t);else for(let o of E.get(e)??[])o(t)},on(e,t){if(Ee(e)){let s=a.events.on(e,t);return h.push(s),s}let o=E.get(e);return o||E.set(e,o=new Set),o.add(t),()=>{o.delete(t)}}};function D(e){return Array.isArray(e)?e.map(D):g(e)?Object.fromEntries(Object.entries(e).map(([t,o])=>[t,t==="description"&&typeof o=="string"?$(o):D(o)])):e}n(D,"descriptions");function _e(e){return{...e,tools:e.tools.flatMap(t=>{let o=S(t.name);return o?[{...t,name:o}]:[]}),executeTool(t,o,s){if(!w.has(t))throw new Error("Tool is not owned by this resource host.");return e.executeTool(b(t),o,s)}}}n(_e,"toolContext"),P={...a,events:xe,on:Ae,registerTool:n(e=>{let t=e.name;if(!w.has(t))return;let o=Object.getOwnPropertyDescriptors(e);o.name={value:b(t),enumerable:!0,configurable:!0},o.label={value:b(t),enumerable:!0,configurable:!0},o.namespace={value:y.namespace,enumerable:!0,configurable:!0},o.exposure={value:"deferred",enumerable:!0,configurable:!0},o.description={get:n(()=>`Use ${b(t)} to ${t==="read"?"inspect provider-owned resources and packaged guides":t==="search"?"find objects or text within an explicit provider-owned resource":`${t} provider-owned text resources`}.`,"get"),enumerable:!0,configurable:!0},o.promptSnippet={get:n(()=>$(e.promptSnippet??""),"get"),enumerable:!0,configurable:!0},o.promptGuidelines={get:n(()=>[...(e.promptGuidelines??[]).map($),"Use only this namespace's owned resource URIs and issued results. Local filesystem paths are not supported."],"get"),enumerable:!0,configurable:!0},o.parameters={get:n(()=>{let i=D(e.parameters),l=g(i.properties)?{...i.properties}:{};for(let R of Re[t]??[])g(l[R])&&(l[R]={...l[R],description:"Provider-owned resource URI, unchanged source result, or an issued reference."});if(t!=="write")return Object.assign({},e.parameters,i,{properties:l});delete l.image,l.content=we.String({description:"Complete text/Markdown or JSON payload for the selected provider resource."});let c=Array.isArray(i.required)?i.required:[];return Object.assign({},e.parameters,i,{properties:l,required:[...new Set([...c,"content"])]})},"get"),enumerable:!0,configurable:!0};let s=n(async(i,l,c,R,N)=>{if(C)throw new Error("Standalone resource host is closed.");let x=new AbortController,q=n(()=>{},"finish"),Ce=new Promise(f=>{q=f});T.set(x,Ce);let Oe=[c,N.signal,x.signal].filter(f=>f!==void 0),L=AbortSignal.any(Oe);try{let f=A.get(i);if(A.delete(i),f)throw f;let F={..._e(N),signal:L};return await G(t,l,F),L.throwIfAborted(),await e.execute(i,l,L,R,F)}catch(f){if(!(f instanceof H))throw f;return X({content:[{type:"text",text:`${f.code}: ${f.message} (${f.source})`}],details:{boundary:{code:f.code,source:f.source}}},we.Unknown(),{status:"error",errors:[J(f,f.code,f.source)]})}finally{T.delete(x),q()}},"execute");o.execute={value:s,enumerable:!0,configurable:!0};let r=n((i,l,c)=>!be.has(t)&&e.renderCall?e.renderCall(i,l,c):re(c.lastComponent,{tool:b(t),primary:{text:g(i)?String(i.path??i.query??"owned resource"):"owned resource",truncate:"end"},expanded:c.expanded},l),"renderCall");o.renderCall={value:r,enumerable:!0,configurable:!0};let m=Object.defineProperties({},o);U.set(t,()=>a.registerTool({...m,exposure:"hidden"})),a.registerTool(m)},"registerTool"),getActiveTools:n(()=>a.getActiveTools().flatMap(e=>{let t=S(e);return t?[t]:[]}),"getActiveTools"),getAllTools:n(()=>a.getAllTools().flatMap(e=>{let t=S(e.name);return t?[{...e,name:t}]:[]}),"getAllTools"),setActiveTools(e){let t=a.getActiveTools().filter(o=>!S(o));a.setActiveTools([...t,...e.filter(o=>w.has(o)).map(b)])}},h.push(I("session_start",()=>{v.clear(),A.clear(),!(a.getSettings().defaultTools??[]).includes("-tool_search")&&a.getAllTools().some(e=>e.name==="tool_search"&&e.exposure!=="hidden")&&!a.getActiveTools().includes("tool_search")&&a.setActiveTools([...a.getActiveTools(),"tool_search"])})),h.push(I("agent_end",()=>{v.clear(),A.clear()}));async function V(e,t=!0){if(C)return;C=!0;for(let r of T.keys())r.abort();await Promise.all(T.values());let o=await Promise.allSettled([...u].map(r=>r({type:"session_shutdown"},e)));for(let r of h)r();if(E.clear(),u.clear(),v.clear(),A.clear(),t)for(let r of U.values())r();U.clear();let s=o.find(r=>r.status==="rejected");if(s?.status==="rejected")throw s.reason}return n(V,"dispose"),h.push(I("session_shutdown",(e,t)=>V(t,!1))),{api:P,owns:j,tools:[...w].map(b),dispose:V,setApi(e){P=e},setRead(e){z=e}}}n(Te,"createResourceHostApi");async function ve(a,y){Y(a);let d=Te(a,y),w=se(d.api,{resourceOutput:!0,promptSection:`resource_${y.namespace.name}_results`}),p=w.api;d.setApi(p);try{await ae(p);let _;await Z(p,{protocol:K,apiVersion:Q,id:"standalone-resource-boundary",setup(u){_=u,d.setRead(u),u.addResourceGuard({id:"standalone-resource-boundary",guard:n(h=>d.owns(h.resourceSource,!1)?{kind:"accepted"}:{kind:"rejected",reason:"Resource belongs outside this standalone host."},"guard")}),u.addHandler({stage:"post-read",handler:ne(k(p),u.read,h=>d.owns(h,!0))})}}),await ie(p);let E=await de(p);if(await E.registerPlugin({protocol:ee,apiVersion:te,id:"standalone-resource-boundary",setup(u){u.addMutationGuard({id:"standalone-resource-boundary",guard:n(h=>h.resources.every(T=>d.owns(T.source,!0)&&T.binary===void 0)?{kind:"accepted"}:{kind:"rejected",rejection:{code:"RESOURCE_HOST_BOUNDARY",reason:"Resource belongs outside this standalone host.",message:"Use this host only for its provider-owned text resources.",effect:"not-applied"}},"guard")})}}),await pe(p),await fe(p),await me(p),await le(p),!_)throw new Error("Standalone Read host did not initialize.");return await he(p,{recordType:`agent-documentation-read/${y.namespace.name}`,ownsTool:n(u=>typeof u=="string"&&d.tools.includes(u),"ownsTool")}),await ge(p,{preferences:{},toolName:n(u=>`${y.namespace.name}_${u}`,"toolName")}),ue(p,E),w.finalize(),{api:p,tools:d.tools,dispose:n(u=>d.dispose(u),"dispose")}}catch(_){throw await d.dispose(),_}}n(ve,"createStandaloneResourceHost");export{ve as createStandaloneResourceHost};
|
package/dist/entry-12.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as i,c as j,d as k}from"./chunk-
|
|
1
|
+
import{a as h,b as i,c as j,d as k}from"./chunk-PBMHSK6J.js";import"./chunk-OA26FH5G.js";import"./chunk-BXGMMZT3.js";import{a,b,c,d,e,f,g}from"./chunk-MLFJU2US.js";import"./chunk-2EY3LEZ7.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{c as DOCTOR_API_VERSION,d as DOCTOR_CORE_READY_EVENT,e as DOCTOR_PLUGIN_REGISTER_EVENT,b as DOCTOR_PROTOCOL,a as DOCTOR_TOOL_PATH_KEYS,j as doctorExecutableAvailable,i as doctorProcessAccess,h as doctorRuntimeOptions,f as isDoctorCoreReady,g as isDoctorPluginRegistrationRequest,k as withDoctorProbeCopy};
|
package/dist/entry-15.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-3PMHFEJY.js";import"./chunk-
|
|
1
|
+
import"./chunk-3PMHFEJY.js";import"./chunk-GQXZEOND.js";import"./chunk-NNCZYO4Q.js";import"./chunk-IQD6PON5.js";import"./chunk-SJQGFUXR.js";import"./chunk-IZTOXSTR.js";import"./chunk-QCAGAJHJ.js";import{a as l}from"./chunk-JY63UUC2.js";import{a as p}from"./chunk-I3G6K7QU.js";import{a as u,b as y}from"./chunk-HSAGZWPO.js";import"./chunk-PS2B6THP.js";import{d as a,e as s}from"./chunk-XEPCURYZ.js";import"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import"./chunk-2EY3LEZ7.js";import"./chunk-IRLWXPL4.js";import"./chunk-ZC65Z3CK.js";import{a as d}from"./chunk-EI7MMDWY.js";function x(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/before-delete/${e.id}`,setup(t){t.addDeleteGuard({id:e.id,guard:d(n=>e.run(n),"guard")})}})}d(x,"connectBeforeDeleteHook");function m(o,e){return c(e),p(o,{protocol:u,apiVersion:y,id:`hook/before-read/${e.id}`,setup(t){t.addResourceGuard({id:e.id,async guard(n){let r=await e.run(n);return r.decision==="allow"?{kind:"accepted"}:{kind:"rejected",reason:r.reason}}})}})}d(m,"connectBeforeReadHook");function A(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/before-edit/${e.id}`,setup(t){t.addMutationGuard({id:e.id,async guard(n,r){let f=await e.run({cwd:r.cwd,intent:r.intent??"edit",resources:n.resources.map(i=>({resourceSource:i.source,existed:i.existed,before:i.before,after:i.after,changes:i.changes,...i.binary===void 0?{}:{binary:i.binary}})),...r.signal!==void 0&&{signal:r.signal}});return f.decision==="allow"?{kind:"accepted"}:{kind:"rejected",rejection:{code:"MUTATION_REJECTED",reason:f.reason,message:`Edit blocked by hook ${e.id}: ${f.reason}`,effect:"not-applied"}}}})}})}d(A,"connectBeforeEditHook");function v(o,e){return c(e),l(o,{protocol:a,apiVersion:s,id:`hook/after-edit/${e.id}`,setup(t){t.onDidEdit(async n=>{if(n.postProcessing!=="deferred")try{return await e.run(n)}catch(r){return{feedback:`After-edit hook ${e.id} failed after the edit was saved: ${r instanceof Error?r.message:String(r)}`,tone:"error"}}})}})}d(v,"connectAfterEditHook");function c(o){if(o.id.trim().length===0||typeof o.run!="function")throw new TypeError("A file hook needs a non-empty id and run function")}d(c,"assertHook");export{v as connectAfterEditHook,x as connectBeforeDeleteHook,A as connectBeforeEditHook,m as connectBeforeReadHook};
|
package/dist/entry-17.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-3PMHFEJY.js";import{a as
|
|
1
|
+
import"./chunk-3PMHFEJY.js";import{a as w}from"./chunk-GQXZEOND.js";import"./chunk-NNCZYO4Q.js";import{a as i,i as j,j as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t}from"./chunk-SJQGFUXR.js";import{b as u,d as v}from"./chunk-IZTOXSTR.js";import{a as h}from"./chunk-I3G6K7QU.js";import{a,b,c,d,e,f,g}from"./chunk-HSAGZWPO.js";import"./chunk-PS2B6THP.js";import"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import"./chunk-2EY3LEZ7.js";import"./chunk-IRLWXPL4.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{u as COMPACT_READ_ROWS,b as READ_API_VERSION,c as READ_CORE_READY_EVENT,d as READ_PLUGIN_REGISTER_EVENT,a as READ_PROTOCOL,h as connectReadPlugin,w as createJqReadHandler,v as createReadResultRenderer,i as createReadResultTargetHandler,s as isFragmentResolverRegistration,e as isReadCoreReady,t as isReadFragmentResolution,q as isReadHandlerRegistration,f as isReadPlugin,g as isReadPluginRegistrationRequest,r as isReadViewRegistration,p as isResourceResolverRegistration,o as isTextTargetResolverRegistration,l as readDataSchema,m as readOutputSchema,j as readParameters,k as readRequestOf,n as structuredRead};
|
package/dist/entry-18.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-72X24ARV.js";import{a as e}from"./chunk-UGWRUW77.js";import"./chunk-EI7MMDWY.js";export{r as createImageContentConverter,e as createPdfContentConverter};
|
package/dist/entry-19.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,
|
|
1
|
+
import{$ as oo,A as B,B as C,C as D,D as E,E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,V as W,W as X,X as Y,Y as Z,Z as _,_ as $,a as r,aa as ro,b as e,ba as eo,c as f,ca as fo,d as m,da as mo,e as p,ea as po,f as t,fa as to,g as x,ga as xo,h as a,ha as ao,i as b,ia as bo,j as c,ja as co,k as d,ka as go,l as g,la as ho,m as h,ma as io,n as i,na as jo,o as j,oa as ko,p as k,pa as lo,q as l,qa as no,r as n,ra as qo,s as q,sa as so,t as s,ta as uo,u,ua as vo,v,va as wo,w,x as y,y as z,z as A}from"./chunk-OEEE5BLN.js";import{a as o}from"./chunk-2QCE7GOV.js";import"./chunk-EI7MMDWY.js";export{Z as CONTENT_API_VERSION,$ as CONTENT_CONVERTER_REGISTER_EVENT,_ as CONTENT_HOST_READY_EVENT,Y as CONTENT_PROTOCOL,m as EDIT_EXECUTION_TIMEOUT_MS,f as EDIT_WAIT_TIMEOUT_MS,l as FILE_TEXT_READ_EVENT,n as FILE_TEXT_VISIBLE_EVENT,F as MAX_STRUCTURED_BYTES,p as NAVIGATION_TIMEOUT_MS,C as ResourceError,r as ResourceScheduler,vo as ResultImageStore,ko as ResultTargetStore,t as SEARCH_TIMEOUT_MS,y as TempResourceStore,a as ToolDeadlineError,V as UnsupportedContentError,G as assertJsonData,q as attachFileTextWindows,g as configureSearchDeadline,fo as connectContentConverter,wo as connectResultImages,uo as connectResultTargets,eo as createContentHost,W as createContentRunner,mo as createLineMap,to as createRangeTracker,no as currentResultTargets,so as describeAdjustedRanges,ao as describeLostRange,v as fileTextDigest,w as fileTextKeys,x as ideToolTimeoutMs,L as isAgentContent,T as isContentConversionAttempt,R as isContentConversionContext,S as isContentConverter,U as isContentConverterRegistration,ro as isContentConverterRegistrationRequest,oo as isContentHostReady,Q as isContentInput,P as isContentTarget,M as isResource,O as isResourceResolutionAttempt,N as isResourceResolver,o as normalizeStructuredArguments,xo as rangesInText,bo as readUnchanged,po as rebaseOrRelocateRange,K as renderContentDescription,d as reportToolEffect,k as resourceAccesses,A as resourceErrorMetadata,B as resourceErrorMetadataOf,z as resourceErrorMetadataSchema,e as resourceScheduler,H as resultError,D as resultErrorSchema,ho as resultInputSchema,go as resultSourceSchema,qo as resultTargetsInText,io as resultValueId,jo as resultValueReference,co as resultValueSchema,u as retainFileTextWindows,h as runWithToolDeadline,i as runWithinToolDeadline,b as snapshotOnToolDeadline,E as structuredResultSchema,s as takeFileTextWindows,X as targetsEqual,j as toolDeadlineFailure,J as trackScriptCalls,c as trackToolCleanup,lo as verifyResultTargets,I as withStructuredResult};
|
package/dist/entry-20.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as F,B as G,a as x,b as a,c as b,e as c,f as d,g,h,i,j,k,l,m as n,o as q,p as s,q as u,r as v,s as w,t as y,u as z,v as A,w as B,x as C,y as D,z as E}from"./chunk-3JBQYLJ4.js";import{a as H}from"./chunk-47SPPIXK.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t}from"./chunk-VAXLSPPU.js";import"./chunk-PS2B6THP.js";import"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import"./chunk-EI7MMDWY.js";export{D as FuzzyVocabulary,r as SEARCH_API_VERSION,e as SEARCH_CORE_READY_EVENT,f as SEARCH_PLUGIN_REGISTER_EVENT,o as SEARCH_PROTOCOL,z as SearchCaptureGuard,y as SearchCaptureLimitError,s as SearchScopeChangedError,H as connectSearchPlugin,v as containsSearchMatch,u as currentScope,k as describePathArgument,G as formatFuzzyCandidate,F as fuzzyCandidateData,A as fuzzyLimits,C as isFuzzyQuery,B as isFuzzyResultData,g as isResultReference,m as isSearchCoreReady,p as isSearchPlugin,t as isSearchPluginRegistrationRequest,c as markNullFields,d as nullFieldsMessage,j as pathMachine,h as plainPathList,E as rankFuzzyIdentifiers,q as renderSearchMatches,l as searchCallPolicy,x as searchDataSchema,a as searchOutputSchema,n as searchSchema,b as selectionData,w as splitGlobList,i as uniquePaths};
|
package/dist/entry-21.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s}from"./chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunk-IRLWXPL4.js";import"./chunk-EI7MMDWY.js";export{j as LINE_ANCHOR_PATTERN,C as NO_FINAL_LINE_BREAK,k as PRESENTED_LINE_ANCHOR_PATTERN,F as SEARCH_HIGHLIGHT_CLOSE,E as SEARCH_HIGHLIGHT_OPEN,o as TextAnchor,r as attachTextAnchorRenderer,v as createTextContentConverter,g as createTextDocument,q as documentLineAnchors,D as endsWithNoFinalLineBreakMarker,e as getTextAnchorRenderer,a as getTextSourceLine,l as isLineAnchor,t as isTextAnchorRecoveryOutcome,p as isTextAnchorResolutionAttempt,m as isTextAnchorResolver,c as isTextLinePresenter,d as isTextPresenterRegistration,z as isTextTargetResolutionAttempt,w as isTextualMediaType,n as lineAnchors,u as linesWithAnchor,i as renderPresentedTextDocument,x as renderPresentedTextRows,f as renderTextAnchor,h as renderTextDocument,B as restoreText,A as storeText,G as stripSearchHighlights,y as textFromAgentContent,s as textLineAnchors,b as withTextSourceLine};
|
package/dist/entry-22.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-IQD6PON5.js";import{m as
|
|
1
|
+
import"./chunk-IQD6PON5.js";import{m as r}from"./chunk-QCAGAJHJ.js";import{a as q}from"./chunk-JY63UUC2.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-XEPCURYZ.js";import"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import"./chunk-IRLWXPL4.js";import"./chunk-ZC65Z3CK.js";import"./chunk-EI7MMDWY.js";export{e as TEXT_EDITOR_API_VERSION,h as TEXT_EDITOR_CORE_READY_EVENT,i as TEXT_EDITOR_PLUGIN_REGISTER_EVENT,d as TEXT_EDITOR_PROTOCOL,f as TEXT_POSITION_ANCHOR_KIND,g as TEXT_SEARCH_ANCHOR_KIND,q as connectTextEditorPlugin,r as connectTextEditorPostEditHandler,k as isResourceResolverRegistration,l as isTextAnchorResolverRegistration,m as isTextAnchorResourceResolutionAttempt,n as isTextEditorCoreReady,o as isTextEditorPlugin,p as isTextEditorPluginRegistrationRequest,j as isTextEditorToolId,c as localFileTransferAccess,a as localObjectMode,b as snapshotLocalObjects};
|
package/dist/entry-27.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-2EY3LEZ7.js";import"./chunk-EI7MMDWY.js";export{d as isExecutableAvailable,b as normalizeProcessEnvironment,e as probeExecutable,a as projectExecutableDirectories,c as projectProcessEnvironment};
|
package/dist/entry-28.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c}from"./chunk-D23NS4VV.js";import"./chunk-2EY3LEZ7.js";import"./chunk-EI7MMDWY.js";export{b as probeProjectExecutable,c as projectExecutableAvailable,a as projectFileExists};
|
package/dist/entry-31.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-NNCZYO4Q.js";import{d as
|
|
2
|
-
`)}]}s(
|
|
1
|
+
import"./chunk-NNCZYO4Q.js";import{d as L}from"./chunk-IZTOXSTR.js";import{a as H}from"./chunk-JY63UUC2.js";import{a as I}from"./chunk-I3G6K7QU.js";import{a as x,b as k}from"./chunk-HSAGZWPO.js";import"./chunk-PS2B6THP.js";import{d as _,e as N}from"./chunk-XEPCURYZ.js";import{B as S,J as D,ba as b,c as P}from"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import{y as O}from"./chunk-IRLWXPL4.js";import{a as g}from"./chunk-ZC65Z3CK.js";import{a as s}from"./chunk-EI7MMDWY.js";import{readdirSync as ce,realpathSync as de,statSync as ue}from"node:fs";import{mkdir as le,readFile as j}from"node:fs/promises";import W from"node:path";import{fileURLToPath as me,pathToFileURL as fe}from"node:url";import{createHash as Z}from"node:crypto";import{mkdir as M,rm as U,stat as K}from"node:fs/promises";import Y from"node:os";import T from"node:path";var Q=1e4;async function F(e,t,n){let i=T.join(Y.tmpdir(),`pi-agent-ide-write-locks${process.getuid?`-${String(process.getuid())}`:""}`),r=T.join(i,Z("sha256").update(T.resolve(e)).digest("hex").slice(0,32));if(!await ee(i,r,e,t))return n();try{return await n()}finally{await U(r,{recursive:!0,force:!0})}}s(F,"withFileWriteLock");async function ee(e,t,n,i){try{await M(e,{recursive:!0})}catch{return!1}let r=performance.now()+P;for(;;){if(i?.throwIfAborted(),performance.now()>=r)throw Object.assign(new Error(`Timed out waiting for the write lock on ${n}`),{code:"LOCK_TIMEOUT"});try{return await M(t),!0}catch(a){if(a.code!=="EEXIST")return!1}let o=await K(t).then(a=>a.mtimeMs,()=>{});if(o!==void 0&&Date.now()-o>Q){await U(t,{recursive:!0,force:!0});continue}await new Promise(a=>setTimeout(a,5+Math.random()*20))}}s(ee,"acquire");import{randomBytes as te}from"node:crypto";import{chmod as re,realpath as ne,rename as oe,rm as ie,stat as se,writeFile as $}from"node:fs/promises";import C from"node:path";async function B(e,t,n){let i=s(()=>$(e,t,n===void 0?{}:{signal:n}),"writeInPlace"),r=await ne(e).catch(()=>{}),o=r===void 0?void 0:await se(r).catch(()=>{});if(r===void 0||o===void 0)return i();let a=process.getuid!==void 0&&o.uid!==process.getuid();if(!o.isFile()||o.nlink>1||a)return i();let c=C.join(C.dirname(r),`.${C.basename(r)}.${te(6).toString("hex")}.pi-tmp`);try{let m=o.mode&4095;await $(c,t,{mode:m,flag:"wx",...n!==void 0&&{signal:n}}),await re(c,m),await oe(c,r)}catch(m){if(await ie(c,{force:!0}),n?.throwIfAborted(),ae(m))return i();throw m}}s(B,"replaceFileContent");function ae(e){let t=e?.code;return t==="EPERM"||t==="EACCES"||t==="EBUSY"||t==="EXDEV"}s(ae,"isRenameRefusal");function V(e){return X("read",e)}s(V,"createFilesystemReadResolver");function J(e){return X("write",e)}s(J,"createFilesystemWriteResolver");function X(e,t){return{id:"filesystem",tryResolve(n,i){return Promise.resolve(pe(n,i,e,t))}}}s(X,"createFilesystemResolver");function pe(e,t,n,i){if(e.length===0)return{kind:"failed",error:new TypeError("Filesystem source must not be empty")};if(!we(e))return{kind:"not-handled"};if(t.signal?.aborted===!0)return{kind:"failed",error:q()};let r=e.startsWith("file://")?de(me(new URL(e))):W.resolve(t.cwd,e),o=fe(r).href,a=(()=>{try{return ue(r).isDirectory()}catch{return!1}})(),c,m,h={source:r,link:o,read:s(async({signal:p})=>(c=void 0,m=void 0,a?ye(r,p,l=>{m=l}):ge(r,i,p,l=>{c=l}).catch(l=>{throw l.code==="ENOENT"&&(c=null),l})),"read"),get sourceBytes(){return c??void 0},get entries(){return m}};return n==="read"||a?{kind:"resolved",resource:h}:{kind:"resolved",resource:{...h,get sourceBytes(){return c??void 0},async write(p,l){w(l.signal);let d=O(p);await le(W.dirname(r),{recursive:!0}),w(l.signal),await F(r,l.signal,async()=>{let u=c;if(u!==void 0){let R=await j(r).catch(E=>{if(E.code!=="ENOENT")throw E});if(u===null?R!==void 0:!R?.equals(u))throw new S("RESOURCE_CHANGED",r,"not-applied")}let y=Buffer.from(d,"utf8");await B(r,y,l.signal),c=y})}}}}s(pe,"resolveFilesystemSource");function ye(e,t,n){w(t);let i=ce(e,{withFileTypes:!0}),r=[`\u{1F4C1} ${e}/`];i.length>0&&r.push("");for(let o of i){let a=o.isDirectory()?"\u{1F4C1}":o.isFile()?"\u{1F4C4}":"\u{1F517}";r.push(` ${a} ${o.name}`)}return n(i.map(o=>o.isDirectory()?`${o.name}/`:o.name)),[{type:"text",text:r.join(`
|
|
2
|
+
`)}]}s(ye,"readDirectoryContent");async function ge(e,t,n,i){w(n);let r=await F(e,n,()=>j(e,{encoding:null,...n!==void 0&&{signal:n}}));return w(n),i(r),t.convert({source:e,bytes:r},n===void 0?{}:{signal:n})}s(ge,"readFilesystemContent");function we(e){return/^[A-Za-z]:[\\/]/u.test(e)||e.startsWith("file://")?!0:!/^[A-Za-z][A-Za-z\d+.-]*:/u.test(e)}s(we,"isFilesystemSource");function w(e){if(e?.aborted===!0)throw q()}s(w,"throwIfAborted");function q(){let e=new Error("The operation was aborted");return e.name="AbortError",e}s(q,"abortError");import{execFile as he}from"node:child_process";import{existsSync as Re}from"node:fs";import{realpath as z}from"node:fs/promises";import Ee from"node:os";import f from"node:path";import{fileURLToPath as ve}from"node:url";async function G(e,t){let n=e.cause,i=Date.now()+500;if(t.signal?.aborted||e.source===void 0||typeof n!="object"||n===null||!("code"in n)||n.code!=="ENOENT")return;let r=e.source.startsWith("file://")?ve(e.source):e.source,o=f.relative(t.cwd,f.resolve(t.cwd,r));if(!A(o)||o.includes("#"))return;let a=f.basename(o).toLowerCase();if(a.length<3||a.length>160)return;let c=f.join(process.env.PI_CODING_AGENT_DIR??f.join(Ee.homedir(),".pi","agent"),"bin",process.platform==="win32"?"rg.exe":"rg"),m=await new Promise(d=>{he(Re(c)?c:"rg",["--files","--hidden","--no-config","--no-ignore-parent","--null","--glob","!.git/**"],{cwd:t.cwd,timeout:250,maxBuffer:2*1024*1024,...t.signal===void 0?{}:{signal:t.signal}},(u,y)=>d(u?[]:y.split("\0").filter(Boolean).slice(0,2e4)))}),v=Math.min(3,Math.max(1,Math.floor(a.length*.2))),h=m.flatMap(d=>{if(t.signal?.aborted||Date.now()>i||!A(d))return[];let u=f.basename(d).toLowerCase();if(u.length>160||Math.abs(u.length-a.length)>v)return[];let y=be(a,u);if(y>v)return[];let R=f.dirname(o).toLowerCase(),E=f.dirname(d).toLowerCase();return[{path:d,distance:y,directoryDistance:R===E?0:1}]}).sort((d,u)=>d.distance-u.distance||d.directoryDistance-u.directoryDistance||d.path.localeCompare(u.path)),p=[],l=await z(t.cwd);for(let d of h.slice(0,20)){if(t.signal?.aborted||Date.now()>i)return;try{let u=await z(f.resolve(t.cwd,d.path));A(f.relative(l,u))&&p.push({path:d.path})}catch{}if(p.length===3)break}return p.length?p:void 0}s(G,"recoverFilesystemPath");function A(e){return e!==""&&!/^\.\.(?:[\\/]|$)/u.test(e)&&!f.isAbsolute(e)}s(A,"insideWorkspace");function be(e,t){let n=Array.from({length:t.length+1},(i,r)=>r);for(let i=1;i<=e.length;i++){let r=[i];for(let o=1;o<=t.length;o++)r[o]=Math.min(g(r[o-1])+1,g(n[o])+1,g(n[o-1])+(e[i-1]===t[o-1]?0:1));n=r}return g(n[t.length])}s(be,"editDistance");var Te={provider:"filesystem",capability:"read"},Fe={provider:"filesystem",capability:"write"},Ce=L({kind:"source",nativeResources:!0});async function Ae(e){let t=b(e,Te),n=b(e,Fe),i=V(t),r=J(n),o={protocol:x,apiVersion:k,id:"filesystem",setup(c){c.addResolver({resolver:i,renderResult:Ce,recoverFailure:G}),c.describe({path:s(()=>D("File \u2014 content; directory \u2014 listing.",t.listDescriptions()),"path")})}},a={protocol:_,apiVersion:N,id:"filesystem",setup(c){c.addResolver({resolver:r})}};await Promise.all([I(e,o),H(e,a)])}s(Ae,"registerFilesystemPlugin");export{Ae as default};
|
package/dist/entry-32.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-72X24ARV.js";import{ca as e}from"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"filesystem",capability:"read"},converter:r(),priority:100};async function i(o){await e(o,n)}t(i,"registerFilesystemImage");export{i as default};
|
package/dist/entry-33.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-GQXZEOND.js";import"./chunk-2EY3LEZ7.js";import"./chunk-IRLWXPL4.js";import"./chunk-EI7MMDWY.js";export{a as createJqReadHandler};
|
package/dist/entry-34.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-GQXZEOND.js";import{a as p}from"./chunk-2YO6RVX4.js";import{b as l,c as d}from"./chunk-MLFJU2US.js";import{a as n}from"./chunk-I3G6K7QU.js";import{a as r,b as o}from"./chunk-HSAGZWPO.js";import{d as c,e as u}from"./chunk-2EY3LEZ7.js";import"./chunk-IRLWXPL4.js";import{a as t}from"./chunk-EI7MMDWY.js";async function m(i){await Promise.all([n(i,w),p(i,g)])}t(m,"registerFilesystemJq");var w={protocol:r,apiVersion:o,id:"filesystem-jq",setup(i){i.addView({view:"jq",presenter:{id:"filesystem-jq",present:t(s=>s,"present")}});let e=f({pluginId:"filesystem-jq",input:t(s=>s.state?.contentKind==="text"?s.state.content[0].text:void 0,"input")});i.addHandler({stage:"read",when:{resolvedBy:"any",contentKind:"text"},handler(s){let a=s.state;return a?.contentKind!=="text"||a.resolvedBy!=="filesystem"&&a.resolvedBy!=="ssh"?{kind:"continue",context:s}:e(s)}}),i.describe({views:"jq:<filter> \u2014 run jq on a JSON file or a resource whose provider supplies JSON (JSONL record by record); use alone; offset and limit apply to its output."})}},g={protocol:l,apiVersion:d,id:"filesystem-jq",setup(i){i.addSetupCheck({id:"jq",async inspect(e){return await c("jq",e.workspace?process.cwd():e.cwd,e.workspace?process.env:e.env,e.signal)?{}:{actions:[{id:"jq-unavailable",message:"JSON jq views are unavailable because jq was not found"}]}}}),i.addCheck({id:"jq",title:"JSON jq views",async run(e){e.signal?.throwIfAborted();let s=await u("jq",["--version"],e.workspace?process.cwd():e.cwd,e.workspace?process.env:e.env,e.signal);return e.signal?.throwIfAborted(),[s.ok?{status:"pass",message:"jq is available",detail:e.workspace?`Controller content adapter: ${s.detail}`:s.detail}:{status:"fail",message:"jq is not available",detail:s.detail}]}})}};export{m as default};
|
package/dist/entry-35.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-UGWRUW77.js";import{
|
|
1
|
+
import{a as r}from"./chunk-UGWRUW77.js";import{ca as e}from"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import{a as t}from"./chunk-EI7MMDWY.js";var n={target:{provider:"filesystem",capability:"read"},converter:r(),priority:200};async function i(o){await e(o,n)}t(i,"registerFilesystemPdf");export{i as default};
|
package/dist/entry-36.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ca as t}from"./chunk-OEEE5BLN.js";import"./chunk-2QCE7GOV.js";import{w as i}from"./chunk-IRLWXPL4.js";import{a as r}from"./chunk-EI7MMDWY.js";var o=i(),n={target:{provider:"filesystem",capability:"read"},converter:o,priority:300},s={target:{provider:"filesystem",capability:"write"},converter:o,priority:300};async function a(e){await Promise.all([t(e,n),t(e,s)])}r(a,"registerFilesystemText");export{a as default};
|
package/dist/entry-37.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as t}from"./chunk-
|
|
1
|
+
import{b as e,c as t}from"./chunk-GNYFA6FS.js";import"./chunk-IRLWXPL4.js";import"./chunk-EI7MMDWY.js";export{t as AstScopeManager,e as withParsedDocument};
|