get-shit-done-cc 1.9.1 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -324,50 +324,6 @@ Use for: bug fixes, small features, config changes, one-off tasks.
324
324
 
325
325
  ## Why It Works
326
326
 
327
- ### Codebase Intelligence
328
-
329
- GSD learns your codebase patterns automatically. As Claude writes code, a PostToolUse hook indexes exports and imports, detects naming conventions, and builds a semantic understanding of your codebase.
330
-
331
- **How it works:**
332
-
333
- 1. **Automatic learning** — Every time Claude writes or edits a JS/TS file, the hook extracts exports/imports and updates `.planning/intel/index.json`
334
- 2. **Convention detection** — Analyzes exports for naming patterns (camelCase, PascalCase, etc.), identifies directory purposes, detects file suffixes
335
- 3. **Graph database** — Stores entity relationships in SQLite for dependency analysis
336
- 4. **Context injection** — At session start, injects a summary into Claude's context so it knows your codebase structure and conventions
337
-
338
- **For existing codebases:**
339
-
340
- ```
341
- /gsd:analyze-codebase
342
- ```
343
-
344
- Performs a bulk scan of your codebase to bootstrap the intelligence layer. Works standalone — no `/gsd:new-project` required. After initial analysis, hooks continue incremental learning.
345
-
346
- **Query the graph:**
347
-
348
- ```
349
- /gsd:query-intel dependents src/lib/db.ts # What depends on this file?
350
- /gsd:query-intel hotspots # Most-depended-on files
351
- ```
352
-
353
- **Files created:**
354
-
355
- | File | Purpose |
356
- |------|---------|
357
- | `.planning/intel/index.json` | File exports and imports index |
358
- | `.planning/intel/conventions.json` | Detected patterns (naming, directories, suffixes) |
359
- | `.planning/intel/graph.db` | SQLite database with entity relationships |
360
- | `.planning/intel/summary.md` | Concise context for session injection |
361
-
362
- **Benefits:**
363
-
364
- - Claude follows your naming conventions automatically
365
- - New files go in the right directories
366
- - Consistency maintained across sessions
367
- - Query blast radius before refactoring
368
- - Identify high-impact hotspot files
369
- - No manual documentation of patterns needed
370
-
371
327
  ### Context Engineering
372
328
 
373
329
  Claude Code is incredibly powerful *if* you give it the context it needs. Most people don't.
@@ -478,8 +434,6 @@ You're never locked in. The system adapts.
478
434
  | Command | What it does |
479
435
  |---------|--------------|
480
436
  | `/gsd:map-codebase` | Analyze existing codebase before new-project |
481
- | `/gsd:analyze-codebase` | Bootstrap codebase intelligence for existing projects |
482
- | `/gsd:query-intel <type>` | Query dependency graph (dependents, hotspots) |
483
437
 
484
438
  ### Phase Management
485
439
 
@@ -52,20 +52,6 @@ git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
52
52
  Store `COMMIT_PLANNING_DOCS` for use in git operations.
53
53
  </step>
54
54
 
55
- <step name="load_codebase_intelligence">
56
- Check for codebase intelligence:
57
-
58
- ```bash
59
- cat .planning/intel/summary.md 2>/dev/null
60
- ```
61
-
62
- If exists:
63
- - Follow detected naming conventions when writing code
64
- - Place new files in directories that match their purpose
65
- - Use established patterns (camelCase, PascalCase, etc.)
66
-
67
- This context helps maintain codebase consistency during execution.
68
- </step>
69
55
 
70
56
  <step name="load_plan">
71
57
  Read the plan file provided in your prompt context.
@@ -416,9 +416,6 @@ Output: [What artifacts will be created]
416
416
  @.planning/ROADMAP.md
417
417
  @.planning/STATE.md
418
418
 
419
- # Codebase intelligence (if exists)
420
- @.planning/intel/summary.md
421
-
422
419
  # Only reference prior plan SUMMARYs if genuinely needed
423
420
  @path/to/relevant/source.ts
424
421
  </context>
@@ -1039,25 +1036,6 @@ If exists, load relevant documents based on phase type:
1039
1036
  | (default) | STACK.md, ARCHITECTURE.md |
1040
1037
  </step>
1041
1038
 
