@aroman22/codegraph-vba 1.3.3
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 +855 -0
- package/dist/bin/codegraph.d.ts +26 -0
- package/dist/bin/command-supervision.d.ts +12 -0
- package/dist/bin/fatal-handler.d.ts +20 -0
- package/dist/bin/node-version-check.d.ts +37 -0
- package/dist/bin/uninstall.d.ts +14 -0
- package/dist/context/formatter.d.ts +30 -0
- package/dist/context/index.d.ts +119 -0
- package/dist/context/markers.d.ts +19 -0
- package/dist/db/index.d.ts +122 -0
- package/dist/db/migrations.d.ts +44 -0
- package/dist/db/queries.d.ts +402 -0
- package/dist/db/sqlite-adapter.d.ts +53 -0
- package/dist/directory.d.ts +179 -0
- package/dist/errors.d.ts +136 -0
- package/dist/extraction/astro-extractor.d.ts +79 -0
- package/dist/extraction/dfm-extractor.d.ts +31 -0
- package/dist/extraction/extraction-version.d.ts +25 -0
- package/dist/extraction/function-ref.d.ts +118 -0
- package/dist/extraction/generated-detection.d.ts +30 -0
- package/dist/extraction/grammars.d.ts +128 -0
- package/dist/extraction/index.d.ts +187 -0
- package/dist/extraction/languages/c-cpp.d.ts +12 -0
- package/dist/extraction/languages/csharp.d.ts +25 -0
- package/dist/extraction/languages/dart.d.ts +3 -0
- package/dist/extraction/languages/go.d.ts +3 -0
- package/dist/extraction/languages/index.d.ts +10 -0
- package/dist/extraction/languages/java.d.ts +3 -0
- package/dist/extraction/languages/javascript.d.ts +3 -0
- package/dist/extraction/languages/kotlin.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/objc.d.ts +3 -0
- package/dist/extraction/languages/pascal.d.ts +3 -0
- package/dist/extraction/languages/php.d.ts +3 -0
- package/dist/extraction/languages/python.d.ts +3 -0
- package/dist/extraction/languages/r.d.ts +3 -0
- package/dist/extraction/languages/ruby.d.ts +3 -0
- package/dist/extraction/languages/rust.d.ts +3 -0
- package/dist/extraction/languages/scala.d.ts +3 -0
- package/dist/extraction/languages/swift.d.ts +3 -0
- package/dist/extraction/languages/typescript.d.ts +16 -0
- package/dist/extraction/liquid-extractor.d.ts +59 -0
- package/dist/extraction/mybatis-extractor.d.ts +48 -0
- package/dist/extraction/parse-pool.d.ts +126 -0
- package/dist/extraction/parse-worker.d.ts +8 -0
- package/dist/extraction/razor-extractor.d.ts +42 -0
- package/dist/extraction/sql-query-extractor.d.ts +25 -0
- package/dist/extraction/svelte-extractor.d.ts +56 -0
- package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/dist/extraction/tree-sitter-types.d.ts +239 -0
- package/dist/extraction/tree-sitter.d.ts +647 -0
- package/dist/extraction/vba-extractor.d.ts +394 -0
- package/dist/extraction/vba-form-extractor.d.ts +89 -0
- package/dist/extraction/vba-preprocess.d.ts +81 -0
- package/dist/extraction/vue-extractor.d.ts +51 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/queries.d.ts +106 -0
- package/dist/graph/traversal.d.ts +127 -0
- package/dist/index.d.ts +563 -0
- package/dist/installer/config-writer.d.ts +28 -0
- package/dist/installer/index.d.ts +100 -0
- package/dist/installer/instructions-template.d.ts +41 -0
- package/dist/installer/targets/antigravity.d.ts +57 -0
- package/dist/installer/targets/claude.d.ts +62 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/gemini.d.ts +26 -0
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/kiro.d.ts +27 -0
- package/dist/installer/targets/opencode.d.ts +38 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/shared.d.ts +101 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/types.d.ts +108 -0
- package/dist/mcp/daemon-manager.d.ts +42 -0
- package/dist/mcp/daemon-paths.d.ts +73 -0
- package/dist/mcp/daemon-registry.d.ts +47 -0
- package/dist/mcp/daemon.d.ts +258 -0
- package/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/dist/mcp/engine.d.ts +122 -0
- package/dist/mcp/index.d.ts +113 -0
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/ppid-watchdog.d.ts +62 -0
- package/dist/mcp/proxy.d.ts +87 -0
- package/dist/mcp/query-pool.d.ts +94 -0
- package/dist/mcp/query-worker.d.ts +24 -0
- package/dist/mcp/server-instructions.d.ts +34 -0
- package/dist/mcp/session.d.ts +79 -0
- package/dist/mcp/stdin-teardown.d.ts +27 -0
- package/dist/mcp/tools.d.ts +591 -0
- package/dist/mcp/transport.d.ts +188 -0
- package/dist/mcp/version.d.ts +19 -0
- package/dist/project-config.d.ts +56 -0
- package/dist/reasoning/config.d.ts +45 -0
- package/dist/reasoning/credentials.d.ts +5 -0
- package/dist/reasoning/login.d.ts +21 -0
- package/dist/reasoning/reasoner.d.ts +43 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +5 -0
- package/dist/resolution/callback-synthesizer.d.ts +15 -0
- package/dist/resolution/frameworks/astro.d.ts +9 -0
- package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
- package/dist/resolution/frameworks/express.d.ts +8 -0
- package/dist/resolution/frameworks/fabric.d.ts +3 -0
- package/dist/resolution/frameworks/go.d.ts +8 -0
- package/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/dist/resolution/frameworks/index.d.ts +50 -0
- package/dist/resolution/frameworks/java.d.ts +8 -0
- package/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/play.d.ts +19 -0
- package/dist/resolution/frameworks/python.d.ts +10 -0
- package/dist/resolution/frameworks/react-native.d.ts +3 -0
- package/dist/resolution/frameworks/react.d.ts +8 -0
- package/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/dist/resolution/frameworks/rust.d.ts +8 -0
- package/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
- package/dist/resolution/frameworks/swift.d.ts +10 -0
- package/dist/resolution/frameworks/vue.d.ts +9 -0
- package/dist/resolution/go-module.d.ts +26 -0
- package/dist/resolution/goframe-synthesizer.d.ts +28 -0
- package/dist/resolution/import-resolver.d.ts +78 -0
- package/dist/resolution/index.d.ts +196 -0
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/name-matcher.d.ts +93 -0
- package/dist/resolution/path-aliases.d.ts +68 -0
- package/dist/resolution/strip-comments.d.ts +27 -0
- package/dist/resolution/swift-objc-bridge.d.ts +134 -0
- package/dist/resolution/types.d.ts +233 -0
- package/dist/resolution/workspace-packages.d.ts +48 -0
- package/dist/search/query-parser.d.ts +57 -0
- package/dist/search/query-utils.d.ts +87 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/index.d.ts +19 -0
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watcher.d.ts +358 -0
- package/dist/sync/worktree.d.ts +54 -0
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/types.d.ts +409 -0
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/shimmer-progress.d.ts +11 -0
- package/dist/ui/shimmer-worker.d.ts +2 -0
- package/dist/ui/types.d.ts +17 -0
- package/dist/upgrade/index.d.ts +132 -0
- package/dist/utils.d.ts +224 -0
- package/npm-sdk.js +75 -0
- package/npm-shim.js +246 -0
- package/package.json +32 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The marker-fenced agent-instructions block the installer writes into each
|
|
3
|
+
* agent's instructions file (CLAUDE.md / AGENTS.md / GEMINI.md).
|
|
4
|
+
*
|
|
5
|
+
* History: pre-#529 the installer wrote a full usage playbook here, which
|
|
6
|
+
* duplicated the MCP `initialize` instructions for the main agent — so it
|
|
7
|
+
* was removed and `mcp/server-instructions.ts` became the single source of
|
|
8
|
+
* truth. A much smaller block returned for #704, because the MCP
|
|
9
|
+
* instructions cannot reach two audiences that the instructions FILE does
|
|
10
|
+
* reach:
|
|
11
|
+
*
|
|
12
|
+
* - **Task-tool subagents** — they receive the project instructions file
|
|
13
|
+
* in their context but NOT the MCP initialize instructions. They hold
|
|
14
|
+
* the codegraph MCP tools only as deferred names and rarely think to
|
|
15
|
+
* load them: measured on a forced-delegation flow question (excalidraw,
|
|
16
|
+
* sonnet, high effort), subagents loaded + used codegraph in ~1 of 9
|
|
17
|
+
* runs without this block, and consistently with it — including runs
|
|
18
|
+
* with zero Read/grep fallback.
|
|
19
|
+
* - **Non-MCP harnesses** — agents with no MCP client at all can still
|
|
20
|
+
* run the `codegraph explore` CLI, which prints the same output as the
|
|
21
|
+
* MCP tool.
|
|
22
|
+
*
|
|
23
|
+
* Keep this block SHORT. The main agent reads it every turn on top of the
|
|
24
|
+
* server instructions — the #529 duplication-cost argument still bounds
|
|
25
|
+
* its size. Command names and the two surfaces, nothing more.
|
|
26
|
+
*/
|
|
27
|
+
/** Markers used by the marker-based section write/removal. */
|
|
28
|
+
export declare const CODEGRAPH_SECTION_START = "<!-- CODEGRAPH_START -->";
|
|
29
|
+
export declare const CODEGRAPH_SECTION_END = "<!-- CODEGRAPH_END -->";
|
|
30
|
+
/**
|
|
31
|
+
* The full block, markers included, exactly as written to disk.
|
|
32
|
+
*
|
|
33
|
+
* The wording is deliberately CONDITIONAL ("in repositories indexed by…"):
|
|
34
|
+
* a global install writes this into a user-scope file (~/.claude/CLAUDE.md,
|
|
35
|
+
* ~/.codex/AGENTS.md) that applies to every project the user opens —
|
|
36
|
+
* including unindexed ones, where an unconditional "this repository is
|
|
37
|
+
* indexed" claim would send subagents into failing codegraph calls (the
|
|
38
|
+
* noise the unindexed-session policy exists to prevent).
|
|
39
|
+
*/
|
|
40
|
+
export declare const CODEGRAPH_INSTRUCTIONS_BLOCK = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nIn repositories indexed by CodeGraph (a `.codegraph/` directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:\n\n- **MCP tool** (when available): `codegraph_explore` answers most code questions in one call \u2014 the relevant symbols' verbatim source plus the call paths between them, including dynamic-dispatch hops grep can't follow. Name a file or symbol in the query to read its current line-numbered source. If it's listed but deferred, load it by name via tool search.\n- **Shell** (always works): `codegraph explore \"<symbol names or question>\"` prints the same output.\n\nIf there is no `.codegraph/` directory, skip CodeGraph entirely \u2014 indexing is the user's decision.\n<!-- CODEGRAPH_END -->";
|
|
41
|
+
//# sourceMappingURL=instructions-template.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Antigravity IDE target. Antigravity is Google's VS Code-derived
|
|
3
|
+
* multi-agent IDE; the Gemini CLI is in the process of consolidating with
|
|
4
|
+
* it under a single agent platform. Antigravity reads MCP server
|
|
5
|
+
* definitions from a separate config file from the CLI.
|
|
6
|
+
*
|
|
7
|
+
* ## Config path: unified vs legacy
|
|
8
|
+
*
|
|
9
|
+
* Antigravity recently migrated to a **unified** MCP config path shared
|
|
10
|
+
* across all Antigravity tools:
|
|
11
|
+
*
|
|
12
|
+
* - **Unified** (post-migration, current): `~/.gemini/config/mcp_config.json`
|
|
13
|
+
* — signalled by the `~/.gemini/config/.migrated` marker file.
|
|
14
|
+
* - **Legacy** (pre-migration): `~/.gemini/antigravity/mcp_config.json`
|
|
15
|
+
* — what the github-mcp-server install guide still documents.
|
|
16
|
+
*
|
|
17
|
+
* We detect the marker at install time and write to the right path. On
|
|
18
|
+
* uninstall we sweep BOTH — so a user who installed on the legacy path,
|
|
19
|
+
* was then auto-migrated by Antigravity, and re-ran `codegraph install`
|
|
20
|
+
* doesn't end up with stale codegraph entries in two files.
|
|
21
|
+
*
|
|
22
|
+
* ## Entry shape: no `type: stdio` field
|
|
23
|
+
*
|
|
24
|
+
* Antigravity rejects MCP entries that carry the `type: "stdio"` field
|
|
25
|
+
* the rest of our targets use — the working entries it manages itself
|
|
26
|
+
* (e.g. `code-review-graph`) omit it, and dropping it was load-bearing
|
|
27
|
+
* to get codegraph to appear in the Customizations UI. We build the
|
|
28
|
+
* entry locally instead of routing through `getMcpServerConfig()`.
|
|
29
|
+
*
|
|
30
|
+
* ## macOS GUI app PATH resolution
|
|
31
|
+
*
|
|
32
|
+
* Antigravity is a GUI Electron app. macOS gives Dock/Finder-launched
|
|
33
|
+
* apps a stripped PATH (`/usr/bin:/bin:/usr/sbin:/sbin`) — nvm-managed
|
|
34
|
+
* tools live outside that, so a bare `codegraph` command fails to spawn
|
|
35
|
+
* even when `which codegraph` resolves in the user's shell. We resolve
|
|
36
|
+
* `codegraph` to its absolute path on macOS at install time. (Linux GUI
|
|
37
|
+
* apps inherit user PATH; Windows uses `PATH` env directly — both are
|
|
38
|
+
* fine with the bare command.)
|
|
39
|
+
*
|
|
40
|
+
* ## Shared instructions (no GEMINI.md from here)
|
|
41
|
+
*
|
|
42
|
+
* The IDE shares `~/.gemini/GEMINI.md` with Gemini CLI for instructions
|
|
43
|
+
* — written by the `./gemini.ts` target. We deliberately don't touch it
|
|
44
|
+
* here so uninstalling Antigravity without uninstalling Gemini CLI
|
|
45
|
+
* leaves CLI instructions intact. Users who install only Antigravity
|
|
46
|
+
* still get a working MCP integration; the prefer-codegraph-over-grep
|
|
47
|
+
* guidance just won't be present unless they also install the gemini
|
|
48
|
+
* target.
|
|
49
|
+
*
|
|
50
|
+
* ## Location
|
|
51
|
+
*
|
|
52
|
+
* `supportsLocation('local')` returns false — Antigravity has no
|
|
53
|
+
* project-scoped config concept as of 2026-05.
|
|
54
|
+
*/
|
|
55
|
+
import { AgentTarget } from './types';
|
|
56
|
+
export declare const antigravityTarget: AgentTarget;
|
|
57
|
+
//# sourceMappingURL=antigravity.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code target. Writes:
|
|
3
|
+
*
|
|
4
|
+
* - MCP server entry to `~/.claude.json` (global = user scope, loads
|
|
5
|
+
* in every project) or `./.mcp.json` (local = project scope, the
|
|
6
|
+
* file Claude Code actually reads for a single project). See the
|
|
7
|
+
* scope table at https://code.claude.com/docs/en/mcp.
|
|
8
|
+
* - Permissions to `~/.claude/settings.json` (global) or
|
|
9
|
+
* `./.claude/settings.json` (local), gated on `autoAllow`.
|
|
10
|
+
* - Instructions to `~/.claude/CLAUDE.md` (global) or
|
|
11
|
+
* `./.claude/CLAUDE.md` (local).
|
|
12
|
+
*
|
|
13
|
+
* Earlier versions wrote the local MCP entry to `./.claude.json` — a
|
|
14
|
+
* file Claude Code never reads — so the server silently never loaded
|
|
15
|
+
* until the user manually renamed it to `.mcp.json` (issue #207). We
|
|
16
|
+
* now write `./.mcp.json` and migrate any stale `./.claude.json` entry
|
|
17
|
+
* out of the way on install and uninstall.
|
|
18
|
+
*/
|
|
19
|
+
import { AgentTarget, Location, WriteResult } from './types';
|
|
20
|
+
/**
|
|
21
|
+
* Per-file write helpers, exported so the legacy `config-writer.ts`
|
|
22
|
+
* shim can call only the named operation (writeMcpConfig writes ONLY
|
|
23
|
+
* the MCP entry, etc.) instead of `claudeTarget.install()` which
|
|
24
|
+
* writes all three files. Without this split the shims silently
|
|
25
|
+
* cause side effects callers don't expect.
|
|
26
|
+
*/
|
|
27
|
+
export declare function writeMcpEntry(loc: Location): WriteResult['files'][number];
|
|
28
|
+
/**
|
|
29
|
+
* Remove stale codegraph auto-sync hooks (`mark-dirty` / `sync-if-dirty`) that a
|
|
30
|
+
* pre-0.8 install wrote. Exported for direct unit-testing; reused by both
|
|
31
|
+
* `install` (an upgrade self-heals) and `uninstall`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function cleanupLegacyHooks(loc: Location): WriteResult['files'][number];
|
|
34
|
+
/**
|
|
35
|
+
* Remove the front-load `UserPromptSubmit` hook this installer writes (see
|
|
36
|
+
* writePromptHookEntry). Used by `uninstall`, and by `install` when the user
|
|
37
|
+
* opts out, so the choice round-trips.
|
|
38
|
+
*/
|
|
39
|
+
export declare function removePromptHookEntry(loc: Location): WriteResult['files'][number];
|
|
40
|
+
export declare function writePermissionsEntry(loc: Location): WriteResult['files'][number];
|
|
41
|
+
/**
|
|
42
|
+
* Write the front-load `UserPromptSubmit` hook into Claude `settings.json` —
|
|
43
|
+
* a `command` hook that runs `codegraph prompt-hook`, which injects
|
|
44
|
+
* codegraph_explore context for structural prompts so the agent reliably uses
|
|
45
|
+
* the graph. Idempotent: if our command is already wired under UserPromptSubmit
|
|
46
|
+
* the file is left byte-for-byte untouched and reported `unchanged`. Sibling
|
|
47
|
+
* hooks (the user's own, or other events) are preserved. Opt-in — the installer
|
|
48
|
+
* only calls this when the user accepts the prompt (default-yes).
|
|
49
|
+
*/
|
|
50
|
+
export declare function writePromptHookEntry(loc: Location): WriteResult['files'][number];
|
|
51
|
+
/**
|
|
52
|
+
* Strip the marker-delimited CodeGraph block from CLAUDE.md if a prior
|
|
53
|
+
* install wrote one. Codegraph no longer maintains an instructions file
|
|
54
|
+
* (issue #529) — the MCP server's `initialize` instructions are the
|
|
55
|
+
* single source of truth — so both install (self-heal on upgrade) and
|
|
56
|
+
* uninstall call this. `removeMarkedSection` returns `not-found`/`kept`
|
|
57
|
+
* when there's nothing to strip; the install caller drops those from
|
|
58
|
+
* the report so a fresh install stays quiet.
|
|
59
|
+
*/
|
|
60
|
+
export declare function removeInstructionsEntry(loc: Location): WriteResult['files'][number];
|
|
61
|
+
export declare const claudeTarget: AgentTarget;
|
|
62
|
+
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
|
@@ -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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini CLI target (also covers the rebranded "Antigravity CLI" —
|
|
3
|
+
* Google is in the middle of unifying its CLI tools under
|
|
4
|
+
* Antigravity, and the new CLI continues to read `~/.gemini/settings.json`
|
|
5
|
+
* + project-local `.gemini/settings.json`). Writes:
|
|
6
|
+
*
|
|
7
|
+
* - MCP server entry to `~/.gemini/settings.json` (global) or
|
|
8
|
+
* `./.gemini/settings.json` (local) under the standard
|
|
9
|
+
* `mcpServers.codegraph` key. Same shape as Claude / Cursor.
|
|
10
|
+
* - Instructions to `~/.gemini/GEMINI.md` (global) or `./GEMINI.md`
|
|
11
|
+
* (local — Gemini reads the project root file directly, not
|
|
12
|
+
* under `.gemini/`).
|
|
13
|
+
*
|
|
14
|
+
* No permissions concept — Gemini CLI gates tool invocations through
|
|
15
|
+
* the `trust` field per server, not an external allowlist. We leave
|
|
16
|
+
* `trust` unset so the user controls confirmation prompts.
|
|
17
|
+
*
|
|
18
|
+
* The Antigravity IDE shares `~/.gemini/GEMINI.md` for instructions
|
|
19
|
+
* but uses a separate MCP config file (`~/.gemini/antigravity/mcp_config.json`)
|
|
20
|
+
* — see `./antigravity.ts`. Both targets writing to GEMINI.md is
|
|
21
|
+
* safe: the marker-based section replacement makes the second write
|
|
22
|
+
* a byte-identical no-op.
|
|
23
|
+
*/
|
|
24
|
+
import { AgentTarget } from './types';
|
|
25
|
+
export declare const geminiTarget: AgentTarget;
|
|
26
|
+
//# sourceMappingURL=gemini.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermes Agent target.
|
|
3
|
+
*
|
|
4
|
+
* Hermes reads MCP servers from `$HERMES_HOME/config.yaml` under the
|
|
5
|
+
* top-level `mcp_servers` key, and exposes discovered MCP tools through
|
|
6
|
+
* dynamic toolsets named `mcp-<server>`. We add:
|
|
7
|
+
*
|
|
8
|
+
* mcp_servers.codegraph -> `codegraph serve --mcp`
|
|
9
|
+
* platform_toolsets.cli -> `mcp-codegraph`
|
|
10
|
+
*
|
|
11
|
+
* The second entry matters because Hermes CLI profiles often enable an
|
|
12
|
+
* explicit `platform_toolsets.cli` list. Without `mcp-codegraph` in that
|
|
13
|
+
* list, the MCP server can be configured and connected but its tools may
|
|
14
|
+
* still be filtered out of normal CLI sessions.
|
|
15
|
+
*/
|
|
16
|
+
import { AgentTarget } from './types';
|
|
17
|
+
export declare const hermesTarget: AgentTarget;
|
|
18
|
+
//# sourceMappingURL=hermes.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kiro CLI / IDE target. Writes:
|
|
3
|
+
*
|
|
4
|
+
* - MCP server entry to `~/.kiro/settings/mcp.json` (global) or
|
|
5
|
+
* `./.kiro/settings/mcp.json` (local). Standard `mcpServers.codegraph`
|
|
6
|
+
* shape, same as Claude / Cursor / Gemini.
|
|
7
|
+
* - Instructions to `~/.kiro/steering/codegraph.md` (global) or
|
|
8
|
+
* `./.kiro/steering/codegraph.md` (local). Kiro's "steering" system
|
|
9
|
+
* loads every `*.md` file in the steering dir as agent context, so
|
|
10
|
+
* a dedicated `codegraph.md` is the natural surface — we own the
|
|
11
|
+
* whole file outright (no marker-based merging needed) and delete
|
|
12
|
+
* it on uninstall.
|
|
13
|
+
*
|
|
14
|
+
* No permissions concept — Kiro gates tool invocations through its own
|
|
15
|
+
* UI prompts rather than an external allowlist. `autoAllow` is silently
|
|
16
|
+
* ignored.
|
|
17
|
+
*
|
|
18
|
+
* Paths are identical on macOS / Linux / Windows because Kiro resolves
|
|
19
|
+
* its config root from `os.homedir()` on all three (Windows `~` →
|
|
20
|
+
* `%USERPROFILE%\.kiro`).
|
|
21
|
+
*
|
|
22
|
+
* Docs: https://kiro.dev/docs/cli/mcp/
|
|
23
|
+
* https://kiro.dev/docs/cli/steering/
|
|
24
|
+
*/
|
|
25
|
+
import { AgentTarget } from './types';
|
|
26
|
+
export declare const kiroTarget: AgentTarget;
|
|
27
|
+
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode target.
|
|
3
|
+
*
|
|
4
|
+
* - MCP server entry to `~/.config/opencode/opencode.jsonc` (global,
|
|
5
|
+
* XDG-style on EVERY platform, Windows included — see below) 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
|
+
*
|
|
10
|
+
* opencode resolves its config dir with the `xdg-basedir` package
|
|
11
|
+
* (sst/opencode `packages/core/src/global.ts`): `XDG_CONFIG_HOME`
|
|
12
|
+
* if set, else `~/.config` — unconditionally, on all platforms. It
|
|
13
|
+
* never reads `%APPDATA%`; that layout belonged to the discontinued
|
|
14
|
+
* Go fork. We previously wrote there on Windows, so opencode never
|
|
15
|
+
* saw the entry (#535) — install/uninstall now also sweep a stale
|
|
16
|
+
* codegraph entry out of the legacy `%APPDATA%/opencode` location.
|
|
17
|
+
* - Instructions to `~/.config/opencode/AGENTS.md` (global) or
|
|
18
|
+
* `./AGENTS.md` (local). opencode reads AGENTS.md for agent
|
|
19
|
+
* instructions — same convention Codex CLI uses.
|
|
20
|
+
* - No permissions concept.
|
|
21
|
+
*
|
|
22
|
+
* Config shape uses opencode's wrapper:
|
|
23
|
+
* {
|
|
24
|
+
* "$schema": "https://opencode.ai/config.json",
|
|
25
|
+
* "mcp": { "codegraph": { "type": "local", "command": [...], "enabled": true } }
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* The shape differs from Claude/Cursor — opencode uses `mcp.<name>`
|
|
29
|
+
* (not `mcpServers`), takes `command` as a string array combining
|
|
30
|
+
* binary + args, and includes an explicit `enabled` flag.
|
|
31
|
+
*
|
|
32
|
+
* Reads + writes go through `jsonc-parser` so any `//` and `/* *\/`
|
|
33
|
+
* comments the user has added to their `.jsonc` survive idempotent
|
|
34
|
+
* re-runs.
|
|
35
|
+
*/
|
|
36
|
+
import { AgentTarget } from './types';
|
|
37
|
+
export declare const opencodeTarget: AgentTarget;
|
|
38
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -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,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers shared across `AgentTarget` implementations.
|
|
3
|
+
*
|
|
4
|
+
* Lifted from the original `config-writer.ts` so each target can
|
|
5
|
+
* compose them without inheritance. Kept deliberately small — the
|
|
6
|
+
* targets are different enough (JSON vs TOML vs Markdown, varying
|
|
7
|
+
* idempotency markers) that a base class would force the awkward
|
|
8
|
+
* shape onto everyone.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The MCP-server config block codegraph injects. Same shape across
|
|
12
|
+
* all JSON-shaped agent configs (Claude, Cursor, opencode), only the
|
|
13
|
+
* surrounding wrapper differs. Codex (TOML) builds its own block.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMcpServerConfig(): {
|
|
16
|
+
type: string;
|
|
17
|
+
command: string;
|
|
18
|
+
args: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Permissions list for Claude `settings.json`. Other targets that
|
|
22
|
+
* have a permissions concept can compose this list directly.
|
|
23
|
+
*
|
|
24
|
+
* One server-scoped wildcard rather than a per-tool list. By default only
|
|
25
|
+
* `codegraph_explore` is even LISTED to the agent (see DEFAULT_MCP_TOOLS in
|
|
26
|
+
* mcp/tools.ts), so in practice explore is the only tool this auto-approves —
|
|
27
|
+
* but the wildcard means that if a user re-enables another tool via
|
|
28
|
+
* CODEGRAPH_MCP_TOOLS, it's already pre-approved (no permission prompt, no
|
|
29
|
+
* hand-editing settings.json), and future tools are covered too. Claude only
|
|
30
|
+
* honors globs after a literal `mcp__<server>__` prefix, so this exact string
|
|
31
|
+
* is the way to allow-all for one server; a bare `mcp__codegraph` or `*` is
|
|
32
|
+
* ignored. The allowlist gates PROMPTING, not visibility, so a superset here
|
|
33
|
+
* never makes a hidden tool appear.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getCodeGraphPermissions(): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Read a JSON file, returning `{}` when missing or unparseable.
|
|
38
|
+
*
|
|
39
|
+
* Unparseable files are backed up to `<path>.backup` BEFORE we return
|
|
40
|
+
* `{}` — so an idempotent re-run never silently deletes a user's
|
|
41
|
+
* existing config that happened to break JSON parse temporarily.
|
|
42
|
+
*/
|
|
43
|
+
export declare function readJsonFile(filePath: string): Record<string, any>;
|
|
44
|
+
/**
|
|
45
|
+
* Write a file atomically: write to `<path>.tmp.<pid>`, then rename.
|
|
46
|
+
*
|
|
47
|
+
* Prevents corruption if the process crashes mid-write. The temp
|
|
48
|
+
* file is cleaned up on rename failure.
|
|
49
|
+
*/
|
|
50
|
+
export declare function atomicWriteFileSync(filePath: string, content: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Atomic JSON write. Trailing newline matches the convention every
|
|
53
|
+
* existing target had — preserves diff-friendly file shape.
|
|
54
|
+
*/
|
|
55
|
+
export declare function writeJsonFile(filePath: string, data: Record<string, any>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Compare two JSON values for deep equality, ignoring key order.
|
|
58
|
+
*
|
|
59
|
+
* Used for idempotency: when the on-disk config already exactly
|
|
60
|
+
* matches what we'd write, return action=`unchanged` instead of
|
|
61
|
+
* re-writing (and emitting a confusing "Updated" log line).
|
|
62
|
+
*/
|
|
63
|
+
export declare function jsonDeepEqual(a: unknown, b: unknown): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Replace or append a marker-delimited section in a markdown-ish file.
|
|
66
|
+
*
|
|
67
|
+
* Used by Claude / Codex for the `<!-- CODEGRAPH_START --> ... <!--
|
|
68
|
+
* CODEGRAPH_END -->` block. Preserves all content outside the
|
|
69
|
+
* markers verbatim.
|
|
70
|
+
*
|
|
71
|
+
* Returns `created` when the file didn't exist; `updated` when
|
|
72
|
+
* markers were found and content swapped; `appended` when markers
|
|
73
|
+
* weren't found and section was added at end. `unchanged` when the
|
|
74
|
+
* existing block already matches `body`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function replaceOrAppendMarkedSection(filePath: string, body: string, startMarker: string, endMarker: string): 'created' | 'updated' | 'appended' | 'unchanged';
|
|
77
|
+
/**
|
|
78
|
+
* Upsert the CodeGraph instructions block into an agent instructions
|
|
79
|
+
* file (CLAUDE.md / AGENTS.md / GEMINI.md). The one write shared by
|
|
80
|
+
* every target: self-heals a stale pre-#529 long block (markers match →
|
|
81
|
+
* replaced by the current short one), appends after existing user
|
|
82
|
+
* content otherwise, and reports `unchanged` on byte-equal re-runs so
|
|
83
|
+
* install stays idempotent. See `instructions-template.ts` for why this
|
|
84
|
+
* block exists (#704: subagents + non-MCP harnesses never see the MCP
|
|
85
|
+
* initialize instructions).
|
|
86
|
+
*/
|
|
87
|
+
export declare function upsertInstructionsEntry(file: string): {
|
|
88
|
+
path: string;
|
|
89
|
+
action: 'created' | 'updated' | 'unchanged';
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Inverse of `replaceOrAppendMarkedSection`. Strips the marker
|
|
93
|
+
* block from `filePath` if present. If the file becomes empty after
|
|
94
|
+
* removal, deletes the file entirely (matches the existing Claude
|
|
95
|
+
* uninstall behavior).
|
|
96
|
+
*
|
|
97
|
+
* Returns `removed` when content was stripped, `not-found` when
|
|
98
|
+
* the markers weren't present, `kept` when the file didn't exist.
|
|
99
|
+
*/
|
|
100
|
+
export declare function removeMarkedSection(filePath: string, startMarker: string, endMarker: string): 'removed' | 'not-found' | 'kept';
|
|
101
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny TOML helpers — just enough to inject / replace / remove a
|
|
3
|
+
* single dotted-key table block (`[mcp_servers.codegraph]`) inside an
|
|
4
|
+
* existing `~/.codex/config.toml`. We deliberately do NOT try to be a
|
|
5
|
+
* general TOML parser/serializer; that would mean pulling in a
|
|
6
|
+
* dependency (~50KB) for ~6 lines of output.
|
|
7
|
+
*
|
|
8
|
+
* Strategy: treat the file as text. Find the `[mcp_servers.codegraph]`
|
|
9
|
+
* header line, splice it (and the lines that follow it until the next
|
|
10
|
+
* `[...]` header or EOF) in or out. Everything outside that block is
|
|
11
|
+
* preserved verbatim, byte-for-byte.
|
|
12
|
+
*
|
|
13
|
+
* Limitations (acceptable for our narrow use):
|
|
14
|
+
* - Only handles top-level table headers; not array-of-tables or
|
|
15
|
+
* subtables nested inside `[mcp_servers]` itself (we always write
|
|
16
|
+
* the full dotted key `[mcp_servers.codegraph]`).
|
|
17
|
+
* - Doesn't validate sibling TOML — if the file is malformed
|
|
18
|
+
* elsewhere, our injection won't fix it but won't make it worse.
|
|
19
|
+
* - Quotes string values with double quotes; escapes `\` and `"`.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Serialize a record into the body lines of a TOML table. Values
|
|
23
|
+
* supported: string, string[]. Other types throw — the codex MCP
|
|
24
|
+
* config only needs these two.
|
|
25
|
+
*/
|
|
26
|
+
export declare function serializeTomlTableBody(values: Record<string, string | string[]>): string;
|
|
27
|
+
/**
|
|
28
|
+
* Build a full table block: header line + body. Suitable for direct
|
|
29
|
+
* insertion into a TOML file.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildTomlTable(header: string, values: Record<string, string | string[]>): string;
|
|
32
|
+
/**
|
|
33
|
+
* Insert or replace a top-level dotted-key TOML table block in the
|
|
34
|
+
* given file content. Preserves all other content verbatim.
|
|
35
|
+
*
|
|
36
|
+
* Returns `'inserted'` when the table was newly added, `'replaced'`
|
|
37
|
+
* when an existing one was rewritten, `'unchanged'` when the
|
|
38
|
+
* existing block already matches `block` byte-for-byte.
|
|
39
|
+
*/
|
|
40
|
+
export declare function upsertTomlTable(fileContent: string, header: string, block: string): {
|
|
41
|
+
content: string;
|
|
42
|
+
action: 'inserted' | 'replaced' | 'unchanged';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Remove a top-level dotted-key TOML table block. Returns the
|
|
46
|
+
* possibly-empty new content + an action flag.
|
|
47
|
+
*/
|
|
48
|
+
export declare function removeTomlTable(fileContent: string, header: string): {
|
|
49
|
+
content: string;
|
|
50
|
+
action: 'removed' | 'not-found';
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=toml.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent target abstraction for the installer.
|
|
3
|
+
*
|
|
4
|
+
* Each MCP-capable agent (Claude Code, Cursor, Codex CLI, opencode, ...)
|
|
5
|
+
* implements this interface so the installer orchestrator can write the
|
|
6
|
+
* right MCP-server config + instructions file + permissions for that
|
|
7
|
+
* agent without baking client-specific paths into core code. Adding a
|
|
8
|
+
* new agent = one new file in `targets/` + one entry in `registry.ts`.
|
|
9
|
+
*
|
|
10
|
+
* Closes the Claude-locked installer issue (upstream #137). The
|
|
11
|
+
* runtime MCP server is already agent-agnostic; this brings the
|
|
12
|
+
* installer to the same surface.
|
|
13
|
+
*/
|
|
14
|
+
export type Location = 'global' | 'local';
|
|
15
|
+
/**
|
|
16
|
+
* Stable string id used in the `--target` CLI flag and the registry
|
|
17
|
+
* lookup. New targets add a value here when they're added to the
|
|
18
|
+
* registry. Keep these short and lowercase.
|
|
19
|
+
*/
|
|
20
|
+
export type TargetId = 'claude' | 'cursor' | 'codex' | 'opencode' | 'hermes' | 'gemini' | 'antigravity' | 'kiro';
|
|
21
|
+
/**
|
|
22
|
+
* Result of `target.detect(location)`.
|
|
23
|
+
*
|
|
24
|
+
* `installed` is a best-effort heuristic that the agent's CLI / app /
|
|
25
|
+
* config dir is present on this system — used to default the
|
|
26
|
+
* multiselect prompt to "what's actually here." False positives are
|
|
27
|
+
* acceptable (we still write); false negatives just mean the user
|
|
28
|
+
* has to opt in manually.
|
|
29
|
+
*
|
|
30
|
+
* `alreadyConfigured` reports whether codegraph has already been
|
|
31
|
+
* wired into this target at this location — drives the
|
|
32
|
+
* "Updated"-vs-"Added" log line and lets `--check` exit 0/1.
|
|
33
|
+
*/
|
|
34
|
+
export interface DetectionResult {
|
|
35
|
+
installed: boolean;
|
|
36
|
+
alreadyConfigured: boolean;
|
|
37
|
+
/** Path inspected; surfaced in diagnostic / dry-run output. */
|
|
38
|
+
configPath?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* What `target.install(location)` actually changed on disk. The
|
|
42
|
+
* orchestrator renders one log line per file using `action`.
|
|
43
|
+
*
|
|
44
|
+
* `unchanged` means we touched the file but its contents were already
|
|
45
|
+
* what we'd write — used for byte-identical idempotent re-runs.
|
|
46
|
+
*/
|
|
47
|
+
export interface WriteResult {
|
|
48
|
+
files: Array<{
|
|
49
|
+
path: string;
|
|
50
|
+
action: 'created' | 'updated' | 'unchanged' | 'removed' | 'not-found' | 'kept';
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional one-line notes the orchestrator surfaces verbatim — e.g.
|
|
54
|
+
* "Restart Cursor to apply." Keep these short; multi-line goes in
|
|
55
|
+
* the README.
|
|
56
|
+
*/
|
|
57
|
+
notes?: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface InstallOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Whether to write the agent's permissions / auto-allow surface
|
|
62
|
+
* (Claude `settings.json`, others where applicable). When the
|
|
63
|
+
* target has no permissions concept this option is a no-op.
|
|
64
|
+
*/
|
|
65
|
+
autoAllow: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Front-load prompt hook (Claude `UserPromptSubmit`) that injects
|
|
68
|
+
* codegraph_explore context for structural prompts. `true` installs it,
|
|
69
|
+
* `false` removes any prior install (so opt-out round-trips), `undefined`
|
|
70
|
+
* leaves it untouched. Targets without a prompt-hook concept ignore it.
|
|
71
|
+
*/
|
|
72
|
+
promptHook?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface AgentTarget {
|
|
75
|
+
/** Stable id; matches the `TargetId` union. */
|
|
76
|
+
readonly id: TargetId;
|
|
77
|
+
/** Human-readable name shown in clack prompts and log lines. */
|
|
78
|
+
readonly displayName: string;
|
|
79
|
+
/** Optional URL for "where do I learn more about this agent." */
|
|
80
|
+
readonly docsUrl?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether this target supports the given install location.
|
|
83
|
+
*
|
|
84
|
+
* Some agents (Codex CLI as of 2026-05) have no project-local
|
|
85
|
+
* config concept — only a single `~/.codex/` dir. Returning false
|
|
86
|
+
* for an unsupported (target, location) pair lets the orchestrator
|
|
87
|
+
* skip cleanly with a clear message.
|
|
88
|
+
*/
|
|
89
|
+
supportsLocation(loc: Location): boolean;
|
|
90
|
+
detect(loc: Location): DetectionResult;
|
|
91
|
+
install(loc: Location, opts: InstallOptions): WriteResult;
|
|
92
|
+
/**
|
|
93
|
+
* Inverse of install. Removes only what install would have written;
|
|
94
|
+
* preserves sibling MCP servers, sibling permissions, and unrelated
|
|
95
|
+
* markdown sections. Must be safe to call when nothing was ever
|
|
96
|
+
* installed (returns `not-found` actions).
|
|
97
|
+
*/
|
|
98
|
+
uninstall(loc: Location): WriteResult;
|
|
99
|
+
/**
|
|
100
|
+
* Print the MCP-server snippet a user would paste manually for this
|
|
101
|
+
* target. Used by `codegraph install --print-config <id>` and by
|
|
102
|
+
* the README. Must NOT touch the filesystem.
|
|
103
|
+
*/
|
|
104
|
+
printConfig(loc: Location): string;
|
|
105
|
+
/** Filesystem paths this target would write to at this location. */
|
|
106
|
+
describePaths(loc: Location): string[];
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=types.d.ts.map
|