@tiangong-lca/cli 0.1.0 → 0.1.2

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 (159) hide show
  1. package/README.md +58 -6
  2. package/dist/src/batch.d.ts +6 -0
  3. package/dist/src/batch.js +6 -0
  4. package/dist/src/batch.js.map +1 -0
  5. package/dist/src/cli.d.ts +161 -0
  6. package/dist/src/cli.js +130 -0
  7. package/dist/src/cli.js.map +1 -1
  8. package/dist/src/command-spec.d.ts +90 -0
  9. package/dist/src/command-spec.js +400 -0
  10. package/dist/src/command-spec.js.map +1 -0
  11. package/dist/src/lib/artifacts.d.ts +9 -0
  12. package/dist/src/lib/auth-identity-receipt.d.ts +160 -0
  13. package/dist/src/lib/auth-identity-receipt.js +634 -0
  14. package/dist/src/lib/auth-identity-receipt.js.map +1 -0
  15. package/dist/src/lib/batch/attempt-recovery.d.ts +12 -0
  16. package/dist/src/lib/batch/attempt-recovery.js +183 -0
  17. package/dist/src/lib/batch/attempt-recovery.js.map +1 -0
  18. package/dist/src/lib/batch/canonical-contracts.d.ts +21 -0
  19. package/dist/src/lib/batch/canonical-contracts.js +180 -0
  20. package/dist/src/lib/batch/canonical-contracts.js.map +1 -0
  21. package/dist/src/lib/batch/engine.d.ts +2 -0
  22. package/dist/src/lib/batch/engine.js +294 -0
  23. package/dist/src/lib/batch/engine.js.map +1 -0
  24. package/dist/src/lib/batch/errors.d.ts +51 -0
  25. package/dist/src/lib/batch/errors.js +81 -0
  26. package/dist/src/lib/batch/errors.js.map +1 -0
  27. package/dist/src/lib/batch/item-projection.d.ts +10 -0
  28. package/dist/src/lib/batch/item-projection.js +118 -0
  29. package/dist/src/lib/batch/item-projection.js.map +1 -0
  30. package/dist/src/lib/batch/run-lock.d.ts +4 -0
  31. package/dist/src/lib/batch/run-lock.js +155 -0
  32. package/dist/src/lib/batch/run-lock.js.map +1 -0
  33. package/dist/src/lib/batch/scheduler-runtime.d.ts +29 -0
  34. package/dist/src/lib/batch/scheduler-runtime.js +114 -0
  35. package/dist/src/lib/batch/scheduler-runtime.js.map +1 -0
  36. package/dist/src/lib/batch/types.d.ts +183 -0
  37. package/dist/src/lib/batch/types.js +2 -0
  38. package/dist/src/lib/batch/types.js.map +1 -0
  39. package/dist/src/lib/dataset-author.d.ts +39 -0
  40. package/dist/src/lib/dataset-bilingual.d.ts +165 -0
  41. package/dist/src/lib/dataset-classification.d.ts +279 -0
  42. package/dist/src/lib/dataset-command.d.ts +53 -0
  43. package/dist/src/lib/dataset-contract.d.ts +82 -0
  44. package/dist/src/lib/dataset-curation-queue.d.ts +219 -0
  45. package/dist/src/lib/dataset-evidence-search.d.ts +134 -0
  46. package/dist/src/lib/dataset-import-lca.d.ts +136 -0
  47. package/dist/src/lib/dataset-local.d.ts +23 -0
  48. package/dist/src/lib/dataset-maintenance-alias-request.d.ts +12 -0
  49. package/dist/src/lib/dataset-maintenance-alias-rewrite.d.ts +111 -0
  50. package/dist/src/lib/dataset-maintenance-apply.d.ts +458 -0
  51. package/dist/src/lib/dataset-maintenance-clear-account.d.ts +161 -0
  52. package/dist/src/lib/dataset-maintenance-contract.d.ts +317 -0
  53. package/dist/src/lib/dataset-maintenance-derivatives.d.ts +48 -0
  54. package/dist/src/lib/dataset-maintenance-flow-identity-approval-claim.d.ts +50 -0
  55. package/dist/src/lib/dataset-maintenance-flow-identity-capture.d.ts +110 -0
  56. package/dist/src/lib/dataset-maintenance-flow-identity-command.d.ts +15 -0
  57. package/dist/src/lib/dataset-maintenance-flow-identity-contract.d.ts +387 -0
  58. package/dist/src/lib/dataset-maintenance-flow-identity-execution-contract.d.ts +456 -0
  59. package/dist/src/lib/dataset-maintenance-flow-identity-freeze.d.ts +99 -0
  60. package/dist/src/lib/dataset-maintenance-flow-identity-plan.d.ts +85 -0
  61. package/dist/src/lib/dataset-maintenance-flow-identity-recovery.d.ts +268 -0
  62. package/dist/src/lib/dataset-maintenance-flow-identity-run.d.ts +123 -0
  63. package/dist/src/lib/dataset-maintenance-flow-identity-seal.d.ts +50 -0
  64. package/dist/src/lib/dataset-maintenance-flow-identity-verify.d.ts +85 -0
  65. package/dist/src/lib/dataset-maintenance-flow-identity-wire.d.ts +32 -0
  66. package/dist/src/lib/dataset-maintenance-pagination.d.ts +58 -0
  67. package/dist/src/lib/dataset-maintenance-plan.d.ts +40 -0
  68. package/dist/src/lib/dataset-maintenance-protected-artifacts.d.ts +16 -0
  69. package/dist/src/lib/dataset-maintenance-protected-before.d.ts +71 -0
  70. package/dist/src/lib/dataset-maintenance-protected-contract.d.ts +385 -0
  71. package/dist/src/lib/dataset-maintenance-protected-freeze.d.ts +148 -0
  72. package/dist/src/lib/dataset-maintenance-protected-preparation.d.ts +76 -0
  73. package/dist/src/lib/dataset-maintenance-protected-run.d.ts +252 -0
  74. package/dist/src/lib/dataset-maintenance-protected-seal.d.ts +93 -0
  75. package/dist/src/lib/dataset-maintenance-protected-toolchain.d.ts +31 -0
  76. package/dist/src/lib/dataset-maintenance-protected-verify.d.ts +99 -0
  77. package/dist/src/lib/dataset-maintenance-remote.d.ts +212 -0
  78. package/dist/src/lib/dataset-maintenance-support-validation.d.ts +18 -0
  79. package/dist/src/lib/dataset-maintenance-verify.d.ts +102 -0
  80. package/dist/src/lib/dataset-patch.d.ts +193 -0
  81. package/dist/src/lib/dataset-references-rewrite.d.ts +77 -0
  82. package/dist/src/lib/dataset-remote-refresh.d.ts +64 -0
  83. package/dist/src/lib/dataset-remote-verify.d.ts +168 -0
  84. package/dist/src/lib/dataset-save-draft-run.d.ts +283 -0
  85. package/dist/src/lib/dataset-save-draft-run.js +54 -21
  86. package/dist/src/lib/dataset-save-draft-run.js.map +1 -1
  87. package/dist/src/lib/dataset-source-upload-attachments.d.ts +109 -0
  88. package/dist/src/lib/dataset-validate.d.ts +62 -0
  89. package/dist/src/lib/dotenv.d.ts +6 -0
  90. package/dist/src/lib/env.d.ts +59 -0
  91. package/dist/src/lib/errors.d.ts +18 -0
  92. package/dist/src/lib/flow-build-alias-map.d.ts +80 -0
  93. package/dist/src/lib/flow-fetch-rows.d.ts +70 -0
  94. package/dist/src/lib/flow-get.d.ts +35 -0
  95. package/dist/src/lib/flow-governance.d.ts +22 -0
  96. package/dist/src/lib/flow-list.d.ts +57 -0
  97. package/dist/src/lib/flow-materialize-decisions.d.ts +67 -0
  98. package/dist/src/lib/flow-payload-validation.d.ts +32 -0
  99. package/dist/src/lib/flow-publish-reviewed-data.d.ts +262 -0
  100. package/dist/src/lib/flow-publish-version.d.ts +193 -0
  101. package/dist/src/lib/flow-qa.d.ts +289 -0
  102. package/dist/src/lib/flow-read.d.ts +70 -0
  103. package/dist/src/lib/flow-regen-product.d.ts +431 -0
  104. package/dist/src/lib/flow-remediate.d.ts +133 -0
  105. package/dist/src/lib/http.d.ts +25 -0
  106. package/dist/src/lib/http.js.map +1 -1
  107. package/dist/src/lib/identity-preflight.d.ts +235 -0
  108. package/dist/src/lib/io.d.ts +2 -0
  109. package/dist/src/lib/kb-search.d.ts +23 -0
  110. package/dist/src/lib/lca-release.d.ts +105 -0
  111. package/dist/src/lib/lifecyclemodel-auto-build.d.ts +223 -0
  112. package/dist/src/lib/lifecyclemodel-bundle-save.d.ts +71 -0
  113. package/dist/src/lib/lifecyclemodel-graph.d.ts +91 -0
  114. package/dist/src/lib/lifecyclemodel-orchestrate.d.ts +349 -0
  115. package/dist/src/lib/lifecyclemodel-publish-build.d.ts +77 -0
  116. package/dist/src/lib/lifecyclemodel-publish-resulting-process.d.ts +27 -0
  117. package/dist/src/lib/lifecyclemodel-qa.d.ts +206 -0
  118. package/dist/src/lib/lifecyclemodel-resulting-process.d.ts +204 -0
  119. package/dist/src/lib/lifecyclemodel-save-draft-run.d.ts +96 -0
  120. package/dist/src/lib/lifecyclemodel-validate-build.d.ts +78 -0
  121. package/dist/src/lib/llm.d.ts +51 -0
  122. package/dist/src/lib/package-version.d.ts +3 -0
  123. package/dist/src/lib/process-auto-build.d.ts +168 -0
  124. package/dist/src/lib/process-batch-build.d.ts +97 -0
  125. package/dist/src/lib/process-dedup-review.d.ts +253 -0
  126. package/dist/src/lib/process-flow-build-plan.d.ts +108 -0
  127. package/dist/src/lib/process-get.d.ts +26 -0
  128. package/dist/src/lib/process-list.d.ts +87 -0
  129. package/dist/src/lib/process-payload-validation.d.ts +27 -0
  130. package/dist/src/lib/process-publish-build.d.ts +148 -0
  131. package/dist/src/lib/process-qa.d.ts +243 -0
  132. package/dist/src/lib/process-refresh-references.d.ts +179 -0
  133. package/dist/src/lib/process-required-fields.d.ts +142 -0
  134. package/dist/src/lib/process-resume-build.d.ts +77 -0
  135. package/dist/src/lib/process-save-draft-run.d.ts +72 -0
  136. package/dist/src/lib/process-save-draft.d.ts +53 -0
  137. package/dist/src/lib/process-scope-statistics.d.ts +210 -0
  138. package/dist/src/lib/process-verify-rows.d.ts +71 -0
  139. package/dist/src/lib/publish.d.ts +219 -0
  140. package/dist/src/lib/remote.d.ts +19 -0
  141. package/dist/src/lib/run.d.ts +60 -0
  142. package/dist/src/lib/runtime-rulesets.d.ts +29 -0
  143. package/dist/src/lib/state-lock.d.ts +25 -0
  144. package/dist/src/lib/state-lock.js +23 -1
  145. package/dist/src/lib/state-lock.js.map +1 -1
  146. package/dist/src/lib/supabase-client.d.ts +47 -0
  147. package/dist/src/lib/supabase-data-api-contract.d.ts +304 -0
  148. package/dist/src/lib/supabase-data-api-replay.d.ts +74 -0
  149. package/dist/src/lib/supabase-json-ordered-write.d.ts +65 -0
  150. package/dist/src/lib/supabase-rest.d.ts +26 -0
  151. package/dist/src/lib/supabase-session.d.ts +115 -0
  152. package/dist/src/lib/tidas-languages.d.ts +3 -0
  153. package/dist/src/lib/tidas-sdk-package-validator.d.ts +111 -0
  154. package/dist/src/lib/tidas-sdk-validation.d.ts +42 -0
  155. package/dist/src/lib/unstructured.d.ts +32 -0
  156. package/dist/src/lib/user-api-key.d.ts +16 -0
  157. package/dist/src/lib/validation.d.ts +82 -0
  158. package/dist/src/main.d.ts +4 -0
  159. package/package.json +17 -3