1042
- <step name="load_codebase_intelligence">
1043
- Check for codebase intelligence:
1044
-
1045
- ```bash
1046
- cat .planning/intel/summary.md 2>/dev/null
1047
- ```
1048
-
1049
- If exists, this provides:
1050
- - File count and structure overview
1051
- - Detected naming conventions (use these when creating new files)
1052
- - Key directories and their purposes
1053
- - Export patterns
1054
-
1055
- **How to use:**
1056
- - Follow detected naming conventions when planning new exports
1057
- - Place new files in directories that match their purpose
1058
- - Reference existing patterns when describing implementation
1059
- </step>
1060
-
1061
1039
  <step name="identify_phase">
1062
1040
  Check roadmap and existing phases:
1063
1041
 
package/bin/install.js CHANGED
@@ -181,6 +181,9 @@ function cleanupOrphanedHooks(settings) {
181
181
  const orphanedHookPatterns = [
182
182
  'gsd-notify.sh', // Removed in v1.6.x
183
183
  'hooks/statusline.js', // Renamed to gsd-statusline.js in v1.9.0
184
+ 'gsd-intel-index.js', // Removed in v1.9.2
185
+ 'gsd-intel-session.js', // Removed in v1.9.2
186
+ 'gsd-intel-prune.js', // Removed in v1.9.2
184
187
  ];
185
188
 
186
189
  let cleaned = false;
@@ -418,72 +421,6 @@ function install(isGlobal) {
418
421
  console.log(` ${green}✓${reset} Configured update check hook`);
419
422
  }
420
423
 
421
- // Register intel hooks for codebase intelligence
422
- const intelIndexCommand = isGlobal
423
- ? 'node "$HOME/.claude/hooks/gsd-intel-index.js"'
424
- : 'node .claude/hooks/gsd-intel-index.js';
425
-
426
- const intelSessionCommand = isGlobal
427
- ? 'node "$HOME/.claude/hooks/gsd-intel-session.js"'
428
- : 'node .claude/hooks/gsd-intel-session.js';
429
-
430
- // PostToolUse hook for indexing
431
- if (!settings.hooks.PostToolUse) {
432
- settings.hooks.PostToolUse = [];
433
- }
434
-
435
- const hasIntelIndexHook = settings.hooks.PostToolUse.some(entry =>
436
- entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-intel-index'))
437
- );
438
-
439
- if (!hasIntelIndexHook) {
440
- settings.hooks.PostToolUse.push({
441
- hooks: [{
442
- type: 'command',
443
- command: intelIndexCommand
444
- }]
445
- });
446
- console.log(` ${green}✓${reset} Configured intel indexing hook`);
447
- }
448
-
449
- // SessionStart hook for context injection
450
- const hasIntelSessionHook = settings.hooks.SessionStart.some(entry =>
451
- entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-intel-session'))
452
- );
453
-
454
- if (!hasIntelSessionHook) {
455
- settings.hooks.SessionStart.push({
456
- hooks: [{
457
- type: 'command',
458
- command: intelSessionCommand
459
- }]
460
- });
461
- console.log(` ${green}✓${reset} Configured intel session hook`);
462
- }
463
-
464
- // Stop hook for pruning deleted files
465
- const intelPruneCommand = isGlobal
466
- ? 'node "$HOME/.claude/hooks/gsd-intel-prune.js"'
467
- : 'node .claude/hooks/gsd-intel-prune.js';
468
-
469
- if (!settings.hooks.Stop) {
470
- settings.hooks.Stop = [];
471
- }
472
-
473
- const hasIntelPruneHook = settings.hooks.Stop.some(entry =>
474
- entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-intel-prune'))
475
- );
476
-
477
- if (!hasIntelPruneHook) {
478
- settings.hooks.Stop.push({
479
- hooks: [{
480
- type: 'command',
481
- command: intelPruneCommand
482
- }]
483
- });
484
- console.log(` ${green}✓${reset} Configured intel prune hook`);
485
- }
486
-
487
424
  return { settingsPath, settings, statuslineCommand };
488
425
  }
489
426
 
@@ -76,17 +76,6 @@ Map an existing codebase for brownfield projects.
76
76
 
77
77
  Usage: `/gsd:map-codebase`
78
78
 
