nexum-code 0.7.19 → 0.7.20

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.
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
3
3
  import { dirname as __cjsShimDirname } from 'node:path';
4
4
  const __filename = __cjsShimFileURLToPath(import.meta.url);
5
5
  const __dirname = __cjsShimDirname(__filename);
6
- import { h as multiSearchWithTrace } from "./dist-CP92tKmm.mjs";
6
+ import { h as multiSearchWithTrace } from "./dist-BaQOFk-J.mjs";
7
7
  export { multiSearchWithTrace };
@@ -243,22 +243,6 @@ var KnowledgeStore = class {
243
243
  return this.embeddingEngine;
244
244
  }
245
245
  /**
246
- * Proactively load the embedding model (downloads on first call).
247
- * Call before ingestion so the user gets a clear download prompt instead
248
- * of a mid-ingest failure.
249
- */
250
- async ensureEmbeddingReady() {
251
- if (this.embeddingEngine === void 0) return {
252
- ok: false,
253
- reason: "engine not set"
254
- };
255
- const ok = await this.embeddingEngine.ensureReady();
256
- return {
257
- ok,
258
- reason: ok ? void 0 : "fastembed init failed"
259
- };
260
- }
261
- /**
262
246
  * Begin a write transaction. Use commitTransaction / rollbackTransaction
263
247
  * to close it. Used by ingest to keep chunks/events/entities/edges atomic —
264
248
  * a mid-ingest failure leaves no partial rows.
@@ -1461,26 +1445,11 @@ async function mapWithConcurrency(items, limit, fn, onProgress) {
1461
1445
  */
1462
1446
  async function ingestFile(store, llm, filePath, onProgress) {
1463
1447
  const engine = store.getEmbeddingEngine();
1464
- let skipEmbed = engine === void 0;
1465
- if (engine !== void 0) {
1466
- onProgress?.({
1467
- stage: "embedding-check",
1468
- message: "检查向量模型..."
1469
- });
1470
- try {
1471
- skipEmbed = !await Promise.race([engine.ensureReady(), new Promise((resolve) => setTimeout(() => resolve(false), 15e3))]);
1472
- if (skipEmbed) onProgress?.({
1473
- stage: "embedding-check",
1474
- message: "向量模型未就绪,本次摄入跳过向量嵌入"
1475
- });
1476
- } catch {
1477
- skipEmbed = true;
1478
- onProgress?.({
1479
- stage: "embedding-check",
1480
- message: "向量模型未就绪,本次摄入跳过向量嵌入"
1481
- });
1482
- }
1483
- }
1448
+ const skipEmbed = engine === void 0 || !engine.available;
1449
+ if (skipEmbed) onProgress?.({
1450
+ stage: "embedding-check",
1451
+ message: "向量模型未就绪,本次摄入跳过向量嵌入"
1452
+ });
1484
1453
  const existing = await store.findSourceByFilePath(filePath);
1485
1454
  if (existing !== void 0) {
1486
1455
  onProgress?.({
package/dist/main.mjs CHANGED
@@ -6,7 +6,7 @@ const __dirname = __cjsShimDirname(__filename);
6
6
  import "./suppress-sqlite-warning-C2VB0doZ.mjs";
7
7
  //#region src/main.ts
8
8
  try {
9
- (await import("./app-BTB_OEiB.mjs")).main();
9
+ (await import("./app-STmkYeC7.mjs")).main();
10
10
  } catch (error) {
11
11
  process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}\n`);
12
12
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexum-code",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
4
4
  "description": "A terminal-native AI agent for builders",
5
5
  "license": "MIT",
6
6
  "author": "NexumCli",
@@ -66,9 +66,10 @@
66
66
  "@tesseract.js-data/eng": "^1.0.0",
67
67
  "chalk": "^5.4.1",
68
68
  "cli-highlight": "^2.1.11",
69
- "commander": "^13.1.0",
70
- "diff": "^9.0.0",
71
- "pdfjs-dist": "^5.3.0",
69
+ "commander": "^13.1.0",
70
+ "diff": "^9.0.0",
71
+ "fastembed": "^2.1.0",
72
+ "pdfjs-dist": "^5.3.0",
72
73
  "semver": "^7.7.4",
73
74
  "smol-toml": "^1.6.1",
74
75
  "tesseract.js": "^7.0.0",