@colbymchenry/codegraph 0.7.9 → 0.8.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.
Files changed (88) hide show
  1. package/README.md +49 -49
  2. package/dist/bin/codegraph.js +47 -20
  3. package/dist/bin/codegraph.js.map +1 -1
  4. package/dist/bin/node-version-check.d.ts +3 -0
  5. package/dist/bin/node-version-check.d.ts.map +1 -1
  6. package/dist/bin/node-version-check.js +5 -2
  7. package/dist/bin/node-version-check.js.map +1 -1
  8. package/dist/context/index.d.ts.map +1 -1
  9. package/dist/context/index.js +4 -2
  10. package/dist/context/index.js.map +1 -1
  11. package/dist/db/queries.d.ts.map +1 -1
  12. package/dist/db/queries.js +7 -1
  13. package/dist/db/queries.js.map +1 -1
  14. package/dist/extraction/index.d.ts.map +1 -1
  15. package/dist/extraction/index.js +63 -37
  16. package/dist/extraction/index.js.map +1 -1
  17. package/dist/installer/config-writer.d.ts.map +1 -1
  18. package/dist/installer/config-writer.js +3 -1
  19. package/dist/installer/config-writer.js.map +1 -1
  20. package/dist/installer/index.d.ts +12 -0
  21. package/dist/installer/index.d.ts.map +1 -1
  22. package/dist/installer/index.js +74 -5
  23. package/dist/installer/index.js.map +1 -1
  24. package/dist/installer/instructions-template.d.ts +2 -2
  25. package/dist/installer/instructions-template.d.ts.map +1 -1
  26. package/dist/installer/instructions-template.js +3 -2
  27. package/dist/installer/instructions-template.js.map +1 -1
  28. package/dist/installer/targets/claude.d.ts +10 -6
  29. package/dist/installer/targets/claude.d.ts.map +1 -1
  30. package/dist/installer/targets/claude.js +72 -10
  31. package/dist/installer/targets/claude.js.map +1 -1
  32. package/dist/mcp/index.d.ts +12 -0
  33. package/dist/mcp/index.d.ts.map +1 -1
  34. package/dist/mcp/index.js +143 -20
  35. package/dist/mcp/index.js.map +1 -1
  36. package/dist/mcp/server-instructions.d.ts +1 -1
  37. package/dist/mcp/server-instructions.d.ts.map +1 -1
  38. package/dist/mcp/server-instructions.js +14 -2
  39. package/dist/mcp/server-instructions.js.map +1 -1
  40. package/dist/mcp/tools.d.ts +75 -5
  41. package/dist/mcp/tools.d.ts.map +1 -1
  42. package/dist/mcp/tools.js +470 -87
  43. package/dist/mcp/tools.js.map +1 -1
  44. package/dist/mcp/transport.d.ts +17 -0
  45. package/dist/mcp/transport.d.ts.map +1 -1
  46. package/dist/mcp/transport.js +63 -0
  47. package/dist/mcp/transport.js.map +1 -1
  48. package/dist/resolution/frameworks/index.d.ts +1 -0
  49. package/dist/resolution/frameworks/index.d.ts.map +1 -1
  50. package/dist/resolution/frameworks/index.js +5 -1
  51. package/dist/resolution/frameworks/index.js.map +1 -1
  52. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  53. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  54. package/dist/resolution/frameworks/nestjs.js +374 -0
  55. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  56. package/dist/search/query-utils.d.ts.map +1 -1
  57. package/dist/search/query-utils.js +29 -26
  58. package/dist/search/query-utils.js.map +1 -1
  59. package/dist/sync/git-hooks.d.ts +45 -0
  60. package/dist/sync/git-hooks.d.ts.map +1 -0
  61. package/dist/sync/git-hooks.js +223 -0
  62. package/dist/sync/git-hooks.js.map +1 -0
  63. package/dist/sync/index.d.ts +4 -0
  64. package/dist/sync/index.d.ts.map +1 -1
  65. package/dist/sync/index.js +12 -1
  66. package/dist/sync/index.js.map +1 -1
  67. package/dist/sync/watch-policy.d.ts +48 -0
  68. package/dist/sync/watch-policy.d.ts.map +1 -0
  69. package/dist/sync/watch-policy.js +124 -0
  70. package/dist/sync/watch-policy.js.map +1 -0
  71. package/dist/sync/watcher.d.ts.map +1 -1
  72. package/dist/sync/watcher.js +10 -0
  73. package/dist/sync/watcher.js.map +1 -1
  74. package/dist/ui/glyphs.d.ts +42 -0
  75. package/dist/ui/glyphs.d.ts.map +1 -0
  76. package/dist/ui/glyphs.js +78 -0
  77. package/dist/ui/glyphs.js.map +1 -0
  78. package/dist/ui/shimmer-worker.js +17 -11
  79. package/dist/ui/shimmer-worker.js.map +1 -1
  80. package/package.json +3 -3
  81. package/scripts/agent-eval/audit.sh +68 -0
  82. package/scripts/agent-eval/itrun.sh +107 -0
  83. package/scripts/agent-eval/parse-run.mjs +45 -0
  84. package/scripts/agent-eval/parse-session.mjs +93 -0
  85. package/scripts/agent-eval/run-agent.sh +34 -0
  86. package/scripts/agent-eval/run-all.sh +67 -0
  87. package/scripts/extract-release-notes.mjs +130 -0
  88. package/scripts/release.sh +5 -7
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Extract a release-notes block from CHANGELOG.md for a given version
4
+ * (or unwrap text supplied on stdin), then join hard-wrapped paragraphs.
5
+ *
6
+ * Why: GitHub renders release-note Markdown with GFM hard breaks, so
7
+ * every `\n` becomes `<br>`. The CHANGELOG is hard-wrapped at ~75
8
+ * chars for readable diffs, which then renders as awkward visible
9
+ * line breaks on the release page. This script joins indented
10
+ * continuation lines into a single line per bullet so the GFM
11
+ * renderer produces clean paragraphs.
12
+ *
13
+ * Repo-level CHANGELOG.md viewing is unaffected (CommonMark treats
14
+ * newlines as spaces there).
15
+ *
16
+ * Usage:
17
+ * extract-release-notes.mjs <version> # read CHANGELOG.md
18
+ * extract-release-notes.mjs --stdin # read from stdin (any text)
19
+ */
20
+
21
+ import { readFileSync } from 'fs';
22
+
23
+ const arg = process.argv[2];
24
+ if (!arg) {
25
+ console.error('usage: extract-release-notes.mjs <version> | --stdin');
26
+ process.exit(1);
27
+ }
28
+
29
+ let block;
30
+ if (arg === '--stdin') {
31
+ block = readFileSync(0, 'utf8').replace(/\r\n?/g, '\n').split('\n');
32
+ } else {
33
+ const version = arg;
34
+ const escaped = version.replace(/\./g, '\\.');
35
+ const headerRe = new RegExp(`^## \\[${escaped}\\]`);
36
+ const anyHeaderRe = /^## \[/;
37
+ const lines = readFileSync('CHANGELOG.md', 'utf8').split('\n');
38
+ const start = lines.findIndex((l) => headerRe.test(l));
39
+ if (start === -1) {
40
+ console.error(`no '## [${version}]' entry found in CHANGELOG.md`);
41
+ process.exit(1);
42
+ }
43
+ const after = lines.findIndex((l, i) => i > start && anyHeaderRe.test(l));
44
+ block = lines.slice(start, after === -1 ? lines.length : after);
45
+ }
46
+
47
+ // Track a stack of `{ indent: number }` frames so a continuation line
48
+ // can attach to the right ancestor. Handles the post-nested-list
49
+ // continuation pattern:
50
+ //
51
+ // - top-level
52
+ // - nested
53
+ // back to top-level <- 2-space indent, joins the top-level bullet
54
+ const out = [];
55
+ let buf = '';
56
+ let stack = [];
57
+
58
+ function flushBuf() {
59
+ if (buf !== '') {
60
+ out.push(buf);
61
+ buf = '';
62
+ }
63
+ }
64
+
65
+ function leadingSpaces(s) {
66
+ const m = s.match(/^(\s*)/);
67
+ return m ? m[1].length : 0;
68
+ }
69
+
70
+ // Bullets: `-`, `*`, `digit.` only. `+` is intentionally excluded — the
71
+ // CHANGELOG uses literal `+` inline (`config + instructions`) and we
72
+ // don't want to misread those as nested bullets.
73
+ const listItemRe = /^(\s*)([-*]|\d+\.)\s+/;
74
+ const fenceRe = /^\s*```/;
75
+
76
+ let inFence = false;
77
+
78
+ for (const line of block) {
79
+ // Fenced code blocks: pass through verbatim, no joining.
80
+ if (fenceRe.test(line)) {
81
+ flushBuf();
82
+ stack = [];
83
+ out.push(line);
84
+ inFence = !inFence;
85
+ continue;
86
+ }
87
+ if (inFence) {
88
+ out.push(line);
89
+ continue;
90
+ }
91
+ if (/^\s*$/.test(line)) {
92
+ flushBuf();
93
+ out.push('');
94
+ continue;
95
+ }
96
+ if (/^#/.test(line)) {
97
+ flushBuf();
98
+ stack = [];
99
+ out.push(line);
100
+ continue;
101
+ }
102
+ const itemMatch = line.match(listItemRe);
103
+ if (itemMatch) {
104
+ flushBuf();
105
+ const indent = itemMatch[1].length;
106
+ while (stack.length > 0 && stack[stack.length - 1].indent >= indent) {
107
+ stack.pop();
108
+ }
109
+ stack.push({ indent });
110
+ buf = line;
111
+ continue;
112
+ }
113
+ if (/^\s/.test(line)) {
114
+ const indent = leadingSpaces(line);
115
+ while (stack.length > 1 && stack[stack.length - 1].indent >= indent) {
116
+ flushBuf();
117
+ stack.pop();
118
+ }
119
+ const trimmed = line.replace(/^\s+/, '');
120
+ buf = buf === '' ? trimmed : `${buf} ${trimmed}`;
121
+ continue;
122
+ }
123
+ flushBuf();
124
+ stack = [];
125
+ out.push(line);
126
+ }
127
+ flushBuf();
128
+
129
+ process.stdout.write(out.join('\n'));
130
+ if (!out[out.length - 1]?.endsWith('\n')) process.stdout.write('\n');
@@ -30,13 +30,11 @@ if ! grep -q "^## \[${VERSION}\]" CHANGELOG.md; then
30
30
  exit 1
31
31
  fi
32
32
 
33
- NOTES=$(awk -v v="${VERSION}" '
34
- /^## \[/ {
35
- if (p) exit
36
- if ($0 ~ "^## \\[" v "\\]") p = 1
37
- }
38
- p
39
- ' CHANGELOG.md)
33
+ # Extract notes with paragraph unwrapping — GitHub Releases render with
34
+ # GFM hard-breaks, so the CHANGELOG's hard-wrapped lines would show as
35
+ # visible `<br>` breaks otherwise. The helper joins continuation lines
36
+ # into a single line per bullet.
37
+ NOTES=$(node scripts/extract-release-notes.mjs "${VERSION}")
40
38
 
41
39
  if [ -z "${NOTES}" ]; then
42
40
  echo "error: failed to extract changelog notes for ${VERSION}" >&2