@cerefox/memory 1.0.0-beta.2 → 1.0.0-beta.3
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 +10 -11
- package/dist/frontend/assets/index-BZdKiyrT.js +125 -0
- package/dist/frontend/assets/index-BZdKiyrT.js.map +1 -0
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +1 -1
- package/dist/server-assets/supabase/functions/cerefox-metadata-search/index.ts +3 -1
- package/dist/server-assets/supabase/functions/cerefox-search/index.ts +8 -1
- package/package.json +1 -1
- package/dist/frontend/assets/index-D3FshoP3.js +0 -125
- package/dist/frontend/assets/index-D3FshoP3.js.map +0 -1
package/dist/frontend/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap"
|
|
16
16
|
/>
|
|
17
17
|
<title>Cerefox</title>
|
|
18
|
-
<script type="module" crossorigin src="/app/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/app/assets/index-BZdKiyrT.js"></script>
|
|
19
19
|
<link rel="stylesheet" crossorigin href="/app/assets/index-Asx5wD7g.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
@@ -93,7 +93,9 @@ Deno.serve(async (req: Request): Promise<Response> => {
|
|
|
93
93
|
{ status: 400, headers: { ...CORS_HEADERS, "Content-Type": "application/json" } },
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
// Clamp limit to [1, 500]: response is byte-capped, but bound the row work too
|
|
97
|
+
// so an authenticated caller can't request an unbounded scan. Defensive review, pre-1.0.
|
|
98
|
+
const limit = Math.min(Math.max(1, Math.floor(Number(body.limit)) || 10), 500);
|
|
97
99
|
const include_content = body.include_content ?? false;
|
|
98
100
|
const requested_max_bytes = body.max_bytes;
|
|
99
101
|
|
|
@@ -52,6 +52,11 @@ const EMBEDDING_DIMENSIONS = 768;
|
|
|
52
52
|
// ceiling is rarely reached under normal usage at the default match_count=5.
|
|
53
53
|
const MAX_BYTES = 200_000;
|
|
54
54
|
|
|
55
|
+
// Upper bound on match_count. The response is byte-capped separately (MAX_BYTES);
|
|
56
|
+
// this caps the query work (vector sort / FTS ranking) so an authenticated caller
|
|
57
|
+
// cannot request an unbounded LIMIT. Defensive review, pre-1.0.
|
|
58
|
+
const MAX_MATCH_COUNT = 200;
|
|
59
|
+
|
|
55
60
|
|
|
56
61
|
interface SearchRequest {
|
|
57
62
|
query: string;
|
|
@@ -216,7 +221,7 @@ Deno.serve(async (req: Request) => {
|
|
|
216
221
|
const {
|
|
217
222
|
query,
|
|
218
223
|
project_name,
|
|
219
|
-
match_count = 5,
|
|
224
|
+
match_count: raw_match_count = 5,
|
|
220
225
|
mode = "docs",
|
|
221
226
|
alpha = 0.7,
|
|
222
227
|
min_score = 0.5,
|
|
@@ -226,6 +231,8 @@ Deno.serve(async (req: Request) => {
|
|
|
226
231
|
|
|
227
232
|
// Enforce ceiling: agents may request less but never more than MAX_BYTES.
|
|
228
233
|
const max_bytes = Math.min(requested_max_bytes ?? MAX_BYTES, MAX_BYTES);
|
|
234
|
+
// Clamp match_count to [1, MAX_MATCH_COUNT] (bounds query work; see MAX_MATCH_COUNT).
|
|
235
|
+
const match_count = Math.min(Math.max(1, Math.floor(Number(raw_match_count)) || 5), MAX_MATCH_COUNT);
|
|
229
236
|
|
|
230
237
|
// Validate metadata_filter: must be a plain object (or null/absent).
|
|
231
238
|
// Reject arrays, strings, and other non-object types to prevent RPC errors.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerefox/memory",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
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",
|