omgbase 0.26.1 → 0.26.2
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 +3 -3
- package/dist/build-info.json +2 -2
- package/dist/src/cmd/oqx.js +29 -26
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -46,11 +46,11 @@ decisions.md 5 blocks 0s ago
|
|
|
46
46
|
$ omg find sqlite
|
|
47
47
|
b_v32ar6f decisions.md#heading[3] ADR-002 Embedded SQLite
|
|
48
48
|
|
|
49
|
-
$ omg q '
|
|
49
|
+
$ omg q 'blocks { _type == "task" && !checked }'
|
|
50
50
|
b_24nr0y0 README.md
|
|
51
51
|
b_36p2zw1 README.md
|
|
52
52
|
|
|
53
|
-
$ omg q 'blocks count {
|
|
53
|
+
$ omg q 'blocks count { _type == "task" && !checked }'
|
|
54
54
|
2
|
|
55
55
|
|
|
56
56
|
$ omg outline README.md
|
|
@@ -72,7 +72,7 @@ ADR-002 Embedded SQLite
|
|
|
72
72
|
`omg cat <path>` prints a document's exact bytes (frontmatter and all); given a block id it prints that block. Edits are structural mutations that update the file and the database together. The pipe is the changeset boundary — `--ids` emits block ids, `done -` reads them from stdin and completes them in one commit:
|
|
73
73
|
|
|
74
74
|
```console
|
|
75
|
-
$ omg q '
|
|
75
|
+
$ omg q 'blocks { _type == "task" && !checked }' --ids | omg done -
|
|
76
76
|
ok committed · 1 document touched
|
|
77
77
|
b_24nr0y0
|
|
78
78
|
b_36p2zw1
|
package/dist/build-info.json
CHANGED
package/dist/src/cmd/oqx.js
CHANGED
|
@@ -15,9 +15,12 @@ import { readStdin } from "./_mutate.js";
|
|
|
15
15
|
// nodes … }` re-projects each doc through its nodes). Clause order is fixed
|
|
16
16
|
// (ADR-020): `select … from … where … follow … order by … limit … offset …`,
|
|
17
17
|
// each at most once, at the top level and inside every block. Only `select` may
|
|
18
|
-
// drop its keyword, and only as the first clause (`_nodes
|
|
19
|
-
//
|
|
20
|
-
// "md:task" }
|
|
18
|
+
// drop its keyword, and only as the first clause (`_nodes { _name }` projects);
|
|
19
|
+
// a predicate that LEADS a body needs no `where` (`_nodes exists { _kind ==
|
|
20
|
+
// "md:task" }`, oqx 0.17) but a bare name there projects rather than filters
|
|
21
|
+
// (`{ is checked }` filters), and a predicate after a projection keeps the
|
|
22
|
+
// keyword; a consumer word with no block is the empty block (`_nodes exists`,
|
|
23
|
+
// oqx 0.26).
|
|
21
24
|
// `where` may use the body's select aliases. Features: a boolean where
|
|
22
25
|
// tree over scalar predicates and consumer directives, count comparisons
|
|
23
26
|
// (`nodes count { … } >= 2`), nestable collect, one-scope lifts (^name:) that
|
|
@@ -70,30 +73,30 @@ async function runOqx(cli, args) {
|
|
|
70
73
|
"examples:",
|
|
71
74
|
],
|
|
72
75
|
});
|
|
73
|
-
cli.io.out(" e.g. query '
|
|
74
|
-
cli.io.out(" query 'select items: _blocks
|
|
75
|
-
cli.io.out(" query 'select _title, open
|
|
76
|
-
cli.io.out(" query 'select owner_id, owner: ^nodes single {
|
|
77
|
-
cli.io.out(" query 'docs count {
|
|
78
|
-
cli.io.out(" query '
|
|
79
|
-
cli.io.out(" query '
|
|
76
|
+
cli.io.out(" e.g. query 'docs { _nodes count { _kind == \"md:task\" } >= 2 }'");
|
|
77
|
+
cli.io.out(" query 'nodes { select items: _blocks { _type == \"list_item\" } where _kind == \"md:section\" }'");
|
|
78
|
+
cli.io.out(" query 'docs { select _title, open where _nodes { ^open: _value where _kind == \"md:task\" and not checked } }'");
|
|
79
|
+
cli.io.out(" query 'docs { select owner_id, owner: ^nodes single { _kind == \"person\" and id == ^owner_id } }' # ^docs/^nodes/^blocks/^links: the repository (the root row) from inside a row; 0^docs from any depth; ^_id / 0^_id = the repository id");
|
|
80
|
+
cli.io.out(" query 'docs count { layer == \"canon\" }' # scalar; also <target> exists/none/first/single { … } at the top level");
|
|
81
|
+
cli.io.out(" query 'docs { _nodes none { _kind == \"md:task\" and not checked } }' # none = zero rows (≡ not … exists; \"every\" = none over the complement)");
|
|
82
|
+
cli.io.out(" query 'docs { era is not null and (layer == \"canon\" or layer == \"working\") }' # and / or / not are the connectives (&& || ! accepted); x is y / x is not y = identity, x is null = absent");
|
|
80
83
|
cli.io.out(" query 'docs { type == \"substance\" and not verified }' # sugar: a block without a consumer is collect; a leading predicate drops `where` (bare names still project — filter a bare field with `is x`); after a follow destination too: follow _children { depth 2 } is its block");
|
|
81
|
-
cli.io.out(" query 'select subject, process: ^docs[slug == ^subject]._path
|
|
82
|
-
cli.io.out(" query 'select _title, $depth
|
|
83
|
-
cli.io.out(" query 'select _title, next: ^docs { ^_path in list(before) }
|
|
84
|
-
cli.io.out(" query '
|
|
85
|
-
cli.io.out(" query 'select fm: entries(_frontmatter)
|
|
86
|
-
cli.io.out(" query 'select _path values
|
|
87
|
-
cli.io.out(" query 'select _title, tags: _tags
|
|
88
|
-
cli.io.out(" query 'docs
|
|
89
|
-
cli.io.out(" query '
|
|
90
|
-
cli.io.out(" query 'select s: semantic(\"the great work\")
|
|
91
|
-
cli.io.out(" query '
|
|
92
|
-
cli.io.out(" query 'select t: _text, d: $depth, s: $stop
|
|
93
|
-
cli.io.out(" query '
|
|
94
|
-
cli.io.out(" query 'select p: _doc._path, d: $depth, s: $stop
|
|
95
|
-
cli.io.out(" query '
|
|
96
|
-
cli.io.out(" query 'select src: _doc_id, to: _dst_path
|
|
84
|
+
cli.io.out(" query 'docs { select subject, process: ^docs[slug == ^subject]._path where type == \"lab-note\" }' # x[p] = first match or absent; x[p]! = exactly one, required; x[n] = positional; _title! = the value or a loud error; a select item may use the items to its left");
|
|
85
|
+
cli.io.out(" query 'docs { select _title, $depth where _path == \"/timeline/review.md\" follow refs(before), refs(after) }' # refs(field): the live documents a property's references name (either path form or a d_ id; dangling dropped) — a receiver, a source or a follow destination");
|
|
86
|
+
cli.io.out(" query 'docs { select _title, next: ^docs { ^_path in list(before) } where type == \"milestone\" }' # paths are /-rooted on the surface (_path == \"/x.md\"; inputs accept both forms), so a property's reference compares with ^_path directly");
|
|
87
|
+
cli.io.out(" query 'docs { type == \"practitioner\" order by era desc limit 2 offset 1 }' # limit/offset bound the set (after order/distinct, before the consumer)");
|
|
88
|
+
cli.io.out(" query 'docs { select fm: entries(_frontmatter) { k: $key, v: $it } where _path == \"/x.md\" }' # a record as a collection ($key/$it); also entries(_data), entries(_attrs), entries(_inline)");
|
|
89
|
+
cli.io.out(" query 'docs { select _path values where layer == \"canon\" }' # `values`: bare values, no {_id,_path} hits (one item only)");
|
|
90
|
+
cli.io.out(" query 'docs { select _title, tags: _tags { $it values where $it != \"draft\" } }' # $it = the current item (here: each tag); _tags = authored tags ∪ #hashtags, bare `tags` the authored key alone");
|
|
91
|
+
cli.io.out(" query 'docs { from _nodes where _kind == \"md:task\" }' # `from E` inside a body re-projects the rows (→ nodes)");
|
|
92
|
+
cli.io.out(" query 'docs { text(\"philosophers stone\") and layer == \"canon\" }' # full-text prune");
|
|
93
|
+
cli.io.out(" query 'blocks { select s: semantic(\"the great work\") where semantic(\"the great work\") > 0.6 }' # embedding score (needs a provider)");
|
|
94
|
+
cli.io.out(" query 'docs { type == \"practitioner\" order by era desc }' # order by <expr> [asc|desc]");
|
|
95
|
+
cli.io.out(" query 'blocks { select t: _text, d: $depth, s: $stop where _id == \"b_x\" follow _children }' # recursive walk ($depth/$stop metadata)");
|
|
96
|
+
cli.io.out(" query 'nodes { _name == \"Overview\" follow _subsections { depth 3 } }' # follow [distinct] <dest> [{ where … frontier … depth n }] — a brace after any destination is that destination's block (identity is $key: project $key: <expr> to rekey a walk)");
|
|
97
|
+
cli.io.out(" query 'docs { select p: _doc._path, d: $depth, s: $stop where _path == \"/index.md\" follow _out_links { from _dst } }' # citation graph (cyclic-safe: $stop=cycle)");
|
|
98
|
+
cli.io.out(" query 'blocks { _type == \"list_item\" and $leaf follow _children }' # $leaf/$depth/$stop filter the walk result post-walk");
|
|
99
|
+
cli.io.out(" query 'links { select src: _doc_id, to: _dst_path where _predicate == \"depends_on\" }' # the links target: _predicate/_provenance/_dst_kind + _doc_id/_dst_path/_uri");
|
|
97
100
|
return EXIT_OK;
|
|
98
101
|
}
|
|
99
102
|
const source = values.file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omgbase",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
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.29.
|
|
48
|
+
"@omgbase/core": "^0.29.2",
|
|
49
49
|
"@omgbase/fs-adapter": "^0.2.0",
|
|
50
|
-
"@omgbase/sync": "^0.6.
|
|
50
|
+
"@omgbase/sync": "^0.6.3",
|
|
51
51
|
"yaml": "^2.9.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|