@aglyn/plugins-ai 1.0.0-beta.263 → 1.0.0-beta.266
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/assets/site-styles/beauty.webp +0 -0
- package/src/lib/assets/site-styles/blog.webp +0 -0
- package/src/lib/assets/site-styles/business.webp +0 -0
- package/src/lib/assets/site-styles/coming-soon.webp +0 -0
- package/src/lib/assets/site-styles/education.webp +0 -0
- package/src/lib/assets/site-styles/events.webp +0 -0
- package/src/lib/assets/site-styles/fitness.webp +0 -0
- package/src/lib/assets/site-styles/landing.webp +0 -0
- package/src/lib/assets/site-styles/music.webp +0 -0
- package/src/lib/assets/site-styles/nonprofit.webp +0 -0
- package/src/lib/assets/site-styles/personal.webp +0 -0
- package/src/lib/assets/site-styles/photography.webp +0 -0
- package/src/lib/assets/site-styles/portfolio.webp +0 -0
- package/src/lib/assets/site-styles/professional.webp +0 -0
- package/src/lib/assets/site-styles/realestate.webp +0 -0
- package/src/lib/assets/site-styles/restaurant.webp +0 -0
- package/src/lib/assets/site-styles/store.webp +0 -0
- package/src/lib/assets/site-styles/studio.webp +0 -0
- package/src/lib/assets/site-styles/trades.webp +0 -0
- package/src/lib/assets/site-styles/wellness.webp +0 -0
- package/src/lib/assets/site-styles/yoga.webp +0 -0
- package/src/lib/components/ai-site-start-card.component.d.ts +12 -0
- package/src/lib/components/ai-site-start-card.component.js +256 -236
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +108 -0
- package/src/lib/components/ai-site-start-steps.component.js +451 -0
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -0
- package/src/lib/components/ai-site-start-tracking.d.ts +114 -0
- package/src/lib/components/ai-site-start-tracking.js +277 -0
- package/src/lib/components/ai-site-start-tracking.js.map +1 -0
- package/src/lib/components/ai-site-style-previews.d.ts +26 -0
- package/src/lib/components/ai-site-style-previews.js +115 -0
- package/src/lib/components/ai-site-style-previews.js.map +1 -0
- package/src/lib/insights/ai-insight-digest.d.ts +9 -0
- package/src/lib/insights/ai-insight-digest.js +35 -11
- package/src/lib/insights/ai-insight-digest.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +9 -0
- package/src/lib/jobs/ai-job-page-language.js +20 -2
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-sections.js +8 -2
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +43 -8
- package/src/lib/jobs/ai-job-plan-step.js +99 -18
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +93 -2
- package/src/lib/jobs/ai-job-site-datasets.js +308 -21
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +191 -13
- package/src/lib/jobs/ai-layout-stock-photos.js +1709 -69
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.d.ts +58 -0
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.js +678 -0
- package/src/lib/jobs/fixtures/ai-site-foreign-datasets-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.d.ts +33 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.js +270 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-beta265-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.d.ts +33 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.js +277 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3856-people-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.d.ts +23 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.js +163 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-juniper-records-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.d.ts +23 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.js +53 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-learning-center-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.d.ts +21 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.js +119 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-synchronicity-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.js +54 -15
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +6 -3
- package/src/lib/layout-language/ai-layout-design.js +14 -13
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-listings.d.ts +55 -0
- package/src/lib/layout-language/ai-layout-listings.js +103 -5
- package/src/lib/layout-language/ai-layout-listings.js.map +1 -1
- package/src/lib/layout-language/ai-layout-pictures.d.ts +42 -8
- package/src/lib/layout-language/ai-layout-pictures.js +91 -6
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
- package/src/lib/model/ai-site-home-arcs.d.ts +75 -0
- package/src/lib/model/ai-site-home-arcs.js +741 -0
- package/src/lib/model/ai-site-home-arcs.js.map +1 -0
- package/src/lib/model/ai-site-inventory.d.ts +18 -0
- package/src/lib/model/ai-site-inventory.js.map +1 -1
- package/src/lib/model/ai-site-job.d.ts +9 -6
- package/src/lib/model/ai-site-job.js +8 -5
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.js +24 -24
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-start-steps.d.ts +67 -0
- package/src/lib/model/ai-site-start-steps.js +127 -0
- package/src/lib/model/ai-site-start-steps.js.map +1 -0
- package/src/lib/model/ai-site-start.js +4 -1
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +32 -0
- package/src/lib/runtime/ai-doctrine-validators.js +119 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.d.ts +6 -1
- package/src/lib/runtime/ai-doctrine.js +9 -5
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-palette.generated.js +5 -2
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/site-inventory.js +6 -0
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/ai-insight-digest-route.js +2 -2
- package/src/lib/server/ai-insight-digest-route.js.map +1 -1
- package/src/lib/usage/assist-free-taste.js +3 -0
- package/src/lib/usage/assist-free-taste.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-job.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\nimport { aiSiteKind } from './ai-site-kinds'\nimport {\n AI_BUILD_PLAN_CREATION_NOUNS,\n aiPlanFormDatasetNames,\n aiPlanUndeclaredRefs,\n type AiBuildPlan,\n type AiBuildPlanCreateKind,\n} from './ai-build-plan'\nimport { AI_JOB_CREATE_KINDS } from './ai-job-creations'\nimport { AI_PAGE_CREATE_KINDS } from './ai-page-job'\nimport { FREE_AI_TASTE_CREDITS_PER_MONTH } from '../plan-entitlements'\nimport {\n AI_CREDIT_RANGE_ZERO,\n AI_MEASURED_PAID_SITE_CREDITS,\n AI_MEASURED_PASS_CREDITS,\n AI_MEASURED_STANDALONE_CREATION_CREDITS,\n AI_MEASURED_UNIT_CREDITS,\n aiCreditRangeAdd,\n aiCreditRangeOf,\n aiCreditRangeOrdered,\n aiCreditsPromptFor,\n aiMeasuredPageCredits,\n aiMeasuredStandalonePageCredits,\n type AiCreditRange,\n type AiCreditsPrompt,\n type AiMeasuredCredits,\n} from './ai-credit-estimate'\n\n/**\n * What a site scaffold is (AGL-2911): the inputs a `site` job is admitted\n * with, the plans a scaffold can build, and what one is estimated to cost\n * before it starts.\n *\n * A scaffold is the one job kind that builds a whole site rather than one\n * record: a plan of four to eight screens, the layout they render inside,\n * the contact form they place, a palette suggestion, and — where the email\n * step is loaded — a welcome email. It builds each of those through the job\n * kind that already owns it, so this module describes what a scaffold may\n * ask for and refuses the rest at confirmation, before a credit is spent,\n * naming what to make first.\n *\n * ── The estimate is the guard rail ───────────────────────────────────────\n *\n * A scaffold is tens of model calls, where every other kind is a few, so the\n * member reads what it will cost before they confirm the plan that spends\n * it. The figure is the machine's own nominal credits per step multiplied by\n * the passes the plan implies — an estimate, and said to be one wherever it\n * is shown.\n *\n * This module imports nothing at runtime, so the doors, the step, the batch\n * card and the plan proposal read one vocabulary.\n */\n\n/** How many pages a scaffold builds: enough to be a site, few enough to read. */\nexport const AI_SITE_PAGES = { min: 4, max: 8 } as const\n\n/**\n * How many pages a Free workspace's scaffold builds (AGL-3594): its home page\n * and the one page the brief most needs. A product decision, not a figure the\n * wall derives — the wall's proof (`jobs/ai-job-free-site.spec.ts`) shows a\n * plan and a build of this many pages fit the Free taste with room for one\n * retried page.\n */\nexport const AI_SITE_FREE_PAGES = { min: 1, max: 2 } as const\n\n/** The pages a scaffold builds for a workspace on the Free taste or on a paid plan. */\nexport function aiSitePagesBand(\n freeTaste: boolean | null | undefined,\n): { readonly min: number; readonly max: number } {\n return freeTaste ? AI_SITE_FREE_PAGES : AI_SITE_PAGES\n}\n\n/**\n * The job input a guided site start sets so its plan is confirmed for it\n * (AGL-3594); `jobs/ai-job-auto-confirm.ts` says where it is honored.\n */\nexport const AI_JOB_AUTO_CONFIRM_INPUT = 'autoConfirm'\n\n/** What a Free site start's page selector says under it (AGL-3594). */\nexport const AI_SITE_FREE_PAGES_NOTE = 'Paid plans can generate more pages.'\n\n/**\n * The plan's answer ceiling for a scaffold (AGL-3594), Free and paid. A plan\n * is an outline — each page's title, address, search listing and sections by\n * name — and the build steps write everything else, so a scaffold plans with\n * no thinking and at a ceiling sized to the outline of its largest band with\n * room to spare: about 300 tokens a page. The 13,491-token plan a Free site\n * spent 227 of its 300 credits on was its thinking, at the routing table's\n * 8,000 a call.\n */\nexport const AI_SITE_PLAN_MAX_TOKENS = { free: 2_000, paid: 4_000 } as const\n\n/** What each exchange of a Free site job comes to at its worst, in credits. */\nexport interface AiFreeSiteWorstCase {\n /** The site plan: its answer and its one re-ask, each at its ceiling. */\n plan: number\n /** The site's look (AGL-3660): its one answer at its ceiling, on the fast tier. */\n look: number\n /**\n * The layout a site with none has built first (AGL-3660): its header and\n * footer as ONE answer in the layout language, writing its cached prefix,\n * at the most a live frame answer wrote, and never under what the live\n * guided start's layout step metered.\n */\n layout: number\n /** The saved form a guided start makes (AGL-3596), at what the live guided start's form step metered. */\n form: number\n /**\n * A language page's answer before its sections (AGL-3660): its cached\n * prefix written, its turn, and the whole room its ceiling keeps for\n * thinking. A page is ONE answer, not a pass a section.\n */\n page: number\n /** Each planned section's words in that answer, at the most a section is written in. */\n section: number\n /**\n * Room for one page asked again: the answer once more, reading its cached\n * prefix, with its thinking room and a full page of sections.\n */\n retry: number\n /** A page's listing. */\n listing: number\n /**\n * A Free blog's one first post (`AI_SITE_FREE_POSTS`): its answer at the\n * `copy.blog` ceiling writing its cached prefix, and its one re-ask reading\n * it, on the fast tier a Free site's post is written on.\n */\n post: number\n}\n\n/**\n * The Free site start's wall at its worst (AGL-3594, re-derived for the\n * layout language in AGL-3660): the plan and the look as\n * `jobs/ai-job-free-site.spec.ts` derives them from their requests at their\n * ceilings; the layout, form and pages from the language requests as they\n * stand, priced as each field says. The spec fails when a figure it derives\n * moves and this does not.\n */\nexport const AI_FREE_SITE_WORST_CASE_CREDITS: Readonly<AiFreeSiteWorstCase> = {\n // The plan, the look and a listing run on the fast tier, billed at the\n // platform's markup on Claude Haiku 5.5 since AGL-3781 (36, 7 and 3 credits\n // at Haiku 4.5's cost before).\n plan: 5,\n look: 2,\n layout: 23,\n form: 29,\n page: 43,\n section: 4,\n retry: 64,\n listing: 1,\n // On Claude Haiku 5.5 at the platform's markup; the same post on the\n // balanced tier the `copy.blog` row routes to would be 68.\n post: 4,\n}\n\n/**\n * The most sections a Free site plans across its pages (AGL-3660), whatever\n * the wall leaves: a full home of five and a page of two or three. A product\n * figure, so the spend a site EXPECTS stays near what it measured; the wall\n * proves it fits.\n */\nexport const AI_FREE_SITE_MAX_SECTIONS = 8\n\n/** What a Free site start builds before its sections: the layouts it builds first, its forms and its pages. */\nexport interface AiFreeSiteCreations {\n layouts: number\n pages: number\n /** The saved forms it makes; a guided start makes one where it places a form. */\n forms: number\n /** The first posts it writes: a Free blog's one (`AI_SITE_FREE_POSTS`), else none. */\n posts?: number\n}\n\n/** How many first posts a Free blog start writes, on its provider's fast tier. */\nexport const AI_SITE_FREE_POSTS = 1\n\n/** The first posts a Free start of this kind writes: a blog's one, and none for any other kind. */\nexport function aiFreeSitePosts(siteKind: string | null | undefined): number {\n return aiSiteStartContent(siteKind) === 'posts' ? AI_SITE_FREE_POSTS : 0\n}\n\n/** A Free site start's credits at its worst for this many sections, its room for one retried page included. */\nexport function aiFreeSiteWorstCaseCredits(\n creations: AiFreeSiteCreations,\n sections: number,\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const pages = Math.max(1, Math.floor(creations.pages))\n return (\n credits.plan +\n credits.look +\n creations.layouts * credits.layout +\n creations.forms * credits.form +\n pages * (credits.page + credits.listing) +\n sections * credits.section +\n credits.retry +\n Math.max(0, Math.floor(creations.posts ?? 0)) * credits.post\n )\n}\n\n/**\n * The most sections a Free site's plan fits in the Free taste at its worst,\n * across all its pages (AGL-3660): the plan, the look, the layout and form it\n * builds first, each page's answer and listing, ROOM FOR ONE RETRIED PAGE,\n * and as many sections as the rest pays for — at most\n * `AI_FREE_SITE_MAX_SECTIONS`, and at most what the pages hold. None when the\n * rest is already past the wall.\n */\nexport function aiFreeSiteSectionsWithin(\n creations: AiFreeSiteCreations,\n taste: number,\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const pages = Math.max(1, Math.floor(creations.pages))\n const before = aiFreeSiteWorstCaseCredits(creations, 0, credits)\n if (before > taste) return 0\n const paid = credits.section > 0 ? Math.floor((taste - before) / credits.section) : Number.POSITIVE_INFINITY\n return Math.min(AI_FREE_SITE_MAX_SECTIONS, pages * AI_SITE_MAX_SECTIONS, paid)\n}\n\n/**\n * What a Free site start of this many pages can cost at its worst, in\n * credits (AGL-3660): `aiFreeSiteWorstCaseCredits` for an empty site — the\n * plan, its look, the layout and form a guided start builds, a blog's one\n * first post, each page's answer and listing, the sections its plan is held\n * to (`aiFreeSiteSectionsWithin` at the month's whole taste, which is what\n * the plan step allows) and the room for one retried page.\n *\n * The CEILING a start is quoted with (\"up to 283\"), no longer the figure it\n * is admitted on (AGL-3722): that is the measured p90\n * (`aiFreeSiteCreditRange`), and a start past what is left is asked to be\n * confirmed and pauses with Resume when its credits run out, instead of\n * being held back from starting at all.\n */\nexport function aiFreeSiteCreditEstimate(\n pages: number,\n options: { siteKind?: string | null } = {},\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const creations: AiFreeSiteCreations = {\n layouts: 1,\n forms: 1,\n pages: Math.max(1, Math.floor(pages)),\n posts: aiFreeSitePosts(options.siteKind),\n }\n const sections = aiFreeSiteSectionsWithin(creations, FREE_AI_TASTE_CREDITS_PER_MONTH, credits)\n return aiFreeSiteWorstCaseCredits(creations, sections, credits)\n}\n\n/**\n * What a Free workspace has left of its Free AI credits this month: the less\n * of its own band's balance and its owner's, since the owner's allowance is\n * shared by every Free workspace they hold (AGL-2925) and the reservation\n * refuses at whichever wall is reached first. `resetsOn` is the UTC day the\n * month — and with it both balances — rolls over, `YYYY-MM-DD`.\n */\nexport interface AiFreeCreditsLeft {\n left: number\n total: number\n resetsOn: string\n /**\n * Both meters `left` is the lesser of, in credits net of give-backs, for the\n * usage strip's live read (AGL-3722): the owner's Free allowance across\n * their Free workspaces (`account`, `null` with no owner) and this\n * workspace's band.\n */\n used?: {\n account: number | null\n org: number\n orgBand: number | null\n /** The strip's warn state for these figures, worked out where the strip's own rule is not shipped to the browser. */\n state: 'ok' | 'warn' | 'capped'\n }\n}\n\n/** The first UTC day of the month after `now`, `YYYY-MM-DD`: when the Free credits come back. */\nexport function aiFreeCreditsResetOn(now: Date): string {\n const next = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 1))\n return next.toISOString().slice(0, 10)\n}\n\n/** A reset day as a person reads it: \"November 1\". */\nexport function aiFreeCreditsResetLabel(resetsOn: string): string {\n const at = new Date(`${resetsOn}T00:00:00.000Z`)\n return Number.isFinite(at.getTime())\n ? at.toLocaleDateString('en-US', { month: 'long', day: 'numeric', timeZone: 'UTC' })\n : 'the first of next month'\n}\n\n/**\n * What a Free site start of this many pages is likely to cost, its p90 and\n * its ceiling (AGL-3722), before a plan names its sections: the plan, the\n * look, the layout and form a guided start builds, and each page at the\n * nominal section count, at what each MEASURED in production\n * (`AI_MEASURED_UNIT_CREDITS`); the ceiling is the whole worst case the wall\n * is proven with (`aiFreeSiteCreditEstimate`). Two pages: about 113\n * (p90 203, up to 243). A blog's one first post has no measurement of its\n * own yet, so it is counted at its worst case in all three.\n */\nexport function aiFreeSiteCreditRange(pages: number, options: { siteKind?: string | null } = {}): AiCreditRange {\n const count = Math.max(1, Math.floor(pages))\n const { likely, p90 } = aiSiteStartMeasured(count)\n const posts = aiFreeSitePosts(options.siteKind) * AI_FREE_SITE_WORST_CASE_CREDITS.post\n return aiCreditRangeOrdered({\n likely: likely + posts,\n p90: p90 + posts,\n ceiling: aiFreeSiteCreditEstimate(count, options),\n })\n}\n\n/** A site start's measured likely and p90 before its plan: plan, look, layout, form and its pages at the nominal sections. */\nfunction aiSiteStartMeasured(pages: number): Pick<AiCreditRange, 'likely' | 'p90'> {\n const { plan, theme, layout, form } = AI_MEASURED_UNIT_CREDITS\n const page = aiMeasuredPageCredits(AI_SITE_NOMINAL_SECTIONS)\n return {\n likely: plan.median + theme.median + layout.median + form.median + pages * page.median,\n p90: plan.p90 + theme.p90 + layout.p90 + form.p90 + pages * page.p90,\n }\n}\n\n/** The smaller first build a site start offers: its home page alone. */\nexport const AI_SITE_HOME_FIRST_LABEL = 'Build the home page first'\n\n/**\n * What a Free site start says before it starts when what is left does not\n * cover its p90 (AGL-3722), or `null` when it fits — or when nothing is known\n * about what is left, since the reservation still decides each pass. Not a\n * refusal: the person may build what fits (the job pauses with Resume when\n * the credits run out), build the home page first, or upgrade.\n */\nexport function aiFreeSitePrompt(\n credits: Pick<AiFreeCreditsLeft, 'left' | 'resetsOn'> | null | undefined,\n pages: number,\n options: { siteKind?: string | null } = {},\n): AiCreditsPrompt | null {\n if (!credits || !Number.isFinite(credits.left)) return null\n const count = Math.max(1, Math.floor(pages))\n const home = aiFreeSiteCreditRange(1, options)\n return aiCreditsPromptFor(\n aiFreeSiteCreditRange(count, options),\n credits,\n count > 1 ? { label: AI_SITE_HOME_FIRST_LABEL, ...home } : null,\n )\n}\n\n/**\n * Why a Free start is refused outright (AGL-3722): nothing at all is left,\n * so there is nothing for \"build what fits\" to build.\n */\nexport function aiFreeCreditsNoneLeftText(resetsOn: string): string {\n return (\n `You have no free AI credits left this month. They are shared by all your Free workspaces and ` +\n `renew on ${aiFreeCreditsResetLabel(resetsOn)}. Upgrade this workspace to build with AI now.`\n )\n}\n\n/**\n * The most sections one scaffolded page may hold. The plan model allows more\n * for a page job, which builds one page; a scaffold builds eight, and each\n * section is a pass of its own.\n */\nexport const AI_SITE_MAX_SECTIONS = 8\n\n/**\n * The fewest sections a site start's home page is planned with (AGL-3660).\n * A new site is a full website (Zach, 2026-10-04): its home reads as one — a\n * hero, then bands such as the offer, why us, social proof, and a closing\n * call to action. A plan is an outline and nothing asked for more than a\n * ceiling, so a live Free yoga start (2026-10-07) planned its home with two\n * sections. The plan step names this count in the plan's turn and re-asks a\n * first answer whose home is under it (`aiSiteThinHomeViolations`).\n */\nexport const AI_SITE_HOME_MIN_SECTIONS = 5\n\n/**\n * The blog a guided start writes its first posts into (AGL-3676), and\n * the addresses it may answer at, in order of preference: the first one no\n * planned page takes.\n */\nexport const AI_SITE_BLOG_NAME = 'Blog'\nexport const AI_SITE_BLOG_SLUGS = ['blog', 'posts', 'journal', 'articles', 'writing', 'stories'] as const\n\n/** A planned page's first path segment, lower-cased: `/journal/2026` → `journal`. */\nconst firstSegment = (slug: string) => slug.trim().replace(/^\\/+/, '').split('/')[0].toLowerCase()\n\n/** The address the blog answers at, beside these planned pages: the first of `AI_SITE_BLOG_SLUGS` none of them takes. */\nexport function aiSiteBlogSlug(screens: ReadonlyArray<{ slug: string }>): string {\n const taken = new Set(screens.map((screen) => firstSegment(screen.slug)).filter(Boolean))\n return AI_SITE_BLOG_SLUGS.find((slug) => !taken.has(slug)) ?? AI_SITE_BLOG_SLUGS[0]\n}\n\n/** The header's link to the blog (AGL-3660): a path, not a page, since the blog is the posts collection. */\nexport const AI_SITE_BLOG_NAV_ID = 'aiSiteBlog'\n\n/** The nav entry a site whose start writes posts links its blog by. */\nexport function aiSiteBlogNavPage(screens: ReadonlyArray<{ slug: string }>): {\n id: string\n label: string\n slug: string\n href: string\n} {\n const slug = aiSiteBlogSlug(screens)\n return { id: AI_SITE_BLOG_NAV_ID, label: AI_SITE_BLOG_NAME, slug: `/${slug}`, href: `/${slug}` }\n}\n\n/**\n * Whether a planned page stands in for the blog a start writes (AGL-3660):\n * its address is one of the blog's, or its name says it lists posts. The\n * home page never does.\n */\nexport function aiSiteIsBlogStandIn(screen: { slug: string; title: string }): boolean {\n if (aiSitePlanIsHome(screen)) return false\n return (AI_SITE_BLOG_SLUGS as readonly string[]).includes(firstSegment(screen.slug)) || BLOG_PAGE_WORDS.test(screen.title)\n}\n\n/**\n * A start that writes posts, with its plan's stand-in pages taken out\n * (AGL-3676): the plan step asks once for a plan without one and keeps a\n * second answer that still has one, so the scaffold merges it into the blog\n * instead — the page is not built, its links go to the blog, and the blog\n * takes the address it left free. The kept screens hold their plan index,\n * which a page unit's slot is named by.\n */\nexport function aiSitePlanWithoutBlogStandIns<T extends { slug: string; title: string }>(\n screens: readonly T[],\n): { screens: T[]; standIns: T[] } {\n return {\n screens: screens.filter((screen) => !aiSiteIsBlogStandIn(screen)),\n standIns: screens.filter((screen) => aiSiteIsBlogStandIn(screen)),\n }\n}\n\n/** The code a planned page that stands in for the written blog is re-asked under. */\nexport const AI_SITE_BLOG_PAGE_CODE = 'plan-blog-page-duplicate'\n\n/** A page's name that says it lists the posts. */\nconst BLOG_PAGE_WORDS = /\\b(blog|posts?|articles?|journal|writing|stories|news)\\b/i\n\n/**\n * A site plan's pages that stand in for the blog its start writes (AGL-3660):\n * the live Slow Roads start (2026-10-08) planned an \"Articles\" page of\n * featured cards beside the posts it wrote at /blog, and the header linked\n * Articles and never the blog. A page whose address is one of the blog's, or\n * whose name says it lists posts, duplicates it; the home page never does.\n */\nexport function aiSiteBlogStandInViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const standIns = plan.screens.flatMap((screen, index) => (aiSiteIsBlogStandIn(screen) ? [{ screen, index }] : []))\n if (!standIns.length) return []\n const names = standIns.map(({ screen }) => `\"${screen.title}\" at ${screen.slug}`).join(', ')\n return [\n {\n rule: null,\n code: AI_SITE_BLOG_PAGE_CODE,\n message: `${names} ${standIns.length === 1 ? 'stands' : 'stand'} in for the blog this site already gets: its first posts are written at /blog, and the header links it. Take ${standIns.length === 1 ? 'that page' : 'those pages'} out, and plan another page the brief needs, or feature the posts in a section of the home page.`,\n paths: standIns.map(({ index }) => `screens[${index}]`),\n },\n ]\n}\n\n/** The code a site plan's work section planned without its pieces is re-asked under. */\nexport const AI_SITE_EMPTY_GALLERY_CODE = 'plan-empty-gallery'\n\n/** The pieces a section that shows the work is planned with (AGL-3660). */\nexport const AI_SITE_GALLERY_MIN_ITEMS = 3\nexport const AI_SITE_GALLERY_MAX_ITEMS = 6\n\n/**\n * A planned section that shows the work: a gallery, a portfolio, a\n * collection, selected or featured work. \"Galleries\" — an audience, as in\n * \"Why galleries choose us\" — and \"how we work\" are not.\n */\nconst GALLERY_SECTION =\n /\\b(gallery|portfolio|collections?|lookbook|showcase|works|projects|(?:selected|featured|recent|our|past) (?:work|pieces|projects))\\b/i\n\n/** A section that only opens, introduces or closes a page, whatever page it is on: \"Portfolio Hero\". */\nconst FRAMING_SECTION = /\\b(hero|intro(?:duction)?|banner|header|cta|call to action|contact|inquiry|enquiry|about)\\b/i\n\n/** Whether a planned section's name says it shows the work. */\nexport function aiSiteSectionShowsWork(name: string): boolean {\n return GALLERY_SECTION.test(name) && !FRAMING_SECTION.test(name)\n}\n\n/** The sentence a site plan's turn states about a section that shows the work. */\nexport const AI_SITE_GALLERY_SENTENCE = `A section that shows the work — a gallery, portfolio, collection or selected works — counts its pieces in its items: ${AI_SITE_GALLERY_MIN_ITEMS} to ${AI_SITE_GALLERY_MAX_ITEMS}.`\n\n/**\n * A site plan's sections that show the work with fewer than three pieces\n * (AGL-3660). The live Juniper Clay start (2026-10-08) planned its Portfolio\n * page's \"Works Gallery\" with no items, and the page's works lost their place\n * to an inquiry form: a page about the work showed none.\n */\nexport function aiSiteEmptyGalleryViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const thin = plan.screens.flatMap((screen, screenIndex) =>\n screen.sections.flatMap((section, sectionIndex) =>\n aiSiteSectionShowsWork(section.name) && section.items < AI_SITE_GALLERY_MIN_ITEMS\n ? [{ name: `\"${section.name}\" on ${screen.title}`, path: `screens[${screenIndex}].sections[${sectionIndex}].items` }]\n : [],\n ),\n )\n if (!thin.length) return []\n const names = thin.map((entry) => entry.name).join(', ')\n return [\n {\n rule: null,\n code: AI_SITE_EMPTY_GALLERY_CODE,\n message: `${names} ${thin.length === 1 ? 'shows' : 'show'} the work with fewer than ${AI_SITE_GALLERY_MIN_ITEMS} pieces. Plan ${thin.length === 1 ? 'it' : 'each'} with ${AI_SITE_GALLERY_MIN_ITEMS} to ${AI_SITE_GALLERY_MAX_ITEMS} items, one for each piece it shows.`,\n paths: thin.map((entry) => entry.path),\n },\n ]\n}\n\n/** The violation a site plan whose home page is under its fewest sections is re-asked under. */\nexport const AI_SITE_THIN_HOME_CODE = 'plan-thin-home'\n\n/**\n * What a site plan's home is composed of, in the words the plan's turn and its\n * re-ask both use. Its trust band is what working together is like, never\n * testimonials (AGL-3887): a new site has no customer words to show, and a\n * home asked for them planned a \"Client feedback placeholder\" the build could\n * fill only with a promise of words to come.\n */\nexport const AI_SITE_HOME_BANDS =\n 'a hero first, then bands such as services or the offer, about or why us, and what working together is like, and a closing call to action or contact band last'\n\n/**\n * The fewest sections this site start's home is held to (AGL-3660): five, or\n * 0 — no minimum — where the Free wall cannot pay for a full home beside the\n * other pages. `across` is the sections the Free taste fits across `pages`\n * pages, each other page keeping at least one; `null` is a paid start, which\n * no wall shares out.\n *\n * ⛔ NEVER a lowered minimum. A Free guided start creates its site empty and\n * plans its layout, and the wall then fits 4 sections across two pages. Told\n * \"a home of at least 3\" beside that, the live yoga start of 2026-10-08\n * planned 4 + 3 and then 4 + 2, was refused for the wall twice, and stopped:\n * a home asked for in bands the wall cannot pay for is a start that fails.\n */\nexport function aiSiteHomeMinSections(input: { pages: number; across: number | null }): number {\n if (input.across === null) return AI_SITE_HOME_MIN_SECTIONS\n const others = Math.max(0, Math.floor(input.pages) - 1)\n return input.across - others >= AI_SITE_HOME_MIN_SECTIONS ? AI_SITE_HOME_MIN_SECTIONS : 0\n}\n\n/**\n * What a site start's plan is told to BUILD with (AGL-3660): the sections are\n * a budget to use, never a ceiling to stay under. Told only \"at most 8\", the\n * live prod start of 2026-10-08 planned a home of two sections, and Zach: \"that\n * didn't mean do as little as possible.\" On the Free taste the sentence shares\n * the wall's sections out — a home of five or six, the other page two or\n * three, about seven or eight in all; a paid start's home is asked to be rich.\n * `min` is the home's fewest (`aiSiteHomeMinSections`), 0 where the plan\n * plans no home or the wall cannot pay for a full one.\n */\nexport function aiSiteFullPlanSentence(input: { pages: number; across: number | null; min: number }): string {\n const { across, min } = input\n if (across === null) {\n return min > 0\n ? `Plan a full website, never a minimal one: a rich home page of ${min + 1} or more sections where the brief gives them, and every page with the sections it needs.`\n : 'Plan a full website, never a minimal one: every page with the sections it needs.'\n }\n const lead = `The ${across} sections are the budget to use, not a ceiling to stay under: plan a full website, never a minimal one`\n const others = Math.max(0, Math.floor(input.pages) - 1)\n if (min <= 0 || across < min) return `${lead}.`\n const homeHi = Math.max(min, Math.min(min + 1, across - others))\n if (!others) return `${lead}: the home page at / with ${min} to ${homeHi} sections.`\n const otherHi = Math.max(1, Math.min(3, Math.floor((across - min) / others)))\n const otherLo = Math.max(1, Math.min(2, otherHi, Math.floor((across - homeHi) / others)))\n const totalLo = Math.max(min + others, across - 1)\n const range = (lo: number, hi: number) => (lo === hi ? `${lo}` : `${lo} to ${hi}`)\n const pagesWord = others === 1 ? 'the other page' : 'each other page'\n return `${lead}: the home page at / with ${range(min, homeHi)} sections, ${pagesWord} ${range(otherLo, otherHi)}, about ${range(totalLo, across)} in total.`\n}\n\n/** Whether a planned page is the site's home: the one at `/`. */\nexport function aiSitePlanIsHome(screen: { slug: string }): boolean {\n const slug = screen.slug.trim()\n return slug === '/' || slug === ''\n}\n\n/**\n * A site plan's home page under its fewest sections (AGL-3660), as the plan\n * step's re-ask names it. A plan with no page at `/` — the owner's own home\n * stays — has no home to hold. `across` is the Free wall's section count, so\n * the re-ask says where the sections come from rather than tripping the wall.\n */\nexport function aiSiteThinHomeViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n options: { min: number; across: number | null },\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const index = plan.screens.findIndex(aiSitePlanIsHome)\n if (index < 0) return []\n const count = plan.screens[index].sections.length\n if (count >= options.min) return []\n const within =\n options.across === null\n ? ''\n : ` Keep the whole plan within ${options.across} sections: take them from the other page where you must.`\n return [\n {\n rule: null,\n code: AI_SITE_THIN_HOME_CODE,\n message: `The home page has ${count} ${count === 1 ? 'section' : 'sections'}, and a new site's home page reads as a full website with at least ${options.min}: ${AI_SITE_HOME_BANDS}.${within}`,\n paths: [`screens[${index}].sections`],\n },\n ]\n}\n\n/**\n * Sections a page is assumed to hold before a plan names them, for the\n * estimate a member reads when they ask for a scaffold. A declared\n * assumption, not a measurement: the plan's own section counts replace it\n * the moment the plan exists.\n */\nexport const AI_SITE_NOMINAL_SECTIONS = 5\n\n/**\n * The credits one pass is held against: the machine's\n * `AI_JOB_STEP_RESERVE_CREDITS`, declared here so the estimate stays a pure\n * number the console computes without the Admin SDK. `ai-site-job.spec.ts`\n * holds the two equal.\n */\nexport const AI_SITE_PASS_CREDITS = 50\n\n/** The longest a scaffold's scalar inputs may run; they are names, not copy. */\nexport const AI_SITE_INPUT_MAX_CHARS = 120\n\n/** The sites one agency batch may generate for in one request. */\nexport const AI_SITE_BATCH_MAX = 25\n\n/**\n * The sites a plan must hold before the org Sites page offers the batch at\n * all: the Agency and Advanced bands, which the plan's `hostLimit` is what\n * distinguishes.\n */\nexport const AI_SITE_BATCH_MIN_HOST_LIMIT = 25\n\nexport interface AiSiteJobInputs {\n /** What the business is, in a few words: the brief's subject. */\n businessType: string\n /**\n * Who the site is for, in a few words (AGL-2918); empty when nobody said.\n * The plan step puts it in front of the model on a line of its own, as it\n * does every other scalar here, so it narrows the pages a plan proposes\n * without a prompt of its own.\n */\n audience: string\n /**\n * The starter site whose shape the person liked (AGL-2918), by its\n * `STARTER_TEMPLATES` id; empty when they picked none.\n *\n * A hint carried as the id rather than the starter, because an id is what\n * the guided start's list, this door and the plan's line all agree on\n * without any of them loading a catalog of node maps. Unrecognized ids are\n * admitted for the same reason an unrecognized business type is: it is a\n * few words in a brief, not a lookup.\n */\n starter: string\n /**\n * The kind of site the person picked (AGL-3660), by its `AI_SITE_KINDS`\n * id; empty when nobody picked one, and the business type suggests it.\n * It sets the look the site is designed in and how its pages are arranged.\n */\n siteKind: string\n /** How many pages the member asked for. */\n pages: number\n /** The per-site variables an agency batch varies; empty when none was given. */\n businessName: string\n city: string\n brand: string\n /** Whether the scaffold also drafts a welcome email. */\n welcomeEmail: boolean\n /**\n * Where the contact form's submissions go (AGL-2918); `null` where nobody\n * said, which is every job created before the question existed and every\n * door that does not ask it.\n *\n * The one setting a new site owner actually needs made, and the one thing\n * about a contact form a model cannot know: whether a submission is a note\n * to read or a lead to chase is a decision about how the business runs. So\n * an answer BINDS the form step rather than hinting to it, and `null`\n * leaves the model's own proposal standing, exactly as it stood before.\n */\n submissions: AiSiteSubmissions | null\n /** The batch this job was created under (AGL-2911); `null` for a single site. */\n batchId: string | null\n}\n\n/**\n * Where a site's contact form sends what a visitor writes.\n *\n * Two, not three. The form step's own vocabulary has a third — a mailing\n * list — which it can only answer with a note, because the stored routing has\n * no place for a list; offering it as a question would be asking somebody to\n * pick an outcome the platform then explains it cannot store.\n */\nexport const AI_SITE_SUBMISSIONS = ['inbox', 'lead'] as const\n\nexport type AiSiteSubmissions = (typeof AI_SITE_SUBMISSIONS)[number]\n\n/**\n * What each answer to \"where do submissions go\" is called, and what it means.\n *\n * Here rather than beside the guided start's own questions, because it is not\n * only the guided start that asks: the agency batch asks the same thing of a\n * whole run (AGL-2918), and two surfaces wording one decision two ways is two\n * decisions. `ai-site-job.spec.ts` holds the list to {@link AI_SITE_SUBMISSIONS}.\n */\nexport const AI_SITE_SUBMISSION_CHOICES: ReadonlyArray<{\n id: AiSiteSubmissions\n label: string\n blurb: string\n}> = [\n {\n id: 'inbox',\n label: 'The Inbox',\n blurb: 'Every message is one to read and reply to.',\n },\n {\n id: 'lead',\n label: 'The Inbox, and CRM as a lead',\n blurb: 'Every message with an email address is also somebody to follow up.',\n },\n]\n\n/**\n * Which kind of email a scaffold's email unit is (AGL-2918), carried on the\n * derived job as `inputs.emailType`. The email step names the kind on the one\n * line it puts above the brief, and a scaffold was naming none.\n *\n * A key of the email step's own `AI_EMAIL_TYPES`, held here because neither\n * step may import the other: a scaffold delegates by job kind, and a\n * deployment that scaffolds is not necessarily one that has loaded the email\n * step. `ai-job-email-step.spec.ts` holds this key to that catalog.\n *\n * `reply` and not `welcome`. The five kinds a member picks are campaigns\n * somebody sends to an audience, and this is an answer to one person who\n * wrote in through the site; the nearest, `welcome`, is a label about signing\n * up, and a kind that misdescribes the email is worse than an absent one\n * because it is the first thing the model is told.\n */\nexport const AI_SITE_EMAIL_TYPE = 'reply'\n\n/**\n * What a site job's plan and every unit it builds are told about the\n * business's name (AGL-3596): that it is the name, used as written. Said on\n * the job's own turn, never in a cached system block, because it is one\n * site's. A model handed only what the business does named it itself —\n * \"Hillside Dog Grooming\" was built as \"Austin Paws Grooming\".\n */\nexport function aiSiteNameSentence(name: string): string {\n return `The business is named “${name}”: the site names it exactly that way, in the header, the footer, the copy and the search listing, and never by any other name.`\n}\n\n/** Where a job's inputs say submissions go, or `null` where they do not say. */\nexport function aiSiteSubmissions(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteSubmissions | null {\n const value = inputs?.['submissions']\n return (AI_SITE_SUBMISSIONS as readonly unknown[]).includes(value)\n ? (value as AiSiteSubmissions)\n : null\n}\n\nconst ID_CHARS = /^[A-Za-z0-9_-]{1,64}$/\n\n/** A scaffold's inputs, or the sentence the door refuses them with. */\nexport function parseAiSiteJobInputs(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteJobInputs | string {\n const text = (key: string): string | null => {\n const value = inputs?.[key]\n if (value === undefined || value === null || value === '') return ''\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed.length > AI_SITE_INPUT_MAX_CHARS ? null : trimmed\n }\n const businessType = text('businessType')\n if (businessType === null) {\n return `businessType must be text under ${AI_SITE_INPUT_MAX_CHARS} characters`\n }\n if (!businessType) return 'Say what kind of business the site is for'\n const businessName = text('businessName')\n const city = text('city')\n const brand = text('brand')\n const audience = text('audience')\n const starter = text('starter')\n // A kind this deployment does not know is nobody having picked one.\n const siteKind = aiSiteKind(inputs?.['siteKind'])?.id ?? ''\n for (const [key, value] of [\n ['businessName', businessName],\n ['city', city],\n ['brand', brand],\n ['audience', audience],\n ['starter', starter],\n ] as const) {\n if (value === null)\n return `${key} must be text under ${AI_SITE_INPUT_MAX_CHARS} characters`\n }\n const rawPages = inputs?.['pages']\n const pages =\n typeof rawPages === 'number' ? rawPages : Number(rawPages ?? NaN)\n // Read here across both bands; the door holds a workspace to its own\n // (`aiSitePagesRefusal`), since only it knows the workspace's plan.\n if (\n !Number.isInteger(pages) ||\n pages < AI_SITE_FREE_PAGES.min ||\n pages > AI_SITE_PAGES.max\n ) {\n return `pages must be a whole number from ${AI_SITE_FREE_PAGES.min} to ${AI_SITE_PAGES.max}`\n }\n // Where submissions go is admitted only as one of the two the form step\n // can actually bind; anything else is nobody having said, and the model\n // proposes as it always did rather than the door refusing the whole job.\n const submissions = aiSiteSubmissions(inputs)\n const rawBatch = inputs?.['batchId']\n const batchId =\n rawBatch === undefined || rawBatch === null || rawBatch === ''\n ? null\n : typeof rawBatch === 'string' && ID_CHARS.test(rawBatch)\n ? rawBatch\n : undefined\n if (batchId === undefined) return 'batchId is not a batch id'\n return {\n businessType,\n audience: audience as string,\n starter: starter as string,\n siteKind,\n pages,\n businessName: businessName as string,\n city: city as string,\n brand: brand as string,\n welcomeEmail: inputs?.['welcomeEmail'] !== false,\n submissions,\n batchId,\n }\n}\n\n/**\n * Why a workspace cannot ask for this many pages (AGL-3594), in a sentence a\n * member reads; `null` when it can. A Free workspace builds one or two, and a\n * paid one four to eight, as it always has. Refused rather than clamped: the\n * guided start offers only the band, so a request outside it was not made\n * there, and a job quietly building fewer pages than it was asked for is a\n * worse answer than a sentence saying why.\n */\nexport function aiSitePagesRefusal(pages: number, freeTaste: boolean | null | undefined): string | null {\n const band = aiSitePagesBand(freeTaste)\n if (pages >= band.min && pages <= band.max) return null\n return freeTaste\n ? `A Free workspace's AI site start builds ${AI_SITE_FREE_PAGES.min} or ${AI_SITE_FREE_PAGES.max} pages. ${AI_SITE_FREE_PAGES_NOTE}`\n : `A site is planned with ${band.min} to ${band.max} pages.`\n}\n\n/**\n * What the site itself is, as a step that is NOT the scaffold reads it off a\n * job's inputs (AGL-2918).\n *\n * A scaffold delegates unit by unit under a job derived from its own — a page\n * job, a form job — and the derived job carries the scaffold's inputs. So the\n * two answers that describe the site rather than one record of it are\n * readable by every delegated step, and a step that wants them does not have\n * to know it was delegated to.\n *\n * Lenient where {@link parseAiSiteJobInputs} is strict, because it reads the\n * inputs of jobs that are not scaffolds: a page job started from the Screens\n * page has no `businessType` and no `pages`, and that is not an error here —\n * it is a site nobody described, and the answer is two empty strings.\n */\nexport interface AiSiteWords {\n /** What kind of site it is; empty when the job's inputs do not say. */\n about: string\n /** Who it is for; empty when the job's inputs do not say. */\n audience: string\n}\n\n/** Whether either half of {@link AiSiteWords} says anything. */\nexport function aiSiteWordsSaidAnything(words: AiSiteWords): boolean {\n return Boolean(words.about || words.audience)\n}\n\n/** What a job's inputs say the site is, read defensively and trimmed to the input ceiling. */\nexport function aiSiteWords(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteWords {\n const read = (key: string): string => {\n const value = inputs?.[key]\n if (typeof value !== 'string') return ''\n return value.replace(/\\s+/g, ' ').trim().slice(0, AI_SITE_INPUT_MAX_CHARS).trim()\n }\n return { about: read('businessType'), audience: read('audience') }\n}\n\n/**\n * What a scaffold builds for itself: the layout its pages render inside, the\n * form they place, the palette suggestion a member applies in the Theme\n * section, and the datasets its structured content is kept in (AGL-3616),\n * which the data plugin writes. Anything else a plan asks to create is a job\n * of its own.\n */\nexport const AI_SITE_CREATE_KINDS: readonly AiBuildPlanCreateKind[] = [\n 'layout',\n 'form',\n 'theme-change',\n 'dataset',\n]\n\n/** The most datasets one site start creates (AGL-3616). */\nexport const AI_SITE_DATASETS_MAX = 3\n\n/** The creations a scaffold cannot build, in the order the plan lists them, each named once. */\nexport function aiSitePlanPrerequisites(\n plan: AiBuildPlan,\n): Array<{ kind: AiBuildPlanCreateKind; name: string }> {\n const seen = new Set<string>()\n const prerequisites: Array<{ kind: AiBuildPlanCreateKind; name: string }> = []\n const add = (kind: AiBuildPlanCreateKind, name: string) => {\n const key = `${kind}:${name.toLowerCase()}`\n if (seen.has(key)) return\n seen.add(key)\n prerequisites.push({ kind, name })\n }\n for (const entry of plan.create) {\n if (!AI_SITE_CREATE_KINDS.includes(entry.kind)) add(entry.kind, entry.name)\n }\n // A reference the create list does not carry is refused by the plan rules\n // before a plan is kept: rule 2 for a screen's layout, rule 7 for anything\n // else (`plan-creation-undeclared`, AGL-3040). A plan confirmed before that\n // rule existed can still carry one. It is named as a component: the\n // reference carries no kind, and the refusal must say where one is made.\n for (const { name } of aiPlanUndeclaredRefs(plan)) add('component', name)\n return prerequisites\n}\n\n/**\n * Why a scaffold cannot build a plan of this SHAPE — the page band, a page's\n * sections, its addresses, its navigation — in a sentence a member reads;\n * `null` when the shape is one it builds. The plan step holds a plan to it\n * with a re-ask (AGL-3030), and the doors hold a confirmed plan to it again\n * through `aiSitePlanRefusal`.\n */\nexport function aiSitePlanShapeRefusal(\n plan: AiBuildPlan,\n options: { freeTaste?: boolean } = {},\n): string | null {\n const { screens } = plan\n const band = aiSitePagesBand(options.freeTaste)\n if (screens.length < band.min || screens.length > band.max) {\n return `This plan builds ${screens.length} ${screens.length === 1 ? 'page' : 'pages'}, and ${\n options.freeTaste ? \"a Free workspace's site scaffold\" : 'a site scaffold'\n } builds ${band.min} to ${band.max}. Describe the site again.`\n }\n const slugs = new Set<string>()\n for (const screen of screens) {\n if (!screen.sections.length) {\n return `The page “${screen.title}” has no sections to build. Describe the site again.`\n }\n if (screen.sections.length > AI_SITE_MAX_SECTIONS) {\n return `The page “${screen.title}” has ${screen.sections.length} sections, and a scaffolded page holds ${AI_SITE_MAX_SECTIONS}. Describe the site again.`\n }\n const slug = screen.slug.trim().toLowerCase()\n if (slugs.has(slug)) {\n return `Two pages in this plan share the address ${screen.slug}. Describe the site again.`\n }\n slugs.add(slug)\n }\n if (!screens.some((screen) => screen.nav)) {\n return 'No page in this plan is in the site navigation. Describe the site again.'\n }\n const datasets = plan.create.filter((entry) => entry.kind === 'dataset').length\n if (datasets > AI_SITE_DATASETS_MAX) {\n return `This plan creates ${datasets} datasets, and a site scaffold creates at most ${AI_SITE_DATASETS_MAX}. Keep the others' items on their pages.`\n }\n return null\n}\n\n/**\n * Why a scaffold cannot build this plan, in a sentence a member reads when\n * confirming it; `null` when it can.\n */\nexport function aiSitePlanRefusal(\n plan: AiBuildPlan,\n options: { freeTaste?: boolean } = {},\n): string | null {\n const shape = aiSitePlanShapeRefusal(plan, options)\n if (shape) return shape\n const prerequisites = aiSitePlanPrerequisites(plan)\n if (!prerequisites.length) return null\n const parts = prerequisites.map(\n ({ kind, name }) =>\n `the ${AI_BUILD_PLAN_CREATION_NOUNS[kind].noun} “${name}” ${AI_BUILD_PLAN_CREATION_NOUNS[kind].where}`,\n )\n const listed =\n parts.length === 1\n ? parts[0]\n : `${parts.slice(0, -1).join(', ')} and ${parts[parts.length - 1]}`\n return `This site needs what the workspace does not have yet. Create ${listed}, then describe the site again.`\n}\n\n/** What the estimate counts a plan in: whether a welcome email follows, and the creations the job builds. */\nexport interface AiPlanPassOptions {\n welcomeEmail?: boolean\n /** The creation kinds the job builds itself; a scaffold's when absent. */\n creates?: readonly AiBuildPlanCreateKind[]\n /** Each page and creation written on its own (`aiStandaloneScreenCreditRange`), not as a site start’s (AGL-3722). */\n standalonePages?: boolean\n}\n\n/**\n * Whether a creation is built with no model: a dataset a form of the plan\n * writes to (AGL-3616) starts empty, designed from its planned fields, so it\n * is no pass of the estimate.\n */\nfunction aiPlanCreationIsModelFree(plan: Pick<AiBuildPlan, 'create'>, entry: AiBuildPlan['create'][number]): boolean {\n return entry.kind === 'dataset' && aiPlanFormDatasetNames(plan).has(entry.name.trim().toLowerCase())\n}\n\n/**\n * The passes a plan implies: one per section of every screen, one more per\n * screen for its search listing and its draft, and one for each thing the\n * plan creates that the job builds. What the estimate is counted in.\n */\nexport function aiPlanPasses(plan: AiBuildPlan, options: AiPlanPassOptions = {}): number {\n const screens = plan.screens.reduce(\n (total, screen) => total + screen.sections.length + 1,\n 0,\n )\n const creates = options.creates ?? AI_SITE_CREATE_KINDS\n const creations = plan.create.filter((entry) => creates.includes(entry.kind) && !aiPlanCreationIsModelFree(plan, entry)).length\n return screens + creations + (options.welcomeEmail ? 1 : 0)\n}\n\n/**\n * About what a plan costs to build, in credits. An ESTIMATE: the nominal\n * credits the machine holds per step, times the passes the plan implies.\n * What each pass actually costs is its model's tokens, recorded on the job\n * as it runs.\n */\nexport function aiPlanCreditEstimate(plan: AiBuildPlan, options: AiPlanPassOptions = {}): number {\n return aiPlanPasses(plan, options) * AI_SITE_PASS_CREDITS\n}\n\n/**\n * About what a job of this kind costs to build from its plan (AGL-3031): a\n * page job counts the layout, forms and components it builds before its\n * page; a template, layout, component, form or email job counts its own\n * record and every creation it builds before it (AGL-3143 §15); and a\n * scaffold counts what it builds. The figure the proposal shows beside\n * Confirm, and the hold a confirmation takes.\n */\nexport function aiJobPlanCreditEstimate(kind: string, plan: AiBuildPlan): number {\n const creates =\n kind === 'page' ? AI_PAGE_CREATE_KINDS : AI_JOB_CREATE_KINDS[kind as keyof typeof AI_JOB_CREATE_KINDS]\n return aiPlanCreditEstimate(plan, creates ? { creates } : {})\n}\n\n/**\n * About what a scaffold of this many pages costs, before a plan names its\n * sections: the same arithmetic on the nominal section count, plus the plan\n * step that proposes it. Shown where a member asks for a scaffold.\n */\nexport function aiSiteCreditEstimate(\n pages: number,\n options: { welcomeEmail?: boolean; siteKind?: string | null } = {},\n): number {\n const screens = Math.max(0, Math.floor(pages))\n const content = aiSiteStartContent(options.siteKind)\n const passes =\n 1 +\n screens * (AI_SITE_NOMINAL_SECTIONS + 1) +\n 2 +\n (options.welcomeEmail ? 1 : 0) +\n (content === 'products' ? 1 : content === 'posts' ? AI_SITE_START_POSTS : 0)\n return passes * AI_SITE_PASS_CREDITS\n}\n\n/** How many first posts a paid blog start writes, one pass each (`AI_SITE_POSTS`, held equal by `ai-site-job.spec.ts`); a Free one writes `AI_SITE_FREE_POSTS`. */\nexport const AI_SITE_START_POSTS = 3\n\n/**\n * The first content a paid start of this kind writes (AGL-3676): a store's\n * first products, a blog's first posts, or nothing. `aiSiteContentPart`'s\n * answer for a paid start, by the kind's id; a Free start writes a blog its\n * one first post (`aiFreeSitePosts`) and a store nothing.\n */\nexport function aiSiteStartContent(siteKind: string | null | undefined): 'posts' | 'products' | null {\n if (siteKind === 'store') return 'products'\n if (siteKind === 'blog') return 'posts'\n return null\n}\n\n/**\n * The measured cost of one creation a plan builds (AGL-3722): a layout's or\n * a form's as measured, a theme's as the site start's look measured, and\n * any other kind at the stand-in a single-answer creation is priced at.\n * `standalone` for one written on its own — a build's, a page job's — rather\n * than inside a site start's warm run.\n */\nexport function aiCreationMeasuredCredits(kind: string, options: { standalone?: boolean } = {}): AiMeasuredCredits {\n if (kind === 'layout') {\n return options.standalone ? AI_MEASURED_STANDALONE_CREATION_CREDITS.layout : AI_MEASURED_UNIT_CREDITS.layout\n }\n if (kind === 'form') return AI_MEASURED_UNIT_CREDITS.form\n if (kind === 'theme' || kind === 'theme-change') return AI_MEASURED_UNIT_CREDITS.theme\n return AI_MEASURED_PASS_CREDITS\n}\n\n/** A planned page's range: its sections scaled around the measured page, its ceiling one pass a section and one for its listing. */\nexport function aiScreenCreditRange(sections: number): AiCreditRange {\n return aiCreditRangeOf(aiMeasuredPageCredits(sections), (Math.max(0, sections) + 1) * AI_SITE_PASS_CREDITS)\n}\n\n/**\n * A page written on its own — an Assist build's, a page job's — as a range\n * (AGL-3722): a fixed cost and one per section as such pages measured\n * (`AI_MEASURED_STANDALONE_PAGE`), never a site start's later, cheaper\n * pages; the ceiling as `aiScreenCreditRange`'s.\n */\nexport function aiStandaloneScreenCreditRange(sections: number): AiCreditRange {\n return aiCreditRangeOf(\n aiMeasuredStandalonePageCredits(sections),\n (Math.max(0, sections) + 1) * AI_SITE_PASS_CREDITS,\n )\n}\n\n/**\n * What a plan is likely to cost, its p90 and its ceiling (AGL-3722): the\n * same units `aiPlanCreditEstimate` counts, each at what it measured; the\n * ceiling IS `aiPlanCreditEstimate`.\n */\nexport function aiPlanCreditRange(plan: AiBuildPlan, options: AiPlanPassOptions = {}): AiCreditRange {\n const creates = options.creates ?? AI_SITE_CREATE_KINDS\n let range = AI_CREDIT_RANGE_ZERO\n const screenRange = options.standalonePages ? aiStandaloneScreenCreditRange : aiScreenCreditRange\n for (const screen of plan.screens) range = aiCreditRangeAdd(range, screenRange(screen.sections.length))\n for (const entry of plan.create) {\n if (!creates.includes(entry.kind) || aiPlanCreationIsModelFree(plan, entry)) continue\n range = aiCreditRangeAdd(\n range,\n aiCreditRangeOf(aiCreationMeasuredCredits(entry.kind, { standalone: options.standalonePages }), AI_SITE_PASS_CREDITS),\n )\n }\n if (options.welcomeEmail) range = aiCreditRangeAdd(range, aiCreditRangeOf(AI_MEASURED_PASS_CREDITS, AI_SITE_PASS_CREDITS))\n return aiCreditRangeOrdered(range)\n}\n\n/**\n * `aiJobPlanCreditEstimate` as a range (AGL-3722): the same kinds, each at\n * what it measured. Only a site start writes its pages in one warm run; every\n * other kind's page is written on its own.\n */\nexport function aiJobPlanCreditRange(kind: string, plan: AiBuildPlan): AiCreditRange {\n const creates =\n kind === 'page' ? AI_PAGE_CREATE_KINDS : AI_JOB_CREATE_KINDS[kind as keyof typeof AI_JOB_CREATE_KINDS]\n return aiPlanCreditRange(plan, { ...(creates ? { creates } : {}), standalonePages: kind !== 'site' })\n}\n\n/**\n * A paid site start's range before its plan (AGL-3722): the plan, its look,\n * layout and form, and each page at the nominal sections, as measured; the\n * ceiling is `aiSiteCreditEstimate`.\n */\nexport function aiSiteCreditRange(\n pages: number,\n options: { welcomeEmail?: boolean; siteKind?: string | null } = {},\n): AiCreditRange {\n const count = Math.max(0, Math.floor(pages))\n // A paid start plans and writes on the paid routing, measured apart (AGL-3739).\n const { plan, theme, layout, form, page, email, products } = AI_MEASURED_PAID_SITE_CREDITS\n const content = aiSiteStartContent(options.siteKind)\n // A blog's posts have no measurement of their own yet: the stand-in pass.\n const parts: AiMeasuredCredits[] = [\n plan,\n theme,\n layout,\n form,\n ...Array.from({ length: count }, () => page),\n ...(options.welcomeEmail ? [email] : []),\n ...(content === 'products' ? [products] : content === 'posts' ? [AI_MEASURED_PASS_CREDITS] : []),\n ]\n return aiCreditRangeOrdered({\n likely: parts.reduce((total, part) => total + part.median, 0),\n p90: parts.reduce((total, part) => total + part.p90, 0),\n ceiling: aiSiteCreditEstimate(count, options),\n })\n}\n"],"names":["aiSiteKind","AI_BUILD_PLAN_CREATION_NOUNS","aiPlanFormDatasetNames","aiPlanUndeclaredRefs","AI_JOB_CREATE_KINDS","AI_PAGE_CREATE_KINDS","FREE_AI_TASTE_CREDITS_PER_MONTH","AI_CREDIT_RANGE_ZERO","AI_MEASURED_PAID_SITE_CREDITS","AI_MEASURED_PASS_CREDITS","AI_MEASURED_STANDALONE_CREATION_CREDITS","AI_MEASURED_UNIT_CREDITS","aiCreditRangeAdd","aiCreditRangeOf","aiCreditRangeOrdered","aiCreditsPromptFor","aiMeasuredPageCredits","aiMeasuredStandalonePageCredits","AI_SITE_PAGES","min","max","AI_SITE_FREE_PAGES","aiSitePagesBand","freeTaste","AI_JOB_AUTO_CONFIRM_INPUT","AI_SITE_FREE_PAGES_NOTE","AI_SITE_PLAN_MAX_TOKENS","free","paid","AI_FREE_SITE_WORST_CASE_CREDITS","plan","look","layout","form","page","section","retry","listing","post","AI_FREE_SITE_MAX_SECTIONS","AI_SITE_FREE_POSTS","aiFreeSitePosts","siteKind","aiSiteStartContent","aiFreeSiteWorstCaseCredits","creations","sections","credits","pages","Math","floor","layouts","forms","posts","aiFreeSiteSectionsWithin","taste","before","Number","POSITIVE_INFINITY","AI_SITE_MAX_SECTIONS","aiFreeSiteCreditEstimate","options","aiFreeCreditsResetOn","now","next","Date","UTC","getUTCFullYear","getUTCMonth","toISOString","slice","aiFreeCreditsResetLabel","resetsOn","at","isFinite","getTime","toLocaleDateString","month","day","timeZone","aiFreeSiteCreditRange","count","likely","p90","aiSiteStartMeasured","ceiling","theme","AI_SITE_NOMINAL_SECTIONS","median","AI_SITE_HOME_FIRST_LABEL","aiFreeSitePrompt","left","home","label","aiFreeCreditsNoneLeftText","AI_SITE_HOME_MIN_SECTIONS","AI_SITE_BLOG_NAME","AI_SITE_BLOG_SLUGS","firstSegment","slug","trim","replace","split","toLowerCase","aiSiteBlogSlug","screens","taken","Set","map","screen","filter","Boolean","find","has","AI_SITE_BLOG_NAV_ID","aiSiteBlogNavPage","id","href","aiSiteIsBlogStandIn","aiSitePlanIsHome","includes","BLOG_PAGE_WORDS","test","title","aiSitePlanWithoutBlogStandIns","standIns","AI_SITE_BLOG_PAGE_CODE","aiSiteBlogStandInViolations","flatMap","index","length","names","join","rule","code","message","paths","AI_SITE_EMPTY_GALLERY_CODE","AI_SITE_GALLERY_MIN_ITEMS","AI_SITE_GALLERY_MAX_ITEMS","GALLERY_SECTION","FRAMING_SECTION","aiSiteSectionShowsWork","name","AI_SITE_GALLERY_SENTENCE","aiSiteEmptyGalleryViolations","thin","screenIndex","sectionIndex","items","path","entry","AI_SITE_THIN_HOME_CODE","AI_SITE_HOME_BANDS","aiSiteHomeMinSections","input","across","others","aiSiteFullPlanSentence","lead","homeHi","otherHi","otherLo","totalLo","range","lo","hi","pagesWord","aiSiteThinHomeViolations","findIndex","within","AI_SITE_PASS_CREDITS","AI_SITE_INPUT_MAX_CHARS","AI_SITE_BATCH_MAX","AI_SITE_BATCH_MIN_HOST_LIMIT","AI_SITE_SUBMISSIONS","AI_SITE_SUBMISSION_CHOICES","blurb","AI_SITE_EMAIL_TYPE","aiSiteNameSentence","aiSiteSubmissions","inputs","value","ID_CHARS","parseAiSiteJobInputs","text","key","undefined","trimmed","businessType","businessName","city","brand","audience","starter","rawPages","NaN","isInteger","submissions","rawBatch","batchId","welcomeEmail","aiSitePagesRefusal","band","aiSiteWordsSaidAnything","words","about","aiSiteWords","read","AI_SITE_CREATE_KINDS","AI_SITE_DATASETS_MAX","aiSitePlanPrerequisites","seen","prerequisites","add","kind","push","create","aiSitePlanShapeRefusal","slugs","some","nav","datasets","aiSitePlanRefusal","shape","parts","noun","where","listed","aiPlanCreationIsModelFree","aiPlanPasses","reduce","total","creates","aiPlanCreditEstimate","aiJobPlanCreditEstimate","aiSiteCreditEstimate","content","passes","AI_SITE_START_POSTS","aiCreationMeasuredCredits","standalone","aiScreenCreditRange","aiStandaloneScreenCreditRange","aiPlanCreditRange","screenRange","standalonePages","aiJobPlanCreditRange","aiSiteCreditRange","email","products","Array","from","part"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,UAAU,QAAQ,qBAAiB;AAC5C,SACEC,4BAA4B,EAC5BC,sBAAsB,EACtBC,oBAAoB,QAGf,qBAAiB;AACxB,SAASC,mBAAmB,QAAQ,wBAAoB;AACxD,SAASC,oBAAoB,QAAQ,mBAAe;AACpD,SAASC,+BAA+B,QAAQ,0BAAsB;AACtE,SACEC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,uCAAuC,EACvCC,wBAAwB,EACxBC,gBAAgB,EAChBC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,qBAAq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AIC,GACD,OAAO,SAASmF,qBAAqBhC,IAAY,EAAEzL,IAAiB;IAClE,MAAM2M,UACJlB,SAAS,SAASlN,uBAAuBD,mBAAmB,CAACmN,KAAyC;IACxG,OAAO6B,kBAAkBtN,MAAM,aAAM2M,UAAU;QAAEA;IAAQ,IAAI,CAAC;QAAIa,iBAAiB/B,SAAS;;AAC9F;AAEA;;;;CAIC,GACD,OAAO,SAASiC,kBACdxM,KAAa,EACba,UAAgE,CAAC,CAAC;IAElE,MAAMoB,QAAQhC,KAAK7B,GAAG,CAAC,GAAG6B,KAAKC,KAAK,CAACF;IACrC,gFAAgF;IAChF,MAAM,EAAElB,IAAI,EAAEwD,KAAK,EAAEtD,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEuN,KAAK,EAAEC,QAAQ,EAAE,GAAGlP;IAC7D,MAAMqO,UAAUlM,mBAAmBkB,QAAQnB,QAAQ;IACnD,0EAA0E;IAC1E,MAAMuL,QAA6B;QACjCnM;QACAwD;QACAtD;QACAC;WACG0N,MAAMC,IAAI,CAAC;YAAE1H,QAAQjD;QAAM,GAAG,IAAM/C;WACnC2B,QAAQ4I,YAAY,GAAG;YAACgD;SAAM,GAAG,EAAE;WACnCZ,YAAY,aAAa;YAACa;SAAS,GAAGb,YAAY,UAAU;YAACpO;SAAyB,GAAG,EAAE;KAChG;IACD,OAAOK,qBAAqB;QAC1BoE,QAAQ+I,MAAMM,MAAM,CAAC,CAACC,OAAOqB,OAASrB,QAAQqB,KAAKrK,MAAM,EAAE;QAC3DL,KAAK8I,MAAMM,MAAM,CAAC,CAACC,OAAOqB,OAASrB,QAAQqB,KAAK1K,GAAG,EAAE;QACrDE,SAASuJ,qBAAqB3J,OAAOpB;IACvC;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-job.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\nimport { aiSiteKind } from './ai-site-kinds'\nimport {\n AI_BUILD_PLAN_CREATION_NOUNS,\n aiPlanFormDatasetNames,\n aiPlanUndeclaredRefs,\n type AiBuildPlan,\n type AiBuildPlanCreateKind,\n} from './ai-build-plan'\nimport { AI_JOB_CREATE_KINDS } from './ai-job-creations'\nimport { AI_PAGE_CREATE_KINDS } from './ai-page-job'\nimport { FREE_AI_TASTE_CREDITS_PER_MONTH } from '../plan-entitlements'\nimport {\n AI_CREDIT_RANGE_ZERO,\n AI_MEASURED_PAID_SITE_CREDITS,\n AI_MEASURED_PASS_CREDITS,\n AI_MEASURED_STANDALONE_CREATION_CREDITS,\n AI_MEASURED_UNIT_CREDITS,\n aiCreditRangeAdd,\n aiCreditRangeOf,\n aiCreditRangeOrdered,\n aiCreditsPromptFor,\n aiMeasuredPageCredits,\n aiMeasuredStandalonePageCredits,\n type AiCreditRange,\n type AiCreditsPrompt,\n type AiMeasuredCredits,\n} from './ai-credit-estimate'\n\n/**\n * What a site scaffold is (AGL-2911): the inputs a `site` job is admitted\n * with, the plans a scaffold can build, and what one is estimated to cost\n * before it starts.\n *\n * A scaffold is the one job kind that builds a whole site rather than one\n * record: a plan of four to eight screens, the layout they render inside,\n * the contact form they place, a palette suggestion, and — where the email\n * step is loaded — a welcome email. It builds each of those through the job\n * kind that already owns it, so this module describes what a scaffold may\n * ask for and refuses the rest at confirmation, before a credit is spent,\n * naming what to make first.\n *\n * ── The estimate is the guard rail ───────────────────────────────────────\n *\n * A scaffold is tens of model calls, where every other kind is a few, so the\n * member reads what it will cost before they confirm the plan that spends\n * it. The figure is the machine's own nominal credits per step multiplied by\n * the passes the plan implies — an estimate, and said to be one wherever it\n * is shown.\n *\n * This module imports nothing at runtime, so the doors, the step, the batch\n * card and the plan proposal read one vocabulary.\n */\n\n/** How many pages a scaffold builds: enough to be a site, few enough to read. */\nexport const AI_SITE_PAGES = { min: 4, max: 8 } as const\n\n/**\n * How many pages a Free workspace's scaffold builds (AGL-3594): its home page\n * and the one page the brief most needs. A product decision, not a figure the\n * wall derives — the wall's proof (`jobs/ai-job-free-site.spec.ts`) shows a\n * plan and a build of this many pages fit the Free taste with room for one\n * retried page.\n */\nexport const AI_SITE_FREE_PAGES = { min: 1, max: 2 } as const\n\n/** The pages a scaffold builds for a workspace on the Free taste or on a paid plan. */\nexport function aiSitePagesBand(\n freeTaste: boolean | null | undefined,\n): { readonly min: number; readonly max: number } {\n return freeTaste ? AI_SITE_FREE_PAGES : AI_SITE_PAGES\n}\n\n/**\n * The job input a guided site start sets so its plan is confirmed for it\n * (AGL-3594); `jobs/ai-job-auto-confirm.ts` says where it is honored.\n */\nexport const AI_JOB_AUTO_CONFIRM_INPUT = 'autoConfirm'\n\n/** What a Free site start's page selector says under it (AGL-3594). */\nexport const AI_SITE_FREE_PAGES_NOTE = 'Paid plans can generate more pages.'\n\n/**\n * The plan's answer ceiling for a scaffold (AGL-3594), Free and paid. A plan\n * is an outline — each page's title, address, search listing and sections by\n * name — and the build steps write everything else, so a scaffold plans with\n * no thinking and at a ceiling sized to the outline of its largest band with\n * room to spare: about 300 tokens a page. The 13,491-token plan a Free site\n * spent 227 of its 300 credits on was its thinking, at the routing table's\n * 8,000 a call.\n */\nexport const AI_SITE_PLAN_MAX_TOKENS = { free: 2_000, paid: 4_000 } as const\n\n/** What each exchange of a Free site job comes to at its worst, in credits. */\nexport interface AiFreeSiteWorstCase {\n /** The site plan: its answer and its one re-ask, each at its ceiling. */\n plan: number\n /** The site's look (AGL-3660): its one answer at its ceiling, on the fast tier. */\n look: number\n /**\n * The layout a site with none has built first (AGL-3660): its header and\n * footer as ONE answer in the layout language, writing its cached prefix,\n * at the most a live frame answer wrote, and never under what the live\n * guided start's layout step metered.\n */\n layout: number\n /** The saved form a guided start makes (AGL-3596), at what the live guided start's form step metered. */\n form: number\n /**\n * A language page's answer before its sections (AGL-3660): its cached\n * prefix written, its turn, and the whole room its ceiling keeps for\n * thinking. A page is ONE answer, not a pass a section.\n */\n page: number\n /** Each planned section's words in that answer, at the most a section is written in. */\n section: number\n /**\n * Room for one page asked again: the answer once more, reading its cached\n * prefix, with its thinking room and a full page of sections.\n */\n retry: number\n /** A page's listing. */\n listing: number\n /**\n * A Free blog's one first post (`AI_SITE_FREE_POSTS`): its answer at the\n * `copy.blog` ceiling writing its cached prefix, and its one re-ask reading\n * it, on the fast tier a Free site's post is written on.\n */\n post: number\n}\n\n/**\n * The Free site start's wall at its worst (AGL-3594, re-derived for the\n * layout language in AGL-3660): the plan and the look as\n * `jobs/ai-job-free-site.spec.ts` derives them from their requests at their\n * ceilings; the layout, form and pages from the language requests as they\n * stand, priced as each field says. The spec fails when a figure it derives\n * moves and this does not.\n */\nexport const AI_FREE_SITE_WORST_CASE_CREDITS: Readonly<AiFreeSiteWorstCase> = {\n // The plan, the look and a listing run on the fast tier, billed at the\n // platform's markup on Claude Haiku 5.5 since AGL-3781 (36, 7 and 3 credits\n // at Haiku 4.5's cost before).\n plan: 5,\n look: 2,\n layout: 23,\n form: 29,\n page: 43,\n section: 4,\n retry: 64,\n listing: 1,\n // On Claude Haiku 5.5 at the platform's markup; the same post on the\n // balanced tier the `copy.blog` row routes to would be 68.\n post: 4,\n}\n\n/**\n * The most sections a Free site plans across its pages (AGL-3660), whatever\n * the wall leaves: a full home of five and a page of two or three. A product\n * figure, so the spend a site EXPECTS stays near what it measured; the wall\n * proves it fits.\n */\nexport const AI_FREE_SITE_MAX_SECTIONS = 8\n\n/** What a Free site start builds before its sections: the layouts it builds first, its forms and its pages. */\nexport interface AiFreeSiteCreations {\n layouts: number\n pages: number\n /** The saved forms it makes; a guided start makes one where it places a form. */\n forms: number\n /** The first posts it writes: a Free blog's one (`AI_SITE_FREE_POSTS`), else none. */\n posts?: number\n}\n\n/** How many first posts a Free blog start writes, on its provider's fast tier. */\nexport const AI_SITE_FREE_POSTS = 1\n\n/** The first posts a Free start of this kind writes: a blog's one, and none for any other kind. */\nexport function aiFreeSitePosts(siteKind: string | null | undefined): number {\n return aiSiteStartContent(siteKind) === 'posts' ? AI_SITE_FREE_POSTS : 0\n}\n\n/** A Free site start's credits at its worst for this many sections, its room for one retried page included. */\nexport function aiFreeSiteWorstCaseCredits(\n creations: AiFreeSiteCreations,\n sections: number,\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const pages = Math.max(1, Math.floor(creations.pages))\n return (\n credits.plan +\n credits.look +\n creations.layouts * credits.layout +\n creations.forms * credits.form +\n pages * (credits.page + credits.listing) +\n sections * credits.section +\n credits.retry +\n Math.max(0, Math.floor(creations.posts ?? 0)) * credits.post\n )\n}\n\n/**\n * The most sections a Free site's plan fits in the Free taste at its worst,\n * across all its pages (AGL-3660): the plan, the look, the layout and form it\n * builds first, each page's answer and listing, ROOM FOR ONE RETRIED PAGE,\n * and as many sections as the rest pays for — at most\n * `AI_FREE_SITE_MAX_SECTIONS`, and at most what the pages hold. None when the\n * rest is already past the wall.\n */\nexport function aiFreeSiteSectionsWithin(\n creations: AiFreeSiteCreations,\n taste: number,\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const pages = Math.max(1, Math.floor(creations.pages))\n const before = aiFreeSiteWorstCaseCredits(creations, 0, credits)\n if (before > taste) return 0\n const paid = credits.section > 0 ? Math.floor((taste - before) / credits.section) : Number.POSITIVE_INFINITY\n return Math.min(AI_FREE_SITE_MAX_SECTIONS, pages * AI_SITE_MAX_SECTIONS, paid)\n}\n\n/**\n * What a Free site start of this many pages can cost at its worst, in\n * credits (AGL-3660): `aiFreeSiteWorstCaseCredits` for an empty site — the\n * plan, its look, the layout and form a guided start builds, a blog's one\n * first post, each page's answer and listing, the sections its plan is held\n * to (`aiFreeSiteSectionsWithin` at the month's whole taste, which is what\n * the plan step allows) and the room for one retried page.\n *\n * The CEILING a start is quoted with (\"up to 283\"), no longer the figure it\n * is admitted on (AGL-3722): that is the measured p90\n * (`aiFreeSiteCreditRange`), and a start past what is left is asked to be\n * confirmed and pauses with Resume when its credits run out, instead of\n * being held back from starting at all.\n */\nexport function aiFreeSiteCreditEstimate(\n pages: number,\n options: { siteKind?: string | null } = {},\n credits: Readonly<AiFreeSiteWorstCase> = AI_FREE_SITE_WORST_CASE_CREDITS,\n): number {\n const creations: AiFreeSiteCreations = {\n layouts: 1,\n forms: 1,\n pages: Math.max(1, Math.floor(pages)),\n posts: aiFreeSitePosts(options.siteKind),\n }\n const sections = aiFreeSiteSectionsWithin(creations, FREE_AI_TASTE_CREDITS_PER_MONTH, credits)\n return aiFreeSiteWorstCaseCredits(creations, sections, credits)\n}\n\n/**\n * What a Free workspace has left of its Free AI credits this month: the less\n * of its own band's balance and its owner's, since the owner's allowance is\n * shared by every Free workspace they hold (AGL-2925) and the reservation\n * refuses at whichever wall is reached first. `resetsOn` is the UTC day the\n * month — and with it both balances — rolls over, `YYYY-MM-DD`.\n */\nexport interface AiFreeCreditsLeft {\n left: number\n total: number\n resetsOn: string\n /**\n * Both meters `left` is the lesser of, in credits net of give-backs, for the\n * usage strip's live read (AGL-3722): the owner's Free allowance across\n * their Free workspaces (`account`, `null` with no owner) and this\n * workspace's band.\n */\n used?: {\n account: number | null\n org: number\n orgBand: number | null\n /** The strip's warn state for these figures, worked out where the strip's own rule is not shipped to the browser. */\n state: 'ok' | 'warn' | 'capped'\n }\n}\n\n/** The first UTC day of the month after `now`, `YYYY-MM-DD`: when the Free credits come back. */\nexport function aiFreeCreditsResetOn(now: Date): string {\n const next = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 1))\n return next.toISOString().slice(0, 10)\n}\n\n/** A reset day as a person reads it: \"November 1\". */\nexport function aiFreeCreditsResetLabel(resetsOn: string): string {\n const at = new Date(`${resetsOn}T00:00:00.000Z`)\n return Number.isFinite(at.getTime())\n ? at.toLocaleDateString('en-US', { month: 'long', day: 'numeric', timeZone: 'UTC' })\n : 'the first of next month'\n}\n\n/**\n * What a Free site start of this many pages is likely to cost, its p90 and\n * its ceiling (AGL-3722), before a plan names its sections: the plan, the\n * look, the layout and form a guided start builds, and each page at the\n * nominal section count, at what each MEASURED in production\n * (`AI_MEASURED_UNIT_CREDITS`); the ceiling is the whole worst case the wall\n * is proven with (`aiFreeSiteCreditEstimate`). Two pages: about 113\n * (p90 203, up to 243). A blog's one first post has no measurement of its\n * own yet, so it is counted at its worst case in all three.\n */\nexport function aiFreeSiteCreditRange(pages: number, options: { siteKind?: string | null } = {}): AiCreditRange {\n const count = Math.max(1, Math.floor(pages))\n const { likely, p90 } = aiSiteStartMeasured(count)\n const posts = aiFreeSitePosts(options.siteKind) * AI_FREE_SITE_WORST_CASE_CREDITS.post\n return aiCreditRangeOrdered({\n likely: likely + posts,\n p90: p90 + posts,\n ceiling: aiFreeSiteCreditEstimate(count, options),\n })\n}\n\n/** A site start's measured likely and p90 before its plan: plan, look, layout, form and its pages at the nominal sections. */\nfunction aiSiteStartMeasured(pages: number): Pick<AiCreditRange, 'likely' | 'p90'> {\n const { plan, theme, layout, form } = AI_MEASURED_UNIT_CREDITS\n const page = aiMeasuredPageCredits(AI_SITE_NOMINAL_SECTIONS)\n return {\n likely: plan.median + theme.median + layout.median + form.median + pages * page.median,\n p90: plan.p90 + theme.p90 + layout.p90 + form.p90 + pages * page.p90,\n }\n}\n\n/** The smaller first build a site start offers: its home page alone. */\nexport const AI_SITE_HOME_FIRST_LABEL = 'Build the home page first'\n\n/**\n * What a Free site start says before it starts when what is left does not\n * cover its p90 (AGL-3722), or `null` when it fits — or when nothing is known\n * about what is left, since the reservation still decides each pass. Not a\n * refusal: the person may build what fits (the job pauses with Resume when\n * the credits run out), build the home page first, or upgrade.\n */\nexport function aiFreeSitePrompt(\n credits: Pick<AiFreeCreditsLeft, 'left' | 'resetsOn'> | null | undefined,\n pages: number,\n options: { siteKind?: string | null } = {},\n): AiCreditsPrompt | null {\n if (!credits || !Number.isFinite(credits.left)) return null\n const count = Math.max(1, Math.floor(pages))\n const home = aiFreeSiteCreditRange(1, options)\n return aiCreditsPromptFor(\n aiFreeSiteCreditRange(count, options),\n credits,\n count > 1 ? { label: AI_SITE_HOME_FIRST_LABEL, ...home } : null,\n )\n}\n\n/**\n * Why a Free start is refused outright (AGL-3722): nothing at all is left,\n * so there is nothing for \"build what fits\" to build.\n */\nexport function aiFreeCreditsNoneLeftText(resetsOn: string): string {\n return (\n `You have no free AI credits left this month. They are shared by all your Free workspaces and ` +\n `renew on ${aiFreeCreditsResetLabel(resetsOn)}. Upgrade this workspace to build with AI now.`\n )\n}\n\n/**\n * The most sections one scaffolded page may hold. The plan model allows more\n * for a page job, which builds one page; a scaffold builds eight, and each\n * section is a pass of its own.\n */\nexport const AI_SITE_MAX_SECTIONS = 8\n\n/**\n * The fewest sections a site start's home page is planned with (AGL-3660).\n * A new site is a full website (Zach, 2026-10-04): its home reads as one — a\n * hero, then bands such as the offer, why us, social proof, and a closing\n * call to action. A plan is an outline and nothing asked for more than a\n * ceiling, so a live Free yoga start (2026-10-07) planned its home with two\n * sections. The plan step names this count in the plan's turn and re-asks a\n * first answer whose home is under it (`aiSiteThinHomeViolations`).\n */\nexport const AI_SITE_HOME_MIN_SECTIONS = 5\n\n/**\n * The blog a guided start writes its first posts into (AGL-3676), and\n * the addresses it may answer at, in order of preference: the first one no\n * planned page takes.\n */\nexport const AI_SITE_BLOG_NAME = 'Blog'\nexport const AI_SITE_BLOG_SLUGS = ['blog', 'posts', 'journal', 'articles', 'writing', 'stories'] as const\n\n/** A planned page's first path segment, lower-cased: `/journal/2026` → `journal`. */\nconst firstSegment = (slug: string) => slug.trim().replace(/^\\/+/, '').split('/')[0].toLowerCase()\n\n/** The address the blog answers at, beside these planned pages: the first of `AI_SITE_BLOG_SLUGS` none of them takes. */\nexport function aiSiteBlogSlug(screens: ReadonlyArray<{ slug: string }>): string {\n const taken = new Set(screens.map((screen) => firstSegment(screen.slug)).filter(Boolean))\n return AI_SITE_BLOG_SLUGS.find((slug) => !taken.has(slug)) ?? AI_SITE_BLOG_SLUGS[0]\n}\n\n/** The header's link to the blog (AGL-3660): a path, not a page, since the blog is the posts collection. */\nexport const AI_SITE_BLOG_NAV_ID = 'aiSiteBlog'\n\n/** The nav entry a site whose start writes posts links its blog by. */\nexport function aiSiteBlogNavPage(screens: ReadonlyArray<{ slug: string }>): {\n id: string\n label: string\n slug: string\n href: string\n} {\n const slug = aiSiteBlogSlug(screens)\n return { id: AI_SITE_BLOG_NAV_ID, label: AI_SITE_BLOG_NAME, slug: `/${slug}`, href: `/${slug}` }\n}\n\n/**\n * Whether a planned page stands in for the blog a start writes (AGL-3660):\n * its address is one of the blog's, or its name says it lists posts. The\n * home page never does.\n */\nexport function aiSiteIsBlogStandIn(screen: { slug: string; title: string }): boolean {\n if (aiSitePlanIsHome(screen)) return false\n return (AI_SITE_BLOG_SLUGS as readonly string[]).includes(firstSegment(screen.slug)) || BLOG_PAGE_WORDS.test(screen.title)\n}\n\n/**\n * A start that writes posts, with its plan's stand-in pages taken out\n * (AGL-3676): the plan step asks once for a plan without one and keeps a\n * second answer that still has one, so the scaffold merges it into the blog\n * instead — the page is not built, its links go to the blog, and the blog\n * takes the address it left free. The kept screens hold their plan index,\n * which a page unit's slot is named by.\n */\nexport function aiSitePlanWithoutBlogStandIns<T extends { slug: string; title: string }>(\n screens: readonly T[],\n): { screens: T[]; standIns: T[] } {\n return {\n screens: screens.filter((screen) => !aiSiteIsBlogStandIn(screen)),\n standIns: screens.filter((screen) => aiSiteIsBlogStandIn(screen)),\n }\n}\n\n/** The code a planned page that stands in for the written blog is re-asked under. */\nexport const AI_SITE_BLOG_PAGE_CODE = 'plan-blog-page-duplicate'\n\n/** A page's name that says it lists the posts. */\nconst BLOG_PAGE_WORDS = /\\b(blog|posts?|articles?|journal|writing|stories|news)\\b/i\n\n/**\n * A site plan's pages that stand in for the blog its start writes (AGL-3660):\n * the live Slow Roads start (2026-10-08) planned an \"Articles\" page of\n * featured cards beside the posts it wrote at /blog, and the header linked\n * Articles and never the blog. A page whose address is one of the blog's, or\n * whose name says it lists posts, duplicates it; the home page never does.\n */\nexport function aiSiteBlogStandInViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const standIns = plan.screens.flatMap((screen, index) => (aiSiteIsBlogStandIn(screen) ? [{ screen, index }] : []))\n if (!standIns.length) return []\n const names = standIns.map(({ screen }) => `\"${screen.title}\" at ${screen.slug}`).join(', ')\n return [\n {\n rule: null,\n code: AI_SITE_BLOG_PAGE_CODE,\n message: `${names} ${standIns.length === 1 ? 'stands' : 'stand'} in for the blog this site already gets: its first posts are written at /blog, and the header links it. Take ${standIns.length === 1 ? 'that page' : 'those pages'} out, and plan another page the brief needs, or feature the posts in a section of the home page.`,\n paths: standIns.map(({ index }) => `screens[${index}]`),\n },\n ]\n}\n\n/** The code a site plan's work section planned without its pieces is re-asked under. */\nexport const AI_SITE_EMPTY_GALLERY_CODE = 'plan-empty-gallery'\n\n/** The pieces a section that shows the work is planned with (AGL-3660). */\nexport const AI_SITE_GALLERY_MIN_ITEMS = 3\nexport const AI_SITE_GALLERY_MAX_ITEMS = 6\n\n/**\n * A planned section that shows the work: a gallery, a portfolio, a\n * collection, selected or featured work. \"Galleries\" — an audience, as in\n * \"Why galleries choose us\" — and \"how we work\" are not.\n */\nconst GALLERY_SECTION =\n /\\b(gallery|portfolio|collections?|lookbook|showcase|works|projects|(?:selected|featured|recent|our|past) (?:work|pieces|projects))\\b/i\n\n/** A section that only opens, introduces or closes a page, whatever page it is on: \"Portfolio Hero\". */\nconst FRAMING_SECTION = /\\b(hero|intro(?:duction)?|banner|header|cta|call to action|contact|inquiry|enquiry|about)\\b/i\n\n/** Whether a planned section's name says it shows the work. */\nexport function aiSiteSectionShowsWork(name: string): boolean {\n return GALLERY_SECTION.test(name) && !FRAMING_SECTION.test(name)\n}\n\n/** The sentence a site plan's turn states about a section that shows the work. */\nexport const AI_SITE_GALLERY_SENTENCE = `A section that shows the work — a gallery, portfolio, collection or selected works — counts its pieces in its items: ${AI_SITE_GALLERY_MIN_ITEMS} to ${AI_SITE_GALLERY_MAX_ITEMS}.`\n\n/**\n * A site plan's sections that show the work with fewer than three pieces\n * (AGL-3660). The live Juniper Clay start (2026-10-08) planned its Portfolio\n * page's \"Works Gallery\" with no items, and the page's works lost their place\n * to an inquiry form: a page about the work showed none.\n */\nexport function aiSiteEmptyGalleryViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const thin = plan.screens.flatMap((screen, screenIndex) =>\n screen.sections.flatMap((section, sectionIndex) =>\n aiSiteSectionShowsWork(section.name) && section.items < AI_SITE_GALLERY_MIN_ITEMS\n ? [{ name: `\"${section.name}\" on ${screen.title}`, path: `screens[${screenIndex}].sections[${sectionIndex}].items` }]\n : [],\n ),\n )\n if (!thin.length) return []\n const names = thin.map((entry) => entry.name).join(', ')\n return [\n {\n rule: null,\n code: AI_SITE_EMPTY_GALLERY_CODE,\n message: `${names} ${thin.length === 1 ? 'shows' : 'show'} the work with fewer than ${AI_SITE_GALLERY_MIN_ITEMS} pieces. Plan ${thin.length === 1 ? 'it' : 'each'} with ${AI_SITE_GALLERY_MIN_ITEMS} to ${AI_SITE_GALLERY_MAX_ITEMS} items, one for each piece it shows.`,\n paths: thin.map((entry) => entry.path),\n },\n ]\n}\n\n/** The violation a site plan whose home page is under its fewest sections is re-asked under. */\nexport const AI_SITE_THIN_HOME_CODE = 'plan-thin-home'\n\n/**\n * What a site plan's home is composed of, in the words the plan's turn and its\n * re-ask both use: a MENU, never an outline (AGL-3899). The hero comes first;\n * the rest is what this business's story needs, in the order the job's arc\n * gives (`model/ai-site-home-arcs.ts`). Told one outline ending \"a closing\n * call to action or contact band last\", 16 of the 22 newest production homes\n * were the same five bands in the same order, and 19 ended on the same call.\n * Its trust band is what working together is like, never testimonials\n * (AGL-3887): a new site has no customer words to show.\n */\nexport const AI_SITE_HOME_BANDS =\n \"a hero first, then the sections this business's story needs, chosen from what it offers, its work, its story, how it works, what working together is like, the questions people ask, where to find it and a call to action, in no fixed order\"\n\n/**\n * The fewest sections this site start's home is held to (AGL-3660): five, or\n * 0 — no minimum — where the Free wall cannot pay for a full home beside the\n * other pages. `across` is the sections the Free taste fits across `pages`\n * pages, each other page keeping at least one; `null` is a paid start, which\n * no wall shares out.\n *\n * ⛔ NEVER a lowered minimum. A Free guided start creates its site empty and\n * plans its layout, and the wall then fits 4 sections across two pages. Told\n * \"a home of at least 3\" beside that, the live yoga start of 2026-10-08\n * planned 4 + 3 and then 4 + 2, was refused for the wall twice, and stopped:\n * a home asked for in bands the wall cannot pay for is a start that fails.\n */\nexport function aiSiteHomeMinSections(input: { pages: number; across: number | null }): number {\n if (input.across === null) return AI_SITE_HOME_MIN_SECTIONS\n const others = Math.max(0, Math.floor(input.pages) - 1)\n return input.across - others >= AI_SITE_HOME_MIN_SECTIONS ? AI_SITE_HOME_MIN_SECTIONS : 0\n}\n\n/**\n * What a site start's plan is told to BUILD with (AGL-3660): the sections are\n * a budget to use, never a ceiling to stay under. Told only \"at most 8\", the\n * live prod start of 2026-10-08 planned a home of two sections, and Zach: \"that\n * didn't mean do as little as possible.\" On the Free taste the sentence shares\n * the wall's sections out — a home of five or six, the other page two or\n * three, about seven or eight in all; a paid start's home is asked to be rich.\n * `min` is the home's fewest (`aiSiteHomeMinSections`), 0 where the plan\n * plans no home or the wall cannot pay for a full one.\n */\nexport function aiSiteFullPlanSentence(input: { pages: number; across: number | null; min: number }): string {\n const { across, min } = input\n if (across === null) {\n return min > 0\n ? `Plan a full website, never a minimal one: a rich home page of ${min + 1} or more sections where the brief gives them, and every page with the sections it needs.`\n : 'Plan a full website, never a minimal one: every page with the sections it needs.'\n }\n const lead = `The ${across} sections are the budget to use, not a ceiling to stay under: plan a full website, never a minimal one`\n const others = Math.max(0, Math.floor(input.pages) - 1)\n if (min <= 0 || across < min) return `${lead}.`\n const homeHi = Math.max(min, Math.min(min + 1, across - others))\n if (!others) return `${lead}: the home page at / with ${min} to ${homeHi} sections.`\n const otherHi = Math.max(1, Math.min(3, Math.floor((across - min) / others)))\n const otherLo = Math.max(1, Math.min(2, otherHi, Math.floor((across - homeHi) / others)))\n const totalLo = Math.max(min + others, across - 1)\n const range = (lo: number, hi: number) => (lo === hi ? `${lo}` : `${lo} to ${hi}`)\n const pagesWord = others === 1 ? 'the other page' : 'each other page'\n return `${lead}: the home page at / with ${range(min, homeHi)} sections, ${pagesWord} ${range(otherLo, otherHi)}, about ${range(totalLo, across)} in total.`\n}\n\n/** Whether a planned page is the site's home: the one at `/`. */\nexport function aiSitePlanIsHome(screen: { slug: string }): boolean {\n const slug = screen.slug.trim()\n return slug === '/' || slug === ''\n}\n\n/**\n * A site plan's home page under its fewest sections (AGL-3660), as the plan\n * step's re-ask names it. A plan with no page at `/` — the owner's own home\n * stays — has no home to hold. `across` is the Free wall's section count, so\n * the re-ask says where the sections come from rather than tripping the wall.\n */\nexport function aiSiteThinHomeViolations(\n plan: Pick<AiBuildPlan, 'screens'>,\n options: { min: number; across: number | null },\n): Array<{ rule: null; code: string; message: string; paths: string[] }> {\n const index = plan.screens.findIndex(aiSitePlanIsHome)\n if (index < 0) return []\n const count = plan.screens[index].sections.length\n if (count >= options.min) return []\n const within =\n options.across === null\n ? ''\n : ` Keep the whole plan within ${options.across} sections: take them from the other page where you must.`\n return [\n {\n rule: null,\n code: AI_SITE_THIN_HOME_CODE,\n message: `The home page has ${count} ${count === 1 ? 'section' : 'sections'}, and a new site's home page reads as a full website with at least ${options.min}: ${AI_SITE_HOME_BANDS}.${within}`,\n paths: [`screens[${index}].sections`],\n },\n ]\n}\n\n/**\n * Sections a page is assumed to hold before a plan names them, for the\n * estimate a member reads when they ask for a scaffold. A declared\n * assumption, not a measurement: the plan's own section counts replace it\n * the moment the plan exists.\n */\nexport const AI_SITE_NOMINAL_SECTIONS = 5\n\n/**\n * The credits one pass is held against: the machine's\n * `AI_JOB_STEP_RESERVE_CREDITS`, declared here so the estimate stays a pure\n * number the console computes without the Admin SDK. `ai-site-job.spec.ts`\n * holds the two equal.\n */\nexport const AI_SITE_PASS_CREDITS = 50\n\n/** The longest a scaffold's scalar inputs may run; they are names, not copy. */\nexport const AI_SITE_INPUT_MAX_CHARS = 120\n\n/** The sites one agency batch may generate for in one request. */\nexport const AI_SITE_BATCH_MAX = 25\n\n/**\n * The sites a plan must hold before the org Sites page offers the batch at\n * all: the Agency and Advanced bands, which the plan's `hostLimit` is what\n * distinguishes.\n */\nexport const AI_SITE_BATCH_MIN_HOST_LIMIT = 25\n\nexport interface AiSiteJobInputs {\n /** What the business is, in a few words: the brief's subject. */\n businessType: string\n /**\n * Who the site is for, in a few words (AGL-2918); empty when nobody said.\n * The plan step puts it in front of the model on a line of its own, as it\n * does every other scalar here, so it narrows the pages a plan proposes\n * without a prompt of its own.\n */\n audience: string\n /**\n * The starter site whose shape the person liked (AGL-2918), by its\n * `STARTER_TEMPLATES` id; empty when they picked none.\n *\n * A hint carried as the id rather than the starter, because an id is what\n * the guided start's list, this door and the plan's line all agree on\n * without any of them loading a catalog of node maps. Unrecognized ids are\n * admitted for the same reason an unrecognized business type is: it is a\n * few words in a brief, not a lookup.\n */\n starter: string\n /**\n * The kind of site the person picked (AGL-3660), by its `AI_SITE_KINDS`\n * id; empty when nobody picked one, and the business type suggests it.\n * It sets the look the site is designed in and how its pages are arranged.\n */\n siteKind: string\n /** How many pages the member asked for. */\n pages: number\n /** The per-site variables an agency batch varies; empty when none was given. */\n businessName: string\n city: string\n brand: string\n /** Whether the scaffold also drafts a welcome email. */\n welcomeEmail: boolean\n /**\n * Where the contact form's submissions go (AGL-2918); `null` where nobody\n * said, which is every job created before the question existed and every\n * door that does not ask it.\n *\n * The one setting a new site owner actually needs made, and the one thing\n * about a contact form a model cannot know: whether a submission is a note\n * to read or a lead to chase is a decision about how the business runs. So\n * an answer BINDS the form step rather than hinting to it, and `null`\n * leaves the model's own proposal standing, exactly as it stood before.\n */\n submissions: AiSiteSubmissions | null\n /** The batch this job was created under (AGL-2911); `null` for a single site. */\n batchId: string | null\n}\n\n/**\n * Where a site's contact form sends what a visitor writes.\n *\n * Two, not three. The form step's own vocabulary has a third — a mailing\n * list — which it can only answer with a note, because the stored routing has\n * no place for a list; offering it as a question would be asking somebody to\n * pick an outcome the platform then explains it cannot store.\n */\nexport const AI_SITE_SUBMISSIONS = ['inbox', 'lead'] as const\n\nexport type AiSiteSubmissions = (typeof AI_SITE_SUBMISSIONS)[number]\n\n/**\n * What each answer to \"where do submissions go\" is called, and what it means.\n *\n * Here rather than beside the guided start's own questions, because it is not\n * only the guided start that asks: the agency batch asks the same thing of a\n * whole run (AGL-2918), and two surfaces wording one decision two ways is two\n * decisions. `ai-site-job.spec.ts` holds the list to {@link AI_SITE_SUBMISSIONS}.\n */\nexport const AI_SITE_SUBMISSION_CHOICES: ReadonlyArray<{\n id: AiSiteSubmissions\n label: string\n blurb: string\n}> = [\n {\n id: 'inbox',\n label: 'The Inbox',\n blurb: 'Every message is one to read and reply to.',\n },\n {\n id: 'lead',\n label: 'The Inbox, and CRM as a lead',\n blurb: 'Every message with an email address is also somebody to follow up.',\n },\n]\n\n/**\n * Which kind of email a scaffold's email unit is (AGL-2918), carried on the\n * derived job as `inputs.emailType`. The email step names the kind on the one\n * line it puts above the brief, and a scaffold was naming none.\n *\n * A key of the email step's own `AI_EMAIL_TYPES`, held here because neither\n * step may import the other: a scaffold delegates by job kind, and a\n * deployment that scaffolds is not necessarily one that has loaded the email\n * step. `ai-job-email-step.spec.ts` holds this key to that catalog.\n *\n * `reply` and not `welcome`. The five kinds a member picks are campaigns\n * somebody sends to an audience, and this is an answer to one person who\n * wrote in through the site; the nearest, `welcome`, is a label about signing\n * up, and a kind that misdescribes the email is worse than an absent one\n * because it is the first thing the model is told.\n */\nexport const AI_SITE_EMAIL_TYPE = 'reply'\n\n/**\n * What a site job's plan and every unit it builds are told about the\n * business's name (AGL-3596): that it is the name, used as written. Said on\n * the job's own turn, never in a cached system block, because it is one\n * site's. A model handed only what the business does named it itself —\n * \"Hillside Dog Grooming\" was built as \"Austin Paws Grooming\".\n */\nexport function aiSiteNameSentence(name: string): string {\n return `The business is named “${name}”: the site names it exactly that way, in the header, the footer, the copy and the search listing, and never by any other name.`\n}\n\n/** Where a job's inputs say submissions go, or `null` where they do not say. */\nexport function aiSiteSubmissions(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteSubmissions | null {\n const value = inputs?.['submissions']\n return (AI_SITE_SUBMISSIONS as readonly unknown[]).includes(value)\n ? (value as AiSiteSubmissions)\n : null\n}\n\nconst ID_CHARS = /^[A-Za-z0-9_-]{1,64}$/\n\n/** A scaffold's inputs, or the sentence the door refuses them with. */\nexport function parseAiSiteJobInputs(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteJobInputs | string {\n const text = (key: string): string | null => {\n const value = inputs?.[key]\n if (value === undefined || value === null || value === '') return ''\n if (typeof value !== 'string') return null\n const trimmed = value.trim()\n return trimmed.length > AI_SITE_INPUT_MAX_CHARS ? null : trimmed\n }\n const businessType = text('businessType')\n if (businessType === null) {\n return `businessType must be text under ${AI_SITE_INPUT_MAX_CHARS} characters`\n }\n if (!businessType) return 'Say what kind of business the site is for'\n const businessName = text('businessName')\n const city = text('city')\n const brand = text('brand')\n const audience = text('audience')\n const starter = text('starter')\n // A kind this deployment does not know is nobody having picked one.\n const siteKind = aiSiteKind(inputs?.['siteKind'])?.id ?? ''\n for (const [key, value] of [\n ['businessName', businessName],\n ['city', city],\n ['brand', brand],\n ['audience', audience],\n ['starter', starter],\n ] as const) {\n if (value === null)\n return `${key} must be text under ${AI_SITE_INPUT_MAX_CHARS} characters`\n }\n const rawPages = inputs?.['pages']\n const pages =\n typeof rawPages === 'number' ? rawPages : Number(rawPages ?? NaN)\n // Read here across both bands; the door holds a workspace to its own\n // (`aiSitePagesRefusal`), since only it knows the workspace's plan.\n if (\n !Number.isInteger(pages) ||\n pages < AI_SITE_FREE_PAGES.min ||\n pages > AI_SITE_PAGES.max\n ) {\n return `pages must be a whole number from ${AI_SITE_FREE_PAGES.min} to ${AI_SITE_PAGES.max}`\n }\n // Where submissions go is admitted only as one of the two the form step\n // can actually bind; anything else is nobody having said, and the model\n // proposes as it always did rather than the door refusing the whole job.\n const submissions = aiSiteSubmissions(inputs)\n const rawBatch = inputs?.['batchId']\n const batchId =\n rawBatch === undefined || rawBatch === null || rawBatch === ''\n ? null\n : typeof rawBatch === 'string' && ID_CHARS.test(rawBatch)\n ? rawBatch\n : undefined\n if (batchId === undefined) return 'batchId is not a batch id'\n return {\n businessType,\n audience: audience as string,\n starter: starter as string,\n siteKind,\n pages,\n businessName: businessName as string,\n city: city as string,\n brand: brand as string,\n welcomeEmail: inputs?.['welcomeEmail'] !== false,\n submissions,\n batchId,\n }\n}\n\n/**\n * Why a workspace cannot ask for this many pages (AGL-3594), in a sentence a\n * member reads; `null` when it can. A Free workspace builds one or two, and a\n * paid one four to eight, as it always has. Refused rather than clamped: the\n * guided start offers only the band, so a request outside it was not made\n * there, and a job quietly building fewer pages than it was asked for is a\n * worse answer than a sentence saying why.\n */\nexport function aiSitePagesRefusal(pages: number, freeTaste: boolean | null | undefined): string | null {\n const band = aiSitePagesBand(freeTaste)\n if (pages >= band.min && pages <= band.max) return null\n return freeTaste\n ? `A Free workspace's AI site start builds ${AI_SITE_FREE_PAGES.min} or ${AI_SITE_FREE_PAGES.max} pages. ${AI_SITE_FREE_PAGES_NOTE}`\n : `A site is planned with ${band.min} to ${band.max} pages.`\n}\n\n/**\n * What the site itself is, as a step that is NOT the scaffold reads it off a\n * job's inputs (AGL-2918).\n *\n * A scaffold delegates unit by unit under a job derived from its own — a page\n * job, a form job — and the derived job carries the scaffold's inputs. So the\n * two answers that describe the site rather than one record of it are\n * readable by every delegated step, and a step that wants them does not have\n * to know it was delegated to.\n *\n * Lenient where {@link parseAiSiteJobInputs} is strict, because it reads the\n * inputs of jobs that are not scaffolds: a page job started from the Screens\n * page has no `businessType` and no `pages`, and that is not an error here —\n * it is a site nobody described, and the answer is two empty strings.\n */\nexport interface AiSiteWords {\n /** What kind of site it is; empty when the job's inputs do not say. */\n about: string\n /** Who it is for; empty when the job's inputs do not say. */\n audience: string\n}\n\n/** Whether either half of {@link AiSiteWords} says anything. */\nexport function aiSiteWordsSaidAnything(words: AiSiteWords): boolean {\n return Boolean(words.about || words.audience)\n}\n\n/** What a job's inputs say the site is, read defensively and trimmed to the input ceiling. */\nexport function aiSiteWords(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiSiteWords {\n const read = (key: string): string => {\n const value = inputs?.[key]\n if (typeof value !== 'string') return ''\n return value.replace(/\\s+/g, ' ').trim().slice(0, AI_SITE_INPUT_MAX_CHARS).trim()\n }\n return { about: read('businessType'), audience: read('audience') }\n}\n\n/**\n * What a scaffold builds for itself: the layout its pages render inside, the\n * form they place, the palette suggestion a member applies in the Theme\n * section, and the datasets its structured content is kept in (AGL-3616),\n * which the data plugin writes. Anything else a plan asks to create is a job\n * of its own.\n */\nexport const AI_SITE_CREATE_KINDS: readonly AiBuildPlanCreateKind[] = [\n 'layout',\n 'form',\n 'theme-change',\n 'dataset',\n]\n\n/** The most datasets one site start creates (AGL-3616). */\nexport const AI_SITE_DATASETS_MAX = 3\n\n/** The creations a scaffold cannot build, in the order the plan lists them, each named once. */\nexport function aiSitePlanPrerequisites(\n plan: AiBuildPlan,\n): Array<{ kind: AiBuildPlanCreateKind; name: string }> {\n const seen = new Set<string>()\n const prerequisites: Array<{ kind: AiBuildPlanCreateKind; name: string }> = []\n const add = (kind: AiBuildPlanCreateKind, name: string) => {\n const key = `${kind}:${name.toLowerCase()}`\n if (seen.has(key)) return\n seen.add(key)\n prerequisites.push({ kind, name })\n }\n for (const entry of plan.create) {\n if (!AI_SITE_CREATE_KINDS.includes(entry.kind)) add(entry.kind, entry.name)\n }\n // A reference the create list does not carry is refused by the plan rules\n // before a plan is kept: rule 2 for a screen's layout, rule 7 for anything\n // else (`plan-creation-undeclared`, AGL-3040). A plan confirmed before that\n // rule existed can still carry one. It is named as a component: the\n // reference carries no kind, and the refusal must say where one is made.\n for (const { name } of aiPlanUndeclaredRefs(plan)) add('component', name)\n return prerequisites\n}\n\n/**\n * Why a scaffold cannot build a plan of this SHAPE — the page band, a page's\n * sections, its addresses, its navigation — in a sentence a member reads;\n * `null` when the shape is one it builds. The plan step holds a plan to it\n * with a re-ask (AGL-3030), and the doors hold a confirmed plan to it again\n * through `aiSitePlanRefusal`.\n */\nexport function aiSitePlanShapeRefusal(\n plan: AiBuildPlan,\n options: { freeTaste?: boolean } = {},\n): string | null {\n const { screens } = plan\n const band = aiSitePagesBand(options.freeTaste)\n if (screens.length < band.min || screens.length > band.max) {\n return `This plan builds ${screens.length} ${screens.length === 1 ? 'page' : 'pages'}, and ${\n options.freeTaste ? \"a Free workspace's site scaffold\" : 'a site scaffold'\n } builds ${band.min} to ${band.max}. Describe the site again.`\n }\n const slugs = new Set<string>()\n for (const screen of screens) {\n if (!screen.sections.length) {\n return `The page “${screen.title}” has no sections to build. Describe the site again.`\n }\n if (screen.sections.length > AI_SITE_MAX_SECTIONS) {\n return `The page “${screen.title}” has ${screen.sections.length} sections, and a scaffolded page holds ${AI_SITE_MAX_SECTIONS}. Describe the site again.`\n }\n const slug = screen.slug.trim().toLowerCase()\n if (slugs.has(slug)) {\n return `Two pages in this plan share the address ${screen.slug}. Describe the site again.`\n }\n slugs.add(slug)\n }\n if (!screens.some((screen) => screen.nav)) {\n return 'No page in this plan is in the site navigation. Describe the site again.'\n }\n const datasets = plan.create.filter((entry) => entry.kind === 'dataset').length\n if (datasets > AI_SITE_DATASETS_MAX) {\n return `This plan creates ${datasets} datasets, and a site scaffold creates at most ${AI_SITE_DATASETS_MAX}. Keep the others' items on their pages.`\n }\n return null\n}\n\n/**\n * Why a scaffold cannot build this plan, in a sentence a member reads when\n * confirming it; `null` when it can.\n */\nexport function aiSitePlanRefusal(\n plan: AiBuildPlan,\n options: { freeTaste?: boolean } = {},\n): string | null {\n const shape = aiSitePlanShapeRefusal(plan, options)\n if (shape) return shape\n const prerequisites = aiSitePlanPrerequisites(plan)\n if (!prerequisites.length) return null\n const parts = prerequisites.map(\n ({ kind, name }) =>\n `the ${AI_BUILD_PLAN_CREATION_NOUNS[kind].noun} “${name}” ${AI_BUILD_PLAN_CREATION_NOUNS[kind].where}`,\n )\n const listed =\n parts.length === 1\n ? parts[0]\n : `${parts.slice(0, -1).join(', ')} and ${parts[parts.length - 1]}`\n return `This site needs what the workspace does not have yet. Create ${listed}, then describe the site again.`\n}\n\n/** What the estimate counts a plan in: whether a welcome email follows, and the creations the job builds. */\nexport interface AiPlanPassOptions {\n welcomeEmail?: boolean\n /** The creation kinds the job builds itself; a scaffold's when absent. */\n creates?: readonly AiBuildPlanCreateKind[]\n /** Each page and creation written on its own (`aiStandaloneScreenCreditRange`), not as a site start’s (AGL-3722). */\n standalonePages?: boolean\n}\n\n/**\n * Whether a creation is built with no model: a dataset a form of the plan\n * writes to (AGL-3616) starts empty, designed from its planned fields, so it\n * is no pass of the estimate.\n */\nfunction aiPlanCreationIsModelFree(plan: Pick<AiBuildPlan, 'create'>, entry: AiBuildPlan['create'][number]): boolean {\n return entry.kind === 'dataset' && aiPlanFormDatasetNames(plan).has(entry.name.trim().toLowerCase())\n}\n\n/**\n * The passes a plan implies: one per section of every screen, one more per\n * screen for its search listing and its draft, and one for each thing the\n * plan creates that the job builds. What the estimate is counted in.\n */\nexport function aiPlanPasses(plan: AiBuildPlan, options: AiPlanPassOptions = {}): number {\n const screens = plan.screens.reduce(\n (total, screen) => total + screen.sections.length + 1,\n 0,\n )\n const creates = options.creates ?? AI_SITE_CREATE_KINDS\n const creations = plan.create.filter((entry) => creates.includes(entry.kind) && !aiPlanCreationIsModelFree(plan, entry)).length\n return screens + creations + (options.welcomeEmail ? 1 : 0)\n}\n\n/**\n * About what a plan costs to build, in credits. An ESTIMATE: the nominal\n * credits the machine holds per step, times the passes the plan implies.\n * What each pass actually costs is its model's tokens, recorded on the job\n * as it runs.\n */\nexport function aiPlanCreditEstimate(plan: AiBuildPlan, options: AiPlanPassOptions = {}): number {\n return aiPlanPasses(plan, options) * AI_SITE_PASS_CREDITS\n}\n\n/**\n * About what a job of this kind costs to build from its plan (AGL-3031): a\n * page job counts the layout, forms and components it builds before its\n * page; a template, layout, component, form or email job counts its own\n * record and every creation it builds before it (AGL-3143 §15); and a\n * scaffold counts what it builds. The figure the proposal shows beside\n * Confirm, and the hold a confirmation takes.\n */\nexport function aiJobPlanCreditEstimate(kind: string, plan: AiBuildPlan): number {\n const creates =\n kind === 'page' ? AI_PAGE_CREATE_KINDS : AI_JOB_CREATE_KINDS[kind as keyof typeof AI_JOB_CREATE_KINDS]\n return aiPlanCreditEstimate(plan, creates ? { creates } : {})\n}\n\n/**\n * About what a scaffold of this many pages costs, before a plan names its\n * sections: the same arithmetic on the nominal section count, plus the plan\n * step that proposes it. Shown where a member asks for a scaffold.\n */\nexport function aiSiteCreditEstimate(\n pages: number,\n options: { welcomeEmail?: boolean; siteKind?: string | null } = {},\n): number {\n const screens = Math.max(0, Math.floor(pages))\n const content = aiSiteStartContent(options.siteKind)\n const passes =\n 1 +\n screens * (AI_SITE_NOMINAL_SECTIONS + 1) +\n 2 +\n (options.welcomeEmail ? 1 : 0) +\n (content === 'products' ? 1 : content === 'posts' ? AI_SITE_START_POSTS : 0)\n return passes * AI_SITE_PASS_CREDITS\n}\n\n/** How many first posts a paid blog start writes, one pass each (`AI_SITE_POSTS`, held equal by `ai-site-job.spec.ts`); a Free one writes `AI_SITE_FREE_POSTS`. */\nexport const AI_SITE_START_POSTS = 3\n\n/**\n * The first content a paid start of this kind writes (AGL-3676): a store's\n * first products, a blog's first posts, or nothing. `aiSiteContentPart`'s\n * answer for a paid start, by the kind's id; a Free start writes a blog its\n * one first post (`aiFreeSitePosts`) and a store nothing.\n */\nexport function aiSiteStartContent(siteKind: string | null | undefined): 'posts' | 'products' | null {\n if (siteKind === 'store') return 'products'\n if (siteKind === 'blog') return 'posts'\n return null\n}\n\n/**\n * The measured cost of one creation a plan builds (AGL-3722): a layout's or\n * a form's as measured, a theme's as the site start's look measured, and\n * any other kind at the stand-in a single-answer creation is priced at.\n * `standalone` for one written on its own — a build's, a page job's — rather\n * than inside a site start's warm run.\n */\nexport function aiCreationMeasuredCredits(kind: string, options: { standalone?: boolean } = {}): AiMeasuredCredits {\n if (kind === 'layout') {\n return options.standalone ? AI_MEASURED_STANDALONE_CREATION_CREDITS.layout : AI_MEASURED_UNIT_CREDITS.layout\n }\n if (kind === 'form') return AI_MEASURED_UNIT_CREDITS.form\n if (kind === 'theme' || kind === 'theme-change') return AI_MEASURED_UNIT_CREDITS.theme\n return AI_MEASURED_PASS_CREDITS\n}\n\n/** A planned page's range: its sections scaled around the measured page, its ceiling one pass a section and one for its listing. */\nexport function aiScreenCreditRange(sections: number): AiCreditRange {\n return aiCreditRangeOf(aiMeasuredPageCredits(sections), (Math.max(0, sections) + 1) * AI_SITE_PASS_CREDITS)\n}\n\n/**\n * A page written on its own — an Assist build's, a page job's — as a range\n * (AGL-3722): a fixed cost and one per section as such pages measured\n * (`AI_MEASURED_STANDALONE_PAGE`), never a site start's later, cheaper\n * pages; the ceiling as `aiScreenCreditRange`'s.\n */\nexport function aiStandaloneScreenCreditRange(sections: number): AiCreditRange {\n return aiCreditRangeOf(\n aiMeasuredStandalonePageCredits(sections),\n (Math.max(0, sections) + 1) * AI_SITE_PASS_CREDITS,\n )\n}\n\n/**\n * What a plan is likely to cost, its p90 and its ceiling (AGL-3722): the\n * same units `aiPlanCreditEstimate` counts, each at what it measured; the\n * ceiling IS `aiPlanCreditEstimate`.\n */\nexport function aiPlanCreditRange(plan: AiBuildPlan, options: AiPlanPassOptions = {}): AiCreditRange {\n const creates = options.creates ?? AI_SITE_CREATE_KINDS\n let range = AI_CREDIT_RANGE_ZERO\n const screenRange = options.standalonePages ? aiStandaloneScreenCreditRange : aiScreenCreditRange\n for (const screen of plan.screens) range = aiCreditRangeAdd(range, screenRange(screen.sections.length))\n for (const entry of plan.create) {\n if (!creates.includes(entry.kind) || aiPlanCreationIsModelFree(plan, entry)) continue\n range = aiCreditRangeAdd(\n range,\n aiCreditRangeOf(aiCreationMeasuredCredits(entry.kind, { standalone: options.standalonePages }), AI_SITE_PASS_CREDITS),\n )\n }\n if (options.welcomeEmail) range = aiCreditRangeAdd(range, aiCreditRangeOf(AI_MEASURED_PASS_CREDITS, AI_SITE_PASS_CREDITS))\n return aiCreditRangeOrdered(range)\n}\n\n/**\n * `aiJobPlanCreditEstimate` as a range (AGL-3722): the same kinds, each at\n * what it measured. Only a site start writes its pages in one warm run; every\n * other kind's page is written on its own.\n */\nexport function aiJobPlanCreditRange(kind: string, plan: AiBuildPlan): AiCreditRange {\n const creates =\n kind === 'page' ? AI_PAGE_CREATE_KINDS : AI_JOB_CREATE_KINDS[kind as keyof typeof AI_JOB_CREATE_KINDS]\n return aiPlanCreditRange(plan, { ...(creates ? { creates } : {}), standalonePages: kind !== 'site' })\n}\n\n/**\n * A paid site start's range before its plan (AGL-3722): the plan, its look,\n * layout and form, and each page at the nominal sections, as measured; the\n * ceiling is `aiSiteCreditEstimate`.\n */\nexport function aiSiteCreditRange(\n pages: number,\n options: { welcomeEmail?: boolean; siteKind?: string | null } = {},\n): AiCreditRange {\n const count = Math.max(0, Math.floor(pages))\n // A paid start plans and writes on the paid routing, measured apart (AGL-3739).\n const { plan, theme, layout, form, page, email, products } = AI_MEASURED_PAID_SITE_CREDITS\n const content = aiSiteStartContent(options.siteKind)\n // A blog's posts have no measurement of their own yet: the stand-in pass.\n const parts: AiMeasuredCredits[] = [\n plan,\n theme,\n layout,\n form,\n ...Array.from({ length: count }, () => page),\n ...(options.welcomeEmail ? [email] : []),\n ...(content === 'products' ? [products] : content === 'posts' ? [AI_MEASURED_PASS_CREDITS] : []),\n ]\n return aiCreditRangeOrdered({\n likely: parts.reduce((total, part) => total + part.median, 0),\n p90: parts.reduce((total, part) => total + part.p90, 0),\n ceiling: aiSiteCreditEstimate(count, options),\n })\n}\n"],"names":["aiSiteKind","AI_BUILD_PLAN_CREATION_NOUNS","aiPlanFormDatasetNames","aiPlanUndeclaredRefs","AI_JOB_CREATE_KINDS","AI_PAGE_CREATE_KINDS","FREE_AI_TASTE_CREDITS_PER_MONTH","AI_CREDIT_RANGE_ZERO","AI_MEASURED_PAID_SITE_CREDITS","AI_MEASURED_PASS_CREDITS","AI_MEASURED_STANDALONE_CREATION_CREDITS","AI_MEASURED_UNIT_CREDITS","aiCreditRangeAdd","aiCreditRangeOf","aiCreditRangeOrdered","aiCreditsPromptFor","aiMeasuredPageCredits","aiMeasuredStandalonePageCredits","AI_SITE_PAGES","min","max","AI_SITE_FREE_PAGES","aiSitePagesBand","freeTaste","AI_JOB_AUTO_CONFIRM_INPUT","AI_SITE_FREE_PAGES_NOTE","AI_SITE_PLAN_MAX_TOKENS","free","paid","AI_FREE_SITE_WORST_CASE_CREDITS","plan","look","layout","form","page","section","retry","listing","post","AI_FREE_SITE_MAX_SECTIONS","AI_SITE_FREE_POSTS","aiFreeSitePosts","siteKind","aiSiteStartContent","aiFreeSiteWorstCaseCredits","creations","sections","credits","pages","Math","floor","layouts","forms","posts","aiFreeSiteSectionsWithin","taste","before","Number","POSITIVE_INFINITY","AI_SITE_MAX_SECTIONS","aiFreeSiteCreditEstimate","options","aiFreeCreditsResetOn","now","next","Date","UTC","getUTCFullYear","getUTCMonth","toISOString","slice","aiFreeCreditsResetLabel","resetsOn","at","isFinite","getTime","toLocaleDateString","month","day","timeZone","aiFreeSiteCreditRange","count","likely","p90","aiSiteStartMeasured","ceiling","theme","AI_SITE_NOMINAL_SECTIONS","median","AI_SITE_HOME_FIRST_LABEL","aiFreeSitePrompt","left","home","label","aiFreeCreditsNoneLeftText","AI_SITE_HOME_MIN_SECTIONS","AI_SITE_BLOG_NAME","AI_SITE_BLOG_SLUGS","firstSegment","slug","trim","replace","split","toLowerCase","aiSiteBlogSlug","screens","taken","Set","map","screen","filter","Boolean","find","has","AI_SITE_BLOG_NAV_ID","aiSiteBlogNavPage","id","href","aiSiteIsBlogStandIn","aiSitePlanIsHome","includes","BLOG_PAGE_WORDS","test","title","aiSitePlanWithoutBlogStandIns","standIns","AI_SITE_BLOG_PAGE_CODE","aiSiteBlogStandInViolations","flatMap","index","length","names","join","rule","code","message","paths","AI_SITE_EMPTY_GALLERY_CODE","AI_SITE_GALLERY_MIN_ITEMS","AI_SITE_GALLERY_MAX_ITEMS","GALLERY_SECTION","FRAMING_SECTION","aiSiteSectionShowsWork","name","AI_SITE_GALLERY_SENTENCE","aiSiteEmptyGalleryViolations","thin","screenIndex","sectionIndex","items","path","entry","AI_SITE_THIN_HOME_CODE","AI_SITE_HOME_BANDS","aiSiteHomeMinSections","input","across","others","aiSiteFullPlanSentence","lead","homeHi","otherHi","otherLo","totalLo","range","lo","hi","pagesWord","aiSiteThinHomeViolations","findIndex","within","AI_SITE_PASS_CREDITS","AI_SITE_INPUT_MAX_CHARS","AI_SITE_BATCH_MAX","AI_SITE_BATCH_MIN_HOST_LIMIT","AI_SITE_SUBMISSIONS","AI_SITE_SUBMISSION_CHOICES","blurb","AI_SITE_EMAIL_TYPE","aiSiteNameSentence","aiSiteSubmissions","inputs","value","ID_CHARS","parseAiSiteJobInputs","text","key","undefined","trimmed","businessType","businessName","city","brand","audience","starter","rawPages","NaN","isInteger","submissions","rawBatch","batchId","welcomeEmail","aiSitePagesRefusal","band","aiSiteWordsSaidAnything","words","about","aiSiteWords","read","AI_SITE_CREATE_KINDS","AI_SITE_DATASETS_MAX","aiSitePlanPrerequisites","seen","prerequisites","add","kind","push","create","aiSitePlanShapeRefusal","slugs","some","nav","datasets","aiSitePlanRefusal","shape","parts","noun","where","listed","aiPlanCreationIsModelFree","aiPlanPasses","reduce","total","creates","aiPlanCreditEstimate","aiJobPlanCreditEstimate","aiSiteCreditEstimate","content","passes","AI_SITE_START_POSTS","aiCreationMeasuredCredits","standalone","aiScreenCreditRange","aiStandaloneScreenCreditRange","aiPlanCreditRange","screenRange","standalonePages","aiJobPlanCreditRange","aiSiteCreditRange","email","products","Array","from","part"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,UAAU,QAAQ,qBAAiB;AAC5C,SACEC,4BAA4B,EAC5BC,sBAAsB,EACtBC,oBAAoB,QAGf,qBAAiB;AACxB,SAASC,mBAAmB,QAAQ,wBAAoB;AACxD,SAASC,oBAAoB,QAAQ,mBAAe;AACpD,SAASC,+BAA+B,QAAQ,0BAAsB;AACtE,SACEC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,uCAAuC,EACvCC,wBAAwB,EACxBC,gBAAgB,EAChBC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,qBAAqB,EACrBC,+BAA+B,QAI1B,0BAAsB;AAE7B;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GAED,+EAA+E,GAC/E,OAAO,MAAMC,gBAAgB;IAAEC,KAAK;IAAGC,KAAK;AAAE,EAAU;AAExD;;;;;;CAMC,GACD,OAAO,MAAMC,qBAAqB;IAAEF,KAAK;IAAGC,KAAK;AAAE,EAAU;AAE7D,qFAAqF,GACrF,OAAO,SAASE,gBACdC,SAAqC;IAErC,OAAOA,YAAYF,qBAAqBH;AAC1C;AAEA;;;CAGC,GACD,OAAO,MAAMM,4BAA4B,cAAa;AAEtD,qEAAqE,GACrE,OAAO,MAAMC,0BAA0B,sCAAqC;AAE5E;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B;IAAEC,MAAM;IAAOC,MAAM;AAAM,EAAU;AAwC5E;;;;;;;CAOC,GACD,OAAO,MAAMC,kCAAiE;IAC5E,uEAAuE;IACvE,4EAA4E;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MuL,QAA6B;QACjCnM;QACAwD;QACAtD;QACAC;WACG0N,MAAMC,IAAI,CAAC;YAAE1H,QAAQjD;QAAM,GAAG,IAAM/C;WACnC2B,QAAQ4I,YAAY,GAAG;YAACgD;SAAM,GAAG,EAAE;WACnCZ,YAAY,aAAa;YAACa;SAAS,GAAGb,YAAY,UAAU;YAACpO;SAAyB,GAAG,EAAE;KAChG;IACD,OAAOK,qBAAqB;QAC1BoE,QAAQ+I,MAAMM,MAAM,CAAC,CAACC,OAAOqB,OAASrB,QAAQqB,KAAKrK,MAAM,EAAE;QAC3DL,KAAK8I,MAAMM,MAAM,CAAC,CAACC,OAAOqB,OAASrB,QAAQqB,KAAK1K,GAAG,EAAE;QACrDE,SAASuJ,qBAAqB3J,OAAOpB;IACvC;AACF"}
|
|
@@ -639,7 +639,7 @@ const ALL_HUES = [
|
|
|
639
639
|
headingScale: 1,
|
|
640
640
|
density: 'regular'
|
|
641
641
|
},
|
|
642
|
-
design: '
|
|
642
|
+
design: 'Clear and confident: say plainly what the business does and for whom, draw what it offers as cards or a ruled list, and let a photo carry a section that describes the place or the work. Mix plain and soft bands with one brand band where the page most needs it.',
|
|
643
643
|
pages: 'Home, Services, About and Contact are typical; a pricing or booking page where the brief asks for one.'
|
|
644
644
|
},
|
|
645
645
|
{
|
|
@@ -769,7 +769,7 @@ const ALL_HUES = [
|
|
|
769
769
|
headingScale: 1.05,
|
|
770
770
|
density: 'compact'
|
|
771
771
|
},
|
|
772
|
-
design: 'Direct and high-contrast: a big promise and a call-to-action button in the first section,
|
|
772
|
+
design: 'Direct and high-contrast: a big promise and a call-to-action button in the first section, services as a tight grid, trust only as the brief gives it (licensed, insured, years, guarantees), and short, practical copy. Use a dark band and a brand band.',
|
|
773
773
|
pages: 'Home, Services, About or Why us, and a Quote or Contact page with the form.'
|
|
774
774
|
},
|
|
775
775
|
{
|
|
@@ -857,7 +857,7 @@ const ALL_HUES = [
|
|
|
857
857
|
headingScale: 0.95,
|
|
858
858
|
density: 'airy'
|
|
859
859
|
},
|
|
860
|
-
design: 'Measured and credible: generous space,
|
|
860
|
+
design: 'Measured and credible: generous space, calm statements, practice areas with short plain explanations, and an unhurried tone with no hard sell. Prefer plain and soft bands, at most one dark band.',
|
|
861
861
|
pages: 'Home, Practice areas or Services, About or Our team, and Contact with a consultation form.'
|
|
862
862
|
},
|
|
863
863
|
{
|
|
@@ -966,7 +966,7 @@ const ALL_HUES = [
|
|
|
966
966
|
headingScale: 1,
|
|
967
967
|
density: 'airy'
|
|
968
968
|
},
|
|
969
|
-
design: 'Reassuring and gentle:
|
|
969
|
+
design: 'Reassuring and gentle: warm words that name who it helps, soft cards, answers in plain language, and a low-pressure tone in every call to action. Prefer soft bands, avoid dark ones.',
|
|
970
970
|
pages: 'Home, Services or Approach, About, and Book or Contact with the form.'
|
|
971
971
|
},
|
|
972
972
|
{
|
|
@@ -1075,7 +1075,7 @@ const ALL_HUES = [
|
|
|
1075
1075
|
headingScale: 1.1,
|
|
1076
1076
|
density: 'regular'
|
|
1077
1077
|
},
|
|
1078
|
-
design: 'Photo-led and inviting:
|
|
1078
|
+
design: 'Photo-led and inviting: large images of the food and the room, the menu as lines rather than cards where it fits, and warm, sensory copy. Use images generously and a warm brand band.',
|
|
1079
1079
|
pages: 'Home, Menu, About or Our story, and Visit or Reserve with the form.'
|
|
1080
1080
|
},
|
|
1081
1081
|
{
|
|
@@ -1156,8 +1156,8 @@ const ALL_HUES = [
|
|
|
1156
1156
|
headingScale: 1,
|
|
1157
1157
|
density: 'regular'
|
|
1158
1158
|
},
|
|
1159
|
-
design: 'A storefront, like a designer shop theme: a hero that sells, its picture the product itself and its first button Shop all; the bestsellers, which the platform lists with their photos, prices and add to cart; the range by collection as picture tiles; the brand story beside a photo; why buy here as three or four short items each with an icon (shipping, small batch, returns, only as the brief gives them); the store\'s customer reviews, which the platform shows once shoppers leave them; and a newsletter sign-up
|
|
1160
|
-
pages: 'Home as a storefront: a hero, then sections named "Bestsellers", "Shop by collection" (3 or 4 items), the story, why buy here (3 or 4 items)
|
|
1159
|
+
design: 'A storefront, like a designer shop theme: a hero that sells, its picture the product itself and its first button Shop all; the bestsellers, which the platform lists with their photos, prices and add to cart; the range by collection as picture tiles; the brand story beside a photo; why buy here as three or four short items each with an icon (shipping, small batch, returns, only as the brief gives them); the store\'s customer reviews, which the platform shows once shoppers leave them; and a newsletter sign-up. Keep copy short and let images lead; never draw the products themselves as cards of your own, and never a band of text alone.',
|
|
1160
|
+
pages: 'Home as a storefront: a hero, then sections named "Bestsellers", "Shop by collection" (3 or 4 items), the story, why buy here (3 or 4 items) and "Customer reviews", in the order given above, with "Newsletter sign-up" last. Shop at /shop: a short title section, then "Product grid" second (the platform lists the real products there, with sort, filters, photos, prices and the cart). About, and Contact. Plan no checkout or cart page.'
|
|
1161
1161
|
},
|
|
1162
1162
|
{
|
|
1163
1163
|
id: 'portfolio',
|
|
@@ -1228,7 +1228,7 @@ const ALL_HUES = [
|
|
|
1228
1228
|
headingScale: 1.3,
|
|
1229
1229
|
density: 'airy'
|
|
1230
1230
|
},
|
|
1231
|
-
design: 'Minimal and image-led: a large, short statement as the title,
|
|
1231
|
+
design: 'Minimal and image-led: a large, short statement as the title, the work as image cards with one-line captions, and very few words elsewhere. Mostly plain bands, lots of space, big type, one accent color.',
|
|
1232
1232
|
pages: 'Home with selected work, Work or Projects, About, and Contact.'
|
|
1233
1233
|
},
|
|
1234
1234
|
{
|
|
@@ -1302,7 +1302,7 @@ const ALL_HUES = [
|
|
|
1302
1302
|
headingScale: 1.3,
|
|
1303
1303
|
density: 'airy'
|
|
1304
1304
|
},
|
|
1305
|
-
design: 'Confident and editorial:
|
|
1305
|
+
design: 'Confident and editorial: oversized statements, case studies as large image cards with the outcome in a line, services as a short list, and a bold dark band where the page needs weight.',
|
|
1306
1306
|
pages: 'Home, Work or Case studies, Services, About, and Contact or Start a project.'
|
|
1307
1307
|
},
|
|
1308
1308
|
{
|
|
@@ -1356,7 +1356,7 @@ const ALL_HUES = [
|
|
|
1356
1356
|
headingScale: 1.2,
|
|
1357
1357
|
density: 'airy'
|
|
1358
1358
|
},
|
|
1359
|
-
design: 'Gallery-first:
|
|
1359
|
+
design: 'Gallery-first: full images, galleries as image cards by subject, few words, packages only as the brief gives them. Many images, mostly plain bands and one dark band.',
|
|
1360
1360
|
pages: 'Home, Galleries or Portfolio, About, and Book or Contact with the form.'
|
|
1361
1361
|
},
|
|
1362
1362
|
{
|
|
@@ -1426,7 +1426,7 @@ const ALL_HUES = [
|
|
|
1426
1426
|
headingScale: 1.05,
|
|
1427
1427
|
density: 'airy'
|
|
1428
1428
|
},
|
|
1429
|
-
design: 'Reading-first: a
|
|
1429
|
+
design: 'Reading-first: a narrow, calm measure, writing as cards with a title and a one-line summary, topics as a list, and a quiet, personal voice. Mostly plain bands.',
|
|
1430
1430
|
pages: 'Home, Articles presenting the writing as cards, About, and Subscribe or Contact. Posts themselves are added in Data as a collection, so plan the articles page as an introduction and a few featured cards.'
|
|
1431
1431
|
},
|
|
1432
1432
|
{
|
|
@@ -1520,7 +1520,7 @@ const ALL_HUES = [
|
|
|
1520
1520
|
headingScale: 1.2,
|
|
1521
1521
|
density: 'regular'
|
|
1522
1522
|
},
|
|
1523
|
-
design: 'Celebratory and clear: the name and what it is in
|
|
1523
|
+
design: 'Celebratory and clear: the name and what it is in big type, when and where only as the brief gives them, the schedule as steps, and the details guests ask about as an FAQ. One brand band.',
|
|
1524
1524
|
pages: 'Home, Schedule or Details, Travel or Venue where the brief names one, and RSVP or Register with the form.'
|
|
1525
1525
|
},
|
|
1526
1526
|
{
|
|
@@ -1638,7 +1638,7 @@ const ALL_HUES = [
|
|
|
1638
1638
|
headingScale: 1.15,
|
|
1639
1639
|
density: 'compact'
|
|
1640
1640
|
},
|
|
1641
|
-
design: 'High-energy:
|
|
1641
|
+
design: 'High-energy: punchy headlines, strong buttons, classes or programs as cards and short, motivating copy. Use a dark band and a brand band.',
|
|
1642
1642
|
pages: 'Home, Classes or Programs, About or Coaches, and Join or Contact with the form.'
|
|
1643
1643
|
},
|
|
1644
1644
|
{
|
|
@@ -1711,7 +1711,7 @@ const ALL_HUES = [
|
|
|
1711
1711
|
headingScale: 1.05,
|
|
1712
1712
|
density: 'airy'
|
|
1713
1713
|
},
|
|
1714
|
-
design: 'Calm and spacious:
|
|
1714
|
+
design: 'Calm and spacious: quiet headlines, classes as soft cards, gentle copy and lots of space. Soft bands, no dark band.',
|
|
1715
1715
|
pages: 'Home, Classes or Schedule, About, and Book or Contact with the form.'
|
|
1716
1716
|
},
|
|
1717
1717
|
{
|
|
@@ -1800,7 +1800,7 @@ const ALL_HUES = [
|
|
|
1800
1800
|
headingScale: 1.1,
|
|
1801
1801
|
density: 'regular'
|
|
1802
1802
|
},
|
|
1803
|
-
design: 'Stylish and image-led:
|
|
1803
|
+
design: 'Stylish and image-led: striking images, services as a menu or cards, the look and feel of the place in pictures, and booking made obvious. One brand band.',
|
|
1804
1804
|
pages: 'Home, Services, About or The team, and Book or Contact with the form.'
|
|
1805
1805
|
},
|
|
1806
1806
|
{
|
|
@@ -1882,7 +1882,7 @@ const ALL_HUES = [
|
|
|
1882
1882
|
headingScale: 1.05,
|
|
1883
1883
|
density: 'regular'
|
|
1884
1884
|
},
|
|
1885
|
-
design: 'Polished and local:
|
|
1885
|
+
design: 'Polished and local: image-led sections, the areas served by name only as the brief gives them, listings only as image cards the owner fills in, and confident, local copy. One dark band.',
|
|
1886
1886
|
pages: 'Home, Buy or Listings, Sell, About, and Contact with the form.'
|
|
1887
1887
|
},
|
|
1888
1888
|
{
|
|
@@ -1974,7 +1974,7 @@ const ALL_HUES = [
|
|
|
1974
1974
|
headingScale: 1,
|
|
1975
1975
|
density: 'regular'
|
|
1976
1976
|
},
|
|
1977
|
-
design: 'Clear and encouraging: who it is for and the result they get, courses or subjects as cards,
|
|
1977
|
+
design: 'Clear and encouraging: who it is for and the result they get in plain words, courses or subjects as cards, steps where something happens in order, and an FAQ where people have questions.',
|
|
1978
1978
|
pages: 'Home, Courses or Lessons, About or Teachers, and Enroll or Contact with the form.'
|
|
1979
1979
|
},
|
|
1980
1980
|
{
|
|
@@ -2094,7 +2094,7 @@ const ALL_HUES = [
|
|
|
2094
2094
|
headingScale: 1.05,
|
|
2095
2095
|
density: 'regular'
|
|
2096
2096
|
},
|
|
2097
|
-
design: 'Mission-led: the cause in one line, what the organization does as cards, how to help as steps (volunteer, give, spread the word), and
|
|
2097
|
+
design: 'Mission-led: the cause in one strong line, what the organization does as cards, how to help as steps (volunteer, give, spread the word), and hopeful, concrete copy. A brand band for the call to help.',
|
|
2098
2098
|
pages: 'Home, Our work or Programs, About, and Get involved or Contact with the form.'
|
|
2099
2099
|
},
|
|
2100
2100
|
{
|
|
@@ -2192,7 +2192,7 @@ const ALL_HUES = [
|
|
|
2192
2192
|
headingScale: 1.3,
|
|
2193
2193
|
density: 'regular'
|
|
2194
2194
|
},
|
|
2195
|
-
design: 'Loud and visual: the name huge
|
|
2195
|
+
design: 'Loud and visual: the name huge, image bands, a listen section where the platform places a music player for the artist’s own tracks, releases or shows as image cards only as the brief gives them, and a short bio. Dark bands are welcome. Never name or link songs by other artists.',
|
|
2196
2196
|
pages: 'Home, Music or Shows, About, and Booking or Contact with the form.'
|
|
2197
2197
|
},
|
|
2198
2198
|
{
|
|
@@ -2255,7 +2255,7 @@ const ALL_HUES = [
|
|
|
2255
2255
|
headingScale: 1.1,
|
|
2256
2256
|
density: 'airy'
|
|
2257
2257
|
},
|
|
2258
|
-
design: 'Simple and personal: who the person is in one line, what they do, experience or highlights as a list or steps, selected work as cards where the brief names some
|
|
2258
|
+
design: 'Simple and personal: who the person is in one line, what they do in plain words, experience or highlights as a list or steps, selected work as cards where the brief names some. Mostly plain bands.',
|
|
2259
2259
|
pages: 'Home, About or Experience, Work where the brief names some, and Contact.'
|
|
2260
2260
|
},
|
|
2261
2261
|
{
|
|
@@ -2320,7 +2320,7 @@ const ALL_HUES = [
|
|
|
2320
2320
|
headingScale: 1.15,
|
|
2321
2321
|
density: 'regular'
|
|
2322
2322
|
},
|
|
2323
|
-
design: 'One action: a strong promise and the call to action first,
|
|
2323
|
+
design: 'One action: a strong promise and the call to action in the first section, benefits as cards, how it works as steps, objections answered as an FAQ, and the call to action repeated. A brand band where the page asks.',
|
|
2324
2324
|
pages: 'One long home page carries the story; a second page only for the form or details the brief asks for.'
|
|
2325
2325
|
},
|
|
2326
2326
|
{
|
|
@@ -2559,9 +2559,9 @@ const HEAD_NOUN_BONUS = 2;
|
|
|
2559
2559
|
return typeof type === 'string' && type.trim() ? aiSiteKindFor(type, typeof audience === 'string' ? audience : '') : null;
|
|
2560
2560
|
}
|
|
2561
2561
|
/** What each band rhythm asks of a page's sections. */ const RHYTHM_WORDS = {
|
|
2562
|
-
calm: 'mostly plain bands with one soft band, and
|
|
2563
|
-
alternating: 'plain and soft bands by turns, with one brand band',
|
|
2564
|
-
bold: 'a dark or brand band
|
|
2562
|
+
calm: 'mostly plain bands with one soft band, and at most one brand or dark band, on whichever section most needs the weight',
|
|
2563
|
+
alternating: 'plain and soft bands by turns, with one brand band wherever the page needs emphasis',
|
|
2564
|
+
bold: 'a dark or brand band for one or two key moments anywhere on the page, and strong contrast between neighboring sections'
|
|
2565
2565
|
};
|
|
2566
2566
|
/** The site's own look tokens a unit is handed (AGL-3660), read defensively. */ export function aiSiteStyleTokens(inputs) {
|
|
2567
2567
|
const raw = inputs == null ? void 0 : inputs['siteStyle'];
|