gitnexus 1.6.3 → 1.6.4-rc.2
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.
|
@@ -13,6 +13,7 @@ if (!process.env.ORT_LOG_LEVEL) {
|
|
|
13
13
|
process.env.ORT_LOG_LEVEL = '3';
|
|
14
14
|
}
|
|
15
15
|
import { pipeline, env } from '@huggingface/transformers';
|
|
16
|
+
import os from 'os';
|
|
16
17
|
import { existsSync } from 'fs';
|
|
17
18
|
import { execFileSync } from 'child_process';
|
|
18
19
|
import { join, dirname } from 'path';
|
|
@@ -135,7 +136,7 @@ export const initEmbedder = async (onProgress, config = {}, forceDevice) => {
|
|
|
135
136
|
// ./node_modules/.cache inside its own install dir, which is unwritable
|
|
136
137
|
// when gitnexus is installed globally (e.g. /usr/lib/node_modules/).
|
|
137
138
|
// Respect HF_HOME if set, otherwise fall back to ~/.cache/huggingface.
|
|
138
|
-
env.cacheDir = process.env.HF_HOME ??
|
|
139
|
+
env.cacheDir = process.env.HF_HOME ?? join(os.homedir(), '.cache', 'huggingface');
|
|
139
140
|
const isDev = process.env.NODE_ENV === 'development';
|
|
140
141
|
if (isDev) {
|
|
141
142
|
console.log(`🧠 Loading embedding model: ${finalConfig.modelId}`);
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* For MCP, we only need to compute query embeddings, not batch embed.
|
|
6
6
|
*/
|
|
7
7
|
import { pipeline, env } from '@huggingface/transformers';
|
|
8
|
+
import os from 'os';
|
|
9
|
+
import { join } from 'path';
|
|
8
10
|
import { isHttpMode, getHttpDimensions, httpEmbedQuery, } from '../../core/embeddings/http-client.js';
|
|
9
11
|
import { silenceStdout, restoreStdout, realStderrWrite } from '../../core/lbug/pool-adapter.js';
|
|
10
12
|
// Model config
|
|
@@ -34,7 +36,7 @@ export const initEmbedder = async () => {
|
|
|
34
36
|
// ./node_modules/.cache inside its own install dir, which is unwritable
|
|
35
37
|
// when gitnexus is installed globally (e.g. /usr/lib/node_modules/).
|
|
36
38
|
// Respect HF_HOME if set, otherwise fall back to ~/.cache/huggingface.
|
|
37
|
-
env.cacheDir = process.env.HF_HOME ??
|
|
39
|
+
env.cacheDir = process.env.HF_HOME ?? join(os.homedir(), '.cache', 'huggingface');
|
|
38
40
|
console.error('GitNexus: Loading embedding model (first search may take a moment)...');
|
|
39
41
|
// Try GPU first (DirectML on Windows, CUDA on Linux), fall back to CPU
|
|
40
42
|
const isWindows = process.platform === 'win32';
|
package/package.json
CHANGED
package/skills/gitnexus-cli.md
CHANGED
|
@@ -23,7 +23,7 @@ Run from the project root. This parses all source files, builds the knowledge gr
|
|
|
23
23
|
| `--embeddings` | Enable embedding generation for semantic search (off by default) |
|
|
24
24
|
| `--drop-embeddings` | Drop existing embeddings on rebuild. By default, an `analyze` without `--embeddings` preserves them. |
|
|
25
25
|
|
|
26
|
-
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook
|
|
26
|
+
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook detects staleness after `git commit` and `git merge` and notifies the agent to run `analyze` — the hook does not run analyze itself, to avoid blocking the agent for up to 120s and risking KuzuDB corruption on timeout.
|
|
27
27
|
|
|
28
28
|
### status — Check index freshness
|
|
29
29
|
|