@colbymchenry/codegraph-darwin-arm64 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,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;AAqMjB,eAAO,MAAM,YAAY,EAAE,WAAgC,CAAC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
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
|
+
const rules = rulesPath();
|
|
149
|
+
const action = (0, shared_1.removeMarkedSection)(rules, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
150
|
+
files.push({ path: rules, action });
|
|
151
|
+
}
|
|
152
|
+
return { files };
|
|
153
|
+
}
|
|
154
|
+
printConfig(loc) {
|
|
155
|
+
const target = mcpJsonPath(loc);
|
|
156
|
+
const snippet = JSON.stringify({ mcpServers: { codegraph: buildCursorMcpConfig(loc) } }, null, 2);
|
|
157
|
+
return `# Add to ${target}\n\n${snippet}\n`;
|
|
158
|
+
}
|
|
159
|
+
describePaths(loc) {
|
|
160
|
+
return loc === 'local'
|
|
161
|
+
? [mcpJsonPath(loc), rulesPath()]
|
|
162
|
+
: [mcpJsonPath(loc)];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Write the project-local `.cursor/rules/codegraph.mdc` file. Used
|
|
166
|
+
* by `codegraph init` to bootstrap projects that have only the
|
|
167
|
+
* global `~/.cursor/mcp.json` — without the rules file, the Cursor
|
|
168
|
+
* agent has no signal to prefer codegraph over native grep.
|
|
169
|
+
*/
|
|
170
|
+
wireProjectSurfaces() {
|
|
171
|
+
return { files: [writeRulesEntry()] };
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build the codegraph MCP-server config for Cursor at the given
|
|
176
|
+
* location. Inherits the shared shape ({type, command, args}) and
|
|
177
|
+
* appends `--path` so the spawned MCP server resolves the workspace
|
|
178
|
+
* correctly regardless of Cursor's launch cwd. See file header for
|
|
179
|
+
* the full rationale.
|
|
180
|
+
*/
|
|
181
|
+
function buildCursorMcpConfig(loc) {
|
|
182
|
+
const base = (0, shared_1.getMcpServerConfig)();
|
|
183
|
+
const pathArg = loc === 'local' ? process.cwd() : '${workspaceFolder}';
|
|
184
|
+
return { ...base, args: [...base.args, '--path', pathArg] };
|
|
185
|
+
}
|
|
186
|
+
function writeMcpEntry(loc) {
|
|
187
|
+
const file = mcpJsonPath(loc);
|
|
188
|
+
const existing = (0, shared_1.readJsonFile)(file);
|
|
189
|
+
const before = existing.mcpServers?.codegraph;
|
|
190
|
+
const after = buildCursorMcpConfig(loc);
|
|
191
|
+
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
192
|
+
return { path: file, action: 'unchanged' };
|
|
193
|
+
}
|
|
194
|
+
const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
|
|
195
|
+
if (!existing.mcpServers)
|
|
196
|
+
existing.mcpServers = {};
|
|
197
|
+
existing.mcpServers.codegraph = after;
|
|
198
|
+
(0, shared_1.writeJsonFile)(file, existing);
|
|
199
|
+
return { path: file, action };
|
|
200
|
+
}
|
|
201
|
+
function writeRulesEntry() {
|
|
202
|
+
const file = rulesPath();
|
|
203
|
+
const dir = path.dirname(file);
|
|
204
|
+
if (!fs.existsSync(dir))
|
|
205
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
206
|
+
// Body is frontmatter + the shared instructions block. The
|
|
207
|
+
// marker-based replacement targets only the marker block, so the
|
|
208
|
+
// frontmatter is preserved across re-runs.
|
|
209
|
+
const body = MDC_FRONTMATTER + instructions_template_1.INSTRUCTIONS_TEMPLATE;
|
|
210
|
+
if (!fs.existsSync(file)) {
|
|
211
|
+
(0, shared_1.atomicWriteFileSync)(file, body + '\n');
|
|
212
|
+
return { path: file, action: 'created' };
|
|
213
|
+
}
|
|
214
|
+
// For .mdc files we own outright, do byte-equality first.
|
|
215
|
+
const existing = fs.readFileSync(file, 'utf-8');
|
|
216
|
+
const wantWithNL = body + '\n';
|
|
217
|
+
if (existing === wantWithNL) {
|
|
218
|
+
return { path: file, action: 'unchanged' };
|
|
219
|
+
}
|
|
220
|
+
// Otherwise, marker-based section swap (preserves any user-added
|
|
221
|
+
// content outside the markers).
|
|
222
|
+
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
223
|
+
const mapped = action === 'created' ? 'created'
|
|
224
|
+
: action === 'unchanged' ? 'unchanged'
|
|
225
|
+
: 'updated';
|
|
226
|
+
return { path: file, action: mapped };
|
|
227
|
+
}
|
|
228
|
+
exports.cursorTarget = new CursorTarget();
|
|
229
|
+
//# 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,qCAQkB;AAClB,oEAIkC;AAElC,SAAS,WAAW,CAAC,GAAa;IAChC,OAAO,GAAG,KAAK,QAA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AC,EAAE,CAAC;QACzB,IAAA,4BAAmB,EAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC3C,CAAC;IAED,0DAA0D;IAC1D,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/B,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC7C,CAAC;IAED,iEAAiE;IACjE,gCAAgC;IAChC,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,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode target.
|
|
3
|
+
*
|
|
4
|
+
* - MCP server entry to `~/.config/opencode/opencode.jsonc` (global,
|
|
5
|
+
* XDG-style; `%APPDATA%/opencode/opencode.jsonc` on Windows) or
|
|
6
|
+
* `./opencode.jsonc` (local). Falls back to `opencode.json` when a
|
|
7
|
+
* `.json` file already exists; defaults new installs to `.jsonc`
|
|
8
|
+
* because that's what opencode itself creates on first run.
|
|
9
|
+
* - Instructions to `~/.config/opencode/AGENTS.md` (global) or
|
|
10
|
+
* `./AGENTS.md` (local). opencode reads AGENTS.md for agent
|
|
11
|
+
* instructions — same convention Codex CLI uses.
|
|
12
|
+
* - No permissions concept.
|
|
13
|
+
*
|
|
14
|
+
* Config shape uses opencode's wrapper:
|
|
15
|
+
* {
|
|
16
|
+
* "$schema": "https://opencode.ai/config.json",
|
|
17
|
+
* "mcp": { "codegraph": { "type": "local", "command": [...], "enabled": true } }
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* The shape differs from Claude/Cursor — opencode uses `mcp.<name>`
|
|
21
|
+
* (not `mcpServers`), takes `command` as a string array combining
|
|
22
|
+
* binary + args, and includes an explicit `enabled` flag.
|
|
23
|
+
*
|
|
24
|
+
* Reads + writes go through `jsonc-parser` so any `//` and `/* *\/`
|
|
25
|
+
* comments the user has added to their `.jsonc` survive idempotent
|
|
26
|
+
* re-runs.
|
|
27
|
+
*/
|
|
28
|
+
import { AgentTarget } from './types';
|
|
29
|
+
export declare const opencodeTarget: AgentTarget;
|
|
30
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AA6MjB,eAAO,MAAM,cAAc,EAAE,WAAkC,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* opencode target.
|
|
4
|
+
*
|
|
5
|
+
* - MCP server entry to `~/.config/opencode/opencode.jsonc` (global,
|
|
6
|
+
* XDG-style; `%APPDATA%/opencode/opencode.jsonc` on Windows) or
|
|
7
|
+
* `./opencode.jsonc` (local). Falls back to `opencode.json` when a
|
|
8
|
+
* `.json` file already exists; defaults new installs to `.jsonc`
|
|
9
|
+
* because that's what opencode itself creates on first run.
|
|
10
|
+
* - Instructions to `~/.config/opencode/AGENTS.md` (global) or
|
|
11
|
+
* `./AGENTS.md` (local). opencode reads AGENTS.md for agent
|
|
12
|
+
* instructions — same convention Codex CLI uses.
|
|
13
|
+
* - No permissions concept.
|
|
14
|
+
*
|
|
15
|
+
* Config shape uses opencode's wrapper:
|
|
16
|
+
* {
|
|
17
|
+
* "$schema": "https://opencode.ai/config.json",
|
|
18
|
+
* "mcp": { "codegraph": { "type": "local", "command": [...], "enabled": true } }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* The shape differs from Claude/Cursor — opencode uses `mcp.<name>`
|
|
22
|
+
* (not `mcpServers`), takes `command` as a string array combining
|
|
23
|
+
* binary + args, and includes an explicit `enabled` flag.
|
|
24
|
+
*
|
|
25
|
+
* Reads + writes go through `jsonc-parser` so any `//` and `/* *\/`
|
|
26
|
+
* comments the user has added to their `.jsonc` survive idempotent
|
|
27
|
+
* re-runs.
|
|
28
|
+
*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
41
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
42
|
+
}) : function(o, v) {
|
|
43
|
+
o["default"] = v;
|
|
44
|
+
});
|
|
45
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
46
|
+
var ownKeys = function(o) {
|
|
47
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
48
|
+
var ar = [];
|
|
49
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50
|
+
return ar;
|
|
51
|
+
};
|
|
52
|
+
return ownKeys(o);
|
|
53
|
+
};
|
|
54
|
+
return function (mod) {
|
|
55
|
+
if (mod && mod.__esModule) return mod;
|
|
56
|
+
var result = {};
|
|
57
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
58
|
+
__setModuleDefault(result, mod);
|
|
59
|
+
return result;
|
|
60
|
+
};
|
|
61
|
+
})();
|
|
62
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
exports.opencodeTarget = void 0;
|
|
64
|
+
const fs = __importStar(require("fs"));
|
|
65
|
+
const path = __importStar(require("path"));
|
|
66
|
+
const os = __importStar(require("os"));
|
|
67
|
+
const jsonc_parser_1 = require("jsonc-parser");
|
|
68
|
+
const shared_1 = require("./shared");
|
|
69
|
+
const instructions_template_1 = require("../instructions-template");
|
|
70
|
+
function globalConfigDir() {
|
|
71
|
+
if (process.platform === 'win32') {
|
|
72
|
+
const appData = process.env.APPDATA ?? path.join(os.homedir(), 'AppData', 'Roaming');
|
|
73
|
+
return path.join(appData, 'opencode');
|
|
74
|
+
}
|
|
75
|
+
// XDG_CONFIG_HOME if set, else ~/.config — matches opencode's docs.
|
|
76
|
+
const xdg = process.env.XDG_CONFIG_HOME && process.env.XDG_CONFIG_HOME.trim().length > 0
|
|
77
|
+
? process.env.XDG_CONFIG_HOME
|
|
78
|
+
: path.join(os.homedir(), '.config');
|
|
79
|
+
return path.join(xdg, 'opencode');
|
|
80
|
+
}
|
|
81
|
+
function configBaseDir(loc) {
|
|
82
|
+
return loc === 'global' ? globalConfigDir() : process.cwd();
|
|
83
|
+
}
|
|
84
|
+
// Pick existing .jsonc, then .json, default to .jsonc for new files.
|
|
85
|
+
// opencode auto-creates .jsonc on first run, so that's the dominant
|
|
86
|
+
// real-world case and the sensible default for greenfield installs.
|
|
87
|
+
function configPath(loc) {
|
|
88
|
+
const dir = configBaseDir(loc);
|
|
89
|
+
const jsonc = path.join(dir, 'opencode.jsonc');
|
|
90
|
+
const json = path.join(dir, 'opencode.json');
|
|
91
|
+
if (fs.existsSync(jsonc))
|
|
92
|
+
return jsonc;
|
|
93
|
+
if (fs.existsSync(json))
|
|
94
|
+
return json;
|
|
95
|
+
return jsonc;
|
|
96
|
+
}
|
|
97
|
+
function instructionsPath(loc) {
|
|
98
|
+
return path.join(configBaseDir(loc), 'AGENTS.md');
|
|
99
|
+
}
|
|
100
|
+
function readConfigText(file) {
|
|
101
|
+
if (!fs.existsSync(file))
|
|
102
|
+
return '';
|
|
103
|
+
return fs.readFileSync(file, 'utf-8');
|
|
104
|
+
}
|
|
105
|
+
function parseConfig(text) {
|
|
106
|
+
if (!text.trim())
|
|
107
|
+
return {};
|
|
108
|
+
const errors = [];
|
|
109
|
+
const result = (0, jsonc_parser_1.parse)(text, errors, { allowTrailingComma: true });
|
|
110
|
+
if (result == null || typeof result !== 'object' || Array.isArray(result)) {
|
|
111
|
+
return {};
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
function getOpencodeServerEntry() {
|
|
116
|
+
return {
|
|
117
|
+
type: 'local',
|
|
118
|
+
command: ['codegraph', 'serve', '--mcp'],
|
|
119
|
+
enabled: true,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const FORMATTING = { tabSize: 2, insertSpaces: true, eol: '\n' };
|
|
123
|
+
class OpencodeTarget {
|
|
124
|
+
id = 'opencode';
|
|
125
|
+
displayName = 'opencode';
|
|
126
|
+
docsUrl = 'https://opencode.ai/docs/config';
|
|
127
|
+
supportsLocation(_loc) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
detect(loc) {
|
|
131
|
+
const file = configPath(loc);
|
|
132
|
+
const config = parseConfig(readConfigText(file));
|
|
133
|
+
const alreadyConfigured = !!config.mcp?.codegraph;
|
|
134
|
+
const installed = loc === 'global'
|
|
135
|
+
? fs.existsSync(globalConfigDir())
|
|
136
|
+
: fs.existsSync(file);
|
|
137
|
+
return { installed, alreadyConfigured, configPath: file };
|
|
138
|
+
}
|
|
139
|
+
install(loc, _opts) {
|
|
140
|
+
const files = [];
|
|
141
|
+
files.push(writeMcpEntry(loc));
|
|
142
|
+
files.push(writeInstructionsEntry(loc));
|
|
143
|
+
return { files };
|
|
144
|
+
}
|
|
145
|
+
uninstall(loc) {
|
|
146
|
+
const files = [];
|
|
147
|
+
const file = configPath(loc);
|
|
148
|
+
if (!fs.existsSync(file)) {
|
|
149
|
+
files.push({ path: file, action: 'not-found' });
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const text = readConfigText(file);
|
|
153
|
+
const config = parseConfig(text);
|
|
154
|
+
if (!config.mcp?.codegraph) {
|
|
155
|
+
files.push({ path: file, action: 'not-found' });
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Drop our key surgically. Leaves siblings + comments untouched.
|
|
159
|
+
let edits = (0, jsonc_parser_1.modify)(text, ['mcp', 'codegraph'], undefined, {
|
|
160
|
+
formattingOptions: FORMATTING,
|
|
161
|
+
});
|
|
162
|
+
let updated = (0, jsonc_parser_1.applyEdits)(text, edits);
|
|
163
|
+
// If `mcp` is now an empty object, drop the wrapper too.
|
|
164
|
+
const afterParsed = parseConfig(updated);
|
|
165
|
+
if (afterParsed.mcp && typeof afterParsed.mcp === 'object' &&
|
|
166
|
+
Object.keys(afterParsed.mcp).length === 0) {
|
|
167
|
+
edits = (0, jsonc_parser_1.modify)(updated, ['mcp'], undefined, { formattingOptions: FORMATTING });
|
|
168
|
+
updated = (0, jsonc_parser_1.applyEdits)(updated, edits);
|
|
169
|
+
}
|
|
170
|
+
(0, shared_1.atomicWriteFileSync)(file, updated);
|
|
171
|
+
files.push({ path: file, action: 'removed' });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const instr = instructionsPath(loc);
|
|
175
|
+
const instrAction = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
176
|
+
files.push({ path: instr, action: instrAction });
|
|
177
|
+
return { files };
|
|
178
|
+
}
|
|
179
|
+
printConfig(loc) {
|
|
180
|
+
const target = configPath(loc);
|
|
181
|
+
const snippet = JSON.stringify({
|
|
182
|
+
$schema: 'https://opencode.ai/config.json',
|
|
183
|
+
mcp: { codegraph: getOpencodeServerEntry() },
|
|
184
|
+
}, null, 2);
|
|
185
|
+
return `# Add to ${target}\n\n${snippet}\n`;
|
|
186
|
+
}
|
|
187
|
+
describePaths(loc) {
|
|
188
|
+
return [configPath(loc), instructionsPath(loc)];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function writeMcpEntry(loc) {
|
|
192
|
+
const file = configPath(loc);
|
|
193
|
+
const existed = fs.existsSync(file);
|
|
194
|
+
let text = readConfigText(file);
|
|
195
|
+
// Seed a minimal opencode config when the file is brand-new so
|
|
196
|
+
// the result is a complete, schema-tagged file (not just a bare
|
|
197
|
+
// `{ "mcp": {...} }`).
|
|
198
|
+
if (!text.trim()) {
|
|
199
|
+
text = '{\n "$schema": "https://opencode.ai/config.json"\n}\n';
|
|
200
|
+
}
|
|
201
|
+
const config = parseConfig(text);
|
|
202
|
+
const before = config.mcp?.codegraph;
|
|
203
|
+
const after = getOpencodeServerEntry();
|
|
204
|
+
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
205
|
+
return { path: file, action: 'unchanged' };
|
|
206
|
+
}
|
|
207
|
+
// Add $schema if the user's existing file is missing it.
|
|
208
|
+
if (!config.$schema) {
|
|
209
|
+
const schemaEdits = (0, jsonc_parser_1.modify)(text, ['$schema'], 'https://opencode.ai/config.json', {
|
|
210
|
+
formattingOptions: FORMATTING,
|
|
211
|
+
});
|
|
212
|
+
text = (0, jsonc_parser_1.applyEdits)(text, schemaEdits);
|
|
213
|
+
}
|
|
214
|
+
// Surgical edit — preserves comments, formatting, and order of
|
|
215
|
+
// every key we don't touch.
|
|
216
|
+
const edits = (0, jsonc_parser_1.modify)(text, ['mcp', 'codegraph'], after, {
|
|
217
|
+
formattingOptions: FORMATTING,
|
|
218
|
+
});
|
|
219
|
+
const updated = (0, jsonc_parser_1.applyEdits)(text, edits);
|
|
220
|
+
(0, shared_1.atomicWriteFileSync)(file, updated);
|
|
221
|
+
return { path: file, action: existed ? 'updated' : 'created' };
|
|
222
|
+
}
|
|
223
|
+
function writeInstructionsEntry(loc) {
|
|
224
|
+
const file = instructionsPath(loc);
|
|
225
|
+
const dir = path.dirname(file);
|
|
226
|
+
if (!fs.existsSync(dir))
|
|
227
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
228
|
+
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
229
|
+
const mapped = action === 'created' ? 'created'
|
|
230
|
+
: action === 'unchanged' ? 'unchanged'
|
|
231
|
+
: 'updated';
|
|
232
|
+
return { path: file, action: mapped };
|
|
233
|
+
}
|
|
234
|
+
exports.opencodeTarget = new OpencodeTarget();
|
|
235
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/installer/targets/opencode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,+CAAuE;AAQvE,qCAKkB;AAClB,oEAIkC;AAElC,SAAS,eAAe;IACtB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;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,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry of all known agent targets.
|
|
3
|
+
*
|
|
4
|
+
* Adding a new target = create `targets/<id>.ts` exporting an
|
|
5
|
+
* `AgentTarget`, then add it to the array below. Order here is the
|
|
6
|
+
* order they appear in the multiselect prompt, in `--target=all`,
|
|
7
|
+
* and in `--print-config`'s help listing — keep it stable.
|
|
8
|
+
*/
|
|
9
|
+
import { AgentTarget, Location, TargetId } from './types';
|
|
10
|
+
export declare const ALL_TARGETS: readonly AgentTarget[];
|
|
11
|
+
export declare function getTarget(id: string): AgentTarget | undefined;
|
|
12
|
+
export declare function listTargetIds(): TargetId[];
|
|
13
|
+
/**
|
|
14
|
+
* Run `detect()` for every target at the given location. Returns the
|
|
15
|
+
* full registry zipped with detection results — orchestrator uses
|
|
16
|
+
* this to seed the multiselect prompt with installed agents
|
|
17
|
+
* pre-checked.
|
|
18
|
+
*/
|
|
19
|
+
export declare function detectAll(loc: Location): Array<{
|
|
20
|
+
target: AgentTarget;
|
|
21
|
+
detection: ReturnType<AgentTarget['detect']>;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a `--target=` flag value to a list of `AgentTarget`
|
|
25
|
+
* instances. Accepts:
|
|
26
|
+
*
|
|
27
|
+
* - `auto` — return all targets whose `detect().installed` is true,
|
|
28
|
+
* or `['claude']` as a fallback if none detected (least-surprise
|
|
29
|
+
* for existing users).
|
|
30
|
+
* - `all` — every target in the registry.
|
|
31
|
+
* - `none` — empty list (caller skips agent writes entirely).
|
|
32
|
+
* - csv list — `'claude,cursor'` etc. Unknown ids throw.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveTargetFlag(value: string, loc: Location): AgentTarget[];
|
|
35
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAM1D,eAAO,MAAM,WAAW,EAAE,SAAS,WAAW,EAK5C,CAAC;AAEH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE7D;AAED,wBAAgB,aAAa,IAAI,QAAQ,EAAE,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC9C,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9C,CAAC,CAKD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,GAAG,WAAW,EAAE,CAyB7E"}
|