kirograph 0.13.0 → 0.14.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/README.md +332 -93
- package/dist/bin/commands/caveman.js +19 -2
- package/dist/bin/commands/caveman.js.map +2 -2
- package/dist/bin/commands/compression.js +109 -0
- package/dist/bin/commands/compression.js.map +7 -0
- package/dist/bin/commands/context.js +31 -24
- package/dist/bin/commands/context.js.map +2 -2
- package/dist/bin/commands/exec.js +107 -0
- package/dist/bin/commands/exec.js.map +7 -0
- package/dist/bin/commands/gain.js +119 -0
- package/dist/bin/commands/gain.js.map +7 -0
- package/dist/bin/commands/help.js +16 -5
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/install.js +8 -2
- package/dist/bin/commands/install.js.map +2 -2
- package/dist/bin/commands/query.js +5 -1
- package/dist/bin/commands/query.js.map +2 -2
- package/dist/bin/commands/serve.js +2 -2
- package/dist/bin/commands/serve.js.map +2 -2
- package/dist/bin/commands/uninit.js +65 -41
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/commands/utils.js +16 -0
- package/dist/bin/commands/utils.js.map +2 -2
- package/dist/bin/installer/cli-agent.js +5 -25
- package/dist/bin/installer/cli-agent.js.map +2 -2
- package/dist/bin/installer/common.js +154 -0
- package/dist/bin/installer/common.js.map +7 -0
- package/dist/bin/installer/config-prompt.js +9 -2
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/hooks.js +19 -1
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.js +104 -86
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/instructions.js +60 -0
- package/dist/bin/installer/instructions.js.map +7 -0
- package/dist/bin/installer/mcp.js +6 -36
- package/dist/bin/installer/mcp.js.map +2 -2
- package/dist/bin/installer/steering.js +116 -40
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/claude.js +79 -0
- package/dist/bin/installer/targets/claude.js.map +7 -0
- package/dist/bin/installer/targets/codex.js +77 -0
- package/dist/bin/installer/targets/codex.js.map +7 -0
- package/dist/bin/installer/targets/index.js +57 -0
- package/dist/bin/installer/targets/index.js.map +7 -0
- package/dist/bin/installer/targets/kiro.js +63 -0
- package/dist/bin/installer/targets/kiro.js.map +7 -0
- package/dist/bin/kirograph.js +7 -1
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/compression/filters/aws.js +418 -0
- package/dist/compression/filters/aws.js.map +7 -0
- package/dist/compression/filters/docker.js +153 -0
- package/dist/compression/filters/docker.js.map +7 -0
- package/dist/compression/filters/files.js +150 -0
- package/dist/compression/filters/files.js.map +7 -0
- package/dist/compression/filters/generic.js +86 -0
- package/dist/compression/filters/generic.js.map +7 -0
- package/dist/compression/filters/git.js +272 -0
- package/dist/compression/filters/git.js.map +7 -0
- package/dist/compression/filters/github.js +137 -0
- package/dist/compression/filters/github.js.map +7 -0
- package/dist/compression/filters/lint.js +280 -0
- package/dist/compression/filters/lint.js.map +7 -0
- package/dist/compression/filters/misc.js +212 -0
- package/dist/compression/filters/misc.js.map +7 -0
- package/dist/compression/filters/package.js +151 -0
- package/dist/compression/filters/package.js.map +7 -0
- package/dist/compression/filters/test.js +266 -0
- package/dist/compression/filters/test.js.map +7 -0
- package/dist/compression/index.js +144 -0
- package/dist/compression/index.js.map +7 -0
- package/dist/compression/naive-cost.js +94 -0
- package/dist/compression/naive-cost.js.map +7 -0
- package/dist/compression/tracker.js +228 -0
- package/dist/compression/tracker.js.map +7 -0
- package/dist/compression/types.js +17 -0
- package/dist/compression/types.js.map +7 -0
- package/dist/config.js +18 -1
- package/dist/config.js.map +2 -2
- package/dist/mcp/tool-names.js +50 -0
- package/dist/mcp/tool-names.js.map +7 -0
- package/dist/mcp/tools.js +173 -4
- package/dist/mcp/tools.js.map +3 -3
- package/package.json +2 -2
|
@@ -39,10 +39,10 @@ function printColoredHelp() {
|
|
|
39
39
|
{
|
|
40
40
|
title: "\u{1F527} Workspace Setup",
|
|
41
41
|
commands: [
|
|
42
|
-
{ name: "install", desc: "Wire up MCP
|
|
42
|
+
{ name: "install", desc: "Wire up MCP/instructions for an agent workspace", opts: ["--target <t> kiro | claude | codex"] },
|
|
43
43
|
{ name: "init", args: "[path]", desc: "Initialize KiroGraph in a project", opts: ["-i, --index Index immediately after init"] },
|
|
44
|
-
{ name: "uninit", args: "[path]", desc: "Remove KiroGraph from a project", opts: ["--force
|
|
45
|
-
{ name: "uninstall", args: "[path]", desc: "Alias for uninit", opts: ["--force
|
|
44
|
+
{ name: "uninit", args: "[path]", desc: "Remove KiroGraph from a project", opts: ["--force Skip confirmation", "--target <t> kiro | claude | codex | all"] },
|
|
45
|
+
{ name: "uninstall", args: "[path]", desc: "Alias for uninit", opts: ["--force Skip confirmation", "--target <t> kiro | claude | codex | all"] }
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
48
|
{
|
|
@@ -89,6 +89,9 @@ function printColoredHelp() {
|
|
|
89
89
|
title: "\u2699\uFE0F Agent & Configuration",
|
|
90
90
|
commands: [
|
|
91
91
|
{ name: "caveman", args: "[mode]", desc: "Set agent communication style (off | lite | full | ultra)" },
|
|
92
|
+
{ name: "compression", args: "[level]", desc: "Set shell compression level (off | normal | aggressive | ultra)" },
|
|
93
|
+
{ name: "exec", args: "<command...>", desc: "Run a shell command with token-optimized output", opts: ["-l, --level <l> normal | aggressive | ultra", "-t, --timeout <s> Timeout in seconds (default 60)", "--raw Show raw + compressed for comparison", "--json Output as JSON"] },
|
|
94
|
+
{ name: "gain", desc: "Show token savings from compressed command outputs", opts: ["--graph ASCII graph (last 30 days)", "--history Recent command history", "--daily Day-by-day breakdown", "--period <p> session | today | week | all"] },
|
|
92
95
|
{ name: "serve", desc: "Start the MCP server", opts: ["--mcp Run as MCP stdio server", "--path <p> Project path"] },
|
|
93
96
|
{ name: "dashboard", desc: "Manage the Qdrant or Typesense dashboard server", opts: ["start [path] Start server and open dashboard", "stop [path] Stop the running server"] }
|
|
94
97
|
]
|
|
@@ -113,7 +116,7 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
|
|
|
113
116
|
console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);
|
|
114
117
|
if (isCaveman) {
|
|
115
118
|
const inspiredPad = " ".repeat(3 + nameWidth);
|
|
116
|
-
console.log(`${inspiredPad}${c.dim}Inspired by Caveman
|
|
119
|
+
console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);
|
|
117
120
|
console.log();
|
|
118
121
|
}
|
|
119
122
|
if (cmd.opts) {
|
|
@@ -141,7 +144,9 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
|
|
|
141
144
|
{
|
|
142
145
|
title: "\u{1F527} Setup & indexing",
|
|
143
146
|
examples: [
|
|
144
|
-
["kirograph install", "Wire up MCP + hooks + steering for the current workspace"],
|
|
147
|
+
["kirograph install", "Wire up Kiro MCP + hooks + steering for the current workspace"],
|
|
148
|
+
["kirograph install --target claude", "Wire up Claude Code MCP + project memory"],
|
|
149
|
+
["kirograph install --target codex", "Install Codex project instructions and print MCP config"],
|
|
145
150
|
["kirograph init --index", "Init and immediately index the project"],
|
|
146
151
|
["kirograph sync", "Incremental sync of changed files"]
|
|
147
152
|
]
|
|
@@ -182,6 +187,12 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
|
|
|
182
187
|
examples: [
|
|
183
188
|
["kirograph caveman full", "Enable full caveman mode for the agent"],
|
|
184
189
|
["kirograph caveman off", "Disable caveman mode"],
|
|
190
|
+
["kirograph compression aggressive", "Set compression to aggressive level"],
|
|
191
|
+
["kirograph compression off", "Disable compression hook (tool still available)"],
|
|
192
|
+
["kirograph exec git status", "Run git status with compression"],
|
|
193
|
+
["kirograph exec --level ultra npm test", "Run tests with ultra compression"],
|
|
194
|
+
["kirograph exec --raw cargo build", "Show raw vs compressed comparison"],
|
|
195
|
+
["kirograph gain --graph", "Show token savings graph"],
|
|
185
196
|
["kirograph serve --mcp", "Start the MCP server"]
|
|
186
197
|
]
|
|
187
198
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/help.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP + hooks + steering for the current Kiro workspace' },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman \u2014 original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up MCP + hooks + steering for the current workspace'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('afterAll', '');\n program.helpInformation = () => {\n printBanner();\n printColoredHelp();\n return '';\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA4B;AAKrB,SAAS,mBAAyB;AACvC,QAAM,IAAI;AAAA,IACR,OAAc;AAAA,IACd,MAAc;AAAA,IACd,KAAc;AAAA,IACd,QAAc;AAAA,IACd,QAAc;AAAA,IACd,UAAc;AAAA,IACd,cAAc;AAAA,IACd,MAAc;AAAA,IACd,OAAc;AAAA,EAChB;AAEA,QAAM,SAAkB;AAAA,IACtB;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,QACR,EAAE,MAAM,WAAiB,MAAM,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP/instructions for an agent workspace', opts: ['--target <t> kiro | claude | codex'] },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'compression', args: '[level]', desc: 'Set shell compression level (off | normal | aggressive | ultra)' },\n { name: 'exec', args: '<command...>', desc: 'Run a shell command with token-optimized output', opts: ['-l, --level <l> normal | aggressive | ultra', '-t, --timeout <s> Timeout in seconds (default 60)', '--raw Show raw + compressed for comparison', '--json Output as JSON'] },\n { name: 'gain', desc: 'Show token savings from compressed command outputs', opts: ['--graph ASCII graph (last 30 days)', '--history Recent command history', '--daily Day-by-day breakdown', '--period <p> session | today | week | all'] },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up Kiro MCP + hooks + steering for the current workspace'],\n ['kirograph install --target claude', 'Wire up Claude Code MCP + project memory'],\n ['kirograph install --target codex', 'Install Codex project instructions and print MCP config'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph compression aggressive', 'Set compression to aggressive level'],\n ['kirograph compression off', 'Disable compression hook (tool still available)'],\n ['kirograph exec git status', 'Run git status with compression'],\n ['kirograph exec --level ultra npm test', 'Run tests with ultra compression'],\n ['kirograph exec --raw cargo build', 'Show raw vs compressed comparison'],\n ['kirograph gain --graph', 'Show token savings graph'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('afterAll', '');\n program.helpInformation = () => {\n printBanner();\n printColoredHelp();\n return '';\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;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AE,YAAY,MAAM,GAAG,CAAC;AAC9C,UAAQ,YAAY,YAAY,EAAE;AAClC,UAAQ,kBAAkB,MAAM;AAC9B,mCAAY;AACZ,qBAAiB;AACjB,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,10 +21,16 @@ __export(install_exports, {
|
|
|
21
21
|
register: () => register
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(install_exports);
|
|
24
|
+
const INSTALL_TARGETS = ["kiro", "claude", "codex"];
|
|
24
25
|
function register(program) {
|
|
25
|
-
program.command("install").description("Configure KiroGraph for
|
|
26
|
+
program.command("install").description("Configure KiroGraph for an agent workspace").option("--target <target>", "Integration target: kiro, claude, or codex", "kiro").action(async (opts) => {
|
|
27
|
+
const target = opts.target.toLowerCase();
|
|
28
|
+
if (!INSTALL_TARGETS.includes(target)) {
|
|
29
|
+
console.error(`Unknown install target: ${opts.target}. Choose from: kiro, claude, codex`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
26
32
|
const { runInstaller } = await Promise.resolve().then(() => require("../installer/index.js"));
|
|
27
|
-
await runInstaller();
|
|
33
|
+
await runInstaller(target);
|
|
28
34
|
});
|
|
29
35
|
}
|
|
30
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/install.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\n\nexport function register(program: Command): void {\n program\n .command('install')\n .description('Configure KiroGraph for
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\n\nconst INSTALL_TARGETS = ['kiro', 'claude', 'codex'];\n\nexport function register(program: Command): void {\n program\n .command('install')\n .description('Configure KiroGraph for an agent workspace')\n .option('--target <target>', 'Integration target: kiro, claude, or codex', 'kiro')\n .action(async (opts: { target: string }) => {\n const target = opts.target.toLowerCase();\n if (!INSTALL_TARGETS.includes(target)) {\n console.error(`Unknown install target: ${opts.target}. Choose from: kiro, claude, codex`);\n process.exit(1);\n }\n const { runInstaller } = await Promise.resolve().then(() => require('../installer/index.js'));\n await runInstaller(target as 'kiro' | 'claude' | 'codex');\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,kBAAkB,CAAC,QAAQ,UAAU,OAAO;AAE3C,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,SAAS,EACjB,YAAY,4CAA4C,EACxD,OAAO,qBAAqB,8CAA8C,MAAM,EAChF,OAAO,OAAO,SAA6B;AAC1C,UAAM,SAAS,KAAK,OAAO,YAAY;AACvC,QAAI,CAAC,gBAAgB,SAAS,MAAM,GAAG;AACrC,cAAQ,MAAM,2BAA2B,KAAK,MAAM,oCAAoC;AACxF,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,UAAM,EAAE,aAAa,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,uBAAuB,CAAC;AAC5F,UAAM,aAAa,MAAqC;AAAA,EAC1D,CAAC;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -25,7 +25,9 @@ var import_ui = require("../ui");
|
|
|
25
25
|
function register(program) {
|
|
26
26
|
program.command("query <search>").description("Search for symbols").option("--kind <kind>", "Filter by kind").option("--limit <n>", "Max results", "10").action(async (search, opts) => {
|
|
27
27
|
const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
|
|
28
|
-
const
|
|
28
|
+
const { trackCliToolSaving } = await Promise.resolve().then(() => require("./utils.js"));
|
|
29
|
+
const cwd = process.cwd();
|
|
30
|
+
const cg = await KiroGraph.open(cwd);
|
|
29
31
|
const results = cg.searchNodes(search, opts.kind, parseInt(opts.limit));
|
|
30
32
|
if (results.length === 0) {
|
|
31
33
|
console.log(` ${import_ui.dim}No results for${import_ui.reset} ${import_ui.violet}${import_ui.bold}${search}${import_ui.reset}`);
|
|
@@ -37,6 +39,8 @@ function register(program) {
|
|
|
37
39
|
console.log(`
|
|
38
40
|
${import_ui.dim}${results.length} result(s)${import_ui.reset}`);
|
|
39
41
|
}
|
|
42
|
+
const output = results.map((r) => `${r.node.name} ${r.node.kind} ${r.node.filePath}:${r.node.startLine}`).join("\n");
|
|
43
|
+
trackCliToolSaving(cwd, "kirograph_search", output, { limit: parseInt(opts.limit) });
|
|
40
44
|
cg.close();
|
|
41
45
|
});
|
|
42
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/query.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { dim, reset, violet, bold } from '../ui';\n\nexport function register(program: Command): void {\n program\n .command('query <search>')\n .description('Search for symbols')\n .option('--kind <kind>', 'Filter by kind')\n .option('--limit <n>', 'Max results', '10')\n .action(async (search: string, opts: { kind?: string; limit: string }) => {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAAyC;AAElC,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,gBAAgB,EACxB,YAAY,oBAAoB,EAChC,OAAO,iBAAiB,gBAAgB,EACxC,OAAO,eAAe,eAAe,IAAI,EACzC,OAAO,OAAO,QAAgB,SAA2C;AACxE,UAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,UAAM,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { dim, reset, violet, bold } from '../ui';\n\nexport function register(program: Command): void {\n program\n .command('query <search>')\n .description('Search for symbols')\n .option('--kind <kind>', 'Filter by kind')\n .option('--limit <n>', 'Max results', '10')\n .action(async (search: string, opts: { kind?: string; limit: string }) => {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const { trackCliToolSaving } = await Promise.resolve().then(() => require('./utils.js'));\n\n const cwd = process.cwd();\n const cg = await KiroGraph.open(cwd);\n const results = cg.searchNodes(search, opts.kind as any, parseInt(opts.limit));\n if (results.length === 0) {\n console.log(` ${dim}No results for${reset} ${violet}${bold}${search}${reset}`);\n } else {\n console.log();\n for (const r of results) {\n console.log(` ${violet}${bold}${r.node.name}${reset} ${dim}${r.node.kind}${reset} ${dim}${r.node.filePath}:${r.node.startLine}${reset}`);\n }\n console.log(`\\n ${dim}${results.length} result(s)${reset}`);\n }\n\n // Track savings\n const output = results.map(r => `${r.node.name} ${r.node.kind} ${r.node.filePath}:${r.node.startLine}`).join('\\n');\n trackCliToolSaving(cwd, 'kirograph_search', output, { limit: parseInt(opts.limit) });\n\n cg.close();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,gBAAyC;AAElC,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,gBAAgB,EACxB,YAAY,oBAAoB,EAChC,OAAO,iBAAiB,gBAAgB,EACxC,OAAO,eAAe,eAAe,IAAI,EACzC,OAAO,OAAO,QAAgB,SAA2C;AACxE,UAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,UAAM,EAAE,mBAAmB,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,YAAY,CAAC;AAEvF,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,KAAK,MAAM,UAAU,KAAK,GAAG;AACnC,UAAM,UAAU,GAAG,YAAY,QAAQ,KAAK,MAAa,SAAS,KAAK,KAAK,CAAC;AAC7E,QAAI,QAAQ,WAAW,GAAG;AACxB,cAAQ,IAAI,KAAK,aAAG,iBAAiB,eAAK,IAAI,gBAAM,GAAG,cAAI,GAAG,MAAM,GAAG,eAAK,EAAE;AAAA,IAChF,OAAO;AACL,cAAQ,IAAI;AACZ,iBAAW,KAAK,SAAS;AACvB,gBAAQ,IAAI,KAAK,gBAAM,GAAG,cAAI,GAAG,EAAE,KAAK,IAAI,GAAG,eAAK,KAAK,aAAG,GAAG,EAAE,KAAK,IAAI,GAAG,eAAK,KAAK,aAAG,GAAG,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,SAAS,GAAG,eAAK,EAAE;AAAA,MAC5I;AACA,cAAQ,IAAI;AAAA,IAAO,aAAG,GAAG,QAAQ,MAAM,aAAa,eAAK,EAAE;AAAA,IAC7D;AAGA,UAAM,SAAS,QAAQ,IAAI,OAAK,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,SAAS,EAAE,EAAE,KAAK,IAAI;AACjH,uBAAmB,KAAK,oBAAoB,QAAQ,EAAE,OAAO,SAAS,KAAK,KAAK,EAAE,CAAC;AAEnF,OAAG,MAAM;AAAA,EACX,CAAC;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,11 +37,11 @@ function register(program) {
|
|
|
37
37
|
program.command("serve").description("Start the MCP server").option("--mcp", "Run as MCP stdio server").option("--path <path>", "Project path").action(async (opts) => {
|
|
38
38
|
if (!opts.mcp) {
|
|
39
39
|
console.log(`
|
|
40
|
-
${import_ui.dim}Start the KiroGraph MCP server
|
|
40
|
+
${import_ui.dim}Start the KiroGraph MCP server.${import_ui.reset}`);
|
|
41
41
|
console.log(`
|
|
42
42
|
${import_ui.dim}Usage:${import_ui.reset} ${import_ui.violet}${import_ui.bold}kirograph serve --mcp${import_ui.reset}`);
|
|
43
43
|
console.log(`
|
|
44
|
-
${import_ui.dim}Add to
|
|
44
|
+
${import_ui.dim}Add to your MCP client config:${import_ui.reset}
|
|
45
45
|
`);
|
|
46
46
|
console.log(` ${import_ui.dim}${JSON.stringify({ mcpServers: { kirograph: { command: "kirograph", args: ["serve", "--mcp"] } } }, null, 2).split("\n").join("\n ")}${import_ui.reset}
|
|
47
47
|
`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/serve.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport { dim, reset, violet, bold } from '../ui';\n\nexport function register(program: Command): void {\n program\n .command('serve')\n .description('Start the MCP server')\n .option('--mcp', 'Run as MCP stdio server')\n .option('--path <path>', 'Project path')\n .action(async (opts: { mcp?: boolean; path?: string }) => {\n if (!opts.mcp) {\n console.log(`\\n ${dim}Start the KiroGraph MCP server
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,gBAAyC;AAElC,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,OAAO,EACf,YAAY,sBAAsB,EAClC,OAAO,SAAS,yBAAyB,EACzC,OAAO,iBAAiB,cAAc,EACtC,OAAO,OAAO,SAA2C;AACxD,QAAI,CAAC,KAAK,KAAK;AACb,cAAQ,IAAI;AAAA,IAAO,aAAG,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport { dim, reset, violet, bold } from '../ui';\n\nexport function register(program: Command): void {\n program\n .command('serve')\n .description('Start the MCP server')\n .option('--mcp', 'Run as MCP stdio server')\n .option('--path <path>', 'Project path')\n .action(async (opts: { mcp?: boolean; path?: string }) => {\n if (!opts.mcp) {\n console.log(`\\n ${dim}Start the KiroGraph MCP server.${reset}`);\n console.log(`\\n ${dim}Usage:${reset} ${violet}${bold}kirograph serve --mcp${reset}`);\n console.log(`\\n ${dim}Add to your MCP client config:${reset}\\n`);\n console.log(` ${dim}${JSON.stringify({ mcpServers: { kirograph: { command: 'kirograph', args: ['serve', '--mcp'] } } }, null, 2).split('\\n').join('\\n ')}${reset}\\n`);\n return;\n }\n const { MCPServer } = await Promise.resolve().then(() => require('../../mcp/server.js'));\n const server = new MCPServer(opts.path ? path.resolve(opts.path) : process.cwd());\n await server.start();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,gBAAyC;AAElC,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,OAAO,EACf,YAAY,sBAAsB,EAClC,OAAO,SAAS,yBAAyB,EACzC,OAAO,iBAAiB,cAAc,EACtC,OAAO,OAAO,SAA2C;AACxD,QAAI,CAAC,KAAK,KAAK;AACb,cAAQ,IAAI;AAAA,IAAO,aAAG,kCAAkC,eAAK,EAAE;AAC/D,cAAQ,IAAI;AAAA,IAAO,aAAG,SAAS,eAAK,KAAK,gBAAM,GAAG,cAAI,wBAAwB,eAAK,EAAE;AACrF,cAAQ,IAAI;AAAA,IAAO,aAAG,iCAAiC,eAAK;AAAA,CAAI;AAChE,cAAQ,IAAI,KAAK,aAAG,GAAG,KAAK,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,aAAa,MAAM,CAAC,SAAS,OAAO,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC,EAAE,MAAM,IAAI,EAAE,KAAK,MAAM,CAAC,GAAG,eAAK;AAAA,CAAI;AACtK;AAAA,IACF;AACA,UAAM,EAAE,UAAU,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,qBAAqB,CAAC;AACvF,UAAM,SAAS,IAAI,UAAU,KAAK,OAAO,KAAK,QAAQ,KAAK,IAAI,IAAI,QAAQ,IAAI,CAAC;AAChF,UAAM,OAAO,MAAM;AAAA,EACrB,CAAC;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -48,72 +48,96 @@ const UNINIT_FAREWELLS = [
|
|
|
48
48
|
"574 embeddings. Gone. Just like that.",
|
|
49
49
|
"See you on the other side of `kirograph install`."
|
|
50
50
|
];
|
|
51
|
+
const UNINIT_TARGETS = ["kiro", "claude", "codex", "all"];
|
|
52
|
+
async function confirm(question) {
|
|
53
|
+
const readline = await import("readline");
|
|
54
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
55
|
+
return new Promise((resolve) => rl.question(question, (ans) => {
|
|
56
|
+
rl.close();
|
|
57
|
+
resolve(ans.toLowerCase() === "y");
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
51
60
|
async function runUninit(projectPath, opts) {
|
|
52
61
|
const target = path.resolve(projectPath ?? process.cwd());
|
|
62
|
+
const integration = (opts.target ?? "kiro").toLowerCase();
|
|
63
|
+
if (!UNINIT_TARGETS.includes(integration)) {
|
|
64
|
+
console.error(`Unknown uninit target: ${opts.target}. Choose from: kiro, claude, codex, all`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
53
67
|
const dir = path.join(target, ".kirograph");
|
|
54
68
|
if (!fs.existsSync(dir)) {
|
|
55
69
|
console.log("Not initialized.");
|
|
56
70
|
return;
|
|
57
71
|
}
|
|
72
|
+
let removeIntegration = true;
|
|
73
|
+
let removeGraph = opts.force === true;
|
|
58
74
|
if (!opts.force) {
|
|
59
75
|
(0, import_banner.printBanner)();
|
|
60
76
|
const farewell = UNINIT_FAREWELLS[Math.floor(Math.random() * UNINIT_FAREWELLS.length)];
|
|
61
77
|
console.log(` ${import_ui.violet}${import_ui.bold}${farewell}${import_ui.reset}`);
|
|
62
78
|
console.log(`
|
|
63
|
-
${import_ui.dim}This
|
|
79
|
+
${import_ui.dim}This can remove ${integration} integration files and, separately, the shared .kirograph/ data.${import_ui.reset}`);
|
|
64
80
|
console.log(` ${import_ui.dim}Your source code is untouched.${import_ui.reset}
|
|
65
81
|
`);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
console.log(`
|
|
72
|
-
${import_ui.dim}Cancelled. The graph lives on.${import_ui.reset}
|
|
82
|
+
removeIntegration = await confirm(` ${import_ui.violet}Remove ${integration} integration files?${import_ui.reset} ${import_ui.dim}(y/N)${import_ui.reset} `);
|
|
83
|
+
removeGraph = await confirm(` ${import_ui.violet}Remove shared .kirograph/ data too?${import_ui.reset} ${import_ui.dim}(y/N)${import_ui.reset} `);
|
|
84
|
+
if (!removeIntegration && !removeGraph) {
|
|
85
|
+
console.log(`
|
|
86
|
+
${import_ui.dim}Cancelled. Nothing removed.${import_ui.reset}
|
|
73
87
|
`);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
resolve();
|
|
77
|
-
}));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
78
90
|
console.log();
|
|
79
91
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
if (removeGraph) {
|
|
93
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
94
|
+
console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed .kirograph/`);
|
|
95
|
+
}
|
|
96
|
+
if (removeIntegration && (integration === "kiro" || integration === "all")) {
|
|
97
|
+
const kiroHooks = [
|
|
98
|
+
"kirograph-mark-dirty-on-save.json",
|
|
99
|
+
"kirograph-mark-dirty-on-create.json",
|
|
100
|
+
"kirograph-sync-on-delete.json",
|
|
101
|
+
"kirograph-sync-if-dirty.json",
|
|
102
|
+
"kirograph-sync-on-save.json",
|
|
103
|
+
"kirograph-sync-on-create.json"
|
|
104
|
+
];
|
|
105
|
+
const hooksDir = path.join(target, ".kiro", "hooks");
|
|
106
|
+
let removedHooks = 0;
|
|
107
|
+
for (const hook of kiroHooks) {
|
|
108
|
+
const p = path.join(hooksDir, hook);
|
|
109
|
+
if (fs.existsSync(p)) {
|
|
110
|
+
fs.unlinkSync(p);
|
|
111
|
+
removedHooks++;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (removedHooks > 0) console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed ${removedHooks} hook(s) from .kiro/hooks/`);
|
|
115
|
+
const steeringPath = path.join(target, ".kiro", "steering", "kirograph.md");
|
|
116
|
+
if (fs.existsSync(steeringPath)) {
|
|
117
|
+
fs.unlinkSync(steeringPath);
|
|
118
|
+
console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed .kiro/steering/kirograph.md`);
|
|
119
|
+
}
|
|
120
|
+
const agentPath = path.join(target, ".kiro", "agents", "kirograph.json");
|
|
121
|
+
if (fs.existsSync(agentPath)) {
|
|
122
|
+
fs.unlinkSync(agentPath);
|
|
123
|
+
console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed .kiro/agents/kirograph.json`);
|
|
97
124
|
}
|
|
98
125
|
}
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
fs.unlinkSync(steeringPath);
|
|
103
|
-
console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed .kiro/steering/kirograph.md`);
|
|
126
|
+
if (removeIntegration && (integration === "claude" || integration === "all")) {
|
|
127
|
+
const { uninitClaude } = await Promise.resolve().then(() => require("../installer/targets/claude.js"));
|
|
128
|
+
uninitClaude(target);
|
|
104
129
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
console.log(` ${import_ui.green}\u2713${import_ui.reset} Removed .kiro/agents/kirograph.json`);
|
|
130
|
+
if (removeIntegration && (integration === "codex" || integration === "all")) {
|
|
131
|
+
const { uninitCodex } = await Promise.resolve().then(() => require("../installer/targets/codex.js"));
|
|
132
|
+
uninitCodex(target);
|
|
109
133
|
}
|
|
110
134
|
console.log(`
|
|
111
|
-
${import_ui.dim}Done. Run ${import_ui.violet}kirograph install${import_ui.reset}${import_ui.dim} to come back anytime.${import_ui.reset}
|
|
135
|
+
${import_ui.dim}Done. Run ${import_ui.violet}kirograph install --target ${integration === "all" ? "kiro" : integration}${import_ui.reset}${import_ui.dim} to come back anytime.${import_ui.reset}
|
|
112
136
|
`);
|
|
113
137
|
}
|
|
114
138
|
function register(program) {
|
|
115
|
-
program.command("uninit [projectPath]").description("Remove KiroGraph from a project").option("--force", "Skip confirmation").action(runUninit);
|
|
116
|
-
program.command("uninstall [projectPath]").description("Alias for uninit
|
|
139
|
+
program.command("uninit [projectPath]").description("Remove KiroGraph from a project").option("--force", "Skip confirmation").option("--target <target>", "Integration target to clean up: kiro, claude, codex, or all", "kiro").action(runUninit);
|
|
140
|
+
program.command("uninstall [projectPath]").description("Alias for uninit. Remove KiroGraph from a project").option("--force", "Skip confirmation").option("--target <target>", "Integration target to clean up: kiro, claude, codex, or all", "kiro").action(runUninit);
|
|
117
141
|
}
|
|
118
142
|
// Annotate the CommonJS export names for ESM import in node:
|
|
119
143
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/uninit.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport { printBanner } from '../banner';\nimport { dim, reset, violet, bold, green } from '../ui';\n\nexport const UNINIT_FAREWELLS = [\n \"Oh. So it's come to this.\",\n \"We're sorry to see you go. (Are we? Yes. We are.)\",\n \"Deleting months of carefully indexed knowledge. Bold move.\",\n \"Fine. We'll just sit here in the dark.\",\n \"You can always come back. We won't mention this.\",\n \"The graph remembers everything. Except, soon, anything.\",\n \"Somewhere a tree-sitter is crying.\",\n \"Uninstalling... and pretending it doesn't hurt.\",\n \"574 embeddings. Gone. Just like that.\",\n \"See you on the other side of `kirograph install`.\",\n];\n\nasync function runUninit(projectPath: string | undefined, opts: { force?: boolean }): Promise<void> {\n const target = path.resolve(projectPath ?? process.cwd());\n const dir = path.join(target, '.kirograph');\n if (!fs.existsSync(dir)) { console.log('Not initialized.'); return; }\n if (!opts.force) {\n printBanner();\n const farewell = UNINIT_FAREWELLS[Math.floor(Math.random() * UNINIT_FAREWELLS.length)]!;\n console.log(` ${violet}${bold}${farewell}${reset}`);\n console.log(`\\n ${dim}This
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,SAAoB;AACpB,oBAA4B;AAC5B,gBAAgD;AAEzC,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,eAAe,UAAU,aAAiC,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport { printBanner } from '../banner';\nimport { dim, reset, violet, bold, green } from '../ui';\n\nexport const UNINIT_FAREWELLS = [\n \"Oh. So it's come to this.\",\n \"We're sorry to see you go. (Are we? Yes. We are.)\",\n \"Deleting months of carefully indexed knowledge. Bold move.\",\n \"Fine. We'll just sit here in the dark.\",\n \"You can always come back. We won't mention this.\",\n \"The graph remembers everything. Except, soon, anything.\",\n \"Somewhere a tree-sitter is crying.\",\n \"Uninstalling... and pretending it doesn't hurt.\",\n \"574 embeddings. Gone. Just like that.\",\n \"See you on the other side of `kirograph install`.\",\n];\n\ntype UninitTarget = 'kiro' | 'claude' | 'codex' | 'all';\n\nconst UNINIT_TARGETS: UninitTarget[] = ['kiro', 'claude', 'codex', 'all'];\n\nasync function confirm(question: string): Promise<boolean> {\n const readline = await import('readline');\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise<boolean>(resolve => rl.question(question, ans => {\n rl.close();\n resolve(ans.toLowerCase() === 'y');\n }));\n}\n\nasync function runUninit(projectPath: string | undefined, opts: { force?: boolean; target?: string }): Promise<void> {\n const target = path.resolve(projectPath ?? process.cwd());\n const integration = (opts.target ?? 'kiro').toLowerCase() as UninitTarget;\n if (!UNINIT_TARGETS.includes(integration)) {\n console.error(`Unknown uninit target: ${opts.target}. Choose from: kiro, claude, codex, all`);\n process.exit(1);\n }\n const dir = path.join(target, '.kirograph');\n if (!fs.existsSync(dir)) { console.log('Not initialized.'); return; }\n\n let removeIntegration = true;\n let removeGraph = opts.force === true;\n\n if (!opts.force) {\n printBanner();\n const farewell = UNINIT_FAREWELLS[Math.floor(Math.random() * UNINIT_FAREWELLS.length)]!;\n console.log(` ${violet}${bold}${farewell}${reset}`);\n console.log(`\\n ${dim}This can remove ${integration} integration files and, separately, the shared .kirograph/ data.${reset}`);\n console.log(` ${dim}Your source code is untouched.${reset}\\n`);\n\n removeIntegration = await confirm(` ${violet}Remove ${integration} integration files?${reset} ${dim}(y/N)${reset} `);\n removeGraph = await confirm(` ${violet}Remove shared .kirograph/ data too?${reset} ${dim}(y/N)${reset} `);\n\n if (!removeIntegration && !removeGraph) {\n console.log(`\\n ${dim}Cancelled. Nothing removed.${reset}\\n`);\n return;\n }\n console.log();\n }\n\n if (removeGraph) {\n fs.rmSync(dir, { recursive: true, force: true });\n console.log(` ${green}\u2713${reset} Removed .kirograph/`);\n }\n\n if (removeIntegration && (integration === 'kiro' || integration === 'all')) {\n // Remove .kiro hooks created by kirograph\n const kiroHooks = [\n 'kirograph-mark-dirty-on-save.json',\n 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json',\n 'kirograph-sync-if-dirty.json',\n 'kirograph-sync-on-save.json',\n 'kirograph-sync-on-create.json',\n ];\n const hooksDir = path.join(target, '.kiro', 'hooks');\n let removedHooks = 0;\n for (const hook of kiroHooks) {\n const p = path.join(hooksDir, hook);\n if (fs.existsSync(p)) { fs.unlinkSync(p); removedHooks++; }\n }\n if (removedHooks > 0) console.log(` ${green}\u2713${reset} Removed ${removedHooks} hook(s) from .kiro/hooks/`);\n\n // Remove .kiro/steering/kirograph.md\n const steeringPath = path.join(target, '.kiro', 'steering', 'kirograph.md');\n if (fs.existsSync(steeringPath)) {\n fs.unlinkSync(steeringPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/steering/kirograph.md`);\n }\n\n // Remove .kiro/agents/kirograph.json\n const agentPath = path.join(target, '.kiro', 'agents', 'kirograph.json');\n if (fs.existsSync(agentPath)) {\n fs.unlinkSync(agentPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/agents/kirograph.json`);\n }\n }\n\n if (removeIntegration && (integration === 'claude' || integration === 'all')) {\n const { uninitClaude } = await Promise.resolve().then(() => require('../installer/targets/claude.js'));\n uninitClaude(target);\n }\n\n if (removeIntegration && (integration === 'codex' || integration === 'all')) {\n const { uninitCodex } = await Promise.resolve().then(() => require('../installer/targets/codex.js'));\n uninitCodex(target);\n }\n\n console.log(`\\n ${dim}Done. Run ${violet}kirograph install --target ${integration === 'all' ? 'kiro' : integration}${reset}${dim} to come back anytime.${reset}\\n`);\n}\n\nexport function register(program: Command): void {\n program\n .command('uninit [projectPath]')\n .description('Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n\n program\n .command('uninstall [projectPath]')\n .description('Alias for uninit. Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,SAAoB;AACpB,oBAA4B;AAC5B,gBAAgD;AAEzC,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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AgB,QAAQ;AAC5E,UAAM,EAAE,aAAa,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gCAAgC,CAAC;AACrG,iBAAa,MAAM;AAAA,EACrB;AAEA,MAAI,sBAAsB,gBAAgB,WAAW,gBAAgB,QAAQ;AAC3E,UAAM,EAAE,YAAY,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,+BAA+B,CAAC;AACnG,gBAAY,MAAM;AAAA,EACpB;AAEA,UAAQ,IAAI;AAAA,IAAO,aAAG,aAAa,gBAAM,8BAA8B,gBAAgB,QAAQ,SAAS,WAAW,GAAG,eAAK,GAAG,aAAG,yBAAyB,eAAK;AAAA,CAAI;AACrK;AAEO,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,sBAAsB,EAC9B,YAAY,iCAAiC,EAC7C,OAAO,WAAW,mBAAmB,EACrC,OAAO,qBAAqB,+DAA+D,MAAM,EACjG,OAAO,SAAS;AAEnB,UACG,QAAQ,yBAAyB,EACjC,YAAY,mDAAmD,EAC/D,OAAO,WAAW,mBAAmB,EACrC,OAAO,qBAAqB,+DAA+D,MAAM,EACjG,OAAO,SAAS;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,6 +30,7 @@ var utils_exports = {};
|
|
|
30
30
|
__export(utils_exports, {
|
|
31
31
|
formatSyncCounts: () => formatSyncCounts,
|
|
32
32
|
openProject: () => openProject,
|
|
33
|
+
trackCliToolSaving: () => trackCliToolSaving,
|
|
33
34
|
warnFallback: () => warnFallback
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(utils_exports);
|
|
@@ -47,10 +48,25 @@ function warnFallback(fallback) {
|
|
|
47
48
|
function formatSyncCounts(result) {
|
|
48
49
|
return ` ${import_ui.green}\u2713${import_ui.reset} ${import_ui.dim}added${import_ui.reset} ${(0, import_ui.value)(String(result.added.length))} ${import_ui.dim}modified${import_ui.reset} ${(0, import_ui.value)(String(result.modified.length))} ${import_ui.dim}removed${import_ui.reset} ${(0, import_ui.value)(String(result.removed.length))} ${import_ui.dim}(${result.duration}ms)${import_ui.reset}`;
|
|
49
50
|
}
|
|
51
|
+
function trackCliToolSaving(projectRoot, toolName, output, args) {
|
|
52
|
+
try {
|
|
53
|
+
const { TokenTracker } = require("../../compression/tracker");
|
|
54
|
+
const { estimateNaiveCost } = require("../../compression/naive-cost");
|
|
55
|
+
const { estimateTokens } = require("../../compression/index");
|
|
56
|
+
const outputTokens = estimateTokens(output);
|
|
57
|
+
const naiveCost = estimateNaiveCost(toolName, outputTokens, args);
|
|
58
|
+
if (naiveCost !== null && naiveCost > outputTokens) {
|
|
59
|
+
const tracker = new TokenTracker(projectRoot);
|
|
60
|
+
tracker.recordGraphSaving(toolName, outputTokens, naiveCost);
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
50
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
66
|
0 && (module.exports = {
|
|
52
67
|
formatSyncCounts,
|
|
53
68
|
openProject,
|
|
69
|
+
trackCliToolSaving,
|
|
54
70
|
warnFallback
|
|
55
71
|
});
|
|
56
72
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import * as path from 'path';\nimport { dim, reset, violet, bold, green, value } from '../ui';\n\nexport async function openProject(projectPath?: string): Promise<{ cg: any; target: string }> {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const target = path.resolve(projectPath ?? process.cwd());\n const cg = await KiroGraph.open(target);\n return { cg, target };\n}\n\nexport function warnFallback(fallback: string | null): void {\n if (fallback) console.warn(` \\x1b[33m\u26A0 Engine fallback: ${fallback}\\x1b[0m`);\n}\n\nexport function formatSyncCounts(result: { added: unknown[]; modified: unknown[]; removed: unknown[]; duration: number }): string {\n return ` ${green}\u2713${reset} ${dim}added${reset} ${value(String(result.added.length))} ${dim}modified${reset} ${value(String(result.modified.length))} ${dim}removed${reset} ${value(String(result.removed.length))} ${dim}(${result.duration}ms)${reset}`;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,gBAAuD;AAEvD,eAAsB,YAAY,aAA4D;AAC5F,QAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,QAAM,SAAS,KAAK,QAAQ,eAAe,QAAQ,IAAI,CAAC;AACxD,QAAM,KAAK,MAAM,UAAU,KAAK,MAAM;AACtC,SAAO,EAAE,IAAI,OAAO;AACtB;AAEO,SAAS,aAAa,UAA+B;AAC1D,MAAI,SAAU,SAAQ,KAAK,qCAAgC,QAAQ,SAAS;AAC9E;AAEO,SAAS,iBAAiB,QAAiG;AAChI,SAAO,KAAK,eAAK,SAAI,eAAK,IAAI,aAAG,QAAQ,eAAK,QAAI,iBAAM,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC,KAAK,aAAG,WAAW,eAAK,QAAI,iBAAM,OAAO,OAAO,SAAS,MAAM,CAAC,CAAC,KAAK,aAAG,UAAU,eAAK,QAAI,iBAAM,OAAO,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,aAAG,IAAI,OAAO,QAAQ,MAAM,eAAK;AAC5P;",
|
|
4
|
+
"sourcesContent": ["import * as path from 'path';\nimport { dim, reset, violet, bold, green, value } from '../ui';\n\nexport async function openProject(projectPath?: string): Promise<{ cg: any; target: string }> {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const target = path.resolve(projectPath ?? process.cwd());\n const cg = await KiroGraph.open(target);\n return { cg, target };\n}\n\nexport function warnFallback(fallback: string | null): void {\n if (fallback) console.warn(` \\x1b[33m\u26A0 Engine fallback: ${fallback}\\x1b[0m`);\n}\n\nexport function formatSyncCounts(result: { added: unknown[]; modified: unknown[]; removed: unknown[]; duration: number }): string {\n return ` ${green}\u2713${reset} ${dim}added${reset} ${value(String(result.added.length))} ${dim}modified${reset} ${value(String(result.modified.length))} ${dim}removed${reset} ${value(String(result.removed.length))} ${dim}(${result.duration}ms)${reset}`;\n}\n\n/**\n * Track token savings for a CLI graph tool invocation.\n * Non-critical \u2014 silently ignores errors.\n */\nexport function trackCliToolSaving(projectRoot: string, toolName: string, output: string, args?: Record<string, unknown>): void {\n try {\n const { TokenTracker } = require('../../compression/tracker');\n const { estimateNaiveCost } = require('../../compression/naive-cost');\n const { estimateTokens } = require('../../compression/index');\n\n const outputTokens = estimateTokens(output);\n const naiveCost = estimateNaiveCost(toolName, outputTokens, args);\n if (naiveCost !== null && naiveCost > outputTokens) {\n const tracker = new TokenTracker(projectRoot);\n tracker.recordGraphSaving(toolName, outputTokens, naiveCost);\n }\n } catch { /* non-critical */ }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,gBAAuD;AAEvD,eAAsB,YAAY,aAA4D;AAC5F,QAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,QAAM,SAAS,KAAK,QAAQ,eAAe,QAAQ,IAAI,CAAC;AACxD,QAAM,KAAK,MAAM,UAAU,KAAK,MAAM;AACtC,SAAO,EAAE,IAAI,OAAO;AACtB;AAEO,SAAS,aAAa,UAA+B;AAC1D,MAAI,SAAU,SAAQ,KAAK,qCAAgC,QAAQ,SAAS;AAC9E;AAEO,SAAS,iBAAiB,QAAiG;AAChI,SAAO,KAAK,eAAK,SAAI,eAAK,IAAI,aAAG,QAAQ,eAAK,QAAI,iBAAM,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC,KAAK,aAAG,WAAW,eAAK,QAAI,iBAAM,OAAO,OAAO,SAAS,MAAM,CAAC,CAAC,KAAK,aAAG,UAAU,eAAK,QAAI,iBAAM,OAAO,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,aAAG,IAAI,OAAO,QAAQ,MAAM,eAAK;AAC5P;AAMO,SAAS,mBAAmB,aAAqB,UAAkB,QAAgB,MAAsC;AAC9H,MAAI;AACF,UAAM,EAAE,aAAa,IAAI,QAAQ,2BAA2B;AAC5D,UAAM,EAAE,kBAAkB,IAAI,QAAQ,8BAA8B;AACpE,UAAM,EAAE,eAAe,IAAI,QAAQ,yBAAyB;AAE5D,UAAM,eAAe,eAAe,MAAM;AAC1C,UAAM,YAAY,kBAAkB,UAAU,cAAc,IAAI;AAChE,QAAI,cAAc,QAAQ,YAAY,cAAc;AAClD,YAAM,UAAU,IAAI,aAAa,WAAW;AAC5C,cAAQ,kBAAkB,UAAU,cAAc,SAAS;AAAA,IAC7D;AAAA,EACF,QAAQ;AAAA,EAAqB;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,39 +33,19 @@ __export(cli_agent_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(cli_agent_exports);
|
|
34
34
|
var fs = __toESM(require("fs"));
|
|
35
35
|
var path = __toESM(require("path"));
|
|
36
|
-
|
|
37
|
-
"@kirograph/kirograph_search",
|
|
38
|
-
"@kirograph/kirograph_context",
|
|
39
|
-
"@kirograph/kirograph_callers",
|
|
40
|
-
"@kirograph/kirograph_callees",
|
|
41
|
-
"@kirograph/kirograph_impact",
|
|
42
|
-
"@kirograph/kirograph_node",
|
|
43
|
-
"@kirograph/kirograph_status",
|
|
44
|
-
"@kirograph/kirograph_files",
|
|
45
|
-
"@kirograph/kirograph_dead_code",
|
|
46
|
-
"@kirograph/kirograph_circular_deps",
|
|
47
|
-
"@kirograph/kirograph_path",
|
|
48
|
-
"@kirograph/kirograph_type_hierarchy",
|
|
49
|
-
"@kirograph/kirograph_architecture",
|
|
50
|
-
"@kirograph/kirograph_package",
|
|
51
|
-
"@kirograph/kirograph_coupling",
|
|
52
|
-
"@kirograph/kirograph_hotspots",
|
|
53
|
-
"@kirograph/kirograph_surprising",
|
|
54
|
-
"@kirograph/kirograph_diff"
|
|
55
|
-
];
|
|
56
|
-
const SYNC_CMD = "kirograph sync-if-dirty --quiet 2>/dev/null || true";
|
|
36
|
+
var import_common = require("./common");
|
|
57
37
|
function buildAgentConfig() {
|
|
58
38
|
return {
|
|
59
39
|
name: "kirograph",
|
|
60
40
|
description: "KiroGraph-aware agent \u2014 uses the semantic code graph for faster, smarter exploration.",
|
|
61
41
|
resources: ["file://.kiro/steering/kirograph.md"],
|
|
62
42
|
tools: ["@builtin", "@kirograph"],
|
|
63
|
-
allowedTools:
|
|
43
|
+
allowedTools: import_common.KIROGRAPH_SCOPED_TOOLS,
|
|
64
44
|
useLegacyMcpJson: true,
|
|
65
45
|
hooks: {
|
|
66
|
-
agentSpawn: [{ command:
|
|
67
|
-
userPromptSubmit: [{ command:
|
|
68
|
-
stop: [{ command:
|
|
46
|
+
agentSpawn: [{ command: import_common.KIROGRAPH_SYNC_CMD }],
|
|
47
|
+
userPromptSubmit: [{ command: import_common.KIROGRAPH_SYNC_CMD }],
|
|
48
|
+
stop: [{ command: import_common.KIROGRAPH_SYNC_CMD }]
|
|
69
49
|
}
|
|
70
50
|
};
|
|
71
51
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/installer/cli-agent.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro CLI agent config\n *\n * Writes .kiro/agents/kirograph.json \u2014 a workspace custom agent that wires up:\n * - MCP server (kirograph tools)\n * - steering file as resource (single source of truth for instructions + caveman rules)\n * - hooks: sync on agentSpawn, userPromptSubmit, stop\n *\n * Sync strategy (CLI has no file-watch events unlike the IDE):\n * - agentSpawn: sync-if-dirty \u2014 catches edits made between sessions\n * - userPromptSubmit: sync-if-dirty \u2014 keeps graph fresh within a session\n * - stop: sync-if-dirty --quiet \u2014 deferred flush, mirrors IDE agentStop\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,SAAoB;AACpB,WAAsB;
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro CLI agent config\n *\n * Writes .kiro/agents/kirograph.json \u2014 a workspace custom agent that wires up:\n * - MCP server (kirograph tools)\n * - steering file as resource (single source of truth for instructions + caveman rules)\n * - hooks: sync on agentSpawn, userPromptSubmit, stop\n *\n * Sync strategy (CLI has no file-watch events unlike the IDE):\n * - agentSpawn: sync-if-dirty \u2014 catches edits made between sessions\n * - userPromptSubmit: sync-if-dirty \u2014 keeps graph fresh within a session\n * - stop: sync-if-dirty --quiet \u2014 deferred flush, mirrors IDE agentStop\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { KIROGRAPH_SCOPED_TOOLS, KIROGRAPH_SYNC_CMD } from './common';\n\nfunction buildAgentConfig() {\n return {\n name: 'kirograph',\n description: 'KiroGraph-aware agent \u2014 uses the semantic code graph for faster, smarter exploration.',\n resources: ['file://.kiro/steering/kirograph.md'],\n tools: ['@builtin', '@kirograph'],\n allowedTools: KIROGRAPH_SCOPED_TOOLS,\n useLegacyMcpJson: true,\n hooks: {\n agentSpawn: [{ command: KIROGRAPH_SYNC_CMD }],\n userPromptSubmit: [{ command: KIROGRAPH_SYNC_CMD }],\n stop: [{ command: KIROGRAPH_SYNC_CMD }],\n },\n };\n}\n\nfunction ensureDir(p: string): void {\n fs.mkdirSync(p, { recursive: true });\n}\n\nfunction writeJson(p: string, data: unknown): void {\n fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\\n');\n}\n\nexport function writeCliAgent(kiroDir: string): void {\n const agentsDir = path.join(kiroDir, 'agents');\n ensureDir(agentsDir);\n const agentPath = path.join(agentsDir, 'kirograph.json');\n writeJson(agentPath, buildAgentConfig());\n console.log(` \u2713 CLI agent config written to ${agentPath}`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,SAAoB;AACpB,WAAsB;AACtB,oBAA2D;AAE3D,SAAS,mBAAmB;AAC1B,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa;AAAA,IACb,WAAW,CAAC,oCAAoC;AAAA,IAChD,OAAO,CAAC,YAAY,YAAY;AAAA,IAChC,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,OAAO;AAAA,MACL,YAAY,CAAC,EAAE,SAAS,iCAAmB,CAAC;AAAA,MAC5C,kBAAkB,CAAC,EAAE,SAAS,iCAAmB,CAAC;AAAA,MAClD,MAAM,CAAC,EAAE,SAAS,iCAAmB,CAAC;AAAA,IACxC;AAAA,EACF;AACF;AAEA,SAAS,UAAU,GAAiB;AAClC,KAAG,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;AACrC;AAEA,SAAS,UAAU,GAAW,MAAqB;AACjD,KAAG,cAAc,GAAG,KAAK,UAAU,MAAM,MAAM,CAAC,IAAI,IAAI;AAC1D;AAEO,SAAS,cAAc,SAAuB;AACnD,QAAM,YAAY,KAAK,KAAK,SAAS,QAAQ;AAC7C,YAAU,SAAS;AACnB,QAAM,YAAY,KAAK,KAAK,WAAW,gBAAgB;AACvD,YAAU,WAAW,iBAAiB,CAAC;AACvC,UAAQ,IAAI,wCAAmC,SAAS,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|