@vectoriox/iox-ui 5.151.1 → 5.153.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/assist-core/index.d.ts +200 -5
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +273 -15
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +149 -7
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/generation-core/index.d.ts +69 -6
- package/package.json +1 -1
- package/src/assist-core/media-generate.ts +325 -0
- package/src/assist-core/public-api.ts +1 -0
- package/src/assist-core/site-look.ts +12 -4
- package/src/assist-core/surfaces.ts +3 -0
- package/src/generation-core/adjustments.ts +25 -2
- package/src/generation-core/fallback-memory.ts +142 -0
- package/src/generation-core/public-api.ts +1 -0
package/assist-core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiStep, JsonSchema, PlanWordContext, AdjustAxis, AdjustKind, SerializedNode, SectionInput, KeptReason } from '@vectoriox/iox-ui/generation-core';
|
|
1
|
+
import { AiStep, JsonSchema, PlanWordContext, AdjustAxis, AdjustKind, SerializedNode, SectionInput, KeptReason, AiFeature, WordsArea, PictureReview, AiTokenPrice, AiModelEntry, ArtDirection, AiEntitlementsView, AiRefusal } from '@vectoriox/iox-ui/generation-core';
|
|
2
2
|
import { DesignChoices, DesignMode } from '@vectoriox/iox-ui/design-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1048,8 +1048,8 @@ declare function applySectionEdits(layout: ReadonlyArray<SerializedNode>, edits:
|
|
|
1048
1048
|
/**
|
|
1049
1049
|
* Surface S1 (the builder), family `look` (ai-assist-plan §4 AI2e; ai-session-panel-plan `setLook` / `setMotion`): the
|
|
1050
1050
|
* SITE's look and motion — every page follows — changed only along the contract's own axes: a style preset, the brand
|
|
1051
|
-
* colour, the background tint, corners, pill buttons, spacing, the
|
|
1052
|
-
* animated and the change between pages. Never a token value, never CSS. A preset brings its whole look and keeps the
|
|
1051
|
+
* colour, the background tint, corners, pill buttons, spacing, the content width (award §0c CW4), the type pairing, the
|
|
1052
|
+
* colour mode, speed, scrolling, how animated and the change between pages. Never a token value, never CSS. A preset brings its whole look and keeps the
|
|
1053
1053
|
* site's own Scrolling · How animated · Between pages (MO-D3, as Design ▸ Look does); a type pairing is one of the worn
|
|
1054
1054
|
* style's own. The colour is checked by the SAME audit the contract gates every preset with (`auditDesignContrast`, in
|
|
1055
1055
|
* every mode the look is worn) — a colour that fails is refused, never worn (R4: the AA gate decides the colour).
|
|
@@ -1064,6 +1064,8 @@ declare enum LookAxis {
|
|
|
1064
1064
|
Corners = "corners",
|
|
1065
1065
|
Buttons = "buttons",
|
|
1066
1066
|
Spacing = "spacing",
|
|
1067
|
+
/** The site's content column (award §0c, AW-D33): wide · contained · narrow — every page without its own word follows. */
|
|
1068
|
+
Column = "column",
|
|
1067
1069
|
Type = "type",
|
|
1068
1070
|
Mode = "mode",
|
|
1069
1071
|
Speed = "speed",
|
|
@@ -1612,5 +1614,198 @@ declare function turnLocale(sentence: string, fields: ReadonlyArray<AssistField>
|
|
|
1612
1614
|
/** The language's own name in the admin's language (`en` → "English" / "אנגלית"). */
|
|
1613
1615
|
declare const languageName: (locale: string, uiLang: string) => string;
|
|
1614
1616
|
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
+
/**
|
|
1618
|
+
* FILES BOX ▸ GENERATE — the vocabulary of AI Assist's surface S7 (ai-assist-plan §2 "S7", A-D14 · A-D15 · A-D16), the
|
|
1619
|
+
* pictures half. ONE spelling for the Files box (iox-cms-client), the route that makes the pictures (iox-cms) and the
|
|
1620
|
+
* proof: what may be asked, how the asked words become the prompt, what it costs before the button, when it is refused
|
|
1621
|
+
* before any call, and what a made picture is afterwards.
|
|
1622
|
+
*
|
|
1623
|
+
* It adds NO generator: a picture is made by the M7 pipeline (`AiStep.MakePictures`), looked at by the same review
|
|
1624
|
+
* (`AiStep.CheckPictures`, `PictureReview`), under the same art-direction preamble (`artDirectionPreamble`). What differs
|
|
1625
|
+
* from a site build's pictures is the owner's part: THEY write the words, THEY choose how many, and every candidate made
|
|
1626
|
+
* is charged and KEPT — a review that says no marks the picture, it does not buy a second try (gateway rule 3, R-H12).
|
|
1627
|
+
*/
|
|
1628
|
+
declare enum GenerateKind {
|
|
1629
|
+
Photo = "photo",
|
|
1630
|
+
Video = "video"
|
|
1631
|
+
}
|
|
1632
|
+
/** Why a kind cannot be made yet — the Files box says it in words, never with a button that fails (R-H13). */
|
|
1633
|
+
declare enum GenerateUnavailable {
|
|
1634
|
+
/** No provider makes a video from a start picture yet (`generateVideo`, premium-sites SC6c). */
|
|
1635
|
+
NoProvider = "noProvider"
|
|
1636
|
+
}
|
|
1637
|
+
/** What each kind can do today. Video turns on here, in one place, the day a provider exists. */
|
|
1638
|
+
declare const GENERATE_KINDS: Readonly<Record<GenerateKind, {
|
|
1639
|
+
readonly available: boolean;
|
|
1640
|
+
readonly why?: GenerateUnavailable;
|
|
1641
|
+
}>>;
|
|
1642
|
+
/** How many candidates one press makes. */
|
|
1643
|
+
declare const GENERATE_COUNTS: ReadonlyArray<number>;
|
|
1644
|
+
declare const GENERATE_COUNT_DEFAULT = 4;
|
|
1645
|
+
/** The frames offered (each a frame the image model is asked for — `PICTURE_ASPECTS`), widest first. */
|
|
1646
|
+
declare const GENERATE_SHAPES: ReadonlyArray<string>;
|
|
1647
|
+
declare const GENERATE_SHAPE_DEFAULT = "4:3";
|
|
1648
|
+
declare const GENERATE_PROMPT_MIN = 3;
|
|
1649
|
+
declare const GENERATE_PROMPT_MAX = 600;
|
|
1650
|
+
/** The element that opened the box, as far as a picture cares: its shape, and the part of it words sit over. */
|
|
1651
|
+
interface GenerateSlot {
|
|
1652
|
+
/** Width / height of the slot. */
|
|
1653
|
+
readonly aspect?: number;
|
|
1654
|
+
readonly wordsArea?: WordsArea;
|
|
1655
|
+
}
|
|
1656
|
+
/** What the owner asks for — the body of the route, checked by `generateRequestIssues` on both sides. */
|
|
1657
|
+
interface GeneratePicturesRequest {
|
|
1658
|
+
readonly kind: `${GenerateKind}`;
|
|
1659
|
+
/** The owner's own words. */
|
|
1660
|
+
readonly prompt: string;
|
|
1661
|
+
readonly shape: string;
|
|
1662
|
+
readonly count: number;
|
|
1663
|
+
/** Wear the site's art direction ("Your look") — on unless the owner turned it off. */
|
|
1664
|
+
readonly look: boolean;
|
|
1665
|
+
/** A picture model of the vetted list; absent = the studio's model for the step (Settings ▸ AI ▸ Models, A-D14). */
|
|
1666
|
+
readonly model?: string;
|
|
1667
|
+
readonly slot?: GenerateSlot;
|
|
1668
|
+
}
|
|
1669
|
+
declare enum GenerateIssueCode {
|
|
1670
|
+
Shape = "shape",
|
|
1671
|
+
Kind = "kind",
|
|
1672
|
+
KindUnavailable = "kindUnavailable",
|
|
1673
|
+
Prompt = "prompt",
|
|
1674
|
+
PromptTooLong = "promptTooLong",
|
|
1675
|
+
Frame = "frame",
|
|
1676
|
+
Count = "count",
|
|
1677
|
+
Model = "model"
|
|
1678
|
+
}
|
|
1679
|
+
interface GenerateIssue {
|
|
1680
|
+
readonly code: GenerateIssueCode;
|
|
1681
|
+
readonly path: string;
|
|
1682
|
+
readonly message: string;
|
|
1683
|
+
}
|
|
1684
|
+
/** What is wrong with a value as a request to generate pictures — nothing is repaired, each fault has its path. */
|
|
1685
|
+
declare function generateRequestIssues(value: unknown): GenerateIssue[];
|
|
1686
|
+
/**
|
|
1687
|
+
* The offered frame nearest a slot ("fits the slot"): by the ratio of the two shapes, so 4:5 goes to 3:4 and never to
|
|
1688
|
+
* 1:1 by a hair. No slot, or one with no shape yet = the default.
|
|
1689
|
+
*/
|
|
1690
|
+
declare function shapeForSlot(aspect: number | undefined | null): string;
|
|
1691
|
+
/**
|
|
1692
|
+
* The prompt a generated picture is asked with: the site's preamble VERBATIM when "Your look" is on (the same one a
|
|
1693
|
+
* site build's pictures get — one preamble per prompt), then the OWNER'S WORDS as written, the frame, and the part left
|
|
1694
|
+
* calm for words when the slot has words over it. Nothing else is added and nothing of the owner's is rewritten.
|
|
1695
|
+
*/
|
|
1696
|
+
declare function generatePicturePrompt(request: Pick<GeneratePicturesRequest, 'prompt' | 'shape' | 'look' | 'slot'>, direction: ArtDirection | null | undefined): string;
|
|
1697
|
+
/** True when the owner's words ask for writing INSIDE the picture — the box says "put the words on the page". */
|
|
1698
|
+
declare function promptAsksForWords(prompt: string): boolean;
|
|
1699
|
+
/**
|
|
1700
|
+
* "Describe from the page": the words the box fills in for the element that opened it — the section's own words and
|
|
1701
|
+
* the kind of business, never the business's name (it would be drawn). No model is asked; empty when the page says
|
|
1702
|
+
* nothing.
|
|
1703
|
+
*/
|
|
1704
|
+
declare function describeFromPage(context: {
|
|
1705
|
+
readonly business?: string;
|
|
1706
|
+
readonly words?: string;
|
|
1707
|
+
}): string;
|
|
1708
|
+
interface GenerateEstimate {
|
|
1709
|
+
readonly count: number;
|
|
1710
|
+
/** One picture, in credits. */
|
|
1711
|
+
readonly picture: number;
|
|
1712
|
+
/** One review of a picture, in credits. */
|
|
1713
|
+
readonly review: number;
|
|
1714
|
+
/** One candidate: a picture and its review. */
|
|
1715
|
+
readonly each: number;
|
|
1716
|
+
/** What the owner is shown, and the most the press may spend. */
|
|
1717
|
+
readonly total: number;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* The cost shown under the box (A-D15: the owner chooses the cost): every candidate is made once and looked at once.
|
|
1721
|
+
* Unlike a site build's pictures (`estimatePictures`) there is NO second try in it — a candidate the review says no to
|
|
1722
|
+
* is kept and marked, and the owner decides whether to press again.
|
|
1723
|
+
*/
|
|
1724
|
+
declare function estimateGenerate(count: number, prices: {
|
|
1725
|
+
readonly image: AiTokenPrice;
|
|
1726
|
+
readonly review: AiTokenPrice;
|
|
1727
|
+
}): GenerateEstimate;
|
|
1728
|
+
/** A picture model the owner may choose, with what one candidate costs on it (the model button, A-D14). */
|
|
1729
|
+
interface GenerateModelChoice {
|
|
1730
|
+
readonly id: string;
|
|
1731
|
+
readonly label: string;
|
|
1732
|
+
/** The studio's default for the step — what "Auto" runs. */
|
|
1733
|
+
readonly recommended: boolean;
|
|
1734
|
+
/** Null when the list carries no price for it (the provider reports each call's cost). */
|
|
1735
|
+
readonly each: number | null;
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* The picture models of the vetted list, each with its estimate for ONE candidate, the default first. A retired model
|
|
1739
|
+
* or one that cannot make a picture is never offered.
|
|
1740
|
+
*/
|
|
1741
|
+
declare function generateModelChoices(models: ReadonlyArray<AiModelEntry>, review: AiTokenPrice): GenerateModelChoice[];
|
|
1742
|
+
/**
|
|
1743
|
+
* The plan features Generate needs: the surface's own (AI Assist, A-D6) AND the one each step it runs belongs to
|
|
1744
|
+
* (`AI_STEP_FEATURE` — the picture steps are the site generator's). A plan missing any is refused `NotInPlan`.
|
|
1745
|
+
*/
|
|
1746
|
+
declare const GENERATE_FEATURES: ReadonlyArray<AiFeature>;
|
|
1747
|
+
/**
|
|
1748
|
+
* May this press run? The answer BEFORE any provider call (R-H12): the plan is known, it includes what Generate needs,
|
|
1749
|
+
* and the credits left cover the cost shown. The Files box asks it to disable the button and say why; iox-cms asks it
|
|
1750
|
+
* again with its own numbers before the first call — the client's are never trusted. Null = go.
|
|
1751
|
+
* A studio on its own key has no meter (`remaining: null`) and is never refused for credits.
|
|
1752
|
+
*/
|
|
1753
|
+
declare function generateRefusal(estimate: Pick<GenerateEstimate, 'total'>, entitlements: AiEntitlementsView | null | undefined): AiRefusal | null;
|
|
1754
|
+
/** Where one candidate stands — the tile's state in the grid. */
|
|
1755
|
+
declare enum CandidateState {
|
|
1756
|
+
Making = "making",
|
|
1757
|
+
Checking = "checking",
|
|
1758
|
+
/** Made, looked at, kept. */
|
|
1759
|
+
Kept = "kept",
|
|
1760
|
+
/** Made and kept, but the look found something the owner should see (words in it, a warped hand). */
|
|
1761
|
+
Flagged = "flagged",
|
|
1762
|
+
/** Not made: the provider failed. Nothing was charged for it. */
|
|
1763
|
+
Failed = "failed"
|
|
1764
|
+
}
|
|
1765
|
+
/** What the look found, in the order the tile says it. */
|
|
1766
|
+
declare enum CandidateFlag {
|
|
1767
|
+
/** Writing, a logo or a watermark inside the picture. */
|
|
1768
|
+
Words = "words",
|
|
1769
|
+
/** Warped hands, faces or objects. */
|
|
1770
|
+
Anatomy = "anatomy",
|
|
1771
|
+
/** Not what was asked for. */
|
|
1772
|
+
Subject = "subject",
|
|
1773
|
+
/** The part left for words is too busy to read over. */
|
|
1774
|
+
CalmArea = "calmArea"
|
|
1775
|
+
}
|
|
1776
|
+
interface CandidateVerdict {
|
|
1777
|
+
readonly state: CandidateState.Kept | CandidateState.Flagged;
|
|
1778
|
+
readonly flags: ReadonlyArray<CandidateFlag>;
|
|
1779
|
+
/** The alt text written from the picture — stored on the asset, set on the element when the picture is used. */
|
|
1780
|
+
readonly alt: string;
|
|
1781
|
+
}
|
|
1782
|
+
/**
|
|
1783
|
+
* A made picture after its look: KEPT either way (it was paid for), flagged when the review says no — the same four
|
|
1784
|
+
* answers a site build's review gives (`pictureReviewPasses`), read here as marks instead of a reason to try again.
|
|
1785
|
+
*/
|
|
1786
|
+
declare function candidateVerdict(review: PictureReview, slot?: Pick<GenerateSlot, 'wordsArea'>): CandidateVerdict;
|
|
1787
|
+
/** One candidate as the route answers it and the tile shows it. */
|
|
1788
|
+
interface GenerateCandidate {
|
|
1789
|
+
readonly id: string;
|
|
1790
|
+
readonly state: `${CandidateState}`;
|
|
1791
|
+
/** The asset written (`assets.source: generated`) — absent while making and when it failed. */
|
|
1792
|
+
readonly assetId?: string;
|
|
1793
|
+
readonly url?: string;
|
|
1794
|
+
readonly alt?: string;
|
|
1795
|
+
readonly flags?: ReadonlyArray<`${CandidateFlag}`>;
|
|
1796
|
+
/** What this candidate was charged, in credits (0 when it failed before a picture was made). */
|
|
1797
|
+
readonly credits?: number;
|
|
1798
|
+
}
|
|
1799
|
+
/** How one press ended, for the line under the box: how many were made, kept and charged; how many could not be. */
|
|
1800
|
+
interface GenerateOutcome {
|
|
1801
|
+
readonly made: number;
|
|
1802
|
+
readonly flagged: number;
|
|
1803
|
+
readonly failed: number;
|
|
1804
|
+
readonly credits: number;
|
|
1805
|
+
/** Every candidate has reached a final state. */
|
|
1806
|
+
readonly done: boolean;
|
|
1807
|
+
}
|
|
1808
|
+
declare function generateOutcome(candidates: ReadonlyArray<GenerateCandidate>): GenerateOutcome;
|
|
1809
|
+
|
|
1810
|
+
export { AI_DRAFT_SOURCE, AROUND_ITEMS_MAX, AROUND_TEXT_CHARS, ASK_SECTION_PATTERNS, ASK_STYLE_SETS, ASSIST_MODEL_AUTO, ASSIST_POLL_MS, ASSIST_ROUTES, AssistBriefError, AssistBudgetError, AssistFieldKind, AssistHandOff, AssistIssueCode, AssistMemoryOutcome, AssistPathError, AssistPermission, AssistRefusalCode, AssistRouteKey, AssistRunStatus, AssistScope, AssistStep, AssistSurface, AssistTurnStatus, BOOLEAN_FALSE, BOOLEAN_TRUE, CandidateFlag, CandidateState, CommitKind, EditFamily, FIELDS_PER_PART, FIELD_HANDLE_PREFIX, FOCUS_TEXT_CHARS, FieldsAnswerKey, GENERATE_COUNTS, GENERATE_COUNT_DEFAULT, GENERATE_FEATURES, GENERATE_KINDS, GENERATE_PROMPT_MAX, GENERATE_PROMPT_MIN, GENERATE_SHAPES, GENERATE_SHAPE_DEFAULT, GenerateIssueCode, GenerateKind, GenerateUnavailable, ItemSuggestionKind, LOCALE_NAME_LANGUAGES, LOOK_AXES, LOOK_AXIS_LABELS, LOOK_KEEP, LookAnswerKey, LookAxis, LookButtons, MAX_ASSIST_PHOTOS, MAX_ASSIST_PROPERTIES, MAX_ROUTE_PROPERTIES, MAX_SENTENCE_CHARS, MEMORY_TURNS, MODE_LABELS, NEW_TARGET, NONE_TEXT, NeverWriteReason, OWNER_FILL_MAX_CHARS, PAGE_WORD_SLOTS, PHOTOS_PER_READ, PHOTO_GROUP_HANDLE_PREFIX, PageChangeOp, PagePartKind, PageSuggestionKind, PhotoAnswerKey, PhotoGrouping, RouteAnswerKey, SECTION_START, SHORTEN_FROM_CHARS, SHORTEN_HEADING_FROM_CHARS, SHORTEN_TEXT_FROM_CHARS, SIBLING_HANDLE_PREFIX, SURFACES, SectionChangeKind, SectionsAnswerKey, StyleAnswerKey, SurfaceStatus, ValueSource, WORDS_PER_PART, WordsAnswerKey, adjustAxesOf, aiDraftStamp, applyFieldEdits, applyLookEdits, applyPageEdits, applySectionEdits, applyStyleEdits, applyWordEdits, askSectionPatternNames, askableStyles, assertAssistBudget, assistBudgetIssues, assistFactIssues, assistFields, assistPath, assistSession, assistSessionKey, builtSurfaces, candidateVerdict, clipText, commitOf, containsHtml, decodeFieldsAnswers, decodeLookAnswers, decodePhotoDraftAnswers, decodeSectionsAnswers, decodeStyleAnswers, decodeWordsAnswers, describeFromPage, draftFromPhotos, escapeText, estimateGenerate, fieldHandle, fieldsJsonSchema, fieldsNamedIn, generateModelChoices, generateOutcome, generatePicturePrompt, generateRefusal, generateRequestIssues, groupPhotos, isAiDraft, isEmptyFieldValue, isPlainRecord, isRunBusy, isSchemeEdit, isSectionEdit, isSessionOf, isSiteLookEdit, isSizeEdit, isStyleEdit, isTerminalTurn, isWritable, itemLocales, itemSuggestions, languageName, lookAxisValue, lookHex, lookJsonSchema, lookNames, memoryLine, namedLocale, ownerFillFields, ownerFillIssues, pageLooks, pageSuggestions, pageWriteLocale, paragraphsToRichText, photoDraftJsonSchema, photoGroupBrief, photoGroupHandle, photoReadCount, photoSlots, primaryLocale, promptAsksForWords, readFieldValue, readLocaleValues, readRoute, readableWords, resolveHandle, richTextParagraphs, routeJsonSchema, sectionLabel, sectionPatternOf, sectionsJsonSchema, serializedBaselineStyles, sessionMemory, shapeForSlot, styleJsonSchema, suggestPhotoType, summarizeItem, summarizeLook, summarizePage, summarizePhotos, surfacePermissions, surfaceSpec, surfaceUndoPermissions, takesPhotos, titleField, turnLocale, unknownHandles, validateRunRequest, validateTurnRequest, withOwnerFill, wordsJsonSchema };
|
|
1811
|
+
export type { AiDraftStamp, AssistChange, AssistEdit, AssistField, AssistIssue, AssistMemoryLine, AssistModelChoice, AssistPhoto, AssistRoute, AssistRunRequest, AssistRunView, AssistSession, AssistTarget, AssistTurn, AssistTurnAccepted, AssistTurnProgress, AssistTurnRefusal, AssistTurnRequest, AssistWordContext, BaselineStyles, Brief, BriefRules, BriefValue, CandidateVerdict, ContentControllerDef, ContentPropertyDef, ContentRecord, ContentTypeSchema, DraftValue, FieldChange, FieldEdit, FieldEditContext, FieldEditsOutcome, FieldsSchemaExtra, FieldsSchemaOptions, FieldsSchemas, GenerateCandidate, GenerateEstimate, GenerateIssue, GenerateModelChoice, GenerateOutcome, GeneratePicturesRequest, GenerateSlot, HandleMap, HandleResolution, HandleTarget, ItemAround, ItemBrief, ItemBriefContext, ItemBriefField, ItemFocus, ItemSuggestion, ItemSummary, KeptDraft, LookEditsOutcome, LookMap, LookSchemas, LookSummary, LookTarget, NeverWrite, NodeStyleEdit, PageAround, PageBrief, PageBriefContext, PageChange, PageEdit, PageEditContext, PageEditsOutcome, PageFocus, PageLook, PagePart, PageSectionSummary, PageSuggestion, PhotoBriefField, PhotoDraft, PhotoDraftAnswer, PhotoDraftContext, PhotoDraftOutcome, PhotoGroup, PhotoSlots, PhotosAround, PhotosBrief, PhotosBriefContext, PhotosFocus, SchemeEdit, SectionAdd, SectionChange, SectionEdit, SectionEditContext, SectionEditsOutcome, SectionMap, SectionMove, SectionRemove, SectionSwap, SectionTarget, SiteLookChange, SiteLookEdit, SizeEdit, StyleChange, StyleEdit, StyleEditContext, StyleEditsOutcome, StyleSchemas, SummarizedItem, SummarizedPage, SummarizedPhotos, SurfaceSpec, WalkedLook, WordChange, WordEdit, WordEditContext, WordEditsOutcome, WordsSchemas, WrittenWords };
|