opendevbrowser 0.0.25 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +7 -10
  2. package/dist/browser/canvas-manager.d.ts.map +1 -1
  3. package/dist/canvas/document-store.d.ts.map +1 -1
  4. package/dist/canvas/types.d.ts +3 -0
  5. package/dist/canvas/types.d.ts.map +1 -1
  6. package/dist/{chunk-7U63PZ4W.js → chunk-MWBDO2L5.js} +461 -189
  7. package/dist/chunk-MWBDO2L5.js.map +1 -0
  8. package/dist/{chunk-Z6ENAZUN.js → chunk-V5DJUSPV.js} +899 -115
  9. package/dist/chunk-V5DJUSPV.js.map +1 -0
  10. package/dist/cli/args.d.ts.map +1 -1
  11. package/dist/cli/commands/daemon.d.ts +27 -0
  12. package/dist/cli/commands/daemon.d.ts.map +1 -1
  13. package/dist/cli/commands/devtools/console-poll.d.ts.map +1 -1
  14. package/dist/cli/commands/devtools/network-poll.d.ts.map +1 -1
  15. package/dist/cli/commands/serve.d.ts +10 -13
  16. package/dist/cli/commands/serve.d.ts.map +1 -1
  17. package/dist/cli/commands/status.d.ts.map +1 -1
  18. package/dist/cli/commands/update.d.ts.map +1 -1
  19. package/dist/cli/daemon-autostart.d.ts +6 -2
  20. package/dist/cli/daemon-autostart.d.ts.map +1 -1
  21. package/dist/cli/daemon-client.d.ts.map +1 -1
  22. package/dist/cli/daemon-status-policy.d.ts +6 -0
  23. package/dist/cli/daemon-status-policy.d.ts.map +1 -0
  24. package/dist/cli/daemon-status.d.ts +1 -0
  25. package/dist/cli/daemon-status.d.ts.map +1 -1
  26. package/dist/cli/daemon.d.ts +5 -0
  27. package/dist/cli/daemon.d.ts.map +1 -1
  28. package/dist/cli/index.js +566 -154
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/utils/http.d.ts.map +1 -1
  31. package/dist/cli/utils/parse.d.ts.map +1 -1
  32. package/dist/daemon-fingerprint.json +3 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +109 -28
  35. package/dist/index.js.map +1 -1
  36. package/dist/inspiredesign/brief-expansion.d.ts +3 -0
  37. package/dist/inspiredesign/brief-expansion.d.ts.map +1 -1
  38. package/dist/{providers/inspiredesign-capture-mode.d.ts → inspiredesign/capture-mode.d.ts} +2 -2
  39. package/dist/inspiredesign/capture-mode.d.ts.map +1 -0
  40. package/dist/{providers/inspiredesign-capture.d.ts → inspiredesign/capture.d.ts} +3 -3
  41. package/dist/inspiredesign/capture.d.ts.map +1 -0
  42. package/dist/{providers/inspiredesign-contract.d.ts → inspiredesign/contract.d.ts} +18 -5
  43. package/dist/inspiredesign/contract.d.ts.map +1 -0
  44. package/dist/inspiredesign/handoff.d.ts +1 -11
  45. package/dist/inspiredesign/handoff.d.ts.map +1 -1
  46. package/dist/inspiredesign/reference-pattern-board.d.ts +73 -0
  47. package/dist/inspiredesign/reference-pattern-board.d.ts.map +1 -0
  48. package/dist/opendevbrowser.d.ts.map +1 -1
  49. package/dist/opendevbrowser.js +109 -28
  50. package/dist/opendevbrowser.js.map +1 -1
  51. package/dist/providers/renderer.d.ts +1 -1
  52. package/dist/providers/renderer.d.ts.map +1 -1
  53. package/dist/providers/workflows.d.ts +7 -5
  54. package/dist/providers/workflows.d.ts.map +1 -1
  55. package/dist/{providers-CYEJZVXB.js → providers-TR3DUJZV.js} +2 -2
  56. package/dist/public-surface/generated-manifest.d.ts +3 -3
  57. package/dist/public-surface/generated-manifest.d.ts.map +1 -1
  58. package/dist/public-surface/source.d.ts +5 -4
  59. package/dist/public-surface/source.d.ts.map +1 -1
  60. package/dist/relay/protocol.d.ts +14 -2
  61. package/dist/relay/protocol.d.ts.map +1 -1
  62. package/dist/tools/index.d.ts.map +1 -1
  63. package/dist/tools/status.d.ts.map +1 -1
  64. package/extension/dist/canvas/canvas-runtime.js +13 -6
  65. package/extension/dist/services/ConnectionManager.js +8 -4
  66. package/extension/manifest.json +1 -1
  67. package/package.json +1 -1
  68. package/skills/opendevbrowser-best-practices/assets/templates/skill-runtime-pack-matrix.json +1 -1
  69. package/skills/opendevbrowser-design-agent/assets/templates/inspiredesign-advanced-brief.v1.json +67 -31
  70. package/dist/chunk-7U63PZ4W.js.map +0 -1
  71. package/dist/chunk-Z6ENAZUN.js.map +0 -1
  72. package/dist/providers/inspiredesign-capture-mode.d.ts.map +0 -1
  73. package/dist/providers/inspiredesign-capture.d.ts.map +0 -1
  74. package/dist/providers/inspiredesign-contract.d.ts.map +0 -1
  75. /package/dist/{providers-CYEJZVXB.js.map → providers-TR3DUJZV.js.map} +0 -0
@@ -9828,7 +9828,7 @@ var enrichResearchRecords = (records, timebox, now = /* @__PURE__ */ new Date())
9828
9828
  return records.map((record) => toResearchRecord(record, timebox, now));
9829
9829
  };
9830
9830
 
9831
- // src/providers/inspiredesign-contract.ts
9831
+ // src/inspiredesign/contract.ts
9832
9832
  import { createHash as createHash3 } from "crypto";
9833
9833
 
9834
9834
  // skills/opendevbrowser-design-agent/assets/templates/canvas-generation-plan.design.v1.json
@@ -10155,7 +10155,7 @@ var INSPIREDESIGN_HANDOFF_RECOMMENDED_SKILLS = [
10155
10155
  formatSkillReference(INSPIREDESIGN_HANDOFF_SKILLS.designAgent)
10156
10156
  ];
10157
10157
  var INSPIREDESIGN_HANDOFF_GUIDANCE = {
10158
- reviewAdvancedBrief: `${INSPIREDESIGN_HANDOFF_FILES.advancedBrief} is the authoritative prompt route for the selected format, profile defaults, layout posture, motion grammar, and anti-patterns. Read it before touching Canvas or implementation files.`,
10158
+ reviewAdvancedBrief: `${INSPIREDESIGN_HANDOFF_FILES.advancedBrief} is the authoritative reference-first brief. When URL references exist, captured evidence leads the creative direction; selected format, profile defaults, layout posture, motion grammar, and anti-patterns are route guardrails only. Read it before touching Canvas or implementation files.`,
10159
10159
  prepareCanvasPlanRequest: `Fill canvasSessionId, leaseId, and documentId in ${INSPIREDESIGN_HANDOFF_FILES.canvasPlanRequest} before running ${INSPIREDESIGN_HANDOFF_COMMANDS.continueInCanvas}.`,
10160
10160
  deepCaptureRecommendation: "Any inspiredesign run with reference URLs already uses captureMode=deep. Rerun with the same URLs only when you need refreshed DOM/layout evidence, restored session state, or capture-specific debugging."
10161
10161
  };
