@agent-native/core 0.41.1 → 0.43.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 (181) hide show
  1. package/README.md +17 -56
  2. package/dist/action.d.ts +13 -1
  3. package/dist/action.d.ts.map +1 -1
  4. package/dist/action.js.map +1 -1
  5. package/dist/agent/production-agent.d.ts +8 -0
  6. package/dist/agent/production-agent.d.ts.map +1 -1
  7. package/dist/agent/production-agent.js +93 -0
  8. package/dist/agent/production-agent.js.map +1 -1
  9. package/dist/cli/app-skill.d.ts +16 -0
  10. package/dist/cli/app-skill.d.ts.map +1 -1
  11. package/dist/cli/app-skill.js +33 -3
  12. package/dist/cli/app-skill.js.map +1 -1
  13. package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
  14. package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
  15. package/dist/cli/pr-visual-recap-workflow.js +1 -1
  16. package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
  17. package/dist/cli/recap.d.ts.map +1 -1
  18. package/dist/cli/recap.js +38 -16
  19. package/dist/cli/recap.js.map +1 -1
  20. package/dist/cli/skills.d.ts +30 -3
  21. package/dist/cli/skills.d.ts.map +1 -1
  22. package/dist/cli/skills.js +180 -114
  23. package/dist/cli/skills.js.map +1 -1
  24. package/dist/client/AssistantChat.d.ts.map +1 -1
  25. package/dist/client/AssistantChat.js +2 -2
  26. package/dist/client/AssistantChat.js.map +1 -1
  27. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  28. package/dist/client/agent-chat-adapter.js +172 -5
  29. package/dist/client/agent-chat-adapter.js.map +1 -1
  30. package/dist/client/blocks/index.d.ts +11 -0
  31. package/dist/client/blocks/index.d.ts.map +1 -1
  32. package/dist/client/blocks/index.js +11 -0
  33. package/dist/client/blocks/index.js.map +1 -1
  34. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +19 -0
  35. package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +1 -1
  36. package/dist/client/blocks/library/AnnotatedCodeBlock.js +6 -58
  37. package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +1 -1
  38. package/dist/client/blocks/library/ApiEndpointBlock.d.ts.map +1 -1
  39. package/dist/client/blocks/library/ApiEndpointBlock.js +116 -7
  40. package/dist/client/blocks/library/ApiEndpointBlock.js.map +1 -1
  41. package/dist/client/blocks/library/DataModelBlock.d.ts.map +1 -1
  42. package/dist/client/blocks/library/DataModelBlock.js +75 -9
  43. package/dist/client/blocks/library/DataModelBlock.js.map +1 -1
  44. package/dist/client/blocks/library/DiffBlock.d.ts +1 -1
  45. package/dist/client/blocks/library/DiffBlock.d.ts.map +1 -1
  46. package/dist/client/blocks/library/DiffBlock.js +265 -39
  47. package/dist/client/blocks/library/DiffBlock.js.map +1 -1
  48. package/dist/client/blocks/library/FileTreeBlock.d.ts.map +1 -1
  49. package/dist/client/blocks/library/FileTreeBlock.js +27 -4
  50. package/dist/client/blocks/library/FileTreeBlock.js.map +1 -1
  51. package/dist/client/blocks/library/HighlightedCode.d.ts +1 -1
  52. package/dist/client/blocks/library/HighlightedCode.js +1 -1
  53. package/dist/client/blocks/library/HighlightedCode.js.map +1 -1
  54. package/dist/client/blocks/library/JsonExplorerBlock.js +1 -1
  55. package/dist/client/blocks/library/JsonExplorerBlock.js.map +1 -1
  56. package/dist/client/blocks/library/MermaidBlock.js +1 -1
  57. package/dist/client/blocks/library/MermaidBlock.js.map +1 -1
  58. package/dist/client/blocks/library/annotation-rail.d.ts +115 -0
  59. package/dist/client/blocks/library/annotation-rail.d.ts.map +1 -0
  60. package/dist/client/blocks/library/annotation-rail.js +139 -0
  61. package/dist/client/blocks/library/annotation-rail.js.map +1 -0
  62. package/dist/client/blocks/library/api-endpoint.config.d.ts +31 -6
  63. package/dist/client/blocks/library/api-endpoint.config.d.ts.map +1 -1
  64. package/dist/client/blocks/library/api-endpoint.config.js +30 -6
  65. package/dist/client/blocks/library/api-endpoint.config.js.map +1 -1
  66. package/dist/client/blocks/library/callout.config.d.ts +29 -0
  67. package/dist/client/blocks/library/callout.config.d.ts.map +1 -0
  68. package/dist/client/blocks/library/callout.config.js +33 -0
  69. package/dist/client/blocks/library/callout.config.js.map +1 -0
  70. package/dist/client/blocks/library/callout.d.ts +20 -0
  71. package/dist/client/blocks/library/callout.d.ts.map +1 -0
  72. package/dist/client/blocks/library/callout.js +61 -0
  73. package/dist/client/blocks/library/callout.js.map +1 -0
  74. package/dist/client/blocks/library/checklist.d.ts.map +1 -1
  75. package/dist/client/blocks/library/checklist.js +3 -3
  76. package/dist/client/blocks/library/checklist.js.map +1 -1
  77. package/dist/client/blocks/library/code.d.ts.map +1 -1
  78. package/dist/client/blocks/library/code.js +32 -15
  79. package/dist/client/blocks/library/code.js.map +1 -1
  80. package/dist/client/blocks/library/columns.d.ts.map +1 -1
  81. package/dist/client/blocks/library/columns.js +56 -35
  82. package/dist/client/blocks/library/columns.js.map +1 -1
  83. package/dist/client/blocks/library/data-model.config.d.ts +17 -0
  84. package/dist/client/blocks/library/data-model.config.d.ts.map +1 -1
  85. package/dist/client/blocks/library/data-model.config.js +15 -0
  86. package/dist/client/blocks/library/data-model.config.js.map +1 -1
  87. package/dist/client/blocks/library/decision.config.d.ts +37 -0
  88. package/dist/client/blocks/library/decision.config.d.ts.map +1 -0
  89. package/dist/client/blocks/library/decision.config.js +32 -0
  90. package/dist/client/blocks/library/decision.config.js.map +1 -0
  91. package/dist/client/blocks/library/decision.d.ts +19 -0
  92. package/dist/client/blocks/library/decision.d.ts.map +1 -0
  93. package/dist/client/blocks/library/decision.js +119 -0
  94. package/dist/client/blocks/library/decision.js.map +1 -0
  95. package/dist/client/blocks/library/diagram.config.d.ts +64 -0
  96. package/dist/client/blocks/library/diagram.config.d.ts.map +1 -0
  97. package/dist/client/blocks/library/diagram.config.js +111 -0
  98. package/dist/client/blocks/library/diagram.config.js.map +1 -0
  99. package/dist/client/blocks/library/diagram.d.ts +16 -0
  100. package/dist/client/blocks/library/diagram.d.ts.map +1 -0
  101. package/dist/client/blocks/library/diagram.js +261 -0
  102. package/dist/client/blocks/library/diagram.js.map +1 -0
  103. package/dist/client/blocks/library/diff.config.d.ts +28 -6
  104. package/dist/client/blocks/library/diff.config.d.ts.map +1 -1
  105. package/dist/client/blocks/library/diff.config.js +30 -6
  106. package/dist/client/blocks/library/diff.config.js.map +1 -1
  107. package/dist/client/blocks/library/question-form.config.d.ts +69 -0
  108. package/dist/client/blocks/library/question-form.config.d.ts.map +1 -0
  109. package/dist/client/blocks/library/question-form.config.js +58 -0
  110. package/dist/client/blocks/library/question-form.config.js.map +1 -0
  111. package/dist/client/blocks/library/question-form.d.ts +20 -0
  112. package/dist/client/blocks/library/question-form.d.ts.map +1 -0
  113. package/dist/client/blocks/library/question-form.js +286 -0
  114. package/dist/client/blocks/library/question-form.js.map +1 -0
  115. package/dist/client/blocks/library/sanitize-html.d.ts +5 -0
  116. package/dist/client/blocks/library/sanitize-html.d.ts.map +1 -0
  117. package/dist/client/blocks/library/sanitize-html.js +240 -0
  118. package/dist/client/blocks/library/sanitize-html.js.map +1 -0
  119. package/dist/client/blocks/library/server-specs.d.ts.map +1 -1
  120. package/dist/client/blocks/library/server-specs.js +59 -0
  121. package/dist/client/blocks/library/server-specs.js.map +1 -1
  122. package/dist/client/blocks/library/specs.d.ts.map +1 -1
  123. package/dist/client/blocks/library/specs.js +11 -0
  124. package/dist/client/blocks/library/specs.js.map +1 -1
  125. package/dist/client/blocks/library/tabs.d.ts.map +1 -1
  126. package/dist/client/blocks/library/tabs.js +12 -12
  127. package/dist/client/blocks/library/tabs.js.map +1 -1
  128. package/dist/client/blocks/library/wireframe-kit.d.ts +260 -0
  129. package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -0
  130. package/dist/client/blocks/library/wireframe-kit.js +920 -0
  131. package/dist/client/blocks/library/wireframe-kit.js.map +1 -0
  132. package/dist/client/blocks/library/wireframe.config.d.ts +123 -0
  133. package/dist/client/blocks/library/wireframe.config.d.ts.map +1 -0
  134. package/dist/client/blocks/library/wireframe.config.js +294 -0
  135. package/dist/client/blocks/library/wireframe.config.js.map +1 -0
  136. package/dist/client/blocks/library/wireframe.d.ts +15 -0
  137. package/dist/client/blocks/library/wireframe.d.ts.map +1 -0
  138. package/dist/client/blocks/library/wireframe.js +206 -0
  139. package/dist/client/blocks/library/wireframe.js.map +1 -0
  140. package/dist/client/blocks/registry.d.ts +9 -0
  141. package/dist/client/blocks/registry.d.ts.map +1 -1
  142. package/dist/client/blocks/registry.js +12 -5
  143. package/dist/client/blocks/registry.js.map +1 -1
  144. package/dist/client/blocks/server.d.ts +1 -0
  145. package/dist/client/blocks/server.d.ts.map +1 -1
  146. package/dist/client/blocks/server.js +1 -0
  147. package/dist/client/blocks/server.js.map +1 -1
  148. package/dist/client/blocks/types.d.ts +10 -2
  149. package/dist/client/blocks/types.d.ts.map +1 -1
  150. package/dist/client/blocks/types.js.map +1 -1
  151. package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +1 -1
  152. package/dist/client/rich-markdown-editor/DragHandle.js +152 -21
  153. package/dist/client/rich-markdown-editor/DragHandle.js.map +1 -1
  154. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts +25 -1
  155. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +1 -1
  156. package/dist/client/rich-markdown-editor/RegistryBlockNode.js +29 -6
  157. package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +1 -1
  158. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +8 -1
  159. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -1
  160. package/dist/client/rich-markdown-editor/SharedRichEditor.js +5 -1
  161. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -1
  162. package/dist/extensions/actions.d.ts.map +1 -1
  163. package/dist/extensions/actions.js +159 -12
  164. package/dist/extensions/actions.js.map +1 -1
  165. package/dist/extensions/store.d.ts +21 -0
  166. package/dist/extensions/store.d.ts.map +1 -1
  167. package/dist/extensions/store.js +33 -1
  168. package/dist/extensions/store.js.map +1 -1
  169. package/dist/server/recap-image-route.d.ts.map +1 -1
  170. package/dist/server/recap-image-route.js +12 -3
  171. package/dist/server/recap-image-route.js.map +1 -1
  172. package/dist/styles/agent-native.css +1 -0
  173. package/dist/styles/blocks.css +1380 -0
  174. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +30 -5
  175. package/docs/content/plan-plugin.md +107 -0
  176. package/docs/content/pr-visual-recap.md +2 -2
  177. package/docs/content/skills-guide.md +8 -0
  178. package/docs/content/template-plan.md +94 -17
  179. package/package.json +2 -1
  180. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +30 -5
  181. package/docs/content/visual-plans.md +0 -80
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-form.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/question-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GAMnB,MAAM,2BAA2B,CAAC;AAyCnC,SAAS,UAAU,CACjB,QAA8B,EAC9B,MAAuB;IAEvB,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,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AAG,EAAE,CAAC,CAAC;QACZ,WAAW,EAAE,eAAe;QAC5B,SAAS,EAAE;YACT;gBACE,EAAE,EAAE,iBAAiB;gBACrB,KAAK,EAAE,wCAAwC;gBAC/C,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP;wBACE,EAAE,EAAE,UAAU;wBACd,KAAK,EAAE,aAAa;wBACpB,MAAM,EAAE,uCAAuC;wBAC/C,WAAW,EAAE,IAAI;qBAClB;oBACD;wBACE,EAAE,EAAE,UAAU;wBACd,KAAK,EAAE,aAAa;wBACpB,MAAM,EAAE,mCAAmC;qBAC5C;iBACF;gBACD,UAAU,EAAE,IAAI;aACjB;SACF;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\nimport {\n IconCheck,\n IconChevronDown,\n IconClipboardText,\n IconPlus,\n IconSend,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils.js\";\nimport { defineBlock } from \"../types.js\";\nimport type {\n BlockReadProps,\n BlockEditProps,\n BlockRenderContext,\n NestedBlock,\n} from \"../types.js\";\nimport {\n questionFormSchema,\n questionFormMdx,\n visualQuestionsSchema,\n visualQuestionsMdx,\n type QuestionFormData,\n type QuestionFormOption,\n type QuestionFormQuestion,\n type QuestionMode,\n type VisualQuestionsData,\n} from \"./question-form.config.js\";\n\n/**\n * Shared `question-form` and `visual-questions` blocks. A respondent-facing\n * intake form: single/multi/freeform questions, recommended options, optional\n * write-in answers, and optional inline wireframe/diagram previews per option.\n * Lives in core so any app can register it (it originated in the plan template).\n *\n * The block stays app-agnostic:\n * - It is shadcn-free. The \"Send to agent\" affordance uses `ctx.renderEditSurface`\n * (the app-provided popover primitive); when no surface is wired it falls back\n * to a plain button that submits directly.\n * - Submission routes through `ctx.onQuestionFormSubmit` so each app wires its own\n * destination (plan posts the summary into the side agent). The readable summary\n * string is built generically here from questions + collected answers.\n * - Per-option `wireframe`/`diagram` previews render through `ctx.renderBlock`\n * (the same nested-block seam tabs/columns use), so core never imports an app's\n * wireframe or diagram renderer.\n * - Colors map to shadcn theme tokens (`text-muted-foreground`, `border-border`,\n * `bg-background`, `bg-card`, `primary`). The root section carries BOTH the\n * app-neutral `an-questions-block` class and the legacy `plan-questions-block`\n * class so plan renders byte-identically while other apps get the theme treatment.\n */\n\n/**\n * `ctx.onQuestionFormSubmit` is the documented submit hook. It is read off the\n * render context as an optional extra so a host that has not yet added it to its\n * provider degrades to a no-op (the button disables) rather than throwing.\n */\ntype QuestionFormSubmitCtx = BlockRenderContext & {\n onQuestionFormSubmit?: (summary: string) => void;\n};\n\n/**\n * Reviewer answers are transient and never persisted on block data — they live\n * in local component state keyed by question id. `freeform` → a string;\n * `single`/`multi` → selected option ids (with an optional write-in `text`).\n */\ntype QuestionAnswer = { text?: string; selected?: string[] };\ntype QuestionAnswers = Record<string, QuestionAnswer>;\n\nfunction isAnswered(\n question: QuestionFormQuestion,\n answer?: QuestionAnswer,\n): boolean {\n if (question.mode === \"freeform\") return Boolean(answer?.text?.trim());\n return Boolean(answer?.selected?.length || answer?.text?.trim());\n}\n\n/**\n * Build a readable, agent-ready summary string from the questions + collected\n * answers. Generic replacement for the plan-specific `summarizeQuestionForm`.\n */\nfunction summarizeAnswers(\n blockId: string | undefined,\n blockTitle: string | undefined,\n questions: QuestionFormQuestion[],\n answers: QuestionAnswers,\n): string {\n const lines = [\n \"Use these question answers to revise the plan:\",\n blockId ? `Question block: ${blockId}` : \"\",\n blockTitle ? `Section: ${blockTitle}` : \"\",\n \"\",\n ].filter((line) => line !== \"\");\n for (const question of questions) {\n const answer = answers[question.id];\n const selectedLabels =\n question.options\n ?.filter((option) => answer?.selected?.includes(option.id))\n .map((option) => option.label) ?? [];\n const other = answer?.text?.trim();\n const value =\n question.mode === \"freeform\"\n ? other\n : [...selectedLabels, ...(other ? [`Other: ${other}`] : [])].join(\", \");\n lines.push(`- ${question.title}: ${value || \"No answer yet\"}`);\n }\n return lines.join(\"\\n\");\n}\n\n/** Render an inline preview (wireframe or diagram) through the app's dispatcher. */\nfunction OptionVisual({\n type,\n data,\n blockId,\n ctx,\n}: {\n type: \"wireframe\" | \"diagram\";\n data: unknown;\n blockId: string;\n ctx: BlockRenderContext;\n}) {\n if (!data || !ctx.renderBlock) return null;\n const block: NestedBlock = {\n id: `${blockId}-${type}`,\n type,\n data,\n };\n return (\n <>{ctx.renderBlock({ block, editing: false, compactVisuals: true })}</>\n );\n}\n\nfunction QuestionView({\n question,\n index,\n answer,\n blockId,\n ctx,\n onAnswer,\n}: {\n question: QuestionFormQuestion;\n index: number;\n answer?: QuestionAnswer;\n blockId: string;\n ctx: BlockRenderContext;\n onAnswer: (answer: QuestionAnswer) => void;\n}) {\n const selected = answer?.selected ?? [];\n const hasVisualOptions = Boolean(\n question.options?.some((option) => option.wireframe || option.diagram),\n );\n return (\n <article className=\"grid gap-4 sm:grid-cols-[36px_minmax(0,1fr)]\">\n <div className=\"flex size-7 items-center justify-center rounded-full border border-border bg-card text-xs font-semibold text-muted-foreground\">\n {index + 1}\n </div>\n <div>\n <h3 className=\"text-lg font-semibold leading-7 text-foreground\">\n {question.title}\n </h3>\n {question.subtitle && (\n <p className=\"mt-1.5 max-w-3xl text-sm leading-6 text-muted-foreground\">\n {question.subtitle}\n </p>\n )}\n {question.mode === \"freeform\" ? (\n <textarea\n value={answer?.text ?? \"\"}\n onChange={(event) => onAnswer({ text: event.target.value })}\n className=\"mt-4 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring\"\n data-plan-interactive\n placeholder={question.placeholder || \"Add details...\"}\n />\n ) : (\n <div\n className={cn(\n \"mt-4\",\n hasVisualOptions\n ? \"grid gap-4 md:grid-cols-2\"\n : \"grid max-w-4xl gap-3\",\n )}\n >\n {question.options?.map((option) => {\n const isSelected = selected.includes(option.id);\n return (\n <button\n key={option.id}\n type=\"button\"\n data-plan-interactive\n aria-pressed={isSelected}\n className={cn(\n hasVisualOptions\n ? \"grid gap-4 rounded-xl border border-border bg-card p-4 text-left transition-colors hover:bg-accent/30\"\n : \"grid w-full gap-2 rounded-xl border border-border bg-card px-4 py-3 text-left text-foreground transition-colors hover:border-primary/40 hover:bg-accent/30\",\n isSelected && \"border-primary/40 bg-primary/10\",\n )}\n onClick={() => {\n if (question.mode === \"single\") {\n onAnswer({ ...answer, selected: [option.id] });\n return;\n }\n onAnswer({\n ...answer,\n selected: isSelected\n ? selected.filter((id) => id !== option.id)\n : [...selected, option.id],\n });\n }}\n >\n <div className=\"flex min-w-0 items-start gap-3\">\n <span\n className={cn(\n \"mt-0.5 flex size-5 shrink-0 items-center justify-center border\",\n question.mode === \"single\" ? \"rounded-full\" : \"rounded\",\n isSelected\n ? \"border-primary bg-primary text-primary-foreground\"\n : \"border-border\",\n )}\n >\n {isSelected && <IconCheck className=\"size-3.5\" />}\n </span>\n <span>\n <span className=\"text-base font-semibold leading-6 text-foreground\">\n {option.label}\n </span>\n {option.recommended && (\n <>\n {\" \"}\n <span className=\"ml-3 rounded-md border border-primary/30 px-2 py-0.5 align-middle text-[11px] font-medium uppercase tracking-[0.12em] text-primary\">\n Recommended\n </span>\n </>\n )}\n {option.detail && (\n <span className=\"mt-1 block max-w-2xl whitespace-pre-line text-sm font-normal leading-6 text-muted-foreground\">\n {option.detail}\n </span>\n )}\n </span>\n </div>\n {hasVisualOptions && (option.wireframe || option.diagram) && (\n <div className=\"ml-8 grid gap-4 lg:grid-cols-[minmax(0,1fr)_280px]\">\n {option.wireframe != null && (\n <OptionVisual\n type=\"wireframe\"\n data={option.wireframe}\n blockId={`${blockId}-${option.id}`}\n ctx={ctx}\n />\n )}\n {option.diagram != null && (\n <OptionVisual\n type=\"diagram\"\n data={option.diagram}\n blockId={`${blockId}-${option.id}`}\n ctx={ctx}\n />\n )}\n </div>\n )}\n </button>\n );\n })}\n {/* Multiple-choice questions always offer a write-in answer so a\n reviewer can give a custom response instead of the listed\n options. Authors opt out only by setting allowOther: false. */}\n {question.allowOther !== false && (\n <input\n value={answer?.text ?? \"\"}\n onChange={(event) =>\n onAnswer({ ...answer, text: event.target.value })\n }\n className={cn(\n \"h-10 w-full rounded-lg border border-border bg-card px-4 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring\",\n hasVisualOptions ? \"md:col-span-2\" : \"sm:w-80\",\n )}\n data-plan-interactive\n placeholder={\n question.placeholder || \"Other — type your own answer…\"\n }\n />\n )}\n </div>\n )}\n </div>\n </article>\n );\n}\n\n/** The \"Send to agent\" affordance: a popover (via the app surface) when wired. */\nfunction SubmitMenu({\n blockId,\n ctx,\n onSubmit,\n buildSummary,\n}: {\n blockId: string;\n ctx: BlockRenderContext;\n onSubmit?: (summary: string) => void;\n buildSummary: () => string;\n}) {\n const [open, setOpen] = useState(false);\n const trigger = (\n <button\n type=\"button\"\n data-plan-interactive\n className=\"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90\"\n >\n Send to agent\n <IconChevronDown className=\"size-3.5 opacity-70\" />\n </button>\n );\n\n const menu = (\n <div className=\"grid gap-1\">\n <div className=\"px-1 py-1 text-xs font-semibold text-muted-foreground\">\n Send feedback\n </div>\n <button\n type=\"button\"\n data-plan-interactive\n disabled={!onSubmit}\n onClick={() => {\n onSubmit?.(buildSummary());\n setOpen(false);\n }}\n className=\"grid grid-cols-[auto_1fr] items-start gap-2 rounded-md px-2 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50\"\n >\n <IconSend className=\"mt-0.5 size-4\" />\n <span className=\"grid gap-0.5\">\n <span>Send to inline agent</span>\n <span className=\"text-xs font-normal leading-4 text-muted-foreground\">\n Posts answered questions into the app side agent.\n </span>\n </span>\n </button>\n <button\n type=\"button\"\n data-plan-interactive\n onClick={() => {\n void navigator.clipboard.writeText(buildSummary());\n setOpen(false);\n }}\n className=\"grid grid-cols-[auto_1fr] items-start gap-2 rounded-md px-2 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent\"\n >\n <IconClipboardText className=\"mt-0.5 size-4\" />\n <span className=\"grid gap-0.5\">\n <span>Copy for your agent</span>\n <span className=\"text-xs font-normal leading-4 text-muted-foreground\">\n Copies a prompt you can paste into chat.\n </span>\n </span>\n </button>\n </div>\n );\n\n // Prefer the app-provided popover surface (shadcn Popover in plan/content);\n // core stays shadcn-free. Without a surface, fall back to a single button that\n // submits directly so the form still works.\n const surface = ctx.renderEditSurface?.({\n title: \"Send to agent\",\n open,\n onOpenChange: setOpen,\n blockId,\n blockType: \"question-form\",\n trigger,\n children: menu,\n });\n if (surface) return <>{surface}</>;\n\n return (\n <button\n type=\"button\"\n data-plan-interactive\n disabled={!onSubmit}\n onClick={() => onSubmit?.(buildSummary())}\n className=\"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50\"\n >\n Send to agent\n </button>\n );\n}\n\n/** Shared read renderer for both `question-form` and `visual-questions`. */\nfunction QuestionFormReadInner({\n data,\n blockId,\n title,\n ctx,\n}: BlockReadProps<QuestionFormData>) {\n const questions = data.questions;\n const [answers, setAnswers] = useState<QuestionAnswers>({});\n const submitCtx = ctx as QuestionFormSubmitCtx;\n\n useEffect(() => {\n setAnswers({});\n }, [blockId]);\n\n const setAnswer = (questionId: string, next: QuestionAnswer) => {\n setAnswers((current) => ({ ...current, [questionId]: next }));\n };\n\n const answered = questions.filter((question) =>\n isAnswered(question, answers[question.id]),\n ).length;\n const buildSummary = () =>\n summarizeAnswers(blockId, title, questions, answers);\n\n return (\n <section\n className=\"an-questions-block plan-questions-block\"\n data-block-id={blockId}\n >\n {title && (\n <h2 className=\"text-[1.45rem] font-semibold leading-tight text-foreground\">\n {title}\n </h2>\n )}\n <div className=\"mt-7 grid gap-8\">\n {questions.map((question, index) => (\n <QuestionView\n key={question.id}\n question={question}\n index={index}\n answer={answers[question.id]}\n blockId={blockId}\n ctx={ctx}\n onAnswer={(next) => setAnswer(question.id, next)}\n />\n ))}\n </div>\n <div className=\"sticky bottom-0 mt-10 flex items-center justify-between gap-4 border-t border-border bg-background py-4 backdrop-blur\">\n <p className=\"text-sm font-semibold text-muted-foreground\">\n {answered}/{questions.length} answered\n </p>\n <div data-plan-interactive>\n <SubmitMenu\n blockId={blockId}\n ctx={ctx}\n onSubmit={submitCtx.onQuestionFormSubmit}\n buildSummary={buildSummary}\n />\n </div>\n </div>\n </section>\n );\n}\n\nexport function QuestionFormRead(props: BlockReadProps<QuestionFormData>) {\n return <QuestionFormReadInner {...props} />;\n}\n\nexport function VisualQuestionsRead(\n props: BlockReadProps<VisualQuestionsData>,\n) {\n return <QuestionFormReadInner {...props} />;\n}\n\nconst inlineInputClass =\n \"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring\";\nconst inlineTextareaClass =\n \"w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm leading-6 text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring\";\nconst inlineLabelClass =\n \"text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground\";\n\nfunction newLocalId(prefix: string): string {\n return `${prefix}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Shared editor for both `question-form` and `visual-questions`. */\nexport function QuestionFormEdit({\n data,\n onChange,\n editable,\n}: BlockEditProps<QuestionFormData>) {\n const updateQuestion = (\n questionId: string,\n patch: Partial<QuestionFormQuestion>,\n ) =>\n onChange({\n ...data,\n questions: data.questions.map((question) =>\n question.id === questionId ? { ...question, ...patch } : question,\n ),\n });\n\n const addQuestion = () => {\n if (data.questions.length >= 40) return;\n onChange({\n ...data,\n questions: [\n ...data.questions,\n {\n id: newLocalId(\"question\"),\n title: \"New question\",\n mode: \"freeform\",\n placeholder: \"Type an answer...\",\n },\n ],\n });\n };\n\n const removeQuestion = (questionId: string) => {\n if (data.questions.length <= 1) return;\n onChange({\n ...data,\n questions: data.questions.filter(\n (question) => question.id !== questionId,\n ),\n });\n };\n\n const setQuestionMode = (\n question: QuestionFormQuestion,\n mode: QuestionMode,\n ) =>\n updateQuestion(question.id, {\n mode,\n options:\n mode === \"freeform\"\n ? question.options\n : question.options && question.options.length > 0\n ? question.options\n : [\n { id: newLocalId(\"option\"), label: \"Option A\" },\n { id: newLocalId(\"option\"), label: \"Option B\" },\n ],\n });\n\n const updateOption = (\n questionId: string,\n optionId: string,\n patch: Partial<QuestionFormOption>,\n ) =>\n onChange({\n ...data,\n questions: data.questions.map((question) =>\n question.id === questionId\n ? {\n ...question,\n options: (question.options ?? []).map((option) =>\n option.id === optionId ? { ...option, ...patch } : option,\n ),\n }\n : question,\n ),\n });\n\n const addOption = (questionId: string) =>\n onChange({\n ...data,\n questions: data.questions.map((question) =>\n question.id === questionId && (question.options?.length ?? 0) < 40\n ? {\n ...question,\n options: [\n ...(question.options ?? []),\n { id: newLocalId(\"option\"), label: \"New option\" },\n ],\n }\n : question,\n ),\n });\n\n const removeOption = (questionId: string, optionId: string) =>\n onChange({\n ...data,\n questions: data.questions.map((question) => {\n if (question.id !== questionId) return question;\n const nextOptions = (question.options ?? []).filter(\n (option) => option.id !== optionId,\n );\n return { ...question, options: nextOptions };\n }),\n });\n\n return (\n <div className=\"grid gap-6\" data-plan-interactive>\n <div className=\"grid gap-4\">\n {data.questions.map((question, index) => {\n const options = question.options ?? [];\n return (\n <article\n key={question.id}\n className=\"rounded-lg border border-border bg-card p-4\"\n >\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <span className={inlineLabelClass}>Question {index + 1}</span>\n {data.questions.length > 1 && (\n <button\n type=\"button\"\n aria-label={`Delete question ${index + 1}`}\n className=\"inline-flex size-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted hover:text-foreground\"\n disabled={!editable}\n onClick={() => removeQuestion(question.id)}\n >\n <IconTrash className=\"size-4\" />\n </button>\n )}\n </div>\n <div className=\"grid gap-3 md:grid-cols-[minmax(0,1fr)_12rem]\">\n <label className=\"grid gap-1.5\">\n <span className={inlineLabelClass}>Title</span>\n <input\n className={inlineInputClass}\n value={question.title}\n disabled={!editable}\n onChange={(event) =>\n updateQuestion(question.id, {\n title: event.target.value,\n })\n }\n />\n </label>\n <label className=\"grid gap-1.5\">\n <span className={inlineLabelClass}>Mode</span>\n <select\n className={inlineInputClass}\n value={question.mode}\n disabled={!editable}\n onChange={(event) =>\n setQuestionMode(\n question,\n event.target.value as QuestionMode,\n )\n }\n >\n <option value=\"freeform\">Freeform</option>\n <option value=\"single\">Single choice</option>\n <option value=\"multi\">Multi choice</option>\n </select>\n </label>\n </div>\n <label className=\"mt-3 grid gap-1.5\">\n <span className={inlineLabelClass}>Subtitle</span>\n <textarea\n className={inlineTextareaClass}\n rows={2}\n value={question.subtitle ?? \"\"}\n disabled={!editable}\n onChange={(event) =>\n updateQuestion(question.id, {\n subtitle: event.target.value || undefined,\n })\n }\n />\n </label>\n <div className=\"mt-3 grid gap-3 md:grid-cols-[minmax(0,1fr)_auto_auto]\">\n <label className=\"grid gap-1.5\">\n <span className={inlineLabelClass}>Placeholder</span>\n <input\n className={inlineInputClass}\n value={question.placeholder ?? \"\"}\n disabled={!editable}\n onChange={(event) =>\n updateQuestion(question.id, {\n placeholder: event.target.value || undefined,\n })\n }\n />\n </label>\n <label className=\"flex items-end gap-2 text-sm font-semibold text-muted-foreground\">\n <input\n type=\"checkbox\"\n className=\"mb-2 size-4\"\n checked={Boolean(question.required)}\n disabled={!editable}\n onChange={(event) =>\n updateQuestion(question.id, {\n required: event.target.checked || undefined,\n })\n }\n />\n Required\n </label>\n {question.mode !== \"freeform\" && (\n <label className=\"flex items-end gap-2 text-sm font-semibold text-muted-foreground\">\n <input\n type=\"checkbox\"\n className=\"mb-2 size-4\"\n checked={question.allowOther !== false}\n disabled={!editable}\n onChange={(event) =>\n updateQuestion(question.id, {\n allowOther: event.target.checked ? undefined : false,\n })\n }\n />\n Allow write-in\n </label>\n )}\n </div>\n {question.mode !== \"freeform\" && (\n <div className=\"mt-4 grid gap-3\">\n {options.map((option) => (\n <div\n key={option.id}\n className=\"grid gap-3 rounded-md border border-border/80 bg-background p-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]\"\n >\n <label className=\"grid gap-1.5\">\n <span className={inlineLabelClass}>Option</span>\n <input\n className={inlineInputClass}\n value={option.label}\n disabled={!editable}\n onChange={(event) =>\n updateOption(question.id, option.id, {\n label: event.target.value,\n })\n }\n />\n </label>\n <label className=\"grid gap-1.5\">\n <span className={inlineLabelClass}>Detail</span>\n <input\n className={inlineInputClass}\n value={option.detail ?? \"\"}\n disabled={!editable}\n onChange={(event) =>\n updateOption(question.id, option.id, {\n detail: event.target.value || undefined,\n })\n }\n />\n </label>\n <div className=\"flex items-end gap-2\">\n <button\n type=\"button\"\n className={cn(\n \"inline-flex h-9 items-center gap-1.5 rounded-md border border-border px-3 text-sm font-semibold text-muted-foreground hover:bg-muted hover:text-foreground\",\n option.recommended && \"border-ring text-foreground\",\n )}\n disabled={!editable}\n onClick={() =>\n updateOption(question.id, option.id, {\n recommended: !option.recommended,\n })\n }\n >\n {option.recommended && (\n <IconCheck className=\"size-4\" />\n )}\n Recommended\n </button>\n {options.length > 1 && (\n <button\n type=\"button\"\n aria-label={`Delete ${option.label}`}\n className=\"inline-flex size-9 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-muted hover:text-foreground\"\n disabled={!editable}\n onClick={() => removeOption(question.id, option.id)}\n >\n <IconTrash className=\"size-4\" />\n </button>\n )}\n </div>\n </div>\n ))}\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-fit items-center gap-1.5 rounded-md border border-border px-3 text-sm font-semibold text-muted-foreground hover:bg-muted hover:text-foreground\"\n disabled={!editable || options.length >= 40}\n onClick={() => addOption(question.id)}\n >\n <IconPlus className=\"size-4\" />\n Add option\n </button>\n </div>\n )}\n </article>\n );\n })}\n </div>\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-fit items-center gap-1.5 rounded-md border border-border px-3 text-sm font-semibold text-muted-foreground hover:bg-muted hover:text-foreground\"\n disabled={!editable || data.questions.length >= 40}\n onClick={addQuestion}\n >\n <IconPlus className=\"size-4\" />\n Add question\n </button>\n </div>\n );\n}\n\n/**\n * Full client spec for the shared `question-form` block. A respondent-facing\n * intake form edited from the block panel (the schema-ish question shape lives\n * behind the edit surface, not inline).\n */\nexport const questionFormBlock = defineBlock<QuestionFormData>({\n type: \"question-form\",\n schema: questionFormSchema,\n mdx: questionFormMdx,\n Read: QuestionFormRead,\n Edit: QuestionFormEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Question form\",\n description:\n \"An interactive respondent-facing form block for open questions, single-choice or multi-choice option rows, freeform answers, recommended options, and optional wireframe/diagram previews. Edit the question schema from the block panel.\",\n empty: () => ({\n submitLabel: \"Send to agent\",\n questions: [\n {\n id: \"open-question\",\n title: \"What should the agent clarify before revising this plan?\",\n mode: \"freeform\",\n placeholder: \"Add constraints, preferences, or a decision...\",\n },\n ],\n }),\n});\n\n/**\n * Full client spec for the shared `visual-questions` block — the same form UI\n * and data shape as `question-form`, branded for explicit visual intake before a\n * plan. Shares the Read/Edit internals; only the type, MDX tag, label, and seed\n * differ.\n */\nexport const visualQuestionsBlock = defineBlock<VisualQuestionsData>({\n type: \"visual-questions\",\n schema: visualQuestionsSchema,\n mdx: visualQuestionsMdx,\n Read: VisualQuestionsRead,\n Edit: QuestionFormEdit,\n placement: [\"block\"],\n editSurface: \"panel\",\n label: \"Visual questions\",\n description:\n \"A visual-intake question block that renders the respondent-facing question UI (single/multi/freeform, recommended options, inline wireframe/diagram previews) and keeps schema editing in the block panel.\",\n empty: () => ({\n submitLabel: \"Send to agent\",\n questions: [\n {\n id: \"visual-question\",\n title: \"Which direction should this plan take?\",\n mode: \"single\",\n options: [\n {\n id: \"option-a\",\n label: \"Direction A\",\n detail: \"Keep the current shape and refine it.\",\n recommended: true,\n },\n {\n id: \"option-b\",\n label: \"Direction B\",\n detail: \"Try a larger structural revision.\",\n },\n ],\n allowOther: true,\n },\n ],\n }),\n});\n"]}
@@ -0,0 +1,5 @@
1
+ export declare function sanitizeWireframeHtml(html: string | undefined): string;
2
+ export declare function sanitizeDiagramHtml(html: string | undefined): string;
3
+ export declare function sanitizeWireframeCss(css: string | undefined): string;
4
+ export declare function scopeDesignCss(css: string, scopeSelector: string): string;
5
+ //# sourceMappingURL=sanitize-html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-html.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/sanitize-html.ts"],"names":[],"mappings":"AAqHA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAStE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAcpE;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAoBpE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAsBzE"}
@@ -0,0 +1,240 @@
1
+ /*
2
+ * Render-layer sanitizer for model-authored wireframe HTML.
3
+ *
4
+ * The HTML artboard injects model HTML via dangerouslySetInnerHTML into the LIVE
5
+ * page DOM (it can't be iframe-sandboxed because the rough overlay must measure
6
+ * the laid-out elements). The schema's regex guard is necessary but not
7
+ * sufficient — obfuscated schemes (java\tscript:, &#106;avascript:) slip past
8
+ * string matching. This neutralizes the html at the render point using the
9
+ * browser's OWN parser/URL normalization, which decodes entities and collapses
10
+ * whitespace, so obfuscation can't survive:
11
+ * - drops dangerous elements (script/style/iframe/object/embed/...);
12
+ * - strips every on* event-handler attribute;
13
+ * - removes url attributes whose RESOLVED scheme isn't safe;
14
+ * - removes inline styles carrying expression()/javascript:/data:text/html.
15
+ * Defense-in-depth: stored content should also be sanitized server-side, but
16
+ * this guarantees the live DOM never carries an executable payload.
17
+ */
18
+ const BLOCKED_TAGS = "script,style,iframe,object,embed,link,meta,base,form,noscript,frame,frameset,applet,marquee,portal";
19
+ const DIAGRAM_BLOCKED_TAGS = `${BLOCKED_TAGS},math,foreignObject,foreignobject`;
20
+ const URL_ATTRS = new Set([
21
+ "href",
22
+ "src",
23
+ "xlink:href",
24
+ "srcdoc",
25
+ "action",
26
+ "formaction",
27
+ "background",
28
+ "poster",
29
+ "data",
30
+ "ping",
31
+ ]);
32
+ const SAFE_SCHEMES = new Set(["http:", "https:", "mailto:", "tel:", "ftp:"]);
33
+ const WHITESPACE = /\s+/g;
34
+ const HAS_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
35
+ const SAFE_DATA_IMAGE = /^data:image\/(png|jpe?g|gif|webp);/i;
36
+ function isSafeUrl(value) {
37
+ // Strip whitespace for scheme detection ONLY (the browser collapses these when
38
+ // resolving too, so obfuscated schemes like "java\tscript:" can't hide). The
39
+ // original attribute is left untouched unless we decide to drop it.
40
+ const v = (value || "").replace(WHITESPACE, "");
41
+ if (v === "" ||
42
+ v.startsWith("#") ||
43
+ v.startsWith("/") ||
44
+ v.startsWith("./") ||
45
+ v.startsWith("../")) {
46
+ return true;
47
+ }
48
+ if (!HAS_SCHEME.test(v))
49
+ return true; // no scheme => relative, safe
50
+ try {
51
+ const a = document.createElement("a");
52
+ a.href = v; // browser decodes the scheme + normalizes
53
+ const proto = a.protocol.toLowerCase();
54
+ // Allow only safe raster data images; block data:image/svg+xml (can script)
55
+ // and data:text/html.
56
+ if (proto === "data:")
57
+ return SAFE_DATA_IMAGE.test(a.href);
58
+ return SAFE_SCHEMES.has(proto);
59
+ }
60
+ catch {
61
+ return false;
62
+ }
63
+ }
64
+ const DANGEROUS_STYLE = /(expression\s*\(|javascript:|vbscript:|url\s*\(\s*['"]?\s*(?:javascript|vbscript|data:text\/html))/i;
65
+ const DANGEROUS_CSS = /(@(?:import|font-face|keyframes|page|namespace|charset)\b|expression\s*\(|javascript:|vbscript:|data:text\/html|data:image\/svg\+xml|<\/?\s*(?:script|style)\b)/i;
66
+ const DANGEROUS_VIEWPORT_CSS = /(?:^|[;{\s])position\s*:\s*(?:fixed|sticky)\b|(?:^|[;{\s])z-index\s*:\s*[1-9]\d{4,}\b/i;
67
+ function decodeCssSafetyEscapes(value) {
68
+ return value.replace(/\\([0-9a-fA-F]{1,6}\s?|.)/g, (_match, escaped) => {
69
+ const hex = String(escaped).match(/^[0-9a-fA-F]{1,6}/)?.[0];
70
+ if (hex) {
71
+ const point = Number.parseInt(hex, 16);
72
+ return Number.isFinite(point) ? String.fromCodePoint(point) : "";
73
+ }
74
+ return String(escaped)[0] ?? "";
75
+ });
76
+ }
77
+ function cssSafetyText(value) {
78
+ return decodeCssSafetyEscapes(value)
79
+ .toLowerCase()
80
+ .replace(/[\u0000-\u0020]+/g, "");
81
+ }
82
+ /** Conservative no-DOM fallback for any non-browser code path (SSR). */
83
+ function fallbackStrip(html) {
84
+ // Drop the whole url attribute if its value (whitespace/control-stripped)
85
+ // carries a dangerous scheme. Mirrors the DOM path for the rare no-DOMParser
86
+ // case; entity-obfuscation isn't decoded here (the live DOM path handles it).
87
+ const stripScheme = (m, dq, sq, uq) => {
88
+ const v = (dq ?? sq ?? uq ?? "").replace(/[\s\u0000-\u001f]+/g, "");
89
+ return /^(?:javascript|vbscript):|^data:text\/html/i.test(v) ? "" : m;
90
+ };
91
+ return html
92
+ .replace(/<\/?(?:script|style|iframe|object|embed|link|meta|base|form|noscript|frame|frameset|applet|marquee|portal)\b[^>]*>/gi, "")
93
+ .replace(/\son[a-z][\w:-]*\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "")
94
+ .replace(/\s(?:href|src|xlink:href|action|formaction|poster|background|data|ping)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi, stripScheme)
95
+ .replace(/\sstyle\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, (m) => DANGEROUS_STYLE.test(m) ? "" : m);
96
+ }
97
+ export function sanitizeWireframeHtml(html) {
98
+ if (!html)
99
+ return "";
100
+ if (typeof DOMParser === "undefined" || typeof document === "undefined") {
101
+ return fallbackStrip(html);
102
+ }
103
+ const doc = new DOMParser().parseFromString(html, "text/html");
104
+ doc.querySelectorAll(BLOCKED_TAGS).forEach((el) => el.remove());
105
+ sanitizeElementAttributes(doc.body);
106
+ return doc.body.innerHTML;
107
+ }
108
+ export function sanitizeDiagramHtml(html) {
109
+ if (!html)
110
+ return "";
111
+ if (typeof DOMParser === "undefined" || typeof document === "undefined") {
112
+ return fallbackStrip(html)
113
+ .replace(/<\/?\s*(?:math|foreignObject|foreignobject)\b[^>]*>/gi, "")
114
+ .replace(/\s(?:@[\w:.-]+|x-on:[\w:.-]+|:on[\w:.-]+|x-bind:on[\w:.-]+|:style|x-bind:style)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "");
115
+ }
116
+ const doc = new DOMParser().parseFromString(html, "text/html");
117
+ doc.querySelectorAll(DIAGRAM_BLOCKED_TAGS).forEach((el) => el.remove());
118
+ sanitizeElementAttributes(doc.body, { stripRuntimeDirectives: true });
119
+ return doc.body.innerHTML;
120
+ }
121
+ export function sanitizeWireframeCss(css) {
122
+ if (!css)
123
+ return "";
124
+ return css
125
+ .split("\n")
126
+ .filter((line) => {
127
+ const decoded = decodeCssSafetyEscapes(line);
128
+ const compact = cssSafetyText(line);
129
+ return !(DANGEROUS_CSS.test(line) ||
130
+ DANGEROUS_CSS.test(decoded) ||
131
+ DANGEROUS_VIEWPORT_CSS.test(decoded) ||
132
+ /(?:javascript|vbscript):|data:(?:text\/html|image\/svg\+xml)|expression\(|url\(['"]?(?:javascript|vbscript|data:(?:text\/html|image\/svg\+xml))/.test(compact));
133
+ })
134
+ .join("\n")
135
+ .replace(/\bjava\s*script\s*:/gi, "")
136
+ .replace(/\bvb\s*script\s*:/gi, "")
137
+ .replace(/\bdata\s*:\s*(?:text\/html|image\/svg\+xml)/gi, "");
138
+ }
139
+ export function scopeDesignCss(css, scopeSelector) {
140
+ if (!css.trim())
141
+ return "";
142
+ return css.replace(/(^|[{}])\s*([^@{}][^{}]*)\{/g, (_match, boundary, selectors) => {
143
+ const scoped = splitSelectorList(selectors)
144
+ .map((selector) => selector.trim())
145
+ .filter(Boolean)
146
+ .map((selector) => {
147
+ if (selector.startsWith(scopeSelector))
148
+ return selector;
149
+ if (selector === ":root" ||
150
+ selector === "html" ||
151
+ selector === "body")
152
+ return scopeSelector;
153
+ return `${scopeSelector} ${selector}`;
154
+ })
155
+ .join(", ");
156
+ return `${boundary} ${scoped} {`;
157
+ });
158
+ }
159
+ function splitSelectorList(selectors) {
160
+ const parts = [];
161
+ let current = "";
162
+ let parenDepth = 0;
163
+ let bracketDepth = 0;
164
+ let quote = null;
165
+ let escaped = false;
166
+ for (const char of selectors) {
167
+ current += char;
168
+ if (escaped) {
169
+ escaped = false;
170
+ continue;
171
+ }
172
+ if (char === "\\") {
173
+ escaped = true;
174
+ continue;
175
+ }
176
+ if (quote) {
177
+ if (char === quote)
178
+ quote = null;
179
+ continue;
180
+ }
181
+ if (char === '"' || char === "'") {
182
+ quote = char;
183
+ continue;
184
+ }
185
+ if (char === "[") {
186
+ bracketDepth += 1;
187
+ continue;
188
+ }
189
+ if (char === "]") {
190
+ bracketDepth = Math.max(0, bracketDepth - 1);
191
+ continue;
192
+ }
193
+ if (char === "(") {
194
+ parenDepth += 1;
195
+ continue;
196
+ }
197
+ if (char === ")") {
198
+ parenDepth = Math.max(0, parenDepth - 1);
199
+ continue;
200
+ }
201
+ if (char === "," && parenDepth === 0 && bracketDepth === 0) {
202
+ parts.push(current.slice(0, -1));
203
+ current = "";
204
+ }
205
+ }
206
+ parts.push(current);
207
+ return parts;
208
+ }
209
+ function sanitizeElementAttributes(root, options) {
210
+ root.querySelectorAll("*").forEach((el) => {
211
+ for (const attr of Array.from(el.attributes)) {
212
+ const name = attr.name.toLowerCase();
213
+ if (name.startsWith("on")) {
214
+ el.removeAttribute(attr.name);
215
+ continue;
216
+ }
217
+ if (options?.stripRuntimeDirectives &&
218
+ (name.startsWith("@") ||
219
+ name.startsWith("x-on:") ||
220
+ name.startsWith(":on") ||
221
+ name.startsWith("x-bind:on") ||
222
+ name === ":style" ||
223
+ name === "x-bind:style")) {
224
+ el.removeAttribute(attr.name);
225
+ continue;
226
+ }
227
+ if (URL_ATTRS.has(name) && !isSafeUrl(attr.value)) {
228
+ el.removeAttribute(attr.name);
229
+ continue;
230
+ }
231
+ if (name === "style" && DANGEROUS_STYLE.test(attr.value)) {
232
+ el.removeAttribute(attr.name);
233
+ }
234
+ }
235
+ if (el instanceof HTMLTemplateElement) {
236
+ sanitizeElementAttributes(el.content, options);
237
+ }
238
+ });
239
+ }
240
+ //# sourceMappingURL=sanitize-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-html.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/sanitize-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,YAAY,GAChB,oGAAoG,CAAC;AACvG,MAAM,oBAAoB,GAAG,GAAG,YAAY,mCAAmC,CAAC;AAEhF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,MAAM;IACN,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7E,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,eAAe,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AAU,CAAC,OAAO,CAAC;oBACxB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;oBACtB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;oBAC5B,IAAI,KAAK,QAAQ;oBACjB,IAAI,KAAK,cAAc,CAAC,EAC1B,CAAC;gBACD,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,SAAS;YACX,CAAC;YACD,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAClD,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,SAAS;YACX,CAAC;YACD,IAAI,IAAI,KAAK,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzD,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QACD,IAAI,EAAE,YAAY,mBAAmB,EAAE,CAAC;YACtC,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Render-layer sanitizer for model-authored wireframe HTML.\n *\n * The HTML artboard injects model HTML via dangerouslySetInnerHTML into the LIVE\n * page DOM (it can't be iframe-sandboxed because the rough overlay must measure\n * the laid-out elements). The schema's regex guard is necessary but not\n * sufficient — obfuscated schemes (java\\tscript:, &#106;avascript:) slip past\n * string matching. This neutralizes the html at the render point using the\n * browser's OWN parser/URL normalization, which decodes entities and collapses\n * whitespace, so obfuscation can't survive:\n * - drops dangerous elements (script/style/iframe/object/embed/...);\n * - strips every on* event-handler attribute;\n * - removes url attributes whose RESOLVED scheme isn't safe;\n * - removes inline styles carrying expression()/javascript:/data:text/html.\n * Defense-in-depth: stored content should also be sanitized server-side, but\n * this guarantees the live DOM never carries an executable payload.\n */\n\nconst BLOCKED_TAGS =\n \"script,style,iframe,object,embed,link,meta,base,form,noscript,frame,frameset,applet,marquee,portal\";\nconst DIAGRAM_BLOCKED_TAGS = `${BLOCKED_TAGS},math,foreignObject,foreignobject`;\n\nconst URL_ATTRS = new Set([\n \"href\",\n \"src\",\n \"xlink:href\",\n \"srcdoc\",\n \"action\",\n \"formaction\",\n \"background\",\n \"poster\",\n \"data\",\n \"ping\",\n]);\n\nconst SAFE_SCHEMES = new Set([\"http:\", \"https:\", \"mailto:\", \"tel:\", \"ftp:\"]);\n\nconst WHITESPACE = /\\s+/g;\nconst HAS_SCHEME = /^[a-z][a-z0-9+.-]*:/i;\nconst SAFE_DATA_IMAGE = /^data:image\\/(png|jpe?g|gif|webp);/i;\n\nfunction isSafeUrl(value: string): boolean {\n // Strip whitespace for scheme detection ONLY (the browser collapses these when\n // resolving too, so obfuscated schemes like \"java\\tscript:\" can't hide). The\n // original attribute is left untouched unless we decide to drop it.\n const v = (value || \"\").replace(WHITESPACE, \"\");\n if (\n v === \"\" ||\n v.startsWith(\"#\") ||\n v.startsWith(\"/\") ||\n v.startsWith(\"./\") ||\n v.startsWith(\"../\")\n ) {\n return true;\n }\n if (!HAS_SCHEME.test(v)) return true; // no scheme => relative, safe\n try {\n const a = document.createElement(\"a\");\n a.href = v; // browser decodes the scheme + normalizes\n const proto = a.protocol.toLowerCase();\n // Allow only safe raster data images; block data:image/svg+xml (can script)\n // and data:text/html.\n if (proto === \"data:\") return SAFE_DATA_IMAGE.test(a.href);\n return SAFE_SCHEMES.has(proto);\n } catch {\n return false;\n }\n}\n\nconst DANGEROUS_STYLE =\n /(expression\\s*\\(|javascript:|vbscript:|url\\s*\\(\\s*['\"]?\\s*(?:javascript|vbscript|data:text\\/html))/i;\nconst DANGEROUS_CSS =\n /(@(?:import|font-face|keyframes|page|namespace|charset)\\b|expression\\s*\\(|javascript:|vbscript:|data:text\\/html|data:image\\/svg\\+xml|<\\/?\\s*(?:script|style)\\b)/i;\nconst DANGEROUS_VIEWPORT_CSS =\n /(?:^|[;{\\s])position\\s*:\\s*(?:fixed|sticky)\\b|(?:^|[;{\\s])z-index\\s*:\\s*[1-9]\\d{4,}\\b/i;\n\nfunction decodeCssSafetyEscapes(value: string): string {\n return value.replace(/\\\\([0-9a-fA-F]{1,6}\\s?|.)/g, (_match, escaped) => {\n const hex = String(escaped).match(/^[0-9a-fA-F]{1,6}/)?.[0];\n if (hex) {\n const point = Number.parseInt(hex, 16);\n return Number.isFinite(point) ? String.fromCodePoint(point) : \"\";\n }\n return String(escaped)[0] ?? \"\";\n });\n}\n\nfunction cssSafetyText(value: string): string {\n return decodeCssSafetyEscapes(value)\n .toLowerCase()\n .replace(/[\\u0000-\\u0020]+/g, \"\");\n}\n\n/** Conservative no-DOM fallback for any non-browser code path (SSR). */\nfunction fallbackStrip(html: string): string {\n // Drop the whole url attribute if its value (whitespace/control-stripped)\n // carries a dangerous scheme. Mirrors the DOM path for the rare no-DOMParser\n // case; entity-obfuscation isn't decoded here (the live DOM path handles it).\n const stripScheme = (m: string, dq?: string, sq?: string, uq?: string) => {\n const v = (dq ?? sq ?? uq ?? \"\").replace(/[\\s\\u0000-\\u001f]+/g, \"\");\n return /^(?:javascript|vbscript):|^data:text\\/html/i.test(v) ? \"\" : m;\n };\n return html\n .replace(\n /<\\/?(?:script|style|iframe|object|embed|link|meta|base|form|noscript|frame|frameset|applet|marquee|portal)\\b[^>]*>/gi,\n \"\",\n )\n .replace(/\\son[a-z][\\w:-]*\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi, \"\")\n .replace(\n /\\s(?:href|src|xlink:href|action|formaction|poster|background|data|ping)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/gi,\n stripScheme,\n )\n .replace(/\\sstyle\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi, (m) =>\n DANGEROUS_STYLE.test(m) ? \"\" : m,\n );\n}\n\nexport function sanitizeWireframeHtml(html: string | undefined): string {\n if (!html) return \"\";\n if (typeof DOMParser === \"undefined\" || typeof document === \"undefined\") {\n return fallbackStrip(html);\n }\n const doc = new DOMParser().parseFromString(html, \"text/html\");\n doc.querySelectorAll(BLOCKED_TAGS).forEach((el) => el.remove());\n sanitizeElementAttributes(doc.body);\n return doc.body.innerHTML;\n}\n\nexport function sanitizeDiagramHtml(html: string | undefined): string {\n if (!html) return \"\";\n if (typeof DOMParser === \"undefined\" || typeof document === \"undefined\") {\n return fallbackStrip(html)\n .replace(/<\\/?\\s*(?:math|foreignObject|foreignobject)\\b[^>]*>/gi, \"\")\n .replace(\n /\\s(?:@[\\w:.-]+|x-on:[\\w:.-]+|:on[\\w:.-]+|x-bind:on[\\w:.-]+|:style|x-bind:style)\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+)/gi,\n \"\",\n );\n }\n const doc = new DOMParser().parseFromString(html, \"text/html\");\n doc.querySelectorAll(DIAGRAM_BLOCKED_TAGS).forEach((el) => el.remove());\n sanitizeElementAttributes(doc.body, { stripRuntimeDirectives: true });\n return doc.body.innerHTML;\n}\n\nexport function sanitizeWireframeCss(css: string | undefined): string {\n if (!css) return \"\";\n return css\n .split(\"\\n\")\n .filter((line) => {\n const decoded = decodeCssSafetyEscapes(line);\n const compact = cssSafetyText(line);\n return !(\n DANGEROUS_CSS.test(line) ||\n DANGEROUS_CSS.test(decoded) ||\n DANGEROUS_VIEWPORT_CSS.test(decoded) ||\n /(?:javascript|vbscript):|data:(?:text\\/html|image\\/svg\\+xml)|expression\\(|url\\(['\"]?(?:javascript|vbscript|data:(?:text\\/html|image\\/svg\\+xml))/.test(\n compact,\n )\n );\n })\n .join(\"\\n\")\n .replace(/\\bjava\\s*script\\s*:/gi, \"\")\n .replace(/\\bvb\\s*script\\s*:/gi, \"\")\n .replace(/\\bdata\\s*:\\s*(?:text\\/html|image\\/svg\\+xml)/gi, \"\");\n}\n\nexport function scopeDesignCss(css: string, scopeSelector: string): string {\n if (!css.trim()) return \"\";\n return css.replace(\n /(^|[{}])\\s*([^@{}][^{}]*)\\{/g,\n (_match, boundary: string, selectors: string) => {\n const scoped = splitSelectorList(selectors)\n .map((selector) => selector.trim())\n .filter(Boolean)\n .map((selector) => {\n if (selector.startsWith(scopeSelector)) return selector;\n if (\n selector === \":root\" ||\n selector === \"html\" ||\n selector === \"body\"\n )\n return scopeSelector;\n return `${scopeSelector} ${selector}`;\n })\n .join(\", \");\n return `${boundary} ${scoped} {`;\n },\n );\n}\n\nfunction splitSelectorList(selectors: string): string[] {\n const parts: string[] = [];\n let current = \"\";\n let parenDepth = 0;\n let bracketDepth = 0;\n let quote: '\"' | \"'\" | null = null;\n let escaped = false;\n\n for (const char of selectors) {\n current += char;\n if (escaped) {\n escaped = false;\n continue;\n }\n if (char === \"\\\\\") {\n escaped = true;\n continue;\n }\n if (quote) {\n if (char === quote) quote = null;\n continue;\n }\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n if (char === \"[\") {\n bracketDepth += 1;\n continue;\n }\n if (char === \"]\") {\n bracketDepth = Math.max(0, bracketDepth - 1);\n continue;\n }\n if (char === \"(\") {\n parenDepth += 1;\n continue;\n }\n if (char === \")\") {\n parenDepth = Math.max(0, parenDepth - 1);\n continue;\n }\n if (char === \",\" && parenDepth === 0 && bracketDepth === 0) {\n parts.push(current.slice(0, -1));\n current = \"\";\n }\n }\n\n parts.push(current);\n return parts;\n}\n\nfunction sanitizeElementAttributes(\n root: ParentNode,\n options?: { stripRuntimeDirectives?: boolean },\n) {\n root.querySelectorAll<HTMLElement>(\"*\").forEach((el) => {\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase();\n if (name.startsWith(\"on\")) {\n el.removeAttribute(attr.name);\n continue;\n }\n if (\n options?.stripRuntimeDirectives &&\n (name.startsWith(\"@\") ||\n name.startsWith(\"x-on:\") ||\n name.startsWith(\":on\") ||\n name.startsWith(\"x-bind:on\") ||\n name === \":style\" ||\n name === \"x-bind:style\")\n ) {\n el.removeAttribute(attr.name);\n continue;\n }\n if (URL_ATTRS.has(name) && !isSafeUrl(attr.value)) {\n el.removeAttribute(attr.name);\n continue;\n }\n if (name === \"style\" && DANGEROUS_STYLE.test(attr.value)) {\n el.removeAttribute(attr.name);\n }\n }\n if (el instanceof HTMLTemplateElement) {\n sanitizeElementAttributes(el.content, options);\n }\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"server-specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAgEpE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,GAAG,CAAC,EA0J/C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAC9C,MAAM,EACN,OAAO,CACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC,CAC5E,CACF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,2BAA2B,CAAA;CAAO,GACxD,IAAI,CAON"}
1
+ {"version":3,"file":"server-specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA4FpE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,GAAG,CAAC,EAsN/C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAC9C,MAAM,EACN,OAAO,CACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,kBAAkB,CAAC,CAC5E,CACF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,2BAA2B,CAAA;CAAO,GACxD,IAAI,CAON"}
@@ -10,6 +10,11 @@ import { codeTabsSchema, codeTabsMdx, } from "./code-tabs.config.js";
10
10
  import { htmlSchema, htmlMdx } from "./html.config.js";
11
11
  import { tabsSchema, tabsMdx } from "./tabs.config.js";
12
12
  import { columnsSchema, columnsMdx, } from "./columns.config.js";
13
+ import { calloutSchema, calloutMdx, } from "./callout.config.js";
14
+ import { decisionSchema, decisionMdx, } from "./decision.config.js";
15
+ import { questionFormSchema, questionFormMdx, visualQuestionsSchema, visualQuestionsMdx, } from "./question-form.config.js";
16
+ import { diagramSchema, diagramMdx, } from "./diagram.config.js";
17
+ import { wireframeSchema, wireframeMdx, } from "./wireframe.config.js";
13
18
  import { mermaidSchema, mermaidMdx, } from "./mermaid.config.js";
14
19
  import { apiEndpointSchema, apiEndpointMdx, } from "./api-endpoint.config.js";
15
20
  import { openApiSpecSchema, openApiSpecMdx, } from "./openapi-spec.config.js";
@@ -101,6 +106,60 @@ export const libraryBlockConfigs = [
101
106
  label: "Columns",
102
107
  description: "A multi-column side-by-side layout container; each column holds its own list of blocks. Ideal for before/after or current/target comparisons.",
103
108
  }),
109
+ defineBlock({
110
+ type: "callout",
111
+ schema: calloutSchema,
112
+ mdx: calloutMdx,
113
+ Read: ServerReadStub,
114
+ placement: ["block"],
115
+ label: "Callout",
116
+ description: "An emphasized note with a tone (info/decision/risk/warning/success) and a markdown body.",
117
+ }),
118
+ defineBlock({
119
+ type: "decision",
120
+ schema: decisionSchema,
121
+ mdx: decisionMdx,
122
+ Read: ServerReadStub,
123
+ placement: ["block"],
124
+ label: "Decision",
125
+ description: "A decision prompt with editable option cards and an authored recommended choice.",
126
+ }),
127
+ defineBlock({
128
+ type: "question-form",
129
+ schema: questionFormSchema,
130
+ mdx: questionFormMdx,
131
+ Read: ServerReadStub,
132
+ placement: ["block"],
133
+ label: "Question form",
134
+ description: "An interactive respondent-facing form block for open questions, single-choice or multi-choice option rows, freeform answers, recommended options, and optional wireframe/diagram previews.",
135
+ }),
136
+ defineBlock({
137
+ type: "visual-questions",
138
+ schema: visualQuestionsSchema,
139
+ mdx: visualQuestionsMdx,
140
+ Read: ServerReadStub,
141
+ placement: ["block"],
142
+ label: "Visual questions",
143
+ description: "A visual-intake question block with the same editable question/option shape as question-form.",
144
+ }),
145
+ defineBlock({
146
+ type: "diagram",
147
+ schema: diagramSchema,
148
+ mdx: diagramMdx,
149
+ Read: ServerReadStub,
150
+ placement: ["block"],
151
+ label: "Diagram",
152
+ description: "A flexible inline architecture/code diagram. Prefer html/css with SVG or semantic HTML for polished two-dimensional layouts; use .diagram-* primitives and --wf-* tokens for theme/sketch compatibility. Legacy nodes/edges are only for simple previews.",
153
+ }),
154
+ defineBlock({
155
+ type: "wireframe",
156
+ schema: wireframeSchema,
157
+ mdx: wireframeMdx,
158
+ Read: ServerReadStub,
159
+ placement: ["block"],
160
+ label: "Wireframe",
161
+ description: "A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).",
162
+ }),
104
163
  defineBlock({
105
164
  type: "mermaid",
106
165
  schema: mermaidSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"server-specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AAEpE,8EAA8E;AAC9E,iFAAiF;AACjF,iFAAiF;AAC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} from \"../registry.js\";\n\n// React-free schema + MDX config for the standard library. The matching React\n// `Read`/`Edit` live in the full client entry; the server path only ever touches\n// `spec.schema` / `spec.mdx`, so these configs register with a render-only stub.\nimport {\n checklistSchema,\n checklistMdx,\n type ChecklistData,\n} from \"./checklist.config.js\";\nimport { tableSchema, tableMdx, type TableData } from \"./table.config.js\";\nimport { codeSchema, codeMdx, type CodeData } from \"./code.config.js\";\nimport {\n codeTabsSchema,\n codeTabsMdx,\n type CodeTabsData,\n} from \"./code-tabs.config.js\";\nimport { htmlSchema, htmlMdx, type HtmlBlockData } from \"./html.config.js\";\nimport { tabsSchema, tabsMdx, type TabsData } from \"./tabs.config.js\";\nimport {\n columnsSchema,\n columnsMdx,\n type ColumnsData,\n} from \"./columns.config.js\";\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\n\n/** Render-only stub for server / agent registries (never invoked off-browser). */\nconst ServerReadStub = () => null;\n\n/**\n * Canonical React-free specs for the standard library, used by BOTH apps' server\n * / shared registries (`plan-block-registry.ts`, `nfm-registry.ts`). Each carries\n * only the parts the server path touches — `schema` + `mdx` + metadata for the\n * agent schema export — with a render-only `Read` stub. The full client specs\n * (with real React `Read`/`Edit`) live in `./specs.tsx`; both share the identical\n * `schema`/`mdx` config so inline source can never drift from what renders.\n *\n * `table` keeps the core default `type` here; content's server registry renames\n * it to `table-block` via {@link LibraryBlockConfigOverrides}. The descriptions\n * are the neutral agent-schema phrasing; an app that curates a longer\n * description for a block (e.g. plan's hand-drawn Mermaid, plan's detailed file\n * tree) passes an override rather than re-authoring the spec.\n */\nexport const libraryBlockConfigs: BlockSpec<any>[] = [\n defineBlock<ChecklistData>({\n type: \"checklist\",\n schema: checklistSchema,\n mdx: checklistMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Checklist\",\n description:\n \"A list of toggleable items, each with a label and an optional note.\",\n }),\n defineBlock<TableData>({\n type: \"table\",\n schema: tableSchema,\n mdx: tableMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Table\",\n description:\n \"A simple grid with header columns and string rows for comparisons, parameters, or structured lists.\",\n }),\n defineBlock<CodeData>({\n type: \"code\",\n schema: codeSchema,\n mdx: codeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Code\",\n description:\n \"A single syntax-highlighted code snippet (Notion-style: one border, hover language switcher + copy, collapse-to-N lines). Put several in a `tabs` block for a file rail.\",\n }),\n defineBlock<CodeTabsData>({\n type: \"code-tabs\",\n schema: codeTabsSchema,\n mdx: codeTabsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Code tabs\",\n description:\n \"A vertical file tab rail of syntax-highlighted code snippets, one tab per file with an optional language and caption.\",\n }),\n defineBlock<HtmlBlockData>({\n type: \"custom-html\",\n schema: htmlSchema,\n mdx: htmlMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"HTML / Tailwind\",\n description:\n \"An author-supplied HTML (with optional CSS) fragment rendered in a sandboxed iframe, with inline source editing.\",\n }),\n defineBlock<TabsData>({\n type: \"tabs\",\n schema: tabsSchema,\n mdx: tabsMdx,\n Read: ServerReadStub,\n placement: [\"block\", \"inline\"],\n label: \"Tabs\",\n description:\n \"A top or side tab container; each tab holds its own list of blocks.\",\n }),\n defineBlock<ColumnsData>({\n type: \"columns\",\n schema: columnsSchema,\n mdx: columnsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Columns\",\n description:\n \"A multi-column side-by-side layout container; each column holds its own list of blocks. Ideal for before/after or current/target comparisons.\",\n }),\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON).\",\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split view and added/removed line highlighting.\",\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree with per-file change badges, notes, and code snippets.\",\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes.\",\n }),\n];\n\n/**\n * Per-block overrides for {@link registerLibraryBlockConfigs}, keyed by canonical\n * `type`. Servers tweak only the agent-facing fields that legitimately differ:\n * content re-types `table` → `table-block`; plan curates a longer Mermaid and\n * file-tree description. The `schema` / `mdx` config always stays shared.\n */\nexport type LibraryBlockConfigOverrides = Record<\n string,\n Partial<\n Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"notionCompatible\">\n >\n>;\n\n/**\n * Register the React-free standard-library config stubs into a server / shared\n * {@link BlockRegistry}. Both `plan-block-registry.ts` and `nfm-registry.ts` call\n * this, then register only their app-specific block configs (plan adds callout /\n * diagram / wireframe / question-form) on top — so the shared library lives in\n * exactly one place across browser AND server registries.\n */\nexport function registerLibraryBlockConfigs(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockConfigOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockConfigs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
1
+ {"version":3,"file":"server-specs.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/server-specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WA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H,MAAM,UAAU,2BAA2B,CACzC,QAAuB,EACvB,UAAuD,EAAE;IAEzD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7C,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,CAAC,CAAE,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAqB,CAAC,CAAC,CAAC,IAAI,CAAC;IACxE,CAAC,CAAC,CAAC;IACH,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { defineBlock, type BlockSpec } from \"../types.js\";\nimport { registerBlocks, type BlockRegistry } from \"../registry.js\";\n\n// React-free schema + MDX config for the standard library. The matching React\n// `Read`/`Edit` live in the full client entry; the server path only ever touches\n// `spec.schema` / `spec.mdx`, so these configs register with a render-only stub.\nimport {\n checklistSchema,\n checklistMdx,\n type ChecklistData,\n} from \"./checklist.config.js\";\nimport { tableSchema, tableMdx, type TableData } from \"./table.config.js\";\nimport { codeSchema, codeMdx, type CodeData } from \"./code.config.js\";\nimport {\n codeTabsSchema,\n codeTabsMdx,\n type CodeTabsData,\n} from \"./code-tabs.config.js\";\nimport { htmlSchema, htmlMdx, type HtmlBlockData } from \"./html.config.js\";\nimport { tabsSchema, tabsMdx, type TabsData } from \"./tabs.config.js\";\nimport {\n columnsSchema,\n columnsMdx,\n type ColumnsData,\n} from \"./columns.config.js\";\nimport {\n calloutSchema,\n calloutMdx,\n type CalloutData,\n} from \"./callout.config.js\";\nimport {\n decisionSchema,\n decisionMdx,\n type DecisionData,\n} from \"./decision.config.js\";\nimport {\n questionFormSchema,\n questionFormMdx,\n visualQuestionsSchema,\n visualQuestionsMdx,\n type QuestionFormData,\n type VisualQuestionsData,\n} from \"./question-form.config.js\";\nimport {\n diagramSchema,\n diagramMdx,\n type DiagramData,\n} from \"./diagram.config.js\";\nimport {\n wireframeSchema,\n wireframeMdx,\n type WireframeData,\n} from \"./wireframe.config.js\";\nimport {\n mermaidSchema,\n mermaidMdx,\n type MermaidData,\n} from \"./mermaid.config.js\";\nimport {\n apiEndpointSchema,\n apiEndpointMdx,\n type ApiEndpointData,\n} from \"./api-endpoint.config.js\";\nimport {\n openApiSpecSchema,\n openApiSpecMdx,\n type OpenApiSpecData,\n} from \"./openapi-spec.config.js\";\nimport {\n dataModelSchema,\n dataModelMdx,\n type DataModelData,\n} from \"./data-model.config.js\";\nimport { diffSchema, diffMdx, type DiffData } from \"./diff.config.js\";\nimport {\n fileTreeSchema,\n fileTreeMdx,\n type FileTreeData,\n} from \"./file-tree.config.js\";\nimport {\n jsonExplorerSchema,\n jsonExplorerMdx,\n type JsonExplorerData,\n} from \"./json-explorer.config.js\";\nimport {\n annotatedCodeSchema,\n annotatedCodeMdx,\n type AnnotatedCodeData,\n} from \"./annotated-code.config.js\";\n\n/** Render-only stub for server / agent registries (never invoked off-browser). */\nconst ServerReadStub = () => null;\n\n/**\n * Canonical React-free specs for the standard library, used by BOTH apps' server\n * / shared registries (`plan-block-registry.ts`, `nfm-registry.ts`). Each carries\n * only the parts the server path touches — `schema` + `mdx` + metadata for the\n * agent schema export — with a render-only `Read` stub. The full client specs\n * (with real React `Read`/`Edit`) live in `./specs.tsx`; both share the identical\n * `schema`/`mdx` config so inline source can never drift from what renders.\n *\n * `table` keeps the core default `type` here; content's server registry renames\n * it to `table-block` via {@link LibraryBlockConfigOverrides}. The descriptions\n * are the neutral agent-schema phrasing; an app that curates a longer\n * description for a block (e.g. plan's hand-drawn Mermaid, plan's detailed file\n * tree) passes an override rather than re-authoring the spec.\n */\nexport const libraryBlockConfigs: BlockSpec<any>[] = [\n defineBlock<ChecklistData>({\n type: \"checklist\",\n schema: checklistSchema,\n mdx: checklistMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Checklist\",\n description:\n \"A list of toggleable items, each with a label and an optional note.\",\n }),\n defineBlock<TableData>({\n type: \"table\",\n schema: tableSchema,\n mdx: tableMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Table\",\n description:\n \"A simple grid with header columns and string rows for comparisons, parameters, or structured lists.\",\n }),\n defineBlock<CodeData>({\n type: \"code\",\n schema: codeSchema,\n mdx: codeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n notionCompatible: true,\n label: \"Code\",\n description:\n \"A single syntax-highlighted code snippet (Notion-style: one border, hover language switcher + copy, collapse-to-N lines). Put several in a `tabs` block for a file rail.\",\n }),\n defineBlock<CodeTabsData>({\n type: \"code-tabs\",\n schema: codeTabsSchema,\n mdx: codeTabsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Code tabs\",\n description:\n \"A vertical file tab rail of syntax-highlighted code snippets, one tab per file with an optional language and caption.\",\n }),\n defineBlock<HtmlBlockData>({\n type: \"custom-html\",\n schema: htmlSchema,\n mdx: htmlMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"HTML / Tailwind\",\n description:\n \"An author-supplied HTML (with optional CSS) fragment rendered in a sandboxed iframe, with inline source editing.\",\n }),\n defineBlock<TabsData>({\n type: \"tabs\",\n schema: tabsSchema,\n mdx: tabsMdx,\n Read: ServerReadStub,\n placement: [\"block\", \"inline\"],\n label: \"Tabs\",\n description:\n \"A top or side tab container; each tab holds its own list of blocks.\",\n }),\n defineBlock<ColumnsData>({\n type: \"columns\",\n schema: columnsSchema,\n mdx: columnsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Columns\",\n description:\n \"A multi-column side-by-side layout container; each column holds its own list of blocks. Ideal for before/after or current/target comparisons.\",\n }),\n defineBlock<CalloutData>({\n type: \"callout\",\n schema: calloutSchema,\n mdx: calloutMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Callout\",\n description:\n \"An emphasized note with a tone (info/decision/risk/warning/success) and a markdown body.\",\n }),\n defineBlock<DecisionData>({\n type: \"decision\",\n schema: decisionSchema,\n mdx: decisionMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Decision\",\n description:\n \"A decision prompt with editable option cards and an authored recommended choice.\",\n }),\n defineBlock<QuestionFormData>({\n type: \"question-form\",\n schema: questionFormSchema,\n mdx: questionFormMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Question form\",\n description:\n \"An interactive respondent-facing form block for open questions, single-choice or multi-choice option rows, freeform answers, recommended options, and optional wireframe/diagram previews.\",\n }),\n defineBlock<VisualQuestionsData>({\n type: \"visual-questions\",\n schema: visualQuestionsSchema,\n mdx: visualQuestionsMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Visual questions\",\n description:\n \"A visual-intake question block with the same editable question/option shape as question-form.\",\n }),\n defineBlock<DiagramData>({\n type: \"diagram\",\n schema: diagramSchema,\n mdx: diagramMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram\",\n description:\n \"A flexible inline architecture/code diagram. Prefer html/css with SVG or semantic HTML for polished two-dimensional layouts; use .diagram-* primitives and --wf-* tokens for theme/sketch compatibility. Legacy nodes/edges are only for simple previews.\",\n }),\n defineBlock<WireframeData>({\n type: \"wireframe\",\n schema: wireframeSchema,\n mdx: wireframeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Wireframe\",\n description:\n \"A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).\",\n }),\n defineBlock<MermaidData>({\n type: \"mermaid\",\n schema: mermaidSchema,\n mdx: mermaidMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diagram (Mermaid)\",\n description:\n \"A Mermaid diagram (flowchart, sequence, etc.) defined as text and rendered as a diagram.\",\n }),\n defineBlock<ApiEndpointData>({\n type: \"api-endpoint\",\n schema: apiEndpointSchema,\n mdx: apiEndpointMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"API endpoint\",\n description:\n \"A Swagger-style API endpoint reference: a colored method pill + path, collapsed by default, expanding to params, request body, and per-status response examples.\",\n }),\n defineBlock<OpenApiSpecData>({\n type: \"openapi-spec\",\n schema: openApiSpecSchema,\n mdx: openApiSpecMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"OpenAPI spec\",\n description:\n \"A whole-document API specification / Redoc / Swagger-UI-style API reference rendered from a complete OpenAPI 3 / Swagger 2 spec (JSON).\",\n }),\n defineBlock<DataModelData>({\n type: \"data-model\",\n schema: dataModelSchema,\n mdx: dataModelMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Data model\",\n description:\n \"A schema modeling / ERD / dbdiagram-style data model: entity cards with typed fields (PK/FK/nullable flags) and interactive foreign-key relations.\",\n }),\n defineBlock<DiffData>({\n type: \"diff\",\n schema: diffSchema,\n mdx: diffMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Diff\",\n description:\n \"A GitHub-style before/after line diff for a file, with unified or split view and added/removed line highlighting.\",\n }),\n defineBlock<FileTreeData>({\n type: \"file-tree\",\n schema: fileTreeSchema,\n mdx: fileTreeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"File tree\",\n description:\n \"A VS Code / GitHub-explorer file and change tree with per-file change badges, notes, and code snippets.\",\n }),\n defineBlock<JsonExplorerData>({\n type: \"json-explorer\",\n schema: jsonExplorerSchema,\n mdx: jsonExplorerMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"JSON explorer\",\n description:\n \"A collapsible browser-devtools / Postman-style JSON tree with type-colored values and expand/collapse.\",\n }),\n defineBlock<AnnotatedCodeData>({\n type: \"annotated-code\",\n schema: annotatedCodeSchema,\n mdx: annotatedCodeMdx,\n Read: ServerReadStub,\n placement: [\"block\"],\n label: \"Annotated code\",\n description:\n \"A line-numbered code walkthrough whose line ranges carry anchored explanatory notes.\",\n }),\n];\n\n/**\n * Per-block overrides for {@link registerLibraryBlockConfigs}, keyed by canonical\n * `type`. Servers tweak only the agent-facing fields that legitimately differ:\n * content re-types `table` → `table-block`; plan curates a longer Mermaid and\n * file-tree description. The `schema` / `mdx` config always stays shared.\n */\nexport type LibraryBlockConfigOverrides = Record<\n string,\n Partial<\n Pick<BlockSpec<any>, \"type\" | \"label\" | \"description\" | \"notionCompatible\">\n >\n>;\n\n/**\n * Register the React-free standard-library config stubs into a server / shared\n * {@link BlockRegistry}. Both `plan-block-registry.ts` and `nfm-registry.ts` call\n * this, then register only their app-specific block configs (plan adds callout /\n * diagram / wireframe / question-form) on top — so the shared library lives in\n * exactly one place across browser AND server registries.\n */\nexport function registerLibraryBlockConfigs(\n registry: BlockRegistry,\n options: { overrides?: LibraryBlockConfigOverrides } = {},\n): void {\n const overrides = options.overrides ?? {};\n const specs = libraryBlockConfigs.map((spec) => {\n const override = overrides[spec.type];\n return override ? ({ ...spec, ...override } as BlockSpec<any>) : spec;\n });\n registerBlocks(registry, specs);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA4PpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,GAAG,CAAC,EAS7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC,MAAM,EACN,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAC1E,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,qBAAqB,CAAA;CAAO,GAClD,IAAI,CAON"}
1
+ {"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/specs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAiQpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,GAAG,CAAC,EAe7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC,MAAM,EACN,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAC1E,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,qBAAqB,CAAA;CAAO,GAClD,IAAI,CAON"}
@@ -8,6 +8,11 @@ import { codeTabsBlock } from "./code-tabs.js";
8
8
  import { htmlBlock } from "./html.js";
9
9
  import { tabsBlock } from "./tabs.js";
10
10
  import { columnsBlock } from "./columns.js";
11
+ import { calloutBlock } from "./callout.js";
12
+ import { decisionBlock } from "./decision.js";
13
+ import { questionFormBlock, visualQuestionsBlock } from "./question-form.js";
14
+ import { diagramBlock } from "./diagram.js";
15
+ import { wireframeBlock } from "./wireframe.js";
11
16
  // Dev-doc blocks: React-free schema + MDX config paired with the shared React
12
17
  // Read/Edit renderers. Composed into full specs below with canonical metadata.
13
18
  import { mermaidSchema, mermaidMdx, } from "./mermaid.config.js";
@@ -215,6 +220,12 @@ export const libraryBlockSpecs = [
215
220
  htmlBlock,
216
221
  tabsBlock,
217
222
  columnsBlock,
223
+ calloutBlock,
224
+ decisionBlock,
225
+ questionFormBlock,
226
+ visualQuestionsBlock,
227
+ diagramBlock,
228
+ wireframeBlock,
218
229
  ...devDocBlockSpecs,
219
230
  ];
220
231
  /**