@@ -0,0 +1,111 @@
1
+ import { type SafeParseIssue, type SafeParseSchema, type SdkValidationFactory } from './tidas-sdk-validation.js';
2
+ type JsonObject = Record<string, unknown>;
3
+ export type ValidationSeverity = 'error' | 'warning' | 'info';
4
+ export type ValidationIssue = {
5
+ issue_code: string;
6
+ severity: ValidationSeverity;
7
+ category: string;
8
+ file_path: string;
9
+ message: string;
10
+ location: string;
11
+ context: Record<string, unknown>;
12
+ };
13
+ type ValidationSummary = {
14
+ issue_count: number;
15
+ error_count: number;
16
+ warning_count: number;
17
+ info_count: number;
18
+ };
19
+ type CategoryValidationReport = {
20
+ category: string;
21
+ ok: boolean;
22
+ summary: ValidationSummary;
23
+ issues: ValidationIssue[];
24
+ };
25
+ export type PackageValidationReport = {
26
+ input_dir: string;
27
+ ok: boolean;
28
+ summary: ValidationSummary & {
29
+ category_count: number;
30
+ };
31
+ categories: CategoryValidationReport[];
32
+ issues: ValidationIssue[];
33
+ };
34
+ type SupportedCategory = 'contacts' | 'flowproperties' | 'flows' | 'lciamethods' | 'lifecyclemodels' | 'processes' | 'sources' | 'unitgroups';
35
+ type TidasSdkPublicModule = {
36
+ ContactSchema?: SafeParseSchema;
37
+ FlowPropertySchema?: SafeParseSchema;
38
+ FlowSchema?: SafeParseSchema;
39
+ LCIAMethodSchema?: SafeParseSchema;
40
+ LifeCycleModelSchema?: SafeParseSchema;
41
+ ProcessSchema?: SafeParseSchema;
42
+ SourceSchema?: SafeParseSchema;
43
+ UnitGroupSchema?: SafeParseSchema;
44
+ createContact?: SdkValidationFactory;
45
+ createFlowProperty?: SdkValidationFactory;
46
+ createFlow?: SdkValidationFactory;
47
+ createLCIAMethod?: SdkValidationFactory;
48
+ createLifeCycleModel?: SdkValidationFactory;
49
+ createProcess?: SdkValidationFactory;
50
+ createSource?: SdkValidationFactory;
51
+ createUnitGroup?: SdkValidationFactory;
52
+ };
53
+ declare function summarizeIssues(issues: ValidationIssue[]): ValidationSummary;
54
+ declare function buildCategoryReport(category: string, issues: ValidationIssue[]): CategoryValidationReport;
55
+ declare function buildPackageReport(inputDir: string, categoryReports: CategoryValidationReport[]): PackageValidationReport;
56
+ declare function asRecord(value: unknown): JsonObject | null;
57
+ declare function ensureArray<T>(value: T | T[] | undefined | null): T[];
58
+ declare function toLocation(pathParts: Array<string | number> | undefined): string;
59
+ declare function createInvalidJsonIssue(category: string, filePath: string, error: unknown): ValidationIssue;
60
+ declare function createValidationErrorIssue(category: string, filePath: string, error: unknown): ValidationIssue;
61
+ declare function createSchemaIssue(category: string, filePath: string, issue: SafeParseIssue): ValidationIssue;
62
+ declare function dedupeIssues(issues: ValidationIssue[]): ValidationIssue[];
63
+ declare function makeIssue(category: string, filePath: string, location: string, message: string, issueCode?: string): ValidationIssue;
64
+ export declare function validateElementaryFlowsClassificationHierarchy(classItems: Array<Record<string, unknown>>): string[];
65
+ export declare function validateProductFlowsClassificationHierarchy(classItems: Array<Record<string, unknown>>): string[];
66
+ export declare function validateProcessesClassificationHierarchy(classItems: Array<Record<string, unknown>>): string[];
67
+ declare function validateSourcesClassificationHierarchy(classItems: Array<Record<string, unknown>> | Record<string, unknown> | undefined): string[];
68
+ declare function validateLocalizedTextLanguageConstraints(node: unknown, currentPath?: string): string[];
69
+ declare function collectFlowClassificationStructureIssues(items: unknown, category: string, filePath: string, locationBase: string, requiredIdKey: '@classId' | '@catId'): ValidationIssue[];
70
+ declare function extractLocalizedTextLocation(message: string): string;
71
+ declare function collectLocalizedTextIssues(jsonItem: unknown, category: string, filePath: string): ValidationIssue[];
72
+ declare function collectFlowSchemaGapIssues(jsonItem: unknown, category: string, filePath: string): ValidationIssue[];
73
+ export declare function collectClassificationIssues(jsonItem: unknown, category: string, filePath: string): ValidationIssue[];
74
+ declare function collectSchemaIssues(schema: SafeParseSchema, jsonItem: unknown, category: SupportedCategory, filePath: string, createEntity?: SdkValidationFactory | null): ValidationIssue[];
75
+ declare function categoryValidate(jsonFilePath: string, category: SupportedCategory, schema: SafeParseSchema, createEntity?: SdkValidationFactory | null, emitLogs?: boolean): CategoryValidationReport;
76
+ declare function resolveCategorySchemas(moduleExports: TidasSdkPublicModule): Map<SupportedCategory, {
77
+ schema: SafeParseSchema;
78
+ createEntity: SdkValidationFactory | null;
79
+ }> | null;
80
+ export declare function createTidasSdkPackageValidator(moduleExports: TidasSdkPublicModule, location: string): {
81
+ location: string;
82
+ validatePackageDir: (inputDir: string, emitLogs?: boolean) => PackageValidationReport;
83
+ } | null;
84
+ export declare const __testInternals: {
85
+ summarizeIssues: typeof summarizeIssues;
86
+ buildCategoryReport: typeof buildCategoryReport;
87
+ buildPackageReport: typeof buildPackageReport;
88
+ asRecord: typeof asRecord;
89
+ ensureArray: typeof ensureArray;
90
+ toLocation: typeof toLocation;
91
+ createInvalidJsonIssue: typeof createInvalidJsonIssue;
92
+ createValidationErrorIssue: typeof createValidationErrorIssue;
93
+ createSchemaIssue: typeof createSchemaIssue;
94
+ dedupeIssues: typeof dedupeIssues;
95
+ makeIssue: typeof makeIssue;
96
+ validateElementaryFlowsClassificationHierarchy: typeof validateElementaryFlowsClassificationHierarchy;
97
+ validateProductFlowsClassificationHierarchy: typeof validateProductFlowsClassificationHierarchy;
98
+ validateProcessesClassificationHierarchy: typeof validateProcessesClassificationHierarchy;
99
+ validateSourcesClassificationHierarchy: typeof validateSourcesClassificationHierarchy;
100
+ validateLocalizedTextLanguageConstraints: typeof validateLocalizedTextLanguageConstraints;
101
+ collectFlowClassificationStructureIssues: typeof collectFlowClassificationStructureIssues;
102
+ extractLocalizedTextLocation: typeof extractLocalizedTextLocation;
103
+ collectLocalizedTextIssues: typeof collectLocalizedTextIssues;
104
+ collectFlowSchemaGapIssues: typeof collectFlowSchemaGapIssues;
105
+ collectClassificationIssues: typeof collectClassificationIssues;
106
+ collectSchemaIssues: typeof collectSchemaIssues;
107
+ categoryValidate: typeof categoryValidate;
108
+ CATEGORY_FACTORY_EXPORTS: Record<SupportedCategory, keyof TidasSdkPublicModule>;
109
+ resolveCategorySchemas: typeof resolveCategorySchemas;
110
+ };
111
+ export {};
@@ -0,0 +1,42 @@
1
+ export type SafeParseIssue = {
2
+ code?: string;
3
+ message?: string;
4
+ path?: Array<string | number>;
5
+ };
6
+ export type SafeParseResult = {
7
+ success: true;
8
+ data?: unknown;
9
+ } | {
10
+ success: false;
11
+ error?: {
12
+ issues?: SafeParseIssue[];
13
+ };
14
+ };
15
+ export type SafeParseSchema = {
16
+ safeParse: (value: unknown) => SafeParseResult;
17
+ };
18
+ export type EntityValidationConfig = {
19
+ mode: 'strict';
20
+ throwOnError: false;
21
+ deepValidation: boolean;
22
+ };
23
+ export type SdkValidationEntity = {
24
+ validateEnhanced?: () => unknown;
25
+ validate?: () => unknown;
26
+ };
27
+ export type SdkValidationFactory = (data?: unknown, validationConfig?: EntityValidationConfig) => SdkValidationEntity | unknown;
28
+ export type SchemaValidationOutcome = {
29
+ success: true;
30
+ issues: [];
31
+ result: SafeParseResult;
32
+ } | {
33
+ success: false;
34
+ issues: SafeParseIssue[];
35
+ result: unknown;
36
+ };
37
+ export declare function validationSucceeded(result: unknown): boolean;
38
+ export declare function validationIssues(result: unknown): SafeParseIssue[];
39
+ export declare function normalizeIssuePath(pathParts: Array<string | number> | undefined, separator?: string): string;
40
+ export declare function runEntityValidation(entity: unknown): unknown | null;
41
+ export declare function validateEntityWithDeepFallback(payload: unknown, createEntity: SdkValidationFactory): unknown | null;
42
+ export declare function validateSchemaWithDeepFallback(schema: SafeParseSchema, payload: unknown, createEntity?: SdkValidationFactory | null): SchemaValidationOutcome;
@@ -0,0 +1,32 @@
1
+ import type { EnvSpec } from './env.js';
2
+ import type { FetchLike } from './http.js';
3
+ export declare const UNSTRUCTURED_ENV_KEYS: {
4
+ readonly apiBaseUrl: 'TIANGONG_LCA_UNSTRUCTURED_API_BASE_URL';
5
+ readonly apiKey: 'TIANGONG_LCA_UNSTRUCTURED_API_KEY';
6
+ readonly provider: 'TIANGONG_LCA_UNSTRUCTURED_PROVIDER';
7
+ readonly model: 'TIANGONG_LCA_UNSTRUCTURED_MODEL';
8
+ readonly chunkType: 'TIANGONG_LCA_UNSTRUCTURED_CHUNK_TYPE';
9
+ readonly returnTxt: 'TIANGONG_LCA_UNSTRUCTURED_RETURN_TXT';
10
+ };
11
+ export declare const UNSTRUCTURED_ENV_SPECS: EnvSpec[];
12
+ export type UnstructuredRuntimeEnv = {
13
+ apiBaseUrl: string | null;
14
+ apiKey: string | null;
15
+ provider: string | null;
16
+ model: string | null;
17
+ chunkType: boolean;
18
+ returnTxt: boolean;
19
+ };
20
+ export type ParseUnstructuredDocumentOptions = {
21
+ env: UnstructuredRuntimeEnv;
22
+ filePath: string;
23
+ prompt?: string | null;
24
+ provider?: string | null;
25
+ model?: string | null;
26
+ chunkType?: boolean;
27
+ returnTxt?: boolean;
28
+ timeoutMs: number;
29
+ fetchImpl: FetchLike;
30
+ };
31
+ export declare function readUnstructuredRuntimeEnv(env: NodeJS.ProcessEnv): UnstructuredRuntimeEnv;
32
+ export declare function parseUnstructuredDocument(options: ParseUnstructuredDocumentOptions): Promise<unknown>;
@@ -0,0 +1,16 @@
1
+ export type UserApiKeyCredentials = {
2
+ email: string;
3
+ password: string;
4
+ };
5
+ declare function normalizeToken(value: unknown): string;
6
+ declare function normalizeCredentialValue(value: unknown): string;
7
+ export declare function decodeUserApiKey(apiKey: string): UserApiKeyCredentials | null;
8
+ export declare function requireUserApiKeyCredentials(apiKey: string): UserApiKeyCredentials;
9
+ export declare function fingerprintSecret(value: string): string;
10
+ export declare function fingerprintUserApiKey(apiKey: string): string;
11
+ export declare function redactEmail(email: string): string;
12
+ export declare const __testInternals: {
13
+ normalizeCredentialValue: typeof normalizeCredentialValue;
14
+ normalizeToken: typeof normalizeToken;
15
+ };
16
+ export {};
@@ -0,0 +1,82 @@
1
+ export declare function resolveRepoRootFrom(startDir: string): string;
2
+ export type ValidationSeverity = 'error' | 'warning' | 'info';
3
+ export type ValidationIssue = {
4
+ issue_code: string;
5
+ severity: ValidationSeverity;
6
+ category: string;
7
+ file_path: string;
8
+ message: string;
9
+ location: string;
10
+ context: Record<string, unknown>;
11
+ };
12
+ export type ValidationSummary = {
13
+ issue_count: number;
14
+ error_count: number;
15
+ warning_count: number;
16
+ info_count: number;
17
+ };
18
+ export type CategoryValidationReport = {
19
+ category: string;
20
+ ok: boolean;
21
+ summary: ValidationSummary;
22
+ issues: ValidationIssue[];
23
+ };
24
+ export type PackageValidationReport = {
25
+ input_dir: string;
26
+ ok: boolean;
27
+ summary: ValidationSummary & {
28
+ category_count: number;
29
+ };
30
+ categories: CategoryValidationReport[];
31
+ issues: ValidationIssue[];
32
+ };
33
+ export type ValidationEngine = 'sdk';
34
+ export type ValidationMode = 'auto' | 'sdk';
35
+ export type ValidationExecutionReport = {
36
+ engine: ValidationEngine;
37
+ ok: boolean;
38
+ duration_ms: number;
39
+ location: string;
40
+ report: PackageValidationReport;
41
+ command?: string[];
42
+ command_exit_code?: number | null;
43
+ };
44
+ export type ValidationComparison = {
45
+ equivalent: boolean;
46
+ differences: string[];
47
+ };
48
+ export type ValidationRunReport = {
49
+ input_dir: string;
50
+ mode: ValidationMode;
51
+ ok: boolean;
52
+ summary: {
53
+ engine_count: number;
54
+ ok_count: number;
55
+ failed_count: number;
56
+ };
57
+ files: {
58
+ report: string | null;
59
+ };
60
+ reports: ValidationExecutionReport[];
61
+ comparison: ValidationComparison | null;
62
+ };
63
+ export type RunValidationOptions = {
64
+ inputDir: string;
65
+ engine?: string;
66
+ reportFile?: string | null;
67
+ };
68
+ export type ValidationDeps = {
69
+ loadSdkModule?: () => {
70
+ location: string;
71
+ validatePackageDir: (inputDir: string, emitLogs?: boolean) => unknown;
72
+ };
73
+ };
74
+ export declare function resolveSdkModuleFromCandidates(requireFn: (candidate: string) => unknown, candidates: string[]): {
75
+ location: string;
76
+ validatePackageDir: (inputDir: string, emitLogs?: boolean) => unknown;
77
+ };
78
+ export declare function resolveLocalSdkModule(): {
79
+ location: string;
80
+ validatePackageDir: (inputDir: string, emitLogs?: boolean) => unknown;
81
+ };
82
+ export declare function runValidation(options: RunValidationOptions, deps?: ValidationDeps): Promise<ValidationRunReport>;
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export declare function main(argv: string[], env?: NodeJS.ProcessEnv): Promise<number>;
3
+ export declare function isDirectEntry(importMetaUrl: string, argv1: string | undefined): boolean;
4
+ export declare function maybeRunFromProcess(argv?: string[], env?: NodeJS.ProcessEnv, importMetaUrl?: string): Promise<number | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiangong-lca/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Unified TianGong LCA CLI with direct REST adapters and low-entropy command surface.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,17 @@
14
14
  "bin": {
15
15
  "tiangong-lca": "./bin/tiangong-lca.js"
16
16
  },
