@cerefox/memory 0.9.5 → 0.9.7

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.
@@ -4,9 +4,19 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" type="image/png" href="/app/cerefox_icon.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ rel="stylesheet"
11
+ href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap"
12
+ />
13
+ <link
14
+ rel="stylesheet"
15
+ href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap"
16
+ />
7
17
  <title>Cerefox</title>
8
- <script type="module" crossorigin src="/app/assets/index-BHVfMLlE.js"></script>
9
- <link rel="stylesheet" crossorigin href="/app/assets/index-DoDJGRih.css">
18
+ <script type="module" crossorigin src="/app/assets/index-D2tSVOss.js"></script>
19
+ <link rel="stylesheet" crossorigin href="/app/assets/index-CTOQrOUn.css">
10
20
  </head>
11
21
  <body>
12
22
  <div id="root"></div>
@@ -1692,7 +1692,9 @@ STABLE
1692
1692
  SECURITY DEFINER
1693
1693
  SET search_path = public, pg_catalog
1694
1694
  AS $$
1695
- SELECT '0.3.1'::TEXT;
1695
+ -- Keep in lockstep with the `@version:` marker in schema.sql (cut_release.ts
1696
+ -- enforces it). Bump whenever schema.sql OR rpcs.sql changes.
1697
+ SELECT '0.4.0'::TEXT;
1696
1698
  $$;
1697
1699
 
1698
1700
 
@@ -1721,3 +1723,54 @@ AS $$
1721
1723
  AND p.proname = p_name
1722
1724
  );
1723
1725
  $$;
1726
+
1727
+
1728
+
1729
+ -- ─────────────────────────────────────────────────────────────────────────
1730
+ -- Corpus totals (dashboard aggregates)
1731
+ -- ─────────────────────────────────────────────────────────────────────────
1732
+ -- Cheap global aggregates for the dashboard stat strip: total current chunks
1733
+ -- (version_id IS NULL, on non-deleted documents) and total characters across
1734
+ -- active documents. SUM cannot be expressed over the Data API, so it lives
1735
+ -- here as a single STABLE function the /dashboard route calls once.
1736
+
1737
+ CREATE OR REPLACE FUNCTION cerefox_corpus_totals()
1738
+ RETURNS TABLE (total_chunks BIGINT, total_chars BIGINT)
1739
+ LANGUAGE sql
1740
+ STABLE
1741
+ SECURITY DEFINER
1742
+ SET search_path = public, pg_catalog
1743
+ AS $$
1744
+ SELECT
1745
+ (SELECT COUNT(*)
1746
+ FROM cerefox_chunks c
1747
+ JOIN cerefox_documents d ON d.id = c.document_id
1748
+ WHERE c.version_id IS NULL
1749
+ AND d.deleted_at IS NULL)::BIGINT AS total_chunks,
1750
+ (SELECT COALESCE(SUM(total_chars), 0)
1751
+ FROM cerefox_documents
1752
+ WHERE deleted_at IS NULL)::BIGINT AS total_chars;
1753
+ $$;
1754
+
1755
+
1756
+
1757
+ -- ─────────────────────────────────────────────────────────────────────────
1758
+ -- Recent-doc authors (dashboard "Author" column)
1759
+ -- ─────────────────────────────────────────────────────────────────────────
1760
+ -- The latest audit author (+ type) per document, for the given doc ids.
1761
+ -- "Latest editor" — used by the /dashboard recent-docs list so the Author
1762
+ -- column can show who last touched a doc (agent vs human). Read-only.
1763
+
1764
+ CREATE OR REPLACE FUNCTION cerefox_recent_doc_authors(p_doc_ids UUID[])
1765
+ RETURNS TABLE (document_id UUID, author TEXT, author_type TEXT)
1766
+ LANGUAGE sql
1767
+ STABLE
1768
+ SECURITY DEFINER
1769
+ SET search_path = public, pg_catalog
1770
+ AS $$
1771
+ SELECT DISTINCT ON (a.document_id)
1772
+ a.document_id, a.author, a.author_type
1773
+ FROM cerefox_audit_log a
1774
+ WHERE a.document_id = ANY(p_doc_ids)
1775
+ ORDER BY a.document_id, a.created_at DESC;
1776
+ $$;
@@ -5,12 +5,14 @@
5
5
  -- Requires extensions: vector (pgvector), uuid-ossp
6
6
  -- These are enabled at the top of db_deploy.py before this file is applied.
7
7
  --
8
- -- @version: 0.3.1
8
+ -- @version: 0.4.0
9
9
  -- The `@version` marker above is read by the schema-version-mismatch banner
10
- -- (see /api/v1/schema-version). Bump it whenever schema.sql or rpcs.sql
11
- -- changes in a way that requires `python scripts/db_deploy.py` to be re-run.
12
- -- The deployed value is exposed via the `cerefox_schema_version()` RPC at
13
- -- the bottom of rpcs.sql.
10
+ -- (see /api/v1/schema-version). Bump it whenever schema.sql OR rpcs.sql
11
+ -- changes in a way that requires `cerefox server deploy` to be re-run
12
+ -- schema and RPCs deploy together, so this version covers both. You MUST
13
+ -- bump it in lockstep with the `cerefox_schema_version()` literal at the
14
+ -- bottom of rpcs.sql (the deployed value); `cut_release.ts` fails the cut if
15
+ -- `src/cerefox/db/` changed without this bump, or if the two disagree.
14
16
 
15
17
  -- ── Projects ──────────────────────────────────────────────────────────────────
16
18
  -- Lightweight user-defined categories. No predefined taxonomy.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerefox/memory",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
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",