@tryvitris/website-harness 0.0.0-stage → 0.1.0-beta.6
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/CONTRIBUTING.md +7 -0
- package/LICENSE +21 -0
- package/NOTICE +17 -0
- package/README.md +141 -2
- package/agent/EVALUATION.md +23 -0
- package/agent/PROMPT.md +13 -0
- package/agent/STATE.json +109 -0
- package/agent/WORKFLOW.md +108 -0
- package/agent/evals/preview.md +5 -0
- package/agent/graph.yaml +752 -0
- package/agent/guardrails.md +10 -0
- package/agent/refs/accessibility.md +9 -0
- package/agent/refs/art-direction.md +15 -0
- package/agent/refs/brand.md +3 -0
- package/agent/refs/browser.md +15 -0
- package/agent/refs/business.md +9 -0
- package/agent/refs/components.md +42 -0
- package/agent/refs/compose.md +10 -0
- package/agent/refs/contracts.md +32 -0
- package/agent/refs/copy.md +14 -0
- package/agent/refs/counterpoint.md +3 -0
- package/agent/refs/critic.md +29 -0
- package/agent/refs/design-calibration.md +31 -0
- package/agent/refs/design-feedback.md +13 -0
- package/agent/refs/design-quality.md +33 -0
- package/agent/refs/design-synthesis.md +9 -0
- package/agent/refs/direction.md +29 -0
- package/agent/refs/feedback-fulfillment.md +7 -0
- package/agent/refs/geo.md +7 -0
- package/agent/refs/harvest.md +7 -0
- package/agent/refs/icons.md +102 -0
- package/agent/refs/images.md +3 -0
- package/agent/refs/implement.md +24 -0
- package/agent/refs/industry-reference-shortlist.md +64 -0
- package/agent/refs/inspiration.md +17 -0
- package/agent/refs/interpret.md +3 -0
- package/agent/refs/jev.md +166 -0
- package/agent/refs/launch.md +11 -0
- package/agent/refs/layout.md +7 -0
- package/agent/refs/media.md +35 -0
- package/agent/refs/motif.md +3 -0
- package/agent/refs/motion-count.md +13 -0
- package/agent/refs/motion-image.md +12 -0
- package/agent/refs/motion-numeric.md +14 -0
- package/agent/refs/motion-page.md +23 -0
- package/agent/refs/motion-process.md +12 -0
- package/agent/refs/motion-sequence.md +7 -0
- package/agent/refs/motion-text.md +12 -0
- package/agent/refs/motion.md +11 -0
- package/agent/refs/narrative.md +9 -0
- package/agent/refs/performance.md +36 -0
- package/agent/refs/preview.md +3 -0
- package/agent/refs/production-quality.md +33 -0
- package/agent/refs/psychology.md +3 -0
- package/agent/refs/refine.md +14 -0
- package/agent/refs/research.md +7 -0
- package/agent/refs/sections.md +6 -0
- package/agent/refs/seo.md +9 -0
- package/agent/refs/storyboard.md +27 -0
- package/agent/refs/template-adaptation.md +42 -0
- package/agent/refs/template-from-url.md +91 -0
- package/agent/refs/template-library.md +32 -0
- package/agent/refs/template-motion.md +44 -0
- package/agent/refs/theme-selection.md +13 -0
- package/agent/refs/ui-ux.md +7 -0
- package/agent/refs/usability.md +5 -0
- package/agent/refs/variant-directions.md +20 -0
- package/agent/refs/write.md +6 -0
- package/agent/request.json +11 -0
- package/agent/workflow.json +4 -0
- package/bin/api/agent/artifacts.js +38 -0
- package/bin/api/agent/evaluate.js +55 -0
- package/bin/api/agent/grade.js +51 -0
- package/bin/api/agent/graph.js +16 -0
- package/bin/api/cli/api.js +104 -0
- package/bin/api/cli.js +48 -0
- package/bin/api/contracts.js +22 -0
- package/bin/api/engine.js +53 -0
- package/bin/api/hosting.js +40 -0
- package/bin/api/icons.js +57 -0
- package/bin/api/index.js +20 -0
- package/bin/api/references.js +45 -0
- package/bin/api/render.js +61 -0
- package/bin/api/schema.js +68 -0
- package/bin/api/theme.js +9 -0
- package/bin/api/types.js +8 -0
- package/bin/chunks/chunk-2NW7KSPA.js +17 -0
- package/bin/chunks/chunk-34H54KEY.js +45 -0
- package/bin/chunks/chunk-3CTBXY5K.js +22313 -0
- package/bin/chunks/chunk-42IXFXUD.js +1141 -0
- package/bin/chunks/chunk-4DM5TTLG.js +219 -0
- package/bin/chunks/chunk-4GZCAWWK.js +327 -0
- package/bin/chunks/chunk-54JC5L35.js +493 -0
- package/bin/chunks/chunk-5OOPJNGN.js +511 -0
- package/bin/chunks/chunk-6A3VWYMF.js +28 -0
- package/bin/chunks/chunk-6H3T46F5.js +25 -0
- package/bin/chunks/chunk-7FS67SRF.js +12 -0
- package/bin/chunks/chunk-7VLBEAFW.js +56 -0
- package/bin/chunks/chunk-ANMJRJQ5.js +31 -0
- package/bin/chunks/chunk-AUO5I56E.js +118774 -0
- package/bin/chunks/chunk-B5I45LFD.js +619 -0
- package/bin/chunks/chunk-BBV7PMFC.js +185 -0
- package/bin/chunks/chunk-BIEDSEL2.js +8 -0
- package/bin/chunks/chunk-CBEJZO4L.js +67 -0
- package/bin/chunks/chunk-DRJQ4OOU.js +514 -0
- package/bin/chunks/chunk-DSS2U2OM.js +115 -0
- package/bin/chunks/chunk-E5Y46VBX.js +678 -0
- package/bin/chunks/chunk-FOXUQXTV.js +278 -0
- package/bin/chunks/chunk-FYN4T4SV.js +4900 -0
- package/bin/chunks/chunk-G7MNMULR.js +192 -0
- package/bin/chunks/chunk-GVNIL34R.js +78 -0
- package/bin/chunks/chunk-GZDLXYZV.js +3425 -0
- package/bin/chunks/chunk-HNORQ74T.js +40 -0
- package/bin/chunks/chunk-IKNMBGGD.js +217 -0
- package/bin/chunks/chunk-JCRGE6AL.js +14 -0
- package/bin/chunks/chunk-LKN75JGA.js +63 -0
- package/bin/chunks/chunk-M2ETYSVJ.js +176 -0
- package/bin/chunks/chunk-M4LNHYYR.js +177 -0
- package/bin/chunks/chunk-PRLL7B63.js +113 -0
- package/bin/chunks/chunk-R7YELY3C.js +923 -0
- package/bin/chunks/chunk-T6PE4KN4.js +277 -0
- package/bin/chunks/chunk-T7DGRVTP.js +458 -0
- package/bin/chunks/chunk-TY33XMHW.js +239 -0
- package/bin/chunks/chunk-VH7PM7KJ.js +179 -0
- package/bin/chunks/chunk-WEFDVXFX.js +65 -0
- package/bin/chunks/chunk-XGTHGWPW.js +90 -0
- package/bin/chunks/chunk-XL2DRAYI.js +39 -0
- package/bin/chunks/chunk-YCVGD2CG.js +2751 -0
- package/bin/chunks/chunk-YQYHROLZ.js +1023 -0
- package/bin/chunks/chunk-YYPYYOEV.js +34 -0
- package/bin/chunks/chunk-Z2UNY47A.js +2418 -0
- package/bin/chunks/design-context-store-IAT2P2OC.js +39 -0
- package/bin/chunks/packets-VBMY4SQJ.js +53 -0
- package/bin/chunks/policy-2I37JUU3.js +18 -0
- package/bin/chunks/preparation-S4MG3RPL.js +93 -0
- package/bin/chunks/questions-HKELBDFL.js +120 -0
- package/bin/chunks/state-GDL6CCJI.js +20 -0
- package/bin/chunks/template-gallery-ET76ERZQ.js +140 -0
- package/bin/cloudflare/backend.js +24421 -0
- package/bin/cloudflare/blake3.wasm +0 -0
- package/bin/cloudflare/forms-test.js +429 -0
- package/bin/cloudflare/templates.js +100 -0
- package/bin/types/scripts/lib/r2.d.ts +7 -0
- package/bin/types/scripts/onboard/browser.d.ts +9 -0
- package/bin/types/scripts/onboard/crawl.d.ts +35 -0
- package/bin/types/scripts/onboard/images.d.ts +19 -0
- package/bin/types/scripts/onboard/prompt.d.ts +10 -0
- package/bin/types/scripts/onboard/run.d.ts +47 -0
- package/bin/types/src/agent/adaptation-checkpoint.d.ts +70 -0
- package/bin/types/src/agent/added-media.d.ts +31 -0
- package/bin/types/src/agent/api-contracts.d.ts +2 -0
- package/bin/types/src/agent/art-direction-policy.d.ts +9 -0
- package/bin/types/src/agent/art-direction.d.ts +253 -0
- package/bin/types/src/agent/artifacts.d.ts +602 -0
- package/bin/types/src/agent/browser-motion-journey.d.ts +59 -0
- package/bin/types/src/agent/browser-motion.d.ts +40 -0
- package/bin/types/src/agent/browser-timeout.d.ts +4 -0
- package/bin/types/src/agent/composition-authoring.d.ts +12 -0
- package/bin/types/src/agent/composition-context.d.ts +63 -0
- package/bin/types/src/agent/composition-contract.d.ts +4 -0
- package/bin/types/src/agent/composition-decisions.d.ts +43 -0
- package/bin/types/src/agent/composition-preflight.d.ts +16 -0
- package/bin/types/src/agent/creative-change-context.d.ts +21 -0
- package/bin/types/src/agent/creative-context.d.ts +56 -0
- package/bin/types/src/agent/creative-contract.d.ts +123 -0
- package/bin/types/src/agent/creative-efficiency.d.ts +18 -0
- package/bin/types/src/agent/creative-evidence.d.ts +57 -0
- package/bin/types/src/agent/creative-objective.d.ts +33 -0
- package/bin/types/src/agent/creative-profile.d.ts +81 -0
- package/bin/types/src/agent/creative-prompts.d.ts +7 -0
- package/bin/types/src/agent/creative-render-bindings.d.ts +13 -0
- package/bin/types/src/agent/creative-revision.d.ts +33 -0
- package/bin/types/src/agent/creative-skills.d.ts +25 -0
- package/bin/types/src/agent/cursor-hook.d.ts +182 -0
- package/bin/types/src/agent/design-bundle.d.ts +24 -0
- package/bin/types/src/agent/design-calibration.d.ts +43 -0
- package/bin/types/src/agent/design-cli.d.ts +5 -0
- package/bin/types/src/agent/design-comparison.d.ts +63 -0
- package/bin/types/src/agent/design-context-packet.d.ts +82 -0
- package/bin/types/src/agent/design-context-store.d.ts +14 -0
- package/bin/types/src/agent/design-context.d.ts +85 -0
- package/bin/types/src/agent/design-contracts.d.ts +35 -0
- package/bin/types/src/agent/design-copy.d.ts +29 -0
- package/bin/types/src/agent/design-feedback.d.ts +91 -0
- package/bin/types/src/agent/design-knowledge.d.ts +124 -0
- package/bin/types/src/agent/design-quality.d.ts +143 -0
- package/bin/types/src/agent/design-review-server.d.ts +13 -0
- package/bin/types/src/agent/design-run.d.ts +174 -0
- package/bin/types/src/agent/design-synthesis.d.ts +76 -0
- package/bin/types/src/agent/design-usage.d.ts +38 -0
- package/bin/types/src/agent/editorial.d.ts +11 -0
- package/bin/types/src/agent/evaluate.d.ts +28 -0
- package/bin/types/src/agent/grade.d.ts +16 -0
- package/bin/types/src/agent/graph.d.ts +82 -0
- package/bin/types/src/agent/industry/document.d.ts +10 -0
- package/bin/types/src/agent/industry/interactions.d.ts +2 -0
- package/bin/types/src/agent/industry/markup.d.ts +14 -0
- package/bin/types/src/agent/industry/registry.d.ts +2 -0
- package/bin/types/src/agent/industry/render-style.d.ts +3 -0
- package/bin/types/src/agent/industry/ridgeline/browse.d.ts +2 -0
- package/bin/types/src/agent/industry/ridgeline/diagrams.d.ts +9 -0
- package/bin/types/src/agent/industry/ridgeline/facts.d.ts +61 -0
- package/bin/types/src/agent/industry/ridgeline/pages/company.d.ts +5 -0
- package/bin/types/src/agent/industry/ridgeline/pages/home.d.ts +1 -0
- package/bin/types/src/agent/industry/ridgeline/pages/journal.d.ts +24 -0
- package/bin/types/src/agent/industry/ridgeline/pages/services.d.ts +6 -0
- package/bin/types/src/agent/industry/ridgeline/photo.d.ts +18 -0
- package/bin/types/src/agent/industry/ridgeline/script.d.ts +1 -0
- package/bin/types/src/agent/industry/ridgeline/site.d.ts +2 -0
- package/bin/types/src/agent/industry/ridgeline/style.d.ts +1 -0
- package/bin/types/src/agent/industry/ridgeline/theme.d.ts +4 -0
- package/bin/types/src/agent/industry/seven/barber-club.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/barber-corner.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/barber-form.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/browse.d.ts +4 -0
- package/bin/types/src/agent/industry/seven/construction-built.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/construction-craft.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/construction-siteworks.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/electrical-circuit.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/electrical-light.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/electrical-power.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/hvac-climate.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/hvac-dispatch.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/hvac-seasonal.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/interactions.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/landscape-atlas.d.ts +4 -0
- package/bin/types/src/agent/industry/seven/landscape-courtyard.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/landscape-seasons.d.ts +3 -0
- package/bin/types/src/agent/industry/seven/legal-casework.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/legal-counsel.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/legal-table.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/medical-continuum.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/medical-movement.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/medical-neighborhood.d.ts +2 -0
- package/bin/types/src/agent/industry/seven/primitives.d.ts +31 -0
- package/bin/types/src/agent/industry/seven/registry.d.ts +4 -0
- package/bin/types/src/agent/industry/seven/theme.d.ts +3 -0
- package/bin/types/src/agent/industry/sites/common-ground.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/coordination.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/everyday.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/independent.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/mainstage.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/neighborhood.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/next-chapter.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/practice-notes.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/property-desk.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/residence.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/risk-office.d.ts +2 -0
- package/bin/types/src/agent/industry/sites/workshop.d.ts +2 -0
- package/bin/types/src/agent/industry/types.d.ts +48 -0
- package/bin/types/src/agent/invocation-budget.d.ts +32 -0
- package/bin/types/src/agent/jev/agent-usage.d.ts +165 -0
- package/bin/types/src/agent/jev/batching.d.ts +101 -0
- package/bin/types/src/agent/jev/block-catalog.d.ts +95 -0
- package/bin/types/src/agent/jev/bounds.d.ts +30 -0
- package/bin/types/src/agent/jev/budget.d.ts +76 -0
- package/bin/types/src/agent/jev/business-draft.d.ts +103 -0
- package/bin/types/src/agent/jev/calibration.d.ts +131 -0
- package/bin/types/src/agent/jev/client.d.ts +52 -0
- package/bin/types/src/agent/jev/component-select.d.ts +102 -0
- package/bin/types/src/agent/jev/config.d.ts +52 -0
- package/bin/types/src/agent/jev/consistency.d.ts +105 -0
- package/bin/types/src/agent/jev/content-checks.d.ts +121 -0
- package/bin/types/src/agent/jev/creative.d.ts +81 -0
- package/bin/types/src/agent/jev/critic-report.d.ts +132 -0
- package/bin/types/src/agent/jev/extraction.d.ts +84 -0
- package/bin/types/src/agent/jev/goals.d.ts +43 -0
- package/bin/types/src/agent/jev/html-tree.d.ts +28 -0
- package/bin/types/src/agent/jev/indexing.d.ts +51 -0
- package/bin/types/src/agent/jev/ledger.d.ts +154 -0
- package/bin/types/src/agent/jev/media.d.ts +62 -0
- package/bin/types/src/agent/jev/observations.d.ts +26 -0
- package/bin/types/src/agent/jev/ownership.d.ts +74 -0
- package/bin/types/src/agent/jev/packets.d.ts +124 -0
- package/bin/types/src/agent/jev/policy.d.ts +83 -0
- package/bin/types/src/agent/jev/questions.d.ts +244 -0
- package/bin/types/src/agent/jev/ranking.d.ts +129 -0
- package/bin/types/src/agent/jev/repair.d.ts +73 -0
- package/bin/types/src/agent/jev/review.d.ts +37 -0
- package/bin/types/src/agent/jev/security.d.ts +28 -0
- package/bin/types/src/agent/jev/semantic-lifecycle.d.ts +19 -0
- package/bin/types/src/agent/jev/semantic-tasks.d.ts +89 -0
- package/bin/types/src/agent/jev/service-registry.d.ts +98 -0
- package/bin/types/src/agent/jev/state.d.ts +104 -0
- package/bin/types/src/agent/jev/types.d.ts +190 -0
- package/bin/types/src/agent/jev/visible-assertions.d.ts +84 -0
- package/bin/types/src/agent/kernel-commands.d.ts +2 -0
- package/bin/types/src/agent/kit-runtime.d.ts +12 -0
- package/bin/types/src/agent/legacy-definitions/theme-art.d.ts +5 -0
- package/bin/types/src/agent/legacy-definitions/theme-commissions.d.ts +1 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-extremes.d.ts +7 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-graphic.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-reading.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-service-extremes.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-service-people.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-service-programme.d.ts +3 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-service-project.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-service-season.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions-tactile.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-compositions.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-legacy-specimens.d.ts +8 -0
- package/bin/types/src/agent/legacy-definitions/theme-library-legacy.d.ts +20 -0
- package/bin/types/src/agent/legacy-definitions/theme-library-release2.d.ts +3 -0
- package/bin/types/src/agent/legacy-definitions/theme-service-art.d.ts +7 -0
- package/bin/types/src/agent/legacy-definitions/theme-service-commissions.d.ts +1 -0
- package/bin/types/src/agent/legacy-definitions/theme-specimen-base.d.ts +1 -0
- package/bin/types/src/agent/legacy-definitions/theme-specimens.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suite-data.d.ts +25 -0
- package/bin/types/src/agent/legacy-definitions/theme-suite-style.d.ts +1 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-checkpoint.d.ts +14 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-graphic.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-information.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-local.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-material.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-practice.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites-spatial.d.ts +2 -0
- package/bin/types/src/agent/legacy-definitions/theme-suites.d.ts +3 -0
- package/bin/types/src/agent/lifecycle.d.ts +136 -0
- package/bin/types/src/agent/lighthouse-browser.d.ts +5 -0
- package/bin/types/src/agent/media-format.d.ts +5 -0
- package/bin/types/src/agent/migration-links.d.ts +4 -0
- package/bin/types/src/agent/motion-composition.d.ts +22 -0
- package/bin/types/src/agent/motion-knowledge.d.ts +3 -0
- package/bin/types/src/agent/motion-plan.d.ts +6 -0
- package/bin/types/src/agent/performance.d.ts +52 -0
- package/bin/types/src/agent/playwright-runtime.d.ts +8 -0
- package/bin/types/src/agent/preparation.d.ts +193 -0
- package/bin/types/src/agent/preview.d.ts +1 -0
- package/bin/types/src/agent/production-quality.d.ts +72 -0
- package/bin/types/src/agent/reference-contract.d.ts +3 -0
- package/bin/types/src/agent/reference-fit.d.ts +50 -0
- package/bin/types/src/agent/reference-library.d.ts +313 -0
- package/bin/types/src/agent/reference-studies.d.ts +110 -0
- package/bin/types/src/agent/refine.d.ts +348 -0
- package/bin/types/src/agent/result-manifest.d.ts +38 -0
- package/bin/types/src/agent/runner.d.ts +10 -0
- package/bin/types/src/agent/site-inputs.d.ts +26 -0
- package/bin/types/src/agent/source-manifest.d.ts +9 -0
- package/bin/types/src/agent/state-transition.d.ts +16 -0
- package/bin/types/src/agent/storyboard-media.d.ts +11 -0
- package/bin/types/src/agent/study-render.d.ts +27 -0
- package/bin/types/src/agent/template-adaptation.d.ts +69 -0
- package/bin/types/src/agent/template-motion.d.ts +59 -0
- package/bin/types/src/agent/theme-art-direction.d.ts +2 -0
- package/bin/types/src/agent/theme-art.d.ts +1 -0
- package/bin/types/src/agent/theme-assets.d.ts +36 -0
- package/bin/types/src/agent/theme-browse.d.ts +67 -0
- package/bin/types/src/agent/theme-cloud-resources.d.ts +7 -0
- package/bin/types/src/agent/theme-cloud.d.ts +41 -0
- package/bin/types/src/agent/theme-commissions.d.ts +1 -0
- package/bin/types/src/agent/theme-compositions-extremes.d.ts +1 -0
- package/bin/types/src/agent/theme-compositions.d.ts +1 -0
- package/bin/types/src/agent/theme-identity.d.ts +23 -0
- package/bin/types/src/agent/theme-layout-roles.d.ts +7 -0
- package/bin/types/src/agent/theme-legacy-specimens.d.ts +1 -0
- package/bin/types/src/agent/theme-library-legacy.d.ts +1 -0
- package/bin/types/src/agent/theme-library-release2.d.ts +1 -0
- package/bin/types/src/agent/theme-library.d.ts +60 -0
- package/bin/types/src/agent/theme-page-manifest.d.ts +26 -0
- package/bin/types/src/agent/theme-picker-model.d.ts +51 -0
- package/bin/types/src/agent/theme-picker-runtime.d.ts +1 -0
- package/bin/types/src/agent/theme-picker-selection-runtime.d.ts +1 -0
- package/bin/types/src/agent/theme-picker-shell.d.ts +7 -0
- package/bin/types/src/agent/theme-picker-styles.d.ts +1 -0
- package/bin/types/src/agent/theme-picker.d.ts +20 -0
- package/bin/types/src/agent/theme-preview.d.ts +26 -0
- package/bin/types/src/agent/theme-release2/assets.d.ts +22 -0
- package/bin/types/src/agent/theme-release2/specimens.d.ts +2 -0
- package/bin/types/src/agent/theme-release2/theme-art.d.ts +5 -0
- package/bin/types/src/agent/theme-release2/theme-compositions-extremes.d.ts +7 -0
- package/bin/types/src/agent/theme-release2/theme-compositions-graphic.d.ts +2 -0
- package/bin/types/src/agent/theme-release2/theme-compositions-reading.d.ts +2 -0
- package/bin/types/src/agent/theme-release2/theme-compositions-tactile.d.ts +2 -0
- package/bin/types/src/agent/theme-release2/theme-compositions.d.ts +3 -0
- package/bin/types/src/agent/theme-release2/theme-specimen-base.d.ts +1 -0
- package/bin/types/src/agent/theme-release3/theme-art-direction.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-art.d.ts +5 -0
- package/bin/types/src/agent/theme-release3/theme-assets.d.ts +121 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-extremes.d.ts +7 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-graphic.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-reading.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-service-extremes.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-service-people.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-service-programme.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-service-project.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-service-season.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions-tactile.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-compositions.d.ts +2 -0
- package/bin/types/src/agent/theme-release3/theme-identity.d.ts +23 -0
- package/bin/types/src/agent/theme-release3/theme-library.d.ts +4 -0
- package/bin/types/src/agent/theme-release3/theme-service-art.d.ts +7 -0
- package/bin/types/src/agent/theme-release3/theme-specimen-base.d.ts +1 -0
- package/bin/types/src/agent/theme-release3/theme-specimens.d.ts +2 -0
- package/bin/types/src/agent/theme-selection.d.ts +75 -0
- package/bin/types/src/agent/theme-service-art.d.ts +1 -0
- package/bin/types/src/agent/theme-specimen-base.d.ts +1 -0
- package/bin/types/src/agent/theme-specimens.d.ts +1 -0
- package/bin/types/src/agent/theme-suite-data.d.ts +1 -0
- package/bin/types/src/agent/theme-suite-identity.d.ts +42 -0
- package/bin/types/src/agent/theme-suite-primitives.d.ts +14 -0
- package/bin/types/src/agent/theme-suite-renderer.d.ts +8 -0
- package/bin/types/src/agent/theme-suite-style.d.ts +1 -0
- package/bin/types/src/agent/theme-suites.d.ts +1 -0
- package/bin/types/src/agent/theme-thumbnails.d.ts +8 -0
- package/bin/types/src/agent/trace.d.ts +337 -0
- package/bin/types/src/agent/workflow-config.d.ts +25 -0
- package/bin/types/src/agent/workflow.d.ts +104 -0
- package/bin/types/src/blocks/library-profile.d.ts +9 -0
- package/bin/types/src/blocks/metadata.d.ts +65 -0
- package/bin/types/src/build/index.d.ts +29 -0
- package/bin/types/src/build/responsive-media.d.ts +19 -0
- package/bin/types/src/build/serve.d.ts +4 -0
- package/bin/types/src/build/static-output.d.ts +2 -0
- package/bin/types/src/build/verified.d.ts +1 -0
- package/bin/types/src/cli/api.d.ts +17 -0
- package/bin/types/src/cli/deploy.d.ts +21 -0
- package/bin/types/src/cli/doctor.d.ts +16 -0
- package/bin/types/src/cli/events.d.ts +16 -0
- package/bin/types/src/cli/feedback.d.ts +21 -0
- package/bin/types/src/cli/forms.d.ts +16 -0
- package/bin/types/src/cli/index.d.ts +1 -0
- package/bin/types/src/cli/lifecycle.d.ts +18 -0
- package/bin/types/src/cli/preserve.d.ts +8 -0
- package/bin/types/src/cli/preview.d.ts +14 -0
- package/bin/types/src/cli/refine.d.ts +41 -0
- package/bin/types/src/cli/root.d.ts +3 -0
- package/bin/types/src/cli/run.d.ts +30 -0
- package/bin/types/src/cli/share.d.ts +17 -0
- package/bin/types/src/cli/site-create.d.ts +24 -0
- package/bin/types/src/cli/site-migrate.d.ts +11 -0
- package/bin/types/src/cli/status.d.ts +8 -0
- package/bin/types/src/cli/types.d.ts +34 -0
- package/bin/types/src/cli/upgrade.d.ts +11 -0
- package/bin/types/src/cli/verify.d.ts +17 -0
- package/bin/types/src/cli/workflow-argv.d.ts +2 -0
- package/bin/types/src/compile/flatten.d.ts +23 -0
- package/bin/types/src/compile/frontmatter.d.ts +10 -0
- package/bin/types/src/compile/icons.d.ts +2 -0
- package/bin/types/src/compile/paths.d.ts +4 -0
- package/bin/types/src/compile/primitives.d.ts +2 -0
- package/bin/types/src/compile/scroll-motion.d.ts +14 -0
- package/bin/types/src/compile/site.d.ts +40 -0
- package/bin/types/src/editing/identity.d.ts +7 -0
- package/bin/types/src/editing/manifest.d.ts +38 -0
- package/bin/types/src/engine/checks.d.ts +2 -0
- package/bin/types/src/engine/contracts.d.ts +104 -0
- package/bin/types/src/engine/impact.d.ts +3 -0
- package/bin/types/src/engine/index.d.ts +70 -0
- package/bin/types/src/engine/revision.d.ts +5 -0
- package/bin/types/src/forms/cloudflare.d.ts +24 -0
- package/bin/types/src/forms/config.d.ts +34 -0
- package/bin/types/src/forms/frontend.d.ts +9 -0
- package/bin/types/src/html.d.ts +3 -0
- package/bin/types/src/icons/catalog.d.ts +28 -0
- package/bin/types/src/icons/coverage.d.ts +12 -0
- package/bin/types/src/icons/drawing.d.ts +7 -0
- package/bin/types/src/icons/duotone.d.ts +4 -0
- package/bin/types/src/icons/index.d.ts +37 -0
- package/bin/types/src/icons/industry-refinements-v4.d.ts +4 -0
- package/bin/types/src/icons/industry-review.d.ts +11 -0
- package/bin/types/src/icons/industry.d.ts +2 -0
- package/bin/types/src/icons/refinements.d.ts +5 -0
- package/bin/types/src/icons/studio-industry-review.d.ts +9 -0
- package/bin/types/src/icons/studio-industry.d.ts +5 -0
- package/bin/types/src/icons/studio.d.ts +34 -0
- package/bin/types/src/integrations/cloudflare-pages.d.ts +10 -0
- package/bin/types/src/integrations/deployment-smoke.d.ts +11 -0
- package/bin/types/src/integrations/hosting.d.ts +33 -0
- package/bin/types/src/integrations/wrangler-command.d.ts +5 -0
- package/bin/types/src/knowledge/artifact-order.d.ts +1 -0
- package/bin/types/src/knowledge/artifact.d.ts +11 -0
- package/bin/types/src/knowledge/composition.d.ts +54 -0
- package/bin/types/src/knowledge/contracts.d.ts +111 -0
- package/bin/types/src/knowledge/explain.d.ts +6 -0
- package/bin/types/src/knowledge/pack.d.ts +32 -0
- package/bin/types/src/knowledge/selection.d.ts +18 -0
- package/bin/types/src/knowledge/site-widgets.d.ts +6 -0
- package/bin/types/src/onboard/brief.d.ts +182 -0
- package/bin/types/src/onboard/classify.d.ts +31 -0
- package/bin/types/src/onboard/crawl-order.d.ts +7 -0
- package/bin/types/src/onboard/extract.d.ts +102 -0
- package/bin/types/src/onboard/harvest-inventory.d.ts +84 -0
- package/bin/types/src/onboard/outline.d.ts +13 -0
- package/bin/types/src/onboard/quality.d.ts +6 -0
- package/bin/types/src/onboard/shortlist.d.ts +11 -0
- package/bin/types/src/onboard/social.d.ts +15 -0
- package/bin/types/src/onboard/visual-hints.d.ts +12 -0
- package/bin/types/src/preserve/build.d.ts +1 -0
- package/bin/types/src/preserve/capture.d.ts +21 -0
- package/bin/types/src/preserve/components.d.ts +10 -0
- package/bin/types/src/preserve/config.d.ts +53 -0
- package/bin/types/src/preserve/embeds.d.ts +15 -0
- package/bin/types/src/preserve/hovers.d.ts +10 -0
- package/bin/types/src/preserve/react-capabilities.d.ts +2 -0
- package/bin/types/src/preserve/runtime.d.ts +2 -0
- package/bin/types/src/preserve/source-defects.d.ts +4 -0
- package/bin/types/src/preserve/supplement.d.ts +3 -0
- package/bin/types/src/preserve/verify.d.ts +29 -0
- package/bin/types/src/render.d.ts +10 -0
- package/bin/types/src/runtime/beacon.d.ts +2 -0
- package/bin/types/src/runtime/before-after.d.ts +2 -0
- package/bin/types/src/runtime/carousel.d.ts +2 -0
- package/bin/types/src/runtime/cookie-compliance.d.ts +14 -0
- package/bin/types/src/runtime/experience.d.ts +4 -0
- package/bin/types/src/runtime/header.d.ts +2 -0
- package/bin/types/src/runtime/leads.d.ts +2 -0
- package/bin/types/src/runtime/lightbox.d.ts +2 -0
- package/bin/types/src/runtime/scroll-motion.generated.d.ts +4 -0
- package/bin/types/src/runtime/tabs.d.ts +2 -0
- package/bin/types/src/schema.d.ts +27 -0
- package/bin/types/src/stock/library.d.ts +14 -0
- package/bin/types/src/stock/search.d.ts +30 -0
- package/bin/types/src/stock/selection.d.ts +30 -0
- package/bin/types/src/stock/types.d.ts +54 -0
- package/bin/types/src/theme.d.ts +3 -0
- package/bin/types/src/types.d.ts +115 -0
- package/bin/types/src/upgrade/kit.d.ts +48 -0
- package/bin/vitris-art.js +192 -0
- package/bin/vitris-blocks.js +238 -0
- package/bin/vitris-build.js +24 -0
- package/bin/vitris-catalog.js +49 -0
- package/bin/vitris-content-coverage.js +21 -0
- package/bin/vitris-create-site.js +86 -0
- package/bin/vitris-cursor-hook.js +61 -0
- package/bin/vitris-eval.js +76 -0
- package/bin/vitris-go.js +99 -0
- package/bin/vitris-harvest.js +184 -0
- package/bin/vitris-icons.js +168 -0
- package/bin/vitris-knowledge.js +43 -0
- package/bin/vitris-launch-preflight.js +964 -0
- package/bin/vitris-media-serve.js +50 -0
- package/bin/vitris-migrate-site.js +20 -0
- package/bin/vitris-motion-view.js +80 -0
- package/bin/vitris-prepare-media.js +64 -0
- package/bin/vitris-preview.js +36 -0
- package/bin/vitris-references.js +173 -0
- package/bin/vitris-refresh.js +50 -0
- package/bin/vitris-sign-publish-bundle.js +64 -0
- package/bin/vitris-stock.js +161 -0
- package/bin/vitris-templates.js +261 -0
- package/bin/vitris-themes.js +321 -0
- package/bin/vitris-upgrade.js +50 -0
- package/bin/vitris-verify-browser.js +662 -0
- package/bin/vitris-verify-performance.js +44 -0
- package/bin/vitris.js +50 -0
- package/blocks/CONVENTIONS.md +121 -0
- package/blocks/INDEX.md +130 -0
- package/blocks/about/about-awards/README.md +36 -0
- package/blocks/about/about-awards/styles.css +13 -0
- package/blocks/about/about-awards/template.html +1 -0
- package/blocks/about/about-credentials/README.md +33 -0
- package/blocks/about/about-credentials/block.meta.json +85 -0
- package/blocks/about/about-credentials/styles.css +4 -0
- package/blocks/about/about-credentials/template.html +1 -0
- package/blocks/about/about-founder/README.md +35 -0
- package/blocks/about/about-founder/styles.css +9 -0
- package/blocks/about/about-founder/template.html +1 -0
- package/blocks/about/about-mission/README.md +31 -0
- package/blocks/about/about-mission/styles.css +5 -0
- package/blocks/about/about-mission/template.html +1 -0
- package/blocks/about/about-statement/README.md +28 -0
- package/blocks/about/about-statement/styles.css +7 -0
- package/blocks/about/about-statement/template.html +1 -0
- package/blocks/about/about-story/README.md +35 -0
- package/blocks/about/about-story/styles.css +5 -0
- package/blocks/about/about-story/template.html +1 -0
- package/blocks/about/about-timeline/README.md +33 -0
- package/blocks/about/about-timeline/styles.css +8 -0
- package/blocks/about/about-timeline/template.html +1 -0
- package/blocks/about/about-values/README.md +31 -0
- package/blocks/about/about-values/styles.css +3 -0
- package/blocks/about/about-values/template.html +1 -0
- package/blocks/blog/blog-featured/README.md +39 -0
- package/blocks/blog/blog-featured/styles.css +12 -0
- package/blocks/blog/blog-featured/template.html +1 -0
- package/blocks/blog/blog-index/README.md +34 -0
- package/blocks/blog/blog-index/styles.css +6 -0
- package/blocks/blog/blog-index/template.html +1 -0
- package/blocks/blog/blog-post-header/README.md +31 -0
- package/blocks/blog/blog-post-header/styles.css +8 -0
- package/blocks/blog/blog-post-header/template.html +1 -0
- package/blocks/contact/contact-cards/README.md +32 -0
- package/blocks/contact/contact-cards/styles.css +7 -0
- package/blocks/contact/contact-cards/template.html +1 -0
- package/blocks/contact/contact-chips/README.md +41 -0
- package/blocks/contact/contact-chips/styles.css +13 -0
- package/blocks/contact/contact-chips/template.html +1 -0
- package/blocks/contact/contact-hours/README.md +41 -0
- package/blocks/contact/contact-hours/block.meta.json +87 -0
- package/blocks/contact/contact-hours/styles.css +8 -0
- package/blocks/contact/contact-hours/template.html +1 -0
- package/blocks/contact/contact-map/README.md +39 -0
- package/blocks/contact/contact-map/styles.css +10 -0
- package/blocks/contact/contact-map/template.html +1 -0
- package/blocks/contact/contact-offices/README.md +32 -0
- package/blocks/contact/contact-offices/styles.css +8 -0
- package/blocks/contact/contact-offices/template.html +1 -0
- package/blocks/contact/contact-phone-first/README.md +33 -0
- package/blocks/contact/contact-phone-first/block.meta.json +86 -0
- package/blocks/contact/contact-phone-first/styles.css +11 -0
- package/blocks/contact/contact-phone-first/template.html +1 -0
- package/blocks/contact/contact-split/README.md +43 -0
- package/blocks/contact/contact-split/styles.css +12 -0
- package/blocks/contact/contact-split/template.html +1 -0
- package/blocks/contact/contact-visit/README.md +36 -0
- package/blocks/contact/contact-visit/block.meta.json +88 -0
- package/blocks/contact/contact-visit/styles.css +13 -0
- package/blocks/contact/contact-visit/template.html +1 -0
- package/blocks/contact/service-areas/README.md +32 -0
- package/blocks/contact/service-areas/styles.css +9 -0
- package/blocks/contact/service-areas/template.html +1 -0
- package/blocks/content/glossary/README.md +35 -0
- package/blocks/content/glossary/styles.css +6 -0
- package/blocks/content/glossary/template.html +1 -0
- package/blocks/content/list-split/README.md +33 -0
- package/blocks/content/list-split/styles.css +13 -0
- package/blocks/content/list-split/template.html +1 -0
- package/blocks/content/prose-split/README.md +32 -0
- package/blocks/content/prose-split/styles.css +12 -0
- package/blocks/content/prose-split/template.html +1 -0
- package/blocks/content/specification-ledger/README.md +32 -0
- package/blocks/content/specification-ledger/block.meta.json +85 -0
- package/blocks/content/specification-ledger/styles.css +10 -0
- package/blocks/content/specification-ledger/template.html +1 -0
- package/blocks/cta/cta-band/README.md +33 -0
- package/blocks/cta/cta-band/styles.css +11 -0
- package/blocks/cta/cta-band/template.html +1 -0
- package/blocks/cta/cta-card/README.md +35 -0
- package/blocks/cta/cta-card/styles.css +8 -0
- package/blocks/cta/cta-card/template.html +1 -0
- package/blocks/cta/cta-floating-bar/README.md +28 -0
- package/blocks/cta/cta-floating-bar/styles.css +8 -0
- package/blocks/cta/cta-floating-bar/template.html +1 -0
- package/blocks/cta/cta-inline/README.md +30 -0
- package/blocks/cta/cta-inline/styles.css +9 -0
- package/blocks/cta/cta-inline/template.html +1 -0
- package/blocks/cta/cta-newsletter/README.md +34 -0
- package/blocks/cta/cta-newsletter/styles.css +8 -0
- package/blocks/cta/cta-newsletter/template.html +1 -0
- package/blocks/cta/cta-photo-fan/README.md +36 -0
- package/blocks/cta/cta-photo-fan/styles.css +14 -0
- package/blocks/cta/cta-photo-fan/template.html +1 -0
- package/blocks/cta/cta-split/README.md +38 -0
- package/blocks/cta/cta-split/styles.css +10 -0
- package/blocks/cta/cta-split/template.html +1 -0
- package/blocks/faq/faq-accordion/README.md +36 -0
- package/blocks/faq/faq-accordion/styles.css +6 -0
- package/blocks/faq/faq-accordion/template.html +1 -0
- package/blocks/faq/faq-grouped/README.md +40 -0
- package/blocks/faq/faq-grouped/styles.css +20 -0
- package/blocks/faq/faq-grouped/template.html +1 -0
- package/blocks/faq/faq-split/README.md +37 -0
- package/blocks/faq/faq-split/styles.css +5 -0
- package/blocks/faq/faq-split/template.html +1 -0
- package/blocks/faq/faq-tabs/README.md +36 -0
- package/blocks/faq/faq-tabs/styles.css +3 -0
- package/blocks/faq/faq-tabs/template.html +1 -0
- package/blocks/feature/feature-bento/README.md +33 -0
- package/blocks/feature/feature-bento/styles.css +7 -0
- package/blocks/feature/feature-bento/template.html +1 -0
- package/blocks/feature/feature-compare-table/README.md +44 -0
- package/blocks/feature/feature-compare-table/styles.css +15 -0
- package/blocks/feature/feature-compare-table/template.html +1 -0
- package/blocks/feature/feature-comparison/README.md +34 -0
- package/blocks/feature/feature-comparison/styles.css +6 -0
- package/blocks/feature/feature-comparison/template.html +1 -0
- package/blocks/feature/feature-grid-3/README.md +34 -0
- package/blocks/feature/feature-grid-3/styles.css +8 -0
- package/blocks/feature/feature-grid-3/template.html +1 -0
- package/blocks/feature/feature-icon-list/README.md +39 -0
- package/blocks/feature/feature-icon-list/styles.css +9 -0
- package/blocks/feature/feature-icon-list/template.html +1 -0
- package/blocks/feature/feature-spotlight/README.md +39 -0
- package/blocks/feature/feature-spotlight/styles.css +5 -0
- package/blocks/feature/feature-spotlight/template.html +1 -0
- package/blocks/feature/feature-stats-band/README.md +33 -0
- package/blocks/feature/feature-stats-band/styles.css +8 -0
- package/blocks/feature/feature-stats-band/template.html +1 -0
- package/blocks/feature/feature-tabs/README.md +38 -0
- package/blocks/feature/feature-tabs/styles.css +7 -0
- package/blocks/feature/feature-tabs/template.html +1 -0
- package/blocks/feature/feature-thumb-list/README.md +38 -0
- package/blocks/feature/feature-thumb-list/styles.css +13 -0
- package/blocks/feature/feature-thumb-list/template.html +1 -0
- package/blocks/feature/feature-zigzag/README.md +31 -0
- package/blocks/feature/feature-zigzag/styles.css +6 -0
- package/blocks/feature/feature-zigzag/template.html +1 -0
- package/blocks/footer/footer-columns/README.md +39 -0
- package/blocks/footer/footer-columns/styles.css +16 -0
- package/blocks/footer/footer-columns/template.html +1 -0
- package/blocks/footer/footer-compact/README.md +33 -0
- package/blocks/footer/footer-compact/styles.css +12 -0
- package/blocks/footer/footer-compact/template.html +1 -0
- package/blocks/footer/footer-cta/README.md +37 -0
- package/blocks/footer/footer-cta/styles.css +18 -0
- package/blocks/footer/footer-cta/template.html +1 -0
- package/blocks/footer/footer-social/README.md +37 -0
- package/blocks/footer/footer-social/styles.css +17 -0
- package/blocks/footer/footer-social/template.html +1 -0
- package/blocks/footer/footer-wordmark/README.md +40 -0
- package/blocks/footer/footer-wordmark/styles.css +19 -0
- package/blocks/footer/footer-wordmark/template.html +1 -0
- package/blocks/gallery/gallery-before-after/README.md +31 -0
- package/blocks/gallery/gallery-before-after/styles.css +6 -0
- package/blocks/gallery/gallery-before-after/template.html +1 -0
- package/blocks/gallery/gallery-carousel/README.md +32 -0
- package/blocks/gallery/gallery-carousel/styles.css +7 -0
- package/blocks/gallery/gallery-carousel/template.html +1 -0
- package/blocks/gallery/gallery-grid/README.md +39 -0
- package/blocks/gallery/gallery-grid/styles.css +13 -0
- package/blocks/gallery/gallery-grid/template.html +1 -0
- package/blocks/gallery/gallery-masonry/README.md +33 -0
- package/blocks/gallery/gallery-masonry/styles.css +4 -0
- package/blocks/gallery/gallery-masonry/template.html +1 -0
- package/blocks/gallery/gallery-mosaic-split/README.md +40 -0
- package/blocks/gallery/gallery-mosaic-split/styles.css +15 -0
- package/blocks/gallery/gallery-mosaic-split/template.html +1 -0
- package/blocks/hero/hero-asymmetric/README.md +34 -0
- package/blocks/hero/hero-asymmetric/styles.css +13 -0
- package/blocks/hero/hero-asymmetric/template.html +10 -0
- package/blocks/hero/hero-before-after/README.md +38 -0
- package/blocks/hero/hero-before-after/styles.css +8 -0
- package/blocks/hero/hero-before-after/template.html +19 -0
- package/blocks/hero/hero-editorial/README.md +34 -0
- package/blocks/hero/hero-editorial/block.meta.json +85 -0
- package/blocks/hero/hero-editorial/styles.css +6 -0
- package/blocks/hero/hero-editorial/template.html +10 -0
- package/blocks/hero/hero-evidence/README.md +32 -0
- package/blocks/hero/hero-evidence/block.meta.json +85 -0
- package/blocks/hero/hero-evidence/styles.css +13 -0
- package/blocks/hero/hero-evidence/template.html +1 -0
- package/blocks/hero/hero-form/README.md +46 -0
- package/blocks/hero/hero-form/styles.css +11 -0
- package/blocks/hero/hero-form/template.html +15 -0
- package/blocks/hero/hero-menu/README.md +36 -0
- package/blocks/hero/hero-menu/styles.css +7 -0
- package/blocks/hero/hero-menu/template.html +10 -0
- package/blocks/hero/hero-overlay/README.md +35 -0
- package/blocks/hero/hero-overlay/styles.css +14 -0
- package/blocks/hero/hero-overlay/template.html +10 -0
- package/blocks/hero/hero-page/README.md +35 -0
- package/blocks/hero/hero-page/styles.css +19 -0
- package/blocks/hero/hero-page/template.html +1 -0
- package/blocks/hero/hero-product/README.md +41 -0
- package/blocks/hero/hero-product/styles.css +11 -0
- package/blocks/hero/hero-product/template.html +14 -0
- package/blocks/hero/hero-service/README.md +37 -0
- package/blocks/hero/hero-service/block.meta.json +85 -0
- package/blocks/hero/hero-service/styles.css +17 -0
- package/blocks/hero/hero-service/template.html +1 -0
- package/blocks/hero/hero-split/README.md +36 -0
- package/blocks/hero/hero-split/styles.css +7 -0
- package/blocks/hero/hero-split/template.html +11 -0
- package/blocks/hero/hero-statement/README.md +33 -0
- package/blocks/hero/hero-statement/styles.css +8 -0
- package/blocks/hero/hero-statement/template.html +1 -0
- package/blocks/hero/hero-stats/README.md +37 -0
- package/blocks/hero/hero-stats/styles.css +10 -0
- package/blocks/hero/hero-stats/template.html +10 -0
- package/blocks/hero/hero-video-still/README.md +36 -0
- package/blocks/hero/hero-video-still/styles.css +9 -0
- package/blocks/hero/hero-video-still/template.html +13 -0
- package/blocks/icons.md +44 -0
- package/blocks/incentives/incentive-banner/README.md +28 -0
- package/blocks/incentives/incentive-banner/styles.css +7 -0
- package/blocks/incentives/incentive-banner/template.html +1 -0
- package/blocks/incentives/incentive-cards/README.md +31 -0
- package/blocks/incentives/incentive-cards/styles.css +4 -0
- package/blocks/incentives/incentive-cards/template.html +1 -0
- package/blocks/navbar/nav-announcement/README.md +35 -0
- package/blocks/navbar/nav-announcement/styles.css +10 -0
- package/blocks/navbar/nav-announcement/template.html +14 -0
- package/blocks/navbar/nav-centered/README.md +35 -0
- package/blocks/navbar/nav-centered/styles.css +11 -0
- package/blocks/navbar/nav-centered/template.html +12 -0
- package/blocks/navbar/nav-minimal/README.md +29 -0
- package/blocks/navbar/nav-minimal/styles.css +5 -0
- package/blocks/navbar/nav-minimal/template.html +6 -0
- package/blocks/navbar/nav-split/README.md +34 -0
- package/blocks/navbar/nav-split/styles.css +11 -0
- package/blocks/navbar/nav-split/template.html +11 -0
- package/blocks/navbar/nav-utility/README.md +37 -0
- package/blocks/navbar/nav-utility/styles.css +17 -0
- package/blocks/navbar/nav-utility/template.html +12 -0
- package/blocks/pricing/menu-featured/README.md +34 -0
- package/blocks/pricing/menu-featured/styles.css +4 -0
- package/blocks/pricing/menu-featured/template.html +1 -0
- package/blocks/pricing/menu-sections/README.md +33 -0
- package/blocks/pricing/menu-sections/styles.css +9 -0
- package/blocks/pricing/menu-sections/template.html +1 -0
- package/blocks/pricing/pricing-table/README.md +40 -0
- package/blocks/pricing/pricing-table/styles.css +9 -0
- package/blocks/pricing/pricing-table/template.html +1 -0
- package/blocks/pricing/pricing-tiers/README.md +34 -0
- package/blocks/pricing/pricing-tiers/styles.css +7 -0
- package/blocks/pricing/pricing-tiers/template.html +1 -0
- package/blocks/pricing/pricing-toggle/README.md +34 -0
- package/blocks/pricing/pricing-toggle/styles.css +10 -0
- package/blocks/pricing/pricing-toggle/template.html +1 -0
- package/blocks/process/process-carousel/README.md +33 -0
- package/blocks/process/process-carousel/styles.css +5 -0
- package/blocks/process/process-carousel/template.html +1 -0
- package/blocks/process/process-split/README.md +35 -0
- package/blocks/process/process-split/styles.css +6 -0
- package/blocks/process/process-split/template.html +1 -0
- package/blocks/process/process-stepper/README.md +40 -0
- package/blocks/process/process-stepper/styles.css +11 -0
- package/blocks/process/process-stepper/template.html +1 -0
- package/blocks/process/process-steps/README.md +35 -0
- package/blocks/process/process-steps/styles.css +6 -0
- package/blocks/process/process-steps/template.html +1 -0
- package/blocks/process/process-sticky/README.md +38 -0
- package/blocks/process/process-sticky/styles.css +12 -0
- package/blocks/process/process-sticky/template.html +1 -0
- package/blocks/process/process-timeline/README.md +35 -0
- package/blocks/process/process-timeline/styles.css +10 -0
- package/blocks/process/process-timeline/template.html +1 -0
- package/blocks/services/services-cards/README.md +34 -0
- package/blocks/services/services-cards/styles.css +3 -0
- package/blocks/services/services-cards/template.html +1 -0
- package/blocks/services/services-carousel/README.md +34 -0
- package/blocks/services/services-carousel/styles.css +6 -0
- package/blocks/services/services-carousel/template.html +1 -0
- package/blocks/services/services-list/README.md +32 -0
- package/blocks/services/services-list/block.meta.json +85 -0
- package/blocks/services/services-list/styles.css +10 -0
- package/blocks/services/services-list/template.html +1 -0
- package/blocks/services/services-menu/README.md +39 -0
- package/blocks/services/services-menu/styles.css +6 -0
- package/blocks/services/services-menu/template.html +1 -0
- package/blocks/services/services-packages/README.md +34 -0
- package/blocks/services/services-packages/styles.css +6 -0
- package/blocks/services/services-packages/template.html +1 -0
- package/blocks/services/services-panels/README.md +36 -0
- package/blocks/services/services-panels/styles.css +15 -0
- package/blocks/services/services-panels/template.html +1 -0
- package/blocks/services/services-photo-grid/README.md +39 -0
- package/blocks/services/services-photo-grid/styles.css +10 -0
- package/blocks/services/services-photo-grid/template.html +1 -0
- package/blocks/services/services-priority/README.md +33 -0
- package/blocks/services/services-priority/block.meta.json +86 -0
- package/blocks/services/services-priority/styles.css +16 -0
- package/blocks/services/services-priority/template.html +1 -0
- package/blocks/stats/stats-cards/README.md +31 -0
- package/blocks/stats/stats-cards/styles.css +4 -0
- package/blocks/stats/stats-cards/template.html +1 -0
- package/blocks/stats/stats-mosaic/README.md +27 -0
- package/blocks/stats/stats-mosaic/styles.css +9 -0
- package/blocks/stats/stats-mosaic/template.html +1 -0
- package/blocks/stats/stats-row/README.md +29 -0
- package/blocks/stats/stats-row/styles.css +8 -0
- package/blocks/stats/stats-row/template.html +1 -0
- package/blocks/stats/stats-split/README.md +35 -0
- package/blocks/stats/stats-split/styles.css +3 -0
- package/blocks/stats/stats-split/template.html +1 -0
- package/blocks/team/team-featured/README.md +42 -0
- package/blocks/team/team-featured/styles.css +9 -0
- package/blocks/team/team-featured/template.html +1 -0
- package/blocks/team/team-grid/README.md +35 -0
- package/blocks/team/team-grid/styles.css +8 -0
- package/blocks/team/team-grid/template.html +1 -0
- package/blocks/team/team-list/README.md +32 -0
- package/blocks/team/team-list/styles.css +7 -0
- package/blocks/team/team-list/template.html +1 -0
- package/blocks/testimonial/testimonial-carousel/README.md +32 -0
- package/blocks/testimonial/testimonial-carousel/styles.css +7 -0
- package/blocks/testimonial/testimonial-carousel/template.html +1 -0
- package/blocks/testimonial/testimonial-grid/README.md +32 -0
- package/blocks/testimonial/testimonial-grid/styles.css +5 -0
- package/blocks/testimonial/testimonial-grid/template.html +1 -0
- package/blocks/testimonial/testimonial-mosaic/README.md +38 -0
- package/blocks/testimonial/testimonial-mosaic/styles.css +14 -0
- package/blocks/testimonial/testimonial-mosaic/template.html +1 -0
- package/blocks/testimonial/testimonial-platform/README.md +34 -0
- package/blocks/testimonial/testimonial-platform/styles.css +17 -0
- package/blocks/testimonial/testimonial-platform/template.html +1 -0
- package/blocks/testimonial/testimonial-rating/README.md +28 -0
- package/blocks/testimonial/testimonial-rating/styles.css +6 -0
- package/blocks/testimonial/testimonial-rating/template.html +1 -0
- package/blocks/testimonial/testimonial-spotlight/README.md +31 -0
- package/blocks/testimonial/testimonial-spotlight/styles.css +9 -0
- package/blocks/testimonial/testimonial-spotlight/template.html +1 -0
- package/blocks/testimonial/testimonial-switcher/README.md +39 -0
- package/blocks/testimonial/testimonial-switcher/styles.css +23 -0
- package/blocks/testimonial/testimonial-switcher/template.html +1 -0
- package/blocks/testimonial/testimonial-wall/README.md +34 -0
- package/blocks/testimonial/testimonial-wall/styles.css +7 -0
- package/blocks/testimonial/testimonial-wall/template.html +1 -0
- package/blocks/trust-strip/trust-badges/README.md +30 -0
- package/blocks/trust-strip/trust-badges/styles.css +5 -0
- package/blocks/trust-strip/trust-badges/template.html +1 -0
- package/blocks/trust-strip/trust-certs/README.md +31 -0
- package/blocks/trust-strip/trust-certs/styles.css +12 -0
- package/blocks/trust-strip/trust-certs/template.html +1 -0
- package/blocks/trust-strip/trust-logos/README.md +32 -0
- package/blocks/trust-strip/trust-logos/styles.css +5 -0
- package/blocks/trust-strip/trust-logos/template.html +1 -0
- package/blocks/trust-strip/trust-quote/README.md +29 -0
- package/blocks/trust-strip/trust-quote/styles.css +5 -0
- package/blocks/trust-strip/trust-quote/template.html +1 -0
- package/blocks/trust-strip/trust-reviews/README.md +35 -0
- package/blocks/trust-strip/trust-reviews/styles.css +9 -0
- package/blocks/trust-strip/trust-reviews/template.html +1 -0
- package/blocks/work/case-alternating/README.md +34 -0
- package/blocks/work/case-alternating/block.meta.json +86 -0
- package/blocks/work/case-alternating/styles.css +7 -0
- package/blocks/work/case-alternating/template.html +1 -0
- package/blocks/work/case-carousel/README.md +26 -0
- package/blocks/work/case-carousel/styles.css +7 -0
- package/blocks/work/case-carousel/template.html +1 -0
- package/blocks/work/case-header/README.md +38 -0
- package/blocks/work/case-header/styles.css +18 -0
- package/blocks/work/case-header/template.html +1 -0
- package/blocks/work/project-evidence/README.md +35 -0
- package/blocks/work/project-evidence/block.meta.json +87 -0
- package/blocks/work/project-evidence/styles.css +12 -0
- package/blocks/work/project-evidence/template.html +1 -0
- package/blocks/work/project-grid/README.md +38 -0
- package/blocks/work/project-grid/styles.css +9 -0
- package/blocks/work/project-grid/template.html +1 -0
- package/cloudflare/wrangler.forms-test.jsonc +19 -0
- package/cloudflare/wrangler.jsonc +14 -0
- package/cloudflare/wrangler.templates.jsonc +6 -0
- package/design-system/MASTER.md +76 -0
- package/design-system/calibration/v2/accuracy.html +1 -0
- package/design-system/calibration/v2/accuracy.png +0 -0
- package/design-system/calibration/v2/manifest.json +88 -0
- package/design-system/calibration/v2/probe.png +0 -0
- package/design-system/calibration/v2/vitris-northline-counsel-home-1280-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-northline-counsel-home-375-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-northline-counsel-planning-1280-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-northline-counsel-planning-375-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-tide-and-slate-home-1280-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-tide-and-slate-home-375-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-tide-and-slate-project-1280-viewport.png +0 -0
- package/design-system/calibration/v2/vitris-tide-and-slate-project-375-viewport.png +0 -0
- package/design-system/compositions/v1/README.md +13 -0
- package/design-system/compositions/v1/northline-counsel/components/contact-phone-first/styles.css +11 -0
- package/design-system/compositions/v1/northline-counsel/components/contact-phone-first/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/contact-visit/styles.css +13 -0
- package/design-system/compositions/v1/northline-counsel/components/contact-visit/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/footer-compact/styles.css +12 -0
- package/design-system/compositions/v1/northline-counsel/components/footer-compact/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/hero-evidence/styles.css +13 -0
- package/design-system/compositions/v1/northline-counsel/components/hero-evidence/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/hero-page/styles.css +19 -0
- package/design-system/compositions/v1/northline-counsel/components/hero-page/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/nav-split/styles.css +11 -0
- package/design-system/compositions/v1/northline-counsel/components/nav-split/template.html +11 -0
- package/design-system/compositions/v1/northline-counsel/components/services-priority/styles.css +16 -0
- package/design-system/compositions/v1/northline-counsel/components/services-priority/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/components/specification-ledger/styles.css +10 -0
- package/design-system/compositions/v1/northline-counsel/components/specification-ledger/template.html +1 -0
- package/design-system/compositions/v1/northline-counsel/direction.md +5 -0
- package/design-system/compositions/v1/northline-counsel/fixture-brief.json +10 -0
- package/design-system/compositions/v1/northline-counsel/media-inventory.json +1 -0
- package/design-system/compositions/v1/northline-counsel/pages/index.html +11 -0
- package/design-system/compositions/v1/northline-counsel/pages/planning.html +11 -0
- package/design-system/compositions/v1/northline-counsel/selection-receipt.json +36 -0
- package/design-system/compositions/v1/northline-counsel/site.json +1 -0
- package/design-system/compositions/v1/northline-counsel/storyboard.md +12 -0
- package/design-system/compositions/v1/northline-counsel/theme/defaults.json +1 -0
- package/design-system/compositions/v1/source-ledger.json +18 -0
- package/design-system/compositions/v1/tide-and-slate/components/contact-phone-first/styles.css +11 -0
- package/design-system/compositions/v1/tide-and-slate/components/contact-phone-first/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/components/footer-compact/styles.css +12 -0
- package/design-system/compositions/v1/tide-and-slate/components/footer-compact/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/components/hero-page/styles.css +19 -0
- package/design-system/compositions/v1/tide-and-slate/components/hero-page/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/components/hero-split/styles.css +7 -0
- package/design-system/compositions/v1/tide-and-slate/components/hero-split/template.html +11 -0
- package/design-system/compositions/v1/tide-and-slate/components/nav-split/styles.css +11 -0
- package/design-system/compositions/v1/tide-and-slate/components/nav-split/template.html +11 -0
- package/design-system/compositions/v1/tide-and-slate/components/project-evidence/styles.css +12 -0
- package/design-system/compositions/v1/tide-and-slate/components/project-evidence/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/components/services-priority/styles.css +16 -0
- package/design-system/compositions/v1/tide-and-slate/components/services-priority/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/components/specification-ledger/styles.css +10 -0
- package/design-system/compositions/v1/tide-and-slate/components/specification-ledger/template.html +1 -0
- package/design-system/compositions/v1/tide-and-slate/direction.md +5 -0
- package/design-system/compositions/v1/tide-and-slate/fixture-brief.json +10 -0
- package/design-system/compositions/v1/tide-and-slate/media/teaching/slate-roof-finished.webp +0 -0
- package/design-system/compositions/v1/tide-and-slate/media/teaching/slate-roof-finished.webp.provenance.json +9 -0
- package/design-system/compositions/v1/tide-and-slate/media/teaching/slate-roof-work.webp +0 -0
- package/design-system/compositions/v1/tide-and-slate/media/teaching/slate-roof-work.webp.provenance.json +9 -0
- package/design-system/compositions/v1/tide-and-slate/media-inventory.json +7 -0
- package/design-system/compositions/v1/tide-and-slate/pages/index.html +10 -0
- package/design-system/compositions/v1/tide-and-slate/pages/project.html +10 -0
- package/design-system/compositions/v1/tide-and-slate/site.json +1 -0
- package/design-system/compositions/v1/tide-and-slate/storyboard.md +12 -0
- package/design-system/compositions/v1/tide-and-slate/theme/defaults.json +1 -0
- package/design-system/compositions/v2/catalog.json +4018 -0
- package/design-system/compositions/v2/clearwell-directory/components/study-clearwell-directory/styles.css +3 -0
- package/design-system/compositions/v2/clearwell-directory/components/study-clearwell-directory/template.html +1 -0
- package/design-system/compositions/v2/clearwell-directory/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/clearwell-directory/pages/index.html +5 -0
- package/design-system/compositions/v2/clearwell-directory/site.json +7 -0
- package/design-system/compositions/v2/clearwell-directory/study.json +244 -0
- package/design-system/compositions/v2/clearwell-directory/theme/defaults.json +16 -0
- package/design-system/compositions/v2/clearwell-letter/components/study-clearwell-letter/styles.css +2 -0
- package/design-system/compositions/v2/clearwell-letter/components/study-clearwell-letter/template.html +1 -0
- package/design-system/compositions/v2/clearwell-letter/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/clearwell-letter/pages/index.html +5 -0
- package/design-system/compositions/v2/clearwell-letter/site.json +7 -0
- package/design-system/compositions/v2/clearwell-letter/study.json +236 -0
- package/design-system/compositions/v2/clearwell-letter/theme/defaults.json +16 -0
- package/design-system/compositions/v2/dock-radio/components/study-dock-radio/styles.css +2 -0
- package/design-system/compositions/v2/dock-radio/components/study-dock-radio/template.html +1 -0
- package/design-system/compositions/v2/dock-radio/media/teaching/original-tone-study.wav +0 -0
- package/design-system/compositions/v2/dock-radio/media/teaching/original-tone-study.wav.provenance.json +6 -0
- package/design-system/compositions/v2/dock-radio/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/dock-radio/pages/index.html +5 -0
- package/design-system/compositions/v2/dock-radio/site.json +7 -0
- package/design-system/compositions/v2/dock-radio/study.json +288 -0
- package/design-system/compositions/v2/dock-radio/theme/defaults.json +16 -0
- package/design-system/compositions/v2/fen-repair/components/study-fen-repair/styles.css +2 -0
- package/design-system/compositions/v2/fen-repair/components/study-fen-repair/template.html +1 -0
- package/design-system/compositions/v2/fen-repair/media/teaching/slate-roof-finished.webp +0 -0
- package/design-system/compositions/v2/fen-repair/media/teaching/slate-roof-finished.webp.provenance.json +9 -0
- package/design-system/compositions/v2/fen-repair/media/teaching/slate-roof-work.webp +0 -0
- package/design-system/compositions/v2/fen-repair/media/teaching/slate-roof-work.webp.provenance.json +9 -0
- package/design-system/compositions/v2/fen-repair/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/fen-repair/pages/index.html +5 -0
- package/design-system/compositions/v2/fen-repair/site.json +7 -0
- package/design-system/compositions/v2/fen-repair/study.json +236 -0
- package/design-system/compositions/v2/fen-repair/theme/defaults.json +16 -0
- package/design-system/compositions/v2/hearth-plane/components/study-hearth-plane/styles.css +2 -0
- package/design-system/compositions/v2/hearth-plane/components/study-hearth-plane/template.html +1 -0
- package/design-system/compositions/v2/hearth-plane/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/hearth-plane/pages/index.html +5 -0
- package/design-system/compositions/v2/hearth-plane/site.json +7 -0
- package/design-system/compositions/v2/hearth-plane/study.json +238 -0
- package/design-system/compositions/v2/hearth-plane/theme/defaults.json +16 -0
- package/design-system/compositions/v2/lacuna-objects/components/study-lacuna-objects/styles.css +2 -0
- package/design-system/compositions/v2/lacuna-objects/components/study-lacuna-objects/template.html +1 -0
- package/design-system/compositions/v2/lacuna-objects/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/lacuna-objects/pages/index.html +5 -0
- package/design-system/compositions/v2/lacuna-objects/site.json +7 -0
- package/design-system/compositions/v2/lacuna-objects/study.json +242 -0
- package/design-system/compositions/v2/lacuna-objects/theme/defaults.json +16 -0
- package/design-system/compositions/v2/loop-room/components/study-loop-room/styles.css +2 -0
- package/design-system/compositions/v2/loop-room/components/study-loop-room/template.html +1 -0
- package/design-system/compositions/v2/loop-room/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/loop-room/pages/index.html +5 -0
- package/design-system/compositions/v2/loop-room/site.json +7 -0
- package/design-system/compositions/v2/loop-room/study.json +253 -0
- package/design-system/compositions/v2/loop-room/theme/defaults.json +16 -0
- package/design-system/compositions/v2/manifest.json +740 -0
- package/design-system/compositions/v2/mara-reading-room/components/study-mara-reading-room/styles.css +2 -0
- package/design-system/compositions/v2/mara-reading-room/components/study-mara-reading-room/template.html +1 -0
- package/design-system/compositions/v2/mara-reading-room/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/mara-reading-room/pages/index.html +5 -0
- package/design-system/compositions/v2/mara-reading-room/site.json +7 -0
- package/design-system/compositions/v2/mara-reading-room/study.json +246 -0
- package/design-system/compositions/v2/mara-reading-room/theme/defaults.json +16 -0
- package/design-system/compositions/v2/mara-specimen/components/study-mara-specimen/styles.css +3 -0
- package/design-system/compositions/v2/mara-specimen/components/study-mara-specimen/template.html +1 -0
- package/design-system/compositions/v2/mara-specimen/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/mara-specimen/pages/index.html +5 -0
- package/design-system/compositions/v2/mara-specimen/site.json +7 -0
- package/design-system/compositions/v2/mara-specimen/study.json +244 -0
- package/design-system/compositions/v2/mara-specimen/theme/defaults.json +16 -0
- package/design-system/compositions/v2/margin-journal/components/study-margin-journal/styles.css +2 -0
- package/design-system/compositions/v2/margin-journal/components/study-margin-journal/template.html +1 -0
- package/design-system/compositions/v2/margin-journal/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/margin-journal/pages/index.html +5 -0
- package/design-system/compositions/v2/margin-journal/site.json +7 -0
- package/design-system/compositions/v2/margin-journal/study.json +242 -0
- package/design-system/compositions/v2/margin-journal/theme/defaults.json +16 -0
- package/design-system/compositions/v2/night-orchard/components/study-night-orchard/styles.css +2 -0
- package/design-system/compositions/v2/night-orchard/components/study-night-orchard/template.html +1 -0
- package/design-system/compositions/v2/night-orchard/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/night-orchard/pages/index.html +5 -0
- package/design-system/compositions/v2/night-orchard/site.json +7 -0
- package/design-system/compositions/v2/night-orchard/study.json +247 -0
- package/design-system/compositions/v2/night-orchard/theme/defaults.json +16 -0
- package/design-system/compositions/v2/previews/clearwell-directory-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-directory-home-390.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-directory-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-directory-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-letter-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-letter-home-390.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-letter-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/clearwell-letter-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/dock-radio-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/dock-radio-home-390.png +0 -0
- package/design-system/compositions/v2/previews/dock-radio-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/dock-radio-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/fen-repair-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/fen-repair-home-390.png +0 -0
- package/design-system/compositions/v2/previews/fen-repair-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/fen-repair-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/hearth-plane-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/hearth-plane-home-390.png +0 -0
- package/design-system/compositions/v2/previews/hearth-plane-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/hearth-plane-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/lacuna-objects-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/lacuna-objects-home-390.png +0 -0
- package/design-system/compositions/v2/previews/lacuna-objects-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/lacuna-objects-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/loop-room-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/loop-room-home-390.png +0 -0
- package/design-system/compositions/v2/previews/loop-room-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/loop-room-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/mara-reading-room-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/mara-reading-room-home-390.png +0 -0
- package/design-system/compositions/v2/previews/mara-reading-room-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/mara-reading-room-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/mara-specimen-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/mara-specimen-home-390.png +0 -0
- package/design-system/compositions/v2/previews/mara-specimen-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/mara-specimen-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/margin-journal-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/margin-journal-home-390.png +0 -0
- package/design-system/compositions/v2/previews/margin-journal-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/margin-journal-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/night-orchard-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/night-orchard-home-390.png +0 -0
- package/design-system/compositions/v2/previews/night-orchard-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/night-orchard-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/relay-workflow-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/relay-workflow-home-390.png +0 -0
- package/design-system/compositions/v2/previews/relay-workflow-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/relay-workflow-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/rivet-components-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/rivet-components-home-390.png +0 -0
- package/design-system/compositions/v2/previews/rivet-components-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/rivet-components-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/signal-fair-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/signal-fair-home-390.png +0 -0
- package/design-system/compositions/v2/previews/signal-fair-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/signal-fair-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/sundial-goods-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/sundial-goods-home-390.png +0 -0
- package/design-system/compositions/v2/previews/sundial-goods-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/sundial-goods-interior-390.png +0 -0
- package/design-system/compositions/v2/previews/thread-mender-home-1440.png +0 -0
- package/design-system/compositions/v2/previews/thread-mender-home-390.png +0 -0
- package/design-system/compositions/v2/previews/thread-mender-interior-1440.png +0 -0
- package/design-system/compositions/v2/previews/thread-mender-interior-390.png +0 -0
- package/design-system/compositions/v2/relay-workflow/components/study-relay-workflow/styles.css +2 -0
- package/design-system/compositions/v2/relay-workflow/components/study-relay-workflow/template.html +1 -0
- package/design-system/compositions/v2/relay-workflow/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/relay-workflow/pages/index.html +5 -0
- package/design-system/compositions/v2/relay-workflow/site.json +7 -0
- package/design-system/compositions/v2/relay-workflow/study.json +283 -0
- package/design-system/compositions/v2/relay-workflow/theme/defaults.json +16 -0
- package/design-system/compositions/v2/rivet-components/components/study-rivet-components/styles.css +2 -0
- package/design-system/compositions/v2/rivet-components/components/study-rivet-components/template.html +1 -0
- package/design-system/compositions/v2/rivet-components/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/rivet-components/pages/index.html +5 -0
- package/design-system/compositions/v2/rivet-components/site.json +7 -0
- package/design-system/compositions/v2/rivet-components/study.json +241 -0
- package/design-system/compositions/v2/rivet-components/theme/defaults.json +16 -0
- package/design-system/compositions/v2/signal-fair/components/study-signal-fair/styles.css +2 -0
- package/design-system/compositions/v2/signal-fair/components/study-signal-fair/template.html +1 -0
- package/design-system/compositions/v2/signal-fair/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/signal-fair/pages/index.html +5 -0
- package/design-system/compositions/v2/signal-fair/site.json +7 -0
- package/design-system/compositions/v2/signal-fair/study.json +271 -0
- package/design-system/compositions/v2/signal-fair/theme/defaults.json +16 -0
- package/design-system/compositions/v2/sundial-goods/components/study-sundial-goods/styles.css +2 -0
- package/design-system/compositions/v2/sundial-goods/components/study-sundial-goods/template.html +1 -0
- package/design-system/compositions/v2/sundial-goods/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/sundial-goods/pages/index.html +5 -0
- package/design-system/compositions/v2/sundial-goods/site.json +7 -0
- package/design-system/compositions/v2/sundial-goods/study.json +247 -0
- package/design-system/compositions/v2/sundial-goods/theme/defaults.json +16 -0
- package/design-system/compositions/v2/thread-mender/components/study-thread-mender/styles.css +2 -0
- package/design-system/compositions/v2/thread-mender/components/study-thread-mender/template.html +1 -0
- package/design-system/compositions/v2/thread-mender/pages/detail/index.html +5 -0
- package/design-system/compositions/v2/thread-mender/pages/index.html +5 -0
- package/design-system/compositions/v2/thread-mender/site.json +7 -0
- package/design-system/compositions/v2/thread-mender/study.json +253 -0
- package/design-system/compositions/v2/thread-mender/theme/defaults.json +16 -0
- package/design-system/knowledge/v1/README.md +8 -0
- package/design-system/knowledge/v1/catalog.json +479 -0
- package/design-system/knowledge/v1/demonstrations/assets/teaching-slate-slope.png +0 -0
- package/design-system/knowledge/v1/demonstrations/assets/teaching-slate-slope.provenance.json +12 -0
- package/design-system/knowledge/v1/demonstrations/mobile-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/mobile-weak.html +50 -0
- package/design-system/knowledge/v1/demonstrations/project-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/project-weak.html +50 -0
- package/design-system/knowledge/v1/demonstrations/repeat-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/repeat-weak.html +50 -0
- package/design-system/knowledge/v1/demonstrations/services-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/services-weak.html +50 -0
- package/design-system/knowledge/v1/demonstrations/sparse-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/sparse-weak.html +50 -0
- package/design-system/knowledge/v1/demonstrations/type-strong.html +50 -0
- package/design-system/knowledge/v1/demonstrations/type-weak.html +50 -0
- package/design-system/knowledge/v1/manifest.json +88 -0
- package/design-system/knowledge/v1/observations/mobile-strong-1080.png +0 -0
- package/design-system/knowledge/v1/observations/mobile-strong-375.png +0 -0
- package/design-system/knowledge/v1/observations/mobile-weak-1080.png +0 -0
- package/design-system/knowledge/v1/observations/mobile-weak-375.png +0 -0
- package/design-system/knowledge/v1/observations/project-strong-1080.png +0 -0
- package/design-system/knowledge/v1/observations/project-strong-375.png +0 -0
- package/design-system/knowledge/v1/observations/project-weak-1080.png +0 -0
- package/design-system/knowledge/v1/observations/project-weak-375.png +0 -0
- package/design-system/knowledge/v1/observations/type-strong-1080.png +0 -0
- package/design-system/knowledge/v1/observations/type-strong-375.png +0 -0
- package/design-system/knowledge/v1/observations/type-weak-1080.png +0 -0
- package/design-system/knowledge/v1/observations/type-weak-375.png +0 -0
- package/design-system/knowledge/v2/added-lessons.json +30 -0
- package/design-system/knowledge/v2/assets.json +14 -0
- package/design-system/knowledge/v2/fixtures/contact-alternate.html +17 -0
- package/design-system/knowledge/v2/fixtures/contact-broken.html +15 -0
- package/design-system/knowledge/v2/fixtures/contact-valid.html +20 -0
- package/design-system/knowledge/v2/fixtures/contrast-cases.html +10 -0
- package/design-system/knowledge/v2/island-audit.json +12 -0
- package/design-system/knowledge/v2/lesson-extensions.json +158 -0
- package/design-system/knowledge/v2/manifest.json +52 -0
- package/design-system/knowledge/v2/replacements.json +14 -0
- package/design-system/knowledge/v2/requirements.json +345 -0
- package/design-system/knowledge/v2/sources.json +182 -0
- package/design-system/knowledge/v3/catalog.json +1232 -0
- package/design-system/knowledge/v3/examples/catalog.json +799 -0
- package/design-system/knowledge/v3/lessons/cmp-collection-structure.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-comparison.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-contextual-action.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-contrastive-critique.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-disclosure.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-evidence-form.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-image-art-direction.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-image-sequence.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-interactive-explanation.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-local-information.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-motion-continuity.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-narrative-continuity.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-navigation.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-page-rhythm.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-process.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-proof-adjacency.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-responsive-recomposition.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-semantic-grouping.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-shared-alignment.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-sparse-media.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-surfaces-motifs.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-text-shape.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-type-roles.md +17 -0
- package/design-system/knowledge/v3/lessons/cmp-unequal-emphasis.md +17 -0
- package/design-system/knowledge/v3/manifest.json +117 -0
- package/design-system/knowledge/v3/sources.json +425 -0
- package/design-system/references/v1/README.md +27 -0
- package/design-system/references/v1/catalog.json +20035 -0
- package/design-system/references/v1/manifest.json +10 -0
- package/design-system/references/v2/README.md +27 -0
- package/design-system/references/v2/catalog.json +27382 -0
- package/design-system/references/v2/manifest.json +11 -0
- package/design-system/references/v3/README.md +27 -0
- package/design-system/references/v3/catalog.json +27628 -0
- package/design-system/references/v3/manifest.json +11 -0
- package/docs/CLI.md +299 -0
- package/docs/CLOUDFLARE.md +53 -0
- package/docs/CONTACT-FORMS.md +161 -0
- package/docs/DISTRIBUTION.md +70 -0
- package/docs/ENGINE.md +28 -0
- package/docs/PRESERVE.md +59 -0
- package/docs/SECURITY.md +23 -0
- package/docs/STOCK-MEDIA.md +66 -0
- package/licenses/blake3-wasm-LICENSE +21 -0
- package/licenses/entities-LICENSE +11 -0
- package/licenses/parse5-LICENSE +19 -0
- package/migrations/0001_init.sql +90 -0
- package/migrations/0002_analytics.sql +50 -0
- package/migrations/0003_site_updates.sql +29 -0
- package/migrations/0004_contact_forms.sql +75 -0
- package/migrations/0005_auth.sql +20 -0
- package/package.json +229 -6
- package/src/runtime/beacon.ts +329 -0
- package/src/runtime/before-after.ts +48 -0
- package/src/runtime/carousel.ts +20 -0
- package/src/runtime/cookie-compliance.ts +50 -0
- package/src/runtime/counter.ts +2 -0
- package/src/runtime/editor.ts +72 -0
- package/src/runtime/experience.ts +57 -0
- package/src/runtime/header.ts +46 -0
- package/src/runtime/leads.ts +102 -0
- package/src/runtime/lightbox.ts +26 -0
- package/src/runtime/reveal.ts +2 -0
- package/src/runtime/scroll-motion.controller.js +100 -0
- package/src/runtime/scroll-motion.count.js +21 -0
- package/src/runtime/scroll-motion.generated.ts +5 -0
- package/src/runtime/scroll-motion.vanilla.js +45 -0
- package/src/runtime/tabs.ts +40 -0
- package/src/stock/catalog.json +5445 -0
- package/src/stock/coverage.json +18 -0
- package/src/stock/picker.css +118 -0
- package/src/stock/picker.js +191 -0
- package/templates/site/.env.example +6 -0
- package/templates/site/.github/workflows/deploy.yml +59 -0
- package/templates/site/AGENTS.md +35 -0
- package/templates/site/CLAUDE.md +5 -0
- package/templates/site/GEMINI.md +5 -0
- package/templates/site/README.md +55 -0
- package/templates/site/components/README.md +18 -0
- package/templates/site/gitignore +10 -0
- package/templates/site/launch.json +14 -0
- package/templates/site/package.json +36 -0
- package/templates/site/pages/README.md +31 -0
- package/templates/site/site.json +10 -0
- package/templates/site/theme/defaults.json +17 -0
|
@@ -0,0 +1,2418 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assetsOrigin,
|
|
3
|
+
publicAssetUrl,
|
|
4
|
+
putLocalR2,
|
|
5
|
+
putRemoteR2,
|
|
6
|
+
writeScratchFile
|
|
7
|
+
} from "./chunk-XGTHGWPW.js";
|
|
8
|
+
import {
|
|
9
|
+
assembleHarvestInventory,
|
|
10
|
+
capturedPathSet,
|
|
11
|
+
classifyMiss,
|
|
12
|
+
colorsFromComputedActions,
|
|
13
|
+
formatExclusion,
|
|
14
|
+
isErrorPage,
|
|
15
|
+
isPlaywrightLaunchFailure
|
|
16
|
+
} from "./chunk-3CTBXY5K.js";
|
|
17
|
+
import {
|
|
18
|
+
json,
|
|
19
|
+
save
|
|
20
|
+
} from "./chunk-T6PE4KN4.js";
|
|
21
|
+
|
|
22
|
+
// scripts/onboard/prompt.ts
|
|
23
|
+
import * as readline from "node:readline/promises";
|
|
24
|
+
|
|
25
|
+
// src/onboard/social.ts
|
|
26
|
+
var PLATFORM_RE = [
|
|
27
|
+
{ platform: "facebook", re: /(?:facebook\.com|fb\.com|fb\.me)\//i },
|
|
28
|
+
{ platform: "instagram", re: /instagram\.com\//i },
|
|
29
|
+
{ platform: "yelp", re: /yelp\.com\//i },
|
|
30
|
+
{
|
|
31
|
+
platform: "google",
|
|
32
|
+
re: /(?:maps\.app\.goo\.gl|goo\.gl\/maps|google\.com\/maps|business\.google\.com|g\.page)\//i
|
|
33
|
+
},
|
|
34
|
+
{ platform: "tiktok", re: /tiktok\.com\/@/i },
|
|
35
|
+
{ platform: "linkedin", re: /linkedin\.com\/(company|in)\//i },
|
|
36
|
+
{ platform: "youtube", re: /(?:youtube\.com\/(channel|c|@|user)|youtu\.be)\//i },
|
|
37
|
+
{ platform: "twitter", re: /(?:twitter\.com|x\.com)\//i }
|
|
38
|
+
];
|
|
39
|
+
function walkJsonLd(nodes) {
|
|
40
|
+
const flat = [];
|
|
41
|
+
const visit = (node) => {
|
|
42
|
+
if (!node || typeof node !== "object") return;
|
|
43
|
+
const obj = node;
|
|
44
|
+
flat.push(obj);
|
|
45
|
+
if (obj["@graph"] && Array.isArray(obj["@graph"])) obj["@graph"].forEach(visit);
|
|
46
|
+
};
|
|
47
|
+
nodes.forEach(visit);
|
|
48
|
+
return flat;
|
|
49
|
+
}
|
|
50
|
+
function platformForUrl(url) {
|
|
51
|
+
for (const { platform, re } of PLATFORM_RE) {
|
|
52
|
+
if (re.test(url)) return platform;
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function collectSocialLinks(opts) {
|
|
57
|
+
const out = [];
|
|
58
|
+
const seen = /* @__PURE__ */ new Set();
|
|
59
|
+
const push = (url, label) => {
|
|
60
|
+
const platform = platformForUrl(url);
|
|
61
|
+
if (!platform) return;
|
|
62
|
+
const key = url.replace(/\/+$/, "").toLowerCase();
|
|
63
|
+
if (seen.has(key)) return;
|
|
64
|
+
seen.add(key);
|
|
65
|
+
out.push({ platform, url, label });
|
|
66
|
+
};
|
|
67
|
+
for (const link of opts.links) {
|
|
68
|
+
push(link.href, link.label || void 0);
|
|
69
|
+
}
|
|
70
|
+
for (const obj of walkJsonLd(opts.jsonLd)) {
|
|
71
|
+
const sameAs = obj.sameAs;
|
|
72
|
+
if (typeof sameAs === "string") push(sameAs);
|
|
73
|
+
else if (Array.isArray(sameAs)) {
|
|
74
|
+
for (const item of sameAs) {
|
|
75
|
+
if (typeof item === "string") push(item);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// src/onboard/extract.ts
|
|
83
|
+
var SKIP_PATH = /\/(wp-admin|wp-login|cart|checkout|account|login|signup|register|cgi-bin|xmlrpc)(\/|$)/i;
|
|
84
|
+
var SKIP_EXT = /\.(pdf|zip|docx?|xlsx?|pptx?|mp4|webm|mp3|ics)(\?|$)/i;
|
|
85
|
+
var LOOP_QUERY = /^(page|paged|offset|start|utm_|fbclid|gclid|msclkid|mc_|ref|sort|order|filter|color|size|min|max|date|month|year|day|session|sid)/i;
|
|
86
|
+
function shouldSkipPath(pathname) {
|
|
87
|
+
if (SKIP_PATH.test(pathname)) return true;
|
|
88
|
+
if (SKIP_EXT.test(pathname)) return true;
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
function shouldSkipQueryUrl(href) {
|
|
92
|
+
try {
|
|
93
|
+
const u = new URL(href);
|
|
94
|
+
if (![...u.searchParams.keys()].length) return false;
|
|
95
|
+
if ([...u.searchParams.keys()].length > 4) return true;
|
|
96
|
+
for (const key of u.searchParams.keys()) {
|
|
97
|
+
if (LOOP_QUERY.test(key)) return true;
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
} catch {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function stripNoise(html) {
|
|
105
|
+
return html.replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<noscript[\s\S]*?<\/noscript>/gi, " ").replace(/<!--[\s\S]*?-->/g, " ");
|
|
106
|
+
}
|
|
107
|
+
function decodeEntities(text) {
|
|
108
|
+
return text.replace(/ /gi, " ").replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/'/g, "'").replace(/&#(\d+);/g, (_m, n) => String.fromCharCode(Number(n))).replace(/\s+/g, " ").trim();
|
|
109
|
+
}
|
|
110
|
+
function meta(html, name) {
|
|
111
|
+
const re = new RegExp(
|
|
112
|
+
`<meta[^>]+(?:name|property)=["']${name}["'][^>]+content=["']([^"']*)["']`,
|
|
113
|
+
"i"
|
|
114
|
+
);
|
|
115
|
+
const re2 = new RegExp(
|
|
116
|
+
`<meta[^>]+content=["']([^"']*)["'][^>]+(?:name|property)=["']${name}["']`,
|
|
117
|
+
"i"
|
|
118
|
+
);
|
|
119
|
+
return decodeEntities((html.match(re) || html.match(re2))?.[1] || "");
|
|
120
|
+
}
|
|
121
|
+
function tags(html, tag) {
|
|
122
|
+
const re = new RegExp(`<${tag}\\b[^>]*>([\\s\\S]*?)</${tag}>`, "gi");
|
|
123
|
+
const out = [];
|
|
124
|
+
for (const m of html.matchAll(re)) {
|
|
125
|
+
const text = decodeEntities(m[1].replace(/<[^>]+>/g, " "));
|
|
126
|
+
if (text) out.push(text);
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
function absolutize(href, base) {
|
|
131
|
+
try {
|
|
132
|
+
href = decodeEntities(href).trim().replace(/^["']+|["']+$/g, "");
|
|
133
|
+
const nested = href.match(/https?:\/\/[^\s"'<>]+/);
|
|
134
|
+
if (nested && href.indexOf(nested[0]) > 0) href = nested[0];
|
|
135
|
+
else if (/["']/.test(href)) href = href.split(/["']/)[0].trim();
|
|
136
|
+
href = href.replace(/"|"|'/gi, "").trim();
|
|
137
|
+
if (!href) return null;
|
|
138
|
+
const u = new URL(href, base);
|
|
139
|
+
if (u.protocol !== "http:" && u.protocol !== "https:") return null;
|
|
140
|
+
u.hash = "";
|
|
141
|
+
return u.href;
|
|
142
|
+
} catch {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function documentBase(html, pageUrl) {
|
|
147
|
+
const m = html.match(/<base\b[^>]*href=["']([^"']+)["']/i);
|
|
148
|
+
if (!m) return pageUrl;
|
|
149
|
+
return absolutize(m[1], pageUrl) || pageUrl;
|
|
150
|
+
}
|
|
151
|
+
function isPathRelativeHref(href) {
|
|
152
|
+
const h = href.trim();
|
|
153
|
+
if (!h || h.startsWith("#") || h.startsWith("?") || h.startsWith("mailto:") || h.startsWith("tel:")) return false;
|
|
154
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(h)) return false;
|
|
155
|
+
if (h.startsWith("//") || h.startsWith("/")) return false;
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
function sameSite(a, b) {
|
|
159
|
+
try {
|
|
160
|
+
const ha = new URL(a).hostname.replace(/^www\./i, "").toLowerCase();
|
|
161
|
+
const hb = new URL(b).hostname.replace(/^www\./i, "").toLowerCase();
|
|
162
|
+
return ha === hb && ha.length > 0;
|
|
163
|
+
} catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function isLikelyTrackingImage(img) {
|
|
168
|
+
if (/sprite|pixel|tracking|1x1|favicon|logo-schema|emoji|gravatar|doubleclick|facebook\.com\/tr/i.test(img.src)) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
if (img.width && img.height && img.width < 64 && img.height < 64 && !img.fromJsonLdLogo && !img.inChrome) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
function dim(tag, name) {
|
|
177
|
+
const m = tag.match(new RegExp(`${name}=["']?(\\d+)`, "i"));
|
|
178
|
+
if (!m) return void 0;
|
|
179
|
+
const n = Number(m[1]);
|
|
180
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
181
|
+
}
|
|
182
|
+
function fromSrcset(srcset, pageUrl) {
|
|
183
|
+
const parts = srcset.split(",").map((s) => s.trim().split(/\s+/)[0]).filter((p) => Boolean(p));
|
|
184
|
+
const last = parts.at(-1);
|
|
185
|
+
return last ? absolutize(last, pageUrl) : null;
|
|
186
|
+
}
|
|
187
|
+
function allFromSrcset(srcset, pageUrl) {
|
|
188
|
+
return srcset.split(",").map((s) => s.trim().split(/\s+/)[0]).filter((p) => Boolean(p)).map((p) => absolutize(p, pageUrl)).filter((u) => Boolean(u));
|
|
189
|
+
}
|
|
190
|
+
function classifyHref(href, origin) {
|
|
191
|
+
if (href.startsWith("tel:")) return "tel";
|
|
192
|
+
if (href.startsWith("mailto:")) return "mailto";
|
|
193
|
+
try {
|
|
194
|
+
const u = new URL(href);
|
|
195
|
+
if (u.origin === origin) return "internal";
|
|
196
|
+
return "external";
|
|
197
|
+
} catch {
|
|
198
|
+
return "other";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var CTA_WORDS = /\b(book|schedule|appoint|call|contact|get a quote|request|order|reserve|sign up|get started|free estimate)\b/i;
|
|
202
|
+
function extractPhones(text) {
|
|
203
|
+
const fromTel = [...text.matchAll(/tel:(\+?[\d().\s-]{7,})/gi)].map(
|
|
204
|
+
(m) => m[1].replace(/\s+/g, " ").trim()
|
|
205
|
+
);
|
|
206
|
+
const fromCopy = [...text.matchAll(/\+?1?[\s.-]?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}/g)].map(
|
|
207
|
+
(m) => m[0].trim()
|
|
208
|
+
);
|
|
209
|
+
return [.../* @__PURE__ */ new Set([...fromTel, ...fromCopy])];
|
|
210
|
+
}
|
|
211
|
+
function extractEmails(text) {
|
|
212
|
+
const fromMailto = [...text.matchAll(/mailto:([^\s"'?>]+)/gi)].map(
|
|
213
|
+
(m) => decodeURIComponent(m[1].split("?")[0]).toLowerCase()
|
|
214
|
+
);
|
|
215
|
+
const fromCopy = [...text.matchAll(/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}/gi)].map(
|
|
216
|
+
(m) => m[0].toLowerCase()
|
|
217
|
+
);
|
|
218
|
+
return [.../* @__PURE__ */ new Set([...fromMailto, ...fromCopy])].filter((e) => !e.endsWith(".png") && !e.endsWith(".jpg"));
|
|
219
|
+
}
|
|
220
|
+
function parseJsonLd(html) {
|
|
221
|
+
const blocks = [...html.matchAll(/<script[^>]*type=["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/gi)];
|
|
222
|
+
const out = [];
|
|
223
|
+
for (const block of blocks) {
|
|
224
|
+
try {
|
|
225
|
+
const parsed = JSON.parse(block[1].trim());
|
|
226
|
+
if (Array.isArray(parsed)) out.push(...parsed);
|
|
227
|
+
else out.push(parsed);
|
|
228
|
+
} catch {
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return out;
|
|
232
|
+
}
|
|
233
|
+
function walkJsonLd2(nodes) {
|
|
234
|
+
const flat = [];
|
|
235
|
+
const visit = (node) => {
|
|
236
|
+
if (!node || typeof node !== "object") return;
|
|
237
|
+
const obj = node;
|
|
238
|
+
flat.push(obj);
|
|
239
|
+
if (obj["@graph"] && Array.isArray(obj["@graph"])) obj["@graph"].forEach(visit);
|
|
240
|
+
};
|
|
241
|
+
nodes.forEach(visit);
|
|
242
|
+
return flat;
|
|
243
|
+
}
|
|
244
|
+
function businessFromJsonLd(nodes) {
|
|
245
|
+
const types = walkJsonLd2(nodes);
|
|
246
|
+
const biz = types.find((n) => {
|
|
247
|
+
const t = n["@type"];
|
|
248
|
+
const s = Array.isArray(t) ? t.join(" ") : String(t || "");
|
|
249
|
+
return /LocalBusiness|Organization|Restaurant|Store|Dentist|Physician|Attorney/i.test(s);
|
|
250
|
+
});
|
|
251
|
+
if (!biz) return {};
|
|
252
|
+
const addr = biz.address;
|
|
253
|
+
let address = "";
|
|
254
|
+
if (typeof addr === "string") address = addr;
|
|
255
|
+
else if (addr && typeof addr === "object") {
|
|
256
|
+
const a = addr;
|
|
257
|
+
address = [a.streetAddress, a.addressLocality, a.addressRegion, a.postalCode].filter(Boolean).map(String).join(", ");
|
|
258
|
+
}
|
|
259
|
+
const hours = biz.openingHours;
|
|
260
|
+
const specHours = hoursFromSpec(biz.openingHoursSpecification);
|
|
261
|
+
const listed = Array.isArray(hours) ? hours.map(String) : typeof hours === "string" ? [hours] : [];
|
|
262
|
+
let city = "";
|
|
263
|
+
if (addr && typeof addr === "object") {
|
|
264
|
+
const locality = addr.addressLocality;
|
|
265
|
+
if (typeof locality === "string") city = locality;
|
|
266
|
+
}
|
|
267
|
+
const phone = Array.isArray(biz.telephone) ? String(biz.telephone[0] || "") : typeof biz.telephone === "string" ? biz.telephone : void 0;
|
|
268
|
+
let logoUrl;
|
|
269
|
+
const logo = biz.logo;
|
|
270
|
+
if (typeof logo === "string") logoUrl = logo;
|
|
271
|
+
else if (logo && typeof logo === "object") {
|
|
272
|
+
const url = logo.url;
|
|
273
|
+
if (typeof url === "string") logoUrl = url;
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
name: typeof biz.name === "string" ? biz.name : void 0,
|
|
277
|
+
phone: phone || void 0,
|
|
278
|
+
email: typeof biz.email === "string" ? biz.email : void 0,
|
|
279
|
+
address: address || void 0,
|
|
280
|
+
city: city || void 0,
|
|
281
|
+
hours: specHours.length ? specHours : listed.length ? listed : void 0,
|
|
282
|
+
url: typeof biz.url === "string" ? biz.url : void 0,
|
|
283
|
+
logoUrl
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function hoursFromSpec(spec) {
|
|
287
|
+
if (!spec) return [];
|
|
288
|
+
const items = Array.isArray(spec) ? spec : [spec];
|
|
289
|
+
const out = [];
|
|
290
|
+
for (const item of items) {
|
|
291
|
+
if (!item || typeof item !== "object") continue;
|
|
292
|
+
const o = item;
|
|
293
|
+
const rawDays = o.dayOfWeek;
|
|
294
|
+
const day = Array.isArray(rawDays) ? rawDays.map((d) => String(d).replace(/^https?:\/\/schema\.org\//, "")).join(", ") : String(rawDays || "").replace(/^https?:\/\/schema\.org\//, "");
|
|
295
|
+
const opens = o.opens;
|
|
296
|
+
const closes = o.closes;
|
|
297
|
+
if (day && opens && closes) out.push(`${day}: ${opens}\u2013${closes}`);
|
|
298
|
+
}
|
|
299
|
+
return out;
|
|
300
|
+
}
|
|
301
|
+
function jsonLdServices(nodes) {
|
|
302
|
+
const out = [];
|
|
303
|
+
for (const obj of walkJsonLd2(nodes)) {
|
|
304
|
+
const t = obj["@type"];
|
|
305
|
+
const type = Array.isArray(t) ? t.join(" ") : String(t || "");
|
|
306
|
+
if (!/Service|Offer/i.test(type)) continue;
|
|
307
|
+
const name = typeof obj.name === "string" ? obj.name.trim() : "";
|
|
308
|
+
if (!name) continue;
|
|
309
|
+
const blurb = typeof obj.description === "string" && obj.description.trim() || typeof obj.price === "string" && obj.price || "";
|
|
310
|
+
out.push({ name, blurb: String(blurb).slice(0, 180) });
|
|
311
|
+
}
|
|
312
|
+
return out;
|
|
313
|
+
}
|
|
314
|
+
function extractLists(html) {
|
|
315
|
+
const out = [];
|
|
316
|
+
for (const m of html.matchAll(/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi)) {
|
|
317
|
+
const items = [...m[2].matchAll(/<li\b[^>]*>([\s\S]*?)<\/li>/gi)].map(
|
|
318
|
+
(li) => decodeEntities(li[1].replace(/<[^>]+>/g, " "))
|
|
319
|
+
);
|
|
320
|
+
const joined = items.filter(Boolean).join(" \xB7 ");
|
|
321
|
+
if (joined) out.push(joined);
|
|
322
|
+
}
|
|
323
|
+
return out;
|
|
324
|
+
}
|
|
325
|
+
function extractTestimonials(html) {
|
|
326
|
+
const out = [];
|
|
327
|
+
for (const m of html.matchAll(/<blockquote\b[^>]*>([\s\S]*?)<\/blockquote>/gi)) {
|
|
328
|
+
const inner = m[1];
|
|
329
|
+
const cite = inner.match(/<cite\b[^>]*>([\s\S]*?)<\/cite>/i)?.[1];
|
|
330
|
+
const footer = inner.match(/<footer\b[^>]*>([\s\S]*?)<\/footer>/i)?.[1];
|
|
331
|
+
const quote = decodeEntities(inner.replace(/<(cite|footer)[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " "));
|
|
332
|
+
if (!quote || quote.length < 20) continue;
|
|
333
|
+
const attribution = decodeEntities((cite || footer || "").replace(/<[^>]+>/g, " ")) || void 0;
|
|
334
|
+
out.push({ quote, attribution });
|
|
335
|
+
}
|
|
336
|
+
return out;
|
|
337
|
+
}
|
|
338
|
+
function extractFaqs(html) {
|
|
339
|
+
const out = [];
|
|
340
|
+
for (const m of html.matchAll(/<dt\b[^>]*>([\s\S]*?)<\/dt>\s*<dd\b[^>]*>([\s\S]*?)<\/dd>/gi)) {
|
|
341
|
+
const question = decodeEntities(m[1].replace(/<[^>]+>/g, " "));
|
|
342
|
+
const answer = decodeEntities(m[2].replace(/<[^>]+>/g, " "));
|
|
343
|
+
if (question && answer) out.push({ question, answer });
|
|
344
|
+
}
|
|
345
|
+
for (const details of html.matchAll(/<details\b[^>]*>([\s\S]*?)<\/details>/gi)) {
|
|
346
|
+
const summary = details[1].match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i)?.[1];
|
|
347
|
+
if (!summary) continue;
|
|
348
|
+
const question = decodeEntities(summary.replace(/<[^>]+>/g, " "));
|
|
349
|
+
const answer = decodeEntities(
|
|
350
|
+
details[1].replace(/<summary[\s\S]*?<\/summary>/i, " ").replace(/<[^>]+>/g, " ")
|
|
351
|
+
);
|
|
352
|
+
if (question && answer) out.push({ question, answer });
|
|
353
|
+
}
|
|
354
|
+
return out;
|
|
355
|
+
}
|
|
356
|
+
function cssBackgroundUrls(html, pageUrl) {
|
|
357
|
+
const out = [];
|
|
358
|
+
for (const m of html.matchAll(/background(?:-image)?\s*:\s*[^;]*url\(\s*['"]?([^)'"]+)['"]?\s*\)/gi)) {
|
|
359
|
+
const abs = absolutize(m[1].trim(), pageUrl);
|
|
360
|
+
if (abs && !abs.startsWith("data:")) out.push(abs);
|
|
361
|
+
}
|
|
362
|
+
for (const m of html.matchAll(/style=["'][^"']*url\(\s*['"]?([^)'"]+)['"]?\s*\)[^"']*["']/gi)) {
|
|
363
|
+
const abs = absolutize(m[1].trim(), pageUrl);
|
|
364
|
+
if (abs && !abs.startsWith("data:")) out.push(abs);
|
|
365
|
+
}
|
|
366
|
+
return out;
|
|
367
|
+
}
|
|
368
|
+
function headingBefore(body, idx) {
|
|
369
|
+
const before = body.slice(0, idx);
|
|
370
|
+
const matches = [...before.matchAll(/<h[1-3][^>]*>([\s\S]*?)<\/h[1-3]>/gi)];
|
|
371
|
+
const last = matches.at(-1);
|
|
372
|
+
if (!last) return "";
|
|
373
|
+
return decodeEntities(last[1].replace(/<[^>]+>/g, " ")).slice(0, 80);
|
|
374
|
+
}
|
|
375
|
+
function isInChrome(tag, surrounding) {
|
|
376
|
+
if (/header|nav|navbar|site-header|masthead|\.logo|class=["'][^"']*logo/i.test(tag)) return true;
|
|
377
|
+
const lookback = surrounding.slice(Math.max(0, surrounding.length - 500));
|
|
378
|
+
return /<(header|nav)\b/i.test(lookback) && !/<\/(header|nav)>/i.test(lookback.split(/<(header|nav)\b/i).pop() || "");
|
|
379
|
+
}
|
|
380
|
+
function countUnlabeledInputs(html) {
|
|
381
|
+
const inputs = [...html.matchAll(/<(input|select|textarea)\b([^>]*)>/gi)];
|
|
382
|
+
let unlabeled = 0;
|
|
383
|
+
for (const m of inputs) {
|
|
384
|
+
const attrs = m[2] || "";
|
|
385
|
+
if (/type=["']hidden["']/i.test(attrs)) continue;
|
|
386
|
+
if (/aria-label=/i.test(attrs) || /aria-labelledby=/i.test(attrs)) continue;
|
|
387
|
+
const id = attrs.match(/\bid=["']([^"']+)["']/i)?.[1];
|
|
388
|
+
if (id && new RegExp(`<label[^>]+for=["']${id}["']`, "i").test(html)) continue;
|
|
389
|
+
if (!id) unlabeled += 1;
|
|
390
|
+
}
|
|
391
|
+
return unlabeled;
|
|
392
|
+
}
|
|
393
|
+
function extractNarrativeParagraphs(html) {
|
|
394
|
+
const clean = stripNoise(html);
|
|
395
|
+
const candidates = [];
|
|
396
|
+
for (const match of clean.matchAll(/<p\b[^>]*>([\s\S]*?)<\/p>/gi)) {
|
|
397
|
+
const value = decodeEntities(match[1].replace(/<[^>]+>/g, " "));
|
|
398
|
+
if (value) candidates.push({ index: match.index, text: value });
|
|
399
|
+
}
|
|
400
|
+
const prose = clean.replace(/<(nav|header|footer)\b[^>]*>[\s\S]*?<\/\1>/gi, (m) => " ".repeat(m.length));
|
|
401
|
+
for (const match of prose.matchAll(/<div\b([^>]*)>((?:(?!<\/?div\b)[\s\S])*?)<\/div>/gi)) {
|
|
402
|
+
if (/\b(?:hidden|aria-hidden\s*=\s*["']true["'])/i.test(match[1]) || /<(?:p|h[1-6]|ul|ol|li|button|input|select|textarea|nav)\b/i.test(match[2])) continue;
|
|
403
|
+
const value = decodeEntities(match[2].replace(/<[^>]+>/g, " "));
|
|
404
|
+
if (value.length >= 60 && value.split(/\s+/).length >= 8) candidates.push({ index: match.index, text: value });
|
|
405
|
+
}
|
|
406
|
+
return [...new Set(candidates.sort((a, b) => a.index - b.index).map((c) => c.text))];
|
|
407
|
+
}
|
|
408
|
+
function extractPage(html, pageUrl) {
|
|
409
|
+
const origin = new URL(pageUrl).origin;
|
|
410
|
+
const raw = html;
|
|
411
|
+
const base = documentBase(html, pageUrl);
|
|
412
|
+
const body = stripNoise(html);
|
|
413
|
+
const title = decodeEntities((body.match(/<title[^>]*>([\s\S]*?)<\/title>/i)?.[1] || "").replace(/<[^>]+>/g, " "));
|
|
414
|
+
const description = meta(body, "description") || meta(body, "og:description");
|
|
415
|
+
const h1 = tags(body, "h1");
|
|
416
|
+
const h2 = tags(body, "h2");
|
|
417
|
+
const h3 = tags(body, "h3");
|
|
418
|
+
const h4 = tags(body, "h4");
|
|
419
|
+
const headings = [...h2, ...h3, ...h4];
|
|
420
|
+
const paragraphs = extractNarrativeParagraphs(body);
|
|
421
|
+
const outline = [...h1, ...headings];
|
|
422
|
+
const lists = extractLists(body);
|
|
423
|
+
const testimonials = extractTestimonials(body);
|
|
424
|
+
const faqs = extractFaqs(body);
|
|
425
|
+
const lang = raw.match(/<html[^>]+lang=["']([^"']+)["']/i)?.[1];
|
|
426
|
+
const canonicalRaw = raw.match(/<link[^>]+rel=["']canonical["'][^>]+href=["']([^"']+)["']/i)?.[1] || raw.match(/<link[^>]+href=["']([^"']+)["'][^>]+rel=["']canonical["']/i)?.[1];
|
|
427
|
+
const canonical = canonicalRaw ? absolutize(canonicalRaw, base) || void 0 : void 0;
|
|
428
|
+
const linkTags = [...body.matchAll(/<a\b([^>]*)>([\s\S]*?)<\/a>/gi)];
|
|
429
|
+
const links = [];
|
|
430
|
+
const ctas = [];
|
|
431
|
+
for (const tag of linkTags) {
|
|
432
|
+
const hrefRaw = tag[1].match(/href=["']([^"']+)["']/i)?.[1];
|
|
433
|
+
if (!hrefRaw) continue;
|
|
434
|
+
const label = decodeEntities(tag[2].replace(/<[^>]+>/g, " "));
|
|
435
|
+
const relative = isPathRelativeHref(hrefRaw);
|
|
436
|
+
const abs = hrefRaw.startsWith("tel:") || hrefRaw.startsWith("mailto:") ? hrefRaw : absolutize(hrefRaw, base);
|
|
437
|
+
if (!abs && !hrefRaw.startsWith("tel:") && !hrefRaw.startsWith("mailto:")) continue;
|
|
438
|
+
const href = abs || hrefRaw;
|
|
439
|
+
links.push({ href, label, ...relative ? { relative: true } : {} });
|
|
440
|
+
const kind = classifyHref(href, origin);
|
|
441
|
+
if (kind === "tel" || kind === "mailto" || CTA_WORDS.test(label) || /btn|button/i.test(tag[1])) {
|
|
442
|
+
ctas.push({ href, label: label || kind, kind });
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
for (const btn of body.matchAll(/<button\b([^>]*)>([\s\S]*?)<\/button>/gi)) {
|
|
446
|
+
const label = decodeEntities(btn[2].replace(/<[^>]+>/g, " "));
|
|
447
|
+
if (label && CTA_WORDS.test(label)) {
|
|
448
|
+
ctas.push({ href: "", label, kind: "other" });
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const images = [];
|
|
452
|
+
const pushImg = (img) => {
|
|
453
|
+
if (!img.src || img.src.startsWith("data:")) return;
|
|
454
|
+
images.push({ ...img, pageUrl: img.pageUrl || pageUrl });
|
|
455
|
+
};
|
|
456
|
+
for (const open of body.matchAll(/<img\b[^>]*>/gi)) {
|
|
457
|
+
const tag = open[0];
|
|
458
|
+
const idx = open.index ?? 0;
|
|
459
|
+
const surrounding = body.slice(Math.max(0, idx - 400), idx + tag.length);
|
|
460
|
+
const srcset = tag.match(/srcset=["']([^"']+)["']/i)?.[1];
|
|
461
|
+
const srcRaw = tag.match(/src=["']([^"']+)["']/i)?.[1] || tag.match(/data-src=["']([^"']+)["']/i)?.[1] || tag.match(/data-lazy-src=["']([^"']+)["']/i)?.[1] || tag.match(/data-original=["']([^"']+)["']/i)?.[1];
|
|
462
|
+
const best = srcset && fromSrcset(srcset, base) || (srcRaw && !srcRaw.startsWith("data:") ? absolutize(srcRaw, base) : null);
|
|
463
|
+
if (!best) continue;
|
|
464
|
+
const alt = decodeEntities(tag.match(/alt=["']([^"']*)["']/i)?.[1] || "");
|
|
465
|
+
const inChrome = isInChrome(tag, surrounding);
|
|
466
|
+
const nearbyHeading = headingBefore(body, idx);
|
|
467
|
+
pushImg({
|
|
468
|
+
src: best,
|
|
469
|
+
alt,
|
|
470
|
+
width: dim(tag, "width"),
|
|
471
|
+
height: dim(tag, "height"),
|
|
472
|
+
inChrome,
|
|
473
|
+
pageUrl,
|
|
474
|
+
nearbyHeading
|
|
475
|
+
});
|
|
476
|
+
if (srcset) {
|
|
477
|
+
for (const u of allFromSrcset(srcset, base)) {
|
|
478
|
+
if (u !== best) pushImg({ src: u, alt, inChrome, pageUrl, nearbyHeading });
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
for (const pic of body.matchAll(/<picture\b[^>]*>([\s\S]*?)<\/picture>/gi)) {
|
|
483
|
+
for (const srcset of pic[1].matchAll(/srcset=["']([^"']+)["']/gi)) {
|
|
484
|
+
for (const u of allFromSrcset(srcset[1], base)) {
|
|
485
|
+
pushImg({ src: u, alt: "" });
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
for (const bg of cssBackgroundUrls(raw, base)) {
|
|
490
|
+
pushImg({ src: bg, alt: "", aboveFold: false });
|
|
491
|
+
}
|
|
492
|
+
const og = meta(raw, "og:image");
|
|
493
|
+
if (og) {
|
|
494
|
+
const src = absolutize(og, base);
|
|
495
|
+
if (src) pushImg({ src, alt: title, fromOg: true, aboveFold: true });
|
|
496
|
+
}
|
|
497
|
+
const appleTouch = raw.match(
|
|
498
|
+
/<link[^>]+rel=["']apple-touch-icon["'][^>]+href=["']([^"']+)["']/i
|
|
499
|
+
)?.[1];
|
|
500
|
+
if (appleTouch) {
|
|
501
|
+
const src = absolutize(appleTouch, base);
|
|
502
|
+
if (src) pushImg({ src, alt: "apple-touch-icon", inChrome: true });
|
|
503
|
+
}
|
|
504
|
+
const jsonLd = parseJsonLd(raw);
|
|
505
|
+
const biz = businessFromJsonLd(jsonLd);
|
|
506
|
+
if (biz.logoUrl) {
|
|
507
|
+
const src = absolutize(biz.logoUrl, base);
|
|
508
|
+
if (src) pushImg({ src, alt: "logo", fromJsonLdLogo: true, inChrome: true });
|
|
509
|
+
}
|
|
510
|
+
for (const obj of walkJsonLd2(jsonLd)) {
|
|
511
|
+
const imgField = obj.image;
|
|
512
|
+
const urls = [];
|
|
513
|
+
if (typeof imgField === "string") urls.push(imgField);
|
|
514
|
+
else if (Array.isArray(imgField)) {
|
|
515
|
+
for (const item of imgField) {
|
|
516
|
+
if (typeof item === "string") urls.push(item);
|
|
517
|
+
else if (item && typeof item === "object" && typeof item.url === "string") {
|
|
518
|
+
urls.push(item.url);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
} else if (imgField && typeof imgField === "object" && typeof imgField.url === "string") {
|
|
522
|
+
urls.push(imgField.url);
|
|
523
|
+
}
|
|
524
|
+
for (const u of urls) {
|
|
525
|
+
const src = absolutize(u, base);
|
|
526
|
+
if (src) pushImg({ src, alt: typeof obj.name === "string" ? obj.name : "" });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const social = collectSocialLinks({ links, jsonLd });
|
|
530
|
+
const textBlob = `${body} ${links.map((l) => l.href).join(" ")}`;
|
|
531
|
+
const dedupedImages = dedupeImages(images);
|
|
532
|
+
const missingAlts = dedupedImages.filter((i) => !i.alt.trim()).length;
|
|
533
|
+
return {
|
|
534
|
+
url: pageUrl,
|
|
535
|
+
title,
|
|
536
|
+
description,
|
|
537
|
+
canonical,
|
|
538
|
+
lang: lang || void 0,
|
|
539
|
+
h1,
|
|
540
|
+
headings,
|
|
541
|
+
outline,
|
|
542
|
+
paragraphs,
|
|
543
|
+
lists,
|
|
544
|
+
testimonials,
|
|
545
|
+
faqs,
|
|
546
|
+
links,
|
|
547
|
+
ctas: dedupeCtas(ctas),
|
|
548
|
+
images: dedupedImages,
|
|
549
|
+
phones: extractPhones(textBlob),
|
|
550
|
+
emails: extractEmails(textBlob),
|
|
551
|
+
social,
|
|
552
|
+
jsonLd,
|
|
553
|
+
audit: {
|
|
554
|
+
h1Count: h1.length,
|
|
555
|
+
missingAlts,
|
|
556
|
+
unlabeledInputs: countUnlabeledInputs(body),
|
|
557
|
+
hasCanonical: Boolean(canonical),
|
|
558
|
+
hasLang: Boolean(lang),
|
|
559
|
+
hasJsonLd: jsonLd.length > 0,
|
|
560
|
+
titleLength: title.length,
|
|
561
|
+
descriptionLength: description.length
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function dedupeCtas(ctas) {
|
|
566
|
+
const seen = /* @__PURE__ */ new Set();
|
|
567
|
+
const out = [];
|
|
568
|
+
for (const c of ctas) {
|
|
569
|
+
const key = `${c.kind}|${c.href}|${c.label.toLowerCase()}`;
|
|
570
|
+
if (seen.has(key)) continue;
|
|
571
|
+
seen.add(key);
|
|
572
|
+
out.push(c);
|
|
573
|
+
}
|
|
574
|
+
return out;
|
|
575
|
+
}
|
|
576
|
+
function dedupeImages(images) {
|
|
577
|
+
const seen = /* @__PURE__ */ new Set();
|
|
578
|
+
const out = [];
|
|
579
|
+
for (const img of images) {
|
|
580
|
+
if (seen.has(img.src)) {
|
|
581
|
+
const existing = out.find((i) => i.src === img.src);
|
|
582
|
+
if (existing) {
|
|
583
|
+
existing.inChrome = existing.inChrome || img.inChrome;
|
|
584
|
+
existing.fromJsonLdLogo = existing.fromJsonLdLogo || img.fromJsonLdLogo;
|
|
585
|
+
existing.fromOg = existing.fromOg || img.fromOg;
|
|
586
|
+
existing.aboveFold = existing.aboveFold || img.aboveFold;
|
|
587
|
+
if (!existing.alt && img.alt) existing.alt = img.alt;
|
|
588
|
+
if (!existing.nearbyHeading && img.nearbyHeading) existing.nearbyHeading = img.nearbyHeading;
|
|
589
|
+
if (!existing.pageUrl && img.pageUrl) existing.pageUrl = img.pageUrl;
|
|
590
|
+
}
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
if (isLikelyTrackingImage(img)) continue;
|
|
594
|
+
seen.add(img.src);
|
|
595
|
+
out.push({ ...img });
|
|
596
|
+
}
|
|
597
|
+
return out;
|
|
598
|
+
}
|
|
599
|
+
function parseSitemapLocs(xml) {
|
|
600
|
+
return [...xml.matchAll(/<loc>\s*([^<]+)\s*<\/loc>/gi)].map((m) => decodeEntities(m[1].trim()));
|
|
601
|
+
}
|
|
602
|
+
function inferPrimaryCta(ctas) {
|
|
603
|
+
const rank = (c) => {
|
|
604
|
+
if (c.kind === "tel") return 2;
|
|
605
|
+
if (/book|appoint|schedule|reserve/i.test(c.label)) return 0;
|
|
606
|
+
if (/quote|estimate|contact|call/i.test(c.label)) return 1;
|
|
607
|
+
if (c.kind === "mailto") return 3;
|
|
608
|
+
return 4;
|
|
609
|
+
};
|
|
610
|
+
return [...ctas].sort((a, b) => rank(a) - rank(b))[0];
|
|
611
|
+
}
|
|
612
|
+
function pageCopySlug(pageUrl, index) {
|
|
613
|
+
try {
|
|
614
|
+
const u = new URL(pageUrl);
|
|
615
|
+
let path = u.pathname.replace(/\/+$/, "") || "index";
|
|
616
|
+
path = path.replace(/^\//, "").replace(/[^\w./-]+/g, "-").replace(/\//g, "__");
|
|
617
|
+
if (!path || path === "-") path = "index";
|
|
618
|
+
return `${String(index).padStart(3, "0")}-${path}`.slice(0, 120);
|
|
619
|
+
} catch {
|
|
620
|
+
return `${String(index).padStart(3, "0")}-page`;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// src/onboard/brief.ts
|
|
625
|
+
var GENERIC_HEADING = /^(home|about( us)?|contact|blog|news|privacy|terms|faq|hours|location|gallery|welcome|our story|get in touch|follow us|our services|what we offer|why (choose us|choose|us)|testimonials?|support|legal|social|how it works|what'?s included|featured( work)?|built for)$/i;
|
|
626
|
+
var NOT_A_SERVICE = /agreement|policy|terms of service|privacy|cookie|contractor|universal terms|master services|^legal$|^support$|^social$|^about$|^home$|^shop$|^login$/i;
|
|
627
|
+
var NUMBERED_CASE_STUDY = /^\d{1,2}[\.\)]?\s+\S/;
|
|
628
|
+
var SERVICE_PATH = /\/(service|services|menu|offer|offers|treat|treatments)(\/|$)/i;
|
|
629
|
+
var SERVICE_PAGE = /\/(service|services|menu|offer|offers|pricing|features|packages)(\/|$)/i;
|
|
630
|
+
var COMPOSE_NOTE = "Follow the agent skill graph (agent/PROMPT.md). Keep facts (name, phone, email, address, hours, services, primary CTA, social). Keep the old site\u2019s media language: owner photos, illustrations, device mockups, portraits, and press marks \u2014 use interpret shortlist /media paths first. Invent new layout, copy, and chrome; do not clone the old grid 1:1. If the old home has a named visual chapter (How It Works, Featured work, Built for\u2026), restyle it on the new home instead of moving it to an inner route.";
|
|
631
|
+
function emptyFacts() {
|
|
632
|
+
return {
|
|
633
|
+
name: "",
|
|
634
|
+
phone: "",
|
|
635
|
+
email: "",
|
|
636
|
+
address: "",
|
|
637
|
+
city: "",
|
|
638
|
+
hours: [],
|
|
639
|
+
primaryCta: { label: "", href: "" },
|
|
640
|
+
services: [],
|
|
641
|
+
social: []
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
function first(...vals) {
|
|
645
|
+
for (const v of vals) {
|
|
646
|
+
if (v && v.trim()) return v.trim();
|
|
647
|
+
}
|
|
648
|
+
return "";
|
|
649
|
+
}
|
|
650
|
+
function parseHoursFromText(text) {
|
|
651
|
+
const days = "Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|Mon|Tue|Wed|Thu|Fri|Sat|Sun";
|
|
652
|
+
const re = new RegExp(`\\b(${days})\\b[:\\s\u2013-]+([^\\n<]{2,40})`, "gi");
|
|
653
|
+
const out = [];
|
|
654
|
+
for (const m of text.matchAll(re)) {
|
|
655
|
+
const hours = m[2].replace(/\s+/g, " ").trim();
|
|
656
|
+
if (/closed|by appointment|\d/i.test(hours)) out.push(`${m[1]}: ${hours}`);
|
|
657
|
+
}
|
|
658
|
+
return [...new Set(out)].slice(0, 7);
|
|
659
|
+
}
|
|
660
|
+
function isServiceHeading(heading, pageUrl) {
|
|
661
|
+
if (GENERIC_HEADING.test(heading) || NOT_A_SERVICE.test(heading) || heading.length > 48) return false;
|
|
662
|
+
try {
|
|
663
|
+
const path = new URL(pageUrl).pathname;
|
|
664
|
+
if (NUMBERED_CASE_STUDY.test(heading) && !SERVICE_PATH.test(path)) return false;
|
|
665
|
+
} catch {
|
|
666
|
+
if (NUMBERED_CASE_STUDY.test(heading)) return false;
|
|
667
|
+
}
|
|
668
|
+
return true;
|
|
669
|
+
}
|
|
670
|
+
function inferServices(pages) {
|
|
671
|
+
const fromLd = pages.flatMap((p) => jsonLdServices(p.jsonLd)).filter((s) => isServiceHeading(s.name, ""));
|
|
672
|
+
if (fromLd.length) return fromLd;
|
|
673
|
+
const servicePages = pages.filter((p) => {
|
|
674
|
+
try {
|
|
675
|
+
const path = new URL(p.url).pathname;
|
|
676
|
+
return SERVICE_PAGE.test(path) || /service|menu|offer|pricing|features/i.test(p.title);
|
|
677
|
+
} catch {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
const pool = servicePages.length ? servicePages : pages.slice(0, 1);
|
|
682
|
+
const fromHeadings = [];
|
|
683
|
+
for (const page of pool) {
|
|
684
|
+
for (const heading of [...page.h1.slice(1), ...page.headings]) {
|
|
685
|
+
if (!isServiceHeading(heading, page.url)) continue;
|
|
686
|
+
if (fromHeadings.some((s) => s.name.toLowerCase() === heading.toLowerCase())) continue;
|
|
687
|
+
const blurb = page.paragraphs.find(
|
|
688
|
+
(p) => p.length > 40 && p.length < 220 && p.toLowerCase().includes(heading.toLowerCase().slice(0, Math.min(12, heading.length)))
|
|
689
|
+
) || "";
|
|
690
|
+
fromHeadings.push({ name: heading, blurb });
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return fromHeadings.slice(0, 12);
|
|
694
|
+
}
|
|
695
|
+
function collectCandidateImages(pages) {
|
|
696
|
+
const seen = /* @__PURE__ */ new Set();
|
|
697
|
+
const out = [];
|
|
698
|
+
for (const page of pages) {
|
|
699
|
+
for (const img of page.images) {
|
|
700
|
+
if (seen.has(img.src)) {
|
|
701
|
+
const existing = out.find((i) => i.src === img.src);
|
|
702
|
+
if (existing) {
|
|
703
|
+
existing.inChrome = existing.inChrome || img.inChrome;
|
|
704
|
+
existing.fromJsonLdLogo = existing.fromJsonLdLogo || img.fromJsonLdLogo;
|
|
705
|
+
existing.fromOg = existing.fromOg || img.fromOg;
|
|
706
|
+
existing.aboveFold = existing.aboveFold || img.aboveFold;
|
|
707
|
+
if (!existing.alt && img.alt) existing.alt = img.alt;
|
|
708
|
+
if (!existing.nearbyHeading && img.nearbyHeading) existing.nearbyHeading = img.nearbyHeading;
|
|
709
|
+
if (!existing.pageUrl && img.pageUrl) existing.pageUrl = img.pageUrl;
|
|
710
|
+
}
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
seen.add(img.src);
|
|
714
|
+
out.push({ ...img });
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
return out;
|
|
718
|
+
}
|
|
719
|
+
function missingCritical(facts) {
|
|
720
|
+
const missing = [];
|
|
721
|
+
if (!facts.name) missing.push("name");
|
|
722
|
+
if (!facts.phone) missing.push("phone");
|
|
723
|
+
if (!facts.email) missing.push("email");
|
|
724
|
+
if (!facts.address && !facts.city) missing.push("address");
|
|
725
|
+
if (!facts.primaryCta.label && !facts.primaryCta.href) missing.push("primaryCta");
|
|
726
|
+
if (!facts.hours.length) missing.push("hours");
|
|
727
|
+
if (!facts.services.length) missing.push("services");
|
|
728
|
+
return missing;
|
|
729
|
+
}
|
|
730
|
+
function mergeFacts(pages, seed = {}) {
|
|
731
|
+
const facts = emptyFacts();
|
|
732
|
+
const ldList = pages.map((p) => businessFromJsonLd(p.jsonLd));
|
|
733
|
+
facts.name = first(seed.name, ...ldList.map((b) => b.name), pages[0]?.h1[0], pages[0]?.title);
|
|
734
|
+
facts.phone = first(seed.phone, ...ldList.map((b) => b.phone), ...pages.flatMap((p) => p.phones));
|
|
735
|
+
facts.email = first(seed.email, ...ldList.map((b) => b.email), ...pages.flatMap((p) => p.emails));
|
|
736
|
+
facts.address = first(seed.address, ...ldList.map((b) => b.address));
|
|
737
|
+
facts.city = first(seed.city, ...ldList.map((b) => b.city));
|
|
738
|
+
facts.hours = seed.hours?.length ? seed.hours : firstNonEmpty(
|
|
739
|
+
ldList.flatMap((b) => b.hours || []),
|
|
740
|
+
pages.flatMap((p) => parseHoursFromText([p.title, ...p.headings, ...p.paragraphs].join("\n")))
|
|
741
|
+
);
|
|
742
|
+
const ctas = pages.flatMap((p) => p.ctas);
|
|
743
|
+
const cta = inferPrimaryCta(ctas);
|
|
744
|
+
facts.primaryCta = seed.primaryCta && (seed.primaryCta.label || seed.primaryCta.href) ? seed.primaryCta : { label: cta?.label || "", href: cta?.href || "" };
|
|
745
|
+
facts.services = seed.services?.length ? seed.services : inferServices(pages);
|
|
746
|
+
if (facts.name.includes("|")) facts.name = facts.name.split("|")[0].trim();
|
|
747
|
+
if (seed.social?.length) {
|
|
748
|
+
facts.social = seed.social;
|
|
749
|
+
} else {
|
|
750
|
+
const seen = /* @__PURE__ */ new Set();
|
|
751
|
+
for (const page of pages) {
|
|
752
|
+
for (const s of page.social) {
|
|
753
|
+
const key = s.url.replace(/\/+$/, "").toLowerCase();
|
|
754
|
+
if (seen.has(key)) continue;
|
|
755
|
+
seen.add(key);
|
|
756
|
+
facts.social.push(s);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if (!facts.social.length) {
|
|
760
|
+
facts.social = collectSocialLinks({
|
|
761
|
+
links: pages.flatMap((p) => p.links),
|
|
762
|
+
jsonLd: pages.flatMap((p) => p.jsonLd)
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return facts;
|
|
767
|
+
}
|
|
768
|
+
function firstNonEmpty(a, b) {
|
|
769
|
+
return a.length ? [...new Set(a)].slice(0, 8) : [...new Set(b)].slice(0, 8);
|
|
770
|
+
}
|
|
771
|
+
function assembleBrief(opts) {
|
|
772
|
+
const business = mergeFacts(opts.pages, opts.seed);
|
|
773
|
+
const pages = opts.pages.map((p) => ({
|
|
774
|
+
aliasOf: p.aliasOf,
|
|
775
|
+
url: p.url,
|
|
776
|
+
title: p.title,
|
|
777
|
+
description: p.description,
|
|
778
|
+
canonical: p.canonical,
|
|
779
|
+
outline: p.outline,
|
|
780
|
+
paragraphs: p.paragraphs,
|
|
781
|
+
lists: p.lists || [],
|
|
782
|
+
testimonials: p.testimonials || [],
|
|
783
|
+
faqs: p.faqs || [],
|
|
784
|
+
ctas: p.ctas,
|
|
785
|
+
copyFile: opts.copyFiles?.get(p.url),
|
|
786
|
+
audit: p.audit
|
|
787
|
+
}));
|
|
788
|
+
return {
|
|
789
|
+
version: 2,
|
|
790
|
+
sourceUrl: opts.sourceUrl,
|
|
791
|
+
crawledAt: opts.crawledAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
792
|
+
slug: opts.slug,
|
|
793
|
+
business,
|
|
794
|
+
missing: missingCritical(business),
|
|
795
|
+
pages,
|
|
796
|
+
images: opts.images || [],
|
|
797
|
+
warnings: opts.warnings || [],
|
|
798
|
+
compose: COMPOSE_NOTE,
|
|
799
|
+
visual: opts.visual || (opts.pages.length ? {
|
|
800
|
+
register: inferRegister(opts.pages, business),
|
|
801
|
+
signatureSections: inferSignatureSections(opts.pages),
|
|
802
|
+
hints: {},
|
|
803
|
+
stills: []
|
|
804
|
+
} : void 0)
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
var SIGNATURE_HEADING = /how it works|what'?s included|featured|portfolio|built for|meet the team|testimonial|industries|our work|case stud/i;
|
|
808
|
+
function inferSignatureSections(pages) {
|
|
809
|
+
const home = pages[0];
|
|
810
|
+
if (!home) return [];
|
|
811
|
+
const out = [];
|
|
812
|
+
for (const heading of home.outline) {
|
|
813
|
+
if (SIGNATURE_HEADING.test(heading) && !out.some((h) => h.toLowerCase() === heading.toLowerCase())) {
|
|
814
|
+
out.push(heading);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
return out.slice(0, 8);
|
|
818
|
+
}
|
|
819
|
+
function inferRegister(pages, business) {
|
|
820
|
+
const blob = [
|
|
821
|
+
business.name,
|
|
822
|
+
...pages.slice(0, 6).flatMap((p) => [p.title, p.description, ...p.outline.slice(0, 12)])
|
|
823
|
+
].join(" ").toLowerCase();
|
|
824
|
+
if (/salon|spa|beauty|lash|nail|barber|med spa/.test(blob)) return "beauty";
|
|
825
|
+
if (/platform|saas|software|demo|features|pricing|marketing agency|automations|digital marketing|website builder/.test(
|
|
826
|
+
blob
|
|
827
|
+
)) {
|
|
828
|
+
return "b2b";
|
|
829
|
+
}
|
|
830
|
+
return "trade";
|
|
831
|
+
}
|
|
832
|
+
function assembleAudit(opts) {
|
|
833
|
+
const pageRows = opts.pages.map((p) => ({
|
|
834
|
+
url: p.url,
|
|
835
|
+
title: p.title,
|
|
836
|
+
description: p.description,
|
|
837
|
+
canonical: p.canonical,
|
|
838
|
+
lang: p.lang,
|
|
839
|
+
...p.audit
|
|
840
|
+
}));
|
|
841
|
+
return {
|
|
842
|
+
version: 1,
|
|
843
|
+
sourceUrl: opts.sourceUrl,
|
|
844
|
+
crawledAt: opts.crawledAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
845
|
+
pages: pageRows,
|
|
846
|
+
summary: {
|
|
847
|
+
pageCount: pageRows.length,
|
|
848
|
+
pagesMissingTitle: pageRows.filter((p) => !p.title).length,
|
|
849
|
+
pagesMissingDescription: pageRows.filter((p) => !p.description).length,
|
|
850
|
+
pagesMultipleH1: pageRows.filter((p) => p.h1Count > 1).length,
|
|
851
|
+
pagesZeroH1: pageRows.filter((p) => p.h1Count === 0).length,
|
|
852
|
+
totalMissingAlts: pageRows.reduce((n, p) => n + p.missingAlts, 0),
|
|
853
|
+
totalUnlabeledInputs: pageRows.reduce((n, p) => n + p.unlabeledInputs, 0)
|
|
854
|
+
},
|
|
855
|
+
webVitals: null
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function emptyResearch(social = []) {
|
|
859
|
+
return {
|
|
860
|
+
version: 1,
|
|
861
|
+
reviews: { snippets: [], sourceUrls: [] },
|
|
862
|
+
social: [...social],
|
|
863
|
+
goals: {},
|
|
864
|
+
sources: [],
|
|
865
|
+
completed: false
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// scripts/onboard/prompt.ts
|
|
870
|
+
var input = process.stdin;
|
|
871
|
+
var output = process.stdout;
|
|
872
|
+
async function ask(rl, label, current = "") {
|
|
873
|
+
const suffix = current ? ` [${current}]` : "";
|
|
874
|
+
const answer = (await rl.question(`${label}${suffix}: `)).trim();
|
|
875
|
+
return answer || current;
|
|
876
|
+
}
|
|
877
|
+
async function promptMissingFacts(facts, opts) {
|
|
878
|
+
const missing = missingCritical(facts);
|
|
879
|
+
if (!missing.length || opts.noPrompt) return facts;
|
|
880
|
+
if (!input.isTTY) {
|
|
881
|
+
console.warn("Non-interactive terminal; pass flags or run without --no-prompt on a TTY to fill missing fields.");
|
|
882
|
+
return facts;
|
|
883
|
+
}
|
|
884
|
+
console.log("\nCrawl missed some critical fields. Fill them in (Enter skips):\n");
|
|
885
|
+
const rl = readline.createInterface({ input, output });
|
|
886
|
+
const next = {
|
|
887
|
+
...facts,
|
|
888
|
+
primaryCta: { ...facts.primaryCta },
|
|
889
|
+
hours: [...facts.hours],
|
|
890
|
+
services: [...facts.services],
|
|
891
|
+
social: [...facts.social || []]
|
|
892
|
+
};
|
|
893
|
+
try {
|
|
894
|
+
const need = new Set(missing);
|
|
895
|
+
if (need.has("name")) next.name = await ask(rl, "Business name", next.name);
|
|
896
|
+
if (need.has("phone")) next.phone = await ask(rl, "Phone", next.phone);
|
|
897
|
+
if (need.has("email")) next.email = await ask(rl, "Email", next.email);
|
|
898
|
+
if (need.has("address")) {
|
|
899
|
+
next.address = await ask(rl, "Street address", next.address);
|
|
900
|
+
next.city = await ask(rl, "City", next.city);
|
|
901
|
+
}
|
|
902
|
+
if (need.has("primaryCta")) {
|
|
903
|
+
next.primaryCta.label = await ask(rl, "Primary CTA label (e.g. Book a chair)", next.primaryCta.label);
|
|
904
|
+
next.primaryCta.href = await ask(rl, "Primary CTA URL (tel:, mailto:, or /contact)", next.primaryCta.href);
|
|
905
|
+
}
|
|
906
|
+
if (need.has("hours")) {
|
|
907
|
+
const hours = await ask(rl, "Hours (e.g. Mon\u2013Fri 9am\u20135pm)", next.hours.join("; "));
|
|
908
|
+
if (hours) next.hours = hours.split(/;|\n/).map((h) => h.trim()).filter(Boolean);
|
|
909
|
+
}
|
|
910
|
+
if (need.has("services")) {
|
|
911
|
+
const services = await ask(rl, "Services (comma-separated)", next.services.map((s) => s.name).join(", "));
|
|
912
|
+
if (services) {
|
|
913
|
+
next.services = services.split(",").map((name) => ({ name: name.trim(), blurb: "" })).filter((s) => s.name);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
} finally {
|
|
917
|
+
rl.close();
|
|
918
|
+
}
|
|
919
|
+
return next;
|
|
920
|
+
}
|
|
921
|
+
function normalizeSourceUrl(url) {
|
|
922
|
+
const trimmed = url.trim();
|
|
923
|
+
if (!trimmed) return "";
|
|
924
|
+
if (trimmed.startsWith("--")) {
|
|
925
|
+
throw new Error(`Invalid URL "${trimmed}". Pass --from https://existing-site.example`);
|
|
926
|
+
}
|
|
927
|
+
const withProto = /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
928
|
+
const parsed = new URL(withProto);
|
|
929
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
930
|
+
throw new Error("Source URL must be http(s)");
|
|
931
|
+
}
|
|
932
|
+
return parsed.href;
|
|
933
|
+
}
|
|
934
|
+
async function promptSourceUrl(opts) {
|
|
935
|
+
if (opts.blank) return "";
|
|
936
|
+
if (opts.from) return normalizeSourceUrl(opts.from);
|
|
937
|
+
if (opts.noPrompt || !input.isTTY) {
|
|
938
|
+
throw new Error("Pass --from https://existing-site.example or --blank");
|
|
939
|
+
}
|
|
940
|
+
const rl = readline.createInterface({ input, output });
|
|
941
|
+
try {
|
|
942
|
+
const url = (await rl.question("Existing site URL to crawl (required unless this is a blank starter; Enter skips): ")).trim();
|
|
943
|
+
return url ? normalizeSourceUrl(url) : "";
|
|
944
|
+
} finally {
|
|
945
|
+
rl.close();
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// scripts/onboard/run.ts
|
|
950
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync, writeFileSync } from "node:fs";
|
|
951
|
+
import { join as join3 } from "node:path";
|
|
952
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
953
|
+
|
|
954
|
+
// src/onboard/outline.ts
|
|
955
|
+
function renderPageCopy(page) {
|
|
956
|
+
const lines = [];
|
|
957
|
+
lines.push(`# ${page.title || page.url}`);
|
|
958
|
+
lines.push("");
|
|
959
|
+
lines.push(`Source: ${page.url}`);
|
|
960
|
+
if (page.description) {
|
|
961
|
+
lines.push("");
|
|
962
|
+
lines.push(`> ${page.description}`);
|
|
963
|
+
}
|
|
964
|
+
if (page.outline.length) {
|
|
965
|
+
lines.push("");
|
|
966
|
+
lines.push("## Outline");
|
|
967
|
+
for (const h of page.outline) lines.push(`- ${h}`);
|
|
968
|
+
}
|
|
969
|
+
if (page.paragraphs.length) {
|
|
970
|
+
lines.push("");
|
|
971
|
+
lines.push("## Copy");
|
|
972
|
+
for (const p of page.paragraphs) {
|
|
973
|
+
lines.push("");
|
|
974
|
+
lines.push(p);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (page.lists.length) {
|
|
978
|
+
lines.push("");
|
|
979
|
+
lines.push("## Lists");
|
|
980
|
+
for (const list of page.lists) {
|
|
981
|
+
lines.push("");
|
|
982
|
+
lines.push(`- ${list}`);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if (page.testimonials.length) {
|
|
986
|
+
lines.push("");
|
|
987
|
+
lines.push("## Testimonials");
|
|
988
|
+
for (const t of page.testimonials) {
|
|
989
|
+
lines.push("");
|
|
990
|
+
lines.push(`> ${t.quote}`);
|
|
991
|
+
if (t.attribution) lines.push(`> \u2014 ${t.attribution}`);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
if (page.faqs.length) {
|
|
995
|
+
lines.push("");
|
|
996
|
+
lines.push("## FAQ");
|
|
997
|
+
for (const f of page.faqs) {
|
|
998
|
+
lines.push("");
|
|
999
|
+
lines.push(`**Q:** ${f.question}`);
|
|
1000
|
+
lines.push(`**A:** ${f.answer}`);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
if (page.ctas.length) {
|
|
1004
|
+
lines.push("");
|
|
1005
|
+
lines.push("## CTAs");
|
|
1006
|
+
for (const c of page.ctas) {
|
|
1007
|
+
lines.push(`- [${c.label}](${c.href || "#"}) (${c.kind})`);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
lines.push("");
|
|
1011
|
+
return lines.join("\n");
|
|
1012
|
+
}
|
|
1013
|
+
function buildCopyFiles(pages) {
|
|
1014
|
+
const out = /* @__PURE__ */ new Map();
|
|
1015
|
+
pages.forEach((page, i) => {
|
|
1016
|
+
const slug = pageCopySlug(page.url, i);
|
|
1017
|
+
out.set(page.url, { slug, markdown: renderPageCopy(page) });
|
|
1018
|
+
});
|
|
1019
|
+
return out;
|
|
1020
|
+
}
|
|
1021
|
+
function imageLine(img) {
|
|
1022
|
+
const bits = [`**${img.role}**`, `kind=${img.kind}`];
|
|
1023
|
+
if (img.mediaType) bits.push(`type=${img.mediaType}`);
|
|
1024
|
+
if (img.alt) bits.push(`alt="${img.alt}"`);
|
|
1025
|
+
if (img.nearbyHeading) bits.push(`near="${img.nearbyHeading}"`);
|
|
1026
|
+
if (img.localPath) bits.push(`use=${img.localPath}`);
|
|
1027
|
+
if (img.error) bits.push(`error=${img.error}`);
|
|
1028
|
+
return `- ${bits.join(" \xB7 ")} \u2014 ${img.src || img.sourceUrl}`;
|
|
1029
|
+
}
|
|
1030
|
+
function renderMediaGuide(brief) {
|
|
1031
|
+
const ok = brief.images.filter((i) => i.role !== "failed" && i.localPath);
|
|
1032
|
+
const hintShortlist = brief.images.filter((i) => i.shortlist);
|
|
1033
|
+
const lines = [];
|
|
1034
|
+
lines.push(`# Media guide \u2014 ${brief.business.name || brief.slug}`);
|
|
1035
|
+
lines.push("");
|
|
1036
|
+
lines.push("All successful harvest images live under media/harvest/. The media node owns the complete asset inventory and dispositions. Do not hotlink the old origin.");
|
|
1037
|
+
lines.push("");
|
|
1038
|
+
if (brief.visual) {
|
|
1039
|
+
lines.push(`- **Register (hint):** ${brief.visual.register} \u2014 the business and direction nodes reassess`);
|
|
1040
|
+
if (brief.visual.signatureSections.length) {
|
|
1041
|
+
lines.push(`- **Signature home chapters (hint):** ${brief.visual.signatureSections.join("; ")}`);
|
|
1042
|
+
}
|
|
1043
|
+
if (brief.visual.stills.length) {
|
|
1044
|
+
lines.push(`- **Old-site stills:** ${brief.visual.stills.map((s) => `\`${s}\``).join(", ")}`);
|
|
1045
|
+
}
|
|
1046
|
+
lines.push("");
|
|
1047
|
+
}
|
|
1048
|
+
lines.push("## Candidate hints \u2014 inspect before selecting");
|
|
1049
|
+
lines.push("");
|
|
1050
|
+
if (!hintShortlist.length) {
|
|
1051
|
+
lines.push("- (pending inspection \u2014 account for the full harvest catalog)");
|
|
1052
|
+
} else {
|
|
1053
|
+
lines.push("_Heuristic hints from harvest (not authoritative):_");
|
|
1054
|
+
lines.push("");
|
|
1055
|
+
for (const img of hintShortlist) {
|
|
1056
|
+
const dims = img.width && img.height ? `${img.width}\xD7${img.height}` : "";
|
|
1057
|
+
lines.push(`- \`${img.localPath || img.src}\` \u2014 **${img.mediaType || img.role}** ${dims} ${img.caption || img.alt || ""}`.trim());
|
|
1058
|
+
if (img.pageUrl) lines.push(` - from ${img.pageUrl}`);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
lines.push("");
|
|
1062
|
+
lines.push("## Harvest catalog");
|
|
1063
|
+
lines.push("");
|
|
1064
|
+
if (!ok.length) {
|
|
1065
|
+
lines.push("- (no images stored \u2014 stock fallback later if needed)");
|
|
1066
|
+
} else {
|
|
1067
|
+
for (const img of ok) {
|
|
1068
|
+
lines.push(imageLine(img));
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
lines.push("");
|
|
1072
|
+
lines.push("## Media treatment");
|
|
1073
|
+
lines.push("");
|
|
1074
|
+
lines.push('- One LCP still (`fetchpriority="high"`).');
|
|
1075
|
+
lines.push("- Select media by narrative purpose and image quality; there is no count quota.");
|
|
1076
|
+
lines.push("- Use actual people and project collections where they answer visitor questions.");
|
|
1077
|
+
lines.push("- Record use, retain, duplicate, or exclude for every asset, and resolve missing source images.");
|
|
1078
|
+
lines.push("");
|
|
1079
|
+
return lines.join("\n");
|
|
1080
|
+
}
|
|
1081
|
+
function renderOutline(opts) {
|
|
1082
|
+
const brief = opts.brief;
|
|
1083
|
+
const biz = opts.business || brief.business;
|
|
1084
|
+
const lines = [];
|
|
1085
|
+
lines.push(`# Onboarding outline \u2014 ${biz.name || brief.slug}`);
|
|
1086
|
+
lines.push("");
|
|
1087
|
+
lines.push(`Source: ${brief.sourceUrl || "(blank)"}`);
|
|
1088
|
+
lines.push(`Crawled: ${brief.crawledAt}`);
|
|
1089
|
+
lines.push(`Slug: ${brief.slug}`);
|
|
1090
|
+
lines.push("");
|
|
1091
|
+
lines.push("## Business facts");
|
|
1092
|
+
lines.push("");
|
|
1093
|
+
lines.push(`- **Name:** ${biz.name || "(missing)"}`);
|
|
1094
|
+
lines.push(`- **Phone:** ${biz.phone || "(missing)"}`);
|
|
1095
|
+
lines.push(`- **Email:** ${biz.email || "(missing)"}`);
|
|
1096
|
+
lines.push(`- **Address:** ${biz.address || "(missing)"}`);
|
|
1097
|
+
lines.push(`- **City:** ${biz.city || "(missing)"}`);
|
|
1098
|
+
lines.push(`- **Hours:** ${biz.hours.length ? biz.hours.join("; ") : "(missing)"}`);
|
|
1099
|
+
lines.push(
|
|
1100
|
+
`- **Primary CTA:** ${biz.primaryCta.label || "(missing)"} \u2192 ${biz.primaryCta.href || "(missing)"}`
|
|
1101
|
+
);
|
|
1102
|
+
if (biz.services.length) {
|
|
1103
|
+
lines.push("- **Services:**");
|
|
1104
|
+
for (const s of biz.services) {
|
|
1105
|
+
lines.push(` - ${s.name}${s.blurb ? ` \u2014 ${s.blurb}` : ""}`);
|
|
1106
|
+
}
|
|
1107
|
+
} else {
|
|
1108
|
+
lines.push("- **Services:** (missing)");
|
|
1109
|
+
}
|
|
1110
|
+
if (biz.social.length) {
|
|
1111
|
+
lines.push("- **Social (from site):**");
|
|
1112
|
+
for (const s of biz.social) {
|
|
1113
|
+
lines.push(` - ${s.platform}: ${s.url}`);
|
|
1114
|
+
}
|
|
1115
|
+
} else {
|
|
1116
|
+
lines.push("- **Social:** (none found on-site \u2014 complete in the research graph node)");
|
|
1117
|
+
}
|
|
1118
|
+
if (brief.visual) {
|
|
1119
|
+
lines.push("");
|
|
1120
|
+
lines.push("## Visual register");
|
|
1121
|
+
lines.push("");
|
|
1122
|
+
lines.push(`- **Register:** ${brief.visual.register} (trade = photo-led local shop; beauty = lifestyle stills; b2b = product/agency \u2014 illustrations, mockups, hover nav OK)`);
|
|
1123
|
+
if (brief.visual.signatureSections.length) {
|
|
1124
|
+
lines.push(`- **Signature chapters (keep on home, restyled):** ${brief.visual.signatureSections.join("; ")}`);
|
|
1125
|
+
}
|
|
1126
|
+
if (brief.visual.hints.fontDisplay) {
|
|
1127
|
+
lines.push(`- **Display font (self-host if distinctive):** ${brief.visual.hints.fontDisplay}`);
|
|
1128
|
+
}
|
|
1129
|
+
if (brief.visual.hints.radius) {
|
|
1130
|
+
lines.push(`- **Computed button radius:** ${brief.visual.hints.radius}`);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
if (brief.missing.length) {
|
|
1134
|
+
lines.push("");
|
|
1135
|
+
lines.push("## Gaps");
|
|
1136
|
+
lines.push("");
|
|
1137
|
+
for (const m of brief.missing) lines.push(`- ${m}`);
|
|
1138
|
+
}
|
|
1139
|
+
lines.push("");
|
|
1140
|
+
lines.push("## Sitemap");
|
|
1141
|
+
lines.push("");
|
|
1142
|
+
for (const page of brief.pages) {
|
|
1143
|
+
const copy = page.copyFile ? ` \u2192 copy/${page.copyFile}` : "";
|
|
1144
|
+
lines.push(`- [${page.title || page.url}](${page.url})${copy}`);
|
|
1145
|
+
}
|
|
1146
|
+
lines.push("");
|
|
1147
|
+
lines.push("## Image inventory");
|
|
1148
|
+
lines.push("");
|
|
1149
|
+
const shortlist = brief.images.filter((i) => i.shortlist);
|
|
1150
|
+
lines.push("### Must-use shortlist");
|
|
1151
|
+
if (shortlist.length) for (const i of shortlist) lines.push(imageLine(i));
|
|
1152
|
+
else lines.push("- (none \u2014 see full inventory below)");
|
|
1153
|
+
lines.push("");
|
|
1154
|
+
lines.push("Read **media.md** for captions and the homepage media budget. Prefer `/media/\u2026` paths.");
|
|
1155
|
+
lines.push("");
|
|
1156
|
+
const logo = brief.images.filter((i) => i.role === "logo");
|
|
1157
|
+
const hero = brief.images.filter((i) => i.role === "hero");
|
|
1158
|
+
const business = brief.images.filter((i) => i.kind === "business" && i.role !== "logo" && i.role !== "hero");
|
|
1159
|
+
const stock = brief.images.filter((i) => i.kind === "stock");
|
|
1160
|
+
const generic = brief.images.filter((i) => i.kind === "generic" || i.kind === "unknown");
|
|
1161
|
+
const failed = brief.images.filter((i) => i.role === "failed");
|
|
1162
|
+
lines.push("### Logo");
|
|
1163
|
+
if (logo.length) for (const i of logo) lines.push(imageLine(i));
|
|
1164
|
+
else lines.push("- (none classified)");
|
|
1165
|
+
lines.push("");
|
|
1166
|
+
lines.push("### Hero candidates");
|
|
1167
|
+
if (hero.length) for (const i of hero) lines.push(imageLine(i));
|
|
1168
|
+
else lines.push("- (none classified)");
|
|
1169
|
+
lines.push("");
|
|
1170
|
+
lines.push("### Business-specific photos");
|
|
1171
|
+
if (business.length) for (const i of business) lines.push(imageLine(i));
|
|
1172
|
+
else lines.push("- (none)");
|
|
1173
|
+
lines.push("");
|
|
1174
|
+
lines.push("### Stock");
|
|
1175
|
+
if (stock.length) for (const i of stock) lines.push(imageLine(i));
|
|
1176
|
+
else lines.push("- (none)");
|
|
1177
|
+
lines.push("");
|
|
1178
|
+
lines.push("### Generic / unknown");
|
|
1179
|
+
if (generic.length) for (const i of generic) lines.push(imageLine(i));
|
|
1180
|
+
else lines.push("- (none)");
|
|
1181
|
+
if (failed.length) {
|
|
1182
|
+
lines.push("");
|
|
1183
|
+
lines.push("### Failed uploads");
|
|
1184
|
+
for (const i of failed) lines.push(imageLine(i));
|
|
1185
|
+
}
|
|
1186
|
+
const testimonials = brief.pages.flatMap((p) => p.testimonials || []);
|
|
1187
|
+
const faqs = brief.pages.flatMap((p) => p.faqs || []);
|
|
1188
|
+
if (testimonials.length) {
|
|
1189
|
+
lines.push("");
|
|
1190
|
+
lines.push("## Testimonials found");
|
|
1191
|
+
for (const t of testimonials) {
|
|
1192
|
+
lines.push(`- \u201C${t.quote.slice(0, 160)}${t.quote.length > 160 ? "\u2026" : ""}\u201D${t.attribution ? ` \u2014 ${t.attribution}` : ""}`);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
if (faqs.length) {
|
|
1196
|
+
lines.push("");
|
|
1197
|
+
lines.push("## FAQs found");
|
|
1198
|
+
for (const f of faqs) {
|
|
1199
|
+
lines.push(`- **${f.question}** \u2014 ${f.answer.slice(0, 120)}${f.answer.length > 120 ? "\u2026" : ""}`);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
if (brief.warnings.length) {
|
|
1203
|
+
lines.push("");
|
|
1204
|
+
lines.push("## Crawl warnings");
|
|
1205
|
+
for (const w of brief.warnings) lines.push(`- ${w}`);
|
|
1206
|
+
}
|
|
1207
|
+
lines.push("");
|
|
1208
|
+
lines.push("## Next (operator / agent)");
|
|
1209
|
+
lines.push("");
|
|
1210
|
+
lines.push("1. Build and independently review the evidence-backed business interpretation.");
|
|
1211
|
+
lines.push("2. Inspect and account for media, then develop and review coherent visual directions.");
|
|
1212
|
+
lines.push("3. Follow the graph through storyboard, edited copy, representative pages, browser checks and final critics.");
|
|
1213
|
+
lines.push("");
|
|
1214
|
+
return lines.join("\n");
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
// scripts/onboard/browser.ts
|
|
1218
|
+
import { createRequire } from "node:module";
|
|
1219
|
+
import { existsSync as existsSync2, mkdirSync } from "node:fs";
|
|
1220
|
+
import { join } from "node:path";
|
|
1221
|
+
|
|
1222
|
+
// src/onboard/crawl-order.ts
|
|
1223
|
+
function pathnameOf(url) {
|
|
1224
|
+
try {
|
|
1225
|
+
return new URL(url).pathname.toLowerCase() || "/";
|
|
1226
|
+
} catch {
|
|
1227
|
+
return "/";
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function isHome(url, startUrl) {
|
|
1231
|
+
try {
|
|
1232
|
+
const a = new URL(url);
|
|
1233
|
+
const b = new URL(startUrl);
|
|
1234
|
+
const path = a.pathname.replace(/\/+$/, "") || "/";
|
|
1235
|
+
return path === "/" || path === "/home" || path === "/index" || a.href === b.href;
|
|
1236
|
+
} catch {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
function crawlPriority(url, startUrl) {
|
|
1241
|
+
if (isHome(url, startUrl)) return 0;
|
|
1242
|
+
const path = pathnameOf(url);
|
|
1243
|
+
if (/\/(about|team|meet-the-team|our-team)(\/|$)/.test(path)) return 1;
|
|
1244
|
+
if (/\/(portfolio|work|our-work|projects|gallery)(\/|$)/.test(path)) return 2;
|
|
1245
|
+
if (/\/(how-it-works|process)(\/|$)/.test(path)) return 3;
|
|
1246
|
+
if (/\/(features|services|menu|offer)(\/|$)/.test(path)) return 4;
|
|
1247
|
+
if (/\/(pricing|packages|plans)(\/|$)/.test(path)) return 5;
|
|
1248
|
+
if (/\/(contact|schedule|book|demo)(\/|$)/.test(path)) return 6;
|
|
1249
|
+
if (/\/(legal|privacy|terms|cookie|shop|cart|login|account)(\/|$)/.test(path)) return 90;
|
|
1250
|
+
return 20;
|
|
1251
|
+
}
|
|
1252
|
+
function insertByCrawlPriority(queue, url, startUrl) {
|
|
1253
|
+
const p = crawlPriority(url, startUrl);
|
|
1254
|
+
let i = 0;
|
|
1255
|
+
while (i < queue.length && crawlPriority(queue[i], startUrl) <= p) i += 1;
|
|
1256
|
+
queue.splice(i, 0, url);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
// src/onboard/visual-hints.ts
|
|
1260
|
+
var GENERIC_FACE = /* @__PURE__ */ new Set([
|
|
1261
|
+
"ui-sans-serif",
|
|
1262
|
+
"system-ui",
|
|
1263
|
+
"sans-serif",
|
|
1264
|
+
"serif",
|
|
1265
|
+
"ui-serif",
|
|
1266
|
+
"arial",
|
|
1267
|
+
"helvetica",
|
|
1268
|
+
"helvetica neue",
|
|
1269
|
+
"times",
|
|
1270
|
+
"times new roman",
|
|
1271
|
+
"georgia",
|
|
1272
|
+
"segoe ui",
|
|
1273
|
+
"tahoma",
|
|
1274
|
+
"verdana",
|
|
1275
|
+
"roboto",
|
|
1276
|
+
"-apple-system",
|
|
1277
|
+
"blinkmacsystemfont",
|
|
1278
|
+
"apple color emoji",
|
|
1279
|
+
"segoe ui emoji",
|
|
1280
|
+
"nimbus sans",
|
|
1281
|
+
"liberation sans",
|
|
1282
|
+
"dejavu sans"
|
|
1283
|
+
]);
|
|
1284
|
+
function firstFace(family) {
|
|
1285
|
+
return (family.split(",")[0] || "").replace(/["']/g, "").trim();
|
|
1286
|
+
}
|
|
1287
|
+
function stackFromComputed(family, fallback) {
|
|
1288
|
+
const face = firstFace(family);
|
|
1289
|
+
if (!face || GENERIC_FACE.has(face.toLowerCase())) return void 0;
|
|
1290
|
+
if (/^https?:/i.test(face) || face.includes("fonts.google")) return void 0;
|
|
1291
|
+
return `"${face}", ${fallback}`;
|
|
1292
|
+
}
|
|
1293
|
+
function radiusFromComputed(raw) {
|
|
1294
|
+
const token = (raw.split(/\s+/)[0] || "").trim();
|
|
1295
|
+
if (!token || token === "0" || token === "0px") return {};
|
|
1296
|
+
if (/%/.test(token) || parseFloat(token) >= 20) return { radiusPill: "999px" };
|
|
1297
|
+
if (parseFloat(token) >= 2) return { radius: token };
|
|
1298
|
+
return {};
|
|
1299
|
+
}
|
|
1300
|
+
function hintsFromComputed(input2) {
|
|
1301
|
+
const hints = {};
|
|
1302
|
+
const body = stackFromComputed(input2.fontBody || "", "ui-sans-serif, system-ui, sans-serif");
|
|
1303
|
+
const display = stackFromComputed(input2.fontDisplay || "", "ui-serif, Georgia, serif");
|
|
1304
|
+
if (body) hints.fontBody = body;
|
|
1305
|
+
if (display) hints.fontDisplay = display;
|
|
1306
|
+
Object.assign(hints, radiusFromComputed(input2.radius || ""));
|
|
1307
|
+
return hints;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
// scripts/onboard/crawl.ts
|
|
1311
|
+
import { existsSync } from "node:fs";
|
|
1312
|
+
var ua = "VitrisOnboard/0.1 (authorized site migration; https://vitris.local)";
|
|
1313
|
+
function sleep(ms) {
|
|
1314
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1315
|
+
}
|
|
1316
|
+
async function fetchDoc(url, accept) {
|
|
1317
|
+
try {
|
|
1318
|
+
const res = await fetch(url, {
|
|
1319
|
+
headers: { "user-agent": ua, accept },
|
|
1320
|
+
redirect: "follow",
|
|
1321
|
+
signal: AbortSignal.timeout(12e3)
|
|
1322
|
+
});
|
|
1323
|
+
const contentType = res.headers.get("content-type") || "";
|
|
1324
|
+
const body = await res.text();
|
|
1325
|
+
if (!res.ok) return { ok: false, status: res.status, error: `HTTP ${res.status}` };
|
|
1326
|
+
return { ok: true, url: res.url || url, body, contentType, status: res.status };
|
|
1327
|
+
} catch (err) {
|
|
1328
|
+
return { ok: false, error: err instanceof Error ? err.message : "error" };
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
function normalizePageUrl(href) {
|
|
1332
|
+
try {
|
|
1333
|
+
const u = new URL(href);
|
|
1334
|
+
if (u.protocol !== "http:" && u.protocol !== "https:") return null;
|
|
1335
|
+
u.hash = "";
|
|
1336
|
+
if (u.pathname.length > 1) u.pathname = u.pathname.replace(/\/+$/, "");
|
|
1337
|
+
return u.href;
|
|
1338
|
+
} catch {
|
|
1339
|
+
return null;
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
function enqueue(queue, seen, href, startUrl, discovery, meta2) {
|
|
1343
|
+
const url = normalizePageUrl(href);
|
|
1344
|
+
if (!url) return;
|
|
1345
|
+
if (!sameSite(url, startUrl)) return;
|
|
1346
|
+
let path = "/";
|
|
1347
|
+
try {
|
|
1348
|
+
path = new URL(url).pathname;
|
|
1349
|
+
} catch {
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
if (shouldSkipPath(path)) return;
|
|
1353
|
+
if (shouldSkipQueryUrl(url)) return;
|
|
1354
|
+
if (seen.has(url)) return;
|
|
1355
|
+
seen.add(url);
|
|
1356
|
+
if (discovery && !discovery.has(url)) {
|
|
1357
|
+
discovery.set(url, meta2 || { provenance: "in-body-relative" });
|
|
1358
|
+
}
|
|
1359
|
+
insertByCrawlPriority(queue, url, startUrl);
|
|
1360
|
+
}
|
|
1361
|
+
async function sitemapUrls(startUrl, warnings) {
|
|
1362
|
+
const origin = new URL(startUrl).origin;
|
|
1363
|
+
const candidates = [
|
|
1364
|
+
`${origin}/sitemap.xml`,
|
|
1365
|
+
`${origin}/sitemap_index.xml`,
|
|
1366
|
+
`${origin}/wp-sitemap.xml`
|
|
1367
|
+
];
|
|
1368
|
+
const robots = await fetchDoc(`${origin}/robots.txt`, "text/plain");
|
|
1369
|
+
if (robots.ok) {
|
|
1370
|
+
for (const m of robots.body.matchAll(/sitemap:\s*(\S+)/gi)) {
|
|
1371
|
+
candidates.unshift(m[1]);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const locs = [];
|
|
1375
|
+
const seenMaps = /* @__PURE__ */ new Set();
|
|
1376
|
+
const mapQueue = [...candidates];
|
|
1377
|
+
while (mapQueue.length) {
|
|
1378
|
+
const mapUrl = mapQueue.shift();
|
|
1379
|
+
if (seenMaps.has(mapUrl)) continue;
|
|
1380
|
+
seenMaps.add(mapUrl);
|
|
1381
|
+
const xml = await fetchDoc(mapUrl, "application/xml,text/xml,text/plain");
|
|
1382
|
+
if (!xml.ok) continue;
|
|
1383
|
+
const found = parseSitemapLocs(xml.body);
|
|
1384
|
+
if (!found.length) continue;
|
|
1385
|
+
if (/<sitemapindex/i.test(xml.body)) {
|
|
1386
|
+
for (const child of found) {
|
|
1387
|
+
if (!seenMaps.has(child)) mapQueue.push(child);
|
|
1388
|
+
}
|
|
1389
|
+
} else {
|
|
1390
|
+
locs.push(...found);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
if (!locs.length) warnings.push("No sitemap found; falling back to homepage links.");
|
|
1394
|
+
return locs;
|
|
1395
|
+
}
|
|
1396
|
+
function persistCheckpoint(path, payload) {
|
|
1397
|
+
if (!path) return;
|
|
1398
|
+
try {
|
|
1399
|
+
save(path, payload);
|
|
1400
|
+
} catch (err) {
|
|
1401
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1402
|
+
payload.warnings.push(`Skipped (persistence error): checkpoint write failed \u2014 ${msg}`);
|
|
1403
|
+
console.warn(` persistence: ${msg}`);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
function pageSignature(p) {
|
|
1407
|
+
return JSON.stringify([p.title, p.description, p.headings, p.paragraphs]);
|
|
1408
|
+
}
|
|
1409
|
+
async function crawlSite(startUrl, maxPages, checkpointPath, fresh = false) {
|
|
1410
|
+
const warnings = [];
|
|
1411
|
+
const start = normalizePageUrl(startUrl) || startUrl;
|
|
1412
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1413
|
+
const queue = [];
|
|
1414
|
+
const discovery = /* @__PURE__ */ new Map();
|
|
1415
|
+
enqueue(queue, seen, start, start, discovery, { provenance: "start" });
|
|
1416
|
+
const fromSitemap = await sitemapUrls(start, warnings);
|
|
1417
|
+
const sitemapPaths = new Set(fromSitemap.map((loc) => {
|
|
1418
|
+
try {
|
|
1419
|
+
return new URL(loc).pathname.replace(/\/+$/, "") || "/";
|
|
1420
|
+
} catch {
|
|
1421
|
+
return loc;
|
|
1422
|
+
}
|
|
1423
|
+
}));
|
|
1424
|
+
for (const loc of fromSitemap) enqueue(queue, seen, loc, start, discovery, { provenance: "sitemap" });
|
|
1425
|
+
const pages = [];
|
|
1426
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1427
|
+
const exclusions = [];
|
|
1428
|
+
const misses = [];
|
|
1429
|
+
const stills = [];
|
|
1430
|
+
let hints;
|
|
1431
|
+
if (checkpointPath && !fresh && existsSync(checkpointPath)) {
|
|
1432
|
+
const checkpoint2 = json(checkpointPath);
|
|
1433
|
+
if (checkpoint2.start === start) {
|
|
1434
|
+
pages.push(...checkpoint2.pages.filter((p) => !isErrorPage(p)));
|
|
1435
|
+
queue.splice(0, queue.length, ...checkpoint2.queue);
|
|
1436
|
+
for (const p of checkpoint2.pages.filter(isErrorPage)) {
|
|
1437
|
+
warnings.push(`Excluded error page from resumed capture: ${p.url}`);
|
|
1438
|
+
}
|
|
1439
|
+
for (const url of checkpoint2.visited) visited.add(url);
|
|
1440
|
+
for (const url of checkpoint2.seen) seen.add(url);
|
|
1441
|
+
for (const [url, meta2] of checkpoint2.discovery || []) discovery.set(url, meta2);
|
|
1442
|
+
warnings.push(...checkpoint2.warnings.filter((w) => !checkpoint2.queue.length || !/browser error|empty document|unvisited|transient/i.test(w)));
|
|
1443
|
+
stills.push(...checkpoint2.stills || []);
|
|
1444
|
+
hints = checkpoint2.hints;
|
|
1445
|
+
exclusions.push(...checkpoint2.exclusions || []);
|
|
1446
|
+
console.log(`Resuming captured crawl: ${pages.length} pages, ${queue.length} URLs pending`);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
const snapshot = () => ({
|
|
1450
|
+
version: 2,
|
|
1451
|
+
start,
|
|
1452
|
+
pages,
|
|
1453
|
+
queue,
|
|
1454
|
+
visited: [...visited],
|
|
1455
|
+
seen: [...seen],
|
|
1456
|
+
warnings,
|
|
1457
|
+
stills,
|
|
1458
|
+
hints,
|
|
1459
|
+
exclusions,
|
|
1460
|
+
discovery: [...discovery]
|
|
1461
|
+
});
|
|
1462
|
+
const checkpoint = () => persistCheckpoint(checkpointPath, snapshot());
|
|
1463
|
+
const retryUrls = [];
|
|
1464
|
+
while (queue.length) {
|
|
1465
|
+
if (maxPages !== void 0 && pages.length >= maxPages) {
|
|
1466
|
+
warnings.push(`Emergency maxPages=${maxPages} reached; ${queue.length} URL(s) left unvisited.`);
|
|
1467
|
+
break;
|
|
1468
|
+
}
|
|
1469
|
+
const url = queue.shift();
|
|
1470
|
+
if (visited.has(url)) continue;
|
|
1471
|
+
queue.unshift(url);
|
|
1472
|
+
checkpoint();
|
|
1473
|
+
queue.shift();
|
|
1474
|
+
visited.add(url);
|
|
1475
|
+
const res = await fetchDoc(url, "text/html,application/xhtml+xml");
|
|
1476
|
+
if (!res.ok) {
|
|
1477
|
+
const kind = res.status && res.status < 500 ? "http" : "transport";
|
|
1478
|
+
misses.push({ url, status: res.status, error: res.error, kind });
|
|
1479
|
+
if (kind === "transport") retryUrls.push(url);
|
|
1480
|
+
checkpoint();
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
if (!sameSite(res.url, start)) {
|
|
1484
|
+
misses.push({ url, error: `${url} \u2192 ${res.url}`, kind: "off-site" });
|
|
1485
|
+
checkpoint();
|
|
1486
|
+
continue;
|
|
1487
|
+
}
|
|
1488
|
+
if (!/html/i.test(res.contentType) && !res.body.trimStart().startsWith("<")) {
|
|
1489
|
+
checkpoint();
|
|
1490
|
+
continue;
|
|
1491
|
+
}
|
|
1492
|
+
const page = extractPage(res.body, res.url);
|
|
1493
|
+
if (isErrorPage(page)) {
|
|
1494
|
+
misses.push({ url, kind: "error-page", error: "Soft error page" });
|
|
1495
|
+
checkpoint();
|
|
1496
|
+
continue;
|
|
1497
|
+
}
|
|
1498
|
+
if (pages.some((p) => p.url === res.url)) {
|
|
1499
|
+
checkpoint();
|
|
1500
|
+
continue;
|
|
1501
|
+
}
|
|
1502
|
+
const duplicate = pages.find((p) => pageSignature(p) === pageSignature(page));
|
|
1503
|
+
if (duplicate) {
|
|
1504
|
+
page.aliasOf = duplicate.aliasOf || duplicate.url;
|
|
1505
|
+
pages.push(page);
|
|
1506
|
+
checkpoint();
|
|
1507
|
+
continue;
|
|
1508
|
+
}
|
|
1509
|
+
pages.push(page);
|
|
1510
|
+
for (const link of page.links) {
|
|
1511
|
+
enqueue(queue, seen, link.href, start, discovery, {
|
|
1512
|
+
provenance: link.relative ? "in-body-relative" : "nav",
|
|
1513
|
+
discoveredFrom: res.url
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
await sleep(120);
|
|
1517
|
+
checkpoint();
|
|
1518
|
+
}
|
|
1519
|
+
const captured = capturedPathSet(pages);
|
|
1520
|
+
for (const miss of misses) {
|
|
1521
|
+
const exclusion = classifyMiss({ ...miss, discovery: discovery.get(miss.url), captured, sitemapPaths });
|
|
1522
|
+
exclusions.push(exclusion);
|
|
1523
|
+
warnings.push(formatExclusion(exclusion));
|
|
1524
|
+
}
|
|
1525
|
+
if (!pages.length) warnings.push("Crawl returned no HTML pages.");
|
|
1526
|
+
for (const url of retryUrls) {
|
|
1527
|
+
visited.delete(url);
|
|
1528
|
+
queue.push(url);
|
|
1529
|
+
}
|
|
1530
|
+
checkpoint();
|
|
1531
|
+
return { startUrl: start, pages, warnings, engine: "fetch", exclusions, stills, hints, unvisited: [...queue] };
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// scripts/onboard/browser.ts
|
|
1535
|
+
async function loadPlaywright(kernelRoot) {
|
|
1536
|
+
try {
|
|
1537
|
+
return await import("playwright");
|
|
1538
|
+
} catch {
|
|
1539
|
+
if (kernelRoot) {
|
|
1540
|
+
try {
|
|
1541
|
+
const require2 = createRequire(join(kernelRoot, "package.json"));
|
|
1542
|
+
return require2("playwright");
|
|
1543
|
+
} catch {
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
throw new Error(
|
|
1547
|
+
"playwright package not installed. From the site repo: npm install && npx playwright install chromium"
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
async function scrollPage(page) {
|
|
1552
|
+
await page.evaluate(async () => {
|
|
1553
|
+
const w = globalThis;
|
|
1554
|
+
await new Promise((resolve) => {
|
|
1555
|
+
let total = 0;
|
|
1556
|
+
const step = Math.max(400, Math.floor(w.innerHeight * 0.85));
|
|
1557
|
+
const timer = setInterval(() => {
|
|
1558
|
+
const { scrollHeight } = w.document.documentElement;
|
|
1559
|
+
w.scrollBy(0, step);
|
|
1560
|
+
total += step;
|
|
1561
|
+
if (total >= scrollHeight || total > 5e4) {
|
|
1562
|
+
clearInterval(timer);
|
|
1563
|
+
w.scrollTo(0, 0);
|
|
1564
|
+
resolve();
|
|
1565
|
+
}
|
|
1566
|
+
}, 120);
|
|
1567
|
+
});
|
|
1568
|
+
});
|
|
1569
|
+
await page.waitForTimeout(400);
|
|
1570
|
+
}
|
|
1571
|
+
async function collectRenderedExtras(page) {
|
|
1572
|
+
return await page.evaluate(() => {
|
|
1573
|
+
const g = globalThis;
|
|
1574
|
+
const imageUrls = [];
|
|
1575
|
+
for (const node of Array.from(g.document.querySelectorAll("img"))) {
|
|
1576
|
+
const img = node;
|
|
1577
|
+
const src = img.currentSrc || img.src || img.getAttribute("data-src") || img.getAttribute("data-lazy-src") || "";
|
|
1578
|
+
if (src && !src.startsWith("data:")) imageUrls.push(src);
|
|
1579
|
+
const srcset = img.getAttribute("srcset") || img.getAttribute("data-srcset");
|
|
1580
|
+
if (srcset) {
|
|
1581
|
+
for (const part of srcset.split(",")) {
|
|
1582
|
+
const u = part.trim().split(/\s+/)[0];
|
|
1583
|
+
if (u && !u.startsWith("data:")) imageUrls.push(u);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
for (const node of Array.from(g.document.querySelectorAll("picture source[srcset]"))) {
|
|
1588
|
+
const source = node;
|
|
1589
|
+
const srcset = source.getAttribute("srcset") || "";
|
|
1590
|
+
for (const part of srcset.split(",")) {
|
|
1591
|
+
const u = part.trim().split(/\s+/)[0];
|
|
1592
|
+
if (u && !u.startsWith("data:")) imageUrls.push(u);
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
const bgUrls = [];
|
|
1596
|
+
for (const el of Array.from(g.document.querySelectorAll("*"))) {
|
|
1597
|
+
const bg = g.getComputedStyle(el).backgroundImage;
|
|
1598
|
+
if (!bg || bg === "none") continue;
|
|
1599
|
+
const re = /url\(\s*["']?([^"')]+)["']?\s*\)/g;
|
|
1600
|
+
let m;
|
|
1601
|
+
while (m = re.exec(bg)) {
|
|
1602
|
+
const u = m[1];
|
|
1603
|
+
if (u && !u.startsWith("data:")) bgUrls.push(u);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
const hrefs = Array.from(g.document.querySelectorAll("a[href]")).map((a) => a.href).filter((h) => Boolean(h));
|
|
1607
|
+
return { imageUrls, bgUrls, hrefs };
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
function mergeExtras(page, extras, pageUrl) {
|
|
1611
|
+
const seen = new Set(page.images.map((i) => i.src));
|
|
1612
|
+
const push = (raw, flags = {}) => {
|
|
1613
|
+
try {
|
|
1614
|
+
const abs = new URL(raw, pageUrl).href;
|
|
1615
|
+
if (seen.has(abs) || abs.startsWith("data:")) return;
|
|
1616
|
+
seen.add(abs);
|
|
1617
|
+
page.images.push({ src: abs, alt: flags.alt || "", pageUrl, ...flags });
|
|
1618
|
+
} catch {
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
for (const u of extras.imageUrls) push(u);
|
|
1622
|
+
for (const u of extras.bgUrls) push(u);
|
|
1623
|
+
}
|
|
1624
|
+
async function captureHints(page) {
|
|
1625
|
+
const raw = await page.evaluate(() => {
|
|
1626
|
+
const g = globalThis;
|
|
1627
|
+
const body = g.getComputedStyle(g.document.body);
|
|
1628
|
+
const heading = g.document.querySelector("h1, h2");
|
|
1629
|
+
const btn = g.document.querySelector("a[class*='btn'], button, [class*='cta']");
|
|
1630
|
+
return {
|
|
1631
|
+
fontBody: body.fontFamily,
|
|
1632
|
+
fontDisplay: heading ? g.getComputedStyle(heading).fontFamily : body.fontFamily,
|
|
1633
|
+
radius: btn ? g.getComputedStyle(btn).borderRadius : ""
|
|
1634
|
+
};
|
|
1635
|
+
});
|
|
1636
|
+
const actionColors = await page.evaluate(() => {
|
|
1637
|
+
const doc = globalThis.document;
|
|
1638
|
+
const computed = globalThis.getComputedStyle;
|
|
1639
|
+
return Array.from(doc.querySelectorAll('nav a, header a, button, a[class*="btn"], a[class*="cta"]')).slice(0, 40).flatMap((el) => {
|
|
1640
|
+
const s = computed(el);
|
|
1641
|
+
return [s.color, s.backgroundColor];
|
|
1642
|
+
});
|
|
1643
|
+
});
|
|
1644
|
+
const brandColors = colorsFromComputedActions(actionColors, `${page.url()}: repeated computed navigation/action color (bounded 40 elements)`);
|
|
1645
|
+
return { ...hintsFromComputed(raw), ...brandColors.length ? { brandColors } : {} };
|
|
1646
|
+
}
|
|
1647
|
+
async function captureStill(page, stillsDir, file, stills) {
|
|
1648
|
+
mkdirSync(stillsDir, { recursive: true });
|
|
1649
|
+
try {
|
|
1650
|
+
await page.screenshot({ path: join(stillsDir, file), fullPage: false, type: "png" });
|
|
1651
|
+
const rel = `onboarding/stills/${file}`;
|
|
1652
|
+
if (!stills.includes(rel)) stills.push(rel);
|
|
1653
|
+
} catch {
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
async function crawlSiteBrowser(startUrl, maxPages, kernelRoot, stillsDir, checkpointPath, fresh = false) {
|
|
1657
|
+
const playwright = await loadPlaywright(kernelRoot);
|
|
1658
|
+
const warnings = [];
|
|
1659
|
+
const start = (() => {
|
|
1660
|
+
try {
|
|
1661
|
+
const u = new URL(startUrl);
|
|
1662
|
+
u.hash = "";
|
|
1663
|
+
if (u.pathname.length > 1) u.pathname = u.pathname.replace(/\/+$/, "");
|
|
1664
|
+
return u.href;
|
|
1665
|
+
} catch {
|
|
1666
|
+
return startUrl;
|
|
1667
|
+
}
|
|
1668
|
+
})();
|
|
1669
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1670
|
+
const queue = [];
|
|
1671
|
+
const discovery = /* @__PURE__ */ new Map();
|
|
1672
|
+
enqueue(queue, seen, start, start, discovery, { provenance: "start" });
|
|
1673
|
+
const fromSitemap = await sitemapUrls(start, warnings);
|
|
1674
|
+
const sitemapPaths = new Set(fromSitemap.map((loc) => {
|
|
1675
|
+
try {
|
|
1676
|
+
return new URL(loc).pathname.replace(/\/+$/, "") || "/";
|
|
1677
|
+
} catch {
|
|
1678
|
+
return loc;
|
|
1679
|
+
}
|
|
1680
|
+
}));
|
|
1681
|
+
for (const loc of fromSitemap) enqueue(queue, seen, loc, start, discovery, { provenance: "sitemap" });
|
|
1682
|
+
const browser = await playwright.chromium.launch({ headless: true });
|
|
1683
|
+
const context = await browser.newContext({
|
|
1684
|
+
viewport: { width: 1440, height: 900 },
|
|
1685
|
+
javaScriptEnabled: true
|
|
1686
|
+
});
|
|
1687
|
+
const pages = [];
|
|
1688
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1689
|
+
const stills = [];
|
|
1690
|
+
const exclusions = [];
|
|
1691
|
+
const misses = [];
|
|
1692
|
+
let hints;
|
|
1693
|
+
if (checkpointPath && !fresh && existsSync2(checkpointPath)) {
|
|
1694
|
+
const checkpoint2 = json(checkpointPath);
|
|
1695
|
+
if (checkpoint2.start === start) {
|
|
1696
|
+
pages.push(...checkpoint2.pages.filter((p) => !isErrorPage(p)));
|
|
1697
|
+
queue.splice(0, queue.length, ...checkpoint2.queue);
|
|
1698
|
+
for (const p of checkpoint2.pages.filter(isErrorPage)) warnings.push(`Excluded error page from resumed capture: ${p.url}`);
|
|
1699
|
+
for (const url of checkpoint2.visited) visited.add(url);
|
|
1700
|
+
for (const url of checkpoint2.seen) seen.add(url);
|
|
1701
|
+
for (const [url, meta2] of checkpoint2.discovery || []) discovery.set(url, meta2);
|
|
1702
|
+
warnings.push(...checkpoint2.warnings.filter((w) => !checkpoint2.queue.length || !/browser error|empty document|unvisited|transient/i.test(w)));
|
|
1703
|
+
stills.push(...checkpoint2.stills);
|
|
1704
|
+
hints = checkpoint2.hints;
|
|
1705
|
+
exclusions.push(...checkpoint2.exclusions || []);
|
|
1706
|
+
console.log(`Resuming captured crawl: ${pages.length} pages, ${queue.length} URLs pending`);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
const snapshot = () => ({ version: 2, start, pages, queue, visited: [...visited], seen: [...seen], warnings, stills, hints, exclusions, discovery: [...discovery] });
|
|
1710
|
+
const checkpoint = () => persistCheckpoint(checkpointPath, snapshot());
|
|
1711
|
+
const retryUrls = [];
|
|
1712
|
+
try {
|
|
1713
|
+
while (queue.length) {
|
|
1714
|
+
if (maxPages !== void 0 && pages.length >= maxPages) {
|
|
1715
|
+
warnings.push(`Emergency maxPages=${maxPages} reached; ${queue.length} URL(s) left unvisited.`);
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
const url = queue.shift();
|
|
1719
|
+
if (visited.has(url)) continue;
|
|
1720
|
+
queue.unshift(url);
|
|
1721
|
+
checkpoint();
|
|
1722
|
+
queue.shift();
|
|
1723
|
+
visited.add(url);
|
|
1724
|
+
const page = await context.newPage();
|
|
1725
|
+
try {
|
|
1726
|
+
const response = await page.goto(url, {
|
|
1727
|
+
waitUntil: "domcontentloaded",
|
|
1728
|
+
timeout: 3e4
|
|
1729
|
+
});
|
|
1730
|
+
if (response && !response.ok()) {
|
|
1731
|
+
const status = response.status();
|
|
1732
|
+
misses.push({
|
|
1733
|
+
url,
|
|
1734
|
+
status,
|
|
1735
|
+
error: `HTTP ${status}`,
|
|
1736
|
+
kind: status >= 500 ? "transport" : "http"
|
|
1737
|
+
});
|
|
1738
|
+
if (status >= 500) retryUrls.push(url);
|
|
1739
|
+
continue;
|
|
1740
|
+
}
|
|
1741
|
+
const finalUrl = page.url();
|
|
1742
|
+
if (!finalUrl.startsWith("http") || !sameSite(finalUrl, start)) {
|
|
1743
|
+
misses.push({ url, error: finalUrl, kind: "non-http" });
|
|
1744
|
+
continue;
|
|
1745
|
+
}
|
|
1746
|
+
await page.waitForTimeout(800);
|
|
1747
|
+
try {
|
|
1748
|
+
await page.waitForLoadState("networkidle", { timeout: 2e3 });
|
|
1749
|
+
} catch {
|
|
1750
|
+
}
|
|
1751
|
+
await scrollPage(page);
|
|
1752
|
+
const html = await page.content();
|
|
1753
|
+
if (!html || html.length < 50) {
|
|
1754
|
+
misses.push({ url, kind: "empty", error: "empty document" });
|
|
1755
|
+
retryUrls.push(url);
|
|
1756
|
+
continue;
|
|
1757
|
+
}
|
|
1758
|
+
const extracted = extractPage(html, finalUrl);
|
|
1759
|
+
if (response && !response.ok() || isErrorPage(extracted)) {
|
|
1760
|
+
misses.push({ url, kind: "error-page", error: "Soft error page" });
|
|
1761
|
+
continue;
|
|
1762
|
+
}
|
|
1763
|
+
if (isErrorPage(extractPage(await page.content(), finalUrl))) {
|
|
1764
|
+
misses.push({ url, kind: "error-page", error: "Soft error page" });
|
|
1765
|
+
continue;
|
|
1766
|
+
}
|
|
1767
|
+
if (pages.some((p) => p.url === finalUrl)) continue;
|
|
1768
|
+
const extras = await collectRenderedExtras(page);
|
|
1769
|
+
mergeExtras(extracted, extras, finalUrl);
|
|
1770
|
+
extracted.url = finalUrl;
|
|
1771
|
+
const signature = (p) => JSON.stringify([p.title, p.description, p.headings, p.paragraphs]);
|
|
1772
|
+
const duplicate = pages.find((p) => signature(p) === signature(extracted));
|
|
1773
|
+
if (duplicate) {
|
|
1774
|
+
extracted.aliasOf = duplicate.aliasOf || duplicate.url;
|
|
1775
|
+
pages.push(extracted);
|
|
1776
|
+
console.log(` alias: ${finalUrl} \u2192 ${extracted.aliasOf}`);
|
|
1777
|
+
continue;
|
|
1778
|
+
}
|
|
1779
|
+
pages.push(extracted);
|
|
1780
|
+
console.log(` page ${pages.length}: ${finalUrl} (${extracted.paragraphs.length} paras, ${extracted.images.length} images)`);
|
|
1781
|
+
const priority = crawlPriority(finalUrl, start);
|
|
1782
|
+
if (stillsDir && (priority === 0 || priority === 1)) {
|
|
1783
|
+
await captureStill(page, stillsDir, priority === 0 ? "home.png" : "about.png", stills);
|
|
1784
|
+
}
|
|
1785
|
+
if (priority === 0 && !hints) {
|
|
1786
|
+
try {
|
|
1787
|
+
hints = await captureHints(page);
|
|
1788
|
+
} catch {
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
for (const href of extras.hrefs) enqueue(queue, seen, href, start, discovery, { provenance: "nav", discoveredFrom: finalUrl });
|
|
1792
|
+
for (const link of extracted.links) {
|
|
1793
|
+
enqueue(queue, seen, link.href, start, discovery, {
|
|
1794
|
+
provenance: link.relative ? "in-body-relative" : "nav",
|
|
1795
|
+
discoveredFrom: finalUrl
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
} catch (err) {
|
|
1799
|
+
retryUrls.push(url);
|
|
1800
|
+
misses.push({ url, kind: "transport", error: err instanceof Error ? err.message : "error" });
|
|
1801
|
+
console.warn(` fail: ${url} \u2014 ${err instanceof Error ? err.message : "error"}`);
|
|
1802
|
+
} finally {
|
|
1803
|
+
await page.close().catch(() => void 0);
|
|
1804
|
+
checkpoint();
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
} finally {
|
|
1808
|
+
await context.close().catch(() => void 0);
|
|
1809
|
+
await browser.close().catch(() => void 0);
|
|
1810
|
+
}
|
|
1811
|
+
if (!pages.length) warnings.push("Playwright crawl returned no HTML pages.");
|
|
1812
|
+
const captured = capturedPathSet(pages);
|
|
1813
|
+
for (const miss of misses) {
|
|
1814
|
+
const exclusion = classifyMiss({ ...miss, discovery: discovery.get(miss.url), captured, sitemapPaths });
|
|
1815
|
+
exclusions.push(exclusion);
|
|
1816
|
+
warnings.push(formatExclusion(exclusion));
|
|
1817
|
+
}
|
|
1818
|
+
for (const url of retryUrls) {
|
|
1819
|
+
visited.delete(url);
|
|
1820
|
+
queue.push(url);
|
|
1821
|
+
}
|
|
1822
|
+
checkpoint();
|
|
1823
|
+
for (const w of warnings) console.warn(` warn: ${w}`);
|
|
1824
|
+
return { startUrl: start, pages, warnings, engine: "playwright", hints, stills, exclusions, unvisited: [...queue] };
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
// scripts/onboard/images.ts
|
|
1828
|
+
import { createHash } from "node:crypto";
|
|
1829
|
+
import { copyFileSync, existsSync as existsSync3, mkdirSync as mkdirSync2 } from "node:fs";
|
|
1830
|
+
import { basename, join as join2 } from "node:path";
|
|
1831
|
+
|
|
1832
|
+
// src/onboard/classify.ts
|
|
1833
|
+
var STOCK_HOST = /unsplash\.com|images\.unsplash|pexels\.com|images\.pexels|pixabay\.com|cdn\.pixabay|shutterstock\.com|gettyimages|adobe\.stock|stock\.adobe|burst\.shopify|istockphoto|depositphotos|dreamstime|fotolia|smugmug\.com\/.*stock/i;
|
|
1834
|
+
var GENERIC_NAME = /handshake|laptop.?latte|coffee.?laptop|smiling.?team|diversity.?meeting|spa.?stones|marble.?texture|placeholder|spacer|dummy|default.?avatar|blank/i;
|
|
1835
|
+
var GENERIC_ALT = /^(alt.?text|image|photo|picture|img|untitled)$/i;
|
|
1836
|
+
var LOGO_HINT = /logo|brand.?mark|wordmark|logotype/i;
|
|
1837
|
+
var ICON_HINT = /icon|sprite|checkmark|arrow|chevron|social.?|facebook|instagram|twitter|linkedin|youtube|tiktok/i;
|
|
1838
|
+
var ILLUSTRATION_HINT = /illustrat|vector|isometric|cartoon|clipart|infographic|doodle|how-it-works|whats-included|what's included/i;
|
|
1839
|
+
var SCREENSHOT_HINT = /mockup|screenshot|device.?frame|laptop|browser|website of|responsive|portfolio/i;
|
|
1840
|
+
var PORTRAIT_HINT = /headshot|portrait|founder|team.?photo|staff|our team|meet the/i;
|
|
1841
|
+
var PRESS_HINT = /featured.?in|as.?seen|press.?logo|publication|badge/i;
|
|
1842
|
+
function isStockHost(src) {
|
|
1843
|
+
try {
|
|
1844
|
+
const host = new URL(src).hostname;
|
|
1845
|
+
return STOCK_HOST.test(host) || STOCK_HOST.test(src);
|
|
1846
|
+
} catch {
|
|
1847
|
+
return STOCK_HOST.test(src);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
function inferMediaType(img, role) {
|
|
1851
|
+
if (role === "logo") return "logo";
|
|
1852
|
+
if (role === "icon") return "icon";
|
|
1853
|
+
const blob = `${img.src} ${img.alt} ${img.nearbyHeading || ""} ${img.pageUrl || ""}`;
|
|
1854
|
+
if (PRESS_HINT.test(blob)) return "press";
|
|
1855
|
+
if (PORTRAIT_HINT.test(blob) || /\/(about|team|meet)/i.test(img.pageUrl || "")) {
|
|
1856
|
+
if (PORTRAIT_HINT.test(blob) || /headshot|portrait|founder|team/i.test(blob)) return "portrait";
|
|
1857
|
+
}
|
|
1858
|
+
if (SCREENSHOT_HINT.test(blob)) return "screenshot";
|
|
1859
|
+
if (ILLUSTRATION_HINT.test(blob) || /\.svg(\?|$)/i.test(img.src)) return "illustration";
|
|
1860
|
+
if (/\/(how-it-works|process)(\/|$)/i.test(img.pageUrl || "")) return "illustration";
|
|
1861
|
+
if (PORTRAIT_HINT.test(blob)) return "portrait";
|
|
1862
|
+
return "photo";
|
|
1863
|
+
}
|
|
1864
|
+
function classifyOne(img, opts = {}) {
|
|
1865
|
+
const inChrome = Boolean(opts.inChrome ?? img.inChrome);
|
|
1866
|
+
const fromJsonLdLogo = Boolean(opts.fromJsonLdLogo ?? img.fromJsonLdLogo);
|
|
1867
|
+
const fromOg = Boolean(opts.fromOg ?? img.fromOg);
|
|
1868
|
+
const aboveFold = Boolean(opts.aboveFold ?? img.aboveFold);
|
|
1869
|
+
const srcAlt = `${img.src} ${img.alt}`;
|
|
1870
|
+
const finish = (role, kind) => ({
|
|
1871
|
+
...img,
|
|
1872
|
+
role,
|
|
1873
|
+
kind,
|
|
1874
|
+
mediaType: inferMediaType(img, role),
|
|
1875
|
+
inChrome,
|
|
1876
|
+
fromJsonLdLogo,
|
|
1877
|
+
fromOg,
|
|
1878
|
+
aboveFold
|
|
1879
|
+
});
|
|
1880
|
+
if (fromJsonLdLogo || LOGO_HINT.test(srcAlt) || inChrome && LOGO_HINT.test(img.alt || img.src)) {
|
|
1881
|
+
return finish("logo", "business");
|
|
1882
|
+
}
|
|
1883
|
+
if (inChrome && (/\.svg(\?|$)/i.test(img.src) || img.width && img.height && img.width <= 400 && img.height <= 200)) {
|
|
1884
|
+
if (!GENERIC_NAME.test(srcAlt)) return finish("logo", "business");
|
|
1885
|
+
}
|
|
1886
|
+
if (ICON_HINT.test(srcAlt) || img.width && img.height && img.width <= 96 && img.height <= 96) {
|
|
1887
|
+
return finish("icon", "generic");
|
|
1888
|
+
}
|
|
1889
|
+
if (isStockHost(img.src) || GENERIC_NAME.test(srcAlt)) {
|
|
1890
|
+
return finish(aboveFold || fromOg ? "hero" : "photo", isStockHost(img.src) ? "stock" : "generic");
|
|
1891
|
+
}
|
|
1892
|
+
const alt = img.alt.trim();
|
|
1893
|
+
if (alt && (GENERIC_ALT.test(alt) || /^alt.?text$/i.test(alt))) {
|
|
1894
|
+
return finish(aboveFold || fromOg ? "hero" : "photo", "generic");
|
|
1895
|
+
}
|
|
1896
|
+
return finish(aboveFold || fromOg ? "hero" : "photo", "business");
|
|
1897
|
+
}
|
|
1898
|
+
function classifyImages(images) {
|
|
1899
|
+
const classified = images.map(
|
|
1900
|
+
(img) => classifyOne(img, {
|
|
1901
|
+
inChrome: img.inChrome,
|
|
1902
|
+
fromJsonLdLogo: img.fromJsonLdLogo,
|
|
1903
|
+
fromOg: img.fromOg,
|
|
1904
|
+
aboveFold: img.aboveFold
|
|
1905
|
+
})
|
|
1906
|
+
);
|
|
1907
|
+
const logos = classified.filter((c) => c.role === "logo");
|
|
1908
|
+
if (logos.length > 1) {
|
|
1909
|
+
const preferred = logos.find((l) => l.fromJsonLdLogo) || logos.find((l) => l.inChrome && LOGO_HINT.test(`${l.src} ${l.alt}`)) || logos[0];
|
|
1910
|
+
for (const c of classified) {
|
|
1911
|
+
if (c.role === "logo" && c.src !== preferred.src) {
|
|
1912
|
+
c.role = "icon";
|
|
1913
|
+
c.kind = c.kind === "business" ? "unknown" : c.kind;
|
|
1914
|
+
c.mediaType = inferMediaType(c, "icon");
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
const heroes = classified.filter((c) => c.role === "hero");
|
|
1919
|
+
if (heroes.length > 1) {
|
|
1920
|
+
const preferred = heroes.find((h) => h.kind === "business" && (h.fromOg || h.aboveFold)) || heroes.find((h) => h.kind === "business") || heroes.find((h) => h.fromOg) || heroes[0];
|
|
1921
|
+
for (const c of classified) {
|
|
1922
|
+
if (c.role === "hero" && c.src !== preferred.src) {
|
|
1923
|
+
c.role = "photo";
|
|
1924
|
+
c.mediaType = inferMediaType(c, "photo");
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
} else if (heroes.length === 0) {
|
|
1928
|
+
const candidate = classified.find((c) => c.kind === "business" && c.role === "photo" && (c.fromOg || c.aboveFold)) || classified.find((c) => c.kind === "business" && c.role === "photo") || classified.find((c) => c.role === "photo");
|
|
1929
|
+
if (candidate) {
|
|
1930
|
+
candidate.role = "hero";
|
|
1931
|
+
candidate.mediaType = inferMediaType(candidate, "hero");
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
return classified;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
// src/onboard/shortlist.ts
|
|
1938
|
+
var SHORTLIST_MIN = 8;
|
|
1939
|
+
var SHORTLIST_MAX = 20;
|
|
1940
|
+
var TYPE_CAPS = {
|
|
1941
|
+
logo: 1,
|
|
1942
|
+
screenshot: 4,
|
|
1943
|
+
illustration: 4,
|
|
1944
|
+
portrait: 3,
|
|
1945
|
+
press: 2,
|
|
1946
|
+
photo: 6,
|
|
1947
|
+
icon: 2
|
|
1948
|
+
};
|
|
1949
|
+
function slugPart(raw) {
|
|
1950
|
+
const s = raw.toLowerCase().replace(/['’]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40);
|
|
1951
|
+
return s || "asset";
|
|
1952
|
+
}
|
|
1953
|
+
function extFromImage(img) {
|
|
1954
|
+
const fromKey = (img.r2Key || img.sourceUrl || img.src).match(/\.([a-z0-9]{3,4})(?:\?|$)/i);
|
|
1955
|
+
const ext = (fromKey?.[1] || "png").toLowerCase();
|
|
1956
|
+
return ext === "jpeg" ? "jpg" : ext;
|
|
1957
|
+
}
|
|
1958
|
+
function scoreShortlist(img) {
|
|
1959
|
+
if (img.role === "failed" || img.error) return -1;
|
|
1960
|
+
let n = 0;
|
|
1961
|
+
if (img.role === "logo") n += 100;
|
|
1962
|
+
if (img.role === "hero") n += 90;
|
|
1963
|
+
if (img.mediaType === "screenshot") n += 40;
|
|
1964
|
+
if (img.mediaType === "illustration") n += 38;
|
|
1965
|
+
if (img.mediaType === "portrait") n += 36;
|
|
1966
|
+
if (img.mediaType === "press") n += 28;
|
|
1967
|
+
if (img.kind === "business") n += 20;
|
|
1968
|
+
if (img.kind === "generic") n -= 8;
|
|
1969
|
+
if (img.alt && !/^alt.?text$/i.test(img.alt)) n += 12;
|
|
1970
|
+
if (img.nearbyHeading) n += 8;
|
|
1971
|
+
if (img.aboveFold || img.fromOg) n += 10;
|
|
1972
|
+
const w = img.width || 0;
|
|
1973
|
+
const h = img.height || 0;
|
|
1974
|
+
if (w >= 600 || h >= 400) n += 10;
|
|
1975
|
+
if (img.mediaType === "icon") n -= 15;
|
|
1976
|
+
return n;
|
|
1977
|
+
}
|
|
1978
|
+
function fileStemFor(img, used) {
|
|
1979
|
+
const fromCaption = img.caption || img.nearbyHeading || img.alt;
|
|
1980
|
+
let base = img.role === "logo" ? "logo" : img.role === "hero" ? "hero" : `${img.mediaType || "photo"}-${slugPart(fromCaption || img.r2Key.slice(-8) || "asset")}`;
|
|
1981
|
+
if (used.has(base)) {
|
|
1982
|
+
let i = 2;
|
|
1983
|
+
while (used.has(`${base}-${i}`)) i += 1;
|
|
1984
|
+
base = `${base}-${i}`;
|
|
1985
|
+
}
|
|
1986
|
+
used.add(base);
|
|
1987
|
+
return base;
|
|
1988
|
+
}
|
|
1989
|
+
function selectShortlist(images) {
|
|
1990
|
+
const ranked = images.filter((img) => scoreShortlist(img) >= 0).sort((a, b) => scoreShortlist(b) - scoreShortlist(a));
|
|
1991
|
+
const picked = [];
|
|
1992
|
+
const counts = {};
|
|
1993
|
+
const take = (img) => {
|
|
1994
|
+
const t = img.mediaType || img.role || "photo";
|
|
1995
|
+
const cap = TYPE_CAPS[t] ?? 4;
|
|
1996
|
+
counts[t] = (counts[t] || 0) + 1;
|
|
1997
|
+
if (counts[t] > cap && picked.length >= SHORTLIST_MIN) return;
|
|
1998
|
+
if (picked.includes(img)) return;
|
|
1999
|
+
picked.push(img);
|
|
2000
|
+
};
|
|
2001
|
+
const logo = ranked.find((i) => i.role === "logo");
|
|
2002
|
+
if (logo) take(logo);
|
|
2003
|
+
const hero = ranked.find((i) => i.role === "hero" && i !== logo);
|
|
2004
|
+
if (hero) take(hero);
|
|
2005
|
+
for (const img of ranked) {
|
|
2006
|
+
if (picked.length >= SHORTLIST_MAX) break;
|
|
2007
|
+
take(img);
|
|
2008
|
+
}
|
|
2009
|
+
const used = /* @__PURE__ */ new Set();
|
|
2010
|
+
for (const img of picked) {
|
|
2011
|
+
img.shortlist = true;
|
|
2012
|
+
const stem = fileStemFor(img, used);
|
|
2013
|
+
img.thumbPath = `onboarding/thumbs/${stem}.${extFromImage(img)}`;
|
|
2014
|
+
if (!img.caption) {
|
|
2015
|
+
img.caption = [img.nearbyHeading, img.alt].filter(Boolean).join(" \u2014 ") || `${img.mediaType || img.role} from the old site (hint stem: ${stem})`;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
return picked;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
// scripts/onboard/images.ts
|
|
2022
|
+
var ua2 = "VitrisOnboard/0.1 (authorized site migration; https://vitris.local)";
|
|
2023
|
+
var MIN_BYTES = 4096;
|
|
2024
|
+
var MAX_BYTES = 8 * 1024 * 1024;
|
|
2025
|
+
function extFor(contentType, url) {
|
|
2026
|
+
if (contentType.includes("png")) return "png";
|
|
2027
|
+
if (contentType.includes("webp")) return "webp";
|
|
2028
|
+
if (contentType.includes("gif")) return "gif";
|
|
2029
|
+
if (contentType.includes("svg")) return "svg";
|
|
2030
|
+
if (contentType.includes("jpeg") || contentType.includes("jpg")) return "jpg";
|
|
2031
|
+
const fromUrl = url.match(/\.(jpe?g|png|webp|gif|svg)(\?|$)/i);
|
|
2032
|
+
return (fromUrl?.[1] || "jpg").toLowerCase().replace("jpeg", "jpg");
|
|
2033
|
+
}
|
|
2034
|
+
async function download(url) {
|
|
2035
|
+
try {
|
|
2036
|
+
const res = await fetch(url, {
|
|
2037
|
+
headers: { "user-agent": ua2, accept: "image/*,*/*;q=0.8" },
|
|
2038
|
+
redirect: "follow",
|
|
2039
|
+
signal: AbortSignal.timeout(15e3)
|
|
2040
|
+
});
|
|
2041
|
+
if (!res.ok) return null;
|
|
2042
|
+
const contentType = (res.headers.get("content-type") || "").toLowerCase();
|
|
2043
|
+
if (contentType && !contentType.startsWith("image/") && !contentType.includes("octet-stream")) {
|
|
2044
|
+
return null;
|
|
2045
|
+
}
|
|
2046
|
+
const bytes = Buffer.from(await res.arrayBuffer());
|
|
2047
|
+
return { bytes, contentType: contentType || "image/jpeg" };
|
|
2048
|
+
} catch {
|
|
2049
|
+
return null;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
async function uploadImages(images, opts) {
|
|
2053
|
+
const classified = classifyImages(images);
|
|
2054
|
+
const out = [];
|
|
2055
|
+
const seenHash = /* @__PURE__ */ new Map();
|
|
2056
|
+
const cachePath = opts.captureKey ? join2(opts.kernelRoot, "scratch/onboard", opts.slug, `downloads-${opts.captureKey}.json`) : void 0;
|
|
2057
|
+
const cached = cachePath && existsSync3(cachePath) ? json(cachePath) : [];
|
|
2058
|
+
let remote = opts.remote;
|
|
2059
|
+
if (opts.local === false && remote === false) {
|
|
2060
|
+
console.log("Media is saved locally; no R2 publication requested.");
|
|
2061
|
+
}
|
|
2062
|
+
for (const img of classified) {
|
|
2063
|
+
const previous = cached.find((c) => (c.sourceUrl === img.src || c.sourceUrls?.includes(img.src)) && c.scratchPath && existsSync3(c.scratchPath));
|
|
2064
|
+
if (previous) {
|
|
2065
|
+
if (!out.some((i) => i.scratchPath === previous.scratchPath)) out.push(previous);
|
|
2066
|
+
continue;
|
|
2067
|
+
}
|
|
2068
|
+
const downloaded = await download(img.src);
|
|
2069
|
+
if (!downloaded) {
|
|
2070
|
+
out.push({
|
|
2071
|
+
sourceUrl: img.src,
|
|
2072
|
+
alt: img.alt,
|
|
2073
|
+
r2Key: "",
|
|
2074
|
+
src: img.src,
|
|
2075
|
+
role: "failed",
|
|
2076
|
+
kind: img.kind,
|
|
2077
|
+
mediaType: img.mediaType,
|
|
2078
|
+
pageUrl: img.pageUrl,
|
|
2079
|
+
nearbyHeading: img.nearbyHeading,
|
|
2080
|
+
width: img.width,
|
|
2081
|
+
height: img.height,
|
|
2082
|
+
error: "download failed"
|
|
2083
|
+
});
|
|
2084
|
+
continue;
|
|
2085
|
+
}
|
|
2086
|
+
if (downloaded.bytes.length > MAX_BYTES) {
|
|
2087
|
+
out.push({
|
|
2088
|
+
sourceUrl: img.src,
|
|
2089
|
+
alt: img.alt,
|
|
2090
|
+
r2Key: "",
|
|
2091
|
+
src: img.src,
|
|
2092
|
+
role: "failed",
|
|
2093
|
+
kind: img.kind,
|
|
2094
|
+
error: "file too large"
|
|
2095
|
+
});
|
|
2096
|
+
continue;
|
|
2097
|
+
}
|
|
2098
|
+
const isLogo = img.role === "logo" || img.fromJsonLdLogo;
|
|
2099
|
+
if (downloaded.bytes.length < MIN_BYTES && !isLogo && !downloaded.contentType.includes("svg")) {
|
|
2100
|
+
out.push({ sourceUrl: img.src, alt: img.alt, r2Key: "", src: img.src, role: "failed", kind: img.kind, error: "Small raster: inspect before inclusion" });
|
|
2101
|
+
continue;
|
|
2102
|
+
}
|
|
2103
|
+
const hash = createHash("sha256").update(downloaded.bytes).digest("hex").slice(0, 16);
|
|
2104
|
+
const duplicate = seenHash.get(hash);
|
|
2105
|
+
if (duplicate) {
|
|
2106
|
+
duplicate.sourceUrls = [.../* @__PURE__ */ new Set([...duplicate.sourceUrls || [duplicate.sourceUrl], img.src])];
|
|
2107
|
+
continue;
|
|
2108
|
+
}
|
|
2109
|
+
const ext = extFor(downloaded.contentType, img.src);
|
|
2110
|
+
const r2Key = `sites/${opts.slug}/media/${hash}.${ext}`;
|
|
2111
|
+
const file = join2(opts.kernelRoot, "scratch", "onboard", opts.slug, `${hash}.${ext}`);
|
|
2112
|
+
writeScratchFile(file, downloaded.bytes);
|
|
2113
|
+
const contentType = downloaded.contentType.startsWith("image/") ? downloaded.contentType : `image/${ext === "jpg" ? "jpeg" : ext}`;
|
|
2114
|
+
let uploaded = false;
|
|
2115
|
+
if (opts.local) {
|
|
2116
|
+
try {
|
|
2117
|
+
putLocalR2(opts.kernelRoot, r2Key, file, contentType);
|
|
2118
|
+
uploaded = true;
|
|
2119
|
+
} catch (err) {
|
|
2120
|
+
console.warn(`local R2 skipped for ${r2Key}: ${err instanceof Error ? err.message : "error"}`);
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
if (remote) {
|
|
2124
|
+
try {
|
|
2125
|
+
await putRemoteR2(r2Key, file, contentType);
|
|
2126
|
+
uploaded = true;
|
|
2127
|
+
} catch (err) {
|
|
2128
|
+
console.warn(`remote R2 skipped for ${r2Key}: ${err instanceof Error ? err.message : "error"}`);
|
|
2129
|
+
remote = false;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
const brief = toBriefImage(img, {
|
|
2133
|
+
r2Key: uploaded ? r2Key : "",
|
|
2134
|
+
src: uploaded ? publicAssetUrl(r2Key) : img.src,
|
|
2135
|
+
uploaded,
|
|
2136
|
+
scratchPath: file,
|
|
2137
|
+
hash,
|
|
2138
|
+
ext
|
|
2139
|
+
});
|
|
2140
|
+
out.push(brief);
|
|
2141
|
+
seenHash.set(hash, brief);
|
|
2142
|
+
if (cachePath) save(cachePath, out.filter((i) => i.scratchPath));
|
|
2143
|
+
}
|
|
2144
|
+
promoteRoles(out);
|
|
2145
|
+
const hints = selectShortlist(out);
|
|
2146
|
+
console.log(`Harvest images: ${out.filter((i) => i.role !== "failed").length} stored; shortlist hint=${hints.length}`);
|
|
2147
|
+
if (out.some((i) => i.role !== "failed" && i.r2Key) && assetsOrigin().includes("127.0.0.1")) {
|
|
2148
|
+
console.warn(
|
|
2149
|
+
"ASSETS_ORIGIN is local. All successful images are copied into media/harvest/; interpret picks the shortlist."
|
|
2150
|
+
);
|
|
2151
|
+
}
|
|
2152
|
+
return out;
|
|
2153
|
+
}
|
|
2154
|
+
function toBriefImage(img, opts) {
|
|
2155
|
+
const meta2 = {
|
|
2156
|
+
mediaType: img.mediaType,
|
|
2157
|
+
pageUrl: img.pageUrl,
|
|
2158
|
+
nearbyHeading: img.nearbyHeading,
|
|
2159
|
+
width: img.width,
|
|
2160
|
+
height: img.height,
|
|
2161
|
+
aboveFold: img.aboveFold,
|
|
2162
|
+
fromOg: img.fromOg,
|
|
2163
|
+
scratchPath: opts.scratchPath,
|
|
2164
|
+
localPath: `/media/harvest/${opts.hash}.${opts.ext}`
|
|
2165
|
+
};
|
|
2166
|
+
return {
|
|
2167
|
+
sourceUrl: img.src,
|
|
2168
|
+
alt: img.alt,
|
|
2169
|
+
r2Key: opts.r2Key,
|
|
2170
|
+
src: opts.src,
|
|
2171
|
+
role: img.role === "failed" ? "photo" : img.role,
|
|
2172
|
+
kind: img.kind,
|
|
2173
|
+
...meta2
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
function copyHarvestToSite(siteRoot, images) {
|
|
2177
|
+
const harvestDir = join2(siteRoot, "media", "harvest");
|
|
2178
|
+
mkdirSync2(harvestDir, { recursive: true });
|
|
2179
|
+
for (const img of images) {
|
|
2180
|
+
if (img.role === "failed" || !img.scratchPath || !existsSync3(img.scratchPath)) continue;
|
|
2181
|
+
const name = img.localPath ? basename(img.localPath) : basename(img.scratchPath);
|
|
2182
|
+
const dest = join2(harvestDir, name);
|
|
2183
|
+
copyFileSync(img.scratchPath, dest);
|
|
2184
|
+
img.localPath = `/media/harvest/${name}`;
|
|
2185
|
+
img.src = img.localPath;
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function promoteRoles(images) {
|
|
2189
|
+
const logos = images.filter((i) => i.role === "logo");
|
|
2190
|
+
if (logos.length > 1) {
|
|
2191
|
+
const keep = logos[0];
|
|
2192
|
+
for (const img of images) {
|
|
2193
|
+
if (img.role === "logo" && img.sourceUrl !== keep.sourceUrl) img.role = "icon";
|
|
2194
|
+
}
|
|
2195
|
+
}
|
|
2196
|
+
const heroes = images.filter((i) => i.role === "hero");
|
|
2197
|
+
if (heroes.length > 1) {
|
|
2198
|
+
const keep = heroes.find((h) => h.kind === "business") || heroes[0];
|
|
2199
|
+
for (const img of images) {
|
|
2200
|
+
if (img.role === "hero" && img.sourceUrl !== keep.sourceUrl) img.role = "photo";
|
|
2201
|
+
}
|
|
2202
|
+
} else if (heroes.length === 0) {
|
|
2203
|
+
const candidate = images.find((i) => i.kind === "business" && i.role === "photo") || images.find((i) => i.role === "photo");
|
|
2204
|
+
if (candidate) candidate.role = "hero";
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
// scripts/onboard/run.ts
|
|
2209
|
+
function writeOnboardingArtifacts(dest, brief, extras) {
|
|
2210
|
+
const dir = join3(dest, "onboarding");
|
|
2211
|
+
mkdirSync3(dir, { recursive: true });
|
|
2212
|
+
mkdirSync3(join3(dir, "copy"), { recursive: true });
|
|
2213
|
+
writeFileSync(join3(dir, "brief.json"), `${JSON.stringify(briefForDisk(brief), null, 2)}
|
|
2214
|
+
`);
|
|
2215
|
+
writeFileSync(join3(dir, "outline.md"), renderOutline({ brief }));
|
|
2216
|
+
writeFileSync(join3(dir, "media.md"), renderMediaGuide(brief));
|
|
2217
|
+
const audit = assembleAudit({
|
|
2218
|
+
sourceUrl: brief.sourceUrl,
|
|
2219
|
+
pages: extras?.pages || [],
|
|
2220
|
+
crawledAt: brief.crawledAt
|
|
2221
|
+
});
|
|
2222
|
+
if (!extras?.pages?.length && brief.pages.length) {
|
|
2223
|
+
audit.pages = brief.pages.map((p) => ({
|
|
2224
|
+
url: p.url,
|
|
2225
|
+
title: p.title,
|
|
2226
|
+
description: p.description,
|
|
2227
|
+
canonical: p.canonical,
|
|
2228
|
+
lang: void 0,
|
|
2229
|
+
h1Count: p.audit?.h1Count ?? 0,
|
|
2230
|
+
missingAlts: p.audit?.missingAlts ?? 0,
|
|
2231
|
+
unlabeledInputs: p.audit?.unlabeledInputs ?? 0,
|
|
2232
|
+
hasCanonical: p.audit?.hasCanonical ?? false,
|
|
2233
|
+
hasLang: p.audit?.hasLang ?? false,
|
|
2234
|
+
hasJsonLd: p.audit?.hasJsonLd ?? false,
|
|
2235
|
+
titleLength: p.audit?.titleLength ?? p.title.length,
|
|
2236
|
+
descriptionLength: p.audit?.descriptionLength ?? p.description.length
|
|
2237
|
+
}));
|
|
2238
|
+
audit.summary = {
|
|
2239
|
+
pageCount: audit.pages.length,
|
|
2240
|
+
pagesMissingTitle: audit.pages.filter((p) => !p.title).length,
|
|
2241
|
+
pagesMissingDescription: audit.pages.filter((p) => !p.description).length,
|
|
2242
|
+
pagesMultipleH1: audit.pages.filter((p) => p.h1Count > 1).length,
|
|
2243
|
+
pagesZeroH1: audit.pages.filter((p) => p.h1Count === 0).length,
|
|
2244
|
+
totalMissingAlts: audit.pages.reduce((n, p) => n + p.missingAlts, 0),
|
|
2245
|
+
totalUnlabeledInputs: audit.pages.reduce((n, p) => n + p.unlabeledInputs, 0)
|
|
2246
|
+
};
|
|
2247
|
+
}
|
|
2248
|
+
writeFileSync(join3(dir, "audit.json"), `${JSON.stringify(audit, null, 2)}
|
|
2249
|
+
`);
|
|
2250
|
+
const research = emptyResearch(brief.business.social || []);
|
|
2251
|
+
writeFileSync(join3(dir, "research.json"), `${JSON.stringify(research, null, 2)}
|
|
2252
|
+
`);
|
|
2253
|
+
writeFileSync(
|
|
2254
|
+
join3(dir, "README.md"),
|
|
2255
|
+
`# Onboarding harvest
|
|
2256
|
+
|
|
2257
|
+
This folder is the crawl output for **${brief.business.name || brief.slug}**.
|
|
2258
|
+
|
|
2259
|
+
| File | Purpose |
|
|
2260
|
+
|------|---------|
|
|
2261
|
+
| \`outline.md\` | Human-readable sitemap, facts, image catalog, gaps |
|
|
2262
|
+
| \`copy/*.md\` | Full visible copy per crawled URL |
|
|
2263
|
+
| \`brief.json\` | Machine index (facts, pages, images) |
|
|
2264
|
+
| \`audit.json\` | Crawl-time SEO/a11y inventory; \`webVitals\` filled by research node |
|
|
2265
|
+
| \`research.json\` | Reviews, social, goals \u2014 complete via the research graph node |
|
|
2266
|
+
| \`media.md\` | Harvest catalog + shortlist hints; the media node owns full asset disposition |
|
|
2267
|
+
| \`harvest-inventory.json\` | Kept pages, original-media files, failed downloads, classified exclusions |
|
|
2268
|
+
| \`harvest-scope.json\` | Optional operator bound (exclude classes / maxPages / notes) |
|
|
2269
|
+
|
|
2270
|
+
## Next
|
|
2271
|
+
|
|
2272
|
+
1. Build the evidence-backed business interpretation and review it.
|
|
2273
|
+
2. Inspect and account for all media, including acquisition failures.
|
|
2274
|
+
3. Follow the graph through direction, storyboard, copy, implementation, browser checks and independent reviews.
|
|
2275
|
+
|
|
2276
|
+
All successful images live under \`media/harvest/\`. Theme tokens are established by the **direction** node (harvest only stores hints in brief.visual).
|
|
2277
|
+
|
|
2278
|
+
See \`harvest-inventory.json\` for kept pages, original-media files, failed downloads, and an explicit class/reason for every exclusion (\`source-missing\`, \`crawler-invalid\`, \`off-site\`, \`error-page\`, \`transient\`). Operator bounds belong in \`harvest-scope.json\`.
|
|
2279
|
+
|
|
2280
|
+
Source: ${brief.sourceUrl || "(blank starter)"}
|
|
2281
|
+
Engine note: see \`warnings\` in brief.json.
|
|
2282
|
+
`
|
|
2283
|
+
);
|
|
2284
|
+
}
|
|
2285
|
+
function persistOnboard(dest, brief, extras) {
|
|
2286
|
+
if (extras?.copyMarkdown) {
|
|
2287
|
+
const copyDir = join3(dest, "onboarding", "copy");
|
|
2288
|
+
mkdirSync3(copyDir, { recursive: true });
|
|
2289
|
+
for (const { slug, markdown } of extras.copyMarkdown.values()) {
|
|
2290
|
+
writeFileSync(join3(copyDir, `${slug}.md`), markdown.endsWith("\n") ? markdown : `${markdown}
|
|
2291
|
+
`);
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
copyHarvestToSite(dest, brief.images);
|
|
2295
|
+
const rawDir = join3(dest, "onboarding", "raw");
|
|
2296
|
+
mkdirSync3(rawDir, { recursive: true });
|
|
2297
|
+
const capture = join3(rawDir, `${String(brief.crawledAt).replace(/[^a-zA-Z0-9-]/g, "-")}.json`);
|
|
2298
|
+
if (!existsSync4(capture)) writeFileSync(capture, JSON.stringify(briefForDisk(brief), null, 2) + "\n");
|
|
2299
|
+
if (brief.business.name) {
|
|
2300
|
+
const sitePath = join3(dest, "site.json");
|
|
2301
|
+
if (existsSync4(sitePath)) {
|
|
2302
|
+
const site = JSON.parse(readFileSync(sitePath, "utf8"));
|
|
2303
|
+
site.name = brief.business.name;
|
|
2304
|
+
writeFileSync(sitePath, `${JSON.stringify(site, null, 2)}
|
|
2305
|
+
`);
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
writeOnboardingArtifacts(dest, brief, { pages: extras?.pages });
|
|
2309
|
+
save(join3(dest, "onboarding", "harvest-inventory.json"), assembleHarvestInventory({
|
|
2310
|
+
engine: extras?.engine || "playwright",
|
|
2311
|
+
startUrl: brief.sourceUrl,
|
|
2312
|
+
pages: extras?.pages || brief.pages,
|
|
2313
|
+
exclusions: extras?.exclusions || [],
|
|
2314
|
+
unvisited: extras?.unvisited || [],
|
|
2315
|
+
siteRoot: dest,
|
|
2316
|
+
images: brief.images
|
|
2317
|
+
}));
|
|
2318
|
+
}
|
|
2319
|
+
function briefForDisk(brief) {
|
|
2320
|
+
return {
|
|
2321
|
+
...brief,
|
|
2322
|
+
images: brief.images.map(({ scratchPath: _drop, ...img }) => img)
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
async function crawlWithFallback(sourceUrl, maxPages, fetchOnly, kernelRoot, stillsDir, checkpointPath, fresh = false) {
|
|
2326
|
+
if (fetchOnly) {
|
|
2327
|
+
const crawl = await crawlSite(sourceUrl, maxPages, checkpointPath, fresh);
|
|
2328
|
+
return crawl;
|
|
2329
|
+
}
|
|
2330
|
+
try {
|
|
2331
|
+
console.log("Crawling with Playwright (rendered DOM)\u2026");
|
|
2332
|
+
return await crawlSiteBrowser(sourceUrl, maxPages, kernelRoot, stillsDir, checkpointPath, fresh);
|
|
2333
|
+
} catch (err) {
|
|
2334
|
+
if (!isPlaywrightLaunchFailure(err)) throw err;
|
|
2335
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2336
|
+
console.warn(`Playwright crawl unavailable (${msg}). Falling back to fetch HTML crawl.`);
|
|
2337
|
+
const crawl = await crawlSite(sourceUrl, maxPages, checkpointPath, fresh);
|
|
2338
|
+
crawl.warnings.unshift(`Playwright unavailable \u2014 used fetch fallback. ${msg}`);
|
|
2339
|
+
return crawl;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
async function gatherOnboard(opts) {
|
|
2343
|
+
const crawl = await crawlWithFallback(
|
|
2344
|
+
opts.sourceUrl,
|
|
2345
|
+
opts.maxPages,
|
|
2346
|
+
Boolean(opts.fetchOnly),
|
|
2347
|
+
opts.kernelRoot,
|
|
2348
|
+
join3(opts.siteRoot, "onboarding", "stills"),
|
|
2349
|
+
join3(opts.siteRoot, "onboarding", "crawl-progress.json"),
|
|
2350
|
+
Boolean(opts.fresh)
|
|
2351
|
+
);
|
|
2352
|
+
console.log(`Crawled ${crawl.pages.length} page(s) from ${crawl.startUrl} via ${crawl.engine}`);
|
|
2353
|
+
if (crawl.warnings.length) {
|
|
2354
|
+
for (const w of crawl.warnings) console.warn(` warn: ${w}`);
|
|
2355
|
+
}
|
|
2356
|
+
const copyMarkdown = buildCopyFiles(crawl.pages);
|
|
2357
|
+
const copyFiles = /* @__PURE__ */ new Map();
|
|
2358
|
+
for (const [url, { slug }] of copyMarkdown) {
|
|
2359
|
+
copyFiles.set(url, `${slug}.md`);
|
|
2360
|
+
}
|
|
2361
|
+
let images = [];
|
|
2362
|
+
if (!opts.skipImages) {
|
|
2363
|
+
const candidates = collectCandidateImages(crawl.pages);
|
|
2364
|
+
const hasRemote = false;
|
|
2365
|
+
console.log(`Downloading ${candidates.length} unique image candidate(s)\u2026`);
|
|
2366
|
+
images = await uploadImages(candidates, {
|
|
2367
|
+
kernelRoot: opts.kernelRoot,
|
|
2368
|
+
slug: opts.slug,
|
|
2369
|
+
local: false,
|
|
2370
|
+
remote: hasRemote,
|
|
2371
|
+
captureKey: createHash2("sha256").update(JSON.stringify(crawl.pages)).digest("hex").slice(0, 20)
|
|
2372
|
+
});
|
|
2373
|
+
const ok = images.filter((i) => i.scratchPath).length;
|
|
2374
|
+
console.log(`Images: ${ok} downloaded locally, ${images.length - ok} skipped or failed`);
|
|
2375
|
+
}
|
|
2376
|
+
let brief = assembleBrief({
|
|
2377
|
+
sourceUrl: crawl.startUrl,
|
|
2378
|
+
slug: opts.slug,
|
|
2379
|
+
pages: crawl.pages,
|
|
2380
|
+
images,
|
|
2381
|
+
warnings: crawl.warnings,
|
|
2382
|
+
seed: opts.name ? { name: opts.name } : void 0,
|
|
2383
|
+
copyFiles
|
|
2384
|
+
});
|
|
2385
|
+
if (brief.visual) {
|
|
2386
|
+
brief.visual = {
|
|
2387
|
+
...brief.visual,
|
|
2388
|
+
hints: crawl.hints || brief.visual.hints,
|
|
2389
|
+
stills: crawl.stills?.length ? crawl.stills : brief.visual.stills
|
|
2390
|
+
};
|
|
2391
|
+
}
|
|
2392
|
+
brief.business = await promptMissingFacts(brief.business, { noPrompt: opts.noPrompt });
|
|
2393
|
+
brief.missing = missingCritical(brief.business);
|
|
2394
|
+
if (brief.visual) {
|
|
2395
|
+
brief.visual.register = inferRegister(crawl.pages, brief.business);
|
|
2396
|
+
}
|
|
2397
|
+
return { brief, pages: crawl.pages, copyMarkdown, crawl };
|
|
2398
|
+
}
|
|
2399
|
+
async function gatherBlankOnboard(opts) {
|
|
2400
|
+
let brief = assembleBrief({
|
|
2401
|
+
sourceUrl: "",
|
|
2402
|
+
slug: opts.slug,
|
|
2403
|
+
pages: [],
|
|
2404
|
+
seed: { name: opts.name },
|
|
2405
|
+
warnings: ["Blank starter \u2014 no existing URL crawled."]
|
|
2406
|
+
});
|
|
2407
|
+
brief.business = await promptMissingFacts(brief.business, { noPrompt: opts.noPrompt });
|
|
2408
|
+
brief.missing = missingCritical(brief.business);
|
|
2409
|
+
return { brief, pages: [], copyMarkdown: /* @__PURE__ */ new Map() };
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
export {
|
|
2413
|
+
normalizeSourceUrl,
|
|
2414
|
+
promptSourceUrl,
|
|
2415
|
+
persistOnboard,
|
|
2416
|
+
gatherOnboard,
|
|
2417
|
+
gatherBlankOnboard
|
|
2418
|
+
};
|