hadara 0.2.0-rc.3 → 0.3.0-rc.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 +144 -148
- package/dist/cli/commands.js +34 -0
- package/dist/cli/docs.js +81 -0
- package/dist/cli/help.js +152 -0
- package/dist/cli/init.js +128 -13
- package/dist/cli/main.js +21 -73
- package/dist/core/schema.js +14 -0
- package/dist/schemas/docs-archive-plan.schema.json +69 -0
- package/dist/schemas/docs-doctor.schema.json +45 -0
- package/dist/schemas/docs-explain.schema.json +69 -0
- package/dist/schemas/docs-list.schema.json +75 -0
- package/dist/schemas/docs-mark.schema.json +65 -0
- package/dist/schemas/docs-patch-plan.schema.json +64 -0
- package/dist/schemas/docs-required-reading.schema.json +63 -0
- package/dist/schemas/schema-index.json +77 -0
- package/dist/services/capability-registry.js +1483 -224
- package/dist/services/docs-cleanup.js +207 -0
- package/dist/services/docs-registry.js +312 -0
- package/dist/services/lifecycle-guide.js +185 -0
- package/dist/services/managed-sections.js +303 -0
- package/dist/services/release-artifact.js +50 -3
- package/dist/task/task-capsule.js +9 -3
- package/dist/task/task-templates.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<img alt="Release candidate" src="https://img.shields.io/badge/
|
|
8
|
+
<img alt="Release candidate" src="https://img.shields.io/badge/npm-0.3.0--rc.0-blue">
|
|
9
9
|
<img alt="Node.js" src="https://img.shields.io/badge/node-%3E%3D22-brightgreen">
|
|
10
10
|
<img alt="License" src="https://img.shields.io/badge/license-MIT-lightgrey">
|
|
11
11
|
</p>
|
|
@@ -14,31 +14,30 @@
|
|
|
14
14
|
|
|
15
15
|
> Unbroken Context, Verified Development.
|
|
16
16
|
|
|
17
|
-
HADARA
|
|
17
|
+
HADARA binds non-deterministic LLM agent work into a production-oriented workflow through Task Capsules, Session Continuity, Policy Layers, Evidence Logs, and Handoff Protocols.
|
|
18
18
|
|
|
19
19
|
This repository is both the HADARA source checkout and the HADARA protocol workspace used to build it.
|
|
20
20
|
|
|
21
21
|
## Release Status
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Current release candidate:
|
|
24
24
|
|
|
25
25
|
```text
|
|
26
|
-
hadara@0.
|
|
26
|
+
hadara@0.3.0-rc.0
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The 0.3.0 line is the Phase 7 Surface Refactor. It organizes HADARA's existing task, evidence, proof, lifecycle, release, and document surfaces so agents can distinguish primary lifecycle commands, diagnostics, advanced surfaces, canonical documents, historical documents, and safe Markdown update boundaries.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Phase 7.x labels are internal implementation phases, not npm release-candidate labels. Publishing `0.3.0-rc.0` or any later release still requires the approval-gated release path and explicit operator confirmation.
|
|
32
32
|
|
|
33
33
|
| Surface | Status |
|
|
34
34
|
|---|---|
|
|
35
35
|
| npm package | Primary release target. |
|
|
36
|
-
| `hadara@0.1.0-rc.0` | Published first RC. |
|
|
37
|
-
| `hadara@0.2.0-rc.0` | Superseded internal publish candidate after recycle findings. |
|
|
38
36
|
| `hadara@0.2.0-rc.1` | Previous published npm RC. |
|
|
39
|
-
| `hadara@0.2.0-rc.2` |
|
|
40
|
-
| `hadara@0.2.0-rc.3` |
|
|
41
|
-
|
|
|
37
|
+
| `hadara@0.2.0-rc.2` | Previous published npm RC. |
|
|
38
|
+
| `hadara@0.2.0-rc.3` | Previous published npm RC. |
|
|
39
|
+
| `hadara@0.3.0-rc.0` | Current release candidate. |
|
|
40
|
+
| GitHub Release | Secondary target, approval-gated. |
|
|
42
41
|
| Docker image | Deferred. |
|
|
43
42
|
| PyPI/Python package | `hadara==0.2.0rc1` published preview bridge. |
|
|
44
43
|
| Installer scripts / USB launchers | Deferred. |
|
|
@@ -49,24 +48,21 @@ No release command should publish, create a GitHub Release, build Docker images,
|
|
|
49
48
|
|
|
50
49
|
Requires Node.js 22.
|
|
51
50
|
|
|
52
|
-
Install
|
|
51
|
+
Install this release candidate:
|
|
53
52
|
|
|
54
53
|
```bash
|
|
55
|
-
npm install -g hadara@0.
|
|
54
|
+
npm install -g hadara@0.3.0-rc.0
|
|
55
|
+
hadara help
|
|
56
56
|
hadara doctor --json
|
|
57
|
-
hadara task list --json
|
|
58
|
-
hadara tools list --json
|
|
59
57
|
```
|
|
60
58
|
|
|
61
59
|
Run without a global install:
|
|
62
60
|
|
|
63
61
|
```bash
|
|
64
|
-
npx hadara@0.
|
|
65
|
-
npx hadara@0.
|
|
62
|
+
npx hadara@0.3.0-rc.0 help
|
|
63
|
+
npx hadara@0.3.0-rc.0 doctor --json
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
After an operator publishes rc3, use `hadara@0.2.0-rc.3` in the install and npx commands above. Previous published RCs remain available on npm for comparison or rollback.
|
|
69
|
-
|
|
70
66
|
## What HADARA Gives You
|
|
71
67
|
|
|
72
68
|
| Capability | Purpose |
|
|
@@ -74,54 +70,126 @@ After an operator publishes rc3, use `hadara@0.2.0-rc.3` in the install and npx
|
|
|
74
70
|
| Task Capsules | Keep each unit of work scoped, evidenced, and resumable. |
|
|
75
71
|
| Evidence Logs | Record public, reduced proof of validation without raw private logs. |
|
|
76
72
|
| Handoff Protocol | Preserve current state for the next operator or agent. |
|
|
77
|
-
|
|
|
78
|
-
|
|
|
73
|
+
| Structured Help | Separate primary lifecycle commands from diagnostics, advanced, release, UI, and integration surfaces. |
|
|
74
|
+
| Document Governance | Classify canonical, active, reference, historical, superseded, and archived docs. |
|
|
75
|
+
| Managed Markdown Safety | Patch declared generated sections with dry-run and hash guards. |
|
|
76
|
+
| Release Gates | Check package and release readiness through evidence-backed dry-run reports. |
|
|
79
77
|
| Read-only MCP Bridge | Expose project/task/evidence state without default write tools. |
|
|
80
78
|
| Dashboard and TUI | Provide local operator observation surfaces over existing read models. |
|
|
81
|
-
| Release Gates | Check release readiness through evidence-backed dry-run reports. |
|
|
82
79
|
|
|
83
80
|
HADARA is deliberately conservative. Read surfaces are broad; write and release surfaces are narrow, explicit, and evidence-oriented.
|
|
84
81
|
|
|
85
|
-
##
|
|
82
|
+
## Start Here
|
|
86
83
|
|
|
87
|
-
|
|
84
|
+
Ask the CLI for the workflow before choosing commands:
|
|
88
85
|
|
|
89
86
|
```bash
|
|
90
|
-
hadara
|
|
91
|
-
hadara
|
|
92
|
-
hadara
|
|
93
|
-
hadara tools list --json
|
|
94
|
-
hadara protocol doctor --json
|
|
95
|
-
hadara protocol doctor --scope docs --json
|
|
87
|
+
hadara help
|
|
88
|
+
hadara help lifecycle
|
|
89
|
+
hadara task next --json
|
|
96
90
|
```
|
|
97
91
|
|
|
98
|
-
|
|
92
|
+
Use structured discovery when an agent or tool needs machine-readable command metadata:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
hadara commands --json
|
|
96
|
+
hadara commands --family capsule-lifecycle --json
|
|
97
|
+
hadara help command task.close
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Primary Capsule Lifecycle
|
|
101
|
+
|
|
102
|
+
The primary path is intentionally small:
|
|
99
103
|
|
|
100
104
|
```bash
|
|
101
105
|
hadara task next --json
|
|
102
106
|
hadara task create "implement a focused change" --json
|
|
103
|
-
hadara task status --task T-
|
|
104
|
-
hadara
|
|
105
|
-
hadara task finish --task T-
|
|
106
|
-
hadara task
|
|
107
|
-
|
|
108
|
-
hadara task
|
|
109
|
-
hadara task
|
|
107
|
+
hadara task status --task T-XXXX --json
|
|
108
|
+
hadara evidence add-command --task T-XXXX --summary "..." --result passed --idempotency-key "command:T-XXXX:check" --json
|
|
109
|
+
hadara task finish --task T-XXXX --json
|
|
110
|
+
hadara task finish --task T-XXXX --execute --json
|
|
111
|
+
# Finalize Task Capsule docs and tracked state docs before closing.
|
|
112
|
+
hadara task ready --task T-XXXX --level done --json
|
|
113
|
+
hadara task close --task T-XXXX --json
|
|
114
|
+
hadara task close --task T-XXXX --execute --json
|
|
115
|
+
hadara task audit-close --task T-XXXX --json
|
|
116
|
+
hadara handoff suggest --task T-XXXX --json
|
|
110
117
|
```
|
|
111
118
|
|
|
112
|
-
|
|
119
|
+
Optional workflow compression is read-only. Use it separately when you want a compact current-stage report and next recommended action:
|
|
113
120
|
|
|
114
121
|
```bash
|
|
115
|
-
hadara
|
|
116
|
-
|
|
122
|
+
hadara task complete --task T-XXXX --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Important boundaries:
|
|
126
|
+
|
|
127
|
+
| Command | Boundary |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `task status` | Read-only operator console. `ok:true` means the report was generated, not that the task is ready. |
|
|
130
|
+
| `task complete` | Optional read-only workflow compressor. It reports the current stage and next action. |
|
|
131
|
+
| `task finish --execute` | Writes only bounded status bookkeeping in `TASK.md` and `docs/TASK_BOARD.md`. |
|
|
132
|
+
| `task close --execute` | Appends close evidence only. |
|
|
133
|
+
| `task audit-close` | Read-only close proof audit. |
|
|
134
|
+
|
|
135
|
+
Before `task close --execute`, finish Task Capsule docs, acceptance/tests/handoff notes, evidence summaries, Task Board updates, and tracked state docs. After close execute, changing close-source docs intentionally invalidates the previous close proof and requires rerunning ready/close/audit.
|
|
136
|
+
|
|
137
|
+
The full command semantics live in `docs/TASK_WORKFLOW_COMMANDS.md`.
|
|
138
|
+
|
|
139
|
+
## Proof and Diagnostics
|
|
140
|
+
|
|
141
|
+
Diagnostics are useful, but they are not the primary lifecycle:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
hadara evidence lint --task T-0001 --json
|
|
117
145
|
hadara evidence list --task T-0001 --json
|
|
118
146
|
hadara proof status --task T-0001 --json
|
|
119
147
|
hadara proof explain --task T-0001 --json
|
|
120
148
|
hadara ci gate --mode advisory --task T-0001 --json
|
|
121
|
-
hadara
|
|
149
|
+
hadara ci gate --mode strict --task T-0001 --json
|
|
150
|
+
hadara protocol doctor --json
|
|
122
151
|
```
|
|
123
152
|
|
|
124
|
-
|
|
153
|
+
Use strict gates before Done/close/release claims. Use advisory gates while exploring.
|
|
154
|
+
|
|
155
|
+
## Document Governance
|
|
156
|
+
|
|
157
|
+
HADARA projects can register and classify their operating documents:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
hadara docs list --json
|
|
161
|
+
hadara docs doctor --json
|
|
162
|
+
hadara docs explain --path docs/PROJECT_STATE.md --json
|
|
163
|
+
hadara docs required-reading --json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The document registry distinguishes canonical, active, reference, historical, superseded, and archived docs. `docs required-reading` reports the effective default reading set and excludes historical, superseded, and archived docs.
|
|
167
|
+
|
|
168
|
+
Docs cleanup is metadata-first:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
hadara docs mark --path docs/specs/old.md --status superseded --by docs/specs/new.md --reason "Replaced" --json
|
|
172
|
+
hadara docs archive --status superseded --json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`docs mark --execute` is hash-guarded and writes only `.hadara/docs-registry.json`. `docs archive` is dry-run planning only in the current implementation; it does not move or delete historical files.
|
|
176
|
+
|
|
177
|
+
## Managed Markdown Safety
|
|
178
|
+
|
|
179
|
+
HADARA can update declared managed sections only. Managed patch execution is dry-run-first and hash-guarded. User-authored prose remains outside automated writes.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
hadara docs managed list --json
|
|
183
|
+
hadara docs managed explain --path docs/TASK_BOARD.md --json
|
|
184
|
+
hadara docs patch --path docs/TASK_BOARD.md --section task-board --content-file .hadara/local/patches/task-board.md --json
|
|
185
|
+
hadara docs patch --path docs/TASK_BOARD.md --section task-board --content-file .hadara/local/patches/task-board.md --execute --before-hash sha256:... --json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Managed patch reports describe target hashes, section hashes, planned operations, and issues before any write is applied.
|
|
189
|
+
|
|
190
|
+
## Release and Advanced Surfaces
|
|
191
|
+
|
|
192
|
+
Release/package commands are release-only surfaces, not ordinary lifecycle steps:
|
|
125
193
|
|
|
126
194
|
```bash
|
|
127
195
|
hadara package smoke --dry-run --json
|
|
@@ -137,55 +205,49 @@ hadara release publish --mode dry-run --json
|
|
|
137
205
|
|
|
138
206
|
`release publish --mode dry-run` reports readiness, token presence by name, approval requirements, and mutation privacy flags without running `npm publish`. Any publish execution must happen only in a separate approval-gated release capsule with explicit operator confirmation.
|
|
139
207
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
HADARA task workflow commands have distinct read/write boundaries. The full command semantics live in `docs/TASK_WORKFLOW_COMMANDS.md`.
|
|
208
|
+
Dashboard, TUI, Hermes, MCP, installer, package, release, and run commands stay out of the primary lifecycle unless a task explicitly needs them.
|
|
143
209
|
|
|
144
|
-
|
|
210
|
+
## Safety Boundaries
|
|
145
211
|
|
|
146
|
-
|
|
147
|
-
hadara task next --json
|
|
212
|
+
HADARA 0.3.0 is not:
|
|
148
213
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
214
|
+
- a full agent runtime;
|
|
215
|
+
- Rack/enterprise behavior;
|
|
216
|
+
- automatic broad document rewriting;
|
|
217
|
+
- automatic historical document deletion;
|
|
218
|
+
- default shell execution through agents;
|
|
219
|
+
- default MCP write tooling;
|
|
220
|
+
- release or publish automation without operator approval.
|
|
155
221
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
hadara evidence add-command --task T-XXXX --summary "..." --result passed --idempotency-key "command:T-XXXX:check" --json
|
|
159
|
-
|
|
160
|
-
hadara task finish --task T-XXXX --json
|
|
161
|
-
hadara task finish --task T-XXXX --execute --json
|
|
162
|
-
|
|
163
|
-
# Finalize Task Capsule docs and tracked state docs before closing.
|
|
222
|
+
HADARA separates portable runtime state from project-owned development state.
|
|
164
223
|
|
|
165
|
-
|
|
224
|
+
Portable/local runtime state:
|
|
166
225
|
|
|
167
|
-
|
|
168
|
-
|
|
226
|
+
```text
|
|
227
|
+
data/
|
|
228
|
+
config/
|
|
229
|
+
secrets/
|
|
230
|
+
sessions/
|
|
231
|
+
logs/
|
|
232
|
+
audit/
|
|
233
|
+
cache/
|
|
234
|
+
exports/
|
|
235
|
+
```
|
|
169
236
|
|
|
170
|
-
|
|
171
|
-
hadara task close --task T-XXXX --execute --json
|
|
237
|
+
Project-owned reproducible state:
|
|
172
238
|
|
|
173
|
-
|
|
239
|
+
```text
|
|
240
|
+
docs/
|
|
241
|
+
tasks/
|
|
242
|
+
.hadara/
|
|
243
|
+
AGENTS.md
|
|
174
244
|
```
|
|
175
245
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
| Command | Boundary |
|
|
179
|
-
|---|---|
|
|
180
|
-
| `task status` | Read-only operator console. `ok:true` means the report was generated, not that the task is ready. |
|
|
181
|
-
| `task complete` | Read-only workflow compressor. It reports the current stage and next action. |
|
|
182
|
-
| `task finish --execute` | Writes only bounded status bookkeeping in `TASK.md` and `docs/TASK_BOARD.md`. |
|
|
183
|
-
| `task close --execute` | Appends close evidence only. |
|
|
184
|
-
| `task audit-close` | Read-only close proof audit. |
|
|
246
|
+
Portable/local state is not committed. Project docs, Task Capsules, and reduced public evidence are committed when they represent reproducible context.
|
|
185
247
|
|
|
186
|
-
|
|
248
|
+
## Development / Contributing
|
|
187
249
|
|
|
188
|
-
|
|
250
|
+
Initialize a project:
|
|
189
251
|
|
|
190
252
|
```bash
|
|
191
253
|
hadara init # default: standard
|
|
@@ -211,11 +273,7 @@ hadara init register-doc --path docs/specs/LOCAL.md --when "Local work" --purpos
|
|
|
211
273
|
hadara init enable-integration --integration mcp --json
|
|
212
274
|
```
|
|
213
275
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
## Develop from Source
|
|
217
|
-
|
|
218
|
-
Use Node.js 22.
|
|
276
|
+
Develop from source with Node.js 22:
|
|
219
277
|
|
|
220
278
|
```bash
|
|
221
279
|
npm install
|
|
@@ -237,56 +295,7 @@ Focused validation:
|
|
|
237
295
|
npm run test:focused -- tests/unit/release-dry-run.test.ts
|
|
238
296
|
```
|
|
239
297
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
HADARA release work is evidence-first.
|
|
243
|
-
|
|
244
|
-
Before any npm publish:
|
|
245
|
-
|
|
246
|
-
1. Confirm the git worktree is clean.
|
|
247
|
-
2. Run `hadara release dry-run --json`.
|
|
248
|
-
3. Run `hadara release publish --mode dry-run --json`.
|
|
249
|
-
4. Confirm `NPM_TOKEN` presence without printing the token value.
|
|
250
|
-
5. Confirm the exact package version is not already on npm.
|
|
251
|
-
6. Generate fresh package, clean-checkout, and release-artifact evidence for the active release capsule.
|
|
252
|
-
7. Publish only after explicit operator approval.
|
|
253
|
-
8. Verify with `npm view hadara@<version> version`.
|
|
254
|
-
9. Attach reduced publish evidence.
|
|
255
|
-
10. Update release notes, Project State, Agent Handoff, and the active Task Capsule.
|
|
256
|
-
|
|
257
|
-
Never write token values, private logs, raw npm output, private paths, or local machine state into committed evidence.
|
|
258
|
-
|
|
259
|
-
## Store Separation
|
|
260
|
-
|
|
261
|
-
HADARA separates portable runtime state from project-owned development state.
|
|
262
|
-
|
|
263
|
-
Portable/local runtime state:
|
|
264
|
-
|
|
265
|
-
```text
|
|
266
|
-
data/
|
|
267
|
-
config/
|
|
268
|
-
secrets/
|
|
269
|
-
sessions/
|
|
270
|
-
logs/
|
|
271
|
-
audit/
|
|
272
|
-
cache/
|
|
273
|
-
exports/
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
Project-owned reproducible state:
|
|
277
|
-
|
|
278
|
-
```text
|
|
279
|
-
docs/
|
|
280
|
-
tasks/
|
|
281
|
-
.hadara/
|
|
282
|
-
AGENTS.md
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
Portable/local state is not committed. Project docs, Task Capsules, and reduced public evidence are committed when they represent reproducible context.
|
|
286
|
-
|
|
287
|
-
## Optional / Deferred Integrations
|
|
288
|
-
|
|
289
|
-
Hermes and MCP surfaces exist for compatibility experiments and read-only bridge work. They are not generated by `hadara init` and are not part of the default scaffold. Use them only when a project explicitly opts into integration guidance.
|
|
298
|
+
Optional integrations are not generated by `hadara init` and are not part of the default scaffold:
|
|
290
299
|
|
|
291
300
|
```bash
|
|
292
301
|
hadara init enable-integration --integration hermes --execute --json
|
|
@@ -298,19 +307,6 @@ hadara mcp serve
|
|
|
298
307
|
|
|
299
308
|
The default MCP server remains read-only. Evidence attach is opt-in, approval-recorded, and audited.
|
|
300
309
|
|
|
301
|
-
## Deferred
|
|
302
|
-
|
|
303
|
-
These are intentionally not part of the current default runtime:
|
|
304
|
-
|
|
305
|
-
- Full multi-agent scheduler/controller.
|
|
306
|
-
- Broad MCP write tools.
|
|
307
|
-
- Shell execution through agents.
|
|
308
|
-
- Real provider execution as the default path.
|
|
309
|
-
- GitHub Release automation as a default path.
|
|
310
|
-
- Docker image publishing.
|
|
311
|
-
- Installer scripts and USB portable launchers.
|
|
312
|
-
- Live dashboard streaming.
|
|
313
|
-
|
|
314
310
|
## License
|
|
315
311
|
|
|
316
312
|
HADARA is released under the MIT License. You can use, copy, modify, distribute, and build on it under the terms in `LICENSE`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleCommandsCommand = handleCommandsCommand;
|
|
4
|
+
exports.createCommandsRegistryReport = createCommandsRegistryReport;
|
|
5
|
+
const args_1 = require("./args");
|
|
6
|
+
const capability_registry_1 = require("../services/capability-registry");
|
|
7
|
+
function handleCommandsCommand(input) {
|
|
8
|
+
const family = (0, args_1.getStringOption)(input.args, '--family');
|
|
9
|
+
const requiredness = (0, args_1.getStringOption)(input.args, '--requiredness');
|
|
10
|
+
const report = createCommandsRegistryReport({ family, requiredness });
|
|
11
|
+
if (input.jsonOutput) {
|
|
12
|
+
console.log(JSON.stringify(report, null, 2));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
for (const entry of report.commands) {
|
|
16
|
+
console.log(`${entry.id} | ${entry.family} | ${entry.requiredness} | ${entry.command}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function createCommandsRegistryReport(filters = {}) {
|
|
22
|
+
return {
|
|
23
|
+
schemaVersion: 'hadara.commands.registry.v1',
|
|
24
|
+
command: 'commands',
|
|
25
|
+
ok: true,
|
|
26
|
+
registryVersion: capability_registry_1.HADARA_COMMAND_REGISTRY_VERSION,
|
|
27
|
+
filters: {
|
|
28
|
+
family: filters.family ?? null,
|
|
29
|
+
requiredness: filters.requiredness ?? null
|
|
30
|
+
},
|
|
31
|
+
commands: (0, capability_registry_1.listCommandRegistryEntries)(filters),
|
|
32
|
+
issues: []
|
|
33
|
+
};
|
|
34
|
+
}
|
package/dist/cli/docs.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleDocsCommand = handleDocsCommand;
|
|
4
|
+
const args_1 = require("./args");
|
|
5
|
+
const docs_cleanup_1 = require("../services/docs-cleanup");
|
|
6
|
+
const docs_registry_1 = require("../services/docs-registry");
|
|
7
|
+
const managed_sections_1 = require("../services/managed-sections");
|
|
8
|
+
function handleDocsCommand(input) {
|
|
9
|
+
const sub = input.args[1];
|
|
10
|
+
if (sub === 'list') {
|
|
11
|
+
const report = (0, docs_registry_1.createDocsListReport)(input.projectRoot, {
|
|
12
|
+
status: (0, args_1.getStringOption)(input.args, '--status'),
|
|
13
|
+
readWhen: (0, args_1.getStringOption)(input.args, '--read-when')
|
|
14
|
+
});
|
|
15
|
+
printReport(report, input.jsonOutput);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (sub === 'doctor') {
|
|
19
|
+
const report = (0, docs_registry_1.createDocsDoctorReport)(input.projectRoot, (0, args_1.getStringOption)(input.args, '--scope', 'all') ?? 'all');
|
|
20
|
+
printReport(report, input.jsonOutput);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (sub === 'explain') {
|
|
24
|
+
const documentPath = (0, args_1.getStringOption)(input.args, '--path') ?? input.args[2] ?? '';
|
|
25
|
+
const report = (0, docs_registry_1.createDocsExplainReport)(input.projectRoot, documentPath);
|
|
26
|
+
printReport(report, input.jsonOutput);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (sub === 'managed') {
|
|
30
|
+
const managedSub = input.args[2];
|
|
31
|
+
if (managedSub === 'list') {
|
|
32
|
+
printReport((0, managed_sections_1.createManagedSectionsListReport)(input.projectRoot), input.jsonOutput);
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
if (managedSub === 'explain') {
|
|
36
|
+
printReport((0, managed_sections_1.createManagedSectionExplainReport)(input.projectRoot, (0, args_1.getRequiredStringOption)(input.args, '--path')), input.jsonOutput);
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (sub === 'patch') {
|
|
41
|
+
const report = (0, managed_sections_1.createDocsPatchPlanReport)(input.projectRoot, {
|
|
42
|
+
targetPath: (0, args_1.getRequiredStringOption)(input.args, '--path'),
|
|
43
|
+
sectionId: (0, args_1.getRequiredStringOption)(input.args, '--section'),
|
|
44
|
+
contentFile: (0, args_1.getRequiredStringOption)(input.args, '--content-file'),
|
|
45
|
+
mode: (0, args_1.getFlag)(input.args, '--execute') ? 'execute' : 'dry-run',
|
|
46
|
+
beforeHash: (0, args_1.getStringOption)(input.args, '--before-hash'),
|
|
47
|
+
owner: (0, args_1.getStringOption)(input.args, '--owner', 'operator') ?? 'operator'
|
|
48
|
+
});
|
|
49
|
+
printReport(report, input.jsonOutput);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (sub === 'mark') {
|
|
53
|
+
const report = (0, docs_cleanup_1.createDocsMarkReport)(input.projectRoot, {
|
|
54
|
+
documentPath: (0, args_1.getRequiredStringOption)(input.args, '--path'),
|
|
55
|
+
status: (0, args_1.getRequiredStringOption)(input.args, '--status'),
|
|
56
|
+
reason: (0, args_1.getStringOption)(input.args, '--reason'),
|
|
57
|
+
by: (0, args_1.getStringOption)(input.args, '--by'),
|
|
58
|
+
mode: (0, args_1.getFlag)(input.args, '--execute') ? 'execute' : 'dry-run',
|
|
59
|
+
beforeHash: (0, args_1.getStringOption)(input.args, '--before-hash'),
|
|
60
|
+
forceCanonical: (0, args_1.getFlag)(input.args, '--force-canonical')
|
|
61
|
+
});
|
|
62
|
+
printReport(report, input.jsonOutput);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (sub === 'archive') {
|
|
66
|
+
printReport((0, docs_cleanup_1.createDocsArchivePlanReport)(input.projectRoot, (0, args_1.getStringOption)(input.args, '--status')), input.jsonOutput);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (sub === 'required-reading') {
|
|
70
|
+
printReport((0, docs_cleanup_1.createDocsRequiredReadingReport)(input.projectRoot), input.jsonOutput);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
function printReport(report, jsonOutput) {
|
|
76
|
+
if (jsonOutput) {
|
|
77
|
+
console.log(JSON.stringify(report, null, 2));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
console.log(JSON.stringify(report, null, 2));
|
|
81
|
+
}
|