omgbase 0.16.0 → 0.18.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.
@@ -1,4 +1,4 @@
1
1
  {
2
- "commit": "b5bb9c1",
3
- "built": "2026-10-13T09:12:01.162Z"
2
+ "commit": "66abf7c",
3
+ "built": "2026-10-14T06:35:28.357Z"
4
4
  }
@@ -159,7 +159,7 @@ export function runSugar(cli, ws, repo, sugar, opts = {}) {
159
159
  */
160
160
  export async function runSugarRemote(cli, tool, toolArgs, effects, refs = []) {
161
161
  if (cli.flags.dryRun)
162
- return renderPlan(cli, await remoteCall(cli, "plan", { effects: await effects() }));
162
+ return renderPlan(cli, await remoteCall(cli, "plan", { effects: await effects(), diffs: true }));
163
163
  return renderReceipt(cli, await remoteSugar(cli, tool, toolArgs, effects, refs));
164
164
  }
165
165
  /** A ref as an effect target for a remote `plan`: a `b_` id is the block, a `d_` id the document, anything else a document path. */
@@ -198,7 +198,7 @@ export function runEffects(cli, ws, repo, effects, opts = {}) {
198
198
  /** Remote peer of `runEffects`: the `apply` tool with `effects` (the Receipt), or on a dry run the `plan` tool (the Plan). */
199
199
  export async function runEffectsRemote(cli, effects, reason) {
200
200
  if (cli.flags.dryRun)
201
- return renderPlan(cli, await remoteCall(cli, "plan", { effects }));
201
+ return renderPlan(cli, await remoteCall(cli, "plan", { effects, diffs: true }));
202
202
  return renderReceipt(cli, await remoteCall(cli, "apply", { effects, ...(reason ? { reason } : {}) }));
203
203
  }
204
204
  /** `execute`: commit exactly a Plan (the plan form, spec/mutate §11.7 — admission, then the one transaction), rendered as a Receipt. */
@@ -40,7 +40,7 @@ function runGcCmd(cli, args) {
40
40
  if (values.help) {
41
41
  return renderHelp(cli, {
42
42
  name: "gc",
43
- summary: "Mark-and-sweep unreferenced blobs and tree nodes (refuses unless gc.enabled is set in repo settings)",
43
+ summary: "Mark-and-sweep unreferenced blobs and tree nodes, and the `same` disposition rows a pre-14.2 store wrote (refuses unless gc.enabled is set in repo settings)",
44
44
  usage: "gc [--dry-run] [--vacuum]",
45
45
  options: [
46
46
  ["--dry-run", "report what would be swept, sweep nothing (allowed even when gc is disabled)"],
@@ -57,7 +57,9 @@ function runGcCmd(cli, args) {
57
57
  if (!enabled && !dryRun) {
58
58
  throw new EngineErrorLike("target_missing", "gc is disabled; set gc.enabled=true (or use --dry-run)");
59
59
  }
60
- const swept = runGc(ws.store, { enabled: enabled || dryRun });
60
+ // A dry run counts every sweep — blobs, tree nodes and the `same` disposition
61
+ // rows a 14.1 store wrote (spec/store §7, 14.2) — and deletes nothing.
62
+ const swept = runGc(ws.store, { enabled: enabled || dryRun, dryRun });
61
63
  // `--vacuum` runs after the sweep (the sweep's freed pages are what it returns);
62
64
  // a dry run measures the free pages and vacuums nothing (spec/store §7).
63
65
  const vac = values.vacuum
@@ -68,7 +70,7 @@ function runGcCmd(cli, args) {
68
70
  const result = vac ? { ...swept, vacuum: vac } : swept;
69
71
  if (cli.flags.mode !== "human")
70
72
  return emitMachine(cli, result);
71
- cli.io.err(cli.style.dim(` swept ${swept.blobsSwept} blobs, ${swept.treeNodesSwept} tree nodes`));
73
+ cli.io.err(cli.style.dim(` swept ${swept.blobsSwept} blobs, ${swept.treeNodesSwept} tree nodes, ${swept.sameDispositionsSwept} same dispositions`));
72
74
  if (vac)
73
75
  cli.io.err(cli.style.dim(vac.applied ? ` vacuumed, reclaimed ${humanBytes(vac.reclaimable)}` : ` would vacuum ${humanBytes(vac.reclaimable)}`));
74
76
  return EXIT_OK;
@@ -83,7 +85,7 @@ function runDoctor(cli, args) {
83
85
  usage: ["doctor [--json]", "doctor --size [--json]"],
84
86
  options: [
85
87
  ["--size", "instead of the checks: what the database is made of — bytes and rows per category (content, history, search, sync) and table, the file's pages, what VACUUM would reclaim, advice"],
86
- ["--json", "`{ ok, checks: [{ name, ok, detail }] }`; with --size `{ file, categories, advice }`"],
88
+ ["--json", "`{ ok, checks: [{ name, ok, detail }] }`; with --size `{ file, categories, same_dispositions, advice }`"],
87
89
  ],
88
90
  });
89
91
  }
@@ -167,10 +167,20 @@ export function renderOqxResult(cli, result, bare = false) {
167
167
  cursor,
168
168
  });
169
169
  }
170
+ // Unknown names (spec/surface §1.5, spec/cli §6 `query`): the result's `hints`
171
+ // — names the query reads that no row of their kind carries — print LAST on
172
+ // stderr, one dim ` hint: …` line each, in every human rendering (the
173
+ // machine modes carry the member itself).
174
+ const { style, io } = cli;
175
+ const hints = () => {
176
+ for (const h of result.hints ?? [])
177
+ io.err(style.dim(` hint: ${h}`));
178
+ };
170
179
  // Scalar consumers (count/exists/none) have no hits — render the reduction itself.
171
180
  if (result.consumer === "count" || result.consumer === "exists" || result.consumer === "none") {
172
181
  const scalar = result.consumer === "count" ? String(result.count) : result.consumer === "exists" ? String(result.exists) : String(result.none);
173
182
  cli.io.out(scalar);
183
+ hints();
174
184
  return EXIT_OK;
175
185
  }
176
186
  // A `values` projection has no hits — one bare value per line (strings
@@ -180,11 +190,12 @@ export function renderOqxResult(cli, result, bare = false) {
180
190
  cli.io.out(typeof v === "string" ? v : JSON.stringify(v));
181
191
  if (cursor !== null)
182
192
  truncationFooter(cli.io, cli.style, cursor);
193
+ hints();
183
194
  return EXIT_OK;
184
195
  }
185
- const { style, io } = cli;
186
196
  if (result.hits.length === 0) {
187
197
  io.err(style.dim(" no hits"));
198
+ hints();
188
199
  return EXIT_OK;
189
200
  }
190
201
  if (bare)
@@ -193,6 +204,7 @@ export function renderOqxResult(cli, result, bare = false) {
193
204
  renderHits(cli, result.hits);
194
205
  if (result.truncated)
195
206
  truncationFooter(io, style, result.cursor ?? "");
207
+ hints();
196
208
  return EXIT_OK;
197
209
  }
198
210
  // `query` (alias `q`) is the single, default query surface — the OQX engine.
@@ -29,7 +29,7 @@ async function runRetarget(cli, args) {
29
29
  // Remote: the `plan` tool previews, `links_retarget` commits server-side.
30
30
  if (cli.flags.server) {
31
31
  if (!values.apply || cli.flags.dryRun) {
32
- const plan = await remoteCall(cli, "plan", { effects: sugar.effects });
32
+ const plan = await remoteCall(cli, "plan", { effects: sugar.effects, diffs: true });
33
33
  return values.apply ? renderPlanDiffs(cli, plan) : renderHits(cli, from, to, retargetOf(plan).hits);
34
34
  }
35
35
  // `links_retarget` where listed (its result adds `hits`/`pairs`), else `apply { retarget }` (spec/cli §2.3, 4.2).
@@ -62,7 +62,7 @@ async function runDocUpdate(cli, args) {
62
62
  // A server without `docs_update` (a minimal profile) gets `apply` over the same effect (spec/cli §2.3, 4.2).
63
63
  const setContent = { op: "set", target: { kind: "document", ...docLocator(doc) }, field: "content", value: bytes };
64
64
  if (dryRun)
65
- plan = await remoteCall(cli, "plan", { effects: [setContent] });
65
+ plan = await remoteCall(cli, "plan", { effects: [setContent], diffs: true });
66
66
  else
67
67
  receipt = await remoteSugar(cli, "docs_update", { ...docLocator(doc), content: bytes, ...(values.reason ? { reason: values.reason } : {}) }, () => [setContent]);
68
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omgbase",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Open Markdown Graph Base — CLI",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,9 +45,9 @@
45
45
  "omg": "./dist/src/main.js"
46
46
  },
47
47
  "dependencies": {
48
- "@omgbase/core": "^0.19.0",
48
+ "@omgbase/core": "^0.21.0",
49
49
  "@omgbase/fs-adapter": "^0.2.0",
50
- "@omgbase/sync": "^0.5.12",
50
+ "@omgbase/sync": "^0.5.14",
51
51
  "yaml": "^2.9.0"
52
52
  },
53
53
  "devDependencies": {