@colbymchenry/codegraph 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -7
- package/npm-shim.js +43 -0
- package/package.json +13 -51
- package/LICENSE +0 -21
- package/dist/bin/codegraph.d.ts +0 -21
- package/dist/bin/codegraph.d.ts.map +0 -1
- package/dist/bin/codegraph.js +0 -1257
- package/dist/bin/codegraph.js.map +0 -1
- package/dist/bin/node-version-check.d.ts +0 -20
- package/dist/bin/node-version-check.d.ts.map +0 -1
- package/dist/bin/node-version-check.js +0 -42
- package/dist/bin/node-version-check.js.map +0 -1
- package/dist/bin/uninstall.d.ts +0 -14
- package/dist/bin/uninstall.d.ts.map +0 -1
- package/dist/bin/uninstall.js +0 -36
- package/dist/bin/uninstall.js.map +0 -1
- package/dist/config.d.ts +0 -51
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -321
- package/dist/config.js.map +0 -1
- package/dist/context/formatter.d.ts +0 -30
- package/dist/context/formatter.d.ts.map +0 -1
- package/dist/context/formatter.js +0 -244
- package/dist/context/formatter.js.map +0 -1
- package/dist/context/index.d.ts +0 -97
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -1050
- package/dist/context/index.js.map +0 -1
- package/dist/db/index.d.ts +0 -72
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js +0 -200
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts +0 -44
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js +0 -131
- package/dist/db/migrations.js.map +0 -1
- package/dist/db/queries.d.ts +0 -253
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js +0 -1207
- package/dist/db/queries.js.map +0 -1
- package/dist/db/schema.sql +0 -151
- package/dist/db/sqlite-adapter.d.ts +0 -52
- package/dist/db/sqlite-adapter.d.ts.map +0 -1
- package/dist/db/sqlite-adapter.js +0 -237
- package/dist/db/sqlite-adapter.js.map +0 -1
- package/dist/directory.d.ts +0 -57
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js +0 -264
- package/dist/directory.js.map +0 -1
- package/dist/errors.d.ts +0 -136
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -219
- package/dist/errors.js.map +0 -1
- package/dist/extraction/dfm-extractor.d.ts +0 -31
- package/dist/extraction/dfm-extractor.d.ts.map +0 -1
- package/dist/extraction/dfm-extractor.js +0 -151
- package/dist/extraction/dfm-extractor.js.map +0 -1
- package/dist/extraction/grammars.d.ts +0 -78
- package/dist/extraction/grammars.d.ts.map +0 -1
- package/dist/extraction/grammars.js +0 -322
- package/dist/extraction/grammars.js.map +0 -1
- package/dist/extraction/index.d.ts +0 -130
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/index.js +0 -1305
- package/dist/extraction/index.js.map +0 -1
- package/dist/extraction/languages/c-cpp.d.ts +0 -4
- package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
- package/dist/extraction/languages/c-cpp.js +0 -126
- package/dist/extraction/languages/c-cpp.js.map +0 -1
- package/dist/extraction/languages/csharp.d.ts +0 -3
- package/dist/extraction/languages/csharp.d.ts.map +0 -1
- package/dist/extraction/languages/csharp.js +0 -72
- package/dist/extraction/languages/csharp.js.map +0 -1
- package/dist/extraction/languages/dart.d.ts +0 -3
- package/dist/extraction/languages/dart.d.ts.map +0 -1
- package/dist/extraction/languages/dart.js +0 -192
- package/dist/extraction/languages/dart.js.map +0 -1
- package/dist/extraction/languages/go.d.ts +0 -3
- package/dist/extraction/languages/go.d.ts.map +0 -1
- package/dist/extraction/languages/go.js +0 -58
- package/dist/extraction/languages/go.js.map +0 -1
- package/dist/extraction/languages/index.d.ts +0 -10
- package/dist/extraction/languages/index.d.ts.map +0 -1
- package/dist/extraction/languages/index.js +0 -45
- package/dist/extraction/languages/index.js.map +0 -1
- package/dist/extraction/languages/java.d.ts +0 -3
- package/dist/extraction/languages/java.d.ts.map +0 -1
- package/dist/extraction/languages/java.js +0 -64
- package/dist/extraction/languages/java.js.map +0 -1
- package/dist/extraction/languages/javascript.d.ts +0 -3
- package/dist/extraction/languages/javascript.d.ts.map +0 -1
- package/dist/extraction/languages/javascript.js +0 -90
- package/dist/extraction/languages/javascript.js.map +0 -1
- package/dist/extraction/languages/kotlin.d.ts +0 -3
- package/dist/extraction/languages/kotlin.d.ts.map +0 -1
- package/dist/extraction/languages/kotlin.js +0 -253
- package/dist/extraction/languages/kotlin.js.map +0 -1
- package/dist/extraction/languages/pascal.d.ts +0 -3
- package/dist/extraction/languages/pascal.d.ts.map +0 -1
- package/dist/extraction/languages/pascal.js +0 -66
- package/dist/extraction/languages/pascal.js.map +0 -1
- package/dist/extraction/languages/php.d.ts +0 -3
- package/dist/extraction/languages/php.d.ts.map +0 -1
- package/dist/extraction/languages/php.js +0 -107
- package/dist/extraction/languages/php.js.map +0 -1
- package/dist/extraction/languages/python.d.ts +0 -3
- package/dist/extraction/languages/python.d.ts.map +0 -1
- package/dist/extraction/languages/python.js +0 -56
- package/dist/extraction/languages/python.js.map +0 -1
- package/dist/extraction/languages/ruby.d.ts +0 -3
- package/dist/extraction/languages/ruby.d.ts.map +0 -1
- package/dist/extraction/languages/ruby.js +0 -114
- package/dist/extraction/languages/ruby.js.map +0 -1
- package/dist/extraction/languages/rust.d.ts +0 -3
- package/dist/extraction/languages/rust.d.ts.map +0 -1
- package/dist/extraction/languages/rust.js +0 -109
- package/dist/extraction/languages/rust.js.map +0 -1
- package/dist/extraction/languages/scala.d.ts +0 -3
- package/dist/extraction/languages/scala.d.ts.map +0 -1
- package/dist/extraction/languages/scala.js +0 -139
- package/dist/extraction/languages/scala.js.map +0 -1
- package/dist/extraction/languages/swift.d.ts +0 -3
- package/dist/extraction/languages/swift.d.ts.map +0 -1
- package/dist/extraction/languages/swift.js +0 -91
- package/dist/extraction/languages/swift.js.map +0 -1
- package/dist/extraction/languages/typescript.d.ts +0 -3
- package/dist/extraction/languages/typescript.d.ts.map +0 -1
- package/dist/extraction/languages/typescript.js +0 -129
- package/dist/extraction/languages/typescript.js.map +0 -1
- package/dist/extraction/liquid-extractor.d.ts +0 -52
- package/dist/extraction/liquid-extractor.d.ts.map +0 -1
- package/dist/extraction/liquid-extractor.js +0 -313
- package/dist/extraction/liquid-extractor.js.map +0 -1
- package/dist/extraction/parse-worker.d.ts +0 -8
- package/dist/extraction/parse-worker.d.ts.map +0 -1
- package/dist/extraction/parse-worker.js +0 -94
- package/dist/extraction/parse-worker.js.map +0 -1
- package/dist/extraction/svelte-extractor.d.ts +0 -56
- package/dist/extraction/svelte-extractor.d.ts.map +0 -1
- package/dist/extraction/svelte-extractor.js +0 -272
- package/dist/extraction/svelte-extractor.js.map +0 -1
- package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
- package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-helpers.js +0 -103
- package/dist/extraction/tree-sitter-helpers.js.map +0 -1
- package/dist/extraction/tree-sitter-types.d.ts +0 -179
- package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-types.js +0 -10
- package/dist/extraction/tree-sitter-types.js.map +0 -1
- package/dist/extraction/tree-sitter.d.ts +0 -233
- package/dist/extraction/tree-sitter.d.ts.map +0 -1
- package/dist/extraction/tree-sitter.js +0 -2393
- package/dist/extraction/tree-sitter.js.map +0 -1
- package/dist/extraction/vue-extractor.d.ts +0 -36
- package/dist/extraction/vue-extractor.d.ts.map +0 -1
- package/dist/extraction/vue-extractor.js +0 -163
- package/dist/extraction/vue-extractor.js.map +0 -1
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/graph/index.d.ts +0 -8
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -13
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/queries.d.ts +0 -106
- package/dist/graph/queries.d.ts.map +0 -1
- package/dist/graph/queries.js +0 -366
- package/dist/graph/queries.js.map +0 -1
- package/dist/graph/traversal.d.ts +0 -127
- package/dist/graph/traversal.d.ts.map +0 -1
- package/dist/graph/traversal.js +0 -493
- package/dist/graph/traversal.js.map +0 -1
- package/dist/index.d.ts +0 -447
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -825
- package/dist/index.js.map +0 -1
- package/dist/installer/claude-md-template.d.ts +0 -14
- package/dist/installer/claude-md-template.d.ts.map +0 -1
- package/dist/installer/claude-md-template.js +0 -21
- package/dist/installer/claude-md-template.js.map +0 -1
- package/dist/installer/config-writer.d.ts +0 -29
- package/dist/installer/config-writer.d.ts.map +0 -1
- package/dist/installer/config-writer.js +0 -111
- package/dist/installer/config-writer.js.map +0 -1
- package/dist/installer/index.d.ts +0 -65
- package/dist/installer/index.d.ts.map +0 -1
- package/dist/installer/index.js +0 -406
- package/dist/installer/index.js.map +0 -1
- package/dist/installer/instructions-template.d.ts +0 -28
- package/dist/installer/instructions-template.d.ts.map +0 -1
- package/dist/installer/instructions-template.js +0 -64
- package/dist/installer/instructions-template.js.map +0 -1
- package/dist/installer/targets/claude.d.ts +0 -31
- package/dist/installer/targets/claude.d.ts.map +0 -1
- package/dist/installer/targets/claude.js +0 -308
- package/dist/installer/targets/claude.js.map +0 -1
- package/dist/installer/targets/codex.d.ts +0 -18
- package/dist/installer/targets/codex.d.ts.map +0 -1
- package/dist/installer/targets/codex.js +0 -185
- package/dist/installer/targets/codex.js.map +0 -1
- package/dist/installer/targets/cursor.d.ts +0 -35
- package/dist/installer/targets/cursor.d.ts.map +0 -1
- package/dist/installer/targets/cursor.js +0 -229
- package/dist/installer/targets/cursor.js.map +0 -1
- package/dist/installer/targets/opencode.d.ts +0 -30
- package/dist/installer/targets/opencode.d.ts.map +0 -1
- package/dist/installer/targets/opencode.js +0 -235
- package/dist/installer/targets/opencode.js.map +0 -1
- package/dist/installer/targets/registry.d.ts +0 -35
- package/dist/installer/targets/registry.d.ts.map +0 -1
- package/dist/installer/targets/registry.js +0 -83
- package/dist/installer/targets/registry.js.map +0 -1
- package/dist/installer/targets/shared.d.ts +0 -77
- package/dist/installer/targets/shared.d.ts.map +0 -1
- package/dist/installer/targets/shared.js +0 -246
- package/dist/installer/targets/shared.js.map +0 -1
- package/dist/installer/targets/toml.d.ts +0 -52
- package/dist/installer/targets/toml.d.ts.map +0 -1
- package/dist/installer/targets/toml.js +0 -147
- package/dist/installer/targets/toml.js.map +0 -1
- package/dist/installer/targets/types.d.ts +0 -116
- package/dist/installer/targets/types.d.ts.map +0 -1
- package/dist/installer/targets/types.js +0 -16
- package/dist/installer/targets/types.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -94
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -453
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/server-instructions.d.ts +0 -19
- package/dist/mcp/server-instructions.d.ts.map +0 -1
- package/dist/mcp/server-instructions.js +0 -71
- package/dist/mcp/server-instructions.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -257
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -1633
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -106
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -233
- package/dist/mcp/transport.js.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.js +0 -225
- package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
- package/dist/resolution/frameworks/csharp.d.ts +0 -8
- package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
- package/dist/resolution/frameworks/csharp.js +0 -213
- package/dist/resolution/frameworks/csharp.js.map +0 -1
- package/dist/resolution/frameworks/express.d.ts +0 -8
- package/dist/resolution/frameworks/express.d.ts.map +0 -1
- package/dist/resolution/frameworks/express.js +0 -225
- package/dist/resolution/frameworks/express.js.map +0 -1
- package/dist/resolution/frameworks/go.d.ts +0 -8
- package/dist/resolution/frameworks/go.d.ts.map +0 -1
- package/dist/resolution/frameworks/go.js +0 -158
- package/dist/resolution/frameworks/go.js.map +0 -1
- package/dist/resolution/frameworks/index.d.ts +0 -42
- package/dist/resolution/frameworks/index.d.ts.map +0 -1
- package/dist/resolution/frameworks/index.js +0 -133
- package/dist/resolution/frameworks/index.js.map +0 -1
- package/dist/resolution/frameworks/java.d.ts +0 -8
- package/dist/resolution/frameworks/java.d.ts.map +0 -1
- package/dist/resolution/frameworks/java.js +0 -177
- package/dist/resolution/frameworks/java.js.map +0 -1
- package/dist/resolution/frameworks/laravel.d.ts +0 -13
- package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
- package/dist/resolution/frameworks/laravel.js +0 -248
- package/dist/resolution/frameworks/laravel.js.map +0 -1
- package/dist/resolution/frameworks/nestjs.d.ts +0 -26
- package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
- package/dist/resolution/frameworks/nestjs.js +0 -374
- package/dist/resolution/frameworks/nestjs.js.map +0 -1
- package/dist/resolution/frameworks/python.d.ts +0 -10
- package/dist/resolution/frameworks/python.d.ts.map +0 -1
- package/dist/resolution/frameworks/python.js +0 -278
- package/dist/resolution/frameworks/python.js.map +0 -1
- package/dist/resolution/frameworks/react.d.ts +0 -8
- package/dist/resolution/frameworks/react.d.ts.map +0 -1
- package/dist/resolution/frameworks/react.js +0 -272
- package/dist/resolution/frameworks/react.js.map +0 -1
- package/dist/resolution/frameworks/ruby.d.ts +0 -8
- package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
- package/dist/resolution/frameworks/ruby.js +0 -198
- package/dist/resolution/frameworks/ruby.js.map +0 -1
- package/dist/resolution/frameworks/rust.d.ts +0 -8
- package/dist/resolution/frameworks/rust.d.ts.map +0 -1
- package/dist/resolution/frameworks/rust.js +0 -207
- package/dist/resolution/frameworks/rust.js.map +0 -1
- package/dist/resolution/frameworks/svelte.d.ts +0 -9
- package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
- package/dist/resolution/frameworks/svelte.js +0 -249
- package/dist/resolution/frameworks/svelte.js.map +0 -1
- package/dist/resolution/frameworks/swift.d.ts +0 -10
- package/dist/resolution/frameworks/swift.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift.js +0 -376
- package/dist/resolution/frameworks/swift.js.map +0 -1
- package/dist/resolution/frameworks/vue.d.ts +0 -9
- package/dist/resolution/frameworks/vue.d.ts.map +0 -1
- package/dist/resolution/frameworks/vue.js +0 -306
- package/dist/resolution/frameworks/vue.js.map +0 -1
- package/dist/resolution/import-resolver.d.ts +0 -40
- package/dist/resolution/import-resolver.d.ts.map +0 -1
- package/dist/resolution/import-resolver.js +0 -663
- package/dist/resolution/import-resolver.js.map +0 -1
- package/dist/resolution/index.d.ts +0 -106
- package/dist/resolution/index.d.ts.map +0 -1
- package/dist/resolution/index.js +0 -709
- package/dist/resolution/index.js.map +0 -1
- package/dist/resolution/name-matcher.d.ts +0 -32
- package/dist/resolution/name-matcher.d.ts.map +0 -1
- package/dist/resolution/name-matcher.js +0 -384
- package/dist/resolution/name-matcher.js.map +0 -1
- package/dist/resolution/path-aliases.d.ts +0 -68
- package/dist/resolution/path-aliases.d.ts.map +0 -1
- package/dist/resolution/path-aliases.js +0 -238
- package/dist/resolution/path-aliases.js.map +0 -1
- package/dist/resolution/strip-comments.d.ts +0 -27
- package/dist/resolution/strip-comments.d.ts.map +0 -1
- package/dist/resolution/strip-comments.js +0 -441
- package/dist/resolution/strip-comments.js.map +0 -1
- package/dist/resolution/types.d.ts +0 -172
- package/dist/resolution/types.d.ts.map +0 -1
- package/dist/resolution/types.js +0 -8
- package/dist/resolution/types.js.map +0 -1
- package/dist/search/query-parser.d.ts +0 -57
- package/dist/search/query-parser.d.ts.map +0 -1
- package/dist/search/query-parser.js +0 -177
- package/dist/search/query-parser.js.map +0 -1
- package/dist/search/query-utils.d.ts +0 -53
- package/dist/search/query-utils.d.ts.map +0 -1
- package/dist/search/query-utils.js +0 -350
- package/dist/search/query-utils.js.map +0 -1
- package/dist/sync/git-hooks.d.ts +0 -45
- package/dist/sync/git-hooks.d.ts.map +0 -1
- package/dist/sync/git-hooks.js +0 -223
- package/dist/sync/git-hooks.js.map +0 -1
- package/dist/sync/index.d.ts +0 -17
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js +0 -28
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/watch-policy.d.ts +0 -48
- package/dist/sync/watch-policy.d.ts.map +0 -1
- package/dist/sync/watch-policy.js +0 -124
- package/dist/sync/watch-policy.js.map +0 -1
- package/dist/sync/watcher.d.ts +0 -81
- package/dist/sync/watcher.d.ts.map +0 -1
- package/dist/sync/watcher.js +0 -194
- package/dist/sync/watcher.js.map +0 -1
- package/dist/types.d.ts +0 -423
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -256
- package/dist/types.js.map +0 -1
- package/dist/ui/glyphs.d.ts +0 -42
- package/dist/ui/glyphs.d.ts.map +0 -1
- package/dist/ui/glyphs.js +0 -78
- package/dist/ui/glyphs.js.map +0 -1
- package/dist/ui/shimmer-progress.d.ts +0 -11
- package/dist/ui/shimmer-progress.d.ts.map +0 -1
- package/dist/ui/shimmer-progress.js +0 -90
- package/dist/ui/shimmer-progress.js.map +0 -1
- package/dist/ui/shimmer-worker.d.ts +0 -2
- package/dist/ui/shimmer-worker.d.ts.map +0 -1
- package/dist/ui/shimmer-worker.js +0 -118
- package/dist/ui/shimmer-worker.js.map +0 -1
- package/dist/ui/types.d.ts +0 -17
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js +0 -3
- package/dist/ui/types.js.map +0 -1
- package/dist/utils.d.ts +0 -205
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -549
- package/dist/utils.js.map +0 -1
- package/scripts/agent-eval/audit.sh +0 -68
- package/scripts/agent-eval/itrun.sh +0 -107
- package/scripts/agent-eval/parse-run.mjs +0 -45
- package/scripts/agent-eval/parse-session.mjs +0 -93
- package/scripts/agent-eval/run-agent.sh +0 -34
- package/scripts/agent-eval/run-all.sh +0 -67
- package/scripts/extract-release-notes.mjs +0 -130
- package/scripts/local-install.sh +0 -41
- package/scripts/patch-tree-sitter-dart.js +0 -112
- package/scripts/release.sh +0 -68
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Claude Code target. Writes:
|
|
4
|
-
*
|
|
5
|
-
* - MCP server entry to `~/.claude.json` (global = user scope, loads
|
|
6
|
-
* in every project) or `./.mcp.json` (local = project scope, the
|
|
7
|
-
* file Claude Code actually reads for a single project). See the
|
|
8
|
-
* scope table at https://code.claude.com/docs/en/mcp.
|
|
9
|
-
* - Permissions to `~/.claude/settings.json` (global) or
|
|
10
|
-
* `./.claude/settings.json` (local), gated on `autoAllow`.
|
|
11
|
-
* - Instructions to `~/.claude/CLAUDE.md` (global) or
|
|
12
|
-
* `./.claude/CLAUDE.md` (local).
|
|
13
|
-
*
|
|
14
|
-
* Earlier versions wrote the local MCP entry to `./.claude.json` — a
|
|
15
|
-
* file Claude Code never reads — so the server silently never loaded
|
|
16
|
-
* until the user manually renamed it to `.mcp.json` (issue #207). We
|
|
17
|
-
* now write `./.mcp.json` and migrate any stale `./.claude.json` entry
|
|
18
|
-
* out of the way on install and uninstall.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(o, k2, desc);
|
|
27
|
-
}) : (function(o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
o[k2] = m[k];
|
|
30
|
-
}));
|
|
31
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
32
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
33
|
-
}) : function(o, v) {
|
|
34
|
-
o["default"] = v;
|
|
35
|
-
});
|
|
36
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
37
|
-
var ownKeys = function(o) {
|
|
38
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
39
|
-
var ar = [];
|
|
40
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
41
|
-
return ar;
|
|
42
|
-
};
|
|
43
|
-
return ownKeys(o);
|
|
44
|
-
};
|
|
45
|
-
return function (mod) {
|
|
46
|
-
if (mod && mod.__esModule) return mod;
|
|
47
|
-
var result = {};
|
|
48
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
49
|
-
__setModuleDefault(result, mod);
|
|
50
|
-
return result;
|
|
51
|
-
};
|
|
52
|
-
})();
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.claudeTarget = void 0;
|
|
55
|
-
exports.writeMcpEntry = writeMcpEntry;
|
|
56
|
-
exports.writePermissionsEntry = writePermissionsEntry;
|
|
57
|
-
exports.writeInstructionsEntry = writeInstructionsEntry;
|
|
58
|
-
const fs = __importStar(require("fs"));
|
|
59
|
-
const path = __importStar(require("path"));
|
|
60
|
-
const os = __importStar(require("os"));
|
|
61
|
-
const shared_1 = require("./shared");
|
|
62
|
-
const instructions_template_1 = require("../instructions-template");
|
|
63
|
-
function configDir(loc) {
|
|
64
|
-
return loc === 'global'
|
|
65
|
-
? path.join(os.homedir(), '.claude')
|
|
66
|
-
: path.join(process.cwd(), '.claude');
|
|
67
|
-
}
|
|
68
|
-
function mcpJsonPath(loc) {
|
|
69
|
-
// global → ~/.claude.json (user scope: visible in every project).
|
|
70
|
-
// local → ./.mcp.json (project scope: the ONLY project-level MCP
|
|
71
|
-
// file Claude Code reads — NOT ./.claude.json, which it ignores).
|
|
72
|
-
return loc === 'global'
|
|
73
|
-
? path.join(os.homedir(), '.claude.json')
|
|
74
|
-
: path.join(process.cwd(), '.mcp.json');
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Where pre-#207 installers wrote the local MCP entry. Claude Code
|
|
78
|
-
* never reads a project-level `./.claude.json`, so we migrate the
|
|
79
|
-
* codegraph entry out of it on install and strip it on uninstall.
|
|
80
|
-
* Only the project-local path is legacy — global `~/.claude.json` is
|
|
81
|
-
* the correct user-scope location and is left untouched.
|
|
82
|
-
*/
|
|
83
|
-
function legacyLocalMcpPath() {
|
|
84
|
-
return path.join(process.cwd(), '.claude.json');
|
|
85
|
-
}
|
|
86
|
-
function settingsJsonPath(loc) {
|
|
87
|
-
return path.join(configDir(loc), 'settings.json');
|
|
88
|
-
}
|
|
89
|
-
function instructionsPath(loc) {
|
|
90
|
-
return path.join(configDir(loc), 'CLAUDE.md');
|
|
91
|
-
}
|
|
92
|
-
class ClaudeCodeTarget {
|
|
93
|
-
id = 'claude';
|
|
94
|
-
displayName = 'Claude Code';
|
|
95
|
-
docsUrl = 'https://docs.claude.com/en/docs/claude-code';
|
|
96
|
-
supportsLocation(_loc) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
detect(loc) {
|
|
100
|
-
const mcpPath = mcpJsonPath(loc);
|
|
101
|
-
const config = (0, shared_1.readJsonFile)(mcpPath);
|
|
102
|
-
const alreadyConfigured = !!config.mcpServers?.codegraph;
|
|
103
|
-
// For "installed" we infer from the existence of either the dir
|
|
104
|
-
// (global) or the project marker file (local). Cheap and avoids
|
|
105
|
-
// shelling out to `claude --version`.
|
|
106
|
-
const installed = loc === 'global'
|
|
107
|
-
? fs.existsSync(configDir(loc)) || fs.existsSync(mcpPath)
|
|
108
|
-
: fs.existsSync(mcpPath) || fs.existsSync(configDir(loc));
|
|
109
|
-
return { installed, alreadyConfigured, configPath: mcpPath };
|
|
110
|
-
}
|
|
111
|
-
install(loc, opts) {
|
|
112
|
-
const files = [];
|
|
113
|
-
// 1. MCP server entry
|
|
114
|
-
files.push(writeMcpEntry(loc));
|
|
115
|
-
// 1b. Migrate away any stale ./.claude.json left by a pre-#207
|
|
116
|
-
// local install, so the project isn't left with two competing
|
|
117
|
-
// (one dead) MCP configs.
|
|
118
|
-
if (loc === 'local') {
|
|
119
|
-
const migrated = cleanupLegacyLocalMcp();
|
|
120
|
-
if (migrated)
|
|
121
|
-
files.push(migrated);
|
|
122
|
-
}
|
|
123
|
-
// 2. Permissions (only when autoAllow)
|
|
124
|
-
if (opts.autoAllow) {
|
|
125
|
-
files.push(writePermissionsEntry(loc));
|
|
126
|
-
}
|
|
127
|
-
// 3. CLAUDE.md instructions
|
|
128
|
-
files.push(writeInstructionsEntry(loc));
|
|
129
|
-
return { files };
|
|
130
|
-
}
|
|
131
|
-
uninstall(loc) {
|
|
132
|
-
const files = [];
|
|
133
|
-
// 1. MCP server entry
|
|
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
|
-
// 1b. Also strip the codegraph entry from a legacy ./.claude.json
|
|
148
|
-
// so uninstall fully reverses a pre-#207 local install.
|
|
149
|
-
if (loc === 'local') {
|
|
150
|
-
const migrated = cleanupLegacyLocalMcp();
|
|
151
|
-
if (migrated)
|
|
152
|
-
files.push(migrated);
|
|
153
|
-
}
|
|
154
|
-
// 2. Permissions
|
|
155
|
-
const settingsPath = settingsJsonPath(loc);
|
|
156
|
-
const settings = (0, shared_1.readJsonFile)(settingsPath);
|
|
157
|
-
if (Array.isArray(settings.permissions?.allow)) {
|
|
158
|
-
const before = settings.permissions.allow.length;
|
|
159
|
-
settings.permissions.allow = settings.permissions.allow.filter((p) => !p.startsWith('mcp__codegraph__'));
|
|
160
|
-
if (settings.permissions.allow.length !== before) {
|
|
161
|
-
if (settings.permissions.allow.length === 0) {
|
|
162
|
-
delete settings.permissions.allow;
|
|
163
|
-
}
|
|
164
|
-
if (Object.keys(settings.permissions).length === 0) {
|
|
165
|
-
delete settings.permissions;
|
|
166
|
-
}
|
|
167
|
-
(0, shared_1.writeJsonFile)(settingsPath, settings);
|
|
168
|
-
files.push({ path: settingsPath, action: 'removed' });
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
files.push({ path: settingsPath, action: 'not-found' });
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
files.push({ path: settingsPath, action: 'not-found' });
|
|
176
|
-
}
|
|
177
|
-
// 3. Instructions
|
|
178
|
-
const instr = instructionsPath(loc);
|
|
179
|
-
const action = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
180
|
-
files.push({ path: instr, action });
|
|
181
|
-
return { files };
|
|
182
|
-
}
|
|
183
|
-
printConfig(loc) {
|
|
184
|
-
const target = mcpJsonPath(loc);
|
|
185
|
-
const snippet = JSON.stringify({ mcpServers: { codegraph: (0, shared_1.getMcpServerConfig)() } }, null, 2);
|
|
186
|
-
return `# Add to ${target}\n\n${snippet}\n`;
|
|
187
|
-
}
|
|
188
|
-
describePaths(loc) {
|
|
189
|
-
return [mcpJsonPath(loc), settingsJsonPath(loc), instructionsPath(loc)];
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Per-file write helpers, exported so the legacy `config-writer.ts`
|
|
194
|
-
* shim can call only the named operation (writeMcpConfig writes ONLY
|
|
195
|
-
* the MCP entry, etc.) instead of `claudeTarget.install()` which
|
|
196
|
-
* writes all three files. Without this split the shims silently
|
|
197
|
-
* cause side effects callers don't expect.
|
|
198
|
-
*/
|
|
199
|
-
function writeMcpEntry(loc) {
|
|
200
|
-
const file = mcpJsonPath(loc);
|
|
201
|
-
const existing = (0, shared_1.readJsonFile)(file);
|
|
202
|
-
const before = existing.mcpServers?.codegraph;
|
|
203
|
-
const after = (0, shared_1.getMcpServerConfig)();
|
|
204
|
-
if ((0, shared_1.jsonDeepEqual)(before, after)) {
|
|
205
|
-
// Already exactly what we'd write — preserve byte-identical file.
|
|
206
|
-
return { path: file, action: 'unchanged' };
|
|
207
|
-
}
|
|
208
|
-
// 'created' here means: the file itself did not exist before this
|
|
209
|
-
// write. A pre-existing MCP JSON file (`~/.claude.json` globally,
|
|
210
|
-
// `./.mcp.json` locally) containing other MCP servers (no
|
|
211
|
-
// `codegraph` key) is 'updated', not 'created' — we're adding an
|
|
212
|
-
// entry to a file that was already there. Codex uses a different
|
|
213
|
-
// idiom (empty-content => 'created') because its config.toml is
|
|
214
|
-
// ours alone to manage.
|
|
215
|
-
const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
|
|
216
|
-
if (!existing.mcpServers)
|
|
217
|
-
existing.mcpServers = {};
|
|
218
|
-
existing.mcpServers.codegraph = after;
|
|
219
|
-
(0, shared_1.writeJsonFile)(file, existing);
|
|
220
|
-
return { path: file, action };
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Strip the codegraph entry from a legacy project-local
|
|
224
|
-
* `./.claude.json` (written by pre-#207 installers, which Claude Code
|
|
225
|
-
* never read). Surgical: only our `codegraph` key is removed; sibling
|
|
226
|
-
* MCP servers and any unrelated keys are preserved, and the file is
|
|
227
|
-
* deleted only when removal leaves it completely empty. Returns the
|
|
228
|
-
* file action for reporting, or `null` when there's nothing to migrate.
|
|
229
|
-
*/
|
|
230
|
-
function cleanupLegacyLocalMcp() {
|
|
231
|
-
const file = legacyLocalMcpPath();
|
|
232
|
-
if (!fs.existsSync(file))
|
|
233
|
-
return null;
|
|
234
|
-
const config = (0, shared_1.readJsonFile)(file);
|
|
235
|
-
if (!config.mcpServers?.codegraph)
|
|
236
|
-
return null;
|
|
237
|
-
delete config.mcpServers.codegraph;
|
|
238
|
-
if (Object.keys(config.mcpServers).length === 0)
|
|
239
|
-
delete config.mcpServers;
|
|
240
|
-
if (Object.keys(config).length === 0) {
|
|
241
|
-
try {
|
|
242
|
-
fs.unlinkSync(file);
|
|
243
|
-
}
|
|
244
|
-
catch { /* ignore */ }
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
(0, shared_1.writeJsonFile)(file, config);
|
|
248
|
-
}
|
|
249
|
-
return { path: file, action: 'removed' };
|
|
250
|
-
}
|
|
251
|
-
function writePermissionsEntry(loc) {
|
|
252
|
-
const file = settingsJsonPath(loc);
|
|
253
|
-
const settings = (0, shared_1.readJsonFile)(file);
|
|
254
|
-
const created = !fs.existsSync(file);
|
|
255
|
-
if (!settings.permissions)
|
|
256
|
-
settings.permissions = {};
|
|
257
|
-
if (!Array.isArray(settings.permissions.allow))
|
|
258
|
-
settings.permissions.allow = [];
|
|
259
|
-
const want = (0, shared_1.getCodeGraphPermissions)();
|
|
260
|
-
const before = [...settings.permissions.allow];
|
|
261
|
-
for (const perm of want) {
|
|
262
|
-
if (!settings.permissions.allow.includes(perm)) {
|
|
263
|
-
settings.permissions.allow.push(perm);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if ((0, shared_1.jsonDeepEqual)(before, settings.permissions.allow) && !created) {
|
|
267
|
-
return { path: file, action: 'unchanged' };
|
|
268
|
-
}
|
|
269
|
-
(0, shared_1.writeJsonFile)(file, settings);
|
|
270
|
-
return { path: file, action: created ? 'created' : 'updated' };
|
|
271
|
-
}
|
|
272
|
-
function writeInstructionsEntry(loc) {
|
|
273
|
-
const file = instructionsPath(loc);
|
|
274
|
-
// Ensure config dir exists (for global ~/.claude/).
|
|
275
|
-
const dir = path.dirname(file);
|
|
276
|
-
if (!fs.existsSync(dir))
|
|
277
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
278
|
-
// Honor the legacy "unmarked ## CodeGraph" rewrite path that the
|
|
279
|
-
// original installer supported (some users hand-pasted a section
|
|
280
|
-
// before markers existed). Detect first and migrate inline.
|
|
281
|
-
if (fs.existsSync(file)) {
|
|
282
|
-
const content = fs.readFileSync(file, 'utf-8');
|
|
283
|
-
if (!content.includes(instructions_template_1.CODEGRAPH_SECTION_START)) {
|
|
284
|
-
const headerMatch = content.match(/\n## CodeGraph\n/);
|
|
285
|
-
if (headerMatch && headerMatch.index !== undefined) {
|
|
286
|
-
const sectionStart = headerMatch.index;
|
|
287
|
-
const after = content.substring(sectionStart + 1);
|
|
288
|
-
const nextHeader = after.match(/\n## (?!#)/);
|
|
289
|
-
const sectionEnd = nextHeader && nextHeader.index !== undefined
|
|
290
|
-
? sectionStart + 1 + nextHeader.index
|
|
291
|
-
: content.length;
|
|
292
|
-
const merged = content.substring(0, sectionStart) +
|
|
293
|
-
'\n' + instructions_template_1.INSTRUCTIONS_TEMPLATE +
|
|
294
|
-
content.substring(sectionEnd);
|
|
295
|
-
(0, shared_1.atomicWriteFileSync)(file, merged);
|
|
296
|
-
return { path: file, action: 'updated' };
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
301
|
-
// Map the four-state action to WriteResult's action vocabulary.
|
|
302
|
-
const mapped = action === 'created' ? 'created'
|
|
303
|
-
: action === 'unchanged' ? 'unchanged'
|
|
304
|
-
: 'updated';
|
|
305
|
-
return { path: file, action: mapped };
|
|
306
|
-
}
|
|
307
|
-
exports.claudeTarget = new ClaudeCodeTarget();
|
|
308
|
-
//# sourceMappingURL=claude.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/installer/targets/claude.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmLH,sCAsBC;AAyBD,sDAoBC;AAED,wDA0CC;AAhSD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCASkB;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,WAAW,CAAC,GAAa;IAChC,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,OAAO,GAAG,KAAK,QAAQ;QACrB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC;QACzC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC;AACD;;;;;;GAMG;AACH,SAAS,kBAAkB;IACzB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;AAClD,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAa;IACrC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC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gBACnB,MAAM,MAAM,GACV,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC;oBAClC,IAAI,GAAG,6CAAqB;oBAC5B,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBAChC,IAAA,4BAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBAClC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,qCAA4B,EACzC,IAAI,EACJ,6CAAqB,EACrB,+CAAuB,EACvB,6CAAqB,CACtB,CAAC;IACF,gEAAgE;IAChE,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,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenAI Codex CLI target.
|
|
3
|
-
*
|
|
4
|
-
* - MCP server entry to `~/.codex/config.toml` as the dotted-key
|
|
5
|
-
* table `[mcp_servers.codegraph]`. TOML — not JSON — handled by
|
|
6
|
-
* the narrow serializer in `./toml.ts`.
|
|
7
|
-
* - Instructions to `~/.codex/AGENTS.md`.
|
|
8
|
-
*
|
|
9
|
-
* Codex CLI as of 2026-05 has no project-local config concept —
|
|
10
|
-
* everything lives under `~/.codex/`. `supportsLocation('local')`
|
|
11
|
-
* returns false; the orchestrator skips Codex when the user picks
|
|
12
|
-
* the local install location.
|
|
13
|
-
*
|
|
14
|
-
* No permissions concept.
|
|
15
|
-
*/
|
|
16
|
-
import { AgentTarget } from './types';
|
|
17
|
-
export declare const codexTarget: AgentTarget;
|
|
18
|
-
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AA2JjB,eAAO,MAAM,WAAW,EAAE,WAA+B,CAAC"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* OpenAI Codex CLI target.
|
|
4
|
-
*
|
|
5
|
-
* - MCP server entry to `~/.codex/config.toml` as the dotted-key
|
|
6
|
-
* table `[mcp_servers.codegraph]`. TOML — not JSON — handled by
|
|
7
|
-
* the narrow serializer in `./toml.ts`.
|
|
8
|
-
* - Instructions to `~/.codex/AGENTS.md`.
|
|
9
|
-
*
|
|
10
|
-
* Codex CLI as of 2026-05 has no project-local config concept —
|
|
11
|
-
* everything lives under `~/.codex/`. `supportsLocation('local')`
|
|
12
|
-
* returns false; the orchestrator skips Codex when the user picks
|
|
13
|
-
* the local install location.
|
|
14
|
-
*
|
|
15
|
-
* No permissions concept.
|
|
16
|
-
*/
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
-
var ownKeys = function(o) {
|
|
35
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
-
var ar = [];
|
|
37
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
-
return ar;
|
|
39
|
-
};
|
|
40
|
-
return ownKeys(o);
|
|
41
|
-
};
|
|
42
|
-
return function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
})();
|
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.codexTarget = void 0;
|
|
52
|
-
const fs = __importStar(require("fs"));
|
|
53
|
-
const path = __importStar(require("path"));
|
|
54
|
-
const os = __importStar(require("os"));
|
|
55
|
-
const shared_1 = require("./shared");
|
|
56
|
-
const instructions_template_1 = require("../instructions-template");
|
|
57
|
-
const toml_1 = require("./toml");
|
|
58
|
-
const TOML_HEADER = 'mcp_servers.codegraph';
|
|
59
|
-
function configDir() {
|
|
60
|
-
return path.join(os.homedir(), '.codex');
|
|
61
|
-
}
|
|
62
|
-
function tomlConfigPath() {
|
|
63
|
-
return path.join(configDir(), 'config.toml');
|
|
64
|
-
}
|
|
65
|
-
function instructionsPath() {
|
|
66
|
-
return path.join(configDir(), 'AGENTS.md');
|
|
67
|
-
}
|
|
68
|
-
class CodexTarget {
|
|
69
|
-
id = 'codex';
|
|
70
|
-
displayName = 'Codex CLI';
|
|
71
|
-
docsUrl = 'https://github.com/openai/codex';
|
|
72
|
-
supportsLocation(loc) {
|
|
73
|
-
return loc === 'global';
|
|
74
|
-
}
|
|
75
|
-
detect(loc) {
|
|
76
|
-
if (loc !== 'global') {
|
|
77
|
-
return { installed: false, alreadyConfigured: false };
|
|
78
|
-
}
|
|
79
|
-
const tomlPath = tomlConfigPath();
|
|
80
|
-
let alreadyConfigured = false;
|
|
81
|
-
if (fs.existsSync(tomlPath)) {
|
|
82
|
-
try {
|
|
83
|
-
const content = fs.readFileSync(tomlPath, 'utf-8');
|
|
84
|
-
alreadyConfigured = content.includes(`[${TOML_HEADER}]`);
|
|
85
|
-
}
|
|
86
|
-
catch { /* ignore */ }
|
|
87
|
-
}
|
|
88
|
-
const installed = fs.existsSync(configDir());
|
|
89
|
-
return { installed, alreadyConfigured, configPath: tomlPath };
|
|
90
|
-
}
|
|
91
|
-
install(loc, _opts) {
|
|
92
|
-
if (loc !== 'global') {
|
|
93
|
-
return {
|
|
94
|
-
files: [],
|
|
95
|
-
notes: ['Codex CLI has no project-local config — re-run with --location=global to install.'],
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
const files = [];
|
|
99
|
-
files.push(writeMcpEntry());
|
|
100
|
-
files.push(writeInstructionsEntry());
|
|
101
|
-
return { files };
|
|
102
|
-
}
|
|
103
|
-
uninstall(loc) {
|
|
104
|
-
if (loc !== 'global')
|
|
105
|
-
return { files: [] };
|
|
106
|
-
const files = [];
|
|
107
|
-
const tomlPath = tomlConfigPath();
|
|
108
|
-
if (fs.existsSync(tomlPath)) {
|
|
109
|
-
const content = fs.readFileSync(tomlPath, 'utf-8');
|
|
110
|
-
const { content: nextContent, action } = (0, toml_1.removeTomlTable)(content, TOML_HEADER);
|
|
111
|
-
if (action === 'removed') {
|
|
112
|
-
if (nextContent.trim() === '') {
|
|
113
|
-
try {
|
|
114
|
-
fs.unlinkSync(tomlPath);
|
|
115
|
-
}
|
|
116
|
-
catch { /* ignore */ }
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
(0, shared_1.atomicWriteFileSync)(tomlPath, nextContent.trimEnd() + '\n');
|
|
120
|
-
}
|
|
121
|
-
files.push({ path: tomlPath, action: 'removed' });
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
files.push({ path: tomlPath, action: 'not-found' });
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
files.push({ path: tomlPath, action: 'not-found' });
|
|
129
|
-
}
|
|
130
|
-
const instr = instructionsPath();
|
|
131
|
-
const instrAction = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
132
|
-
files.push({ path: instr, action: instrAction });
|
|
133
|
-
return { files };
|
|
134
|
-
}
|
|
135
|
-
printConfig(loc) {
|
|
136
|
-
if (loc !== 'global') {
|
|
137
|
-
return '# Codex CLI has no project-local config — use --location=global.\n';
|
|
138
|
-
}
|
|
139
|
-
const block = buildCodegraphBlock();
|
|
140
|
-
return `# Add to ${tomlConfigPath()}\n\n${block}\n`;
|
|
141
|
-
}
|
|
142
|
-
describePaths(loc) {
|
|
143
|
-
if (loc !== 'global')
|
|
144
|
-
return [];
|
|
145
|
-
return [tomlConfigPath(), instructionsPath()];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function buildCodegraphBlock() {
|
|
149
|
-
const mcp = (0, shared_1.getMcpServerConfig)();
|
|
150
|
-
return (0, toml_1.buildTomlTable)(TOML_HEADER, {
|
|
151
|
-
command: mcp.command,
|
|
152
|
-
args: mcp.args,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
function writeMcpEntry() {
|
|
156
|
-
const file = tomlConfigPath();
|
|
157
|
-
const dir = path.dirname(file);
|
|
158
|
-
if (!fs.existsSync(dir))
|
|
159
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
160
|
-
const block = buildCodegraphBlock();
|
|
161
|
-
// Single read — `existing === ''` derives both "is the file empty
|
|
162
|
-
// or absent" and "what was its content," avoiding a TOCTOU window
|
|
163
|
-
// between two `fs.existsSync` calls.
|
|
164
|
-
const existing = fs.existsSync(file) ? fs.readFileSync(file, 'utf-8') : '';
|
|
165
|
-
const created = existing.length === 0;
|
|
166
|
-
const { content: nextContent, action } = (0, toml_1.upsertTomlTable)(existing, TOML_HEADER, block);
|
|
167
|
-
if (action === 'unchanged') {
|
|
168
|
-
return { path: file, action: 'unchanged' };
|
|
169
|
-
}
|
|
170
|
-
(0, shared_1.atomicWriteFileSync)(file, nextContent);
|
|
171
|
-
return { path: file, action: created ? 'created' : 'updated' };
|
|
172
|
-
}
|
|
173
|
-
function writeInstructionsEntry() {
|
|
174
|
-
const file = instructionsPath();
|
|
175
|
-
const dir = path.dirname(file);
|
|
176
|
-
if (!fs.existsSync(dir))
|
|
177
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
178
|
-
const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
|
|
179
|
-
const mapped = action === 'created' ? 'created'
|
|
180
|
-
: action === 'unchanged' ? 'unchanged'
|
|
181
|
-
: 'updated';
|
|
182
|
-
return { path: file, action: mapped };
|
|
183
|
-
}
|
|
184
|
-
exports.codexTarget = new CodexTarget();
|
|
185
|
-
//# sourceMappingURL=codex.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/installer/targets/codex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCAKkB;AAClB,oEAIkC;AAClC,iCAA0E;AAE1E,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,I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,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,WAAW,GAAgB,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|