@agent-native/core 0.153.9 → 0.154.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/AGENTS.md +20 -30
  3. package/corpus/templates/analytics/actions/search-dashboard-references.ts +58 -0
  4. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -1
  5. package/corpus/templates/analytics/app/lib/utils.ts +1 -1
  6. package/corpus/templates/analytics/app/pages/DataSources.tsx +2 -1
  7. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +1 -1
  8. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +4 -2
  9. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +4 -2
  10. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +2 -0
  11. package/corpus/templates/analytics/server/lib/dashboards-store.ts +366 -3
  12. package/corpus/templates/analytics/server/lib/real-data-actions.ts +3 -1
  13. package/corpus/templates/analytics/server/plugins/agent-chat.ts +6 -2
  14. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +1 -1
  15. package/corpus/templates/calendar/app/lib/utils.ts +1 -1
  16. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +32 -5
  17. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +15 -15
  18. package/corpus/templates/clips/app/i18n/en-US.ts +3 -3
  19. package/corpus/templates/clips/app/lib/utils.ts +5 -6
  20. package/corpus/templates/clips/app/root.tsx +4 -1
  21. package/corpus/templates/clips/app/routes/share.$shareId.tsx +2 -2
  22. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +43 -8
  23. package/corpus/templates/clips/desktop/src/app.tsx +27 -13
  24. package/corpus/templates/clips/desktop/src/lib/recorder.ts +23 -9
  25. package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +261 -11
  26. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +21 -3
  27. package/corpus/templates/clips/shared/mic-audio-cleanup.ts +350 -0
  28. package/corpus/templates/content/app/i18n-data.ts +10 -10
  29. package/corpus/templates/content/scripts/check-native-deps.mjs +181 -15
  30. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +79 -7
  31. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +14 -2
  32. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +2 -2
  33. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +35 -11
  34. package/corpus/templates/design/actions/get-design-system.ts +103 -3
  35. package/corpus/templates/design/actions/import-design-tokens.ts +37 -8
  36. package/corpus/templates/design/actions/import-github.ts +32 -138
  37. package/corpus/templates/design/actions/index-design-system-with-builder.ts +49 -16
  38. package/corpus/templates/design/actions/present-design-variants.ts +93 -4
  39. package/corpus/templates/design/actions/run-design-audit.ts +229 -0
  40. package/corpus/templates/design/actions/sync-design-system-with-builder.ts +64 -0
  41. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +2 -1
  42. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
  43. package/corpus/templates/design/app/components/design/code-workbench/commands.ts +2 -2
  44. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +17 -4
  45. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +5 -1
  46. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +5 -1
  47. package/corpus/templates/design/app/hooks/use-question-flow.ts +81 -5
  48. package/corpus/templates/design/app/i18n/en-US.ts +1 -1
  49. package/corpus/templates/design/app/i18n-data.ts +32 -1
  50. package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +10 -10
  51. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +83 -11
  52. package/corpus/templates/design/app/pages/DesignSystems.tsx +14 -0
  53. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +22 -0
  54. package/corpus/templates/design/changelog/2026-08-13-a-screen-that-would-render-behind-an-invisible-alpine-overla.md +6 -0
  55. package/corpus/templates/design/changelog/2026-08-13-attach-a-ui-screenshot-and-the-design-is-reproduced-not-rein.md +6 -0
  56. package/corpus/templates/design/changelog/2026-08-13-linking-a-design-system-means-you-never-get-generic-directio.md +6 -0
  57. package/corpus/templates/design/changelog/2026-08-13-the-design-audit-now-reports-when-a-screen-ignores-its-linke.md +6 -0
  58. package/corpus/templates/design/changelog/2026-08-13-the-design-system-preview-now-shows-how-many-named-tokens-we.md +6 -0
  59. package/corpus/templates/design/changelog/2026-08-13-your-design-system-prompt-and-reference-screenshots-now-reac.md +6 -0
  60. package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +18 -2
  61. package/corpus/templates/design/shared/design-review.ts +1 -0
  62. package/corpus/templates/design/shared/html-integrity.ts +171 -0
  63. package/corpus/templates/mail/app/lib/utils.ts +1 -1
  64. package/corpus/templates/plan/app/pages/PlansPage.tsx +5 -2
  65. package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +10 -6
  66. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +41 -3
  67. package/corpus/templates/slides/actions/sync-design-system-with-builder.ts +64 -0
  68. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +1 -1
  69. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +193 -20
  70. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +58 -33
  71. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +28 -41
  72. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +119 -91
  73. package/corpus/templates/slides/app/components/editor/ImageOverlay.tsx +16 -0
  74. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +158 -31
  75. package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +30 -14
  76. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +2 -2
  77. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +4 -1
  78. package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +14 -0
  79. package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +24 -0
  80. package/corpus/templates/slides/app/global.css +24 -0
  81. package/corpus/templates/slides/app/hooks/use-navigation-state.ts +5 -1
  82. package/corpus/templates/slides/app/i18n/en-US.ts +19 -10
  83. package/corpus/templates/slides/app/lib/deck-filter.ts +47 -0
  84. package/corpus/templates/slides/app/lib/export-google-slides-client.ts +15 -4
  85. package/corpus/templates/slides/app/lib/export-pptx-client.ts +637 -1
  86. package/corpus/templates/slides/app/lib/image-download.ts +84 -0
  87. package/corpus/templates/slides/app/lib/utils.ts +1 -1
  88. package/corpus/templates/slides/app/pages/Index.tsx +25 -9
  89. package/corpus/templates/slides/netlify.toml +1 -0
  90. package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +14 -2
  91. package/dist/agent/production-agent.js +1 -1
  92. package/dist/brand-kit/types.d.ts +10 -2
  93. package/dist/cli/code.js +1 -1
  94. package/dist/cli/index.js +30 -1
  95. package/dist/cli/native-dependencies.d.ts +24 -0
  96. package/dist/cli/native-dependencies.js +264 -0
  97. package/dist/cli/plan-local.js +1 -1
  98. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
  99. package/dist/cli/skills-content/design-visual-edit-skill.js +2 -2
  100. package/dist/cli/skills-content/help.d.ts +1 -1
  101. package/dist/cli/skills-content/help.js +2 -1
  102. package/dist/cli/skills.js +2 -1
  103. package/dist/cli/visualize-repo.js +1 -1
  104. package/dist/client/FeedbackButton.js +12 -12
  105. package/dist/client/NewWorkspaceAppFlow.js +4 -1
  106. package/dist/client/agent-chat-adapter.js +3 -4
  107. package/dist/client/agent-page/AgentTabsPage.d.ts +2 -2
  108. package/dist/client/agent-page/AgentTabsPage.js +12 -9
  109. package/dist/client/assistant-ui-recovery.d.ts +1 -1
  110. package/dist/client/assistant-ui-recovery.js +4 -0
  111. package/dist/client/chat/message-components.d.ts +11 -3
  112. package/dist/client/chat/message-components.js +31 -5
  113. package/dist/client/chat/tool-call-display.d.ts +2 -1
  114. package/dist/client/chat/tool-call-display.js +33 -15
  115. package/dist/client/db-admin/SqlEditor.js +1 -1
  116. package/dist/client/dev-overlay/DevOverlay.js +2 -2
  117. package/dist/client/extensions/ExtensionsSidebarSection.js +2 -1
  118. package/dist/client/extensions/portable-extension.js +4 -0
  119. package/dist/client/guided-questions.d.ts +8 -0
  120. package/dist/client/guided-questions.js +12 -3
  121. package/dist/client/onboarding/FirstRunOnboarding.js +2 -1
  122. package/dist/client/org/TeamPage.js +14 -3
  123. package/dist/client/settings/SettingsPanel.js +26 -1
  124. package/dist/client/sharing/ShareButton.js +16 -24
  125. package/dist/client/sse-event-processor.js +35 -15
  126. package/dist/client/tool-display.d.ts +9 -0
  127. package/dist/client/tool-display.js +39 -0
  128. package/dist/client/vite-dev-recovery-script.js +1 -1
  129. package/dist/extensions/html-shell.js +5 -0
  130. package/dist/integrations/catalog.js +9 -8
  131. package/dist/observability/routes.d.ts +2 -2
  132. package/dist/secrets/routes.d.ts +6 -6
  133. package/dist/server/agent-chat/prompt-resources.js +17 -16
  134. package/dist/server/agent-chat-plugin.d.ts +9 -0
  135. package/dist/server/agent-chat-plugin.js +31 -9
  136. package/dist/server/builder-design-systems.d.ts +33 -1
  137. package/dist/server/builder-design-systems.js +293 -11
  138. package/dist/server/design-token-utils.d.ts +11 -0
  139. package/dist/server/design-token-utils.js +68 -16
  140. package/dist/server/index.d.ts +1 -1
  141. package/dist/server/index.js +1 -1
  142. package/dist/server/onboarding-html.js +2 -1
  143. package/dist/shared/docs-url.d.ts +24 -0
  144. package/dist/shared/docs-url.js +39 -0
  145. package/dist/shared/index.d.ts +1 -0
  146. package/dist/shared/index.js +1 -0
  147. package/dist/templates/default/app/routes/_index.tsx +2 -1
  148. package/package.json +2 -2
  149. package/src/templates/default/app/routes/_index.tsx +2 -1
