omgbase 0.8.0 → 0.10.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.
- package/README.md +1 -1
- package/dist/build-info.json +2 -2
- package/dist/src/cmd/_mutate.js +4 -2
- package/dist/src/cmd/cat.js +1 -1
- package/dist/src/cmd/docs.js +14 -11
- package/dist/src/cmd/find.js +2 -2
- package/dist/src/cmd/oqx.js +9 -9
- package/dist/src/cmd/outline.js +5 -4
- package/dist/src/cmd/retarget.js +3 -2
- package/dist/src/cmd/show.js +1 -1
- package/dist/src/cmd/sync.js +3 -2
- package/dist/src/cmd/update.js +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ $ omg q 'from blocks where type == "task" && !attrs.checked'
|
|
|
50
50
|
b_24nr0y0 README.md
|
|
51
51
|
b_36p2zw1 README.md
|
|
52
52
|
|
|
53
|
-
$ omg q '
|
|
53
|
+
$ omg q 'blocks count { where type == "task" && !attrs.checked }'
|
|
54
54
|
2
|
|
55
55
|
|
|
56
56
|
$ omg outline README.md
|
package/dist/build-info.json
CHANGED
package/dist/src/cmd/_mutate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync, readSync } from "node:fs";
|
|
2
2
|
import { userInfo } from "node:os";
|
|
3
|
-
import { apply, unifiedDiff } from "@omgbase/core";
|
|
3
|
+
import { apply, unifiedDiff, surfaceApplyResult } from "@omgbase/core";
|
|
4
4
|
import { CliUsageError, EXIT_OK, EXIT_ERROR } from "../output.js";
|
|
5
5
|
import { remoteCall } from "./_remote.js";
|
|
6
6
|
// Shared plumbing for every write command (11 §5.6, §5.7). Sugar commands build
|
|
@@ -135,7 +135,9 @@ export function runOps(cli, ws, repo, ops, opts = {}) {
|
|
|
135
135
|
omgbaseDir: ws.omgbaseDir,
|
|
136
136
|
...(cli.flags.dryRun ? { dryRun: true } : {}),
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
// The reference form on every printed path (spec/surface §1 "Paths"): the
|
|
139
|
+
// kernel's result is re-shaped exactly as the MCP server re-shapes it.
|
|
140
|
+
const result = surfaceApplyResult(apply(ws.store, req));
|
|
139
141
|
return renderApply(cli, result);
|
|
140
142
|
}
|
|
141
143
|
/**
|
package/dist/src/cmd/cat.js
CHANGED
|
@@ -59,7 +59,7 @@ async function runCat(cli, args) {
|
|
|
59
59
|
summary: "Content bytes of a node — exact raw bytes by default, pipe-clean (`show` is the metadata card)",
|
|
60
60
|
usage: "cat <node…|-> [--resolution raw|text|outline|skeleton|full]",
|
|
61
61
|
options: [
|
|
62
|
-
["<node…>", "one or more refs: a block id (`b_…`), a doc id (`d_…`), a node id (`n_…`), or a
|
|
62
|
+
["<node…>", "one or more refs: a block id (`b_…`), a doc id (`d_…`), a node id (`n_…`), or a doc path (`/notes/x.md`; the leading `/` is optional)"],
|
|
63
63
|
["-", `read refs from stdin, one per line (\`${cli.prog} q … --ids | ${cli.prog} cat -\`)`],
|
|
64
64
|
["--resolution <r>", "block refs only: raw (default: exact bytes) | text | outline | skeleton | full; a document is always its exact bytes (warns if given)"],
|
|
65
65
|
],
|
package/dist/src/cmd/docs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { parse as parseYamlScalar } from "yaml";
|
|
3
|
-
import { docsCreate, docsMove, docsDelete, docsSetMeta } from "@omgbase/core";
|
|
3
|
+
import { docsCreate, docsMove, docsDelete, docsSetMeta, surfaceDocOpResult, surfaceDocMoveResult, referencePath } from "@omgbase/core";
|
|
4
4
|
import { CliUsageError, EXIT_OK, renderHelp } from "../output.js";
|
|
5
5
|
import { readContent, extractContentOpts, renderDiffs } from "./_mutate.js";
|
|
6
6
|
import { remoteCall } from "./_remote.js";
|
|
@@ -8,6 +8,9 @@ import { remoteCall } from "./_remote.js";
|
|
|
8
8
|
// over the core doc ops, which own the file-write + commit + flock protocol.
|
|
9
9
|
// The global --dry-run rides as the op's `dryRun` (spec/cli §3.6): the op
|
|
10
10
|
// validates and returns the per-file diffs it would make, committing nothing.
|
|
11
|
+
// Every path printed is the reference form (spec/surface §1 "Paths"): the
|
|
12
|
+
// library's result is re-shaped through `surfaceDocOpResult` — the same
|
|
13
|
+
// function the MCP server applies — before it is rendered.
|
|
11
14
|
function ctxOf(cli, ws, repoId, rootPath, actor) {
|
|
12
15
|
return {
|
|
13
16
|
repoId,
|
|
@@ -52,7 +55,7 @@ function reportMove(cli, from, res) {
|
|
|
52
55
|
const n = res.dangling.length;
|
|
53
56
|
io.err(style.warn(` ${style.warn(cli.render.g.warn)} ${n} inbound link${n === 1 ? "" : "s"} still name${n === 1 ? "s" : ""} the old path: ${where}`));
|
|
54
57
|
if (res.dangling.some((l) => l.block))
|
|
55
|
-
io.err(style.dim(` fix: ${cli.prog} retarget
|
|
58
|
+
io.err(style.dim(` fix: ${cli.prog} retarget ${from} ${res.path} --apply`));
|
|
56
59
|
const seen = new Set();
|
|
57
60
|
for (const l of res.dangling) {
|
|
58
61
|
if (l.block || !l.field)
|
|
@@ -61,7 +64,7 @@ function reportMove(cli, from, res) {
|
|
|
61
64
|
if (seen.has(key))
|
|
62
65
|
continue;
|
|
63
66
|
seen.add(key);
|
|
64
|
-
io.err(style.dim(` fix: ${cli.prog} meta ${l.path} --set ${l.field}
|
|
67
|
+
io.err(style.dim(` fix: ${cli.prog} meta ${l.path} --set ${l.field}=${res.path}`));
|
|
65
68
|
}
|
|
66
69
|
return code;
|
|
67
70
|
}
|
|
@@ -95,7 +98,7 @@ async function runNew(cli, args) {
|
|
|
95
98
|
}
|
|
96
99
|
const ws = cli.workspace();
|
|
97
100
|
const repo = cli.repo(ws);
|
|
98
|
-
const res = docsCreate(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), path, bytes);
|
|
101
|
+
const res = surfaceDocOpResult(docsCreate(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), path, bytes));
|
|
99
102
|
return report(cli, "created", res);
|
|
100
103
|
}
|
|
101
104
|
// ---- mv ---------------------------------------------------------------------
|
|
@@ -127,7 +130,7 @@ async function runMv(cli, args) {
|
|
|
127
130
|
}
|
|
128
131
|
const ws = cli.workspace();
|
|
129
132
|
const repo = cli.repo(ws);
|
|
130
|
-
const res = docsMove(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), doc, toPath, noRetarget ? { retargetInbound: false } : {});
|
|
133
|
+
const res = surfaceDocMoveResult(docsMove(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), doc, toPath, noRetarget ? { retargetInbound: false } : {}));
|
|
131
134
|
return reportMove(cli, fromPathOf(res, doc), res);
|
|
132
135
|
}
|
|
133
136
|
// ---- rm --doc (block rm lives in mutate.ts; this handles the --doc branch) --
|
|
@@ -137,7 +140,7 @@ export async function runRmDoc(cli, doc, actor) {
|
|
|
137
140
|
}
|
|
138
141
|
const ws = cli.workspace();
|
|
139
142
|
const repo = cli.repo(ws);
|
|
140
|
-
const res = docsDelete(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, actor), doc);
|
|
143
|
+
const res = surfaceDocOpResult(docsDelete(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, actor), doc));
|
|
141
144
|
return report(cli, "deleted", res);
|
|
142
145
|
}
|
|
143
146
|
// ---- meta -------------------------------------------------------------------
|
|
@@ -198,18 +201,18 @@ async function runMeta(cli, args) {
|
|
|
198
201
|
}
|
|
199
202
|
const ws = cli.workspace();
|
|
200
203
|
const repo = cli.repo(ws);
|
|
201
|
-
const res = docsSetMeta(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), doc, { set, unset });
|
|
204
|
+
const res = surfaceDocOpResult(docsSetMeta(ws.store, ctxOf(cli, ws, repo.repoId, repo.rootPath, values.actor), doc, { set, unset }));
|
|
202
205
|
return report(cli, "patched", res);
|
|
203
206
|
}
|
|
204
207
|
function dryRunArg(cli) {
|
|
205
208
|
return cli.flags.dryRun ? { dry_run: true } : {};
|
|
206
209
|
}
|
|
207
|
-
// The path a move left behind, for the retarget hint
|
|
208
|
-
// it as written (`target
|
|
209
|
-
// fall back to the ref the user typed when nothing dangles.
|
|
210
|
+
// The path a move left behind, for the retarget hint, in the reference form:
|
|
211
|
+
// the dangling links name it as written (`target`, the canonical spelling with
|
|
212
|
+
// a leading `/`); fall back to the ref the user typed when nothing dangles.
|
|
210
213
|
function fromPathOf(res, ref) {
|
|
211
214
|
const named = res.dangling.find((l) => l.target)?.target;
|
|
212
|
-
return (named ?? ref)
|
|
215
|
+
return referencePath(named ?? ref);
|
|
213
216
|
}
|
|
214
217
|
export const cmdNew = { name: "new", summary: "Create a document", run: (c, a) => runNew(c, a) };
|
|
215
218
|
export const cmdMv = { name: "mv", summary: "Rename a document", run: (c, a) => runMv(c, a) };
|
package/dist/src/cmd/find.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import { resolve as resolveThing } from "@omgbase/core";
|
|
2
|
+
import { resolve as resolveThing, surfaceResolveHits } from "@omgbase/core";
|
|
3
3
|
import { CliUsageError, EXIT_OK, emitMachine, renderHelp } from "../output.js";
|
|
4
4
|
import { loadEmbedding } from "./_embed.js";
|
|
5
5
|
import { remoteCall } from "./_remote.js";
|
|
@@ -59,7 +59,7 @@ async function runFind(cli, args) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
hits = resolveThing(ws.store, input);
|
|
62
|
+
hits = surfaceResolveHits(resolveThing(ws.store, input)); // locators in the reference form
|
|
63
63
|
}
|
|
64
64
|
cli.capture?.(hits); // shell: the ranked hits become the addressable frame
|
|
65
65
|
// -1: bare top id.
|
package/dist/src/cmd/oqx.js
CHANGED
|
@@ -9,7 +9,7 @@ import { readStdin } from "./_mutate.js";
|
|
|
9
9
|
// object model (`doc.layer`, `section.blocks`); whitespace query directives
|
|
10
10
|
// belong to OQX (`<receiver> collect|exists|count|first|single { <block> }`).
|
|
11
11
|
// `from E` selects + flattens a relation relative to the current source scope
|
|
12
|
-
// (top-level `from docs` = the repository's docs;
|
|
12
|
+
// (top-level `from docs` = the repository's docs; `docs collect { from
|
|
13
13
|
// nodes … }` re-projects each doc through its nodes). Clause order is fixed
|
|
14
14
|
// (ADR-020): `select … from … where … follow … order by … limit … offset …`,
|
|
15
15
|
// each at most once, at the top level and inside every block. Only `select` may
|
|
@@ -20,14 +20,14 @@ import { readStdin } from "./_mutate.js";
|
|
|
20
20
|
// tree over scalar predicates and consumer directives, count comparisons
|
|
21
21
|
// (`nodes count { … } >= 2`), nestable collect, one-scope lifts (^name:) that
|
|
22
22
|
// filter + capture, one-scope-outward references (^name) that correlate a nested
|
|
23
|
-
// query to a parent binding,
|
|
23
|
+
// query to a parent binding, the root row's collections ^docs/^nodes/^blocks for
|
|
24
24
|
// join-equivalents, first/single lookups, full-text text(...) + embedding-score
|
|
25
25
|
// semantic(...) predicates, `order by <expr> [asc|desc]` ranking, and recursive
|
|
26
26
|
// `follow [distinct] <rel> [{ where … frontier … depth n by … }]` traversal over
|
|
27
27
|
// a type-preserving relation with $depth/$stop/$ordinal recursion metadata +
|
|
28
28
|
// post-walk filtering. A top-level consumer directive changes the result shape:
|
|
29
|
-
//
|
|
30
|
-
//
|
|
29
|
+
// `docs count { … }` / `docs exists { … }` reduce to a scalar,
|
|
30
|
+
// `docs first { … }` / `docs single { … }` to zero-or-one row (bare
|
|
31
31
|
// `from …` = collect). Coexists with `omg q` (CEL). Source is a positional
|
|
32
32
|
// string or -f file|-. Human output: one hit per line (id + path), or an aligned
|
|
33
33
|
// id/path/columns table when the query projects (`select`), or the scalar for
|
|
@@ -64,20 +64,20 @@ async function runOqx(cli, args) {
|
|
|
64
64
|
cli.io.out(" e.g. query 'from docs where nodes count { where kind == \"md:task\" } >= 2'");
|
|
65
65
|
cli.io.out(" query 'select items: section.blocks collect { where type == \"list_item\" } from nodes where kind == \"md:section\"'");
|
|
66
66
|
cli.io.out(" query 'select $path, open from docs where nodes collect { ^open: value where kind == \"md:task\" && !attrs.checked }'");
|
|
67
|
-
cli.io.out(" query 'select owner_id, owner:
|
|
68
|
-
cli.io.out(" query '
|
|
67
|
+
cli.io.out(" query 'select owner_id, owner: ^nodes single { where kind == \"person\" && attrs.id == ^owner_id } from docs' # ^docs/^nodes/^blocks/^edges: the repository (the root row) from inside a row; 0^docs from any depth");
|
|
68
|
+
cli.io.out(" query 'docs count { where layer == \"canon\" }' # scalar; also <target> exists/none/first/single { … } at the top level");
|
|
69
69
|
cli.io.out(" query 'from docs where nodes none { where kind == \"md:task\" && !checked }' # none = zero rows (≡ !exists; \"every\" = none over the complement)");
|
|
70
70
|
cli.io.out(" query 'from docs where type == \"practitioner\" order by era desc limit 2 offset 1' # limit/offset bound the set (after order/distinct, before the consumer)");
|
|
71
|
-
cli.io.out(" query 'select fm: entries(frontmatter) collect { k: $key, v: $it } from docs where $path == \"x.md\"' # a record as a collection ($key/$it); also entries(attrs), entries(inline)");
|
|
71
|
+
cli.io.out(" query 'select fm: entries(frontmatter) collect { k: $key, v: $it } from docs where $path == \"/x.md\"' # a record as a collection ($key/$it); also entries(attrs), entries(inline)");
|
|
72
72
|
cli.io.out(" query 'select $path values from docs where layer == \"canon\"' # `values`: bare values, no {id,path} hits (one item only)");
|
|
73
73
|
cli.io.out(" query 'select $path, tags: tags collect { $it values where $it != \"draft\" } from docs' # $it = the current item (here: each tag)");
|
|
74
|
-
cli.io.out(" query '
|
|
74
|
+
cli.io.out(" query 'docs collect { from nodes where kind == \"md:task\" }' # `from E` re-projects the source (→ nodes)");
|
|
75
75
|
cli.io.out(" query 'from docs where text(\"philosophers stone\") && layer == \"canon\"' # full-text prune");
|
|
76
76
|
cli.io.out(" query 'select s: semantic(\"the great work\") from blocks where semantic(\"the great work\") > 0.6' # embedding score (needs a provider)");
|
|
77
77
|
cli.io.out(" query 'from docs where type == \"practitioner\" order by era desc' # order by <expr> [asc|desc]");
|
|
78
78
|
cli.io.out(" query 'select t: text, d: $depth, s: $stop from blocks where $id == \"b_x\" follow block.children' # recursive walk ($depth/$stop metadata)");
|
|
79
79
|
cli.io.out(" query 'from nodes where name == \"Overview\" follow section.subsections { depth 3 }' # follow [distinct] <rel> [{ where … frontier … depth n by … }]");
|
|
80
|
-
cli.io.out(" query 'select p: $path, d: $depth, s: $stop from docs where $path == \"index.md\" follow doc.out' # citation graph (cyclic-safe: $stop=cycle)");
|
|
80
|
+
cli.io.out(" query 'select p: $path, d: $depth, s: $stop from docs where $path == \"/index.md\" follow doc.out' # citation graph (cyclic-safe: $stop=cycle)");
|
|
81
81
|
cli.io.out(" query 'from blocks where type == \"list_item\" && $leaf follow block.children' # $leaf/$depth/$stop filter the walk result post-walk");
|
|
82
82
|
cli.io.out(" query 'select src: $src, to: $dst_path from edges where predicate == \"depends_on\"' # the edges target: predicate/provenance/dst_kind + $src/$dst_path/$dst_uri");
|
|
83
83
|
return EXIT_OK;
|
package/dist/src/cmd/outline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import { findDoc, docsOutline } from "@omgbase/core";
|
|
2
|
+
import { findDoc, docsOutline, referencePath } from "@omgbase/core";
|
|
3
3
|
import { CliUsageError, EngineErrorLike, truncationFooter, EXIT_OK, emitMachine, renderHelp } from "../output.js";
|
|
4
4
|
import { remoteCall } from "./_remote.js";
|
|
5
5
|
// `omg outline <doc|path>` (alias ol) — the wire format (06 §6). Human output
|
|
@@ -33,13 +33,14 @@ async function runOutline(cli, args) {
|
|
|
33
33
|
let header;
|
|
34
34
|
if (cli.flags.server) {
|
|
35
35
|
// Remote: the docs_outline tool resolves the ref + returns the same
|
|
36
|
-
// OutlineResult. The header shows the ref you passed (no local path lookup)
|
|
36
|
+
// OutlineResult. The header shows the ref you passed (no local path lookup):
|
|
37
|
+
// a path ref rooted (spec/surface §1 "Paths"), a `d_` id verbatim.
|
|
37
38
|
result = await remoteCall(cli, "docs_outline", {
|
|
38
39
|
doc: ref,
|
|
39
40
|
...(values.depth ? { depth: Number(values.depth) } : {}),
|
|
40
41
|
...(values.skeleton ? { resolution: "skeleton" } : {}),
|
|
41
42
|
});
|
|
42
|
-
header = ref;
|
|
43
|
+
header = ref.startsWith("d_") ? ref : referencePath(ref);
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
46
|
const ws = cli.workspace();
|
|
@@ -53,7 +54,7 @@ async function runOutline(cli, args) {
|
|
|
53
54
|
if (values.skeleton)
|
|
54
55
|
opts.resolution = "skeleton";
|
|
55
56
|
result = docsOutline(ws.store, info.docId, opts);
|
|
56
|
-
header = info.path;
|
|
57
|
+
header = referencePath(info.path);
|
|
57
58
|
}
|
|
58
59
|
// `{ text, truncated }` carries neither a list nor ids: every machine mode is the document.
|
|
59
60
|
if (cli.flags.mode !== "human")
|
package/dist/src/cmd/retarget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import { linksRetarget } from "@omgbase/core";
|
|
2
|
+
import { linksRetarget, surfaceRetargetHits } from "@omgbase/core";
|
|
3
3
|
import { CliUsageError, EXIT_OK, renderHelp } from "../output.js";
|
|
4
4
|
import { runOps, unifiedDiffLines } from "./_mutate.js";
|
|
5
5
|
import { remoteCall } from "./_remote.js";
|
|
@@ -45,7 +45,8 @@ async function runRetarget(cli, args) {
|
|
|
45
45
|
}
|
|
46
46
|
const ws = cli.workspace();
|
|
47
47
|
const repo = cli.repo(ws);
|
|
48
|
-
const { ops, hits } = linksRetarget(ws.store, repo.repoId, from, to, values.scope ? { pathGlob: values.scope } : {});
|
|
48
|
+
const { ops, hits: rawHits } = linksRetarget(ws.store, repo.repoId, from, to, values.scope ? { pathGlob: values.scope } : {});
|
|
49
|
+
const hits = surfaceRetargetHits(rawHits); // the hits' document paths in the reference form
|
|
49
50
|
// --apply → commit via the shared helper (honors --dry-run too, if combined).
|
|
50
51
|
if (values.apply) {
|
|
51
52
|
return runOps(cli, ws, repo, ops, values.actor ? { actor: values.actor } : {});
|
package/dist/src/cmd/show.js
CHANGED
|
@@ -37,7 +37,7 @@ function runShow(cli, args) {
|
|
|
37
37
|
summary: "Metadata card for a node: attrs, placement, open edges, last change (`cat` is the bytes)",
|
|
38
38
|
usage: "show <node…|-> [--include history]",
|
|
39
39
|
options: [
|
|
40
|
-
["<node…>", "one or more refs: a block id (`b_…`), a doc id (`d_…`), a node id (`n_…`), or a
|
|
40
|
+
["<node…>", "one or more refs: a block id (`b_…`), a doc id (`d_…`), a node id (`n_…`), or a doc path (`/notes/x.md`; the leading `/` is optional)"],
|
|
41
41
|
["-", `read refs from stdin, one per line (\`${cli.prog} q … --ids | ${cli.prog} show -\`)`],
|
|
42
42
|
["--include <list>", "comma-separated extras; `history` adds the block's last 5 changes"],
|
|
43
43
|
],
|
package/dist/src/cmd/sync.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
|
-
import { Watcher, WatchLease, EmbedDrainer, freshnessSweep, awaitReady, WATCH_READY_PATIENCE_MS, EngineError } from "@omgbase/core";
|
|
3
|
+
import { Watcher, WatchLease, EmbedDrainer, freshnessSweep, awaitReady, WATCH_READY_PATIENCE_MS, EngineError, surfaceSweepResult } from "@omgbase/core";
|
|
4
4
|
import { runFsMirror } from "@omgbase/sync";
|
|
5
5
|
import { EngineErrorLike, EXIT_OK, emitMachine, renderHelp } from "../output.js";
|
|
6
6
|
import { loadEmbedding } from "./_embed.js";
|
|
@@ -68,7 +68,8 @@ function runOneShot(cli, ws, repo) {
|
|
|
68
68
|
cli.io.err(cli.style.dim(` ${repo.slug} has no filesystem source — nothing to sync`));
|
|
69
69
|
return EXIT_OK;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
// The paths the sweep names are printed in the reference form (spec/surface §1 "Paths").
|
|
72
|
+
const result = surfaceSweepResult(freshnessSweep(ws.store, repo.repoId, repo.rootPath));
|
|
72
73
|
// A `SweepResult` is a record (its lists are per-kind): every machine mode is the document.
|
|
73
74
|
if (cli.flags.mode !== "human")
|
|
74
75
|
return emitMachine(cli, result);
|
package/dist/src/cmd/update.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import { docsUpdate, renderOpsetPlan } from "@omgbase/core";
|
|
2
|
+
import { docsUpdate, renderOpsetPlan, surfaceDocsUpdate } from "@omgbase/core";
|
|
3
3
|
import { CliUsageError, EXIT_OK, renderHelp } from "../output.js";
|
|
4
4
|
import { readContent, extractContentOpts } from "./_mutate.js";
|
|
5
5
|
import { cmdUpdate as cmdUpdateBlock } from "./mutate.js";
|
|
@@ -76,10 +76,10 @@ async function runDocUpdate(cli, args) {
|
|
|
76
76
|
...(ws.omgbaseDir ? { omgbaseDir: ws.omgbaseDir } : {}),
|
|
77
77
|
...(values.actor ? { actor: values.actor } : {}),
|
|
78
78
|
};
|
|
79
|
-
({ opset, result } = docsUpdate(ws.store, ctx, doc, bytes, {
|
|
79
|
+
({ opset, result } = surfaceDocsUpdate(docsUpdate(ws.store, ctx, doc, bytes, {
|
|
80
80
|
dryRun,
|
|
81
81
|
...(values.reason ? { reason: values.reason } : {}),
|
|
82
|
-
}));
|
|
82
|
+
})));
|
|
83
83
|
}
|
|
84
84
|
if (cli.flags.mode !== "human") {
|
|
85
85
|
cli.io.out(JSON.stringify({ opset, result }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omgbase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.
|
|
48
|
+
"@omgbase/core": "^0.10.0",
|
|
49
49
|
"@omgbase/fs-adapter": "^0.2.0",
|
|
50
|
-
"@omgbase/sync": "^0.4.
|
|
50
|
+
"@omgbase/sync": "^0.4.10",
|
|
51
51
|
"yaml": "^2.9.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|