@vectoriox/iox-ui 5.52.0 → 5.54.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 +144 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +52 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +150 -2
- package/harness-core/index.d.ts +17 -2
- package/package.json +1 -1
- package/src/generation-core/ai-run.ts +209 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/harness-core/site-analysis.ts +70 -0
|
@@ -3905,6 +3905,57 @@ function validateSiteAnalysis(value, ctx) {
|
|
|
3905
3905
|
c.oneOf(a, 'locale', Object.values(AnalysisLocale), '');
|
|
3906
3906
|
return { valid: c.issues.length === 0, issues: c.issues };
|
|
3907
3907
|
}
|
|
3908
|
+
/** The name a provider shows the format under (`json_schema.name`). */
|
|
3909
|
+
const SITE_ANALYSIS_SCHEMA_NAME = 'site_analysis';
|
|
3910
|
+
const OPTIONAL_MARK = '?';
|
|
3911
|
+
const text = () => ({ type: 'string' });
|
|
3912
|
+
const oneOf = (values) => ({ type: 'string', enum: [...values] });
|
|
3913
|
+
const listOf = (items) => ({ type: 'array', items });
|
|
3914
|
+
/** The shape table's own words for a key — the description the model reads. */
|
|
3915
|
+
function describe(shape, key) {
|
|
3916
|
+
const entry = SHAPE[shape];
|
|
3917
|
+
return String(entry[key] ?? entry[`${key}${OPTIONAL_MARK}`] ?? '');
|
|
3918
|
+
}
|
|
3919
|
+
/** An object of `shape`: exactly its keys, its required ones required, each described by the table. */
|
|
3920
|
+
function shaped(shape, properties) {
|
|
3921
|
+
return {
|
|
3922
|
+
type: 'object',
|
|
3923
|
+
properties: Object.fromEntries(Object.entries(properties).map(([key, schema]) => [key, { ...schema, description: describe(shape, key) }])),
|
|
3924
|
+
required: requiredShapeKeys(SHAPE[shape]),
|
|
3925
|
+
additionalProperties: false,
|
|
3926
|
+
};
|
|
3927
|
+
}
|
|
3928
|
+
/** `{ [fact]: factRead }`: the closed fact keys, each optional — a fact the prompt does not state is left out. */
|
|
3929
|
+
function factsSchema(factRead) {
|
|
3930
|
+
return {
|
|
3931
|
+
type: 'object',
|
|
3932
|
+
properties: Object.fromEntries(FACT_KEYS.map(key => [key, factRead])),
|
|
3933
|
+
required: [],
|
|
3934
|
+
additionalProperties: false,
|
|
3935
|
+
description: describe('analysis', 'facts'),
|
|
3936
|
+
};
|
|
3937
|
+
}
|
|
3938
|
+
function siteAnalysisJsonSchema() {
|
|
3939
|
+
const factRead = shaped('factRead', { value: text(), quote: text() });
|
|
3940
|
+
return shaped('analysis', {
|
|
3941
|
+
businessType: oneOf(BUSINESS_TYPE_IDS),
|
|
3942
|
+
alternatives: listOf(oneOf(BUSINESS_TYPE_IDS)),
|
|
3943
|
+
business: shaped('business', { name: text(), audience: text() }),
|
|
3944
|
+
needs: listOf(shaped('need', { id: oneOf(NEED_IDS), from: oneOf(Object.values(NeedSource)), name: text() })),
|
|
3945
|
+
facts: factsSchema(factRead),
|
|
3946
|
+
missingFacts: listOf(oneOf(FACT_KEYS)),
|
|
3947
|
+
voice: shaped('voice', {
|
|
3948
|
+
tone: text(),
|
|
3949
|
+
person: oneOf(Object.values(VoicePerson)),
|
|
3950
|
+
formality: oneOf(Object.values(VoiceFormality)),
|
|
3951
|
+
avoidWords: listOf(text()),
|
|
3952
|
+
}),
|
|
3953
|
+
moods: listOf(oneOf(MOOD_IDS)),
|
|
3954
|
+
avoid: listOf(oneOf(USER_AVOID_IDS)),
|
|
3955
|
+
hero: shaped('hero', { headline: text(), lead: text() }),
|
|
3956
|
+
locale: oneOf(Object.values(AnalysisLocale)),
|
|
3957
|
+
});
|
|
3958
|
+
}
|
|
3908
3959
|
|
|
3909
3960
|
var PresetFit;
|
|
3910
3961
|
(function (PresetFit) {
|
|
@@ -4331,5 +4382,5 @@ function structureFor(typeId) {
|
|
|
4331
4382
|
* Generated bundle index. Do not edit.
|
|
4332
4383
|
*/
|
|
4333
4384
|
|
|
4334
|
-
export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, CopyLength, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, NEEDS, NEED_IDS, NeedSource, PresetFit, RANK_WEIGHTS, READ_ANIMATE, READ_WEIGHTS, RankReason, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STRUCTURES, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisPromptContext, businessTypeById, calmerChoice, inferNeeds, isLookRule, lintDesign, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, motionAdvice, motionFor, normalizeAddress, oklchHue, presetHasSerifHeadings, presetLook, presetReason, rankStylePresets, rankWithReferences, structureFor, userAvoidRule, validateSiteAnalysis, withoutAddress };
|
|
4385
|
+
export { ANIMATE_ADVICE_STEPS, AnalysisIssueCode, AnalysisLocale, AvoidCheck, BUSINESS_TYPES, BUSINESS_TYPE_IDS, BookingNeed, COPY_LENGTH_ORDER, CopyLength, HARNESS_SOURCE, LITTLE_MOVEMENT_AVOID, LITTLE_MOVEMENT_CAP, LintKind, MAX_ANALYSIS_MOODS, NEEDS, NEED_IDS, NeedSource, PresetFit, RANK_WEIGHTS, READ_ANIMATE, READ_WEIGHTS, RankReason, SITE_ANALYSIS_SCHEMA_NAME, SPEC_ANALYSIS_SHAPE, SPEC_BUSINESS_TYPES, SPEC_HARNESS_EXAMPLES, SPEC_HARNESS_SOURCE, SPEC_NEEDS, SPEC_STRUCTURES, SPEC_USER_AVOIDS, STRUCTURES, StyleReadGround, StyleReadHeadings, StyleReadMotion, StyleReadSourceKind, USER_AVOID_IDS, VoiceFormality, VoicePerson, addressesIn, analysisPromptContext, businessTypeById, calmerChoice, inferNeeds, isLookRule, lintDesign, lookMatches, mapStyleRead, matchBusinessType, matchBusinessTypes, motionAdvice, motionFor, normalizeAddress, oklchHue, presetHasSerifHeadings, presetLook, presetReason, rankStylePresets, rankWithReferences, siteAnalysisJsonSchema, structureFor, userAvoidRule, validateSiteAnalysis, withoutAddress };
|
|
4335
4386
|
//# sourceMappingURL=vectoriox-iox-ui-harness-core.mjs.map
|