@@ -270,9 +270,11 @@ const DEFAULT_LABELS: DesignColorPickerLabels = {
270
270
  diamond: "Diamond", // i18n-ignore fallback component label
271
271
  };
272
272
 
273
- // checkerboard: explicit light/dark tiles for legibility.
274
- const CHECKER_A = "#d4d4d4";
275
- const CHECKER_B = "#a3a3a3";
273
+ // Keep transparency tiles light on both light and dark editor surfaces.
274
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
275
+ const CHECKER_A = "#e5e5e5";
276
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
277
+ const CHECKER_B = "#f5f5f5";
276
278
  const CHECKERBOARD_IMAGE = `linear-gradient(45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(-45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${CHECKER_A} 75%), linear-gradient(-45deg, transparent 75%, ${CHECKER_A} 75%)`;
277
279
 
278
280
  // ─── Paint-type icon SVGs (Tabler style, distinct per type) ────────────────────
@@ -1676,6 +1678,7 @@ export function DesignColorPicker({
1676
1678
  max={100}
1677
1679
  disabled={disabled}
1678
1680
  backgroundImage={alphaTrackBackground(fieldColor)}
1681
+ backgroundColor={CHECKER_B}
1679
1682
  backgroundSize="8px 8px, 8px 8px, 8px 8px, 8px 8px, 100% 100%"
1680
1683
  backgroundPosition="0 0, 0 4px, 4px -4px, -4px 0, 0 0"
1681
1684
  onChange={(next) => {
@@ -2062,6 +2065,7 @@ function ColorTrack({
2062
2065
  max,
2063
2066
  disabled,
2064
2067
  backgroundImage,
2068
+ backgroundColor,
2065
2069
  backgroundSize,
2066
2070
  backgroundPosition,
2067
2071
  onChange,
@@ -2073,6 +2077,7 @@ function ColorTrack({
2073
2077
  max: number;
2074
2078
  disabled: boolean;
2075
2079
  backgroundImage: string;
2080
+ backgroundColor?: string;
2076
2081
  backgroundSize?: string;
2077
2082
  backgroundPosition?: string;
2078
2083
  onChange: (value: number) => void;
@@ -2160,7 +2165,12 @@ function ColorTrack({
2160
2165
  "active:cursor-grabbing",
2161
2166
  disabled && "cursor-not-allowed opacity-60",
2162
2167
  )}
2163
- style={{ backgroundImage, backgroundSize, backgroundPosition }}
2168
+ style={{
2169
+ backgroundImage,
2170
+ backgroundColor,
2171
+ backgroundSize,
2172
+ backgroundPosition,
2173
+ }}
2164
2174
  >
2165
2175
  {/* Thumb overhangs the track slightly, matching the design editor */}
2166
2176
  <span
@@ -2552,6 +2562,7 @@ function triggerSwatchStyle(
2552
2562
  if (!lower || lower === "transparent") {
2553
2563
  return {
2554
2564
  backgroundImage: CHECKERBOARD_IMAGE,
2565
+ backgroundColor: CHECKER_B,
2555
2566
  backgroundSize: "8px 8px",
2556
2567
  };
2557
2568
  }
@@ -2577,6 +2588,7 @@ function swatchStyle(value: string): {
2577
2588
  if (parsed && parsed.a < 1) {
2578
2589
  return {
2579
2590
  backgroundImage: `${CHECKERBOARD_IMAGE}, linear-gradient(${rgbaToCss(parsed)}, ${rgbaToCss(parsed)})`,
2591
+ backgroundColor: CHECKER_B,
2580
2592
  backgroundSize: "8px 8px, 8px 8px, 8px 8px, 8px 8px, 100% 100%",
2581
2593
  backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0, 0 0",
2582
2594
  };
@@ -2590,6 +2602,7 @@ function swatchStyle(value: string): {
2590
2602
  // that would otherwise render as a blank swatch.
2591
2603
  return {
2592
2604
  backgroundImage: CHECKERBOARD_IMAGE,
2605
+ backgroundColor: CHECKER_B,
2593
2606
  backgroundSize: "8px 8px",
2594
2607
  };
2595
2608
  }
@@ -75,7 +75,10 @@ export interface GradientEditSessionTarget {
75
75
 
76
76
  // ─── Checkerboard (matches DesignColorPicker) ───────────────────────────────────
77
77
 
78
- const CHECKER_A = "#d4d4d4";
78
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
79
+ const CHECKER_A = "#e5e5e5";
80
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
81
+ const CHECKER_B = "#f5f5f5";
79
82
  const CHECKERBOARD_IMAGE = `linear-gradient(45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(-45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${CHECKER_A} 75%), linear-gradient(-45deg, transparent 75%, ${CHECKER_A} 75%)`;
80
83
  const CHECKER_SIZE = "8px 8px, 8px 8px, 8px 8px, 8px 8px";
81
84
  const CHECKER_POS = "0 0, 0 4px, 4px -4px, -4px 0";
@@ -635,6 +638,7 @@ export function GradientEditor({
635
638
  style={{
636
639
  height: BAR_HEIGHT,
637
640
  backgroundImage: CHECKERBOARD_IMAGE,
641
+ backgroundColor: CHECKER_B,
638
642
  backgroundSize: CHECKER_SIZE,
639
643
  backgroundPosition: CHECKER_POS,
640
644
  }}
@@ -71,7 +71,10 @@ function readFileAsDataUrl(file: File): Promise<string> {
71
71
  });
72
72
  }
73
73
 
74
- const CHECKER_A = "#d4d4d4";
74
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
75
+ const CHECKER_A = "#e5e5e5";
76
+ // guard:allow-raw-color — fixed light checkerboard tile keeps transparency visible.
77
+ const CHECKER_B = "#f5f5f5";
75
78
  const CHECKERBOARD_IMAGE = `linear-gradient(45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(-45deg, ${CHECKER_A} 25%, transparent 25%), linear-gradient(45deg, transparent 75%, ${CHECKER_A} 75%), linear-gradient(-45deg, transparent 75%, ${CHECKER_A} 75%)`;
76
79
  const FIT_MARKER_RE =
77
80
  /\/\*\s*agent-native-image-fit:(fill|fit|crop|tile)\s*\*\//i;
@@ -345,6 +348,7 @@ export function ImageFillControls({
345
348
  backgroundImage: value.url
346
349
  ? `url("${escapeForQuotedUrl(value.url.trim())}")`
347
350
  : CHECKERBOARD_IMAGE,
351
+ backgroundColor: value.url ? undefined : CHECKER_B,
348
352
  backgroundSize: value.url
349
353
  ? value.fit === "fit"
350
354
  ? "contain"
@@ -7,6 +7,7 @@ import { type PromptComposerSubmitOptions } from "@agent-native/core/client/comp
7
7
  import { useCallback } from "react";
8
8
 
9
9
  import { sendToDesignAgentChat } from "@/lib/agent-chat";
10
+ import { loadDesignSystemGenerationContext } from "@/pages/design-editor/generation-prompt-directives";
10
11
 
11
12
  export interface QuestionFlowModelSelection {
12
13
  model?: string;
@@ -14,6 +15,23 @@ export interface QuestionFlowModelSelection {
14
15
  effort?: PromptComposerSubmitOptions["effort"];
15
16
  }
16
17
 
18
+ /**
19
+ * What the user actually supplied at kickoff. The intake turn is forced to emit
20
+ * only a questionnaire and then stop, so THIS continuation is the turn that
21
+ * writes HTML — and a fresh thread inherits nothing. Re-sending the brief here
22
+ * is the only thing that puts the user's own prompt, reference screenshots, and
23
+ * design system in front of the model at the moment it generates.
24
+ */
25
+ export interface QuestionFlowGenerationBrief {
26
+ /** The user's original words, replayed verbatim — never a paraphrase. */
27
+ prompt?: string;
28
+ designSystemId?: string | null;
29
+ /** Data URLs; re-attached so the reference screenshot survives the hop. */
30
+ images?: string[];
31
+ /** Extracted text from uploaded files (specs, outlines, token dumps). */
32
+ uploadedFileContext?: string;
33
+ }
34
+
17
35
  interface UseQuestionFlowOptions {
18
36
  enabled?: boolean;
19
37
  continuationTabId?: string | null;
@@ -25,12 +43,49 @@ interface UseQuestionFlowOptions {
25
43
  * filled after render, so a snapshot taken here would be the pre-kickoff one.
26
44
  */
27
45
  getModelSelection?: () => QuestionFlowModelSelection | null | undefined;
46
+ /** Read at send time, for the same reason as `getModelSelection`. */
47
+ getGenerationBrief?: () => QuestionFlowGenerationBrief | null | undefined;
28
48
  }
29
49
 
30
50
  function designQuestionsStateKey(designId: string | undefined): string {
31
51
  return designId ? `show-questions:${designId}` : "show-questions";
32
52
  }
33
53
 
54
+ /**
55
+ * Render the kickoff brief as prompt context for the continuation turn.
56
+ * Exported and pure so the carry-through is testable without a DOM — this is
57
+ * the whole fix for "the agent ignored my design system / screenshot / brief".
58
+ */
59
+ export function buildGenerationBriefContext(
60
+ brief: QuestionFlowGenerationBrief | null | undefined,
61
+ designSystemContext: string,
62
+ ): string {
63
+ return [
64
+ brief?.prompt?.trim()
65
+ ? [
66
+ "## The user's original request (verbatim)",
67
+ "This is the spec for what to build. The answers below refine it;",
68
+ "they do not replace it. Do not restate it as a looser paraphrase.",
69
+ "",
70
+ brief.prompt.trim(),
71
+ ].join("\n")
72
+ : "",
73
+ brief?.images?.length
74
+ ? [
75
+ `## ${brief.images.length} reference image(s) re-attached to this message`,
76
+ "Treat an attached UI screenshot as a layout specification to",
77
+ "reproduce — its structure, hierarchy, density, and component",
78
+ "grammar — not as loose inspiration. Match it unless an answer",
79
+ "below explicitly overrides a part of it.",
80
+ ].join("\n")
81
+ : "",
82
+ brief?.uploadedFileContext?.trim() ?? "",
83
+ designSystemContext,
84
+ ]
85
+ .filter(Boolean)
86
+ .join("\n\n");
87
+ }
88
+
34
89
  const RESPONSIVE_GENERATION_REQUIREMENTS =
35
90
  'Responsive behavior is mandatory for every web design. Read the form-factor answer above: for Desktop or Both/responsive, call generate-design with `primaryViewport: "desktop"` and a 1440x1024 canvas frame; use `primaryViewport: "mobile"` only for an explicitly mobile-primary choice. Use mobile-first responsive CSS, then take desktop and mobile screenshots and fix any overflow before reporting the design complete.';
36
91
 
@@ -47,6 +102,7 @@ export function useQuestionFlow(
47
102
  continuationTabId,
48
103
  onContinue,
49
104
  getModelSelection,
105
+ getGenerationBrief,
50
106
  }: UseQuestionFlowOptions = {},
51
107
  ) {
52
108
  const stateKey = designQuestionsStateKey(designId);
@@ -79,9 +135,21 @@ export function useQuestionFlow(
79
135
  });
80
136
 
81
137
  const sendContinuation = useCallback(
82
- (message: string, context?: string) => {
138
+ async (message: string, context?: string) => {
83
139
  const selection = getModelSelection?.() ?? {};
84
140
  const { model, engine, effort } = selection;
141
+ const brief = getGenerationBrief?.() ?? null;
142
+ // Re-hydrated rather than snapshotted at kickoff: the user can link or
143
+ // change the design system while the questionnaire is open. This never
144
+ // throws — a load failure returns instruction text telling the agent to
145
+ // stop rather than improvise a generic style.
146
+ const designSystemContext = brief?.designSystemId
147
+ ? await loadDesignSystemGenerationContext(brief.designSystemId)
148
+ : "";
149
+ const briefContext = buildGenerationBriefContext(
150
+ brief,
151
+ designSystemContext,
152
+ );
85
153
  // Always request `newTab` (mirroring useAgentGenerating.submit's
86
154
  // default). Without it, when there is no continuationTabId yet the
87
155
  // message goes to whatever tab is currently active, but the id we
@@ -96,9 +164,10 @@ export function useQuestionFlow(
96
164
  // real destination thread.
97
165
  const tabId = sendToDesignAgentChat({
98
166
  message,
99
- context,
167
+ context: [briefContext, context].filter(Boolean).join("\n\n"),
100
168
  submit: true,
101
169
  newTab: true,
170
+ ...(brief?.images?.length ? { images: brief.images } : {}),
102
171
  ...(continuationTabId ? { tabId: continuationTabId } : {}),
103
172
  ...(model ? { model } : {}),
104
173
  ...(engine ? { engine } : {}),
@@ -107,7 +176,14 @@ export function useQuestionFlow(
107
176
  onContinue?.(tabId);
108
177
  flow.clear();
109
178
  },
110
- [continuationTabId, designId, flow, getModelSelection, onContinue],
179
+ [
180
+ continuationTabId,
181
+ designId,
182
+ flow,
183
+ getGenerationBrief,
184
+ getModelSelection,
185
+ onContinue,
186
+ ],
111
187
  );
112
188
 
113
189
  const handleSubmit = useCallback(
@@ -129,13 +205,13 @@ export function useQuestionFlow(
129
205
  .filter(Boolean)
130
206
  .join("\n");
131
207
 
132
- sendContinuation("Here are my answers — go ahead.", context);
208
+ void sendContinuation("Here are my answers — go ahead.", context);
133
209
  },
134
210
  [designId, sendContinuation],
135
211
  );
136
212
 
137
213
  const handleSkip = useCallback(() => {
138
- sendContinuation(
214
+ void sendContinuation(
139
215
  "Skip the questions — decide for me.",
140
216
  designId
141
217
  ? `The user skipped the pre-generation questions for design ${designId}. Proceed with reasonable defaults. ${RESPONSIVE_GENERATION_REQUIREMENTS} Generate one polished first direction unless the original prompt explicitly requested options.`
@@ -25,7 +25,7 @@ const messages = {
25
25
  commentMode: "Comment",
26
26
  sendToAgent: "Send to agent",
27
27
  sendingToAgent: "Sending to agent…",
28
- enterToPost: "Enter to post · Shift+Enter for a new line",
28
+ enterToPost: "Enter to post · Shift Enter for a new line",
29
29
  post: "Post",
30
30
  posting: "Posting…",
31
31
  postFailed: "Could not post this comment",
@@ -754,7 +754,7 @@ const enUS = {
754
754
  big: "Big nudge",
755
755
  unit: "px",
756
756
  description:
757
- "Arrow keys move by the small amount and Shift+arrow by the big one. Inside an auto layout frame, arrows reorder the layer instead of moving it.",
757
+ "Arrow keys move by the small amount and Shift arrow by the big one. Inside an auto layout frame, arrows reorder the layer instead of moving it.",
758
758
  },
759
759
  keys: {
760
760
  or: "or",
@@ -1487,6 +1487,8 @@ const enUS = {
1487
1487
  websiteUrl: "Website-URL",
1488
1488
  add: "Add",
1489
1489
  githubRepository: "GitHub repository",
1490
+ githubRef: "Branch, tag, or commit (optional)",
1491
+ githubPaths: "Files or folders, comma-separated (optional)",
1490
1492
  privateRepoPrefix: "Private repos need a fine-grained token saved as",
1491
1493
  privateRepoSuffix: "with Contents read access.",
1492
1494
  localCodeFiles: "Connect code files",
@@ -1658,6 +1660,7 @@ const enUS = {
1658
1660
  logos: "Logos",
1659
1661
  assets: "Assets",
1660
1662
  savedCount: "{{count}} saved",
1663
+ namedTokens: "Named tokens",
1661
1664
  colorLabels: {
1662
1665
  primary: "Primary",
1663
1666
  secondary: "Secondary",
@@ -1964,6 +1967,8 @@ const designLocaleOverrides = {
1964
1967
  websiteUrl: "网站URL",
1965
1968
  add: "添加",
1966
1969
  githubRepository: "GitHub 存储库",
1970
+ githubRef: "分支、标签或提交(可选)",
1971
+ githubPaths: "文件或文件夹,以逗号分隔(可选)",
1967
1972
  privateRepoPrefix: "私人仓库需要一个细粒度的令牌,另存为",
1968
1973
  privateRepoSuffix: "具有内容读取权限。",
1969
1974
  localCodeFiles: "连接代码文件",
@@ -2128,6 +2133,7 @@ const designLocaleOverrides = {
2128
2133
  logos: "标志",
2129
2134
  assets: "资产",
2130
2135
  savedCount: "已保存 {{count}} 个",
2136
+ namedTokens: "具名代币",
2131
2137
  colorLabels: {
2132
2138
  primary: "基本的",
2133
2139
  secondary: "中学",
@@ -2379,6 +2385,8 @@ const designLocaleOverrides = {
2379
2385
  websiteUrl: "Sitio web URL",
2380
2386
  add: "Agregar",
2381
2387
  githubRepository: "repositorio GitHub",
2388
+ githubRef: "Rama, etiqueta o commit (opcional)",
2389
+ githubPaths: "Archivos o carpetas, separados por comas (opcional)",
2382
2390
  privateRepoPrefix:
2383
2391
  "Los repositorios privados necesitan un token detallado guardado como",
2384
2392
  privateRepoSuffix: "con acceso de lectura de contenidos.",
@@ -2558,6 +2566,7 @@ const designLocaleOverrides = {
2558
2566
  logos: "Logotipos",
2559
2567
  assets: "Activos",
2560
2568
  savedCount: "{{count}} guardado",
2569
+ namedTokens: "Tokens con nombre",
2561
2570
  colorLabels: {
2562
2571
  primary: "Primario",
2563
2572
  secondary: "Secundario",
@@ -2814,6 +2823,9 @@ const designLocaleOverrides = {
2814
2823
  websiteUrl: "Site Web URL",
2815
2824
  add: "Ajouter",
2816
2825
  githubRepository: "référentiel GitHub",
2826
+ githubRef: "Branche, tag ou commit (facultatif)",
2827
+ githubPaths:
2828
+ "Fichiers ou dossiers, séparés par des virgules (facultatif)",
2817
2829
  privateRepoPrefix:
2818
2830
  "Les dépôts privés nécessitent un jeton à granularité fine enregistré sous",
2819
2831
  privateRepoSuffix: "avec accès en lecture au contenu.",
@@ -2993,6 +3005,7 @@ const designLocaleOverrides = {
2993
3005
  logos: "Logos",
2994
3006
  assets: "Actifs",
2995
3007
  savedCount: "{{count}} enregistré",
3008
+ namedTokens: "Jetons nommés",
2996
3009
  colorLabels: {
2997
3010
  primary: "Primaire",
2998
3011
  secondary: "Secondaire",
@@ -3249,6 +3262,8 @@ const designLocaleOverrides = {
3249
3262
  websiteUrl: "Website URL",
3250
3263
  add: "Hinzufügen",
3251
3264
  githubRepository: "GitHub-Repository",
3265
+ githubRef: "Branch, Tag oder Commit (optional)",
3266
+ githubPaths: "Dateien oder Ordner, durch Kommas getrennt (optional)",
3252
3267
  privateRepoPrefix:
3253
3268
  "Private Repos benötigen einen feinkörnigen Token, der unter gespeichert wird",
3254
3269
  privateRepoSuffix: "mit Lesezugriff auf Inhalte.",
@@ -3429,6 +3444,7 @@ const designLocaleOverrides = {
3429
3444
  logos: "Logos",
3430
3445
  assets: "Vermögenswerte",
3431
3446
  savedCount: "{{count}} gespeichert",
3447
+ namedTokens: "Benannte Tokens",
3432
3448
  colorLabels: {
3433
3449
  primary: "Primär",
3434
3450
  secondary: "Sekundär",
@@ -3684,6 +3700,8 @@ const designLocaleOverrides = {
3684
3700
  websiteUrl: "ウェブサイト URL",
3685
3701
  add: "追加",
3686
3702
  githubRepository: "GitHub リポジトリ",
3703
+ githubRef: "ブランチ、タグ、コミット(任意)",
3704
+ githubPaths: "ファイルまたはフォルダー(カンマ区切り、任意)",
3687
3705
  privateRepoPrefix:
3688
3706
  "プライベート リポジトリには、次のように保存されたきめ細かいトークンが必要です。",
3689
3707
  privateRepoSuffix: "コンテンツ読み取りアクセス付き。",
@@ -3860,6 +3878,7 @@ const designLocaleOverrides = {
3860
3878
  logos: "ロゴ",
3861
3879
  assets: "資産",
3862
3880
  savedCount: "{{count}} 保存しました",
3881
+ namedTokens: "名前付きトークン",
3863
3882
  colorLabels: {
3864
3883
  primary: "主要な",
3865
3884
  secondary: "二次",
@@ -4113,6 +4132,8 @@ const designLocaleOverrides = {
4113
4132
  websiteUrl: "웹사이트 URL",
4114
4133
  add: "추가하다",
4115
4134
  githubRepository: "GitHub 저장소",
4135
+ githubRef: "브랜치, 태그 또는 커밋 (선택 사항)",
4136
+ githubPaths: "파일 또는 폴더, 쉼표로 구분 (선택 사항)",
4116
4137
  privateRepoPrefix:
4117
4138
  "비공개 저장소에는 다음과 같이 저장된 세분화된 토큰이 필요합니다.",
4118
4139
  privateRepoSuffix: "콘텐츠 읽기 액세스 권한이 있습니다.",
@@ -4284,6 +4305,7 @@ const designLocaleOverrides = {
4284
4305
  logos: "로고",
4285
4306
  assets: "자산",
4286
4307
  savedCount: "{{count}}가 저장되었습니다.",
4308
+ namedTokens: "이름이 지정된 토큰",
4287
4309
  colorLabels: {
4288
4310
  primary: "주요한",
4289
4311
  secondary: "반성",
@@ -4538,6 +4560,8 @@ const designLocaleOverrides = {
4538
4560
  websiteUrl: "Site URL",
4539
4561
  add: "Adicionar",
4540
4562
  githubRepository: "repositório GitHub",
4563
+ githubRef: "Branch, tag ou commit (opcional)",
4564
+ githubPaths: "Arquivos ou pastas, separados por vírgulas (opcional)",
4541
4565
  privateRepoPrefix:
4542
4566
  "Os repositórios privados precisam de um token refinado salvo como",
4543
4567
  privateRepoSuffix: "com acesso de leitura de conteúdo.",
@@ -4715,6 +4739,7 @@ const designLocaleOverrides = {
4715
4739
  logos: "Logotipos",
4716
4740
  assets: "Ativos",
4717
4741
  savedCount: "{{count}} salvo",
4742
+ namedTokens: "Tokens nomeados",
4718
4743
  colorLabels: {
4719
4744
  primary: "Primário",
4720
4745
  secondary: "Secundário",
@@ -4967,6 +4992,8 @@ const designLocaleOverrides = {
4967
4992
  websiteUrl: "वेबसाइट URL",
4968
4993
  add: "जोड़ना",
4969
4994
  githubRepository: "GitHub रिपॉजिटरी",
4995
+ githubRef: "ब्रांच, टैग या कमिट (वैकल्पिक)",
4996
+ githubPaths: "फ़ाइलें या फ़ोल्डर, कॉमा से अलग (वैकल्पिक)",
4970
4997
  privateRepoPrefix:
4971
4998
  "निजी रेपो को एक बढ़िया टोकन के रूप में सहेजे जाने की आवश्यकता होती है",
4972
4999
  privateRepoSuffix: "सामग्री पढ़ने की पहुंच के साथ।",
@@ -5137,6 +5164,7 @@ const designLocaleOverrides = {
5137
5164
  logos: "लोगो",
5138
5165
  assets: "संपत्ति",
5139
5166
  savedCount: "{{count}} सहेजा गया",
5167
+ namedTokens: "नामित टोकन",
5140
5168
  colorLabels: {
5141
5169
  primary: "प्राथमिक",
5142
5170
  secondary: "माध्यमिक",
@@ -5387,6 +5415,8 @@ const designLocaleOverrides = {
5387
5415
  websiteUrl: "موقع URL",
5388
5416
  add: "يضيف",
5389
5417
  githubRepository: "مستودع GitHub",
5418
+ githubRef: "فرع أو وسم أو التزام (اختياري)",
5419
+ githubPaths: "الملفات أو المجلدات، مفصولة بفواصل (اختياري)",
5390
5420
  privateRepoPrefix:
5391
5421
  "تحتاج عمليات إعادة الشراء الخاصة إلى رمز مميز محفوظ باسم",
5392
5422
  privateRepoSuffix: "مع محتويات الوصول للقراءة.",
@@ -5558,6 +5588,7 @@ const designLocaleOverrides = {
5558
5588
  logos: "الشعارات",
5559
5589
  assets: "أصول",
5560
5590
  savedCount: "تم حفظ {{count}}",
5591
+ namedTokens: "الرموز المميزة المسماة",
5561
5592
  colorLabels: {
5562
5593
  primary: "أساسي",
5563
5594
  secondary: "ثانوي",
@@ -58,7 +58,7 @@ export const keyboardShortcutLabels = {
58
58
  nudgeAmountSmall: "小距離",
59
59
  nudgeAmountBig: "大距離",
60
60
  nudgeAmountDescription:
61
- "方向鍵以小距離移動,Shift+方向鍵以大距離移動。在自動版面配置框架內,方向鍵改為調整圖層順序。",
61
+ "方向鍵以小距離移動,Shift 方向鍵以大距離移動。在自動版面配置框架內,方向鍵改為調整圖層順序。",
62
62
  },
63
63
  "zh-CN": {
64
64
  title: "键盘快捷键",
@@ -76,7 +76,7 @@ export const keyboardShortcutLabels = {
76
76
  nudgeAmountSmall: "小距离",
77
77
  nudgeAmountBig: "大距离",
78
78
  nudgeAmountDescription:
79
- "方向键以小距离移动,Shift+方向键以大距离移动。在自动布局框架内,方向键改为调整图层顺序。",
79
+ "方向键以小距离移动,Shift 方向键以大距离移动。在自动布局框架内,方向键改为调整图层顺序。",
80
80
  },
81
81
  "es-ES": {
82
82
  title: "Atajos de teclado",
@@ -95,7 +95,7 @@ export const keyboardShortcutLabels = {
95
95
  nudgeAmountSmall: "Desplazamiento pequeño",
96
96
  nudgeAmountBig: "Desplazamiento grande",
97
97
  nudgeAmountDescription:
98
- "Las flechas mueven la cantidad pequeña y Mayús+flecha la grande. Dentro de un marco de autodiseño, las flechas reordenan la capa.",
98
+ "Las flechas mueven la cantidad pequeña y Mayús flecha la grande. Dentro de un marco de autodiseño, las flechas reordenan la capa.",
99
99
  },
100
100
  "fr-FR": {
101
101
  title: "Raccourcis clavier",
@@ -115,7 +115,7 @@ export const keyboardShortcutLabels = {
115
115
  nudgeAmountSmall: "Petit déplacement",
116
116
  nudgeAmountBig: "Grand déplacement",
117
117
  nudgeAmountDescription:
118
- "Les flèches déplacent de la petite valeur et Maj+flèche de la grande. Dans un cadre en disposition automatique, les flèches réorganisent le calque.",
118
+ "Les flèches déplacent de la petite valeur et Maj flèche de la grande. Dans un cadre en disposition automatique, les flèches réorganisent le calque.",
119
119
  },
120
120
  "de-DE": {
121
121
  title: "Tastenkürzel",
@@ -135,7 +135,7 @@ export const keyboardShortcutLabels = {
135
135
  nudgeAmountSmall: "Kleiner Schritt",
136
136
  nudgeAmountBig: "Großer Schritt",
137
137
  nudgeAmountDescription:
138
- "Pfeiltasten verschieben um den kleinen Wert, Umschalt+Pfeil um den großen. In einem Auto-Layout-Rahmen ordnen die Pfeiltasten die Ebene neu an.",
138
+ "Pfeiltasten verschieben um den kleinen Wert, Umschalt Pfeil um den großen. In einem Auto-Layout-Rahmen ordnen die Pfeiltasten die Ebene neu an.",
139
139
  },
140
140
  "ja-JP": {
141
141
  title: "キーボードショートカット",
@@ -153,7 +153,7 @@ export const keyboardShortcutLabels = {
153
153
  nudgeAmountSmall: "小さい移動量",
154
154
  nudgeAmountBig: "大きい移動量",
155
155
  nudgeAmountDescription:
156
- "矢印キーは小さい移動量、Shift+矢印キーは大きい移動量で移動します。オートレイアウトフレーム内では、矢印キーはレイヤーの順序を変更します。",
156
+ "矢印キーは小さい移動量、Shift 矢印キーは大きい移動量で移動します。オートレイアウトフレーム内では、矢印キーはレイヤーの順序を変更します。",
157
157
  },
158
158
  "ko-KR": {
159
159
  title: "키보드 단축키",
@@ -171,7 +171,7 @@ export const keyboardShortcutLabels = {
171
171
  nudgeAmountSmall: "작은 이동",
172
172
  nudgeAmountBig: "큰 이동",
173
173
  nudgeAmountDescription:
174
- "화살표 키는 작은 간격으로, Shift+화살표 키는 큰 간격으로 이동합니다. 오토 레이아웃 프레임 안에서는 화살표 키가 레이어 순서를 변경합니다.",
174
+ "화살표 키는 작은 간격으로, Shift 화살표 키는 큰 간격으로 이동합니다. 오토 레이아웃 프레임 안에서는 화살표 키가 레이어 순서를 변경합니다.",
175
175
  },
176
176
  "pt-BR": {
177
177
  title: "Atalhos de teclado",
@@ -191,7 +191,7 @@ export const keyboardShortcutLabels = {
191
191
  nudgeAmountSmall: "Deslocamento pequeno",
192
192
  nudgeAmountBig: "Deslocamento grande",
193
193
  nudgeAmountDescription:
194
- "As setas movem pela distância pequena e Shift+seta pela grande. Dentro de um frame com layout automático, as setas reordenam a camada.",
194
+ "As setas movem pela distância pequena e Shift seta pela grande. Dentro de um frame com layout automático, as setas reordenam a camada.",
195
195
  },
196
196
  "hi-IN": {
197
197
  title: "कीबोर्ड शॉर्टकट",
@@ -209,7 +209,7 @@ export const keyboardShortcutLabels = {
209
209
  nudgeAmountSmall: "छोटी नज",
210
210
  nudgeAmountBig: "बड़ी नज",
211
211
  nudgeAmountDescription:
212
- "ऐरो कुंजियाँ छोटी दूरी से और Shift+ऐरो बड़ी दूरी से ले जाती हैं। ऑटो लेआउट फ़्रेम के अंदर ऐरो कुंजियाँ लेयर का क्रम बदलती हैं।",
212
+ "ऐरो कुंजियाँ छोटी दूरी से और Shift ऐरो बड़ी दूरी से ले जाती हैं। ऑटो लेआउट फ़्रेम के अंदर ऐरो कुंजियाँ लेयर का क्रम बदलती हैं।",
213
213
  },
214
214
  "ar-SA": {
215
215
  title: "اختصارات لوحة المفاتيح",
@@ -227,7 +227,7 @@ export const keyboardShortcutLabels = {
227
227
  nudgeAmountSmall: "إزاحة صغيرة",
228
228
  nudgeAmountBig: "إزاحة كبيرة",
229
229
  nudgeAmountDescription:
230
- "تحرّك مفاتيح الأسهم بالمقدار الصغير، وShift+سهم بالمقدار الكبير. داخل إطار التخطيط التلقائي، تعيد مفاتيح الأسهم ترتيب الطبقة.",
230
+ "تحرّك مفاتيح الأسهم بالمقدار الصغير، وShift سهم بالمقدار الكبير. داخل إطار التخطيط التلقائي، تعيد مفاتيح الأسهم ترتيب الطبقة.",
231
231
  },
232
232
  } satisfies Record<Exclude<LocaleCode, "en-US">, KeyboardShortcutLabels>;
233
233