wiki-graph 0.4.1 → 0.5.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/dist/cli.js +916 -579
- package/dist/cli.js.map +1 -1
- package/dist/data/help/commands/library-predicate.jinja +18 -18
- package/dist/data/help/commands/library.jinja +8 -5
- package/dist/data/help/commands/predicate.jinja +108 -98
- package/dist/data/help/commands/root.jinja +1 -1
- package/dist/data/help/commands/uri.jinja +46 -19
- package/dist/data/help/topics/config.jinja +27 -0
- package/dist/data/help/topics/library.jinja +11 -7
- package/dist/data/help/topics/readiness.jinja +71 -34
- package/dist/data/help/topics/recipe.jinja +11 -8
- package/dist/data/help/topics/uri.jinja +10 -3
- package/dist/gc-worker.js +109 -84
- package/dist/gc-worker.js.map +1 -1
- package/dist/index.cjs +3657 -2517
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3658 -2504
- package/dist/index.js.map +1 -1
- package/dist/queue-worker.js +571 -355
- package/dist/queue-worker.js.map +1 -1
- package/package.json +3 -3
- package/dist/cli.d.ts +0 -1
- package/dist/gc-worker.d.ts +0 -1
- package/dist/index.d.cts +0 -36
- package/dist/queue-worker.d.ts +0 -1
|
@@ -106,36 +106,36 @@ Usage:
|
|
|
106
106
|
{{ commandName }} {{ uri }} [--json]
|
|
107
107
|
|
|
108
108
|
Notes:
|
|
109
|
-
- The status tells whether the library index is current, dirty,
|
|
109
|
+
- The status tells whether the library index cache is current, dirty, or missing.
|
|
110
110
|
- Library-wide object `--query` and object scope enumeration require a current library index.
|
|
111
|
-
- Run `
|
|
112
|
-
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "
|
|
111
|
+
- Run `sync` when the status says the index cache needs to be built or rebuilt.
|
|
112
|
+
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "sync" %}
|
|
113
113
|
Purpose:
|
|
114
|
-
|
|
114
|
+
Sync this library's aggregate index cache.
|
|
115
115
|
|
|
116
116
|
Usage:
|
|
117
|
-
{{ commandName }} {{ uri }}
|
|
117
|
+
{{ commandName }} {{ uri }} sync [--jsonl]
|
|
118
118
|
|
|
119
119
|
Notes:
|
|
120
|
-
- This
|
|
120
|
+
- This rebuilds cache from chapter index artifacts already stored in registered present archives.
|
|
121
|
+
- It does not build missing artifacts and does not call an embeddings provider.
|
|
121
122
|
- Missing or unreadable library archive members are skipped and reported.
|
|
122
123
|
- Progress is emitted as text by default, or line-delimited events with `--jsonl`.
|
|
123
|
-
- `--json` is not supported for
|
|
124
|
+
- `--json` is not supported for sync because progress is streamed.
|
|
124
125
|
- Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "disable" %}
|
|
126
|
+
- Sync holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `clean`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
|
|
127
|
+
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "clean" %}
|
|
128
128
|
Purpose:
|
|
129
|
-
|
|
129
|
+
Remove this library index cache.
|
|
130
130
|
|
|
131
131
|
Usage:
|
|
132
|
-
{{ commandName }} {{ uri }}
|
|
132
|
+
{{ commandName }} {{ uri }} clean [--json]
|
|
133
133
|
|
|
134
134
|
Notes:
|
|
135
135
|
- This does not delete the library registry, metadata, folder, or managed `.wikg` archives.
|
|
136
|
-
-
|
|
137
|
-
- Library
|
|
138
|
-
-
|
|
136
|
+
- It deletes only local derived cache under Wiki Graph staging.
|
|
137
|
+
- Library-wide object `--query` and object scope enumeration will fail until the index cache is synced again.
|
|
138
|
+
- Clean holds the library write lock and cannot run concurrently with membership changes or index sync for the same library.
|
|
139
139
|
{% elif target.kind == "scope" and predicate == "add" %}
|
|
140
140
|
Purpose:
|
|
141
141
|
Copy a `.wikg` archive into this library folder and register it as a managed archive member.
|
|
@@ -149,7 +149,7 @@ Notes:
|
|
|
149
149
|
- `--to` must be a relative `.wikg` path inside the library folder.
|
|
150
150
|
- Parent directories for `--to` are created as needed.
|
|
151
151
|
- Existing target files are not overwritten.
|
|
152
|
-
- Adding an archive
|
|
152
|
+
- Adding an archive can make an existing library index cache stale.
|
|
153
153
|
- The command holds the library write lock and cannot run concurrently with `arc scan`, library `path set`, archive path changes/removes, or index rebuild for the same library.
|
|
154
154
|
{% elif target.kind == "scope" and predicate == "scan" %}
|
|
155
155
|
Purpose:
|
|
@@ -162,7 +162,7 @@ Notes:
|
|
|
162
162
|
- Scan recursively discovers `.wikg` files in the bound library folder.
|
|
163
163
|
- Registered files that are no longer present remain visible as missing/stale instead of being deleted silently.
|
|
164
164
|
- When a moved archive can be matched by its stable mutation token, scan preserves its archive id and updates the relative path.
|
|
165
|
-
- Scan
|
|
165
|
+
- Scan can make an existing library index cache stale when membership changes.
|
|
166
166
|
- Scan holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
|
|
167
167
|
{% elif target.kind == "scope" and predicate == "get" %}
|
|
168
168
|
Purpose:
|
|
@@ -220,7 +220,7 @@ Notes:
|
|
|
220
220
|
- `--confirm` is required.
|
|
221
221
|
- If the registered file is already missing, the command can still clean the registry entry.
|
|
222
222
|
- This does not delete empty parent directories.
|
|
223
|
-
- Removing an archive
|
|
223
|
+
- Removing an archive can make an existing library index cache stale.
|
|
224
224
|
- Remove holds the library write lock and cannot run concurrently with library scan, add, path binding, archive path changes, or index rebuild for the same library.
|
|
225
225
|
{% elif target.kind == "metadata" and predicate == "set" %}
|
|
226
226
|
Purpose:
|
|
@@ -153,12 +153,12 @@ Use when:
|
|
|
153
153
|
|
|
154
154
|
Usage:
|
|
155
155
|
{{ commandName }} {{ uri }} [--json]
|
|
156
|
-
{{ commandName }} {{ uri }}
|
|
157
|
-
{{ commandName }} {{ uri }}
|
|
156
|
+
{{ commandName }} {{ uri }} sync [--jsonl]
|
|
157
|
+
{{ commandName }} {{ uri }} clean [--json]
|
|
158
158
|
|
|
159
159
|
Predicate commands:
|
|
160
|
-
-
|
|
161
|
-
-
|
|
160
|
+
- sync: rebuild this library index cache from registered present archives' artifacts. Help: {{ commandName }} {{ uri }} sync --help
|
|
161
|
+
- clean: remove this library index cache. Help: {{ commandName }} {{ uri }} clean --help
|
|
162
162
|
|
|
163
163
|
Related help:
|
|
164
164
|
- Library registry, membership, path binding, and aggregate index concepts: {{ commandName }} help library
|
|
@@ -169,8 +169,9 @@ Default behavior:
|
|
|
169
169
|
- `{{ commandName }} {{ uri }}` reads the library-wide scope collection.
|
|
170
170
|
- Use `{{ commandName }} wikg://lib/registry` to list all library registries.
|
|
171
171
|
- `{{ commandName }} {{ uri }} --query <query>` searches library-wide objects through the library index.
|
|
172
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
172
173
|
- `{{ commandName }} {{ uri }}/arc scan` reconciles membership with `.wikg` files currently under the library folder.
|
|
173
|
-
- Library-wide object scopes such as `/entity` and `/triple` query one object type through the library index after it is
|
|
174
|
+
- Library-wide object scopes such as `/entity` and `/triple` query one object type through the library index after it is synced.
|
|
174
175
|
- Archive object search must use an explicit lens such as `/entity`, `/triple`, `/chapter`, or `/chunk`.
|
|
175
176
|
|
|
176
177
|
Use when:
|
|
@@ -192,6 +193,7 @@ Usage:
|
|
|
192
193
|
{% if target.isDefault %}
|
|
193
194
|
{{ commandName }} wikg://lib [--json]
|
|
194
195
|
{{ commandName }} wikg://lib --query <query> [--limit <n>] [--cursor <cursor>] [--json]
|
|
196
|
+
{{ commandName }} wikg://lib --query <query> --skip-unindexed
|
|
195
197
|
{{ commandName }} wikg://lib/chapter --query <query>
|
|
196
198
|
{{ commandName }} wikg://lib/chunk --query <query>
|
|
197
199
|
{{ commandName }} wikg://lib/registry add --path <folder> [--json]
|
|
@@ -206,6 +208,7 @@ Usage:
|
|
|
206
208
|
{% else %}
|
|
207
209
|
{{ commandName }} {{ uri }} [--json]
|
|
208
210
|
{{ commandName }} {{ uri }} --query <query> [--limit <n>] [--cursor <cursor>] [--json]
|
|
211
|
+
{{ commandName }} {{ uri }} --query <query> --skip-unindexed
|
|
209
212
|
{{ commandName }} {{ uri }}/chapter --query <query>
|
|
210
213
|
{{ commandName }} {{ uri }}/chunk --query <query>
|
|
211
214
|
{{ commandName }} {{ uri }}/arc scan [--json|--jsonl]
|
|
@@ -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>] [--reverse] [--all] [--limit <n>] [--context <n>] [--cursor <token>] [--role <any|subject|object|self>] [--evidence [n]] [--json|--jsonl]
|
|
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]
|
|
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
|
-
- `--query` filters and ranks related results with the current
|
|
22
|
+
- `--query` filters and ranks related results with the current search index.
|
|
23
|
+
- Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
|
|
23
24
|
- Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
|
|
24
25
|
- `--role` only applies to entity targets.
|
|
25
26
|
- Use `{{ commandName }} {{ uri }} evidence --help` when source grounding is the main goal.
|
|
@@ -28,11 +29,12 @@ Purpose:
|
|
|
28
29
|
Trace the current object back to source-backed evidence.
|
|
29
30
|
|
|
30
31
|
Usage:
|
|
31
|
-
{{ commandName }} {{ uri }} evidence [--query <query>] [--reverse] [--all] [--limit <n>] [--context <n>] [--
|
|
32
|
+
{{ commandName }} {{ uri }} evidence [--query <query>] [--skip-unindexed] [--reverse] [--all] [--limit <n>] [--context <n>] [--json|--jsonl]
|
|
32
33
|
|
|
33
34
|
Notes:
|
|
34
35
|
- Evidence is for grounding, verification, and citation support.
|
|
35
|
-
- `--query` filters and ranks evidence with the current
|
|
36
|
+
- `--query` filters and ranks evidence with the current search index.
|
|
37
|
+
- Add `--skip-unindexed` only with `--query` when you intentionally want to search indexed chapters and ignore uncovered chapters.
|
|
36
38
|
- Without `--query`, `--reverse` reads Document Flow order backward. See `{{ commandName }} help uri`.
|
|
37
39
|
- Evidence previews include nearby source context by default; use `--context 0` for exact cited ranges.
|
|
38
40
|
- Source and scope URIs are not evidence targets.
|
|
@@ -96,11 +98,32 @@ Usage:
|
|
|
96
98
|
|
|
97
99
|
Notes:
|
|
98
100
|
- Run this before broad Reading Graph, Reading Summary, or Knowledge Graph work.
|
|
99
|
-
- The report includes content counts,
|
|
101
|
+
- The report includes content counts, search index readiness, generation coverage, retrieval guidance, recommended next commands, planning estimates, and concurrency hints.
|
|
100
102
|
- Use `--json` for a machine-readable report with the same recommendations.
|
|
101
103
|
{% if libraryContext.isArchiveShortcut %}
|
|
102
104
|
- This library archive shortcut inspects one managed archive's readiness; it is not a library-level health report.
|
|
103
105
|
{% endif %}
|
|
106
|
+
{% elif predicate == "build" and target.name == "chapter-index-artifact" %}
|
|
107
|
+
Purpose:
|
|
108
|
+
Queue a job to build or replace this chapter index artifact.
|
|
109
|
+
|
|
110
|
+
Usage:
|
|
111
|
+
{{ commandName }} {{ uri }} build [--json]
|
|
112
|
+
|
|
113
|
+
Notes:
|
|
114
|
+
- This command enqueues work; it does not wait for the artifact to be built.
|
|
115
|
+
- A queued response means the artifact is not ready yet. Use the returned job id with `{{ commandName }} wikg://local/job/<job-id> watch` to follow progress.
|
|
116
|
+
{% if "/index/fts" in uri %}
|
|
117
|
+
- FTS artifacts are local compilation work and do not call a provider.
|
|
118
|
+
{% else %}
|
|
119
|
+
- Source and summary embedding artifacts require `wikg://local/config/embeddings` and may call the configured provider.
|
|
120
|
+
- Building an embedding artifact can immediately enqueue or run provider-backed work and may incur provider cost.
|
|
121
|
+
{% endif %}
|
|
122
|
+
- Direct artifact build is an explicit build request; it does not use `--accept-cost`.
|
|
123
|
+
{% if "/index/embedding/summary" in uri %}
|
|
124
|
+
- Summary embedding artifacts require an existing non-empty chapter summary.
|
|
125
|
+
{% endif %}
|
|
126
|
+
- After artifacts change, sync the archive or library index cache before library query; archive-level query can create a missing archive cache from current artifacts on first use.
|
|
104
127
|
{% elif predicate == "add" and target.name == "chapter-collection-scope" %}
|
|
105
128
|
Purpose:
|
|
106
129
|
Add a chapter to the archive.
|
|
@@ -115,13 +138,17 @@ Notes:
|
|
|
115
138
|
- Source input must not be empty when `--input` is used.
|
|
116
139
|
{% elif predicate == "add" and target.name == "job-collection-scope" %}
|
|
117
140
|
Purpose:
|
|
118
|
-
Add a local
|
|
141
|
+
Add a local build job.
|
|
119
142
|
|
|
120
143
|
Usage:
|
|
121
|
-
{{ commandName }} {{ uri }} add --input <archive-uri|chapter-uri> --task reading-graph|reading-summary|knowledge-graph --accept-cost [--depth <N>] [--boost] [--llm <json>] [--prompt <text>]
|
|
144
|
+
{{ commandName }} {{ uri }} add --input <archive-uri|chapter-uri> --task index-fts|index-embedding-source|index-embedding-summary|reading-graph|reading-summary|knowledge-graph [--accept-cost] [--depth <N>] [--boost] [--llm <json>] [--prompt <text>]
|
|
122
145
|
|
|
123
146
|
Notes:
|
|
124
|
-
-
|
|
147
|
+
- `index-fts` builds chapter FTS artifacts locally and does not require `--accept-cost`.
|
|
148
|
+
- `index-embedding-source` and `index-embedding-summary` build Dense artifacts with `wikg://local/config/embeddings` and require `--accept-cost`.
|
|
149
|
+
- Reading Graph, Reading Summary, and Knowledge Graph jobs may call an LLM provider and require `--accept-cost`.
|
|
150
|
+
- Reading Graph and Knowledge Graph jobs require a current FTS artifact for the chapter.
|
|
151
|
+
- Summary embedding jobs require an existing non-empty summary.
|
|
125
152
|
- Archive input adds jobs for all eligible chapters; chapter input expands to the chapter subtree by default.
|
|
126
153
|
- Use `--depth <N>` with archive or chapter input to limit affected chapters. For archive input, depth is measured from the archive's root chapters; for chapter input, it is measured from the specified chapter. `--depth 0` means only the relevant root chapters or specified chapter.
|
|
127
154
|
- `--llm <json>` stores a job-local LLM object; it does not update `wikg://local/config/llm`.
|
|
@@ -261,6 +288,23 @@ Notes:
|
|
|
261
288
|
- If current output shows `"apiKey":"****"`, passing the same masked value preserves the existing secret.
|
|
262
289
|
- To add or replace the secret, use `{{ commandName }} {{ uri }} put apiKey --secret`.
|
|
263
290
|
- To remove the secret, use `{{ commandName }} {{ uri }} delete apiKey`.
|
|
291
|
+
{% elif "/embeddings" in uri %}
|
|
292
|
+
Schema:
|
|
293
|
+
{
|
|
294
|
+
"provider": "openai|openai-compatible",
|
|
295
|
+
"model": "<embedding-model-name>",
|
|
296
|
+
"baseURL": "<url>",
|
|
297
|
+
"name": "<display-name>",
|
|
298
|
+
"dimensions": 1536
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
Notes:
|
|
302
|
+
- Allowed keys: provider, model, baseURL, name, dimensions, apiKey.
|
|
303
|
+
- `apiKey` is sensitive and cannot be set from JSON.
|
|
304
|
+
- If current output shows `"apiKey":"****"`, passing the same masked value preserves the existing secret.
|
|
305
|
+
- To add or replace the secret, use `{{ commandName }} {{ uri }} put apiKey --secret`.
|
|
306
|
+
- To remove the secret, use `{{ commandName }} {{ uri }} delete apiKey`.
|
|
307
|
+
- `dimensions` must be a positive integer and is sent only to providers/models that support dimension control.
|
|
264
308
|
{% elif "/wikispine" in uri %}
|
|
265
309
|
Schema:
|
|
266
310
|
{
|
|
@@ -287,6 +331,10 @@ Examples:
|
|
|
287
331
|
{{ commandName }} {{ uri }} set '{"provider":"openai","model":"gpt-4.1"}'
|
|
288
332
|
{{ commandName }} {{ uri }} set --json-input '{"provider":"openai-compatible","model":"model-name"}'
|
|
289
333
|
{{ commandName }} {{ uri }} set '{"provider":"google","model":"gemini-2.5-pro"}' --json
|
|
334
|
+
{% elif "/embeddings" in uri %}
|
|
335
|
+
{{ commandName }} {{ uri }} set '{"provider":"openai","model":"text-embedding-3-small"}'
|
|
336
|
+
{{ commandName }} {{ uri }} set --json-input '{"provider":"openai-compatible","model":"embedding-model","baseURL":"https://api.example.com/v1"}'
|
|
337
|
+
{{ commandName }} {{ uri }} put dimensions 1536
|
|
290
338
|
{% elif "/wikispine" in uri %}
|
|
291
339
|
{{ commandName }} {{ uri }} set '{"provider":"fetch"}'
|
|
292
340
|
{{ commandName }} {{ uri }} set '{"provider":"cli"}'
|
|
@@ -337,112 +385,50 @@ Notes:
|
|
|
337
385
|
Notes:
|
|
338
386
|
- This predicate is only available on URI targets that explicitly support clearing.
|
|
339
387
|
{% endif %}
|
|
340
|
-
{% elif predicate == "
|
|
341
|
-
{% if
|
|
388
|
+
{% elif predicate == "sync" and target.name == "index-object" %}
|
|
389
|
+
{% if libraryContext.isLibraryWide %}
|
|
342
390
|
Purpose:
|
|
343
|
-
|
|
391
|
+
Sync this library index cache from registered archives' chapter index artifacts.
|
|
344
392
|
|
|
345
393
|
Usage:
|
|
346
|
-
{{ commandName }} {{ uri }}
|
|
394
|
+
{{ commandName }} {{ uri }} sync [--jsonl]
|
|
347
395
|
|
|
348
396
|
Notes:
|
|
349
|
-
- This is a
|
|
397
|
+
- This is a cache rebuild from artifacts already stored inside member `.wikg` archives.
|
|
398
|
+
- It does not build missing chapter artifacts and does not call an embeddings provider.
|
|
350
399
|
- Missing or unreadable library archive members are skipped and reported.
|
|
351
400
|
- Progress is emitted as text by default, or line-delimited events with `--jsonl`.
|
|
352
|
-
- `--json` is not supported for
|
|
401
|
+
- `--json` is not supported for sync because progress is streamed.
|
|
353
402
|
- Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
{% else %}
|
|
357
|
-
Purpose:
|
|
358
|
-
Enable searchable FTS index support for this archive on this machine.
|
|
359
|
-
|
|
360
|
-
Usage:
|
|
361
|
-
{{ commandName }} {{ uri }} enable [--jsonl]
|
|
362
|
-
|
|
363
|
-
Notes:
|
|
364
|
-
- This initializes or repairs the local searchable index and may take time on large archives.
|
|
365
|
-
- After the index is enabled, CLI archive writes keep it synchronized automatically.
|
|
366
|
-
- Do not run this after every generation job; run it when `inspect` says query support is unavailable or the index needs repair.
|
|
367
|
-
- By default the index is stored as local cache outside the `.wikg` archive. Use `embed` when the index should travel with the archive.
|
|
368
|
-
- Enabling uses local CPU and disk only; it does not call an LLM provider.
|
|
369
|
-
- Text success output is a short status summary.
|
|
370
|
-
- With `--jsonl`, progress is emitted as line-delimited event records such as step/status/error records.
|
|
371
|
-
- After enable succeeds, `--query`, `related --query`, and `evidence --query` become available.
|
|
372
|
-
{% endif %}
|
|
373
|
-
{% elif predicate == "disable" %}
|
|
374
|
-
{% if target.name == "index-object" and libraryContext.isLibraryWide %}
|
|
375
|
-
Purpose:
|
|
376
|
-
Disable this library index and remove its current local materialization.
|
|
377
|
-
|
|
378
|
-
Usage:
|
|
379
|
-
{{ commandName }} {{ uri }} disable [--json]
|
|
380
|
-
|
|
381
|
-
Notes:
|
|
382
|
-
- This does not delete the library registry, metadata, folder, or managed `.wikg` archives.
|
|
383
|
-
- Library-wide object `--query` and object scope enumeration will fail until the index is enabled again.
|
|
384
|
-
- Library indexes do not support archive-style `embed` or `external` modes.
|
|
385
|
-
- Disable holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
|
|
386
|
-
{% else %}
|
|
387
|
-
Purpose:
|
|
388
|
-
Disable searchable FTS index support for this archive and remove the current index materialization.
|
|
389
|
-
|
|
390
|
-
Usage:
|
|
391
|
-
{{ commandName }} {{ uri }} disable [--json]
|
|
392
|
-
|
|
393
|
-
Notes:
|
|
394
|
-
- Disabling removes the current local or embedded index materialization.
|
|
395
|
-
- After disable succeeds, `--query`, `related --query`, and `evidence --query` are unavailable until `enable` or `embed` is run again.
|
|
396
|
-
- Use this when intentionally dropping index state, not as routine cleanup after generation.
|
|
397
|
-
{% endif %}
|
|
398
|
-
{% elif predicate == "embed" %}
|
|
399
|
-
{% if target.name == "index-object" and libraryContext.isLibraryWide %}
|
|
400
|
-
Purpose:
|
|
401
|
-
This library index does not support embedded archive index storage.
|
|
402
|
-
|
|
403
|
-
Usage:
|
|
404
|
-
{{ commandName }} {{ uri }} enable --help
|
|
405
|
-
|
|
406
|
-
Notes:
|
|
407
|
-
- Library indexes are local derived state under Wiki Graph staging.
|
|
408
|
-
- Use `enable` to build the library index or `disable` to remove it.
|
|
403
|
+
- Sync holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `clean`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
|
|
404
|
+
- Library query requires a current library index cache.
|
|
409
405
|
{% else %}
|
|
410
406
|
Purpose:
|
|
411
|
-
|
|
407
|
+
Sync this archive index cache from chapter index artifacts.
|
|
412
408
|
|
|
413
409
|
Usage:
|
|
414
|
-
{{ commandName }} {{ uri }}
|
|
410
|
+
{{ commandName }} {{ uri }} sync [--jsonl] [--skip-unindexed]
|
|
415
411
|
|
|
416
412
|
Notes:
|
|
417
|
-
- This
|
|
418
|
-
-
|
|
419
|
-
-
|
|
420
|
-
-
|
|
413
|
+
- This initializes or repairs the local `index.db` cache outside the `.wikg` archive.
|
|
414
|
+
- It reads chapter index artifacts from the archive and does not call an embeddings provider.
|
|
415
|
+
- If required chapter artifacts are missing, sync reports that artifact readiness problem instead of building them.
|
|
416
|
+
- Add `--skip-unindexed` only when you intentionally want the cache to include indexed chapters and ignore uncovered chapters.
|
|
417
|
+
- Archive-level query can create a missing cache from current artifacts on first use, but explicit sync avoids the first-query delay.
|
|
418
|
+
- If query reports a missing or outdated cache, run this sync command before retrying.
|
|
419
|
+
- With `--jsonl`, progress is emitted as line-delimited event records.
|
|
421
420
|
{% endif %}
|
|
422
|
-
{% elif predicate == "
|
|
423
|
-
{% if target.name == "index-object" and libraryContext.isLibraryWide %}
|
|
424
|
-
Purpose:
|
|
425
|
-
This library index does not support archive externalization.
|
|
426
|
-
|
|
427
|
-
Usage:
|
|
428
|
-
{{ commandName }} {{ uri }} enable --help
|
|
429
|
-
|
|
430
|
-
Notes:
|
|
431
|
-
- Library indexes are already local derived state under Wiki Graph staging.
|
|
432
|
-
- Use `enable` to build the library index or `disable` to remove it.
|
|
433
|
-
{% else %}
|
|
421
|
+
{% elif predicate == "clean" and target.name == "index-object" %}
|
|
434
422
|
Purpose:
|
|
435
|
-
|
|
423
|
+
Delete this index cache.
|
|
436
424
|
|
|
437
425
|
Usage:
|
|
438
|
-
{{ commandName }} {{ uri }}
|
|
426
|
+
{{ commandName }} {{ uri }} clean [--json]
|
|
439
427
|
|
|
440
428
|
Notes:
|
|
441
|
-
- This
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
- Run `{{ commandName }} {{ uri }} enable` to build or repair local query support after switching to external storage.
|
|
445
|
-
{% endif %}
|
|
429
|
+
- This removes local `index.db` cache data only.
|
|
430
|
+
- It does not delete chapter index artifacts, Knowledge Graph, Reading Graph, Summary, source text, or library membership.
|
|
431
|
+
- Archive query can recreate an archive cache from artifacts when the selected scope supports lazy cache creation.
|
|
446
432
|
{% elif predicate == "clean" %}
|
|
447
433
|
Purpose:
|
|
448
434
|
Remove completed local generation jobs.
|
|
@@ -475,6 +461,11 @@ Purpose:
|
|
|
475
461
|
|
|
476
462
|
Usage:
|
|
477
463
|
{{ commandName }} {{ uri }} resume
|
|
464
|
+
|
|
465
|
+
Notes:
|
|
466
|
+
- Paused jobs move back to queued.
|
|
467
|
+
- Queued jobs are already resumable work; `resume` leaves them queued and asks the local worker to pick up the queue.
|
|
468
|
+
- Finished, failed, canceled, and canceling jobs cannot be resumed.
|
|
478
469
|
{% elif predicate == "cancel" %}
|
|
479
470
|
Purpose:
|
|
480
471
|
Cancel this local job.
|
|
@@ -522,6 +513,14 @@ Keys:
|
|
|
522
513
|
- baseURL: non-empty provider base URL string
|
|
523
514
|
- name: non-empty display name
|
|
524
515
|
- apiKey: secret; use `--secret`
|
|
516
|
+
{% elif "/embeddings" in uri %}
|
|
517
|
+
Keys:
|
|
518
|
+
- provider: openai or openai-compatible
|
|
519
|
+
- model: non-empty embedding model name
|
|
520
|
+
- baseURL: non-empty provider base URL string
|
|
521
|
+
- name: non-empty display name
|
|
522
|
+
- dimensions: positive integer; numeric strings are normalized to numbers
|
|
523
|
+
- apiKey: secret; use `--secret`
|
|
525
524
|
{% elif "/wikispine" in uri %}
|
|
526
525
|
Keys:
|
|
527
526
|
- provider: fetch or cli
|
|
@@ -535,14 +534,24 @@ Notes:
|
|
|
535
534
|
- Positional `<value>` is stored as a string.
|
|
536
535
|
- `--json-input` stores a JSON value and is useful for numeric config sections.
|
|
537
536
|
- `--json` controls output shape; it is not JSON input.
|
|
538
|
-
{% if "/llm" in uri %}
|
|
537
|
+
{% if "/llm" in uri or "/embeddings" in uri %}
|
|
539
538
|
- `--secret` reads the value from an interactive terminal without echoing it; use it for `apiKey`.
|
|
540
539
|
{% endif %}
|
|
541
540
|
- Success output is the full section JSON with sensitive values masked.
|
|
542
541
|
{% endif %}
|
|
543
542
|
{% endif %}
|
|
544
543
|
{% elif predicate == "delete" %}
|
|
545
|
-
{% if target.name == "
|
|
544
|
+
{% if target.name == "chapter-index-artifact" %}
|
|
545
|
+
Purpose:
|
|
546
|
+
Delete this chapter index artifact.
|
|
547
|
+
|
|
548
|
+
Usage:
|
|
549
|
+
{{ commandName }} {{ uri }} delete [--json]
|
|
550
|
+
|
|
551
|
+
Notes:
|
|
552
|
+
- This deletes the stored artifact from the `.wikg` archive.
|
|
553
|
+
- It does not clean external `index.db` cache by itself; sync or clean the archive/library index cache after deleting artifacts.
|
|
554
|
+
{% elif target.name == "metadata-object" %}
|
|
546
555
|
Purpose:
|
|
547
556
|
Delete one metadata key.
|
|
548
557
|
|
|
@@ -584,6 +593,7 @@ Notes:
|
|
|
584
593
|
- This does not contact an external service.
|
|
585
594
|
{% else %}
|
|
586
595
|
- For `llm`, this sends a small request to the configured model.
|
|
596
|
+
- For `embeddings`, this sends a small embedding request and reports the returned vector dimensions.
|
|
587
597
|
- For `wikispine`, this checks the built-in fetch service or local `wikispine` command.
|
|
588
598
|
{% endif %}
|
|
589
599
|
- Text success output is intentionally short.
|
|
@@ -598,7 +608,7 @@ Notes:
|
|
|
598
608
|
Library context:
|
|
599
609
|
- This predicate runs through a library URI, not a standalone `.wikg` locator.
|
|
600
610
|
{% if libraryContext.isLibraryWide %}
|
|
601
|
-
- Library-wide object predicates use the aggregate library index and may fail when that index is missing,
|
|
611
|
+
- Library-wide object predicates use the aggregate library index and may fail when that index is missing, stale, or not ready.
|
|
602
612
|
- Interpret results with the returned archive/member provenance; cite the specific returned evidence or member.
|
|
603
613
|
{% endif %}
|
|
604
614
|
{% if target.name == "chapter-collection-scope" or target.name == "chapter-scope" or target.name == "chapter-source-object" or target.name == "chapter-summary-object" or target.name == "chapter-title-object" or target.name == "chapter-tree-object" or target.name == "chapter-state-object" %}
|
|
@@ -619,7 +629,7 @@ Library context:
|
|
|
619
629
|
Related help:
|
|
620
630
|
- {{ commandName }} {{ uri }} --help
|
|
621
631
|
- {{ commandName }} help uri
|
|
622
|
-
{% if predicate == "related" or predicate == "evidence" or predicate == "pack" or
|
|
632
|
+
{% if predicate == "related" or predicate == "evidence" or predicate == "pack" or target.name == "index-object" or target.name == "chapter-index-artifact" or target.name == "job-collection-scope" %}
|
|
623
633
|
- {{ commandName }} help readiness
|
|
624
634
|
{% endif %}
|
|
625
635
|
{% if predicate == "create" or predicate == "export" %}
|
|
@@ -22,7 +22,7 @@ Knowledge-base contents:
|
|
|
22
22
|
- Reading Graph: attention chunks that preserve source-backed reading context.
|
|
23
23
|
- Summaries: compressed reading outputs for chapters or archive scopes.
|
|
24
24
|
- Source text: original chapter content and source ranges.
|
|
25
|
-
These structures are URI-addressed and can be retrieved
|
|
25
|
+
These structures are URI-addressed and can be retrieved through the search index.
|
|
26
26
|
|
|
27
27
|
Required first step for Agents:
|
|
28
28
|
If you receive an unfamiliar archive, inspect it before querying, generating, or editing:
|
|
@@ -12,7 +12,9 @@ URI type:
|
|
|
12
12
|
|
|
13
13
|
Default behavior:
|
|
14
14
|
- `{{ commandName }} {{ uri }}` enumerates archive-level objects.
|
|
15
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
15
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval across archive scopes.
|
|
16
|
+
- Broad query results are bucketed by object family: chapter/title hits, graph objects, chunks, then text streams.
|
|
17
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
16
18
|
|
|
17
19
|
Use when:
|
|
18
20
|
- You need the archive entry point before narrowing to chapters, chunks, entities, triples, source, or summaries.
|
|
@@ -28,7 +30,8 @@ URI type:
|
|
|
28
30
|
|
|
29
31
|
Default behavior:
|
|
30
32
|
- `{{ commandName }} {{ uri }}` enumerates chapters.
|
|
31
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
33
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to chapter objects.
|
|
34
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
32
35
|
- Chapter collection scope covers the full chapter tree by default; use `--depth 0` for root-level chapters only.
|
|
33
36
|
- Chapter path URIs are the public CLI handles; internal chapter ids are not command targets.
|
|
34
37
|
|
|
@@ -40,7 +43,9 @@ URI type:
|
|
|
40
43
|
|
|
41
44
|
Default behavior:
|
|
42
45
|
- `{{ commandName }} {{ uri }}` enumerates objects inside this chapter subtree.
|
|
43
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
46
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval inside this chapter subtree.
|
|
47
|
+
- Broad query results are bucketed by object family: chapter/title hits, graph objects, chunks, then text streams.
|
|
48
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
44
49
|
- Use `--depth 0` to restrict the scope to this chapter only; `--depth 1` includes direct children.
|
|
45
50
|
- The path in this URI is the public CLI handle for the chapter; internal chapter ids are not command targets.
|
|
46
51
|
|
|
@@ -52,7 +57,8 @@ URI type:
|
|
|
52
57
|
|
|
53
58
|
Default behavior:
|
|
54
59
|
- `{{ commandName }} {{ uri }}` enumerates Reading Graph chunks.
|
|
55
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
60
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to chunks in this scope.
|
|
61
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
56
62
|
{% if uriContext.isChapterQualified %}
|
|
57
63
|
- This chapter-qualified scope covers the selected chapter subtree by default.
|
|
58
64
|
- Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
|
|
@@ -69,7 +75,8 @@ URI type:
|
|
|
69
75
|
|
|
70
76
|
Default behavior:
|
|
71
77
|
- `{{ commandName }} {{ uri }}` enumerates Knowledge Graph entities.
|
|
72
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
78
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to entities in this scope.
|
|
79
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
73
80
|
{% if uriContext.isChapterQualified %}
|
|
74
81
|
- This chapter-qualified scope covers the selected chapter subtree by default.
|
|
75
82
|
- Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
|
|
@@ -86,7 +93,8 @@ URI type:
|
|
|
86
93
|
|
|
87
94
|
Default behavior:
|
|
88
95
|
- `{{ commandName }} {{ uri }}` enumerates Knowledge Graph triples matching this scope or pattern.
|
|
89
|
-
- `{{ commandName }} {{ uri }} --query <query>` applies
|
|
96
|
+
- `{{ commandName }} {{ uri }} --query <query>` applies search index retrieval to triples in this scope.
|
|
97
|
+
- Query is strict by default; add `--skip-unindexed` only to intentionally search indexed chapters and ignore uncovered chapters.
|
|
90
98
|
{% if uriContext.isChapterQualified %}
|
|
91
99
|
- This chapter-qualified scope covers the selected chapter subtree by default.
|
|
92
100
|
- Use `--depth 0` for only the selected chapter, or `--depth 1` for the selected chapter plus direct children.
|
|
@@ -129,6 +137,7 @@ Default behavior:
|
|
|
129
137
|
- Summary range fragments such as `#4..8` read sentence numbers 4 through 8, inclusive.
|
|
130
138
|
- Range sentence numbers are 1-based. `#1` is the first sentence; `#1..2` is the first two sentences.
|
|
131
139
|
- Whole summary reads are plain text streams and do not support `--json`; summary range fragments are structured range objects and support `--json`.
|
|
140
|
+
- Summary readiness means a summary object exists and is current for the chapter source. It does not guarantee the prose answers every question about the chapter.
|
|
132
141
|
|
|
133
142
|
Use when:
|
|
134
143
|
- You need compact readable prose before tracing source evidence.
|
|
@@ -170,6 +179,17 @@ Default behavior:
|
|
|
170
179
|
|
|
171
180
|
Use when:
|
|
172
181
|
- You need to know whether source, Reading Graph, Reading Summary, or Knowledge Graph data exists for a chapter.
|
|
182
|
+
{% elif target.name == "chapter-index-artifact" %}
|
|
183
|
+
URI type:
|
|
184
|
+
Chapter index artifact object
|
|
185
|
+
|
|
186
|
+
Default behavior:
|
|
187
|
+
- `{{ commandName }} {{ uri }}` reads this chapter index artifact status and summary.
|
|
188
|
+
|
|
189
|
+
Use when:
|
|
190
|
+
- You need to build or delete one chapter-level index artifact stored in the `.wikg` archive.
|
|
191
|
+
- Use `/index/fts` for lexical retrieval, `/index/embedding/source` for Dense source retrieval, or `/index/embedding/summary` for Dense summary retrieval.
|
|
192
|
+
- Build enqueues a local job; read the returned job status or watch the job before assuming the artifact is ready.
|
|
173
193
|
{% elif target.name == "chunk-object" %}
|
|
174
194
|
URI type:
|
|
175
195
|
Chunk object
|
|
@@ -217,20 +237,21 @@ Use when:
|
|
|
217
237
|
- You need to redirect or pipe the cover resource.
|
|
218
238
|
{% elif target.name == "index-object" %}
|
|
219
239
|
URI type:
|
|
220
|
-
Index object
|
|
240
|
+
Index cache object
|
|
221
241
|
|
|
222
242
|
Default behavior:
|
|
223
|
-
- `{{ commandName }} {{ uri }}` reads
|
|
224
|
-
-
|
|
243
|
+
- `{{ commandName }} {{ uri }}` reads index cache status and capabilities.
|
|
244
|
+
- Chapter-level `/index/...` URIs manage index artifacts. Archive and library `/index` URIs manage derived cache.
|
|
225
245
|
|
|
226
246
|
Use when:
|
|
227
|
-
- You need to inspect
|
|
247
|
+
- You need to inspect, sync, or clean query cache materialization.
|
|
228
248
|
{% elif target.name == "job-collection-scope" %}
|
|
229
249
|
URI type:
|
|
230
250
|
Local job collection scope
|
|
231
251
|
|
|
232
252
|
Default behavior:
|
|
233
253
|
- `{{ commandName }} {{ uri }}` shows local generation jobs.
|
|
254
|
+
- Use `--json` for a machine-readable job list. Job list does not support `--jsonl`; `watch --jsonl` is the streaming job interface.
|
|
234
255
|
|
|
235
256
|
Use when:
|
|
236
257
|
- You need to inspect, add, or clean local generation jobs.
|
|
@@ -268,6 +289,7 @@ Use when:
|
|
|
268
289
|
|
|
269
290
|
Sections:
|
|
270
291
|
- `{{ commandName }} wikg://local/config/llm --help`
|
|
292
|
+
- `{{ commandName }} wikg://local/config/embeddings --help`
|
|
271
293
|
- `{{ commandName }} wikg://local/config/concurrent --help`
|
|
272
294
|
- `{{ commandName }} wikg://local/config/wikispine --help`
|
|
273
295
|
{% elif target.name == "local-config-section" %}
|
|
@@ -279,6 +301,9 @@ Default behavior:
|
|
|
279
301
|
|
|
280
302
|
Use when:
|
|
281
303
|
- You need to read, replace, edit, clear, or test local configuration.
|
|
304
|
+
{% if "/embeddings" in uri %}
|
|
305
|
+
- This section is used by Dense embedding artifact builds and Dense query embeddings.
|
|
306
|
+
{% endif %}
|
|
282
307
|
{% if "/wikispine" in uri %}
|
|
283
308
|
|
|
284
309
|
WikiSpine runtime guide:
|
|
@@ -357,10 +382,16 @@ Predicate commands:
|
|
|
357
382
|
{% endif %}
|
|
358
383
|
{% elif predicate == "boost" %}
|
|
359
384
|
- boost: move a waiting job forward. Help: {{ commandName }} {{ uri }} boost --help
|
|
385
|
+
{% elif predicate == "build" %}
|
|
386
|
+
- build: build or replace this chapter index artifact. Help: {{ commandName }} {{ uri }} build --help
|
|
360
387
|
{% elif predicate == "cancel" %}
|
|
361
388
|
- cancel: cancel a local job. Help: {{ commandName }} {{ uri }} cancel --help
|
|
362
389
|
{% elif predicate == "clean" %}
|
|
390
|
+
{% if target.name == "index-object" %}
|
|
391
|
+
- clean: remove derived index cache materialization. Help: {{ commandName }} {{ uri }} clean --help
|
|
392
|
+
{% else %}
|
|
363
393
|
- clean: remove completed local jobs. Help: {{ commandName }} {{ uri }} clean --help
|
|
394
|
+
{% endif %}
|
|
364
395
|
{% elif predicate == "clear" %}
|
|
365
396
|
{% if target.name == "metadata-object" %}
|
|
366
397
|
- clear: clear this metadata map. Help: {{ commandName }} {{ uri }} clear --help
|
|
@@ -370,23 +401,19 @@ Predicate commands:
|
|
|
370
401
|
{% elif predicate == "create" %}
|
|
371
402
|
- create: create the archive; use `--replace` only when discarding an existing archive. Help: {{ commandName }} {{ uri }} create --help
|
|
372
403
|
{% elif predicate == "delete" %}
|
|
373
|
-
{% if target.name == "
|
|
404
|
+
{% if target.name == "chapter-index-artifact" %}
|
|
405
|
+
- delete: delete this chapter index artifact. Help: {{ commandName }} {{ uri }} delete --help
|
|
406
|
+
{% elif target.name == "metadata-object" %}
|
|
374
407
|
- delete: delete one metadata key. Help: {{ commandName }} {{ uri }} delete --help
|
|
375
408
|
{% else %}
|
|
376
409
|
- delete: delete a config key. Help: {{ commandName }} {{ uri }} delete --help
|
|
377
410
|
{% endif %}
|
|
378
|
-
{% elif predicate == "disable" %}
|
|
379
|
-
- disable: disable searchable index support and remove index materialization. Help: {{ commandName }} {{ uri }} disable --help
|
|
380
|
-
{% elif predicate == "embed" %}
|
|
381
|
-
- embed: use archive-embedded searchable index storage. Help: {{ commandName }} {{ uri }} embed --help
|
|
382
|
-
{% elif predicate == "enable" %}
|
|
383
|
-
- enable: enable searchable index support and bring it to current. Help: {{ commandName }} {{ uri }} enable --help
|
|
384
411
|
{% elif predicate == "evidence" %}
|
|
385
412
|
- evidence: trace this object to source-backed evidence; supports `--reverse` without `--query`. Help: {{ commandName }} {{ uri }} evidence --help
|
|
386
413
|
{% elif predicate == "export" %}
|
|
387
414
|
- export: export an archive projection. Help: {{ commandName }} {{ uri }} export --help
|
|
388
|
-
{% elif predicate == "
|
|
389
|
-
-
|
|
415
|
+
{% elif predicate == "sync" %}
|
|
416
|
+
- sync: rebuild derived index cache from chapter index artifacts. Help: {{ commandName }} {{ uri }} sync --help
|
|
390
417
|
{% elif predicate == "inspect" %}
|
|
391
418
|
- inspect: inspect archive readiness. Help: {{ commandName }} {{ uri }} inspect --help
|
|
392
419
|
{% elif predicate == "move" %}
|