@aglyn/plugins-ai 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/lib/jobs/ai-job-import-step.d.ts +28 -2
- package/src/lib/jobs/ai-job-import-step.js +170 -14
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +2 -0
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.js +6 -2
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +13 -3
- package/src/lib/jobs/ai-site-import-compile.js +336 -27
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +3 -1
- package/src/lib/jobs/ai-site-import-document.js +36 -0
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-look.d.ts +9 -0
- package/src/lib/jobs/ai-site-import-look.js +89 -6
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +16 -0
- package/src/lib/layout-language/ai-layout-compiler.js +351 -54
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +88 -2
- package/src/lib/layout-language/ai-layout-frame-source.js +591 -30
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.js +30 -18
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +72 -3
- package/src/lib/layout-language/ai-layout-language.js +5 -3
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/layout-language/ai-layout-store.d.ts +8 -0
- package/src/lib/layout-language/ai-layout-store.js +32 -6
- package/src/lib/layout-language/ai-layout-store.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +31 -1
- package/src/lib/model/ai-site-import-fidelity.js +347 -25
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +203 -6
- package/src/lib/model/ai-site-import.js +161 -5
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +8 -1
- package/src/lib/model/ai-site-look.js +8 -5
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -1
- package/src/lib/runtime/ai-doctrine-validators.js +25 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.js +19 -2
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-page-links.d.ts +15 -0
- package/src/lib/runtime/ai-page-links.js +48 -0
- package/src/lib/runtime/ai-page-links.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +30 -5
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +9 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +24 -5
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-crawl.d.ts +3 -1
- package/src/lib/site-import/site-import-crawl.js +8 -3
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.d.ts +20 -0
- package/src/lib/site-import/site-import-css.js +106 -0
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +39 -0
- package/src/lib/site-import/site-import-html.js +515 -5
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.d.ts +16 -6
- package/src/lib/site-import/site-import-layout.js +524 -52
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/site-import/site-import-nav.js +286 -24
- package/src/lib/site-import/site-import-nav.js.map +1 -1
- package/src/lib/site-import/site-import-page.js +3 -0
- package/src/lib/site-import/site-import-page.js.map +1 -1
|
@@ -57,6 +57,7 @@ import { SITE_LAYOUT_PAGES, siteLayoutRecording, siteLayoutSameSite } from "./si
|
|
|
57
57
|
}
|
|
58
58
|
/** A recorded page as a wave's read keeps it and the import step hands it on: its blocks, its layout, its photos in the library. */ export function siteImportReplayDocument(name) {
|
|
59
59
|
var _read_blocks;
|
|
60
|
+
var _read_videos;
|
|
60
61
|
const { url } = SITE_LAYOUT_PAGES[name];
|
|
61
62
|
const page = extractSiteImportPage(siteLayoutRecording(name), url, siteLayoutSameSite(name), {
|
|
62
63
|
structure: true
|
|
@@ -96,6 +97,8 @@ import { SITE_LAYOUT_PAGES, siteLayoutRecording, siteLayoutSameSite } from "./si
|
|
|
96
97
|
]
|
|
97
98
|
}, read.layout ? {
|
|
98
99
|
layout: read.layout
|
|
100
|
+
} : {}, ((_read_videos = read.videos) == null ? void 0 : _read_videos.length) ? {
|
|
101
|
+
videos: read.videos
|
|
99
102
|
} : {});
|
|
100
103
|
}
|
|
101
104
|
/**
|
|
@@ -241,6 +244,11 @@ const NOW = new Date('2026-10-29T18:00:00.000Z');
|
|
|
241
244
|
'/classes',
|
|
242
245
|
'/gallery'
|
|
243
246
|
];
|
|
247
|
+
const home = aiSiteImportHomeOf({
|
|
248
|
+
pages: [
|
|
249
|
+
crawledHome(name)
|
|
250
|
+
]
|
|
251
|
+
});
|
|
244
252
|
const pages = paths.map((path, index)=>{
|
|
245
253
|
const slug = path === '/' ? '/' : path.split('/').filter(Boolean).pop();
|
|
246
254
|
return {
|
|
@@ -288,11 +296,7 @@ const NOW = new Date('2026-10-29T18:00:00.000Z');
|
|
|
288
296
|
frame: {
|
|
289
297
|
draftId: 'frameDraft'
|
|
290
298
|
},
|
|
291
|
-
home
|
|
292
|
-
pages: [
|
|
293
|
-
crawledHome(name)
|
|
294
|
-
]
|
|
295
|
-
}),
|
|
299
|
+
home,
|
|
296
300
|
look: {
|
|
297
301
|
at: NOW.toISOString(),
|
|
298
302
|
theme: 'applied',
|
|
@@ -303,11 +307,32 @@ const NOW = new Date('2026-10-29T18:00:00.000Z');
|
|
|
303
307
|
width: 632,
|
|
304
308
|
height: 192
|
|
305
309
|
} : null,
|
|
310
|
+
// The menus' pictures, in the library as the look pass brings them in (AGL-4139).
|
|
311
|
+
pictures: siteImportMenuPictures(home).map((from, index)=>({
|
|
312
|
+
mediaId: `mp${index}`,
|
|
313
|
+
src: `media:host-import/mp${index}`,
|
|
314
|
+
from,
|
|
315
|
+
width: 1200,
|
|
316
|
+
height: 750
|
|
317
|
+
})),
|
|
306
318
|
seo: true,
|
|
307
319
|
seed: 7
|
|
308
320
|
}
|
|
309
321
|
};
|
|
310
322
|
}
|
|
323
|
+
/** The pictures a home page's menus show, each once: what the look pass brings in. */ function siteImportMenuPictures(home) {
|
|
324
|
+
var _ref;
|
|
325
|
+
var _home_nav;
|
|
326
|
+
const urls = ((_ref = home == null ? void 0 : (_home_nav = home.nav) == null ? void 0 : _home_nav.items) != null ? _ref : []).flatMap((group)=>{
|
|
327
|
+
var _group_columns;
|
|
328
|
+
return ((_group_columns = group.columns) != null ? _group_columns : []).flatMap((column)=>column.image ? [
|
|
329
|
+
column.image.url
|
|
330
|
+
] : []);
|
|
331
|
+
});
|
|
332
|
+
return [
|
|
333
|
+
...new Set(urls)
|
|
334
|
+
];
|
|
335
|
+
}
|
|
311
336
|
/** A recorded home page's header and footer, drawn with no model as the layout step stores them (AGL-4108). */ export function siteImportReplayFrame(name) {
|
|
312
337
|
var _frameJob_plan, _ref, _ref1, _ref2, _ref3;
|
|
313
338
|
var _frameJob_inputs, _state_home, _built_value, _state_home1, _state_home2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/ai/src/lib/site-import/fixtures/site-import-fidelity-replay.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The recorded pages brought in again, offline (AGL-4109), for the fidelity\n * spec and the fidelity report: each page of `site-layout/` read by the\n * reader, built by the import's compile and held to its page check as the\n * page step stores it, and each recorded home page's header and footer drawn\n * as the frame step draws them, with no model. Every page the source links\n * on its own site is a page the import plans, as on a whole-site import. No\n * live AI: a design answer here is a recorded one, in the shape the tool\n * answers.\n */\n\nimport { aiImportedPageCheck } from '../../jobs/ai-job-page-language'\nimport { aiSiteImportFrameJob, aiSiteImportHomeOf } from '../../jobs/ai-job-import-step'\nimport { aiLayoutSiteBrandOf, aiLayoutSiteFrameOf, aiLayoutSourceFrameBuild } from '../../jobs/ai-job-layout-language'\nimport { aiLayoutChecks } from '../../jobs/ai-job-layout-step'\nimport { aiSiteImportSectionNames } from '../../jobs/ai-site-import-compile'\nimport type { AiSiteImportDocument } from '../../jobs/ai-site-import-document'\nimport type { AiLayoutFrameSource } from '../../layout-language/ai-layout-frame-source'\nimport type { AiJob } from '../../model/ai-jobs.types'\nimport { aiSiteImportLedger, type AiSiteImportPage, type AiSiteImportState, type SiteImportFooter, type SiteImportNavTree } from '../../model/ai-site-import'\nimport type { SiteImportFidelitySource, SiteImportFidelityTree } from '../../model/ai-site-import-fidelity'\nimport { emptyAiSiteInventory } from '../../model/ai-site-inventory'\nimport type { SiteImportInventory } from '../site-import-crawl'\nimport { extractSiteImportPage, type SiteImportBlock } from '../site-import-html'\nimport { siteImportLayout, siteImportLookOf } from '../site-import-layout'\nimport { siteImportFooterColumns, siteImportNavTree, type SiteImportFrameSource } from '../site-import-nav'\nimport { siteImportPageRead } from '../site-import-page'\nimport { SITE_LAYOUT_PAGES, siteLayoutRecording, siteLayoutSameSite, type SiteLayoutPageName } from './site-layout-recordings'\n\n/** The page's same-site addresses, each a page the import plans: every page a link may go to. */\nfunction plannedLinks(blocks: readonly SiteImportBlock[], origin: string): Array<{ path: string; id: string }> {\n const paths = new Set<string>()\n for (const block of blocks) {\n if (block.kind !== 'link') continue\n try {\n const url = new URL(block.href)\n const path = url.pathname.replace(/\\/+$/, '') || '/'\n if (url.origin === origin && path !== '/') paths.add(path)\n } catch {\n // Not an address.\n }\n }\n return [...paths].map((path) => ({ path, id: `p${path.replace(/[^a-z0-9]+/gi, '-')}` }))\n}\n\n/** A recorded page as a wave's read keeps it and the import step hands it on: its blocks, its layout, its photos in the library. */\nexport function siteImportReplayDocument(name: SiteLayoutPageName): AiSiteImportDocument {\n const { url } = SITE_LAYOUT_PAGES[name]\n const page = extractSiteImportPage(siteLayoutRecording(name), url, siteLayoutSameSite(name), { structure: true })\n const layout = siteImportLayout(page as Parameters<typeof siteImportLayout>[0])\n const path = new URL(url).pathname\n const read = siteImportPageRead({ ...page, layout, url, path, foundBy: path === '/' ? 'home' : 'sitemap', bytes: 0 } as never, 'now')\n const blocks = read.blocks ?? []\n const origin = new URL(url).origin\n const pictures = [...new Set(blocks.flatMap((block) => (block.kind === 'image' ? [block.url] : [])))]\n return {\n build: 'arranged',\n title: read.title,\n url,\n blocks,\n photos: pictures.map((from, index) => ({ mediaId: `m${index}`, src: `media:host-import/m${index}`, from, width: 1600, height: 900 })),\n links: plannedLinks(blocks, origin),\n origins: [origin, origin.replace('://', '://www.')],\n ...(read.layout ? { layout: read.layout } : {}),\n }\n}\n\n/** A recorded page built as the page step builds it: its source, its stored nodes, and what the page check said. */\nexport interface SiteImportReplayPage {\n doc: AiSiteImportDocument\n source: SiteImportFidelitySource\n tree: SiteImportFidelityTree\n violations: unknown[]\n}\n\n/**\n * A recorded page built and checked as the page step stores it (AGL-4109):\n * with a recorded design `answer`, as a main page is arranged, or with none,\n * as a page is drawn from its layout alone; `forms` are the site's saved\n * forms. `layout: false` builds it as a read with no layout was built, one\n * section at each second-level heading, as the 10/29 import did.\n */\nexport function siteImportReplayPage(\n name: SiteLayoutPageName,\n options: { answer?: Record<string, unknown> | null; forms?: Array<{ id: string; name: string }>; layout?: boolean } = {},\n): SiteImportReplayPage {\n const read = siteImportReplayDocument(name)\n const { layout, ...rest } = read\n const doc: AiSiteImportDocument = options.layout === false ? rest : read\n const names = aiSiteImportSectionNames(doc)\n const sectionIds = names.map((_, index) => `sec-${index}`)\n const screen = { title: doc.title, slug: name === 'home' ? '/' : `/${name}`, sections: names.map((section) => ({ name: section, uses: [] as string[], items: 0 })) }\n const forms = options.forms ?? []\n const targets = { pageId: 'p0', pages: [], homeIds: [], forms, formPageId: null, components: [], facts: '' }\n const check = aiImportedPageCheck({\n screen: screen as never,\n sectionIds,\n targets: targets as never,\n context: { screenIds: doc.links.map((link) => link.id), formIds: forms.map((form) => form.id), componentIds: [], codeBuilt: true },\n design: { kind: 'business', seed: 7, home: name === 'home' } as never,\n doc,\n })\n const result = check(options.answer ?? null)\n const nodes = (result.value?.nodes ?? {}) as unknown as SiteImportFidelityTree['nodes']\n return {\n doc,\n source: { layout: layout as NonNullable<typeof layout>, blocks: read.blocks, photos: read.photos },\n tree: { rootId: '_@_', nodes },\n violations: result.violations,\n }\n}\n\n/**\n * The design answer recorded for aglyn.com's Home, in the tool's shape: a\n * split hero, ruled cards, a dark band asked where the source drew its own\n * white, a style of pictures for a group that has none. The compile spec\n * holds the same one.\n */\nexport const SITE_IMPORT_REPLAY_HOME_ANSWER: Readonly<Record<string, unknown>> = {\n sections: [\n { hero: 'split', band: 'source', align: 'start', groups: [] },\n { hero: 'none', band: 'source', align: 'source', groups: [{ kind: 'source', style: 'ruled' }] },\n { hero: 'none', band: 'dark', align: 'source', groups: [] },\n { hero: 'none', band: 'source', align: 'source', groups: [{ kind: 'source', style: 'pictures' }] },\n ],\n}\n\n/** The recorded home pages a header and footer is drawn from. */\nexport type SiteImportReplayHome = Extract<SiteLayoutPageName, 'home' | 'pottery'>\n\nconst NOW = new Date('2026-10-29T18:00:00.000Z')\n\n/** A recorded home page as the crawl keeps it: its menu, footer and look read as the source builds them. */\nfunction crawledHome(name: SiteImportReplayHome): SiteImportInventory['pages'][number] {\n const { url } = SITE_LAYOUT_PAGES[name]\n const extract = extractSiteImportPage(siteLayoutRecording(name), url, siteLayoutSameSite(name), { structure: true })\n const source = extract as SiteImportFrameSource\n const { structure: _structure, loginForm: _loginForm, ...rest } = extract\n return { ...rest, url, path: '/', foundBy: 'home', bytes: 0, nav: siteImportNavTree(source), footer: siteImportFooterColumns(source), look: siteImportLookOf(source) }\n}\n\n/** A site planned for its first wave: Home, and two pages of its own. */\nfunction replayState(name: SiteImportReplayHome): AiSiteImportState {\n const origin = new URL(SITE_LAYOUT_PAGES[name].url).origin\n const paths = name === 'home' ? ['/', '/product', '/pricing'] : ['/', '/classes', '/gallery']\n const pages: AiSiteImportPage[] = paths.map((path, index) => {\n const slug = path === '/' ? '/' : (path.split('/').filter(Boolean).pop() as string)\n return { slot: `p${index}`, url: `${origin}${path}`, path, title: slug, group: 'main', wave: 1, draftId: `draft${index}`, slug, words: 300, images: 0 }\n })\n return {\n domain: new URL(origin).hostname.replace(/^www\\./, ''),\n siteName: 'import-check',\n ownership: { method: 'dns', provenAt: 1, detail: null },\n readAt: NOW.toISOString(),\n pageLimit: null,\n existingPages: 0,\n found: pages.length,\n stoppedBy: null,\n groups: [],\n pages,\n waves: [{ index: 1, label: 'Wave 1', group: 'main', slots: pages.map((page) => page.slot), frame: true, status: 'running', startedAt: NOW.toISOString(), finishedAt: null }],\n leftOut: [],\n leftOutCount: {},\n frame: { draftId: 'frameDraft' },\n home: aiSiteImportHomeOf({ pages: [crawledHome(name)] }),\n look: {\n at: NOW.toISOString(),\n theme: 'applied',\n colors: [],\n logo: name === 'home' ? { mediaId: 'm1', src: 'media:host-import/m1', width: 632, height: 192 } : null,\n seo: true,\n seed: 7,\n },\n }\n}\n\n/** A recorded home page's header and footer as the frame step draws them: the source's menu and footer, the stored nodes, the check's word. */\nexport interface SiteImportReplayFrame {\n nav: SiteImportNavTree | null\n footer: SiteImportFooter | null\n tree: SiteImportFidelityTree\n violations: unknown[]\n}\n\n/** A recorded home page's header and footer, drawn with no model as the layout step stores them (AGL-4108). */\nexport function siteImportReplayFrame(name: SiteImportReplayHome): SiteImportReplayFrame {\n const state = replayState(name)\n const job = {\n $id: 'importJob',\n orgId: 'org-replay',\n hostId: 'host-replay',\n kind: 'import',\n status: 'running',\n brief: `Bring in ${state.domain}`,\n inputs: { domain: state.domain },\n steps: [],\n outputs: [],\n createdBy: 'uid-replay',\n createdAt: NOW,\n updatedAt: NOW,\n expiresAt: NOW,\n } as unknown as AiJob\n const frameJob = aiSiteImportFrameJob(job, state, state.waves[0] as AiSiteImportState['waves'][number], aiSiteImportLedger(state))\n const home = state.pages[0] as AiSiteImportPage\n const built = aiLayoutSourceFrameBuild({\n siteName: String(frameJob.inputs?.['businessName']),\n homeId: home.draftId,\n pages: [{ id: home.draftId, label: 'Home', slug: '/' }],\n targets: { pageId: null, pages: [], homeIds: [home.draftId], forms: [], formPageId: null, components: [], facts: '' } as never,\n extend: aiLayoutChecks(emptyAiSiteInventory('host-replay'), frameJob.plan ?? null, [frameJob.brief, ...(state.home?.facts.lines ?? [])].join('\\n')),\n brand: aiLayoutSiteBrandOf(frameJob.inputs),\n source: aiLayoutSiteFrameOf(frameJob.inputs) as AiLayoutFrameSource,\n })\n const nodes = (built.value?.nodes ?? {}) as unknown as SiteImportFidelityTree['nodes']\n return { nav: state.home?.nav ?? null, footer: state.home?.footer ?? null, tree: { rootId: '_@_', nodes }, violations: built.violations }\n}\n"],"names":["aiImportedPageCheck","aiSiteImportFrameJob","aiSiteImportHomeOf","aiLayoutSiteBrandOf","aiLayoutSiteFrameOf","aiLayoutSourceFrameBuild","aiLayoutChecks","aiSiteImportSectionNames","aiSiteImportLedger","emptyAiSiteInventory","extractSiteImportPage","siteImportLayout","siteImportLookOf","siteImportFooterColumns","siteImportNavTree","siteImportPageRead","SITE_LAYOUT_PAGES","siteLayoutRecording","siteLayoutSameSite","plannedLinks","blocks","origin","paths","Set","block","kind","url","URL","href","path","pathname","replace","add","map","id","siteImportReplayDocument","name","read","page","structure","layout","foundBy","bytes","pictures","flatMap","build","title","photos","from","index","mediaId","src","width","height","links","origins","siteImportReplayPage","options","result","rest","doc","names","sectionIds","_","screen","slug","sections","section","uses","items","forms","targets","pageId","pages","homeIds","formPageId","components","facts","check","context","screenIds","link","formIds","form","componentIds","codeBuilt","design","seed","home","answer","nodes","value","source","tree","rootId","violations","SITE_IMPORT_REPLAY_HOME_ANSWER","hero","band","align","groups","style","NOW","Date","crawledHome","extract","_structure","loginForm","_loginForm","nav","footer","look","replayState","split","filter","Boolean","pop","slot","group","wave","draftId","words","images","domain","hostname","siteName","ownership","method","provenAt","detail","readAt","toISOString","pageLimit","existingPages","found","length","stoppedBy","waves","label","slots","frame","status","startedAt","finishedAt","leftOut","leftOutCount","at","theme","colors","logo","seo","siteImportReplayFrame","frameJob","state","built","job","$id","orgId","hostId","brief","inputs","steps","outputs","createdBy","createdAt","updatedAt","expiresAt","String","homeId","extend","plan","lines","join","brand"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GAED,SAASA,mBAAmB,QAAQ,qCAAiC;AACrE,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,mCAA+B;AACxF,SAASC,mBAAmB,EAAEC,mBAAmB,EAAEC,wBAAwB,QAAQ,uCAAmC;AACtH,SAASC,cAAc,QAAQ,mCAA+B;AAC9D,SAASC,wBAAwB,QAAQ,uCAAmC;AAI5E,SAASC,kBAAkB,QAAsG,gCAA4B;AAE7J,SAASC,oBAAoB,QAAQ,mCAA+B;AAEpE,SAASC,qBAAqB,QAA8B,yBAAqB;AACjF,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,2BAAuB;AAC1E,SAASC,uBAAuB,EA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* Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The recorded pages brought in again, offline (AGL-4109), for the fidelity\n * spec and the fidelity report: each page of `site-layout/` read by the\n * reader, built by the import's compile and held to its page check as the\n * page step stores it, and each recorded home page's header and footer drawn\n * as the frame step draws them, with no model. Every page the source links\n * on its own site is a page the import plans, as on a whole-site import. No\n * live AI: a design answer here is a recorded one, in the shape the tool\n * answers.\n */\n\nimport { aiImportedPageCheck } from '../../jobs/ai-job-page-language'\nimport { aiSiteImportFrameJob, aiSiteImportHomeOf } from '../../jobs/ai-job-import-step'\nimport { aiLayoutSiteBrandOf, aiLayoutSiteFrameOf, aiLayoutSourceFrameBuild } from '../../jobs/ai-job-layout-language'\nimport { aiLayoutChecks } from '../../jobs/ai-job-layout-step'\nimport { aiSiteImportSectionNames } from '../../jobs/ai-site-import-compile'\nimport type { AiSiteImportDocument } from '../../jobs/ai-site-import-document'\nimport type { AiLayoutFrameSource } from '../../layout-language/ai-layout-frame-source'\nimport type { AiJob } from '../../model/ai-jobs.types'\nimport { aiSiteImportLedger, type AiSiteImportPage, type AiSiteImportState, type SiteImportFooter, type SiteImportNavTree } from '../../model/ai-site-import'\nimport type { SiteImportFidelitySource, SiteImportFidelityTree } from '../../model/ai-site-import-fidelity'\nimport { emptyAiSiteInventory } from '../../model/ai-site-inventory'\nimport type { SiteImportInventory } from '../site-import-crawl'\nimport { extractSiteImportPage, type SiteImportBlock } from '../site-import-html'\nimport { siteImportLayout, siteImportLookOf } from '../site-import-layout'\nimport { siteImportFooterColumns, siteImportNavTree, type SiteImportFrameSource } from '../site-import-nav'\nimport { siteImportPageRead } from '../site-import-page'\nimport { SITE_LAYOUT_PAGES, siteLayoutRecording, siteLayoutSameSite, type SiteLayoutPageName } from './site-layout-recordings'\n\n/** The page's same-site addresses, each a page the import plans: every page a link may go to. */\nfunction plannedLinks(blocks: readonly SiteImportBlock[], origin: string): Array<{ path: string; id: string }> {\n const paths = new Set<string>()\n for (const block of blocks) {\n if (block.kind !== 'link') continue\n try {\n const url = new URL(block.href)\n const path = url.pathname.replace(/\\/+$/, '') || '/'\n if (url.origin === origin && path !== '/') paths.add(path)\n } catch {\n // Not an address.\n }\n }\n return [...paths].map((path) => ({ path, id: `p${path.replace(/[^a-z0-9]+/gi, '-')}` }))\n}\n\n/** A recorded page as a wave's read keeps it and the import step hands it on: its blocks, its layout, its photos in the library. */\nexport function siteImportReplayDocument(name: SiteLayoutPageName): AiSiteImportDocument {\n const { url } = SITE_LAYOUT_PAGES[name]\n const page = extractSiteImportPage(siteLayoutRecording(name), url, siteLayoutSameSite(name), { structure: true })\n const layout = siteImportLayout(page as Parameters<typeof siteImportLayout>[0])\n const path = new URL(url).pathname\n const read = siteImportPageRead({ ...page, layout, url, path, foundBy: path === '/' ? 'home' : 'sitemap', bytes: 0 } as never, 'now')\n const blocks = read.blocks ?? []\n const origin = new URL(url).origin\n const pictures = [...new Set(blocks.flatMap((block) => (block.kind === 'image' ? [block.url] : [])))]\n return {\n build: 'arranged',\n title: read.title,\n url,\n blocks,\n photos: pictures.map((from, index) => ({ mediaId: `m${index}`, src: `media:host-import/m${index}`, from, width: 1600, height: 900 })),\n links: plannedLinks(blocks, origin),\n origins: [origin, origin.replace('://', '://www.')],\n ...(read.layout ? { layout: read.layout } : {}),\n ...(read.videos?.length ? { videos: read.videos } : {}),\n }\n}\n\n/** A recorded page built as the page step builds it: its source, its stored nodes, and what the page check said. */\nexport interface SiteImportReplayPage {\n doc: AiSiteImportDocument\n source: SiteImportFidelitySource\n tree: SiteImportFidelityTree\n violations: unknown[]\n}\n\n/**\n * A recorded page built and checked as the page step stores it (AGL-4109):\n * with a recorded design `answer`, as a main page is arranged, or with none,\n * as a page is drawn from its layout alone; `forms` are the site's saved\n * forms. `layout: false` builds it as a read with no layout was built, one\n * section at each second-level heading, as the 10/29 import did.\n */\nexport function siteImportReplayPage(\n name: SiteLayoutPageName,\n options: { answer?: Record<string, unknown> | null; forms?: Array<{ id: string; name: string }>; layout?: boolean } = {},\n): SiteImportReplayPage {\n const read = siteImportReplayDocument(name)\n const { layout, ...rest } = read\n const doc: AiSiteImportDocument = options.layout === false ? rest : read\n const names = aiSiteImportSectionNames(doc)\n const sectionIds = names.map((_, index) => `sec-${index}`)\n const screen = { title: doc.title, slug: name === 'home' ? '/' : `/${name}`, sections: names.map((section) => ({ name: section, uses: [] as string[], items: 0 })) }\n const forms = options.forms ?? []\n const targets = { pageId: 'p0', pages: [], homeIds: [], forms, formPageId: null, components: [], facts: '' }\n const check = aiImportedPageCheck({\n screen: screen as never,\n sectionIds,\n targets: targets as never,\n context: { screenIds: doc.links.map((link) => link.id), formIds: forms.map((form) => form.id), componentIds: [], codeBuilt: true },\n design: { kind: 'business', seed: 7, home: name === 'home' } as never,\n doc,\n })\n const result = check(options.answer ?? null)\n const nodes = (result.value?.nodes ?? {}) as unknown as SiteImportFidelityTree['nodes']\n return {\n doc,\n source: { layout: layout as NonNullable<typeof layout>, blocks: read.blocks, photos: read.photos },\n tree: { rootId: '_@_', nodes },\n violations: result.violations,\n }\n}\n\n/**\n * The design answer recorded for aglyn.com's Home, in the tool's shape: a\n * split hero, ruled cards, a dark band asked where the source drew its own\n * white, a style of pictures for a group that has none. The compile spec\n * holds the same one.\n */\nexport const SITE_IMPORT_REPLAY_HOME_ANSWER: Readonly<Record<string, unknown>> = {\n sections: [\n { hero: 'split', band: 'source', align: 'start', groups: [] },\n { hero: 'none', band: 'source', align: 'source', groups: [{ kind: 'source', style: 'ruled' }] },\n { hero: 'none', band: 'dark', align: 'source', groups: [] },\n { hero: 'none', band: 'source', align: 'source', groups: [{ kind: 'source', style: 'pictures' }] },\n ],\n}\n\n/** The recorded home pages a header and footer is drawn from. */\nexport type SiteImportReplayHome = Extract<SiteLayoutPageName, 'home' | 'pottery'>\n\nconst NOW = new Date('2026-10-29T18:00:00.000Z')\n\n/** A recorded home page as the crawl keeps it: its menu, footer and look read as the source builds them. */\nfunction crawledHome(name: SiteImportReplayHome): SiteImportInventory['pages'][number] {\n const { url } = SITE_LAYOUT_PAGES[name]\n const extract = extractSiteImportPage(siteLayoutRecording(name), url, siteLayoutSameSite(name), { structure: true })\n const source = extract as SiteImportFrameSource\n const { structure: _structure, loginForm: _loginForm, ...rest } = extract\n return { ...rest, url, path: '/', foundBy: 'home', bytes: 0, nav: siteImportNavTree(source), footer: siteImportFooterColumns(source), look: siteImportLookOf(source) }\n}\n\n/** A site planned for its first wave: Home, and two pages of its own. */\nfunction replayState(name: SiteImportReplayHome): AiSiteImportState {\n const origin = new URL(SITE_LAYOUT_PAGES[name].url).origin\n const paths = name === 'home' ? ['/', '/product', '/pricing'] : ['/', '/classes', '/gallery']\n const home = aiSiteImportHomeOf({ pages: [crawledHome(name)] })\n const pages: AiSiteImportPage[] = paths.map((path, index) => {\n const slug = path === '/' ? '/' : (path.split('/').filter(Boolean).pop() as string)\n return { slot: `p${index}`, url: `${origin}${path}`, path, title: slug, group: 'main', wave: 1, draftId: `draft${index}`, slug, words: 300, images: 0 }\n })\n return {\n domain: new URL(origin).hostname.replace(/^www\\./, ''),\n siteName: 'import-check',\n ownership: { method: 'dns', provenAt: 1, detail: null },\n readAt: NOW.toISOString(),\n pageLimit: null,\n existingPages: 0,\n found: pages.length,\n stoppedBy: null,\n groups: [],\n pages,\n waves: [{ index: 1, label: 'Wave 1', group: 'main', slots: pages.map((page) => page.slot), frame: true, status: 'running', startedAt: NOW.toISOString(), finishedAt: null }],\n leftOut: [],\n leftOutCount: {},\n frame: { draftId: 'frameDraft' },\n home,\n look: {\n at: NOW.toISOString(),\n theme: 'applied',\n colors: [],\n logo: name === 'home' ? { mediaId: 'm1', src: 'media:host-import/m1', width: 632, height: 192 } : null,\n // The menus' pictures, in the library as the look pass brings them in (AGL-4139).\n pictures: siteImportMenuPictures(home).map((from, index) => ({ mediaId: `mp${index}`, src: `media:host-import/mp${index}`, from, width: 1200, height: 750 })),\n seo: true,\n seed: 7,\n },\n }\n}\n\n/** The pictures a home page's menus show, each once: what the look pass brings in. */\nfunction siteImportMenuPictures(home: AiSiteImportState['home']): string[] {\n const urls = (home?.nav?.items ?? []).flatMap((group) => (group.columns ?? []).flatMap((column) => (column.image ? [column.image.url] : [])))\n return [...new Set(urls)]\n}\n\n/** A recorded home page's header and footer as the frame step draws them: the source's menu and footer, the stored nodes, the check's word. */\nexport interface SiteImportReplayFrame {\n nav: SiteImportNavTree | null\n footer: SiteImportFooter | null\n tree: SiteImportFidelityTree\n violations: unknown[]\n}\n\n/** A recorded home page's header and footer, drawn with no model as the layout step stores them (AGL-4108). */\nexport function siteImportReplayFrame(name: SiteImportReplayHome): SiteImportReplayFrame {\n const state = replayState(name)\n const job = {\n $id: 'importJob',\n orgId: 'org-replay',\n hostId: 'host-replay',\n kind: 'import',\n status: 'running',\n brief: `Bring in ${state.domain}`,\n inputs: { domain: state.domain },\n steps: [],\n outputs: [],\n createdBy: 'uid-replay',\n createdAt: NOW,\n updatedAt: NOW,\n expiresAt: NOW,\n } as unknown as AiJob\n const frameJob = aiSiteImportFrameJob(job, state, state.waves[0] as AiSiteImportState['waves'][number], aiSiteImportLedger(state))\n const home = state.pages[0] as AiSiteImportPage\n const built = aiLayoutSourceFrameBuild({\n siteName: String(frameJob.inputs?.['businessName']),\n homeId: home.draftId,\n pages: [{ id: home.draftId, label: 'Home', slug: '/' }],\n targets: { pageId: null, pages: [], homeIds: [home.draftId], forms: [], formPageId: null, components: [], facts: '' } as never,\n extend: aiLayoutChecks(emptyAiSiteInventory('host-replay'), frameJob.plan ?? null, [frameJob.brief, ...(state.home?.facts.lines ?? [])].join('\\n')),\n brand: aiLayoutSiteBrandOf(frameJob.inputs),\n source: aiLayoutSiteFrameOf(frameJob.inputs) as AiLayoutFrameSource,\n })\n const nodes = (built.value?.nodes ?? {}) as unknown as SiteImportFidelityTree['nodes']\n return { nav: state.home?.nav ?? null, footer: state.home?.footer ?? null, tree: { rootId: '_@_', nodes }, violations: built.violations }\n}\n"],"names":["aiImportedPageCheck","aiSiteImportFrameJob","aiSiteImportHomeOf","aiLayoutSiteBrandOf","aiLayoutSiteFrameOf","aiLayoutSourceFrameBuild","aiLayoutChecks","aiSiteImportSectionNames","aiSiteImportLedger","emptyAiSiteInventory","extractSiteImportPage","siteImportLayout","siteImportLookOf","siteImportFooterColumns","siteImportNavTree","siteImportPageRead","SITE_LAYOUT_PAGES","siteLayoutRecording","siteLayoutSameSite","plannedLinks","blocks","origin","paths","Set","block","kind","url","URL","href","path","pathname","replace","add","map","id","siteImportReplayDocument","name","read","page","structure","layout","foundBy","bytes","pictures","flatMap","build","title","photos","from","index","mediaId","src","width","height","links","origins","videos","length","siteImportReplayPage","options","result","rest","doc","names","sectionIds","_","screen","slug","sections","section","uses","items","forms","targets","pageId","pages","homeIds","formPageId","components","facts","check","context","screenIds","link","formIds","form","componentIds","codeBuilt","design","seed","home","answer","nodes","value","source","tree","rootId","violations","SITE_IMPORT_REPLAY_HOME_ANSWER","hero","band","align","groups","style","NOW","Date","crawledHome","extract","_structure","loginForm","_loginForm","nav","footer","look","replayState","split","filter","Boolean","pop","slot","group","wave","draftId","words","images","domain","hostname","siteName","ownership","method","provenAt","detail","readAt","toISOString","pageLimit","existingPages","found","stoppedBy","waves","label","slots","frame","status","startedAt","finishedAt","leftOut","leftOutCount","at","theme","colors","logo","siteImportMenuPictures","seo","urls","columns","column","image","siteImportReplayFrame","frameJob","state","built","job","$id","orgId","hostId","brief","inputs","steps","outputs","createdBy","createdAt","updatedAt","expiresAt","String","homeId","extend","plan","lines","join","brand"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;CASC,GA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";
|
|
19
|
+
export declare const SITE_LAYOUT_BAKERY_ORIGIN = "https://www.hearth-bakery.example";
|
|
19
20
|
/** The recorded pages, by name: the file and the address it was read from. */
|
|
20
21
|
export declare const SITE_LAYOUT_PAGES: {
|
|
21
22
|
readonly home: {
|
|
@@ -42,10 +43,18 @@ export declare const SITE_LAYOUT_PAGES: {
|
|
|
42
43
|
readonly file: "aglyn-blog-post.html";
|
|
43
44
|
readonly url: "https://aglyn.com/blog/multi-site-cost-sheet-2026";
|
|
44
45
|
};
|
|
46
|
+
readonly blog: {
|
|
47
|
+
readonly file: "aglyn-blog.html";
|
|
48
|
+
readonly url: "https://aglyn.com/blog";
|
|
49
|
+
};
|
|
45
50
|
readonly pottery: {
|
|
46
51
|
readonly file: "squarespace-pottery.html";
|
|
47
52
|
readonly url: "https://www.tidewater-pottery.example/";
|
|
48
53
|
};
|
|
54
|
+
readonly bakery: {
|
|
55
|
+
readonly file: "video-bakery.html";
|
|
56
|
+
readonly url: "https://www.hearth-bakery.example/";
|
|
57
|
+
};
|
|
49
58
|
};
|
|
50
59
|
export type SiteLayoutPageName = keyof typeof SITE_LAYOUT_PAGES;
|
|
51
60
|
/** One recorded page's markup. */
|
|
@@ -21,9 +21,16 @@
|
|
|
21
21
|
* `site-layout/` holds five pages of aglyn.com as AglynBot read them on
|
|
22
22
|
* 2026-10-28 and 2026-10-29 (home, product, pricing, contact, one blog post),
|
|
23
23
|
* its pricing page again as it read on 2026-11-01, which a live import fell
|
|
24
|
-
* short on (`livePricing`),
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* short on (`livePricing`), its blog listing as it read on 2026-11-03, whose
|
|
25
|
+
* cards crop their pictures to a height of their own (`blog`, AGL-4138), and
|
|
26
|
+
* one page in the markup a Squarespace site is built with, written for these
|
|
27
|
+
* specs about a studio that does not exist, so the readers are never tuned to
|
|
28
|
+
* one site's markup.
|
|
29
|
+
* A bakery that does not exist either, in the markup a WordPress block theme
|
|
30
|
+
* writes, shows a film of every kind the reader reads (AGL-4140): a
|
|
31
|
+
* `<video>` playing behind its opening, a YouTube frame, a `lite-youtube`
|
|
32
|
+
* facade, a card's picture linking a Vimeo page, and an `og:video` in its
|
|
33
|
+
* head.
|
|
27
34
|
*
|
|
28
35
|
* The aglyn.com recordings keep what the `aglyn-com/` ones dropped and the
|
|
29
36
|
* layout is made of: class names, inline icons and the page's own stylesheet.
|
|
@@ -35,13 +42,17 @@
|
|
|
35
42
|
* are dropped, a grid framework's own hints kept; the pricing page keeps the
|
|
36
43
|
* first 14 rows of its plan table, and the product, pricing, contact and blog
|
|
37
44
|
* pages their header menu without its panels and their footer's © line. The
|
|
38
|
-
*
|
|
39
|
-
*
|
|
45
|
+
* blog listing keeps its first page of posts, a featured one and six cards,
|
|
46
|
+
* without its search box and its newsletter band, inside the blog post's
|
|
47
|
+
* header and footer. The home page keeps its header and footer whole, for
|
|
48
|
+
* the menu reader. Every address, phone number, author and profile is a
|
|
49
|
+
* placeholder.
|
|
40
50
|
*/ import { readFileSync } from "node:fs";
|
|
41
51
|
import { join } from "node:path";
|
|
42
52
|
const DIR = join(__dirname, 'site-layout');
|
|
43
53
|
export const SITE_LAYOUT_AGLYN_ORIGIN = 'https://aglyn.com';
|
|
44
54
|
export const SITE_LAYOUT_POTTERY_ORIGIN = 'https://www.tidewater-pottery.example';
|
|
55
|
+
export const SITE_LAYOUT_BAKERY_ORIGIN = 'https://www.hearth-bakery.example';
|
|
45
56
|
/** The recorded pages, by name: the file and the address it was read from. */ export const SITE_LAYOUT_PAGES = {
|
|
46
57
|
home: {
|
|
47
58
|
file: 'aglyn-home.html',
|
|
@@ -67,9 +78,17 @@ export const SITE_LAYOUT_POTTERY_ORIGIN = 'https://www.tidewater-pottery.example
|
|
|
67
78
|
file: 'aglyn-blog-post.html',
|
|
68
79
|
url: `${SITE_LAYOUT_AGLYN_ORIGIN}/blog/multi-site-cost-sheet-2026`
|
|
69
80
|
},
|
|
81
|
+
blog: {
|
|
82
|
+
file: 'aglyn-blog.html',
|
|
83
|
+
url: `${SITE_LAYOUT_AGLYN_ORIGIN}/blog`
|
|
84
|
+
},
|
|
70
85
|
pottery: {
|
|
71
86
|
file: 'squarespace-pottery.html',
|
|
72
87
|
url: `${SITE_LAYOUT_POTTERY_ORIGIN}/`
|
|
88
|
+
},
|
|
89
|
+
bakery: {
|
|
90
|
+
file: 'video-bakery.html',
|
|
91
|
+
url: `${SITE_LAYOUT_BAKERY_ORIGIN}/`
|
|
73
92
|
}
|
|
74
93
|
};
|
|
75
94
|
const cache = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/ai/src/lib/site-import/fixtures/site-layout-recordings.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 * Pages recorded with their layout (AGL-4106), for the specs of the layout,\n * menu and stylesheet readers, and for the compile and fidelity specs that\n * read what they find.\n *\n * `site-layout/` holds five pages of aglyn.com as AglynBot read them on\n * 2026-10-28 and 2026-10-29 (home, product, pricing, contact, one blog post),\n * its pricing page again as it read on 2026-11-01, which a live import fell\n * short on (`livePricing`), and one page in the markup a Squarespace site is
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/ai/src/lib/site-import/fixtures/site-layout-recordings.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 * Pages recorded with their layout (AGL-4106), for the specs of the layout,\n * menu and stylesheet readers, and for the compile and fidelity specs that\n * read what they find.\n *\n * `site-layout/` holds five pages of aglyn.com as AglynBot read them on\n * 2026-10-28 and 2026-10-29 (home, product, pricing, contact, one blog post),\n * its pricing page again as it read on 2026-11-01, which a live import fell\n * short on (`livePricing`), its blog listing as it read on 2026-11-03, whose\n * cards crop their pictures to a height of their own (`blog`, AGL-4138), and\n * one page in the markup a Squarespace site is built with, written for these\n * specs about a studio that does not exist, so the readers are never tuned to\n * one site's markup.\n * A bakery that does not exist either, in the markup a WordPress block theme\n * writes, shows a film of every kind the reader reads (AGL-4140): a\n * `<video>` playing behind its opening, a YouTube frame, a `lite-youtube`\n * facade, a card's picture linking a Vimeo page, and an `og:video` in its\n * head.\n *\n * The aglyn.com recordings keep what the `aglyn-com/` ones dropped and the\n * layout is made of: class names, inline icons and the page's own stylesheet.\n * Each was trimmed before it entered the repo: script bodies are gone (one\n * small inline script with a hostile line stands in for them; the\n * structured data stays), so are preload links, `data-*` attributes and\n * `srcset`s; the stylesheet keeps only the rules for classes the page uses\n * and the properties the readers read; class names the kept rules do not name\n * are dropped, a grid framework's own hints kept; the pricing page keeps the\n * first 14 rows of its plan table, and the product, pricing, contact and blog\n * pages their header menu without its panels and their footer's © line. The\n * blog listing keeps its first page of posts, a featured one and six cards,\n * without its search box and its newsletter band, inside the blog post's\n * header and footer. The home page keeps its header and footer whole, for\n * the menu reader. Every address, phone number, author and profile is a\n * placeholder.\n */\n\nimport { readFileSync } from 'node:fs'\nimport { join } from 'node:path'\n\nconst DIR = join(__dirname, 'site-layout')\n\nexport const SITE_LAYOUT_AGLYN_ORIGIN = 'https://aglyn.com'\nexport const SITE_LAYOUT_POTTERY_ORIGIN = 'https://www.tidewater-pottery.example'\nexport const SITE_LAYOUT_BAKERY_ORIGIN = 'https://www.hearth-bakery.example'\n\n/** The recorded pages, by name: the file and the address it was read from. */\nexport const SITE_LAYOUT_PAGES = {\n home: { file: 'aglyn-home.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/` },\n product: { file: 'aglyn-product.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/product` },\n pricing: { file: 'aglyn-pricing.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/pricing` },\n livePricing: { file: 'aglyn-pricing-2026-11.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/pricing` },\n contact: { file: 'aglyn-contact.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/contact` },\n post: { file: 'aglyn-blog-post.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/blog/multi-site-cost-sheet-2026` },\n blog: { file: 'aglyn-blog.html', url: `${SITE_LAYOUT_AGLYN_ORIGIN}/blog` },\n pottery: { file: 'squarespace-pottery.html', url: `${SITE_LAYOUT_POTTERY_ORIGIN}/` },\n bakery: { file: 'video-bakery.html', url: `${SITE_LAYOUT_BAKERY_ORIGIN}/` },\n} as const\n\nexport type SiteLayoutPageName = keyof typeof SITE_LAYOUT_PAGES\n\nconst cache = new Map<string, string>()\n\n/** One recorded page's markup. */\nexport function siteLayoutRecording(name: SiteLayoutPageName): string {\n const { file } = SITE_LAYOUT_PAGES[name]\n const held = cache.get(file)\n if (held !== undefined) return held\n const text = readFileSync(join(DIR, file), 'utf8')\n cache.set(file, text)\n return text\n}\n\n/** Whether an address is on the recorded page's own site. */\nexport function siteLayoutSameSite(name: SiteLayoutPageName): (url: URL) => boolean {\n const origin = new URL(SITE_LAYOUT_PAGES[name].url).origin\n const bare = origin.replace('://www.', '://')\n const www = origin.replace('://', '://www.').replace('://www.www.', '://www.')\n return (url) => url.origin === origin || url.origin === bare || url.origin === www\n}\n"],"names":["readFileSync","join","DIR","__dirname","SITE_LAYOUT_AGLYN_ORIGIN","SITE_LAYOUT_POTTERY_ORIGIN","SITE_LAYOUT_BAKERY_ORIGIN","SITE_LAYOUT_PAGES","home","file","url","product","pricing","livePricing","contact","post","blog","pottery","bakery","cache","Map","siteLayoutRecording","name","held","get","undefined","text","set","siteLayoutSameSite","origin","URL","bare","replace","www"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCC,GAED,SAASA,YAAY,QAAQ,UAAS;AACtC,SAASC,IAAI,QAAQ,YAAW;AAEhC,MAAMC,MAAMD,KAAKE,WAAW;AAE5B,OAAO,MAAMC,2BAA2B,oBAAmB;AAC3D,OAAO,MAAMC,6BAA6B,wCAAuC;AACjF,OAAO,MAAMC,4BAA4B,oCAAmC;AAE5E,4EAA4E,GAC5E,OAAO,MAAMC,oBAAoB;IAC/BC,MAAM;QAAEC,MAAM;QAAmBC,KAAK,GAAGN,yBAAyB,CAAC,CAAC;IAAC;IACrEO,SAAS;QAAEF,MAAM;QAAsBC,KAAK,GAAGN,yBAAyB,QAAQ,CAAC;IAAC;IAClFQ,SAAS;QAAEH,MAAM;QAAsBC,KAAK,GAAGN,yBAAyB,QAAQ,CAAC;IAAC;IAClFS,aAAa;QAAEJ,MAAM;QAA8BC,KAAK,GAAGN,yBAAyB,QAAQ,CAAC;IAAC;IAC9FU,SAAS;QAAEL,MAAM;QAAsBC,KAAK,GAAGN,yBAAyB,QAAQ,CAAC;IAAC;IAClFW,MAAM;QAAEN,MAAM;QAAwBC,KAAK,GAAGN,yBAAyB,gCAAgC,CAAC;IAAC;IACzGY,MAAM;QAAEP,MAAM;QAAmBC,KAAK,GAAGN,yBAAyB,KAAK,CAAC;IAAC;IACzEa,SAAS;QAAER,MAAM;QAA4BC,KAAK,GAAGL,2BAA2B,CAAC,CAAC;IAAC;IACnFa,QAAQ;QAAET,MAAM;QAAqBC,KAAK,GAAGJ,0BAA0B,CAAC,CAAC;IAAC;AAC5E,EAAU;AAIV,MAAMa,QAAQ,IAAIC;AAElB,gCAAgC,GAChC,OAAO,SAASC,oBAAoBC,IAAwB;IAC1D,MAAM,EAAEb,IAAI,EAAE,GAAGF,iBAAiB,CAACe,KAAK;IACxC,MAAMC,OAAOJ,MAAMK,GAAG,CAACf;IACvB,IAAIc,SAASE,WAAW,OAAOF;IAC/B,MAAMG,OAAO1B,aAAaC,KAAKC,KAAKO,OAAO;IAC3CU,MAAMQ,GAAG,CAAClB,MAAMiB;IAChB,OAAOA;AACT;AAEA,2DAA2D,GAC3D,OAAO,SAASE,mBAAmBN,IAAwB;IACzD,MAAMO,SAAS,IAAIC,IAAIvB,iBAAiB,CAACe,KAAK,CAACZ,GAAG,EAAEmB,MAAM;IAC1D,MAAME,OAAOF,OAAOG,OAAO,CAAC,WAAW;IACvC,MAAMC,MAAMJ,OAAOG,OAAO,CAAC,OAAO,WAAWA,OAAO,CAAC,eAAe;IACpE,OAAO,CAACtB,MAAQA,IAAImB,MAAM,KAAKA,UAAUnB,IAAImB,MAAM,KAAKE,QAAQrB,IAAImB,MAAM,KAAKI;AACjF"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { type PublicFetchEdge, type PublicFetchOptions, type PublicFetchResult } from '../jobs/ai-theme-brand-inputs';
|
|
18
18
|
import type { SiteImportFooter, SiteImportLayout, SiteImportLookFacts, SiteImportNavTree } from '../model/ai-site-import';
|
|
19
|
-
import { type SiteImportBlock, type SiteImportBrandMark, type SiteImportForm, type SiteImportIcon, type SiteImportImage, type SiteImportNavLink, type SiteImportOrganization } from './site-import-html';
|
|
19
|
+
import { type SiteImportBlock, type SiteImportBrandMark, type SiteImportForm, type SiteImportVideo, type SiteImportIcon, type SiteImportImage, type SiteImportNavLink, type SiteImportOrganization } from './site-import-html';
|
|
20
20
|
/**
|
|
21
21
|
* Where the bot's user agent points a site owner who wants to know what it is
|
|
22
22
|
* (AGL-3983): the operator's own page about it. `SITE_IMPORT_BOT_INFO_URL` on
|
|
@@ -105,6 +105,8 @@ export interface SiteImportPage {
|
|
|
105
105
|
kept: SiteImportForm[];
|
|
106
106
|
removed: number;
|
|
107
107
|
};
|
|
108
|
+
/** Its videos (AGL-4140), each once; absent on a page with none. */
|
|
109
|
+
videos?: SiteImportVideo[];
|
|
108
110
|
bytes: number;
|
|
109
111
|
/** How the source lays the page out (AGL-4106), on a read asked for it (`layout`): a wave's. */
|
|
110
112
|
layout?: SiteImportLayout | null;
|
|
@@ -446,11 +446,13 @@ function skipReasonFor(result) {
|
|
|
446
446
|
if (extract.structure) {
|
|
447
447
|
const linked = await Promise.all(extract.structure.stylesheets.filter((url)=>!/fonts\.googleapis\.com/i.test(url)).slice(0, AI_THEME_REFERENCE_STYLESHEETS).map(stylesheet));
|
|
448
448
|
const css = linked.filter((text)=>typeof text === 'string');
|
|
449
|
-
const source = {
|
|
449
|
+
const source = _extends({
|
|
450
450
|
blocks: extract.blocks,
|
|
451
451
|
organization: extract.organization,
|
|
452
452
|
structure: extract.structure
|
|
453
|
-
}
|
|
453
|
+
}, extract.videos ? {
|
|
454
|
+
videos: extract.videos
|
|
455
|
+
} : {});
|
|
454
456
|
try {
|
|
455
457
|
built = _extends({}, readLayout ? {
|
|
456
458
|
layout: siteImportLayout(source, css)
|
|
@@ -486,7 +488,10 @@ function skipReasonFor(result) {
|
|
|
486
488
|
links: [
|
|
487
489
|
...new Set(links.map(canon))
|
|
488
490
|
],
|
|
489
|
-
forms: extract.forms
|
|
491
|
+
forms: extract.forms
|
|
492
|
+
}, extract.videos ? {
|
|
493
|
+
videos: extract.videos
|
|
494
|
+
} : {}, {
|
|
490
495
|
bytes: page.bytes
|
|
491
496
|
}));
|
|
492
497
|
return null;
|