@tiangong-lca/cli 0.1.9 → 0.1.11

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 (82) hide show
  1. package/README.md +10 -5
  2. package/assets/runtime/cli-runtime-descriptor.schema.json +138 -0
  3. package/assets/runtime/cli-runtime-expectation.schema.json +38 -0
  4. package/assets/runtime/runtime-bootstrap-lock.schema.json +254 -0
  5. package/assets/runtime/runtime-command-result.schema.json +95 -0
  6. package/assets/runtime/runtime-manifest.schema.json +383 -0
  7. package/dist/src/cli.js +5 -1
  8. package/dist/src/cli.js.map +1 -1
  9. package/dist/src/lib/dataset-import-lca.js +2 -2
  10. package/dist/src/lib/dataset-import-lca.js.map +1 -1
  11. package/dist/src/lib/runtime/archive-writer.d.ts +7 -0
  12. package/dist/src/lib/runtime/archive-writer.js +89 -0
  13. package/dist/src/lib/runtime/archive-writer.js.map +1 -0
  14. package/dist/src/lib/runtime/archive.d.ts +2 -0
  15. package/dist/src/lib/runtime/archive.js +122 -0
  16. package/dist/src/lib/runtime/archive.js.map +1 -0
  17. package/dist/src/lib/runtime/command.d.ts +8 -0
  18. package/dist/src/lib/runtime/command.js +57 -0
  19. package/dist/src/lib/runtime/command.js.map +1 -0
  20. package/dist/src/lib/runtime/descriptor.d.ts +11 -0
  21. package/dist/src/lib/runtime/descriptor.js +126 -0
  22. package/dist/src/lib/runtime/descriptor.js.map +1 -0
  23. package/dist/src/lib/runtime/download.d.ts +9 -0
  24. package/dist/src/lib/runtime/download.js +118 -0
  25. package/dist/src/lib/runtime/download.js.map +1 -0
  26. package/dist/src/lib/runtime/exec-command.d.ts +7 -0
  27. package/dist/src/lib/runtime/exec-command.js +86 -0
  28. package/dist/src/lib/runtime/exec-command.js.map +1 -0
  29. package/dist/src/lib/runtime/execute.d.ts +12 -0
  30. package/dist/src/lib/runtime/execute.js +132 -0
  31. package/dist/src/lib/runtime/execute.js.map +1 -0
  32. package/dist/src/lib/runtime/files.d.ts +7 -0
  33. package/dist/src/lib/runtime/files.js +91 -0
  34. package/dist/src/lib/runtime/files.js.map +1 -0
  35. package/dist/src/lib/runtime/host-context-protocol.d.ts +20 -0
  36. package/dist/src/lib/runtime/host-context-protocol.js +83 -0
  37. package/dist/src/lib/runtime/host-context-protocol.js.map +1 -0
  38. package/dist/src/lib/runtime/host-context-server.d.ts +6 -0
  39. package/dist/src/lib/runtime/host-context-server.js +81 -0
  40. package/dist/src/lib/runtime/host-context-server.js.map +1 -0
  41. package/dist/src/lib/runtime/host-context.d.ts +23 -0
  42. package/dist/src/lib/runtime/host-context.js +122 -0
  43. package/dist/src/lib/runtime/host-context.js.map +1 -0
  44. package/dist/src/lib/runtime/host.d.ts +8 -0
  45. package/dist/src/lib/runtime/host.js +37 -0
  46. package/dist/src/lib/runtime/host.js.map +1 -0
  47. package/dist/src/lib/runtime/leases.d.ts +12 -0
  48. package/dist/src/lib/runtime/leases.js +72 -0
  49. package/dist/src/lib/runtime/leases.js.map +1 -0
  50. package/dist/src/lib/runtime/managed-command.d.ts +6 -0
  51. package/dist/src/lib/runtime/managed-command.js +99 -0
  52. package/dist/src/lib/runtime/managed-command.js.map +1 -0
  53. package/dist/src/lib/runtime/manager.d.ts +33 -0
  54. package/dist/src/lib/runtime/manager.js +196 -0
  55. package/dist/src/lib/runtime/manager.js.map +1 -0
  56. package/dist/src/lib/runtime/manifest-types.d.ts +82 -0
  57. package/dist/src/lib/runtime/manifest-types.js +5 -0
  58. package/dist/src/lib/runtime/manifest-types.js.map +1 -0
  59. package/dist/src/lib/runtime/manifest-values.d.ts +15 -0
  60. package/dist/src/lib/runtime/manifest-values.js +124 -0
  61. package/dist/src/lib/runtime/manifest-values.js.map +1 -0
  62. package/dist/src/lib/runtime/manifest.d.ts +8 -0
  63. package/dist/src/lib/runtime/manifest.js +239 -0
  64. package/dist/src/lib/runtime/manifest.js.map +1 -0
  65. package/dist/src/lib/runtime/process.d.ts +4 -0
  66. package/dist/src/lib/runtime/process.js +69 -0
  67. package/dist/src/lib/runtime/process.js.map +1 -0
  68. package/dist/src/lib/runtime/storage.d.ts +8 -0
  69. package/dist/src/lib/runtime/storage.js +142 -0
  70. package/dist/src/lib/runtime/storage.js.map +1 -0
  71. package/dist/src/lib/runtime/types.d.ts +45 -0
  72. package/dist/src/lib/runtime/types.js +9 -0
  73. package/dist/src/lib/runtime/types.js.map +1 -0
  74. package/dist/src/lib/runtime/work-directory.d.ts +2 -0
  75. package/dist/src/lib/runtime/work-directory.js +16 -0
  76. package/dist/src/lib/runtime/work-directory.js.map +1 -0
  77. package/dist/src/main.js +13 -1
  78. package/dist/src/main.js.map +1 -1
  79. package/dist/src/runtime.d.ts +16 -0
  80. package/dist/src/runtime.js +23 -0
  81. package/dist/src/runtime.js.map +1 -0
  82. package/package.json +5 -1
