@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.
- package/README.md +58 -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/cli.js +130 -0
- package/dist/src/cli.js.map +1 -1
- 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/auth-identity-receipt.js +634 -0
- package/dist/src/lib/auth-identity-receipt.js.map +1 -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/http.js.map +1 -1
- 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 +17 -3
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import type { JsonRecord } from './flow-governance.js';
|
|
2
|
+
import type { FetchLike } from './http.js';
|
|
3
|
+
type ClassificationEntry = {
|
|
4
|
+
level: string;
|
|
5
|
+
class_id?: string;
|
|
6
|
+
cat_id?: string;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
type FlowRuleFinding = {
|
|
10
|
+
flow_uuid: string;
|
|
11
|
+
base_version: string;
|
|
12
|
+
severity: string;
|
|
13
|
+
rule_id?: string;
|
|
14
|
+
ruleset_id?: 'flow-authoring/strict';
|
|
15
|
+
methodology_rule_id?: string | null;
|
|
16
|
+
message?: string;
|
|
17
|
+
fixability?: string;
|
|
18
|
+
source: 'rule' | 'llm';
|
|
19
|
+
rule_source?: string;
|
|
20
|
+
evidence?: JsonRecord;
|
|
21
|
+
action?: string;
|
|
22
|
+
};
|
|
23
|
+
type FlowSummary = {
|
|
24
|
+
flow_uuid: string;
|
|
25
|
+
base_version: string;
|
|
26
|
+
type_of_dataset: string;
|
|
27
|
+
names: {
|
|
28
|
+
primary_en: string;
|
|
29
|
+
primary_zh: string;
|
|
30
|
+
all_texts: string[];
|
|
31
|
+
};
|
|
32
|
+
classification: {
|
|
33
|
+
leaf: {
|
|
34
|
+
class_id: string;
|
|
35
|
+
text: string;
|
|
36
|
+
key: string;
|
|
37
|
+
};
|
|
38
|
+
path: ClassificationEntry[];
|
|
39
|
+
};
|
|
40
|
+
flow_property: JsonRecord;
|
|
41
|
+
quantitative_reference: {
|
|
42
|
+
reference_flow_property_internal_id: string;
|
|
43
|
+
};
|
|
44
|
+
unitgroup: {
|
|
45
|
+
uuid: string;
|
|
46
|
+
name: string;
|
|
47
|
+
reference_unit_name: string;
|
|
48
|
+
lookup_status: string;
|
|
49
|
+
lookup_source: string;
|
|
50
|
+
};
|
|
51
|
+
rule_signals: Array<{
|
|
52
|
+
rule_id: string;
|
|
53
|
+
severity: string;
|
|
54
|
+
message: string;
|
|
55
|
+
evidence: JsonRecord;
|
|
56
|
+
}>;
|
|
57
|
+
similarity_candidates: Array<{
|
|
58
|
+
other_flow_uuid: string;
|
|
59
|
+
other_base_version: string;
|
|
60
|
+
similarity: number;
|
|
61
|
+
other_name_en: string;
|
|
62
|
+
classification_group: string;
|
|
63
|
+
}>;
|
|
64
|
+
source_file?: string;
|
|
65
|
+
_name_fingerprint: string;
|
|
66
|
+
};
|
|
67
|
+
type FlowSimilarityPair = {
|
|
68
|
+
classification_group: string;
|
|
69
|
+
flow_property_uuid: string;
|
|
70
|
+
unitgroup_uuid: string;
|
|
71
|
+
left_flow_uuid: string;
|
|
72
|
+
right_flow_uuid: string;
|
|
73
|
+
left_version: string;
|
|
74
|
+
right_version: string;
|
|
75
|
+
similarity: number;
|
|
76
|
+
left_name_en: string;
|
|
77
|
+
right_name_en: string;
|
|
78
|
+
};
|
|
79
|
+
type FlowQaLlmBatchResult = {
|
|
80
|
+
batch_index: number;
|
|
81
|
+
batch_size: number;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
ok: boolean;
|
|
84
|
+
reason?: string;
|
|
85
|
+
raw_preview?: string;
|
|
86
|
+
};
|
|
87
|
+
export type FlowQaLlmResult = {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
ok?: boolean;
|
|
90
|
+
reason?: string;
|
|
91
|
+
batch_count: number;
|
|
92
|
+
reviewed_flow_count: number;
|
|
93
|
+
truncated: boolean;
|
|
94
|
+
batch_results: FlowQaLlmBatchResult[];
|
|
95
|
+
};
|
|
96
|
+
type FlowQaLlmRunResult = FlowQaLlmResult & {
|
|
97
|
+
llmFindings: FlowRuleFinding[];
|
|
98
|
+
};
|
|
99
|
+
type FlowRulesetGate = {
|
|
100
|
+
status: 'passed' | 'needs_review' | 'blocked';
|
|
101
|
+
ruleset_id: 'flow-authoring/strict';
|
|
102
|
+
ruleset_version: '1';
|
|
103
|
+
ruleset_source_version: string;
|
|
104
|
+
ruleset_rule_ids: string[];
|
|
105
|
+
counts: {
|
|
106
|
+
findings: number;
|
|
107
|
+
blockers: number;
|
|
108
|
+
};
|
|
109
|
+
blockers: FlowRuleFinding[];
|
|
110
|
+
next_action: 'continue' | 'review_findings' | 'fix_blockers';
|
|
111
|
+
};
|
|
112
|
+
export type FlowQaReport = {
|
|
113
|
+
schema_version: 1;
|
|
114
|
+
generated_at_utc: string;
|
|
115
|
+
status: 'completed_local_flow_qa';
|
|
116
|
+
run_id: string;
|
|
117
|
+
out_dir: string;
|
|
118
|
+
rows_file: string;
|
|
119
|
+
input_mode: 'rows_file' | 'flows_dir' | 'run_root';
|
|
120
|
+
effective_flows_dir: string;
|
|
121
|
+
logic_version: string;
|
|
122
|
+
ruleset_id?: 'flow-authoring/strict';
|
|
123
|
+
ruleset_version?: '1';
|
|
124
|
+
ruleset_source_version?: string;
|
|
125
|
+
ruleset_rule_ids?: string[];
|
|
126
|
+
flow_count: number;
|
|
127
|
+
similarity_threshold: number;
|
|
128
|
+
methodology_rule_source: string;
|
|
129
|
+
with_reference_context: false;
|
|
130
|
+
reference_context_mode: 'disabled';
|
|
131
|
+
rule_finding_count: number;
|
|
132
|
+
llm_finding_count: number;
|
|
133
|
+
finding_count: number;
|
|
134
|
+
blocker_count?: number;
|
|
135
|
+
severity_counts: Record<string, number>;
|
|
136
|
+
rule_counts: Record<string, number>;
|
|
137
|
+
methodology_rule_counts?: Record<string, number>;
|
|
138
|
+
ruleset_gate?: FlowRulesetGate;
|
|
139
|
+
llm: FlowQaLlmResult;
|
|
140
|
+
files: {
|
|
141
|
+
qa_input_summary: string;
|
|
142
|
+
materialization_summary: string | null;
|
|
143
|
+
rule_findings: string;
|
|
144
|
+
llm_findings: string;
|
|
145
|
+
findings: string;
|
|
146
|
+
ruleset_gate?: string;
|
|
147
|
+
flow_summaries: string;
|
|
148
|
+
similarity_pairs: string;
|
|
149
|
+
summary: string;
|
|
150
|
+
qa_zh: string;
|
|
151
|
+
qa_en: string;
|
|
152
|
+
timing: string;
|
|
153
|
+
report: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export type RunFlowQaOptions = {
|
|
157
|
+
rowsFile?: string;
|
|
158
|
+
flowsDir?: string;
|
|
159
|
+
runRoot?: string;
|
|
160
|
+
runId?: string;
|
|
161
|
+
outDir: string;
|
|
162
|
+
startTs?: string;
|
|
163
|
+
endTs?: string;
|
|
164
|
+
logicVersion?: string;
|
|
165
|
+
enableLlm?: boolean;
|
|
166
|
+
llmModel?: string;
|
|
167
|
+
llmMaxFlows?: number;
|
|
168
|
+
llmBatchSize?: number;
|
|
169
|
+
similarityThreshold?: number;
|
|
170
|
+
methodologyId?: string;
|
|
171
|
+
env?: NodeJS.ProcessEnv;
|
|
172
|
+
fetchImpl?: FetchLike;
|
|
173
|
+
now?: () => Date;
|
|
174
|
+
};
|
|
175
|
+
declare function walkStrings(node: unknown): string[];
|
|
176
|
+
declare function langTextForLang(value: unknown, lang: string): string;
|
|
177
|
+
declare function findUuidInNode(node: unknown): string;
|
|
178
|
+
declare function flowRoot(doc: JsonRecord): JsonRecord;
|
|
179
|
+
declare function nameFingerprint(flow: JsonRecord): string;
|
|
180
|
+
declare function classificationLeaf(flow: JsonRecord): {
|
|
181
|
+
class_id: string;
|
|
182
|
+
text: string;
|
|
183
|
+
key: string;
|
|
184
|
+
};
|
|
185
|
+
declare function computeSimilarity(left: string, right: string): number;
|
|
186
|
+
declare function createRuleFinding(flowUuidValue: string, baseVersion: string, severity: string, ruleId: string, message: string, options?: {
|
|
187
|
+
fixability?: string;
|
|
188
|
+
evidence?: JsonRecord;
|
|
189
|
+
action?: string;
|
|
190
|
+
ruleSource?: string;
|
|
191
|
+
}): FlowRuleFinding;
|
|
192
|
+
declare function flowRulesetGate(findings: FlowRuleFinding[]): FlowRulesetGate;
|
|
193
|
+
declare function applyMethodologyChecks(flow: JsonRecord, flowUuidValue: string, baseVersion: string, ruleSource: string): FlowRuleFinding[];
|
|
194
|
+
declare function buildFlowSummaryAndRuleFindings(doc: JsonRecord, methodologyRuleSource: string): {
|
|
195
|
+
summary: FlowSummary;
|
|
196
|
+
findings: FlowRuleFinding[];
|
|
197
|
+
};
|
|
198
|
+
declare function buildSimilarity(summaries: FlowSummary[], threshold: number): {
|
|
199
|
+
pairs: FlowSimilarityPair[];
|
|
200
|
+
candidatesByFlow: Record<string, FlowSummary['similarity_candidates']>;
|
|
201
|
+
};
|
|
202
|
+
declare function parseLlmJsonOutput(output: string): JsonRecord | null;
|
|
203
|
+
declare function buildLlmPrompt(batch: unknown[]): string;
|
|
204
|
+
declare function normalizeLlmFinding(item: JsonRecord, summaryByUuid: Record<string, FlowSummary>, fallbackFlowUuid?: string): FlowRuleFinding | null;
|
|
205
|
+
declare function runOptionalLlmReview(summaries: FlowSummary[], options: {
|
|
206
|
+
enableLlm: boolean;
|
|
207
|
+
llmModel?: string;
|
|
208
|
+
llmMaxFlows: number;
|
|
209
|
+
llmBatchSize: number;
|
|
210
|
+
env: NodeJS.ProcessEnv;
|
|
211
|
+
fetchImpl?: FetchLike;
|
|
212
|
+
outDir: string;
|
|
213
|
+
runId: string;
|
|
214
|
+
}): Promise<FlowQaLlmRunResult>;
|
|
215
|
+
declare function severityCounts(rows: FlowRuleFinding[]): Record<string, number>;
|
|
216
|
+
declare function ruleCounts(rows: FlowRuleFinding[]): Record<string, number>;
|
|
217
|
+
declare function methodologyRuleCounts(rows: FlowRuleFinding[]): Record<string, number>;
|
|
218
|
+
declare function readJsonObject(filePath: string): JsonRecord;
|
|
219
|
+
declare function materializeRowsFile(rowsFile: string, outDir: string): {
|
|
220
|
+
flowsDir: string;
|
|
221
|
+
summaryPath: string;
|
|
222
|
+
};
|
|
223
|
+
declare function resolveReviewInput(options: RunFlowQaOptions): {
|
|
224
|
+
inputMode: 'rows_file' | 'flows_dir' | 'run_root';
|
|
225
|
+
effectiveFlowsDir: string;
|
|
226
|
+
materializationSummaryPath: string | null;
|
|
227
|
+
runId: string;
|
|
228
|
+
reviewInputSummary: JsonRecord;
|
|
229
|
+
};
|
|
230
|
+
declare function listFlowFiles(flowsDir: string): string[];
|
|
231
|
+
declare function renderZhReview(options: {
|
|
232
|
+
runId: string;
|
|
233
|
+
logicVersion: string;
|
|
234
|
+
flowsDir: string;
|
|
235
|
+
flowSummaries: JsonRecord[];
|
|
236
|
+
ruleFindings: FlowRuleFinding[];
|
|
237
|
+
llmFindings: FlowRuleFinding[];
|
|
238
|
+
llmResult: FlowQaLlmResult;
|
|
239
|
+
mergedFindings: FlowRuleFinding[];
|
|
240
|
+
summary: FlowQaReport;
|
|
241
|
+
}): string;
|
|
242
|
+
declare function renderEnReview(options: {
|
|
243
|
+
runId: string;
|
|
244
|
+
logicVersion: string;
|
|
245
|
+
flowsDir: string;
|
|
246
|
+
flowCount: number;
|
|
247
|
+
ruleFindingCount: number;
|
|
248
|
+
llmFindingCount: number;
|
|
249
|
+
llmResult: FlowQaLlmResult;
|
|
250
|
+
methodologyRuleSource: string;
|
|
251
|
+
}): string;
|
|
252
|
+
declare function renderTimingReview(options: {
|
|
253
|
+
runId: string;
|
|
254
|
+
startTs?: string;
|
|
255
|
+
endTs?: string;
|
|
256
|
+
flowCount: number;
|
|
257
|
+
}): string;
|
|
258
|
+
export declare function runFlowQa(options: RunFlowQaOptions): Promise<FlowQaReport>;
|
|
259
|
+
declare function reportRowsFile(value: unknown): string;
|
|
260
|
+
export declare const __testInternals: {
|
|
261
|
+
applyMethodologyChecks: typeof applyMethodologyChecks;
|
|
262
|
+
buildFlowSummaryAndRuleFindings: typeof buildFlowSummaryAndRuleFindings;
|
|
263
|
+
buildSimilarity: typeof buildSimilarity;
|
|
264
|
+
buildLlmPrompt: typeof buildLlmPrompt;
|
|
265
|
+
classificationLeaf: typeof classificationLeaf;
|
|
266
|
+
computeSimilarity: typeof computeSimilarity;
|
|
267
|
+
createRuleFinding: typeof createRuleFinding;
|
|
268
|
+
findUuidInNode: typeof findUuidInNode;
|
|
269
|
+
flowRoot: typeof flowRoot;
|
|
270
|
+
langTextForLang: typeof langTextForLang;
|
|
271
|
+
listFlowFiles: typeof listFlowFiles;
|
|
272
|
+
materializeRowsFile: typeof materializeRowsFile;
|
|
273
|
+
nameFingerprint: typeof nameFingerprint;
|
|
274
|
+
normalizeLlmFinding: typeof normalizeLlmFinding;
|
|
275
|
+
parseLlmJsonOutput: typeof parseLlmJsonOutput;
|
|
276
|
+
readJsonObject: typeof readJsonObject;
|
|
277
|
+
renderEnReview: typeof renderEnReview;
|
|
278
|
+
renderTimingReview: typeof renderTimingReview;
|
|
279
|
+
renderZhReview: typeof renderZhReview;
|
|
280
|
+
reportRowsFile: typeof reportRowsFile;
|
|
281
|
+
resolveReviewInput: typeof resolveReviewInput;
|
|
282
|
+
runOptionalLlmReview: typeof runOptionalLlmReview;
|
|
283
|
+
flowRulesetGate: typeof flowRulesetGate;
|
|
284
|
+
methodologyRuleCounts: typeof methodologyRuleCounts;
|
|
285
|
+
ruleCounts: typeof ruleCounts;
|
|
286
|
+
severityCounts: typeof severityCounts;
|
|
287
|
+
walkStrings: typeof walkStrings;
|
|
288
|
+
};
|
|
289
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { FetchLike } from './http.js';
|
|
2
|
+
import { type SupabaseDataRuntime } from './supabase-client.js';
|
|
3
|
+
type JsonObject = Record<string, unknown>;
|
|
4
|
+
export type SupabaseFlowRow = {
|
|
5
|
+
id: string;
|
|
6
|
+
version: string;
|
|
7
|
+
user_id: string | null;
|
|
8
|
+
state_code: number | null;
|
|
9
|
+
modified_at: string | null;
|
|
10
|
+
json: unknown;
|
|
11
|
+
};
|
|
12
|
+
export type FlowListQueryFilters = {
|
|
13
|
+
ids?: string[];
|
|
14
|
+
version?: string | null;
|
|
15
|
+
userId?: string | null;
|
|
16
|
+
stateCodes?: number[];
|
|
17
|
+
typeOfDataset?: string[];
|
|
18
|
+
order?: string | null;
|
|
19
|
+
limit?: number | null;
|
|
20
|
+
offset?: number | null;
|
|
21
|
+
};
|
|
22
|
+
export type SupabaseFlowLookup = {
|
|
23
|
+
row: SupabaseFlowRow;
|
|
24
|
+
sourceUrl: string;
|
|
25
|
+
resolution: 'remote_supabase_exact' | 'remote_supabase_latest' | 'remote_supabase_latest_fallback';
|
|
26
|
+
};
|
|
27
|
+
declare function buildHeaders(publishableKey: string, accessToken: string): Record<string, string>;
|
|
28
|
+
declare function normalizeTokenList(values: readonly string[] | undefined): string[];
|
|
29
|
+
declare function normalizeStateCodeList(values: readonly number[] | undefined): number[];
|
|
30
|
+
declare function buildFlowListUrl(restBaseUrl: string, filters: FlowListQueryFilters): string;
|
|
31
|
+
declare function parseFlowRows(payload: unknown, url: string): SupabaseFlowRow[];
|
|
32
|
+
declare function normalizeSupabaseFlowPayload(payload: unknown, lookupKey: string): JsonObject;
|
|
33
|
+
declare function listFlowRows(options: {
|
|
34
|
+
runtime: SupabaseDataRuntime;
|
|
35
|
+
filters: FlowListQueryFilters;
|
|
36
|
+
timeoutMs: number;
|
|
37
|
+
fetchImpl: FetchLike;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
rows: SupabaseFlowRow[];
|
|
40
|
+
sourceUrl: string;
|
|
41
|
+
}>;
|
|
42
|
+
declare function buildAmbiguousMatchDetails(rows: SupabaseFlowRow[]): Array<{
|
|
43
|
+
id: string;
|
|
44
|
+
version: string;
|
|
45
|
+
user_id: string | null;
|
|
46
|
+
state_code: number | null;
|
|
47
|
+
}>;
|
|
48
|
+
declare function latestRowsAreAmbiguous(rows: SupabaseFlowRow[]): boolean;
|
|
49
|
+
declare function fetchOneFlowRow(options: {
|
|
50
|
+
runtime: SupabaseDataRuntime;
|
|
51
|
+
id: string;
|
|
52
|
+
version?: string | null;
|
|
53
|
+
userId?: string | null;
|
|
54
|
+
stateCode?: number | null;
|
|
55
|
+
timeoutMs: number;
|
|
56
|
+
fetchImpl: FetchLike;
|
|
57
|
+
fallbackToLatest?: boolean;
|
|
58
|
+
}): Promise<SupabaseFlowLookup | null>;
|
|
59
|
+
export { buildFlowListUrl, buildHeaders, buildAmbiguousMatchDetails, fetchOneFlowRow, latestRowsAreAmbiguous, listFlowRows, normalizeStateCodeList, normalizeSupabaseFlowPayload, normalizeTokenList, parseFlowRows, };
|
|
60
|
+
export declare const __testInternals: {
|
|
61
|
+
buildFlowListUrl: typeof buildFlowListUrl;
|
|
62
|
+
buildHeaders: typeof buildHeaders;
|
|
63
|
+
buildAmbiguousMatchDetails: typeof buildAmbiguousMatchDetails;
|
|
64
|
+
latestRowsAreAmbiguous: typeof latestRowsAreAmbiguous;
|
|
65
|
+
normalizeStateCodeList: typeof normalizeStateCodeList;
|
|
66
|
+
normalizeSupabaseFlowPayload: typeof normalizeSupabaseFlowPayload;
|
|
67
|
+
normalizeTokenList: typeof normalizeTokenList;
|
|
68
|
+
parseFlowRows: typeof parseFlowRows;
|
|
69
|
+
};
|
|
70
|
+
export type { SupabaseDataRuntime };
|