@cerefox/memory 0.9.6 → 0.9.8

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.
@@ -7184,7 +7184,7 @@ var exports_meta = {};
7184
7184
  __export(exports_meta, {
7185
7185
  PKG_VERSION: () => PKG_VERSION
7186
7186
  });
7187
- var PKG_VERSION = "0.9.6";
7187
+ var PKG_VERSION = "0.9.8";
7188
7188
  var init_meta = () => {};
7189
7189
 
7190
7190
  // ../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
@@ -75880,6 +75880,7 @@ function registerInit(program2) {
75880
75880
  init_cli_core();
75881
75881
  init_client();
75882
75882
  async function action21(options) {
75883
+ const deleted = !!options.deleted;
75883
75884
  const limit = parsePositiveInt(options.limit, "--limit", 100);
75884
75885
  const client = getClient();
75885
75886
  let projectId;
@@ -75893,7 +75894,8 @@ async function action21(options) {
75893
75894
  }
75894
75895
  projectId = project.id;
75895
75896
  }
75896
- let query = client.raw.from("cerefox_documents").select("id, title, source, metadata, created_at, updated_at, review_status, deleted_at").is("deleted_at", null).order("updated_at", { ascending: false, nullsFirst: false }).limit(limit);
75897
+ let query = client.raw.from("cerefox_documents").select("id, title, source, metadata, created_at, updated_at, review_status, deleted_at").limit(limit);
75898
+ query = deleted ? query.not("deleted_at", "is", null).order("deleted_at", { ascending: false, nullsFirst: false }) : query.is("deleted_at", null).order("updated_at", { ascending: false, nullsFirst: false });
75897
75899
  if (projectId) {
75898
75900
  const { data: junctionRows, error: junctionError } = await client.raw.from("cerefox_document_projects").select("document_id").eq("project_id", projectId);
75899
75901
  if (junctionError) {
@@ -75921,20 +75923,23 @@ async function action21(options) {
75921
75923
  return;
75922
75924
  }
75923
75925
  if (rows.length === 0) {
75924
- process.stdout.write(`(no documents)
75926
+ process.stdout.write(deleted ? `(trash is empty)
75927
+ ` : `(no documents)
75925
75928
  `);
75926
75929
  return;
75927
75930
  }
75928
- printTable(rows.map((doc) => ({
75929
- id: doc.id.slice(0, 8) + "…",
75930
- title: doc.title.length > 60 ? doc.title.slice(0, 57) + "…" : doc.title,
75931
- source: doc.source ?? "",
75932
- status: doc.review_status ?? "",
75933
- updated_at: (doc.updated_at ?? doc.created_at).slice(0, 19).replace("T", " ")
75934
- })));
75931
+ printTable(rows.map((doc) => {
75932
+ const base = {
75933
+ id: doc.id.slice(0, 8) + "…",
75934
+ title: doc.title.length > 60 ? doc.title.slice(0, 57) + "…" : doc.title,
75935
+ source: doc.source ?? "",
75936
+ status: doc.review_status ?? ""
75937
+ };
75938
+ return deleted ? { ...base, deleted_at: (doc.deleted_at ?? "").slice(0, 19).replace("T", " ") } : { ...base, updated_at: (doc.updated_at ?? doc.created_at).slice(0, 19).replace("T", " ") };
75939
+ }));
75935
75940
  }
75936
75941
  function registerListDocs(program2) {
75937
- program2.command("list-docs").description("List documents in the knowledge base.").option("-p, --project <name>", "Filter to a specific project.").option("-l, --limit <n>", "Maximum docs to return.", "100").option("--json", "Emit machine-readable JSON.").action(action21);
75942
+ program2.command("list-docs").description("List documents in the knowledge base.").option("-p, --project <name>", "Filter to a specific project.").option("-l, --limit <n>", "Maximum docs to return.", "100").option("--deleted", "List soft-deleted (trashed) documents instead of active ones.").option("--json", "Emit machine-readable JSON.").action(action21);
75938
75943
  }
75939
75944
 
75940
75945
  // src/cli/commands/list-metadata-keys.ts
@@ -80505,6 +80510,7 @@ function registerDocumentReadRoutes(app, ctx) {
80505
80510
  review_status: meta ? meta.review_status ?? "approved" : "approved",
80506
80511
  created_at: meta ? meta.created_at ?? null : null,
80507
80512
  updated_at: meta ? meta.updated_at ?? null : null,
80513
+ deleted_at: meta ? meta.deleted_at ?? null : null,
80508
80514
  versions: versions3.map((v) => ({
80509
80515
  version_id: v.version_id,
80510
80516
  version_number: v.version_number,