@cerefox/memory 1.0.5 → 1.0.6
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/bin/cerefox.js +33 -19
- package/dist/frontend/assets/{index-Csj-6UHY.js → index-VeqA60-v.js} +2 -2
- package/dist/frontend/assets/{index-Csj-6UHY.js.map → index-VeqA60-v.js.map} +1 -1
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +2 -2
- package/dist/server-assets/_shared/mcp-tools/_utils.ts +48 -12
- package/dist/server-assets/_shared/mcp-tools/search.ts +2 -2
- package/dist/server-assets/db/rpcs.sql +20 -4
- package/dist/server-assets/db/schema.sql +1 -1
- package/docs/guides/configuration.md +8 -5
- package/package.json +1 -1
package/dist/bin/cerefox.js
CHANGED
|
@@ -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.
|
|
7187
|
+
var PKG_VERSION = "1.0.6";
|
|
7188
7188
|
var init_meta = () => {};
|
|
7189
7189
|
|
|
7190
7190
|
// ../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
|
|
@@ -25217,21 +25217,35 @@ function getMaxResponseBytes() {
|
|
|
25217
25217
|
const n = Number.parseInt(raw, 10);
|
|
25218
25218
|
return Number.isNaN(n) || n <= 0 ? MAX_RESPONSE_BYTES : n;
|
|
25219
25219
|
}
|
|
25220
|
-
function
|
|
25221
|
-
const
|
|
25222
|
-
const
|
|
25223
|
-
if (
|
|
25224
|
-
return
|
|
25225
|
-
|
|
25226
|
-
|
|
25220
|
+
function readEnv(name) {
|
|
25221
|
+
const g = globalThis;
|
|
25222
|
+
const fromProcess = g.process?.env?.[name];
|
|
25223
|
+
if (fromProcess !== undefined && fromProcess !== "")
|
|
25224
|
+
return fromProcess;
|
|
25225
|
+
try {
|
|
25226
|
+
const fromDeno = g.Deno?.env?.get(name);
|
|
25227
|
+
return fromDeno === "" ? undefined : fromDeno;
|
|
25228
|
+
} catch {
|
|
25229
|
+
return;
|
|
25230
|
+
}
|
|
25227
25231
|
}
|
|
25228
|
-
function
|
|
25229
|
-
const raw =
|
|
25230
|
-
if (raw === undefined
|
|
25232
|
+
function readUnitInterval(name) {
|
|
25233
|
+
const raw = readEnv(name);
|
|
25234
|
+
if (raw === undefined)
|
|
25231
25235
|
return;
|
|
25232
25236
|
const n = Number.parseFloat(raw);
|
|
25233
25237
|
return Number.isNaN(n) || n < 0 || n > 1 ? undefined : n;
|
|
25234
25238
|
}
|
|
25239
|
+
function getSearchAlpha() {
|
|
25240
|
+
return readUnitInterval("CEREFOX_SEARCH_ALPHA") ?? DEFAULT_SEARCH_ALPHA;
|
|
25241
|
+
}
|
|
25242
|
+
function getMinSearchScore() {
|
|
25243
|
+
const fallback = readEnv("CEREFOX_EMBEDDER") === "local" ? DEFAULT_MIN_SEARCH_SCORE_LOCAL : DEFAULT_MIN_SEARCH_SCORE;
|
|
25244
|
+
return readUnitInterval("CEREFOX_MIN_SEARCH_SCORE") ?? fallback;
|
|
25245
|
+
}
|
|
25246
|
+
function getMinTermCoverage() {
|
|
25247
|
+
return readUnitInterval("CEREFOX_MIN_TERM_COVERAGE");
|
|
25248
|
+
}
|
|
25235
25249
|
function applyByteBudget(rows, maxBytes) {
|
|
25236
25250
|
const accepted = [];
|
|
25237
25251
|
let usedBytes = 0;
|
|
@@ -25259,7 +25273,7 @@ function logUsage(supabase, params) {
|
|
|
25259
25273
|
p_extra: params.extra ?? {}
|
|
25260
25274
|
})).catch(() => {});
|
|
25261
25275
|
}
|
|
25262
|
-
var MAX_RESPONSE_BYTES = 200000, DEFAULT_MIN_SEARCH_SCORE = 0.5, DEFAULT_MIN_SEARCH_SCORE_LOCAL = 0.6;
|
|
25276
|
+
var MAX_RESPONSE_BYTES = 200000, DEFAULT_MIN_SEARCH_SCORE = 0.5, DEFAULT_MIN_SEARCH_SCORE_LOCAL = 0.6, DEFAULT_SEARCH_ALPHA = 0.7;
|
|
25263
25277
|
|
|
25264
25278
|
// ../../_shared/mcp-tools/_projects.ts
|
|
25265
25279
|
async function ensureDocumentInProject(supabase, documentId, projectName) {
|
|
@@ -55577,7 +55591,7 @@ async function handler9(supabase, args, ctx) {
|
|
|
55577
55591
|
const project_name = args.project_name;
|
|
55578
55592
|
const match_count = args.match_count ?? 5;
|
|
55579
55593
|
const mode = args.mode ?? "docs";
|
|
55580
|
-
const alpha = args.alpha ??
|
|
55594
|
+
const alpha = args.alpha ?? getSearchAlpha();
|
|
55581
55595
|
const min_score = args.min_score ?? getMinSearchScore();
|
|
55582
55596
|
const min_term_coverage = args.min_term_coverage ?? getMinTermCoverage();
|
|
55583
55597
|
const coverageParam = min_term_coverage !== undefined ? { p_min_term_coverage: min_term_coverage } : {};
|
|
@@ -75006,8 +75020,8 @@ import { homedir as homedir6 } from "node:os";
|
|
|
75006
75020
|
import { join as join9 } from "node:path";
|
|
75007
75021
|
|
|
75008
75022
|
// ../../_shared/ef-meta/index.ts
|
|
75009
|
-
var EF_VERSION = "1.0.
|
|
75010
|
-
var EF_LAST_CHANGED = "1.0.
|
|
75023
|
+
var EF_VERSION = "1.0.6";
|
|
75024
|
+
var EF_LAST_CHANGED = "1.0.6";
|
|
75011
75025
|
|
|
75012
75026
|
// src/cli/util/checks.ts
|
|
75013
75027
|
init_config();
|
|
@@ -77480,7 +77494,7 @@ async function action29(query, options) {
|
|
|
77480
77494
|
throw userError("Empty query.");
|
|
77481
77495
|
}
|
|
77482
77496
|
const matchCount = parsePositiveInt(options.matchCount, "--match-count", 5);
|
|
77483
|
-
const alpha = parseFloat01(options.alpha, "--alpha",
|
|
77497
|
+
const alpha = parseFloat01(options.alpha, "--alpha", getSearchAlpha());
|
|
77484
77498
|
const minScore = parseFloat01(options.minScore, "--min-score", getMinSearchScore());
|
|
77485
77499
|
const envCoverage = getMinTermCoverage();
|
|
77486
77500
|
const coverageParam = options.minTermCoverage !== undefined ? { p_min_term_coverage: parseFloat01(options.minTermCoverage, "--min-term-coverage", envCoverage ?? 0.5) } : envCoverage !== undefined ? { p_min_term_coverage: envCoverage } : {};
|
|
@@ -77639,7 +77653,7 @@ async function action29(query, options) {
|
|
|
77639
77653
|
}
|
|
77640
77654
|
}
|
|
77641
77655
|
function registerSearch(program2) {
|
|
77642
|
-
program2.command("search").description("Search the knowledge base (hybrid FTS + semantic).").argument("<query>", "Natural-language search query.").option("-c, --match-count <n>", "Maximum number of documents to return.", "5").option("-p, --project-name <name>", "Filter results to a specific project.").option("-f, --metadata-filter <json>", "JSON containment filter; only docs whose metadata contains ALL pairs are returned.").option("--mode <mode>", "Search mode: docs (default), hybrid, fts.", "docs").option("--alpha <float>", "Semantic weight 0..1 (default: 0.7)."
|
|
77656
|
+
program2.command("search").description("Search the knowledge base (hybrid FTS + semantic).").argument("<query>", "Natural-language search query.").option("-c, --match-count <n>", "Maximum number of documents to return.", "5").option("-p, --project-name <name>", "Filter results to a specific project.").option("-f, --metadata-filter <json>", "JSON containment filter; only docs whose metadata contains ALL pairs are returned.").option("--mode <mode>", "Search mode: docs (default), hybrid, fts.", "docs").option("--alpha <float>", "Semantic weight 0..1 (default: CEREFOX_SEARCH_ALPHA; else 0.7).").option("--min-score <float>", "Minimum cosine similarity threshold (default: CEREFOX_MIN_SEARCH_SCORE; else 0.5, or 0.6 with the local embedder).").option("--min-term-coverage <float>", "OR-fallback keyword matches must cover at least this fraction of the query's meaningful terms to count as confident hits (default: CEREFOX_MIN_TERM_COVERAGE; else the server default 0.5; needs schema ≥ 0.9.1).").option("--max-bytes <n>", "Response size budget in bytes (default: CEREFOX_MAX_RESPONSE_BYTES or 200000).").option("-r, --requestor <name>", "Agent / user name (recorded in usage log).").option("--json", "Emit machine-readable JSON instead of the default text.").option("--only-metadata", "List matching docs (id, score, chunks, chars, partial/full) WITHOUT their content — like the web UI's collapsed result list. Grab a [id:…] then `cerefox document get <id>`.").action(action29);
|
|
77643
77657
|
}
|
|
77644
77658
|
|
|
77645
77659
|
// src/cli/commands/self-update.ts
|
|
@@ -81643,7 +81657,7 @@ async function runSearch(ctx, opts) {
|
|
|
81643
81657
|
p_query_text: query,
|
|
81644
81658
|
p_query_embedding: embedding,
|
|
81645
81659
|
p_match_count: count,
|
|
81646
|
-
p_alpha:
|
|
81660
|
+
p_alpha: getSearchAlpha(),
|
|
81647
81661
|
p_use_upgrade: false,
|
|
81648
81662
|
p_project_id: projectId,
|
|
81649
81663
|
p_min_score: getMinSearchScore()
|
|
@@ -81659,7 +81673,7 @@ async function runSearch(ctx, opts) {
|
|
|
81659
81673
|
p_query_text: query,
|
|
81660
81674
|
p_query_embedding: embedding,
|
|
81661
81675
|
p_match_count: Math.min(count, 5),
|
|
81662
|
-
p_alpha:
|
|
81676
|
+
p_alpha: getSearchAlpha(),
|
|
81663
81677
|
p_project_id: projectId,
|
|
81664
81678
|
p_min_score: getMinSearchScore()
|
|
81665
81679
|
};
|