@vectoriox/iox-ui 5.62.1 → 5.64.0
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/fesm2022/vectoriox-iox-ui-generation-core.mjs +143 -26
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +54 -16
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +29 -5
- package/harness-core/index.d.ts +10 -3
- package/package.json +1 -1
- package/src/generation-core/compose-site.ts +21 -23
- package/src/generation-core/plan-derived.ts +84 -0
- package/src/generation-core/plan-edits.ts +8 -3
- package/src/generation-core/plan-wire.ts +9 -4
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/recipe-fields.ts +49 -0
- package/src/generation-core/validate-site-plan.ts +15 -2
- package/src/harness-core/site-analysis.ts +43 -8
- package/src/harness-core/site-reading.ts +16 -7
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
|
|
7
7
|
import { paletteSamples, readPalette } from './palette';
|
|
8
8
|
import { StyleRead, StyleReadGround, StyleReadHeadings, StyleReadSourceKind } from './rank';
|
|
9
|
-
import { AnalysisIssue, MAX_ANALYSIS_MOODS, SiteAnalysis, siteAnalysisJsonSchema, validateSiteAnalysis } from './site-analysis';
|
|
9
|
+
import { AnalysisIssue, analysisFromWire, MAX_ANALYSIS_MOODS, SiteAnalysis, siteAnalysisJsonSchema, validateSiteAnalysis } from './site-analysis';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The READING call (AI plan §3d step 1, §3k R2, M1-1): ONE `text.fast` call reads the owner's words AND the pictures
|
|
@@ -129,23 +129,32 @@ function validatePictures(c: Collector, raw: unknown, count: number): void {
|
|
|
129
129
|
c.oneOf(style, 'density', Object.keys(SPEC_AXES.densities), 'pictures.style');
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
/** The analysis on the wire, judged as the document it becomes: the wire's own faults, then `validateSiteAnalysis`'s. */
|
|
133
|
+
function analysisIssues(wire: unknown, prompt: string): AnalysisIssue[] {
|
|
134
|
+
const read = analysisFromWire(wire);
|
|
135
|
+
return [...read.issues, ...validateSiteAnalysis(read.analysis, { prompt }).issues];
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
/** The reading's gate: the analysis by `validateSiteAnalysis` (paths under `analysis.` when pictures came too), the pictures by `READING_SHAPE`. */
|
|
133
139
|
export function validateSiteReading(value: unknown, ctx: { prompt: string; pictureCount: number }): { valid: boolean; issues: ReadingIssue[] } {
|
|
134
|
-
if (ctx.pictureCount <= 0)
|
|
140
|
+
if (ctx.pictureCount <= 0) {
|
|
141
|
+
const issues = analysisIssues(value, ctx.prompt);
|
|
142
|
+
return { valid: issues.length === 0, issues };
|
|
143
|
+
}
|
|
135
144
|
const c = new Collector();
|
|
136
145
|
const reading = c.object(value, 'reading', '');
|
|
137
146
|
if (!reading) return { valid: false, issues: c.issues };
|
|
138
|
-
const
|
|
139
|
-
const issues: ReadingIssue[] = analysis.issues.map(i => ({ ...i, path: pathAt('analysis', i.path) }));
|
|
147
|
+
const issues: ReadingIssue[] = analysisIssues(reading['analysis'], ctx.prompt).map(i => ({ ...i, path: pathAt('analysis', i.path) }));
|
|
140
148
|
validatePictures(c, reading['pictures'], ctx.pictureCount);
|
|
141
149
|
issues.push(...c.issues);
|
|
142
150
|
return { valid: issues.length === 0, issues };
|
|
143
151
|
}
|
|
144
152
|
|
|
145
|
-
/** A valid reading's answer → `SiteReading` (the analysis alone answers `{ analysis }
|
|
153
|
+
/** A valid reading's answer → `SiteReading` (the analysis alone answers `{ analysis }`; the facts made a map again). */
|
|
146
154
|
export function decodeSiteReading(value: unknown, pictureCount: number): SiteReading {
|
|
147
|
-
if (pictureCount <= 0) return { analysis: value as SiteAnalysis };
|
|
148
|
-
|
|
155
|
+
if (pictureCount <= 0) return { analysis: analysisFromWire(value).analysis as SiteAnalysis };
|
|
156
|
+
const reading = value as SiteReading;
|
|
157
|
+
return { ...reading, analysis: analysisFromWire(reading.analysis).analysis as SiteAnalysis };
|
|
149
158
|
}
|
|
150
159
|
|
|
151
160
|
// ── Readings → ONE StyleRead ───────────────────────────────────────────────────────────────────────────
|