claude-memory-layer 1.0.20 → 1.0.21

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/dist/cli/index.js CHANGED
@@ -2634,13 +2634,15 @@ var VectorStore = class {
2634
2634
  };
2635
2635
 
2636
2636
  // src/core/embedder.ts
2637
- import { pipeline } from "@xenova/transformers";
2637
+ import { pipeline } from "@huggingface/transformers";
2638
2638
  var Embedder = class {
2639
2639
  pipeline = null;
2640
2640
  modelName;
2641
+ activeModelName;
2641
2642
  initialized = false;
2642
- constructor(modelName = "jinaai/jina-embeddings-v5-text-nano") {
2643
+ constructor(modelName = "jinaai/jina-embeddings-v5-text-nano-text-matching") {
2643
2644
  this.modelName = modelName;
2645
+ this.activeModelName = modelName;
2644
2646
  }
2645
2647
  /**
2646
2648
  * Initialize the embedding pipeline
@@ -2648,8 +2650,21 @@ var Embedder = class {
2648
2650
  async initialize() {
2649
2651
  if (this.initialized)
2650
2652
  return;
2651
- this.pipeline = await pipeline("feature-extraction", this.modelName);
2652
- this.initialized = true;
2653
+ try {
2654
+ this.pipeline = await pipeline("feature-extraction", this.modelName);
2655
+ this.activeModelName = this.modelName;
2656
+ this.initialized = true;
2657
+ return;
2658
+ } catch (primaryError) {
2659
+ const fallbackModel = process.env.CLAUDE_MEMORY_EMBEDDING_FALLBACK_MODEL || "onnx-community/embeddinggemma-300m-ONNX";
2660
+ if (fallbackModel === this.modelName) {
2661
+ throw primaryError;
2662
+ }
2663
+ console.warn(`[Embedder] Primary model failed (${this.modelName}). Falling back to ${fallbackModel}`);
2664
+ this.pipeline = await pipeline("feature-extraction", fallbackModel);
2665
+ this.activeModelName = fallbackModel;
2666
+ this.initialized = true;
2667
+ }
2653
2668
  }
2654
2669
  /**
2655
2670
  * Generate embedding for a single text
@@ -2666,7 +2681,7 @@ var Embedder = class {
2666
2681
  const vector = Array.from(output.data);
2667
2682
  return {
2668
2683
  vector,
2669
- model: this.modelName,
2684
+ model: this.activeModelName,
2670
2685
  dimensions: vector.length
2671
2686
  };
2672
2687
  }
@@ -2690,7 +2705,7 @@ var Embedder = class {
2690
2705
  const vector = Array.from(output.data);
2691
2706
  results.push({
2692
2707
  vector,
2693
- model: this.modelName,
2708
+ model: this.activeModelName,
2694
2709
  dimensions: vector.length
2695
2710
  });
2696
2711
  }
@@ -2714,7 +2729,7 @@ var Embedder = class {
2714
2729
  * Get model name
2715
2730
  */
2716
2731
  getModelName() {
2717
- return this.modelName;
2732
+ return this.activeModelName;
2718
2733
  }
2719
2734
  };
2720
2735
  var defaultEmbedder = null;
@@ -9694,7 +9709,7 @@ function getHooksConfig(pluginPath) {
9694
9709
  };
9695
9710
  }
9696
9711
  var program = new Command();
9697
- program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.20");
9712
+ program.name("claude-memory-layer").description("Claude Code Memory Plugin CLI").version("1.0.21");
9698
9713
  program.command("install").description("Install hooks into Claude Code settings").option("--path <path>", "Custom plugin path (defaults to auto-detect)").action(async (options) => {
9699
9714
  try {
9700
9715
  const pluginPath = options.path || getPluginPath();
@@ -10186,7 +10201,7 @@ program.command("organize-import [sourceDir]").description("Import existing mark
10186
10201
  process.exit(1);
10187
10202
  }
10188
10203
  });
10189
- program.command("import").description("Import existing Claude Code conversation history").option("-p, --project <path>", "Import from specific project path").option("-s, --session <file>", "Import specific session file (JSONL)").option("-a, --all", "Import all sessions from all projects").option("-l, --limit <number>", "Limit messages per session").option("-f, --force", "Force reimport: delete existing events and reimport with turn_id grouping").option("--embedding-model <name>", "Embedding model override (default: jinaai/jina-embeddings-v5-text-nano, or env CLAUDE_MEMORY_EMBEDDING_MODEL)").option("-v, --verbose", "Show detailed progress").action(async (options) => {
10204
+ program.command("import").description("Import existing Claude Code conversation history").option("-p, --project <path>", "Import from specific project path").option("-s, --session <file>", "Import specific session file (JSONL)").option("-a, --all", "Import all sessions from all projects").option("-l, --limit <number>", "Limit messages per session").option("-f, --force", "Force reimport: delete existing events and reimport with turn_id grouping").option("--embedding-model <name>", "Embedding model override (default: jinaai/jina-embeddings-v5-text-nano-text-matching, or env CLAUDE_MEMORY_EMBEDDING_MODEL; fallback env: CLAUDE_MEMORY_EMBEDDING_FALLBACK_MODEL)").option("-v, --verbose", "Show detailed progress").action(async (options) => {
10190
10205
  const startTime = Date.now();
10191
10206
  const targetProjectPath = options.project || process.cwd();
10192
10207
  if (options.embeddingModel) {