@vectoriox/iox-ui 5.47.0 → 5.48.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/design-core/index.d.ts +5 -3
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +7 -4
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +128 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +71 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +29 -1
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +109 -3
- package/harness-core/index.d.ts +21 -2
- package/index.d.ts +22 -3
- package/package.json +1 -1
- package/src/design-core/design-apply.ts +8 -4
- package/src/generation-core/entrances.ts +110 -0
- package/src/generation-core/plan-data.ts +71 -0
- package/src/generation-core/public-api.ts +2 -0
- package/src/harness-core/intake.ts +85 -0
- package/src/harness-core/public-api.ts +1 -0
|
@@ -4091,6 +4091,76 @@ function analysisPromptContext(analysis, opts = {}) {
|
|
|
4091
4091
|
};
|
|
4092
4092
|
}
|
|
4093
4093
|
|
|
4094
|
+
/**
|
|
4095
|
+
* What Start reads from the owner's words BEFORE any model runs (AI plan rev 3 §3d step 0, N-D3): the kind of
|
|
4096
|
+
* business by the contract's own keywords (`BusinessType.match` — "the no-model fallback"), and the addresses
|
|
4097
|
+
* typed into the box (each becomes a "style only" reference chip, R1). Pure; the template path uses it today and
|
|
4098
|
+
* the reading stage (M1-1) checks the model against the same match.
|
|
4099
|
+
*/
|
|
4100
|
+
/** A single Hebrew letter that prefixes a word (the, in, to, and, from, that, as) — "בסדנאות" holds "סדנ". */
|
|
4101
|
+
const HEBREW_PREFIX = '[הבלומשכ]?';
|
|
4102
|
+
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
4103
|
+
const KEYWORD_RES = new Map();
|
|
4104
|
+
/** A keyword matches at the START of a word (so a stem — "סדנ", "consult" — matches its forms). */
|
|
4105
|
+
function keywordRe(keyword) {
|
|
4106
|
+
let re = KEYWORD_RES.get(keyword);
|
|
4107
|
+
if (!re) {
|
|
4108
|
+
re = new RegExp(`(^|[^\\p{L}\\p{N}])${HEBREW_PREFIX}${escapeRe(keyword.toLocaleLowerCase())}`, 'u');
|
|
4109
|
+
KEYWORD_RES.set(keyword, re);
|
|
4110
|
+
}
|
|
4111
|
+
return re;
|
|
4112
|
+
}
|
|
4113
|
+
/** The kind of business the words name, best first; empty when none of the keywords appears. Ties keep the board's order. */
|
|
4114
|
+
function matchBusinessTypes(text, types = BUSINESS_TYPES) {
|
|
4115
|
+
const words = (text ?? '').toLocaleLowerCase();
|
|
4116
|
+
if (!words.trim())
|
|
4117
|
+
return [];
|
|
4118
|
+
return types
|
|
4119
|
+
.map((type, order) => {
|
|
4120
|
+
const keywords = type.match.filter(k => keywordRe(k).test(words));
|
|
4121
|
+
return { id: type.id, keywords, score: keywords.reduce((n, k) => n + k.length, 0), order };
|
|
4122
|
+
})
|
|
4123
|
+
.filter(m => m.score > 0)
|
|
4124
|
+
.sort((a, b) => b.score - a.score || a.order - b.order)
|
|
4125
|
+
.map(({ order, ...m }) => m);
|
|
4126
|
+
}
|
|
4127
|
+
/** The single best kind of business the words name, or null. */
|
|
4128
|
+
function matchBusinessType(text, types = BUSINESS_TYPES) {
|
|
4129
|
+
return matchBusinessTypes(text, types)[0]?.id ?? null;
|
|
4130
|
+
}
|
|
4131
|
+
const ADDRESS_RE = /(?:https?:\/\/)?(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<>"']*)?/gi;
|
|
4132
|
+
const TRAILING = /[.,;:!?)\]}'"״׳]+$/;
|
|
4133
|
+
/** An address as a chip shows it: no scheme, no `www.`, no trailing punctuation or slash, lower-case host. */
|
|
4134
|
+
function normalizeAddress(raw) {
|
|
4135
|
+
const bare = raw.replace(TRAILING, '').replace(/^https?:\/\//i, '').replace(/^www\./i, '').replace(/\/+$/, '');
|
|
4136
|
+
const slash = bare.indexOf('/');
|
|
4137
|
+
return slash < 0 ? bare.toLowerCase() : bare.slice(0, slash).toLowerCase() + bare.slice(slash);
|
|
4138
|
+
}
|
|
4139
|
+
/** Every website address typed or pasted in the words (an http(s) address or a bare domain), once each, in
|
|
4140
|
+
* order. An email address is not a website. */
|
|
4141
|
+
function addressesIn(text) {
|
|
4142
|
+
const found = [];
|
|
4143
|
+
for (const m of (text ?? '').matchAll(ADDRESS_RE)) {
|
|
4144
|
+
const before = m.index ? text[m.index - 1] : '';
|
|
4145
|
+
if (before === '@' || /[\p{L}\p{N}_-]/u.test(before))
|
|
4146
|
+
continue;
|
|
4147
|
+
const address = normalizeAddress(m[0]);
|
|
4148
|
+
if (address && !found.includes(address))
|
|
4149
|
+
found.push(address);
|
|
4150
|
+
}
|
|
4151
|
+
return found;
|
|
4152
|
+
}
|
|
4153
|
+
/** The words without one address (removing its chip): every spelling of it, and the space it leaves. */
|
|
4154
|
+
function withoutAddress(text, address) {
|
|
4155
|
+
const out = (text ?? '').replace(ADDRESS_RE, (m, offset, whole) => {
|
|
4156
|
+
const before = offset ? whole[offset - 1] : '';
|
|
4157
|
+
if (before === '@' || /[\p{L}\p{N}_-]/u.test(before))
|
|
4158
|
+
return m;
|
|
4159
|
+
return normalizeAddress(m) === address ? '' : m;
|
|
4160
|
+
});
|
|
4161
|
+
return out.replace(/[ \t]{2,}/g, ' ').replace(/ +([.,;:!?])/g, '$1').trim();
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4094
4164
|
/**
|
|
4095
4165
|
* @vectoriox/iox-ui/harness-core — the design HARNESS (AI plan rev 3 §3f, decision N18), FRAMEWORK-FREE: the 30
|
|
4096
4166
|
* kinds of business and their rules (generated 1:1 from iox-ai-guidance `flavor-spec.v1.json` `harness`), the
|
|
@@ -4105,5 +4175,5 @@ function analysisPromptContext(analysis, opts = {}) {
|
|
|
4105
4175
|
* Generated bundle index. Do not edit.
|
|
4106
4176
|
*/
|
|
4107
4177
|
|
|
4108
|
-
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, analysisPromptContext, businessTypeById, calmerChoice, inferNeeds, isLookRule, lintDesign, lookMatches, mapStyleRead, motionFor, oklchHue, presetHasSerifHeadings, presetLook, rankStylePresets, rankWithReferences, userAvoidRule, validateSiteAnalysis };
|
|
4178
|
+
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, motionFor, normalizeAddress, oklchHue, presetHasSerifHeadings, presetLook, rankStylePresets, rankWithReferences, userAvoidRule, validateSiteAnalysis, withoutAddress };
|
|
4109
4179
|
//# sourceMappingURL=vectoriox-iox-ui-harness-core.mjs.map
|