@mduenas/codegraph 0.6.7 → 0.6.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mduenas/codegraph",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Supercharge Claude Code with semantic code intelligence. 30% fewer tokens, 25% fewer tool calls, 100% local.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,12 +9,10 @@
9
9
  },
10
10
  "files": [
11
11
  "dist",
12
- "scripts",
13
12
  "README.md"
14
13
  ],
15
14
  "scripts": {
16
15
  "build": "tsc && npm run copy-assets",
17
- "postinstall": "node scripts/postinstall.js",
18
16
  "copy-assets": "mkdir -p dist/db && cp src/db/schema.sql dist/db/ && (cp -r src/extraction/queries dist/extraction/ 2>/dev/null || true)",
19
17
  "dev": "tsc --watch",
20
18
  "cli": "npm run build && node dist/bin/codegraph.js",
@@ -1,68 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Postinstall script - downloads the embedding model to ~/.codegraph/models
4
- * This runs after `npm install` or `npx @mduenas/codegraph`
5
- */
6
- const { existsSync, mkdirSync } = require('fs');
7
- const { join } = require('path');
8
- const { homedir } = require('os');
9
-
10
- const CODEGRAPH_DIR = join(homedir(), '.codegraph');
11
- const MODELS_DIR = join(CODEGRAPH_DIR, 'models');
12
- const MODEL_ID = 'nomic-ai/nomic-embed-text-v1.5';
13
-
14
- async function downloadModel() {
15
- // Ensure directories exist
16
- if (!existsSync(CODEGRAPH_DIR)) {
17
- mkdirSync(CODEGRAPH_DIR, { recursive: true });
18
- }
19
- if (!existsSync(MODELS_DIR)) {
20
- mkdirSync(MODELS_DIR, { recursive: true });
21
- }
22
-
23
- // Check if model is already cached
24
- const modelCachePath = join(MODELS_DIR, MODEL_ID.replace('/', '/'));
25
- if (existsSync(modelCachePath)) {
26
- console.log('Embedding model already downloaded.');
27
- return;
28
- }
29
-
30
- console.log('Downloading embedding model (~130MB)...');
31
- console.log('This is a one-time download for semantic code search.\n');
32
-
33
- try {
34
- // Dynamic import for @xenova/transformers (ESM-only package)
35
- const { pipeline, env } = await import('@xenova/transformers');
36
-
37
- // Configure cache directory
38
- env.cacheDir = MODELS_DIR;
39
-
40
- // Download with progress
41
- await pipeline('feature-extraction', MODEL_ID, {
42
- progress_callback: (progress) => {
43
- if (progress.status === 'progress' && progress.file && progress.progress !== undefined) {
44
- const fileName = progress.file.split('/').pop();
45
- const percent = Math.round(progress.progress);
46
- process.stdout.write(`\rDownloading ${fileName}... ${percent}% `);
47
- } else if (progress.status === 'done') {
48
- process.stdout.write('\n');
49
- }
50
- },
51
- });
52
-
53
- console.log('\nEmbedding model ready!');
54
- } catch (error) {
55
- // Don't fail the install if model download fails
56
- // User can still use codegraph without semantic search
57
- console.log('\nNote: Could not download embedding model.');
58
- console.log('Semantic search will download it on first use.');
59
- if (process.env.DEBUG) {
60
- console.error(error);
61
- }
62
- }
63
- }
64
-
65
- downloadModel().catch(() => {
66
- // Silent exit - don't break npm install
67
- process.exit(0);
68
- });