wiki-graph 0.6.0 → 0.7.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/LICENSE +201 -0
- package/dist/cli.js +2449 -663
- package/dist/cli.js.map +1 -1
- package/dist/data/help/commands/predicate.jinja +35 -2
- package/dist/data/help/commands/uri.jinja +1 -0
- package/dist/data/help/topics/config.jinja +26 -6
- package/dist/data/help/topics/readiness.jinja +3 -2
- package/dist/gc-worker.js +77 -92
- package/dist/gc-worker.js.map +1 -1
- package/dist/index.cjs +1247 -4800
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1233 -4885
- package/dist/index.js.map +1 -1
- package/dist/queue-worker.js +2359 -575
- package/dist/queue-worker.js.map +1 -1
- package/package.json +7 -16
|
@@ -314,12 +314,42 @@ Notes:
|
|
|
314
314
|
{% elif "/wikispine" in uri %}
|
|
315
315
|
Schema:
|
|
316
316
|
{
|
|
317
|
-
"provider": "fetch|cli"
|
|
317
|
+
"provider": "fetch|cli",
|
|
318
|
+
"endpoint": "<optional-service-base-url>"
|
|
318
319
|
}
|
|
319
320
|
|
|
320
321
|
Notes:
|
|
321
|
-
-
|
|
322
|
+
- Allowed keys: provider, endpoint, token.
|
|
323
|
+
- `fetch` uses the hosted WikiSpine endpoint by default and requires its Bearer API key.
|
|
322
324
|
- `cli` runs the local `wikispine` command from PATH.
|
|
325
|
+
- `token` is sensitive and cannot be set from JSON.
|
|
326
|
+
- To add or replace it, use `{{ commandName }} {{ uri }} put token --secret`.
|
|
327
|
+
- To remove it, use `{{ commandName }} {{ uri }} delete token`.
|
|
328
|
+
{% elif "/wikimedia" in uri %}
|
|
329
|
+
Schema:
|
|
330
|
+
{
|
|
331
|
+
"endpoint": "<optional-service-base-url>"
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
Notes:
|
|
335
|
+
- Allowed keys: endpoint, token.
|
|
336
|
+
- An empty section uses direct local Wikimedia access. Setting `token` enables the hosted resolver; `endpoint` is optional.
|
|
337
|
+
- Remote access requires `token`; `endpoint` alone is incomplete.
|
|
338
|
+
- `pnpm dev` defaults to `https://pdf-craft-api.oomol.dev`; built CLI artifacts default to `https://api.pdfcraft.ai`.
|
|
339
|
+
- `token` is sensitive and cannot be set from JSON.
|
|
340
|
+
- To add or replace it, use `{{ commandName }} {{ uri }} put token --secret`.
|
|
341
|
+
- To remove it, use `{{ commandName }} {{ uri }} delete token`.
|
|
342
|
+
{% elif "/job" in uri %}
|
|
343
|
+
Schema:
|
|
344
|
+
{
|
|
345
|
+
"endpoint": "<service-base-url>"
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
Notes:
|
|
349
|
+
- Allowed keys: endpoint, token.
|
|
350
|
+
- `token` is optional and sensitive; it cannot be set from JSON.
|
|
351
|
+
- To add or replace it, use `{{ commandName }} {{ uri }} put token --secret`.
|
|
352
|
+
- To remove it, use `{{ commandName }} {{ uri }} delete token`.
|
|
323
353
|
{% elif "/concurrent" in uri %}
|
|
324
354
|
Schema:
|
|
325
355
|
{
|
|
@@ -344,6 +374,9 @@ Examples:
|
|
|
344
374
|
{% elif "/wikispine" in uri %}
|
|
345
375
|
{{ commandName }} {{ uri }} set '{"provider":"fetch"}'
|
|
346
376
|
{{ commandName }} {{ uri }} set '{"provider":"cli"}'
|
|
377
|
+
{% elif "/job" in uri or "/wikimedia" in uri %}
|
|
378
|
+
{{ commandName }} {{ uri }} set '{"endpoint":"https://service.example.com"}'
|
|
379
|
+
{{ commandName }} {{ uri }} put token --secret
|
|
347
380
|
{% elif "/concurrent" in uri %}
|
|
348
381
|
{{ commandName }} {{ uri }} set '{"job":3,"request":6}'
|
|
349
382
|
{{ commandName }} {{ uri }} set --json-input '{"job":2,"request":4}'
|
|
@@ -326,6 +326,7 @@ Sections:
|
|
|
326
326
|
- `{{ commandName }} wikg://local/config/llm --help`
|
|
327
327
|
- `{{ commandName }} wikg://local/config/embeddings --help`
|
|
328
328
|
- `{{ commandName }} wikg://local/config/concurrent --help`
|
|
329
|
+
- `{{ commandName }} wikg://local/config/wikimedia --help`
|
|
329
330
|
- `{{ commandName }} wikg://local/config/wikispine --help`
|
|
330
331
|
{% elif target.name == "local-config-section" %}
|
|
331
332
|
URI type:
|
|
@@ -22,10 +22,16 @@ Sections:
|
|
|
22
22
|
- `job`: simultaneous generation jobs. Default: 3.
|
|
23
23
|
- `request`: concurrent LLM requests. Default: 6.
|
|
24
24
|
|
|
25
|
+
`wikg://local/config/wikimedia`
|
|
26
|
+
Optional remote Wikimedia resolver:
|
|
27
|
+
- `endpoint`: optional service base URL; defaults to the current development or production gateway.
|
|
28
|
+
- `token`: required Bearer API key. A configured token enables remote resolution; an empty section keeps direct local Wikimedia access.
|
|
29
|
+
|
|
25
30
|
`wikg://local/config/wikispine`
|
|
26
31
|
WikiSpine runtime provider for Knowledge Graph builds:
|
|
27
32
|
- `provider`: `cli` or `fetch`.
|
|
28
|
-
- `fetch
|
|
33
|
+
- `endpoint`: optional service base URL for `fetch`; defaults to the current development or production gateway.
|
|
34
|
+
- `token`: required Bearer API key for `fetch`.
|
|
29
35
|
- `cli` runs the local `wikispine` command from PATH.
|
|
30
36
|
|
|
31
37
|
Operations:
|
|
@@ -33,13 +39,14 @@ Operations:
|
|
|
33
39
|
{{ commandName }} wikg://local/config/llm
|
|
34
40
|
{{ commandName }} wikg://local/config/embeddings
|
|
35
41
|
{{ commandName }} wikg://local/config/concurrent
|
|
42
|
+
{{ commandName }} wikg://local/config/wikimedia
|
|
36
43
|
{{ commandName }} wikg://local/config/wikispine
|
|
37
44
|
|
|
38
45
|
Replace a section with a JSON object:
|
|
39
46
|
{{ commandName }} wikg://local/config/llm set '{"provider":"openai","model":"gpt-4.1"}'
|
|
40
47
|
{{ commandName }} wikg://local/config/embeddings set '{"provider":"openai","model":"text-embedding-3-small"}'
|
|
41
48
|
{{ commandName }} wikg://local/config/concurrent set '{"job":3,"request":6}'
|
|
42
|
-
|
|
49
|
+
Sensitive tokens cannot be supplied by `set`; configure remote Wikimedia and WikiSpine incrementally with `put`.
|
|
43
50
|
|
|
44
51
|
Update one key:
|
|
45
52
|
{{ commandName }} wikg://local/config/llm put provider openai
|
|
@@ -48,16 +55,23 @@ Operations:
|
|
|
48
55
|
{{ commandName }} wikg://local/config/embeddings put model text-embedding-3-small
|
|
49
56
|
{{ commandName }} wikg://local/config/concurrent put job 3
|
|
50
57
|
{{ commandName }} wikg://local/config/concurrent put request 6
|
|
58
|
+
{{ commandName }} wikg://local/config/wikimedia put endpoint https://wikimedia.example.com
|
|
59
|
+
{{ commandName }} wikg://local/config/wikimedia put token --secret
|
|
51
60
|
{{ commandName }} wikg://local/config/wikispine put provider cli
|
|
52
61
|
{{ commandName }} wikg://local/config/wikispine put provider fetch
|
|
62
|
+
{{ commandName }} wikg://local/config/wikispine put token --secret
|
|
53
63
|
|
|
54
64
|
Store the API key:
|
|
55
65
|
{{ commandName }} wikg://local/config/llm put apiKey --secret
|
|
56
66
|
{{ commandName }} wikg://local/config/embeddings put apiKey --secret
|
|
57
67
|
|
|
68
|
+
Store a service token:
|
|
69
|
+
{{ commandName }} wikg://local/config/wikimedia put token --secret
|
|
70
|
+
{{ commandName }} wikg://local/config/wikispine put token --secret
|
|
71
|
+
|
|
58
72
|
Secret handling:
|
|
59
|
-
- `apiKey`
|
|
60
|
-
- `apiKey`
|
|
73
|
+
- `apiKey` and `token` are read through an interactive hidden prompt.
|
|
74
|
+
- `apiKey` and `token` are masked as `****` in command output.
|
|
61
75
|
- `set <json>` and `set --json-input <json>` cannot set a real `apiKey`.
|
|
62
76
|
- Those JSON inputs may include `"apiKey":"****"` to preserve an existing secret.
|
|
63
77
|
- Omitting `apiKey` from those JSON inputs removes it from the section.
|
|
@@ -96,16 +110,22 @@ Examples:
|
|
|
96
110
|
{{ commandName }} wikg://local/config/embeddings put apiKey --secret
|
|
97
111
|
{{ commandName }} wikg://local/config/embeddings test
|
|
98
112
|
{{ commandName }} wikg://local/config/wikispine put provider fetch
|
|
113
|
+
{{ commandName }} wikg://local/config/wikispine put token --secret
|
|
99
114
|
{{ commandName }} wikg://local/config/wikispine test
|
|
100
115
|
|
|
116
|
+
Hosted provider environments:
|
|
117
|
+
- `pnpm dev` uses `https://pdf-craft-api.oomol.dev`.
|
|
118
|
+
- Built CLI artifacts use `https://api.pdfcraft.ai`.
|
|
119
|
+
- An explicit provider endpoint overrides these defaults.
|
|
120
|
+
|
|
101
121
|
WikiSpine:
|
|
102
122
|
Knowledge Graph builds require WikiSpine. If `wikispine` is missing,
|
|
103
123
|
configure one provider and run the config test before starting Knowledge Graph work.
|
|
104
|
-
- `fetch` uses the
|
|
124
|
+
- `fetch` uses the hosted service endpoint and requires network access plus a configured API key.
|
|
105
125
|
- `cli` requires a `wikispine` executable on PATH and any local runtime/data it needs.
|
|
106
126
|
- Test `cli` from the same shell that runs Wiki Graph; a different terminal or service environment may have a different PATH.
|
|
107
127
|
- If `{{ commandName }} wikg://local/config/wikispine test` fails for `cli`, check PATH first or switch to `fetch`.
|
|
108
|
-
- If the test fails for `fetch`, check network access or switch to `cli` in environments with a prepared local runtime.
|
|
128
|
+
- If the test fails for `fetch`, check network access and the API key, or switch to `cli` in environments with a prepared local runtime.
|
|
109
129
|
- CLI help does not install the local WikiSpine runtime; use `fetch` unless the local runtime is already prepared.
|
|
110
130
|
- Knowledge Graph jobs should not be started until this test succeeds.
|
|
111
131
|
Runtime setup and recovery guide:
|
|
@@ -125,18 +125,19 @@ WikiSpine readiness:
|
|
|
125
125
|
WikiSpine provides entity candidate lookup for Knowledge Graph construction.
|
|
126
126
|
|
|
127
127
|
Provider choices:
|
|
128
|
-
- `fetch`: use the
|
|
128
|
+
- `fetch`: use the hosted WikiSpine HTTP service with a WikiGraph API key. This is usually easier for Agents and hosted setups.
|
|
129
129
|
- `cli`: run the local `wikispine` command from PATH. This is useful for offline or locally controlled environments, but requires local runtime setup and data.
|
|
130
130
|
|
|
131
131
|
Configure one provider, then test it:
|
|
132
132
|
{{ commandName }} wikg://local/config/wikispine put provider fetch
|
|
133
|
+
{{ commandName }} wikg://local/config/wikispine put token --secret
|
|
133
134
|
{{ commandName }} wikg://local/config/wikispine test
|
|
134
135
|
|
|
135
136
|
{{ commandName }} wikg://local/config/wikispine put provider cli
|
|
136
137
|
{{ commandName }} wikg://local/config/wikispine test
|
|
137
138
|
|
|
138
139
|
Recovery:
|
|
139
|
-
Use `fetch` when network access
|
|
140
|
+
Use `fetch` when network access and an API key for the hosted service are available.
|
|
140
141
|
Use `cli` only when a local `wikispine` executable and its runtime/data are prepared.
|
|
141
142
|
Test `cli` from the same shell that runs Wiki Graph so PATH and runtime files match the job environment.
|
|
142
143
|
CLI help does not install the local WikiSpine runtime; use the guide below when preparing a local setup.
|