@vectoriox/iox-ui 5.51.0 → 5.53.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 +27 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +24 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +142 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +496 -311
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +146 -2
- package/harness-core/index.d.ts +147 -2
- package/package.json +1 -1
- package/src/design-core/flavor-spec.generated.ts +24 -0
- package/src/design-core/style-presets.ts +3 -0
- package/src/generation-core/ai-run.ts +205 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/harness-core/business-types.ts +2 -0
- package/src/harness-core/harness-spec.generated.ts +240 -120
- package/src/harness-core/rank.ts +17 -1
- package/src/harness-core/site-analysis.ts +70 -0
|
@@ -3025,5 +3025,149 @@ interface BuildStepFacts {
|
|
|
3025
3025
|
}
|
|
3026
3026
|
declare function buildStepFacts(plan: SitePlan, actions?: Readonly<Record<string, `${ContentTypeAction}`>>): BuildStepFacts;
|
|
3027
3027
|
|
|
3028
|
-
|
|
3029
|
-
|
|
3028
|
+
/**
|
|
3029
|
+
* The AI pipeline's WIRE vocabulary (AI plan §3c, §3n, M0): what iox-cms's `ai` API answers and what every client
|
|
3030
|
+
* of it reads — the steps a model works on, who pays (IOX credits or the studio's own key), a model of the vetted
|
|
3031
|
+
* list with its price per token class, the one cost → credits rule (1 credit = 1 US cent of what the AI cost, D4),
|
|
3032
|
+
* the refusals (board 11) and a generation's stages. ONE definition: iox-cms meters and refuses with it, the
|
|
3033
|
+
* Settings ▸ AI screen and the wizard show it. Pure types, enums and helpers; no transport, no prices typed here.
|
|
3034
|
+
*/
|
|
3035
|
+
declare enum AiProviderId {
|
|
3036
|
+
Anthropic = "anthropic",
|
|
3037
|
+
OpenRouter = "openrouter"
|
|
3038
|
+
}
|
|
3039
|
+
/** Who pays: the platform's credits, or the studio's own provider key (metered for display, never charged). */
|
|
3040
|
+
declare enum AiKeyMode {
|
|
3041
|
+
Platform = "platform",
|
|
3042
|
+
Own = "own"
|
|
3043
|
+
}
|
|
3044
|
+
/** The steps a model works on (board 9's rows), in screen order. */
|
|
3045
|
+
declare enum AiStep {
|
|
3046
|
+
ReadMessage = "read",
|
|
3047
|
+
PlanSite = "plan",
|
|
3048
|
+
ChangePlan = "change",
|
|
3049
|
+
MakePictures = "pictures",
|
|
3050
|
+
NameStructures = "scan"
|
|
3051
|
+
}
|
|
3052
|
+
declare const AI_STEPS: ReadonlyArray<AiStep>;
|
|
3053
|
+
/** What a model must be able to do for a step to run on it. */
|
|
3054
|
+
declare enum AiCapability {
|
|
3055
|
+
StructuredOutput = "structured-output",
|
|
3056
|
+
ImageInput = "image-input",
|
|
3057
|
+
ImageOutput = "image-output"
|
|
3058
|
+
}
|
|
3059
|
+
declare const AI_STEP_NEEDS: Readonly<Record<AiStep, ReadonlyArray<AiCapability>>>;
|
|
3060
|
+
/** Tokens a typical use of a step reads and writes (plan §3d "Where credits go") — what a shown estimate is made of. */
|
|
3061
|
+
declare const AI_STEP_TYPICAL_TOKENS: Readonly<Record<AiStep, AiTokenCounts>>;
|
|
3062
|
+
/** Tokens by the class a provider prices them in. */
|
|
3063
|
+
interface AiTokenCounts {
|
|
3064
|
+
input: number;
|
|
3065
|
+
output: number;
|
|
3066
|
+
/** Written to the prompt cache (priced above input). */
|
|
3067
|
+
cacheWrite: number;
|
|
3068
|
+
/** Read from the prompt cache (priced well below input). */
|
|
3069
|
+
cacheRead: number;
|
|
3070
|
+
}
|
|
3071
|
+
/** US dollars per million tokens, per class. A class without a price is priced as input. */
|
|
3072
|
+
interface AiTokenPrice {
|
|
3073
|
+
input: number;
|
|
3074
|
+
output: number;
|
|
3075
|
+
cacheWrite?: number;
|
|
3076
|
+
cacheRead?: number;
|
|
3077
|
+
}
|
|
3078
|
+
/** A model of the vetted list (served by the control plane with the entitlements, §3n) — its price travels with it. */
|
|
3079
|
+
interface AiModelEntry {
|
|
3080
|
+
id: string;
|
|
3081
|
+
provider: `${AiProviderId}`;
|
|
3082
|
+
label: string;
|
|
3083
|
+
/** The steps it may be chosen for. */
|
|
3084
|
+
steps: ReadonlyArray<`${AiStep}`>;
|
|
3085
|
+
/** The steps it is the default for (board 9's "recommended"). */
|
|
3086
|
+
recommendedFor?: ReadonlyArray<`${AiStep}`>;
|
|
3087
|
+
capabilities: ReadonlyArray<`${AiCapability}`>;
|
|
3088
|
+
/** Null when the provider reports each call's cost itself and the list carries no price. */
|
|
3089
|
+
price: AiTokenPrice | null;
|
|
3090
|
+
/** Kept so old ledger rows still name it; never offered, and a studio's choice of it falls back to the default. */
|
|
3091
|
+
retired?: boolean;
|
|
3092
|
+
}
|
|
3093
|
+
/** 1 credit = 1 US cent of what the AI actually cost (decision D4). */
|
|
3094
|
+
declare const CREDITS_PER_USD = 100;
|
|
3095
|
+
declare const NO_TOKENS: Readonly<AiTokenCounts>;
|
|
3096
|
+
/** What `tokens` cost at `price`, in US dollars. */
|
|
3097
|
+
declare function costUsd(tokens: AiTokenCounts, price: AiTokenPrice): number;
|
|
3098
|
+
/** Dollars → credits, kept to a millionth of a credit (a short read costs a fraction of one). */
|
|
3099
|
+
declare function creditsOfUsd(usd: number): number;
|
|
3100
|
+
/** The credits a typical use of `step` costs on a model of `price` — never typed, always computed (§3d). */
|
|
3101
|
+
declare function estimateStepCredits(step: AiStep, price: AiTokenPrice, tokens?: AiTokenCounts): number;
|
|
3102
|
+
/** Can `model` do `step`? The step's needs against the model's capabilities. */
|
|
3103
|
+
declare function modelCanDo(model: Pick<AiModelEntry, 'capabilities'>, step: AiStep): boolean;
|
|
3104
|
+
/** Why AI did not run (board 11). The server refuses with these BEFORE any model call. */
|
|
3105
|
+
declare enum AiRefusalCode {
|
|
3106
|
+
NotInPlan = "ai.notInPlan",
|
|
3107
|
+
OutOfCredits = "ai.outOfCredits",
|
|
3108
|
+
CapReached = "ai.capReached",
|
|
3109
|
+
NotConnected = "ai.notConnected",
|
|
3110
|
+
KeyInvalid = "ai.keyInvalid",
|
|
3111
|
+
PlanUnknown = "ai.planUnknown"
|
|
3112
|
+
}
|
|
3113
|
+
/** The HTTP status each refusal answers with (board 11). */
|
|
3114
|
+
declare const AI_REFUSAL_STATUS: Readonly<Record<AiRefusalCode, number>>;
|
|
3115
|
+
/** What a refusal offers next. */
|
|
3116
|
+
declare enum AiNextKind {
|
|
3117
|
+
/** Ask IOX (a prefilled email to the operator, until a plan can be bought — D2). */
|
|
3118
|
+
Contact = "contact",
|
|
3119
|
+
/** Open Settings ▸ AI. */
|
|
3120
|
+
Settings = "settings",
|
|
3121
|
+
/** Try again later, or with less. */
|
|
3122
|
+
Retry = "retry"
|
|
3123
|
+
}
|
|
3124
|
+
declare const AI_REFUSAL_NEXT: Readonly<Record<AiRefusalCode, AiNextKind>>;
|
|
3125
|
+
interface AiRefusal {
|
|
3126
|
+
code: AiRefusalCode;
|
|
3127
|
+
planName?: string;
|
|
3128
|
+
/** Credits left this period (platform credits only). */
|
|
3129
|
+
remaining?: number;
|
|
3130
|
+
/** What the refused call would have cost, about. */
|
|
3131
|
+
estimate?: number;
|
|
3132
|
+
next: {
|
|
3133
|
+
kind: AiNextKind;
|
|
3134
|
+
href?: string;
|
|
3135
|
+
};
|
|
3136
|
+
}
|
|
3137
|
+
/** The studio's AI credits this period (the connector's meter, E4). `allowance: null` = unlimited. */
|
|
3138
|
+
interface AiMeter {
|
|
3139
|
+
used: number;
|
|
3140
|
+
allowance: number | null;
|
|
3141
|
+
remaining: number | null;
|
|
3142
|
+
periodStart: string;
|
|
3143
|
+
periodEnd: string;
|
|
3144
|
+
}
|
|
3145
|
+
/** A generation's stages (§3d). The runner works while `task` is set; otherwise the owner has the next move. */
|
|
3146
|
+
declare enum AiGenerationStage {
|
|
3147
|
+
Reading = "reading",
|
|
3148
|
+
Analysis = "analysis",
|
|
3149
|
+
Design = "design",
|
|
3150
|
+
Plan = "plan",
|
|
3151
|
+
Build = "build",
|
|
3152
|
+
Done = "done",
|
|
3153
|
+
Failed = "failed",
|
|
3154
|
+
Cancelled = "cancelled"
|
|
3155
|
+
}
|
|
3156
|
+
/** The stages nothing advances any more. */
|
|
3157
|
+
declare const FINAL_GENERATION_STAGES: ReadonlyArray<AiGenerationStage>;
|
|
3158
|
+
/** How one model call ended — a ledger row's status. */
|
|
3159
|
+
declare enum AiCallStatus {
|
|
3160
|
+
/** Written before the call: a reservation at the estimate until the call settles. */
|
|
3161
|
+
Started = "started",
|
|
3162
|
+
Ok = "ok",
|
|
3163
|
+
/** The answer came back and the shared validator refused it (with a path). */
|
|
3164
|
+
Invalid = "invalid",
|
|
3165
|
+
/** The model declined (a provider refusal) — charged what the provider reports. */
|
|
3166
|
+
Refused = "refused",
|
|
3167
|
+
Error = "error",
|
|
3168
|
+
/** The process died during the call: charged at the estimate, since what it cost was never reported. */
|
|
3169
|
+
Interrupted = "interrupted"
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
export { ACTIVE_BUILD_STATUSES, AI_REFUSAL_NEXT, AI_REFUSAL_STATUS, AI_STEPS, AI_STEP_NEEDS, AI_STEP_TYPICAL_TOKENS, AiCallStatus, AiCapability, AiGenerationStage, AiKeyMode, AiNextKind, AiProviderId, AiRefusalCode, AiStep, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BUILD_STEPS, BaselineRole, BindScope, BuildNoticeCode, BuildStep, CREDITS_PER_USD, CardBindTarget, ComposeError, ComposeIssueCode, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, FACT_KEYS, FINAL_GENERATION_STAGES, GlobalSlot, KeptReason, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NO_TOKENS, NavPagesSource, NavRole, NavShape, NavShapeError, PRICING_PATTERN, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PlaceholderKind, PlanDataSourceMode, PlanDataSourceType, PreflightRefusalCode, RelativeOp, SAMPLE_IMAGE_REF, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_FACTS, SPEC_SITE_LIBRARY, SPEC_SITE_PATTERNS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_TEMPLATES, STUDIO_TEMPLATE, SiteBuildKind, SiteBuildStatus, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StepState, addBarItem, altSourceScopes, assertStyleSlots, assertValidSitePlan, barIconForRoute, blocksPublish, buildKeys, buildStepFacts, builtHomePageId, composeNavHeader, composeSection, composeSite, costUsd, createSerializedNode, creditsOfUsd, describePlanData, entranceAction, entranceInteraction, estimateStepCredits, failedBuildStep, findNavRoot, isActiveBuild, isNonEmptyString, isPlainObject, modelCanDo, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, parseSampleImageRef, pathAt, patternById, patternNeedsBinding, patternNodes, patternOptionalParts, patternScopes, patternSlots, patternTakesBinding, phoneMenuPages, planFromTemplate, planNavShape, releasedLayoutDefaults, removeBarItem, requiredShapeKeys, routeParams, sampleImageRef, sectionEntrances, setStyleProps, shapeKeys, siteNavPages, staggerDelay, validateSitePlan, walkSerialized };
|
|
3173
|
+
export type { AddBarItemResult, AiMeter, AiModelEntry, AiRefusal, AiTokenCounts, AiTokenPrice, BarItemsEditResult, BuildNotice, BuildStepError, BuildStepFacts, BuildStepRecord, CmsDataSourcePlan, ComposeContext, ComposeIssue, ComposedDataSource, ComposedItem, ComposedNavHeader, ComposedPage, ComposedPlaceholder, ComposedRoute, ComposedSection, ComposedSite, ContentFieldPlan, ContentSeedPlan, ContentTypePlan, CreateNodeOptions, CreatedRecord, DataSourcePlan, EntranceAction, EntranceInteraction, EntranceSpec, FactKey, NavHeaderInput, NavHeaderOptions, NavPage, NavShapeOptions, NavShapeResult, NodeBaseline, PageData, PageDataLine, PagePlan, PageSectionPlan, PathIssue, PatternNode, PlainObject, PreflightRefusal, RelativeDataSourcePlan, SectionEntrances, SectionInput, SectionOptions, SerializedBinding, SerializedNode, SerializedResponsive, ShapeEntry, ShapeIssueCodes, SiteBuildRun, SiteBusiness, SitePageRef, SitePattern, SitePlan, SitePlanIssue, SitePlanSource, SitePlanValidation, SiteTemplate, TemplatePlanInput, UndoKept, UndoPreview, UndoRecord };
|