@stupidloud/codegraph 0.7.20 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +38 -48
  2. package/dist/bin/codegraph.js +25 -0
  3. package/dist/bin/codegraph.js.map +1 -1
  4. package/dist/extraction/index.d.ts.map +1 -1
  5. package/dist/extraction/index.js +63 -37
  6. package/dist/extraction/index.js.map +1 -1
  7. package/dist/installer/config-writer.d.ts.map +1 -1
  8. package/dist/installer/config-writer.js +3 -1
  9. package/dist/installer/config-writer.js.map +1 -1
  10. package/dist/installer/index.d.ts +12 -0
  11. package/dist/installer/index.d.ts.map +1 -1
  12. package/dist/installer/index.js +72 -4
  13. package/dist/installer/index.js.map +1 -1
  14. package/dist/installer/instructions-template.d.ts +2 -2
  15. package/dist/installer/instructions-template.d.ts.map +1 -1
  16. package/dist/installer/instructions-template.js +4 -2
  17. package/dist/installer/instructions-template.js.map +1 -1
  18. package/dist/installer/targets/claude.d.ts +10 -6
  19. package/dist/installer/targets/claude.d.ts.map +1 -1
  20. package/dist/installer/targets/claude.js +72 -10
  21. package/dist/installer/targets/claude.js.map +1 -1
  22. package/dist/mcp/index.d.ts +8 -0
  23. package/dist/mcp/index.d.ts.map +1 -1
  24. package/dist/mcp/index.js +116 -18
  25. package/dist/mcp/index.js.map +1 -1
  26. package/dist/mcp/server-instructions.d.ts +1 -1
  27. package/dist/mcp/server-instructions.d.ts.map +1 -1
  28. package/dist/mcp/server-instructions.js +15 -0
  29. package/dist/mcp/server-instructions.js.map +1 -1
  30. package/dist/mcp/tools.d.ts +14 -0
  31. package/dist/mcp/tools.d.ts.map +1 -1
  32. package/dist/mcp/tools.js +90 -15
  33. package/dist/mcp/tools.js.map +1 -1
  34. package/dist/mcp/transport.d.ts +17 -0
  35. package/dist/mcp/transport.d.ts.map +1 -1
  36. package/dist/mcp/transport.js +63 -0
  37. package/dist/mcp/transport.js.map +1 -1
  38. package/dist/resolution/frameworks/index.d.ts +1 -0
  39. package/dist/resolution/frameworks/index.d.ts.map +1 -1
  40. package/dist/resolution/frameworks/index.js +5 -1
  41. package/dist/resolution/frameworks/index.js.map +1 -1
  42. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  43. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  44. package/dist/resolution/frameworks/nestjs.js +374 -0
  45. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  46. package/dist/sync/git-hooks.d.ts +45 -0
  47. package/dist/sync/git-hooks.d.ts.map +1 -0
  48. package/dist/sync/git-hooks.js +223 -0
  49. package/dist/sync/git-hooks.js.map +1 -0
  50. package/dist/sync/index.d.ts +4 -0
  51. package/dist/sync/index.d.ts.map +1 -1
  52. package/dist/sync/index.js +12 -1
  53. package/dist/sync/index.js.map +1 -1
  54. package/dist/sync/watch-policy.d.ts +48 -0
  55. package/dist/sync/watch-policy.d.ts.map +1 -0
  56. package/dist/sync/watch-policy.js +124 -0
  57. package/dist/sync/watch-policy.js.map +1 -0
  58. package/dist/sync/watcher.d.ts.map +1 -1
  59. package/dist/sync/watcher.js +10 -0
  60. package/dist/sync/watcher.js.map +1 -1
  61. package/package.json +3 -3
  62. package/scripts/agent-eval/audit.sh +68 -0
  63. package/scripts/agent-eval/itrun.sh +1 -1
  64. package/scripts/agent-eval/run-all.sh +67 -0
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env bash
2
+ # With/without A/B (and optional interactive) eval for a codegraph version on a
3
+ # repo. Codegraph is the ONLY variable: both arms launch claude with
4
+ # --strict-mcp-config — with = codegraph-only MCP (pointed at $CG_BIN),
5
+ # without = empty MCP. Built-in Read/Grep/Bash stay available in both arms.
6
+ #
7
+ # Usage: run-all.sh <repo-path> "<question>" [headless|tmux|all]
8
+ # Env: CG_BIN codegraph binary (default: command -v codegraph)
9
+ # AGENT_EVAL_OUT output dir (default: /tmp/agent-eval)
10
+ set -uo pipefail
11
+
12
+ REPO="${1:?usage: run-all.sh <repo-path> \"<question>\" [headless|tmux|all]}"
13
+ Q="${2:?question required}"
14
+ MODE="${3:-headless}"
15
+ CG_BIN="${CG_BIN:-$(command -v codegraph)}"
16
+ OUT="${AGENT_EVAL_OUT:-/tmp/agent-eval}"
17
+ HARNESS="$(cd "$(dirname "$0")" && pwd)"
18
+ mkdir -p "$OUT"
19
+
20
+ [ -n "$CG_BIN" ] || { echo "no codegraph binary on PATH (set CG_BIN)"; exit 1; }
21
+ [ -d "$REPO/.codegraph" ] || { echo "no .codegraph index at $REPO — index it first"; exit 1; }
22
+ case "$MODE" in headless|tmux|all) ;; *) echo "mode must be headless|tmux|all (got '$MODE')"; exit 1;; esac
23
+
24
+ # MCP config files (path form avoids inline-JSON quoting through tmux).
25
+ cat > "$OUT/mcp-codegraph.json" <<JSON
26
+ {"mcpServers":{"codegraph":{"command":"$CG_BIN","args":["serve","--mcp","--path","$REPO"]}}}
27
+ JSON
28
+ echo '{"mcpServers":{}}' > "$OUT/mcp-empty.json"
29
+
30
+ echo "###### codegraph: $CG_BIN"
31
+ echo "###### repo: $REPO"
32
+ echo "###### question: $Q"
33
+ echo
34
+
35
+ # Headless arm: claude -p with stream-json -> exact tool sequence + tokens/cost.
36
+ headless() {
37
+ local label="$1" cfg="$2"
38
+ echo "############################## HEADLESS [$label] ##############################"
39
+ ( cd "$REPO" && claude -p "$Q" \
40
+ --output-format stream-json --verbose \
41
+ --permission-mode bypassPermissions \
42
+ --model opus \
43
+ --max-budget-usd 4 \
44
+ --strict-mcp-config --mcp-config "$cfg" \
45
+ > "$OUT/run-$label.jsonl" 2>"$OUT/run-$label.err" )
46
+ echo "exit $? -> $OUT/run-$label.jsonl ($(wc -l < "$OUT/run-$label.jsonl" | tr -d ' ') lines)"
47
+ tail -2 "$OUT/run-$label.err" 2>/dev/null
48
+ node "$HARNESS/parse-run.mjs" "$OUT/run-$label.jsonl" 2>&1 || true
49
+ echo
50
+ }
51
+
52
+ if [ "$MODE" = headless ] || [ "$MODE" = all ]; then
53
+ headless "headless-with" "$OUT/mcp-codegraph.json"
54
+ headless "headless-without" "$OUT/mcp-empty.json"
55
+ fi
56
+
57
+ if [ "$MODE" = tmux ] || [ "$MODE" = all ]; then
58
+ echo "############################## INTERACTIVE [with] ##############################"
59
+ CLAUDE_EXTRA_ARGS="--model opus --strict-mcp-config --mcp-config $OUT/mcp-codegraph.json" \
60
+ bash "$HARNESS/itrun.sh" "$REPO" "int-with" "$Q" 2>&1 || echo "[itrun WITH failed]"
61
+ echo
62
+ echo "############################## INTERACTIVE [without] ##############################"
63
+ CLAUDE_EXTRA_ARGS="--model opus --strict-mcp-config --mcp-config $OUT/mcp-empty.json" \
64
+ bash "$HARNESS/itrun.sh" "$REPO" "int-without" "$Q" 2>&1 || echo "[itrun WITHOUT failed]"
65
+ echo
66
+ fi
67
+ echo "############################## RUN-ALL COMPLETE ##############################"