@syntrologie/adapt-content 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 (109) hide show
  1. package/dist/runtime.d.ts.map +1 -1
  2. package/dist/runtime.js +431 -348
  3. package/dist/runtime.js.map +7 -0
  4. package/dist/schema.d.ts +56 -16
  5. package/dist/schema.d.ts.map +1 -1
  6. package/dist/schema.js +363 -62
  7. package/dist/schema.js.map +7 -0
  8. package/package.json +8 -26
  9. package/dist/cdn.d.ts +0 -35
  10. package/dist/cdn.d.ts.map +0 -1
  11. package/dist/cdn.js +0 -39
  12. package/dist/components/AnchorPicker.d.ts +0 -8
  13. package/dist/components/AnchorPicker.d.ts.map +0 -1
  14. package/dist/components/AnchorPicker.js +0 -6
  15. package/dist/content-editor-state.d.ts +0 -45
  16. package/dist/content-editor-state.d.ts.map +0 -1
  17. package/dist/content-editor-state.js +0 -123
  18. package/dist/content-editor-ui.d.ts +0 -26
  19. package/dist/content-editor-ui.d.ts.map +0 -1
  20. package/dist/content-editor-ui.js +0 -301
  21. package/dist/editor.d.ts +0 -9
  22. package/dist/editor.d.ts.map +0 -1
  23. package/dist/editor.js +0 -8
  24. package/dist/reconciliation-guard.js +0 -80
  25. package/dist/sanitizer.js +0 -95
  26. package/dist/summarize.js +0 -88
  27. package/dist/types.js +0 -7
  28. package/dist/utils/selectorGenerator.d.ts +0 -6
  29. package/dist/utils/selectorGenerator.d.ts.map +0 -1
  30. package/dist/utils/selectorGenerator.js +0 -4
  31. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +0 -2
  32. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +0 -1
  33. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +0 -3
  34. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +0 -34
  35. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +0 -1
  36. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +0 -158
  37. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +0 -7
  38. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +0 -1
  39. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +0 -9
  40. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +0 -23
  41. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +0 -1
  42. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +0 -40
  43. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +0 -7
  44. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +0 -1
  45. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +0 -22
  46. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +0 -8
  47. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +0 -1
  48. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +0 -9
  49. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +0 -7
  50. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +0 -1
  51. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +0 -4
  52. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +0 -7
  53. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +0 -1
  54. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +0 -4
  55. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +0 -13
  56. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +0 -1
  57. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +0 -15
  58. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +0 -7
  59. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +0 -1
  60. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +0 -4
  61. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +0 -9
  62. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +0 -1
  63. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +0 -4
  64. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +0 -8
  65. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +0 -1
  66. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +0 -8
  67. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +0 -7
  68. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +0 -1
  69. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +0 -4
  70. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +0 -25
  71. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +0 -1
  72. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +0 -379
  73. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +0 -8
  74. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +0 -1
  75. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +0 -8
  76. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +0 -8
  77. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +0 -1
  78. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +0 -17
  79. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +0 -32
  80. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +0 -1
  81. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +0 -85
  82. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +0 -6
  83. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +0 -1
  84. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +0 -4
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +0 -8
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +0 -1
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +0 -5
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +0 -12
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +0 -1
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +0 -40
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +0 -26
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +0 -1
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +0 -202
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +0 -8
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +0 -1
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +0 -46
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +0 -24
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +0 -1
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +0 -86
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +0 -34
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +0 -1
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +0 -25
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts +0 -37
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts.map +0 -1
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.js +0 -52
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +0 -22
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +0 -1
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +0 -143
  109. package/node_modules/@syntrologie/shared-editor-ui/package.json +0 -45
