@cerefox/memory 0.9.7 → 0.9.9

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.7";
7187
+ var PKG_VERSION = "0.9.9";
7188
7188
  var init_meta = () => {};
7189
7189
 
7190
7190
  // ../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.js
@@ -68117,6 +68117,12 @@ _cerefox() {
68117
68117
  _cerefox_candidates "$path"
68118
68118
  compadd -- \${=REPLY}
68119
68119
  }
68120
+ # Self-bootstrap the completion system if no \`compinit\` has run yet (e.g. this
68121
+ # file is sourced from an rc that never initialized completions). No-op when
68122
+ # \`compdef\` already exists, so it never re-runs compinit unnecessarily.
68123
+ if ! whence compdef >/dev/null 2>&1; then
68124
+ autoload -Uz compinit && compinit
68125
+ fi
68120
68126
  compdef _cerefox cerefox
68121
68127
  `;
68122
68128
  }
@@ -75880,6 +75886,7 @@ function registerInit(program2) {
75880
75886
  init_cli_core();
75881
75887
  init_client();
75882
75888
  async function action21(options) {
75889
+ const deleted = !!options.deleted;
75883
75890
  const limit = parsePositiveInt(options.limit, "--limit", 100);
75884
75891
  const client = getClient();
75885
75892
  let projectId;
@@ -75893,7 +75900,8 @@ async function action21(options) {
75893
75900
  }
75894
75901
  projectId = project.id;
75895
75902
  }
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);
75903
+ let query = client.raw.from("cerefox_documents").select("id, title, source, metadata, created_at, updated_at, review_status, deleted_at").limit(limit);
75904
+ 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
75905
  if (projectId) {
75898
75906
  const { data: junctionRows, error: junctionError } = await client.raw.from("cerefox_document_projects").select("document_id").eq("project_id", projectId);
75899
75907
  if (junctionError) {
@@ -75921,20 +75929,23 @@ async function action21(options) {
75921
75929
  return;
75922
75930
  }
75923
75931
  if (rows.length === 0) {
75924
- process.stdout.write(`(no documents)
75932
+ process.stdout.write(deleted ? `(trash is empty)
75933
+ ` : `(no documents)
75925
75934
  `);
75926
75935
  return;
75927
75936
  }
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
- })));
75937
+ printTable(rows.map((doc) => {
75938
+ const base = {
75939
+ id: doc.id.slice(0, 8) + "…",
75940
+ title: doc.title.length > 60 ? doc.title.slice(0, 57) + "…" : doc.title,
75941
+ source: doc.source ?? "",
75942
+ status: doc.review_status ?? ""
75943
+ };
75944
+ 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", " ") };
75945
+ }));
75935
75946
  }
75936
75947
  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);
75948
+ 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
75949
  }
75939
75950
 
75940
75951
  // src/cli/commands/list-metadata-keys.ts
@@ -80505,6 +80516,7 @@ function registerDocumentReadRoutes(app, ctx) {
80505
80516
  review_status: meta ? meta.review_status ?? "approved" : "approved",
80506
80517
  created_at: meta ? meta.created_at ?? null : null,
80507
80518
  updated_at: meta ? meta.updated_at ?? null : null,
80519
+ deleted_at: meta ? meta.deleted_at ?? null : null,
80508
80520
  versions: versions3.map((v) => ({
80509
80521
  version_id: v.version_id,
80510
80522
  version_number: v.version_number,