@@ -0,0 +1,383 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:tiangong-lca:runtime-manifest:v1",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schema",
8
+ "bootstrap_protocol",
9
+ "product",
10
+ "minimum_hosts",
11
+ "workspace",
12
+ "components",
13
+ "launches"
14
+ ],
15
+ "properties": {
16
+ "schema": {
17
+ "const": "tiangong-lca.runtime-manifest.v1"
18
+ },
19
+ "bootstrap_protocol": {
20
+ "const": "tiangong-lca.runtime-bootstrap.v1"
21
+ },
22
+ "product": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["id", "version"],
26
+ "properties": {
27
+ "id": {
28
+ "type": "string",
29
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
30
+ },
31
+ "version": {
32
+ "type": "string",
33
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
34
+ }
35
+ }
36
+ },
37
+ "minimum_hosts": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "minProperties": 1,
41
+ "properties": {
42
+ "darwin-arm64": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["os_release", "glibc"],
46
+ "properties": {
47
+ "os_release": {
48
+ "type": "string",
49
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
50
+ },
51
+ "glibc": {
52
+ "type": "null"
53
+ }
54
+ }
55
+ },
56
+ "linux-x64": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["os_release", "glibc"],
60
+ "properties": {
61
+ "os_release": {
62
+ "type": "string",
63
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
64
+ },
65
+ "glibc": {
66
+ "type": "string",
67
+ "pattern": "^[0-9]+\\.[0-9]+$"
68
+ }
69
+ }
70
+ },
71
+ "linux-arm64": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["os_release", "glibc"],
75
+ "properties": {
76
+ "os_release": {
77
+ "type": "string",
78
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
79
+ },
80
+ "glibc": {
81
+ "type": "string",
82
+ "pattern": "^[0-9]+\\.[0-9]+$"
83
+ }
84
+ }
85
+ },
86
+ "win32-x64": {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": ["os_release", "glibc"],
90
+ "properties": {
91
+ "os_release": {
92
+ "type": "string",
93
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
94
+ },
95
+ "glibc": {
96
+ "type": "null"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ },
102
+ "workspace": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["read", "write"],
106
+ "properties": {
107
+ "read": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["schema", "features"],
113
+ "properties": {
114
+ "schema": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 256
118
+ },
119
+ "features": {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string",
123
+ "minLength": 1,
124
+ "maxLength": 256
125
+ },
126
+ "maxItems": 64,
127
+ "minItems": 0
128
+ }
129
+ }
130
+ },
131
+ "maxItems": 32,
132
+ "minItems": 0
133
+ },
134
+ "write": {
135
+ "type": "array",
136
+ "items": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["schema", "features"],
140
+ "properties": {
141
+ "schema": {
142
+ "type": "string",
143
+ "minLength": 1,
144
+ "maxLength": 256
145
+ },
146
+ "features": {
147
+ "type": "array",
148
+ "items": {
149
+ "type": "string",
150
+ "minLength": 1,
151
+ "maxLength": 256
152
+ },
153
+ "maxItems": 64,
154
+ "minItems": 0
155
+ }
156
+ }
157
+ },
158
+ "maxItems": 32,
159
+ "minItems": 0
160
+ }
161
+ }
162
+ },
163
+ "components": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "object",
167
+ "additionalProperties": false,
168
+ "required": [
169
+ "id",
170
+ "version",
171
+ "platform",
172
+ "archive",
173
+ "files",
174
+ "content_sha256",
175
+ "production_lock",
176
+ "sbom",
177
+ "licenses",
178
+ "provenance",
179
+ "protocols",
180
+ "asset_fingerprints"
181
+ ],
182
+ "properties": {
183
+ "id": {
184
+ "type": "string",
185
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
186
+ },
187
+ "version": {
188
+ "type": "string",
189
+ "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
190
+ },
191
+ "platform": {
192
+ "enum": ["darwin-arm64", "linux-x64", "linux-arm64", "win32-x64"]
193
+ },
194
+ "archive": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": ["format", "url", "bytes", "sha256"],
198
+ "properties": {
199
+ "format": {
200
+ "const": "tar-gzip-ustar-v1"
201
+ },
202
+ "url": {
203
+ "type": "string",
204
+ "format": "uri",
205
+ "maxLength": 4096
206
+ },
207
+ "bytes": {
208
+ "type": "integer",
209
+ "minimum": 1,
210
+ "maximum": 536870912
211
+ },
212
+ "sha256": {
213
+ "type": "string",
214
+ "pattern": "^[0-9a-f]{64}$"
215
+ }
216
+ }
217
+ },
218
+ "files": {
219
+ "type": "array",
220
+ "items": {
221
+ "type": "object",
222
+ "additionalProperties": false,
223
+ "required": ["path", "bytes", "sha256", "mode"],
224
+ "properties": {
225
+ "path": {
226
+ "type": "string",
227
+ "minLength": 1,
228
+ "maxLength": 255
229
+ },
230
+ "bytes": {
231
+ "type": "integer",
232
+ "minimum": 0,
233
+ "maximum": 536870912
234
+ },
235
+ "sha256": {
236
+ "type": "string",
237
+ "pattern": "^[0-9a-f]{64}$"
238
+ },
239
+ "mode": {
240
+ "enum": [420, 493]
241
+ }
242
+ }
243
+ },
244
+ "maxItems": 50000,
245
+ "minItems": 1
246
+ },
247
+ "content_sha256": {
248
+ "type": "string",
249
+ "pattern": "^[0-9a-f]{64}$"
250
+ },
251
+ "production_lock": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 255
255
+ },
256
+ "sbom": {
257
+ "type": "string",
258
+ "minLength": 1,
259
+ "maxLength": 255
260
+ },
261
+ "licenses": {
262
+ "type": "array",
263
+ "items": {
264
+ "type": "string",
265
+ "minLength": 1,
266
+ "maxLength": 255
267
+ },
268
+ "maxItems": 64,
269
+ "minItems": 1
270
+ },
271
+ "provenance": {
272
+ "type": "array",
273
+ "items": {
274
+ "type": "string",
275
+ "minLength": 1,
276
+ "maxLength": 255
277
+ },
278
+ "maxItems": 64,
279
+ "minItems": 1
280
+ },
281
+ "protocols": {
282
+ "type": "array",
283
+ "items": {
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "maxLength": 256
287
+ },
288
+ "maxItems": 32,
289
+ "minItems": 1
290
+ },
291
+ "asset_fingerprints": {
292
+ "type": "object",
293
+ "maxProperties": 64,
294
+ "additionalProperties": {
295
+ "type": "string",
296
+ "pattern": "^[0-9a-f]{64}$"
297
+ }
298
+ }
299
+ }
300
+ },
301
+ "maxItems": 128,
302
+ "minItems": 1
303
+ },
304
+ "launches": {
305
+ "type": "array",
306
+ "items": {
307
+ "type": "object",
308
+ "additionalProperties": false,
309
+ "required": ["id", "platform", "executable", "environment", "argv"],
310
+ "properties": {
311
+ "id": {
312
+ "type": "string",
313
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
314
+ },
315
+ "platform": {
316
+ "enum": ["darwin-arm64", "linux-x64", "linux-arm64", "win32-x64"]
317
+ },
318
+ "executable": {
319
+ "type": "object",
320
+ "additionalProperties": false,
321
+ "required": ["component", "path"],
322
+ "properties": {
323
+ "component": {
324
+ "type": "string",
325
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
326
+ },
327
+ "path": {
328
+ "type": "string",
329
+ "minLength": 1,
330
+ "maxLength": 255
331
+ }
332
+ }
333
+ },
334
+ "environment": {
335
+ "enum": ["isolated", "cli-auth"]
336
+ },
337
+ "context_protocol": {
338
+ "const": "tiangong-lca.runtime-host.v1"
339
+ },
340
+ "argv": {
341
+ "type": "array",
342
+ "items": {
343
+ "oneOf": [
344
+ {
345
+ "type": "object",
346
+ "additionalProperties": false,
347
+ "required": ["component", "path"],
348
+ "properties": {
349
+ "component": {
350
+ "type": "string",
351
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
352
+ },
353
+ "path": {
354
+ "type": "string",
355
+ "minLength": 1,
356
+ "maxLength": 255
357
+ }
358
+ }
359
+ },
360
+ {
361
+ "type": "object",
362
+ "additionalProperties": false,
363
+ "required": ["literal"],
364
+ "properties": {
365
+ "literal": {
366
+ "type": "string",
367
+ "minLength": 1,
368
+ "maxLength": 4096
369
+ }
370
+ }
371
+ }
372
+ ]
373
+ },
374
+ "maxItems": 32,
375
+ "minItems": 0
376
+ }
377
+ }
378
+ },
379
+ "maxItems": 64,
380
+ "minItems": 1
381
+ }
382
+ }
383
+ }
package/dist/src/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { parseArgs } from 'node:util';
2
+ import { runRuntimeCommand } from './lib/runtime/command.js';
2
3
  import { buildDoctorReport, readRuntimeEnv } from './lib/env.js';