79
- **`/gsd:analyze-codebase`**
80
- Bootstrap codebase intelligence for existing projects.
81
-
82
- - Scans all JS/TS files and extracts exports/imports
83
- - Detects naming conventions, directory patterns, file suffixes
84
- - Creates `.planning/intel/` with index, conventions, and summary
85
- - Works standalone (no `/gsd:new-project` required)
86
- - After initial scan, PostToolUse hook continues incremental learning
87
-
88
- Usage: `/gsd:analyze-codebase`
89
-
90
79
  ### Phase Planning
91
80
 
92
81
  **`/gsd:discuss-phase <number>`**
@@ -339,19 +328,6 @@ Quick switch model profile for GSD agents.
339
328
 
340
329
  Usage: `/gsd:set-profile budget`
341
330
 
342
- ### Codebase Intelligence
343
-
344
- **`/gsd:query-intel <type> [path]`**
345
- Query the codebase intelligence graph database.
346
-
347
- - `dependents <file>` — What files depend on this? (blast radius)
348
- - `hotspots` — Which files have the most dependents?
349
-
350
- Requires `/gsd:analyze-codebase` to build the graph first.
351
-
352
- Usage: `/gsd:query-intel dependents src/lib/db.ts`
353
- Usage: `/gsd:query-intel hotspots`
354
-
355
331
  ### Utility Commands
356
332
 
357
333
  **`/gsd:help`**
@@ -389,10 +365,6 @@ Usage: `/gsd:update`
389
365
  │ └── done/ # Completed todos
390
366
  ├── debug/ # Active debug sessions
391
367
  │ └── resolved/ # Archived resolved issues
392
- ├── intel/ # Codebase intelligence (auto-populated)
393
- │ ├── index.json # File exports and imports
394
- │ ├── conventions.json # Detected patterns
395
- │ └── summary.md # Context for session injection
396
368
  ├── codebase/ # Codebase map (brownfield projects)
397
369
  │ ├── STACK.md # Languages, frameworks, dependencies
398
370
  │ ├── ARCHITECTURE.md # Patterns, layers, data flow
@@ -19,7 +19,6 @@ This is the most leveraged moment in any project. Deep questioning here means be
19
19
  - `.planning/PROJECT.md` — project context
20
20
  - `.planning/config.json` — workflow preferences
21
21
  - `.planning/research/` — domain research (optional)
22
- - `.planning/intel/` — codebase intelligence (auto-populated by hooks)
23
22
  - `.planning/REQUIREMENTS.md` — scoped requirements
24
23
  - `.planning/ROADMAP.md` — phase structure
25
24
  - `.planning/STATE.md` — project memory
@@ -58,14 +57,7 @@ This is the most leveraged moment in any project. Deep questioning here means be
58
57
  fi
59
58
  ```
60
59
 
61
- 3. **Create intel directory for codebase intelligence:**
62
- ```bash
63
- mkdir -p .planning/intel
64
- ```
65
-
66
- This prepares the directory for the PostToolUse hook to populate with index.json, conventions.json, and summary.md as Claude writes code.
67
-
68
- 4. **Detect existing code (brownfield detection):**
60
+ 3. **Detect existing code (brownfield detection):**
69
61
  ```bash
70
62
  CODE_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.swift" -o -name "*.java" 2>/dev/null | grep -v node_modules | grep -v .git | head -20)
71
63
  HAS_PACKAGE=$([ -f package.json ] || [ -f requirements.txt ] || [ -f Cargo.toml ] || [ -f go.mod ] || [ -f Package.swift ] && echo "yes")
