@colbymchenry/codegraph 0.7.6 → 0.7.10
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 +35 -10
- package/dist/bin/codegraph.js +94 -24
- package/dist/bin/codegraph.js.map +1 -1
- package/dist/bin/node-version-check.d.ts +3 -0
- package/dist/bin/node-version-check.d.ts.map +1 -1
- package/dist/bin/node-version-check.js +5 -2
- package/dist/bin/node-version-check.js.map +1 -1
- package/dist/bin/uninstall.d.ts +7 -7
- package/dist/bin/uninstall.d.ts.map +1 -1
- package/dist/bin/uninstall.js +23 -135
- package/dist/bin/uninstall.js.map +1 -1
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +7 -1
- package/dist/db/queries.js.map +1 -1
- package/dist/installer/claude-md-template.d.ts +10 -6
- package/dist/installer/claude-md-template.d.ts.map +1 -1
- package/dist/installer/claude-md-template.js +15 -40
- package/dist/installer/claude-md-template.js.map +1 -1
- package/dist/installer/config-writer.d.ts +17 -24
- package/dist/installer/config-writer.d.ts.map +1 -1
- package/dist/installer/config-writer.js +44 -239
- package/dist/installer/config-writer.js.map +1 -1
- package/dist/installer/index.d.ts +45 -4
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +216 -79
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/instructions-template.d.ts +28 -0
- package/dist/installer/instructions-template.d.ts.map +1 -0
- package/dist/installer/instructions-template.js +63 -0
- package/dist/installer/instructions-template.js.map +1 -0
- package/dist/installer/targets/claude.d.ts +27 -0
- package/dist/installer/targets/claude.d.ts.map +1 -0
- package/dist/installer/targets/claude.js +246 -0
- package/dist/installer/targets/claude.js.map +1 -0
- package/dist/installer/targets/codex.d.ts +18 -0
- package/dist/installer/targets/codex.d.ts.map +1 -0
- package/dist/installer/targets/codex.js +185 -0
- package/dist/installer/targets/codex.js.map +1 -0
- package/dist/installer/targets/cursor.d.ts +35 -0
- package/dist/installer/targets/cursor.d.ts.map +1 -0
- package/dist/installer/targets/cursor.js +229 -0
- package/dist/installer/targets/cursor.js.map +1 -0
- package/dist/installer/targets/opencode.d.ts +30 -0
- package/dist/installer/targets/opencode.d.ts.map +1 -0
- package/dist/installer/targets/opencode.js +235 -0
- package/dist/installer/targets/opencode.js.map +1 -0
- package/dist/installer/targets/registry.d.ts +35 -0
- package/dist/installer/targets/registry.d.ts.map +1 -0
- package/dist/installer/targets/registry.js +83 -0
- package/dist/installer/targets/registry.js.map +1 -0
- package/dist/installer/targets/shared.d.ts +77 -0
- package/dist/installer/targets/shared.d.ts.map +1 -0
- package/dist/installer/targets/shared.js +246 -0
- package/dist/installer/targets/shared.js.map +1 -0
- package/dist/installer/targets/toml.d.ts +52 -0
- package/dist/installer/targets/toml.d.ts.map +1 -0
- package/dist/installer/targets/toml.js +147 -0
- package/dist/installer/targets/toml.js.map +1 -0
- package/dist/installer/targets/types.d.ts +116 -0
- package/dist/installer/targets/types.d.ts.map +1 -0
- package/dist/installer/targets/types.js +16 -0
- package/dist/installer/targets/types.js.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +34 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools.d.ts +16 -3
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +86 -17
- package/dist/mcp/tools.js.map +1 -1
- package/dist/ui/glyphs.d.ts +42 -0
- package/dist/ui/glyphs.d.ts.map +1 -0
- package/dist/ui/glyphs.js +78 -0
- package/dist/ui/glyphs.js.map +1 -0
- package/dist/ui/shimmer-worker.js +17 -11
- package/dist/ui/shimmer-worker.js.map +1 -1
- package/package.json +2 -1
- package/scripts/local-install.sh +41 -0
- package/scripts/release.sh +70 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Glyph selection for CLI output.
|
|
4
|
+
*
|
|
5
|
+
* On Windows, console output is interpreted via the active output
|
|
6
|
+
* codepage. PowerShell 5.1 and cmd.exe default to OEM codepages
|
|
7
|
+
* (CP437, CP936, ...), so UTF-8 bytes written to the console render
|
|
8
|
+
* as mojibake (see #168). The shimmer worker is hit hardest because
|
|
9
|
+
* it uses `fs.writeSync(1, ...)` (raw bytes, no TTY-aware encoding
|
|
10
|
+
* conversion) to keep animation smooth while the main thread is
|
|
11
|
+
* blocked in SQLite. To stay readable everywhere, we fall back to
|
|
12
|
+
* ASCII glyphs whenever the terminal is not known to handle UTF-8.
|
|
13
|
+
*
|
|
14
|
+
* Detection is intentionally simple:
|
|
15
|
+
* - `CODEGRAPH_ASCII=1` -> ASCII (escape hatch for any terminal)
|
|
16
|
+
* - `CODEGRAPH_UNICODE=1` -> Unicode (opt-in on Windows)
|
|
17
|
+
* - Windows -> ASCII by default
|
|
18
|
+
* - Linux kernel console (`TERM=linux`) -> ASCII
|
|
19
|
+
* - Everything else -> Unicode
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ASCII_GLYPHS = exports.UNICODE_GLYPHS = void 0;
|
|
23
|
+
exports.supportsUnicode = supportsUnicode;
|
|
24
|
+
exports.getGlyphs = getGlyphs;
|
|
25
|
+
exports._resetGlyphsCache = _resetGlyphsCache;
|
|
26
|
+
function supportsUnicode() {
|
|
27
|
+
if (process.env.CODEGRAPH_ASCII === '1')
|
|
28
|
+
return false;
|
|
29
|
+
if (process.env.CODEGRAPH_UNICODE === '1')
|
|
30
|
+
return true;
|
|
31
|
+
if (process.platform === 'win32')
|
|
32
|
+
return false;
|
|
33
|
+
return process.env.TERM !== 'linux';
|
|
34
|
+
}
|
|
35
|
+
exports.UNICODE_GLYPHS = {
|
|
36
|
+
ok: '✓',
|
|
37
|
+
err: '✗',
|
|
38
|
+
info: 'ℹ',
|
|
39
|
+
warn: '⚠',
|
|
40
|
+
spinner: ['·', '✢', '✳', '✶', '✻', '✽'],
|
|
41
|
+
barFilled: '█',
|
|
42
|
+
barEmpty: '░',
|
|
43
|
+
rail: '│',
|
|
44
|
+
phaseDone: '◆',
|
|
45
|
+
dash: '—',
|
|
46
|
+
hLine: '─',
|
|
47
|
+
treeBranch: '├── ',
|
|
48
|
+
treeLast: '└── ',
|
|
49
|
+
treePipe: '│ ',
|
|
50
|
+
};
|
|
51
|
+
exports.ASCII_GLYPHS = {
|
|
52
|
+
ok: '[OK]',
|
|
53
|
+
err: '[ERR]',
|
|
54
|
+
info: '[i]',
|
|
55
|
+
warn: '[!]',
|
|
56
|
+
spinner: ['.', '*', '+', 'x', 'o', 'O'],
|
|
57
|
+
barFilled: '#',
|
|
58
|
+
barEmpty: '-',
|
|
59
|
+
rail: '|',
|
|
60
|
+
phaseDone: '*',
|
|
61
|
+
dash: '-',
|
|
62
|
+
hLine: '-',
|
|
63
|
+
treeBranch: '|-- ',
|
|
64
|
+
treeLast: '`-- ',
|
|
65
|
+
treePipe: '| ',
|
|
66
|
+
};
|
|
67
|
+
let cached = null;
|
|
68
|
+
function getGlyphs() {
|
|
69
|
+
if (cached === null) {
|
|
70
|
+
cached = supportsUnicode() ? exports.UNICODE_GLYPHS : exports.ASCII_GLYPHS;
|
|
71
|
+
}
|
|
72
|
+
return cached;
|
|
73
|
+
}
|
|
74
|
+
/** Reset the cached glyph set. Test-only; production code should call `getGlyphs()`. */
|
|
75
|
+
function _resetGlyphsCache() {
|
|
76
|
+
cached = null;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=glyphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glyphs.js","sourceRoot":"","sources":["../../src/ui/glyphs.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,0CAKC;AAuDD,8BAKC;AAGD,8CAEC;AAtED,SAAgB,eAAe;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,OAAO,CA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CAAC,CAAC,CAAC,oBAAY,CAAC;IAC7D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,wFAAwF;AACxF,SAAgB,iBAAiB;IAC/B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const worker_threads_1 = require("worker_threads");
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
|
+
const glyphs_1 = require("./glyphs");
|
|
5
6
|
// Write directly to fd 1 (stdout) instead of writeStdout().
|
|
6
7
|
// In Node.js worker threads, process.stdout is proxied through the main
|
|
7
8
|
// thread's event loop — so if the main thread is blocked (e.g. SQLite),
|
|
8
9
|
// stdout writes from the worker queue up and the animation freezes.
|
|
9
10
|
// fs.writeSync(1, ...) is a direct kernel syscall that bypasses this.
|
|
11
|
+
//
|
|
12
|
+
// Side effect: bypasses Node's TTY-aware encoding conversion on Windows,
|
|
13
|
+
// so UTF-8 bytes hit the console raw and mojibake on OEM codepages.
|
|
14
|
+
// `getGlyphs()` returns ASCII fallbacks on Windows to avoid this (#168).
|
|
10
15
|
function writeStdout(s) {
|
|
11
16
|
(0, fs_1.writeSync)(1, s);
|
|
12
17
|
}
|
|
13
|
-
const
|
|
18
|
+
const G = (0, glyphs_1.getGlyphs)();
|
|
19
|
+
const SPINNER_GLYPHS = G.spinner;
|
|
14
20
|
const ANIM_INTERVAL = 150;
|
|
15
21
|
const FRAMES_PER_GLYPH = 3;
|
|
16
22
|
const RST = '\x1b[0m';
|
|
@@ -36,7 +42,7 @@ function formatNumber(n) {
|
|
|
36
42
|
}
|
|
37
43
|
function renderBar(frame, filled, empty) {
|
|
38
44
|
if (filled === 0)
|
|
39
|
-
return `${DM}${
|
|
45
|
+
return `${DM}${G.barEmpty.repeat(empty)}${RST}`;
|
|
40
46
|
const cycleFrames = 24;
|
|
41
47
|
const shimmerPos = ((frame % cycleFrames) / cycleFrames) * (filled + 6) - 3;
|
|
42
48
|
const shimmerWidth = 3;
|
|
@@ -47,9 +53,9 @@ function renderBar(frame, filled, empty) {
|
|
|
47
53
|
const r = lerp(160, 251, t);
|
|
48
54
|
const g = lerp(100, 191, t);
|
|
49
55
|
const b = lerp(9, 36, t);
|
|
50
|
-
bar += `\x1b[38;2;${r};${g};${b}m${BOLD}
|
|
56
|
+
bar += `\x1b[38;2;${r};${g};${b}m${BOLD}${G.barFilled}`;
|
|
51
57
|
}
|
|
52
|
-
bar += `${RST}${DM}${
|
|
58
|
+
bar += `${RST}${DM}${G.barEmpty.repeat(empty)}${RST}`;
|
|
53
59
|
return bar;
|
|
54
60
|
}
|
|
55
61
|
// Mutable state
|
|
@@ -61,20 +67,20 @@ function render() {
|
|
|
61
67
|
return;
|
|
62
68
|
const frame = animFrame();
|
|
63
69
|
const glyphIdx = Math.floor(frame / FRAMES_PER_GLYPH) % SPINNER_GLYPHS.length;
|
|
64
|
-
const glyph = SPINNER_GLYPHS[glyphIdx] ?? '
|
|
70
|
+
const glyph = SPINNER_GLYPHS[glyphIdx] ?? SPINNER_GLYPHS[0] ?? '.';
|
|
65
71
|
const color = shimmerColor(frame);
|
|
66
72
|
let line;
|
|
67
73
|
if (currentPercent >= 0) {
|
|
68
74
|
const barWidth = 25;
|
|
69
75
|
const filled = Math.round(barWidth * currentPercent / 100);
|
|
70
76
|
const empty = barWidth - filled;
|
|
71
|
-
line = `${DM}
|
|
77
|
+
line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage} ${renderBar(frame, filled, empty)} ${currentPercent}%`;
|
|
72
78
|
}
|
|
73
79
|
else if (currentCount > 0) {
|
|
74
|
-
line = `${DM}
|
|
80
|
+
line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage}... ${formatNumber(currentCount)} found`;
|
|
75
81
|
}
|
|
76
82
|
else {
|
|
77
|
-
line = `${DM}
|
|
83
|
+
line = `${DM}${G.rail}${RST} ${color}${glyph}${RST} ${currentMessage}...`;
|
|
78
84
|
}
|
|
79
85
|
writeStdout(`\r\x1b[K${line}`);
|
|
80
86
|
}
|
|
@@ -84,10 +90,10 @@ function finishPhase() {
|
|
|
84
90
|
writeStdout(`\r\x1b[K`);
|
|
85
91
|
let detail = '';
|
|
86
92
|
if (currentPercent >= 0)
|
|
87
|
-
detail =
|
|
93
|
+
detail = ` ${G.dash} done`;
|
|
88
94
|
else if (currentCount > 0)
|
|
89
|
-
detail = `
|
|
90
|
-
writeStdout(`${DM}
|
|
95
|
+
detail = ` ${G.dash} ${formatNumber(currentCount)} found`;
|
|
96
|
+
writeStdout(`${DM}${G.rail}${RST} ${GRN}${G.phaseDone}${RST} ${currentMessage}${detail}\n`);
|
|
91
97
|
currentMessage = '';
|
|
92
98
|
currentPercent = -1;
|
|
93
99
|
currentCount = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer-worker.js","sourceRoot":"","sources":["../../src/ui/shimmer-worker.ts"],"names":[],"mappings":";;AAAA,mDAAwD;AACxD,2BAA+B;
|
|
1
|
+
{"version":3,"file":"shimmer-worker.js","sourceRoot":"","sources":["../../src/ui/shimmer-worker.ts"],"names":[],"mappings":";;AAAA,mDAAwD;AACxD,2BAA+B;AAC/B,qCAAqC;AAGrC,4DAA4D;AAC5D,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,oEAAoE;AACpE,yEAAyE;AACzE,SAAS,WAAW,CAAC,CAAS;IAC5B,IAAA,cAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,GAAG,IAAA,kBAAS,GAAE,CAAC;AACtB,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC;AACjC,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,MAAM,GAAG,GAAG,SAAS,CAAC;AACtB,MAAM,EA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
|
"name": "@colbymchenry/codegraph",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"description": "Supercharge Claude Code with semantic code intelligence. 94% fewer tool calls • 77% faster exploration • 100% local.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"commander": "^14.0.2",
|
|
37
37
|
"fast-string-width": "^3.0.2",
|
|
38
38
|
"fast-wrap-ansi": "^0.2.0",
|
|
39
|
+
"jsonc-parser": "^3.3.1",
|
|
39
40
|
"node-sqlite3-wasm": "^0.8.30",
|
|
40
41
|
"picomatch": "^4.0.3",
|
|
41
42
|
"sisteransi": "^1.0.5",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Build the current branch and link it as the global `codegraph` for
|
|
3
|
+
# hands-on testing. Replaces any existing global install for as long
|
|
4
|
+
# as the symlink is in place.
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# ./scripts/local-install.sh # build + link
|
|
8
|
+
# ./scripts/local-install.sh --undo # unlink + restore the published version
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
cd "$(dirname "$0")/.."
|
|
13
|
+
|
|
14
|
+
PKG=$(node -p "require('./package.json').name")
|
|
15
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
16
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
17
|
+
|
|
18
|
+
if [ "${1:-}" = "--undo" ]; then
|
|
19
|
+
echo "→ unlinking ${PKG}"
|
|
20
|
+
npm unlink -g "${PKG}" >/dev/null 2>&1 || true
|
|
21
|
+
echo "→ reinstalling published ${PKG}"
|
|
22
|
+
npm install -g "${PKG}"
|
|
23
|
+
echo "done: global codegraph -> $(command -v codegraph)"
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
echo "→ building ${PKG} ${VERSION} (${BRANCH})"
|
|
28
|
+
npm run build
|
|
29
|
+
|
|
30
|
+
echo "→ linking globally"
|
|
31
|
+
npm link
|
|
32
|
+
|
|
33
|
+
LINKED=$(command -v codegraph || echo "(not on PATH)")
|
|
34
|
+
echo
|
|
35
|
+
echo "✓ global codegraph now points to this branch"
|
|
36
|
+
echo " binary: ${LINKED}"
|
|
37
|
+
echo " branch: ${BRANCH}"
|
|
38
|
+
echo " version: ${VERSION}"
|
|
39
|
+
echo
|
|
40
|
+
echo "To restore the published version:"
|
|
41
|
+
echo " ./scripts/local-install.sh --undo"
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Tag the current commit with the version in package.json and publish a
|
|
3
|
+
# matching GitHub Release whose body is the corresponding CHANGELOG.md entry.
|
|
4
|
+
#
|
|
5
|
+
# Run AFTER you have:
|
|
6
|
+
# - bumped package.json
|
|
7
|
+
# - added a `## [X.Y.Z] - YYYY-MM-DD` block at the top of CHANGELOG.md
|
|
8
|
+
# - committed, pushed to origin, and run `npm publish`
|
|
9
|
+
#
|
|
10
|
+
# Idempotent: safe to re-run after a partial failure. Skips steps that are
|
|
11
|
+
# already done (tag created, tag pushed, release published).
|
|
12
|
+
#
|
|
13
|
+
# Usage: ./scripts/release.sh
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
cd "$(dirname "$0")/.."
|
|
18
|
+
|
|
19
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
20
|
+
TAG="v${VERSION}"
|
|
21
|
+
|
|
22
|
+
REPO=$(git remote get-url origin | sed -E 's|.*github\.com[:/]||; s|\.git$||')
|
|
23
|
+
if [ -z "${REPO}" ]; then
|
|
24
|
+
echo "error: could not derive owner/repo from origin remote URL" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if ! grep -q "^## \[${VERSION}\]" CHANGELOG.md; then
|
|
29
|
+
echo "error: no '## [${VERSION}]' entry found in CHANGELOG.md" >&2
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
NOTES=$(awk -v v="${VERSION}" '
|
|
34
|
+
/^## \[/ {
|
|
35
|
+
if (p) exit
|
|
36
|
+
if ($0 ~ "^## \\[" v "\\]") p = 1
|
|
37
|
+
}
|
|
38
|
+
p
|
|
39
|
+
' CHANGELOG.md)
|
|
40
|
+
|
|
41
|
+
if [ -z "${NOTES}" ]; then
|
|
42
|
+
echo "error: failed to extract changelog notes for ${VERSION}" >&2
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
if git rev-parse "${TAG}" >/dev/null 2>&1; then
|
|
47
|
+
echo "✓ tag ${TAG} already exists locally"
|
|
48
|
+
else
|
|
49
|
+
echo "→ tagging ${TAG}"
|
|
50
|
+
git tag "${TAG}"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if git ls-remote --exit-code --tags origin "${TAG}" >/dev/null 2>&1; then
|
|
54
|
+
echo "✓ tag ${TAG} already on origin"
|
|
55
|
+
else
|
|
56
|
+
echo "→ pushing ${TAG} to origin"
|
|
57
|
+
git push origin "${TAG}"
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
if gh release view "${TAG}" --repo "${REPO}" >/dev/null 2>&1; then
|
|
61
|
+
echo "✓ release ${TAG} already published"
|
|
62
|
+
else
|
|
63
|
+
echo "→ creating GitHub Release ${TAG} on ${REPO}"
|
|
64
|
+
gh release create "${TAG}" \
|
|
65
|
+
--repo "${REPO}" \
|
|
66
|
+
--title "${TAG}" \
|
|
67
|
+
--notes "${NOTES}"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "done: https://github.com/${REPO}/releases/tag/${TAG}"
|