@@ -10182,12 +10182,15 @@ var inspiredesign_advanced_brief_v1_default = {
10182
10182
  bestFor: [
10183
10183
  "product homepages",
10184
10184
  "docs homepages",
10185
+ "consulting service homepages",
10185
10186
  "launch pages",
10186
10187
  "rebrands"
10187
10188
  ],
10188
10189
  businessFocus: [
10189
10190
  "premium SaaS marketing",
10190
10191
  "product launches",
10192
+ "AI consulting services",
10193
+ "enterprise advisory landing pages",
10191
10194
  "docs-first brands",
10192
10195
  "brand refresh surfaces"
10193
10196
  ],
@@ -10199,6 +10202,11 @@ var inspiredesign_advanced_brief_v1_default = {
10199
10202
  "editorial",
10200
10203
  "hero",
10201
10204
  "marketing",
10205
+ "consulting",
10206
+ "advisory",
10207
+ "enterprise AI",
10208
+ "services",
10209
+ "case studies",
10202
10210
  "docs"
10203
10211
  ],
10204
10212
  matchSignals: {
@@ -10212,6 +10220,16 @@ var inspiredesign_advanced_brief_v1_default = {
10212
10220
  "editorial",
10213
10221
  "hero",
10214
10222
  "marketing",
10223
+ "consulting",
10224
+ "advisory",
10225
+ "ai consulting",
10226
+ "enterprise ai",
10227
+ "business services",
10228
+ "client services",
10229
+ "case studies",
10230
+ "transformation",
10231
+ "services",
10232
+ "cta",
10215
10233
  "docs"
10216
10234
  ],
10217
10235
  excluded: [
@@ -10219,7 +10237,7 @@ var inspiredesign_advanced_brief_v1_default = {
10219
10237
  "admin",
10220
10238
  "onboarding"
10221
10239
  ],
10222
- tieBreaker: 1
10240
+ tieBreaker: 2
10223
10241
  },
10224
10242
  lead: "Study the inspiration references and synthesize a premium editorial landing page system that translates the source brief into a reusable, brand-specific direction.",
10225
10243
  archetype: "editorial brand campaign",
@@ -10638,17 +10656,22 @@ var inspiredesign_advanced_brief_v1_default = {
10638
10656
  label: "Maison campaign world",
10639
10657
  bestFor: [
10640
10658
  "luxury fashion",
10659
+ "fashion design studios",
10641
10660
  "fragrance launches",
10642
10661
  "jewelry campaigns",
10643
10662
  "premium hospitality brands"
10644
10663
  ],
10645
10664
  businessFocus: [
10646
10665
  "fashion maisons",
10666
+ "fashion design studios",
10647
10667
  "luxury accessories",
10648
10668
  "fragrance campaigns",
10649
10669
  "high-end hospitality identity"
10650
10670
  ],
10651
10671
  keywords: [
10672
+ "fashion",
10673
+ "fashion design",
10674
+ "fashion studio",
10652
10675
  "maison",
10653
10676
  "atelier",
10654
10677
  "collection",
@@ -10660,6 +10683,9 @@ var inspiredesign_advanced_brief_v1_default = {
10660
10683
  ],
10661
10684
  matchSignals: {
10662
10685
  positive: [
10686
+ "fashion",
10687
+ "fashion design",
10688
+ "fashion studio",
10663
10689
  "maison",
10664
10690
  "atelier",
10665
10691
  "collection",
@@ -10904,7 +10930,7 @@ var inspiredesign_advanced_brief_v1_default = {
10904
10930
  },
10905
10931
  {
10906
10932
  id: "luminous-research-atlas",
10907
- label: "Luminous research atlas",
10933
+ label: "Luminous insight landing page",
10908
10934
  bestFor: [
10909
10935
  "AI labs",
10910
10936
  "think tanks",
@@ -10914,15 +10940,14 @@ var inspiredesign_advanced_brief_v1_default = {
10914
10940
  businessFocus: [
10915
10941
  "research organizations",
10916
10942
  "evidence-led storytelling",
10917
- "atlas and observatory products",
10918
- "methodology-rich publications"
10943
+ "insight-led public landing pages",
10944
+ "visual research narratives"
10919
10945
  ],
10920
10946
  keywords: [
10921
10947
  "atlas",
10922
10948
  "observatory",
10923
- "methodology",
10949
+ "insight",
10924
10950
  "evidence",
10925
- "report",
10926
10951
  "research",
10927
10952
  "index",
10928
10953
  "publication"
@@ -10931,9 +10956,8 @@ var inspiredesign_advanced_brief_v1_default = {
10931
10956
  positive: [
10932
10957
  "atlas",
10933
10958
  "observatory",
10934
- "methodology",
10959
+ "insight",
10935
10960
  "evidence",
10936
- "report",
10937
10961
  "research",
10938
10962
  "map",
10939
10963
  "model",
@@ -10943,37 +10967,43 @@ var inspiredesign_advanced_brief_v1_default = {
10943
10967
  excluded: [
10944
10968
  "checkout",
10945
10969
  "festival",
10946
- "villa"
10970
+ "villa",
10971
+ "consulting",
10972
+ "advisory",
10973
+ "bcg",
10974
+ "services",
10975
+ "landing page",
10976
+ "homepage"
10947
10977
  ],
10948
- tieBreaker: 3
10978
+ tieBreaker: 1
10949
10979
  },
10950
- lead: "Study the inspiration references and synthesize a luminous research atlas that turns evidence, methodology, and narrative into a premium, readable system.",
10951
- archetype: "annotated evidence atlas",
10952
- layoutArchetype: "bright scroll atlas with chaptered evidence bands and annotation rails",
10980
+ lead: "Study the inspiration references and synthesize a luminous insight landing page that turns research-backed ideas into a premium, text-light public story.",
10981
+ archetype: "luminous insight landing page",
10982
+ layoutArchetype: "full-bleed insight story with visual proof bands",
10953
10983
  typographySystem: "precise sans for data and narrative paired with restrained serif emphasis",
10954
- surfaceTreatment: "ivory research planes, layered evidence visuals, and quiet annotation rails",
10955
- shapeLanguage: "clean modules, chart frames, citation bars, and highlighted note rails",
10956
- componentGrammar: "evidence chapters, methodology blocks, chart plates, callout annotations, citation modules",
10957
- motionGrammar: "zoom-and-highlight transitions, subtle annotation reveals, and calm data emphasis",
10984
+ surfaceTreatment: "ivory research planes, layered evidence visuals, and generous image-led whitespace",
10985
+ shapeLanguage: "clean modules, visual proof frames, and quiet emphasis bands",
10986
+ componentGrammar: "hero composition, insight proof bands, visual story panels, outcome moments, restrained CTA groups",
10987
+ motionGrammar: "calm reveal transitions, proof-panel emphasis, and restrained visual depth",
10958
10988
  paletteIntent: "bright ivory base with measured accent coding for evidence groups",
10959
10989
  visualDensity: "balanced",
10960
10990
  designVariance: "structured expressiveness",
10961
10991
  focusAreas: [
10962
10992
  "evidence hierarchy",
10963
- "methodology framing",
10964
- "annotation rails",
10965
- "chart grammar",
10966
- "citation treatment",
10993
+ "insight framing",
10994
+ "visual proof bands",
10995
+ "chart restraint",
10996
+ "public story cadence",
10967
10997
  "scroll-story beats",
10968
10998
  "proof sequencing"
10969
10999
  ],
10970
11000
  responsiveCollapseRules: [
10971
- "Collapse annotation rails beneath the primary evidence block before reducing chart legibility.",
10972
- "Keep citations attached to the relevant section on mobile instead of moving them to a distant appendix treatment."
11001
+ "Collapse visual proof bands into a single readable story stack before reducing chart legibility.",
11002
+ "Keep evidence labels visually close to the relevant section without turning mobile into an appendix."
10973
11003
  ],
10974
11004
  guardrails: [
10975
- "Keep the surface bright, exact, and evidence-first rather than dashboard-like or cyber-styled.",
10976
- "Use motion only to clarify how the user should read charts, maps, and methodology layers."
11005
+ "Keep the surface bright, exact, and evidence-led without becoming a documentation hub.",
11006
+ "Use motion to clarify priority, proof, and action rather than to explain long-form methodology."
10977
11007
  ],
10978
11008
  antiPatterns: [
10979
11009
  "No cyber glow.",
@@ -10982,14 +11012,14 @@ var inspiredesign_advanced_brief_v1_default = {
10982
11012
  "No unexplained iconography."
10983
11013
  ],
10984
11014
  deliverables: [
10985
- "Define the evidence hierarchy, chart grammar, annotation system, citation treatment, and scroll-story beats.",
10986
- "Return a premium research contract detailed enough for publication surfaces and Canvas-ready implementation."
11015
+ "Define the evidence hierarchy, visual proof rhythm, insight story cadence, and conversion path.",
11016
+ "Return a premium insight landing contract detailed enough for a visually led Canvas-ready implementation."
10987
11017
  ],
10988
11018
  route: {
10989
- profile: "documentation",
11019
+ profile: "product-story",
10990
11020
  themeStrategy: "single-theme",
10991
- navigationModel: "contextual",
10992
- layoutApproach: "annotated-atlas-scroll"
11021
+ navigationModel: "global-header",
11022
+ layoutApproach: "insight-led-landing-page"
10993
11023
  }
10994
11024
  },
10995
11025
  {
@@ -11304,7 +11334,13 @@ var inspiredesign_advanced_brief_v1_default = {
11304
11334
  excluded: [
11305
11335
  "villa",
11306
11336
  "festival",
11307
- "fragrance"
11337
+ "fragrance",
11338
+ "fashion",
11339
+ "fashion design",
11340
+ "maison",
11341
+ "couture",
11342
+ "collection",
11343
+ "campaign"
11308
11344
  ],
11309
11345
  tieBreaker: 3
11310
11346
  },
@@ -11537,6 +11573,8 @@ var inspiredesign_advanced_brief_v1_default = {
11537
11573
  // src/inspiredesign/brief-expansion.ts
11538
11574
  var BRIEF_TEMPLATE = inspiredesign_advanced_brief_v1_default;
11539
11575
  var INSPIREDESIGN_BRIEF_TEMPLATE_VERSION = BRIEF_TEMPLATE.version;
11576
+ var INSPIREDESIGN_BRIEF_COMMON_RULES = [...BRIEF_TEMPLATE.commonRules];
11577
+ var INSPIREDESIGN_BRIEF_OUTPUT_REQUIREMENTS = [...BRIEF_TEMPLATE.outputRequirements];
11540
11578
  var normalizeInspiredesignBriefText = (value) => value.trim().replace(/\s+/g, " ");
11541
11579
  var formatBulletList = (items) => items.map((item) => `- ${item}`).join("\n");
11542
11580
  var countMatches = (brief, keywords) => {
@@ -11546,6 +11584,20 @@ var countMatches = (brief, keywords) => {
11546
11584
  0
11547
11585
  );
11548
11586
  };
11587
+ var escapeRegExp2 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
11588
+ var removeNegativeSignal = (brief, keyword) => {
11589
+ const escaped = escapeRegExp2(keyword.toLowerCase());
11590
+ const modifiers = "(?:[a-z0-9-]+\\s+){0,3}";
11591
+ return brief.replace(new RegExp(`\\b(?:not|no|without|avoid|exclude|excluding)\\s+(?:an?\\s+|the\\s+)?${modifiers}${escaped}\\b(?:\\s+[a-z0-9-]+){0,2}`, "g"), " ").replace(new RegExp(`\\b${escaped}\\s+(?:is\\s+)?(?:not|excluded|forbidden)\\b`, "g"), " ");
11592
+ };
11593
+ var positiveSignalText = (brief, formats) => {
11594
+ const keywords = formats.flatMap((format) => [
11595
+ ...format.matchSignals.positive,
11596
+ ...format.matchSignals.required ?? [],
11597
+ ...format.matchSignals.excluded ?? []
11598
+ ]);
11599
+ return [...new Set(keywords)].reduce(removeNegativeSignal, brief.toLowerCase());
11600
+ };
11549
11601
  var cloneStringList = (items) => [...items];
11550
11602
  var cloneRoute = (route) => ({
11551
11603
  profile: route.profile,
@@ -11569,6 +11621,7 @@ var cloneInspiredesignBriefFormat = (format) => ({
11569
11621
  paletteIntent: format.paletteIntent,
11570
11622
  visualDensity: format.visualDensity,
11571
11623
  designVariance: format.designVariance,
11624
+ focusAreas: cloneStringList(format.focusAreas ?? []),
11572
11625
  responsiveCollapseRules: cloneStringList(format.responsiveCollapseRules),
11573
11626
  guardrails: cloneStringList(format.guardrails),
11574
11627
  antiPatterns: cloneStringList(format.antiPatterns),
@@ -11591,6 +11644,7 @@ var summarizeFormat = (format) => ({
11591
11644
  paletteIntent: format.paletteIntent,
11592
11645
  visualDensity: format.visualDensity,
11593
11646
  designVariance: format.designVariance,
11647
+ focusAreas: cloneStringList(format.focusAreas),
11594
11648
  responsiveCollapseRules: cloneStringList(format.responsiveCollapseRules),
11595
11649
  guardrails: cloneStringList(format.guardrails),
11596
11650
  antiPatterns: cloneStringList(format.antiPatterns),
@@ -11611,12 +11665,13 @@ var findFormatById = (formatId) => {
11611
11665
  return BRIEF_TEMPLATE.formats.find((format) => format.id === formatId);
11612
11666
  };
11613
11667
  var scoreFormat = (sourceBrief, format) => {
11614
- const requiredMatches = countMatches(sourceBrief, format.matchSignals.required ?? []);
11668
+ const brief = positiveSignalText(sourceBrief, BRIEF_TEMPLATE.formats);
11669
+ const requiredMatches = countMatches(brief, format.matchSignals.required ?? []);
11615
11670
  if ((format.matchSignals.required?.length ?? 0) > 0 && requiredMatches === 0) {
11616
11671
  return Number.NEGATIVE_INFINITY;
11617
11672
  }
11618
- const excludedMatches = countMatches(sourceBrief, format.matchSignals.excluded ?? []);
11619
- const positiveMatches = countMatches(sourceBrief, format.matchSignals.positive);
11673
+ const excludedMatches = countMatches(brief, format.matchSignals.excluded ?? []);
11674
+ const positiveMatches = countMatches(brief, format.matchSignals.positive);
11620
11675
  return positiveMatches * 4 + requiredMatches * 6 - excludedMatches * 8 + (format.matchSignals.tieBreaker ?? 0);
11621
11676
  };
11622
11677
  var chooseFormat = (sourceBrief) => {
@@ -11706,7 +11761,379 @@ var expandInspiredesignBrief = (brief, preferredFormatId) => {
11706
11761
  };
11707
11762
  };
11708
11763
 
11709
- // src/providers/inspiredesign-contract.ts
11764
+ // src/inspiredesign/reference-pattern-board.ts
11765
+ var SIGNAL_LIMIT = 5;
11766
+ var SIGNAL_CLIP = 180;
11767
+ var PATTERN_LIMIT = 6;
11768
+ var trimText = (value) => value.trim().replace(/\s+/g, " ");
11769
+ var clipText = (value, maxLength) => {
11770
+ if (value.length <= maxLength) return value;
11771
+ return `${value.slice(0, Math.max(0, maxLength - 3)).trimEnd()}...`;
11772
+ };
11773
+ var textFromHtml = (html) => {
11774
+ return html ? trimText(html.replace(/<[^>]+>/g, " ")) : void 0;
11775
+ };
11776
+ var stripActionRefs = (value) => value.replace(/\[r\d+\]\s+(?:link|button|combobox|textbox|option)\s+/gi, "").replace(/\[r\d+\]\s+/gi, "").replace(/\bvalue=/gi, "");
11777
+ var isCodeOrCssPreview = (value) => {
11778
+ const lower = value.toLowerCase();
11779
+ return lower.includes("dangerouslysetinnerhtml") || lower.includes("opendevbrowser-root") || lower.includes("align-content:") || lower.startsWith("import ") || /^[.#][a-z0-9_-]+\s*\{/.test(lower) || lower.includes("{") && /[a-z-]+:\s*[^;]+;/.test(lower);
11780
+ };
11781
+ var cleanEvidenceText = (value) => {
11782
+ return trimText(stripActionRefs(value).replace(/[{};]/g, " "));
11783
+ };
11784
+ var DIAGNOSTIC_TEXT_MARKERS = [
11785
+ "authentication required",
11786
+ "sign in",
11787
+ "login required",
11788
+ "challenge page",
11789
+ "access denied",
11790
+ "browser capture unavailable",
11791
+ "javascript required",
11792
+ "javascript is required",
11793
+ "captcha",
11794
+ "verification challenge",
11795
+ "enable cookies",
11796
+ "checking if the site connection is secure",
11797
+ "complete the verification",
11798
+ "blocked reference"
11799
+ ];
11800
+ var PUBLIC_LANDING_TEXT_MARKERS = [
11801
+ "church",
11802
+ "landing page",
11803
+ "homepage",
11804
+ "home page",
11805
+ "consulting",
11806
+ "advisory",
11807
+ "bcg",
11808
+ "ai consulting",
11809
+ "enterprise ai",
11810
+ "transformation",
11811
+ "client services",
11812
+ "business services",
11813
+ "case studies",
11814
+ "clients",
11815
+ "industries",
11816
+ "worship",
11817
+ "locations",
11818
+ "gallery",
11819
+ "atelier",
11820
+ "fashion"
11821
+ ];
11822
+ var PUBLIC_LANDING_SUPPORT_MARKERS = [
11823
+ "online",
11824
+ "events",
11825
+ "studio",
11826
+ "website",
11827
+ "full-bleed",
11828
+ "hero",
11829
+ "story",
11830
+ "stories",
11831
+ "services",
11832
+ "service",
11833
+ "cta"
11834
+ ];
11835
+ var isDiagnosticText = (value) => {
11836
+ const lower = value.toLowerCase();
11837
+ return DIAGNOSTIC_TEXT_MARKERS.some((marker) => lower.includes(marker));
11838
+ };
11839
+ var hasPublicLandingSignal = (value) => {
11840
+ const lower = value.toLowerCase();
11841
+ const strongCount = PUBLIC_LANDING_TEXT_MARKERS.filter((marker) => lower.includes(marker)).length;
11842
+ const supportCount = PUBLIC_LANDING_SUPPORT_MARKERS.filter((marker) => lower.includes(marker)).length;
11843
+ const visualLandingCombo = lower.includes("hero") && (lower.includes("full-bleed") || lower.includes("cta") || lower.includes("website"));
11844
+ return visualLandingCombo || strongCount >= 2 || strongCount >= 1 && strongCount + supportCount >= 2;
11845
+ };
11846
+ var pushSignal = (signals, value) => {
11847
+ if (!value || isCodeOrCssPreview(value)) return;
11848
+ const text = cleanEvidenceText(value);
11849
+ if (isCodeOrCssPreview(text) || isDiagnosticText(text)) return;
11850
+ if (text.length > 0 && !signals.includes(text)) {
11851
+ signals.push(text);
11852
+ }
11853
+ };
11854
+ var getInspiredesignReferenceSignals = (reference) => {
11855
+ const signals = [];
11856
+ pushSignal(signals, reference.title);
11857
+ pushSignal(signals, reference.excerpt);
11858
+ pushSignal(signals, reference.capture?.title);
11859
+ pushSignal(signals, reference.capture?.snapshot?.content);
11860
+ pushSignal(signals, textFromHtml(reference.capture?.clone?.componentPreview));
11861
+ pushSignal(signals, reference.capture?.clone?.cssPreview);
11862
+ pushSignal(signals, textFromHtml(reference.capture?.dom?.outerHTML));
11863
+ return signals.map((signal) => clipText(signal, SIGNAL_CLIP)).slice(0, SIGNAL_LIMIT);
11864
+ };
11865
+ var hasCleanSignal = (value) => {
11866
+ if (!value || isCodeOrCssPreview(value)) return false;
11867
+ const text = cleanEvidenceText(value);
11868
+ return text.length > 0 && !isCodeOrCssPreview(text) && !isDiagnosticText(text);
11869
+ };
11870
+ var hasUsableCloneCreativeEvidence = (reference) => hasCleanSignal(reference.capture?.clone?.componentPreview);
11871
+ var hasUsableCaptureEvidence = (reference) => hasCleanSignal(reference.capture?.snapshot?.content) || hasUsableCloneCreativeEvidence(reference) || hasCleanSignal(textFromHtml(reference.capture?.dom?.outerHTML));
11872
+ var hasInspiredesignUsableReferenceEvidence = (reference) => {
11873
+ if (reference.captureStatus === "captured" && hasUsableCaptureEvidence(reference)) return true;
11874
+ return reference.fetchStatus === "captured" && (hasCleanSignal(reference.title) || hasCleanSignal(reference.excerpt));
11875
+ };
11876
+ var firstSignal = (reference) => {
11877
+ const preferred = [
11878
+ reference.capture?.title,
11879
+ reference.capture?.snapshot?.content,
11880
+ textFromHtml(reference.capture?.clone?.componentPreview),
11881
+ textFromHtml(reference.capture?.dom?.outerHTML),
11882
+ reference.excerpt,
11883
+ reference.title
11884
+ ].map((value) => value ? cleanEvidenceText(value) : "").find((value) => value.length > 0 && !isCodeOrCssPreview(value) && !isDiagnosticText(value));
11885
+ return preferred ? clipText(preferred, SIGNAL_CLIP) : reference.url;
11886
+ };
11887
+ var REFERENCE_PATTERN_RULES = [
11888
+ {
11889
+ summary: "location-first church discovery with regional pathways",
11890
+ matches: ["find a church", "church locations", "location", "city or postcode", "current location"]
11891
+ },
11892
+ {
11893
+ summary: "worship and music content as atmosphere and ministry proof",
11894
+ matches: ["music", "worship", "united", "young & free", "chapel", "instrumentals"]
11895
+ },
11896
+ {
11897
+ summary: "global region navigation with online participation path",
11898
+ matches: ["asia pacific", "europe", "north america", "latin america", "africa", "middle east", "online"]
11899
+ },
11900
+ {
11901
+ summary: "story-led editorial pathway after the primary church action",
11902
+ matches: ["stories", "blog", "start reading", "newsroom"]
11903
+ },
11904
+ {
11905
+ summary: "ministry ecosystem pathways for college, conferences, and events",
11906
+ matches: ["college", "conference", "tours", "events"]
11907
+ },
11908
+ {
11909
+ summary: "multilingual/global audience affordance",
11910
+ matches: ["language", '"en"', '"fr"', '"es"', '"pt"', '"de"']
11911
+ },
11912
+ {
11913
+ summary: "full-bleed hero with restrained CTA rail",
11914
+ matches: ["full-bleed", "hero", "cta rail", "primary cta"]
11915
+ },
11916
+ {
11917
+ summary: "premium consulting public landing page with service narrative, client proof, and conversion CTAs",
11918
+ matches: ["consulting", "advisory", "bcg", "enterprise ai", "transformation", "client services", "case studies", "industries"]
11919
+ }
11920
+ ];
11921
+ var ruleMatches = (text, rule) => {
11922
+ const lower = text.toLowerCase();
11923
+ return rule.matches.some((match) => lower.includes(match));
11924
+ };
11925
+ var derivePatternSummaries = (signals, fallback) => {
11926
+ const text = signals.join(" ");
11927
+ const matches = REFERENCE_PATTERN_RULES.filter((rule) => ruleMatches(text, rule)).map((rule) => rule.summary);
11928
+ return matches.length > 0 ? matches.slice(0, PATTERN_LIMIT) : [fallback];
11929
+ };
11930
+ var appendSourceDetail = (patterns, primarySignal) => {
11931
+ if (patterns.some((pattern) => primarySignal.toLowerCase().includes(pattern.toLowerCase()))) {
11932
+ return patterns;
11933
+ }
11934
+ return [...patterns, `source detail: ${primarySignal}`].slice(0, PATTERN_LIMIT);
11935
+ };
11936
+ var deriveCapturedVia = (reference) => {
11937
+ const methods = [];
11938
+ if (reference.fetchStatus === "captured") methods.push("fetch");
11939
+ if (reference.capture?.snapshot?.content.trim()) methods.push("snapshot");
11940
+ if (hasUsableCloneCreativeEvidence(reference)) {
11941
+ methods.push("clone");
11942
+ }
11943
+ if (reference.capture?.dom?.outerHTML.trim()) methods.push("dom");
11944
+ return methods;
11945
+ };
11946
+ var deriveComponentFamilies = (format, patterns, isPublicLanding) => {
11947
+ const base = isPublicLanding ? "hero composition, proof bands, narrative pathways, service or story sections, conversion CTA, and footer" : format.componentGrammar;
11948
+ return [base, ...patterns.slice(0, 3)];
11949
+ };
11950
+ var hasReferencePublicLandingEvidence = (reference) => {
11951
+ const text = [
11952
+ reference.surfaceType,
11953
+ reference.layoutRecipe,
11954
+ ...reference.contentHierarchy,
11955
+ ...reference.patternsToBorrow
11956
+ ].join(" ");
11957
+ return hasPublicLandingSignal(text);
11958
+ };
11959
+ var hasBoardPublicLandingEvidence = (board) => board.references.some(hasReferencePublicLandingEvidence);
11960
+ var boardEvidenceText = (board) => board.references.map((reference) => [
11961
+ reference.layoutRecipe,
11962
+ ...reference.contentHierarchy,
11963
+ ...reference.componentFamilies,
11964
+ ...reference.motionPosture,
11965
+ ...reference.patternsToBorrow
11966
+ ].join(" ")).join(" ").toLowerCase();
11967
+ var hasEvidenceCue = (text, matches) => matches.some((match) => text.includes(match));
11968
+ var deriveReferenceEntry = (reference, format) => {
11969
+ const signals = getInspiredesignReferenceSignals(reference);
11970
+ const primarySignal = firstSignal(reference);
11971
+ const patterns = appendSourceDetail(derivePatternSummaries(signals, primarySignal), primarySignal);
11972
+ const isPublicLanding = signals.some(hasPublicLandingSignal);
11973
+ return {
11974
+ id: reference.id,
11975
+ name: reference.title ?? reference.url,
11976
+ url: reference.url,
11977
+ surfaceType: isPublicLanding ? "public landing page" : format.archetype,
11978
+ capturedVia: deriveCapturedVia(reference),
11979
+ layoutRecipe: patterns.join("; "),
11980
+ contentHierarchy: patterns.slice(0, 4),
11981
+ componentFamilies: deriveComponentFamilies(format, patterns, isPublicLanding),
11982
+ motionPosture: [format.motionGrammar, "Plan hero reveal, scroll reveal, CTA feedback, and reduced-motion behavior."],
11983
+ tokenNotes: [format.paletteIntent, format.typographySystem, format.surfaceTreatment],
11984
+ patternsToBorrow: [...patterns, ...signals.slice(0, 2)].slice(0, PATTERN_LIMIT),
11985
+ patternsToReject: [...format.antiPatterns],
11986
+ whyItWorks: reference.captureStatus === "captured" ? "Captured reference evidence provides reusable hierarchy, rhythm, and component cues." : "Available reference text provides directional content and hierarchy cues."
11987
+ };
11988
+ };
11989
+ var buildInspiredesignReferencePatternBoard = (briefId, format, references) => {
11990
+ const entries = references.filter(hasInspiredesignUsableReferenceEvidence).map((reference) => deriveReferenceEntry(reference, format));
11991
+ const sharedStrengths = entries.flatMap((entry) => entry.patternsToBorrow).slice(0, 6);
11992
+ const targetSurface = entries.some((entry) => entry.surfaceType === "public landing page") ? "reference-led public landing page" : format.layoutArchetype;
11993
+ return {
11994
+ briefId,
11995
+ targetSurface,
11996
+ references: entries,
11997
+ synthesis: {
11998
+ dominantDirection: entries[0]?.layoutRecipe ?? format.archetype,
11999
+ sharedStrengths,
12000
+ sharedFailuresToAvoid: [...format.antiPatterns],
12001
+ contractDeltas: [
12002
+ "Selected prompt format supplies route defaults and guardrails, not the creative source of truth.",
12003
+ "Use captured reference hierarchy before generic profile defaults when URL evidence exists."
12004
+ ]
12005
+ }
12006
+ };
12007
+ };
12008
+ var buildInteractionDensity = (format, board) => {
12009
+ if (hasBoardPublicLandingEvidence(board)) {
12010
+ return "low-to-medium; prioritize confident public-page CTAs over app-shell controls.";
12011
+ }
12012
+ if (format.route.navigationModel === "sidebar") {
12013
+ return "medium-to-high; prioritize command surfaces, state clarity, and durable workspace controls.";
12014
+ }
12015
+ if (format.route.profile === "documentation") {
12016
+ return "low-to-medium; prioritize visual overview, proof scanning, and a small number of clear action paths.";
12017
+ }
12018
+ if (format.route.profile === "auth-focused") {
12019
+ return "low; prioritize one confident first action with clear feedback and trust cues.";
12020
+ }
12021
+ return "low-to-medium; prioritize confident public-page CTAs over app-shell controls.";
12022
+ };
12023
+ var buildImageryPosture = (format, board) => {
12024
+ if (hasBoardPublicLandingEvidence(board)) {
12025
+ return [format.surfaceTreatment, "Use dominant atmospheric imagery as the visual anchor."];
12026
+ }
12027
+ if (format.route.navigationModel === "sidebar") {
12028
+ return [format.surfaceTreatment, "Use product state, data hierarchy, and workspace continuity as the visual anchor."];
12029
+ }
12030
+ return [format.surfaceTreatment, "Use dominant atmospheric imagery as the visual anchor."];
12031
+ };
12032
+ var buildInteractionMoments = (format, board) => {
12033
+ const evidenceText = boardEvidenceText(board);
12034
+ const publicLanding = hasBoardPublicLandingEvidence(board);
12035
+ const referenceBacked = board.references.length > 0;
12036
+ const cursorScope = publicLanding ? "hero CTA, media reveals, and primary navigation moments" : "high-value actions and selected command surfaces";
12037
+ const moments = [
12038
+ "Microinteractions: define hover effects, visible focus rings, pressed states, loading states, and confirmation feedback for every primary action.",
12039
+ `Animation choreography: sequence ${format.motionGrammar}, hover feedback, active feedback, and page transitions through one timing system.`
12040
+ ];
12041
+ const cursorBacked = hasEvidenceCue(evidenceText, ["cursor", "magnetic", "follow-cursor", "pointer"]);
12042
+ const cursorPolicy = cursorBacked ? `Cursor effects: reference evidence supports premium pointer affordances for ${cursorScope}; keep default cursor behavior for reading surfaces.` : `Cursor effects policy: consider magnetic or follow-cursor affordances only when reference evidence supports ${cursorScope}.`;
12043
+ return referenceBacked ? [...moments, cursorPolicy] : moments;
12044
+ };
12045
+ var buildMaterialEffects = (board) => {
12046
+ if (board.references.length === 0) {
12047
+ return [
12048
+ "Material effects: define elevation, shadows, surface contrast, and reduced-motion-safe depth from the brief.",
12049
+ "Reduced-motion material fallback: preserve hierarchy and CTA clarity without transform-based depth."
12050
+ ];
12051
+ }
12052
+ const evidenceText = boardEvidenceText(board);
12053
+ const publicLanding = hasBoardPublicLandingEvidence(board);
12054
+ const glassScope = publicLanding ? "navigation overlays, hero scrims, and atmospheric CTA surfaces" : "focused overlays, inspectors, or state containers";
12055
+ const parallaxBacked = hasEvidenceCue(evidenceText, ["parallax", "depth", "layered", "immersive", "full-bleed"]);
12056
+ const glassBacked = hasEvidenceCue(evidenceText, ["glass", "frosted", "blur", "translucent", "scrim", "overlay"]);
12057
+ const parallax = parallaxBacked ? "Depth language: reference evidence supports restrained parallax, layered shadows, and atmospheric depth where it reinforces hierarchy." : "Depth language policy: use parallax only when reference evidence supports layered depth; otherwise use spacing, scale, and shadow hierarchy.";
12058
+ const glass = glassBacked ? `Glassmorphism/translucency: reference evidence supports frosted or translucent surfaces for ${glassScope}; never use glass as generic decoration.` : `Glassmorphism/translucency policy: use frosted or translucent surfaces only when reference evidence supports ${glassScope}.`;
12059
+ return [
12060
+ parallax,
12061
+ glass,
12062
+ "Reduced-motion material fallback: remove parallax and cursor-follow transforms while preserving hierarchy, depth, and CTA clarity."
12063
+ ];
12064
+ };
12065
+ var buildSectionArchitecture = (format, board) => {
12066
+ if (hasBoardPublicLandingEvidence(board)) {
12067
+ return [
12068
+ "Use 8 to 12 primary landing-page sections unless the user explicitly asks for a microsite.",
12069
+ "Build a clear sequence from hero, proof, story, service pathways, impact, conversion CTA, and footer."
12070
+ ];
12071
+ }
12072
+ if (format.route.profile === "documentation") {
12073
+ return [
12074
+ "Use a text-light overview sequence for purpose, proof, examples, action paths, and footer.",
12075
+ "Keep long-form reference depth, citation modules, annotation rails, and methodology blocks out of the primary visual route."
12076
+ ];
12077
+ }
12078
+ if (format.route.profile === "auth-focused") {
12079
+ return [
12080
+ "Use a screen sequence for value, trust, input, confirmation, and first-action transition.",
12081
+ "Keep the flow compact instead of expanding into marketing section sprawl."
12082
+ ];
12083
+ }
12084
+ if (format.route.navigationModel === "immersive") {
12085
+ return [
12086
+ "Use cinematic scene beats for hero, product reveal, proof, detail, and decisive CTA.",
12087
+ "Keep each scroll beat focused on one visual idea."
12088
+ ];
12089
+ }
12090
+ if (format.route.navigationModel === "sidebar") {
12091
+ return [
12092
+ "Use workspace shell zones for navigation, command surfaces, primary work area, detail panels, and state feedback.",
12093
+ "Prioritize task continuity over marketing-section cadence."
12094
+ ];
12095
+ }
12096
+ return [
12097
+ "Use 8 to 12 primary landing-page sections unless the user explicitly asks for a microsite.",
12098
+ "Build a clear sequence from hero, proof, story, service pathways, impact, conversion CTA, and footer."
12099
+ ];
12100
+ };
12101
+ var buildInspiredesignDesignVectors = (format, board) => {
12102
+ const influence = board.synthesis.sharedStrengths.length > 0 ? board.synthesis.sharedStrengths : [format.archetype];
12103
+ const publicLandingEvidence = hasBoardPublicLandingEvidence(board);
12104
+ const surfaceIntent = publicLandingEvidence ? "reference-led public landing page" : format.archetype;
12105
+ const compositionModel = publicLandingEvidence ? ["full-bleed hero with narrative section cadence", ...board.references.map((entry) => entry.layoutRecipe)] : [format.layoutArchetype, ...board.references.map((entry) => entry.layoutRecipe)];
12106
+ return {
12107
+ sourcePriority: board.references.length > 0 ? "reference-evidence-first" : "brief-only",
12108
+ directionLabel: board.synthesis.dominantDirection,
12109
+ surfaceIntent,
12110
+ compositionModel: compositionModel.slice(0, 5),
12111
+ premiumPosture: [
12112
+ "premium visual hierarchy, refined spacing, and editorial image treatment.",
12113
+ "Premium typography, spacing, visual hierarchy, palette, and image treatment must lead the page.",
12114
+ format.surfaceTreatment,
12115
+ format.paletteIntent
12116
+ ],
12117
+ motionPosture: [
12118
+ "Use a hero entrance reveal, section scroll reveal, and CTA/focus feedback.",
12119
+ "Respect reduced-motion preference with static hierarchy preserved.",
12120
+ format.motionGrammar
12121
+ ],
12122
+ sectionArchitecture: buildSectionArchitecture(format, board),
12123
+ typographyPosture: [format.typographySystem],
12124
+ imageryPosture: buildImageryPosture(format, board),
12125
+ interactionDensity: buildInteractionDensity(format, board),
12126
+ interactionMoments: buildInteractionMoments(format, board),
12127
+ materialEffects: buildMaterialEffects(board),
12128
+ referenceInfluence: influence,
12129
+ patternsToBorrow: board.references.flatMap((entry) => entry.patternsToBorrow).slice(0, 8),
12130
+ patternsToReject: board.references.flatMap((entry) => entry.patternsToReject).slice(0, 8),
12131
+ guardrails: [...format.guardrails],
12132
+ antiPatterns: [...format.antiPatterns]
12133
+ };
12134
+ };
12135
+
12136
+ // src/inspiredesign/contract.ts
11710
12137
  var INSPIREDESIGN_CAPTURE_ATTEMPT_KEYS = ["snapshot", "clone", "dom"];
11711
12138
  var MALFORMED_CAPTURE_ATTEMPT_DETAIL = "Capture attempt metadata missing or malformed.";
11712
12139
  var NORMALIZED_CAPTURE_ATTEMPT_DETAIL = "Captured artifact was empty after normalization.";
@@ -12012,15 +12439,15 @@ var PROFILE_CONFIG = {
12012
12439
  }
12013
12440
  },
12014
12441
  "documentation": {
12015
- direction: "reference-first documentation",
12016
- visualPersonality: "legible, calm, highly structured",
12017
- brandTone: "expert and accessible",
12018
- hierarchyPrinciples: ["Make scanning effortless.", "Keep code, steps, and warnings visually distinct."],
12019
- interactionPhilosophy: "Light motion, sticky wayfinding, strong anchor visibility.",
12442
+ direction: "text-light knowledge story",
12443
+ visualPersonality: "legible, calm, visually led",
12444
+ brandTone: "expert, concise, and accessible",
12445
+ hierarchyPrinciples: ["Make scanning effortless.", "Use visual proof before long explanatory text."],
12446
+ interactionPhilosophy: "Light motion, clear wayfinding, strong anchor visibility.",
12020
12447
  navigationModel: "sidebar",
12021
- layoutApproach: "docs-shell",
12022
- pagePatterns: ["Docs shell", "Procedure section", "Reference table block"],
12023
- componentSequence: ["Sidebar", "Search", "Anchored headings", "Code blocks", "Callouts"],
12448
+ layoutApproach: "knowledge-story-shell",
12449
+ pagePatterns: ["Insight overview", "Visual proof band", "Action path"],
12450
+ componentSequence: ["Navigation", "Search", "Anchored headings", "Proof bands", "Callouts"],
12024
12451
  colors: {
12025
12452
  primary: "#1D4ED8",
12026
12453
  accent: "#0F766E",
@@ -12036,37 +12463,198 @@ var PROFILE_CONFIG = {
12036
12463
  }
12037
12464
  }
12038
12465
  };
12039
- var trimText = (value) => {
12466
+ var trimText2 = (value) => {
12040
12467
  return value.trim().replace(/\s+/g, " ");
12041
12468
  };
12042
- var clipText = (value, maxLength) => {
12469
+ var clipText2 = (value, maxLength) => {
12043
12470
  if (value.length <= maxLength) return value;
12044
12471
  return `${value.slice(0, Math.max(0, maxLength - 3)).trimEnd()}...`;
12045
12472
  };
12473
+ var REFERENCE_SUMMARY_CLIP_LENGTH = 220;
12474
+ var GENERATION_PLAN_REFERENCE_CLIP_LENGTH = 600;
12475
+ var buildReferenceSynthesis = (references) => {
12476
+ const lines = references.filter(hasInspiredesignUsableReferenceEvidence).map((reference, index) => {
12477
+ const signals = getInspiredesignReferenceSignals(reference);
12478
+ if (signals.length === 0) return "";
12479
+ return `Source ${index + 1} ${reference.title ?? reference.url}: ${signals.join(" | ")}`;
12480
+ }).filter((line) => line.length > 0);
12481
+ return {
12482
+ lines,
12483
+ summary: lines.length > 0 ? lines.map((line) => clipText2(line, REFERENCE_SUMMARY_CLIP_LENGTH)).join(" ") : "No live reference cues were captured."
12484
+ };
12485
+ };
12486
+ var renderReferenceFirstAdvancedBrief = (briefExpansion, board, vectors, references) => {
12487
+ if (board.references.length === 0) {
12488
+ if (references.length > 0) {
12489
+ return [
12490
+ "Reference evidence unavailable:",
12491
+ "URL references were attempted, but no usable creative evidence was captured. Treat this as a capture gap, not a design direction.",
12492
+ "",
12493
+ formatBulletList2(references.map((reference) => renderUnavailableReference(reference))),
12494
+ "",
12495
+ briefExpansion.advancedBrief
12496
+ ].join("\n");
12497
+ }
12498
+ return briefExpansion.advancedBrief;
12499
+ }
12500
+ return [
12501
+ "Reference pattern board:",
12502
+ "URL reference evidence is the creative source of truth when references are supplied.",
12503
+ "",
12504
+ "Reference evidence analysis:",
12505
+ formatBulletList2(board.references.map((reference) => `${reference.name}: ${reference.layoutRecipe}`)),
12506
+ "",
12507
+ "Design vectors:",
12508
+ formatBulletList2([
12509
+ `directionLabel: ${vectors.directionLabel}`,
12510
+ `surfaceIntent: ${vectors.surfaceIntent}`,
12511
+ `premiumPosture: ${vectors.premiumPosture.join(" ")}`,
12512
+ `motionPosture: ${vectors.motionPosture.join(" ")}`,
12513
+ `sectionArchitecture: ${vectors.sectionArchitecture.join(" ")}`,
12514
+ `interactionMoments: ${vectors.interactionMoments.join(" ")}`,
12515
+ `materialEffects: ${vectors.materialEffects.join(" ")}`
12516
+ ]),
12517
+ "",
12518
+ "Fixed format guardrails:",
12519
+ "Selected prompt format supplies route defaults and guardrails, not the creative source of truth.",
12520
+ "",
12521
+ briefExpansion.advancedBrief
12522
+ ].join("\n");
12523
+ };
12524
+ var renderEvidenceDerivedAdvancedBrief = (briefExpansion, format) => [
12525
+ `Selected prompt format: ${format.label}`,
12526
+ "",
12527
+ "Source brief:",
12528
+ briefExpansion.sourceBrief,
12529
+ "",
12530
+ "Prompt objective:",
12531
+ `Use the reference evidence and source brief to define a ${format.archetype}.`,
12532
+ "",
12533
+ "Business focus:",
12534
+ formatBulletList2(format.businessFocus),
12535
+ "",
12536
+ "Keywords:",
12537
+ formatBulletList2(format.keywords),
12538
+ "",
12539
+ "Route defaults:",
12540
+ formatBulletList2([
12541
+ `profile: ${format.route.profile}`,
12542
+ `theme strategy: ${format.route.themeStrategy}`,
12543
+ `navigation model: ${format.route.navigationModel}`,
12544
+ `layout approach: ${format.route.layoutApproach}`
12545
+ ]),
12546
+ "",
12547
+ "Design direction:",
12548
+ formatBulletList2([
12549
+ `archetype: ${format.archetype}`,
12550
+ `layout archetype: ${format.layoutArchetype}`,
12551
+ `typography system: ${format.typographySystem}`,
12552
+ `surface treatment: ${format.surfaceTreatment}`,
12553
+ `shape language: ${format.shapeLanguage}`,
12554
+ `component grammar: ${format.componentGrammar}`,
12555
+ `motion grammar: ${format.motionGrammar}`,
12556
+ `palette intent: ${format.paletteIntent}`,
12557
+ `visual density: ${format.visualDensity}`,
12558
+ `design variance: ${format.designVariance}`
12559
+ ]),
12560
+ "",
12561
+ "Responsive collapse rules:",
12562
+ formatBulletList2(format.responsiveCollapseRules),
12563
+ "",
12564
+ "Focus areas:",
12565
+ formatBulletList2(format.focusAreas ?? []),
12566
+ "",
12567
+ "Execution rules:",
12568
+ formatBulletList2([...INSPIREDESIGN_BRIEF_COMMON_RULES, ...format.guardrails]),
12569
+ "",
12570
+ "Anti-patterns:",
12571
+ formatBulletList2(format.antiPatterns),
12572
+ "",
12573
+ "Return:",
12574
+ formatBulletList2([...INSPIREDESIGN_BRIEF_OUTPUT_REQUIREMENTS, ...format.deliverables]),
12575
+ "",
12576
+ "Best fit use cases:",
12577
+ formatBulletList2(format.bestFor)
12578
+ ].join("\n");
12579
+ var renderUnavailableReference = (reference) => {
12580
+ const reason = reference.fetchFailure ?? reference.captureFailure ?? "no usable creative evidence captured";
12581
+ return `${reference.url}: fetch=${reference.fetchStatus}, capture=${reference.captureStatus}, reason=${clipText2(reason, 160)}`;
12582
+ };
12046
12583
  var cloneTemplate = (value) => structuredClone(value);
12047
12584
  var referenceFingerprint = (value) => {
12048
12585
  return createHash3("sha256").update(value).digest("hex").slice(0, 12);
12049
12586
  };
12050
12587
  var summarizeBrief = (brief) => {
12051
- const normalized = trimText(brief);
12588
+ const normalized = trimText2(brief);
12052
12589
  const sentence = normalized.split(/[.!?]/).map((part) => part.trim()).find(Boolean);
12053
- return clipText(sentence ?? normalized, 140);
12590
+ return clipText2(sentence ?? normalized, 140);
12054
12591
  };
12055
12592
  var buildSupportingMessages = (references) => {
12056
- const messages = references.map((reference) => reference.title ?? reference.excerpt ?? "").map((value) => clipText(trimText(value), 72)).filter((value) => value.length > 0);
12593
+ const messages = references.map((reference) => reference.title ?? reference.excerpt ?? "").map((value) => clipText2(trimText2(value), 72)).filter((value) => value.length > 0);
12057
12594
  return messages.slice(0, 3);
12058
12595
  };
12059
- var buildGenerationPlan = (brief, format) => {
12596
+ var summarizeDesignVectors = (designVectors) => [
12597
+ `direction: ${designVectors.directionLabel}`,
12598
+ `sections: ${designVectors.sectionArchitecture.join(" ")}`,
12599
+ `motion: ${designVectors.motionPosture.slice(0, 1).join(" ")}`,
12600
+ `interactions: ${designVectors.interactionMoments.slice(0, 1).join(" ")}`,
12601
+ `materials: ${designVectors.materialEffects.slice(0, 1).join(" ")}`
12602
+ ].join(" ");
12603
+ var isReferenceFirstPublicLanding = (designVectors) => {
12604
+ return designVectors.sourcePriority === "reference-evidence-first" && designVectors.surfaceIntent.toLowerCase().includes("public landing page");
12605
+ };
12606
+ var buildEvidenceDerivedFormat = (format, designVectors) => {
12607
+ const clone = cloneInspiredesignBriefFormat(format);
12608
+ if (!isReferenceFirstPublicLanding(designVectors)) return clone;
12609
+ return {
12610
+ ...clone,
12611
+ label: "Reference-led public landing page",
12612
+ archetype: "reference-led public landing page",
12613
+ layoutArchetype: "full-bleed hero with narrative section cadence",
12614
+ componentGrammar: "hero composition, proof bands, narrative pathways, service or story sections, conversion CTA, and footer",
12615
+ route: {
12616
+ ...clone.route,
12617
+ profile: "product-story",
12618
+ navigationModel: "global-header",
12619
+ layoutApproach: "reference-led-landing-page"
12620
+ }
12621
+ };
12622
+ };
12623
+ var buildGenerationPlan = ({
12624
+ brief,
12625
+ format,
12626
+ synthesis,
12627
+ referencePatternBoard,
12628
+ designVectors
12629
+ }) => {
12060
12630
  const plan = cloneTemplate(BASE_GENERATION_PLAN);
12061
12631
  const profile = format.route.profile;
12062
- plan.targetOutcome.summary = summarizeBrief(brief);
12632
+ const vectorSummary = summarizeDesignVectors(designVectors);
12633
+ plan.targetOutcome.summary = clipText2(
12634
+ `${summarizeBrief(brief)} Reference cues: ${synthesis.summary} ${vectorSummary}`,
12635
+ GENERATION_PLAN_REFERENCE_CLIP_LENGTH
12636
+ );
12063
12637
  plan.visualDirection.profile = profile;
12064
12638
  plan.visualDirection.themeStrategy = format.route.themeStrategy;
12065
12639
  plan.layoutStrategy.approach = format.route.layoutApproach;
12066
12640
  plan.layoutStrategy.navigationModel = format.route.navigationModel;
12641
+ plan.contentStrategy.source = clipText2(
12642
+ `${INSPIREDESIGN_HANDOFF_FILES.evidence}, ${INSPIREDESIGN_HANDOFF_FILES.advancedBrief}, ${INSPIREDESIGN_HANDOFF_FILES.designMarkdown}. Use reference pattern board and design vectors from evidence/handoff artifacts. ${synthesis.summary} ${vectorSummary}`,
12643
+ GENERATION_PLAN_REFERENCE_CLIP_LENGTH
12644
+ );
12645
+ plan.componentStrategy.mode = clipText2(
12646
+ `reuse-first, adapted from captured references: ${synthesis.summary}. Include hero entrance reveal, section scroll reveal, CTA/focus feedback, microinteractions, hover effects, evidence-gated cursor effects, material depth, parallax constraints, glass/translucency policy, and prefers-reduced-motion behavior. Capture desktop and mobile browser proof for responsive layout, reduced-motion behavior, focus states, and primary CTA visibility.`,
12647
+ GENERATION_PLAN_REFERENCE_CLIP_LENGTH
12648
+ );
12067
12649
  plan.componentStrategy.interactionStates = ["default", "hover", "focus", "disabled", "loading"];
12068
12650
  plan.validationTargets.requiredThemes = plan.visualDirection.themeStrategy === "single-theme" ? ["light"] : ["light", "dark"];
12069
- return plan;
12651
+ return {
12652
+ ...plan,
12653
+ referencePatternBoard,
12654
+ designVectors,
12655
+ interactionMoments: [...designVectors.interactionMoments],
12656
+ materialEffects: [...designVectors.materialEffects]
12657
+ };
12070
12658
  };
12071
12659
  var buildIntentBlock = (brief, urls, references, format) => {
12072
12660
  const intent = cloneTemplate(BASE_CONTRACT_TEMPLATE.intent);
@@ -12174,11 +12762,17 @@ var buildIconSystemBlock = () => ({
12174
12762
  "Decorative icons should remain visually lighter than primary copy."
12175
12763
  ]
12176
12764
  });
12177
- var buildMotionSystemBlock = (format) => {
12765
+ var buildMotionSystemBlock = (format, designVectors) => {
12178
12766
  const block = cloneTemplate(BASE_CONTRACT_TEMPLATE.motionSystem);
12179
12767
  return {
12180
12768
  ...block,
12181
12769
  grammar: format.motionGrammar,
12770
+ posture: [...designVectors.motionPosture],
12771
+ interactionMoments: [...designVectors.interactionMoments],
12772
+ materialEffects: [...designVectors.materialEffects],
12773
+ parallaxPolicy: "Use parallax only as a restrained hierarchy cue and remove transform-based depth for reduced-motion users.",
12774
+ hoverPolicy: "Hover effects must clarify clickability without becoming the only visible affordance.",
12775
+ cursorPolicy: "Cursor effects are allowed only on premium hero or CTA moments and must not interfere with reading or form controls.",
12182
12776
  durations: {
12183
12777
  quick: "120ms",
12184
12778
  standard: "180ms",
@@ -12214,7 +12808,7 @@ var buildLibraryPolicyBlock = () => ({
12214
12808
  });
12215
12809
  var buildRuntimeBudgetsBlock = (plan) => ({
12216
12810
  maxHeroActions: 2,
12217
- maxPrimarySections: 8,
12811
+ maxPrimarySections: plan.layoutStrategy.navigationModel === "global-header" ? 12 : 8,
12218
12812
  maxInteractionLatencyMs: plan.validationTargets.maxInteractionLatencyMs,
12219
12813
  previewBudgetMs: 1500,
12220
12814
  notes: [
@@ -12254,7 +12848,21 @@ var buildPerformanceModelBlock = () => {
12254
12848
  var buildCanvasPlanRequest = (brief, generationPlan) => ({
12255
12849
  ...cloneTemplate(BASE_PLAN_REQUEST_TEMPLATE),
12256
12850
  requestId: `req_plan_${referenceFingerprint(brief).slice(0, 12)}`,
12257
- generationPlan
12851
+ generationPlan: toCanvasGenerationPlan(generationPlan)
12852
+ });
12853
+ var toCanvasGenerationPlan = (plan) => cloneTemplate({
12854
+ targetOutcome: plan.targetOutcome,
12855
+ visualDirection: plan.visualDirection,
12856
+ layoutStrategy: plan.layoutStrategy,
12857
+ contentStrategy: plan.contentStrategy,
12858
+ componentStrategy: plan.componentStrategy,
12859
+ motionPosture: plan.motionPosture,
12860
+ responsivePosture: plan.responsivePosture,
12861
+ accessibilityPosture: plan.accessibilityPosture,
12862
+ validationTargets: plan.validationTargets,
12863
+ interactionMoments: [...plan.interactionMoments],
12864
+ materialEffects: [...plan.materialEffects],
12865
+ designVectors: plan.designVectors
12258
12866
  });
12259
12867
  var buildContractScope = () => ({
12260
12868
  emittedContract: "CanvasDesignGovernance",
@@ -12267,7 +12875,26 @@ var buildBriefExpansionMetadata = (briefExpansion) => ({
12267
12875
  file: INSPIREDESIGN_HANDOFF_FILES.advancedBrief,
12268
12876
  format: cloneInspiredesignBriefFormat(briefExpansion.format)
12269
12877
  });
12270
- var buildFollowthrough = (generationPlan, briefExpansion) => ({
12878
+ var buildRequiredReferenceArtifacts = (includePrototypeGuidance) => {
12879
+ const files = [
12880
+ INSPIREDESIGN_HANDOFF_FILES.evidence,
12881
+ INSPIREDESIGN_HANDOFF_FILES.advancedBrief,
12882
+ INSPIREDESIGN_HANDOFF_FILES.designMarkdown,
12883
+ INSPIREDESIGN_HANDOFF_FILES.generationPlan,
12884
+ INSPIREDESIGN_HANDOFF_FILES.canvasPlanRequest,
12885
+ INSPIREDESIGN_HANDOFF_FILES.designContract,
12886
+ INSPIREDESIGN_HANDOFF_FILES.implementationPlanMarkdown
12887
+ ];
12888
+ return includePrototypeGuidance ? [...files, INSPIREDESIGN_HANDOFF_FILES.prototypeGuidance] : files;
12889
+ };
12890
+ var buildFollowthrough = ({
12891
+ generationPlan,
12892
+ briefExpansion,
12893
+ synthesis,
12894
+ includePrototypeGuidance,
12895
+ referencePatternBoard,
12896
+ designVectors
12897
+ }) => ({
12271
12898
  summary: buildInspiredesignFollowthroughSummary(),
12272
12899
  nextStep: buildInspiredesignNextStep(),
12273
12900
  briefExpansion: buildBriefExpansionMetadata(briefExpansion),
@@ -12278,20 +12905,32 @@ var buildFollowthrough = (generationPlan, briefExpansion) => ({
12278
12905
  implementationContext: {
12279
12906
  navigationModel: buildNavigationModelBlock(generationPlan.layoutStrategy.navigationModel),
12280
12907
  asyncModel: buildAsyncModelBlock(),
12281
- performanceModel: buildPerformanceModelBlock()
12908
+ performanceModel: buildPerformanceModelBlock(),
12909
+ referenceSynthesis: {
12910
+ requiredArtifacts: buildRequiredReferenceArtifacts(includePrototypeGuidance),
12911
+ cues: synthesis.lines
12912
+ },
12913
+ referencePatternBoard,
12914
+ designVectors
12282
12915
  }
12283
12916
  });
12284
- var buildDesignContract = (brief, urls, references, plan, format) => ({
12917
+ var buildDesignContract = ({
12918
+ brief,
12919
+ urls,
12920
+ references,
12921
+ plan,
12922
+ format
12923
+ }) => ({
12285
12924
  intent: buildIntentBlock(brief, urls, references, format),
12286
- generationPlan: plan,
12925
+ generationPlan: toCanvasGenerationPlan(plan),
12287
12926
  designLanguage: buildDesignLanguageBlock(plan.visualDirection.profile, format),
12288
- contentModel: buildContentModelBlock(brief, references),
12927
+ contentModel: buildContentModelBlock(brief, references.filter(hasInspiredesignUsableReferenceEvidence)),
12289
12928
  layoutSystem: buildLayoutSystemBlock(plan, format),
12290
12929
  typographySystem: buildTypographySystemBlock(format),
12291
12930
  colorSystem: buildColorSystemBlock(plan.visualDirection.profile, format),
12292
12931
  surfaceSystem: buildSurfaceSystemBlock(format),
12293
12932
  iconSystem: buildIconSystemBlock(),
12294
- motionSystem: buildMotionSystemBlock(format),
12933
+ motionSystem: buildMotionSystemBlock(format, plan.designVectors),
12295
12934
  responsiveSystem: buildResponsiveSystemBlock(format),
12296
12935
  accessibilityPolicy: buildAccessibilityBlock(),
12297
12936
  libraryPolicy: buildLibraryPolicyBlock(),
@@ -12353,17 +12992,31 @@ var buildComponentBuildPlan = (profile) => {
12353
12992
  implementationNote: "Use semantic tokens first and keep copy/state logic outside the visual component."
12354
12993
  }));
12355
12994
  };
12356
- var buildImplementationPlan = (profile, format, references) => ({
12995
+ var buildImplementationPlan = ({
12996
+ profile,
12997
+ format,
12998
+ references,
12999
+ synthesis,
13000
+ designVectors
13001
+ }) => ({
12357
13002
  architectureRecommendation: `Implement the surface as a ${format.archetype} using token-first components and shared semantic CSS variables, then compose page sections from those primitives before adding any page-specific polish.`,
12358
13003
  tokenStrategy: buildTokenStrategy(profile),
13004
+ referenceImplementationNotes: synthesis.lines.length > 0 ? synthesis.lines : ["No live reference cues were captured; keep implementation anchored to the source brief and selected prompt format."],
12359
13005
  componentBuildPlan: buildComponentBuildPlan(profile),
12360
13006
  pageAssemblyPlan: [
12361
13007
  `Start with the ${format.layoutArchetype} and the primary navigation pattern.`,
13008
+ ...designVectors.sectionArchitecture,
13009
+ "Make each major section content-rich with a concrete headline, supporting copy, proof detail, and a clear role in the journey.",
12362
13010
  "Compose the hero or primary decision section before supporting sections.",
12363
13011
  "Add proof, utility, and footer sections only after the top-level hierarchy is stable."
12364
13012
  ],
12365
13013
  stateAndInteractionPlan: [
12366
13014
  `Use ${format.motionGrammar} while keeping hover, focus, loading, success, and error states visually distinct.`,
13015
+ ...designVectors.motionPosture,
13016
+ ...designVectors.interactionMoments,
13017
+ ...designVectors.materialEffects,
13018
+ "Implement hero entrance reveal, section scroll reveal, and CTA/focus feedback as the minimum motion system for landing pages.",
13019
+ "Use @media (prefers-reduced-motion: reduce) to preserve hierarchy without motion.",
12367
13020
  "Preserve layout during loading and keep transient confirmations out of the main flow.",
12368
13021
  "Use reduced-motion-safe transitions for reveals and CTA feedback."
12369
13022
  ],
@@ -12379,25 +13032,33 @@ var buildImplementationPlan = (profile, format, references) => ({
12379
13032
  "Avoid horizontal scrolling for primary content."
12380
13033
  ],
12381
13034
  risksAndAmbiguities: [
12382
- references.length === 0 ? "No live references were supplied, so visual cues are derived entirely from the written brief." : "Live references were reduced into reusable patterns; unique brand assets should still be recreated, not copied.",
12383
- "Any missing interaction states must be validated during visual QA."
13035
+ references.length === 0 ? "No live references were supplied, so visual cues are derived entirely from the written brief." : synthesis.lines.length > 0 ? "Live references were reduced into reusable patterns; unique brand assets should still be recreated, not copied." : "Reference URLs were attempted, but no usable creative evidence was captured; keep implementation anchored to the source brief and selected prompt format.",
13036
+ "Any missing interaction states must be validated during visual QA.",
13037
+ "Capture desktop and mobile browser proof before handoff, including reduced-motion behavior and primary CTA visibility."
12384
13038
  ],
12385
13039
  buildSequence: [
12386
13040
  "Define semantic tokens and typography.",
12387
13041
  "Build the shell, navigation, and primary CTA components.",
12388
13042
  "Implement section-level patterns and proof blocks.",
12389
13043
  "Add loading, empty, and error states.",
12390
- "Run accessibility, responsive, and browser QA before final polish."
13044
+ "Capture desktop and mobile browser proof for responsive layout, reduced-motion behavior, focus states, and primary CTA visibility before final polish."
12391
13045
  ]
12392
13046
  });
12393
13047
  var formatBulletList2 = (items) => items.map((item) => `- ${item}`).join("\n");
13048
+ var renderAntiPatternRule = (rule) => {
13049
+ const cleanRule = rule.replace(/\.$/, "").trim();
13050
+ const withoutNo = cleanRule.replace(/^no\s+/i, "");
13051
+ if (withoutNo !== cleanRule) return `Don't use ${withoutNo.charAt(0).toLowerCase()}${withoutNo.slice(1)}.`;
13052
+ const withoutDoNot = cleanRule.replace(/^do not\s+/i, "");
13053
+ if (withoutDoNot !== cleanRule) return `Don't ${withoutDoNot.charAt(0).toLowerCase()}${withoutDoNot.slice(1)}.`;
13054
+ return `Don't ${cleanRule.charAt(0).toLowerCase()}${cleanRule.slice(1)}.`;
13055
+ };
12394
13056
  var formatRecordList = (record) => {
12395
13057
  return Object.entries(record).map(([key, value]) => `- \`${key}\`: ${value}`).join("\n");
12396
13058
  };
12397
13059
  var referenceContribution = (reference) => {
12398
13060
  if (reference.captureStatus === "captured") return "Live hierarchy and component evidence captured from the page.";
12399
- if (reference.fetchStatus === "captured") return "Content and structural cues inferred from fetched page data.";
12400
- return "Only operator brief context was available for this reference.";
13061
+ return "Content and structural cues inferred from fetched page data.";
12401
13062
  };
12402
13063
  var referenceMotionNote = (reference) => {
12403
13064
  if (reference.capture?.snapshot?.warnings?.length) {
@@ -12406,8 +13067,13 @@ var referenceMotionNote = (reference) => {
12406
13067
  if (reference.captureStatus === "captured") return "Motion should remain subtle until validated against the live capture.";
12407
13068
  return "Motion is inferred from the brief rather than directly observed.";
12408
13069
  };
13070
+ var referenceLayoutObservation = (reference, excerpt) => {
13071
+ if (!reference.capture?.snapshot && !reference.capture?.clone && !reference.capture?.dom) return excerpt;
13072
+ const signals = getInspiredesignReferenceSignals(reference);
13073
+ return signals.find((signal) => signal !== reference.title) ?? signals[0] ?? excerpt;
13074
+ };
12409
13075
  var renderReferenceMarkdown = (reference, index) => {
12410
- const excerpt = reference.excerpt ? clipText(reference.excerpt, 220) : "No fetched excerpt captured.";
13076
+ const excerpt = reference.excerpt ? clipText2(reference.excerpt, 220) : "No fetched excerpt captured.";
12411
13077
  const title = reference.title ?? reference.url;
12412
13078
  return [
12413
13079
  `### Source ${index + 1}: ${title}`,
@@ -12415,13 +13081,20 @@ var renderReferenceMarkdown = (reference, index) => {
12415
13081
  `- notable UI patterns: ${reference.capture?.snapshot ? "Primary hierarchy and actionables were captured from the live page." : "Patterns inferred from brief and fetched content."}`,
12416
13082
  `- typography observations: ${reference.title ? "Headline density and copy hierarchy were inferred from the fetched title and excerpt." : "Typography is inferred."}`,
12417
13083
  `- color and theme observations: ${reference.captureStatus === "captured" ? "Color posture should be validated against the captured page before cloning brand treatment." : "Color posture remains a synthesis decision."}`,
12418
- `- layout and hierarchy observations: ${reference.capture?.snapshot ? clipText(reference.capture.snapshot.content, 180) : excerpt}`,
13084
+ `- layout and hierarchy observations: ${referenceLayoutObservation(reference, excerpt)}`,
12419
13085
  `- component patterns: ${reference.capture?.clone ? "Buttons, cards, or layout wrappers can be inferred from the captured clone preview." : "Component families were inferred from available reference text."}`,
12420
13086
  `- motion/interaction observations: ${referenceMotionNote(reference)}`,
12421
13087
  `- accessibility/responsiveness notes: ${reference.captureStatus === "captured" ? "Validate focus order, CTA prominence, and stacked layouts during build QA." : "Accessibility and responsiveness are inferred from system defaults."}`,
12422
13088
  `- what should be adopted, adapted, or avoided: adopt layout hierarchy, adapt it to the new brand tokens, avoid copying proprietary copy or visual assets directly.`
12423
13089
  ].join("\n");
12424
13090
  };
13091
+ var renderInspirationAnalysis = (references, usableReferences) => {
13092
+ if (usableReferences.length > 0) return usableReferences.map(renderReferenceMarkdown).join("\n\n");
13093
+ if (references.length > 0) {
13094
+ return "- Reference URLs were attempted, but no usable creative evidence was captured. See evidence.json for fetch/capture status.";
13095
+ }
13096
+ return "- No live inspiration source was provided. The system is derived entirely from the brief.";
13097
+ };
12425
13098
  var renderGovernanceMarkdown = (designContract, implementationPlan, format) => {
12426
13099
  const generationPlan = designContract.generationPlan;
12427
13100
  const profileConfig = PROFILE_CONFIG[generationPlan.visualDirection.profile];
@@ -12516,7 +13189,7 @@ var renderGovernanceMarkdown = (designContract, implementationPlan, format) => {
12516
13189
  "Do encode repeated visual rules into semantic tokens.",
12517
13190
  "Don't copy proprietary logos, screenshots, or brand-only illustrations.",
12518
13191
  "Don't hide important actions inside ambiguous hover-only affordances.",
12519
- ...format.antiPatterns.map((rule) => `Don't ${rule.replace(/\.$/, "").toLowerCase()}.`)
13192
+ ...format.antiPatterns.map(renderAntiPatternRule)
12520
13193
  ]),
12521
13194
  "",
12522
13195
  "## 4.15 Acceptance Criteria",
@@ -12539,39 +13212,50 @@ var renderImplementationMarkdown = (implementationPlan) => {
12539
13212
  "",
12540
13213
  formatRecordList(implementationPlan.tokenStrategy.typography),
12541
13214
  "",
12542
- "## 5.3 Component Build Plan",
13215
+ "## 5.3 Reference Implementation Notes",
13216
+ formatBulletList2(implementationPlan.referenceImplementationNotes),
13217
+ "",
13218
+ "## 5.4 Component Build Plan",
12543
13219
  implementationPlan.componentBuildPlan.map((component, index) => `${index + 1}. ${component.name}: ${component.purpose}`).join("\n"),
12544
13220
  "",
12545
- "## 5.4 Page Assembly Plan",
13221
+ "## 5.5 Page Assembly Plan",
12546
13222
  formatBulletList2(implementationPlan.pageAssemblyPlan),
12547
13223
  "",
12548
- "## 5.5 State and Interaction Plan",
13224
+ "## 5.6 State and Interaction Plan",
12549
13225
  formatBulletList2(implementationPlan.stateAndInteractionPlan),
12550
13226
  "",
12551
- "## 5.6 Accessibility Implementation Checklist",
13227
+ "## 5.7 Accessibility Implementation Checklist",
12552
13228
  formatBulletList2(implementationPlan.accessibilityChecklist),
12553
13229
  "",
12554
- "## 5.7 Responsive Implementation Checklist",
13230
+ "## 5.8 Responsive Implementation Checklist",
12555
13231
  formatBulletList2(implementationPlan.responsiveChecklist),
12556
13232
  "",
12557
- "## 5.8 Risks and Ambiguities",
13233
+ "## 5.9 Risks and Ambiguities",
12558
13234
  formatBulletList2(implementationPlan.risksAndAmbiguities),
12559
13235
  "",
12560
- "## 5.9 Recommended Build Sequence",
13236
+ "## 5.10 Recommended Build Sequence",
12561
13237
  implementationPlan.buildSequence.map((step, index) => `${index + 1}. ${step}`).join("\n")
12562
13238
  ].join("\n");
12563
13239
  };
12564
- var renderPrototypeGuidance = (profile) => {
13240
+ var renderPrototypeGuidance = (profile, synthesis, designVectors) => {
12565
13241
  return [
12566
13242
  "# 6. Optional Prototype Plan",
12567
13243
  "",
12568
- "- page structure: establish the shell, hero or primary action zone, proof sections, and footer in that order.",
13244
+ "## 6.1 Reference Anchors",
13245
+ formatBulletList2(synthesis.lines.length > 0 ? synthesis.lines : ["No live reference cues were captured."]),
13246
+ "",
13247
+ "## 6.2 Prototype Structure",
13248
+ "- page structure: for public landing pages, build 8 to 12 content-rich sections unless the brief explicitly asks for a microsite.",
13249
+ `- section architecture: ${designVectors.sectionArchitecture.join(" ")}`,
12569
13250
  `- section order: ${PROFILE_CONFIG[profile].pagePatterns.join(" -> ")}`,
12570
13251
  "- component composition: reuse button, card, input, and navigation primitives before page-specific wrappers.",
12571
- "- interaction expectations: provide visible focus, compact hover feedback, and reduced-motion-safe entry transitions.",
12572
- "- HTML skeleton guidance: start with one main landmark, one primary CTA group, and semantic sections for proof or detail bands.",
12573
- "- styling approach: define CSS variables first, then map components to semantic tokens rather than raw values.",
12574
- "- first prototype should include vs omit: include shell, hero, CTA, one proof section, and one form or action cluster; omit analytics, heavy animation, and tertiary content until hierarchy is proven."
13252
+ `- interaction expectations: ${designVectors.interactionMoments.join(" ")}`,
13253
+ `- motion expectations: ${designVectors.motionPosture.join(" ")}`,
13254
+ `- material and depth expectations: ${designVectors.materialEffects.join(" ")}`,
13255
+ "- browser proof: capture desktop and mobile browser screenshots, verify reduced-motion behavior, inspect focus states, and confirm the primary CTA remains visible without overlap.",
13256
+ "- HTML skeleton guidance: start with one main landmark, one primary CTA group, and semantic sections that follow the design vector section architecture instead of fixed industry-specific defaults.",
13257
+ "- styling approach: define CSS variables for timing, easing, elevation, translucency, backdrop blur, cursor effects, hover effects, and parallax distance before mapping components to semantic tokens.",
13258
+ "- first prototype should include vs omit: include shell, primary hero or decision section, CTA group, proof or detail sections, section patterns named in the design vectors, final CTA, and footer; omit analytics, app-shell widgets, empty card grids, and any section not supported by the brief or reference evidence."
12575
13259
  ].join("\n");
12576
13260
  };
12577
13261
  var renderDeliverablesSummary = (includePrototypeGuidance) => {
@@ -12589,27 +13273,36 @@ var renderDeliverablesSummary = (includePrototypeGuidance) => {
12589
13273
  deliverables.push("Evidence digest describing brief, references, fetch outcomes, and capture outcomes");
12590
13274
  return formatBulletList2(deliverables);
12591
13275
  };
12592
- var buildEvidencePayload = (brief, briefExpansion, urls, references) => ({
13276
+ var buildEvidencePayload = ({
13277
+ brief,
13278
+ briefExpansion,
13279
+ advancedBriefMarkdown,
13280
+ urls,
13281
+ references,
13282
+ referencePatternBoard,
13283
+ designVectors
13284
+ }) => ({
12593
13285
  brief,
12594
13286
  briefHash: referenceFingerprint(brief),
12595
- advancedBrief: briefExpansion.advancedBrief,
12596
- advancedBriefHash: referenceFingerprint(briefExpansion.advancedBrief),
13287
+ advancedBrief: advancedBriefMarkdown,
13288
+ advancedBriefHash: referenceFingerprint(advancedBriefMarkdown),
12597
13289
  briefExpansion: {
12598
13290
  templateVersion: briefExpansion.templateVersion,
12599
13291
  format: cloneInspiredesignBriefFormat(briefExpansion.format)
12600
13292
  },
12601
13293
  urls,
12602
13294
  referenceCount: references.length,
12603
- references: references.map((reference) => toReferenceEvidenceJson(reference))
13295
+ references: references.map((reference) => toReferenceEvidenceJson(reference)),
13296
+ referencePatternBoard,
13297
+ designVectors
12604
13298
  });
12605
- var toCaptureEvidenceJson = (capture) => {
12606
- const normalized = normalizeInspiredesignCaptureEvidence(capture);
13299
+ var toCaptureEvidenceJson = (reference) => {
13300
+ const normalized = normalizeInspiredesignCaptureEvidence(reference.capture);
12607
13301
  if (!normalized) return null;
13302
+ const signals = getInspiredesignReferenceSignals(reference);
12608
13303
  return {
12609
13304
  ...normalized.title ? { title: normalized.title } : {},
12610
- ...normalized.snapshot ? { snapshot: normalized.snapshot } : {},
12611
- ...normalized.dom ? { dom: normalized.dom } : {},
12612
- ...normalized.clone ? { clone: normalized.clone } : {},
13305
+ ...signals.length > 0 ? { signals } : {},
12613
13306
  ...normalized.attempts ? { attempts: normalized.attempts } : {}
12614
13307
  };
12615
13308
  };
@@ -12622,33 +13315,78 @@ var toReferenceEvidenceJson = (reference) => ({
12622
13315
  captureStatus: reference.captureStatus,
12623
13316
  ...reference.fetchFailure ? { fetchFailure: reference.fetchFailure } : {},
12624
13317
  ...reference.captureFailure ? { captureFailure: reference.captureFailure } : {},
12625
- capture: toCaptureEvidenceJson(reference.capture)
13318
+ capture: toCaptureEvidenceJson(reference)
12626
13319
  });
12627
13320
  var buildInspiredesignPacket = (input) => {
12628
- const brief = trimText(input.brief);
13321
+ const brief = trimText2(input.brief);
12629
13322
  const selectedFormat = cloneInspiredesignBriefFormat(input.briefExpansion.format);
12630
- const advancedBriefMarkdown = input.briefExpansion.advancedBrief;
12631
- const urls = [...new Set(input.urls.map((url) => trimText(url)).filter(Boolean))];
13323
+ const includePrototypeGuidance = input.includePrototypeGuidance ?? false;
13324
+ const urls = [...new Set(input.urls.map((url) => trimText2(url)).filter(Boolean))];
12632
13325
  const references = input.references.map((reference) => ({
12633
13326
  ...reference,
12634
- title: reference.title ? trimText(reference.title) : void 0,
12635
- excerpt: reference.excerpt ? trimText(reference.excerpt) : void 0
13327
+ title: reference.title ? trimText2(reference.title) : void 0,
13328
+ excerpt: reference.excerpt ? trimText2(reference.excerpt) : void 0
12636
13329
  }));
12637
- const generationPlan = buildGenerationPlan(brief, selectedFormat);
13330
+ const usableReferences = references.filter(hasInspiredesignUsableReferenceEvidence);
13331
+ const synthesis = buildReferenceSynthesis(usableReferences);
13332
+ const referencePatternBoard = buildInspiredesignReferencePatternBoard(
13333
+ referenceFingerprint(brief),
13334
+ selectedFormat,
13335
+ references
13336
+ );
13337
+ const designVectors = buildInspiredesignDesignVectors(selectedFormat, referencePatternBoard);
13338
+ const effectiveFormat = buildEvidenceDerivedFormat(selectedFormat, designVectors);
13339
+ const effectiveBriefExpansion = {
13340
+ ...input.briefExpansion,
13341
+ advancedBrief: isReferenceFirstPublicLanding(designVectors) ? renderEvidenceDerivedAdvancedBrief(input.briefExpansion, effectiveFormat) : input.briefExpansion.advancedBrief,
13342
+ format: effectiveFormat
13343
+ };
13344
+ const advancedBriefMarkdown = renderReferenceFirstAdvancedBrief(
13345
+ effectiveBriefExpansion,
13346
+ referencePatternBoard,
13347
+ designVectors,
13348
+ references
13349
+ );
13350
+ const generationPlan = buildGenerationPlan({
13351
+ brief,
13352
+ format: effectiveFormat,
13353
+ synthesis,
13354
+ referencePatternBoard,
13355
+ designVectors
13356
+ });
12638
13357
  const profile = generationPlan.visualDirection.profile;
12639
13358
  const canvasPlanRequest = buildCanvasPlanRequest(brief, generationPlan);
12640
- const designContract = buildDesignContract(brief, urls, references, generationPlan, selectedFormat);
12641
- const followthrough = buildFollowthrough(generationPlan, input.briefExpansion);
12642
- const implementationPlan = buildImplementationPlan(profile, selectedFormat, references);
12643
- const governanceMarkdown = renderGovernanceMarkdown(designContract, implementationPlan, selectedFormat);
13359
+ const designContract = buildDesignContract({
13360
+ brief,
13361
+ urls,
13362
+ references,
13363
+ plan: generationPlan,
13364
+ format: effectiveFormat
13365
+ });
13366
+ const followthrough = buildFollowthrough({
13367
+ generationPlan,
13368
+ briefExpansion: effectiveBriefExpansion,
13369
+ synthesis,
13370
+ includePrototypeGuidance,
13371
+ referencePatternBoard,
13372
+ designVectors
13373
+ });
13374
+ const implementationPlan = buildImplementationPlan({
13375
+ profile,
13376
+ format: effectiveFormat,
13377
+ references,
13378
+ synthesis,
13379
+ designVectors
13380
+ });
13381
+ const governanceMarkdown = renderGovernanceMarkdown(designContract, implementationPlan, effectiveFormat);
12644
13382
  const implementationPlanMarkdown = renderImplementationMarkdown(implementationPlan);
12645
- const prototypeGuidanceMarkdown = input.includePrototypeGuidance ? renderPrototypeGuidance(profile) : null;
13383
+ const prototypeGuidanceMarkdown = includePrototypeGuidance ? renderPrototypeGuidance(profile, synthesis, designVectors) : null;
12646
13384
  const designMarkdown = [
12647
13385
  "# 1. Executive Summary",
12648
13386
  "",
12649
13387
  formatBulletList2([
12650
13388
  `Analyzed brief plus ${references.length || 0} inspiration reference(s).`,
12651
- `Chosen design direction: ${selectedFormat.archetype}.`,
13389
+ `Chosen design direction: ${designVectors.surfaceIntent}.`,
12652
13390
  `Route profile: ${PROFILE_CONFIG[profile].direction}.`,
12653
13391
  `Prompt format: ${selectedFormat.label} (${input.briefExpansion.templateVersion}).`,
12654
13392
  "Final outcome: a reusable design contract, engineering plan, and optional prototype guidance.",
@@ -12657,16 +13395,38 @@ var buildInspiredesignPacket = (input) => {
12657
13395
  "",
12658
13396
  "# 2. Inspiration Analysis",
12659
13397
  "",
12660
- references.length > 0 ? references.map(renderReferenceMarkdown).join("\n\n") : "- No live inspiration source was provided. The system is derived entirely from the brief.",
13398
+ renderInspirationAnalysis(references, usableReferences),
12661
13399
  "",
12662
13400
  "# 3. Unified Design Direction",
12663
13401
  "",
13402
+ "## 3.1 Reference-Specific Build Rules",
13403
+ "",
13404
+ formatBulletList2(synthesis.lines.length > 0 ? synthesis.lines : ["No live reference cues were captured."]),
13405
+ "",
13406
+ "## 3.2 Reference Pattern Board",
13407
+ "",
13408
+ formatBulletList2(referencePatternBoard.synthesis.sharedStrengths.length > 0 ? referencePatternBoard.synthesis.sharedStrengths : ["No live reference cues were captured."]),
13409
+ "",
13410
+ "## 3.3 Design Vectors",
13411
+ "",
13412
+ formatBulletList2([
13413
+ `source priority: ${designVectors.sourcePriority}`,
13414
+ `direction: ${designVectors.directionLabel}`,
13415
+ `premium posture: ${designVectors.premiumPosture.join(" ")}`,
13416
+ `motion posture: ${designVectors.motionPosture.join(" ")}`,
13417
+ `section architecture: ${designVectors.sectionArchitecture.join(" ")}`,
13418
+ `interaction moments: ${designVectors.interactionMoments.join(" ")}`,
13419
+ `material effects: ${designVectors.materialEffects.join(" ")}`
13420
+ ]),
13421
+ "",
13422
+ "## 3.4 System Direction",
13423
+ "",
12664
13424
  formatBulletList2([
12665
13425
  `visual personality: ${PROFILE_CONFIG[profile].visualPersonality}`,
12666
13426
  `tone: ${PROFILE_CONFIG[profile].brandTone}`,
12667
- `layout archetype: ${selectedFormat.layoutArchetype}`,
12668
- `typography system: ${selectedFormat.typographySystem}`,
12669
- `motion grammar: ${selectedFormat.motionGrammar}`,
13427
+ `layout archetype: ${effectiveFormat.layoutArchetype}`,
13428
+ `typography system: ${effectiveFormat.typographySystem}`,
13429
+ `motion grammar: ${effectiveFormat.motionGrammar}`,
12670
13430
  `UX principles: ${PROFILE_CONFIG[profile].hierarchyPrinciples.join(" ")}`,
12671
13431
  `interaction philosophy: ${PROFILE_CONFIG[profile].interactionPhilosophy}`,
12672
13432
  "branding posture: preserve the intent of the references without cloning brand-only assets.",
@@ -12695,7 +13455,15 @@ var buildInspiredesignPacket = (input) => {
12695
13455
  implementationPlan,
12696
13456
  implementationPlanMarkdown,
12697
13457
  prototypeGuidanceMarkdown,
12698
- evidence: buildEvidencePayload(brief, input.briefExpansion, urls, references)
13458
+ evidence: buildEvidencePayload({
13459
+ brief,
13460
+ briefExpansion: effectiveBriefExpansion,
13461
+ advancedBriefMarkdown,
13462
+ urls,
13463
+ references,
13464
+ referencePatternBoard,
13465
+ designVectors
13466
+ })
12699
13467
  };
12700
13468
  };
12701
13469
 
@@ -14921,7 +15689,7 @@ var executeResearchWorkflowPlan = async (runtime, plan, options) => {
14921
15689
  };
14922
15690
  };
14923
15691
 
14924
- // src/providers/inspiredesign-capture-mode.ts
15692
+ // src/inspiredesign/capture-mode.ts
14925
15693
  var hasInspiredesignUrls = (urls) => {
14926
15694
  return Array.isArray(urls) && urls.some((url) => url.trim().length > 0);
14927
15695
  };
@@ -15667,7 +16435,14 @@ var createRemainingTimeoutResolver = (timeoutMs) => {
15667
16435
  return () => void 0;
15668
16436
  }
15669
16437
  const startedAtMs = Date.now();
15670
- return () => Math.max(1, timeoutMs - Math.max(0, Date.now() - startedAtMs));
16438
+ let firstRead = true;
16439
+ return () => {
16440
+ if (firstRead) {
16441
+ firstRead = false;
16442
+ return timeoutMs;
16443
+ }
16444
+ return Math.max(1, timeoutMs - Math.max(0, Date.now() - startedAtMs));
16445
+ };
15671
16446
  };
15672
16447
  var INSPIREDESIGN_RENDER_MODES = /* @__PURE__ */ new Set(["compact", "json", "md", "context", "path"]);
15673
16448
  var INSPIREDESIGN_CAPTURE_MODES = /* @__PURE__ */ new Set(["off", "deep"]);
@@ -16047,8 +16822,12 @@ var excerptFromInspiredesignCapture = (capture) => {
16047
16822
  return captureSnippet(capture?.snapshot?.content, 240) ?? captureSnippet(capture?.dom?.outerHTML, 240) ?? captureSnippet(capture?.clone?.componentPreview, 240) ?? captureSnippet(capture?.clone?.cssPreview, 240);
16048
16823
  };
16049
16824
  var isInspiredesignFetchRecovered = (reference) => {
16050
- return reference.fetchStatus === "failed" && reference.captureStatus === "captured" && (Boolean(reference.title) || Boolean(reference.excerpt));
16825
+ return reference.fetchStatus === "failed" && reference.captureStatus === "captured" && hasInspiredesignUsableReferenceEvidence(reference);
16051
16826
  };
16827
+ var summarizeInspiredesignRecoveredFetches = (references) => references.filter(isInspiredesignFetchRecovered).map((reference) => ({
16828
+ url: reference.url,
16829
+ ...reference.fetchFailure ? { fetchFailure: reference.fetchFailure } : {}
16830
+ }));
16052
16831
  var buildInspiredesignReference = (url, result, capture) => {
16053
16832
  const primary = getInspiredesignPrimaryRecord(result, url);
16054
16833
  const normalizedCapture = normalizeInspiredesignCaptureEvidence(capture.capture);
@@ -16095,6 +16874,7 @@ var summarizeInspiredesignFetchConstraint = (references) => {
16095
16874
  var buildInspiredesignMeta = (runtime, workflowInput, references, failures, followthrough) => {
16096
16875
  const failedCaptures = references.filter((reference) => reference.captureStatus === "failed");
16097
16876
  const captureAttemptReport = summarizeInspiredesignCaptureAttempts(references);
16877
+ const recoveredFetches = summarizeInspiredesignRecoveredFetches(references);
16098
16878
  let reasonCodeDistribution = summarizeReasonCodeDistribution(failures);
16099
16879
  let meta = withCamelCasePrimaryConstraintMeta(withReasonCodeDistributionMeta({
16100
16880
  selection: {
@@ -16108,6 +16888,10 @@ var buildInspiredesignMeta = (runtime, workflowInput, references, failures, foll
16108
16888
  captured_references: references.filter((reference) => reference.captureStatus === "captured").length,
16109
16889
  failed_fetches: references.filter((reference) => reference.fetchStatus === "failed" && !isInspiredesignFetchRecovered(reference)).length,
16110
16890
  failed_captures: failedCaptures.length,
16891
+ ...recoveredFetches.length > 0 ? {
16892
+ recovered_fetches: recoveredFetches.length,
16893
+ recovered_fetch_details: recoveredFetches
16894
+ } : {},
16111
16895
  ...captureAttemptReport ? { capture_attempts: captureAttemptReport.counts } : {}
16112
16896
  },
16113
16897
  alerts: buildWorkflowAlerts(runtime, failures)
@@ -19618,4 +20402,4 @@ export {
19618
20402
  createProviderRuntime,
19619
20403
  createDefaultRuntime
19620
20404
  };
19621
- //# sourceMappingURL=chunk-Z6ENAZUN.js.map
20405
+ //# sourceMappingURL=chunk-V5DJUSPV.js.map