@tiangong-lca/cli 0.1.1 → 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.
- package/README.md +26 -6
- package/dist/src/batch.d.ts +6 -0
- package/dist/src/batch.js +6 -0
- package/dist/src/batch.js.map +1 -0
- package/dist/src/cli.d.ts +161 -0
- package/dist/src/command-spec.d.ts +90 -0
- package/dist/src/command-spec.js +400 -0
- package/dist/src/command-spec.js.map +1 -0
- package/dist/src/lib/artifacts.d.ts +9 -0
- package/dist/src/lib/auth-identity-receipt.d.ts +160 -0
- package/dist/src/lib/batch/attempt-recovery.d.ts +12 -0
- package/dist/src/lib/batch/attempt-recovery.js +183 -0
- package/dist/src/lib/batch/attempt-recovery.js.map +1 -0
- package/dist/src/lib/batch/canonical-contracts.d.ts +21 -0
- package/dist/src/lib/batch/canonical-contracts.js +180 -0
- package/dist/src/lib/batch/canonical-contracts.js.map +1 -0
- package/dist/src/lib/batch/engine.d.ts +2 -0
- package/dist/src/lib/batch/engine.js +294 -0
- package/dist/src/lib/batch/engine.js.map +1 -0
- package/dist/src/lib/batch/errors.d.ts +51 -0
- package/dist/src/lib/batch/errors.js +81 -0
- package/dist/src/lib/batch/errors.js.map +1 -0
- package/dist/src/lib/batch/item-projection.d.ts +10 -0
- package/dist/src/lib/batch/item-projection.js +118 -0
- package/dist/src/lib/batch/item-projection.js.map +1 -0
- package/dist/src/lib/batch/run-lock.d.ts +4 -0
- package/dist/src/lib/batch/run-lock.js +155 -0
- package/dist/src/lib/batch/run-lock.js.map +1 -0
- package/dist/src/lib/batch/scheduler-runtime.d.ts +29 -0
- package/dist/src/lib/batch/scheduler-runtime.js +114 -0
- package/dist/src/lib/batch/scheduler-runtime.js.map +1 -0
- package/dist/src/lib/batch/types.d.ts +183 -0
- package/dist/src/lib/batch/types.js +2 -0
- package/dist/src/lib/batch/types.js.map +1 -0
- package/dist/src/lib/dataset-author.d.ts +39 -0
- package/dist/src/lib/dataset-bilingual.d.ts +165 -0
- package/dist/src/lib/dataset-classification.d.ts +279 -0
- package/dist/src/lib/dataset-command.d.ts +53 -0
- package/dist/src/lib/dataset-contract.d.ts +82 -0
- package/dist/src/lib/dataset-curation-queue.d.ts +219 -0
- package/dist/src/lib/dataset-evidence-search.d.ts +134 -0
- package/dist/src/lib/dataset-import-lca.d.ts +136 -0
- package/dist/src/lib/dataset-local.d.ts +23 -0
- package/dist/src/lib/dataset-maintenance-alias-request.d.ts +12 -0
- package/dist/src/lib/dataset-maintenance-alias-rewrite.d.ts +111 -0
- package/dist/src/lib/dataset-maintenance-apply.d.ts +458 -0
- package/dist/src/lib/dataset-maintenance-clear-account.d.ts +161 -0
- package/dist/src/lib/dataset-maintenance-contract.d.ts +317 -0
- package/dist/src/lib/dataset-maintenance-derivatives.d.ts +48 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-approval-claim.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-capture.d.ts +110 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-command.d.ts +15 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-contract.d.ts +387 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-execution-contract.d.ts +456 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-freeze.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-plan.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-recovery.d.ts +268 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-run.d.ts +123 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-seal.d.ts +50 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-verify.d.ts +85 -0
- package/dist/src/lib/dataset-maintenance-flow-identity-wire.d.ts +32 -0
- package/dist/src/lib/dataset-maintenance-pagination.d.ts +58 -0
- package/dist/src/lib/dataset-maintenance-plan.d.ts +40 -0
- package/dist/src/lib/dataset-maintenance-protected-artifacts.d.ts +16 -0
- package/dist/src/lib/dataset-maintenance-protected-before.d.ts +71 -0
- package/dist/src/lib/dataset-maintenance-protected-contract.d.ts +385 -0
- package/dist/src/lib/dataset-maintenance-protected-freeze.d.ts +148 -0
- package/dist/src/lib/dataset-maintenance-protected-preparation.d.ts +76 -0
- package/dist/src/lib/dataset-maintenance-protected-run.d.ts +252 -0
- package/dist/src/lib/dataset-maintenance-protected-seal.d.ts +93 -0
- package/dist/src/lib/dataset-maintenance-protected-toolchain.d.ts +31 -0
- package/dist/src/lib/dataset-maintenance-protected-verify.d.ts +99 -0
- package/dist/src/lib/dataset-maintenance-remote.d.ts +212 -0
- package/dist/src/lib/dataset-maintenance-support-validation.d.ts +18 -0
- package/dist/src/lib/dataset-maintenance-verify.d.ts +102 -0
- package/dist/src/lib/dataset-patch.d.ts +193 -0
- package/dist/src/lib/dataset-references-rewrite.d.ts +77 -0
- package/dist/src/lib/dataset-remote-refresh.d.ts +64 -0
- package/dist/src/lib/dataset-remote-verify.d.ts +168 -0
- package/dist/src/lib/dataset-save-draft-run.d.ts +283 -0
- package/dist/src/lib/dataset-save-draft-run.js +54 -21
- package/dist/src/lib/dataset-save-draft-run.js.map +1 -1
- package/dist/src/lib/dataset-source-upload-attachments.d.ts +109 -0
- package/dist/src/lib/dataset-validate.d.ts +62 -0
- package/dist/src/lib/dotenv.d.ts +6 -0
- package/dist/src/lib/env.d.ts +59 -0
- package/dist/src/lib/errors.d.ts +18 -0
- package/dist/src/lib/flow-build-alias-map.d.ts +80 -0
- package/dist/src/lib/flow-fetch-rows.d.ts +70 -0
- package/dist/src/lib/flow-get.d.ts +35 -0
- package/dist/src/lib/flow-governance.d.ts +22 -0
- package/dist/src/lib/flow-list.d.ts +57 -0
- package/dist/src/lib/flow-materialize-decisions.d.ts +67 -0
- package/dist/src/lib/flow-payload-validation.d.ts +32 -0
- package/dist/src/lib/flow-publish-reviewed-data.d.ts +262 -0
- package/dist/src/lib/flow-publish-version.d.ts +193 -0
- package/dist/src/lib/flow-qa.d.ts +289 -0
- package/dist/src/lib/flow-read.d.ts +70 -0
- package/dist/src/lib/flow-regen-product.d.ts +431 -0
- package/dist/src/lib/flow-remediate.d.ts +133 -0
- package/dist/src/lib/http.d.ts +25 -0
- package/dist/src/lib/identity-preflight.d.ts +235 -0
- package/dist/src/lib/io.d.ts +2 -0
- package/dist/src/lib/kb-search.d.ts +23 -0
- package/dist/src/lib/lca-release.d.ts +105 -0
- package/dist/src/lib/lifecyclemodel-auto-build.d.ts +223 -0
- package/dist/src/lib/lifecyclemodel-bundle-save.d.ts +71 -0
- package/dist/src/lib/lifecyclemodel-graph.d.ts +91 -0
- package/dist/src/lib/lifecyclemodel-orchestrate.d.ts +349 -0
- package/dist/src/lib/lifecyclemodel-publish-build.d.ts +77 -0
- package/dist/src/lib/lifecyclemodel-publish-resulting-process.d.ts +27 -0
- package/dist/src/lib/lifecyclemodel-qa.d.ts +206 -0
- package/dist/src/lib/lifecyclemodel-resulting-process.d.ts +204 -0
- package/dist/src/lib/lifecyclemodel-save-draft-run.d.ts +96 -0
- package/dist/src/lib/lifecyclemodel-validate-build.d.ts +78 -0
- package/dist/src/lib/llm.d.ts +51 -0
- package/dist/src/lib/package-version.d.ts +3 -0
- package/dist/src/lib/process-auto-build.d.ts +168 -0
- package/dist/src/lib/process-batch-build.d.ts +97 -0
- package/dist/src/lib/process-dedup-review.d.ts +253 -0
- package/dist/src/lib/process-flow-build-plan.d.ts +108 -0
- package/dist/src/lib/process-get.d.ts +26 -0
- package/dist/src/lib/process-list.d.ts +87 -0
- package/dist/src/lib/process-payload-validation.d.ts +27 -0
- package/dist/src/lib/process-publish-build.d.ts +148 -0
- package/dist/src/lib/process-qa.d.ts +243 -0
- package/dist/src/lib/process-refresh-references.d.ts +179 -0
- package/dist/src/lib/process-required-fields.d.ts +142 -0
- package/dist/src/lib/process-resume-build.d.ts +77 -0
- package/dist/src/lib/process-save-draft-run.d.ts +72 -0
- package/dist/src/lib/process-save-draft.d.ts +53 -0
- package/dist/src/lib/process-scope-statistics.d.ts +210 -0
- package/dist/src/lib/process-verify-rows.d.ts +71 -0
- package/dist/src/lib/publish.d.ts +219 -0
- package/dist/src/lib/remote.d.ts +19 -0
- package/dist/src/lib/run.d.ts +60 -0
- package/dist/src/lib/runtime-rulesets.d.ts +29 -0
- package/dist/src/lib/state-lock.d.ts +25 -0
- package/dist/src/lib/state-lock.js +23 -1
- package/dist/src/lib/state-lock.js.map +1 -1
- package/dist/src/lib/supabase-client.d.ts +47 -0
- package/dist/src/lib/supabase-data-api-contract.d.ts +304 -0
- package/dist/src/lib/supabase-data-api-replay.d.ts +74 -0
- package/dist/src/lib/supabase-json-ordered-write.d.ts +65 -0
- package/dist/src/lib/supabase-rest.d.ts +26 -0
- package/dist/src/lib/supabase-session.d.ts +115 -0
- package/dist/src/lib/tidas-languages.d.ts +3 -0
- package/dist/src/lib/tidas-sdk-package-validator.d.ts +111 -0
- package/dist/src/lib/tidas-sdk-validation.d.ts +42 -0
- package/dist/src/lib/unstructured.d.ts +32 -0
- package/dist/src/lib/user-api-key.d.ts +16 -0
- package/dist/src/lib/validation.d.ts +82 -0
- package/dist/src/main.d.ts +4 -0
- package/package.json +13 -2
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { ValidationIssue } from './validation.js';
|
|
2
|
+
type JsonObject = Record<string, unknown>;
|
|
3
|
+
type ModelEntry = {
|
|
4
|
+
runName: string;
|
|
5
|
+
modelFiles: string[];
|
|
6
|
+
summaryPath: string;
|
|
7
|
+
connectionsPath: string;
|
|
8
|
+
processCatalogPath: string;
|
|
9
|
+
inputMode: 'run_dir' | 'rows_file';
|
|
10
|
+
};
|
|
11
|
+
type ModelFileReviewInfo = {
|
|
12
|
+
modelFile: string;
|
|
13
|
+
modelUuid: string;
|
|
14
|
+
modelVersion: string;
|
|
15
|
+
referenceProcessInternalId: string | null;
|
|
16
|
+
resultingProcessUuid: string | null;
|
|
17
|
+
processInstanceCount: number;
|
|
18
|
+
zeroMultiplicationFactorCount: number;
|
|
19
|
+
};
|
|
20
|
+
type LifecyclemodelValidationAggregate = {
|
|
21
|
+
ok: boolean | null;
|
|
22
|
+
reportPath: string | null;
|
|
23
|
+
modelReports: Map<string, LifecyclemodelModelValidationSummary>;
|
|
24
|
+
};
|
|
25
|
+
type LifecyclemodelModelValidationSummary = {
|
|
26
|
+
ok: boolean | null;
|
|
27
|
+
reportFile: string | null;
|
|
28
|
+
engineCount: number;
|
|
29
|
+
issues: ValidationIssue[];
|
|
30
|
+
};
|
|
31
|
+
type SeverityCounts = {
|
|
32
|
+
error: number;
|
|
33
|
+
warning: number;
|
|
34
|
+
info: number;
|
|
35
|
+
};
|
|
36
|
+
export type LifecyclemodelQaFinding = {
|
|
37
|
+
run_name: string;
|
|
38
|
+
model_file: string | null;
|
|
39
|
+
severity: 'error' | 'warning' | 'info';
|
|
40
|
+
rule_id: string;
|
|
41
|
+
source: 'validation' | 'qa';
|
|
42
|
+
message: string;
|
|
43
|
+
evidence: JsonObject;
|
|
44
|
+
};
|
|
45
|
+
export type LifecyclemodelQaModelSummary = {
|
|
46
|
+
run_name: string;
|
|
47
|
+
model_files: string[];
|
|
48
|
+
model_uuids: string[];
|
|
49
|
+
model_versions: string[];
|
|
50
|
+
reference_process_uuids: string[];
|
|
51
|
+
reference_process_internal_ids: string[];
|
|
52
|
+
resulting_process_uuids: string[];
|
|
53
|
+
summary_process_count: number | null;
|
|
54
|
+
process_instance_count: number;
|
|
55
|
+
summary_edge_count: number | null;
|
|
56
|
+
connection_count: number | null;
|
|
57
|
+
process_catalog_count: number | null;
|
|
58
|
+
multiplication_factor_count: number;
|
|
59
|
+
zero_multiplication_factor_count: number;
|
|
60
|
+
validation: {
|
|
61
|
+
available: boolean;
|
|
62
|
+
ok: boolean | null;
|
|
63
|
+
report_file: string | null;
|
|
64
|
+
engine_count: number;
|
|
65
|
+
issue_count: number;
|
|
66
|
+
};
|
|
67
|
+
artifacts: {
|
|
68
|
+
summary: string | null;
|
|
69
|
+
connections: string | null;
|
|
70
|
+
process_catalog: string | null;
|
|
71
|
+
};
|
|
72
|
+
finding_count: number;
|
|
73
|
+
severity_counts: SeverityCounts;
|
|
74
|
+
};
|
|
75
|
+
export type LifecyclemodelQaReport = {
|
|
76
|
+
schema_version: 1;
|
|
77
|
+
generated_at_utc: string;
|
|
78
|
+
status: 'completed_local_lifecyclemodel_qa';
|
|
79
|
+
run_id: string;
|
|
80
|
+
run_root: string;
|
|
81
|
+
rows_file: string;
|
|
82
|
+
input_mode: 'run_dir' | 'rows_file';
|
|
83
|
+
out_dir: string;
|
|
84
|
+
logic_version: string;
|
|
85
|
+
model_count: number;
|
|
86
|
+
finding_count: number;
|
|
87
|
+
severity_counts: SeverityCounts;
|
|
88
|
+
validation: {
|
|
89
|
+
available: boolean;
|
|
90
|
+
ok: boolean | null;
|
|
91
|
+
report: string | null;
|
|
92
|
+
};
|
|
93
|
+
files: {
|
|
94
|
+
run_manifest: string;
|
|
95
|
+
invocation_index: string;
|
|
96
|
+
qa_input_summary: string | null;
|
|
97
|
+
validation_report: string | null;
|
|
98
|
+
model_summaries: string;
|
|
99
|
+
findings: string;
|
|
100
|
+
summary: string;
|
|
101
|
+
qa_zh: string;
|
|
102
|
+
qa_en: string;
|
|
103
|
+
timing: string;
|
|
104
|
+
report: string;
|
|
105
|
+
};
|
|
106
|
+
model_summaries: LifecyclemodelQaModelSummary[];
|
|
107
|
+
next_actions: string[];
|
|
108
|
+
};
|
|
109
|
+
export type RunLifecyclemodelQaOptions = {
|
|
110
|
+
runDir?: string;
|
|
111
|
+
rowsFile?: string;
|
|
112
|
+
outDir: string;
|
|
113
|
+
startTs?: string;
|
|
114
|
+
endTs?: string;
|
|
115
|
+
logicVersion?: string;
|
|
116
|
+
now?: () => Date;
|
|
117
|
+
cwd?: string;
|
|
118
|
+
};
|
|
119
|
+
export type LifecyclemodelQaLayout = {
|
|
120
|
+
runId: string;
|
|
121
|
+
runRoot: string;
|
|
122
|
+
rowsFile: string;
|
|
123
|
+
inputMode: 'run_dir' | 'rows_file';
|
|
124
|
+
outDir: string;
|
|
125
|
+
modelsDir: string;
|
|
126
|
+
reportsDir: string;
|
|
127
|
+
manifestsDir: string;
|
|
128
|
+
runManifestPath: string;
|
|
129
|
+
invocationIndexPath: string;
|
|
130
|
+
validationReportPath: string;
|
|
131
|
+
qaInputSummaryPath: string | null;
|
|
132
|
+
modelSummariesPath: string;
|
|
133
|
+
findingsPath: string;
|
|
134
|
+
summaryPath: string;
|
|
135
|
+
reviewZhPath: string;
|
|
136
|
+
reviewEnPath: string;
|
|
137
|
+
timingPath: string;
|
|
138
|
+
reportPath: string;
|
|
139
|
+
};
|
|
140
|
+
declare function sanitizeFileName(value: unknown): string;
|
|
141
|
+
declare function buildLayout(options: {
|
|
142
|
+
runRoot: string;
|
|
143
|
+
outDir: string;
|
|
144
|
+
rowsFile?: string;
|
|
145
|
+
inputMode?: 'run_dir' | 'rows_file';
|
|
146
|
+
}): LifecyclemodelQaLayout;
|
|
147
|
+
declare function resolveLayout(options: RunLifecyclemodelQaOptions): LifecyclemodelQaLayout;
|
|
148
|
+
declare function readInvocationIndex(layout: LifecyclemodelQaLayout): JsonObject;
|
|
149
|
+
declare function discoverModelEntries(layout: LifecyclemodelQaLayout): ModelEntry[];
|
|
150
|
+
declare function materializeRowsFile(layout: LifecyclemodelQaLayout): {
|
|
151
|
+
invocationIndex: JsonObject;
|
|
152
|
+
validationAggregate: LifecyclemodelValidationAggregate;
|
|
153
|
+
modelEntries: ModelEntry[];
|
|
154
|
+
};
|
|
155
|
+
declare function readValidationAggregate(layout: LifecyclemodelQaLayout): LifecyclemodelValidationAggregate;
|
|
156
|
+
declare function readModelFileReviewInfo(filePath: string): ModelFileReviewInfo;
|
|
157
|
+
declare function buildModelReview(entry: ModelEntry, validationAggregate: LifecyclemodelValidationAggregate): {
|
|
158
|
+
summary: LifecyclemodelQaModelSummary;
|
|
159
|
+
findings: LifecyclemodelQaFinding[];
|
|
160
|
+
};
|
|
161
|
+
declare function buildInvocationIndex(layout: LifecyclemodelQaLayout, invocationIndex: JsonObject, options: RunLifecyclemodelQaOptions, now: Date): JsonObject;
|
|
162
|
+
declare function buildNextActions(layout: LifecyclemodelQaLayout, validationAggregate: LifecyclemodelValidationAggregate): string[];
|
|
163
|
+
declare function renderZhReview(options: {
|
|
164
|
+
runId: string;
|
|
165
|
+
logicVersion: string;
|
|
166
|
+
runRoot: string;
|
|
167
|
+
rowsFile: string;
|
|
168
|
+
inputMode: 'run_dir' | 'rows_file';
|
|
169
|
+
modelSummaries: LifecyclemodelQaModelSummary[];
|
|
170
|
+
findings: LifecyclemodelQaFinding[];
|
|
171
|
+
validation: LifecyclemodelQaReport['validation'];
|
|
172
|
+
}): string;
|
|
173
|
+
declare function renderEnReview(options: {
|
|
174
|
+
runId: string;
|
|
175
|
+
logicVersion: string;
|
|
176
|
+
runRoot: string;
|
|
177
|
+
rowsFile: string;
|
|
178
|
+
inputMode: 'run_dir' | 'rows_file';
|
|
179
|
+
modelSummaries: LifecyclemodelQaModelSummary[];
|
|
180
|
+
findings: LifecyclemodelQaFinding[];
|
|
181
|
+
validation: LifecyclemodelQaReport['validation'];
|
|
182
|
+
}): string;
|
|
183
|
+
declare function renderTiming(options: {
|
|
184
|
+
runId: string;
|
|
185
|
+
startTs?: string;
|
|
186
|
+
endTs?: string;
|
|
187
|
+
modelCount: number;
|
|
188
|
+
}): string;
|
|
189
|
+
export declare function runLifecyclemodelQa(options: RunLifecyclemodelQaOptions): Promise<LifecyclemodelQaReport>;
|
|
190
|
+
export declare const __testInternals: {
|
|
191
|
+
buildLayout: typeof buildLayout;
|
|
192
|
+
resolveLayout: typeof resolveLayout;
|
|
193
|
+
readInvocationIndex: typeof readInvocationIndex;
|
|
194
|
+
discoverModelEntries: typeof discoverModelEntries;
|
|
195
|
+
readValidationAggregate: typeof readValidationAggregate;
|
|
196
|
+
materializeRowsFile: typeof materializeRowsFile;
|
|
197
|
+
sanitizeFileName: typeof sanitizeFileName;
|
|
198
|
+
readModelFileReviewInfo: typeof readModelFileReviewInfo;
|
|
199
|
+
buildModelReview: typeof buildModelReview;
|
|
200
|
+
buildInvocationIndex: typeof buildInvocationIndex;
|
|
201
|
+
buildNextActions: typeof buildNextActions;
|
|
202
|
+
renderZhReview: typeof renderZhReview;
|
|
203
|
+
renderEnReview: typeof renderEnReview;
|
|
204
|
+
renderTiming: typeof renderTiming;
|
|
205
|
+
};
|
|
206
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { FetchLike } from './http.js';
|
|
2
|
+
type JsonObject = Record<string, unknown>;
|
|
3
|
+
export type ProjectionMode = 'primary-only' | 'all-subproducts';
|
|
4
|
+
export type PublishIntent = 'dry_run' | 'prepare_only' | 'publish';
|
|
5
|
+
export type LifecyclemodelResultingProcessRequest = {
|
|
6
|
+
source_model: {
|
|
7
|
+
id: string | null;
|
|
8
|
+
version: string | null;
|
|
9
|
+
name: string | null;
|
|
10
|
+
json_ordered_path: string | null;
|
|
11
|
+
json_ordered: JsonObject | null;
|
|
12
|
+
};
|
|
13
|
+
projection: {
|
|
14
|
+
mode: ProjectionMode;
|
|
15
|
+
process_id: string | null;
|
|
16
|
+
process_version: string | null;
|
|
17
|
+
metadata_overrides: JsonObject;
|
|
18
|
+
attach_graph_snapshot: boolean;
|
|
19
|
+
attach_graph_snapshot_uri: string | null;
|
|
20
|
+
};
|
|
21
|
+
process_sources: {
|
|
22
|
+
process_catalog_path: string | null;
|
|
23
|
+
run_dirs: string[];
|
|
24
|
+
process_json_dirs: string[];
|
|
25
|
+
process_json_files: string[];
|
|
26
|
+
allow_remote_lookup: boolean;
|
|
27
|
+
};
|
|
28
|
+
publish: {
|
|
29
|
+
intent: PublishIntent;
|
|
30
|
+
prepare_process_payloads: boolean;
|
|
31
|
+
prepare_relation_payloads: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type LifecyclemodelResultingProcessReport = {
|
|
35
|
+
generated_at_utc: string;
|
|
36
|
+
request_path: string;
|
|
37
|
+
out_dir: string;
|
|
38
|
+
status: string;
|
|
39
|
+
projected_process_count: number;
|
|
40
|
+
relation_count: number;
|
|
41
|
+
source_model: {
|
|
42
|
+
id: string;
|
|
43
|
+
version: string;
|
|
44
|
+
name: string;
|
|
45
|
+
json_ordered_path: string | null;
|
|
46
|
+
reference_to_resulting_process_id: string | null;
|
|
47
|
+
reference_to_resulting_process_version: string | null;
|
|
48
|
+
reference_process_instance_id: string | null;
|
|
49
|
+
};
|
|
50
|
+
files: {
|
|
51
|
+
normalized_request: string;
|
|
52
|
+
source_model_normalized: string;
|
|
53
|
+
source_model_summary: string;
|
|
54
|
+
projection_report: string;
|
|
55
|
+
process_projection_bundle: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export type RunLifecyclemodelResultingProcessOptions = {
|
|
59
|
+
inputPath: string;
|
|
60
|
+
outDir?: string | null;
|
|
61
|
+
now?: Date;
|
|
62
|
+
env?: NodeJS.ProcessEnv;
|
|
63
|
+
fetchImpl?: FetchLike;
|
|
64
|
+
};
|
|
65
|
+
type RemoteProcessLookupContext = {
|
|
66
|
+
env: NodeJS.ProcessEnv;
|
|
67
|
+
fetchImpl: FetchLike;
|
|
68
|
+
};
|
|
69
|
+
type ProcessRecord = {
|
|
70
|
+
processUuid: string;
|
|
71
|
+
version: string;
|
|
72
|
+
raw: JsonObject;
|
|
73
|
+
sourceLabel: string;
|
|
74
|
+
sourcePath: string | null;
|
|
75
|
+
referenceExchangeInternalId: string;
|
|
76
|
+
referenceFlowUuid: string;
|
|
77
|
+
referenceDirection: string;
|
|
78
|
+
referenceAmount: number;
|
|
79
|
+
inputAmounts: Record<string, number>;
|
|
80
|
+
outputAmounts: Record<string, number>;
|
|
81
|
+
};
|
|
82
|
+
type ProcessInstance = {
|
|
83
|
+
instance_id: string;
|
|
84
|
+
process_id: string;
|
|
85
|
+
process_version: string;
|
|
86
|
+
label: string;
|
|
87
|
+
multiplication_factor: number;
|
|
88
|
+
reference_to_process: JsonObject;
|
|
89
|
+
raw: JsonObject;
|
|
90
|
+
};
|
|
91
|
+
type Edge = {
|
|
92
|
+
edge_id: string;
|
|
93
|
+
from: string;
|
|
94
|
+
to: string;
|
|
95
|
+
exchange_id: string | null;
|
|
96
|
+
flow_uuid: string | null;
|
|
97
|
+
};
|
|
98
|
+
declare function uniqueStrings(values: Array<string | null | undefined>): string[];
|
|
99
|
+
declare function toFiniteNumber(value: unknown, fieldName: string): number;
|
|
100
|
+
declare function normalizeNumericOutput(value: number): number;
|
|
101
|
+
declare function toBoolean(value: unknown, defaultValue: boolean): boolean;
|
|
102
|
+
export declare function normalizeLifecyclemodelResultingProcessRequest(input: unknown, options: {
|
|
103
|
+
requestPath: string;
|
|
104
|
+
}): LifecyclemodelResultingProcessRequest;
|
|
105
|
+
declare function resolveNameField(namePayload: unknown): string | null;
|
|
106
|
+
declare function normalizedNameInfo(namePayload: unknown, fallbackText: string): JsonObject;
|
|
107
|
+
declare function modelIdentifier(model: JsonObject, sourceModel: LifecyclemodelResultingProcessRequest['source_model']): {
|
|
108
|
+
id: string;
|
|
109
|
+
version: string;
|
|
110
|
+
name: string;
|
|
111
|
+
};
|
|
112
|
+
declare function extractProcessInstances(model: JsonObject): ProcessInstance[];
|
|
113
|
+
declare function extractEdges(model: JsonObject): Edge[];
|
|
114
|
+
declare function processReferencePairs(model: JsonObject): Array<{
|
|
115
|
+
process_id: string;
|
|
116
|
+
version: string;
|
|
117
|
+
}>;
|
|
118
|
+
declare function parseProcessRecord(payload: JsonObject, options: {
|
|
119
|
+
sourceLabel: string;
|
|
120
|
+
sourcePath: string | null;
|
|
121
|
+
}): ProcessRecord;
|
|
122
|
+
declare function autoDetectProcessCatalogPath(modelPath: string | null): string | null;
|
|
123
|
+
declare function autoDetectProcessJsonDirs(modelPath: string | null): string[];
|
|
124
|
+
declare function processSourceDirs(request: LifecyclemodelResultingProcessRequest): string[];
|
|
125
|
+
declare function locateLocalProcessFile(processId: string, version: string, options: {
|
|
126
|
+
processDirs: string[];
|
|
127
|
+
processFiles: string[];
|
|
128
|
+
}): string | null;
|
|
129
|
+
declare function loadSourceModel(request: LifecyclemodelResultingProcessRequest): {
|
|
130
|
+
sourceModelJson: JsonObject;
|
|
131
|
+
modelPath: string | null;
|
|
132
|
+
};
|
|
133
|
+
declare function referenceToResultingProcess(model: JsonObject): {
|
|
134
|
+
id: string | null;
|
|
135
|
+
version: string | null;
|
|
136
|
+
};
|
|
137
|
+
declare function referenceProcessInstanceId(model: JsonObject): string | null;
|
|
138
|
+
declare function chooseReferenceInstance(processInstances: ProcessInstance[], requestedInstanceId: string | null): ProcessInstance;
|
|
139
|
+
declare function cloneExchangeWithAmount(exchange: JsonObject, amount: number, internalId: string, options: {
|
|
140
|
+
quantitativeReference: boolean;
|
|
141
|
+
}): JsonObject;
|
|
142
|
+
declare function buildResultingProcessPayload(options: {
|
|
143
|
+
sourceModelId: string;
|
|
144
|
+
sourceModelVersion: string;
|
|
145
|
+
sourceModelName: string;
|
|
146
|
+
sourceModelNameInfo: JsonObject;
|
|
147
|
+
processId: string;
|
|
148
|
+
processVersion: string;
|
|
149
|
+
role: 'primary';
|
|
150
|
+
projectionSignature: string;
|
|
151
|
+
processInstances: ProcessInstance[];
|
|
152
|
+
edges: Edge[];
|
|
153
|
+
processRecords: Record<string, ProcessRecord>;
|
|
154
|
+
referenceProcessInstanceId: string | null;
|
|
155
|
+
metadataOverrides: JsonObject;
|
|
156
|
+
attachGraphSnapshotUri: string | null;
|
|
157
|
+
}): JsonObject;
|
|
158
|
+
declare function buildProjectionBundle(options: {
|
|
159
|
+
request: LifecyclemodelResultingProcessRequest;
|
|
160
|
+
sourceModelJson: JsonObject;
|
|
161
|
+
modelPath: string | null;
|
|
162
|
+
remoteLookup?: RemoteProcessLookupContext;
|
|
163
|
+
}): Promise<{
|
|
164
|
+
bundle: JsonObject;
|
|
165
|
+
report: JsonObject;
|
|
166
|
+
sourceModelSummary: {
|
|
167
|
+
id: string;
|
|
168
|
+
version: string;
|
|
169
|
+
name: string;
|
|
170
|
+
json_ordered_path: string | null;
|
|
171
|
+
reference_to_resulting_process_id: string | null;
|
|
172
|
+
reference_to_resulting_process_version: string | null;
|
|
173
|
+
reference_process_instance_id: string | null;
|
|
174
|
+
resolved_process_summary: JsonObject;
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
declare function defaultOutDir(requestPath: string, subject: string, now?: Date): string;
|
|
178
|
+
export declare function runLifecyclemodelBuildResultingProcess(options: RunLifecyclemodelResultingProcessOptions): Promise<LifecyclemodelResultingProcessReport>;
|
|
179
|
+
export declare const __testInternals: {
|
|
180
|
+
uniqueStrings: typeof uniqueStrings;
|
|
181
|
+
toFiniteNumber: typeof toFiniteNumber;
|
|
182
|
+
normalizeNumericOutput: typeof normalizeNumericOutput;
|
|
183
|
+
toBoolean: typeof toBoolean;
|
|
184
|
+
resolveNameField: typeof resolveNameField;
|
|
185
|
+
normalizedNameInfo: typeof normalizedNameInfo;
|
|
186
|
+
modelIdentifier: typeof modelIdentifier;
|
|
187
|
+
extractProcessInstances: typeof extractProcessInstances;
|
|
188
|
+
extractEdges: typeof extractEdges;
|
|
189
|
+
processReferencePairs: typeof processReferencePairs;
|
|
190
|
+
parseProcessRecord: typeof parseProcessRecord;
|
|
191
|
+
autoDetectProcessCatalogPath: typeof autoDetectProcessCatalogPath;
|
|
192
|
+
autoDetectProcessJsonDirs: typeof autoDetectProcessJsonDirs;
|
|
193
|
+
processSourceDirs: typeof processSourceDirs;
|
|
194
|
+
locateLocalProcessFile: typeof locateLocalProcessFile;
|
|
195
|
+
loadSourceModel: typeof loadSourceModel;
|
|
196
|
+
referenceToResultingProcess: typeof referenceToResultingProcess;
|
|
197
|
+
referenceProcessInstanceId: typeof referenceProcessInstanceId;
|
|
198
|
+
chooseReferenceInstance: typeof chooseReferenceInstance;
|
|
199
|
+
cloneExchangeWithAmount: typeof cloneExchangeWithAmount;
|
|
200
|
+
buildResultingProcessPayload: typeof buildResultingProcessPayload;
|
|
201
|
+
buildProjectionBundle: typeof buildProjectionBundle;
|
|
202
|
+
defaultOutDir: typeof defaultOutDir;
|
|
203
|
+
};
|
|
204
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { FetchLike } from './http.js';
|
|
2
|
+
import { type JsonObject } from './dataset-local.js';
|
|
3
|
+
import { type LifecyclemodelBundleWriteResult, type LifecyclemodelPublishMetadata } from './lifecyclemodel-bundle-save.js';
|
|
4
|
+
import { normalizeIssuePath, type SafeParseSchema, type SdkValidationFactory } from './tidas-sdk-validation.js';
|
|
5
|
+
export type LifecyclemodelPayloadValidationIssue = {
|
|
6
|
+
path: string;
|
|
7
|
+
message: string;
|
|
8
|
+
code: string;
|
|
9
|
+
};
|
|
10
|
+
export type LifecyclemodelPayloadValidationResult = {
|
|
11
|
+
ok: true;
|
|
12
|
+
validator: string;
|
|
13
|
+
issue_count: 0;
|
|
14
|
+
issues: [];
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
validator: string;
|
|
18
|
+
issue_count: number;
|
|
19
|
+
issues: LifecyclemodelPayloadValidationIssue[];
|
|
20
|
+
};
|
|
21
|
+
type LifecyclemodelSaveDraftCandidate = {
|
|
22
|
+
id: string | null;
|
|
23
|
+
version: string | null;
|
|
24
|
+
payload: JsonObject;
|
|
25
|
+
metadata: LifecyclemodelPublishMetadata | null;
|
|
26
|
+
validation?: LifecyclemodelPayloadValidationResult;
|
|
27
|
+
error?: {
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type LifecyclemodelSaveDraftModelReport = {
|
|
32
|
+
id: string | null;
|
|
33
|
+
version: string | null;
|
|
34
|
+
status: 'prepared' | 'executed' | 'failed';
|
|
35
|
+
validation?: LifecyclemodelPayloadValidationResult;
|
|
36
|
+
execution?: LifecyclemodelBundleWriteResult;
|
|
37
|
+
error?: {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type LifecyclemodelSaveDraftReport = {
|
|
42
|
+
generated_at_utc: string;
|
|
43
|
+
input_path: string;
|
|
44
|
+
out_dir: string;
|
|
45
|
+
commit: boolean;
|
|
46
|
+
mode: 'dry_run' | 'commit';
|
|
47
|
+
status: 'completed' | 'completed_with_failures';
|
|
48
|
+
counts: {
|
|
49
|
+
selected: number;
|
|
50
|
+
prepared: number;
|
|
51
|
+
executed: number;
|
|
52
|
+
failed: number;
|
|
53
|
+
};
|
|
54
|
+
files: {
|
|
55
|
+
normalized_input: string;
|
|
56
|
+
selected_lifecyclemodels: string;
|
|
57
|
+
progress_jsonl: string;
|
|
58
|
+
failures_jsonl: string;
|
|
59
|
+
summary_json: string;
|
|
60
|
+
};
|
|
61
|
+
lifecyclemodels: LifecyclemodelSaveDraftModelReport[];
|
|
62
|
+
};
|
|
63
|
+
export type RunLifecyclemodelSaveDraftOptions = {
|
|
64
|
+
inputPath: string;
|
|
65
|
+
outDir?: string | null;
|
|
66
|
+
commit?: boolean | null;
|
|
67
|
+
rawInput?: unknown;
|
|
68
|
+
env?: NodeJS.ProcessEnv;
|
|
69
|
+
fetchImpl?: FetchLike;
|
|
70
|
+
timeoutMs?: number;
|
|
71
|
+
now?: Date;
|
|
72
|
+
validateLifecyclemodelPayloadImpl?: (payload: JsonObject) => LifecyclemodelPayloadValidationResult;
|
|
73
|
+
};
|
|
74
|
+
declare function getLifecyclemodelSchema(sdk?: {
|
|
75
|
+
LifeCycleModelSchema?: unknown;
|
|
76
|
+
}): SafeParseSchema;
|
|
77
|
+
declare function getLifecyclemodelFactory(sdk?: {
|
|
78
|
+
createLifeCycleModel?: unknown;
|
|
79
|
+
}): SdkValidationFactory | null;
|
|
80
|
+
export declare function validateLifecyclemodelPayload(payload: JsonObject, schema?: SafeParseSchema, createEntity?: SdkValidationFactory | null): LifecyclemodelPayloadValidationResult;
|
|
81
|
+
declare function summarizeValidation(result: LifecyclemodelPayloadValidationResult): string;
|
|
82
|
+
declare function buildCandidate(row: JsonObject, payload: JsonObject, validate: (payload: JsonObject) => LifecyclemodelPayloadValidationResult): LifecyclemodelSaveDraftCandidate;
|
|
83
|
+
declare function serializeError(error: unknown): {
|
|
84
|
+
message: string;
|
|
85
|
+
};
|
|
86
|
+
export declare function runLifecyclemodelSaveDraft(options: RunLifecyclemodelSaveDraftOptions): Promise<LifecyclemodelSaveDraftReport>;
|
|
87
|
+
export declare const __testInternals: {
|
|
88
|
+
buildCandidate: typeof buildCandidate;
|
|
89
|
+
getLifecyclemodelFactory: typeof getLifecyclemodelFactory;
|
|
90
|
+
getLifecyclemodelSchema: typeof getLifecyclemodelSchema;
|
|
91
|
+
normalizeIssuePath: typeof normalizeIssuePath;
|
|
92
|
+
serializeError: typeof serializeError;
|
|
93
|
+
summarizeValidation: typeof summarizeValidation;
|
|
94
|
+
validateLifecyclemodelPayload: typeof validateLifecyclemodelPayload;
|
|
95
|
+
};
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type RunValidationOptions, type ValidationRunReport } from './validation.js';
|
|
2
|
+
type JsonObject = Record<string, unknown>;
|
|
3
|
+
type ModelBundleEntry = {
|
|
4
|
+
runName: string;
|
|
5
|
+
inputDir: string;
|
|
6
|
+
modelFiles: string[];
|
|
7
|
+
};
|
|
8
|
+
export type LifecyclemodelValidateBuildLayout = {
|
|
9
|
+
runId: string;
|
|
10
|
+
runRoot: string;
|
|
11
|
+
modelsDir: string;
|
|
12
|
+
reportsDir: string;
|
|
13
|
+
modelReportsDir: string;
|
|
14
|
+
manifestsDir: string;
|
|
15
|
+
runManifestPath: string;
|
|
16
|
+
invocationIndexPath: string;
|
|
17
|
+
autoBuildReportPath: string;
|
|
18
|
+
reportPath: string;
|
|
19
|
+
};
|
|
20
|
+
export type LifecyclemodelValidateBuildModelReport = {
|
|
21
|
+
run_name: string;
|
|
22
|
+
input_dir: string;
|
|
23
|
+
model_files: string[];
|
|
24
|
+
report_file: string;
|
|
25
|
+
validation: ValidationRunReport;
|
|
26
|
+
};
|
|
27
|
+
export type LifecyclemodelValidateBuildReport = {
|
|
28
|
+
schema_version: 1;
|
|
29
|
+
generated_at_utc: string;
|
|
30
|
+
status: 'completed_lifecyclemodel_validate_build';
|
|
31
|
+
run_id: string;
|
|
32
|
+
run_root: string;
|
|
33
|
+
ok: boolean;
|
|
34
|
+
engine: string;
|
|
35
|
+
counts: {
|
|
36
|
+
models: number;
|
|
37
|
+
ok: number;
|
|
38
|
+
failed: number;
|
|
39
|
+
};
|
|
40
|
+
files: {
|
|
41
|
+
run_manifest: string;
|
|
42
|
+
invocation_index: string;
|
|
43
|
+
auto_build_report: string | null;
|
|
44
|
+
report: string;
|
|
45
|
+
model_reports_dir: string;
|
|
46
|
+
};
|
|
47
|
+
model_reports: LifecyclemodelValidateBuildModelReport[];
|
|
48
|
+
next_actions: string[];
|
|
49
|
+
};
|
|
50
|
+
export type RunLifecyclemodelValidateBuildOptions = {
|
|
51
|
+
runDir: string;
|
|
52
|
+
engine?: string;
|
|
53
|
+
now?: Date;
|
|
54
|
+
cwd?: string;
|
|
55
|
+
};
|
|
56
|
+
export type LifecyclemodelValidateBuildDeps = {
|
|
57
|
+
runValidationImpl?: (options: RunValidationOptions) => Promise<ValidationRunReport>;
|
|
58
|
+
};
|
|
59
|
+
declare function buildLayout(runRoot: string): LifecyclemodelValidateBuildLayout;
|
|
60
|
+
declare function resolveLayout(options: RunLifecyclemodelValidateBuildOptions): LifecyclemodelValidateBuildLayout;
|
|
61
|
+
declare function readInvocationIndex(layout: LifecyclemodelValidateBuildLayout): JsonObject;
|
|
62
|
+
declare function discoverModelEntries(layout: LifecyclemodelValidateBuildLayout): ModelBundleEntry[];
|
|
63
|
+
declare function buildInvocationIndex(layout: LifecyclemodelValidateBuildLayout, invocationIndex: JsonObject, options: RunLifecyclemodelValidateBuildOptions, now: Date): JsonObject;
|
|
64
|
+
declare function buildNextActions(layout: LifecyclemodelValidateBuildLayout): string[];
|
|
65
|
+
declare function resolveValidationImpl(deps: LifecyclemodelValidateBuildDeps): (options: RunValidationOptions) => Promise<ValidationRunReport>;
|
|
66
|
+
declare function resolveReportEngine(modelReports: LifecyclemodelValidateBuildModelReport[], requestedEngine?: string): string;
|
|
67
|
+
export declare function runLifecyclemodelValidateBuild(options: RunLifecyclemodelValidateBuildOptions, deps?: LifecyclemodelValidateBuildDeps): Promise<LifecyclemodelValidateBuildReport>;
|
|
68
|
+
export declare const __testInternals: {
|
|
69
|
+
buildLayout: typeof buildLayout;
|
|
70
|
+
resolveLayout: typeof resolveLayout;
|
|
71
|
+
readInvocationIndex: typeof readInvocationIndex;
|
|
72
|
+
discoverModelEntries: typeof discoverModelEntries;
|
|
73
|
+
buildInvocationIndex: typeof buildInvocationIndex;
|
|
74
|
+
buildNextActions: typeof buildNextActions;
|
|
75
|
+
resolveValidationImpl: typeof resolveValidationImpl;
|
|
76
|
+
resolveReportEngine: typeof resolveReportEngine;
|
|
77
|
+
};
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { EnvSpec } from './env.js';
|
|
2
|
+
import type { FetchLike } from './http.js';
|
|
3
|
+
export declare const LLM_ENV_KEYS: {
|
|
4
|
+
readonly baseUrl: 'TIANGONG_LCA_REVIEW_LLM_BASE_URL';
|
|
5
|
+
readonly apiKey: 'TIANGONG_LCA_REVIEW_LLM_API_KEY';
|
|
6
|
+
readonly model: 'TIANGONG_LCA_REVIEW_LLM_MODEL';
|
|
7
|
+
};
|
|
8
|
+
export declare const LLM_ENV_SPECS: EnvSpec[];
|
|
9
|
+
export type LlmRuntimeEnv = {
|
|
10
|
+
baseUrl: string | null;
|
|
11
|
+
apiKey: string | null;
|
|
12
|
+
model: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type LlmUsage = {
|
|
15
|
+
inputTokens?: number;
|
|
16
|
+
outputTokens?: number;
|
|
17
|
+
totalTokens?: number;
|
|
18
|
+
cachedInputTokens?: number;
|
|
19
|
+
reasoningTokens?: number;
|
|
20
|
+
};
|
|
21
|
+
export type LlmInvocationInput = {
|
|
22
|
+
prompt: string;
|
|
23
|
+
context?: unknown;
|
|
24
|
+
responseFormat?: unknown;
|
|
25
|
+
text?: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
export type LlmInvocationResult = {
|
|
28
|
+
output: string;
|
|
29
|
+
usage: LlmUsage | null;
|
|
30
|
+
cacheHit: boolean;
|
|
31
|
+
promptHash: string;
|
|
32
|
+
};
|
|
33
|
+
export type InvokeLlmOptions = {
|
|
34
|
+
env: LlmRuntimeEnv;
|
|
35
|
+
input: LlmInvocationInput;
|
|
36
|
+
fetchImpl: FetchLike;
|
|
37
|
+
timeoutMs: number;
|
|
38
|
+
maxAttempts?: number;
|
|
39
|
+
sleep?: (ms: number) => Promise<void>;
|
|
40
|
+
retryDelayMs?: number;
|
|
41
|
+
cacheDir?: string | null;
|
|
42
|
+
tracePath?: string | null;
|
|
43
|
+
runId?: string | null;
|
|
44
|
+
module?: string;
|
|
45
|
+
stage?: string;
|
|
46
|
+
now?: () => Date;
|
|
47
|
+
};
|
|
48
|
+
export declare function extractLlmOutput(payload: unknown): string;
|
|
49
|
+
export declare function extractLlmUsage(payload: unknown): LlmUsage | null;
|
|
50
|
+
export declare function readLlmRuntimeEnv(env: NodeJS.ProcessEnv): LlmRuntimeEnv;
|
|
51
|
+
export declare function invokeLlm(options: InvokeLlmOptions): Promise<LlmInvocationResult>;
|