@tiangong-lca/cli 0.0.5 → 0.0.7

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.
Files changed (60) hide show
  1. package/README.md +73 -30
  2. package/dist/src/cli.js +913 -113
  3. package/dist/src/cli.js.map +1 -1
  4. package/dist/src/lib/dataset-local.js +231 -0
  5. package/dist/src/lib/dataset-local.js.map +1 -0
  6. package/dist/src/lib/dataset-references-rewrite.js +214 -0
  7. package/dist/src/lib/dataset-references-rewrite.js.map +1 -0
  8. package/dist/src/lib/dataset-validate.js +191 -0
  9. package/dist/src/lib/dataset-validate.js.map +1 -0
  10. package/dist/src/lib/flow-regen-product.js +2 -10
  11. package/dist/src/lib/flow-regen-product.js.map +1 -1
  12. package/dist/src/lib/flow-remediate.js +4 -8
  13. package/dist/src/lib/flow-remediate.js.map +1 -1
  14. package/dist/src/lib/lifecyclemodel-auto-build.js +11 -8
  15. package/dist/src/lib/lifecyclemodel-auto-build.js.map +1 -1
  16. package/dist/src/lib/lifecyclemodel-bundle-save.js +468 -0
  17. package/dist/src/lib/lifecyclemodel-bundle-save.js.map +1 -0
  18. package/dist/src/lib/lifecyclemodel-graph.js +248 -0
  19. package/dist/src/lib/lifecyclemodel-graph.js.map +1 -0
  20. package/dist/src/lib/lifecyclemodel-publish-build.js +3 -1
  21. package/dist/src/lib/lifecyclemodel-publish-build.js.map +1 -1
  22. package/dist/src/lib/lifecyclemodel-save-draft-run.js +245 -0
  23. package/dist/src/lib/lifecyclemodel-save-draft-run.js.map +1 -0
  24. package/dist/src/lib/lifecyclemodel-validate-build.js +1 -1
  25. package/dist/src/lib/lifecyclemodel-validate-build.js.map +1 -1
  26. package/dist/src/lib/process-auto-build.js +11 -8
  27. package/dist/src/lib/process-auto-build.js.map +1 -1
  28. package/dist/src/lib/process-batch-build.js +6 -3
  29. package/dist/src/lib/process-batch-build.js.map +1 -1
  30. package/dist/src/lib/process-dedup-review.js +870 -0
  31. package/dist/src/lib/process-dedup-review.js.map +1 -0
  32. package/dist/src/lib/process-payload-validation.js +50 -0
  33. package/dist/src/lib/process-payload-validation.js.map +1 -0
  34. package/dist/src/lib/process-publish-build.js +4 -6
  35. package/dist/src/lib/process-publish-build.js.map +1 -1
  36. package/dist/src/lib/process-refresh-references.js +1028 -0
  37. package/dist/src/lib/process-refresh-references.js.map +1 -0
  38. package/dist/src/lib/process-resume-build.js +4 -6
  39. package/dist/src/lib/process-resume-build.js.map +1 -1
  40. package/dist/src/lib/process-save-draft-run.js +31 -12
  41. package/dist/src/lib/process-save-draft-run.js.map +1 -1
  42. package/dist/src/lib/process-scope-statistics.js +859 -0
  43. package/dist/src/lib/process-scope-statistics.js.map +1 -0
  44. package/dist/src/lib/process-verify-rows.js +250 -0
  45. package/dist/src/lib/process-verify-rows.js.map +1 -0
  46. package/dist/src/lib/publish.js +54 -4
  47. package/dist/src/lib/publish.js.map +1 -1
  48. package/dist/src/lib/remote.js +4 -4
  49. package/dist/src/lib/remote.js.map +1 -1
  50. package/dist/src/lib/review-lifecyclemodel.js +2 -2
  51. package/dist/src/lib/review-lifecyclemodel.js.map +1 -1
  52. package/dist/src/lib/tidas-sdk-package-validator.js +28 -9
  53. package/dist/src/lib/tidas-sdk-package-validator.js.map +1 -1
  54. package/dist/src/lib/tidas-sdk-validation.js +96 -0
  55. package/dist/src/lib/tidas-sdk-validation.js.map +1 -0
  56. package/dist/src/lib/user-api-key.js +1 -1
  57. package/dist/src/lib/user-api-key.js.map +1 -1
  58. package/package.json +4 -4
  59. /package/bin/{tiangong.d.ts → tiangong-lca.d.ts} +0 -0
  60. /package/bin/{tiangong.js → tiangong-lca.js} +0 -0
