sdtk-wiki-kit 0.1.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/README.md +262 -0
- package/assets/atlas/build_atlas.py +1110 -0
- package/assets/atlas/doc_atlas_viewer_template.html +3796 -0
- package/assets/atlas/vendor/mermaid.min.js +2029 -0
- package/assets/keys/sdtk-entitlement-public.pem +11 -0
- package/bin/sdtk-wiki.js +14 -0
- package/package.json +45 -0
- package/src/commands/ask.js +139 -0
- package/src/commands/atlas.js +339 -0
- package/src/commands/deferred.js +14 -0
- package/src/commands/help.js +67 -0
- package/src/commands/init.js +91 -0
- package/src/commands/lint.js +48 -0
- package/src/commands/wiki.js +251 -0
- package/src/index.js +65 -0
- package/src/lib/args.js +68 -0
- package/src/lib/browser-open.js +32 -0
- package/src/lib/errors.js +29 -0
- package/src/lib/wiki-ask.js +175 -0
- package/src/lib/wiki-compile.js +287 -0
- package/src/lib/wiki-config.js +180 -0
- package/src/lib/wiki-discover.js +271 -0
- package/src/lib/wiki-flags.js +89 -0
- package/src/lib/wiki-ingest.js +198 -0
- package/src/lib/wiki-lint.js +468 -0
- package/src/lib/wiki-paths.js +169 -0
- package/src/lib/wiki-premium-loader.js +364 -0
- package/src/lib/wiki-prune.js +334 -0
- package/src/lib/wiki-query-history.js +111 -0
- package/src/lib/wiki-runner.js +373 -0
- package/src/lib/wiki-workspace.js +144 -0
package/README.md
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# SDTK-WIKI Kit
|
|
2
|
+
|
|
3
|
+
`sdtk-wiki-kit` is the standalone SDTK-WIKI Foundation/Beta toolkit package for
|
|
4
|
+
project-local wiki, document graph, provenance, lint/gap analysis, local source
|
|
5
|
+
intake, grounded Ask, and report-first second-brain maintenance workflows.
|
|
6
|
+
|
|
7
|
+
SDTK-WIKI is the canonical home for new SDTK wiki work. The older
|
|
8
|
+
`sdtk-spec atlas` commands remain a compatibility path for free graph/viewer
|
|
9
|
+
workflows and keep using `.sdtk/atlas`.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
npm install -g sdtk-wiki-kit
|
|
15
|
+
sdtk-wiki --help
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For local validation from this repository:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
node products/sdtk-wiki/distribution/sdtk-wiki-kit/bin/sdtk-wiki.js --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Current Runtime Surface
|
|
25
|
+
|
|
26
|
+
Implemented in the Foundation/Beta package:
|
|
27
|
+
|
|
28
|
+
| Capability | Command |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Initialize SDTK-WIKI workspace | `sdtk-wiki init` |
|
|
31
|
+
| Build graph, viewer, generated pages, and provenance | `sdtk-wiki atlas build` |
|
|
32
|
+
| Open local viewer | `sdtk-wiki atlas open` |
|
|
33
|
+
| Watch markdown sources and rebuild | `sdtk-wiki atlas watch` |
|
|
34
|
+
| Show workspace/build status | `sdtk-wiki atlas status` |
|
|
35
|
+
| Register one local source in raw/provenance registry | `sdtk-wiki wiki ingest` |
|
|
36
|
+
| Run non-destructive wiki lint | `sdtk-wiki lint` |
|
|
37
|
+
| Run stale-page prune dry-run report | `sdtk-wiki wiki prune --dry-run` |
|
|
38
|
+
| Generate local discovery plan from gap evidence | `sdtk-wiki wiki discover --plan` |
|
|
39
|
+
| Generate compile dry-run preview from a local plan | `sdtk-wiki wiki compile --dry-run` |
|
|
40
|
+
| Ask grounded questions over built graph | `sdtk-wiki ask` |
|
|
41
|
+
| Save one redacted query record after successful Ask | `sdtk-wiki ask --save-query` |
|
|
42
|
+
|
|
43
|
+
Not implemented in the Foundation/Beta runtime:
|
|
44
|
+
|
|
45
|
+
- `sdtk-wiki wiki compile --apply`
|
|
46
|
+
- automatic web discovery or web fetch
|
|
47
|
+
- automatic source ingest from the web
|
|
48
|
+
- destructive prune/delete/archive
|
|
49
|
+
- query history list/show/delete commands
|
|
50
|
+
- full prompt/full answer query persistence by default
|
|
51
|
+
- automatic migration or deletion of `.sdtk/atlas`
|
|
52
|
+
|
|
53
|
+
## Workspace Contract
|
|
54
|
+
|
|
55
|
+
| Path | Meaning |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `.sdtk/wiki` | SDTK-WIKI workspace root |
|
|
58
|
+
| `.sdtk/wiki/graph` | graph/viewer output |
|
|
59
|
+
| `.sdtk/wiki/pages` | generated managed wiki pages |
|
|
60
|
+
| `.sdtk/wiki/raw` | metadata-only raw/source registry |
|
|
61
|
+
| `.sdtk/wiki/provenance` | source/build/ingest provenance |
|
|
62
|
+
| `.sdtk/wiki/reports` | lint, prune, discover, and compile preview reports |
|
|
63
|
+
| `.sdtk/wiki/queries` | opt-in redacted Ask query records |
|
|
64
|
+
| `.sdtk/atlas` | legacy Atlas compatibility output, readable only |
|
|
65
|
+
|
|
66
|
+
SDTK-WIKI writes only under project-local `.sdtk/wiki`. It must not auto-delete,
|
|
67
|
+
auto-migrate, or rewrite `.sdtk/atlas`.
|
|
68
|
+
|
|
69
|
+
Existing `sdtk-spec atlas init|build|open|watch|status` commands remain the R1
|
|
70
|
+
compatibility path and keep compatibility output under `.sdtk/atlas`.
|
|
71
|
+
The old `sdtk-spec atlas ask` path is not supported; native Ask uses
|
|
72
|
+
capability `wiki.ask`.
|
|
73
|
+
|
|
74
|
+
## First Run
|
|
75
|
+
|
|
76
|
+
Run from the project root you want to index:
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
sdtk-wiki init --project-path . --no-open
|
|
80
|
+
sdtk-wiki atlas status --project-path .
|
|
81
|
+
sdtk-wiki atlas build --project-path .
|
|
82
|
+
sdtk-wiki lint --project-path .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Open the viewer:
|
|
86
|
+
|
|
87
|
+
```powershell
|
|
88
|
+
sdtk-wiki atlas open --project-path .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Command Reference
|
|
92
|
+
|
|
93
|
+
### Init
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
sdtk-wiki init [--project-path <path>] [--output-dir <path>] [--scan-root <path>] [--force] [--no-build] [--no-open] [--host <host>] [--port <port>] [--verbose]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Initializes `.sdtk/wiki`, writes package config, optionally builds the graph,
|
|
100
|
+
and optionally opens the viewer.
|
|
101
|
+
|
|
102
|
+
### Build, Open, Watch, Status
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
sdtk-wiki atlas build [--project-path <path>] [--output-dir <path>] [--scan-root <path>] [--verbose]
|
|
106
|
+
sdtk-wiki atlas open [--project-path <path>] [--host <host>] [--port <port>] [--no-open]
|
|
107
|
+
sdtk-wiki atlas watch [--project-path <path>] [--scan-root <path>] [--port <port>] [--no-open]
|
|
108
|
+
sdtk-wiki atlas status [--project-path <path>]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The `atlas` namespace is retained for R1 command continuity while generated
|
|
112
|
+
workspace output is SDTK-WIKI-owned under `.sdtk/wiki`.
|
|
113
|
+
|
|
114
|
+
### Ingest Local Source Metadata
|
|
115
|
+
|
|
116
|
+
```powershell
|
|
117
|
+
sdtk-wiki wiki ingest --project-path <path> --source <path>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Registers one local project source in `.sdtk/wiki/raw` and writes ingest
|
|
121
|
+
provenance under `.sdtk/wiki/provenance`.
|
|
122
|
+
|
|
123
|
+
Safety:
|
|
124
|
+
|
|
125
|
+
- local project files only
|
|
126
|
+
- metadata-only registry
|
|
127
|
+
- no source payload copy
|
|
128
|
+
- no generated page updates
|
|
129
|
+
- no graph/viewer rebuild side effects
|
|
130
|
+
|
|
131
|
+
### Lint
|
|
132
|
+
|
|
133
|
+
```powershell
|
|
134
|
+
sdtk-wiki lint [--project-path <path>]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Runs report-first checks over canonical `.sdtk/wiki` artifacts and writes a
|
|
138
|
+
dated markdown report under `.sdtk/wiki/reports`. Lint does not auto-fix,
|
|
139
|
+
delete, archive, compile, or persist query history.
|
|
140
|
+
|
|
141
|
+
### Prune Dry-Run
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
sdtk-wiki wiki prune --dry-run --project-path <path>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Writes a stale managed-page review report under `.sdtk/wiki/reports`.
|
|
148
|
+
This command is dry-run only. It does not delete, archive, apply, or mutate
|
|
149
|
+
`.sdtk/atlas`.
|
|
150
|
+
|
|
151
|
+
### Discover Plan
|
|
152
|
+
|
|
153
|
+
```powershell
|
|
154
|
+
sdtk-wiki wiki discover --plan --project-path <path>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Writes a local-only discovery plan from existing lint/raw/provenance/stale
|
|
158
|
+
evidence under `.sdtk/wiki/reports`.
|
|
159
|
+
|
|
160
|
+
Safety:
|
|
161
|
+
|
|
162
|
+
- no web fetch
|
|
163
|
+
- no source ingest
|
|
164
|
+
- no compile/apply
|
|
165
|
+
- no prune/delete/archive
|
|
166
|
+
|
|
167
|
+
### Compile Dry-Run Preview
|
|
168
|
+
|
|
169
|
+
```powershell
|
|
170
|
+
sdtk-wiki wiki compile --plan <path> --project-path <path> --dry-run
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Reads a local markdown or JSON compile plan and writes a preview report under
|
|
174
|
+
`.sdtk/wiki/reports`.
|
|
175
|
+
|
|
176
|
+
Supported operation types:
|
|
177
|
+
|
|
178
|
+
- `append_section`
|
|
179
|
+
- `create_page`
|
|
180
|
+
- `add_relation`
|
|
181
|
+
- `add_source_ref`
|
|
182
|
+
|
|
183
|
+
Unknown operation types are reported as `unsupported_operation`. The current
|
|
184
|
+
runtime has no `--apply` behavior and does not modify wiki pages, raw sources,
|
|
185
|
+
provenance, or `.sdtk/atlas`.
|
|
186
|
+
|
|
187
|
+
### Ask
|
|
188
|
+
|
|
189
|
+
```powershell
|
|
190
|
+
sdtk-wiki ask --question "<text>" [--project-path <path>] [--json] [--source <id-or-path>] [--max-sources <n>] [--save-query]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Native `sdtk-wiki ask` is the canonical Q&A command for capability `wiki.ask`.
|
|
194
|
+
|
|
195
|
+
Preconditions:
|
|
196
|
+
|
|
197
|
+
- `.sdtk/wiki/graph` must exist
|
|
198
|
+
- local `wiki.ask` entitlement must be valid
|
|
199
|
+
- local premium/runtime Ask pack must be available
|
|
200
|
+
|
|
201
|
+
Query history is off by default. `--save-query` writes one redacted JSON record
|
|
202
|
+
under `.sdtk/wiki/queries` only after a successful answer.
|
|
203
|
+
|
|
204
|
+
Saved query records store `question_redacted`, `answer_summary`, source refs,
|
|
205
|
+
runtime metadata, and retention policy. They do not store full question or full
|
|
206
|
+
answer by default.
|
|
207
|
+
|
|
208
|
+
## Practical Flows
|
|
209
|
+
|
|
210
|
+
Build and view a project knowledge graph:
|
|
211
|
+
|
|
212
|
+
```powershell
|
|
213
|
+
sdtk-wiki init --project-path . --no-open
|
|
214
|
+
sdtk-wiki atlas build --project-path .
|
|
215
|
+
sdtk-wiki atlas open --project-path .
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Add local source metadata and refresh graph outputs:
|
|
219
|
+
|
|
220
|
+
```powershell
|
|
221
|
+
sdtk-wiki wiki ingest --project-path . --source docs/product/PRD_ORDER_MGMT.md
|
|
222
|
+
sdtk-wiki atlas build --project-path .
|
|
223
|
+
sdtk-wiki lint --project-path .
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Run report-first maintenance checks:
|
|
227
|
+
|
|
228
|
+
```powershell
|
|
229
|
+
sdtk-wiki lint --project-path .
|
|
230
|
+
sdtk-wiki wiki prune --dry-run --project-path .
|
|
231
|
+
sdtk-wiki wiki discover --plan --project-path .
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Preview a compile plan without applying it:
|
|
235
|
+
|
|
236
|
+
```powershell
|
|
237
|
+
sdtk-wiki wiki compile --plan <local-plan.md-or-json> --project-path . --dry-run
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Ask and save an opt-in redacted query record:
|
|
241
|
+
|
|
242
|
+
```powershell
|
|
243
|
+
sdtk-wiki atlas build --project-path .
|
|
244
|
+
sdtk-wiki ask --project-path . --question "Which docs describe the deployment path?" --save-query
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Foundation/Beta Boundaries
|
|
248
|
+
|
|
249
|
+
This release is local-first and report-first. It is a foundation for a
|
|
250
|
+
second-brain workflow, not a fully autonomous second brain.
|
|
251
|
+
|
|
252
|
+
Do not claim the Foundation/Beta runtime includes:
|
|
253
|
+
|
|
254
|
+
- web fetch/discover
|
|
255
|
+
- compile `--apply`
|
|
256
|
+
- destructive prune/delete/archive
|
|
257
|
+
- query list/show/delete
|
|
258
|
+
- default full prompt/full answer query persistence
|
|
259
|
+
- `.sdtk/atlas` as canonical storage
|
|
260
|
+
|
|
261
|
+
See `products/sdtk-wiki/governance/SDTK_WIKI_USAGE_GUIDE.md` for the fuller
|
|
262
|
+
current usage guide.
|