@aglyn/plugins-ai 1.14.0 → 1.15.1
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/package.json +17 -17
- package/src/lib/components/ai-site-build-page.component.js +5 -3
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-finish.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-finish.component.js +3 -3
- package/src/lib/components/ai-site-import-finish.component.js.map +1 -1
- package/src/lib/components/ai-site-import-job.component.d.ts +4 -3
- package/src/lib/components/ai-site-import-job.component.js +141 -43
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/components/ai-site-import-plan.component.d.ts +42 -0
- package/src/lib/components/ai-site-import-plan.component.js +246 -0
- package/src/lib/components/ai-site-import-plan.component.js.map +1 -0
- package/src/lib/components/ai-site-import-start.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-start.component.js +6 -3
- package/src/lib/components/ai-site-import-start.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.js +6 -2
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +3 -2
- package/src/lib/components/ai-site-start-steps.component.js +12 -5
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +63 -2
- package/src/lib/jobs/ai-job-import-step.js +372 -22
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +4 -1
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +23 -2
- package/src/lib/jobs/ai-job-page-language.js +252 -5
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +7 -0
- package/src/lib/jobs/ai-job-page-step.js +75 -12
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.js +4 -2
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-look.js +14 -5
- package/src/lib/jobs/ai-job-site-look.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +11 -2
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.js +2 -1
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +43 -2
- package/src/lib/jobs/ai-site-import-compile.js +131 -63
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +25 -1
- package/src/lib/jobs/ai-site-import-document.js +26 -7
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-honesty.d.ts +65 -0
- package/src/lib/jobs/ai-site-import-honesty.js +271 -0
- package/src/lib/jobs/ai-site-import-honesty.js.map +1 -0
- package/src/lib/jobs/ai-site-import-improve.d.ts +286 -0
- package/src/lib/jobs/ai-site-import-improve.js +1281 -0
- package/src/lib/jobs/ai-site-import-improve.js.map +1 -0
- package/src/lib/jobs/ai-site-import-look.d.ts +4 -0
- package/src/lib/jobs/ai-site-import-look.js +16 -6
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/jobs/ai-site-import-pictures.d.ts +83 -0
- package/src/lib/jobs/ai-site-import-pictures.js +261 -0
- package/src/lib/jobs/ai-site-import-pictures.js.map +1 -0
- package/src/lib/jobs/ai-site-import-plan.d.ts +78 -0
- package/src/lib/jobs/ai-site-import-plan.js +627 -0
- package/src/lib/jobs/ai-site-import-plan.js.map +1 -0
- package/src/lib/jobs/ai-site-import-wording.js +2 -5
- package/src/lib/jobs/ai-site-import-wording.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +6 -0
- package/src/lib/layout-language/ai-layout-compiler.js +10 -6
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +9 -0
- package/src/lib/layout-language/ai-layout-design.js +29 -3
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +5 -0
- package/src/lib/layout-language/ai-layout-frame-source.js +4 -2
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-frame.js +20 -12
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +8 -0
- package/src/lib/layout-language/ai-layout-language.js +7 -3
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-credit-estimate.d.ts +16 -0
- package/src/lib/model/ai-credit-estimate.js +14 -0
- package/src/lib/model/ai-credit-estimate.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +64 -0
- package/src/lib/model/ai-site-import-fidelity.js +380 -0
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-ledger.d.ts +82 -0
- package/src/lib/model/ai-site-import-ledger.js +254 -0
- package/src/lib/model/ai-site-import-ledger.js.map +1 -0
- package/src/lib/model/ai-site-import-view.d.ts +113 -7
- package/src/lib/model/ai-site-import-view.js +174 -16
- package/src/lib/model/ai-site-import-view.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +253 -3
- package/src/lib/model/ai-site-import.js +371 -25
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-job.js +4 -0
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.d.ts +2 -0
- package/src/lib/model/ai-site-kinds.js +7 -0
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +14 -5
- package/src/lib/model/ai-site-look.js +22 -16
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +37 -7
- package/src/lib/model/ai-site-start.js +54 -10
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-site-starter-look.d.ts +69 -0
- package/src/lib/model/ai-site-starter-look.js +90 -0
- package/src/lib/model/ai-site-starter-look.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -0
- package/src/lib/runtime/ai-doctrine-validators.js +3 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.d.ts +10 -0
- package/src/lib/runtime/ai-doctrine.js +16 -2
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +12 -3
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-jobs-route.js +5 -1
- package/src/lib/server/ai-jobs-route.js.map +1 -1
- package/src/lib/server/ai-site-import-route.d.ts +6 -0
- package/src/lib/server/ai-site-import-route.js +8 -1
- package/src/lib/server/ai-site-import-route.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +46 -7
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +260 -14
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-improve-answers.d.ts +33 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js +457 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js.map +1 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +29 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +26 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-flag.d.ts +17 -0
- package/src/lib/site-import/site-import-flag.js +15 -0
- package/src/lib/site-import/site-import-flag.js.map +1 -1
|
@@ -50,7 +50,16 @@ export interface AiLayoutDesign {
|
|
|
50
50
|
seed: number;
|
|
51
51
|
/** Whether this page is the site's home, which opens tallest. */
|
|
52
52
|
home: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* What a site's plan chose for it (AGL-4152), so every page of every wave is
|
|
55
|
+
* drawn alike. Absent on every other site, whose choices are its seed's.
|
|
56
|
+
*/
|
|
57
|
+
planned?: AiLayoutPlannedChoices;
|
|
53
58
|
}
|
|
59
|
+
/** The choices a site's plan makes in place of its seed's (AGL-4152). */
|
|
60
|
+
export type AiLayoutPlannedChoices = Partial<Pick<AiLayoutDesignChoices, 'hero' | 'group' | 'bandRhythm' | 'coverClose'>>;
|
|
61
|
+
/** A plan's choices as a job carries them, read defensively (AGL-4152); `null` for none. */
|
|
62
|
+
export declare function aiLayoutPlannedChoicesOf(raw: unknown): AiLayoutPlannedChoices | null;
|
|
54
63
|
/**
|
|
55
64
|
* How the first section of a page is drawn:
|
|
56
65
|
* - `cover`: a full-bleed photo with the words over it on a scrim, set at
|
|
@@ -40,7 +40,33 @@
|
|
|
40
40
|
* many items each shows are still the model's, page by page.
|
|
41
41
|
*
|
|
42
42
|
* Pure: no tree, no theme, no network.
|
|
43
|
-
*/ /** What the compiler is told about the site a page belongs to. */
|
|
43
|
+
*/ /** What the compiler is told about the site a page belongs to. */ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
44
|
+
/** A plan's choices as a job carries them, read defensively (AGL-4152); `null` for none. */ export function aiLayoutPlannedChoicesOf(raw) {
|
|
45
|
+
if (!raw || typeof raw !== 'object') return null;
|
|
46
|
+
const value = raw;
|
|
47
|
+
const hero = AI_LAYOUT_HERO_VARIANTS.find((entry)=>entry === value['hero']);
|
|
48
|
+
const group = [
|
|
49
|
+
'cards',
|
|
50
|
+
'ruled',
|
|
51
|
+
'icons'
|
|
52
|
+
].find((entry)=>entry === value['group']);
|
|
53
|
+
const bandRhythm = [
|
|
54
|
+
'alternate',
|
|
55
|
+
'plain'
|
|
56
|
+
].find((entry)=>entry === value['bandRhythm']);
|
|
57
|
+
const coverClose = typeof value['coverClose'] === 'boolean' ? value['coverClose'] : null;
|
|
58
|
+
const planned = _extends({}, hero ? {
|
|
59
|
+
hero
|
|
60
|
+
} : {}, group ? {
|
|
61
|
+
group
|
|
62
|
+
} : {}, bandRhythm ? {
|
|
63
|
+
bandRhythm
|
|
64
|
+
} : {}, coverClose !== null ? {
|
|
65
|
+
coverClose
|
|
66
|
+
} : {});
|
|
67
|
+
return Object.keys(planned).length ? planned : null;
|
|
68
|
+
}
|
|
69
|
+
/** Every hero arrangement, as {@link AiLayoutHeroVariant} lists them. */ export const AI_LAYOUT_HERO_VARIANTS = [
|
|
44
70
|
'cover',
|
|
45
71
|
'poster',
|
|
46
72
|
'split',
|
|
@@ -488,7 +514,7 @@ const pick = (next, list)=>list[Math.floor(next() * list.length) % list.length];
|
|
|
488
514
|
const signature = aiLayoutKindSignature(design.kind);
|
|
489
515
|
const hero = pick(next, signature.heroes);
|
|
490
516
|
const group = pick(next, signature.groups);
|
|
491
|
-
return {
|
|
517
|
+
return _extends({
|
|
492
518
|
hero,
|
|
493
519
|
// A store's reasons to buy — the making, the shipping, the care — read
|
|
494
520
|
// as open columns each led by an icon, the way a storefront theme draws
|
|
@@ -513,7 +539,7 @@ const pick = (next, list)=>list[Math.floor(next() * list.length) % list.length];
|
|
|
513
539
|
// Drawn after it (AGL-4065), so a seed's earlier choices stay too.
|
|
514
540
|
headingCase: next() < (LABEL_TITLE_KINDS.has(design.kind) ? 0.3 : 0.1) ? 'caps' : 'sentence',
|
|
515
541
|
bandRhythm: next() < (ONE_GROUND_FAMILIES.has(family) ? 0.5 : 0.35) ? 'plain' : 'alternate'
|
|
516
|
-
};
|
|
542
|
+
}, design.planned);
|
|
517
543
|
}
|
|
518
544
|
const WORK = /\b(work|works|project|projects|portfolio|gallery|galleries|case|cases|studies|selected|commission|commissions|illustration|illustrations|photo|photos|series|book|books|editorial|brand|collection|collections|wedding|weddings|portrait|portraits|session|sessions|shoot|shoots)\b/i;
|
|
519
545
|
const WRITING = /\b(article|articles|post|posts|writing|writings|latest|featured|journey|journeys|recipe|recipes|story|stories|essay|essays|guide|guides|issue|issues|episode|episodes)\b/i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/layout-language/ai-layout-design.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * THE DESIGNER LAYER of the layout compiler (AGL-3660): how a page the model\n * described in the layout language is ARRANGED, decided by code from the\n * site's kind and its job's seed — never asked of the model, so a recorded\n * answer compiles into the new design with no new call.\n *\n * Why. A page compiled one way for every site read like a SaaS landing page:\n * a centered text hero, three outlined cards, a numbered row, a solid form\n * band. The designer templates people compare a site to (Squarespace's Loam,\n * Clove, Auburn, Rivoli, Matsuya; Wix's portfolio and restaurant sets) are\n * built from a handful of moves instead — a full-bleed photo hero with the\n * type over it, image and text side by side, work shown as pictures in an\n * uneven grid, writing as a list under thin rules, a closing band over a\n * photo — and they pick those moves for the KIND of site.\n *\n * So a site's design is a set of VARIANTS — the hero's arrangement, how its\n * groups are drawn, whether its text sections take a picture beside them,\n * how its closing section reads — each chosen among the ones that suit the\n * kind, by the seed. The choices are the site's: every page of one site is\n * drawn with the same hero and the same group style, so the site reads as\n * one design, and two sites of one kind come out differently.\n *\n * This is NOT a template library. A variant is a way of drawing whatever the\n * model wrote; the sections, their order, their bands, their words and how\n * many items each shows are still the model's, page by page.\n *\n * Pure: no tree, no theme, no network.\n */\n\n/** What the compiler is told about the site a page belongs to. */\nexport interface AiLayoutDesign {\n /** The site's kind (`AI_SITE_KINDS`); an unknown one draws as a business site. */\n kind: string\n /** The job's design seed: the same for every page of one site. */\n seed: number\n /** Whether this page is the site's home, which opens tallest. */\n home: boolean\n}\n\n/**\n * How the first section of a page is drawn:\n * - `cover`: a full-bleed photo with the words over it on a scrim, set at\n * the start of the page;\n * - `poster`: a full-bleed photo, taller, the words centered over it in\n * display type (AGL-3985);\n * - `split`: the words beside a tall photo, inside the page's measure;\n * - `bleed`: the band in two halves, a photo filling one edge to edge and\n * the words in the other (AGL-3985);\n * - `editorial`: display type across the page, the lede and the buttons in\n * a row under it, and a wide photo below;\n * - `column`: a masthead — the words centered in a narrow column, a wide\n * photo under them (AGL-3985);\n * - `collage`: the words beside two photos, a tall one and a smaller one\n * laid over its corner (AGL-3985);\n * - `panel`: a full-bleed photo, undimmed, with the words on a card of the\n * page's surface over its lower corner (AGL-3985);\n * - `portrait`: a round photo over the words, all centered: a person's own\n * page (AGL-3985).\n */\nexport type AiLayoutHeroVariant = 'cover' | 'poster' | 'split' | 'bleed' | 'editorial' | 'column' | 'collage' | 'panel' | 'portrait'\n\n/** Every hero arrangement, as {@link AiLayoutHeroVariant} lists them. */\nexport const AI_LAYOUT_HERO_VARIANTS: readonly AiLayoutHeroVariant[] = ['cover', 'poster', 'split', 'bleed', 'editorial', 'column', 'collage', 'panel', 'portrait']\n\n/** The heroes whose words take half the page or less, so their title is the page's title size, never display. */\nexport const AI_LAYOUT_HALF_HEROES: ReadonlySet<AiLayoutHeroVariant> = new Set(['split', 'bleed', 'collage', 'panel'])\n\n/** The heroes that lay their words over a photo, which pins the section to the site's dark scheme. */\nexport const AI_LAYOUT_OVER_PHOTO_HEROES: ReadonlySet<AiLayoutHeroVariant> = new Set(['cover', 'poster'])\n\n/**\n * How a group of cards is drawn where no component draws it:\n * - `cards`: the theme's cards (the compiler's first design);\n * - `ruled`: open columns, each under a thin rule, no card around it;\n * - `pictures`: a picture over each item's title and caption, in an uneven\n * grid (work, products);\n * - `articles`: a picture over each title and summary, in even columns (writing);\n * - `menu`: two columns of lines under rules (dishes, prices left out);\n * - `icons`: open columns, each led by an icon in a soft disc over its title\n * and words — a storefront's reasons to buy (shipping, small batch,\n * returns), never a block of text (AGL-3676).\n */\nexport type AiLayoutGroupVariant = 'cards' | 'ruled' | 'pictures' | 'articles' | 'menu' | 'icons'\n\n/** How a numbered group is drawn: a row of numbers, or a ruled list beside its heading. */\nexport type AiLayoutStepsVariant = 'numbers' | 'timeline'\n\n/** The site-level choices a page is drawn with. */\nexport interface AiLayoutDesignChoices {\n hero: AiLayoutHeroVariant\n /** The group style of a section that names no subject the kind draws its own way. */\n group: 'cards' | 'ruled' | 'icons'\n steps: AiLayoutStepsVariant\n /** Whether a section of words takes a photo beside it. */\n features: boolean\n /** Whether the photo of the first such section sits on the left. */\n featureLeft: boolean\n /** Whether a closing section of words is drawn over a photo. */\n coverClose: boolean\n /** Whether a section's heading sits beside its items rather than over them. */\n splitHeads: boolean\n /** How work is laid out where the kind shows it as pictures. */\n pictures: 'mosaic' | 'even'\n /**\n * How a blog's own posts are listed where a page shows them (AGL-3676):\n * `grid`, a cover over each post's date, title and excerpt in columns; or\n * `ruled`, a list under thin rules, the date in its own column and a small\n * cover beside each title — the two ways an editorial site lists writing.\n */\n writing: 'grid' | 'ruled'\n /**\n * How the titles of a designed group read (AGL-4065): `sentence`, each set\n * in the theme's heading style for an item; or `caps`, each set as the\n * theme's label (its overline: spaced capitals where the site's eyebrows\n * are capitals) over its words, as a designer's ruled columns and icon\n * rows title their items. Only a variant the theme defines is chosen: the\n * case of a section's own heading is the look's font pairing, never the\n * compiler's.\n */\n headingCase: 'sentence' | 'caps'\n /**\n * How the plain and soft bands run down a page (AGL-4065): `alternate`, the\n * bands as the model wrote them except that two neighbors of one never\n * meet — the second takes the other — so sections read apart; or `plain`,\n * one ground for the whole page, every soft band drawn plain and the\n * sections set apart by their spacing. Brand and dark bands are the\n * model's either way.\n */\n bandRhythm: 'alternate' | 'plain'\n}\n\ntype Family = 'gallery' | 'editorial' | 'hospitality' | 'calm' | 'retail' | 'standard'\ntype GroupStyle = AiLayoutDesignChoices['group']\n\nconst FAMILIES: Readonly<Record<string, Family>> = {\n portfolio: 'gallery',\n photography: 'gallery',\n studio: 'gallery',\n blog: 'editorial',\n restaurant: 'hospitality',\n events: 'hospitality',\n yoga: 'calm',\n wellness: 'calm',\n beauty: 'calm',\n store: 'retail',\n}\n\n/**\n * A kind's LAYOUT SIGNATURE (AGL-3985): the arrangements its pages are drawn\n * in, so a café, a law firm and a band never read as one page in three\n * colors. Before it, six kinds shared one list of heroes and every kind drew\n * its groups, its photo-led sections and its headings beside their items at\n * the same odds; the guided start's 21 style previews, which the real\n * compiler draws, read as one page — a header bar, a split or banded hero,\n * one section.\n *\n * - `heroes`: the two first sections the kind opens with, each drawn at even\n * odds (AGL-3899). The first is the one its style card shows. No two kinds\n * share the same two.\n * - `groups`: the group styles a section of items takes where its subject\n * picks none.\n * - `steps`: how its numbered groups read.\n * - `features`: the chance a section of words takes a photo beside it — a\n * café's or a salon's pages are photo-led, a law firm's or a writer's let\n * the type carry them.\n * - `coverClose`: the chance a closing call to action is drawn over a photo.\n * - `splitHeads`: the chance a heading sits beside its items: an\n * editorial, considered page.\n * - `pictures`: how its work is laid out where it shows it as pictures.\n */\nexport interface AiLayoutKindSignature {\n heroes: readonly [AiLayoutHeroVariant, AiLayoutHeroVariant]\n groups: readonly GroupStyle[]\n steps: readonly AiLayoutStepsVariant[]\n features: number\n coverClose: number\n splitHeads: number\n pictures: readonly AiLayoutDesignChoices['pictures'][]\n}\n\nconst BOTH_STEPS: readonly AiLayoutStepsVariant[] = ['timeline', 'numbers']\nconst MOSTLY_MOSAIC: readonly AiLayoutDesignChoices['pictures'][] = ['mosaic', 'mosaic', 'even']\n\n/** Each kind's signature, by its `AI_SITE_KINDS` id. */\nexport const AI_LAYOUT_KIND_SIGNATURES: Readonly<Record<string, AiLayoutKindSignature>> = {\n // Clear and confident: a contained split, or the words on a card over the place.\n business: { heroes: ['split', 'panel'], groups: ['cards', 'icons'], steps: BOTH_STEPS, features: 0.6, coverClose: 0.3, splitHeads: 0.5, pictures: MOSTLY_MOSAIC },\n // Direct: a full-bleed job photo with the promise at the start, services as\n // tight cards, ruled columns or icon rows, and a job's steps numbered or\n // ruled (AGL-4065: two trades sites of 2026-10-25 shared one layout).\n trades: { heroes: ['cover', 'split'], groups: ['cards', 'ruled', 'icons'], steps: BOTH_STEPS, features: 0.5, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Measured: the words on a card over the office, practice areas ruled, headings beside them.\n professional: { heroes: ['panel', 'editorial'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.2, splitHeads: 0.8, pictures: MOSTLY_MOSAIC },\n // Reassuring: half the band a calm room, or a quiet centered masthead.\n wellness: { heroes: ['bleed', 'column'], groups: ['icons', 'cards'], steps: BOTH_STEPS, features: 0.7, coverClose: 0.2, splitHeads: 0.3, pictures: MOSTLY_MOSAIC },\n // Photo-led: the room full-bleed with the name centered over it, the menu as lines.\n restaurant: { heroes: ['poster', 'bleed'], groups: ['ruled', 'cards'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // A storefront: the products themselves, two of them, beside the words.\n store: { heroes: ['collage', 'split'], groups: ['icons'], steps: BOTH_STEPS, features: 1, coverClose: 0.2, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // The work first: display type then a wide picture, or the words beside two pieces.\n portfolio: { heroes: ['editorial', 'collage'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.2, splitHeads: 0.5, pictures: ['mosaic'] },\n // Oversized statements over a wide picture, or full-bleed and dark.\n studio: { heroes: ['editorial', 'cover'], groups: ['ruled', 'cards'], steps: ['timeline'], features: 0.4, coverClose: 0.5, splitHeads: 0.6, pictures: ['mosaic', 'even'] },\n // Pictures first, few words.\n photography: { heroes: ['editorial', 'poster'], groups: ['ruled'], steps: ['timeline'], features: 0.6, coverClose: 0.6, splitHeads: 0.35, pictures: ['even', 'mosaic'] },\n // Reading-first: a centered masthead over the lead picture.\n blog: { heroes: ['column', 'editorial'], groups: ['ruled'], steps: ['timeline'], features: 0.4, coverClose: 0.1, splitHeads: 0.7, pictures: MOSTLY_MOSAIC },\n // Celebratory: two pictures of the day beside its name, or the name over one.\n events: { heroes: ['collage', 'poster'], groups: ['cards', 'icons'], steps: ['timeline'], features: 0.7, coverClose: 0.6, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // High energy: half the band a photo, half a loud headline; or full-bleed.\n // Its groups as cards or ruled columns, its steps numbered or ruled (AGL-4065).\n fitness: { heroes: ['bleed', 'cover'], groups: ['cards', 'ruled'], steps: BOTH_STEPS, features: 0.5, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Calm and spacious: a centered masthead, or a soft split.\n yoga: { heroes: ['column', 'split'], groups: ['icons', 'cards'], steps: BOTH_STEPS, features: 0.6, coverClose: 0.2, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Image-led: two pictures of the work and the place, or half the band one.\n beauty: { heroes: ['collage', 'bleed'], groups: ['ruled', 'cards'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.3, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Polished: the home full-bleed with the words on a card, or under a scrim.\n realestate: { heroes: ['panel', 'cover'], groups: ['cards', 'ruled'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.5, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Encouraging: a contained split, or the teacher's portrait over the words.\n education: { heroes: ['split', 'portrait'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.6, coverClose: 0.2, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Mission-led: the people full-bleed with the cause over them, or two pictures beside it.\n nonprofit: { heroes: ['cover', 'collage'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.6, coverClose: 0.7, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Loud: the name huge over a full-bleed photo, at the start or centered.\n music: { heroes: ['cover', 'poster'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.8, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // A person: their portrait over who they are, or a quiet masthead.\n personal: { heroes: ['portrait', 'column'], groups: ['ruled'], steps: ['timeline'], features: 0.4, coverClose: 0.1, splitHeads: 0.6, pictures: MOSTLY_MOSAIC },\n // One action: the promise centered over the picture of the thing, or over a photo.\n landing: { heroes: ['column', 'poster'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.5, coverClose: 0.3, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Short and striking: one big line over a photo, or on a card over it.\n 'coming-soon': { heroes: ['poster', 'panel'], groups: ['icons', 'ruled'], steps: BOTH_STEPS, features: 0.3, coverClose: 0.2, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n}\n\n/** The signature of a kind; an unknown kind draws as a business site. */\nexport function aiLayoutKindSignature(kind: string): AiLayoutKindSignature {\n return AI_LAYOUT_KIND_SIGNATURES[kind] ?? (AI_LAYOUT_KIND_SIGNATURES['business'] as AiLayoutKindSignature)\n}\n\n/** A small deterministic generator over a seed (mulberry32). */\nfunction random(seed: number): () => number {\n let state = seed >>> 0\n return () => {\n state = (state + 0x6d2b79f5) >>> 0\n let t = state\n t = Math.imul(t ^ (t >>> 15), t | 1)\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n }\n}\n\nconst pick = <T>(next: () => number, list: readonly T[]): T => list[Math.floor(next() * list.length) % list.length] as T\n\n/** The family a kind's pages are drawn in. */\nexport function aiLayoutFamily(kind: string): Family {\n return FAMILIES[kind] ?? 'standard'\n}\n\n/** The kinds whose item titles are set as labels three sites in ten (AGL-4065); every other kind's one in ten. */\nconst LABEL_TITLE_KINDS: ReadonlySet<string> = new Set(['trades', 'fitness'])\n\n/** The families whose pages keep one ground as often as they alternate: a gallery's, a publication's (AGL-4065). */\nconst ONE_GROUND_FAMILIES: ReadonlySet<Family> = new Set(['gallery', 'editorial'])\n\n/**\n * A site's choices, the same for every page of it, each drawn at even odds\n * among the options its kind's signature lists (AGL-3899, AGL-3985), so two\n * sites of one kind are drawn apart and two kinds never read as one page.\n * Favoring each list's first option made the newest production sites one\n * design: the kind's first hero won 55% before the pick, a business site\n * opened split, groups were ruled two times in three and every text section\n * took a photo.\n */\nexport function aiLayoutDesignChoices(design: AiLayoutDesign): AiLayoutDesignChoices {\n const next = random(design.seed ^ 0x2f6b9d1)\n const family = aiLayoutFamily(design.kind)\n const signature = aiLayoutKindSignature(design.kind)\n const hero = pick(next, signature.heroes)\n const group = pick(next, signature.groups)\n return {\n hero,\n // A store's reasons to buy — the making, the shipping, the care — read\n // as open columns each led by an icon, the way a storefront theme draws\n // them: never a SaaS page's feature cards, and never the plain columns\n // of a title and a sentence the beta.237 Willow Wick home showed four\n // bands of (AGL-3676).\n group: family === 'retail' ? 'icons' : group,\n steps: pick(next, signature.steps),\n // Whether a section of words takes a photo beside it: some sites are\n // photo-led, some let their type carry the page. A storefront never\n // shows a band of text alone (AGL-3676), so its story always takes one.\n features: next() < signature.features || family === 'retail',\n featureLeft: next() < 0.5,\n coverClose: next() < signature.coverClose,\n splitHeads: next() < signature.splitHeads,\n pictures: pick(next, signature.pictures),\n // Drawn last, so every choice above stays what it was for a seed.\n writing: pick(next, ['grid', 'ruled'] as const),\n // Drawn after it (AGL-4065), so a seed's earlier choices stay too.\n headingCase: next() < (LABEL_TITLE_KINDS.has(design.kind) ? 0.3 : 0.1) ? 'caps' : 'sentence',\n bandRhythm: next() < (ONE_GROUND_FAMILIES.has(family) ? 0.5 : 0.35) ? 'plain' : 'alternate',\n }\n}\n\n\nconst WORK = /\\b(work|works|project|projects|portfolio|gallery|galleries|case|cases|studies|selected|commission|commissions|illustration|illustrations|photo|photos|series|book|books|editorial|brand|collection|collections|wedding|weddings|portrait|portraits|session|sessions|shoot|shoots)\\b/i\nconst WRITING = /\\b(article|articles|post|posts|writing|writings|latest|featured|journey|journeys|recipe|recipes|story|stories|essay|essays|guide|guides|issue|issues|episode|episodes)\\b/i\nconst DISHES = /\\b(menu|menus|dish|dishes|breakfast|brunch|lunch|dinner|pastry|pastries|coffee|drink|drinks|cocktail|cocktails|wine|wines|highlight|highlights|favorite|favorites|favourites|special|specials|plate|plates|bake|bakes|bread|cake|cakes)\\b/i\n// A store's own products are listed by its Product grid (AGL-3676), never drawn\n// from words: what a store shows as pictures is how its range is grouped — its\n// collections, gift sets, occasions and scents. \"Candle care and burn notes\" is no band of pictures.\n/**\n * Words a section uses for itself when it is a showing of pictures, on any\n * kind of site (AGL-3923) — \"in pictures\" and \"in photos\" among them\n * (AGL-4065): the 2026-10-25 Rut Runners Racing and Pit Row Tacos homes drew\n * \"The team at the track in pictures\" and \"The trailer and the food in\n * pictures\" as six captions each, with no picture slot for a photo to fill.\n * Whole words only: \"Picture-perfect\" and \"Photoshoot\" show no pictures.\n */\nconst GALLERY = /\\b(gallery|galleries|portfolio|portfolios|lookbook|lookbooks|pictures|photos)\\b/i\nconst CATEGORIES = /\\b(collection|collections|range|ranges|categor(?:y|ies)|gift|gifts|gift sets?|sets|occasion|occasions|scent|scents|edit|edits)\\b/i\n\n/**\n * How a section's group of cards is drawn, from what the section is about:\n * work in a gallery kind and products in a store are pictures, writing in a\n * blog is articles, dishes in a restaurant a menu; anything else takes the\n * site's own group style.\n */\nexport function aiLayoutGroupVariant(\n design: AiLayoutDesign,\n choices: AiLayoutDesignChoices,\n words: string,\n): AiLayoutGroupVariant {\n const family = aiLayoutFamily(design.kind)\n if (family === 'gallery' && (WORK.test(words) || design.kind === 'photography')) return 'pictures'\n if (family === 'editorial' && WRITING.test(words)) return 'articles'\n if (family === 'hospitality' && DISHES.test(words)) return 'menu'\n if (family === 'retail' && CATEGORIES.test(words)) return 'pictures'\n // A section that calls itself a gallery or a portfolio shows pictures on any\n // kind of site (AGL-3923): the beta.265 Kasvora Marketing Solutions home drew\n // its \"Selected work gallery\" as four cards of icons.\n if (GALLERY.test(words)) return 'pictures'\n return choices.group\n}\n"],"names":["AI_LAYOUT_HERO_VARIANTS","AI_LAYOUT_HALF_HEROES","Set","AI_LAYOUT_OVER_PHOTO_HEROES","FAMILIES","portfolio","photography","studio","blog","restaurant","events","yoga","wellness","beauty","store","BOTH_STEPS","MOSTLY_MOSAIC","AI_LAYOUT_KIND_SIGNATURES","business","heroes","groups","steps","features","coverClose","splitHeads","pictures","trades","professional","fitness","realestate","education","nonprofit","music","personal","landing","aiLayoutKindSignature","kind","random","seed","state","t","Math","imul","pick","next","list","floor","length","aiLayoutFamily","LABEL_TITLE_KINDS","ONE_GROUND_FAMILIES","aiLayoutDesignChoices","design","family","signature","hero","group","featureLeft","writing","headingCase","has","bandRhythm","WORK","WRITING","DISHES","GALLERY","CATEGORIES","aiLayoutGroupVariant","choices","words","test"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GAED,gEAAgE,GAgChE,uEAAuE,GACvE,OAAO,MAAMA,0BAA0D;IAAC;IAAS;IAAU;IAAS;IAAS;IAAa;IAAU;IAAW;IAAS;CAAW,CAAA;AAEnK,+GAA+G,GAC/G,OAAO,MAAMC,wBAA0D,IAAIC,IAAI;IAAC;IAAS;IAAS;IAAW;CAAQ,EAAC;AAEtH,oGAAoG,GACpG,OAAO,MAAMC,8BAAgE,IAAID,IAAI;IAAC;IAAS;CAAS,EAAC;AAkEzG,MAAME,WAA6C;IACjDC,WAAW;IACXC,aAAa;IACbC,QAAQ;IACRC,MAAM;IACNC,YAAY;IACZC,QAAQ;IACRC,MAAM;IACNC,UAAU;IACVC,QAAQ;IACRC,OAAO;AACT;AAmCA,MAAMC,aAA8C;IAAC;IAAY;CAAU;AAC3E,MAAMC,gBAA8D;IAAC;IAAU;IAAU;CAAO;AAEhG,sDAAsD,GACtD,OAAO,MAAMC,4BAA6E;IACxF,iFAAiF;IACjFC,UAAU;QAAEC,QAAQ;YAAC;YAAS;SAAQ;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J,QAAQK,IAAI,CAACD,QAAQ,OAAO;IAChC,OAAOD,QAAQZ,KAAK;AACtB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/layout-language/ai-layout-design.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * THE DESIGNER LAYER of the layout compiler (AGL-3660): how a page the model\n * described in the layout language is ARRANGED, decided by code from the\n * site's kind and its job's seed — never asked of the model, so a recorded\n * answer compiles into the new design with no new call.\n *\n * Why. A page compiled one way for every site read like a SaaS landing page:\n * a centered text hero, three outlined cards, a numbered row, a solid form\n * band. The designer templates people compare a site to (Squarespace's Loam,\n * Clove, Auburn, Rivoli, Matsuya; Wix's portfolio and restaurant sets) are\n * built from a handful of moves instead — a full-bleed photo hero with the\n * type over it, image and text side by side, work shown as pictures in an\n * uneven grid, writing as a list under thin rules, a closing band over a\n * photo — and they pick those moves for the KIND of site.\n *\n * So a site's design is a set of VARIANTS — the hero's arrangement, how its\n * groups are drawn, whether its text sections take a picture beside them,\n * how its closing section reads — each chosen among the ones that suit the\n * kind, by the seed. The choices are the site's: every page of one site is\n * drawn with the same hero and the same group style, so the site reads as\n * one design, and two sites of one kind come out differently.\n *\n * This is NOT a template library. A variant is a way of drawing whatever the\n * model wrote; the sections, their order, their bands, their words and how\n * many items each shows are still the model's, page by page.\n *\n * Pure: no tree, no theme, no network.\n */\n\n/** What the compiler is told about the site a page belongs to. */\nexport interface AiLayoutDesign {\n /** The site's kind (`AI_SITE_KINDS`); an unknown one draws as a business site. */\n kind: string\n /** The job's design seed: the same for every page of one site. */\n seed: number\n /** Whether this page is the site's home, which opens tallest. */\n home: boolean\n /**\n * What a site's plan chose for it (AGL-4152), so every page of every wave is\n * drawn alike. Absent on every other site, whose choices are its seed's.\n */\n planned?: AiLayoutPlannedChoices\n}\n\n/** The choices a site's plan makes in place of its seed's (AGL-4152). */\nexport type AiLayoutPlannedChoices = Partial<Pick<AiLayoutDesignChoices, 'hero' | 'group' | 'bandRhythm' | 'coverClose'>>\n\n/** A plan's choices as a job carries them, read defensively (AGL-4152); `null` for none. */\nexport function aiLayoutPlannedChoicesOf(raw: unknown): AiLayoutPlannedChoices | null {\n if (!raw || typeof raw !== 'object') return null\n const value = raw as Record<string, unknown>\n const hero = AI_LAYOUT_HERO_VARIANTS.find((entry) => entry === value['hero'])\n const group = (['cards', 'ruled', 'icons'] as const).find((entry) => entry === value['group'])\n const bandRhythm = (['alternate', 'plain'] as const).find((entry) => entry === value['bandRhythm'])\n const coverClose = typeof value['coverClose'] === 'boolean' ? value['coverClose'] : null\n const planned = { ...(hero ? { hero } : {}), ...(group ? { group } : {}), ...(bandRhythm ? { bandRhythm } : {}), ...(coverClose !== null ? { coverClose } : {}) }\n return Object.keys(planned).length ? planned : null\n}\n\n/**\n * How the first section of a page is drawn:\n * - `cover`: a full-bleed photo with the words over it on a scrim, set at\n * the start of the page;\n * - `poster`: a full-bleed photo, taller, the words centered over it in\n * display type (AGL-3985);\n * - `split`: the words beside a tall photo, inside the page's measure;\n * - `bleed`: the band in two halves, a photo filling one edge to edge and\n * the words in the other (AGL-3985);\n * - `editorial`: display type across the page, the lede and the buttons in\n * a row under it, and a wide photo below;\n * - `column`: a masthead — the words centered in a narrow column, a wide\n * photo under them (AGL-3985);\n * - `collage`: the words beside two photos, a tall one and a smaller one\n * laid over its corner (AGL-3985);\n * - `panel`: a full-bleed photo, undimmed, with the words on a card of the\n * page's surface over its lower corner (AGL-3985);\n * - `portrait`: a round photo over the words, all centered: a person's own\n * page (AGL-3985).\n */\nexport type AiLayoutHeroVariant = 'cover' | 'poster' | 'split' | 'bleed' | 'editorial' | 'column' | 'collage' | 'panel' | 'portrait'\n\n/** Every hero arrangement, as {@link AiLayoutHeroVariant} lists them. */\nexport const AI_LAYOUT_HERO_VARIANTS: readonly AiLayoutHeroVariant[] = ['cover', 'poster', 'split', 'bleed', 'editorial', 'column', 'collage', 'panel', 'portrait']\n\n/** The heroes whose words take half the page or less, so their title is the page's title size, never display. */\nexport const AI_LAYOUT_HALF_HEROES: ReadonlySet<AiLayoutHeroVariant> = new Set(['split', 'bleed', 'collage', 'panel'])\n\n/** The heroes that lay their words over a photo, which pins the section to the site's dark scheme. */\nexport const AI_LAYOUT_OVER_PHOTO_HEROES: ReadonlySet<AiLayoutHeroVariant> = new Set(['cover', 'poster'])\n\n/**\n * How a group of cards is drawn where no component draws it:\n * - `cards`: the theme's cards (the compiler's first design);\n * - `ruled`: open columns, each under a thin rule, no card around it;\n * - `pictures`: a picture over each item's title and caption, in an uneven\n * grid (work, products);\n * - `articles`: a picture over each title and summary, in even columns (writing);\n * - `menu`: two columns of lines under rules (dishes, prices left out);\n * - `icons`: open columns, each led by an icon in a soft disc over its title\n * and words — a storefront's reasons to buy (shipping, small batch,\n * returns), never a block of text (AGL-3676).\n */\nexport type AiLayoutGroupVariant = 'cards' | 'ruled' | 'pictures' | 'articles' | 'menu' | 'icons'\n\n/** How a numbered group is drawn: a row of numbers, or a ruled list beside its heading. */\nexport type AiLayoutStepsVariant = 'numbers' | 'timeline'\n\n/** The site-level choices a page is drawn with. */\nexport interface AiLayoutDesignChoices {\n hero: AiLayoutHeroVariant\n /** The group style of a section that names no subject the kind draws its own way. */\n group: 'cards' | 'ruled' | 'icons'\n steps: AiLayoutStepsVariant\n /** Whether a section of words takes a photo beside it. */\n features: boolean\n /** Whether the photo of the first such section sits on the left. */\n featureLeft: boolean\n /** Whether a closing section of words is drawn over a photo. */\n coverClose: boolean\n /** Whether a section's heading sits beside its items rather than over them. */\n splitHeads: boolean\n /** How work is laid out where the kind shows it as pictures. */\n pictures: 'mosaic' | 'even'\n /**\n * How a blog's own posts are listed where a page shows them (AGL-3676):\n * `grid`, a cover over each post's date, title and excerpt in columns; or\n * `ruled`, a list under thin rules, the date in its own column and a small\n * cover beside each title — the two ways an editorial site lists writing.\n */\n writing: 'grid' | 'ruled'\n /**\n * How the titles of a designed group read (AGL-4065): `sentence`, each set\n * in the theme's heading style for an item; or `caps`, each set as the\n * theme's label (its overline: spaced capitals where the site's eyebrows\n * are capitals) over its words, as a designer's ruled columns and icon\n * rows title their items. Only a variant the theme defines is chosen: the\n * case of a section's own heading is the look's font pairing, never the\n * compiler's.\n */\n headingCase: 'sentence' | 'caps'\n /**\n * How the plain and soft bands run down a page (AGL-4065): `alternate`, the\n * bands as the model wrote them except that two neighbors of one never\n * meet — the second takes the other — so sections read apart; or `plain`,\n * one ground for the whole page, every soft band drawn plain and the\n * sections set apart by their spacing. Brand and dark bands are the\n * model's either way.\n */\n bandRhythm: 'alternate' | 'plain'\n}\n\ntype Family = 'gallery' | 'editorial' | 'hospitality' | 'calm' | 'retail' | 'standard'\ntype GroupStyle = AiLayoutDesignChoices['group']\n\nconst FAMILIES: Readonly<Record<string, Family>> = {\n portfolio: 'gallery',\n photography: 'gallery',\n studio: 'gallery',\n blog: 'editorial',\n restaurant: 'hospitality',\n events: 'hospitality',\n yoga: 'calm',\n wellness: 'calm',\n beauty: 'calm',\n store: 'retail',\n}\n\n/**\n * A kind's LAYOUT SIGNATURE (AGL-3985): the arrangements its pages are drawn\n * in, so a café, a law firm and a band never read as one page in three\n * colors. Before it, six kinds shared one list of heroes and every kind drew\n * its groups, its photo-led sections and its headings beside their items at\n * the same odds; the guided start's 21 style previews, which the real\n * compiler draws, read as one page — a header bar, a split or banded hero,\n * one section.\n *\n * - `heroes`: the two first sections the kind opens with, each drawn at even\n * odds (AGL-3899). The first is the one its style card shows. No two kinds\n * share the same two.\n * - `groups`: the group styles a section of items takes where its subject\n * picks none.\n * - `steps`: how its numbered groups read.\n * - `features`: the chance a section of words takes a photo beside it — a\n * café's or a salon's pages are photo-led, a law firm's or a writer's let\n * the type carry them.\n * - `coverClose`: the chance a closing call to action is drawn over a photo.\n * - `splitHeads`: the chance a heading sits beside its items: an\n * editorial, considered page.\n * - `pictures`: how its work is laid out where it shows it as pictures.\n */\nexport interface AiLayoutKindSignature {\n heroes: readonly [AiLayoutHeroVariant, AiLayoutHeroVariant]\n groups: readonly GroupStyle[]\n steps: readonly AiLayoutStepsVariant[]\n features: number\n coverClose: number\n splitHeads: number\n pictures: readonly AiLayoutDesignChoices['pictures'][]\n}\n\nconst BOTH_STEPS: readonly AiLayoutStepsVariant[] = ['timeline', 'numbers']\nconst MOSTLY_MOSAIC: readonly AiLayoutDesignChoices['pictures'][] = ['mosaic', 'mosaic', 'even']\n\n/** Each kind's signature, by its `AI_SITE_KINDS` id. */\nexport const AI_LAYOUT_KIND_SIGNATURES: Readonly<Record<string, AiLayoutKindSignature>> = {\n // Clear and confident: a contained split, or the words on a card over the place.\n business: { heroes: ['split', 'panel'], groups: ['cards', 'icons'], steps: BOTH_STEPS, features: 0.6, coverClose: 0.3, splitHeads: 0.5, pictures: MOSTLY_MOSAIC },\n // Direct: a full-bleed job photo with the promise at the start, services as\n // tight cards, ruled columns or icon rows, and a job's steps numbered or\n // ruled (AGL-4065: two trades sites of 2026-10-25 shared one layout).\n trades: { heroes: ['cover', 'split'], groups: ['cards', 'ruled', 'icons'], steps: BOTH_STEPS, features: 0.5, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Measured: the words on a card over the office, practice areas ruled, headings beside them.\n professional: { heroes: ['panel', 'editorial'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.2, splitHeads: 0.8, pictures: MOSTLY_MOSAIC },\n // Reassuring: half the band a calm room, or a quiet centered masthead.\n wellness: { heroes: ['bleed', 'column'], groups: ['icons', 'cards'], steps: BOTH_STEPS, features: 0.7, coverClose: 0.2, splitHeads: 0.3, pictures: MOSTLY_MOSAIC },\n // Photo-led: the room full-bleed with the name centered over it, the menu as lines.\n restaurant: { heroes: ['poster', 'bleed'], groups: ['ruled', 'cards'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // A storefront: the products themselves, two of them, beside the words.\n store: { heroes: ['collage', 'split'], groups: ['icons'], steps: BOTH_STEPS, features: 1, coverClose: 0.2, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // The work first: display type then a wide picture, or the words beside two pieces.\n portfolio: { heroes: ['editorial', 'collage'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.2, splitHeads: 0.5, pictures: ['mosaic'] },\n // Oversized statements over a wide picture, or full-bleed and dark.\n studio: { heroes: ['editorial', 'cover'], groups: ['ruled', 'cards'], steps: ['timeline'], features: 0.4, coverClose: 0.5, splitHeads: 0.6, pictures: ['mosaic', 'even'] },\n // Pictures first, few words.\n photography: { heroes: ['editorial', 'poster'], groups: ['ruled'], steps: ['timeline'], features: 0.6, coverClose: 0.6, splitHeads: 0.35, pictures: ['even', 'mosaic'] },\n // Reading-first: a centered masthead over the lead picture.\n blog: { heroes: ['column', 'editorial'], groups: ['ruled'], steps: ['timeline'], features: 0.4, coverClose: 0.1, splitHeads: 0.7, pictures: MOSTLY_MOSAIC },\n // Celebratory: two pictures of the day beside its name, or the name over one.\n events: { heroes: ['collage', 'poster'], groups: ['cards', 'icons'], steps: ['timeline'], features: 0.7, coverClose: 0.6, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // High energy: half the band a photo, half a loud headline; or full-bleed.\n // Its groups as cards or ruled columns, its steps numbered or ruled (AGL-4065).\n fitness: { heroes: ['bleed', 'cover'], groups: ['cards', 'ruled'], steps: BOTH_STEPS, features: 0.5, coverClose: 0.7, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Calm and spacious: a centered masthead, or a soft split.\n yoga: { heroes: ['column', 'split'], groups: ['icons', 'cards'], steps: BOTH_STEPS, features: 0.6, coverClose: 0.2, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Image-led: two pictures of the work and the place, or half the band one.\n beauty: { heroes: ['collage', 'bleed'], groups: ['ruled', 'cards'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.3, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Polished: the home full-bleed with the words on a card, or under a scrim.\n realestate: { heroes: ['panel', 'cover'], groups: ['cards', 'ruled'], steps: BOTH_STEPS, features: 0.8, coverClose: 0.5, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Encouraging: a contained split, or the teacher's portrait over the words.\n education: { heroes: ['split', 'portrait'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.6, coverClose: 0.2, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Mission-led: the people full-bleed with the cause over them, or two pictures beside it.\n nonprofit: { heroes: ['cover', 'collage'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.6, coverClose: 0.7, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // Loud: the name huge over a full-bleed photo, at the start or centered.\n music: { heroes: ['cover', 'poster'], groups: ['ruled'], steps: ['timeline'], features: 0.5, coverClose: 0.8, splitHeads: 0.35, pictures: MOSTLY_MOSAIC },\n // A person: their portrait over who they are, or a quiet masthead.\n personal: { heroes: ['portrait', 'column'], groups: ['ruled'], steps: ['timeline'], features: 0.4, coverClose: 0.1, splitHeads: 0.6, pictures: MOSTLY_MOSAIC },\n // One action: the promise centered over the picture of the thing, or over a photo.\n landing: { heroes: ['column', 'poster'], groups: ['icons', 'cards'], steps: ['numbers'], features: 0.5, coverClose: 0.3, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n // Short and striking: one big line over a photo, or on a card over it.\n 'coming-soon': { heroes: ['poster', 'panel'], groups: ['icons', 'ruled'], steps: BOTH_STEPS, features: 0.3, coverClose: 0.2, splitHeads: 0.2, pictures: MOSTLY_MOSAIC },\n}\n\n/** The signature of a kind; an unknown kind draws as a business site. */\nexport function aiLayoutKindSignature(kind: string): AiLayoutKindSignature {\n return AI_LAYOUT_KIND_SIGNATURES[kind] ?? (AI_LAYOUT_KIND_SIGNATURES['business'] as AiLayoutKindSignature)\n}\n\n/** A small deterministic generator over a seed (mulberry32). */\nfunction random(seed: number): () => number {\n let state = seed >>> 0\n return () => {\n state = (state + 0x6d2b79f5) >>> 0\n let t = state\n t = Math.imul(t ^ (t >>> 15), t | 1)\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61)\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n }\n}\n\nconst pick = <T>(next: () => number, list: readonly T[]): T => list[Math.floor(next() * list.length) % list.length] as T\n\n/** The family a kind's pages are drawn in. */\nexport function aiLayoutFamily(kind: string): Family {\n return FAMILIES[kind] ?? 'standard'\n}\n\n/** The kinds whose item titles are set as labels three sites in ten (AGL-4065); every other kind's one in ten. */\nconst LABEL_TITLE_KINDS: ReadonlySet<string> = new Set(['trades', 'fitness'])\n\n/** The families whose pages keep one ground as often as they alternate: a gallery's, a publication's (AGL-4065). */\nconst ONE_GROUND_FAMILIES: ReadonlySet<Family> = new Set(['gallery', 'editorial'])\n\n/**\n * A site's choices, the same for every page of it, each drawn at even odds\n * among the options its kind's signature lists (AGL-3899, AGL-3985), so two\n * sites of one kind are drawn apart and two kinds never read as one page.\n * Favoring each list's first option made the newest production sites one\n * design: the kind's first hero won 55% before the pick, a business site\n * opened split, groups were ruled two times in three and every text section\n * took a photo.\n */\nexport function aiLayoutDesignChoices(design: AiLayoutDesign): AiLayoutDesignChoices {\n const next = random(design.seed ^ 0x2f6b9d1)\n const family = aiLayoutFamily(design.kind)\n const signature = aiLayoutKindSignature(design.kind)\n const hero = pick(next, signature.heroes)\n const group = pick(next, signature.groups)\n return {\n hero,\n // A store's reasons to buy — the making, the shipping, the care — read\n // as open columns each led by an icon, the way a storefront theme draws\n // them: never a SaaS page's feature cards, and never the plain columns\n // of a title and a sentence the beta.237 Willow Wick home showed four\n // bands of (AGL-3676).\n group: family === 'retail' ? 'icons' : group,\n steps: pick(next, signature.steps),\n // Whether a section of words takes a photo beside it: some sites are\n // photo-led, some let their type carry the page. A storefront never\n // shows a band of text alone (AGL-3676), so its story always takes one.\n features: next() < signature.features || family === 'retail',\n featureLeft: next() < 0.5,\n coverClose: next() < signature.coverClose,\n splitHeads: next() < signature.splitHeads,\n pictures: pick(next, signature.pictures),\n // Drawn last, so every choice above stays what it was for a seed.\n writing: pick(next, ['grid', 'ruled'] as const),\n // Drawn after it (AGL-4065), so a seed's earlier choices stay too.\n headingCase: next() < (LABEL_TITLE_KINDS.has(design.kind) ? 0.3 : 0.1) ? 'caps' : 'sentence',\n bandRhythm: next() < (ONE_GROUND_FAMILIES.has(family) ? 0.5 : 0.35) ? 'plain' : 'alternate',\n // A site's plan says these for every page of it (AGL-4152).\n ...design.planned,\n }\n}\n\n\nconst WORK = /\\b(work|works|project|projects|portfolio|gallery|galleries|case|cases|studies|selected|commission|commissions|illustration|illustrations|photo|photos|series|book|books|editorial|brand|collection|collections|wedding|weddings|portrait|portraits|session|sessions|shoot|shoots)\\b/i\nconst WRITING = /\\b(article|articles|post|posts|writing|writings|latest|featured|journey|journeys|recipe|recipes|story|stories|essay|essays|guide|guides|issue|issues|episode|episodes)\\b/i\nconst DISHES = /\\b(menu|menus|dish|dishes|breakfast|brunch|lunch|dinner|pastry|pastries|coffee|drink|drinks|cocktail|cocktails|wine|wines|highlight|highlights|favorite|favorites|favourites|special|specials|plate|plates|bake|bakes|bread|cake|cakes)\\b/i\n// A store's own products are listed by its Product grid (AGL-3676), never drawn\n// from words: what a store shows as pictures is how its range is grouped — its\n// collections, gift sets, occasions and scents. \"Candle care and burn notes\" is no band of pictures.\n/**\n * Words a section uses for itself when it is a showing of pictures, on any\n * kind of site (AGL-3923) — \"in pictures\" and \"in photos\" among them\n * (AGL-4065): the 2026-10-25 Rut Runners Racing and Pit Row Tacos homes drew\n * \"The team at the track in pictures\" and \"The trailer and the food in\n * pictures\" as six captions each, with no picture slot for a photo to fill.\n * Whole words only: \"Picture-perfect\" and \"Photoshoot\" show no pictures.\n */\nconst GALLERY = /\\b(gallery|galleries|portfolio|portfolios|lookbook|lookbooks|pictures|photos)\\b/i\nconst CATEGORIES = /\\b(collection|collections|range|ranges|categor(?:y|ies)|gift|gifts|gift sets?|sets|occasion|occasions|scent|scents|edit|edits)\\b/i\n\n/**\n * How a section's group of cards is drawn, from what the section is about:\n * work in a gallery kind and products in a store are pictures, writing in a\n * blog is articles, dishes in a restaurant a menu; anything else takes the\n * site's own group style.\n */\nexport function aiLayoutGroupVariant(\n design: AiLayoutDesign,\n choices: AiLayoutDesignChoices,\n words: string,\n): AiLayoutGroupVariant {\n const family = aiLayoutFamily(design.kind)\n if (family === 'gallery' && (WORK.test(words) || design.kind === 'photography')) return 'pictures'\n if (family === 'editorial' && WRITING.test(words)) return 'articles'\n if (family === 'hospitality' && DISHES.test(words)) return 'menu'\n if (family === 'retail' && CATEGORIES.test(words)) return 'pictures'\n // A section that calls itself a gallery or a portfolio shows pictures on any\n // kind of site (AGL-3923): the beta.265 Kasvora Marketing Solutions home drew\n // its \"Selected work gallery\" as four cards of icons.\n if (GALLERY.test(words)) return 'pictures'\n return choices.group\n}\n"],"names":["aiLayoutPlannedChoicesOf","raw","value","hero","AI_LAYOUT_HERO_VARIANTS","find","entry","group","bandRhythm","coverClose","planned","Object","keys","length","AI_LAYOUT_HALF_HEROES","Set","AI_LAYOUT_OVER_PHOTO_HEROES","FAMILIES","portfolio","photography","studio","blog","restaurant","events","yoga","wellness","beauty","store","BOTH_STEPS","MOSTLY_MOSAIC","AI_LAYOUT_KIND_SIGNATURES","business","heroes","groups","steps","features","splitHeads","pictures","trades","professional","fitness","realestate","education","nonprofit","music","personal","landing","aiLayoutKindSignature","kind","random","seed","state","t","Math","imul","pick","next","list","floor","aiLayoutFamily","LABEL_TITLE_KINDS","ONE_GROUND_FAMILIES","aiLayoutDesignChoices","design","family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AC9BC,KAAa;IAEb,MAAMb,SAASL,eAAeI,OAAOf,IAAI;IACzC,IAAIgB,WAAW,aAAcM,CAAAA,KAAKQ,IAAI,CAACD,UAAUd,OAAOf,IAAI,KAAK,aAAY,GAAI,OAAO;IACxF,IAAIgB,WAAW,eAAeO,QAAQO,IAAI,CAACD,QAAQ,OAAO;IAC1D,IAAIb,WAAW,iBAAiBQ,OAAOM,IAAI,CAACD,QAAQ,OAAO;IAC3D,IAAIb,WAAW,YAAYU,WAAWI,IAAI,CAACD,QAAQ,OAAO;IAC1D,6EAA6E;IAC7E,8EAA8E;IAC9E,sDAAsD;IACtD,IAAIJ,QAAQK,IAAI,CAACD,QAAQ,OAAO;IAChC,OAAOD,QAAQrE,KAAK;AACtB"}
|
|
@@ -119,6 +119,11 @@ export interface AiLayoutFrameSource {
|
|
|
119
119
|
ctas: AiLayoutFrameSourceCta[];
|
|
120
120
|
header: AiLayoutFrameSourceGround;
|
|
121
121
|
footer: AiLayoutFrameSourceFooter | null;
|
|
122
|
+
/**
|
|
123
|
+
* The header and footer a site's plan organized (AGL-4152): a footer with no
|
|
124
|
+
* columns to carry is drawn compact, never a tall band around one line.
|
|
125
|
+
*/
|
|
126
|
+
planned?: true;
|
|
122
127
|
}
|
|
123
128
|
/** The most kept of each part: the reader's own limits, held again on the way in. */
|
|
124
129
|
export declare const AI_LAYOUT_FRAME_SOURCE_LIMITS: {
|
|
@@ -207,12 +207,14 @@ const present = (value)=>value !== null;
|
|
|
207
207
|
}).filter(present);
|
|
208
208
|
if (!nav.length && !ctas.length) return null;
|
|
209
209
|
const header = GROUNDS.includes(raw['header']) ? raw['header'] : 'paper';
|
|
210
|
-
return {
|
|
210
|
+
return _extends({
|
|
211
211
|
nav,
|
|
212
212
|
ctas,
|
|
213
213
|
header,
|
|
214
214
|
footer: footerOf(raw['footer'])
|
|
215
|
-
}
|
|
215
|
+
}, raw['planned'] === true ? {
|
|
216
|
+
planned: true
|
|
217
|
+
} : {});
|
|
216
218
|
}
|
|
217
219
|
function footerOf(raw) {
|
|
218
220
|
if (!isRecord(raw)) return null;
|