@syntrologie/adapt-faq 2.8.0-canary.31 → 2.8.0-canary.310

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 (62) hide show
  1. package/dist/FAQWidgetLit.d.ts +85 -0
  2. package/dist/FAQWidgetLit.d.ts.map +1 -0
  3. package/dist/FAQWidgetLit.editable.d.ts +154 -0
  4. package/dist/FAQWidgetLit.editable.d.ts.map +1 -0
  5. package/dist/answerRendering.d.ts +4 -0
  6. package/dist/answerRendering.d.ts.map +1 -0
  7. package/dist/chunk-5WRI5ZAA.js +31 -0
  8. package/dist/chunk-5WRI5ZAA.js.map +7 -0
  9. package/dist/chunk-IGCYULL7.js +223 -0
  10. package/dist/chunk-IGCYULL7.js.map +7 -0
  11. package/dist/chunk-KRKRB4OL.js +598 -0
  12. package/dist/chunk-KRKRB4OL.js.map +7 -0
  13. package/dist/editor.d.ts +60 -33
  14. package/dist/editor.d.ts.map +1 -1
  15. package/dist/editor.js +5054 -313
  16. package/dist/editor.js.map +7 -0
  17. package/dist/faq-item-editor.d.ts +33 -0
  18. package/dist/faq-item-editor.d.ts.map +1 -0
  19. package/dist/faq-styles.d.ts +3 -1
  20. package/dist/faq-styles.d.ts.map +1 -1
  21. package/dist/faq-types.d.ts +4 -0
  22. package/dist/faq-types.d.ts.map +1 -1
  23. package/dist/runtime.d.ts +17 -5
  24. package/dist/runtime.d.ts.map +1 -1
  25. package/dist/runtime.js +841 -64
  26. package/dist/runtime.js.map +7 -0
  27. package/dist/schema.d.ts +1174 -555
  28. package/dist/schema.d.ts.map +1 -1
  29. package/dist/schema.js +290 -207
  30. package/dist/schema.js.map +7 -0
  31. package/dist/types.d.ts +19 -0
  32. package/dist/types.d.ts.map +1 -1
  33. package/node_modules/marked/LICENSE.md +44 -0
  34. package/node_modules/marked/README.md +107 -0
  35. package/node_modules/marked/bin/main.js +283 -0
  36. package/node_modules/marked/bin/marked.js +16 -0
  37. package/node_modules/marked/lib/marked.d.ts +759 -0
  38. package/node_modules/marked/lib/marked.esm.js +72 -0
  39. package/node_modules/marked/lib/marked.esm.js.map +7 -0
  40. package/node_modules/marked/lib/marked.umd.js +74 -0
  41. package/node_modules/marked/lib/marked.umd.js.map +7 -0
  42. package/node_modules/marked/man/marked.1 +113 -0
  43. package/node_modules/marked/man/marked.1.md +93 -0
  44. package/node_modules/marked/package.json +103 -0
  45. package/package.json +13 -18
  46. package/dist/FAQWidget.d.ts +0 -33
  47. package/dist/FAQWidget.d.ts.map +0 -1
  48. package/dist/FAQWidget.js +0 -388
  49. package/dist/cdn.d.ts +0 -70
  50. package/dist/cdn.d.ts.map +0 -1
  51. package/dist/cdn.js +0 -46
  52. package/dist/executors.js +0 -150
  53. package/dist/faq-styles.js +0 -204
  54. package/dist/faq-types.js +0 -7
  55. package/dist/state.js +0 -132
  56. package/dist/summarize.js +0 -62
  57. package/dist/types.js +0 -17
  58. package/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +0 -129
  59. package/node_modules/@syntrologie/sdk-contracts/dist/index.js +0 -15
  60. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +0 -2225
  61. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +0 -162
  62. package/node_modules/@syntrologie/sdk-contracts/package.json +0 -33
