@mrclrchtr/supi-code-intelligence 11.4.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +17 -9
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +21 -16
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +3 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +71 -13
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +28 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-edit-capture.ts +258 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +75 -14
- package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +48 -79
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +43 -21
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +21 -35
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-command-capture.ts +139 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +202 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/route-boundary.ts +26 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +74 -14
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +24 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/coordinates.ts +16 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +4 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-range.ts +94 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +26 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +6 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +13 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +1 -9
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/health/server-status.ts +41 -12
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored-structural.ts +4 -1
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/symbol.ts +42 -48
- package/src/analysis/target/types.ts +4 -9
- package/src/analysis/workspace/cmake-parser.ts +207 -0
- package/src/analysis/workspace/cmake.ts +141 -0
- package/src/analysis/workspace/maven.ts +310 -0
- package/src/analysis/workspace/membership.ts +100 -26
- package/src/analysis/workspace/metadata.ts +6 -1
- package/src/analysis/workspace/observe.ts +6 -0
- package/src/analysis/workspace/types.ts +11 -3
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/session/find-types.ts +8 -4
- package/src/session/find-workflow.ts +11 -16
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/input/health-refactor.ts +48 -34
- package/src/session/input/workflows.ts +45 -46
- package/src/session/inspect/file-point.ts +2 -2
- package/src/session/inspect-types.ts +1 -1
- package/src/session/inspect-workflow.ts +3 -3
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-workflow.ts +4 -19
- package/src/session/refactor-file-actions.ts +122 -0
- package/src/session/refactor-plan-pipeline.ts +152 -0
- package/src/session/refactor-plans.ts +18 -15
- package/src/session/refactor-types.ts +24 -12
- package/src/session/refactor-workflow.ts +68 -243
- package/src/session/target-workflow.ts +25 -18
- package/src/tool/code_find/execute.ts +6 -7
- package/src/tool/code_find/result.ts +5 -7
- package/src/tool/code_find/spec.ts +9 -16
- package/src/tool/code_find/tui.ts +12 -6
- package/src/tool/code_graph/display.ts +5 -6
- package/src/tool/code_graph/format.ts +8 -24
- package/src/tool/code_graph/result.ts +16 -75
- package/src/tool/code_graph/section.ts +21 -33
- package/src/tool/code_graph/spec.ts +6 -0
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +60 -8
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/spec.ts +6 -0
- package/src/tool/code_health/structured-schema.ts +18 -4
- package/src/tool/code_health/structured.ts +22 -18
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/execute.ts +1 -1
- package/src/tool/code_inspect/markdown.ts +33 -6
- package/src/tool/code_inspect/result.ts +24 -19
- package/src/tool/code_inspect/spec.ts +14 -6
- package/src/tool/code_inspect/structured.ts +4 -21
- package/src/tool/code_inspect/tui.ts +2 -2
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/spec.ts +8 -0
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_refactor_apply/result.ts +2 -1
- package/src/tool/code_refactor_apply/spec.ts +7 -0
- package/src/tool/code_refactor_plan/execute.ts +0 -2
- package/src/tool/code_refactor_plan/result.ts +23 -13
- package/src/tool/code_refactor_plan/spec.ts +8 -2
- package/src/tool/code_refactor_plan/structured.ts +59 -12
- package/src/tool/code_refactor_plan/tui.ts +14 -17
- package/src/tool/code_resolve/markdown.ts +5 -47
- package/src/tool/code_resolve/result.ts +43 -72
- package/src/tool/code_resolve/spec.ts +6 -0
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/namespace.ts +14 -0
- package/src/tool/refactor-markdown.ts +55 -15
- package/src/tool/register.ts +3 -0
- package/src/tool/result/candidate-selection.ts +141 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor-preview.ts +118 -0
- package/src/tool/result/refactor-unavailable.ts +16 -0
- package/src/tool/result/refactor.ts +19 -10
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +76 -38
- package/src/tool/specs.ts +3 -0
- package/src/ui/footer.ts +2 -4
- package/src/ui/status-overlay.ts +1 -1
- package/src/ui/status-presentation.ts +4 -7
- package/src/ui/tui/candidate-selection.ts +40 -95
- package/src/ui/tui/common.ts +16 -70
- package/src/ui/tui/display.ts +6 -24
- package/src/tool/result/candidate-row.ts +0 -49
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Shell hints — explain BSD sed script errors once per session.
|
|
2
|
+
//
|
|
3
|
+
// On macOS, `sed` is BSD sed: `-i` requires a backup-suffix argument and script errors read
|
|
4
|
+
// `sed: 1: "...": ...`. Agents trained on GNU sed retry the same shape repeatedly. This hook adds
|
|
5
|
+
// one hint to the first matching bash result in a session. It costs no context until it fires.
|
|
6
|
+
|
|
7
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
/** Marker that identifies the hint in tool results and on the session branch. */
|
|
10
|
+
export const BSD_SED_HINT_MARKER = "[supi shell hint]";
|
|
11
|
+
|
|
12
|
+
/** Text appended to the first BSD sed script error in a session. */
|
|
13
|
+
export const BSD_SED_HINT = `${BSD_SED_HINT_MARKER} This is BSD sed (macOS): \`sed -i\` needs a suffix argument (\`sed -i '' ...\`), and the substitute delimiter must not occur in the pattern. Prefer the edit tool for file changes when it is available, or \`gsed\` if installed.`;
|
|
14
|
+
|
|
15
|
+
const BSD_SED_ERROR = /^sed: (?:\d+: |-i may not be used|-I or -i may not be used)/m;
|
|
16
|
+
|
|
17
|
+
function resultText(content: readonly { type: string; text?: string }[]): string {
|
|
18
|
+
return content.map((part) => (part.type === "text" ? (part.text ?? "") : "")).join("\n");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function hintAlreadyShown(ctx: ExtensionContext): boolean {
|
|
22
|
+
return ctx.sessionManager
|
|
23
|
+
.getBranch()
|
|
24
|
+
.some(
|
|
25
|
+
(entry) =>
|
|
26
|
+
entry.type === "message" &&
|
|
27
|
+
entry.message.role === "toolResult" &&
|
|
28
|
+
JSON.stringify(entry.message.content).includes(BSD_SED_HINT_MARKER),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Register a `tool_result` hook that appends {@link BSD_SED_HINT} to the first bash result in a
|
|
34
|
+
* session that contains a BSD sed script error. Safe to register from several extensions: the hook
|
|
35
|
+
* skips results that already carry the hint and sessions whose branch already shows it.
|
|
36
|
+
* Usable directly as a child-session extension factory.
|
|
37
|
+
*/
|
|
38
|
+
export function registerShellHints(pi: ExtensionAPI): void {
|
|
39
|
+
pi.on("tool_result", (event, ctx) => {
|
|
40
|
+
if (event.toolName !== "bash") return;
|
|
41
|
+
const text = resultText(event.content);
|
|
42
|
+
if (!BSD_SED_ERROR.test(text) || text.includes(BSD_SED_HINT_MARKER)) return;
|
|
43
|
+
if (hintAlreadyShown(ctx)) return;
|
|
44
|
+
return { content: [...event.content, { type: "text", text: BSD_SED_HINT }] };
|
|
45
|
+
});
|
|
46
|
+
}
|
package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// supi-core spill domain — create-only temp files for full tool output (#597).
|
|
2
|
+
//
|
|
3
|
+
// SuPi never deletes spill files. Instead, it writes few of them: one private base directory per
|
|
4
|
+
// user, content-addressed names, and reuse for identical content. The OS temp purge owns their
|
|
5
|
+
// lifetime, so paths returned to the model stay readable for the session.
|
|
6
|
+
|
|
7
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
8
|
+
import { lstatSync, mkdirSync, mkdtempSync, renameSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { tmpdir } from "node:os";
|
|
10
|
+
import { extname, join } from "node:path";
|
|
11
|
+
|
|
12
|
+
/** Input for {@link writeSpillFile}. */
|
|
13
|
+
export interface SpillFileOptions {
|
|
14
|
+
/** Producer id used as sub-directory, e.g. `"agent"`. Lowercase letters, digits, and dashes. */
|
|
15
|
+
owner: string;
|
|
16
|
+
/** Descriptive file name, e.g. `"snapshot.md"`. The content hash is inserted before the extension. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Full content to persist. */
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SEGMENT = /^[a-z0-9][a-z0-9-]*$/;
|
|
23
|
+
const FILE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Persist full output that did not fit inline and return its absolute path.
|
|
27
|
+
*
|
|
28
|
+
* Layout: `$TMPDIR/supi-<uid>/<owner>/<stem>-<sha256 prefix><ext>`. Identical content maps to the
|
|
29
|
+
* same file, which is reused. Both directories must be real directories owned by the current
|
|
30
|
+
* user without group/other access; otherwise the file falls back to a fresh `mkdtemp`
|
|
31
|
+
* directory, as before. Files are created with mode `0600` and published atomically by rename.
|
|
32
|
+
*/
|
|
33
|
+
export function writeSpillFile({ owner, name, content }: SpillFileOptions): string {
|
|
34
|
+
if (!SEGMENT.test(owner)) throw new Error(`Invalid spill owner: ${owner}`);
|
|
35
|
+
if (!FILE_NAME.test(name)) throw new Error(`Invalid spill file name: ${name}`);
|
|
36
|
+
const extension = extname(name);
|
|
37
|
+
const stem = name.slice(0, name.length - extension.length);
|
|
38
|
+
const hash = createHash("sha256").update(content).digest("hex").slice(0, 32);
|
|
39
|
+
const fileName = `${stem}-${hash}${extension}`;
|
|
40
|
+
|
|
41
|
+
const directory = privateSpillDirectory(owner);
|
|
42
|
+
if (!directory) {
|
|
43
|
+
const fallback = join(mkdtempSync(join(tmpdir(), `supi-${owner}-`)), fileName);
|
|
44
|
+
writeFileSync(fallback, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
45
|
+
return fallback;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const target = join(directory, fileName);
|
|
49
|
+
if (isRegularFile(target)) return target;
|
|
50
|
+
const staging = join(directory, `.${fileName}.${process.pid}.${randomBytes(4).toString("hex")}`);
|
|
51
|
+
writeFileSync(staging, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
52
|
+
// Atomic publish; a concurrent writer of the same hash replaces it with identical bytes.
|
|
53
|
+
renameSync(staging, target);
|
|
54
|
+
return target;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Return the validated private spill directory for `owner`, or undefined when it is unsafe. */
|
|
58
|
+
function privateSpillDirectory(owner: string): string | undefined {
|
|
59
|
+
const uid = process.getuid?.();
|
|
60
|
+
const base = join(tmpdir(), uid === undefined ? "supi" : `supi-${uid}`);
|
|
61
|
+
if (!ensurePrivateDirectory(base, uid)) return undefined;
|
|
62
|
+
const directory = join(base, owner);
|
|
63
|
+
return ensurePrivateDirectory(directory, uid) ? directory : undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Create `path` with mode `0700` if missing, then accept it only when it is a real directory
|
|
68
|
+
* (not a symlink) owned by `uid` with no group/other permissions. Never modifies or removes an
|
|
69
|
+
* existing entry. Ownership and mode checks are skipped where POSIX ids are unavailable.
|
|
70
|
+
*/
|
|
71
|
+
function ensurePrivateDirectory(path: string, uid: number | undefined): boolean {
|
|
72
|
+
try {
|
|
73
|
+
mkdirSync(path, { mode: 0o700 });
|
|
74
|
+
} catch (error) {
|
|
75
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") return false;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const stats = lstatSync(path);
|
|
79
|
+
if (!stats.isDirectory() || stats.isSymbolicLink()) return false;
|
|
80
|
+
if (uid === undefined) return true;
|
|
81
|
+
return stats.uid === uid && (stats.mode & 0o077) === 0;
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isRegularFile(path: string): boolean {
|
|
88
|
+
try {
|
|
89
|
+
return lstatSync(path).isFile();
|
|
90
|
+
} catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -1790,6 +1790,7 @@ var require_web_tree_sitter = __commonJS({
|
|
|
1790
1790
|
var _ts_language_symbol_name = Module["_ts_language_symbol_name"] = makeInvalidEarlyAccess("_ts_language_symbol_name");
|
|
1791
1791
|
var _ts_language_symbol_for_name = Module["_ts_language_symbol_for_name"] = makeInvalidEarlyAccess("_ts_language_symbol_for_name");
|
|
1792
1792
|
var _strncmp = Module["_strncmp"] = makeInvalidEarlyAccess("_strncmp");
|
|
1793
|
+
var _strlen = Module["_strlen"] = makeInvalidEarlyAccess("_strlen");
|
|
1793
1794
|
var _ts_language_symbol_type = Module["_ts_language_symbol_type"] = makeInvalidEarlyAccess("_ts_language_symbol_type");
|
|
1794
1795
|
var _ts_language_field_name_for_id = Module["_ts_language_field_name_for_id"] = makeInvalidEarlyAccess("_ts_language_field_name_for_id");
|
|
1795
1796
|
var _ts_lookahead_iterator_new = Module["_ts_lookahead_iterator_new"] = makeInvalidEarlyAccess("_ts_lookahead_iterator_new");
|
|
@@ -1911,7 +1912,6 @@ var require_web_tree_sitter = __commonJS({
|
|
|
1911
1912
|
var _memcpy = Module["_memcpy"] = makeInvalidEarlyAccess("_memcpy");
|
|
1912
1913
|
var _memmove = Module["_memmove"] = makeInvalidEarlyAccess("_memmove");
|
|
1913
1914
|
var _fflush = makeInvalidEarlyAccess("_fflush");
|
|
1914
|
-
var _strlen = Module["_strlen"] = makeInvalidEarlyAccess("_strlen");
|
|
1915
1915
|
var _iswalpha = Module["_iswalpha"] = makeInvalidEarlyAccess("_iswalpha");
|
|
1916
1916
|
var _iswblank = Module["_iswblank"] = makeInvalidEarlyAccess("_iswblank");
|
|
1917
1917
|
var _iswdigit = Module["_iswdigit"] = makeInvalidEarlyAccess("_iswdigit");
|
|
@@ -1951,6 +1951,7 @@ var require_web_tree_sitter = __commonJS({
|
|
|
1951
1951
|
Module["_ts_language_symbol_name"] = _ts_language_symbol_name = createExportWrapper("ts_language_symbol_name", 2);
|
|
1952
1952
|
Module["_ts_language_symbol_for_name"] = _ts_language_symbol_for_name = createExportWrapper("ts_language_symbol_for_name", 4);
|
|
1953
1953
|
Module["_strncmp"] = _strncmp = createExportWrapper("strncmp", 3);
|
|
1954
|
+
Module["_strlen"] = _strlen = createExportWrapper("strlen", 1);
|
|
1954
1955
|
Module["_ts_language_symbol_type"] = _ts_language_symbol_type = createExportWrapper("ts_language_symbol_type", 2);
|
|
1955
1956
|
Module["_ts_language_field_name_for_id"] = _ts_language_field_name_for_id = createExportWrapper("ts_language_field_name_for_id", 2);
|
|
1956
1957
|
Module["_ts_lookahead_iterator_new"] = _ts_lookahead_iterator_new = createExportWrapper("ts_lookahead_iterator_new", 2);
|
|
@@ -2072,7 +2073,6 @@ var require_web_tree_sitter = __commonJS({
|
|
|
2072
2073
|
Module["_memcpy"] = _memcpy = createExportWrapper("memcpy", 3);
|
|
2073
2074
|
Module["_memmove"] = _memmove = createExportWrapper("memmove", 3);
|
|
2074
2075
|
_fflush = createExportWrapper("fflush", 1);
|
|
2075
|
-
Module["_strlen"] = _strlen = createExportWrapper("strlen", 1);
|
|
2076
2076
|
Module["_iswalpha"] = _iswalpha = createExportWrapper("iswalpha", 1);
|
|
2077
2077
|
Module["_iswblank"] = _iswblank = createExportWrapper("iswblank", 1);
|
|
2078
2078
|
Module["_iswdigit"] = _iswdigit = createExportWrapper("iswdigit", 1);
|
|
@@ -2640,29 +2640,17 @@ var Tree = class _Tree {
|
|
|
2640
2640
|
};
|
|
2641
2641
|
|
|
2642
2642
|
// src/tree_cursor.ts
|
|
2643
|
-
var finalizer3 = newFinalizer((
|
|
2644
|
-
|
|
2643
|
+
var finalizer3 = newFinalizer((handles) => {
|
|
2644
|
+
marshalTreeCursor({ handles });
|
|
2645
|
+
C._ts_tree_cursor_delete_wasm(0);
|
|
2645
2646
|
});
|
|
2646
2647
|
var TreeCursor = class _TreeCursor {
|
|
2647
2648
|
static {
|
|
2648
2649
|
__name(this, "TreeCursor");
|
|
2649
2650
|
}
|
|
2650
2651
|
/** @internal */
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
// Internal handle for Wasm
|
|
2654
|
-
/** @internal */
|
|
2655
|
-
// @ts-expect-error: never read
|
|
2656
|
-
[1] = 0;
|
|
2657
|
-
// Internal handle for Wasm
|
|
2658
|
-
/** @internal */
|
|
2659
|
-
// @ts-expect-error: never read
|
|
2660
|
-
[2] = 0;
|
|
2661
|
-
// Internal handle for Wasm
|
|
2662
|
-
/** @internal */
|
|
2663
|
-
// @ts-expect-error: never read
|
|
2664
|
-
[3] = 0;
|
|
2665
|
-
// Internal handle for Wasm
|
|
2652
|
+
handles = [0, 0, 0, 0];
|
|
2653
|
+
// Internal handles for Wasm, shared with the finalizer.
|
|
2666
2654
|
/** @internal */
|
|
2667
2655
|
tree;
|
|
2668
2656
|
/** @internal */
|
|
@@ -2670,21 +2658,20 @@ var TreeCursor = class _TreeCursor {
|
|
|
2670
2658
|
assertInternal(internal);
|
|
2671
2659
|
this.tree = tree;
|
|
2672
2660
|
unmarshalTreeCursor(this);
|
|
2673
|
-
finalizer3?.register(this, this.
|
|
2661
|
+
finalizer3?.register(this, this.handles, this);
|
|
2674
2662
|
}
|
|
2675
2663
|
/** Creates a deep copy of the tree cursor. This allocates new memory. */
|
|
2676
2664
|
copy() {
|
|
2677
|
-
|
|
2665
|
+
marshalTreeCursor(this);
|
|
2678
2666
|
C._ts_tree_cursor_copy_wasm(this.tree[0]);
|
|
2679
|
-
|
|
2680
|
-
return copy;
|
|
2667
|
+
return new _TreeCursor(INTERNAL, this.tree);
|
|
2681
2668
|
}
|
|
2682
2669
|
/** Delete the tree cursor, freeing its resources. */
|
|
2683
2670
|
delete() {
|
|
2684
2671
|
finalizer3?.unregister(this);
|
|
2685
2672
|
marshalTreeCursor(this);
|
|
2686
2673
|
C._ts_tree_cursor_delete_wasm(this.tree[0]);
|
|
2687
|
-
this
|
|
2674
|
+
this.handles.fill(0);
|
|
2688
2675
|
}
|
|
2689
2676
|
/** Get the tree cursor's current {@link Node}. */
|
|
2690
2677
|
get currentNode() {
|
|
@@ -2895,10 +2882,10 @@ var TreeCursor = class _TreeCursor {
|
|
|
2895
2882
|
}
|
|
2896
2883
|
/**
|
|
2897
2884
|
* Move this cursor to the first child of its current node that contains or
|
|
2898
|
-
* starts after the given
|
|
2885
|
+
* starts after the given position.
|
|
2899
2886
|
*
|
|
2900
|
-
* This returns
|
|
2901
|
-
* `
|
|
2887
|
+
* This returns `true` if the cursor successfully moved to a child node, and returns
|
|
2888
|
+
* `false` if no such child was found.
|
|
2902
2889
|
*/
|
|
2903
2890
|
gotoFirstChildForPosition(goalPosition) {
|
|
2904
2891
|
marshalTreeCursor(this);
|
|
@@ -2914,8 +2901,9 @@ var TreeCursor = class _TreeCursor {
|
|
|
2914
2901
|
reset(node) {
|
|
2915
2902
|
marshalNode(node);
|
|
2916
2903
|
marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE);
|
|
2917
|
-
C._ts_tree_cursor_reset_wasm(
|
|
2904
|
+
C._ts_tree_cursor_reset_wasm(node.tree[0]);
|
|
2918
2905
|
unmarshalTreeCursor(this);
|
|
2906
|
+
this.tree = node.tree;
|
|
2919
2907
|
}
|
|
2920
2908
|
/**
|
|
2921
2909
|
* Re-initialize a tree cursor to the same position as another cursor.
|
|
@@ -2928,6 +2916,7 @@ var TreeCursor = class _TreeCursor {
|
|
|
2928
2916
|
marshalTreeCursor(cursor, TRANSFER_BUFFER + SIZE_OF_CURSOR);
|
|
2929
2917
|
C._ts_tree_cursor_reset_to_wasm(this.tree[0], cursor.tree[0]);
|
|
2930
2918
|
unmarshalTreeCursor(this);
|
|
2919
|
+
this.tree = cursor.tree;
|
|
2931
2920
|
}
|
|
2932
2921
|
};
|
|
2933
2922
|
|
|
@@ -3288,16 +3277,14 @@ var Node = class {
|
|
|
3288
3277
|
if (!Array.isArray(types)) types = [types];
|
|
3289
3278
|
const symbols = [];
|
|
3290
3279
|
const typesBySymbol = this.tree.language.types;
|
|
3291
|
-
for (const node_type of types) {
|
|
3292
|
-
if (node_type == "ERROR") {
|
|
3293
|
-
symbols.push(65535);
|
|
3294
|
-
}
|
|
3295
|
-
}
|
|
3296
3280
|
for (let i2 = 0, n = typesBySymbol.length; i2 < n; i2++) {
|
|
3297
3281
|
if (types.includes(typesBySymbol[i2])) {
|
|
3298
3282
|
symbols.push(i2);
|
|
3299
3283
|
}
|
|
3300
3284
|
}
|
|
3285
|
+
if (types.includes("ERROR")) {
|
|
3286
|
+
symbols.push(65535);
|
|
3287
|
+
}
|
|
3301
3288
|
const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);
|
|
3302
3289
|
for (let i2 = 0, n = symbols.length; i2 < n; i2++) {
|
|
3303
3290
|
C.setValue(symbolsAddress + i2 * SIZE_OF_INT, symbols[i2], "i32");
|
|
@@ -3452,31 +3439,9 @@ var Node = class {
|
|
|
3452
3439
|
* you want to keep and continue to use after an edit.
|
|
3453
3440
|
*/
|
|
3454
3441
|
edit(edit) {
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
let subbedPointColumn;
|
|
3459
|
-
if (this.startPosition.row > edit.oldEndPosition.row) {
|
|
3460
|
-
subbedPointRow = this.startPosition.row - edit.oldEndPosition.row;
|
|
3461
|
-
subbedPointColumn = this.startPosition.column;
|
|
3462
|
-
} else {
|
|
3463
|
-
subbedPointRow = 0;
|
|
3464
|
-
subbedPointColumn = this.startPosition.column;
|
|
3465
|
-
if (this.startPosition.column >= edit.oldEndPosition.column) {
|
|
3466
|
-
subbedPointColumn = this.startPosition.column - edit.oldEndPosition.column;
|
|
3467
|
-
}
|
|
3468
|
-
}
|
|
3469
|
-
if (subbedPointRow > 0) {
|
|
3470
|
-
this.startPosition.row += subbedPointRow;
|
|
3471
|
-
this.startPosition.column = subbedPointColumn;
|
|
3472
|
-
} else {
|
|
3473
|
-
this.startPosition.column += subbedPointColumn;
|
|
3474
|
-
}
|
|
3475
|
-
} else if (this.startIndex > edit.startIndex) {
|
|
3476
|
-
this.startIndex = edit.newEndIndex;
|
|
3477
|
-
this.startPosition.row = edit.newEndPosition.row;
|
|
3478
|
-
this.startPosition.column = edit.newEndPosition.column;
|
|
3479
|
-
}
|
|
3442
|
+
const { point, index } = edit.editPoint(this.startPosition, this.startIndex);
|
|
3443
|
+
this.startPosition = point;
|
|
3444
|
+
this.startIndex = index;
|
|
3480
3445
|
}
|
|
3481
3446
|
/** Get the S-expression representation of this node. */
|
|
3482
3447
|
toString() {
|
|
@@ -3534,18 +3499,18 @@ function unmarshalNode(tree, address = TRANSFER_BUFFER) {
|
|
|
3534
3499
|
return result;
|
|
3535
3500
|
}
|
|
3536
3501
|
__name(unmarshalNode, "unmarshalNode");
|
|
3537
|
-
function marshalTreeCursor(
|
|
3538
|
-
C.setValue(address + 0 * SIZE_OF_INT,
|
|
3539
|
-
C.setValue(address + 1 * SIZE_OF_INT,
|
|
3540
|
-
C.setValue(address + 2 * SIZE_OF_INT,
|
|
3541
|
-
C.setValue(address + 3 * SIZE_OF_INT,
|
|
3502
|
+
function marshalTreeCursor({ handles }, address = TRANSFER_BUFFER) {
|
|
3503
|
+
C.setValue(address + 0 * SIZE_OF_INT, handles[0], "i32");
|
|
3504
|
+
C.setValue(address + 1 * SIZE_OF_INT, handles[1], "i32");
|
|
3505
|
+
C.setValue(address + 2 * SIZE_OF_INT, handles[2], "i32");
|
|
3506
|
+
C.setValue(address + 3 * SIZE_OF_INT, handles[3], "i32");
|
|
3542
3507
|
}
|
|
3543
3508
|
__name(marshalTreeCursor, "marshalTreeCursor");
|
|
3544
|
-
function unmarshalTreeCursor(
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3509
|
+
function unmarshalTreeCursor({ handles }) {
|
|
3510
|
+
handles[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32");
|
|
3511
|
+
handles[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32");
|
|
3512
|
+
handles[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32");
|
|
3513
|
+
handles[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, "i32");
|
|
3549
3514
|
}
|
|
3550
3515
|
__name(unmarshalTreeCursor, "unmarshalTreeCursor");
|
|
3551
3516
|
function marshalPoint(address, point) {
|
|
@@ -4291,6 +4256,10 @@ function parsePattern(index, stepType, stepValueId, captureNames, stringValues,
|
|
|
4291
4256
|
}
|
|
4292
4257
|
}
|
|
4293
4258
|
__name(parsePattern, "parsePattern");
|
|
4259
|
+
function indexForByteOffset(source, byteOffset) {
|
|
4260
|
+
return new TextEncoder().encodeInto(source, new Uint8Array(byteOffset)).read;
|
|
4261
|
+
}
|
|
4262
|
+
__name(indexForByteOffset, "indexForByteOffset");
|
|
4294
4263
|
var finalizer5 = newFinalizer((address) => {
|
|
4295
4264
|
C._ts_query_delete(address);
|
|
4296
4265
|
});
|
|
@@ -4305,6 +4274,8 @@ var Query = class {
|
|
|
4305
4274
|
exceededMatchLimit;
|
|
4306
4275
|
/** @internal */
|
|
4307
4276
|
textPredicates;
|
|
4277
|
+
/** @internal */
|
|
4278
|
+
source;
|
|
4308
4279
|
/** The names of the captures used in the query. */
|
|
4309
4280
|
captureNames;
|
|
4310
4281
|
/** The quantifiers of the captures used in the query. */
|
|
@@ -4443,6 +4414,7 @@ var Query = class {
|
|
|
4443
4414
|
this.captureNames = captureNames;
|
|
4444
4415
|
this.captureQuantifiers = captureQuantifiers;
|
|
4445
4416
|
this.textPredicates = textPredicates;
|
|
4417
|
+
this.source = source;
|
|
4446
4418
|
this.predicates = predicates;
|
|
4447
4419
|
this.setProperties = setProperties;
|
|
4448
4420
|
this.assertedProperties = assertedProperties;
|
|
@@ -4679,23 +4651,25 @@ var Query = class {
|
|
|
4679
4651
|
didExceedMatchLimit() {
|
|
4680
4652
|
return this.exceededMatchLimit;
|
|
4681
4653
|
}
|
|
4682
|
-
/** Get the
|
|
4654
|
+
/** Get the index where the given pattern starts in the query's source. */
|
|
4683
4655
|
startIndexForPattern(patternIndex) {
|
|
4684
4656
|
if (patternIndex >= this.predicates.length) {
|
|
4685
4657
|
throw new Error(
|
|
4686
4658
|
`Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`
|
|
4687
4659
|
);
|
|
4688
4660
|
}
|
|
4689
|
-
|
|
4661
|
+
const byteOffset = C._ts_query_start_byte_for_pattern(this[0], patternIndex);
|
|
4662
|
+
return indexForByteOffset(this.source, byteOffset);
|
|
4690
4663
|
}
|
|
4691
|
-
/** Get the
|
|
4664
|
+
/** Get the index where the given pattern ends in the query's source. */
|
|
4692
4665
|
endIndexForPattern(patternIndex) {
|
|
4693
4666
|
if (patternIndex >= this.predicates.length) {
|
|
4694
4667
|
throw new Error(
|
|
4695
4668
|
`Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`
|
|
4696
4669
|
);
|
|
4697
4670
|
}
|
|
4698
|
-
|
|
4671
|
+
const byteOffset = C._ts_query_end_byte_for_pattern(this[0], patternIndex);
|
|
4672
|
+
return indexForByteOffset(this.source, byteOffset);
|
|
4699
4673
|
}
|
|
4700
4674
|
/** Get the number of patterns in the query. */
|
|
4701
4675
|
patternCount() {
|
|
@@ -4714,13 +4688,14 @@ var Query = class {
|
|
|
4714
4688
|
return C._ts_query_is_pattern_non_local(this[0], patternIndex) === 1;
|
|
4715
4689
|
}
|
|
4716
4690
|
/**
|
|
4717
|
-
* Check if
|
|
4691
|
+
* Check if the step at the given index in the query's source is 'definite'.
|
|
4718
4692
|
*
|
|
4719
4693
|
* A query step is 'definite' if its parent pattern will be guaranteed to
|
|
4720
4694
|
* match successfully once it reaches the step.
|
|
4721
4695
|
*/
|
|
4722
|
-
isPatternGuaranteedAtStep(
|
|
4723
|
-
|
|
4696
|
+
isPatternGuaranteedAtStep(index) {
|
|
4697
|
+
const byteOffset = C.lengthBytesUTF8(this.source.slice(0, index));
|
|
4698
|
+
return C._ts_query_is_pattern_guaranteed_at_step(this[0], byteOffset) === 1;
|
|
4724
4699
|
}
|
|
4725
4700
|
};
|
|
4726
4701
|
// Annotate the CommonJS export names for ESM import in node:
|