wiki-graph 0.3.1 → 0.4.1
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 +17 -0
- package/dist/cli.js +2221 -37548
- package/dist/cli.js.map +1 -1
- package/dist/data/editor/text_compressor.jinja +17 -13
- package/dist/data/help/commands/archive/next.jinja +7 -2
- package/dist/data/help/commands/gc.jinja +2 -1
- package/dist/data/help/commands/legacy/migrate.jinja +6 -1
- package/dist/data/help/commands/legacy.jinja +3 -2
- package/dist/data/help/commands/library-predicate.jinja +296 -0
- package/dist/data/help/commands/library.jinja +237 -0
- package/dist/data/help/commands/maintenance/chapter/add.jinja +3 -3
- package/dist/data/help/commands/maintenance/chapter/list.jinja +4 -4
- package/dist/data/help/commands/maintenance/chapter/move.jinja +4 -4
- package/dist/data/help/commands/maintenance/chapter/remove.jinja +1 -1
- package/dist/data/help/commands/maintenance/chapter/reset.jinja +1 -1
- package/dist/data/help/commands/maintenance/chapter/set-source.jinja +2 -2
- package/dist/data/help/commands/maintenance/chapter/set-summary.jinja +1 -1
- package/dist/data/help/commands/maintenance/chapter/set-title.jinja +3 -3
- package/dist/data/help/commands/maintenance/chapter/tree.jinja +6 -6
- package/dist/data/help/commands/maintenance/chapter.jinja +10 -10
- package/dist/data/help/commands/maintenance/meta.jinja +7 -7
- package/dist/data/help/commands/maintenance/upgrade.jinja +35 -0
- package/dist/data/help/commands/maintenance.jinja +23 -0
- package/dist/data/help/commands/predicate.jinja +204 -28
- package/dist/data/help/commands/root.jinja +10 -3
- package/dist/data/help/commands/uri.jinja +165 -6
- package/dist/data/help/topics/config.jinja +10 -3
- package/dist/data/help/topics/library.jinja +90 -0
- package/dist/data/help/topics/readiness.jinja +32 -2
- package/dist/data/help/topics/recipe.jinja +42 -17
- package/dist/data/help/topics/runtime.jinja +20 -3
- package/dist/data/help/topics/uri.jinja +53 -25
- package/dist/gc-worker.d.ts +1 -0
- package/dist/gc-worker.js +548 -0
- package/dist/gc-worker.js.map +1 -0
- package/dist/index.cjs +12678 -33444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -2649
- package/dist/index.d.ts +36 -2649
- package/dist/index.js +12901 -33331
- package/dist/index.js.map +1 -1
- package/dist/queue-worker.js +1367 -24052
- package/dist/queue-worker.js.map +1 -1
- package/package.json +15 -3
|
@@ -26,11 +26,11 @@ Your compressed text must fall within the acceptable range. Going over the maxim
|
|
|
26
26
|
- Natural expression (sound native in {{ user_language }}, not machine-translated)
|
|
27
27
|
- Terminology consistency (technical terms and proper nouns should be accurately rendered)
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
Apply these constraints silently:
|
|
30
|
+
- Understand the marked content in whatever language(s) it uses.
|
|
31
|
+
- Compress according to retention levels (`verbatim`, `detailed`, etc.).
|
|
32
|
+
- Translate the compressed result to {{ user_language }}.
|
|
33
|
+
- Ensure the output reads naturally in {{ user_language }}.
|
|
34
34
|
|
|
35
35
|
**Important Notes:**
|
|
36
36
|
- The input text may be in any language or mix of languages (e.g., an English book with French quotes)
|
|
@@ -46,6 +46,14 @@ Your compressed text must fall within the acceptable range. Going over the maxim
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
+
## Response Protocol (MUST FOLLOW)
|
|
50
|
+
|
|
51
|
+
Return exactly one XML block matching this shape and nothing else: `<final>...</final>`
|
|
52
|
+
|
|
53
|
+
The content inside `<final>` is the only user-visible compressed content. Do not put any extra text before or after this block. Do not use Markdown fences, headings, separators, explanations, processing notes, or prefaces.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
49
57
|
## Format Requirements (MUST FOLLOW)
|
|
50
58
|
|
|
51
59
|
### 1. Remove ALL `<chunk>` tags from your output
|
|
@@ -61,9 +69,9 @@ The input text contains `<chunk>` markup tags like this:
|
|
|
61
69
|
- ❌ WRONG: `<chunk retention="detailed">比如刮风啊...</chunk>`
|
|
62
70
|
- ✅ CORRECT: `比如刮风啊...`
|
|
63
71
|
|
|
64
|
-
### 2.
|
|
72
|
+
### 2. The content inside `<final>` must be plain text only
|
|
65
73
|
|
|
66
|
-
|
|
74
|
+
Inside `<final>`, do NOT add:
|
|
67
75
|
- Section headers (like "## Compressed Text")
|
|
68
76
|
- XML/HTML markup of any kind
|
|
69
77
|
- Explanatory comments mixed with the content
|
|
@@ -89,7 +97,7 @@ Your output should read like a natural excerpt from a longer article.
|
|
|
89
97
|
- Delete entire paragraphs if they don't have markup
|
|
90
98
|
- Only keep ultra-short transitions if absolutely necessary (e.g., "三年后", "1344年", "此时")
|
|
91
99
|
|
|
92
|
-
###
|
|
100
|
+
### Compression priority:
|
|
93
101
|
|
|
94
102
|
1. **First, preserve all marked content** (`<chunk>` tags) - this is your priority
|
|
95
103
|
2. **Then, delete most unmarked text** - this is where you achieve compression
|
|
@@ -120,8 +128,4 @@ You are compressing a **segment** of a larger work (like part of a book chapter)
|
|
|
120
128
|
|
|
121
129
|
## Output Format
|
|
122
130
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
[Your compressed text - plain text only, no headers, no tags, written as continuous prose]
|
|
131
|
+
Return exactly this XML shape with no Markdown code fence: `<final>Your compressed text - plain text only, no headers, no tags, written as continuous prose</final>`
|
|
@@ -10,20 +10,25 @@ Use when:
|
|
|
10
10
|
|
|
11
11
|
Usage:
|
|
12
12
|
{{ commandName }} next <cursor> [--limit <n>] [--json|--jsonl] [--help|-h]
|
|
13
|
-
{{ commandName }} next <
|
|
13
|
+
{{ commandName }} next <uri> <cursor> [--limit <n>] [--json|--jsonl] [--help|-h]
|
|
14
14
|
|
|
15
15
|
Returns:
|
|
16
16
|
- The next result page for the cursor.
|
|
17
17
|
|
|
18
18
|
Notes:
|
|
19
19
|
- Cursors are opaque short tokens stored in local Wiki Graph state.
|
|
20
|
-
-
|
|
20
|
+
- A cursor stores the index scope that produced it, such as a standalone archive index or a library index.
|
|
21
|
+
- Passing `<uri>` is optional; when provided, it is used only as a safety check and must match the cursor's stored index scope.
|
|
22
|
+
- Library cursors re-check that the library index is still current before continuing.
|
|
21
23
|
- Use `--limit` to override the next page size.
|
|
22
24
|
|
|
23
25
|
Examples:
|
|
24
26
|
{{ commandName }} next c_7Kp9x2aQ
|
|
25
27
|
{{ commandName }} next wikg:///books/book.wikg c_7Kp9x2aQ
|
|
28
|
+
{{ commandName }} next wikg://lib c_7Kp9x2aQ
|
|
26
29
|
|
|
27
30
|
Related help:
|
|
28
31
|
- URI scopes, pagination, JSON, and JSONL result shapes:
|
|
29
32
|
{{ commandName }} help uri
|
|
33
|
+
- Library cursor scope and aggregate index freshness:
|
|
34
|
+
{{ commandName }} help library
|
|
@@ -21,10 +21,11 @@ Options:
|
|
|
21
21
|
|
|
22
22
|
Managed areas:
|
|
23
23
|
- Wiki Graph coordinator workspace files and cached SQLite databases.
|
|
24
|
-
- Search query cache
|
|
24
|
+
- Search query cache and expired continuation cursor state under `~/.wikigraph/cache`.
|
|
25
25
|
- Expired Wikipedia page cache.
|
|
26
26
|
- Completed build job records and their durable event, cache, log, and workspace files.
|
|
27
27
|
- Wiki Graph controlled temporary directories under the state directory.
|
|
28
|
+
- Orphaned library aggregate index staging that is no longer tied to a registered library.
|
|
28
29
|
|
|
29
30
|
Output:
|
|
30
31
|
Text output reports scanned resources, removed resources, and freed disk space.
|
|
@@ -2,7 +2,10 @@ Help Type: command
|
|
|
2
2
|
Command: {{ commandName }} legacy migrate
|
|
3
3
|
|
|
4
4
|
Purpose:
|
|
5
|
-
|
|
5
|
+
Deprecated alias for converting an `.sdpub` archive into the current `.wikg` format.
|
|
6
|
+
|
|
7
|
+
Deprecated:
|
|
8
|
+
Use `{{ commandName }} maintenance upgrade <path.sdpub>` instead.
|
|
6
9
|
|
|
7
10
|
Usage:
|
|
8
11
|
{{ commandName }} legacy migrate <path.sdpub> [--output <path.wikg>]
|
|
@@ -16,5 +19,7 @@ Examples:
|
|
|
16
19
|
{{ commandName }} legacy migrate ./book.sdpub --output ./book.wikg
|
|
17
20
|
|
|
18
21
|
Related help:
|
|
22
|
+
- Current maintenance upgrade entry point:
|
|
23
|
+
{{ commandName }} maintenance upgrade --help
|
|
19
24
|
- Current archive format, create/import, and export boundaries:
|
|
20
25
|
{{ commandName }} help format
|
|
@@ -2,18 +2,19 @@ Help Type: command
|
|
|
2
2
|
Command: {{ commandName }} legacy
|
|
3
3
|
|
|
4
4
|
Purpose:
|
|
5
|
-
|
|
5
|
+
Deprecated compatibility entry point for `.sdpub` upgrade.
|
|
6
6
|
|
|
7
7
|
Usage:
|
|
8
8
|
{{ commandName }} legacy migrate <path.sdpub> [--output <path.wikg>]
|
|
9
9
|
|
|
10
10
|
Commands:
|
|
11
|
-
migrate
|
|
11
|
+
migrate Deprecated alias for `{{ commandName }} maintenance upgrade <path.sdpub>`.
|
|
12
12
|
|
|
13
13
|
Examples:
|
|
14
14
|
{{ commandName }} legacy migrate ./book.sdpub
|
|
15
15
|
{{ commandName }} legacy migrate ./book.sdpub --output ./book.wikg
|
|
16
16
|
|
|
17
17
|
See Also:
|
|
18
|
+
{{ commandName }} maintenance upgrade --help
|
|
18
19
|
{{ commandName }} legacy migrate --help
|
|
19
20
|
{{ commandName }} help format
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
Help Type: command
|
|
2
|
+
Command: {{ commandName }} {{ uri }} {{ predicate }}
|
|
3
|
+
|
|
4
|
+
Library Predicate Command
|
|
5
|
+
|
|
6
|
+
Target:
|
|
7
|
+
{{ uri }}
|
|
8
|
+
|
|
9
|
+
Predicate:
|
|
10
|
+
{{ predicate }}
|
|
11
|
+
|
|
12
|
+
{% if target.kind == "registry" and predicate == "add" %}
|
|
13
|
+
Purpose:
|
|
14
|
+
Create a non-default library registry and create its empty library folder.
|
|
15
|
+
|
|
16
|
+
Usage:
|
|
17
|
+
{{ commandName }} wikg://lib/registry add --path <folder> [--json]
|
|
18
|
+
|
|
19
|
+
Notes:
|
|
20
|
+
- The folder must not already exist; the command creates it as an empty directory.
|
|
21
|
+
- Text output is the new public library URI. With `--json`, output includes the public id, URI, folder path, default marker, staging path, and timestamps.
|
|
22
|
+
{% elif target.kind == "registry" and predicate == "list" %}
|
|
23
|
+
Purpose:
|
|
24
|
+
List all library registries.
|
|
25
|
+
|
|
26
|
+
Usage:
|
|
27
|
+
{{ commandName }} wikg://lib/registry [--json]
|
|
28
|
+
{% elif target.kind == "path" and predicate == "get" %}
|
|
29
|
+
Purpose:
|
|
30
|
+
Read this library folder path.
|
|
31
|
+
|
|
32
|
+
Usage:
|
|
33
|
+
{{ commandName }} {{ uri }} [--json]
|
|
34
|
+
{% elif target.kind == "path" and predicate == "set" %}
|
|
35
|
+
Purpose:
|
|
36
|
+
Bind this library to an existing directory, then scan/reconcile `.wikg` files in that directory.
|
|
37
|
+
|
|
38
|
+
Usage:
|
|
39
|
+
{{ commandName }} {{ uri }} set <folder> [--json|--jsonl]
|
|
40
|
+
|
|
41
|
+
Notes:
|
|
42
|
+
- The command updates only this library registry's folder path.
|
|
43
|
+
- With `--jsonl`, it streams started/progress/completed events.
|
|
44
|
+
{% elif target.kind == "archive-collection" and predicate == "add" %}
|
|
45
|
+
Purpose:
|
|
46
|
+
Copy a `.wikg` archive into this library folder and register it as a managed archive member.
|
|
47
|
+
|
|
48
|
+
Usage:
|
|
49
|
+
{{ commandName }} {{ uri }} add --input <path> [--to <relative-wikg-path>] [--json]
|
|
50
|
+
{% elif target.kind == "archive-collection" and predicate == "scan" %}
|
|
51
|
+
Purpose:
|
|
52
|
+
Reconcile this library registry with `.wikg` files currently under the library folder.
|
|
53
|
+
|
|
54
|
+
Usage:
|
|
55
|
+
{{ commandName }} {{ uri }} scan [--json|--jsonl]
|
|
56
|
+
|
|
57
|
+
Notes:
|
|
58
|
+
- With `--jsonl`, it streams started/progress/completed events.
|
|
59
|
+
{% elif target.kind == "archive-tree" and predicate == "archive-tree" %}
|
|
60
|
+
Purpose:
|
|
61
|
+
Show the archive member file tree.
|
|
62
|
+
|
|
63
|
+
Usage:
|
|
64
|
+
{{ commandName }} {{ uri }} [--parent <relative-path>] [--depth <n>] [--json]
|
|
65
|
+
|
|
66
|
+
Notes:
|
|
67
|
+
- `--parent` accepts a directory or concrete `.wikg` file and preserves ancestor nodes.
|
|
68
|
+
- `--depth` is calculated from the library scope root.
|
|
69
|
+
- This target is read-only and does not support `set` or `apply`.
|
|
70
|
+
{% elif target.kind == "archive-path" and predicate == "get" %}
|
|
71
|
+
Purpose:
|
|
72
|
+
Read this archive member's relative `.wikg` path.
|
|
73
|
+
|
|
74
|
+
Usage:
|
|
75
|
+
{{ commandName }} {{ uri }} [--json]
|
|
76
|
+
{% elif target.kind == "archive-path" and predicate == "set" %}
|
|
77
|
+
Purpose:
|
|
78
|
+
Move or rename this managed archive inside the same library folder.
|
|
79
|
+
|
|
80
|
+
Usage:
|
|
81
|
+
{{ commandName }} {{ uri }} set <relative-wikg-path> [--json]
|
|
82
|
+
{% elif target.kind == "scope" and predicate == "create" %}
|
|
83
|
+
Purpose:
|
|
84
|
+
Create a non-default library registry and create its empty library folder.
|
|
85
|
+
|
|
86
|
+
Usage:
|
|
87
|
+
{{ commandName }} wikg://lib/registry add --path <folder> [--json]
|
|
88
|
+
|
|
89
|
+
Notes:
|
|
90
|
+
- Create libraries from the registry collection, `wikg://lib/registry`.
|
|
91
|
+
- `<folder>` must not already exist; the command creates it as an empty directory.
|
|
92
|
+
- The folder is not scanned, and contained `.wikg` files are not registered in this stage.
|
|
93
|
+
- Registry data is stored in the global core database, not in the library folder.
|
|
94
|
+
- Text output is the new public library URI. With `--json`, output includes the public id, URI, folder path, default marker, staging path, and timestamps.
|
|
95
|
+
- Save the emitted URI or public id if you need to address this non-default library later.
|
|
96
|
+
- List all library registries with `{{ commandName }} wikg://lib/registry`.
|
|
97
|
+
|
|
98
|
+
Examples:
|
|
99
|
+
{{ commandName }} wikg://lib/registry add --path ./research-library
|
|
100
|
+
{{ commandName }} wikg://lib/registry add --path ./research-library --json
|
|
101
|
+
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "get" %}
|
|
102
|
+
Purpose:
|
|
103
|
+
Read this library index status.
|
|
104
|
+
|
|
105
|
+
Usage:
|
|
106
|
+
{{ commandName }} {{ uri }} [--json]
|
|
107
|
+
|
|
108
|
+
Notes:
|
|
109
|
+
- The status tells whether the library index is current, dirty, missing, or disabled.
|
|
110
|
+
- Library-wide object `--query` and object scope enumeration require a current library index.
|
|
111
|
+
- Run `enable` when the status says the index needs to be built or rebuilt.
|
|
112
|
+
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "enable" %}
|
|
113
|
+
Purpose:
|
|
114
|
+
Build or rebuild this library's aggregate search index.
|
|
115
|
+
|
|
116
|
+
Usage:
|
|
117
|
+
{{ commandName }} {{ uri }} enable [--jsonl]
|
|
118
|
+
|
|
119
|
+
Notes:
|
|
120
|
+
- This is a full rebuild from registered present archives.
|
|
121
|
+
- Missing or unreadable library archive members are skipped and reported.
|
|
122
|
+
- Progress is emitted as text by default, or line-delimited events with `--jsonl`.
|
|
123
|
+
- `--json` is not supported for enable because progress is streamed.
|
|
124
|
+
- Library indexes are local derived state under Wiki Graph staging, not files inside the library folder.
|
|
125
|
+
- Rebuild holds the library write lock; concurrent `arc scan`, `arc add`, `path set`, `disable`, archive `path set`, or archive `remove` commands for the same library cannot run at the same time.
|
|
126
|
+
- Archive writes can mark the aggregate index dirty; rebuild again before relying on library-wide query when status reports dirty or stale.
|
|
127
|
+
{% elif target.kind == "scope" and target.objectUri == "wikg://index" and predicate == "disable" %}
|
|
128
|
+
Purpose:
|
|
129
|
+
Disable this library index and remove its current local materialization.
|
|
130
|
+
|
|
131
|
+
Usage:
|
|
132
|
+
{{ commandName }} {{ uri }} disable [--json]
|
|
133
|
+
|
|
134
|
+
Notes:
|
|
135
|
+
- This does not delete the library registry, metadata, folder, or managed `.wikg` archives.
|
|
136
|
+
- Library-wide object `--query` and object scope enumeration will fail until the index is enabled again.
|
|
137
|
+
- Library indexes do not support archive-style `embed` or `external` modes.
|
|
138
|
+
- Disable holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
|
|
139
|
+
{% elif target.kind == "scope" and predicate == "add" %}
|
|
140
|
+
Purpose:
|
|
141
|
+
Copy a `.wikg` archive into this library folder and register it as a managed archive member.
|
|
142
|
+
|
|
143
|
+
Usage:
|
|
144
|
+
{{ commandName }} {{ uri }} add --input <path> [--to <relative-wikg-path>] [--json]
|
|
145
|
+
|
|
146
|
+
Notes:
|
|
147
|
+
- `--input` is a normal filesystem path, not a `wikg://` archive URI.
|
|
148
|
+
- Without `--to`, the archive is copied to the library folder using its basename.
|
|
149
|
+
- `--to` must be a relative `.wikg` path inside the library folder.
|
|
150
|
+
- Parent directories for `--to` are created as needed.
|
|
151
|
+
- Existing target files are not overwritten.
|
|
152
|
+
- Adding an archive marks the library index dirty.
|
|
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
|
+
{% elif target.kind == "scope" and predicate == "scan" %}
|
|
155
|
+
Purpose:
|
|
156
|
+
Reconcile this library registry with `.wikg` files currently under the library folder.
|
|
157
|
+
|
|
158
|
+
Usage:
|
|
159
|
+
{{ commandName }} {{ uri }} scan [--json]
|
|
160
|
+
|
|
161
|
+
Notes:
|
|
162
|
+
- Scan recursively discovers `.wikg` files in the bound library folder.
|
|
163
|
+
- Registered files that are no longer present remain visible as missing/stale instead of being deleted silently.
|
|
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 marks the library index dirty when membership changes.
|
|
166
|
+
- Scan holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
|
|
167
|
+
{% elif target.kind == "scope" and predicate == "get" %}
|
|
168
|
+
Purpose:
|
|
169
|
+
Read this library scope.
|
|
170
|
+
|
|
171
|
+
Usage:
|
|
172
|
+
{{ commandName }} {{ uri }} get [--json]
|
|
173
|
+
|
|
174
|
+
Notes:
|
|
175
|
+
- For a bare library URI, this reads the same membership listing as the default command.
|
|
176
|
+
- For concrete library-wide objects such as `{{ uri }}/entity/<qid>`, use the object URI directly or ask that URI for help.
|
|
177
|
+
- This is not a list of all library registries; use known `wikg://lib/<lib-id>` URIs for non-default libraries.
|
|
178
|
+
{% elif target.kind == "scope" and predicate == "list" %}
|
|
179
|
+
Purpose:
|
|
180
|
+
This library scope does not expose an archive membership flat list.
|
|
181
|
+
|
|
182
|
+
Usage:
|
|
183
|
+
{{ commandName }} {{ uri }} [--json]
|
|
184
|
+
|
|
185
|
+
Notes:
|
|
186
|
+
- Use `{{ commandName }} {{ uri }}/arc/tree` to inspect the managed archive file tree.
|
|
187
|
+
- Use `{{ commandName }} {{ uri }}/arc scan` when the folder contents changed outside Wiki Graph.
|
|
188
|
+
- Use `{{ commandName }} wikg://lib/registry` to list all library registries.
|
|
189
|
+
{% elif target.kind == "scope" and predicate == "remove" %}
|
|
190
|
+
Purpose:
|
|
191
|
+
Remove this non-default library registry.
|
|
192
|
+
|
|
193
|
+
Usage:
|
|
194
|
+
{{ commandName }} {{ uri }} remove --confirm [--json]
|
|
195
|
+
|
|
196
|
+
Notes:
|
|
197
|
+
- The default library is system-managed and cannot be removed.
|
|
198
|
+
- Removing a library deletes its core registry record, metadata, membership records, and local derived index state.
|
|
199
|
+
- Removing a library does not delete the library folder or any `.wikg` files in it.
|
|
200
|
+
- `--confirm` is required.
|
|
201
|
+
- Remove holds the library write lock and cannot run concurrently with membership changes or index rebuild for the same library.
|
|
202
|
+
{% elif target.kind == "archive" and predicate == "get" %}
|
|
203
|
+
Purpose:
|
|
204
|
+
Read this library archive membership record.
|
|
205
|
+
|
|
206
|
+
Usage:
|
|
207
|
+
{{ commandName }} {{ uri }} [--json]
|
|
208
|
+
|
|
209
|
+
Notes:
|
|
210
|
+
- This reads membership information, not archive content.
|
|
211
|
+
- Add archive object suffixes such as `/chapter`, `/entity`, or `/triple` to query the managed archive contents.
|
|
212
|
+
{% elif target.kind == "archive" and predicate == "remove" %}
|
|
213
|
+
Purpose:
|
|
214
|
+
Delete this managed `.wikg` file from the library folder and unregister it.
|
|
215
|
+
|
|
216
|
+
Usage:
|
|
217
|
+
{{ commandName }} {{ uri }} remove --confirm [--json]
|
|
218
|
+
|
|
219
|
+
Notes:
|
|
220
|
+
- `--confirm` is required.
|
|
221
|
+
- If the registered file is already missing, the command can still clean the registry entry.
|
|
222
|
+
- This does not delete empty parent directories.
|
|
223
|
+
- Removing an archive marks the library index dirty.
|
|
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
|
+
{% elif target.kind == "metadata" and predicate == "set" %}
|
|
226
|
+
Purpose:
|
|
227
|
+
Replace the whole library metadata map.
|
|
228
|
+
|
|
229
|
+
Usage:
|
|
230
|
+
{{ commandName }} {{ uri }} set <json> [--json]
|
|
231
|
+
{{ commandName }} {{ uri }} set --json-input <json> [--json]
|
|
232
|
+
{{ commandName }} {{ uri }} set --input <path|-> [--json]
|
|
233
|
+
|
|
234
|
+
Notes:
|
|
235
|
+
- `set` requires a JSON object.
|
|
236
|
+
- Metadata keys are free-form user fields.
|
|
237
|
+
- `--json` controls output shape; it is not JSON input.
|
|
238
|
+
- System registry fields such as id, public id, folder path, default marker, and staging path cannot be modified through metadata.
|
|
239
|
+
- With `--json`, success output is the resulting metadata map.
|
|
240
|
+
{% elif target.kind == "metadata" and predicate == "get" %}
|
|
241
|
+
Purpose:
|
|
242
|
+
Read this library metadata map.
|
|
243
|
+
|
|
244
|
+
Usage:
|
|
245
|
+
{{ commandName }} {{ uri }} get [--json]
|
|
246
|
+
|
|
247
|
+
Notes:
|
|
248
|
+
- This reads the whole metadata map.
|
|
249
|
+
- Metadata keys are free-form user fields.
|
|
250
|
+
- System registry fields such as id, public id, folder path, default marker, and staging path cannot be modified through metadata.
|
|
251
|
+
{% elif target.kind == "metadata" and predicate == "put" %}
|
|
252
|
+
Purpose:
|
|
253
|
+
Write one library metadata key.
|
|
254
|
+
|
|
255
|
+
Usage:
|
|
256
|
+
{{ commandName }} {{ uri }} put <key> <value> [--json]
|
|
257
|
+
{{ commandName }} {{ uri }} put <key> --json-input <value> [--json]
|
|
258
|
+
{{ commandName }} {{ uri }} put <key> --input <path|-> [--json]
|
|
259
|
+
|
|
260
|
+
Notes:
|
|
261
|
+
- Without JSON input, the value is stored as a string.
|
|
262
|
+
- With JSON input, the value is parsed as JSON.
|
|
263
|
+
- `--json` controls output shape; it is not JSON input.
|
|
264
|
+
- Metadata keys are command arguments, not URI segments.
|
|
265
|
+
- System registry fields such as id, public id, folder path, default marker, and staging path cannot be modified through metadata.
|
|
266
|
+
{% elif target.kind == "metadata" and predicate == "delete" %}
|
|
267
|
+
Purpose:
|
|
268
|
+
Delete one library metadata key.
|
|
269
|
+
|
|
270
|
+
Usage:
|
|
271
|
+
{{ commandName }} {{ uri }} delete <key> [--json]
|
|
272
|
+
|
|
273
|
+
Notes:
|
|
274
|
+
- Missing keys are ignored.
|
|
275
|
+
- With `--json`, success output is the resulting metadata map.
|
|
276
|
+
{% elif target.kind == "metadata" and predicate == "clear" %}
|
|
277
|
+
Purpose:
|
|
278
|
+
Clear this library metadata map.
|
|
279
|
+
|
|
280
|
+
Usage:
|
|
281
|
+
{{ commandName }} {{ uri }} clear [--json]
|
|
282
|
+
|
|
283
|
+
Notes:
|
|
284
|
+
- This clears user metadata only.
|
|
285
|
+
- It does not remove the library registry or change the library folder.
|
|
286
|
+
{% else %}
|
|
287
|
+
This library target does not support `{{ predicate }}`.
|
|
288
|
+
{% endif %}
|
|
289
|
+
|
|
290
|
+
Related help:
|
|
291
|
+
- {{ commandName }} {{ uri }} --help
|
|
292
|
+
- {{ commandName }} help library
|
|
293
|
+
{% if target.kind == "scope" and target.objectUri == "wikg://index" %}
|
|
294
|
+
- {{ commandName }} help readiness
|
|
295
|
+
{% endif %}
|
|
296
|
+
- {{ commandName }} help uri
|