17
+ "exports": {
18
+ "./bin/tiangong-lca.js": "./bin/tiangong-lca.js",
19
+ "./command-spec": {
20
+ "types": "./dist/src/command-spec.d.ts",
21
+ "import": "./dist/src/command-spec.js"
22
+ },
23
+ "./batch": {
24
+ "types": "./dist/src/batch.d.ts",
25
+ "import": "./dist/src/batch.js"
26
+ }
27
+ },
17
28
  "files": [
18
29
  "assets/",
19
30
  "bin/",
@@ -32,8 +43,8 @@
32
43
  ]
33
44
  },
34
45
  "engines": {
35
- "node": ">=24 <25",
36
- "pnpm": "11.23.0"
46
+ "node": ">=24.19.0 <25",
47
+ "pnpm": "11.24.0"
37
48
  },
38
49
  "keywords": [
39
50
  "tiangong-lca",
@@ -49,6 +60,7 @@
49
60
  "oxlint": "^1.80.0",
50
61
  "oxlint-tsgolint": "^7.0.2001",
51
62
  "prettier": "3.8.1",
63
+ "sigstore": "5.0.0",
52
64
  "tsx": "^4.23.12",
53
65
  "typescript": "^7.0.2"
54
66
  },
@@ -74,9 +86,11 @@
74
86
  "test:package": "node --test test/toolchain-contract.test.mjs",
75
87
  "test:coverage": "pnpm build && node ./scripts/run-test-coverage.cjs",
76
88
  "test:coverage:assert-full": "node ./dist/scripts/assert-full-coverage.js",
89
+ "case:auth-identity:production": "pnpm build && node ./dist/scripts/run-auth-identity-production-case.js",
77
90
  "prepush:gate": "pnpm lint && pnpm test:package && pnpm test:coverage && pnpm test:coverage:assert-full",
78
91
  "release:check-tag": "node ./scripts/ci/check-release-tag.cjs cli",
79
92
  "release:assert-unpublished": "node ./scripts/ci/release-version.cjs assert-unpublished",
93
+ "release:verify-published": "node ./scripts/ci/verify-published-release.cjs",
80
94
  "clean": "node --eval \"import('node:fs').then(({ rmSync }) => rmSync('dist', { recursive: true, force: true }))\""
81
95
  }
82
96
  }