@@ -305,29 +297,39 @@ All recommended for important projects. Skip for quick experiments.
305
297
  questions: [
306
298
  {
307
299
  header: "Research",
308
- question: "Spawn Plan Researcher? (researches domain before planning adds tokens/time)",
300
+ question: "Research before planning each phase? (adds tokens/time)",
309
301
  multiSelect: false,
310
302
  options: [
311
- { label: "Yes (Recommended)", description: "Research phase goals before planning" },
312
- { label: "No", description: "Skip research, plan directly" }
303
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
304
+ { label: "No", description: "Plan directly from requirements" }
313
305
  ]
314
306
  },
315
307
  {
316
308
  header: "Plan Check",
317
- question: "Spawn Plan Checker? (verifies plans before execution — adds tokens/time)",
309
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
318
310
  multiSelect: false,
319
311
  options: [
320
- { label: "Yes (Recommended)", description: "Verify plans meet phase goals" },
321
- { label: "No", description: "Skip plan verification" }
312
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
313
+ { label: "No", description: "Execute plans without verification" }
322
314
  ]
323
315
  },
324
316
  {
325
317
  header: "Verifier",
326
- question: "Spawn Execution Verifier? (verifies phase completion adds tokens/time)",
318
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
319
+ multiSelect: false,
320
+ options: [
321
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
322
+ { label: "No", description: "Trust execution, skip verification" }
323
+ ]
324
+ },
325
+ {
326
+ header: "Model Profile",
327
+ question: "Which AI models for planning agents?",
327
328
  multiSelect: false,
328
329
  options: [
329
- { label: "Yes (Recommended)", description: "Verify must-haves after execution" },
330
- { label: "No", description: "Skip post-execution verification" }
330
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
331
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
332
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
331
333
  ]
332
334
  }
333
335
  ]
@@ -341,6 +343,7 @@ Create `.planning/config.json` with all settings:
341
343
  "depth": "quick|standard|comprehensive",
342
344
  "parallelization": true|false,
343
345
  "commit_docs": true|false,
