wiki-graph 0.8.0 → 0.8.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/dist/cli.js +484 -484
- package/dist/cli.js.map +1 -1
- package/dist/data/help/commands/library.jinja +7 -2
- package/dist/data/help/commands/predicate.jinja +11 -9
- package/dist/data/help/commands/uri.jinja +13 -0
- package/dist/data/help/topics/library.jinja +3 -1
- package/dist/data/help/topics/readiness.jinja +3 -3
- package/dist/data/help/topics/recipe.jinja +1 -1
- package/dist/data/help/topics/uri.jinja +6 -1
- package/dist/gc-worker.js +54 -54
- package/dist/gc-worker.js.map +1 -1
- package/dist/index.cjs +164 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +164 -17
- package/dist/index.js.map +1 -1
- package/dist/queue-worker.js +475 -475
- package/dist/queue-worker.js.map +1 -1
- package/package.json +2 -2
|
@@ -40,10 +40,15 @@ Archive member collection
|
|
|
40
40
|
|
|
41
41
|
Default behavior:
|
|
42
42
|
- `{{ commandName }} {{ uri }}` reads the archive collection scope; use `/tree` for member file visualization.
|
|
43
|
+
- `{{ commandName }} {{ uri }} --query <query>` searches managed archive titles through the aggregate library index.
|
|
44
|
+
- Add `--query-mode hybrid|fts|embedding`; `hybrid` is the default and explicit single-index modes are strict.
|
|
45
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed archive titles while ignoring uncovered chapters.
|
|
43
46
|
- `scan` reconciles `.wikg` files; `add` copies and registers one archive.
|
|
44
47
|
|
|
45
48
|
Usage:
|
|
46
49
|
{{ commandName }} {{ uri }} [--json]
|
|
50
|
+
{{ commandName }} {{ uri }} --query <query> [--query-mode <hybrid|fts|embedding>] [--limit <n>] [--cursor <cursor>] [--json]
|
|
51
|
+
{{ commandName }} {{ uri }} --query <query> --skip-unindexed
|
|
47
52
|
{{ commandName }} {{ uri }} add --input <path> [--to <relative-wikg-path>] [--json]
|
|
48
53
|
{{ commandName }} {{ uri }} scan [--json|--jsonl]
|
|
49
54
|
{{ commandName }} {{ uri }}/tree [--parent <relative-path>] [--depth <n>] [--json]
|
|
@@ -194,7 +199,7 @@ URI forms:
|
|
|
194
199
|
Usage:
|
|
195
200
|
{% if target.isDefault %}
|
|
196
201
|
{{ commandName }} wikg://lib [--json]
|
|
197
|
-
{{ commandName }} wikg://lib --query <query> [--limit <n>] [--cursor <cursor>] [--json]
|
|
202
|
+
{{ commandName }} wikg://lib --query <query> [--query-mode <hybrid|fts|embedding>] [--limit <n>] [--cursor <cursor>] [--json]
|
|
198
203
|
{{ commandName }} wikg://lib --query <query> --skip-unindexed
|
|
199
204
|
{{ commandName }} wikg://lib/chapter --query <query>
|
|
200
205
|
{{ commandName }} wikg://lib/chunk --query <query>
|
|
@@ -209,7 +214,7 @@ Usage:
|
|
|
209
214
|
{{ commandName }} wikg://lib/meta [--json]
|
|
210
215
|
{% else %}
|
|
211
216
|
{{ commandName }} {{ uri }} [--json]
|
|
212
|
-
{{ commandName }} {{ uri }} --query <query> [--limit <n>] [--cursor <cursor>] [--json]
|
|
217
|
+
{{ commandName }} {{ uri }} --query <query> [--query-mode <hybrid|fts|embedding>] [--limit <n>] [--cursor <cursor>] [--json]
|
|
213
218
|
{{ commandName }} {{ uri }} --query <query> --skip-unindexed
|
|
214
219
|
{{ commandName }} {{ uri }}/chapter --query <query>
|
|
215
220
|
{{ commandName }} {{ uri }}/chunk --query <query>
|
|
@@ -14,12 +14,13 @@ Purpose:
|
|
|
14
14
|
Expand from the current chunk or entity object to nearby objects.
|
|
15
15
|
|
|
16
16
|
Usage:
|
|
17
|
-
{{ commandName }} {{ uri }} related [--query <query>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
|
|
17
|
+
{{ commandName }} {{ uri }} related [--query <query>] [--query-mode <hybrid|fts|embedding>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
|
|
18
18
|
|
|
19
19
|
Notes:
|
|
20
20
|
- Chunk targets return nearby Reading Graph chunks.
|
|
21
21
|
- Entity targets return Knowledge Graph triples involving the entity.
|
|
22
22
|
- `--query` filters and ranks related results with the current search index.
|
|
23
|
+
- `--query-mode` requires `--query`; `hybrid` is the default, while `fts` and `embedding` are strict.
|
|
23
24
|
- Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
|
|
24
25
|
- Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
|
|
25
26
|
- `--role` only applies to entity targets.
|
|
@@ -29,11 +30,12 @@ Purpose:
|
|
|
29
30
|
Trace the current object back to source-backed evidence.
|
|
30
31
|
|
|
31
32
|
Usage:
|
|
32
|
-
{{ commandName }} {{ uri }} evidence [--query <query>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--json|--jsonl]
|
|
33
|
+
{{ commandName }} {{ uri }} evidence [--query <query>] [--query-mode <hybrid|fts|embedding>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--json|--jsonl]
|
|
33
34
|
|
|
34
35
|
Notes:
|
|
35
36
|
- Evidence is for grounding, verification, and citation support.
|
|
36
37
|
- `--query` filters and ranks evidence with the current search index.
|
|
38
|
+
- `--query-mode` requires `--query`; `hybrid` is the default, while `fts` and `embedding` are strict.
|
|
37
39
|
- Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
|
|
38
40
|
- Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
|
|
39
41
|
- Evidence previews include nearby source context by default; use `--context 0` for exact cited ranges.
|
|
@@ -237,9 +239,9 @@ Usage:
|
|
|
237
239
|
Notes:
|
|
238
240
|
- The input is plain summary text from a positional value, `--input <path>`, or `--input -` for stdin.
|
|
239
241
|
- This sets the summary resource directly; it does not call an LLM provider.
|
|
240
|
-
{% elif target.name == "chapter-title-object" %}
|
|
242
|
+
{% elif target.name == "chapter-title-object" or target.name == "archive-title-object" %}
|
|
241
243
|
Purpose:
|
|
242
|
-
Replace this chapter title.
|
|
244
|
+
Replace this {% if target.name == "archive-title-object" %}archive{% else %}chapter{% endif %} title.
|
|
243
245
|
|
|
244
246
|
Usage:
|
|
245
247
|
{{ commandName }} {{ uri }} set <title>
|
|
@@ -392,9 +394,9 @@ Notes:
|
|
|
392
394
|
- `set` is target-specific. Use the URI help page to find the writable child resource or supported predicate.
|
|
393
395
|
{% endif %}
|
|
394
396
|
{% elif predicate == "clear" %}
|
|
395
|
-
{% if target.name == "chapter-title-object" %}
|
|
397
|
+
{% if target.name == "chapter-title-object" or target.name == "archive-title-object" %}
|
|
396
398
|
Purpose:
|
|
397
|
-
Remove this chapter's explicit title.
|
|
399
|
+
Remove this {% if target.name == "archive-title-object" %}archive's{% else %}chapter's{% endif %} explicit title.
|
|
398
400
|
{% elif target.name == "metadata-object" %}
|
|
399
401
|
Purpose:
|
|
400
402
|
Clear this metadata map.
|
|
@@ -406,10 +408,10 @@ Purpose:
|
|
|
406
408
|
Usage:
|
|
407
409
|
{{ commandName }} {{ uri }} clear{% if target.name == "metadata-object" %} [--json]{% endif %}
|
|
408
410
|
|
|
409
|
-
{% if target.name == "chapter-title-object" %}
|
|
411
|
+
{% if target.name == "chapter-title-object" or target.name == "archive-title-object" %}
|
|
410
412
|
Notes:
|
|
411
|
-
- Removes the explicit title for this chapter.
|
|
412
|
-
- This does not delete the chapter, source text, Reading Graph data, or summary.
|
|
413
|
+
- Removes the explicit title for this {% if target.name == "archive-title-object" %}archive{% else %}chapter{% endif %}.
|
|
414
|
+
- This does not delete the {% if target.name == "archive-title-object" %}archive.{% else %}chapter, source text, Reading Graph data, or summary.{% endif %}
|
|
413
415
|
{% elif target.name == "metadata-object" %}
|
|
414
416
|
Notes:
|
|
415
417
|
- Clears all metadata keys for this metadata object.
|
|
@@ -13,6 +13,7 @@ URI type:
|
|
|
13
13
|
Default behavior:
|
|
14
14
|
- `{{ commandName }} {{ uri }}` enumerates archive-level objects.
|
|
15
15
|
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval across archive scopes.
|
|
16
|
+
- Add `--query-mode hybrid|fts|embedding`; `hybrid` is the default and explicit single-index modes are strict.
|
|
16
17
|
- Broad query results are bucketed by object family: chapter/title hits, graph objects, chunks, then text streams.
|
|
17
18
|
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
18
19
|
|
|
@@ -20,6 +21,7 @@ Use when:
|
|
|
20
21
|
- You need the archive entry point before narrowing to chapters, chunks, entities, triples, source, or summaries.
|
|
21
22
|
|
|
22
23
|
Common child targets:
|
|
24
|
+
- `{{ commandName }} {{ uri }}/title --help`: archive title object and title edits.
|
|
23
25
|
- `{{ commandName }} {{ uri }}/chapter --help`: chapter tree, chapter paths, and chapter-scoped retrieval.
|
|
24
26
|
- `{{ commandName }} {{ uri }}/index --help`: archive search index status and lifecycle.
|
|
25
27
|
- `{{ commandName }} {{ uri }}/meta --help`: archive metadata.
|
|
@@ -196,6 +198,17 @@ Default behavior:
|
|
|
196
198
|
|
|
197
199
|
Use when:
|
|
198
200
|
- You need the current title or want to set or clear it.
|
|
201
|
+
{% elif target.name == "archive-title-object" %}
|
|
202
|
+
URI type:
|
|
203
|
+
Archive title object
|
|
204
|
+
|
|
205
|
+
Default behavior:
|
|
206
|
+
- `{{ commandName }} {{ uri }}` reads the archive title.
|
|
207
|
+
- For a managed archive, use its library archive URI with `/title`; do not expose or substitute its filesystem path.
|
|
208
|
+
- Archive title objects are searchable through archive and library scopes when their corresponding FTS index is current.
|
|
209
|
+
|
|
210
|
+
Use when:
|
|
211
|
+
- You need the current title or want to set or clear it for one archive.
|
|
199
212
|
{% elif target.name == "chapter-tree-object" %}
|
|
200
213
|
URI type:
|
|
201
214
|
Chapter tree object
|
|
@@ -14,6 +14,7 @@ Core model:
|
|
|
14
14
|
- The `arc` reserved segment keeps library ids distinct from archive member ids.
|
|
15
15
|
- `{{ commandName }} wikg://lib` reads the default library root scope.
|
|
16
16
|
- `{{ commandName }} wikg://lib --query <query>` searches library-wide objects through the library index.
|
|
17
|
+
- Add `--query-mode hybrid|fts|embedding` to select hybrid, FTS-only, or embedding-only retrieval.
|
|
17
18
|
|
|
18
19
|
Registry discovery:
|
|
19
20
|
- `{{ commandName }} wikg://lib/registry add --path <folder>` prints the new non-default library URI.
|
|
@@ -51,6 +52,7 @@ Library archive shortcuts:
|
|
|
51
52
|
|
|
52
53
|
Library-wide query:
|
|
53
54
|
- `{{ commandName }} wikg://lib --query <archive-term>` searches library-wide objects through the library index.
|
|
55
|
+
- `{{ commandName }} wikg://lib/arc --query <archive-title>` searches only managed archive title objects.
|
|
54
56
|
- `{{ commandName }} wikg://lib/entity --query <query>` searches across present archive members through the library index.
|
|
55
57
|
- `{{ commandName }} wikg://lib/triple --query <query>` searches library-wide Knowledge Graph triples.
|
|
56
58
|
- `{{ commandName }} wikg://lib/chunk --query <query>` searches library-wide Reading Graph chunks.
|
|
@@ -67,7 +69,7 @@ Library index lifecycle:
|
|
|
67
69
|
- Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
|
|
68
70
|
- Sync does not build missing chapter artifacts and does not call an embeddings provider.
|
|
69
71
|
- Dense query still requires `wikg://local/config/embeddings` to embed the query text.
|
|
70
|
-
-
|
|
72
|
+
- `--query-mode hybrid` combines FTS and Dense when both exist; use `fts` or `embedding` to require one index type.
|
|
71
73
|
- Library membership changes can make the aggregate index stale.
|
|
72
74
|
- Managed archive writes try to sync an existing library index cache immediately; if sync cannot complete, library-wide query reports the cache as stale or not ready.
|
|
73
75
|
- Sync the library index again when library-wide query reports that the index is missing, stale, or not ready.
|
|
@@ -36,9 +36,9 @@ Archive index readiness:
|
|
|
36
36
|
`{{ commandName }} <archive-uri>/index clean` deletes only the local cache.
|
|
37
37
|
|
|
38
38
|
Query behavior:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
`--query-mode hybrid` is the default and uses every available compatible index with automatic fusion.
|
|
40
|
+
`--query-mode fts` requires current FTS coverage and never calls an embeddings provider.
|
|
41
|
+
`--query-mode embedding` requires current source embedding coverage and a compatible embeddings provider; it never falls back to FTS.
|
|
42
42
|
Broad query is grouped by result type first: chapter/title, object, chunk, then source/summary text.
|
|
43
43
|
FTS, Dense, and Hybrid ranking affect ordering inside those result groups and evidence-backed object ranking; they do not flatten the type groups into one global rerank.
|
|
44
44
|
Missing both FTS and source embedding for any content chapter in scope: ordinary query fails.
|
|
@@ -79,7 +79,7 @@ After inspect:
|
|
|
79
79
|
Check the chapter or archive readiness before relying on summaries.
|
|
80
80
|
|
|
81
81
|
Finding material:
|
|
82
|
-
`--query` uses indexed
|
|
82
|
+
`--query` uses indexed retrieval and defaults to hybrid FTS + embedding search. Use `--query-mode fts` for strict keyword retrieval or `--query-mode embedding` for strict semantic retrieval.
|
|
83
83
|
|
|
84
84
|
- Need document structure, chapter readiness, or chapter-local scope:
|
|
85
85
|
{{ commandName }} wikg://book.wikg/chapter
|
|
@@ -52,6 +52,7 @@ Short and located URIs:
|
|
|
52
52
|
Command routing:
|
|
53
53
|
- `{{ commandName }} <scope-uri>` enumerates objects.
|
|
54
54
|
- `{{ commandName }} <scope-uri> --query <query>` applies search index retrieval within that scope.
|
|
55
|
+
- Add `--query-mode hybrid|fts|embedding` to choose the allowed index. `hybrid` is the default.
|
|
55
56
|
- `{{ commandName }} <object-uri>` reads one object.
|
|
56
57
|
- `{{ commandName }} <uri> --help` explains that URI target and its supported predicates.
|
|
57
58
|
- `{{ commandName }} <uri> <predicate> --help` explains a URI-bound predicate.
|
|
@@ -59,6 +60,7 @@ Command routing:
|
|
|
59
60
|
Common command shapes:
|
|
60
61
|
{{ commandName }} <scope-uri>
|
|
61
62
|
{{ commandName }} <scope-uri> --query <query>
|
|
63
|
+
{{ commandName }} <scope-uri> --query <query> --query-mode fts
|
|
62
64
|
{{ commandName }} <object-uri>
|
|
63
65
|
{{ commandName }} <chunk-uri|entity-uri> related
|
|
64
66
|
{{ commandName }} <entity|triple|chunk-uri> evidence
|
|
@@ -82,7 +84,7 @@ Scope URIs:
|
|
|
82
84
|
Query is strict by default: every chapter in scope must have a current FTS artifact or source embedding artifact.
|
|
83
85
|
Add `--skip-unindexed` only when you intentionally want to search indexed chapters and ignore uncovered chapters.
|
|
84
86
|
Broad query is grouped by result type before ranking within each group. Use `/chunk`, `/entity`, or `/triple` lenses when you want one object family instead of the mixed broad result. Query an archive or chapter scope to find source or summary text, then read the returned `/source` or `/summary` object.
|
|
85
|
-
Search uses
|
|
87
|
+
Search uses Hybrid by default. `--query-mode fts` and `--query-mode embedding` are strict and never fall back to the other index; use `{{ commandName }} help readiness` to inspect what must exist.
|
|
86
88
|
Add `--depth <N>` to limit chapter subtree expansion:
|
|
87
89
|
- no `--depth`: full subtree
|
|
88
90
|
- `--depth 0`: only the current chapter, or root-level chapters for `<archive-uri>/chapter`
|
|
@@ -104,6 +106,7 @@ Scope URIs:
|
|
|
104
106
|
|
|
105
107
|
Object URIs:
|
|
106
108
|
Object URIs read one object by default.
|
|
109
|
+
wikg://book.wikg/title
|
|
107
110
|
wikg://book.wikg/chapter/part/title
|
|
108
111
|
wikg://book.wikg/chapter/part/state
|
|
109
112
|
wikg://book.wikg/chapter/part/source
|
|
@@ -130,6 +133,7 @@ Triple pattern scopes:
|
|
|
130
133
|
A complete triple URI with concrete subject, predicate, and object is an object URI.
|
|
131
134
|
|
|
132
135
|
Object boundaries:
|
|
136
|
+
- An archive URI is a scope; `<archive-uri>/title` is its queryable title object.
|
|
133
137
|
- `chapter/<path>` is a scope, not an object.
|
|
134
138
|
- `chapter/<path>/title` is the queryable chapter title object.
|
|
135
139
|
- Whole `source` and `summary` objects are readable text streams, not collection scopes.
|
|
@@ -154,6 +158,7 @@ Document Flow order:
|
|
|
154
158
|
Document Flow order means `/chapter/tree` preorder chapter traversal, then source or summary ranges from the start of each chapter to the end.
|
|
155
159
|
Use `--reverse` when you need the same flow backward, for example to find the latest source occurrence of a known object.
|
|
156
160
|
`--reverse` cannot be combined with `--query`; query results use indexed match ranking instead.
|
|
161
|
+
`--query-mode` requires `--query`.
|
|
157
162
|
|
|
158
163
|
Lens selection:
|
|
159
164
|
- Use `<archive-uri>` when the whole archive is the right retrieval scope.
|