@cerefox/memory 1.0.0-beta.4 → 1.0.0-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.
Files changed (2) hide show
  1. package/dist/bin/cerefox.js +47 -11
  2. package/package.json +1 -1
@@ -7184,7 +7184,7 @@ var exports_meta = {};
7184
7184
  __export(exports_meta, {
7185
7185
  PKG_VERSION: () => PKG_VERSION
7186
7186
  });
7187
- var PKG_VERSION = "1.0.0-beta.4";
7187
+ var PKG_VERSION = "1.0.0-rc.2";
7188
7188
  var init_meta = () => {};
7189
7189
 
7190
7190
  // ../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
@@ -25244,15 +25244,51 @@ var init_bundled_docs = __esm(() => {
25244
25244
 
25245
25245
  // ../../_shared/compatibility/index.ts
25246
25246
  function compareSemver(a, b2) {
25247
- const norm = (v) => v.split(/[.-]/).slice(0, 3).map((p) => Number.parseInt(p, 10)).map((n) => Number.isFinite(n) ? n : 0);
25248
- const pa = norm(a);
25249
- const pb = norm(b2);
25247
+ const split = (v) => {
25248
+ const [core, ...preParts] = v.split("-");
25249
+ return {
25250
+ core: core.split(".").slice(0, 3).map((p) => {
25251
+ const n = Number.parseInt(p, 10);
25252
+ return Number.isFinite(n) ? n : 0;
25253
+ }),
25254
+ pre: preParts.length ? preParts.join("-").split(".") : []
25255
+ };
25256
+ };
25257
+ const pa = split(a);
25258
+ const pb = split(b2);
25250
25259
  for (let i = 0;i < 3; i++) {
25251
- const x = pa[i] ?? 0;
25252
- const y = pb[i] ?? 0;
25260
+ const x = pa.core[i] ?? 0;
25261
+ const y = pb.core[i] ?? 0;
25253
25262
  if (x !== y)
25254
25263
  return x < y ? -1 : 1;
25255
25264
  }
25265
+ if (pa.pre.length === 0 && pb.pre.length === 0)
25266
+ return 0;
25267
+ if (pa.pre.length === 0)
25268
+ return 1;
25269
+ if (pb.pre.length === 0)
25270
+ return -1;
25271
+ const len = Math.max(pa.pre.length, pb.pre.length);
25272
+ for (let i = 0;i < len; i++) {
25273
+ const x = pa.pre[i];
25274
+ const y = pb.pre[i];
25275
+ if (x === undefined)
25276
+ return -1;
25277
+ if (y === undefined)
25278
+ return 1;
25279
+ const xn = /^\d+$/.test(x) ? Number.parseInt(x, 10) : null;
25280
+ const yn = /^\d+$/.test(y) ? Number.parseInt(y, 10) : null;
25281
+ if (xn !== null && yn !== null) {
25282
+ if (xn !== yn)
25283
+ return xn < yn ? -1 : 1;
25284
+ } else if (xn !== null) {
25285
+ return -1;
25286
+ } else if (yn !== null) {
25287
+ return 1;
25288
+ } else if (x !== y) {
25289
+ return x < y ? -1 : 1;
25290
+ }
25291
+ }
25256
25292
  return 0;
25257
25293
  }
25258
25294
  function classifyCompat(deployed, min, bundled) {
@@ -76853,13 +76889,12 @@ function registerMetadataSearch(program2) {
76853
76889
  init_dist4();
76854
76890
  init_cli_core();
76855
76891
  init_config();
76856
- var DEFAULT_MODEL = "text-embedding-3-small";
76857
76892
  async function action27(options) {
76858
76893
  const settings = loadSettings();
76859
76894
  if (!settings.supabaseUrl || !settings.supabaseKey) {
76860
76895
  throw userError("Supabase credentials not configured — run `cerefox init` first.");
76861
76896
  }
76862
- if (!settings.openaiApiKey) {
76897
+ if (!settings.openaiApiKey && resolveEmbedderKind() !== "local") {
76863
76898
  throw userError("OPENAI_API_KEY not set — required for embeddings.");
76864
76899
  }
76865
76900
  const supabase = createClient(settings.supabaseUrl, settings.supabaseKey, {
@@ -76875,8 +76910,9 @@ async function action27(options) {
76875
76910
  if (options.documentId) {
76876
76911
  query = query.eq("document_id", options.documentId);
76877
76912
  }
76913
+ const targetModel = activeEmbedderName();
76878
76914
  if (!reindexAll) {
76879
- query = query.neq("embedder_primary", DEFAULT_MODEL);
76915
+ query = query.neq("embedder_primary", targetModel);
76880
76916
  }
76881
76917
  const { data, error: error3 } = await query;
76882
76918
  if (error3)
@@ -76905,7 +76941,7 @@ ${c2.content}`;
76905
76941
  });
76906
76942
  let embeddings;
76907
76943
  try {
76908
- embeddings = await embedBatch(texts, settings.openaiApiKey);
76944
+ embeddings = await embedBatch(texts, settings.openaiApiKey ?? "");
76909
76945
  } catch (err) {
76910
76946
  errors4 += slice.length;
76911
76947
  const msg = err instanceof Error ? err.message : String(err);
@@ -76915,7 +76951,7 @@ ${c2.content}`;
76915
76951
  for (let i = 0;i < slice.length; i++) {
76916
76952
  const { error: updErr } = await supabase.from("cerefox_chunks").update({
76917
76953
  embedding_primary: embeddings[i],
76918
- embedder_primary: DEFAULT_MODEL
76954
+ embedder_primary: targetModel
76919
76955
  }).eq("id", slice[i].id);
76920
76956
  if (updErr) {
76921
76957
  errors4 += 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Cerefox — user-owned shared memory for AI agents. The local TypeScript runtime: stdio MCP server in v0.4; CLI binary added in v0.5; in-process web server in v0.6; ingestion pipeline in v0.7.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/fstamatelopoulos/cerefox",