@kkvcrobatz107/codegraph 0.9.6-pkm.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/LICENSE +21 -0
- package/README.md +595 -0
- package/dist/bin/codegraph.d.ts +25 -0
- package/dist/bin/codegraph.d.ts.map +1 -0
- package/dist/bin/codegraph.js +1563 -0
- package/dist/bin/codegraph.js.map +1 -0
- package/dist/bin/node-version-check.d.ts +37 -0
- package/dist/bin/node-version-check.d.ts.map +1 -0
- package/dist/bin/node-version-check.js +79 -0
- package/dist/bin/node-version-check.js.map +1 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/bin/uninstall.d.ts.map +1 -0
- package/dist/bin/uninstall.js +36 -0
- package/dist/bin/uninstall.js.map +1 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/formatter.d.ts.map +1 -0
- package/dist/context/formatter.js +244 -0
- package/dist/context/formatter.js.map +1 -0
- package/dist/context/index.d.ts +110 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +1169 -0
- package/dist/context/index.js.map +1 -0
- package/dist/db/index.d.ts +101 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +251 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +44 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +131 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/queries.d.ts +281 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +1300 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.sql +151 -0
- package/dist/db/sqlite-adapter.d.ts +46 -0
- package/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/dist/db/sqlite-adapter.js +114 -0
- package/dist/db/sqlite-adapter.js.map +1 -0
- package/dist/directory.d.ts +57 -0
- package/dist/directory.d.ts.map +1 -0
- package/dist/directory.js +264 -0
- package/dist/directory.js.map +1 -0
- package/dist/errors.d.ts +136 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +219 -0
- package/dist/errors.js.map +1 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/dist/extraction/dfm-extractor.js +151 -0
- package/dist/extraction/dfm-extractor.js.map +1 -0
- package/dist/extraction/grammars.d.ts +90 -0
- package/dist/extraction/grammars.d.ts.map +1 -0
- package/dist/extraction/grammars.js +407 -0
- package/dist/extraction/grammars.js.map +1 -0
- package/dist/extraction/index.d.ts +138 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +1378 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/dist/extraction/languages/c-cpp.js +171 -0
- package/dist/extraction/languages/c-cpp.js.map +1 -0
- package/dist/extraction/languages/csharp.d.ts +3 -0
- package/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/dist/extraction/languages/csharp.js +73 -0
- package/dist/extraction/languages/csharp.js.map +1 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/dart.d.ts.map +1 -0
- package/dist/extraction/languages/dart.js +192 -0
- package/dist/extraction/languages/dart.js.map +1 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts.map +1 -0
- package/dist/extraction/languages/go.js +70 -0
- package/dist/extraction/languages/go.js.map +1 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/index.d.ts.map +1 -0
- package/dist/extraction/languages/index.js +51 -0
- package/dist/extraction/languages/index.js.map +1 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/java.d.ts.map +1 -0
- package/dist/extraction/languages/java.js +70 -0
- package/dist/extraction/languages/java.js.map +1 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/dist/extraction/languages/javascript.js +90 -0
- package/dist/extraction/languages/javascript.js.map +1 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/dist/extraction/languages/kotlin.js +259 -0
- package/dist/extraction/languages/kotlin.js.map +1 -0
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts.map +1 -0
- package/dist/extraction/languages/lua.js +150 -0
- package/dist/extraction/languages/lua.js.map +1 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts.map +1 -0
- package/dist/extraction/languages/luau.js +37 -0
- package/dist/extraction/languages/luau.js.map +1 -0
- package/dist/extraction/languages/objc.d.ts +3 -0
- package/dist/extraction/languages/objc.d.ts.map +1 -0
- package/dist/extraction/languages/objc.js +133 -0
- package/dist/extraction/languages/objc.js.map +1 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/dist/extraction/languages/pascal.js +66 -0
- package/dist/extraction/languages/pascal.js.map +1 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts.map +1 -0
- package/dist/extraction/languages/php.js +107 -0
- package/dist/extraction/languages/php.js.map +1 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts.map +1 -0
- package/dist/extraction/languages/python.js +56 -0
- package/dist/extraction/languages/python.js.map +1 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/dist/extraction/languages/ruby.js +114 -0
- package/dist/extraction/languages/ruby.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -0
- package/dist/extraction/languages/rust.js +109 -0
- package/dist/extraction/languages/rust.js.map +1 -0
- package/dist/extraction/languages/scala.d.ts +3 -0
- package/dist/extraction/languages/scala.d.ts.map +1 -0
- package/dist/extraction/languages/scala.js +139 -0
- package/dist/extraction/languages/scala.js.map +1 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts.map +1 -0
- package/dist/extraction/languages/swift.js +91 -0
- package/dist/extraction/languages/swift.js.map +1 -0
- package/dist/extraction/languages/typescript.d.ts +3 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/dist/extraction/languages/typescript.js +129 -0
- package/dist/extraction/languages/typescript.js.map +1 -0
- package/dist/extraction/liquid-extractor.d.ts +52 -0
- package/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/dist/extraction/liquid-extractor.js +313 -0
- package/dist/extraction/liquid-extractor.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +48 -0
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
- package/dist/extraction/mybatis-extractor.js +198 -0
- package/dist/extraction/mybatis-extractor.js.map +1 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/parse-worker.d.ts.map +1 -0
- package/dist/extraction/parse-worker.js +94 -0
- package/dist/extraction/parse-worker.js.map +1 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/dist/extraction/svelte-extractor.js +272 -0
- package/dist/extraction/svelte-extractor.js.map +1 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-helpers.js +103 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/dist/extraction/tree-sitter-types.d.ts +193 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/dist/extraction/tree-sitter-types.js +10 -0
- package/dist/extraction/tree-sitter-types.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts +291 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/dist/extraction/tree-sitter.js +2961 -0
- package/dist/extraction/tree-sitter.js.map +1 -0
- package/dist/extraction/vue-extractor.d.ts +36 -0
- package/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/dist/extraction/vue-extractor.js +163 -0
- package/dist/extraction/vue-extractor.js.map +1 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +105 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/queries.d.ts.map +1 -0
- package/dist/graph/queries.js +366 -0
- package/dist/graph/queries.js.map +1 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/graph/traversal.d.ts.map +1 -0
- package/dist/graph/traversal.js +528 -0
- package/dist/graph/traversal.js.map +1 -0
- package/dist/index.d.ts +460 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +863 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/claude-md-template.d.ts +14 -0
- package/dist/installer/claude-md-template.d.ts.map +1 -0
- package/dist/installer/claude-md-template.js +21 -0
- package/dist/installer/claude-md-template.js.map +1 -0
- package/dist/installer/config-writer.d.ts +29 -0
- package/dist/installer/config-writer.d.ts.map +1 -0
- package/dist/installer/config-writer.js +111 -0
- package/dist/installer/config-writer.js.map +1 -0
- package/dist/installer/index.d.ts +117 -0
- package/dist/installer/index.d.ts.map +1 -0
- package/dist/installer/index.js +528 -0
- package/dist/installer/index.js.map +1 -0
- package/dist/installer/instructions-template.d.ts +28 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +65 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/antigravity.d.ts.map +1 -0
- package/dist/installer/targets/antigravity.js +307 -0
- package/dist/installer/targets/antigravity.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +47 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +401 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +185 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/cursor.d.ts.map +1 -0
- package/dist/installer/targets/cursor.js +283 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/gemini.d.ts.map +1 -0
- package/dist/installer/targets/gemini.js +165 -0
- package/dist/installer/targets/gemini.js.map +1 -0
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/hermes.d.ts.map +1 -0
- package/dist/installer/targets/hermes.js +359 -0
- package/dist/installer/targets/hermes.js.map +1 -0
- package/dist/installer/targets/kiro.d.ts +27 -0
- package/dist/installer/targets/kiro.d.ts.map +1 -0
- package/dist/installer/targets/kiro.js +196 -0
- package/dist/installer/targets/kiro.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +30 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +235 -0
- package/dist/installer/targets/opencode.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +91 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +77 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +246 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +147 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/types.d.ts +116 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +16 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/mcp/daemon-paths.d.ts +46 -0
- package/dist/mcp/daemon-paths.d.ts.map +1 -0
- package/dist/mcp/daemon-paths.js +125 -0
- package/dist/mcp/daemon-paths.js.map +1 -0
- package/dist/mcp/daemon.d.ts +161 -0
- package/dist/mcp/daemon.d.ts.map +1 -0
- package/dist/mcp/daemon.js +403 -0
- package/dist/mcp/daemon.js.map +1 -0
- package/dist/mcp/engine.d.ts +100 -0
- package/dist/mcp/engine.d.ts.map +1 -0
- package/dist/mcp/engine.js +291 -0
- package/dist/mcp/engine.js.map +1 -0
- package/dist/mcp/index.d.ts +109 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +470 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/proxy.d.ts +46 -0
- package/dist/mcp/proxy.d.ts.map +1 -0
- package/dist/mcp/proxy.js +276 -0
- package/dist/mcp/proxy.js.map +1 -0
- package/dist/mcp/server-instructions.d.ts +19 -0
- package/dist/mcp/server-instructions.d.ts.map +1 -0
- package/dist/mcp/server-instructions.js +73 -0
- package/dist/mcp/server-instructions.js.map +1 -0
- package/dist/mcp/session.d.ts +67 -0
- package/dist/mcp/session.d.ts.map +1 -0
- package/dist/mcp/session.js +276 -0
- package/dist/mcp/session.js.map +1 -0
- package/dist/mcp/tools.d.ts +385 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +2545 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/transport.d.ts +188 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +343 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/mcp/version.d.ts +19 -0
- package/dist/mcp/version.d.ts.map +1 -0
- package/dist/mcp/version.js +71 -0
- package/dist/mcp/version.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +10 -0
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
- package/dist/resolution/callback-synthesizer.js +924 -0
- package/dist/resolution/callback-synthesizer.js.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/dist/resolution/frameworks/csharp.js +241 -0
- package/dist/resolution/frameworks/csharp.js.map +1 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +367 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
- package/dist/resolution/frameworks/expo-modules.js +143 -0
- package/dist/resolution/frameworks/expo-modules.js.map +1 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/dist/resolution/frameworks/express.js +308 -0
- package/dist/resolution/frameworks/express.js.map +1 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
- package/dist/resolution/frameworks/fabric.js +354 -0
- package/dist/resolution/frameworks/fabric.js.map +1 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/dist/resolution/frameworks/go.js +161 -0
- package/dist/resolution/frameworks/go.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +48 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/dist/resolution/frameworks/index.js +161 -0
- package/dist/resolution/frameworks/index.js.map +1 -0
- package/dist/resolution/frameworks/java.d.ts +8 -0
- package/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/dist/resolution/frameworks/java.js +504 -0
- package/dist/resolution/frameworks/java.js.map +1 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/dist/resolution/frameworks/laravel.js +257 -0
- package/dist/resolution/frameworks/laravel.js.map +1 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +698 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/play.d.ts.map +1 -0
- package/dist/resolution/frameworks/play.js +111 -0
- package/dist/resolution/frameworks/play.js.map +1 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/dist/resolution/frameworks/python.js +396 -0
- package/dist/resolution/frameworks/python.js.map +1 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
- package/dist/resolution/frameworks/react-native.js +360 -0
- package/dist/resolution/frameworks/react-native.js.map +1 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/dist/resolution/frameworks/react.js +365 -0
- package/dist/resolution/frameworks/react.js.map +1 -0
- package/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/dist/resolution/frameworks/ruby.js +302 -0
- package/dist/resolution/frameworks/ruby.js.map +1 -0
- package/dist/resolution/frameworks/rust.d.ts +8 -0
- package/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/dist/resolution/frameworks/rust.js +304 -0
- package/dist/resolution/frameworks/rust.js.map +1 -0
- package/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/dist/resolution/frameworks/svelte.js +249 -0
- package/dist/resolution/frameworks/svelte.js.map +1 -0
- package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift-objc.js +252 -0
- package/dist/resolution/frameworks/swift-objc.js.map +1 -0
- package/dist/resolution/frameworks/swift.d.ts +10 -0
- package/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/dist/resolution/frameworks/swift.js +400 -0
- package/dist/resolution/frameworks/swift.js.map +1 -0
- package/dist/resolution/frameworks/vue.d.ts +9 -0
- package/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/dist/resolution/frameworks/vue.js +306 -0
- package/dist/resolution/frameworks/vue.js.map +1 -0
- package/dist/resolution/go-module.d.ts +26 -0
- package/dist/resolution/go-module.d.ts.map +1 -0
- package/dist/resolution/go-module.js +78 -0
- package/dist/resolution/go-module.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +68 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -0
- package/dist/resolution/import-resolver.js +1231 -0
- package/dist/resolution/import-resolver.js.map +1 -0
- package/dist/resolution/index.d.ts +116 -0
- package/dist/resolution/index.d.ts.map +1 -0
- package/dist/resolution/index.js +878 -0
- package/dist/resolution/index.js.map +1 -0
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/lru-cache.d.ts.map +1 -0
- package/dist/resolution/lru-cache.js +62 -0
- package/dist/resolution/lru-cache.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +32 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -0
- package/dist/resolution/name-matcher.js +596 -0
- package/dist/resolution/name-matcher.js.map +1 -0
- package/dist/resolution/path-aliases.d.ts +68 -0
- package/dist/resolution/path-aliases.d.ts.map +1 -0
- package/dist/resolution/path-aliases.js +238 -0
- package/dist/resolution/path-aliases.js.map +1 -0
- package/dist/resolution/strip-comments.d.ts +27 -0
- package/dist/resolution/strip-comments.d.ts.map +1 -0
- package/dist/resolution/strip-comments.js +441 -0
- package/dist/resolution/strip-comments.js.map +1 -0
- package/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
- package/dist/resolution/swift-objc-bridge.js +256 -0
- package/dist/resolution/swift-objc-bridge.js.map +1 -0
- package/dist/resolution/types.d.ts +209 -0
- package/dist/resolution/types.d.ts.map +1 -0
- package/dist/resolution/types.js +8 -0
- package/dist/resolution/types.js.map +1 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-parser.d.ts.map +1 -0
- package/dist/search/query-parser.js +177 -0
- package/dist/search/query-parser.js.map +1 -0
- package/dist/search/query-utils.d.ts +53 -0
- package/dist/search/query-utils.d.ts.map +1 -0
- package/dist/search/query-utils.js +350 -0
- package/dist/search/query-utils.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +223 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +35 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +191 -0
- package/dist/sync/watcher.d.ts.map +1 -0
- package/dist/sync/watcher.js +398 -0
- package/dist/sync/watcher.js.map +1 -0
- package/dist/sync/worktree.d.ts +54 -0
- package/dist/sync/worktree.d.ts.map +1 -0
- package/dist/sync/worktree.js +136 -0
- package/dist/sync/worktree.js.map +1 -0
- package/dist/types.d.ts +369 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +78 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/dist/ui/shimmer-progress.js +90 -0
- package/dist/ui/shimmer-progress.js.map +1 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/dist/ui/shimmer-worker.js +118 -0
- package/dist/ui/shimmer-worker.js.map +1 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +3 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/utils.d.ts +205 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +549 -0
- package/dist/utils.js.map +1 -0
- package/package.json +59 -0
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/arms-F.sh +21 -0
- package/scripts/agent-eval/arms-matrix.sh +37 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/bench-readme.sh +28 -0
- package/scripts/agent-eval/block-read-hook.sh +19 -0
- package/scripts/agent-eval/hook-settings.json +15 -0
- package/scripts/agent-eval/itrun.sh +107 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -0
- package/scripts/agent-eval/parse-bench-readme.mjs +67 -0
- package/scripts/agent-eval/parse-run.mjs +45 -0
- package/scripts/agent-eval/parse-session.mjs +93 -0
- package/scripts/agent-eval/probe-context.mjs +21 -0
- package/scripts/agent-eval/probe-explore.mjs +40 -0
- package/scripts/agent-eval/probe-node.mjs +20 -0
- package/scripts/agent-eval/probe-trace.mjs +20 -0
- package/scripts/agent-eval/run-agent.sh +34 -0
- package/scripts/agent-eval/run-all.sh +67 -0
- package/scripts/agent-eval/run-arms.sh +56 -0
- package/scripts/agent-eval/seq-matrix.mjs +137 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/extract-release-notes.mjs +130 -0
- package/scripts/local-install.sh +41 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/pack-npm.sh +95 -0
- package/scripts/prepare-release.mjs +270 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor target.
|
|
3
|
+
*
|
|
4
|
+
* - MCP server entry to `~/.cursor/mcp.json` (global) or
|
|
5
|
+
* `./.cursor/mcp.json` (local). Same `{mcpServers: {...}}` shape
|
|
6
|
+
* as Claude.
|
|
7
|
+
* - Instructions to `./.cursor/rules/codegraph.mdc` (project-local
|
|
8
|
+
* ONLY). Cursor's rules system is a project-scoped surface;
|
|
9
|
+
* global cursor rules aren't a stable convention as of 2026-05.
|
|
10
|
+
* For `--location=global`, only mcp.json is written.
|
|
11
|
+
*
|
|
12
|
+
* ## Why we hardcode `--path` for Cursor
|
|
13
|
+
*
|
|
14
|
+
* Cursor launches MCP-server subprocesses with a working directory
|
|
15
|
+
* that ISN'T the workspace root AND doesn't pass `rootUri` /
|
|
16
|
+
* `workspaceFolders` in the MCP initialize call. The codegraph MCP
|
|
17
|
+
* server's `process.cwd()` fallback therefore misses the workspace's
|
|
18
|
+
* `.codegraph/` and reports "not initialized" on every tool call.
|
|
19
|
+
*
|
|
20
|
+
* So we inject `--path` into the args ourselves:
|
|
21
|
+
*
|
|
22
|
+
* - `local` install: absolute path (we know it at install time).
|
|
23
|
+
* - `global` install: `${workspaceFolder}` — Cursor expands this to
|
|
24
|
+
* the open workspace's root, giving us per-workspace behavior
|
|
25
|
+
* from a single global config.
|
|
26
|
+
*
|
|
27
|
+
* Codex and Claude do not need this — they launch MCP servers with
|
|
28
|
+
* `cwd = workspace` and pass `rootUri`, respectively.
|
|
29
|
+
*
|
|
30
|
+
* No permissions concept — Cursor doesn't have an auto-allow list
|
|
31
|
+
* the installer can populate. `autoAllow` is silently ignored.
|
|
32
|
+
*/
|
|
33
|
+
import { AgentTarget } from './types';
|
|
34
|
+
export declare const cursorTarget: AgentTarget;
|
|
35
|
+
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AAuPjB,eAAO,MAAM,YAAY,EAAE,WAAgC,CAAC"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cursor target.
|
|
4
|
+
*
|
|
5
|
+
* - MCP server entry to `~/.cursor/mcp.json` (global) or
|
|
6
|
+
* `./.cursor/mcp.json` (local). Same `{mcpServers: {...}}` shape
|
|
7
|
+
* as Claude.
|
|
8
|
+
* - Instructions to `./.cursor/rules/codegraph.mdc` (project-local
|
|
9
|
+
* ONLY). Cursor's rules system is a project-scoped surface;
|
|
10
|
+
* global cursor rules aren't a stable convention as of 2026-05.
|
|
11
|
+
* For `--location=global`, only mcp.json is written.
|
|
12
|
+
*
|
|
13
|
+
* ## Why we hardcode `--path` for Cursor
|
|
14
|
+
*
|
|
15
|
+
* Cursor launches MCP-server subprocesses with a working directory
|
|
16
|
+
* that ISN'T the workspace root AND doesn't pass `rootUri` /
|
|
17
|
+
* `workspaceFolders` in the MCP initialize call. The codegraph MCP
|
|
18
|
+
* server's `process.cwd()` fallback therefore misses the workspace's
|
|
19
|
+
* `.codegraph/` and reports "not initialized" on every tool call.
|
|
20
|
+
*
|
|
21
|
+
* So we inject `--path` into the args ourselves:
|
|
22
|
+
*
|
|
23
|
+
* - `local` install: absolute path (we know it at install time).
|
|
24
|
+
* - `global` install: `${workspaceFolder}` — Cursor expands this to
|
|
25
|
+
* the open workspace's root, giving us per-workspace behavior
|
|
26
|
+
* from a single global config.
|
|
27
|
+
*
|
|
28
|
+
* Codex and Claude do not need this — they launch MCP servers with
|
|
29
|
+
* `cwd = workspace` and pass `rootUri`, respectively.
|
|
30
|
+
*
|
|
31
|
+
* No permissions concept — Cursor doesn't have an auto-allow list
|
|
32
|
+
* the installer can populate. `autoAllow` is silently ignored.
|
|
33
|
+
*/
|
|
34
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
35
|
+
if (k2 === undefined) k2 = k;
|
|
36
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
37
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
38
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
39
|
+
}
|
|
40
|
+
Object.defineProperty(o, k2, desc);
|
|
41
|
+
}) : (function(o, m, k, k2) {
|
|
42
|
+
if (k2 === undefined) k2 = k;
|
|
43
|
+
o[k2] = m[k];
|
|
44
|
+
}));
|
|
45
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
46
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
47
|
+
}) : function(o, v) {
|
|
48
|
+
o["default"] = v;
|
|
49
|
+
});
|
|
50
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
51
|
+
var ownKeys = function(o) {
|
|
52
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
53
|
+
var ar = [];
|
|
54
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
55
|
+
return ar;
|
|
56
|
+
};
|
|
57
|
+
return ownKeys(o);
|
|
58
|
+
};
|
|
59
|
+
return function (mod) {
|
|
60
|
+
if (mod && mod.__esModule) return mod;
|
|
61
|
+
var result = {};
|
|
62
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
63
|
+
__setModuleDefault(result, mod);
|
|
64
|
+
return result;
|
|
65
|
+
};
|
|
66
|
+
})();
|
|
67
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
+
exports.cursorTarget = void 0;
|
|
69
|
+
const fs = __importStar(require("fs"));
|
|
70
|
+
const path = __importStar(require("path"));
|
|
71
|
+
const os = __importStar(require("os"));
|
|
72
|
+
const shared_1 = require("./shared");
|
|
73
|
+
const instructions_template_1 = require("../instructions-template");
|
|
74
|
+
function mcpJsonPath(loc) {
|
|
75
|
+
return loc === 'global'
|
|
76
|
+
? path.join(os.homedir(), '.cursor', 'mcp.json')
|
|
77
|
+
: path.join(process.cwd(), '.cursor', 'mcp.json');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Cursor "rules" file. Only meaningful for the project-local
|
|
81
|
+
* location — Cursor reads `.cursor/rules/*.mdc` from the workspace
|
|
82
|
+
* root. There is no global equivalent.
|
|
83
|
+
*/
|
|
84
|
+
function rulesPath() {
|
|
85
|
+
return path.join(process.cwd(), '.cursor', 'rules', 'codegraph.mdc');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Cursor `.mdc` rules use YAML-ish frontmatter. `alwaysApply: true`
|
|
89
|
+
* makes the rule load on every conversation regardless of file
|
|
90
|
+
* patterns — appropriate for a tool-usage guide that's relevant
|
|
91
|
+
* whenever the user is asking the agent to navigate code.
|
|
92
|
+
*/
|
|
93
|
+
const MDC_FRONTMATTER = [
|
|
94
|
+
'---',
|
|
95
|
+
'description: CodeGraph MCP usage guide — when to use which tool',
|
|
96
|
+
'alwaysApply: true',
|
|
97
|
+
'---',
|
|
98
|
+
'',
|
|
99
|
+
].join('\n');
|
|
100
|
+
class CursorTarget {
|
|
101
|
+
id = 'cursor';
|
|
102
|
+
displayName = 'Cursor';
|
|
103
|
+
docsUrl = 'https://docs.cursor.com/context/model-context-protocol';
|
|
104
|
+
supportsLocation(_loc) {
|
|
105
|
+
// Both supported, but `local` writes more files (mcp.json + rules);
|
|
106
|
+
// `global` writes only mcp.json. The orchestrator surfaces the
|
|
107
|
+
// difference via describePaths.
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
detect(loc) {
|
|
111
|
+
const mcpPath = mcpJsonPath(loc);
|
|
112
|
+
const config = (0, shared_1.readJsonFile)(mcpPath);
|
|
113
|
+
const alreadyConfigured = !!config.mcpServers?.codegraph;
|
|
114
|
+
// "Installed" heuristic: does ~/.cursor exist (global) or has the
|
|
115
|
+
// user opted into a project-local cursor config dir?
|
|
116
|
+
const installed = loc === 'global'
|
|
117
|
+
? fs.existsSync(path.join(os.homedir(), '.cursor'))
|
|
118
|
+
: fs.existsSync(path.join(process.cwd(), '.cursor'));
|
|
119
|
+
return { installed, alreadyConfigured, configPath: mcpPath };
|
|
120
|
+
}
|
|
121
|
+
install(loc, _opts) {
|
|
122
|
+
const files = [];
|
|
123
|
+
files.push(writeMcpEntry(loc));
|
|
124
|
+
if (loc === 'local') {
|
|
125
|
+
files.push(writeRulesEntry());
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
files,
|
|
129
|
+
notes: ['Restart Cursor for MCP changes to take effect.'],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
uninstall(loc) {
|
|
133
|
+
const files = [];
|
|
134
|
+
const mcpPath = mcpJsonPath(loc);
|
|
135
|
+
const config = (0, shared_1.readJsonFile)(mcpPath);
|
|
136
|
+
if (config.mcpServers?.codegraph) {
|
|
137
|
+
delete config.mcpServers.codegraph;
|
|
138
|
+
if (Object.keys(config.mcpServers).length === 0) {
|
|
139
|
+
delete config.mcpServers;
|
|
140
|
+
}
|
|
141
|
+
(0, shared_1.writeJsonFile)(mcpPath, config);
|
|
142
|
+
files.push({ path: mcpPath, action: 'removed' });
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
files.push({ path: mcpPath, action: 'not-found' });
|
|
146
|
+
}
|
|
147
|
+
if (loc === 'local') {
|
|
148
|
+
files.push(removeRulesEntry());
|
|
149
|
+
}
|
|
150
|
+
return { files };
|
|
151
|
+
}
|
|
152
|
+
printConfig(loc) {
|
|
153
|
+
const target = mcpJsonPath(loc);
|
|
154
|
+
const snippet = JSON.stringify({ mcpServers: { codegraph: buildCursorMcpConfig(loc) } }, null, 2);
|
|
155
|
+
return `# Add to ${target}\n\n${snippet}\n`;
|
|
156
|
+
}
|
|
157
|
+
describePaths(loc) {
|
|
158
|
+
return loc === 'local'
|
|
159
|
+
? [mcpJsonPath(loc), rulesPath()]
|
|
160
|
+
: [mcpJsonPath(loc)];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Write the project-local `.cursor/rules/codegraph.mdc` file. Used
|
|
164
|
+
* by `codegraph init` to bootstrap projects that have only the
|
|
165
|
+
* global `~/.cursor/mcp.json` — without the rules file, the Cursor
|
|
166
|
+
* agent has no signal to prefer codegraph over native grep.
|
|
167
|
+
*/
|
|
168
|
+
wireProjectSurfaces() {
|
|
169
|
+
return { files: [writeRulesEntry()] };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Build the codegraph MCP-server config for Cursor at the given
|
|
174
|
+
* location. Inherits the shared shape ({type, command, args}) and
|
|
175
|
+
* appends `--path` so the spawned MCP server resolves the workspace
|
|
176
|
+
* correctly regardless of Cursor's launch cwd. See file header for
|
|
177
|
+
* the full rationale.
|
|
178
|
+
*/
|
|
179
|
+
function buildCursorMcpConfig(loc) {
|
|
180
|
+
const base = (0, shared_1.getMcpServerConfig)();
|
|
181
|
+
const pathArg = loc === 'local' ? process.cwd() : '${workspaceFolder}';
|
|
182
|
+
return { ...base, args: [...base.args, '--path', pathArg] };
|
|
183
|
+
}
|
|
184
|
+
function writeMcpEntry(loc) {
|
|
185
|
+
const file = mcpJsonPath(loc);
|
|
186
|
+
const existing = (0, shared_1.readJsonFile)(file);
|
|
187
|
+
const before = existing.mcpServers?.codegraph;
|
|
188
|
+
const after = buildCursorMcpConfig(loc);
|
|
189
|
+
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
190
|
+
return { path: file, action: 'unchanged' };
|
|
191
|
+
}
|
|
192
|
+
const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
|
|
193
|
+
if (!existing.mcpServers)
|
|
194
|
+
existing.mcpServers = {};
|
|
195
|
+
existing.mcpServers.codegraph = after;
|
|
196
|
+
(0, shared_1.writeJsonFile)(file, existing);
|
|
197
|
+
return { path: file, action };
|
|
198
|
+
}
|
|
199
|
+
function writeRulesEntry() {
|
|
200
|
+
const file = rulesPath();
|
|
201
|
+
const dir = path.dirname(file);
|
|
202
|
+
if (!fs.existsSync(dir))
|
|
203
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
204
|
+
// Body is frontmatter + the shared instructions block. The
|
|
205
|
+
// marker-based replacement targets only the marker block, so the
|
|
206
|
+
// frontmatter is preserved across re-runs.
|
|
207
|
+
const body = MDC_FRONTMATTER + instructions_template_1.INSTRUCTIONS_TEMPLATE;
|
|
208
|
+
if (!fs.existsSync(file)) {
|
|
209
|
+
(0, shared_1.atomicWriteFileSync)(file, body + '\n');
|
|
210
|
+
return { path: file, action: 'created' };
|
|
211
|
+
}
|
|
212
|
+
// For .mdc files we own outright, do byte-equality first.
|
|
213
|
+
const existing = fs.readFileSync(file, 'utf-8');
|
|
214
|
+
const wantWithNL = body + '\n';
|
|
215
|
+
if (existing === wantWithNL) {
|
|
216
|
+
return { path: file, action: 'unchanged' };
|
|
217
|
+
}
|
|
218
|
+
// Otherwise, marker-based section swap (preserves any user-added
|
|
219
|
+
// content outside the markers).
|
|
220
|
+
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
221
|
+
const mapped = action === 'created' ? 'created'
|
|
222
|
+
: action === 'unchanged' ? 'unchanged'
|
|
223
|
+
: 'updated';
|
|
224
|
+
return { path: file, action: mapped };
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Remove the Cursor rules file on uninstall.
|
|
228
|
+
*
|
|
229
|
+
* Unlike the shared CLAUDE.md / AGENTS.md files (where codegraph owns
|
|
230
|
+
* only a marker-delimited section), `.cursor/rules/codegraph.mdc` is a
|
|
231
|
+
* file we create OUTRIGHT — the frontmatter is ours too. So a plain
|
|
232
|
+
* `removeMarkedSection` is wrong here: it would strip our instruction
|
|
233
|
+
* block but leave the orphaned `description: CodeGraph ...` frontmatter
|
|
234
|
+
* behind, so the file lingers and still "mentions" codegraph.
|
|
235
|
+
*
|
|
236
|
+
* Instead: strip our block, and if nothing but our own frontmatter
|
|
237
|
+
* remains, delete the whole file. Only when the user has added their
|
|
238
|
+
* own content outside our markers do we keep the file (minus our block).
|
|
239
|
+
*/
|
|
240
|
+
function removeRulesEntry() {
|
|
241
|
+
const file = rulesPath();
|
|
242
|
+
if (!fs.existsSync(file))
|
|
243
|
+
return { path: file, action: 'not-found' };
|
|
244
|
+
let content;
|
|
245
|
+
try {
|
|
246
|
+
content = fs.readFileSync(file, 'utf-8');
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return { path: file, action: 'not-found' };
|
|
250
|
+
}
|
|
251
|
+
const ourFrontmatter = MDC_FRONTMATTER.trim();
|
|
252
|
+
const startIdx = content.indexOf(instructions_template_1.CODEGRAPH_SECTION_START);
|
|
253
|
+
const endIdx = content.indexOf(instructions_template_1.CODEGRAPH_SECTION_END);
|
|
254
|
+
// Our marked block is present — strip it, then decide what's left.
|
|
255
|
+
if (startIdx !== -1 && endIdx > startIdx) {
|
|
256
|
+
const before = content.substring(0, startIdx).trimEnd();
|
|
257
|
+
const after = content.substring(endIdx + instructions_template_1.CODEGRAPH_SECTION_END.length).trimStart();
|
|
258
|
+
const remainder = (before + (before && after ? '\n\n' : '') + after).trim();
|
|
259
|
+
if (remainder === '' || remainder === ourFrontmatter) {
|
|
260
|
+
try {
|
|
261
|
+
fs.unlinkSync(file);
|
|
262
|
+
}
|
|
263
|
+
catch { /* ignore */ }
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
(0, shared_1.atomicWriteFileSync)(file, remainder + '\n');
|
|
267
|
+
}
|
|
268
|
+
return { path: file, action: 'removed' };
|
|
269
|
+
}
|
|
270
|
+
// No block, but the file is still our pristine frontmatter-only file
|
|
271
|
+
// — it's ours, so remove it.
|
|
272
|
+
if (content.trim() === ourFrontmatter) {
|
|
273
|
+
try {
|
|
274
|
+
fs.unlinkSync(file);
|
|
275
|
+
}
|
|
276
|
+
catch { /* ignore */ }
|
|
277
|
+
return { path: file, action: 'removed' };
|
|
278
|
+
}
|
|
279
|
+
// Foreign content we don't recognize — leave it alone.
|
|
280
|
+
return { path: file, action: 'not-found' };
|
|
281
|
+
}
|
|
282
|
+
exports.cursorTarget = new CursorTarget();
|
|
283
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/installer/targets/cursor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCAOkB;AAClB,oEAIkC;AAElC,SAAS,WAAW,CAAC,GAAa;IAChC,OAAO,GAAG,KAAK,QAAQ;QACrB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC;QAChD,CAAC,CAAC,IAAI,CAAC,IAAI,CA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1
|
+
/**
|
|
2
|
+
* Gemini CLI target (also covers the rebranded "Antigravity CLI" —
|
|
3
|
+
* Google is in the middle of unifying its CLI tools under
|
|
4
|
+
* Antigravity, and the new CLI continues to read `~/.gemini/settings.json`
|
|
5
|
+
* + project-local `.gemini/settings.json`). Writes:
|
|
6
|
+
*
|
|
7
|
+
* - MCP server entry to `~/.gemini/settings.json` (global) or
|
|
8
|
+
* `./.gemini/settings.json` (local) under the standard
|
|
9
|
+
* `mcpServers.codegraph` key. Same shape as Claude / Cursor.
|
|
10
|
+
* - Instructions to `~/.gemini/GEMINI.md` (global) or `./GEMINI.md`
|
|
11
|
+
* (local — Gemini reads the project root file directly, not
|
|
12
|
+
* under `.gemini/`).
|
|
13
|
+
*
|
|
14
|
+
* No permissions concept — Gemini CLI gates tool invocations through
|
|
15
|
+
* the `trust` field per server, not an external allowlist. We leave
|
|
16
|
+
* `trust` unset so the user controls confirmation prompts.
|
|
17
|
+
*
|
|
18
|
+
* The Antigravity IDE shares `~/.gemini/GEMINI.md` for instructions
|
|
19
|
+
* but uses a separate MCP config file (`~/.gemini/antigravity/mcp_config.json`)
|
|
20
|
+
* — see `./antigravity.ts`. Both targets writing to GEMINI.md is
|
|
21
|
+
* safe: the marker-based section replacement makes the second write
|
|
22
|
+
* a byte-identical no-op.
|
|
23
|
+
*/
|
|
24
|
+
import { AgentTarget } from './types';
|
|
25
|
+
export declare const geminiTarget: AgentTarget;
|
|
26
|
+
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/gemini.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AAqIjB,eAAO,MAAM,YAAY,EAAE,WAAgC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Gemini CLI target (also covers the rebranded "Antigravity CLI" —
|
|
4
|
+
* Google is in the middle of unifying its CLI tools under
|
|
5
|
+
* Antigravity, and the new CLI continues to read `~/.gemini/settings.json`
|
|
6
|
+
* + project-local `.gemini/settings.json`). Writes:
|
|
7
|
+
*
|
|
8
|
+
* - MCP server entry to `~/.gemini/settings.json` (global) or
|
|
9
|
+
* `./.gemini/settings.json` (local) under the standard
|
|
10
|
+
* `mcpServers.codegraph` key. Same shape as Claude / Cursor.
|
|
11
|
+
* - Instructions to `~/.gemini/GEMINI.md` (global) or `./GEMINI.md`
|
|
12
|
+
* (local — Gemini reads the project root file directly, not
|
|
13
|
+
* under `.gemini/`).
|
|
14
|
+
*
|
|
15
|
+
* No permissions concept — Gemini CLI gates tool invocations through
|
|
16
|
+
* the `trust` field per server, not an external allowlist. We leave
|
|
17
|
+
* `trust` unset so the user controls confirmation prompts.
|
|
18
|
+
*
|
|
19
|
+
* The Antigravity IDE shares `~/.gemini/GEMINI.md` for instructions
|
|
20
|
+
* but uses a separate MCP config file (`~/.gemini/antigravity/mcp_config.json`)
|
|
21
|
+
* — see `./antigravity.ts`. Both targets writing to GEMINI.md is
|
|
22
|
+
* safe: the marker-based section replacement makes the second write
|
|
23
|
+
* a byte-identical no-op.
|
|
24
|
+
*/
|
|
25
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
26
|
+
if (k2 === undefined) k2 = k;
|
|
27
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
28
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
29
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
30
|
+
}
|
|
31
|
+
Object.defineProperty(o, k2, desc);
|
|
32
|
+
}) : (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
o[k2] = m[k];
|
|
35
|
+
}));
|
|
36
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
37
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
38
|
+
}) : function(o, v) {
|
|
39
|
+
o["default"] = v;
|
|
40
|
+
});
|
|
41
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
42
|
+
var ownKeys = function(o) {
|
|
43
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
44
|
+
var ar = [];
|
|
45
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
46
|
+
return ar;
|
|
47
|
+
};
|
|
48
|
+
return ownKeys(o);
|
|
49
|
+
};
|
|
50
|
+
return function (mod) {
|
|
51
|
+
if (mod && mod.__esModule) return mod;
|
|
52
|
+
var result = {};
|
|
53
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
54
|
+
__setModuleDefault(result, mod);
|
|
55
|
+
return result;
|
|
56
|
+
};
|
|
57
|
+
})();
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.geminiTarget = void 0;
|
|
60
|
+
const fs = __importStar(require("fs"));
|
|
61
|
+
const path = __importStar(require("path"));
|
|
62
|
+
const os = __importStar(require("os"));
|
|
63
|
+
const shared_1 = require("./shared");
|
|
64
|
+
const instructions_template_1 = require("../instructions-template");
|
|
65
|
+
function configDir(loc) {
|
|
66
|
+
return loc === 'global'
|
|
67
|
+
? path.join(os.homedir(), '.gemini')
|
|
68
|
+
: path.join(process.cwd(), '.gemini');
|
|
69
|
+
}
|
|
70
|
+
function settingsJsonPath(loc) {
|
|
71
|
+
return path.join(configDir(loc), 'settings.json');
|
|
72
|
+
}
|
|
73
|
+
function instructionsPath(loc) {
|
|
74
|
+
// Global GEMINI.md lives under ~/.gemini/; project-local GEMINI.md
|
|
75
|
+
// lives at the project root (NOT under .gemini/), matching how
|
|
76
|
+
// Gemini CLI's hierarchical context loader searches.
|
|
77
|
+
return loc === 'global'
|
|
78
|
+
? path.join(configDir('global'), 'GEMINI.md')
|
|
79
|
+
: path.join(process.cwd(), 'GEMINI.md');
|
|
80
|
+
}
|
|
81
|
+
class GeminiTarget {
|
|
82
|
+
id = 'gemini';
|
|
83
|
+
displayName = 'Gemini CLI';
|
|
84
|
+
docsUrl = 'https://geminicli.com/docs/tools/mcp-server/';
|
|
85
|
+
supportsLocation(_loc) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
detect(loc) {
|
|
89
|
+
const file = settingsJsonPath(loc);
|
|
90
|
+
const config = (0, shared_1.readJsonFile)(file);
|
|
91
|
+
const alreadyConfigured = !!config.mcpServers?.codegraph;
|
|
92
|
+
const installed = loc === 'global'
|
|
93
|
+
? fs.existsSync(configDir('global')) || fs.existsSync(file)
|
|
94
|
+
: fs.existsSync(file) || fs.existsSync(configDir('local'));
|
|
95
|
+
return { installed, alreadyConfigured, configPath: file };
|
|
96
|
+
}
|
|
97
|
+
install(loc, _opts) {
|
|
98
|
+
const files = [];
|
|
99
|
+
files.push(writeMcpEntry(loc));
|
|
100
|
+
files.push(writeInstructionsEntry(loc));
|
|
101
|
+
return { files };
|
|
102
|
+
}
|
|
103
|
+
uninstall(loc) {
|
|
104
|
+
const files = [];
|
|
105
|
+
const file = settingsJsonPath(loc);
|
|
106
|
+
const config = (0, shared_1.readJsonFile)(file);
|
|
107
|
+
if (config.mcpServers?.codegraph) {
|
|
108
|
+
delete config.mcpServers.codegraph;
|
|
109
|
+
if (Object.keys(config.mcpServers).length === 0) {
|
|
110
|
+
delete config.mcpServers;
|
|
111
|
+
}
|
|
112
|
+
// If the file is now an empty `{}` we still leave it — other
|
|
113
|
+
// (top-level) Gemini settings the user might add later can
|
|
114
|
+
// share the file; deleting it would be surprising.
|
|
115
|
+
(0, shared_1.writeJsonFile)(file, config);
|
|
116
|
+
files.push({ path: file, action: 'removed' });
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
files.push({ path: file, action: 'not-found' });
|
|
120
|
+
}
|
|
121
|
+
const instr = instructionsPath(loc);
|
|
122
|
+
const action = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
123
|
+
files.push({ path: instr, action });
|
|
124
|
+
return { files };
|
|
125
|
+
}
|
|
126
|
+
printConfig(loc) {
|
|
127
|
+
const target = settingsJsonPath(loc);
|
|
128
|
+
const snippet = JSON.stringify({ mcpServers: { codegraph: (0, shared_1.getMcpServerConfig)() } }, null, 2);
|
|
129
|
+
return `# Add to ${target}\n\n${snippet}\n`;
|
|
130
|
+
}
|
|
131
|
+
describePaths(loc) {
|
|
132
|
+
return [settingsJsonPath(loc), instructionsPath(loc)];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function writeMcpEntry(loc) {
|
|
136
|
+
const file = settingsJsonPath(loc);
|
|
137
|
+
const dir = path.dirname(file);
|
|
138
|
+
if (!fs.existsSync(dir))
|
|
139
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
140
|
+
const existing = (0, shared_1.readJsonFile)(file);
|
|
141
|
+
const before = existing.mcpServers?.codegraph;
|
|
142
|
+
const after = (0, shared_1.getMcpServerConfig)();
|
|
143
|
+
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
144
|
+
return { path: file, action: 'unchanged' };
|
|
145
|
+
}
|
|
146
|
+
const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
|
|
147
|
+
if (!existing.mcpServers)
|
|
148
|
+
existing.mcpServers = {};
|
|
149
|
+
existing.mcpServers.codegraph = after;
|
|
150
|
+
(0, shared_1.writeJsonFile)(file, existing);
|
|
151
|
+
return { path: file, action };
|
|
152
|
+
}
|
|
153
|
+
function writeInstructionsEntry(loc) {
|
|
154
|
+
const file = instructionsPath(loc);
|
|
155
|
+
const dir = path.dirname(file);
|
|
156
|
+
if (!fs.existsSync(dir))
|
|
157
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
158
|
+
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
159
|
+
const mapped = action === 'created' ? 'created'
|
|
160
|
+
: action === 'unchanged' ? 'unchanged'
|
|
161
|
+
: 'updated';
|
|
162
|
+
return { path: file, action: mapped };
|
|
163
|
+
}
|
|
164
|
+
exports.geminiTarget = new GeminiTarget();
|
|
165
|
+
//# sourceMappingURL=gemini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../src/installer/targets/gemini.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCAOkB;AAClB,oEAIkC;AAElC,SAAS,SAAS,CAAC,GAAa;IAC9B,OAAO,GAAG,KAAK,QAAQ;QACrB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC;QACpC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAa;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC;AACpD,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAa;IACrC,mEAAmE;IACnE,+DAA+D;IAC/D,qDAAqD;IACrD,OAAO,GAAG,KAAK,QAAQ;QACrB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;QAC7C,CAAC,CAAC,IAAI,CAAC,IAAI,CA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C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,IAAA,qCAA4B,EACzC,IAAI,EACJ,6CAAqB,EACrB,+CAAuB,EACvB,6CAAqB,CACtB,CAAC;IACF,MAAM,MAAM,GACV,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS;QAC9B,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW;YACpC,CAAC,CAAC,SAAS,CAAC;IAClB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAEY,QAAA,YAAY,GAAgB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermes Agent target.
|
|
3
|
+
*
|
|
4
|
+
* Hermes reads MCP servers from `$HERMES_HOME/config.yaml` under the
|
|
5
|
+
* top-level `mcp_servers` key, and exposes discovered MCP tools through
|
|
6
|
+
* dynamic toolsets named `mcp-<server>`. We add:
|
|
7
|
+
*
|
|
8
|
+
* mcp_servers.codegraph -> `codegraph serve --mcp`
|
|
9
|
+
* platform_toolsets.cli -> `mcp-codegraph`
|
|
10
|
+
*
|
|
11
|
+
* The second entry matters because Hermes CLI profiles often enable an
|
|
12
|
+
* explicit `platform_toolsets.cli` list. Without `mcp-codegraph` in that
|
|
13
|
+
* list, the MCP server can be configured and connected but its tools may
|
|
14
|
+
* still be filtered out of normal CLI sessions.
|
|
15
|
+
*/
|
|
16
|
+
import { AgentTarget } from './types';
|
|
17
|
+
export declare const hermesTarget: AgentTarget;
|
|
18
|
+
//# sourceMappingURL=hermes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/hermes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AA0UjB,eAAO,MAAM,YAAY,EAAE,WAAgC,CAAC"}
|