kirograph 0.12.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/README.md +1171 -0
- package/dist/architecture/index.d.ts +11 -0
- package/dist/architecture/index.d.ts.map +1 -0
- package/dist/architecture/index.js +207 -0
- package/dist/architecture/index.js.map +7 -0
- package/dist/architecture/layers/csharp.d.ts +6 -0
- package/dist/architecture/layers/csharp.d.ts.map +1 -0
- package/dist/architecture/layers/csharp.js +100 -0
- package/dist/architecture/layers/csharp.js.map +7 -0
- package/dist/architecture/layers/elixir.js +116 -0
- package/dist/architecture/layers/elixir.js.map +7 -0
- package/dist/architecture/layers/go.d.ts +7 -0
- package/dist/architecture/layers/go.d.ts.map +1 -0
- package/dist/architecture/layers/go.js +117 -0
- package/dist/architecture/layers/go.js.map +7 -0
- package/dist/architecture/layers/index.d.ts +30 -0
- package/dist/architecture/layers/index.d.ts.map +1 -0
- package/dist/architecture/layers/index.js +100 -0
- package/dist/architecture/layers/index.js.map +7 -0
- package/dist/architecture/layers/java.d.ts +7 -0
- package/dist/architecture/layers/java.d.ts.map +1 -0
- package/dist/architecture/layers/java.js +119 -0
- package/dist/architecture/layers/java.js.map +7 -0
- package/dist/architecture/layers/python.d.ts +7 -0
- package/dist/architecture/layers/python.d.ts.map +1 -0
- package/dist/architecture/layers/python.js +111 -0
- package/dist/architecture/layers/python.js.map +7 -0
- package/dist/architecture/layers/ruby.d.ts +6 -0
- package/dist/architecture/layers/ruby.d.ts.map +1 -0
- package/dist/architecture/layers/ruby.js +95 -0
- package/dist/architecture/layers/ruby.js.map +7 -0
- package/dist/architecture/layers/rust.d.ts +6 -0
- package/dist/architecture/layers/rust.d.ts.map +1 -0
- package/dist/architecture/layers/rust.js +98 -0
- package/dist/architecture/layers/rust.js.map +7 -0
- package/dist/architecture/layers/types.d.ts +2 -0
- package/dist/architecture/layers/types.d.ts.map +1 -0
- package/dist/architecture/layers/types.js +17 -0
- package/dist/architecture/layers/types.js.map +7 -0
- package/dist/architecture/layers/typescript.d.ts +9 -0
- package/dist/architecture/layers/typescript.d.ts.map +1 -0
- package/dist/architecture/layers/typescript.js +143 -0
- package/dist/architecture/layers/typescript.js.map +7 -0
- package/dist/architecture/manifest/cargo.d.ts +3 -0
- package/dist/architecture/manifest/cargo.d.ts.map +1 -0
- package/dist/architecture/manifest/cargo.js +94 -0
- package/dist/architecture/manifest/cargo.js.map +7 -0
- package/dist/architecture/manifest/csproj.d.ts +3 -0
- package/dist/architecture/manifest/csproj.d.ts.map +1 -0
- package/dist/architecture/manifest/csproj.js +75 -0
- package/dist/architecture/manifest/csproj.js.map +7 -0
- package/dist/architecture/manifest/go.d.ts +3 -0
- package/dist/architecture/manifest/go.d.ts.map +1 -0
- package/dist/architecture/manifest/go.js +85 -0
- package/dist/architecture/manifest/go.js.map +7 -0
- package/dist/architecture/manifest/gradle.d.ts +3 -0
- package/dist/architecture/manifest/gradle.d.ts.map +1 -0
- package/dist/architecture/manifest/gradle.js +80 -0
- package/dist/architecture/manifest/gradle.js.map +7 -0
- package/dist/architecture/manifest/index.d.ts +12 -0
- package/dist/architecture/manifest/index.d.ts.map +1 -0
- package/dist/architecture/manifest/index.js +130 -0
- package/dist/architecture/manifest/index.js.map +7 -0
- package/dist/architecture/manifest/maven.d.ts +3 -0
- package/dist/architecture/manifest/maven.d.ts.map +1 -0
- package/dist/architecture/manifest/maven.js +76 -0
- package/dist/architecture/manifest/maven.js.map +7 -0
- package/dist/architecture/manifest/npm.d.ts +3 -0
- package/dist/architecture/manifest/npm.d.ts.map +1 -0
- package/dist/architecture/manifest/npm.js +103 -0
- package/dist/architecture/manifest/npm.js.map +7 -0
- package/dist/architecture/manifest/python.d.ts +3 -0
- package/dist/architecture/manifest/python.d.ts.map +1 -0
- package/dist/architecture/manifest/python.js +105 -0
- package/dist/architecture/manifest/python.js.map +7 -0
- package/dist/architecture/manifest/types.d.ts +2 -0
- package/dist/architecture/manifest/types.d.ts.map +1 -0
- package/dist/architecture/manifest/types.js +17 -0
- package/dist/architecture/manifest/types.js.map +7 -0
- package/dist/architecture/types.d.ts +91 -0
- package/dist/architecture/types.d.ts.map +1 -0
- package/dist/architecture/types.js +17 -0
- package/dist/architecture/types.js.map +7 -0
- package/dist/assets/logo.png +0 -0
- package/dist/banner.d.ts +6 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +67 -0
- package/dist/banner.js.map +1 -0
- package/dist/bin/banner.d.ts +6 -0
- package/dist/bin/banner.d.ts.map +1 -0
- package/dist/bin/banner.js +88 -0
- package/dist/bin/banner.js.map +7 -0
- package/dist/bin/commands/affected.d.ts +3 -0
- package/dist/bin/commands/affected.d.ts.map +1 -0
- package/dist/bin/commands/affected.js +78 -0
- package/dist/bin/commands/affected.js.map +7 -0
- package/dist/bin/commands/architecture.d.ts +3 -0
- package/dist/bin/commands/architecture.d.ts.map +1 -0
- package/dist/bin/commands/architecture.js +125 -0
- package/dist/bin/commands/architecture.js.map +7 -0
- package/dist/bin/commands/caveman.js +136 -0
- package/dist/bin/commands/caveman.js.map +7 -0
- package/dist/bin/commands/context.d.ts +3 -0
- package/dist/bin/commands/context.d.ts.map +1 -0
- package/dist/bin/commands/context.js +81 -0
- package/dist/bin/commands/context.js.map +7 -0
- package/dist/bin/commands/coupling.d.ts +3 -0
- package/dist/bin/commands/coupling.d.ts.map +1 -0
- package/dist/bin/commands/coupling.js +164 -0
- package/dist/bin/commands/coupling.js.map +7 -0
- package/dist/bin/commands/dashboard.d.ts +3 -0
- package/dist/bin/commands/dashboard.d.ts.map +1 -0
- package/dist/bin/commands/dashboard.js +209 -0
- package/dist/bin/commands/dashboard.js.map +7 -0
- package/dist/bin/commands/dead-code.js +77 -0
- package/dist/bin/commands/dead-code.js.map +7 -0
- package/dist/bin/commands/export.js +2620 -0
- package/dist/bin/commands/export.js.map +7 -0
- package/dist/bin/commands/files.d.ts +3 -0
- package/dist/bin/commands/files.d.ts.map +1 -0
- package/dist/bin/commands/files.js +104 -0
- package/dist/bin/commands/files.js.map +7 -0
- package/dist/bin/commands/help.d.ts +4 -0
- package/dist/bin/commands/help.d.ts.map +1 -0
- package/dist/bin/commands/help.js +212 -0
- package/dist/bin/commands/help.js.map +7 -0
- package/dist/bin/commands/hotspots.js +77 -0
- package/dist/bin/commands/hotspots.js.map +7 -0
- package/dist/bin/commands/index.d.ts +3 -0
- package/dist/bin/commands/index.d.ts.map +1 -0
- package/dist/bin/commands/index.js +58 -0
- package/dist/bin/commands/index.js.map +7 -0
- package/dist/bin/commands/init.d.ts +3 -0
- package/dist/bin/commands/init.d.ts.map +1 -0
- package/dist/bin/commands/init.js +68 -0
- package/dist/bin/commands/init.js.map +7 -0
- package/dist/bin/commands/install.d.ts +3 -0
- package/dist/bin/commands/install.d.ts.map +1 -0
- package/dist/bin/commands/install.js +34 -0
- package/dist/bin/commands/install.js.map +7 -0
- package/dist/bin/commands/mark-dirty.d.ts +3 -0
- package/dist/bin/commands/mark-dirty.d.ts.map +1 -0
- package/dist/bin/commands/mark-dirty.js +51 -0
- package/dist/bin/commands/mark-dirty.js.map +7 -0
- package/dist/bin/commands/package.d.ts +3 -0
- package/dist/bin/commands/package.d.ts.map +1 -0
- package/dist/bin/commands/package.js +139 -0
- package/dist/bin/commands/package.js.map +7 -0
- package/dist/bin/commands/path.js +93 -0
- package/dist/bin/commands/path.js.map +7 -0
- package/dist/bin/commands/qdrant.d.ts +3 -0
- package/dist/bin/commands/qdrant.d.ts.map +1 -0
- package/dist/bin/commands/qdrant.js +159 -0
- package/dist/bin/commands/qdrant.js.map +1 -0
- package/dist/bin/commands/query.d.ts +3 -0
- package/dist/bin/commands/query.d.ts.map +1 -0
- package/dist/bin/commands/query.js +47 -0
- package/dist/bin/commands/query.js.map +7 -0
- package/dist/bin/commands/serve.d.ts +3 -0
- package/dist/bin/commands/serve.d.ts.map +1 -0
- package/dist/bin/commands/serve.js +59 -0
- package/dist/bin/commands/serve.js.map +7 -0
- package/dist/bin/commands/snapshot.js +122 -0
- package/dist/bin/commands/snapshot.js.map +7 -0
- package/dist/bin/commands/status.d.ts +3 -0
- package/dist/bin/commands/status.d.ts.map +1 -0
- package/dist/bin/commands/status.js +107 -0
- package/dist/bin/commands/status.js.map +7 -0
- package/dist/bin/commands/stop.d.ts +3 -0
- package/dist/bin/commands/stop.d.ts.map +1 -0
- package/dist/bin/commands/stop.js +81 -0
- package/dist/bin/commands/stop.js.map +1 -0
- package/dist/bin/commands/surprising.js +79 -0
- package/dist/bin/commands/surprising.js.map +7 -0
- package/dist/bin/commands/sync-if-dirty.d.ts +3 -0
- package/dist/bin/commands/sync-if-dirty.d.ts.map +1 -0
- package/dist/bin/commands/sync-if-dirty.js +67 -0
- package/dist/bin/commands/sync-if-dirty.js.map +7 -0
- package/dist/bin/commands/sync.d.ts +3 -0
- package/dist/bin/commands/sync.d.ts.map +1 -0
- package/dist/bin/commands/sync.js +81 -0
- package/dist/bin/commands/sync.js.map +7 -0
- package/dist/bin/commands/typesense.d.ts +3 -0
- package/dist/bin/commands/typesense.d.ts.map +1 -0
- package/dist/bin/commands/typesense.js +126 -0
- package/dist/bin/commands/typesense.js.map +1 -0
- package/dist/bin/commands/uninit.d.ts +4 -0
- package/dist/bin/commands/uninit.d.ts.map +1 -0
- package/dist/bin/commands/uninit.js +123 -0
- package/dist/bin/commands/uninit.js.map +7 -0
- package/dist/bin/commands/unlock.d.ts +3 -0
- package/dist/bin/commands/unlock.d.ts.map +1 -0
- package/dist/bin/commands/unlock.js +53 -0
- package/dist/bin/commands/unlock.js.map +7 -0
- package/dist/bin/commands/utils.d.ts +12 -0
- package/dist/bin/commands/utils.d.ts.map +1 -0
- package/dist/bin/commands/utils.js +56 -0
- package/dist/bin/commands/utils.js.map +7 -0
- package/dist/bin/installer/archive.js +230 -0
- package/dist/bin/installer/archive.js.map +7 -0
- package/dist/bin/installer/caveman.js +57 -0
- package/dist/bin/installer/caveman.js.map +7 -0
- package/dist/bin/installer/cli-agent.d.ts +15 -0
- package/dist/bin/installer/cli-agent.d.ts.map +1 -0
- package/dist/bin/installer/cli-agent.js +89 -0
- package/dist/bin/installer/cli-agent.js.map +7 -0
- package/dist/bin/installer/config-prompt.d.ts +13 -0
- package/dist/bin/installer/config-prompt.d.ts.map +1 -0
- package/dist/bin/installer/config-prompt.js +158 -0
- package/dist/bin/installer/config-prompt.js.map +7 -0
- package/dist/bin/installer/dashboard.d.ts +3 -0
- package/dist/bin/installer/dashboard.d.ts.map +1 -0
- package/dist/bin/installer/dashboard.js +149 -0
- package/dist/bin/installer/dashboard.js.map +7 -0
- package/dist/bin/installer/hooks.d.ts +5 -0
- package/dist/bin/installer/hooks.d.ts.map +1 -0
- package/dist/bin/installer/hooks.js +155 -0
- package/dist/bin/installer/hooks.js.map +7 -0
- package/dist/bin/installer/index.d.ts +11 -0
- package/dist/bin/installer/index.d.ts.map +1 -0
- package/dist/bin/installer/index.js +228 -0
- package/dist/bin/installer/index.js.map +7 -0
- package/dist/bin/installer/mcp.d.ts +5 -0
- package/dist/bin/installer/mcp.d.ts.map +1 -0
- package/dist/bin/installer/mcp.js +80 -0
- package/dist/bin/installer/mcp.js.map +7 -0
- package/dist/bin/installer/prompts.d.ts +28 -0
- package/dist/bin/installer/prompts.d.ts.map +1 -0
- package/dist/bin/installer/prompts.js +134 -0
- package/dist/bin/installer/prompts.js.map +7 -0
- package/dist/bin/installer/qdrant-dashboard.d.ts +4 -0
- package/dist/bin/installer/qdrant-dashboard.d.ts.map +1 -0
- package/dist/bin/installer/qdrant-dashboard.js +115 -0
- package/dist/bin/installer/qdrant-dashboard.js.map +7 -0
- package/dist/bin/installer/steering.d.ts +5 -0
- package/dist/bin/installer/steering.d.ts.map +1 -0
- package/dist/bin/installer/steering.js +283 -0
- package/dist/bin/installer/steering.js.map +7 -0
- package/dist/bin/kirograph.d.ts +6 -0
- package/dist/bin/kirograph.d.ts.map +1 -0
- package/dist/bin/kirograph.js +95 -0
- package/dist/bin/kirograph.js.map +7 -0
- package/dist/bin/progress.d.ts +14 -0
- package/dist/bin/progress.d.ts.map +1 -0
- package/dist/bin/progress.js +201 -0
- package/dist/bin/progress.js.map +7 -0
- package/dist/bin/ui.d.ts +11 -0
- package/dist/bin/ui.d.ts.map +1 -0
- package/dist/bin/ui.js +71 -0
- package/dist/bin/ui.js.map +7 -0
- package/dist/config.d.ts +48 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +273 -0
- package/dist/config.js.map +7 -0
- package/dist/context/index.d.ts +61 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +224 -0
- package/dist/context/index.js.map +7 -0
- package/dist/core/file-tree.d.ts +15 -0
- package/dist/core/file-tree.d.ts.map +1 -0
- package/dist/core/file-tree.js +69 -0
- package/dist/core/file-tree.js.map +7 -0
- package/dist/core/lock-manager.d.ts +20 -0
- package/dist/core/lock-manager.d.ts.map +1 -0
- package/dist/core/lock-manager.js +120 -0
- package/dist/core/lock-manager.js.map +7 -0
- package/dist/core/pipeline.d.ts +37 -0
- package/dist/core/pipeline.d.ts.map +1 -0
- package/dist/core/pipeline.js +375 -0
- package/dist/core/pipeline.js.map +7 -0
- package/dist/core/snapshot.js +141 -0
- package/dist/core/snapshot.js.map +7 -0
- package/dist/db/database.d.ts +133 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/database.js +929 -0
- package/dist/db/database.js.map +7 -0
- package/dist/db/schema.sql +174 -0
- package/dist/errors.d.ts +49 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +160 -0
- package/dist/errors.js.map +7 -0
- package/dist/extraction/extractor.d.ts +29 -0
- package/dist/extraction/extractor.d.ts.map +1 -0
- package/dist/extraction/extractor.js +764 -0
- package/dist/extraction/extractor.js.map +7 -0
- package/dist/extraction/grammars.d.ts +48 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +166 -0
- package/dist/extraction/grammars.js.map +7 -0
- package/dist/extraction/languages.d.ts +9 -0
- package/dist/extraction/languages.d.ts.map +1 -0
- package/dist/extraction/languages.js +103 -0
- package/dist/extraction/languages.js.map +7 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/frameworks/csharp.d.ts +8 -0
- package/dist/frameworks/csharp.d.ts.map +1 -0
- package/dist/frameworks/csharp.js +93 -0
- package/dist/frameworks/csharp.js.map +7 -0
- package/dist/frameworks/elixir.js +142 -0
- package/dist/frameworks/elixir.js.map +7 -0
- package/dist/frameworks/express.d.ts +8 -0
- package/dist/frameworks/express.d.ts.map +1 -0
- package/dist/frameworks/express.js +143 -0
- package/dist/frameworks/express.js.map +7 -0
- package/dist/frameworks/go.d.ts +8 -0
- package/dist/frameworks/go.d.ts.map +1 -0
- package/dist/frameworks/go.js +85 -0
- package/dist/frameworks/go.js.map +7 -0
- package/dist/frameworks/index.d.ts +30 -0
- package/dist/frameworks/index.d.ts.map +1 -0
- package/dist/frameworks/index.js +243 -0
- package/dist/frameworks/index.js.map +7 -0
- package/dist/frameworks/java.d.ts +8 -0
- package/dist/frameworks/java.d.ts.map +1 -0
- package/dist/frameworks/java.js +87 -0
- package/dist/frameworks/java.js.map +7 -0
- package/dist/frameworks/laravel.d.ts +9 -0
- package/dist/frameworks/laravel.d.ts.map +1 -0
- package/dist/frameworks/laravel.js +115 -0
- package/dist/frameworks/laravel.js.map +7 -0
- package/dist/frameworks/python.d.ts +10 -0
- package/dist/frameworks/python.d.ts.map +1 -0
- package/dist/frameworks/python.js +158 -0
- package/dist/frameworks/python.js.map +7 -0
- package/dist/frameworks/react.d.ts +9 -0
- package/dist/frameworks/react.d.ts.map +1 -0
- package/dist/frameworks/react.js +230 -0
- package/dist/frameworks/react.js.map +7 -0
- package/dist/frameworks/ruby.d.ts +8 -0
- package/dist/frameworks/ruby.d.ts.map +1 -0
- package/dist/frameworks/ruby.js +136 -0
- package/dist/frameworks/ruby.js.map +7 -0
- package/dist/frameworks/rust.d.ts +8 -0
- package/dist/frameworks/rust.d.ts.map +1 -0
- package/dist/frameworks/rust.js +82 -0
- package/dist/frameworks/rust.js.map +7 -0
- package/dist/frameworks/svelte.d.ts +8 -0
- package/dist/frameworks/svelte.d.ts.map +1 -0
- package/dist/frameworks/svelte.js +174 -0
- package/dist/frameworks/svelte.js.map +7 -0
- package/dist/frameworks/swift.d.ts +10 -0
- package/dist/frameworks/swift.d.ts.map +1 -0
- package/dist/frameworks/swift.js +151 -0
- package/dist/frameworks/swift.js.map +7 -0
- package/dist/frameworks/types.d.ts +37 -0
- package/dist/frameworks/types.d.ts.map +1 -0
- package/dist/frameworks/types.js +17 -0
- package/dist/frameworks/types.js.map +7 -0
- package/dist/graph/queries.d.ts +53 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +224 -0
- package/dist/graph/queries.js.map +7 -0
- package/dist/graph/traversal.d.ts +35 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +148 -0
- package/dist/graph/traversal.js.map +7 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +303 -0
- package/dist/index.js.map +7 -0
- package/dist/installer/index.d.ts +10 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +526 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/mcp/server.d.ts +16 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +116 -0
- package/dist/mcp/server.js.map +7 -0
- package/dist/mcp/tools.d.ts +37 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +779 -0
- package/dist/mcp/tools.js.map +7 -0
- package/dist/mcp/transport.d.ts +29 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +70 -0
- package/dist/mcp/transport.js.map +7 -0
- package/dist/resolution/index.d.ts +56 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +384 -0
- package/dist/resolution/index.js.map +7 -0
- package/dist/resolution/name-matcher.d.ts +25 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +60 -0
- package/dist/resolution/name-matcher.js.map +7 -0
- package/dist/scripts/postinstall.js +64 -0
- package/dist/search/query-utils.d.ts +21 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +219 -0
- package/dist/search/query-utils.js.map +7 -0
- package/dist/search/searcher.d.ts +15 -0
- package/dist/search/searcher.d.ts.map +1 -0
- package/dist/search/searcher.js +49 -0
- package/dist/search/searcher.js.map +7 -0
- package/dist/sync/index.d.ts +33 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +200 -0
- package/dist/sync/index.js.map +7 -0
- package/dist/types.d.ts +131 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +37 -0
- package/dist/types.js.map +7 -0
- package/dist/utils.d.ts +52 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +254 -0
- package/dist/utils.js.map +7 -0
- package/dist/vectors/index.d.ts +71 -0
- package/dist/vectors/index.d.ts.map +1 -0
- package/dist/vectors/index.js +480 -0
- package/dist/vectors/index.js.map +7 -0
- package/dist/vectors/lancedb-index.d.ts +50 -0
- package/dist/vectors/lancedb-index.d.ts.map +1 -0
- package/dist/vectors/lancedb-index.js +153 -0
- package/dist/vectors/lancedb-index.js.map +7 -0
- package/dist/vectors/orama-index.d.ts +54 -0
- package/dist/vectors/orama-index.d.ts.map +1 -0
- package/dist/vectors/orama-index.js +213 -0
- package/dist/vectors/orama-index.js.map +7 -0
- package/dist/vectors/pglite-index.d.ts +53 -0
- package/dist/vectors/pglite-index.d.ts.map +1 -0
- package/dist/vectors/pglite-index.js +194 -0
- package/dist/vectors/pglite-index.js.map +7 -0
- package/dist/vectors/qdrant-index.d.ts +70 -0
- package/dist/vectors/qdrant-index.d.ts.map +1 -0
- package/dist/vectors/qdrant-index.js +364 -0
- package/dist/vectors/qdrant-index.js.map +7 -0
- package/dist/vectors/typesense-index.d.ts +75 -0
- package/dist/vectors/typesense-index.d.ts.map +1 -0
- package/dist/vectors/typesense-index.js +453 -0
- package/dist/vectors/typesense-index.js.map +7 -0
- package/dist/vectors/vec-index.d.ts +52 -0
- package/dist/vectors/vec-index.d.ts.map +1 -0
- package/dist/vectors/vec-index.js +198 -0
- package/dist/vectors/vec-index.js.map +7 -0
- package/package.json +67 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var query_utils_exports = {};
|
|
20
|
+
__export(query_utils_exports, {
|
|
21
|
+
STOP_WORDS: () => STOP_WORDS,
|
|
22
|
+
extractSearchTerms: () => extractSearchTerms,
|
|
23
|
+
kindBonus: () => kindBonus,
|
|
24
|
+
scorePathRelevance: () => scorePathRelevance
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(query_utils_exports);
|
|
27
|
+
const STOP_WORDS = /* @__PURE__ */ new Set([
|
|
28
|
+
"the",
|
|
29
|
+
"and",
|
|
30
|
+
"for",
|
|
31
|
+
"with",
|
|
32
|
+
"from",
|
|
33
|
+
"this",
|
|
34
|
+
"that",
|
|
35
|
+
"have",
|
|
36
|
+
"been",
|
|
37
|
+
"will",
|
|
38
|
+
"would",
|
|
39
|
+
"could",
|
|
40
|
+
"should",
|
|
41
|
+
"does",
|
|
42
|
+
"done",
|
|
43
|
+
"make",
|
|
44
|
+
"made",
|
|
45
|
+
"use",
|
|
46
|
+
"used",
|
|
47
|
+
"using",
|
|
48
|
+
"work",
|
|
49
|
+
"works",
|
|
50
|
+
"find",
|
|
51
|
+
"found",
|
|
52
|
+
"show",
|
|
53
|
+
"call",
|
|
54
|
+
"called",
|
|
55
|
+
"get",
|
|
56
|
+
"set",
|
|
57
|
+
"add",
|
|
58
|
+
"all",
|
|
59
|
+
"any",
|
|
60
|
+
"how",
|
|
61
|
+
"what",
|
|
62
|
+
"when",
|
|
63
|
+
"where",
|
|
64
|
+
"which",
|
|
65
|
+
"who",
|
|
66
|
+
"why",
|
|
67
|
+
"fix",
|
|
68
|
+
"bug",
|
|
69
|
+
"code",
|
|
70
|
+
"file",
|
|
71
|
+
"files",
|
|
72
|
+
"function",
|
|
73
|
+
"method",
|
|
74
|
+
"class",
|
|
75
|
+
"type",
|
|
76
|
+
"build",
|
|
77
|
+
"run",
|
|
78
|
+
"test",
|
|
79
|
+
"a",
|
|
80
|
+
"an",
|
|
81
|
+
"in",
|
|
82
|
+
"of",
|
|
83
|
+
"to",
|
|
84
|
+
"is",
|
|
85
|
+
"it",
|
|
86
|
+
"by",
|
|
87
|
+
"on",
|
|
88
|
+
"at",
|
|
89
|
+
"as",
|
|
90
|
+
"or",
|
|
91
|
+
"be",
|
|
92
|
+
"do",
|
|
93
|
+
"if",
|
|
94
|
+
"no",
|
|
95
|
+
"so",
|
|
96
|
+
"up",
|
|
97
|
+
"not",
|
|
98
|
+
"but",
|
|
99
|
+
"are",
|
|
100
|
+
"was",
|
|
101
|
+
"has",
|
|
102
|
+
"had",
|
|
103
|
+
"its",
|
|
104
|
+
"can",
|
|
105
|
+
"may",
|
|
106
|
+
"also",
|
|
107
|
+
"into",
|
|
108
|
+
"then",
|
|
109
|
+
"than",
|
|
110
|
+
"just",
|
|
111
|
+
"more",
|
|
112
|
+
"some",
|
|
113
|
+
"such",
|
|
114
|
+
"each",
|
|
115
|
+
"over",
|
|
116
|
+
"only",
|
|
117
|
+
"new",
|
|
118
|
+
"out",
|
|
119
|
+
"two",
|
|
120
|
+
"way",
|
|
121
|
+
"see",
|
|
122
|
+
"him",
|
|
123
|
+
"his",
|
|
124
|
+
"her",
|
|
125
|
+
"she",
|
|
126
|
+
"they",
|
|
127
|
+
"them",
|
|
128
|
+
"their",
|
|
129
|
+
"our",
|
|
130
|
+
"your",
|
|
131
|
+
"you",
|
|
132
|
+
"we",
|
|
133
|
+
"me",
|
|
134
|
+
"my",
|
|
135
|
+
"him",
|
|
136
|
+
"his"
|
|
137
|
+
]);
|
|
138
|
+
function extractSearchTerms(query) {
|
|
139
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
140
|
+
const camelSplit = query.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
141
|
+
const normalised = camelSplit.replace(/[_\.]+/g, " ");
|
|
142
|
+
const words = normalised.split(/[^a-zA-Z0-9]+/).filter(Boolean);
|
|
143
|
+
for (const word of words) {
|
|
144
|
+
const lower = word.toLowerCase();
|
|
145
|
+
if (lower.length < 3) continue;
|
|
146
|
+
if (STOP_WORDS.has(lower)) continue;
|
|
147
|
+
tokens.add(lower);
|
|
148
|
+
}
|
|
149
|
+
return [...tokens];
|
|
150
|
+
}
|
|
151
|
+
function scorePathRelevance(filePath, query) {
|
|
152
|
+
const queryTerms = extractSearchTerms(query);
|
|
153
|
+
if (queryTerms.length === 0) return 0;
|
|
154
|
+
const normalised = filePath.replace(/\\/g, "/");
|
|
155
|
+
const segments = normalised.split("/").filter(Boolean);
|
|
156
|
+
if (segments.length === 0) return 0;
|
|
157
|
+
const lastSegment = segments[segments.length - 1];
|
|
158
|
+
const dotIdx = lastSegment.lastIndexOf(".");
|
|
159
|
+
const filename = dotIdx > 0 ? lastSegment.slice(0, dotIdx) : lastSegment;
|
|
160
|
+
const dirSegments = segments.slice(0, -1);
|
|
161
|
+
let score = 0;
|
|
162
|
+
for (const term of queryTerms) {
|
|
163
|
+
const filenameLower = filename.toLowerCase();
|
|
164
|
+
const termLower = term.toLowerCase();
|
|
165
|
+
if (filenameLower === termLower) {
|
|
166
|
+
score += 10;
|
|
167
|
+
} else if (dirSegments.some((s) => s.toLowerCase() === termLower)) {
|
|
168
|
+
score += 5;
|
|
169
|
+
} else if (segments.some((s) => s.toLowerCase().includes(termLower))) {
|
|
170
|
+
score += 3;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return score;
|
|
174
|
+
}
|
|
175
|
+
function kindBonus(kind) {
|
|
176
|
+
switch (kind) {
|
|
177
|
+
case "function":
|
|
178
|
+
case "method":
|
|
179
|
+
return 10;
|
|
180
|
+
case "route":
|
|
181
|
+
return 9;
|
|
182
|
+
case "class":
|
|
183
|
+
case "component":
|
|
184
|
+
return 8;
|
|
185
|
+
case "interface":
|
|
186
|
+
return 7;
|
|
187
|
+
case "type_alias":
|
|
188
|
+
case "struct":
|
|
189
|
+
case "trait":
|
|
190
|
+
return 6;
|
|
191
|
+
case "enum":
|
|
192
|
+
return 5;
|
|
193
|
+
case "module":
|
|
194
|
+
case "namespace":
|
|
195
|
+
return 4;
|
|
196
|
+
case "property":
|
|
197
|
+
case "field":
|
|
198
|
+
case "constant":
|
|
199
|
+
return 3;
|
|
200
|
+
case "variable":
|
|
201
|
+
return 2;
|
|
202
|
+
case "import":
|
|
203
|
+
case "export":
|
|
204
|
+
return 1;
|
|
205
|
+
case "parameter":
|
|
206
|
+
case "file":
|
|
207
|
+
return 0;
|
|
208
|
+
default:
|
|
209
|
+
return 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
213
|
+
0 && (module.exports = {
|
|
214
|
+
STOP_WORDS,
|
|
215
|
+
extractSearchTerms,
|
|
216
|
+
kindBonus,
|
|
217
|
+
scorePathRelevance
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=query-utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/search/query-utils.ts"],
|
|
4
|
+
"sourcesContent": ["import type { NodeKind } from '../types';\n\n// \u2500\u2500 Stop Words \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** Common English words that carry no search signal. */\nexport const STOP_WORDS = new Set([\n 'the', 'and', 'for', 'with', 'from', 'this', 'that', 'have', 'been', 'will',\n 'would', 'could', 'should', 'does', 'done', 'make', 'made', 'use', 'used',\n 'using', 'work', 'works', 'find', 'found', 'show', 'call', 'called', 'get',\n 'set', 'add', 'all', 'any', 'how', 'what', 'when', 'where', 'which', 'who',\n 'why', 'fix', 'bug', 'code', 'file', 'files', 'function', 'method', 'class',\n 'type', 'build', 'run', 'test', 'a', 'an', 'in', 'of', 'to', 'is', 'it',\n 'by', 'on', 'at', 'as', 'or', 'be', 'do', 'if', 'no', 'so', 'up', 'not',\n 'but', 'are', 'was', 'has', 'had', 'its', 'can', 'may', 'also', 'into',\n 'then', 'than', 'just', 'more', 'some', 'such', 'each', 'over', 'only',\n 'new', 'out', 'two', 'way', 'see', 'him', 'his', 'her', 'she', 'they',\n 'them', 'their', 'our', 'your', 'you', 'we', 'me', 'my', 'him', 'his',\n]);\n\n// \u2500\u2500 extractSearchTerms \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Tokenises a natural-language query.\n * Splits camelCase, PascalCase, snake_case, SCREAMING_SNAKE, and dot.notation.\n * Lowercases all tokens, removes stop words, removes tokens shorter than 3 chars.\n */\nexport function extractSearchTerms(query: string): string[] {\n const tokens = new Set<string>();\n\n // Split camelCase / PascalCase into component words\n // e.g. \"getUserName\" \u2192 [\"get\", \"User\", \"Name\"] \u2192 [\"get\", \"user\", \"name\"]\n const camelSplit = query.replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');\n\n // Replace underscores and dots with spaces (handles snake_case, SCREAMING_SNAKE, dot.notation)\n const normalised = camelSplit.replace(/[_\\.]+/g, ' ');\n\n // Split on any non-alphanumeric character\n const words = normalised.split(/[^a-zA-Z0-9]+/).filter(Boolean);\n\n for (const word of words) {\n const lower = word.toLowerCase();\n if (lower.length < 3) continue;\n if (STOP_WORDS.has(lower)) continue;\n tokens.add(lower);\n }\n\n return [...tokens];\n}\n\n// \u2500\u2500 scorePathRelevance \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Numeric relevance score for a file path against a query string.\n * +10 if filename (no extension) matches a query token exactly.\n * +5 if a directory segment matches a query token exactly.\n * +3 if any path segment contains a query token as a substring.\n */\nexport function scorePathRelevance(filePath: string, query: string): number {\n const queryTerms = extractSearchTerms(query);\n if (queryTerms.length === 0) return 0;\n\n // Normalise separators and split into segments\n const normalised = filePath.replace(/\\\\/g, '/');\n const segments = normalised.split('/').filter(Boolean);\n if (segments.length === 0) return 0;\n\n const lastSegment = segments[segments.length - 1];\n const dotIdx = lastSegment.lastIndexOf('.');\n const filename = dotIdx > 0 ? lastSegment.slice(0, dotIdx) : lastSegment;\n const dirSegments = segments.slice(0, -1);\n\n let score = 0;\n\n for (const term of queryTerms) {\n const filenameLower = filename.toLowerCase();\n const termLower = term.toLowerCase();\n\n if (filenameLower === termLower) {\n // +10: filename exactly matches\n score += 10;\n } else if (dirSegments.some(s => s.toLowerCase() === termLower)) {\n // +5: a directory segment exactly matches\n score += 5;\n } else if (segments.some(s => s.toLowerCase().includes(termLower))) {\n // +3: any segment contains the term as a substring\n score += 3;\n }\n }\n\n return score;\n}\n\n// \u2500\u2500 kindBonus \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Numeric relevance bonus by node kind.\n */\nexport function kindBonus(kind: NodeKind): number {\n switch (kind) {\n case 'function':\n case 'method':\n return 10;\n case 'route':\n return 9;\n case 'class':\n case 'component':\n return 8;\n case 'interface':\n return 7;\n case 'type_alias':\n case 'struct':\n case 'trait':\n return 6;\n case 'enum':\n return 5;\n case 'module':\n case 'namespace':\n return 4;\n case 'property':\n case 'field':\n case 'constant':\n return 3;\n case 'variable':\n return 2;\n case 'import':\n case 'export':\n return 1;\n case 'parameter':\n case 'file':\n return 0;\n default:\n return 0;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,aAAa,oBAAI,IAAI;AAAA,EAChC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EACrE;AAAA,EAAS;AAAA,EAAS;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA,EACnE;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAU;AAAA,EACrE;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EACrE;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAY;AAAA,EAAU;AAAA,EACpE;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAK;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EACnE;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAClE;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA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,MAAI,QAAQ;AAEZ,aAAW,QAAQ,YAAY;AAC7B,UAAM,gBAAgB,SAAS,YAAY;AAC3C,UAAM,YAAY,KAAK,YAAY;AAEnC,QAAI,kBAAkB,WAAW;AAE/B,eAAS;AAAA,IACX,WAAW,YAAY,KAAK,OAAK,EAAE,YAAY,MAAM,SAAS,GAAG;AAE/D,eAAS;AAAA,IACX,WAAW,SAAS,KAAK,OAAK,EAAE,YAAY,EAAE,SAAS,SAAS,CAAC,GAAG;AAElE,eAAS;AAAA,IACX;AAAA,EACF;AAEA,SAAO;AACT;AAOO,SAAS,UAAU,MAAwB;AAChD,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Searcher — symbol search with 3-tier fallback strategy.
|
|
3
|
+
*
|
|
4
|
+
* Tier 1: exact name match (highest precision, fastest)
|
|
5
|
+
* Tier 2: SQLite FTS5 full-text search
|
|
6
|
+
* Tier 3: LIKE fallback (when FTS5 returns nothing or throws)
|
|
7
|
+
*/
|
|
8
|
+
import type { GraphDatabase } from '../db/database';
|
|
9
|
+
import type { NodeKind, SearchResult, SearchOptions } from '../types';
|
|
10
|
+
export declare class Searcher {
|
|
11
|
+
private readonly db;
|
|
12
|
+
constructor(db: GraphDatabase);
|
|
13
|
+
search(query: string, kindOrOpts?: NodeKind | SearchOptions, limit?: number): SearchResult[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=searcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searcher.d.ts","sourceRoot":"","sources":["../../src/search/searcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAQ,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5E,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,aAAa;IAE9C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,aAAa,EAAE,KAAK,SAAK,GAAG,YAAY,EAAE;CA0BzF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var searcher_exports = {};
|
|
20
|
+
__export(searcher_exports, {
|
|
21
|
+
Searcher: () => Searcher
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(searcher_exports);
|
|
24
|
+
class Searcher {
|
|
25
|
+
constructor(db) {
|
|
26
|
+
this.db = db;
|
|
27
|
+
}
|
|
28
|
+
search(query, kindOrOpts, limit = 20) {
|
|
29
|
+
const opts = typeof kindOrOpts === "string" ? { kinds: [kindOrOpts], limit } : { limit, ...kindOrOpts };
|
|
30
|
+
const exact = this.db.findNodesByExactName(query, opts.kinds, opts.limit);
|
|
31
|
+
if (exact.length > 0) {
|
|
32
|
+
return exact.map((n) => ({ node: n, score: 1, matchType: "exact" }));
|
|
33
|
+
}
|
|
34
|
+
let nodes = [];
|
|
35
|
+
try {
|
|
36
|
+
nodes = this.db.searchNodes(query, opts);
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
if (nodes.length === 0) {
|
|
40
|
+
nodes = this.db.searchNodesByName(query, opts);
|
|
41
|
+
}
|
|
42
|
+
return nodes.map((n) => ({ node: n, score: 1, matchType: "fuzzy" }));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
Searcher
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=searcher.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/search/searcher.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Searcher \u2014 symbol search with 3-tier fallback strategy.\n *\n * Tier 1: exact name match (highest precision, fastest)\n * Tier 2: SQLite FTS5 full-text search\n * Tier 3: LIKE fallback (when FTS5 returns nothing or throws)\n */\n\nimport type { GraphDatabase } from '../db/database';\nimport type { Node, NodeKind, SearchResult, SearchOptions } from '../types';\n\nexport class Searcher {\n constructor(private readonly db: GraphDatabase) {}\n\n search(query: string, kindOrOpts?: NodeKind | SearchOptions, limit = 20): SearchResult[] {\n const opts: SearchOptions = typeof kindOrOpts === 'string'\n ? { kinds: [kindOrOpts as NodeKind], limit }\n : { limit, ...kindOrOpts };\n\n // Tier 1: exact name match\n const exact = this.db.findNodesByExactName(query, opts.kinds, opts.limit);\n if (exact.length > 0) {\n return exact.map((n: Node) => ({ node: n, score: 1, matchType: 'exact' as const }));\n }\n\n // Tier 2: FTS5\n let nodes: Node[] = [];\n try {\n nodes = this.db.searchNodes(query, opts);\n } catch {\n // FTS5 parse error (e.g. special chars) \u2014 fall through to LIKE\n }\n\n // Tier 3: LIKE fallback\n if (nodes.length === 0) {\n nodes = this.db.searchNodesByName(query, opts);\n }\n\n return nodes.map((n: Node) => ({ node: n, score: 1, matchType: 'fuzzy' as const }));\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,MAAM,SAAS;AAAA,EACpB,YAA6B,IAAmB;AAAnB;AAAA,EAAoB;AAAA,EAEjD,OAAO,OAAe,YAAuC,QAAQ,IAAoB;AACvF,UAAM,OAAsB,OAAO,eAAe,WAC9C,EAAE,OAAO,CAAC,UAAsB,GAAG,MAAM,IACzC,EAAE,OAAO,GAAG,WAAW;AAG3B,UAAM,QAAQ,KAAK,GAAG,qBAAqB,OAAO,KAAK,OAAO,KAAK,KAAK;AACxE,QAAI,MAAM,SAAS,GAAG;AACpB,aAAO,MAAM,IAAI,CAAC,OAAa,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,QAAiB,EAAE;AAAA,IACpF;AAGA,QAAI,QAAgB,CAAC;AACrB,QAAI;AACF,cAAQ,KAAK,GAAG,YAAY,OAAO,IAAI;AAAA,IACzC,QAAQ;AAAA,IAER;AAGA,QAAI,MAAM,WAAW,GAAG;AACtB,cAAQ,KAAK,GAAG,kBAAkB,OAAO,IAAI;AAAA,IAC/C;AAEA,WAAO,MAAM,IAAI,CAAC,OAAa,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,QAAiB,EAAE;AAAA,EACpF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Module — file discovery and change detection
|
|
3
|
+
*
|
|
4
|
+
* Extracted from KiroGraph class private methods in src/index.ts.
|
|
5
|
+
* Provides scanDirectory, hashContent, shouldIncludeFile, and getChangedFiles.
|
|
6
|
+
*/
|
|
7
|
+
import type { KiroGraphConfig } from '../config';
|
|
8
|
+
/**
|
|
9
|
+
* Returns true when relPath passes the include/exclude filter from config.
|
|
10
|
+
* Exclude patterns are checked first; include patterns (if any) are checked second.
|
|
11
|
+
*/
|
|
12
|
+
export declare function shouldIncludeFile(relPath: string, config: KiroGraphConfig): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* SHA-256 hex digest of the given content.
|
|
15
|
+
*/
|
|
16
|
+
export declare function hashContent(content: Buffer | string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Returns absolute paths of all indexable files under root.
|
|
19
|
+
* Uses git ls-files fast-path when available; falls back to filesystem walk.
|
|
20
|
+
* Respects AbortSignal.
|
|
21
|
+
*/
|
|
22
|
+
export declare function scanDirectory(root: string, config: KiroGraphConfig, signal?: AbortSignal): Promise<string[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Classifies git-changed files into added / modified / removed.
|
|
25
|
+
* Returns absolute paths. Returns empty arrays if git is unavailable.
|
|
26
|
+
* Excludes paths whose detected language is 'unknown'.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getChangedFiles(root: string, config: KiroGraphConfig): Promise<{
|
|
29
|
+
added: string[];
|
|
30
|
+
modified: string[];
|
|
31
|
+
removed: string[];
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sync/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAsFjD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAUnF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CAwBnB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoCrE"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var sync_exports = {};
|
|
30
|
+
__export(sync_exports, {
|
|
31
|
+
getChangedFiles: () => getChangedFiles,
|
|
32
|
+
hashContent: () => hashContent,
|
|
33
|
+
scanDirectory: () => scanDirectory,
|
|
34
|
+
shouldIncludeFile: () => shouldIncludeFile
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(sync_exports);
|
|
37
|
+
var path = __toESM(require("path"));
|
|
38
|
+
var fs = __toESM(require("fs"));
|
|
39
|
+
var crypto = __toESM(require("crypto"));
|
|
40
|
+
var import_child_process = require("child_process");
|
|
41
|
+
var import_picomatch = __toESM(require("picomatch"));
|
|
42
|
+
var import_languages = require("../extraction/languages");
|
|
43
|
+
function buildExcludeMatchers(config) {
|
|
44
|
+
const patterns = [...config.exclude];
|
|
45
|
+
return patterns.map((p) => {
|
|
46
|
+
try {
|
|
47
|
+
return (0, import_picomatch.default)(p);
|
|
48
|
+
} catch {
|
|
49
|
+
return () => false;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function buildIncludeMatcher(config) {
|
|
54
|
+
if (!config.include || config.include.length === 0) return null;
|
|
55
|
+
const matchers = config.include.map((p) => {
|
|
56
|
+
try {
|
|
57
|
+
return (0, import_picomatch.default)(p);
|
|
58
|
+
} catch {
|
|
59
|
+
return () => false;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return (s) => matchers.some((m) => m(s));
|
|
63
|
+
}
|
|
64
|
+
function scanDirectoryWalk(root, config, signal, visited = /* @__PURE__ */ new Set()) {
|
|
65
|
+
const results = [];
|
|
66
|
+
const walk = (dir) => {
|
|
67
|
+
if (signal?.aborted) return;
|
|
68
|
+
let realDir;
|
|
69
|
+
try {
|
|
70
|
+
realDir = fs.realpathSync(dir);
|
|
71
|
+
} catch {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (visited.has(realDir)) return;
|
|
75
|
+
visited.add(realDir);
|
|
76
|
+
const ignoreFile = path.join(dir, ".kirographignore");
|
|
77
|
+
if (fs.existsSync(ignoreFile)) return;
|
|
78
|
+
let entries;
|
|
79
|
+
try {
|
|
80
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
if (signal?.aborted) return;
|
|
86
|
+
const full = path.join(dir, entry.name);
|
|
87
|
+
const rel = path.relative(root, full).replace(/\\/g, "/");
|
|
88
|
+
if (entry.isDirectory()) {
|
|
89
|
+
walk(full);
|
|
90
|
+
} else if (entry.isFile()) {
|
|
91
|
+
if (shouldIncludeFile(rel, config)) {
|
|
92
|
+
const lang = (0, import_languages.detectLanguage)(full);
|
|
93
|
+
if (lang !== "unknown") results.push(full);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
walk(root);
|
|
99
|
+
return results;
|
|
100
|
+
}
|
|
101
|
+
function findGitRoots(root) {
|
|
102
|
+
const roots = [];
|
|
103
|
+
const walk = (dir) => {
|
|
104
|
+
if (fs.existsSync(path.join(dir, ".git"))) {
|
|
105
|
+
roots.push(dir);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
let entries;
|
|
109
|
+
try {
|
|
110
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
111
|
+
} catch {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const entry of entries) {
|
|
115
|
+
if (entry.isDirectory()) walk(path.join(dir, entry.name));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
walk(root);
|
|
119
|
+
return roots.length > 0 ? roots : [root];
|
|
120
|
+
}
|
|
121
|
+
function shouldIncludeFile(relPath, config) {
|
|
122
|
+
const excludeMatchers = buildExcludeMatchers(config);
|
|
123
|
+
if (excludeMatchers.some((m) => {
|
|
124
|
+
try {
|
|
125
|
+
return m(relPath) || m(relPath + "/");
|
|
126
|
+
} catch {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
})) return false;
|
|
130
|
+
const includeMatcher = buildIncludeMatcher(config);
|
|
131
|
+
if (includeMatcher && !includeMatcher(relPath)) return false;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
function hashContent(content) {
|
|
135
|
+
return crypto.createHash("sha256").update(content).digest("hex");
|
|
136
|
+
}
|
|
137
|
+
async function scanDirectory(root, config, signal) {
|
|
138
|
+
if (signal?.aborted) return [];
|
|
139
|
+
const gitRoots = findGitRoots(root);
|
|
140
|
+
const allFiles = [];
|
|
141
|
+
for (const gitRoot of gitRoots) {
|
|
142
|
+
if (signal?.aborted) return allFiles;
|
|
143
|
+
try {
|
|
144
|
+
const output = (0, import_child_process.execFileSync)("git", ["ls-files", "--cached", "--others", "--exclude-standard"], {
|
|
145
|
+
cwd: gitRoot,
|
|
146
|
+
encoding: "utf8",
|
|
147
|
+
timeout: 1e4,
|
|
148
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
149
|
+
});
|
|
150
|
+
if (signal?.aborted) return allFiles;
|
|
151
|
+
const files = output.split("\n").filter(Boolean).map((rel) => path.join(gitRoot, rel)).filter((abs) => {
|
|
152
|
+
const rel = path.relative(root, abs).replace(/\\/g, "/");
|
|
153
|
+
return shouldIncludeFile(rel, config) && (0, import_languages.detectLanguage)(abs) !== "unknown";
|
|
154
|
+
});
|
|
155
|
+
allFiles.push(...files);
|
|
156
|
+
} catch {
|
|
157
|
+
allFiles.push(...scanDirectoryWalk(gitRoot, config, signal));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return allFiles;
|
|
161
|
+
}
|
|
162
|
+
async function getChangedFiles(root, config) {
|
|
163
|
+
const added = [];
|
|
164
|
+
const modified = [];
|
|
165
|
+
const removed = [];
|
|
166
|
+
const gitRoots = findGitRoots(root);
|
|
167
|
+
for (const gitRoot of gitRoots) {
|
|
168
|
+
try {
|
|
169
|
+
const output = (0, import_child_process.execFileSync)("git", ["status", "--porcelain", "--no-renames"], {
|
|
170
|
+
cwd: gitRoot,
|
|
171
|
+
encoding: "utf8",
|
|
172
|
+
timeout: 1e4,
|
|
173
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
174
|
+
});
|
|
175
|
+
for (const line of output.split("\n").filter(Boolean)) {
|
|
176
|
+
const statusCode = line.slice(0, 2);
|
|
177
|
+
const relPath = line.slice(3).trim();
|
|
178
|
+
const absPath = path.join(gitRoot, relPath);
|
|
179
|
+
if ((0, import_languages.detectLanguage)(absPath) === "unknown") continue;
|
|
180
|
+
if (statusCode === "??") {
|
|
181
|
+
added.push(absPath);
|
|
182
|
+
} else if (statusCode[0] === "D" || statusCode[1] === "D") {
|
|
183
|
+
removed.push(absPath);
|
|
184
|
+
} else {
|
|
185
|
+
modified.push(absPath);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return { added, modified, removed };
|
|
192
|
+
}
|
|
193
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
194
|
+
0 && (module.exports = {
|
|
195
|
+
getChangedFiles,
|
|
196
|
+
hashContent,
|
|
197
|
+
scanDirectory,
|
|
198
|
+
shouldIncludeFile
|
|
199
|
+
});
|
|
200
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sync/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Sync Module \u2014 file discovery and change detection\n *\n * Extracted from KiroGraph class private methods in src/index.ts.\n * Provides scanDirectory, hashContent, shouldIncludeFile, and getChangedFiles.\n */\n\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as crypto from 'crypto';\nimport { execFileSync } from 'child_process';\nimport picomatch from 'picomatch';\nimport type { KiroGraphConfig } from '../config';\nimport { detectLanguage } from '../extraction/languages';\n\n// \u2500\u2500 Internal helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Returns picomatch matchers for all exclude patterns plus .kirographignore root file lines.\n */\nfunction buildExcludeMatchers(config: KiroGraphConfig): ((s: string) => boolean)[] {\n const patterns = [...config.exclude];\n\n return patterns.map(p => {\n try {\n return picomatch(p);\n } catch {\n return () => false;\n }\n });\n}\n\n/**\n * Returns a combined picomatch matcher or null if no include patterns.\n */\nfunction buildIncludeMatcher(config: KiroGraphConfig): ((s: string) => boolean) | null {\n if (!config.include || config.include.length === 0) return null;\n const matchers = config.include.map(p => {\n try {\n return picomatch(p);\n } catch {\n return () => false;\n }\n });\n return (s: string) => matchers.some(m => m(s));\n}\n\n/**\n * Recursive filesystem walk. Checks .kirographignore, guards against symlink cycles,\n * respects AbortSignal, and filters files through shouldIncludeFile.\n */\nfunction scanDirectoryWalk(\n root: string,\n config: KiroGraphConfig,\n signal?: AbortSignal,\n visited: Set<string> = new Set()\n): string[] {\n const results: string[] = [];\n\n const walk = (dir: string) => {\n if (signal?.aborted) return;\n\n // Guard against symlink cycles\n let realDir: string;\n try { realDir = fs.realpathSync(dir); } catch { return; }\n if (visited.has(realDir)) return;\n visited.add(realDir);\n\n // Check for .kirographignore in this directory\n const ignoreFile = path.join(dir, '.kirographignore');\n if (fs.existsSync(ignoreFile)) return;\n\n let entries: fs.Dirent[];\n try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }\n\n for (const entry of entries) {\n if (signal?.aborted) return;\n\n const full = path.join(dir, entry.name);\n const rel = path.relative(root, full).replace(/\\\\/g, '/');\n\n if (entry.isDirectory()) {\n walk(full);\n } else if (entry.isFile()) {\n if (shouldIncludeFile(rel, config)) {\n const lang = detectLanguage(full);\n if (lang !== 'unknown') results.push(full);\n }\n }\n }\n };\n\n walk(root);\n return results;\n}\n\n// \u2500\u2500 Git root helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Finds all git roots at or under `root` (including root itself).\n * Returns paths sorted shallowest-first so parent roots are processed before children.\n */\nfunction findGitRoots(root: string): string[] {\n const roots: string[] = [];\n\n const walk = (dir: string) => {\n if (fs.existsSync(path.join(dir, '.git'))) {\n roots.push(dir);\n return; // don't recurse into nested git repos\n }\n let entries: fs.Dirent[];\n try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }\n for (const entry of entries) {\n if (entry.isDirectory()) walk(path.join(dir, entry.name));\n }\n };\n\n walk(root);\n return roots.length > 0 ? roots : [root];\n}\n\n// \u2500\u2500 Public API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Returns true when relPath passes the include/exclude filter from config.\n * Exclude patterns are checked first; include patterns (if any) are checked second.\n */\nexport function shouldIncludeFile(relPath: string, config: KiroGraphConfig): boolean {\n const excludeMatchers = buildExcludeMatchers(config);\n if (excludeMatchers.some(m => {\n try { return m(relPath) || m(relPath + '/'); } catch { return false; }\n })) return false;\n\n const includeMatcher = buildIncludeMatcher(config);\n if (includeMatcher && !includeMatcher(relPath)) return false;\n\n return true;\n}\n\n/**\n * SHA-256 hex digest of the given content.\n */\nexport function hashContent(content: Buffer | string): string {\n return crypto.createHash('sha256').update(content).digest('hex');\n}\n\n/**\n * Returns absolute paths of all indexable files under root.\n * Handles monorepos with multiple nested git roots by running git ls-files\n * from each sub-repo root independently, then merging results.\n * Falls back to filesystem walk if no git roots found.\n * Respects AbortSignal.\n */\nexport async function scanDirectory(\n root: string,\n config: KiroGraphConfig,\n signal?: AbortSignal\n): Promise<string[]> {\n if (signal?.aborted) return [];\n\n const gitRoots = findGitRoots(root);\n const allFiles: string[] = [];\n\n for (const gitRoot of gitRoots) {\n if (signal?.aborted) return allFiles;\n try {\n const output = execFileSync('git', ['ls-files', '--cached', '--others', '--exclude-standard'], {\n cwd: gitRoot,\n encoding: 'utf8',\n timeout: 10_000,\n stdio: ['ignore', 'pipe', 'ignore'],\n });\n if (signal?.aborted) return allFiles;\n const files = output.split('\\n').filter(Boolean)\n .map(rel => path.join(gitRoot, rel))\n .filter(abs => {\n const rel = path.relative(root, abs).replace(/\\\\/g, '/');\n return shouldIncludeFile(rel, config) && detectLanguage(abs) !== 'unknown';\n });\n allFiles.push(...files);\n } catch {\n // git unavailable for this root \u2014 fall back to walk\n allFiles.push(...scanDirectoryWalk(gitRoot, config, signal));\n }\n }\n\n return allFiles;\n}\n\n/**\n * Classifies git-changed files into added / modified / removed across all nested git roots.\n * Returns absolute paths. Returns empty arrays if git is unavailable.\n * Excludes paths whose detected language is 'unknown'.\n */\nexport async function getChangedFiles(\n root: string,\n config: KiroGraphConfig\n): Promise<{ added: string[]; modified: string[]; removed: string[] }> {\n const added: string[] = [];\n const modified: string[] = [];\n const removed: string[] = [];\n\n const gitRoots = findGitRoots(root);\n\n for (const gitRoot of gitRoots) {\n try {\n const output = execFileSync('git', ['status', '--porcelain', '--no-renames'], {\n cwd: gitRoot,\n encoding: 'utf8',\n timeout: 10_000,\n stdio: ['ignore', 'pipe', 'ignore'],\n });\n\n for (const line of output.split('\\n').filter(Boolean)) {\n const statusCode = line.slice(0, 2);\n const relPath = line.slice(3).trim();\n const absPath = path.join(gitRoot, relPath);\n if (detectLanguage(absPath) === 'unknown') continue;\n if (statusCode === '??') {\n added.push(absPath);\n } else if (statusCode[0] === 'D' || statusCode[1] === 'D') {\n removed.push(absPath);\n } else {\n modified.push(absPath);\n }\n }\n } catch {\n // git unavailable for this root \u2014 skip\n }\n }\n\n return { added, modified, removed };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,WAAsB;AACtB,SAAoB;AACpB,aAAwB;AACxB,2BAA6B;AAC7B,uBAAsB;AAEtB,uBAA+B;AAO/B,SAAS,qBAAqB,QAAqD;AACjF,QAAM,WAAW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