@promptowl/contextnest-community 1.6.0 → 1.8.0

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.
@@ -14,7 +14,15 @@ var HISTORICAL_MIGRATIONS = [
14
14
  "008_drop_steward_folder_scope",
15
15
  "009_lowercase_emails",
16
16
  "010_sso_used_jti",
17
- "011_comments"
17
+ "011_comments",
18
+ // 012 merges case-colliding SQLite user rows. Postgres can never have them:
19
+ // the NOCASE-unique idx_users_email_nocase (lower(email)) exists from table
20
+ // creation, so duplicates are rejected on insert and there's nothing to merge.
21
+ // Seed the id so bookkeeping matches SQLite and future incremental Postgres
22
+ // migrations gate correctly.
23
+ "012_merge_case_colliding_users",
24
+ "013_node_deletion_tombstones",
25
+ "014_api_events"
18
26
  ];
19
27
  async function runPostgresMigrations(db) {
20
28
  await db.exec(`
@@ -252,6 +260,38 @@ async function runPostgresMigrations(db) {
252
260
  CREATE INDEX IF NOT EXISTS idx_comments_thread
253
261
  ON comments(parent_id);
254
262
 
263
+ -- node_deletions tombstones (migration 013). DELETE /nodes purges all other
264
+ -- governance rows for the node; this is the only record that a doc was
265
+ -- removed, read by GET /nests/:id/changes. One row per (nest, node); a
266
+ -- re-delete after recreate upserts in place. deleted_at written explicitly.
267
+ CREATE TABLE IF NOT EXISTS node_deletions (
268
+ nest_id TEXT NOT NULL REFERENCES nests(id) ON DELETE CASCADE,
269
+ node_id TEXT NOT NULL,
270
+ deleted_by TEXT,
271
+ deleted_at TEXT NOT NULL,
272
+ PRIMARY KEY (nest_id, node_id)
273
+ );
274
+ CREATE INDEX IF NOT EXISTS idx_node_deletions_time
275
+ ON node_deletions(nest_id, deleted_at);
276
+
277
+ -- activity trace (migration 014). One row per API request / MCP tool call
278
+ -- so the server admin has a single place to audit everything. Pruned on a
279
+ -- rolling window in trace-log.ts.
280
+ CREATE TABLE IF NOT EXISTS api_events (
281
+ id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
282
+ ts TEXT NOT NULL,
283
+ kind TEXT NOT NULL CHECK(kind IN ('api', 'mcp')),
284
+ method TEXT, -- HTTP method (api rows)
285
+ path TEXT, -- request path (api rows)
286
+ tool TEXT, -- tool name (mcp rows)
287
+ nest_id TEXT,
288
+ user_id TEXT,
289
+ user_email TEXT,
290
+ status INTEGER, -- HTTP status (api + mcp rows)
291
+ duration_ms INTEGER
292
+ );
293
+ CREATE INDEX IF NOT EXISTS idx_api_events_ts ON api_events(ts);
294
+
255
295
  CREATE TABLE IF NOT EXISTS schema_migrations (
256
296
  id TEXT PRIMARY KEY,
257
297
  applied_at TEXT NOT NULL DEFAULT ${NOW}
@@ -6,12 +6,12 @@ import {
6
6
  getReviewQueue,
7
7
  reject,
8
8
  submitForReview
9
- } from "./chunk-MZGFKBOK.js";
10
- import "./chunk-T5L4LYU4.js";
9
+ } from "./chunk-Z3Y46ZGU.js";
10
+ import "./chunk-XNGOO6RI.js";
11
11
  import {
12
12
  canUserApprove
13
- } from "./chunk-2TUMMVBG.js";
14
- import "./chunk-7V33Z6CS.js";
13
+ } from "./chunk-PJTAUVD7.js";
14
+ import "./chunk-PLAHCDQG.js";
15
15
  import "./chunk-SLTQACJW.js";
16
16
  export {
17
17
  approve,
@@ -20,8 +20,8 @@ import {
20
20
  syncFromConfig,
21
21
  updateSteward,
22
22
  updateStewardRole
23
- } from "./chunk-2TUMMVBG.js";
24
- import "./chunk-7V33Z6CS.js";
23
+ } from "./chunk-PJTAUVD7.js";
24
+ import "./chunk-PLAHCDQG.js";
25
25
  import "./chunk-SLTQACJW.js";
26
26
  export {
27
27
  assignSteward,
@@ -11,8 +11,8 @@ import {
11
11
  hashContent,
12
12
  setApprovedVersion,
13
13
  systemAuthor
14
- } from "./chunk-T5L4LYU4.js";
15
- import "./chunk-7V33Z6CS.js";
14
+ } from "./chunk-XNGOO6RI.js";
15
+ import "./chunk-PLAHCDQG.js";
16
16
  import "./chunk-SLTQACJW.js";
17
17
  export {
18
18
  SYSTEM_AUTHOR_PREFIX,