@colbymchenry/codegraph-darwin-x64 0.9.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/bin/codegraph +3 -0
- package/lib/dist/bin/codegraph.d.ts +21 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -0
- package/lib/dist/bin/codegraph.js +1273 -0
- package/lib/dist/bin/codegraph.js.map +1 -0
- package/lib/dist/bin/node-version-check.d.ts +37 -0
- package/lib/dist/bin/node-version-check.d.ts.map +1 -0
- package/lib/dist/bin/node-version-check.js +79 -0
- package/lib/dist/bin/node-version-check.js.map +1 -0
- package/lib/dist/bin/uninstall.d.ts +14 -0
- package/lib/dist/bin/uninstall.d.ts.map +1 -0
- package/lib/dist/bin/uninstall.js +36 -0
- package/lib/dist/bin/uninstall.js.map +1 -0
- package/lib/dist/config.d.ts +51 -0
- package/lib/dist/config.d.ts.map +1 -0
- package/lib/dist/config.js +321 -0
- package/lib/dist/config.js.map +1 -0
- package/lib/dist/context/formatter.d.ts +30 -0
- package/lib/dist/context/formatter.d.ts.map +1 -0
- package/lib/dist/context/formatter.js +244 -0
- package/lib/dist/context/formatter.js.map +1 -0
- package/lib/dist/context/index.d.ts +97 -0
- package/lib/dist/context/index.d.ts.map +1 -0
- package/lib/dist/context/index.js +1050 -0
- package/lib/dist/context/index.js.map +1 -0
- package/lib/dist/db/index.d.ts +83 -0
- package/lib/dist/db/index.d.ts.map +1 -0
- package/lib/dist/db/index.js +219 -0
- package/lib/dist/db/index.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +44 -0
- package/lib/dist/db/migrations.d.ts.map +1 -0
- package/lib/dist/db/migrations.js +131 -0
- package/lib/dist/db/migrations.js.map +1 -0
- package/lib/dist/db/queries.d.ts +253 -0
- package/lib/dist/db/queries.d.ts.map +1 -0
- package/lib/dist/db/queries.js +1207 -0
- package/lib/dist/db/queries.js.map +1 -0
- package/lib/dist/db/schema.sql +151 -0
- package/lib/dist/db/sqlite-adapter.d.ts +46 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/lib/dist/db/sqlite-adapter.js +114 -0
- package/lib/dist/db/sqlite-adapter.js.map +1 -0
- package/lib/dist/directory.d.ts +57 -0
- package/lib/dist/directory.d.ts.map +1 -0
- package/lib/dist/directory.js +264 -0
- package/lib/dist/directory.js.map +1 -0
- package/lib/dist/errors.d.ts +136 -0
- package/lib/dist/errors.d.ts.map +1 -0
- package/lib/dist/errors.js +219 -0
- package/lib/dist/errors.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/dfm-extractor.js +151 -0
- package/lib/dist/extraction/dfm-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +78 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -0
- package/lib/dist/extraction/grammars.js +332 -0
- package/lib/dist/extraction/grammars.js.map +1 -0
- package/lib/dist/extraction/index.d.ts +130 -0
- package/lib/dist/extraction/index.d.ts.map +1 -0
- package/lib/dist/extraction/index.js +1305 -0
- package/lib/dist/extraction/index.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.js +126 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.d.ts +3 -0
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +72 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -0
- package/lib/dist/extraction/languages/dart.d.ts +3 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
- package/lib/dist/extraction/languages/dart.js +192 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -0
- package/lib/dist/extraction/languages/go.d.ts +3 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -0
- package/lib/dist/extraction/languages/go.js +58 -0
- package/lib/dist/extraction/languages/go.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts +10 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -0
- package/lib/dist/extraction/languages/index.js +49 -0
- package/lib/dist/extraction/languages/index.js.map +1 -0
- package/lib/dist/extraction/languages/java.d.ts +3 -0
- package/lib/dist/extraction/languages/java.d.ts.map +1 -0
- package/lib/dist/extraction/languages/java.js +64 -0
- package/lib/dist/extraction/languages/java.js.map +1 -0
- package/lib/dist/extraction/languages/javascript.d.ts +3 -0
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/javascript.js +90 -0
- package/lib/dist/extraction/languages/javascript.js.map +1 -0
- package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/lib/dist/extraction/languages/kotlin.js +253 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -0
- package/lib/dist/extraction/languages/lua.d.ts +3 -0
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
- package/lib/dist/extraction/languages/lua.js +150 -0
- package/lib/dist/extraction/languages/lua.js.map +1 -0
- package/lib/dist/extraction/languages/luau.d.ts +3 -0
- package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
- package/lib/dist/extraction/languages/luau.js +37 -0
- package/lib/dist/extraction/languages/luau.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts +3 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal.js +66 -0
- package/lib/dist/extraction/languages/pascal.js.map +1 -0
- package/lib/dist/extraction/languages/php.d.ts +3 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -0
- package/lib/dist/extraction/languages/php.js +107 -0
- package/lib/dist/extraction/languages/php.js.map +1 -0
- package/lib/dist/extraction/languages/python.d.ts +3 -0
- package/lib/dist/extraction/languages/python.d.ts.map +1 -0
- package/lib/dist/extraction/languages/python.js +56 -0
- package/lib/dist/extraction/languages/python.js.map +1 -0
- package/lib/dist/extraction/languages/ruby.d.ts +3 -0
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/lib/dist/extraction/languages/ruby.js +114 -0
- package/lib/dist/extraction/languages/ruby.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +3 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust.js +109 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -0
- package/lib/dist/extraction/languages/scala.d.ts +3 -0
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
- package/lib/dist/extraction/languages/scala.js +139 -0
- package/lib/dist/extraction/languages/scala.js.map +1 -0
- package/lib/dist/extraction/languages/swift.d.ts +3 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
- package/lib/dist/extraction/languages/swift.js +91 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -0
- package/lib/dist/extraction/languages/typescript.d.ts +3 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/typescript.js +129 -0
- package/lib/dist/extraction/languages/typescript.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +52 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/liquid-extractor.js +313 -0
- package/lib/dist/extraction/liquid-extractor.js.map +1 -0
- package/lib/dist/extraction/parse-worker.d.ts +8 -0
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
- package/lib/dist/extraction/parse-worker.js +94 -0
- package/lib/dist/extraction/parse-worker.js.map +1 -0
- package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/svelte-extractor.js +272 -0
- package/lib/dist/extraction/svelte-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js +103 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.js +10 -0
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +233 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter.js +2425 -0
- package/lib/dist/extraction/tree-sitter.js.map +1 -0
- package/lib/dist/extraction/vue-extractor.d.ts +36 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/vue-extractor.js +163 -0
- package/lib/dist/extraction/vue-extractor.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/graph/index.d.ts +8 -0
- package/lib/dist/graph/index.d.ts.map +1 -0
- package/lib/dist/graph/index.js +13 -0
- package/lib/dist/graph/index.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +106 -0
- package/lib/dist/graph/queries.d.ts.map +1 -0
- package/lib/dist/graph/queries.js +366 -0
- package/lib/dist/graph/queries.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +127 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -0
- package/lib/dist/graph/traversal.js +493 -0
- package/lib/dist/graph/traversal.js.map +1 -0
- package/lib/dist/index.d.ts +453 -0
- package/lib/dist/index.d.ts.map +1 -0
- package/lib/dist/index.js +833 -0
- package/lib/dist/index.js.map +1 -0
- package/lib/dist/installer/claude-md-template.d.ts +14 -0
- package/lib/dist/installer/claude-md-template.d.ts.map +1 -0
- package/lib/dist/installer/claude-md-template.js +21 -0
- package/lib/dist/installer/claude-md-template.js.map +1 -0
- package/lib/dist/installer/config-writer.d.ts +29 -0
- package/lib/dist/installer/config-writer.d.ts.map +1 -0
- package/lib/dist/installer/config-writer.js +111 -0
- package/lib/dist/installer/config-writer.js.map +1 -0
- package/lib/dist/installer/index.d.ts +65 -0
- package/lib/dist/installer/index.d.ts.map +1 -0
- package/lib/dist/installer/index.js +406 -0
- package/lib/dist/installer/index.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +28 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -0
- package/lib/dist/installer/instructions-template.js +64 -0
- package/lib/dist/installer/instructions-template.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +47 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -0
- package/lib/dist/installer/targets/claude.js +401 -0
- package/lib/dist/installer/targets/claude.js.map +1 -0
- package/lib/dist/installer/targets/codex.d.ts +18 -0
- package/lib/dist/installer/targets/codex.d.ts.map +1 -0
- package/lib/dist/installer/targets/codex.js +185 -0
- package/lib/dist/installer/targets/codex.js.map +1 -0
- package/lib/dist/installer/targets/cursor.d.ts +35 -0
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
- package/lib/dist/installer/targets/cursor.js +229 -0
- package/lib/dist/installer/targets/cursor.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts +30 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
- package/lib/dist/installer/targets/opencode.js +235 -0
- package/lib/dist/installer/targets/opencode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts +35 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -0
- package/lib/dist/installer/targets/registry.js +83 -0
- package/lib/dist/installer/targets/registry.js.map +1 -0
- package/lib/dist/installer/targets/shared.d.ts +77 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -0
- package/lib/dist/installer/targets/shared.js +246 -0
- package/lib/dist/installer/targets/shared.js.map +1 -0
- package/lib/dist/installer/targets/toml.d.ts +52 -0
- package/lib/dist/installer/targets/toml.d.ts.map +1 -0
- package/lib/dist/installer/targets/toml.js +147 -0
- package/lib/dist/installer/targets/toml.js.map +1 -0
- package/lib/dist/installer/targets/types.d.ts +116 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -0
- package/lib/dist/installer/targets/types.js +16 -0
- package/lib/dist/installer/targets/types.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +94 -0
- package/lib/dist/mcp/index.d.ts.map +1 -0
- package/lib/dist/mcp/index.js +453 -0
- package/lib/dist/mcp/index.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +19 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
- package/lib/dist/mcp/server-instructions.js +71 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +257 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -0
- package/lib/dist/mcp/tools.js +1646 -0
- package/lib/dist/mcp/tools.js.map +1 -0
- package/lib/dist/mcp/transport.d.ts +106 -0
- package/lib/dist/mcp/transport.d.ts.map +1 -0
- package/lib/dist/mcp/transport.js +233 -0
- package/lib/dist/mcp/transport.js.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.js +213 -0
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts +8 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/express.js +225 -0
- package/lib/dist/resolution/frameworks/express.js.map +1 -0
- package/lib/dist/resolution/frameworks/go.d.ts +8 -0
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/go.js +158 -0
- package/lib/dist/resolution/frameworks/go.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +42 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/index.js +133 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -0
- package/lib/dist/resolution/frameworks/java.d.ts +8 -0
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/java.js +177 -0
- package/lib/dist/resolution/frameworks/java.js.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.js +248 -0
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.js +374 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts +10 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/python.js +278 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +8 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react.js +272 -0
- package/lib/dist/resolution/frameworks/react.js.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.js +198 -0
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
- package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/rust.js +207 -0
- package/lib/dist/resolution/frameworks/rust.js.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.js +249 -0
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/swift.js +376 -0
- package/lib/dist/resolution/frameworks/swift.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue.js +306 -0
- package/lib/dist/resolution/frameworks/vue.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +40 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
- package/lib/dist/resolution/import-resolver.js +663 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -0
- package/lib/dist/resolution/index.d.ts +106 -0
- package/lib/dist/resolution/index.d.ts.map +1 -0
- package/lib/dist/resolution/index.js +709 -0
- package/lib/dist/resolution/index.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +32 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
- package/lib/dist/resolution/name-matcher.js +384 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +68 -0
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/path-aliases.js +238 -0
- package/lib/dist/resolution/path-aliases.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +27 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
- package/lib/dist/resolution/strip-comments.js +441 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +172 -0
- package/lib/dist/resolution/types.d.ts.map +1 -0
- package/lib/dist/resolution/types.js +8 -0
- package/lib/dist/resolution/types.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts +57 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -0
- package/lib/dist/search/query-parser.js +177 -0
- package/lib/dist/search/query-parser.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +53 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -0
- package/lib/dist/search/query-utils.js +350 -0
- package/lib/dist/search/query-utils.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts +45 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -0
- package/lib/dist/sync/git-hooks.js +223 -0
- package/lib/dist/sync/git-hooks.js.map +1 -0
- package/lib/dist/sync/index.d.ts +17 -0
- package/lib/dist/sync/index.d.ts.map +1 -0
- package/lib/dist/sync/index.js +28 -0
- package/lib/dist/sync/index.js.map +1 -0
- package/lib/dist/sync/watch-policy.d.ts +48 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -0
- package/lib/dist/sync/watch-policy.js +124 -0
- package/lib/dist/sync/watch-policy.js.map +1 -0
- package/lib/dist/sync/watcher.d.ts +81 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -0
- package/lib/dist/sync/watcher.js +194 -0
- package/lib/dist/sync/watcher.js.map +1 -0
- package/lib/dist/types.d.ts +423 -0
- package/lib/dist/types.d.ts.map +1 -0
- package/lib/dist/types.js +262 -0
- package/lib/dist/types.js.map +1 -0
- package/lib/dist/ui/glyphs.d.ts +42 -0
- package/lib/dist/ui/glyphs.d.ts.map +1 -0
- package/lib/dist/ui/glyphs.js +78 -0
- package/lib/dist/ui/glyphs.js.map +1 -0
- package/lib/dist/ui/shimmer-progress.d.ts +11 -0
- package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-progress.js +90 -0
- package/lib/dist/ui/shimmer-progress.js.map +1 -0
- package/lib/dist/ui/shimmer-worker.d.ts +2 -0
- package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-worker.js +118 -0
- package/lib/dist/ui/shimmer-worker.js.map +1 -0
- package/lib/dist/ui/types.d.ts +17 -0
- package/lib/dist/ui/types.d.ts.map +1 -0
- package/lib/dist/ui/types.js +3 -0
- package/lib/dist/ui/types.js.map +1 -0
- package/lib/dist/utils.d.ts +205 -0
- package/lib/dist/utils.d.ts.map +1 -0
- package/lib/dist/utils.js +549 -0
- package/lib/dist/utils.js.map +1 -0
- package/lib/node_modules/.package-lock.json +116 -0
- package/lib/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/lib/node_modules/@clack/core/LICENSE +9 -0
- package/lib/node_modules/@clack/core/README.md +22 -0
- package/lib/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/lib/node_modules/@clack/core/dist/index.mjs +17 -0
- package/lib/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/core/package.json +63 -0
- package/lib/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/lib/node_modules/@clack/prompts/LICENSE +9 -0
- package/lib/node_modules/@clack/prompts/README.md +375 -0
- package/lib/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/prompts/package.json +68 -0
- package/lib/node_modules/commander/LICENSE +22 -0
- package/lib/node_modules/commander/Readme.md +1176 -0
- package/lib/node_modules/commander/esm.mjs +16 -0
- package/lib/node_modules/commander/index.js +24 -0
- package/lib/node_modules/commander/lib/argument.js +150 -0
- package/lib/node_modules/commander/lib/command.js +2777 -0
- package/lib/node_modules/commander/lib/error.js +39 -0
- package/lib/node_modules/commander/lib/help.js +747 -0
- package/lib/node_modules/commander/lib/option.js +380 -0
- package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/lib/node_modules/commander/package-support.json +19 -0
- package/lib/node_modules/commander/package.json +82 -0
- package/lib/node_modules/commander/typings/esm.d.mts +3 -0
- package/lib/node_modules/commander/typings/index.d.ts +1113 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/lib/node_modules/fast-string-truncated-width/license +21 -0
- package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
- package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-width/dist/index.js +14 -0
- package/lib/node_modules/fast-string-width/license +21 -0
- package/lib/node_modules/fast-string-width/package.json +34 -0
- package/lib/node_modules/fast-string-width/readme.md +42 -0
- package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/lib/node_modules/jsonc-parser/README.md +364 -0
- package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/lib/node_modules/jsonc-parser/package.json +37 -0
- package/lib/node_modules/picomatch/LICENSE +21 -0
- package/lib/node_modules/picomatch/README.md +738 -0
- package/lib/node_modules/picomatch/index.js +17 -0
- package/lib/node_modules/picomatch/lib/constants.js +180 -0
- package/lib/node_modules/picomatch/lib/parse.js +1085 -0
- package/lib/node_modules/picomatch/lib/picomatch.js +341 -0
- package/lib/node_modules/picomatch/lib/scan.js +391 -0
- package/lib/node_modules/picomatch/lib/utils.js +72 -0
- package/lib/node_modules/picomatch/package.json +83 -0
- package/lib/node_modules/picomatch/posix.js +3 -0
- package/lib/node_modules/sisteransi/license +21 -0
- package/lib/node_modules/sisteransi/package.json +34 -0
- package/lib/node_modules/sisteransi/readme.md +113 -0
- package/lib/node_modules/sisteransi/src/index.js +58 -0
- package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
- package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
- package/lib/node_modules/web-tree-sitter/README.md +269 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
- package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
- package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
- package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
- package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
- package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
- package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
- package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
- package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
- package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
- package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
- package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
- package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
- package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
- package/lib/node_modules/web-tree-sitter/package.json +98 -0
- package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
- package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
- package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
- package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
- package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
- package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
- package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
- package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
- package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
- package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
- package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
- package/lib/package.json +55 -0
- package/node +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Directory Management
|
|
4
|
+
*
|
|
5
|
+
* Manages the .codegraph/ directory structure for CodeGraph data.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.CODEGRAPH_DIR = void 0;
|
|
42
|
+
exports.getCodeGraphDir = getCodeGraphDir;
|
|
43
|
+
exports.isInitialized = isInitialized;
|
|
44
|
+
exports.findNearestCodeGraphRoot = findNearestCodeGraphRoot;
|
|
45
|
+
exports.createDirectory = createDirectory;
|
|
46
|
+
exports.removeDirectory = removeDirectory;
|
|
47
|
+
exports.listDirectoryContents = listDirectoryContents;
|
|
48
|
+
exports.getDirectorySize = getDirectorySize;
|
|
49
|
+
exports.ensureSubdirectory = ensureSubdirectory;
|
|
50
|
+
exports.validateDirectory = validateDirectory;
|
|
51
|
+
const fs = __importStar(require("fs"));
|
|
52
|
+
const path = __importStar(require("path"));
|
|
53
|
+
/**
|
|
54
|
+
* CodeGraph directory name
|
|
55
|
+
*/
|
|
56
|
+
exports.CODEGRAPH_DIR = '.codegraph';
|
|
57
|
+
/**
|
|
58
|
+
* Get the .codegraph directory path for a project
|
|
59
|
+
*/
|
|
60
|
+
function getCodeGraphDir(projectRoot) {
|
|
61
|
+
return path.join(projectRoot, exports.CODEGRAPH_DIR);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a project has been initialized with CodeGraph
|
|
65
|
+
* Requires both .codegraph/ directory AND codegraph.db to exist
|
|
66
|
+
*/
|
|
67
|
+
function isInitialized(projectRoot) {
|
|
68
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
69
|
+
if (!fs.existsSync(codegraphDir) || !fs.statSync(codegraphDir).isDirectory()) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
// Must have codegraph.db, not just .codegraph folder
|
|
73
|
+
const dbPath = path.join(codegraphDir, 'codegraph.db');
|
|
74
|
+
return fs.existsSync(dbPath);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Find the nearest parent directory containing .codegraph/
|
|
78
|
+
*
|
|
79
|
+
* Walks up from the given path to find a CodeGraph-initialized project,
|
|
80
|
+
* similar to how git finds .git/ directories.
|
|
81
|
+
*
|
|
82
|
+
* @param startPath - Directory to start searching from
|
|
83
|
+
* @returns The project root containing .codegraph/, or null if not found
|
|
84
|
+
*/
|
|
85
|
+
function findNearestCodeGraphRoot(startPath) {
|
|
86
|
+
let current = path.resolve(startPath);
|
|
87
|
+
const root = path.parse(current).root;
|
|
88
|
+
while (current !== root) {
|
|
89
|
+
if (isInitialized(current)) {
|
|
90
|
+
return current;
|
|
91
|
+
}
|
|
92
|
+
const parent = path.dirname(current);
|
|
93
|
+
if (parent === current)
|
|
94
|
+
break; // Reached filesystem root
|
|
95
|
+
current = parent;
|
|
96
|
+
}
|
|
97
|
+
// Check root as well
|
|
98
|
+
if (isInitialized(current)) {
|
|
99
|
+
return current;
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create the .codegraph directory structure
|
|
105
|
+
* Note: Only throws if codegraph.db already exists, not just if .codegraph/ exists.
|
|
106
|
+
*/
|
|
107
|
+
function createDirectory(projectRoot) {
|
|
108
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
109
|
+
const dbPath = path.join(codegraphDir, 'codegraph.db');
|
|
110
|
+
// Only throw if CodeGraph is actually initialized (db exists)
|
|
111
|
+
// .codegraph/ folder alone is fine
|
|
112
|
+
if (fs.existsSync(dbPath)) {
|
|
113
|
+
throw new Error(`CodeGraph already initialized in ${projectRoot}`);
|
|
114
|
+
}
|
|
115
|
+
// Create main directory (if it doesn't exist)
|
|
116
|
+
fs.mkdirSync(codegraphDir, { recursive: true });
|
|
117
|
+
// Create .gitignore inside .codegraph (if it doesn't exist)
|
|
118
|
+
const gitignorePath = path.join(codegraphDir, '.gitignore');
|
|
119
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
120
|
+
const gitignoreContent = `# CodeGraph data files
|
|
121
|
+
# These are local to each machine and should not be committed
|
|
122
|
+
|
|
123
|
+
# Database
|
|
124
|
+
*.db
|
|
125
|
+
*.db-wal
|
|
126
|
+
*.db-shm
|
|
127
|
+
|
|
128
|
+
# Cache
|
|
129
|
+
cache/
|
|
130
|
+
|
|
131
|
+
# Logs
|
|
132
|
+
*.log
|
|
133
|
+
|
|
134
|
+
# Hook markers
|
|
135
|
+
.dirty
|
|
136
|
+
`;
|
|
137
|
+
fs.writeFileSync(gitignorePath, gitignoreContent, 'utf-8');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Remove the .codegraph directory
|
|
142
|
+
*/
|
|
143
|
+
function removeDirectory(projectRoot) {
|
|
144
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
145
|
+
if (!fs.existsSync(codegraphDir)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
// Verify .codegraph is a real directory, not a symlink pointing elsewhere
|
|
149
|
+
const lstat = fs.lstatSync(codegraphDir);
|
|
150
|
+
if (lstat.isSymbolicLink()) {
|
|
151
|
+
// Only remove the symlink itself, never follow it for recursive delete
|
|
152
|
+
fs.unlinkSync(codegraphDir);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (!lstat.isDirectory()) {
|
|
156
|
+
// Not a directory - remove the single file
|
|
157
|
+
fs.unlinkSync(codegraphDir);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Recursively remove directory
|
|
161
|
+
fs.rmSync(codegraphDir, { recursive: true, force: true });
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get all files in the .codegraph directory
|
|
165
|
+
*/
|
|
166
|
+
function listDirectoryContents(projectRoot) {
|
|
167
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
168
|
+
if (!fs.existsSync(codegraphDir)) {
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
const files = [];
|
|
172
|
+
function walkDir(dir, prefix = '') {
|
|
173
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
174
|
+
for (const entry of entries) {
|
|
175
|
+
const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
176
|
+
// Skip symlinks to prevent following links outside .codegraph
|
|
177
|
+
if (entry.isSymbolicLink()) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (entry.isDirectory()) {
|
|
181
|
+
walkDir(path.join(dir, entry.name), relativePath);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
files.push(relativePath);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
walkDir(codegraphDir);
|
|
189
|
+
return files;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Get the total size of the .codegraph directory in bytes
|
|
193
|
+
*/
|
|
194
|
+
function getDirectorySize(projectRoot) {
|
|
195
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
196
|
+
if (!fs.existsSync(codegraphDir)) {
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
let totalSize = 0;
|
|
200
|
+
function walkDir(dir) {
|
|
201
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
202
|
+
for (const entry of entries) {
|
|
203
|
+
// Skip symlinks to prevent following links outside .codegraph
|
|
204
|
+
if (entry.isSymbolicLink()) {
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const fullPath = path.join(dir, entry.name);
|
|
208
|
+
if (entry.isDirectory()) {
|
|
209
|
+
walkDir(fullPath);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
const stats = fs.statSync(fullPath);
|
|
213
|
+
totalSize += stats.size;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
walkDir(codegraphDir);
|
|
218
|
+
return totalSize;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Ensure a subdirectory exists within .codegraph
|
|
222
|
+
*/
|
|
223
|
+
function ensureSubdirectory(projectRoot, subdirName) {
|
|
224
|
+
if (subdirName.includes('..') || subdirName.includes(path.sep) || subdirName.includes('/')) {
|
|
225
|
+
throw new Error(`Invalid subdirectory name: ${subdirName}`);
|
|
226
|
+
}
|
|
227
|
+
const subdirPath = path.join(getCodeGraphDir(projectRoot), subdirName);
|
|
228
|
+
if (!fs.existsSync(subdirPath)) {
|
|
229
|
+
fs.mkdirSync(subdirPath, { recursive: true });
|
|
230
|
+
}
|
|
231
|
+
return subdirPath;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Check if the .codegraph directory has valid structure
|
|
235
|
+
*/
|
|
236
|
+
function validateDirectory(projectRoot) {
|
|
237
|
+
const errors = [];
|
|
238
|
+
const codegraphDir = getCodeGraphDir(projectRoot);
|
|
239
|
+
if (!fs.existsSync(codegraphDir)) {
|
|
240
|
+
errors.push('CodeGraph directory does not exist');
|
|
241
|
+
return { valid: false, errors };
|
|
242
|
+
}
|
|
243
|
+
if (!fs.statSync(codegraphDir).isDirectory()) {
|
|
244
|
+
errors.push('.codegraph exists but is not a directory');
|
|
245
|
+
return { valid: false, errors };
|
|
246
|
+
}
|
|
247
|
+
// Auto-repair missing .gitignore (non-critical file)
|
|
248
|
+
const gitignorePath = path.join(codegraphDir, '.gitignore');
|
|
249
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
250
|
+
try {
|
|
251
|
+
const gitignoreContent = `# CodeGraph data files\n# These are local to each machine and should not be committed\n\n# Database\n*.db\n*.db-wal\n*.db-shm\n\n# Cache\ncache/\n\n# Logs\n*.log\n\n# Hook markers\n.dirty\n`;
|
|
252
|
+
fs.writeFileSync(gitignorePath, gitignoreContent, 'utf-8');
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
// Non-fatal: warn but don't block
|
|
256
|
+
errors.push('.gitignore missing in .codegraph directory and could not be created');
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
valid: errors.length === 0,
|
|
261
|
+
errors,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=directory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaH,0CAEC;AAMD,sCAQC;AAWD,4DAmBC;AAMD,0CAoCC;AAKD,0CAuBC;AAKD,sDA8BC;AAKD,4CA+BC;AAKD,gDAYC;AAKD,8CAiCC;AA7PD,uCAAyB;AACzB,2CAA6B;AAE7B;;GAEG;AACU,QAA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AC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeGraph Error Classes
|
|
3
|
+
*
|
|
4
|
+
* Custom error types for better error handling and debugging.
|
|
5
|
+
*
|
|
6
|
+
* @module errors
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { FileError, ParseError, setLogger, silentLogger } from 'codegraph';
|
|
11
|
+
*
|
|
12
|
+
* // Catch specific error types
|
|
13
|
+
* try {
|
|
14
|
+
* await cg.indexAll();
|
|
15
|
+
* } catch (error) {
|
|
16
|
+
* if (error instanceof FileError) {
|
|
17
|
+
* console.log(`File error at ${error.filePath}: ${error.message}`);
|
|
18
|
+
* } else if (error instanceof ParseError) {
|
|
19
|
+
* console.log(`Parse error at ${error.filePath}:${error.line}`);
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* // Disable logging for tests
|
|
24
|
+
* setLogger(silentLogger);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Base error class for all CodeGraph errors.
|
|
29
|
+
*
|
|
30
|
+
* All CodeGraph-specific errors extend this class, allowing you to catch
|
|
31
|
+
* all CodeGraph errors with a single catch block.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* try {
|
|
36
|
+
* await cg.indexAll();
|
|
37
|
+
* } catch (error) {
|
|
38
|
+
* if (error instanceof CodeGraphError) {
|
|
39
|
+
* console.log(`CodeGraph error [${error.code}]: ${error.message}`);
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class CodeGraphError extends Error {
|
|
45
|
+
/** Error code for categorization (e.g., 'FILE_ERROR', 'PARSE_ERROR') */
|
|
46
|
+
readonly code: string;
|
|
47
|
+
/** Additional context about the error */
|
|
48
|
+
readonly context?: Record<string, unknown>;
|
|
49
|
+
constructor(message: string, code: string, context?: Record<string, unknown>);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Error reading or accessing files
|
|
53
|
+
*/
|
|
54
|
+
export declare class FileError extends CodeGraphError {
|
|
55
|
+
readonly filePath: string;
|
|
56
|
+
constructor(message: string, filePath: string, cause?: Error);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Error parsing source code
|
|
60
|
+
*/
|
|
61
|
+
export declare class ParseError extends CodeGraphError {
|
|
62
|
+
readonly filePath: string;
|
|
63
|
+
readonly line?: number;
|
|
64
|
+
readonly column?: number;
|
|
65
|
+
constructor(message: string, filePath: string, options?: {
|
|
66
|
+
line?: number;
|
|
67
|
+
column?: number;
|
|
68
|
+
cause?: Error;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Error with database operations
|
|
73
|
+
*/
|
|
74
|
+
export declare class DatabaseError extends CodeGraphError {
|
|
75
|
+
readonly operation: string;
|
|
76
|
+
constructor(message: string, operation: string, cause?: Error);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Error with search operations
|
|
80
|
+
*/
|
|
81
|
+
export declare class SearchError extends CodeGraphError {
|
|
82
|
+
readonly query: string;
|
|
83
|
+
constructor(message: string, query: string, cause?: Error);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Error with vector/embedding operations
|
|
87
|
+
*/
|
|
88
|
+
export declare class VectorError extends CodeGraphError {
|
|
89
|
+
constructor(message: string, operation: string, cause?: Error);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Error with configuration
|
|
93
|
+
*/
|
|
94
|
+
export declare class ConfigError extends CodeGraphError {
|
|
95
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Simple logger for CodeGraph operations
|
|
99
|
+
*
|
|
100
|
+
* By default, logs to console.warn for warnings and console.error for errors.
|
|
101
|
+
* Can be configured to use custom logging.
|
|
102
|
+
*/
|
|
103
|
+
export interface Logger {
|
|
104
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
105
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
106
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Default console-based logger
|
|
110
|
+
*/
|
|
111
|
+
export declare const defaultLogger: Logger;
|
|
112
|
+
/**
|
|
113
|
+
* Silent logger (no output) - useful for tests
|
|
114
|
+
*/
|
|
115
|
+
export declare const silentLogger: Logger;
|
|
116
|
+
/**
|
|
117
|
+
* Set the global logger
|
|
118
|
+
*/
|
|
119
|
+
export declare function setLogger(logger: Logger): void;
|
|
120
|
+
/**
|
|
121
|
+
* Get the current logger
|
|
122
|
+
*/
|
|
123
|
+
export declare function getLogger(): Logger;
|
|
124
|
+
/**
|
|
125
|
+
* Log a debug message
|
|
126
|
+
*/
|
|
127
|
+
export declare function logDebug(message: string, context?: Record<string, unknown>): void;
|
|
128
|
+
/**
|
|
129
|
+
* Log a warning message
|
|
130
|
+
*/
|
|
131
|
+
export declare function logWarn(message: string, context?: Record<string, unknown>): void;
|
|
132
|
+
/**
|
|
133
|
+
* Log an error message
|
|
134
|
+
*/
|
|
135
|
+
export declare function logError(message: string, context?: Record<string, unknown>): void;
|
|
136
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,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error types for better error handling and debugging.
|
|
6
|
+
*
|
|
7
|
+
* @module errors
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { FileError, ParseError, setLogger, silentLogger } from 'codegraph';
|
|
12
|
+
*
|
|
13
|
+
* // Catch specific error types
|
|
14
|
+
* try {
|
|
15
|
+
* await cg.indexAll();
|
|
16
|
+
* } catch (error) {
|
|
17
|
+
* if (error instanceof FileError) {
|
|
18
|
+
* console.log(`File error at ${error.filePath}: ${error.message}`);
|
|
19
|
+
* } else if (error instanceof ParseError) {
|
|
20
|
+
* console.log(`Parse error at ${error.filePath}:${error.line}`);
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* // Disable logging for tests
|
|
25
|
+
* setLogger(silentLogger);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.silentLogger = exports.defaultLogger = exports.ConfigError = exports.VectorError = exports.SearchError = exports.DatabaseError = exports.ParseError = exports.FileError = exports.CodeGraphError = void 0;
|
|
30
|
+
exports.setLogger = setLogger;
|
|
31
|
+
exports.getLogger = getLogger;
|
|
32
|
+
exports.logDebug = logDebug;
|
|
33
|
+
exports.logWarn = logWarn;
|
|
34
|
+
exports.logError = logError;
|
|
35
|
+
/**
|
|
36
|
+
* Base error class for all CodeGraph errors.
|
|
37
|
+
*
|
|
38
|
+
* All CodeGraph-specific errors extend this class, allowing you to catch
|
|
39
|
+
* all CodeGraph errors with a single catch block.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* try {
|
|
44
|
+
* await cg.indexAll();
|
|
45
|
+
* } catch (error) {
|
|
46
|
+
* if (error instanceof CodeGraphError) {
|
|
47
|
+
* console.log(`CodeGraph error [${error.code}]: ${error.message}`);
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
class CodeGraphError extends Error {
|
|
53
|
+
/** Error code for categorization (e.g., 'FILE_ERROR', 'PARSE_ERROR') */
|
|
54
|
+
code;
|
|
55
|
+
/** Additional context about the error */
|
|
56
|
+
context;
|
|
57
|
+
constructor(message, code, context) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.name = 'CodeGraphError';
|
|
60
|
+
this.code = code;
|
|
61
|
+
this.context = context;
|
|
62
|
+
// Maintain proper stack trace for V8
|
|
63
|
+
if (Error.captureStackTrace) {
|
|
64
|
+
Error.captureStackTrace(this, this.constructor);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.CodeGraphError = CodeGraphError;
|
|
69
|
+
/**
|
|
70
|
+
* Error reading or accessing files
|
|
71
|
+
*/
|
|
72
|
+
class FileError extends CodeGraphError {
|
|
73
|
+
filePath;
|
|
74
|
+
constructor(message, filePath, cause) {
|
|
75
|
+
super(message, 'FILE_ERROR', { filePath, cause: cause?.message });
|
|
76
|
+
this.name = 'FileError';
|
|
77
|
+
this.filePath = filePath;
|
|
78
|
+
if (cause) {
|
|
79
|
+
this.cause = cause;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.FileError = FileError;
|
|
84
|
+
/**
|
|
85
|
+
* Error parsing source code
|
|
86
|
+
*/
|
|
87
|
+
class ParseError extends CodeGraphError {
|
|
88
|
+
filePath;
|
|
89
|
+
line;
|
|
90
|
+
column;
|
|
91
|
+
constructor(message, filePath, options) {
|
|
92
|
+
super(message, 'PARSE_ERROR', {
|
|
93
|
+
filePath,
|
|
94
|
+
line: options?.line,
|
|
95
|
+
column: options?.column,
|
|
96
|
+
cause: options?.cause?.message,
|
|
97
|
+
});
|
|
98
|
+
this.name = 'ParseError';
|
|
99
|
+
this.filePath = filePath;
|
|
100
|
+
this.line = options?.line;
|
|
101
|
+
this.column = options?.column;
|
|
102
|
+
if (options?.cause) {
|
|
103
|
+
this.cause = options.cause;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.ParseError = ParseError;
|
|
108
|
+
/**
|
|
109
|
+
* Error with database operations
|
|
110
|
+
*/
|
|
111
|
+
class DatabaseError extends CodeGraphError {
|
|
112
|
+
operation;
|
|
113
|
+
constructor(message, operation, cause) {
|
|
114
|
+
super(message, 'DATABASE_ERROR', { operation, cause: cause?.message });
|
|
115
|
+
this.name = 'DatabaseError';
|
|
116
|
+
this.operation = operation;
|
|
117
|
+
if (cause) {
|
|
118
|
+
this.cause = cause;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.DatabaseError = DatabaseError;
|
|
123
|
+
/**
|
|
124
|
+
* Error with search operations
|
|
125
|
+
*/
|
|
126
|
+
class SearchError extends CodeGraphError {
|
|
127
|
+
query;
|
|
128
|
+
constructor(message, query, cause) {
|
|
129
|
+
super(message, 'SEARCH_ERROR', { query, cause: cause?.message });
|
|
130
|
+
this.name = 'SearchError';
|
|
131
|
+
this.query = query;
|
|
132
|
+
if (cause) {
|
|
133
|
+
this.cause = cause;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.SearchError = SearchError;
|
|
138
|
+
/**
|
|
139
|
+
* Error with vector/embedding operations
|
|
140
|
+
*/
|
|
141
|
+
class VectorError extends CodeGraphError {
|
|
142
|
+
constructor(message, operation, cause) {
|
|
143
|
+
super(message, 'VECTOR_ERROR', { operation, cause: cause?.message });
|
|
144
|
+
this.name = 'VectorError';
|
|
145
|
+
if (cause) {
|
|
146
|
+
this.cause = cause;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.VectorError = VectorError;
|
|
151
|
+
/**
|
|
152
|
+
* Error with configuration
|
|
153
|
+
*/
|
|
154
|
+
class ConfigError extends CodeGraphError {
|
|
155
|
+
constructor(message, details) {
|
|
156
|
+
super(message, 'CONFIG_ERROR', details);
|
|
157
|
+
this.name = 'ConfigError';
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.ConfigError = ConfigError;
|
|
161
|
+
/**
|
|
162
|
+
* Default console-based logger
|
|
163
|
+
*/
|
|
164
|
+
exports.defaultLogger = {
|
|
165
|
+
debug(message, context) {
|
|
166
|
+
if (process.env.CODEGRAPH_DEBUG) {
|
|
167
|
+
console.debug(`[CodeGraph] ${message}`, context ?? '');
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
warn(message, context) {
|
|
171
|
+
console.warn(`[CodeGraph] ${message}`, context ?? '');
|
|
172
|
+
},
|
|
173
|
+
error(message, context) {
|
|
174
|
+
console.error(`[CodeGraph] ${message}`, context ?? '');
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Silent logger (no output) - useful for tests
|
|
179
|
+
*/
|
|
180
|
+
exports.silentLogger = {
|
|
181
|
+
debug() { },
|
|
182
|
+
warn() { },
|
|
183
|
+
error() { },
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Current logger instance (can be replaced)
|
|
187
|
+
*/
|
|
188
|
+
let currentLogger = exports.defaultLogger;
|
|
189
|
+
/**
|
|
190
|
+
* Set the global logger
|
|
191
|
+
*/
|
|
192
|
+
function setLogger(logger) {
|
|
193
|
+
currentLogger = logger;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Get the current logger
|
|
197
|
+
*/
|
|
198
|
+
function getLogger() {
|
|
199
|
+
return currentLogger;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Log a debug message
|
|
203
|
+
*/
|
|
204
|
+
function logDebug(message, context) {
|
|
205
|
+
currentLogger.debug(message, context);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Log a warning message
|
|
209
|
+
*/
|
|
210
|
+
function logWarn(message, context) {
|
|
211
|
+
currentLogger.warn(message, context);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Log an error message
|
|
215
|
+
*/
|
|
216
|
+
function logError(message, context) {
|
|
217
|
+
currentLogger.error(message, context);
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAwLH,8BAEC;AAKD,8BAEC;AAKD,4BAEC;AAKD,0BAEC;AAKD,4BAEC;AApND;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,cAAe,SAAQ,KAAK;IACvC,wEAAwE;IAC/D,IAAI,CAAS;IACtB,yCAAyC;IAChC,OAAO,CAA2B;IAE3C,YAAY,OAAe,EAAE,IAAY,EAAE,OAAiC;QAC1E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,qCAAqC;QACrC,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAjBD,wCAiBC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,cAAc;IAClC,QAAQ,CAAS;IAE1B,YAAY,OAAe,EAAE,QAAgB,EAAE,KAAa;QAC1D,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;IACH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OAAe,EAAE,OAAiC;QACtD,OAAO,CAAC,KAAK,CAAC,eAAe,OAAO,EAAE,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,YAAY,GAAW;IAClC,KAAK,KAAU,CAAC;IAChB,IAAI,KAAU,CAAC;IACf,KAAK,KAAU,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,IAAI,aAAa,GAAW,qBAAa,CAAC;AAE1C;;GAEG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,aAAa,GAAG,MAAM,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS;IACvB,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,OAAiC;IACzE,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,OAAe,EAAE,OAAiC;IACxE,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,OAAe,EAAE,OAAiC;IACzE,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ExtractionResult } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom extractor for Delphi DFM/FMX form files.
|
|
4
|
+
*
|
|
5
|
+
* DFM/FMX files describe the visual component hierarchy and event handler
|
|
6
|
+
* bindings. They use a simple text format (object/end blocks) that we parse
|
|
7
|
+
* with regex — no tree-sitter grammar exists for this format.
|
|
8
|
+
*
|
|
9
|
+
* Extracted information:
|
|
10
|
+
* - Components as NodeKind `component`
|
|
11
|
+
* - Nesting as EdgeKind `contains`
|
|
12
|
+
* - Event handlers (OnClick = MethodName) as UnresolvedReference → EdgeKind `references`
|
|
13
|
+
*/
|
|
14
|
+
export declare class DfmExtractor {
|
|
15
|
+
private filePath;
|
|
16
|
+
private source;
|
|
17
|
+
private nodes;
|
|
18
|
+
private edges;
|
|
19
|
+
private unresolvedReferences;
|
|
20
|
+
private errors;
|
|
21
|
+
constructor(filePath: string, source: string);
|
|
22
|
+
/**
|
|
23
|
+
* Extract components and event handler references from DFM/FMX source
|
|
24
|
+
*/
|
|
25
|
+
extract(): ExtractionResult;
|
|
26
|
+
/** Create a file node for the DFM form file */
|
|
27
|
+
private createFileNode;
|
|
28
|
+
/** Parse object/end blocks and extract components + event handlers */
|
|
29
|
+
private parseComponents;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=dfm-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dfm-extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/dfm-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,gBAAgB,EAAwC,MAAM,UAAU,CAAC;AAG9F;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,MAAM,CAAyB;gBAE3B,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK5C;;OAEG;IACH,OAAO,IAAI,gBAAgB;IAuB3B,+CAA+C;IAC/C,OAAO,CAAC,cAAc;IAsBtB,sEAAsE;IACtE,OAAO,CAAC,eAAe;CAgFxB"}
|