package/dist/schema.js CHANGED
@@ -1,215 +1,298 @@
1
- /**
2
- * Adaptive FAQ - Config Schema
3
- *
4
- * Zod schema for validating FAQ accordion configuration.
5
- * Demonstrates compositional action pattern with per-item triggerWhen.
6
- */
7
- import { AnchorIdZ, DecisionStrategyZ, NotifyZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';
8
- import { z } from 'zod';
9
- // ============================================================================
10
- // Rich Answer Content Schemas
11
- // ============================================================================
12
- /** Schema for media assets embedded in enhanced markdown answers. */
13
- const AssetZ = z.object({
14
- id: z.string(),
15
- type: z.enum(['image', 'video']),
16
- src: z.string(),
17
- alt: z.string().optional(),
18
- width: z.number().optional(),
19
- height: z.number().optional(),
1
+ import {
2
+ AnchorIdZ,
3
+ AuthoringFieldsZ,
4
+ DecisionStrategyZ,
5
+ NotifyZ,
6
+ TriggerWhenZ
7
+ } from "./chunk-IGCYULL7.js";
8
+ import "./chunk-5WRI5ZAA.js";
9
+
10
+ // src/schema.ts
11
+ import { z } from "zod";
12
+ var AssetZ = z.object({
13
+ id: z.string().describe("Unique asset ID referenced inside the markdown content via `asset:<id>`."),
14
+ type: z.enum(["image", "video"]).describe('"image" for static images, "video" for embeddable video clips.'),
15
+ src: z.string().describe("Absolute URL of the media asset."),
16
+ alt: z.string().optional().describe("Optional alt text for images (accessibility)."),
17
+ width: z.number().optional().describe("Optional display width in pixels."),
18
+ height: z.number().optional().describe("Optional display height in pixels.")
19
+ }).describe(
20
+ "A single embedded media asset (image or video) referenced by ID in the markdown content."
21
+ );
22
+ var RichHTMLAnswerZ = z.object({
23
+ type: z.literal("rich").describe(
24
+ "Last-resort variant. Only use when the answer needs HTML elements markdown cannot produce: a real <button>, an embedded <iframe>, a <form>, or a structural <table> with attributes. Otherwise use a plain string with markdown."
25
+ ),
26
+ html: z.string().describe("Sanitized HTML string rendered directly as the answer body.")
27
+ }).describe(
28
+ "Rich HTML answer. Use only when the answer needs HTML markdown cannot produce \u2014 buttons, iframes, forms, structural tables. Plain text, bold/italic, links, and lists all belong in a plain string with markdown."
29
+ );
30
+ var EnhancedMarkdownAnswerZ = z.object({
31
+ type: z.literal("markdown").describe(
32
+ "Markdown answer with a sidecar `assets` array. Renders identically to a plain-string answer \u2014 the only reason to choose this shape is to attach named media (images, video) with metadata (alt, width, height) and reference them via `asset:<id>` URIs. For inline images with raw URLs, a plain string is simpler."
33
+ ),
34
+ content: z.string().describe(
35
+ "Markdown string. Reference assets using the `asset:<id>` URI scheme, e.g. `![alt](asset:my-img)`."
36
+ ),
37
+ assets: z.array(AssetZ).optional().describe("Optional media assets referenced in the markdown via `asset:<id>` URIs.")
38
+ }).describe(
39
+ "Markdown answer with a named-assets sidecar. Same renderer as a plain-string answer; the only difference is that media is referenced by id with metadata instead of inlined as raw URLs."
40
+ );
41
+ var FAQAnswerZ = z.union([z.string(), RichHTMLAnswerZ, EnhancedMarkdownAnswerZ]).describe(
42
+ 'Answer content. DEFAULT: a plain string with markdown \u2014 paragraphs, **bold**, *italic*, `code`, [links](url), and bulleted/numbered lists all render via GFM. Use "rich" HTML ONLY when the answer needs HTML markdown cannot produce (buttons, iframes, forms, structural tables) \u2014 there must be a real reason. Use "markdown" (the object form) only when you need named media assets with metadata; otherwise a plain string is simpler.'
43
+ );
44
+ var FeedbackConfigZ = z.object({
45
+ style: z.enum(["thumbs", "rating"]).describe('"thumbs" shows a thumbs-up/down pair; "rating" shows a numeric scale.'),
46
+ prompt: z.string().optional().describe(
47
+ 'Optional prompt text shown above the feedback controls (e.g. "Was this helpful?").'
48
+ )
49
+ }).describe("Detailed feedback widget configuration specifying style and optional prompt text.");
50
+ var FeedbackZ = z.union([z.boolean(), FeedbackConfigZ]).describe(
51
+ "Per-item feedback widget. Pass true for default thumbs feedback, false to disable, or a FeedbackConfig object for custom style and prompt."
52
+ );
53
+ var SegmentOrderingZ = z.object({
54
+ type: z.literal("segment").describe("Segment-based ordering: item order varies per user segment."),
55
+ segmentWeights: z.record(z.array(z.string())).describe(
56
+ "Map of segment ID \u2192 ordered list of question IDs. Each segment gets its own item order."
57
+ )
58
+ }).describe(
59
+ "Segment-based ordering strategy. Each key is a segment ID and the value is the ordered list of item IDs shown to users in that segment."
60
+ );
61
+ var OrderingStrategyZ = z.union([z.enum(["static", "priority"]), SegmentOrderingZ]).describe(
62
+ '"static" = config order, "priority" = sort by item priority field descending, or a segment object for per-segment ordering.'
63
+ );
64
+ var AnswerStrategyZ = z.object({
65
+ endpoint: z.string().min(1).describe("Backend endpoint URL that generates the AI answer for this question."),
66
+ context: z.array(z.string()).optional().describe("Optional list of context keys passed to the endpoint to ground the answer."),
67
+ cache: z.enum(["session", "none"]).optional().describe(
68
+ `"session" caches the generated answer for the user's session; "none" regenerates on each expand.`
69
+ ),
70
+ fallback: z.string().optional().describe("Static fallback answer text shown if the AI endpoint fails or times out.")
71
+ }).describe(
72
+ "AI answer generation strategy. When present, the answer is generated dynamically by calling the specified endpoint."
73
+ );
74
+ var InjectionRuleZ = z.object({
75
+ trigger: DecisionStrategyZ.describe(
76
+ "Decision strategy that evaluates to true when the items should be injected (e.g. page URL matches checkout)."
77
+ ),
78
+ items: z.array(z.lazy(() => FAQQuestionSchema)).describe("FAQ question items to inject when the trigger fires."),
79
+ position: z.enum(["prepend", "append"]).optional().describe('"prepend" inserts injected items at the top; "append" adds them at the bottom.'),
80
+ once: z.boolean().optional().describe("When true, items are injected only on the first trigger match and not again.")
81
+ }).describe(
82
+ "Dynamic injection rule: adds contextual FAQ items when a trigger condition is met (e.g. user is on the checkout page)."
83
+ );
84
+ var FAQQuestionSchema = z.object({
85
+ ...AuthoringFieldsZ,
86
+ kind: z.literal("faq:question").describe(
87
+ "Compositional action type for a single FAQ accordion item. Rendered by the adaptive-faq:accordion widget."
88
+ ),
89
+ config: z.object({
90
+ /** Unique identifier for this question */
91
+ id: z.string().min(1, "ID is required"),
92
+ /** The question text */
93
+ question: z.string().min(1, "Question is required").describe("The question text shown in the accordion header."),
94
+ /** The answer content (plain string, rich HTML, or enhanced markdown) */
95
+ answer: FAQAnswerZ,
96
+ /** Optional category for grouping */
97
+ category: z.string().optional().describe(
98
+ "Optional grouping label. Questions with the same category are collapsible under a shared section header."
99
+ ),
100
+ /** Optional priority for ordering */
101
+ priority: z.number().optional().describe(
102
+ 'Numeric priority used when ordering="priority". Higher values appear first. Omit for equal priority.'
103
+ ),
104
+ /** Optional AI answer generation strategy */
105
+ answerStrategy: AnswerStrategyZ.optional().describe(
106
+ "Optional AI answer generation config. When set, the answer field is used as a fallback only."
107
+ )
108
+ }).describe(
109
+ "Per-question configuration including the question text, answer content, and optional metadata."
110
+ ),
111
+ /** Per-item activation strategy (null = always show) */
112
+ triggerWhen: TriggerWhenZ.describe(
113
+ "Conditional visibility strategy. When null or omitted, the question is always shown. Use a rules strategy to show/hide based on page URL, event counts, or session metrics."
114
+ ),
115
+ /** Toast config when triggerWhen transitions false → true. Required when triggerWhen is set (use null to opt out). */
116
+ notify: NotifyZ.describe(
117
+ "Toast notification shown when triggerWhen transitions false \u2192 true. Required when triggerWhen is set \u2014 pass null to opt out of the toast."
118
+ )
119
+ }).refine((data) => !data.triggerWhen || data.notify !== void 0, {
120
+ message: "notify is required when triggerWhen is present (use null to opt out of notifications)"
20
121
  });
21
- /** Schema for rich HTML answer content. */
22
- const RichHTMLAnswerZ = z.object({
23
- type: z.literal('rich'),
24
- html: z.string(),
122
+ var configSchema = z.object({
123
+ /** Display title for the FAQ widget */
124
+ title: z.string().optional().describe("Optional header text shown above the accordion list."),
125
+ /** Whether only one or multiple questions can be expanded at once */
126
+ expandBehavior: z.enum(["single", "multiple"]).default("single").describe(
127
+ '"single" collapses any open item before expanding another; "multiple" allows any number open at once.'
128
+ ),
129
+ /** Whether to show a search/filter input */
130
+ searchable: z.boolean().default(false).describe("When true, renders a text input that filters questions by keyword."),
131
+ /** Color theme */
132
+ theme: z.enum(["light", "dark", "auto"]).default("auto").describe(
133
+ `"auto" follows the user's OS preference; use "light" or "dark" to pin the theme.`
134
+ ),
135
+ /** FAQ questions (compositional actions) */
136
+ actions: z.array(FAQQuestionSchema).default([]).describe(
137
+ "The FAQ items rendered by the accordion. Each item is a faq:question compositional action \u2014 these are configuration data rendered by the widget, not actions executed by the runtime. Empty arrays are accepted at the SDK runtime layer (LLM-driven mounts start empty and append items in subsequent tool calls); empty-FAQ rejection lives in the publish-time validator, not here."
138
+ ),
139
+ /** Feedback widget configuration */
140
+ feedback: FeedbackZ.optional().describe(
141
+ "Optional per-item feedback widget. Enable with true (default thumbs style) or a FeedbackConfig for custom style."
142
+ ),
143
+ /** Question ordering strategy */
144
+ ordering: OrderingStrategyZ.optional().describe(
145
+ 'Controls the display order of items. Omit for static (config) order, "priority" to sort by priority field, or a segment object for per-segment ordering.'
146
+ ),
147
+ /** Dynamic FAQ injection rules */
148
+ injections: z.array(InjectionRuleZ).optional().describe(
149
+ "Optional injection rules that dynamically add FAQ items when trigger conditions are met (e.g. inject checkout FAQs on the checkout page)."
150
+ )
151
+ }).describe(
152
+ "Props for the adaptive-faq:accordion tile widget. Configures the FAQ accordion including items, expand behavior, search, feedback, and ordering."
153
+ );
154
+ var ScrollToFaqSchema = z.object({
155
+ ...AuthoringFieldsZ,
156
+ kind: z.literal("faq:scroll_to").describe("Scrolls the viewport to a specific FAQ item and optionally expands it."),
157
+ itemId: z.string().optional().describe("Target question ID. Use this or itemQuestion (at least one required)."),
158
+ itemQuestion: z.string().optional().describe(
159
+ "Target question text for fuzzy matching. Use this or itemId (at least one required)."
160
+ ),
161
+ expand: z.boolean().optional().describe("When true (default), expands the item after scrolling into view."),
162
+ behavior: z.enum(["smooth", "instant", "auto"]).optional().describe('"smooth" animates the scroll; "instant" jumps; "auto" defers to browser default.')
163
+ }).refine((data) => data.itemId || data.itemQuestion, {
164
+ message: "Either itemId or itemQuestion is required"
25
165
  });
26
- /** Schema for enhanced markdown answer content with optional assets. */
27
- const EnhancedMarkdownAnswerZ = z.object({
28
- type: z.literal('markdown'),
29
- content: z.string(),
30
- assets: z.array(AssetZ).optional(),
166
+ var ToggleFaqItemSchema = z.object({
167
+ ...AuthoringFieldsZ,
168
+ kind: z.literal("faq:toggle_item").describe("Opens, closes, or toggles the expanded state of a specific FAQ item."),
169
+ itemId: z.string().optional().describe("Target question ID. Use this or itemQuestion (at least one required)."),
170
+ itemQuestion: z.string().optional().describe(
171
+ "Target question text for fuzzy matching. Use this or itemId (at least one required)."
172
+ ),
173
+ state: z.enum(["open", "closed", "toggle"]).default("toggle").describe('"open" expands, "closed" collapses, "toggle" flips the current state.')
174
+ }).refine((data) => data.itemId || data.itemQuestion, {
175
+ message: "Either itemId or itemQuestion is required"
31
176
  });
32
- /** Union of all FAQ answer types: plain string, rich HTML, or enhanced markdown. */
33
- const FAQAnswerZ = z.union([z.string(), RichHTMLAnswerZ, EnhancedMarkdownAnswerZ]);
34
- // ============================================================================
35
- // Feedback Schemas
36
- // ============================================================================
37
- /** Schema for feedback widget configuration. */
38
- const FeedbackConfigZ = z.object({
39
- style: z.enum(['thumbs', 'rating']),
40
- prompt: z.string().optional(),
177
+ var UpdateFaqSchema = z.object({
178
+ ...AuthoringFieldsZ,
179
+ kind: z.literal("faq:update").describe("Dynamically adds, removes, reorders, or replaces FAQ items at runtime."),
180
+ operation: z.enum(["add", "remove", "reorder", "replace"]).describe(
181
+ '"add" inserts items, "remove" deletes one by ID, "reorder" applies a new ID order, "replace" swaps all items.'
182
+ ),
183
+ items: z.array(FAQQuestionSchema).optional().describe(
184
+ 'Items to act on. Required for "add" (the items to insert) and "replace" (the full replacement set; pass [] to intentionally clear all items).'
185
+ ),
186
+ itemId: z.string().optional().describe('ID of the item to remove. Required for "remove".'),
187
+ order: z.array(z.string()).optional().describe(
188
+ 'New display order as an ordered list of item IDs. Required for "reorder". To intentionally clear the list, use operation "replace" with items: [].'
189
+ ),
190
+ position: z.enum(["prepend", "append", "before", "after"]).optional().describe("Where to insert new items relative to existing ones or relative to anchorId."),
191
+ anchorId: AnchorIdZ.optional().describe(
192
+ 'Reference item for "before" or "after" positioning. Identifies an existing FAQ item as the insertion anchor.'
193
+ )
194
+ }).describe(
195
+ "Runtime mutation action for the FAQ item list. Use to add contextual questions, remove outdated ones, or reorder by priority."
196
+ ).superRefine((data, ctx) => {
197
+ switch (data.operation) {
198
+ case "add":
199
+ if (data.items === void 0) {
200
+ ctx.addIssue({
201
+ code: z.ZodIssueCode.custom,
202
+ path: ["items"],
203
+ message: 'items is required when operation is "add"'
204
+ });
205
+ }
206
+ break;
207
+ case "remove":
208
+ if (data.itemId === void 0) {
209
+ ctx.addIssue({
210
+ code: z.ZodIssueCode.custom,
211
+ path: ["itemId"],
212
+ message: 'itemId is required when operation is "remove"'
213
+ });
214
+ }
215
+ break;
216
+ case "reorder":
217
+ if (data.order === void 0) {
218
+ ctx.addIssue({
219
+ code: z.ZodIssueCode.custom,
220
+ path: ["order"],
221
+ message: 'order is required when operation is "reorder" (use operation "replace" with items: [] to intentionally clear the list)'
222
+ });
223
+ }
224
+ break;
225
+ case "replace":
226
+ if (data.items === void 0) {
227
+ ctx.addIssue({
228
+ code: z.ZodIssueCode.custom,
229
+ path: ["items"],
230
+ message: 'items is required when operation is "replace" (pass [] to clear the list)'
231
+ });
232
+ }
233
+ break;
234
+ }
41
235
  });
42
- /** Feedback can be a boolean (enable/disable) or a detailed config object. */
43
- const FeedbackZ = z.union([z.boolean(), FeedbackConfigZ]);
44
- // ============================================================================
45
- // Ordering Schemas
46
- // ============================================================================
47
- /** Schema for segment-based ordering strategy. */
48
- const SegmentOrderingZ = z.object({
49
- type: z.literal('segment'),
50
- segmentWeights: z.record(z.array(z.string())),
51
- });
52
- /** Ordering strategy: static order, priority-based, or segment-based. */
53
- const OrderingStrategyZ = z.union([z.enum(['static', 'priority']), SegmentOrderingZ]);
54
- // ============================================================================
55
- // AI Answer Strategy Schema
56
- // ============================================================================
57
- /** Schema for AI-generated answer configuration. */
58
- const AnswerStrategyZ = z.object({
59
- endpoint: z.string().min(1),
60
- context: z.array(z.string()).optional(),
61
- cache: z.enum(['session', 'none']).optional(),
62
- fallback: z.string().optional(),
63
- });
64
- // ============================================================================
65
- // Injection Rule Schema
66
- // ============================================================================
67
- /** Schema for dynamic FAQ injection rules. */
68
- const InjectionRuleZ = z.object({
69
- trigger: DecisionStrategyZ,
70
- items: z.array(z.lazy(() => FAQQuestionSchema)),
71
- position: z.enum(['prepend', 'append']).optional(),
72
- once: z.boolean().optional(),
73
- });
74
- // ============================================================================
75
- // FAQ Question Schema
76
- // ============================================================================
77
- /**
78
- * Schema for a single FAQ question (compositional action).
79
- */
80
- export const FAQQuestionSchema = z
81
- .object({
82
- kind: z.literal('faq:question'),
83
- config: z.object({
84
- /** Unique identifier for this question */
85
- id: z.string().min(1, 'ID is required'),
86
- /** The question text */
87
- question: z.string().min(1, 'Question is required'),
88
- /** The answer content (plain string, rich HTML, or enhanced markdown) */
89
- answer: FAQAnswerZ,
90
- /** Optional category for grouping */
91
- category: z.string().optional(),
92
- /** Optional priority for ordering */
93
- priority: z.number().optional(),
94
- /** Optional AI answer generation strategy */
95
- answerStrategy: AnswerStrategyZ.optional(),
96
- }),
97
- /** Per-item activation strategy (null = always show) */
98
- triggerWhen: TriggerWhenZ,
99
- /** Toast config when triggerWhen transitions false → true. Required when triggerWhen is set (use null to opt out). */
100
- notify: NotifyZ,
101
- })
102
- .refine((data) => !data.triggerWhen || data.notify !== undefined, {
103
- message: 'notify is required when triggerWhen is present (use null to opt out of notifications)',
104
- });
105
- // ============================================================================
106
- // FAQ Config Schema
107
- // ============================================================================
108
- /**
109
- * Full configuration schema for adaptive-faq.
110
- */
111
- export const configSchema = z.object({
112
- /** Display title for the FAQ widget */
113
- title: z.string().optional(),
114
- /** Whether only one or multiple questions can be expanded at once */
115
- expandBehavior: z.enum(['single', 'multiple']).default('single'),
116
- /** Whether to show a search/filter input */
117
- searchable: z.boolean().default(false),
118
- /** Color theme */
119
- theme: z.enum(['light', 'dark', 'auto']).default('auto'),
120
- /** FAQ questions (compositional actions) */
121
- actions: z.array(FAQQuestionSchema).default([]),
122
- /** Feedback widget configuration */
123
- feedback: FeedbackZ.optional(),
124
- /** Question ordering strategy */
125
- ordering: OrderingStrategyZ.optional(),
126
- /** Dynamic FAQ injection rules */
127
- injections: z.array(InjectionRuleZ).optional(),
128
- });
129
- // ============================================================================
130
- // Executor Action Schemas
131
- // ============================================================================
132
- /**
133
- * Schema for scrolling to a specific FAQ item.
134
- * Requires either itemId or itemQuestion to identify the target.
135
- */
136
- export const ScrollToFaqSchema = z
137
- .object({
138
- kind: z.literal('faq:scroll_to'),
139
- itemId: z.string().optional(),
140
- itemQuestion: z.string().optional(),
141
- expand: z.boolean().optional(),
142
- behavior: z.enum(['smooth', 'instant', 'auto']).optional(),
143
- })
144
- .refine((data) => data.itemId || data.itemQuestion, {
145
- message: 'Either itemId or itemQuestion is required',
146
- });
147
- /**
148
- * Schema for toggling a FAQ item open/closed.
149
- * Requires either itemId or itemQuestion to identify the target.
150
- */
151
- export const ToggleFaqItemSchema = z
152
- .object({
153
- kind: z.literal('faq:toggle_item'),
154
- itemId: z.string().optional(),
155
- itemQuestion: z.string().optional(),
156
- state: z.enum(['open', 'closed', 'toggle']).default('toggle'),
157
- })
158
- .refine((data) => data.itemId || data.itemQuestion, {
159
- message: 'Either itemId or itemQuestion is required',
160
- });
161
- /**
162
- * Schema for updating FAQ items (add, remove, reorder, replace).
163
- */
164
- export const UpdateFaqSchema = z.object({
165
- kind: z.literal('faq:update'),
166
- operation: z.enum(['add', 'remove', 'reorder', 'replace']),
167
- items: z.array(FAQQuestionSchema).optional(),
168
- itemId: z.string().optional(),
169
- order: z.array(z.string()).optional(),
170
- position: z.enum(['prepend', 'append', 'before', 'after']).optional(),
171
- anchorId: AnchorIdZ.optional(),
172
- });
173
- // ============================================================================
174
- // Validation Helpers
175
- // ============================================================================
176
- /**
177
- * Validate a FAQ question action.
178
- */
179
- export function validateFAQQuestion(data) {
180
- return FAQQuestionSchema.safeParse(data);
236
+ function validateFAQQuestion(data) {
237
+ return FAQQuestionSchema.safeParse(data);
181
238
  }
182
- /**
183
- * Validate the full FAQ config.
184
- */
185
- export function validateFAQConfig(data) {
186
- return configSchema.safeParse(data);
239
+ function validateFAQConfig(data) {
240
+ return configSchema.safeParse(data);
187
241
  }
188
- // ============================================================================
189
- // Unified Schema Export
190
- // ============================================================================
191
- /**
192
- * Action step schemas for unified JSON Schema generation.
193
- * The build script reads this array to merge adaptive actions into the
194
- * unified canvas-config.schema.json.
195
- *
196
- * Note: `.innerType()` strips the `.refine()` wrapper since JSON Schema
197
- * cannot express cross-field refinements; runtime Zod handles that.
198
- */
199
- export const actionStepSchemas = [
200
- { defName: 'faqQuestion', schema: FAQQuestionSchema.innerType() },
201
- { defName: 'faqScrollTo', schema: ScrollToFaqSchema.innerType() },
202
- { defName: 'faqToggleItem', schema: ToggleFaqItemSchema.innerType() },
203
- { defName: 'faqUpdate', schema: UpdateFaqSchema },
242
+ var actionStepSchemas = [
243
+ { defName: "faqQuestion", schema: FAQQuestionSchema.innerType() },
244
+ { defName: "faqScrollTo", schema: ScrollToFaqSchema.innerType() },
245
+ { defName: "faqToggleItem", schema: ToggleFaqItemSchema.innerType() },
246
+ { defName: "faqUpdate", schema: UpdateFaqSchema.innerType() }
204
247
  ];
205
- // ============================================================================
206
- // Tile Widget Props Export
207
- // ============================================================================
208
- /**
209
- * Tile widget definitions for unified JSON Schema generation.
210
- * Maps widget IDs to their props validation schema so the build script
211
- * can inject if/then constraints on tile.props.
212
- */
213
- export const tileWidgets = [
214
- { widget: 'adaptive-faq:accordion', defName: 'faqAccordionProps', propsSchema: configSchema },
248
+ var tileWidgets = [
249
+ { widget: "adaptive-faq:accordion", defName: "faqAccordionProps", propsSchema: configSchema }
215
250
  ];
251
+ var CAPABILITIES_DOCUMENTATION = {
252
+ packageId: "adaptive-faq",
253
+ plannerSummary: "A grouping (or one) of focused Q&A to educate the user on information they need given their segment/behavior.",
254
+ description: "Collapsible Q&A accordion with actions, rich content, feedback, and personalization.",
255
+ whenToUse: [
256
+ {
257
+ goal: "Add an FAQ accordion widget",
258
+ action: 'Add a tile with widget: "adaptive-faq:accordion"'
259
+ },
260
+ { goal: "Scroll to and expand a specific FAQ item", action: "faq:scroll_to" },
261
+ { goal: "Open, close, or toggle a FAQ item", action: "faq:toggle_item" },
262
+ { goal: "Add, remove, reorder, or replace FAQ items", action: "faq:update" }
263
+ ],
264
+ conventions: [
265
+ {
266
+ name: "Compositional action pattern",
267
+ description: "faq:question actions are configuration data rendered by the accordion widget, not actions executed by the runtime. This allows per-item conditional visibility via triggerWhen, category grouping under collapsible section headers, and dynamic injection of contextual items."
268
+ },
269
+ {
270
+ name: "Answer format \u2014 always prefer markdown",
271
+ description: 'Always use a plain string with markdown for FAQ answers. The only real reason to reach for the "rich" HTML variant is when the answer needs an HTML element markdown cannot produce \u2014 a real <button>, an <iframe>, a <form>, or a structural <table>. Bold/italic, links, lists, code blocks, and inline images all render fine from a plain string. The "markdown" object variant exists only for named-asset references with metadata; otherwise a plain string is simpler.'
272
+ },
273
+ {
274
+ name: "Feedback events",
275
+ description: "When feedback is enabled, user feedback events are published via context.publishEvent for analytics integration."
276
+ }
277
+ ],
278
+ events: [
279
+ {
280
+ name: "faq:feedback_submitted",
281
+ when: "User submits feedback on a FAQ answer",
282
+ props: "{ questionId, style, value }"
283
+ }
284
+ ]
285
+ };
286
+ export {
287
+ CAPABILITIES_DOCUMENTATION,
288
+ FAQQuestionSchema,
289
+ ScrollToFaqSchema,
290
+ ToggleFaqItemSchema,
291
+ UpdateFaqSchema,
292
+ actionStepSchemas,
293
+ configSchema,
294
+ tileWidgets,
295
+ validateFAQConfig,
296
+ validateFAQQuestion
297
+ };
298
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/schema.ts"],
4
+ "sourcesContent": ["/**\n * Adaptive FAQ - Config Schema\n *\n * Zod schema for validating FAQ accordion configuration.\n * Demonstrates compositional action pattern with per-item triggerWhen.\n */\n\nimport {\n AnchorIdZ,\n AuthoringFieldsZ,\n DecisionStrategyZ,\n NotifyZ,\n TriggerWhenZ,\n} from '@syntrologie/sdk-contracts';\nimport { z } from 'zod';\n\n// ============================================================================\n// Rich Answer Content Schemas\n// ============================================================================\n\n/** Schema for media assets embedded in enhanced markdown answers. */\nconst AssetZ = z\n .object({\n id: z\n .string()\n .describe('Unique asset ID referenced inside the markdown content via `asset:<id>`.'),\n type: z\n .enum(['image', 'video'])\n .describe('\"image\" for static images, \"video\" for embeddable video clips.'),\n src: z.string().describe('Absolute URL of the media asset.'),\n alt: z.string().optional().describe('Optional alt text for images (accessibility).'),\n width: z.number().optional().describe('Optional display width in pixels.'),\n height: z.number().optional().describe('Optional display height in pixels.'),\n })\n .describe(\n 'A single embedded media asset (image or video) referenced by ID in the markdown content.'\n );\n\n/** Schema for rich HTML answer content. */\nconst RichHTMLAnswerZ = z\n .object({\n type: z\n .literal('rich')\n .describe(\n 'Last-resort variant. Only use when the answer needs HTML elements markdown cannot produce: a real <button>, an embedded <iframe>, a <form>, or a structural <table> with attributes. Otherwise use a plain string with markdown.'\n ),\n html: z.string().describe('Sanitized HTML string rendered directly as the answer body.'),\n })\n .describe(\n 'Rich HTML answer. Use only when the answer needs HTML markdown cannot produce \u2014 buttons, iframes, forms, structural tables. Plain text, bold/italic, links, and lists all belong in a plain string with markdown.'\n );\n\n/** Schema for enhanced markdown answer content with optional assets. */\nconst EnhancedMarkdownAnswerZ = z\n .object({\n type: z\n .literal('markdown')\n .describe(\n 'Markdown answer with a sidecar `assets` array. Renders identically to a plain-string answer \u2014 the only reason to choose this shape is to attach named media (images, video) with metadata (alt, width, height) and reference them via `asset:<id>` URIs. For inline images with raw URLs, a plain string is simpler.'\n ),\n content: z\n .string()\n .describe(\n 'Markdown string. Reference assets using the `asset:<id>` URI scheme, e.g. `![alt](asset:my-img)`.'\n ),\n assets: z\n .array(AssetZ)\n .optional()\n .describe('Optional media assets referenced in the markdown via `asset:<id>` URIs.'),\n })\n .describe(\n 'Markdown answer with a named-assets sidecar. Same renderer as a plain-string answer; the only difference is that media is referenced by id with metadata instead of inlined as raw URLs.'\n );\n\n/** Union of all FAQ answer types: plain string, rich HTML, or enhanced markdown. */\nconst FAQAnswerZ = z\n .union([z.string(), RichHTMLAnswerZ, EnhancedMarkdownAnswerZ])\n .describe(\n 'Answer content. DEFAULT: a plain string with markdown \u2014 paragraphs, **bold**, *italic*, `code`, [links](url), and bulleted/numbered lists all render via GFM. Use \"rich\" HTML ONLY when the answer needs HTML markdown cannot produce (buttons, iframes, forms, structural tables) \u2014 there must be a real reason. Use \"markdown\" (the object form) only when you need named media assets with metadata; otherwise a plain string is simpler.'\n );\n\n// ============================================================================\n// Feedback Schemas\n// ============================================================================\n\n/** Schema for feedback widget configuration. */\nconst FeedbackConfigZ = z\n .object({\n style: z\n .enum(['thumbs', 'rating'])\n .describe('\"thumbs\" shows a thumbs-up/down pair; \"rating\" shows a numeric scale.'),\n prompt: z\n .string()\n .optional()\n .describe(\n 'Optional prompt text shown above the feedback controls (e.g. \"Was this helpful?\").'\n ),\n })\n .describe('Detailed feedback widget configuration specifying style and optional prompt text.');\n\n/** Feedback can be a boolean (enable/disable) or a detailed config object. */\nconst FeedbackZ = z\n .union([z.boolean(), FeedbackConfigZ])\n .describe(\n 'Per-item feedback widget. Pass true for default thumbs feedback, false to disable, or a FeedbackConfig object for custom style and prompt.'\n );\n\n// ============================================================================\n// Ordering Schemas\n// ============================================================================\n\n/** Schema for segment-based ordering strategy. */\nconst SegmentOrderingZ = z\n .object({\n type: z\n .literal('segment')\n .describe('Segment-based ordering: item order varies per user segment.'),\n segmentWeights: z\n .record(z.array(z.string()))\n .describe(\n 'Map of segment ID \u2192 ordered list of question IDs. Each segment gets its own item order.'\n ),\n })\n .describe(\n 'Segment-based ordering strategy. Each key is a segment ID and the value is the ordered list of item IDs shown to users in that segment.'\n );\n\n/** Ordering strategy: static order, priority-based, or segment-based. */\nconst OrderingStrategyZ = z\n .union([z.enum(['static', 'priority']), SegmentOrderingZ])\n .describe(\n '\"static\" = config order, \"priority\" = sort by item priority field descending, or a segment object for per-segment ordering.'\n );\n\n// ============================================================================\n// AI Answer Strategy Schema\n// ============================================================================\n\n/** Schema for AI-generated answer configuration. */\nconst AnswerStrategyZ = z\n .object({\n endpoint: z\n .string()\n .min(1)\n .describe('Backend endpoint URL that generates the AI answer for this question.'),\n context: z\n .array(z.string())\n .optional()\n .describe('Optional list of context keys passed to the endpoint to ground the answer.'),\n cache: z\n .enum(['session', 'none'])\n .optional()\n .describe(\n '\"session\" caches the generated answer for the user\\'s session; \"none\" regenerates on each expand.'\n ),\n fallback: z\n .string()\n .optional()\n .describe('Static fallback answer text shown if the AI endpoint fails or times out.'),\n })\n .describe(\n 'AI answer generation strategy. When present, the answer is generated dynamically by calling the specified endpoint.'\n );\n\n// ============================================================================\n// Injection Rule Schema\n// ============================================================================\n\n/** Schema for dynamic FAQ injection rules. */\nconst InjectionRuleZ = z\n .object({\n trigger: DecisionStrategyZ.describe(\n 'Decision strategy that evaluates to true when the items should be injected (e.g. page URL matches checkout).'\n ),\n items: z\n .array(z.lazy(() => FAQQuestionSchema))\n .describe('FAQ question items to inject when the trigger fires.'),\n position: z\n .enum(['prepend', 'append'])\n .optional()\n .describe('\"prepend\" inserts injected items at the top; \"append\" adds them at the bottom.'),\n once: z\n .boolean()\n .optional()\n .describe('When true, items are injected only on the first trigger match and not again.'),\n })\n .describe(\n 'Dynamic injection rule: adds contextual FAQ items when a trigger condition is met (e.g. user is on the checkout page).'\n );\n\n// ============================================================================\n// FAQ Question Schema\n// ============================================================================\n\n/**\n * Schema for a single FAQ question (compositional action).\n */\nexport const FAQQuestionSchema = z\n .object({\n ...AuthoringFieldsZ,\n kind: z\n .literal('faq:question')\n .describe(\n 'Compositional action type for a single FAQ accordion item. Rendered by the adaptive-faq:accordion widget.'\n ),\n config: z\n .object({\n /** Unique identifier for this question */\n id: z.string().min(1, 'ID is required'),\n /** The question text */\n question: z\n .string()\n .min(1, 'Question is required')\n .describe('The question text shown in the accordion header.'),\n /** The answer content (plain string, rich HTML, or enhanced markdown) */\n answer: FAQAnswerZ,\n /** Optional category for grouping */\n category: z\n .string()\n .optional()\n .describe(\n 'Optional grouping label. Questions with the same category are collapsible under a shared section header.'\n ),\n /** Optional priority for ordering */\n priority: z\n .number()\n .optional()\n .describe(\n 'Numeric priority used when ordering=\"priority\". Higher values appear first. Omit for equal priority.'\n ),\n /** Optional AI answer generation strategy */\n answerStrategy: AnswerStrategyZ.optional().describe(\n 'Optional AI answer generation config. When set, the answer field is used as a fallback only.'\n ),\n })\n .describe(\n 'Per-question configuration including the question text, answer content, and optional metadata.'\n ),\n /** Per-item activation strategy (null = always show) */\n triggerWhen: TriggerWhenZ.describe(\n 'Conditional visibility strategy. When null or omitted, the question is always shown. Use a rules strategy to show/hide based on page URL, event counts, or session metrics.'\n ),\n /** Toast config when triggerWhen transitions false \u2192 true. Required when triggerWhen is set (use null to opt out). */\n notify: NotifyZ.describe(\n 'Toast notification shown when triggerWhen transitions false \u2192 true. Required when triggerWhen is set \u2014 pass null to opt out of the toast.'\n ),\n })\n .refine((data) => !data.triggerWhen || data.notify !== undefined, {\n message:\n 'notify is required when triggerWhen is present (use null to opt out of notifications)',\n });\n\nexport type FAQQuestionSchemaType = z.infer<typeof FAQQuestionSchema>;\n\n// ============================================================================\n// FAQ Config Schema\n// ============================================================================\n\n/**\n * Full configuration schema for adaptive-faq.\n */\nexport const configSchema = z\n .object({\n /** Display title for the FAQ widget */\n title: z.string().optional().describe('Optional header text shown above the accordion list.'),\n /** Whether only one or multiple questions can be expanded at once */\n expandBehavior: z\n .enum(['single', 'multiple'])\n .default('single')\n .describe(\n '\"single\" collapses any open item before expanding another; \"multiple\" allows any number open at once.'\n ),\n /** Whether to show a search/filter input */\n searchable: z\n .boolean()\n .default(false)\n .describe('When true, renders a text input that filters questions by keyword.'),\n /** Color theme */\n theme: z\n .enum(['light', 'dark', 'auto'])\n .default('auto')\n .describe(\n '\"auto\" follows the user\\'s OS preference; use \"light\" or \"dark\" to pin the theme.'\n ),\n /** FAQ questions (compositional actions) */\n actions: z\n .array(FAQQuestionSchema)\n .default([])\n .describe(\n 'The FAQ items rendered by the accordion. Each item is a faq:question compositional action \u2014 these are configuration data rendered by the widget, not actions executed by the runtime. Empty arrays are accepted at the SDK runtime layer (LLM-driven mounts start empty and append items in subsequent tool calls); empty-FAQ rejection lives in the publish-time validator, not here.'\n ),\n /** Feedback widget configuration */\n feedback: FeedbackZ.optional().describe(\n 'Optional per-item feedback widget. Enable with true (default thumbs style) or a FeedbackConfig for custom style.'\n ),\n /** Question ordering strategy */\n ordering: OrderingStrategyZ.optional().describe(\n 'Controls the display order of items. Omit for static (config) order, \"priority\" to sort by priority field, or a segment object for per-segment ordering.'\n ),\n /** Dynamic FAQ injection rules */\n injections: z\n .array(InjectionRuleZ)\n .optional()\n .describe(\n 'Optional injection rules that dynamically add FAQ items when trigger conditions are met (e.g. inject checkout FAQs on the checkout page).'\n ),\n })\n .describe(\n 'Props for the adaptive-faq:accordion tile widget. Configures the FAQ accordion including items, expand behavior, search, feedback, and ordering.'\n );\n\nexport type FAQConfig = z.infer<typeof configSchema>;\n\n// ============================================================================\n// Executor Action Schemas\n// ============================================================================\n\n/**\n * Schema for scrolling to a specific FAQ item.\n * Requires either itemId or itemQuestion to identify the target.\n */\nexport const ScrollToFaqSchema = z\n .object({\n ...AuthoringFieldsZ,\n kind: z\n .literal('faq:scroll_to')\n .describe('Scrolls the viewport to a specific FAQ item and optionally expands it.'),\n itemId: z\n .string()\n .optional()\n .describe('Target question ID. Use this or itemQuestion (at least one required).'),\n itemQuestion: z\n .string()\n .optional()\n .describe(\n 'Target question text for fuzzy matching. Use this or itemId (at least one required).'\n ),\n expand: z\n .boolean()\n .optional()\n .describe('When true (default), expands the item after scrolling into view.'),\n behavior: z\n .enum(['smooth', 'instant', 'auto'])\n .optional()\n .describe('\"smooth\" animates the scroll; \"instant\" jumps; \"auto\" defers to browser default.'),\n })\n .refine((data) => data.itemId || data.itemQuestion, {\n message: 'Either itemId or itemQuestion is required',\n });\n\n/**\n * Schema for toggling a FAQ item open/closed.\n * Requires either itemId or itemQuestion to identify the target.\n */\nexport const ToggleFaqItemSchema = z\n .object({\n ...AuthoringFieldsZ,\n kind: z\n .literal('faq:toggle_item')\n .describe('Opens, closes, or toggles the expanded state of a specific FAQ item.'),\n itemId: z\n .string()\n .optional()\n .describe('Target question ID. Use this or itemQuestion (at least one required).'),\n itemQuestion: z\n .string()\n .optional()\n .describe(\n 'Target question text for fuzzy matching. Use this or itemId (at least one required).'\n ),\n state: z\n .enum(['open', 'closed', 'toggle'])\n .default('toggle')\n .describe('\"open\" expands, \"closed\" collapses, \"toggle\" flips the current state.'),\n })\n .refine((data) => data.itemId || data.itemQuestion, {\n message: 'Either itemId or itemQuestion is required',\n });\n\n/**\n * Schema for updating FAQ items (add, remove, reorder, replace).\n *\n * Per-operation field requirements are enforced via .superRefine() so the\n * validator rejects shapes that would silently no-op or destructively clear\n * the list at the executor level (e.g. `operation: 'reorder'` with no\n * `order` array would have wiped all items).\n */\nexport const UpdateFaqSchema = z\n .object({\n ...AuthoringFieldsZ,\n kind: z\n .literal('faq:update')\n .describe('Dynamically adds, removes, reorders, or replaces FAQ items at runtime.'),\n operation: z\n .enum(['add', 'remove', 'reorder', 'replace'])\n .describe(\n '\"add\" inserts items, \"remove\" deletes one by ID, \"reorder\" applies a new ID order, \"replace\" swaps all items.'\n ),\n items: z\n .array(FAQQuestionSchema)\n .optional()\n .describe(\n 'Items to act on. Required for \"add\" (the items to insert) and \"replace\" (the full replacement set; pass [] to intentionally clear all items).'\n ),\n itemId: z.string().optional().describe('ID of the item to remove. Required for \"remove\".'),\n order: z\n .array(z.string())\n .optional()\n .describe(\n 'New display order as an ordered list of item IDs. Required for \"reorder\". To intentionally clear the list, use operation \"replace\" with items: [].'\n ),\n position: z\n .enum(['prepend', 'append', 'before', 'after'])\n .optional()\n .describe('Where to insert new items relative to existing ones or relative to anchorId.'),\n anchorId: AnchorIdZ.optional().describe(\n 'Reference item for \"before\" or \"after\" positioning. Identifies an existing FAQ item as the insertion anchor.'\n ),\n })\n .describe(\n 'Runtime mutation action for the FAQ item list. Use to add contextual questions, remove outdated ones, or reorder by priority.'\n )\n .superRefine((data, ctx) => {\n switch (data.operation) {\n case 'add':\n if (data.items === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['items'],\n message: 'items is required when operation is \"add\"',\n });\n }\n break;\n case 'remove':\n if (data.itemId === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['itemId'],\n message: 'itemId is required when operation is \"remove\"',\n });\n }\n break;\n case 'reorder':\n if (data.order === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['order'],\n message:\n 'order is required when operation is \"reorder\" (use operation \"replace\" with items: [] to intentionally clear the list)',\n });\n }\n break;\n case 'replace':\n if (data.items === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['items'],\n message: 'items is required when operation is \"replace\" (pass [] to clear the list)',\n });\n }\n break;\n }\n });\n\n// ============================================================================\n// Validation Helpers\n// ============================================================================\n\n/**\n * Validate a FAQ question action.\n */\nexport function validateFAQQuestion(data: unknown) {\n return FAQQuestionSchema.safeParse(data);\n}\n\n/**\n * Validate the full FAQ config.\n */\nexport function validateFAQConfig(data: unknown) {\n return configSchema.safeParse(data);\n}\n\n// ============================================================================\n// Unified Schema Export\n// ============================================================================\n\n/**\n * Action step schemas for unified JSON Schema generation.\n * The build script reads this array to merge adaptive actions into the\n * unified canvas-config.schema.json.\n *\n * Note: `.innerType()` strips the `.refine()` wrapper since JSON Schema\n * cannot express cross-field refinements; runtime Zod handles that.\n */\nexport const actionStepSchemas = [\n { defName: 'faqQuestion', schema: FAQQuestionSchema.innerType() },\n { defName: 'faqScrollTo', schema: ScrollToFaqSchema.innerType() },\n { defName: 'faqToggleItem', schema: ToggleFaqItemSchema.innerType() },\n { defName: 'faqUpdate', schema: UpdateFaqSchema.innerType() },\n];\n\n// ============================================================================\n// Tile Widget Props Export\n// ============================================================================\n\n/**\n * Tile widget definitions for unified JSON Schema generation.\n * Maps widget IDs to their props validation schema so the build script\n * can inject if/then constraints on tile.props.\n */\nexport const tileWidgets = [\n { widget: 'adaptive-faq:accordion', defName: 'faqAccordionProps', propsSchema: configSchema },\n];\n\n// ============================================================================\n// Capabilities Documentation (injected into JSON Schema for LLM prompts)\n// ============================================================================\n\nexport const CAPABILITIES_DOCUMENTATION = {\n packageId: 'adaptive-faq',\n plannerSummary:\n 'A grouping (or one) of focused Q&A to educate the user on information they need given their segment/behavior.',\n description:\n 'Collapsible Q&A accordion with actions, rich content, feedback, and personalization.',\n whenToUse: [\n {\n goal: 'Add an FAQ accordion widget',\n action: 'Add a tile with widget: \"adaptive-faq:accordion\"',\n },\n { goal: 'Scroll to and expand a specific FAQ item', action: 'faq:scroll_to' },\n { goal: 'Open, close, or toggle a FAQ item', action: 'faq:toggle_item' },\n { goal: 'Add, remove, reorder, or replace FAQ items', action: 'faq:update' },\n ],\n conventions: [\n {\n name: 'Compositional action pattern',\n description:\n 'faq:question actions are configuration data rendered by the accordion widget, not actions executed by the runtime. This allows per-item conditional visibility via triggerWhen, category grouping under collapsible section headers, and dynamic injection of contextual items.',\n },\n {\n name: 'Answer format \u2014 always prefer markdown',\n description:\n 'Always use a plain string with markdown for FAQ answers. The only real reason to reach for the \"rich\" HTML variant is when the answer needs an HTML element markdown cannot produce \u2014 a real <button>, an <iframe>, a <form>, or a structural <table>. Bold/italic, links, lists, code blocks, and inline images all render fine from a plain string. The \"markdown\" object variant exists only for named-asset references with metadata; otherwise a plain string is simpler.',\n },\n {\n name: 'Feedback events',\n description:\n 'When feedback is enabled, user feedback events are published via context.publishEvent for analytics integration.',\n },\n ],\n events: [\n {\n name: 'faq:feedback_submitted',\n when: 'User submits feedback on a FAQ answer',\n props: '{ questionId, style, value }',\n },\n ],\n};\n"],
5
+ "mappings": ";;;;;;;;;;AAcA,SAAS,SAAS;AAOlB,IAAM,SAAS,EACZ,OAAO;AAAA,EACN,IAAI,EACD,OAAO,EACP,SAAS,0EAA0E;AAAA,EACtF,MAAM,EACH,KAAK,CAAC,SAAS,OAAO,CAAC,EACvB,SAAS,gEAAgE;AAAA,EAC5E,KAAK,EAAE,OAAO,EAAE,SAAS,kCAAkC;AAAA,EAC3D,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,+CAA+C;AAAA,EACnF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,mCAAmC;AAAA,EACzE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oCAAoC;AAC7E,CAAC,EACA;AAAA,EACC;AACF;AAGF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;AAAA,EACX,gBACE;AAAA,EACF,aACE;AAAA,EACF,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,IACA,EAAE,MAAM,4CAA4C,QAAQ,gBAAgB;AAAA,IAC5E,EAAE,MAAM,qCAAqC,QAAQ,kBAAkB;AAAA,IACvE,EAAE,MAAM,8CAA8C,QAAQ,aAAa;AAAA,EAC7E;AAAA,EACA,aAAa;AAAA,IACX;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
package/dist/types.d.ts CHANGED
@@ -111,6 +111,25 @@ export interface FAQConfig {
111
111
  ordering?: OrderingStrategy;
112
112
  injections?: InjectionRule[];
113
113
  }
114
+ /**
115
+ * One section of a multi-tile FAQ config (per-route tiles), as produced by
116
+ * `actionsToAppConfig` when ≥2 FAQ tiles exist on the canvas. The editor
117
+ * renders each group as a section header + items underneath; on save the
118
+ * editor-sdk merge layer routes each group's `actions` back to its tile by
119
+ * `tileId`.
120
+ */
121
+ export interface FAQGroup {
122
+ tileId: string;
123
+ title: string;
124
+ routes: string[];
125
+ actions: FAQQuestionAction[];
126
+ }
127
+ /** Multi-tile FAQ shape consumed by the editor when the canvas has ≥2 FAQ tiles. */
128
+ export interface GroupedFAQConfig {
129
+ groups: FAQGroup[];
130
+ }
131
+ export type FAQEditorConfig = FAQConfig | GroupedFAQConfig;
132
+ export declare function isGroupedFAQConfig(c: FAQEditorConfig | null): c is GroupedFAQConfig;
114
133
  export interface ScrollToFaqAction {
115
134
  kind: 'faq:scroll_to';
116
135
  itemId?: string;
@@ -1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