package/README.md CHANGED
@@ -1,24 +1,47 @@
1
+ ---
2
+ docType: guide
3
+ scope: repo
4
+ status: active
5
+ authoritative: false
6
+ owner: cli
7
+ language: en
8
+ whenToUse:
9
+ - when installing or invoking the TianGong LCA CLI
10
+ - when checking public command examples
11
+ whenToUpdate:
12
+ - when the published CLI executable or invocation contract changes
13
+ - when user-facing command examples change
14
+ checkPaths:
15
+ - README.md
16
+ - package.json
17
+ - bin/**
18
+ - src/cli.ts
19
+ - src/main.ts
20
+ lastReviewedAt: 2026-05-08
21
+ lastReviewedCommit: 06dbec3287513cf94c5d64c73bd467ed5347f40a
22
+ ---
23
+
1
24
  # TianGong LCA CLI
2
25
 
3
- Package: `@tiangong-lca/cli` Executable: `tiangong` Node: `24.x`
26
+ Package: `@tiangong-lca/cli` Executable: `tiangong-lca` Node: `24.x`
4
27
 
5
28
  ## Run
6
29
 
7
30
  One-off published run:
8
31
 
9
32
  ```bash
10
- npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong --help
11
- npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong doctor
12
- npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong flow --help
33
+ npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong-lca --help
34
+ npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong-lca doctor
35
+ npm exec --yes --package=@tiangong-lca/cli@latest -- tiangong-lca flow --help
13
36
  ```
14
37
 
15
38
  Install the published CLI:
16
39
 
17
40
  ```bash
18
41
  npm install --global @tiangong-lca/cli
19
- tiangong --help
20
- tiangong doctor
21
- tiangong flow --help
42
+ tiangong-lca --help
43
+ tiangong-lca doctor
44
+ tiangong-lca flow --help
22
45
  ```
23
46
 
24
47
  Run from this repository:
@@ -26,7 +49,7 @@ Run from this repository:
26
49
  ```bash
27
50
  npm ci
28
51
  npm run build
29
- node ./bin/tiangong.js --help
52
+ node ./bin/tiangong-lca.js --help
30
53
  ```
31
54
 
32
55
  ## Env
@@ -78,9 +101,9 @@ Minimal `search flow` request:
78
101
  Run:
79
102
 
80
103
  ```bash
81
- tiangong search flow --input ./search-flow.request.json --json
82
- tiangong search process --input ./search-process.request.json --json
83
- tiangong search lifecyclemodel --input ./search-lifecyclemodel.request.json --json
104
+ tiangong-lca search flow --input ./search-flow.request.json --json
105
+ tiangong-lca search process --input ./search-process.request.json --json
106
+ tiangong-lca search lifecyclemodel --input ./search-lifecyclemodel.request.json --json
84
107
  ```
85
108
 
86
109
  Empty search results should be treated as empty whether the response is `[]` or `{"data":[]}`.
@@ -88,10 +111,10 @@ Empty search results should be treated as empty whether the response is `[]` or
88
111
  ## Read
89
112
 
90
113
  ```bash
91
- tiangong flow get --id <flow-id> --version <version> --json
92
- tiangong flow list --id <flow-id> --state-code 100 --limit 20 --json
93
- tiangong process get --id <process-id> --version <version> --json
94
- tiangong process list --state-code 100 --limit 20 --json
114
+ tiangong-lca flow get --id <flow-id> --version <version> --json
115
+ tiangong-lca flow list --id <flow-id> --state-code 100 --limit 20 --json
116
+ tiangong-lca process get --id <process-id> --version <version> --json
117
+ tiangong-lca process list --state-code 100 --limit 20 --json
95
118
  ```
96
119
 
97
120
  ## Real DB Flow Review
@@ -138,15 +161,15 @@ tiangong process list --state-code 100 --limit 20 --json
138
161
  Run:
139
162
 
140
163
  ```bash
141
- tiangong flow fetch-rows \
164
+ tiangong-lca flow fetch-rows \
142
165
  --refs-file ./flow-refs.json \
143
166
  --out-dir ./flow-fetch
144
167
 
145
- tiangong review flow \
168
+ tiangong-lca review flow \
146
169
  --rows-file ./flow-fetch/review-input-rows.jsonl \
147
170
  --out-dir ./flow-review
148
171
 
149
- tiangong flow materialize-decisions \
172
+ tiangong-lca flow materialize-decisions \
150
173
  --decision-file ./approved-decisions.json \
151
174
  --flow-rows-file ./flow-fetch/review-input-rows.jsonl \
152
175
  --out-dir ./flow-decisions
@@ -170,29 +193,49 @@ Key `flow materialize-decisions` outputs:
170
193
  ## Other Common Commands
171
194
 
172
195
  ```bash
173
- tiangong review process --rows-file ./process-list-report.json --out-dir ./review
174
- tiangong review process --run-root ./artifacts/process_from_flow/<run_id> --run-id <run_id> --out-dir ./review
175
- tiangong publish run --input ./publish-request.json --dry-run
176
- tiangong doctor --json
196
+ tiangong-lca process auto-build --input ./examples/process-auto-build.request.json --out-dir /abs/path/to/process-run --json
197
+ tiangong-lca process resume-build --run-dir /abs/path/to/process-run --json
198
+ tiangong-lca process publish-build --run-dir /abs/path/to/process-run --json
199
+ tiangong-lca process batch-build --input ./examples/process-batch-build.request.json --out-dir /abs/path/to/process-batch --json
200
+ tiangong-lca dataset validate --input ./rows.jsonl --type auto --out-dir /abs/path/to/dataset-validate --json
201
+ tiangong-lca dataset references rewrite --input ./rows.jsonl --from flow:<old-id>@<old-version> --to flow:<new-id>@<new-version> --out-dir /abs/path/to/dataset-rewrite --json
202
+ tiangong-lca lifecyclemodel auto-build --input ./examples/lifecyclemodel-auto-build.request.json --out-dir /abs/path/to/lifecyclemodel-run --json
203
+ tiangong-lca lifecyclemodel validate-build --run-dir /abs/path/to/lifecyclemodel-run --json
204
+ tiangong-lca lifecyclemodel publish-build --run-dir /abs/path/to/lifecyclemodel-run --json
205
+ tiangong-lca lifecyclemodel save-draft --input ./lifecyclemodels.jsonl --out-dir /abs/path/to/lifecyclemodel-save-draft --dry-run --json
206
+ tiangong-lca lifecyclemodel graph --input ./lifecyclemodels.jsonl --out-dir /abs/path/to/lifecyclemodel-graph --format all --json
207
+ tiangong-lca lifecyclemodel orchestrate plan --input ./lifecyclemodel-orchestrate.request.json --out-dir /abs/path/to/lifecyclemodel-recursive-run --json
208
+ tiangong-lca review process --rows-file ./process-list-report.json --out-dir ./review
209
+ tiangong-lca review process --run-root /abs/path/to/process-run --run-id <run_id> --out-dir ./review
210
+ tiangong-lca process save-draft --input ./patched-processes.jsonl --out-dir /abs/path/to/process-save-draft --dry-run --json
211
+ tiangong-lca process save-draft --input ./patched-processes.jsonl --out-dir /abs/path/to/process-save-draft --commit --json
212
+ tiangong-lca publish run --input ./publish-request.json --dry-run
213
+ tiangong-lca doctor --json
177
214
  ```
178
215
 
179
216
  For `publish run`, relative `out_dir` values from either the request body or `--out-dir` are resolved against the request file directory, not the shell `cwd`. Use an absolute path when you want a fixed destination independent of the request file location.
180
217
 
181
- For `review process`, `--rows-file` accepts either raw process rows as JSON/JSONL or the full JSON report emitted by `tiangong process list --json`, as long as it contains a `rows` array.
218
+ For `review process`, `--rows-file` accepts either raw process rows as JSON/JSONL or the full JSON report emitted by `tiangong-lca process list --json`, as long as it contains a `rows` array.
219
+
220
+ For `process save-draft`, canonical process payloads are validated locally with `ProcessSchema` before any `--commit` write. Schema-invalid rows remain in `outputs/save-draft-rpc/failures.jsonl` instead of being persisted.
221
+
222
+ For `lifecyclemodel save-draft`, canonical lifecyclemodel payloads are validated locally with `LifeCycleModelSchema` before any `--commit` write. Schema-invalid rows remain in `outputs/save-draft-bundle/failures.jsonl` instead of being persisted.
223
+
224
+ For `dataset references rewrite`, `--commit` executes the state-aware save-draft path for patched process and lifecyclemodel rows; without `--commit`, the command only writes local rewrite artifacts.
182
225
 
183
226
  ## More Docs
184
227
 
185
228
  - `docs/IMPLEMENTATION_GUIDE_CN.md`: maintainer-facing command contract and implementation notes
186
- - `--help`: the canonical command surface for `tiangong`, `tiangong flow`, `tiangong review`, `tiangong process`, `tiangong lifecyclemodel`, and `tiangong publish`
229
+ - `--help`: the canonical command surface for `tiangong-lca`, `tiangong-lca flow`, `tiangong-lca review`, `tiangong-lca process`, `tiangong-lca lifecyclemodel`, and `tiangong-lca publish`
187
230
  - `tiangong-lca-skills`: use the skill-specific `SKILL.md` and wrapper docs for agent workflows; the CLI README only covers the public invocation contract
188
231
 
189
232
  ## Help
190
233
 
191
234
  ```bash
192
- tiangong --help
193
- tiangong flow --help
194
- tiangong review --help
195
- tiangong process --help
196
- tiangong lifecyclemodel --help
197
- tiangong publish --help
235
+ tiangong-lca --help
236
+ tiangong-lca flow --help
237
+ tiangong-lca review --help
238
+ tiangong-lca process --help
239
+ tiangong-lca lifecyclemodel --help
240
+ tiangong-lca publish --help
198
241
  ```