3
4
  import { CliError, toErrorPayload } from './lib/errors.js';
4
5
  import { stringifyJson } from './lib/io.js';
@@ -91,6 +92,7 @@ Usage:
91
92
  Commands:
92
93
  Implemented Commands:
93
94
  doctor show environment diagnostics
95
+ runtime describe | ensure | status | prune | lease-release | exec
94
96
  auth login | status | whoami | doctor-auth | logout | identity-receipt
95
97
  search flow | process | lifecyclemodel
96
98
  process get | list | identity-preflight | build-plan | scope-statistics | dedup-review | auto-build | resume-build | publish-build | complete-required-fields | save-draft | batch-build | refresh-references | verify-rows
@@ -981,7 +983,7 @@ Outputs written under --output-dir:
981
983
  - mapping.csv.gz when --write-mapping is used
982
984
 
983
985
  Runtime contract:
984
- - Linux x86_64/ARM64, macOS Intel/Apple Silicon, and Windows x86_64 are supported.
986
+ - Linux x86_64/ARM64, macOS Apple Silicon (arm64), and Windows x86_64 are supported.
985
987
  - Windows ARM64 is unsupported.
986
988
  - The binary must report tidas.operation-report.v1 and a stable 0.2.x version.
987
989
  - Import publication, cancellation cleanup, and domain validation remain owned by Rust tidas.
@@ -5806,6 +5808,8 @@ export async function executeCli(argv, deps) {
5806
5808
  if (!command || command === 'help' || flags.help) {
5807
5809
  return { exitCode: 0, stdout: `${renderMainHelp(deps.dotEnvStatus)}\n`, stderr: '' };
5808
5810
  }
5811
+ if (command === 'runtime')
5812
+ return await runRuntimeCommand(subcommand, commandArgs, undefined, deps.fetchImpl, deps.env);
5809
5813
  if (command === 'doctor') {
5810
5814
  const doctorFlags = parseDoctorFlags(commandArgs);
5811
5815
  if (doctorFlags.help) {