@cerefox/memory 1.12.0 → 1.12.1

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.
@@ -7440,7 +7440,7 @@ var exports_meta = {};
7440
7440
  __export(exports_meta, {
7441
7441
  PKG_VERSION: () => PKG_VERSION
7442
7442
  });
7443
- var PKG_VERSION = "1.12.0";
7443
+ var PKG_VERSION = "1.12.1";
7444
7444
  var init_meta = () => {};
7445
7445
 
7446
7446
  // ../../_shared/config/paths.ts
@@ -26003,7 +26003,7 @@ var init_bundled_docs = __esm(() => {
26003
26003
  });
26004
26004
 
26005
26005
  // ../../_shared/ef-meta/index.ts
26006
- var EF_VERSION = "1.12.0", CEREFOX_VERSION = "1.12.0", EF_LAST_CHANGED = "1.11.0";
26006
+ var EF_VERSION = "1.12.1", CEREFOX_VERSION = "1.12.1", EF_LAST_CHANGED = "1.11.0";
26007
26007
  var init_ef_meta = () => {};
26008
26008
 
26009
26009
  // ../../_shared/compatibility/index.ts
@@ -81393,6 +81393,9 @@ function envGitignoreWarning(path) {
81393
81393
  }
81394
81394
  }
81395
81395
 
81396
+ // src/web/auth.ts
81397
+ import { existsSync as existsSync15 } from "node:fs";
81398
+
81396
81399
  // ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/conninfo.mjs