package/dist/schema.js CHANGED
@@ -1,63 +1,364 @@
1
- /**
2
- * Adaptive Content - Config Schema
3
- *
4
- * Zod schema for validating content app configuration.
5
- */
6
- import { AnchorIdZ } from '@syntrologie/sdk-contracts';
7
- import { z } from 'zod';
8
- /**
9
- * Content app config schema.
10
- * Defines the structure for content modifications in a canvas config.
11
- */
12
- export const configSchema = z.object({
13
- /** Text replacements */
14
- textReplacements: z
15
- .array(z.object({
16
- anchorId: AnchorIdZ,
17
- summary: z.string(),
18
- text: z.string(),
19
- }))
20
- .optional(),
21
- /** Attribute modifications */
22
- attributeChanges: z
23
- .array(z.object({
24
- anchorId: AnchorIdZ,
25
- summary: z.string(),
26
- attr: z.string(),
27
- value: z.string(),
28
- }))
29
- .optional(),
30
- /** Style modifications */
31
- styleChanges: z
32
- .array(z.object({
33
- anchorId: AnchorIdZ,
34
- summary: z.string(),
35
- styles: z.record(z.string()),
36
- }))
37
- .optional(),
38
- /** HTML insertions */
39
- htmlInsertions: z
40
- .array(z.object({
41
- anchorId: AnchorIdZ,
42
- summary: z.string(),
43
- html: z.string(),
44
- position: z.enum(['before', 'after', 'prepend', 'append', 'replace']),
45
- }))
46
- .optional(),
47
- /** Class additions */
48
- classAdditions: z
49
- .array(z.object({
50
- anchorId: AnchorIdZ,
51
- summary: z.string(),
52
- className: z.string(),
53
- }))
54
- .optional(),
55
- /** Class removals */
56
- classRemovals: z
57
- .array(z.object({
58
- anchorId: AnchorIdZ,
59
- summary: z.string(),
60
- className: z.string(),
61
- }))
62
- .optional(),
1
+ // ../../../node_modules/@lit/context/lib/create-context.js
2
+ function n(n2) {
3
+ return n2;
4
+ }
5
+
6
+ // ../../sdk-contracts/dist/canvas-context.js
7
+ var canvasRuntimeContext = n("syntrologie:canvas-runtime");
8
+
9
+ // ../../sdk-contracts/dist/routes.js
10
+ var utf8Decoder = new TextDecoder("utf-8", { fatal: false });
11
+
12
+ // ../../sdk-contracts/dist/schemas.js
13
+ import { z } from "zod";
14
+ var AnchorIdZ = z.object({
15
+ selector: z.string(),
16
+ route: z.union([z.string(), z.array(z.string())])
17
+ }).strict();
18
+ var AuthoringFieldsZ = {
19
+ id: z.string().optional().describe('Stable action identifier (e.g. "act_3db6a14d2ab0").'),
20
+ title: z.string().max(200).optional().describe("Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK."),
21
+ description: z.string().max(1e3).optional().describe("Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK."),
22
+ validation: z.array(z.string().max(500)).max(10).optional().describe("Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.")
23
+ };
24
+ var COUNTABLE_EVENTS = [
25
+ // User interactions (from PostHog autocapture normalization)
26
+ "ui.click",
27
+ "ui.scroll",
28
+ "ui.input",
29
+ "ui.change",
30
+ "ui.submit",
31
+ // Behavioral detectors (from event-processor)
32
+ "ui.hover",
33
+ "ui.idle",
34
+ "ui.scroll_thrash",
35
+ "ui.focus_bounce",
36
+ "ui.hesitate",
37
+ "ui.rage_click",
38
+ // Navigation
39
+ "nav.page_view",
40
+ "nav.page_leave"
41
+ ];
42
+ var CountableEventZ = z.enum(COUNTABLE_EVENTS).describe("Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.");
43
+ var SESSION_METRIC_KEYS = ["time_on_page", "page_views", "scroll_depth"];
44
+ var SessionMetricKeyZ = z.enum(SESSION_METRIC_KEYS).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");
45
+ var PageUrlConditionZ = z.object({
46
+ type: z.literal("page_url"),
47
+ url: z.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')
48
+ }).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}');
49
+ var RouteConditionZ = z.object({
50
+ type: z.literal("route"),
51
+ routeId: z.string().describe("Named route ID from the route filter")
52
+ }).describe("Fires when the current route matches a named route ID.");
53
+ var AnchorVisibleConditionZ = z.object({
54
+ type: z.literal("anchor_visible"),
55
+ anchorId: z.string().describe("CSS selector of the anchor element"),
56
+ state: z.enum(["visible", "present", "absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')
57
+ }).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`);
58
+ var EventOccurredConditionZ = z.object({
59
+ type: z.literal("event_occurred"),
60
+ eventName: z.string().describe('Event name (e.g. "ui.click", "$pageview")'),
61
+ withinMs: z.number().optional().describe("Time window in ms. Omit = any time this session.")
62
+ }).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}');
63
+ var StateEqualsConditionZ = z.object({
64
+ type: z.literal("state_equals"),
65
+ key: z.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),
66
+ value: z.unknown().describe("Expected value to match against")
67
+ }).describe("Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.");
68
+ var ViewportConditionZ = z.object({
69
+ type: z.literal("viewport"),
70
+ minWidth: z.number().optional().describe("Minimum viewport width in pixels"),
71
+ maxWidth: z.number().optional().describe("Maximum viewport width in pixels"),
72
+ minHeight: z.number().optional().describe("Minimum viewport height in pixels"),
73
+ maxHeight: z.number().optional().describe("Maximum viewport height in pixels")
74
+ }).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.');
75
+ var SessionMetricConditionZ = z.object({
76
+ type: z.literal("session_metric"),
77
+ key: SessionMetricKeyZ,
78
+ operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
79
+ threshold: z.number().describe("Numeric threshold to compare against")
80
+ }).describe('Fires when a session metric crosses a threshold. Valid keys: "time_on_page" (seconds), "page_views" (count), "scroll_depth" (0-100). Example: {"type": "session_metric", "key": "time_on_page", "operator": "gte", "threshold": 30}');
81
+ var DismissedConditionZ = z.object({
82
+ type: z.literal("dismissed"),
83
+ key: z.string().describe("Dismissal key (usually a tile or action ID)"),
84
+ inverted: z.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")
85
+ }).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.");
86
+ var CooldownActiveConditionZ = z.object({
87
+ type: z.literal("cooldown_active"),
88
+ key: z.string().describe("Cooldown key"),
89
+ inverted: z.boolean().optional().describe("When true, fires if cooldown is NOT active")
90
+ }).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.");
91
+ var FrequencyLimitConditionZ = z.object({
92
+ type: z.literal("frequency_limit"),
93
+ key: z.string().describe("Frequency counter key"),
94
+ limit: z.number().describe("Maximum allowed count"),
95
+ inverted: z.boolean().optional().describe("When true, fires if limit NOT reached")
96
+ }).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.");
97
+ var MatchOpZ = z.object({
98
+ equals: z.union([z.string(), z.number(), z.boolean()]).optional(),
99
+ contains: z.string().optional()
100
+ }).describe("Match operator for counter filters. Exactly one of equals or contains must be specified.");
101
+ var CounterDefZ = z.object({
102
+ events: z.array(CountableEventZ).min(1).describe("Event names to count. Use values from the countable events enum."),
103
+ match: z.record(z.string(), MatchOpZ).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")
104
+ }).describe("Defines what events to count. Registered as an accumulator predicate at config-load time.");
105
+ var EventCountConditionZ = z.object({
106
+ type: z.literal("event_count"),
107
+ key: z.string().describe("Unique key for this counter (used for accumulator registration)"),
108
+ operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
109
+ count: z.number().int().min(0).describe("Target count threshold"),
110
+ withinMs: z.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),
111
+ counter: CounterDefZ.optional().describe("Inline counter definition. Defines what events to count.")
112
+ }).describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. Example: {"type": "event_count", "key": "pricing-clicks", "operator": "gte", "count": 3, "counter": {"events": ["ui.click"], "match": {"attr__data-cta": {"contains": "pricing"}}}}');
113
+ var ConditionZ = z.discriminatedUnion("type", [
114
+ PageUrlConditionZ,
115
+ RouteConditionZ,
116
+ AnchorVisibleConditionZ,
117
+ EventOccurredConditionZ,
118
+ StateEqualsConditionZ,
119
+ ViewportConditionZ,
120
+ SessionMetricConditionZ,
121
+ DismissedConditionZ,
122
+ CooldownActiveConditionZ,
123
+ FrequencyLimitConditionZ,
124
+ EventCountConditionZ
125
+ ]);
126
+ var RuleZ = z.object({
127
+ conditions: z.array(ConditionZ).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),
128
+ value: z.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")
129
+ }).describe("A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated top-to-bottom \u2014 first rule where all conditions match wins and returns its value.");
130
+ var RuleStrategyZ = z.object({
131
+ type: z.literal("rules"),
132
+ rules: z.array(RuleZ).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),
133
+ default: z.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")
134
+ }).describe("Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match returns its value. If no rule matches, returns default. For triggerWhen: set value=true on matching rules, default=false.");
135
+ var ScoreStrategyZ = z.object({
136
+ type: z.literal("score"),
137
+ field: z.string(),
138
+ threshold: z.number(),
139
+ above: z.unknown(),
140
+ below: z.unknown()
141
+ }).describe("Score-based strategy. Compares a field value against a threshold.");
142
+ var ModelStrategyZ = z.object({
143
+ type: z.literal("model"),
144
+ modelId: z.string(),
145
+ inputs: z.array(z.string()),
146
+ outputMapping: z.record(z.string(), z.unknown()),
147
+ default: z.unknown()
148
+ }).describe("ML model strategy. Sends inputs to a model and maps outputs.");
149
+ var ExternalStrategyZ = z.object({
150
+ type: z.literal("external"),
151
+ endpoint: z.string(),
152
+ method: z.enum(["GET", "POST"]).optional(),
153
+ default: z.unknown(),
154
+ timeoutMs: z.number().optional()
155
+ }).describe("External API strategy. Calls an endpoint to determine the value.");
156
+ var DecisionStrategyZ = z.discriminatedUnion("type", [
157
+ RuleStrategyZ,
158
+ ScoreStrategyZ,
159
+ ModelStrategyZ,
160
+ ExternalStrategyZ
161
+ ]);
162
+ var TriggerWhenZ = DecisionStrategyZ.nullable().optional();
163
+ var EventScopeZ = z.object({
164
+ events: z.array(z.string()),
165
+ urlContains: z.string().optional(),
166
+ props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional()
63
167
  });
168
+ var NotifyZ = z.object({
169
+ title: z.string().optional(),
170
+ body: z.string().optional(),
171
+ icon: z.string().optional()
172
+ }).nullable().optional();
173
+
174
+ // src/schema.ts
175
+ import { z as z2 } from "zod";
176
+ var configSchema = z2.object({
177
+ /** Text replacements */
178
+ textReplacements: z2.array(
179
+ z2.object({
180
+ anchorId: AnchorIdZ.describe(
181
+ "Route and CSS selector identifying the element whose text content to replace."
182
+ ),
183
+ summary: z2.string().describe(
184
+ "Human-readable description of this change, used for logging and debugging."
185
+ ),
186
+ text: z2.string().describe("New text content to set on the element (replaces existing text).")
187
+ }).describe("A single text replacement: replaces the text content of a matched element.")
188
+ ).optional().describe(
189
+ "Replaces the visible text of DOM elements. Use for copy changes, headline personalization, or CTA label swaps."
190
+ ),
191
+ /** Attribute modifications */
192
+ attributeChanges: z2.array(
193
+ z2.object({
194
+ anchorId: AnchorIdZ.describe(
195
+ "Route and CSS selector identifying the element whose attribute to set."
196
+ ),
197
+ summary: z2.string().describe(
198
+ "Human-readable description of this change, used for logging and debugging."
199
+ ),
200
+ attr: z2.string().min(
201
+ 1,
202
+ 'Attribute name must not be empty \u2014 setAttribute("", ...) throws InvalidCharacterError in all browsers.'
203
+ ).describe(
204
+ 'HTML attribute name to set (e.g. "href", "src", "data-experiment"). Event handler attributes are blocked.'
205
+ ),
206
+ value: z2.string().describe("New attribute value to apply.")
207
+ }).describe("A single attribute change: sets one HTML attribute on a matched element.")
208
+ ).optional().describe(
209
+ "Sets HTML attributes on DOM elements. Use for href swaps, src changes, or adding data-* experiment markers. Event handlers (onclick, onerror, etc.) are blocked."
210
+ ),
211
+ /** Style modifications */
212
+ styleChanges: z2.array(
213
+ z2.object({
214
+ anchorId: AnchorIdZ.describe(
215
+ "Route and CSS selector identifying the element to restyle."
216
+ ),
217
+ summary: z2.string().describe(
218
+ "Human-readable description of this change, used for logging and debugging."
219
+ ),
220
+ styles: z2.record(
221
+ // CSS property names must be kebab-case — `element.style.setProperty()`
222
+ // silently drops camelCase keys at runtime. (BUG-1779388834)
223
+ z2.string().regex(
224
+ /^(?:-?[a-z][a-z0-9-]*|--[a-zA-Z0-9_-]+)$/,
225
+ "Invalid CSS property name. Use kebab-case (e.g. 'font-size', not 'fontSize')."
226
+ ),
227
+ z2.string()
228
+ ).describe(
229
+ 'Map of CSS property \u2192 value pairs applied as inline styles (e.g. {"background-color": "#1e40af", "padding": "2rem"}).'
230
+ )
231
+ }).describe("A single style change: sets inline CSS properties on a matched element.")
232
+ ).optional().describe(
233
+ "Sets inline CSS styles on DOM elements. Use for color, spacing, or visibility changes without modifying the stylesheet."
234
+ ),
235
+ /** HTML insertions */
236
+ htmlInsertions: z2.array(
237
+ z2.object({
238
+ anchorId: AnchorIdZ.describe(
239
+ "Route and CSS selector identifying the reference element for the insertion."
240
+ ),
241
+ summary: z2.string().describe(
242
+ "Human-readable description of this change, used for logging and debugging."
243
+ ),
244
+ html: z2.string().min(
245
+ 1,
246
+ 'HTML string must not be empty \u2014 an empty html with position "replace" silently swaps the anchor element for an empty div.'
247
+ ).describe(
248
+ "HTML string to insert. The SDK sanitizes it before injection \u2014 no script tags or event handlers (onclick, onerror, etc.). NEVER embed JavaScript \u2014 use deepLink for canvas navigation instead."
249
+ ),
250
+ position: z2.enum(["before", "after", "prepend", "append", "replace"]).describe(
251
+ '"before"/"after" inserts adjacent to the element; "prepend"/"append" inserts inside at the start/end; "replace" swaps the entire element.'
252
+ ),
253
+ deepLink: z2.object({
254
+ tileId: z2.string().describe("ID of the canvas tile to open when the inserted element is clicked."),
255
+ itemId: z2.string().optional().describe(
256
+ "Optional specific item within the tile (e.g. a FAQ question ID) to scroll to after opening."
257
+ )
258
+ }).optional().describe(
259
+ "Makes the entire inserted element clickable to open the canvas panel and navigate to a specific tile. The SDK wires up click handlers, sets cursor to pointer, and publishes a notification.deep_link event. This is the ONLY correct way to connect inserted HTML to canvas tiles \u2014 NEVER use onclick handlers or window.SynOS in HTML strings."
260
+ )
261
+ }).describe(
262
+ "A single HTML insertion: injects a sanitized HTML fragment relative to a matched element. Use deepLink to connect inserted buttons/links to canvas tiles."
263
+ )
264
+ ).optional().describe(
265
+ "Inserts sanitized HTML fragments relative to DOM elements. Use for adding badges, banners, or supplementary content. Do NOT embed JavaScript \u2014 use deepLink for canvas navigation."
266
+ ),
267
+ /** Class additions */
268
+ classAdditions: z2.array(
269
+ z2.object({
270
+ anchorId: AnchorIdZ.describe(
271
+ "Route and CSS selector identifying the element to add the class to."
272
+ ),
273
+ summary: z2.string().describe(
274
+ "Human-readable description of this change, used for logging and debugging."
275
+ ),
276
+ className: z2.string().min(
277
+ 1,
278
+ 'Class name must not be empty \u2014 classList.add("") throws DOMException in all browsers.'
279
+ ).describe(
280
+ `CSS class name to add to the element's class list (e.g. "highlighted", "is-active").`
281
+ )
282
+ }).describe("A single class addition: appends one CSS class to a matched element.")
283
+ ).optional().describe(
284
+ "Adds CSS classes to DOM elements. Use to toggle visibility, apply highlight styles, or trigger CSS animations already defined in the host stylesheet."
285
+ ),
286
+ /** Class removals */
287
+ classRemovals: z2.array(
288
+ z2.object({
289
+ anchorId: AnchorIdZ.describe(
290
+ "Route and CSS selector identifying the element to remove the class from."
291
+ ),
292
+ summary: z2.string().describe(
293
+ "Human-readable description of this change, used for logging and debugging."
294
+ ),
295
+ className: z2.string().min(
296
+ 1,
297
+ 'Class name must not be empty \u2014 classList.remove("") throws DOMException in all browsers.'
298
+ ).describe(
299
+ `CSS class name to remove from the element's class list (e.g. "hidden", "disabled").`
300
+ )
301
+ }).describe("A single class removal: removes one CSS class from a matched element.")
302
+ ).optional().describe(
303
+ "Removes CSS classes from DOM elements. Use to reveal hidden elements, remove disabled states, or undo class-based styling."
304
+ )
305
+ }).describe(
306
+ "Props for adaptive-content DOM mutation operations. Each field targets a list of elements by anchorId and applies a specific type of change (text, attribute, style, HTML, or class)."
307
+ );
308
+ var CAPABILITIES_DOCUMENTATION = {
309
+ packageId: "adaptive-content",
310
+ plannerSummary: "Insert and modify the existing DOM \u2014 text, HTML, styles, classes. Reach for this when the strategy calls for altering the existing DOM surface.",
311
+ description: "DOM content modification capabilities for text, attributes, styles, HTML, and classes.",
312
+ whenToUse: [
313
+ { goal: "Replace an element's text", action: "content:setText" },
314
+ { goal: "Change an HTML attribute (href, src, data-*)", action: "content:setAttr" },
315
+ { goal: "Modify inline styles (color, size, spacing)", action: "content:setStyle" },
316
+ { goal: "Inject new HTML before/after/inside an element", action: "content:insertHtml" },
317
+ { goal: "Add a CSS class (show/hide, animate)", action: "content:addClass" },
318
+ { goal: "Remove a CSS class", action: "content:removeClass" }
319
+ ],
320
+ conventions: [
321
+ {
322
+ name: "Deep-linking inserted content to canvas tiles",
323
+ description: "Use the deepLink property on content:insertHtml to make inserted elements open the canvas panel and navigate to a specific tile when clicked. NEVER use onclick handlers or window.SynOS in HTML strings \u2014 they are sanitized and stripped. deepLink is the only supported mechanism."
324
+ },
325
+ {
326
+ name: "Blocked attributes",
327
+ description: "Event handler attributes (onclick, onerror, onload, etc.) are blocked by content:setAttr. Use data-* attributes for experiment markers instead."
328
+ }
329
+ ],
330
+ events: []
331
+ };
332
+ export {
333
+ CAPABILITIES_DOCUMENTATION,
334
+ configSchema
335
+ };
336
+ /*! Bundled license information:
337
+
338
+ @lit/context/lib/context-request-event.js:
339
+ @lit/context/lib/create-context.js:
340
+ @lit/context/lib/controllers/context-consumer.js:
341
+ @lit/context/lib/value-notifier.js:
342
+ @lit/context/lib/controllers/context-provider.js:
343
+ @lit/context/lib/context-root.js:
344
+ (**
345
+ * @license
346
+ * Copyright 2021 Google LLC
347
+ * SPDX-License-Identifier: BSD-3-Clause
348
+ *)
349
+
350
+ @lit/context/lib/decorators/provide.js:
351
+ (**
352
+ * @license
353
+ * Copyright 2017 Google LLC
354
+ * SPDX-License-Identifier: BSD-3-Clause
355
+ *)
356
+
357
+ @lit/context/lib/decorators/consume.js:
358
+ (**
359
+ * @license
360
+ * Copyright 2022 Google LLC
361
+ * SPDX-License-Identifier: BSD-3-Clause
362
+ *)
363
+ */
364
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../node_modules/@lit/context/src/lib/create-context.ts", "../../../sdk-contracts/dist/canvas-context.js", "../../../sdk-contracts/dist/routes.js", "../../../sdk-contracts/dist/schemas.js", "../src/schema.ts"],
4
+ "sourcesContent": ["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Context type defines a type brand to associate a key value with the context value type\n */\nexport type Context<KeyType, ValueType> = KeyType & {__context__: ValueType};\n\n/**\n * @deprecated use Context instead\n */\nexport type ContextKey<KeyType, ValueType> = Context<KeyType, ValueType>;\n\n/**\n * A helper type which can extract a Context value type from a Context type\n */\nexport type ContextType<Key extends Context<unknown, unknown>> =\n Key extends Context<unknown, infer ValueType> ? ValueType : never;\n\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext<ValueType, K = unknown>(key: K) {\n return key as Context<K, ValueType>;\n}\n", "/**\n * Canvas runtime context \u2014 the shared @lit/context symbol both\n * runtime-sdk (the provider) and canvas-sdk / canvas authors (the\n * consumers) use to thread a narrow runtime handle through the canvas\n * element tree.\n *\n * Living here keeps the symbol identity stable across both packages.\n * If canvas-sdk created its own symbol with `createContext(...)`, it\n * would never match the one runtime-sdk publishes, and `<sc-mount>`\n * would silently see `undefined` instead of the widget registry.\n *\n * The shape declared here is a NARROW VIEW of `SmartCanvasRuntime`.\n * Canvas-side code reads only this subset. The runtime-sdk's\n * `SmartCanvasRuntime` type is a structural superset.\n */\nimport { createContext } from '@lit/context';\n/**\n * The @lit/context symbol. Both runtime-sdk's ContextProvider and\n * canvas-sdk's ContextConsumer must import THIS exact symbol \u2014 not a\n * symbol with the same string name \u2014 for context propagation to work.\n */\nexport const canvasRuntimeContext = createContext('syntrologie:canvas-runtime');\n", "/**\n * Canonical route normalization. See `routes.md` for rules and\n * `normalize-route.cases.json` for the parity corpus shared with the\n * Python implementation in syntrologie_common/sdk/routing.py.\n *\n * Two exports \u2014 `normalizeRoute` for literal paths, `normalizeRoutePattern`\n * for activation patterns containing `*`, `**`, `:param`. Today they share\n * an implementation because the rules happen to be wildcard-safe (no\n * lowercase, unreserved-only decode, slash collapse preserves `**`).\n * The seam is preserved as separate exports so the API can diverge\n * without consumer churn if rules change.\n */\n// RFC 3986 reserved characters (gen-delims + sub-delims). When a `%XX`\n// sequence decodes to one of these bytes, we keep the percent-encoded\n// form \u2014 decoding would re-segment the path or change its meaning.\nconst RESERVED_BYTES = new Set([\n 0x21, // !\n 0x23, // #\n 0x24, // $\n 0x26, // &\n 0x27, // '\n 0x28, // (\n 0x29, // )\n 0x2a, // *\n 0x2b, // +\n 0x2c, // ,\n 0x2f, // /\n 0x3a, // :\n 0x3b, // ;\n 0x3d, // =\n 0x3f, // ?\n 0x40, // @\n 0x5b, // [\n 0x5d, // ]\n]);\nconst utf8Decoder = new TextDecoder('utf-8', { fatal: false });\n/** Decode `%XX` sequences for unreserved bytes only. Collapses\n * adjacent `%XX` runs into a UTF-8 decode so `%C3%A9` \u2192 `\u00E9`. */\nfunction decodeUnreservedOnly(input) {\n let out = '';\n let pending = [];\n const flushPending = () => {\n if (pending.length === 0)\n return;\n const bytes = new Uint8Array(pending);\n out += utf8Decoder.decode(bytes);\n pending = [];\n };\n let i = 0;\n while (i < input.length) {\n const ch = input[i];\n if (ch === '%' && i + 2 < input.length && isHex(input[i + 1]) && isHex(input[i + 2])) {\n const byte = parseInt(input.slice(i + 1, i + 3), 16);\n if (RESERVED_BYTES.has(byte)) {\n flushPending();\n // Keep raw, but normalize hex case to uppercase so the\n // canonical form is stable across input casing.\n out += `%${input.slice(i + 1, i + 3).toUpperCase()}`;\n i += 3;\n }\n else {\n pending.push(byte);\n i += 3;\n }\n }\n else {\n flushPending();\n out += ch;\n i += 1;\n }\n }\n flushPending();\n return out;\n}\nfunction isHex(c) {\n return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');\n}\n/** Strip query string and hash fragment. */\nfunction stripQueryAndHash(s) {\n const q = s.indexOf('?');\n if (q !== -1)\n s = s.slice(0, q);\n const h = s.indexOf('#');\n if (h !== -1)\n s = s.slice(0, h);\n return s;\n}\n/**\n * Normalize a literal path (e.g. `window.location.pathname`, an\n * action's `route` field, a wiki route key).\n *\n * Throws `TypeError` if the input is not an absolute path. Callers\n * that want a soft API should use {@link normalizeRouteWithChange}.\n */\nexport function normalizeRoute(path) {\n if (typeof path !== 'string' || path.length === 0) {\n throw new TypeError('normalizeRoute: input must be a non-empty string');\n }\n if (!path.startsWith('/')) {\n throw new TypeError(`normalizeRoute: input must be absolute (start with '/'); got ${JSON.stringify(path)}`);\n }\n let s = stripQueryAndHash(path);\n s = decodeUnreservedOnly(s);\n s = s.replace(/\\/+/g, '/');\n if (s.length > 1 && s.endsWith('/'))\n s = s.slice(0, -1);\n return s;\n}\n/**\n * Normalize an activation route pattern. Preserves `*`, `**`,\n * `:param` exactly. Today equivalent to {@link normalizeRoute} \u2014 kept\n * as a separate export so rules can diverge later without API churn.\n */\nexport function normalizeRoutePattern(pattern) {\n return normalizeRoute(pattern);\n}\n/**\n * Normalize a route and report whether the input was already\n * canonical. Used by authoring tools to decide whether to emit a\n * warning to the LLM.\n */\nexport function normalizeRouteWithChange(path) {\n const canonical = normalizeRoute(path);\n return { canonical, changed: canonical !== path };\n}\n/** Pattern-side counterpart of {@link normalizeRouteWithChange}. */\nexport function normalizeRoutePatternWithChange(pattern) {\n const canonical = normalizeRoutePattern(pattern);\n return { canonical, changed: canonical !== pattern };\n}\n/**\n * Case-insensitive comparison of two already-canonical paths. Use\n * this anywhere two routes are compared for equality (wiki lookups,\n * non-pattern action route gates) \u2014 preserves casing in the inputs\n * while honoring case-insensitive routing on the customer's site.\n */\nexport function routesMatch(a, b) {\n return a.toLowerCase() === b.toLowerCase();\n}\n", "/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 id / title / description / validation\n//\n// Shared fields every action carries. `id` is the action identifier the\n// runtime uses to dispatch, dedupe, and drop/replace actions \u2014 it is NOT\n// stripped before serving. `title` / `description` / `validation` are\n// authoring-only metadata stripped server-side in `to_runtime_config`\n// (platform/backend/app/domains/experiments/helpers.py).\n//\n// They all appear in the JSON Schema (and therefore in the tactician's\n// prompt) because the LLM needs to know they are valid action properties \u2014\n// otherwise schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n id: z.string().optional().describe('Stable action identifier (e.g. \"act_3db6a14d2ab0\").'),\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions.\n *\n * Every value here must be an event the runtime actually emits \u2014 either a\n * PostHog-autocapture normalization (ui.click/scroll/input/change/submit) or\n * an event-processor detector (ui.hover/idle/scroll_thrash/focus_bounce/\n * hesitate/rage_click). Do not add aspirational names; a trigger counting an\n * event nothing emits never fires.\n */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n 'ui.hesitate',\n 'ui.rage_click',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Adaptive Content - Config Schema\n *\n * Zod schema for validating content app configuration.\n */\n\nimport { AnchorIdZ } from '@syntrologie/sdk-contracts';\nimport { z } from 'zod';\n\n/**\n * Content app config schema.\n * Defines the structure for content modifications in a canvas config.\n */\nexport const configSchema = z\n .object({\n /** Text replacements */\n textReplacements: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the element whose text content to replace.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n text: z\n .string()\n .describe('New text content to set on the element (replaces existing text).'),\n })\n .describe('A single text replacement: replaces the text content of a matched element.')\n )\n .optional()\n .describe(\n 'Replaces the visible text of DOM elements. Use for copy changes, headline personalization, or CTA label swaps.'\n ),\n\n /** Attribute modifications */\n attributeChanges: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the element whose attribute to set.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n attr: z\n .string()\n .min(\n 1,\n 'Attribute name must not be empty \u2014 setAttribute(\"\", ...) throws InvalidCharacterError in all browsers.'\n )\n .describe(\n 'HTML attribute name to set (e.g. \"href\", \"src\", \"data-experiment\"). Event handler attributes are blocked.'\n ),\n value: z.string().describe('New attribute value to apply.'),\n })\n .describe('A single attribute change: sets one HTML attribute on a matched element.')\n )\n .optional()\n .describe(\n 'Sets HTML attributes on DOM elements. Use for href swaps, src changes, or adding data-* experiment markers. Event handlers (onclick, onerror, etc.) are blocked.'\n ),\n\n /** Style modifications */\n styleChanges: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the element to restyle.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n styles: z\n .record(\n // CSS property names must be kebab-case \u2014 `element.style.setProperty()`\n // silently drops camelCase keys at runtime. (BUG-1779388834)\n z\n .string()\n .regex(\n /^(?:-?[a-z][a-z0-9-]*|--[a-zA-Z0-9_-]+)$/,\n \"Invalid CSS property name. Use kebab-case (e.g. 'font-size', not 'fontSize').\"\n ),\n z.string()\n )\n .describe(\n 'Map of CSS property \u2192 value pairs applied as inline styles (e.g. {\"background-color\": \"#1e40af\", \"padding\": \"2rem\"}).'\n ),\n })\n .describe('A single style change: sets inline CSS properties on a matched element.')\n )\n .optional()\n .describe(\n 'Sets inline CSS styles on DOM elements. Use for color, spacing, or visibility changes without modifying the stylesheet.'\n ),\n\n /** HTML insertions */\n htmlInsertions: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the reference element for the insertion.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n html: z\n .string()\n .min(\n 1,\n 'HTML string must not be empty \u2014 an empty html with position \"replace\" silently swaps the anchor element for an empty div.'\n )\n .describe(\n 'HTML string to insert. The SDK sanitizes it before injection \u2014 no script tags or event handlers (onclick, onerror, etc.). NEVER embed JavaScript \u2014 use deepLink for canvas navigation instead.'\n ),\n position: z\n .enum(['before', 'after', 'prepend', 'append', 'replace'])\n .describe(\n '\"before\"/\"after\" inserts adjacent to the element; \"prepend\"/\"append\" inserts inside at the start/end; \"replace\" swaps the entire element.'\n ),\n deepLink: z\n .object({\n tileId: z\n .string()\n .describe('ID of the canvas tile to open when the inserted element is clicked.'),\n itemId: z\n .string()\n .optional()\n .describe(\n 'Optional specific item within the tile (e.g. a FAQ question ID) to scroll to after opening.'\n ),\n })\n .optional()\n .describe(\n 'Makes the entire inserted element clickable to open the canvas panel and navigate to a specific tile. The SDK wires up click handlers, sets cursor to pointer, and publishes a notification.deep_link event. This is the ONLY correct way to connect inserted HTML to canvas tiles \u2014 NEVER use onclick handlers or window.SynOS in HTML strings.'\n ),\n })\n .describe(\n 'A single HTML insertion: injects a sanitized HTML fragment relative to a matched element. Use deepLink to connect inserted buttons/links to canvas tiles.'\n )\n )\n .optional()\n .describe(\n 'Inserts sanitized HTML fragments relative to DOM elements. Use for adding badges, banners, or supplementary content. Do NOT embed JavaScript \u2014 use deepLink for canvas navigation.'\n ),\n\n /** Class additions */\n classAdditions: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the element to add the class to.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n className: z\n .string()\n .min(\n 1,\n 'Class name must not be empty \u2014 classList.add(\"\") throws DOMException in all browsers.'\n )\n .describe(\n 'CSS class name to add to the element\\'s class list (e.g. \"highlighted\", \"is-active\").'\n ),\n })\n .describe('A single class addition: appends one CSS class to a matched element.')\n )\n .optional()\n .describe(\n 'Adds CSS classes to DOM elements. Use to toggle visibility, apply highlight styles, or trigger CSS animations already defined in the host stylesheet.'\n ),\n\n /** Class removals */\n classRemovals: z\n .array(\n z\n .object({\n anchorId: AnchorIdZ.describe(\n 'Route and CSS selector identifying the element to remove the class from.'\n ),\n summary: z\n .string()\n .describe(\n 'Human-readable description of this change, used for logging and debugging.'\n ),\n className: z\n .string()\n .min(\n 1,\n 'Class name must not be empty \u2014 classList.remove(\"\") throws DOMException in all browsers.'\n )\n .describe(\n 'CSS class name to remove from the element\\'s class list (e.g. \"hidden\", \"disabled\").'\n ),\n })\n .describe('A single class removal: removes one CSS class from a matched element.')\n )\n .optional()\n .describe(\n 'Removes CSS classes from DOM elements. Use to reveal hidden elements, remove disabled states, or undo class-based styling.'\n ),\n })\n .describe(\n 'Props for adaptive-content DOM mutation operations. Each field targets a list of elements by anchorId and applies a specific type of change (text, attribute, style, HTML, or class).'\n );\n\nexport type ContentConfig = z.infer<typeof configSchema>;\n\n// ============================================================================\n// Capabilities Documentation (injected into JSON Schema for LLM prompts)\n// ============================================================================\n\nexport const CAPABILITIES_DOCUMENTATION = {\n packageId: 'adaptive-content',\n plannerSummary:\n 'Insert and modify the existing DOM \u2014 text, HTML, styles, classes. Reach for this when the strategy calls for altering the existing DOM surface.',\n description:\n 'DOM content modification capabilities for text, attributes, styles, HTML, and classes.',\n whenToUse: [\n { goal: \"Replace an element's text\", action: 'content:setText' },\n { goal: 'Change an HTML attribute (href, src, data-*)', action: 'content:setAttr' },\n { goal: 'Modify inline styles (color, size, spacing)', action: 'content:setStyle' },\n { goal: 'Inject new HTML before/after/inside an element', action: 'content:insertHtml' },\n { goal: 'Add a CSS class (show/hide, animate)', action: 'content:addClass' },\n { goal: 'Remove a CSS class', action: 'content:removeClass' },\n ],\n conventions: [\n {\n name: 'Deep-linking inserted content to canvas tiles',\n description:\n 'Use the deepLink property on content:insertHtml to make inserted elements open the canvas panel and navigate to a specific tile when clicked. NEVER use onclick handlers or window.SynOS in HTML strings \u2014 they are sanitized and stripped. deepLink is the only supported mechanism.',\n },\n {\n name: 'Blocked attributes',\n description:\n 'Event handler attributes (onclick, onerror, onload, etc.) are blocked by content:setAttr. Use data-* attributes for experiment markers instead.',\n },\n ],\n events: [],\n};\n"],
5
+ "mappings": ";AAq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X,gBACE;AAAA,EACF,aACE;AAAA,EACF,WAAW;AAAA,IACT,EAAE,MAAM,6BAA6B,QAAQ,kBAAkB;AAAA,IAC/D,EAAE,MAAM,gDAAgD,QAAQ,kBAAkB;AAAA,IAClF,EAAE,MAAM,+CAA+C,QAAQ,mBAAmB;AAAA,IAClF,EAAE,MAAM,kDAAkD,QAAQ,qBAAqB;AAAA,IACvF,EAAE,MAAM,wCAAwC,QAAQ,mBAAmB;AAAA,IAC3E,EAAE,MAAM,sBAAsB,QAAQ,sBAAsB;AAAA,EAC9D;AAAA,EACA,aAAa;AAAA,IACX;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,EACF;AAAA,EACA,QAAQ,CAAC;AACX;",
6
+ "names": ["createContext", "key", "z"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/adapt-content",
3
- "version": "2.8.0-canary.31",
3
+ "version": "2.8.0-canary.310",
4
4
  "description": "Adaptive Content app - DOM manipulation actions for text, attributes, and styles",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -22,49 +22,31 @@
22
22
  "./schema": {
23
23
  "types": "./dist/schema.d.ts",
24
24
  "import": "./dist/schema.js"
25
- },
26
- "./editor": {
27
- "types": "./dist/editor.d.ts",
28
- "import": "./dist/editor.js"
29
25
  }
30
26
  },
