wiki-graph 0.4.1 → 0.6.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 +1360 -1017
- package/dist/cli.js.map +1 -1
- package/dist/data/help/commands/library-predicate.jinja +19 -19
- package/dist/data/help/commands/library.jinja +8 -5
- package/dist/data/help/commands/maintenance/chapter/add.jinja +2 -2
- package/dist/data/help/commands/maintenance/chapter/set-source.jinja +3 -20
- package/dist/data/help/commands/maintenance/chapter.jinja +3 -2
- package/dist/data/help/commands/maintenance/upgrade.jinja +2 -2
- package/dist/data/help/commands/maintenance.jinja +1 -1
- package/dist/data/help/commands/predicate.jinja +143 -119
- package/dist/data/help/commands/root.jinja +4 -2
- package/dist/data/help/commands/shared/chapter-source-set.jinja +21 -0
- package/dist/data/help/commands/uri.jinja +89 -23
- package/dist/data/help/topics/config.jinja +27 -0
- package/dist/data/help/topics/file-import.jinja +49 -0
- package/dist/data/help/topics/format.jinja +6 -4
- package/dist/data/help/topics/library.jinja +11 -7
- package/dist/data/help/topics/readiness.jinja +73 -34
- package/dist/data/help/topics/recipe.jinja +15 -12
- package/dist/data/help/topics/runtime.jinja +1 -1
- package/dist/data/help/topics/source-locators.jinja +45 -0
- package/dist/data/help/topics/uri.jinja +19 -4
- package/dist/gc-worker.js +508 -253
- package/dist/gc-worker.js.map +1 -1
- package/dist/index.cjs +5232 -2809
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5153 -2731
- package/dist/index.js.map +1 -1
- package/dist/queue-worker.js +1856 -647
- package/dist/queue-worker.js.map +1 -1
- package/package.json +9 -8
- package/LICENSE +0 -201
- 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
|
@@ -4,7 +4,7 @@ Command: {{ commandName }} {{ uri }} {{ predicate }}
|
|
|
4
4
|
Library Predicate Command
|
|
5
5
|
|
|
6
6
|
Target:
|
|
7
|
-
{{
|
|
7
|
+
{{ displayUri }}
|
|
8
8
|
|
|
9
9
|
Predicate:
|
|
10
10
|
{{ predicate }}
|
|
@@ -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]
|
|
@@ -22,8 +22,8 @@ Behavior:
|
|
|
22
22
|
|
|
23
23
|
Output shape:
|
|
24
24
|
Prints the new chapter status.
|
|
25
|
-
|
|
26
|
-
With `--json`,
|
|
25
|
+
`Chapter` is the archive-relative handle; `Located URI` is the complete target for later commands.
|
|
26
|
+
With `--json`, the same values are `uri` and `locatedUri`; reuse `locatedUri` for later commands.
|
|
27
27
|
|
|
28
28
|
Typical next step:
|
|
29
29
|
{{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task reading-graph --accept-cost
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
Help Type: command
|
|
2
2
|
Command: {{ commandName }} <chapter-uri>/source set
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
{{ commandName }} <chapter-uri>/source set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
|
|
9
|
-
|
|
10
|
-
Input:
|
|
11
|
-
- Source text is read from a positional value, `--input <path>`, or `--input -` for stdin.
|
|
12
|
-
|
|
13
|
-
Preconditions:
|
|
14
|
-
- The chapter must be `planned`.
|
|
15
|
-
- To replace source on a later-stage chapter, first reset it to `planned`.
|
|
16
|
-
|
|
17
|
-
Behavior:
|
|
18
|
-
- Writes normalized source text.
|
|
19
|
-
- Moves the chapter to `source`.
|
|
20
|
-
- Does not generate Reading Graph data.
|
|
21
|
-
- Does not generate or modify a summary.
|
|
22
|
-
- Does not call an LLM provider.
|
|
23
|
-
- With `--json`, prints the updated chapter status as one JSON object.
|
|
4
|
+
{% set uri = "<chapter-uri>/source" %}
|
|
5
|
+
{% include "help/commands/shared/chapter-source-set.jinja" %}
|
|
24
6
|
|
|
25
7
|
Typical next step:
|
|
26
8
|
{{ commandName }} wikg://local/job add --input <archive-uri|chapter-uri> --task reading-graph --accept-cost
|
|
27
9
|
|
|
28
10
|
See also:
|
|
11
|
+
- {{ commandName }} help file-import
|
|
29
12
|
- {{ commandName }} wikg://book.wikg/chapter/part/state --help
|
|
30
13
|
- {{ commandName }} wikg://book.wikg/chapter/part reset --help
|
|
31
14
|
- {{ commandName }} wikg://local/job --help
|
|
@@ -11,7 +11,7 @@ Usage:
|
|
|
11
11
|
{{ commandName }} <chapter-uri> move (--parent <chapter-path>|--root|--before <chapter-path>|--after <chapter-path>|--first|--last) [--llm <json>] [--help|-h]
|
|
12
12
|
{{ commandName }} <chapter-uri> remove [--recursive] [--llm <json>] [--help|-h]
|
|
13
13
|
{{ commandName }} <chapter-uri> reset --to <planned|source|reading-graph> [--llm <json>] [--help|-h]
|
|
14
|
-
{{ commandName }} <chapter-uri>/source set
|
|
14
|
+
{{ commandName }} <chapter-uri>/source set (<text>|--input <path|->) [--input-format jsonl] [--llm <json>] [--json] [--help|-h]
|
|
15
15
|
{{ commandName }} <chapter-uri>/summary set [text] [--input <path|->] [--llm <json>] [--json] [--help|-h]
|
|
16
16
|
{{ commandName }} <chapter-uri>/title set <title> [--llm <json>] [--help|-h]
|
|
17
17
|
{{ commandName }} <chapter-uri>/title clear [--llm <json>] [--help|-h]
|
|
@@ -29,7 +29,8 @@ Input rules:
|
|
|
29
29
|
- `<chapter-uri>` includes the chapter path printed by the chapter collection or `add`.
|
|
30
30
|
- `add` creates an empty planned chapter. Use this for chapter directories, groups, and drafting placeholders.
|
|
31
31
|
- `add --input <path>` creates a chapter and fills it from source text; use `--input -` for stdin.
|
|
32
|
-
- `<chapter-uri>/source set`
|
|
32
|
+
- `<chapter-uri>/source set` fills a planned chapter from one positional value or `--input <path|->`; use `--input-format jsonl` for externally extracted source provenance.
|
|
33
|
+
- `<chapter-uri>/summary set` reads a positional value, `--input <path>`, or `--input -` for stdin.
|
|
33
34
|
- `<chapter-uri>/title set <title>` renames a chapter in the tree; `<chapter-uri>/title clear` removes the explicit title.
|
|
34
35
|
- `move` changes parent/order only; it does not edit source, graph, or summary data.
|
|
35
36
|
- `tree` prints the chapter tree as JSON with `title: null` for untitled chapters.
|
|
@@ -9,7 +9,7 @@ Usage:
|
|
|
9
9
|
{{ commandName }} maintenance upgrade <path.sdpub> [--output <path.wikg>] [--json]
|
|
10
10
|
|
|
11
11
|
Targets:
|
|
12
|
-
- Home state: ~/.wikigraph
|
|
12
|
+
- Home state: home (or ~/.wikigraph)
|
|
13
13
|
- Standalone archive: ./book.wikg, /path/to/book.wikg, wikg://book.wikg, wikg:///path/to/book.wikg
|
|
14
14
|
- Legacy sdpub: ./book.sdpub, optionally with --output
|
|
15
15
|
- Library: wikg://lib or wikg://lib/<lib-id>
|
|
@@ -23,7 +23,7 @@ Notes:
|
|
|
23
23
|
- Library upgrade covers the registry and managed archive members for that library.
|
|
24
24
|
|
|
25
25
|
Examples:
|
|
26
|
-
{{ commandName }} maintenance upgrade
|
|
26
|
+
{{ commandName }} maintenance upgrade home
|
|
27
27
|
{{ commandName }} maintenance upgrade ./book.wikg
|
|
28
28
|
{{ commandName }} maintenance upgrade wikg://lib
|
|
29
29
|
{{ commandName }} maintenance upgrade ./book.sdpub --output ./book.wikg
|
|
@@ -11,7 +11,7 @@ Commands:
|
|
|
11
11
|
upgrade Upgrade home state, a .wikg archive, a library, or migrate .sdpub.
|
|
12
12
|
|
|
13
13
|
Upgrade targets:
|
|
14
|
-
{{ commandName }} maintenance upgrade
|
|
14
|
+
{{ commandName }} maintenance upgrade home
|
|
15
15
|
{{ commandName }} maintenance upgrade ./book.wikg
|
|
16
16
|
{{ commandName }} maintenance upgrade wikg://book.wikg
|
|
17
17
|
{{ commandName }} maintenance upgrade ./book.sdpub [--output ./book.wikg]
|