@aglyn/plugins-ai 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/package.json +17 -17
  2. package/src/lib/activity/ai-activity.js +4 -2
  3. package/src/lib/activity/ai-activity.js.map +1 -1
  4. package/src/lib/components/ai-credits-card.component.d.ts +4 -3
  5. package/src/lib/components/ai-credits-card.component.js +13 -12
  6. package/src/lib/components/ai-credits-card.component.js.map +1 -1
  7. package/src/lib/components/ai-site-import-job.component.js +14 -5
  8. package/src/lib/components/ai-site-import-job.component.js.map +1 -1
  9. package/src/lib/components/ai-upsell-dialog.component.d.ts +2 -2
  10. package/src/lib/components/ai-upsell-dialog.component.js +3 -3
  11. package/src/lib/components/ai-upsell-dialog.component.js.map +1 -1
  12. package/src/lib/components/staff-org-ai-card.component.js +2 -2
  13. package/src/lib/components/staff-org-ai-card.component.js.map +1 -1
  14. package/src/lib/declarations.d.ts +2 -2
  15. package/src/lib/declarations.js +10 -9
  16. package/src/lib/declarations.js.map +1 -1
  17. package/src/lib/jobs/ai-job-import-step.d.ts +28 -2
  18. package/src/lib/jobs/ai-job-import-step.js +170 -14
  19. package/src/lib/jobs/ai-job-import-step.js.map +1 -1
  20. package/src/lib/jobs/ai-job-layout-language.js +2 -0
  21. package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
  22. package/src/lib/jobs/ai-job-page-language.js +6 -2
  23. package/src/lib/jobs/ai-job-page-language.js.map +1 -1
  24. package/src/lib/jobs/ai-site-import-compile.d.ts +13 -3
  25. package/src/lib/jobs/ai-site-import-compile.js +339 -27
  26. package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
  27. package/src/lib/jobs/ai-site-import-document.d.ts +3 -1
  28. package/src/lib/jobs/ai-site-import-document.js +42 -1
  29. package/src/lib/jobs/ai-site-import-document.js.map +1 -1
  30. package/src/lib/jobs/ai-site-import-look.d.ts +9 -0
  31. package/src/lib/jobs/ai-site-import-look.js +89 -6
  32. package/src/lib/jobs/ai-site-import-look.js.map +1 -1
  33. package/src/lib/layout-language/ai-layout-compiler.d.ts +16 -0
  34. package/src/lib/layout-language/ai-layout-compiler.js +378 -56
  35. package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
  36. package/src/lib/layout-language/ai-layout-frame-source.d.ts +88 -2
  37. package/src/lib/layout-language/ai-layout-frame-source.js +591 -30
  38. package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
  39. package/src/lib/layout-language/ai-layout-frame.js +30 -18
  40. package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
  41. package/src/lib/layout-language/ai-layout-language.d.ts +74 -3
  42. package/src/lib/layout-language/ai-layout-language.js +5 -3
  43. package/src/lib/layout-language/ai-layout-language.js.map +1 -1
  44. package/src/lib/layout-language/ai-layout-store.d.ts +8 -0
  45. package/src/lib/layout-language/ai-layout-store.js +32 -6
  46. package/src/lib/layout-language/ai-layout-store.js.map +1 -1
  47. package/src/lib/model/ai-site-import-fidelity.d.ts +31 -1
  48. package/src/lib/model/ai-site-import-fidelity.js +347 -25
  49. package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
  50. package/src/lib/model/ai-site-import-view.js +4 -3
  51. package/src/lib/model/ai-site-import-view.js.map +1 -1
  52. package/src/lib/model/ai-site-import.d.ts +205 -6
  53. package/src/lib/model/ai-site-import.js +161 -5
  54. package/src/lib/model/ai-site-import.js.map +1 -1
  55. package/src/lib/model/ai-site-look.d.ts +8 -1
  56. package/src/lib/model/ai-site-look.js +8 -5
  57. package/src/lib/model/ai-site-look.js.map +1 -1
  58. package/src/lib/model/ai-upsell-copy.js +4 -3
  59. package/src/lib/model/ai-upsell-copy.js.map +1 -1
  60. package/src/lib/plan-entitlements.d.ts +3 -3
  61. package/src/lib/plan-entitlements.js +1 -1
  62. package/src/lib/plan-entitlements.js.map +1 -1
  63. package/src/lib/providers/model-choice.d.ts +6 -3
  64. package/src/lib/providers/model-choice.js +8 -4
  65. package/src/lib/providers/model-choice.js.map +1 -1
  66. package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -1
  67. package/src/lib/runtime/ai-doctrine-validators.js +25 -2
  68. package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
  69. package/src/lib/runtime/ai-node-tree.js +19 -2
  70. package/src/lib/runtime/ai-node-tree.js.map +1 -1
  71. package/src/lib/runtime/ai-page-links.d.ts +15 -0
  72. package/src/lib/runtime/ai-page-links.js +48 -0
  73. package/src/lib/runtime/ai-page-links.js.map +1 -1
  74. package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +1 -1
  75. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +35 -6
  76. package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
  77. package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +9 -0
  78. package/src/lib/site-import/fixtures/site-layout-recordings.js +24 -5
  79. package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
  80. package/src/lib/site-import/site-import-crawl.d.ts +3 -1
  81. package/src/lib/site-import/site-import-crawl.js +8 -3
  82. package/src/lib/site-import/site-import-crawl.js.map +1 -1
  83. package/src/lib/site-import/site-import-css.d.ts +20 -0
  84. package/src/lib/site-import/site-import-css.js +106 -0
  85. package/src/lib/site-import/site-import-css.js.map +1 -1
  86. package/src/lib/site-import/site-import-html.d.ts +39 -0
  87. package/src/lib/site-import/site-import-html.js +515 -5
  88. package/src/lib/site-import/site-import-html.js.map +1 -1
  89. package/src/lib/site-import/site-import-layout.d.ts +16 -6
  90. package/src/lib/site-import/site-import-layout.js +528 -52
  91. package/src/lib/site-import/site-import-layout.js.map +1 -1
  92. package/src/lib/site-import/site-import-nav.js +286 -24
  93. package/src/lib/site-import/site-import-nav.js.map +1 -1
  94. package/src/lib/site-import/site-import-page.js +3 -0
  95. package/src/lib/site-import/site-import-page.js.map +1 -1
  96. package/src/lib/usage/assist-credits.d.ts +5 -4
  97. package/src/lib/usage/assist-credits.js +5 -4
  98. package/src/lib/usage/assist-credits.js.map +1 -1
  99. package/src/lib/usage/staff-org-ai-view.js +6 -6
  100. package/src/lib/usage/staff-org-ai-view.js.map +1 -1
  101. package/src/lib/usage/staff-org-ai.d.ts +4 -4
  102. package/src/lib/usage/staff-org-ai.js +8 -7
  103. package/src/lib/usage/staff-org-ai.js.map +1 -1
  104. package/src/lib/usage/staff-org-usage-ai.js +2 -2
  105. package/src/lib/usage/staff-org-usage-ai.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-import-view.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*==========================================\n * BRING MY SITE, AS THE CONSOLE SHOWS IT (AGL-3976).\n *\n * Pure: what the \"Create site\" choice card says before anyone clicks, and\n * what an import job's page shows in each of its states — the site read and\n * its waves planned, a wave running, a wave in for review, a wave held for a\n * proof or the day's limit, the import done. The components draw these; the\n * specs hold them.\n *=========================================*/\n\nimport { PLATFORM_BRAND_NAME } from '@aglyn/aglyn/app-utils/platform-brand'\nimport { aiCreditRangeText } from './ai-credit-estimate'\nimport type { AiJobItemLedger, AiJobSummary } from './ai-jobs.types'\nimport {\n AI_SITE_IMPORT_FRAME_SLOT,\n AI_SITE_IMPORT_LEFT_OUT_COPY,\n AI_SITE_IMPORT_LEFT_OUT_REASONS,\n AI_SITE_IMPORT_UNREAD_REASONS,\n aiSiteImportNextWave,\n aiSiteImportPagesText,\n aiSiteImportQuoteText,\n aiSiteImportReadStops,\n aiSiteImportReadVerdictMessage,\n aiSiteImportReadVerdictReason,\n aiSiteImportRemainingCreditRange,\n aiSiteImportReviewWave,\n aiSiteImportRunningWave,\n aiSiteImportWaveCreditRange,\n aiSiteImportWaveOwed,\n type AiSiteImportLeftOutReason,\n type AiSiteImportState,\n type AiSiteImportWave,\n} from './ai-site-import'\n\n/** A domain ownership claim, as the ownership door answers it. */\nexport interface AiSiteImportClaim {\n domain: string\n status: 'pending' | 'proven'\n current: boolean\n provenMethod: 'dns' | 'meta' | 'email' | null\n provenAt: number | null\n provenDetail: string | null\n lastChecks: Partial<Record<'dns' | 'meta' | 'email', 'proven' | 'not-yet' | 'unreachable'>>\n dns: { host: string; type: 'TXT'; value: string }\n meta: { name: string; content: string; tag: string }\n email: { domain: string; pendingAddress: string | null; expiresAt: number | null; attemptsLeft: number | null }\n}\n\n/** Whether \"Bring my site\" is offered here, and if not why. */\nexport type AiSiteImportAvailability =\n | { state: 'checking' }\n /** The release flag is off, or the doors cannot be reached: the card is not drawn. */\n | { state: 'hidden' }\n /** Something the workspace can change stands in the way: the card is drawn disabled, with the reason. */\n | { state: 'blocked'; reason: 'plan' | 'role'; message: string }\n | { state: 'ready'; claims: AiSiteImportClaim[] }\n\n/** What the card says to a plan that does not include it. */\nexport const AI_SITE_IMPORT_PLAN_COPY =\n 'Bring your current website in, every page and photo, on any paid plan. Upgrade to bring yours in.'\n\n/** What the card says to a member who cannot. */\nexport const AI_SITE_IMPORT_ROLE_COPY = 'Only the workspace owner or an admin can bring a site in.'\n\n/**\n * The jobs list's `siteImport` offer (AGL-3976), as the card's state: absent\n * is the flag off, and the card is not drawn; `plan` and `role` are drawn\n * disabled with the reason.\n */\nexport function aiSiteImportOfferOf(offer: unknown): AiSiteImportAvailability {\n if (offer === 'ready') return { state: 'ready', claims: [] }\n if (offer === 'plan') return { state: 'blocked', reason: 'plan', message: AI_SITE_IMPORT_PLAN_COPY }\n if (offer === 'role') return { state: 'blocked', reason: 'role', message: AI_SITE_IMPORT_ROLE_COPY }\n return { state: 'hidden' }\n}\n\n/** Where an import job's page is. */\nexport type AiSiteImportPhase =\n /** The site is being read. */\n | 'reading'\n /** Read and planned; the first wave waits to be started. */\n | 'ready'\n /** A wave was started and has not begun yet. */\n | 'starting'\n | 'running'\n /** A wave is in; the next waits to be started. */\n | 'review'\n /** Held for something the person does: verify again, wait for tomorrow, read again. */\n | 'held'\n /** Out of AI credits or at a cap: the meter's pause, carried on by Resume. */\n | 'paused'\n | 'done'\n | 'stopped'\n\nexport function aiSiteImportPhaseOf(job: Pick<AiJobSummary, 'status' | 'review' | 'siteImport'>): AiSiteImportPhase {\n const state = job.siteImport ?? null\n // A read that stopped at its home page is held, and its Check again reads again (AGL-4083).\n const stopped = aiSiteImportReadStops(state?.verdict)\n if (job.status === 'done') return 'done'\n if (job.status === 'failed' || job.status === 'canceled') return 'stopped'\n if (job.status === 'needs_input') return 'paused'\n if (job.status === 'needs_review') {\n if (job.review?.reason !== 'wave' || !state || stopped) return 'held'\n return aiSiteImportReviewWave(state) ? 'review' : 'ready'\n }\n if (!state || stopped) return 'reading'\n return aiSiteImportRunningWave(state) ? 'running' : 'starting'\n}\n\n/**\n * How a hold that is the site's to fix reads (AGL-4083): its heading, its\n * sentence and its button. A home page bot protection turned away, or one\n * that could not be read, is checked again for free; `null` for any other\n * hold, which keeps its own words.\n */\nexport function aiSiteImportHeldCopy(\n job: Pick<AiJobSummary, 'review' | 'siteImport'>,\n): { heading: string; message: string; action: string } | null {\n const state = job.siteImport ?? null\n const fromState = aiSiteImportReadStops(state?.verdict) ? aiSiteImportReadVerdictReason(state?.verdict) : null\n const reason = job.review?.reason === 'blocked' || job.review?.reason === 'unreadable' ? job.review.reason : fromState\n if (!reason) return null\n const message =\n (fromState && state ? aiSiteImportReadVerdictMessage(state.verdict, state.domain) : null) ?? job.review?.message ?? ''\n return {\n heading: reason === 'blocked' ? 'AglynBot was turned away' : 'Your home page could not be read',\n message,\n action: 'Check again',\n }\n}\n\n/**\n * Why an import that had started is waiting with no wave to review (AGL-4083):\n * the sentence its stop left, which says what is not in yet and what to start.\n * `null` for one that has not started, and one waiting for its review.\n */\nexport function aiSiteImportStoppedCopy(job: Pick<AiJobSummary, 'status' | 'review' | 'siteImport'>): string | null {\n const state = job.siteImport ?? null\n if (aiSiteImportPhaseOf(job) !== 'ready' || !state?.waves.some((wave) => wave.startedAt)) return null\n return job.review?.message || null\n}\n\nexport type AiSiteImportRowState = 'waiting' | 'active' | 'done' | 'failed' | 'skipped'\n\nexport interface AiSiteImportRowView {\n slot: string\n title: string\n /** Where it is on the old site. */\n from: string\n /** Where it is on the new one. */\n to: string\n state: AiSiteImportRowState\n /** Why it failed or was left out, or what the person should know. */\n note: string | null\n /** \"3 photos added, 1 already in your library\". */\n photos: string | null\n /** The draft the row wrote, by its output id. */\n outputId: string | null\n /** The page on the old site, to open beside the draft (AGL-4083). */\n oldPage: string\n /** \"1,204 of 1,310 words\", once the page is in and the step has counted them. */\n words: string | null\n /** \"Copied as it is\" or \"Arranged by Aglyn AI\", once the step has chosen. */\n build: string | null\n}\n\nfunction rowState(row: AiJobItemLedger | undefined, active: boolean): AiSiteImportRowState {\n if (!row) return 'waiting'\n if (row.status === 'succeeded' || row.status === 'degraded') return 'done'\n if (row.status === 'failed') return 'failed'\n if (row.status === 'skipped') return 'skipped'\n return active ? 'active' : 'waiting'\n}\n\n/**\n * \"3 photos added\", \"2 photos added, 1 already in your media library\"; with\n * photos that could not come in, against all it tried: \"3 of 5 photos: 2\n * added, 1 already in your media library, 2 could not be brought in\".\n */\nexport function aiSiteImportPhotosText(\n photos: { brought: number; reused: number; skipped?: number } | null | undefined,\n): string | null {\n if (!photos) return null\n const skipped = Math.max(0, photos.skipped ?? 0)\n const into = photos.brought + photos.reused\n if (into === 0 && skipped === 0) return null\n if (!skipped) {\n const added = photos.brought ? `${photos.brought} ${photos.brought === 1 ? 'photo' : 'photos'} added` : ''\n const reused = photos.reused ? `${photos.reused} already in your media library` : ''\n return [added, reused].filter(Boolean).join(', ')\n }\n const parts = [\n photos.brought ? `${photos.brought} added` : '',\n photos.reused ? `${photos.reused} already in your media library` : '',\n `${skipped} could not be brought in`,\n ].filter(Boolean)\n const tried = into + skipped\n return `${into} of ${tried} ${tried === 1 ? 'photo' : 'photos'}: ${parts.join(', ')}`\n}\n\nconst BUILD_COPY = { copied: 'Copied as it is', arranged: `Arranged by ${PLATFORM_BRAND_NAME} AI` } as const\n\n/** One wave's rows, the header and footer first where the wave builds them. */\nexport function aiSiteImportWaveRows(\n job: Pick<AiJobSummary, 'items' | 'siteImport' | 'status'>,\n wave: AiSiteImportWave,\n): AiSiteImportRowView[] {\n const state = job.siteImport as AiSiteImportState\n const items = new Map((job.items ?? []).map((row) => [row.slot, row]))\n const running = wave.status === 'running' && (job.status === 'running' || job.status === 'queued')\n let activeTaken = false\n const active = (row: AiJobItemLedger | undefined) => {\n if (!running || activeTaken || !row || (row.status !== 'pending' && row.status !== 'running')) return false\n activeTaken = true\n return true\n }\n const rows: AiSiteImportRowView[] = []\n if (wave.frame && state.frame) {\n const row = items.get(AI_SITE_IMPORT_FRAME_SLOT)\n rows.push({\n slot: AI_SITE_IMPORT_FRAME_SLOT,\n title: 'Header and footer',\n from: `Your menu on ${state.domain}`,\n to: 'Every page',\n state: rowState(row, active(row)),\n note: row?.failure?.message ?? row?.note ?? null,\n photos: null,\n outputId: row?.outputs[0] ?? null,\n oldPage: `https://${state.domain}/`,\n words: null,\n build: null,\n })\n }\n for (const slot of wave.slots) {\n const page = state.pages.find((entry) => entry.slot === slot)\n if (!page) continue\n const row = items.get(slot)\n rows.push({\n slot,\n title: page.title,\n from: page.path,\n to: page.slug === '/' ? '/' : `/${page.slug}`,\n state: rowState(row, active(row)),\n note: row?.failure?.message ?? row?.note ?? (page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null),\n photos: aiSiteImportPhotosText(page.photos),\n outputId: row?.outputs[0] ?? null,\n oldPage: page.url,\n words: page.brought ? `${page.brought.words.toLocaleString('en-US')} of ${page.words.toLocaleString('en-US')} words` : null,\n build: page.build ? BUILD_COPY[page.build] : null,\n })\n }\n return rows\n}\n\n/**\n * \"About 189 credits (up to 650)\" for the wave, as it stands; once the step\n * has chosen how its pages are built, it names them: \"…: 7 pages arranged by\n * Aglyn AI, 3 copied as they are\" (AGL-4083).\n */\nexport function aiSiteImportWaveQuote(job: Pick<AiJobSummary, 'items' | 'siteImport'>, wave: AiSiteImportWave): string {\n const state = job.siteImport as AiSiteImportState\n const range = aiSiteImportWaveCreditRange(state, wave, job.items ?? null)\n return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, job.items ?? null))\n}\n\n/** What a wave cost, its pages' credits less what was given back. */\nexport function aiSiteImportWaveSpent(job: Pick<AiJobSummary, 'items'>, wave: AiSiteImportWave): number {\n const slots = new Set([...wave.slots, ...(wave.frame ? [AI_SITE_IMPORT_FRAME_SLOT] : [])])\n return (job.items ?? [])\n .filter((row) => slots.has(row.slot))\n .reduce((total, row) => total + Math.max(0, (row.creditsSpent ?? 0) - (row.creditsRefunded ?? 0)), 0)\n}\n\n/** Pages the site has that AglynBot could not read: turned away, unanswered, too large or never reached. */\nexport function aiSiteImportUnreadCount(state: AiSiteImportState): number {\n return AI_SITE_IMPORT_UNREAD_REASONS.reduce((total, reason) => total + (state.leftOutCount[reason] ?? 0), 0)\n}\n\n/**\n * The read site in one sentence: \"Found 21 pages on harbor-dental.com: Main\n * pages (6) and Blog (14).\" — and how many more could not be read (AGL-4083).\n */\nexport function aiSiteImportFoundText(state: AiSiteImportState): string {\n const groups = state.groups.map((group) => `${group.label} (${group.pages})`)\n const listed =\n groups.length <= 1 ? groups.join('') : `${groups.slice(0, -1).join(', ')} and ${groups[groups.length - 1]}`\n const found = `Found ${aiSiteImportPagesText(state.found)} on ${state.domain}`\n const lead = listed ? `${found}: ${listed}.` : `${found}.`\n const unread = aiSiteImportUnreadCount(state)\n return unread ? `${lead} ${unread.toLocaleString('en-US')} more could not be read; see Not brought in.` : lead\n}\n\n/** Why the read stopped short, when it did and left pages unread (AGL-4083). */\nexport function aiSiteImportStopText(state: AiSiteImportState): string | null {\n const unreached = state.leftOutCount['not-reached'] ?? 0\n if (!unreached) return null\n const first = `Only the first ${aiSiteImportPagesText(state.found)}`\n const rest = 'the rest are listed under Not brought in as not reached.'\n switch (state.stoppedBy) {\n case 'time':\n return `${first} could be read in the time allowed; ${rest}`\n case 'total-bytes':\n return `${first} could be read before the read reached its size limit; ${rest}`\n default:\n return `${first} could be read this time; ${rest}`\n }\n}\n\n/** The read's warning when most of the site was turned away though its home page came in (AGL-4083). */\nexport function aiSiteImportVerdictNote(state: AiSiteImportState): string | null {\n return state.verdict?.kind === 'mostly-blocked' ? aiSiteImportReadVerdictMessage(state.verdict, state.domain) : null\n}\n\n/** The plan's page count against the site: \"Your plan includes 25 pages and this site has 0, so 20 are brought in.\" */\nexport function aiSiteImportPlanText(state: AiSiteImportState): string {\n const kept = state.pages.length\n const waves = state.waves.length\n const plan =\n state.pageLimit === null\n ? 'Your plan has no page limit'\n : `Your plan includes ${aiSiteImportPagesText(state.pageLimit)} and this site has ${state.existingPages}`\n const lead = `${plan}, so ${aiSiteImportPagesText(kept)} ${kept === 1 ? 'is' : 'are'} brought in, in ${waves === 1 ? 'one wave' : `${waves} waves`}.`\n const stop = aiSiteImportStopText(state)\n return stop ? `${lead} ${stop}` : lead\n}\n\n/** What was left out, by reason, most first. */\nexport function aiSiteImportLeftOutLines(state: AiSiteImportState): Array<{ reason: AiSiteImportLeftOutReason; count: number; text: string; paths: string[] }> {\n return AI_SITE_IMPORT_LEFT_OUT_REASONS.map((reason) => ({\n reason,\n count: state.leftOutCount[reason] ?? 0,\n text: AI_SITE_IMPORT_LEFT_OUT_COPY[reason],\n paths: state.leftOut.filter((entry) => entry.reason === reason).map((entry) => entry.path),\n }))\n .filter((line) => line.count > 0)\n .sort((a, b) => b.count - a.count)\n}\n\n/** The wave a page offers to start next, and its button's words. */\nexport function aiSiteImportStartAction(\n job: Pick<AiJobSummary, 'siteImport' | 'items'> & Partial<Pick<AiJobSummary, 'status'>>,\n): { wave: AiSiteImportWave; label: string; quote: string } | null {\n const state = job.siteImport ?? null\n // An import that stopped inside a wave waits on that wave, which starts again where it stopped (AGL-4083).\n const wave = (job.status === 'needs_review' ? aiSiteImportRunningWave(state) : null) ?? aiSiteImportNextWave(state)\n if (!state || !wave) return null\n return { wave, label: `Start ${wave.label}`, quote: aiSiteImportWaveQuote(job, wave) }\n}\n\n/**\n * \"Start every remaining wave\" (AGL-4083), off by default: offered beside the\n * next wave's button when more than one wave waits, quoted as all of them.\n */\nexport function aiSiteImportStartAllAction(\n job: Pick<AiJobSummary, 'siteImport' | 'items'>,\n): { label: string; quote: string; waves: number } | null {\n const state = job.siteImport ?? null\n if (!state || !aiSiteImportNextWave(state)) return null\n const waves = state.waves.filter((wave) => wave.status === 'waiting').length\n if (waves < 2) return null\n return {\n label: 'Start every remaining wave',\n quote: aiCreditRangeText(aiSiteImportRemainingCreditRange(state, job.items ?? null)),\n waves,\n }\n}\n"],"names":["PLATFORM_BRAND_NAME","aiCreditRangeText","AI_SITE_IMPORT_FRAME_SLOT","AI_SITE_IMPORT_LEFT_OUT_COPY","AI_SITE_IMPORT_LEFT_OUT_REASONS","AI_SITE_IMPORT_UNREAD_REASONS","aiSiteImportNextWave","aiSiteImportPagesText","aiSiteImportQuoteText","aiSiteImportReadStops","aiSiteImportReadVerdictMessage","aiSiteImportReadVerdictReason","aiSiteImportRemainingCreditRange","aiSiteImportReviewWave","aiSiteImportRunningWave","aiSiteImportWaveCreditRange","aiSiteImportWaveOwed","AI_SITE_IMPORT_PLAN_COPY","AI_SITE_IMPORT_ROLE_COPY","aiSiteImportOfferOf","offer","state","claims","reason","message","aiSiteImportPhaseOf","job","siteImport","stopped","verdict","status","review","aiSiteImportHeldCopy","fromState","domain","heading","action","aiSiteImportStoppedCopy","waves","some","wave","startedAt","rowState","row","active","aiSiteImportPhotosText","photos","skipped","Math","max","into","brought","reused","added","filter","Boolean","join","parts","tried","BUILD_COPY","copied","arranged","aiSiteImportWaveRows","items","Map","map","slot","running","activeTaken","rows","frame","get","push","title","from","to","note","failure","outputId","outputs","oldPage","words","build","slots","page","pages","find","entry","path","slug","refused","url","toLocaleString","aiSiteImportWaveQuote","range","aiSiteImportWaveSpent","Set","has","reduce","total","creditsSpent","creditsRefunded","aiSiteImportUnreadCount","leftOutCount","aiSiteImportFoundText","groups","group","label","listed","length","slice","found","lead","unread","aiSiteImportStopText","unreached","first","rest","stoppedBy","aiSiteImportVerdictNote","kind","aiSiteImportPlanText","kept","plan","pageLimit","existingPages","stop","aiSiteImportLeftOutLines","count","text","paths","leftOut","line","sort","a","b","aiSiteImportStartAction","quote","aiSiteImportStartAllAction"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;2CAQ2C,GAE3C,SAASA,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,iBAAiB,QAAQ,0BAAsB;AAExD,SACEC,yBAAyB,EACzBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,6BAA6B,EAC7BC,oBAAoB,EACpBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,8BAA8B,EAC9BC,6BAA6B,EAC7BC,gCAAgC,EAChCC,sBAAsB,EACtBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,oBAAoB,QAIf,sBAAkB;AAyBzB,2DAA2D,GAC3D,OAAO,MAAMC,2BACX,oGAAmG;AAErG,+CAA+C,GAC/C,OAAO,MAAMC,2BAA2B,4DAA2D;AAEnG;;;;CAIC,GACD,OAAO,SAASC,oBAAoBC,KAAc;IAChD,IAAIA,UAAU,SAAS,OAAO;QAAEC,OAAO;QAASC,QAAQ,EAAE;IAAC;IAC3D,IAAIF,UAAU,QAAQ,OAAO;QAAEC,OAAO;QAAWE,QAAQ;QAAQC,SAASP;IAAyB;IACnG,IAAIG,UAAU,QAAQ,OAAO;QAAEC,OAAO;QAAWE,QAAQ;QAAQC,SAASN;IAAyB;IACn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9BK,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEP,KAAK,GAAGM,EAAEN,KAAK;AACrC;AAEA,kEAAkE,GAClE,OAAO,SAASQ,wBACd9G,GAAuF;QAEzEA,iBAEAA;IAFd,MAAML,SAAQK,kBAAAA,IAAIC,UAAU,YAAdD,kBAAkB;IAChC,2GAA2G;IAC3G,MAAMc,QAAQd,OAAAA,IAAII,MAAM,KAAK,iBAAiBhB,wBAAwBO,SAAS,gBAAjEK,OAA0EpB,qBAAqBe;IAC7G,IAAI,CAACA,SAAS,CAACmB,MAAM,OAAO;IAC5B,OAAO;QAAEA;QAAMmE,OAAO,CAAC,MAAM,EAAEnE,KAAKmE,KAAK,EAAE;QAAE8B,OAAO5C,sBAAsBnE,KAAKc;IAAM;AACvF;AAEA;;;CAGC,GACD,OAAO,SAASkG,2BACdhH,GAA+C;QAEjCA,iBAMqDA;IANnE,MAAML,SAAQK,kBAAAA,IAAIC,UAAU,YAAdD,kBAAkB;IAChC,IAAI,CAACL,SAAS,CAACf,qBAAqBe,QAAQ,OAAO;IACnD,MAAMiB,QAAQjB,MAAMiB,KAAK,CAACgB,MAAM,CAAC,CAACd,OAASA,KAAKV,MAAM,KAAK,WAAW+E,MAAM;IAC5E,IAAIvE,QAAQ,GAAG,OAAO;IACtB,OAAO;QACLqE,OAAO;QACP8B,OAAOxI,kBAAkBW,iCAAiCS,QAAOK,aAAAA,IAAIqC,KAAK,YAATrC,aAAa;QAC9EY;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-import-view.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*==========================================\n * BRING MY SITE, AS THE CONSOLE SHOWS IT (AGL-3976).\n *\n * Pure: what the \"Create site\" choice card says before anyone clicks, and\n * what an import job's page shows in each of its states — the site read and\n * its waves planned, a wave running, a wave in for review, a wave held for a\n * proof or the day's limit, the import done. The components draw these; the\n * specs hold them.\n *=========================================*/\n\nimport { PLATFORM_BRAND_NAME } from '@aglyn/aglyn/app-utils/platform-brand'\nimport { aiCreditRangeText } from './ai-credit-estimate'\nimport type { AiJobItemLedger, AiJobSummary } from './ai-jobs.types'\nimport {\n AI_SITE_IMPORT_FRAME_SLOT,\n AI_SITE_IMPORT_LEFT_OUT_COPY,\n AI_SITE_IMPORT_LEFT_OUT_REASONS,\n AI_SITE_IMPORT_UNREAD_REASONS,\n aiSiteImportNextWave,\n aiSiteImportPagesText,\n aiSiteImportQuoteText,\n aiSiteImportReadStops,\n aiSiteImportReadVerdictMessage,\n aiSiteImportReadVerdictReason,\n aiSiteImportRemainingCreditRange,\n aiSiteImportReviewWave,\n aiSiteImportRunningWave,\n aiSiteImportWaveCreditRange,\n aiSiteImportWaveOwed,\n type AiSiteImportLeftOutReason,\n type AiSiteImportState,\n type AiSiteImportWave,\n} from './ai-site-import'\n\n/** A domain ownership claim, as the ownership door answers it. */\nexport interface AiSiteImportClaim {\n domain: string\n status: 'pending' | 'proven'\n current: boolean\n provenMethod: 'dns' | 'meta' | 'email' | null\n provenAt: number | null\n provenDetail: string | null\n lastChecks: Partial<Record<'dns' | 'meta' | 'email', 'proven' | 'not-yet' | 'unreachable'>>\n dns: { host: string; type: 'TXT'; value: string }\n meta: { name: string; content: string; tag: string }\n email: { domain: string; pendingAddress: string | null; expiresAt: number | null; attemptsLeft: number | null }\n}\n\n/** Whether \"Bring my site\" is offered here, and if not why. */\nexport type AiSiteImportAvailability =\n | { state: 'checking' }\n /** The release flag is off, or the doors cannot be reached: the card is not drawn. */\n | { state: 'hidden' }\n /** Something the workspace can change stands in the way: the card is drawn disabled, with the reason. */\n | { state: 'blocked'; reason: 'plan' | 'role'; message: string }\n | { state: 'ready'; claims: AiSiteImportClaim[] }\n\n/** What the card says to a plan that does not include it. */\nexport const AI_SITE_IMPORT_PLAN_COPY =\n 'Bring your current website in, every page and photo, on any paid plan. Upgrade to bring yours in.'\n\n/** What the card says to a member who cannot. */\nexport const AI_SITE_IMPORT_ROLE_COPY = 'Only the workspace owner or an admin can bring a site in.'\n\n/**\n * The jobs list's `siteImport` offer (AGL-3976), as the card's state: absent\n * is the flag off, and the card is not drawn; `plan` and `role` are drawn\n * disabled with the reason.\n */\nexport function aiSiteImportOfferOf(offer: unknown): AiSiteImportAvailability {\n if (offer === 'ready') return { state: 'ready', claims: [] }\n if (offer === 'plan') return { state: 'blocked', reason: 'plan', message: AI_SITE_IMPORT_PLAN_COPY }\n if (offer === 'role') return { state: 'blocked', reason: 'role', message: AI_SITE_IMPORT_ROLE_COPY }\n return { state: 'hidden' }\n}\n\n/** Where an import job's page is. */\nexport type AiSiteImportPhase =\n /** The site is being read. */\n | 'reading'\n /** Read and planned; the first wave waits to be started. */\n | 'ready'\n /** A wave was started and has not begun yet. */\n | 'starting'\n | 'running'\n /** A wave is in; the next waits to be started. */\n | 'review'\n /** Held for something the person does: verify again, wait for tomorrow, read again. */\n | 'held'\n /** Out of AI credits or at a cap: the meter's pause, carried on by Resume. */\n | 'paused'\n | 'done'\n | 'stopped'\n\nexport function aiSiteImportPhaseOf(job: Pick<AiJobSummary, 'status' | 'review' | 'siteImport'>): AiSiteImportPhase {\n const state = job.siteImport ?? null\n // A read that stopped at its home page is held, and its Check again reads again (AGL-4083).\n const stopped = aiSiteImportReadStops(state?.verdict)\n if (job.status === 'done') return 'done'\n if (job.status === 'failed' || job.status === 'canceled') return 'stopped'\n if (job.status === 'needs_input') return 'paused'\n if (job.status === 'needs_review') {\n if (job.review?.reason !== 'wave' || !state || stopped) return 'held'\n return aiSiteImportReviewWave(state) ? 'review' : 'ready'\n }\n if (!state || stopped) return 'reading'\n return aiSiteImportRunningWave(state) ? 'running' : 'starting'\n}\n\n/**\n * How a hold that is the site's to fix reads (AGL-4083): its heading, its\n * sentence and its button. A home page bot protection turned away, or one\n * that could not be read, is checked again for free; `null` for any other\n * hold, which keeps its own words.\n */\nexport function aiSiteImportHeldCopy(\n job: Pick<AiJobSummary, 'review' | 'siteImport'>,\n): { heading: string; message: string; action: string } | null {\n const state = job.siteImport ?? null\n const fromState = aiSiteImportReadStops(state?.verdict) ? aiSiteImportReadVerdictReason(state?.verdict) : null\n const reason = job.review?.reason === 'blocked' || job.review?.reason === 'unreadable' ? job.review.reason : fromState\n if (!reason) return null\n const message =\n (fromState && state ? aiSiteImportReadVerdictMessage(state.verdict, state.domain) : null) ?? job.review?.message ?? ''\n return {\n heading: reason === 'blocked' ? 'AglynBot was turned away' : 'Your home page could not be read',\n message,\n action: 'Check again',\n }\n}\n\n/**\n * Why an import that had started is waiting with no wave to review (AGL-4083):\n * the sentence its stop left, which says what is not in yet and what to start.\n * `null` for one that has not started, and one waiting for its review.\n */\nexport function aiSiteImportStoppedCopy(job: Pick<AiJobSummary, 'status' | 'review' | 'siteImport'>): string | null {\n const state = job.siteImport ?? null\n if (aiSiteImportPhaseOf(job) !== 'ready' || !state?.waves.some((wave) => wave.startedAt)) return null\n return job.review?.message || null\n}\n\nexport type AiSiteImportRowState = 'waiting' | 'active' | 'done' | 'failed' | 'skipped'\n\nexport interface AiSiteImportRowView {\n slot: string\n title: string\n /** Where it is on the old site. */\n from: string\n /** Where it is on the new one. */\n to: string\n state: AiSiteImportRowState\n /** Why it failed or was left out, or what the person should know. */\n note: string | null\n /** \"3 photos added, 1 already in your library\". */\n photos: string | null\n /** The draft the row wrote, by its output id. */\n outputId: string | null\n /** The page on the old site, to open beside the draft (AGL-4083). */\n oldPage: string\n /** \"1,204 of 1,310 words\", once the page is in and the step has counted them. */\n words: string | null\n /** \"Copied as it is\" or \"Arranged by Aglyn AI\", once the step has chosen. */\n build: string | null\n}\n\nfunction rowState(row: AiJobItemLedger | undefined, active: boolean): AiSiteImportRowState {\n if (!row) return 'waiting'\n if (row.status === 'succeeded' || row.status === 'degraded') return 'done'\n if (row.status === 'failed') return 'failed'\n if (row.status === 'skipped') return 'skipped'\n return active ? 'active' : 'waiting'\n}\n\n/**\n * \"3 photos added\", \"2 photos added, 1 already in your media library\"; with\n * photos that could not come in, against all it tried: \"3 of 5 photos: 2\n * added, 1 already in your media library, 2 could not be brought in\".\n */\nexport function aiSiteImportPhotosText(\n photos: { brought: number; reused: number; skipped?: number } | null | undefined,\n): string | null {\n if (!photos) return null\n const skipped = Math.max(0, photos.skipped ?? 0)\n const into = photos.brought + photos.reused\n if (into === 0 && skipped === 0) return null\n if (!skipped) {\n const added = photos.brought ? `${photos.brought} ${photos.brought === 1 ? 'photo' : 'photos'} added` : ''\n const reused = photos.reused ? `${photos.reused} already in your media library` : ''\n return [added, reused].filter(Boolean).join(', ')\n }\n const parts = [\n photos.brought ? `${photos.brought} added` : '',\n photos.reused ? `${photos.reused} already in your media library` : '',\n `${skipped} could not be brought in`,\n ].filter(Boolean)\n const tried = into + skipped\n return `${into} of ${tried} ${tried === 1 ? 'photo' : 'photos'}: ${parts.join(', ')}`\n}\n\nconst BUILD_COPY = { copied: 'Copied as it is', arranged: `Arranged by ${PLATFORM_BRAND_NAME} AI` } as const\n\n/** One wave's rows, the header and footer first where the wave builds them. */\nexport function aiSiteImportWaveRows(\n job: Pick<AiJobSummary, 'items' | 'siteImport' | 'status'>,\n wave: AiSiteImportWave,\n): AiSiteImportRowView[] {\n const state = job.siteImport as AiSiteImportState\n const items = new Map((job.items ?? []).map((row) => [row.slot, row]))\n const running = wave.status === 'running' && (job.status === 'running' || job.status === 'queued')\n let activeTaken = false\n const active = (row: AiJobItemLedger | undefined) => {\n if (!running || activeTaken || !row || (row.status !== 'pending' && row.status !== 'running')) return false\n activeTaken = true\n return true\n }\n const rows: AiSiteImportRowView[] = []\n if (wave.frame && state.frame) {\n const row = items.get(AI_SITE_IMPORT_FRAME_SLOT)\n rows.push({\n slot: AI_SITE_IMPORT_FRAME_SLOT,\n title: 'Header and footer',\n from: `Your menu on ${state.domain}`,\n to: 'Every page',\n state: rowState(row, active(row)),\n note: row?.failure?.message ?? row?.note ?? null,\n photos: null,\n outputId: row?.outputs[0] ?? null,\n oldPage: `https://${state.domain}/`,\n words: null,\n build: null,\n })\n }\n for (const slot of wave.slots) {\n const page = state.pages.find((entry) => entry.slot === slot)\n if (!page) continue\n const row = items.get(slot)\n rows.push({\n slot,\n title: page.title,\n from: page.path,\n to: page.slug === '/' ? '/' : `/${page.slug}`,\n state: rowState(row, active(row)),\n note: row?.failure?.message ?? row?.note ?? (page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null),\n photos: aiSiteImportPhotosText(page.photos),\n outputId: row?.outputs[0] ?? null,\n oldPage: page.url,\n // Beside the old page's own words, its main region's as the wave read them: its menu and footer are the site's (AGL-4084).\n words: page.brought ? `${page.brought.words.toLocaleString('en-US')} of ${(page.read?.words ?? page.words).toLocaleString('en-US')} words` : null,\n build: page.build ? BUILD_COPY[page.build] : null,\n })\n }\n return rows\n}\n\n/**\n * \"About 189 credits (up to 650)\" for the wave, as it stands; once the step\n * has chosen how its pages are built, it names them: \"…: 7 pages arranged by\n * Aglyn AI, 3 copied as they are\" (AGL-4083).\n */\nexport function aiSiteImportWaveQuote(job: Pick<AiJobSummary, 'items' | 'siteImport'>, wave: AiSiteImportWave): string {\n const state = job.siteImport as AiSiteImportState\n const range = aiSiteImportWaveCreditRange(state, wave, job.items ?? null)\n return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, job.items ?? null))\n}\n\n/** What a wave cost, its pages' credits less what was given back. */\nexport function aiSiteImportWaveSpent(job: Pick<AiJobSummary, 'items'>, wave: AiSiteImportWave): number {\n const slots = new Set([...wave.slots, ...(wave.frame ? [AI_SITE_IMPORT_FRAME_SLOT] : [])])\n return (job.items ?? [])\n .filter((row) => slots.has(row.slot))\n .reduce((total, row) => total + Math.max(0, (row.creditsSpent ?? 0) - (row.creditsRefunded ?? 0)), 0)\n}\n\n/** Pages the site has that AglynBot could not read: turned away, unanswered, too large or never reached. */\nexport function aiSiteImportUnreadCount(state: AiSiteImportState): number {\n return AI_SITE_IMPORT_UNREAD_REASONS.reduce((total, reason) => total + (state.leftOutCount[reason] ?? 0), 0)\n}\n\n/**\n * The read site in one sentence: \"Found 21 pages on harbor-dental.com: Main\n * pages (6) and Blog (14).\" — and how many more could not be read (AGL-4083).\n */\nexport function aiSiteImportFoundText(state: AiSiteImportState): string {\n const groups = state.groups.map((group) => `${group.label} (${group.pages})`)\n const listed =\n groups.length <= 1 ? groups.join('') : `${groups.slice(0, -1).join(', ')} and ${groups[groups.length - 1]}`\n const found = `Found ${aiSiteImportPagesText(state.found)} on ${state.domain}`\n const lead = listed ? `${found}: ${listed}.` : `${found}.`\n const unread = aiSiteImportUnreadCount(state)\n return unread ? `${lead} ${unread.toLocaleString('en-US')} more could not be read; see Not brought in.` : lead\n}\n\n/** Why the read stopped short, when it did and left pages unread (AGL-4083). */\nexport function aiSiteImportStopText(state: AiSiteImportState): string | null {\n const unreached = state.leftOutCount['not-reached'] ?? 0\n if (!unreached) return null\n const first = `Only the first ${aiSiteImportPagesText(state.found)}`\n const rest = 'the rest are listed under Not brought in as not reached.'\n switch (state.stoppedBy) {\n case 'time':\n return `${first} could be read in the time allowed; ${rest}`\n case 'total-bytes':\n return `${first} could be read before the read reached its size limit; ${rest}`\n default:\n return `${first} could be read this time; ${rest}`\n }\n}\n\n/** The read's warning when most of the site was turned away though its home page came in (AGL-4083). */\nexport function aiSiteImportVerdictNote(state: AiSiteImportState): string | null {\n return state.verdict?.kind === 'mostly-blocked' ? aiSiteImportReadVerdictMessage(state.verdict, state.domain) : null\n}\n\n/** The plan's page count against the site: \"Your plan includes 25 pages and this site has 0, so 20 are brought in.\" */\nexport function aiSiteImportPlanText(state: AiSiteImportState): string {\n const kept = state.pages.length\n const waves = state.waves.length\n const plan =\n state.pageLimit === null\n ? 'Your plan has no page limit'\n : `Your plan includes ${aiSiteImportPagesText(state.pageLimit)} and this site has ${state.existingPages}`\n const lead = `${plan}, so ${aiSiteImportPagesText(kept)} ${kept === 1 ? 'is' : 'are'} brought in, in ${waves === 1 ? 'one wave' : `${waves} waves`}.`\n const stop = aiSiteImportStopText(state)\n return stop ? `${lead} ${stop}` : lead\n}\n\n/** What was left out, by reason, most first. */\nexport function aiSiteImportLeftOutLines(state: AiSiteImportState): Array<{ reason: AiSiteImportLeftOutReason; count: number; text: string; paths: string[] }> {\n return AI_SITE_IMPORT_LEFT_OUT_REASONS.map((reason) => ({\n reason,\n count: state.leftOutCount[reason] ?? 0,\n text: AI_SITE_IMPORT_LEFT_OUT_COPY[reason],\n paths: state.leftOut.filter((entry) => entry.reason === reason).map((entry) => entry.path),\n }))\n .filter((line) => line.count > 0)\n .sort((a, b) => b.count - a.count)\n}\n\n/** The wave a page offers to start next, and its button's words. */\nexport function aiSiteImportStartAction(\n job: Pick<AiJobSummary, 'siteImport' | 'items'> & Partial<Pick<AiJobSummary, 'status'>>,\n): { wave: AiSiteImportWave; label: string; quote: string } | null {\n const state = job.siteImport ?? null\n // An import that stopped inside a wave waits on that wave, which starts again where it stopped (AGL-4083).\n const wave = (job.status === 'needs_review' ? aiSiteImportRunningWave(state) : null) ?? aiSiteImportNextWave(state)\n if (!state || !wave) return null\n return { wave, label: `Start ${wave.label}`, quote: aiSiteImportWaveQuote(job, wave) }\n}\n\n/**\n * \"Start every remaining wave\" (AGL-4083), off by default: offered beside the\n * next wave's button when more than one wave waits, quoted as all of them.\n */\nexport function aiSiteImportStartAllAction(\n job: Pick<AiJobSummary, 'siteImport' | 'items'>,\n): { label: string; quote: string; waves: number } | null {\n const state = job.siteImport ?? null\n if (!state || !aiSiteImportNextWave(state)) return null\n const waves = state.waves.filter((wave) => wave.status === 'waiting').length\n if (waves < 2) return null\n return {\n label: 'Start every remaining wave',\n quote: aiCreditRangeText(aiSiteImportRemainingCreditRange(state, job.items ?? null)),\n waves,\n }\n}\n"],"names":["PLATFORM_BRAND_NAME","aiCreditRangeText","AI_SITE_IMPORT_FRAME_SLOT","AI_SITE_IMPORT_LEFT_OUT_COPY","AI_SITE_IMPORT_LEFT_OUT_REASONS","AI_SITE_IMPORT_UNREAD_REASONS","aiSiteImportNextWave","aiSiteImportPagesText","aiSiteImportQuoteText","aiSiteImportReadStops","aiSiteImportReadVerdictMessage","aiSiteImportReadVerdictReason","aiSiteImportRemainingCreditRange","aiSiteImportReviewWave","aiSiteImportRunningWave","aiSiteImportWaveCreditRange","aiSiteImportWaveOwed","AI_SITE_IMPORT_PLAN_COPY","AI_SITE_IMPORT_ROLE_COPY","aiSiteImportOfferOf","offer","state","claims","reason","message","aiSiteImportPhaseOf","job","siteImport","stopped","verdict","status","review","aiSiteImportHeldCopy","fromState","domain","heading","action","aiSiteImportStoppedCopy","waves","some","wave","startedAt","rowState","row","active","aiSiteImportPhotosText","photos","skipped","Math","max","into","brought","reused","added","filter","Boolean","join","parts","tried","BUILD_COPY","copied","arranged","aiSiteImportWaveRows","items","Map","map","slot","running","activeTaken","rows","frame","get","push","title","from","to","note","failure","outputId","outputs","oldPage","words","build","slots","page","pages","find","entry","path","slug","refused","url","toLocaleString","read","aiSiteImportWaveQuote","range","aiSiteImportWaveSpent","Set","has","reduce","total","creditsSpent","creditsRefunded","aiSiteImportUnreadCount","leftOutCount","aiSiteImportFoundText","groups","group","label","listed","length","slice","found","lead","unread","aiSiteImportStopText","unreached","first","rest","stoppedBy","aiSiteImportVerdictNote","kind","aiSiteImportPlanText","kept","plan","pageLimit","existingPages","stop","aiSiteImportLeftOutLines","count","text","paths","leftOut","line","sort","a","b","aiSiteImportStartAction","quote","aiSiteImportStartAllAction"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;2CAQ2C,GAE3C,SAASA,mBAAmB,QAAQ,wCAAuC;AAC3E,SA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c;IAAM;AACvF;AAEA;;;CAGC,GACD,OAAO,SAASmG,2BACdjH,GAA+C;QAEjCA,iBAMqDA;IANnE,MAAML,SAAQK,kBAAAA,IAAIC,UAAU,YAAdD,kBAAkB;IAChC,IAAI,CAACL,SAAS,CAACf,qBAAqBe,QAAQ,OAAO;IACnD,MAAMiB,QAAQjB,MAAMiB,KAAK,CAACgB,MAAM,CAAC,CAACd,OAASA,KAAKV,MAAM,KAAK,WAAWgF,MAAM;IAC5E,IAAIxE,QAAQ,GAAG,OAAO;IACtB,OAAO;QACLsE,OAAO;QACP8B,OAAOzI,kBAAkBW,iCAAiCS,QAAOK,aAAAA,IAAIqC,KAAK,YAATrC,aAAa;QAC9EY;IACF;AACF"}
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import type { SiteImportBlock, SiteImportForm } from '../site-import/site-import-html';
17
+ import type { SiteImportBlock, SiteImportForm, SiteImportVideo } from '../site-import/site-import-html';
18
18
  import { type AiCreditRange } from './ai-credit-estimate';
19
19
  import type { AiJobItemLedger } from './ai-jobs.types';
20
20
  /** The job kind. */
@@ -152,13 +152,41 @@ export type SiteImportButtonStyle = 'primary' | 'secondary' | 'quiet';
152
152
  /** What a repeated group of the source is. */
153
153
  export type SiteImportGroupKind = 'cards' | 'steps' | 'stats' | 'faq' | 'quotes' | 'logos' | 'pricing' | 'list' | 'text';
154
154
  export declare const SITE_IMPORT_GROUP_KINDS: readonly SiteImportGroupKind[];
155
- /** One line in place. `role` only where the source's own styling says it (an uppercase eyebrow, a large lede, a small note). */
155
+ /**
156
+ * One line in place. `role` only where the source's own styling says it (an
157
+ * uppercase eyebrow, a large lede, a large bold statement, a small note).
158
+ */
156
159
  export interface SiteImportLayoutLine {
157
160
  kind: 'line';
158
161
  line: SiteImportLineRef;
159
- role?: 'eyebrow' | 'lede' | 'note';
162
+ role?: 'eyebrow' | 'lede' | 'statement' | 'note';
160
163
  /** The source draws this line (a link, or a `<button>`'s words) as a button. Its destination is the link block's `href`. */
161
164
  button?: SiteImportButtonStyle;
165
+ /** An eyebrow the source sets in a pill of its own: a fill or a border, its corners rounded (AGL-4138). */
166
+ chip?: true;
167
+ /** An eyebrow's color as the source shows it, `#rrggbb` over the ground it sits on (AGL-4138). */
168
+ color?: string;
169
+ }
170
+ /**
171
+ * How the source frames a picture (AGL-4138): the shape its own `width` and
172
+ * `height` give it, the box it crops it to, its fit in that box, its corners
173
+ * and its shadow. A source that draws a picture at `width: 100%; height:
174
+ * auto` crops nothing, and a page brought in shows it whole.
175
+ */
176
+ export interface SiteImportPictureFit {
177
+ /** The picture's own shape, width over height, from its `width` and `height` attributes. */
178
+ ratio?: number;
179
+ /** A shape the source crops it to, width over height: an `aspect-ratio` on it or its box. */
180
+ box?: number;
181
+ /** A height in px the source crops it to, at whatever width its column gives it. */
182
+ height?: number;
183
+ objectFit?: 'cover' | 'contain';
184
+ /** Its corners' radius in px, on it or its box; 999 for a round one. */
185
+ radius?: number;
186
+ /** It, or its box, is set on a shadow. */
187
+ shadow?: true;
188
+ /** A width in px the source holds it to, its `max-width` or its box's: a film's card narrower than its column. */
189
+ measure?: number;
162
190
  }
163
191
  /** A picture in place: an image block. */
164
192
  export interface SiteImportLayoutPicture {
@@ -168,6 +196,25 @@ export interface SiteImportLayoutPicture {
168
196
  href?: string;
169
197
  /** It sits in a `<button>` (a video's poster, a lightbox): the picture is kept, the button is not a destination. */
170
198
  button?: true;
199
+ /** How the source frames it (AGL-4138). */
200
+ fit?: SiteImportPictureFit;
201
+ }
202
+ /**
203
+ * A filled square an icon sits in (AGL-4138): its fill and corners, and the
204
+ * icon's own color in it, as the source draws them, `#rrggbb`.
205
+ */
206
+ export interface SiteImportIconTile {
207
+ fill: string;
208
+ radius: number;
209
+ color: string | null;
210
+ }
211
+ /** A line the source draws along one side of each item of a group, in place of a box (AGL-4138): a step's rule. */
212
+ export interface SiteImportRule {
213
+ side: 'top' | 'right' | 'bottom' | 'left';
214
+ /** Its width in px. */
215
+ width: number;
216
+ /** Its color, `#rrggbb`; `null` where the source draws it in the words' own. */
217
+ color: string | null;
171
218
  }
172
219
  /** An icon standing on its own, by index into `SiteImportLayout.icons`. */
173
220
  export interface SiteImportLayoutIcon {
@@ -179,6 +226,20 @@ export interface SiteImportLayoutForm {
179
226
  kind: 'form';
180
227
  form: number;
181
228
  }
229
+ /**
230
+ * Where one of the page's videos sat (AGL-4140), by index into
231
+ * `AiSiteImportPageRead.videos`. Its poster, when the source shows one, is an
232
+ * image line: the film's first paint, copied into the library as any picture.
233
+ */
234
+ export interface SiteImportLayoutVideo {
235
+ kind: 'video';
236
+ video: number;
237
+ poster?: SiteImportLineRef;
238
+ /** How the source frames its poster (AGL-4138), as it frames any picture. */
239
+ fit?: SiteImportPictureFit;
240
+ /** The box the source plays it in casts a shadow. */
241
+ shadow?: true;
242
+ }
182
243
  /**
183
244
  * A row of columns side by side; `cols` are relative widths in twelfths
184
245
  * (`[4, 8]`, `[1, 1, 1]`). Every list of lists is a list of objects: the
@@ -216,20 +277,36 @@ export interface SiteImportLayoutItem {
216
277
  /** What its price is for, beside the price: "/mo" (AGL-4083). */
217
278
  period?: SiteImportLineRef;
218
279
  image?: SiteImportLineRef;
280
+ /** How the source frames its picture (AGL-4138). */
281
+ imageFit?: SiteImportPictureFit;
219
282
  /** The icon that leads it, by index into `SiteImportLayout.icons`. */
220
283
  icon?: number;
284
+ /** The filled square its lead icon sits in (AGL-4138). */
285
+ tile?: SiteImportIconTile;
286
+ /** A second icon at the end of its first row, as an arrow that it is a link (AGL-4138), by index into `SiteImportLayout.icons`. */
287
+ mark?: number;
288
+ /** Its figure is drawn in the muted words' color, not the brand's (AGL-4138). */
289
+ figureMuted?: true;
221
290
  /** The icon each of its bullet points carries (a check mark), when they share one. */
222
291
  listIcon?: number;
223
292
  /** Where the item goes as a whole: its title link's address. */
224
293
  to?: string;
294
+ /** The video it holds (AGL-4140), by index into the read's videos; its poster is its `image`. */
295
+ video?: number;
225
296
  }
226
297
  export interface SiteImportLayoutGroup {
227
298
  kind: 'group';
228
299
  group: SiteImportGroupKind;
229
300
  /** Columns the source lays the items out in on a wide screen. */
230
301
  columns: number;
231
- /** Each item is drawn as a box (a border, a shadow or a fill of its own). */
302
+ /** Columns on a tablet, where the source sets fewer there than on a wide screen (AGL-4138). */
303
+ columnsSm?: number;
304
+ /** Each item is drawn as a box: a shadow, a fill of its own, or a border on two sides or more. */
232
305
  boxed: boolean;
306
+ /** Each item is drawn with a line along one side and no box (AGL-4138). */
307
+ rule?: SiteImportRule;
308
+ /** How the items' words are set, where it is not the section's alignment (AGL-4138). */
309
+ align?: 'start' | 'center';
233
310
  /**
234
311
  * Each item is a row of its own, its parts side by side, one under another:
235
312
  * a plan's name, words and button, or a label and its value (AGL-4083).
@@ -257,7 +334,7 @@ export interface SiteImportLayoutTabs {
257
334
  panel: SiteImportLayoutNode[];
258
335
  }>;
259
336
  }
260
- export type SiteImportLayoutNode = SiteImportLayoutLine | SiteImportLayoutPicture | SiteImportLayoutIcon | SiteImportLayoutForm | SiteImportLayoutRow | SiteImportLayoutGroup | SiteImportLayoutTable | SiteImportLayoutTabs;
337
+ export type SiteImportLayoutNode = SiteImportLayoutLine | SiteImportLayoutPicture | SiteImportLayoutIcon | SiteImportLayoutForm | SiteImportLayoutVideo | SiteImportLayoutRow | SiteImportLayoutGroup | SiteImportLayoutTable | SiteImportLayoutTabs;
261
338
  /** Where the hero's picture sits against its words. */
262
339
  export type SiteImportHeroPicture = 'beside' | 'behind' | 'below' | 'above';
263
340
  export interface SiteImportLayoutSection {
@@ -268,12 +345,16 @@ export interface SiteImportLayoutSection {
268
345
  band: SiteImportBand;
269
346
  /** Its background color as `#rrggbb`, when it has one. */
270
347
  background: string | null;
271
- /** A gradient or a photo behind it. */
348
+ /** A gradient, a photo, or a film playing on its own behind it (AGL-4140), its poster an image line. */
272
349
  backdrop?: {
273
350
  kind: 'gradient';
274
351
  } | {
275
352
  kind: 'picture';
276
353
  url: string;
354
+ } | {
355
+ kind: 'video';
356
+ video: number;
357
+ poster?: SiteImportLineRef;
277
358
  };
278
359
  align: 'start' | 'center';
279
360
  /**
@@ -330,6 +411,12 @@ export interface SiteImportLookFacts {
330
411
  link: string | null;
331
412
  /** Its header bar's background. */
332
413
  header: string | null;
414
+ /**
415
+ * The color most of its eyebrows are drawn in, where that is a color of its
416
+ * own: none of its text's, its buttons' or white (AGL-4138). The look pass
417
+ * pins it as the theme's third color. Absent on a read made before.
418
+ */
419
+ eyebrow?: string | null;
333
420
  }
334
421
  /** A page's layout, as the source lays it out (AGL-4106). */
335
422
  export interface SiteImportLayout {
@@ -350,6 +437,37 @@ export interface SiteImportNavEntry {
350
437
  viewBox?: string;
351
438
  /** The heading of the menu's column it sits in ("By team"). */
352
439
  column?: string;
440
+ /** The column of its panel it sits in, by index into its group's `columns` (AGL-4139). */
441
+ at?: number;
442
+ /** The filled box its icon sits in, as the source draws it (AGL-4139): its fill, corners and the icon's own color. */
443
+ tile?: {
444
+ fill: string;
445
+ radius: number;
446
+ color: string | null;
447
+ };
448
+ }
449
+ /**
450
+ * One column of a menu's panel as the source sets it (AGL-4139): its heading,
451
+ * its other lines of words, the fill it sits on, the picture it shows, and
452
+ * its own width. A footer's filled box is read the same way, with its links.
453
+ */
454
+ export interface SiteImportNavColumn {
455
+ heading: string | null;
456
+ /** Its words outside its links, after its heading, as written. */
457
+ lines: string[];
458
+ /** The fill it sits on against its panel's: none, a light one, the brand's, or a dark one. */
459
+ band: SiteImportBand;
460
+ /** The picture it shows outside its links (a featured card's), with `src` once the look pass brings it into the library. */
461
+ image?: {
462
+ url: string;
463
+ alt: string;
464
+ };
465
+ /** Its own width in CSS pixels, where the source sets one. */
466
+ width?: number;
467
+ /** A footer box's links, as written (AGL-4139). */
468
+ links?: SiteImportFooterLink[];
469
+ /** The icon beside its heading, one path on a 24-unit square. */
470
+ iconPath?: string;
353
471
  }
354
472
  /** A top-level item of the source's menu: a link, or a menu of entries under a name. */
355
473
  export interface SiteImportNavGroup {
@@ -358,6 +476,16 @@ export interface SiteImportNavGroup {
358
476
  href: string | null;
359
477
  /** Empty for a plain link. */
360
478
  items: SiteImportNavEntry[];
479
+ /** Its panel's columns side by side, in the source's order (AGL-4139); absent on a read made before. */
480
+ columns?: SiteImportNavColumn[];
481
+ /**
482
+ * Its panel (AGL-4139): how wide the source caps it, and whether it opens
483
+ * on hover — hidden until shown, under a name that is not a button.
484
+ */
485
+ panel?: {
486
+ width: number | null;
487
+ hover: boolean;
488
+ };
361
489
  }
362
490
  /** A button in the source's header outside its menu ("Sign in", "Start free"). */
363
491
  export interface SiteImportNavCta {
@@ -397,6 +525,10 @@ export interface SiteImportFooter {
397
525
  email: string | null;
398
526
  /** Its © line, word for word. */
399
527
  copyright: string | null;
528
+ /** It opens with the site's logo (AGL-4139). */
529
+ logo?: boolean;
530
+ /** Its filled boxes, each with its heading, words and links (AGL-4139), which `text` and `links` then leave out. */
531
+ panels?: SiteImportNavColumn[];
400
532
  }
401
533
  /** Every line a layout's nodes place, in order. */
402
534
  export declare function siteImportLayoutLines(nodes: readonly SiteImportLayoutNode[]): SiteImportLineRef[];
@@ -409,6 +541,62 @@ export declare function siteImportLayoutChars(layout: SiteImportLayout | null |
409
541
  export declare function siteImportLayoutWithin(layout: SiteImportLayout, count: number): SiteImportLayout;
410
542
  /** Nodes with only the lines `keep` keeps; what is left empty goes. */
411
543
  export declare function siteImportFilterNodes(list: readonly SiteImportLayoutNode[], keep: (ref: SiteImportLineRef) => boolean): SiteImportLayoutNode[];
544
+ /** The words that name a control as one that plays a film: a facade's label, a "Watch the film" button. */
545
+ export declare const SITE_IMPORT_PLAY_WORDS: RegExp;
546
+ /**
547
+ * Where a video of a page brought in plays from on the new page, or `null`
548
+ * where the Video element cannot play it: a link to a video host whose
549
+ * player the element frames (`hosted`), else the file the old site serves at
550
+ * an https address, which the new page plays from that address. A video on
551
+ * any other host is shown as its poster, linking to it.
552
+ */
553
+ export declare function siteImportFilmSource(video: Pick<SiteImportVideo, 'src' | 'embed'> | null | undefined): {
554
+ src: string;
555
+ hosted: boolean;
556
+ } | null;
557
+ /**
558
+ * The films a page brought in plays from the old site's own address
559
+ * (AGL-4140): the https file of each video its layout places where it sits or
560
+ * in an item, which the Video element plays because its poster is in the
561
+ * library. A film on a host's player, one behind a section's words (drawn as
562
+ * its poster), and one with no poster the library holds play nothing from
563
+ * the old site. The rule the compile places a film by (`filmPlaces`).
564
+ */
565
+ export declare function aiSiteImportOwnFilms(read: Pick<AiSiteImportPageRead, 'videos' | 'layout' | 'blocks'> | null | undefined, photos: ReadonlyArray<{
566
+ from?: string;
567
+ }>): string[];
568
+ /**
569
+ * The most hosts a site approves of one kind: `APPROVED_IMAGE_HOSTS_MAX` in
570
+ * `security-origins.js`, the tenant policy's own ceiling, which a spec holds
571
+ * this to.
572
+ */
573
+ export declare const SITE_IMPORT_APPROVED_HOSTS_MAX = 50;
574
+ /**
575
+ * A host as the Security tab keeps one and the tenant's policy reads it
576
+ * (`normalizeApprovedImageHost` in `security-origins.js`, which a spec holds
577
+ * this to): lowercase, a hostname with at least one dot and a letter-only
578
+ * last label, an optional leading `*.`, and no scheme, path, port or
579
+ * separator; `null` for anything else.
580
+ */
581
+ export declare function siteImportApprovedHost(value: unknown): string | null;
582
+ /**
583
+ * A site's approved media hosts with the old site's film hosts added
584
+ * (AGL-4140): every entry the owner has kept as it is and where it is, each
585
+ * new host once, after them, within `SITE_IMPORT_APPROVED_HOSTS_MAX`; `null`
586
+ * when nothing is added.
587
+ */
588
+ export declare function siteImportApprovedHostsWith(current: unknown, addresses: readonly string[]): string[] | null;
589
+ /**
590
+ * What a page's row says of its videos (AGL-4140), or `null`: a film the old
591
+ * site serves itself plays from there, the owner may move it, and its address
592
+ * was approved for the site to play (`approved`, once the host write is in);
593
+ * a film the source showed no poster for is left out, since its poster is the
594
+ * button a visitor presses, and the owner may add it with one.
595
+ */
596
+ export declare function aiSiteImportVideoNote(videos: readonly SiteImportVideo[] | null | undefined, own?: {
597
+ films: number;
598
+ approved: boolean;
599
+ }): string | null;
412
600
  /** A layout with its icons' drawings dropped, for a page that must be lighter. */
413
601
  export declare function siteImportLayoutWithoutDrawings(layout: SiteImportLayout): SiteImportLayout;
414
602
  /** What a wave's read found on one page, for its model answer. Never on the wire. */
@@ -453,6 +641,13 @@ export interface AiSiteImportPageRead {
453
641
  title: string;
454
642
  description: string;
455
643
  };
644
+ /**
645
+ * The videos the page shows (AGL-4140), which its layout places by index:
646
+ * where each plays from, its poster's address and what a search engine
647
+ * reads of it. Untrusted data. Absent on a page that shows none, or a read
648
+ * made before they were kept; emptied with `blocks` once the page is in.
649
+ */
650
+ videos?: SiteImportVideo[];
456
651
  }
457
652
  /** How a page is built from its old page, as the step chose: its words copied as they are, or arranged by Aglyn AI. */
458
653
  export type AiSiteImportBuild = 'copied' | 'arranged';
@@ -573,6 +768,8 @@ export interface AiSiteImportHome {
573
768
  title: string;
574
769
  description: string;
575
770
  ogImage: string | null;
771
+ /** The site's icon its head names (AGL-4139): its largest touch icon, else its largest picture icon. Absent on a read made before. */
772
+ favicon?: string | null;
576
773
  siteName: string;
577
774
  brand: {
578
775
  kind: 'logo-only' | 'logo-and-name' | 'name-only';
@@ -619,6 +816,8 @@ export interface AiSiteImportLook {
619
816
  colors: string[];
620
817
  /** The source's logo, as the library holds it, for the header's brand. */
621
818
  logo: AiSiteImportPhoto | null;
819
+ /** The pictures the home page's menus show (AGL-4139), as the library holds them, each by the address it came `from`. */
820
+ pictures?: AiSiteImportPhoto[];
622
821
  /** Whether the site's listing was taken from the home page's own words. */
623
822
  seo: boolean;
624
823
  /** The look's seed, which every page of the import is drawn with. */