31
27
  "files": [
32
28
  "dist"
33
29
  ],
34
- "bundledDependencies": [
35
- "@syntrologie/shared-editor-ui"
36
- ],
37
30
  "scripts": {
38
31
  "prepack": "node ../../../scripts/prepare-bundled-deps.mjs",
39
- "build": "tsc",
32
+ "build": "tsc --emitDeclarationOnly && node ../scripts/build-lib.mjs",
40
33
  "typecheck": "tsc --noEmit",
41
34
  "clean": "rm -rf dist",
42
35
  "test": "vitest run",
43
36
  "test:watch": "vitest"
44
37
  },
45
38
  "peerDependencies": {
46
- "lucide-react": ">=0.400.0",
47
- "react": ">=18.0.0",
48
- "react-dom": ">=18.0.0",
49
39
  "zod": "^3.0.0"
50
40
  },
51
41
  "dependencies": {
52
- "@syntrologie/shared-editor-ui": "*",
53
- "css-selector-generator": "^3.8.0",
54
- "data-urls": "^5.0.0"
42
+ "css-selector-generator": "3.8.0",
43
+ "data-urls": "5.0.0"
55
44
  },
56
45
  "devDependencies": {
57
- "@floating-ui/dom": "^1.7.5",
58
46
  "@syntrologie/sdk-contracts": "*",
59
- "@testing-library/react": "^16.3.2",
60
- "@types/react": "^19.2.0",
61
- "@types/react-dom": "^19.2.0",
62
- "jsdom": "^26.1.0",
63
- "lucide-react": "^0.576.0",
64
- "react": "^19.2.0",
65
- "react-dom": "^19.2.0",
66
- "typescript": "^5.9.3",
67
- "vitest": "^4.0.18",
68
- "zod": "^3.25.76"
47
+ "jsdom": "26.1.0",
48
+ "typescript": "5.9.3",
49
+ "vitest": "4.0.18",
50
+ "zod": "3.25.76"
69
51
  }
70
52
  }