81397
81400
  var getConnInfo = (c2) => {
81398
81401
  const bindings = c2.env.server ? c2.env.server : c2.env;
@@ -81454,6 +81457,27 @@ var LOOPBACK_ADDRESSES = new Set([
81454
81457
  "::1",
81455
81458
  "::ffff:127.0.0.1"
81456
81459
  ]);
81460
+ function isContainerised() {
81461
+ try {
81462
+ return existsSync15("/.dockerenv");
81463
+ } catch {
81464
+ return false;
81465
+ }
81466
+ }
81467
+ function containerGateWarning(env4 = process.env) {
81468
+ const hasKey = (env4.CEREFOX_API_KEY ?? "").trim() !== "";
81469
+ const requireAll = (env4.CEREFOX_API_REQUIRE_KEY ?? "") === "1";
81470
+ if (!hasKey || requireAll || !isContainerised())
81471
+ return null;
81472
+ return `
81473
+ ⚠ CEREFOX_API_KEY is set inside a container without CEREFOX_API_REQUIRE_KEY=1.
81474
+ ` + ` Docker rewrites the source address of every published-port request, so the
81475
+ ` + ` loopback exemption cannot match and EVERY caller will get a 401 — including
81476
+ ` + ` the web UI. In a container the gate must be all-or-nothing:
81477
+ ` + ` • publishing on 127.0.0.1 → leave CEREFOX_API_KEY unset (the bind is the boundary)
81478
+ ` + ` • publishing wider → also set CEREFOX_API_REQUIRE_KEY=1
81479
+ `;
81480
+ }
81457
81481
  function isLoopbackAddress(address) {
81458
81482
  if (!address)
81459
81483
  return false;
@@ -83159,7 +83183,7 @@ var _baseMimes = {
83159
83183
  var baseMimes = _baseMimes;
83160
83184
 
83161
83185
  // ../../node_modules/.bun/@hono+node-server@2.0.12+19b9adbcbc3b652f/node_modules/@hono/node-server/dist/serve-static.mjs
83162
- import { createReadStream, existsSync as existsSync15, statSync as statSync5 } from "node:fs";
83186
+ import { createReadStream, existsSync as existsSync16, statSync as statSync5 } from "node:fs";
83163
83187
  import { join as join13 } from "node:path";
83164
83188
  var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
83165
83189
  var ENCODINGS = {
@@ -83233,7 +83257,7 @@ var tryDecodeURI = (str) => tryDecode(str, decodeURI);
83233
83257
  var serveStatic = (options = { root: "" }) => {
83234
83258
  const root = options.root || "";
83235
83259
  const optionPath = options.path;
83236
- if (root !== "" && !existsSync15(root))
83260
+ if (root !== "" && !existsSync16(root))
83237
83261
  console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`);
83238
83262
  return async (c2, next) => {
83239
83263
  if (c2.finalized)
@@ -83316,7 +83340,7 @@ var serveStatic = (options = { root: "" }) => {
83316
83340
  };
83317
83341
 
83318
83342
  // src/web/server.ts
83319
- import { existsSync as existsSync19 } from "node:fs";
83343
+ import { existsSync as existsSync20 } from "node:fs";
83320
83344
  import { readFileSync as readFileSync18 } from "node:fs";
83321
83345
  import { join as join17 } from "node:path";
83322
83346
 
@@ -86580,7 +86604,7 @@ import { execFileSync } from "node:child_process";
86580
86604
 
86581
86605
  // src/web/docs.ts
86582
86606
  import {
86583
- existsSync as existsSync16,
86607
+ existsSync as existsSync17,
86584
86608
  readFileSync as readFileSync16,
86585
86609
  readdirSync as readdirSync6,
86586
86610
  statSync as statSync6
@@ -86613,7 +86637,7 @@ function resolveDocsRoots() {
86613
86637
  let pkgTopLevel = null;
86614
86638
  for (const pkg of pkgRootCandidates) {
86615
86639
  const guides = join14(pkg, "docs", "guides");
86616
- if (existsSync16(guides) && statSync6(guides).isDirectory()) {
86640
+ if (existsSync17(guides) && statSync6(guides).isDirectory()) {
86617
86641
  pkgGuides = guides;
86618
86642
  pkgTopLevel = pkg;
86619
86643
  break;
@@ -86625,8 +86649,8 @@ function resolveDocsRoots() {
86625
86649
  return {
86626
86650
  pkgGuides,
86627
86651
  pkgTopLevel,
86628
- repoGuides: existsSync16(repoGuides) ? repoGuides : null,
86629
- repoTopLevel: existsSync16(join14(repoTopLevel, "README.md")) ? repoTopLevel : null
86652
+ repoGuides: existsSync17(repoGuides) ? repoGuides : null,
86653
+ repoTopLevel: existsSync17(join14(repoTopLevel, "README.md")) ? repoTopLevel : null
86630
86654
  };
86631
86655
  }
86632
86656
  function readH1(filePath) {
@@ -86652,7 +86676,7 @@ function listBundledDocs2() {
86652
86676
  if (topRoot) {
86653
86677
  for (const t of TOP_LEVEL_DOCS) {
86654
86678
  const abs = join14(topRoot, t.filename);
86655
- if (existsSync16(abs)) {
86679
+ if (existsSync17(abs)) {
86656
86680
  entries.push(entryForFile(abs, t.path, t.category));
86657
86681
  }
86658
86682
  }
@@ -86679,7 +86703,7 @@ function readDoc(docPath) {
86679
86703
  if (!candidate.startsWith(rootResolved + "/") && candidate !== rootResolved) {
86680
86704
  return null;
86681
86705
  }
86682
- if (existsSync16(candidate) && statSync6(candidate).isFile()) {
86706
+ if (existsSync17(candidate) && statSync6(candidate).isFile()) {
86683
86707
  try {
86684
86708
  return readFileSync16(candidate, "utf8");
86685
86709
  } catch {
@@ -86730,7 +86754,7 @@ function registerMetaRoutes(app, ctx) {
86730
86754
  app.get("/api/v1/schema-version", async (c2) => {
86731
86755
  let bundled = null;
86732
86756
  try {
86733
- const { readFileSync: readFileSync17, existsSync: existsSync17 } = await import("node:fs");
86757
+ const { readFileSync: readFileSync17, existsSync: existsSync18 } = await import("node:fs");
86734
86758
  const { fileURLToPath: fileURLToPath4 } = await import("node:url");
86735
86759
  const { dirname: dirname7, join: join15 } = await import("node:path");
86736
86760
  const here = dirname7(fileURLToPath4(import.meta.url));
@@ -86739,7 +86763,7 @@ function registerMetaRoutes(app, ctx) {
86739
86763
  join15(here, "..", "..", "..", "..", "..", "src", "cerefox", "db", "schema.sql")
86740
86764
  ];
86741
86765
  for (const path of candidates) {
86742
- if (existsSync17(path)) {
86766
+ if (existsSync18(path)) {
86743
86767
  const sql = readFileSync17(path, "utf8");
86744
86768
  const match2 = sql.match(SCHEMA_VERSION_RE3);
86745
86769
  bundled = match2 ? match2[1] : null;
@@ -86836,7 +86860,7 @@ function registerPostgrestProxy(app) {
86836
86860
 
86837
86861
  // src/web/routes/preferences.ts
86838
86862
  init_config();
86839
- import { existsSync as existsSync17, mkdirSync as mkdirSync5, readFileSync as readFileSync17, writeFileSync as writeFileSync6 } from "node:fs";
86863
+ import { existsSync as existsSync18, mkdirSync as mkdirSync5, readFileSync as readFileSync17, writeFileSync as writeFileSync6 } from "node:fs";
86840
86864
  import { join as join15 } from "node:path";
86841
86865
  function isTheme(v) {
86842
86866
  return v === "auto" || v === "light" || v === "dark";
@@ -86862,7 +86886,7 @@ function registerPreferencesRoutes(app) {
86862
86886
  const next = { ...readPrefs(), theme: body.theme };
86863
86887
  try {
86864
86888
  const dir = userStateDir();
86865
- if (!existsSync17(dir))
86889
+ if (!existsSync18(dir))
86866
86890
  mkdirSync5(dir, { recursive: true });
86867
86891
  writeFileSync6(prefsFile(), `${JSON.stringify(next, null, 2)}
86868
86892
  `);
@@ -86999,14 +87023,14 @@ function registerProjectsRoutes(app, ctx) {
86999
87023
  }
87000
87024
 
87001
87025
  // src/web/static.ts
87002
- import { existsSync as existsSync18, statSync as statSync7 } from "node:fs";
87026
+ import { existsSync as existsSync19, statSync as statSync7 } from "node:fs";
87003
87027
  import { dirname as dirname7, join as join16 } from "node:path";
87004
87028
  import { fileURLToPath as fileURLToPath4 } from "node:url";
87005
87029
  function moduleDir3() {
87006
87030
  return dirname7(fileURLToPath4(import.meta.url));
87007
87031
  }
87008
87032
  function isUsableSpaDir(dir) {
87009
- return existsSync18(dir) && statSync7(dir).isDirectory() && existsSync18(join16(dir, "index.html"));
87033
+ return existsSync19(dir) && statSync7(dir).isDirectory() && existsSync19(join16(dir, "index.html"));
87010
87034
  }
87011
87035
  function resolveSpaDist() {
87012
87036
  const here = moduleDir3();
@@ -87028,7 +87052,7 @@ function resolveStaticDir() {
87028
87052
  join16(here, "..", "..", "..", "..", "web", "static")
87029
87053
  ];
87030
87054
  for (const c2 of candidates) {
87031
- if (existsSync18(c2) && statSync7(c2).isDirectory())
87055
+ if (existsSync19(c2) && statSync7(c2).isDirectory())
87032
87056
  return c2;
87033
87057
  }
87034
87058
  return null;
@@ -87119,7 +87143,7 @@ function buildApp(ctx = buildWebContext()) {
87119
87143
  rewriteRequestPath: (path) => path.replace(/^\/app/, "") || "/"
87120
87144
  }));
87121
87145
  const indexPath = join17(spaDist, "index.html");
87122
- if (existsSync19(indexPath)) {
87146
+ if (existsSync20(indexPath)) {
87123
87147
  const indexHtml = readFileSync18(indexPath, "utf8");
87124
87148
  app.get("/app/*", (c2) => c2.html(indexHtml));
87125
87149
  }
@@ -87164,6 +87188,9 @@ async function buildWebServer(options = {}) {
87164
87188
  const host = options.host ?? "127.0.0.1";
87165
87189
  const port = options.port ?? 8000;
87166
87190
  await assertServerCompatible();
87191
+ const containerWarning = containerGateWarning();
87192
+ if (containerWarning)
87193
+ console.warn(containerWarning);
87167
87194
  if (!isLoopbackAddress(host) && !(process.env.CEREFOX_API_KEY ?? "").trim()) {
87168
87195
  console.warn(`
87169
87196
  ⚠ Binding ${host} with NO API key configured.
@@ -87186,7 +87213,7 @@ async function buildWebServer(options = {}) {
87186
87213
  // src/web/daemon.ts
87187
87214
  import { spawn } from "node:child_process";
87188
87215
  import {
87189
- existsSync as existsSync20,
87216
+ existsSync as existsSync21,
87190
87217
  mkdirSync as mkdirSync6,
87191
87218
  openSync,
87192
87219
  readFileSync as readFileSync19,
@@ -87206,11 +87233,11 @@ var PID_FILE = join18(STATE_DIR, "web.pid");
87206
87233
  var LOG_FILE = join18(STATE_DIR, "web.log");
87207
87234
  var daemonPaths = { stateDir: STATE_DIR, pidFile: PID_FILE, logFile: LOG_FILE };
87208
87235
  function ensureStateDir() {
87209
- if (!existsSync20(STATE_DIR))
87236
+ if (!existsSync21(STATE_DIR))
87210
87237
  mkdirSync6(STATE_DIR, { recursive: true });
87211
87238
  }
87212
87239
  function readPidFile() {
87213
- if (!existsSync20(PID_FILE))
87240
+ if (!existsSync21(PID_FILE))
87214
87241
  return null;
87215
87242
  try {
87216
87243
  const parsed = JSON.parse(readFileSync19(PID_FILE, "utf8"));
@@ -87607,7 +87634,7 @@ Learn more:
87607
87634
 
87608
87635
  // src/bin/cerefox.ts
87609
87636
  async function bareEntryPoint() {
87610
- const { existsSync: existsSync21 } = await import("node:fs");
87637
+ const { existsSync: existsSync22 } = await import("node:fs");
87611
87638
  const { resolveEnvFile: resolveEnvFile2 } = await Promise.resolve().then(() => (init_config(), exports_config));
87612
87639
  const { c: c2, println: println2 } = await Promise.resolve().then(() => (init_cli_core(), exports_cli_core));
87613
87640
  const { PKG_VERSION: PKG_VERSION2 } = await Promise.resolve().then(() => (init_meta(), exports_meta));
@@ -87616,7 +87643,7 @@ async function bareEntryPoint() {
87616
87643
  println2("");
87617
87644
  let configExists = false;
87618
87645
  try {
87619
- configExists = existsSync21(resolveEnvFile2());
87646
+ configExists = existsSync22(resolveEnvFile2());
87620
87647
  } catch {}
87621
87648
  if (!configExists) {
87622
87649
  println2(c2.yellow("⚠ No config detected."));
@@ -18,7 +18,7 @@
18
18
  * doesn't touch `supabase/functions/` leaves it alone).
19
19
  */
20
20
 
21
- export const EF_VERSION = "1.12.0";
21
+ export const EF_VERSION = "1.12.1";
22
22
 
23
23
  /**
24
24
  * The Cerefox RELEASE version — what `cerefox --version` reports and what npm
@@ -36,7 +36,7 @@ export const EF_VERSION = "1.12.0";
36
36
  * is imported by the Deno Edge Functions, which cannot reach into the npm
37
37
  * package.
38
38
  */
39
- export const CEREFOX_VERSION = "1.12.0";
39
+ export const CEREFOX_VERSION = "1.12.1";
40
40
 
41
41
  /**
42
42
  * The most recent version whose EF-side SOURCE actually changed (#127).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Cerefox — user-owned shared memory for AI agents. CLI + stdio MCP server + web UI + ingestion for a knowledge base on your own Supabase project (or fully self-hosted with Cerefox Local).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/fstamatelopoulos/cerefox",