context-vault 2.8.11 → 2.8.13

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/bin/cli.js CHANGED
@@ -14,6 +14,7 @@ import { createInterface } from "node:readline";
14
14
  import {
15
15
  existsSync,
16
16
  statSync,
17
+ readdirSync,
17
18
  readFileSync,
18
19
  writeFileSync,
19
20
  mkdirSync,
@@ -455,6 +456,9 @@ async function runSetup() {
455
456
  if (create.toLowerCase() !== "n") {
456
457
  mkdirSync(resolvedVaultDir, { recursive: true });
457
458
  console.log(` ${green("+")} Created ${resolvedVaultDir}`);
459
+ } else {
460
+ console.log(red("\n Setup cancelled — vault directory is required."));
461
+ process.exit(1);
458
462
  }
459
463
  }
460
464
 
@@ -506,16 +510,45 @@ async function runSetup() {
506
510
  const spinnerFrames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
507
511
  let frame = 0;
508
512
  const start = Date.now();
513
+ const modelDir = join(homedir(), ".context-mcp", "models");
509
514
  const spinner = setInterval(() => {
510
515
  const elapsed = ((Date.now() - start) / 1000).toFixed(0);
516
+ let downloadedMB = "?";
517
+ try {
518
+ const files = readdirSync(modelDir, {
519
+ recursive: true,
520
+ withFileTypes: true,
521
+ });
522
+ const totalBytes = files
523
+ .filter((f) => f.isFile())
524
+ .reduce(
525
+ (sum, f) =>
526
+ sum + statSync(join(f.parentPath ?? f.path, f.name)).size,
527
+ 0,
528
+ );
529
+ downloadedMB = (totalBytes / 1024 / 1024).toFixed(1);
530
+ } catch {}
511
531
  process.stdout.write(
512
- `\r ${spinnerFrames[frame++ % spinnerFrames.length]} Downloading... ${dim(`${elapsed}s`)}`,
532
+ `\r ${spinnerFrames[frame++ % spinnerFrames.length]} Downloading... ${downloadedMB} MB / ~22 MB ${dim(`${elapsed}s`)}`,
513
533
  );
514
534
  }, 100);
515
535
 
516
536
  try {
517
537
  const { embed } = await import("@context-vault/core/index/embed");
518
- await embed("warmup");
538
+ let timeoutHandle;
539
+ const timeout = new Promise((_, reject) => {
540
+ timeoutHandle = setTimeout(
541
+ () =>
542
+ reject(
543
+ Object.assign(new Error("Download timed out after 90s"), {
544
+ code: "ETIMEDOUT",
545
+ }),
546
+ ),
547
+ 90_000,
548
+ );
549
+ });
550
+ await Promise.race([embed("warmup"), timeout]);
551
+ clearTimeout(timeoutHandle);
519
552
 
520
553
  clearInterval(spinner);
521
554
  process.stdout.write(
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-vault/core",
3
- "version": "2.8.11",
3
+ "version": "2.8.13",
4
4
  "type": "module",
5
5
  "description": "Shared core: capture, index, retrieve, tools, and utilities for context-vault",
6
6
  "main": "src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context-vault",
3
- "version": "2.8.11",
3
+ "version": "2.8.13",
4
4
  "type": "module",
5
5
  "description": "Persistent memory for AI agents — saves and searches knowledge across sessions",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "@context-vault/core"
56
56
  ],
57
57
  "dependencies": {
58
- "@context-vault/core": "^2.8.11",
58
+ "@context-vault/core": "^2.8.13",
59
59
  "@modelcontextprotocol/sdk": "^1.26.0",
60
60
  "better-sqlite3": "^12.6.2",
61
61
  "sqlite-vec": "^0.1.0"