@syntrologie/adapt-feedback 2.55.1 → 2.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,3 +1,7 @@
1
+ import {
2
+ external_exports
3
+ } from "./chunk-EGBP2YTC.js";
4
+
1
5
  // ../../../node_modules/@lit/context/lib/create-context.js
2
6
  function n(n2) {
3
7
  return n2;
@@ -6,6 +10,234 @@ function n(n2) {
6
10
  // ../../sdk-contracts/dist/canvas-context.js
7
11
  var canvasRuntimeContext = n("syntrologie:canvas-runtime");
8
12
 
13
+ // ../../sdk-contracts/dist/telemetry-events.js
14
+ var entry = (e2) => e2;
15
+ var TELEMETRY_EVENTS = {
16
+ // --- intervention metrics (April 2026) — wire names unchanged, all plan-scope
17
+ syntro_config_served: entry({
18
+ subject: "config",
19
+ verb: "served",
20
+ scope: "plan",
21
+ props: ["tiles", "actions"]
22
+ }),
23
+ syntro_intervention_seen: entry({
24
+ subject: "intervention",
25
+ verb: "seen",
26
+ scope: "plan",
27
+ props: ["intervention_id", "intervention_kind"]
28
+ }),
29
+ syntro_intervention_triggered: entry({
30
+ subject: "intervention",
31
+ verb: "triggered",
32
+ scope: "plan",
33
+ props: ["intervention_id", "intervention_kind"]
34
+ }),
35
+ syntro_intervention_interacted: entry({
36
+ subject: "intervention",
37
+ verb: "interacted",
38
+ scope: "plan",
39
+ props: ["intervention_id", "intervention_kind", "interaction_type"]
40
+ }),
41
+ // --- concierge (FEAT-1789150184) ---------------------------------------
42
+ syntro_concierge_opened: entry({
43
+ subject: "concierge",
44
+ verb: "opened",
45
+ scope: "open",
46
+ props: ["trigger", "page_path"]
47
+ // trigger: ConciergeOpenTrigger
48
+ }),
49
+ syntro_concierge_closed: entry({
50
+ subject: "concierge",
51
+ verb: "closed",
52
+ scope: "open",
53
+ props: ["duration_ms", "reason", "messages_sent", "tiles_dismissed", "pages_viewed"]
54
+ // reason: ConciergeCloseReason
55
+ }),
56
+ /**
57
+ * The shopper asked to leave the canvas by a link. Emitted on intent, before
58
+ * the host answers, so refused or denied opens are counted too (parity with
59
+ * syntro_concierge_closed reason navigation).
60
+ *
61
+ * On a merchant's own page a link tap closes the canvas, and
62
+ * `syntro_concierge_closed { reason: 'navigation' }` is the row that
63
+ * records it. Inside a chat app's card the frame is sandboxed: the canvas
64
+ * cannot navigate, does not close, and asks the host to open the link
65
+ * instead, so that close row never fires. This is its counterpart, and it
66
+ * carries the same `reason` so one query covers both surfaces.
67
+ */
68
+ syntro_link_opened: entry({
69
+ subject: "link",
70
+ verb: "opened",
71
+ scope: "open",
72
+ props: ["kind", "reason"]
73
+ // kind: LinkOpenKind, reason: ConciergeCloseReason
74
+ }),
75
+ /**
76
+ * A store's product page opened inside a chat-app card instead of leaving
77
+ * through the host (the card's product view). `product` is the store's
78
+ * handle, never the display name; a rail switch is a new open. Its
79
+ * counterpart when the shopper goes back to the conversation's picks is
80
+ * syntro_product_view_closed.
81
+ *
82
+ * Plan scope, like the card's own syntro_card_lifecycle_seen: an inline
83
+ * card holds an open scope only while the host has it fullscreen, and a
84
+ * view opened from a tile fires before the host answers that request (or
85
+ * after it refused), so an open-scope row here would be dropped. The core
86
+ * still stamps surface and open_id whenever an open is live.
87
+ */
88
+ syntro_product_view_opened: entry({
89
+ subject: "product_view",
90
+ verb: "opened",
91
+ scope: "plan",
92
+ props: ["product", "from"]
93
+ // from: ProductViewOpenSource
94
+ }),
95
+ syntro_product_view_closed: entry({
96
+ subject: "product_view",
97
+ verb: "closed",
98
+ scope: "plan",
99
+ props: ["product"]
100
+ }),
101
+ syntro_deck_paged: entry({
102
+ subject: "deck",
103
+ verb: "paged",
104
+ scope: "open",
105
+ props: ["from_index", "to_index", "method"]
106
+ // method: DeckPageMethod
107
+ }),
108
+ syntro_tile_dismissed: entry({
109
+ subject: "tile",
110
+ verb: "dismissed",
111
+ scope: "open",
112
+ props: ["tile_id", "tile_kind", "visible_ms"]
113
+ }),
114
+ // A tile's own data load finished: the network wait between the concierge
115
+ // mounting a tile and the shopper seeing its content (BUG-1784767817 was a
116
+ // 30 s reviews hang here). `outcome` is 'ok' | 'error'; `requested` is how
117
+ // many items the tile asked for, `received` how many came back.
118
+ syntro_tile_data_received: entry({
119
+ subject: "tile_data",
120
+ verb: "received",
121
+ scope: "open",
122
+ props: ["tile_id", "tile_kind", "total_ms", "outcome", "requested", "received"]
123
+ }),
124
+ // The three chat atoms are OPEN-scope: they carry `surface` / `open_id` and
125
+ // only make sense inside a concierge open. An INLINE chat bar (no concierge)
126
+ // still dispatches them on every turn, and the core drops each one and
127
+ // increments the `telemetry_dropped` health counter. That is EXPECTED on an
128
+ // inline-chat host page, not a bug — `telemetry_dropped` there mixes "real
129
+ // defect" with "inline chat has no open scope", so do not alert on it alone.
130
+ syntro_chat_message_sent: entry({
131
+ subject: "chat_message",
132
+ verb: "sent",
133
+ scope: "open",
134
+ props: ["turn", "chars", "via"]
135
+ // via: ChatSendVia
136
+ }),
137
+ syntro_chat_reply_received: entry({
138
+ subject: "chat_reply",
139
+ verb: "received",
140
+ scope: "open",
141
+ // mount_tools: the mount_* tool name of every mount this reply fired, in order (two product cards appear twice).
142
+ props: ["turn", "ttft_ms", "total_ms", "mounts", "cards", "mount_tools"]
143
+ }),
144
+ syntro_chat_interrupted: entry({
145
+ subject: "chat",
146
+ verb: "interrupted",
147
+ scope: "open",
148
+ props: ["turn", "after_ms"]
149
+ }),
150
+ syntro_chat_maximize_toggled: entry({
151
+ subject: "chat_maximize",
152
+ verb: "toggled",
153
+ scope: "open",
154
+ props: ["maximized"]
155
+ }),
156
+ syntro_chat_takeover_triggered: entry({
157
+ subject: "chat_takeover",
158
+ verb: "triggered",
159
+ scope: "open",
160
+ props: ["turn"]
161
+ }),
162
+ // --- search takeover (2026-09-17) ---------------------------------------
163
+ // All plan-scope: the search interceptor fires before any concierge open
164
+ // exists. No prop here ever carries query text (SEE the contract test's
165
+ // no-text-prop rule) — classification/signal_hits are the interceptor's
166
+ // own derived signals, never the string itself.
167
+ syntro_search_sent: entry({
168
+ subject: "search",
169
+ verb: "sent",
170
+ scope: "plan",
171
+ props: ["classification", "word_count", "signal_hits", "entry_point", "platform"]
172
+ // classification: SearchClassification, entry_point: SearchEntryPoint
173
+ }),
174
+ // `ms_to_skeleton` is intentionally the only timing prop: it is always
175
+ // knowable the instant the surface mounts. `ms_to_first_content` is NOT
176
+ // declared here (revision 1 defect) because a surface that never painted
177
+ // content still fires this event, and a required prop it cannot supply
178
+ // would make TelemetryCore.emit drop exactly the row worth measuring.
179
+ syntro_search_surface_seen: entry({
180
+ subject: "search_surface",
181
+ verb: "seen",
182
+ scope: "plan",
183
+ props: ["variant", "classification", "result_count", "ms_to_skeleton"]
184
+ // variant: SearchVariant, classification: SearchClassification
185
+ }),
186
+ syntro_search_result_tapped: entry({
187
+ subject: "search_result",
188
+ verb: "tapped",
189
+ scope: "plan",
190
+ props: ["variant", "region_id", "module", "position"]
191
+ // variant: SearchVariant
192
+ }),
193
+ syntro_search_followup_sent: entry({
194
+ subject: "search_followup",
195
+ verb: "sent",
196
+ scope: "plan",
197
+ props: ["delta_kind", "variant"]
198
+ // delta_kind: SearchDeltaKind, variant: SearchVariant
199
+ }),
200
+ // Declares `ms_since_boot` (not a "since surface mounted" timing prop) so a
201
+ // not-ready fallback the takeover never rendered is still measurable —
202
+ // revision 1 emitted nothing on this path.
203
+ syntro_search_native_served: entry({
204
+ subject: "search_native",
205
+ verb: "served",
206
+ scope: "plan",
207
+ props: ["reason", "platform", "ms_since_boot"]
208
+ // reason: SearchFallbackReason
209
+ }),
210
+ syntro_search_takeover_dismissed: entry({
211
+ subject: "search_takeover",
212
+ verb: "dismissed",
213
+ scope: "plan",
214
+ props: ["variant", "reason"]
215
+ // variant: SearchVariant, reason: SearchDismissReason
216
+ }),
217
+ // --- chat-app card lifecycle (2026-09-24) --------------------------------
218
+ // One row per stage a card reached, from `reportCardStage` in
219
+ // card-lifecycle.ts. Plan scope: most stages happen before a config is
220
+ // served and none happen inside a concierge open. `stage` is a
221
+ // CardLifecycleStage; `since_shell_ms` is the card shell's own clock, so a
222
+ // card's rows order themselves from the first byte of the page. The same
223
+ // stages reach the connector through the shell's beacon, which is the only
224
+ // record of a card whose SDK never booted.
225
+ syntro_card_lifecycle_seen: entry({
226
+ subject: "card_lifecycle",
227
+ verb: "seen",
228
+ scope: "plan",
229
+ props: ["stage", "since_shell_ms"]
230
+ // stage: CardLifecycleStage
231
+ })
232
+ };
233
+ var TELEMETRY_EVENT_NAMES = Object.keys(TELEMETRY_EVENTS);
234
+
235
+ // ../../sdk-contracts/dist/card-lifecycle.js
236
+ var MCP_APP_SURFACE_ATTRIBUTES = Object.freeze({
237
+ surface_type: "mcp-app",
238
+ surface: "personal_agent"
239
+ });
240
+
9
241
  // ../../sdk-contracts/dist/detector-events.js
10
242
  var DETECTOR_EVENT_NAMES = [
11
243
  "ui.hover",
@@ -134,27 +366,26 @@ function normalizeRoute(path) {
134
366
  }
135
367
 
136
368
  // ../../sdk-contracts/dist/schemas.js
137
- import { z } from "zod";
138
369
  var NO_CSS_BREAKOUT_PATTERN = /^[^{}]*$/;
139
- var AnchorIdZ = z.object({
140
- selector: z.string().regex(NO_CSS_BREAKOUT_PATTERN, {
370
+ var AnchorIdZ = external_exports.object({
371
+ selector: external_exports.string().regex(NO_CSS_BREAKOUT_PATTERN, {
141
372
  message: 'selector must not contain "{" or "}" \u2014 not valid CSS selector syntax, and content:hideBySelector injects this value directly into a <style> element where these characters would break out of the generated rule.'
142
373
  }).describe("CSS selector for the target element"),
143
- route: z.union([z.string(), z.array(z.string())]).superRefine((value, ctx) => {
374
+ route: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).superRefine((value, ctx) => {
144
375
  for (const route of Array.isArray(value) ? value : [value]) {
145
376
  let canonical;
146
377
  try {
147
378
  canonical = normalizeRoute(route);
148
379
  } catch (err) {
149
380
  ctx.addIssue({
150
- code: z.ZodIssueCode.custom,
381
+ code: external_exports.ZodIssueCode.custom,
151
382
  message: `route must be an absolute path starting with "/" (got ${JSON.stringify(route)}): ${err instanceof Error ? err.message : String(err)}`
152
383
  });
153
384
  continue;
154
385
  }
155
386
  if (canonical !== route) {
156
387
  ctx.addIssue({
157
- code: z.ZodIssueCode.custom,
388
+ code: external_exports.ZodIssueCode.custom,
158
389
  message: `route ${JSON.stringify(route)} is not canonical \u2014 use ${JSON.stringify(canonical)} (this must match what the backend's RouteCanonicalityCheck accepts)`
159
390
  });
160
391
  }
@@ -162,10 +393,10 @@ var AnchorIdZ = z.object({
162
393
  }).describe("URL path(s) where this element exists")
163
394
  }).strict().describe("DOM element target. selector = CSS selector, route = URL path(s) where the element exists.");
164
395
  var AuthoringFieldsZ = {
165
- id: z.string().optional().describe('Stable action identifier (e.g. "act_3db6a14d2ab0").'),
166
- title: z.string().max(200).optional().describe("Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK."),
167
- 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."),
168
- 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.")
396
+ id: external_exports.string().optional().describe('Stable action identifier (e.g. "act_3db6a14d2ab0").'),
397
+ title: external_exports.string().max(200).optional().describe("Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK."),
398
+ description: external_exports.string().max(1e3).optional().describe("Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK."),
399
+ validation: external_exports.array(external_exports.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.")
169
400
  };
170
401
  var COUNTABLE_EVENTS = [
171
402
  // User interactions (from PostHog autocapture normalization)
@@ -185,80 +416,80 @@ var COUNTABLE_EVENTS = [
185
416
  "nav.page_view",
186
417
  "nav.page_leave"
187
418
  ];
188
- 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.");
419
+ var CountableEventZ = external_exports.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.");
189
420
  var SESSION_METRIC_KEYS = ["time_on_page", "page_views", "scroll_depth"];
190
- 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.");
191
- var PageUrlConditionZ = z.object({
192
- type: z.literal("page_url"),
193
- url: z.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')
421
+ var SessionMetricKeyZ = external_exports.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.");
422
+ var PageUrlConditionZ = external_exports.object({
423
+ type: external_exports.literal("page_url"),
424
+ url: external_exports.string().describe('URL path to match (e.g. "/pricing", "/dashboard")')
194
425
  }).describe('Fires when the current page URL matches. Use for page-specific actions. Example: {"type": "page_url", "url": "/pricing"}');
195
- var RouteConditionZ = z.object({
196
- type: z.literal("route"),
197
- routeId: z.string().describe("Named route ID from the route filter")
426
+ var RouteConditionZ = external_exports.object({
427
+ type: external_exports.literal("route"),
428
+ routeId: external_exports.string().describe("Named route ID from the route filter")
198
429
  }).describe("Fires when the current route matches a named route ID.");
199
- var AnchorVisibleConditionZ = z.object({
200
- type: z.literal("anchor_visible"),
201
- anchorId: z.string().describe("CSS selector of the anchor element"),
202
- state: z.enum(["visible", "present", "absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')
430
+ var AnchorVisibleConditionZ = external_exports.object({
431
+ type: external_exports.literal("anchor_visible"),
432
+ anchorId: external_exports.string().describe("CSS selector of the anchor element"),
433
+ state: external_exports.enum(["visible", "present", "absent"]).describe('"visible" = in viewport, "present" = in DOM, "absent" = not in DOM')
203
434
  }).describe(`Fires based on a DOM element's visibility state. Example: {"type": "anchor_visible", "anchorId": "#cta-button", "state": "visible"}`);
204
- var EventOccurredConditionZ = z.object({
205
- type: z.literal("event_occurred"),
206
- eventName: z.string().describe('Event name (e.g. "ui.click", "$pageview")'),
207
- withinMs: z.number().optional().describe("Time window in ms. Omit = any time this session.")
435
+ var EventOccurredConditionZ = external_exports.object({
436
+ type: external_exports.literal("event_occurred"),
437
+ eventName: external_exports.string().describe('Event name (e.g. "ui.click", "$pageview")'),
438
+ withinMs: external_exports.number().optional().describe("Time window in ms. Omit = any time this session.")
208
439
  }).describe('Fires when a specific event has occurred during this session. Example: {"type": "event_occurred", "eventName": "ui.click", "withinMs": 5000}');
209
- var StateEqualsConditionZ = z.object({
210
- type: z.literal("state_equals"),
211
- 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()."),
212
- value: z.unknown().describe("Expected value to match against")
440
+ var StateEqualsConditionZ = external_exports.object({
441
+ type: external_exports.literal("state_equals"),
442
+ key: external_exports.string().describe("Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set()."),
443
+ value: external_exports.unknown().describe("Expected value to match against")
213
444
  }).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.");
214
- var ViewportConditionZ = z.object({
215
- type: z.literal("viewport"),
216
- minWidth: z.number().optional().describe("Minimum viewport width in pixels"),
217
- maxWidth: z.number().optional().describe("Maximum viewport width in pixels"),
218
- minHeight: z.number().optional().describe("Minimum viewport height in pixels"),
219
- maxHeight: z.number().optional().describe("Maximum viewport height in pixels")
445
+ var ViewportConditionZ = external_exports.object({
446
+ type: external_exports.literal("viewport"),
447
+ minWidth: external_exports.number().optional().describe("Minimum viewport width in pixels"),
448
+ maxWidth: external_exports.number().optional().describe("Maximum viewport width in pixels"),
449
+ minHeight: external_exports.number().optional().describe("Minimum viewport height in pixels"),
450
+ maxHeight: external_exports.number().optional().describe("Maximum viewport height in pixels")
220
451
  }).describe('Fires based on viewport (screen) size. Use for responsive behavior. Example: {"type": "viewport", "minWidth": 768} \u2014 fires on tablet and larger.');
221
- var SessionMetricConditionZ = z.object({
222
- type: z.literal("session_metric"),
452
+ var SessionMetricConditionZ = external_exports.object({
453
+ type: external_exports.literal("session_metric"),
223
454
  key: SessionMetricKeyZ,
224
- operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
225
- threshold: z.number().describe("Numeric threshold to compare against")
455
+ operator: external_exports.enum(["gte", "lte", "eq", "gt", "lt"]),
456
+ threshold: external_exports.number().describe("Numeric threshold to compare against")
226
457
  }).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}');
227
- var DismissedConditionZ = z.object({
228
- type: z.literal("dismissed"),
229
- key: z.string().describe("Dismissal key (usually a tile or action ID)"),
230
- inverted: z.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")
458
+ var DismissedConditionZ = external_exports.object({
459
+ type: external_exports.literal("dismissed"),
460
+ key: external_exports.string().describe("Dismissal key (usually a tile or action ID)"),
461
+ inverted: external_exports.boolean().optional().describe("When true, fires if NOT dismissed (default behavior)")
231
462
  }).describe("Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.");
232
- var CooldownActiveConditionZ = z.object({
233
- type: z.literal("cooldown_active"),
234
- key: z.string().describe("Cooldown key"),
235
- inverted: z.boolean().optional().describe("When true, fires if cooldown is NOT active")
463
+ var CooldownActiveConditionZ = external_exports.object({
464
+ type: external_exports.literal("cooldown_active"),
465
+ key: external_exports.string().describe("Cooldown key"),
466
+ inverted: external_exports.boolean().optional().describe("When true, fires if cooldown is NOT active")
236
467
  }).describe("Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.");
237
- var FrequencyLimitConditionZ = z.object({
238
- type: z.literal("frequency_limit"),
239
- key: z.string().describe("Frequency counter key"),
240
- limit: z.number().describe("Maximum allowed count"),
241
- inverted: z.boolean().optional().describe("When true, fires if limit NOT reached")
468
+ var FrequencyLimitConditionZ = external_exports.object({
469
+ type: external_exports.literal("frequency_limit"),
470
+ key: external_exports.string().describe("Frequency counter key"),
471
+ limit: external_exports.number().describe("Maximum allowed count"),
472
+ inverted: external_exports.boolean().optional().describe("When true, fires if limit NOT reached")
242
473
  }).describe("Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.");
243
- var MatchOpZ = z.object({
244
- equals: z.union([z.string(), z.number(), z.boolean()]).optional(),
245
- contains: z.string().optional()
474
+ var MatchOpZ = external_exports.object({
475
+ equals: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional(),
476
+ contains: external_exports.string().optional()
246
477
  }).refine((operator) => Number(operator.equals !== void 0) + Number(operator.contains !== void 0) === 1, {
247
478
  message: "Exactly one of equals or contains must be specified."
248
479
  }).describe("Match operator for counter filters. Exactly one of equals or contains must be specified.");
249
- var CounterDefZ = z.object({
250
- events: z.array(CountableEventZ).min(1).describe("Event names to count. Use values from the countable events enum."),
251
- 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.")
480
+ var CounterDefZ = external_exports.object({
481
+ events: external_exports.array(CountableEventZ).min(1).describe("Event names to count. Use values from the countable events enum."),
482
+ match: external_exports.record(external_exports.string(), MatchOpZ).optional().describe("Property filters. Keys are event prop names or element-chain fields (tag_name, $el_text, attr__*). All entries AND together.")
252
483
  }).describe("Defines what events to count. Registered as an accumulator predicate at config-load time.");
253
- var EventCountConditionZ = z.object({
254
- type: z.literal("event_count"),
255
- key: z.string().describe("Unique key for this counter (used for accumulator registration)"),
256
- operator: z.enum(["gte", "lte", "eq", "gt", "lt"]),
257
- count: z.number().int().min(0).describe("Target count threshold"),
258
- withinMs: z.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),
484
+ var EventCountConditionZ = external_exports.object({
485
+ type: external_exports.literal("event_count"),
486
+ key: external_exports.string().describe("Unique key for this counter (used for accumulator registration)"),
487
+ operator: external_exports.enum(["gte", "lte", "eq", "gt", "lt"]),
488
+ count: external_exports.number().int().min(0).describe("Target count threshold"),
489
+ withinMs: external_exports.number().positive().optional().describe("Time window in ms. Omit = count across entire session."),
259
490
  counter: CounterDefZ.optional().describe("Inline counter definition. Defines what events to count.")
260
491
  }).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"}}}}');
261
- var ConditionZ = z.discriminatedUnion("type", [
492
+ var ConditionZ = external_exports.discriminatedUnion("type", [
262
493
  PageUrlConditionZ,
263
494
  RouteConditionZ,
264
495
  AnchorVisibleConditionZ,
@@ -271,150 +502,54 @@ var ConditionZ = z.discriminatedUnion("type", [
271
502
  FrequencyLimitConditionZ,
272
503
  EventCountConditionZ
273
504
  ]);
274
- var RuleZ = z.object({
275
- conditions: z.array(ConditionZ).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),
276
- value: z.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")
505
+ var RuleZ = external_exports.object({
506
+ conditions: external_exports.array(ConditionZ).describe("Array of conditions \u2014 ALL must match (AND logic) for this rule to fire."),
507
+ value: external_exports.unknown().describe("Value returned when all conditions match. For triggerWhen: true = fire the action.")
277
508
  }).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.");
278
- var RuleStrategyZ = z.object({
279
- type: z.literal("rules"),
280
- rules: z.array(RuleZ).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),
281
- default: z.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")
509
+ var RuleStrategyZ = external_exports.object({
510
+ type: external_exports.literal("rules"),
511
+ rules: external_exports.array(RuleZ).describe("Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins."),
512
+ default: external_exports.unknown().describe("Fallback value when no rule matches. For triggerWhen: false = do not fire by default.")
282
513
  }).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.");
283
- var ScoreStrategyZ = z.object({
284
- type: z.literal("score"),
285
- field: z.string(),
286
- threshold: z.number(),
287
- above: z.unknown(),
288
- below: z.unknown()
514
+ var ScoreStrategyZ = external_exports.object({
515
+ type: external_exports.literal("score"),
516
+ field: external_exports.string(),
517
+ threshold: external_exports.number(),
518
+ above: external_exports.unknown(),
519
+ below: external_exports.unknown()
289
520
  }).describe("Score-based strategy. Compares a field value against a threshold.");
290
- var ModelStrategyZ = z.object({
291
- type: z.literal("model"),
292
- modelId: z.string(),
293
- inputs: z.array(z.string()),
294
- outputMapping: z.record(z.string(), z.unknown()),
295
- default: z.unknown()
521
+ var ModelStrategyZ = external_exports.object({
522
+ type: external_exports.literal("model"),
523
+ modelId: external_exports.string(),
524
+ inputs: external_exports.array(external_exports.string()),
525
+ outputMapping: external_exports.record(external_exports.string(), external_exports.unknown()),
526
+ default: external_exports.unknown()
296
527
  }).describe("ML model strategy. Sends inputs to a model and maps outputs.");
297
- var ExternalStrategyZ = z.object({
298
- type: z.literal("external"),
299
- endpoint: z.string(),
300
- method: z.enum(["GET", "POST"]).optional(),
301
- default: z.unknown(),
302
- timeoutMs: z.number().optional()
528
+ var ExternalStrategyZ = external_exports.object({
529
+ type: external_exports.literal("external"),
530
+ endpoint: external_exports.string(),
531
+ method: external_exports.enum(["GET", "POST"]).optional(),
532
+ default: external_exports.unknown(),
533
+ timeoutMs: external_exports.number().optional()
303
534
  }).describe("External API strategy. Calls an endpoint to determine the value.");
304
- var DecisionStrategyZ = z.discriminatedUnion("type", [
535
+ var DecisionStrategyZ = external_exports.discriminatedUnion("type", [
305
536
  RuleStrategyZ,
306
537
  ScoreStrategyZ,
307
538
  ModelStrategyZ,
308
539
  ExternalStrategyZ
309
540
  ]);
310
541
  var TriggerWhenZ = DecisionStrategyZ.nullable().optional();
311
- var EventScopeZ = z.object({
312
- events: z.array(z.string()),
313
- urlContains: z.string().optional(),
314
- props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional()
542
+ var EventScopeZ = external_exports.object({
543
+ events: external_exports.array(external_exports.string()),
544
+ urlContains: external_exports.string().optional(),
545
+ props: external_exports.record(external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])).optional()
315
546
  });
316
- var NotifyZ = z.object({
317
- title: z.string().optional().describe("Notification title"),
318
- body: z.string().optional().describe("Notification body text"),
319
- icon: z.string().optional().describe("Notification icon (emoji or URL)")
547
+ var NotifyZ = external_exports.object({
548
+ title: external_exports.string().optional().describe("Notification title"),
549
+ body: external_exports.string().optional().describe("Notification body text"),
550
+ icon: external_exports.string().optional().describe("Notification icon (emoji or URL)")
320
551
  }).describe("Optional toast notification shown when this action triggers.").nullable().optional();
321
552
 
322
- // ../../sdk-contracts/dist/telemetry-events.js
323
- var entry = (e2) => e2;
324
- var TELEMETRY_EVENTS = {
325
- // --- intervention metrics (April 2026) — wire names unchanged, all plan-scope
326
- syntro_config_served: entry({
327
- subject: "config",
328
- verb: "served",
329
- scope: "plan",
330
- props: ["tiles", "actions"]
331
- }),
332
- syntro_intervention_seen: entry({
333
- subject: "intervention",
334
- verb: "seen",
335
- scope: "plan",
336
- props: ["intervention_id", "intervention_kind"]
337
- }),
338
- syntro_intervention_triggered: entry({
339
- subject: "intervention",
340
- verb: "triggered",
341
- scope: "plan",
342
- props: ["intervention_id", "intervention_kind"]
343
- }),
344
- syntro_intervention_interacted: entry({
345
- subject: "intervention",
346
- verb: "interacted",
347
- scope: "plan",
348
- props: ["intervention_id", "intervention_kind", "interaction_type"]
349
- }),
350
- // --- concierge (FEAT-1789150184) ---------------------------------------
351
- syntro_concierge_opened: entry({
352
- subject: "concierge",
353
- verb: "opened",
354
- scope: "open",
355
- props: ["trigger", "page_path"]
356
- // trigger: ConciergeOpenTrigger
357
- }),
358
- syntro_concierge_closed: entry({
359
- subject: "concierge",
360
- verb: "closed",
361
- scope: "open",
362
- props: ["duration_ms", "reason", "messages_sent", "tiles_dismissed", "pages_viewed"]
363
- // reason: ConciergeCloseReason
364
- }),
365
- syntro_deck_paged: entry({
366
- subject: "deck",
367
- verb: "paged",
368
- scope: "open",
369
- props: ["from_index", "to_index", "method"]
370
- // method: DeckPageMethod
371
- }),
372
- syntro_tile_dismissed: entry({
373
- subject: "tile",
374
- verb: "dismissed",
375
- scope: "open",
376
- props: ["tile_id", "tile_kind", "visible_ms"]
377
- }),
378
- // The three chat atoms are OPEN-scope: they carry `surface` / `open_id` and
379
- // only make sense inside a concierge open. An INLINE chat bar (no concierge)
380
- // still dispatches them on every turn, and the core drops each one and
381
- // increments the `telemetry_dropped` health counter. That is EXPECTED on an
382
- // inline-chat host page, not a bug — `telemetry_dropped` there mixes "real
383
- // defect" with "inline chat has no open scope", so do not alert on it alone.
384
- syntro_chat_message_sent: entry({
385
- subject: "chat_message",
386
- verb: "sent",
387
- scope: "open",
388
- props: ["turn", "chars", "via"]
389
- // via: ChatSendVia
390
- }),
391
- syntro_chat_reply_received: entry({
392
- subject: "chat_reply",
393
- verb: "received",
394
- scope: "open",
395
- props: ["turn", "ttft_ms", "total_ms", "mounts", "cards"]
396
- }),
397
- syntro_chat_interrupted: entry({
398
- subject: "chat",
399
- verb: "interrupted",
400
- scope: "open",
401
- props: ["turn", "after_ms"]
402
- }),
403
- syntro_chat_maximize_toggled: entry({
404
- subject: "chat_maximize",
405
- verb: "toggled",
406
- scope: "open",
407
- props: ["maximized"]
408
- }),
409
- syntro_chat_takeover_triggered: entry({
410
- subject: "chat_takeover",
411
- verb: "triggered",
412
- scope: "open",
413
- props: ["turn"]
414
- })
415
- };
416
- var TELEMETRY_EVENT_NAMES = Object.keys(TELEMETRY_EVENTS);
417
-
418
553
  // src/FeedbackWidget.ts
419
554
  import { css as css7, html as html7, LitElement as LitElement7, nothing } from "lit";
420
555
 
@@ -1384,4 +1519,4 @@ export {
1384
1519
  * SPDX-License-Identifier: BSD-3-Clause
1385
1520
  *)
1386
1521
  */
1387
- //# sourceMappingURL=chunk-RRYPZI5R.js.map
1522
+ //# sourceMappingURL=chunk-Q75D5OQJ.js.map