346
+ "model_profile": "quality|balanced|budget",
344
347
  "workflow": {
345
348
  "research": true|false,
346
349
  "plan_check": true|false,
@@ -354,7 +357,7 @@ Create `.planning/config.json` with all settings:
354
357
  - Add `.planning/` to `.gitignore` (create if needed)
355
358
 
356
359
  **If commit_docs = Yes:**
357
- - Add `.planning/intel/` to `.gitignore` (intel is always local — changes constantly, can be regenerated)
360
+ - No additional gitignore entries needed
358
361
 
359
362
  **Commit config.json:**
360
363
 
@@ -970,7 +973,6 @@ Present completion with next steps:
970
973
  - `ARCHITECTURE.md`
971
974
  - `PITFALLS.md`
972
975
  - `SUMMARY.md`
973
- - `.planning/intel/` (created empty, populated by hooks during coding)
974
976
  - `.planning/REQUIREMENTS.md`
975
977
  - `.planning/ROADMAP.md`
976
978
  - `.planning/STATE.md`
@@ -249,9 +249,6 @@ RESEARCH_CONTENT=$(cat "${PHASE_DIR}"/*-RESEARCH.md 2>/dev/null)
249
249
  # Gap closure files (only if --gaps mode)
250
250
  VERIFICATION_CONTENT=$(cat "${PHASE_DIR}"/*-VERIFICATION.md 2>/dev/null)
251
251
  UAT_CONTENT=$(cat "${PHASE_DIR}"/*-UAT.md 2>/dev/null)
252
-
253
- # Codebase intelligence (if exists)
254
- INTEL_CONTENT=$(cat .planning/intel/summary.md 2>/dev/null)
255
252
  ```
256
253
 
257
254
  ## 8. Spawn gsd-planner Agent
@@ -292,11 +289,6 @@ Fill prompt with inlined content and spawn:
292
289
  {verification_content}
293
290
  {uat_content}
294
291
 
295
- **Codebase Intel (if exists):**
296
- <codebase-intel>
297
- {intel_content}
298
- </codebase-intel>
299
-
300
292
  </planning_context>
301
293
 
302
294
  <downstream_consumer>
@@ -598,8 +598,7 @@ Execute each task in the prompt. **Deviations are normal** - handle them automat
598
598
  - Continue implementing, applying rules as needed
599
599
  - Run the verification
600
600
  - Confirm done criteria met
601
- - **Update intel entities** for modified files (see `<update_intel_entity>` below)
602
- - **Commit the task** (see `<task_commit>` below) - includes entity files in commit
601
+ - **Commit the task** (see `<task_commit>` below)
603
602
  - Track task completion and commit hash for Summary documentation
604
603
  - Continue to next task
605
604
 
@@ -928,148 +927,6 @@ None - plan executed exactly as written.
928
927
 
929
928
  </deviation_documentation>
930
929
 
931
- <update_intel_entity>
932
-
933
- ## Update Codebase Intelligence Entity
934
-
935
- **Trigger:** After each task's `<done>` criteria met, BEFORE committing.
936
-
937
- This step documents your understanding of modified files. The knowledge base self-evolves as you work.
938
-
939
- **1. Get files from the just-completed task:**
940
-
941
- Check the task's `<files>` list. If no `<files>` attribute, use `git status --short` to identify modified files.
942
-
943
- **2. For each file, determine if significant:**
944
-
945
- **Skip these patterns (not worth indexing):**
946
- ```bash
947
- # Build/generated
948
- node_modules/*, .next/*, dist/*, build/*, .git/*
949
-
950
- # Tests (their targets are more valuable)
951
- *.test.*, *.spec.*, __tests__/*, __mocks__/*
952
-
953
- # Config files (change rarely, low context value)
954
- package.json, package-lock.json, tsconfig.json, *.config.*, *.config.js, *.config.ts
955
-
956
- # Environment and locks
957
- .env*, *.lock, *.log, yarn.lock, pnpm-lock.yaml
958
- ```
959
-
960
- If file matches skip pattern: continue to next file.
961
-
962
- **3. Derive entity path:**
963
-
964
- ```bash
965
- # Convert file path to entity filename
966
- # src/lib/auth.ts → src-lib-auth.md
967
- # app/api/users/route.ts → app-api-users-route.md
968
-
969
- FILE_PATH="$1"
970
- ENTITY_NAME=$(echo "$FILE_PATH" | sed 's|^[./]*||' | tr '/' '-' | sed 's/\.[^.]*$//')
971
- ENTITY_PATH=".planning/intel/entities/${ENTITY_NAME}.md"
972
- ```
973
-
974
- **4. Create intel directory if needed:**
975
-
976
- ```bash
977
- mkdir -p .planning/intel/entities
978
- ```
979
-
980
- **5. Check if entity exists:**
981
-
982
- ```bash
983
- if [ -f "$ENTITY_PATH" ]; then
984
- ACTION="update"
985
- else
986
- ACTION="create"
987
- fi
988
- ```
989
-
990
- **6. Create or update entity:**
991
-
992
- Use template from `~/.claude/get-shit-done/templates/entity.md`.
993
-
994
- Fill fields based on what you just built:
995
-
996
- | Field | Source |
997
- |-------|--------|
998
- | `path` | Absolute path to file |
999
- | `type` | Infer: module, component, util, config, api, hook |
1000
- | `updated` | Today's date (YYYY-MM-DD) |
1001
- | `status` | active (unless you're deprecating) |
1002
- | **Purpose** | What you understand this file does |
1003
- | **Exports** | Extract from the code you just wrote |
1004
- | **Dependencies** | `[[slugified-path]]` for internal, plain for external |
1005
- | **Used By** | Add callers if you know them from this session |
1006
- | **Notes** | Gotchas, patterns, warnings discovered |
1007
-
1008
- **If updating existing entity:**
1009
- - Read current content first
1010
- - Preserve Used By entries you didn't touch
1011
- - Update sections that changed
1012
- - Don't remove information unless it's wrong
1013
-
1014
- **7. Write entity file:**
1015
-
1016
- ```bash
1017
- # Write the entity content
1018
- cat > "$ENTITY_PATH" << 'EOF'
1019
- ---
1020
- path: {path}
1021
- type: {type}
1022
- updated: {today}
1023
- status: active
1024
- ---
1025
-
1026
- # {filename}
1027
-
1028
- ## Purpose
1029
-
1030
- {purpose}
1031
-
1032
- ## Exports
1033
-
1034
- {exports}
1035
-
1036
- ## Dependencies
1037
-
1038
- {dependencies}
1039
-
1040
- ## Used By
1041
-
1042
- {used_by}
1043
-
1044
- ## Notes
1045
-
1046
- {notes}
1047
- EOF
1048
- ```
1049
-
1050
- **8. Verify entity was created/updated:**
1051
-
1052
- ```bash
1053
- head -10 "$ENTITY_PATH"
1054
- ```
1055
-
1056
- **9. Stage entity file:**
1057
-
1058
- Entity files are staged along with task code files in the task commit.
1059
-
1060
- ```bash
1061
- git add "$ENTITY_PATH"
1062
- ```
1063
-
1064
- **Error handling:**
1065
- - If entity creation fails: Log warning, continue to task_commit
1066
- - Entity update is NOT blocking - a failed entity shouldn't stop code from being committed
1067
- - Log: `"Warning: Could not update entity for {file}: {reason}"`
1068
-
1069
- **Target size:** Keep entities concise (30-50 lines). Purpose and Exports are most valuable.
1070
-
1071
- </update_intel_entity>
1072
-
1073
930
  <tdd_plan_execution>
1074
931
  ## TDD Plan Execution
1075
932
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "get-shit-done-cc",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.",
5
5
  "bin": {
6
6
  "get-shit-done-cc": "bin/install.js"
@@ -36,8 +36,7 @@
36
36
  },
37
37
  "dependencies": {},
38
38
  "devDependencies": {
39
- "esbuild": "^0.24.0",
40
- "sql.js": "^1.12.0"
39
+ "esbuild": "^0.24.0"
41
40
  },
42
41
  "scripts": {
43
42
  "build:hooks": "node scripts/build-hooks.js",
@@ -1,77 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Bundle GSD hooks with dependencies for zero-config installation.
4
- *
5
- * sql.js includes a WASM binary that must be inlined for portability.
6
- * This script bundles hooks into self-contained files that work from any cwd.
3
+ * Copy GSD hooks to dist for installation.
7
4
  */
8
5
 
9
- const esbuild = require('esbuild');
10
6
  const fs = require('fs');
11
7
  const path = require('path');
12
8
 
13
9
  const HOOKS_DIR = path.join(__dirname, '..', 'hooks');
14
10
  const DIST_DIR = path.join(HOOKS_DIR, 'dist');
15
11
 
16
- // Hooks that need bundling (have npm dependencies)
17
- const HOOKS_TO_BUNDLE = [
18
- 'gsd-intel-index.js'
19
- ];
20
-
21
- // Hooks that are pure Node.js (just copy)
12
+ // Hooks to copy (pure Node.js, no bundling needed)
22
13
  const HOOKS_TO_COPY = [
23
- 'gsd-intel-session.js',
24
- 'gsd-intel-prune.js',
25
14
  'gsd-check-update.js',
26
15
  'gsd-statusline.js'
27
16
  ];
28
17
 
29
- async function build() {
18
+ function build() {
30
19
  // Ensure dist directory exists
31
20
  if (!fs.existsSync(DIST_DIR)) {
32
21
  fs.mkdirSync(DIST_DIR, { recursive: true });
33
22
  }
34
23
 
35
- // Bundle hooks with dependencies
36
- for (const hook of HOOKS_TO_BUNDLE) {
37
- const entryPoint = path.join(HOOKS_DIR, hook);
38
- const outfile = path.join(DIST_DIR, hook);
39
-
40
- if (!fs.existsSync(entryPoint)) {
41
- console.warn(`Warning: ${hook} not found, skipping`);
42
- continue;
43
- }
44
-
45
- console.log(`Bundling ${hook}...`);
46
-
47
- await esbuild.build({
48
- entryPoints: [entryPoint],
49
- bundle: true,
50
- platform: 'node',
51
- target: 'node18',
52
- outfile,
53
- format: 'cjs',
54
- // Inline WASM as base64 for sql.js
55
- loader: {
56
- '.wasm': 'binary'
57
- },
58
- // Don't externalize anything - bundle it all
59
- external: [],
60
- // Minify for smaller package size
61
- minify: true,
62
- // Keep function names for debugging
63
- keepNames: true,
64
- // Handle sql.js WASM loading
65
- define: {
66
- 'process.env.NODE_ENV': '"production"'
67
- }
68
- // Note: shebang preserved from source file by esbuild
69
- });
70
-
71
- console.log(` → ${outfile}`);
72
- }
73
-
74
- // Copy pure Node.js hooks (no bundling needed)
24
+ // Copy hooks to dist
75
25
  for (const hook of HOOKS_TO_COPY) {
76
26
  const src = path.join(HOOKS_DIR, hook);
77
27
  const dest = path.join(DIST_DIR, hook);
@@ -89,7 +39,4 @@ async function build() {
89
39
  console.log('\nBuild complete.');
90
40
  }
91
41
 
92
- build().catch(err => {
93
- console.error('Build failed:', err);
94
- process.exit(1);
95
- });
42
+ build();