@guidelytech/shared 0.16.0 → 0.17.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.
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  AuthoringPickSchema: () => AuthoringPickSchema,
43
43
  AutocaptureSettingsSchema: () => AutocaptureSettingsSchema,
44
44
  BUTTON_ACTIONS: () => BUTTON_ACTIONS,
45
+ BugReportSchema: () => BugReportSchema,
45
46
  ButtonSchema: () => ButtonSchema,
46
47
  CAPTURE_PARAM: () => CAPTURE_PARAM,
47
48
  CAPTURE_SCREENSHOT_MAX_BYTES: () => CAPTURE_SCREENSHOT_MAX_BYTES,
@@ -107,6 +108,10 @@ __export(index_exports, {
107
108
  LocaleSchema: () => LocaleSchema,
108
109
  LocalizationSettingsSchema: () => LocalizationSettingsSchema,
109
110
  MAX_ANNOTATIONS: () => MAX_ANNOTATIONS,
111
+ MAX_APP_VERSION_LENGTH: () => MAX_APP_VERSION_LENGTH,
112
+ MAX_BREADCRUMBS: () => MAX_BREADCRUMBS,
113
+ MAX_BUG_REPORT_LENGTH: () => MAX_BUG_REPORT_LENGTH,
114
+ MAX_BUG_REPORT_SCREENSHOT_BYTES: () => MAX_BUG_REPORT_SCREENSHOT_BYTES,
110
115
  MAX_COLLECTION_DEPTH: () => MAX_COLLECTION_DEPTH,
111
116
  MAX_COMPLAINT_ANSWER_LENGTH: () => MAX_COMPLAINT_ANSWER_LENGTH,
112
117
  MAX_COMPLAINT_ATTACHMENT_BYTES: () => MAX_COMPLAINT_ATTACHMENT_BYTES,
@@ -114,6 +119,13 @@ __export(index_exports, {
114
119
  MAX_COMPLAINT_FIELDS: () => MAX_COMPLAINT_FIELDS,
115
120
  MAX_COMPLAINT_LENGTH: () => MAX_COMPLAINT_LENGTH,
116
121
  MAX_CUSTOM_CSS: () => MAX_CUSTOM_CSS,
122
+ MAX_DEBUG_IMAGES: () => MAX_DEBUG_IMAGES,
123
+ MAX_DETAIL_FRAMES: () => MAX_DETAIL_FRAMES,
124
+ MAX_DETAIL_THREADS: () => MAX_DETAIL_THREADS,
125
+ MAX_ERROR_TAGS: () => MAX_ERROR_TAGS,
126
+ MAX_EXCEPTION_CHAIN: () => MAX_EXCEPTION_CHAIN,
127
+ MAX_EXCEPTION_DETAIL_BYTES: () => MAX_EXCEPTION_DETAIL_BYTES,
128
+ MAX_EXCEPTION_DETAIL_RAW_BYTES: () => MAX_EXCEPTION_DETAIL_RAW_BYTES,
117
129
  MAX_FEEDBACK_COMMENT: () => MAX_FEEDBACK_COMMENT,
118
130
  MAX_FEEDBACK_DESCRIPTION: () => MAX_FEEDBACK_DESCRIPTION,
119
131
  MAX_FEEDBACK_NOTE: () => MAX_FEEDBACK_NOTE,
@@ -141,6 +153,7 @@ __export(index_exports, {
141
153
  PDF_PAGES_CLASS: () => PDF_PAGES_CLASS,
142
154
  PLACEMENTS: () => PLACEMENTS,
143
155
  PLATFORMS: () => PLATFORMS,
156
+ PerformanceSettingsSchema: () => PerformanceSettingsSchema,
144
157
  PostMessageSchema: () => PostMessageSchema,
145
158
  ProjectThemeSchema: () => ProjectThemeSchema,
146
159
  PublishedGuideSchema: () => PublishedGuideSchema,
@@ -210,11 +223,13 @@ __export(index_exports, {
210
223
  contrastIssues: () => contrastIssues,
211
224
  contrastRatio: () => contrastRatio,
212
225
  cssSelectorError: () => cssSelectorError,
226
+ customFingerprint: () => customFingerprint,
213
227
  defaultGuideConfig: () => defaultGuideConfig,
214
228
  defaultStep: () => defaultStep,
215
229
  describeCaptureStep: () => describeCaptureStep,
216
230
  describeRule: () => describeRule,
217
231
  emptyRuleGroup: () => emptyRuleGroup,
232
+ errorFilterDrops: () => errorFilterDrops,
218
233
  evaluateRule: () => evaluateRule,
219
234
  evaluateRules: () => evaluateRules,
220
235
  evenWeights: () => evenWeights,
@@ -257,10 +272,12 @@ __export(index_exports, {
257
272
  mediaKind: () => mediaKind,
258
273
  mediaMaxBytes: () => mediaMaxBytes,
259
274
  needsReview: () => needsReview,
275
+ normalizeAppVersion: () => normalizeAppVersion,
260
276
  normalizeErrorMessage: () => normalizeErrorMessage,
261
277
  normalizeFrameFile: () => normalizeFrameFile,
262
278
  normalizeLocale: () => normalizeLocale,
263
279
  normalizeSnapshot: () => normalizeSnapshot,
280
+ normalizeTags: () => normalizeTags,
264
281
  orderedModules: () => orderedModules,
265
282
  pageLabel: () => pageLabel,
266
283
  pageName: () => pageName,
@@ -278,6 +295,7 @@ __export(index_exports, {
278
295
  propertyAttributeAllowed: () => propertyAttributeAllowed,
279
296
  queryConditionRegex: () => queryConditionRegex,
280
297
  randomId: () => randomId,
298
+ reactNativeBundleUrl: () => reactNativeBundleUrl,
281
299
  readableTextOn: () => readableTextOn,
282
300
  recordingLevel: () => recordingLevel,
283
301
  relativeLuminance: () => relativeLuminance,
@@ -308,6 +326,7 @@ __export(index_exports, {
308
326
  toTranslationCsv: () => toTranslationCsv,
309
327
  toXliff: () => toXliff,
310
328
  translationCoverage: () => translationCoverage,
329
+ trimExceptionDetail: () => trimExceptionDetail,
311
330
  unreadAnnouncements: () => unreadAnnouncements,
312
331
  validateGuideConfig: () => validateGuideConfig,
313
332
  variantProblems: () => variantProblems,
@@ -340,18 +359,18 @@ function slugify(input) {
340
359
  return input.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "untitled";
341
360
  }
342
361
  var ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
343
- function randomId(size = 16) {
362
+ function randomId(size2 = 16) {
344
363
  const g = typeof globalThis !== "undefined" ? globalThis : {};
345
364
  let bytes;
346
365
  if (g.crypto && typeof g.crypto.getRandomValues === "function") {
347
- bytes = new Uint8Array(size);
366
+ bytes = new Uint8Array(size2);
348
367
  g.crypto.getRandomValues(bytes);
349
368
  } else {
350
- bytes = new Uint8Array(size);
351
- for (let i = 0; i < size; i++) bytes[i] = Math.floor(Math.random() * 256);
369
+ bytes = new Uint8Array(size2);
370
+ for (let i = 0; i < size2; i++) bytes[i] = Math.floor(Math.random() * 256);
352
371
  }
353
372
  let out = "";
354
- for (let i = 0; i < size; i++) out += ALPHABET[bytes[i] % ALPHABET.length];
373
+ for (let i = 0; i < size2; i++) out += ALPHABET[bytes[i] % ALPHABET.length];
355
374
  return out;
356
375
  }
357
376
  function isPlainObject(v) {
@@ -1088,19 +1107,91 @@ var ProjectThemeSchema = import_zod2.z.object({
1088
1107
  // src/events.ts
1089
1108
  var import_zod3 = require("zod");
1090
1109
 
1110
+ // src/error-detail.ts
1111
+ var MAX_EXCEPTION_DETAIL_BYTES = 64 * 1024;
1112
+ var MAX_EXCEPTION_DETAIL_RAW_BYTES = 1024 * 1024;
1113
+ var MAX_BREADCRUMBS = 100;
1114
+ var MAX_EXCEPTION_CHAIN = 20;
1115
+ var MAX_DETAIL_FRAMES = 250;
1116
+ var MAX_DETAIL_THREADS = 100;
1117
+ var MAX_DEBUG_IMAGES = 500;
1118
+ var MAX_ERROR_TAGS = 50;
1119
+ var size = (v) => {
1120
+ try {
1121
+ return JSON.stringify(v)?.length ?? 0;
1122
+ } catch {
1123
+ return Infinity;
1124
+ }
1125
+ };
1126
+ function normalizeTags(tags) {
1127
+ const out = {};
1128
+ for (const [k, v] of Object.entries(tags ?? {})) {
1129
+ if (Object.keys(out).length >= MAX_ERROR_TAGS) break;
1130
+ if (!k || v === void 0 || v === null) continue;
1131
+ out[k.slice(0, 32)] = String(v).slice(0, 200);
1132
+ }
1133
+ return out;
1134
+ }
1135
+ function trimExceptionDetail(detail, max = MAX_EXCEPTION_DETAIL_BYTES) {
1136
+ const d = detail;
1137
+ if (d.breadcrumbs?.values && d.breadcrumbs.values.length > MAX_BREADCRUMBS) d.breadcrumbs.values = d.breadcrumbs.values.slice(-MAX_BREADCRUMBS);
1138
+ if (d.exception?.values && d.exception.values.length > MAX_EXCEPTION_CHAIN) d.exception.values = d.exception.values.slice(-MAX_EXCEPTION_CHAIN);
1139
+ if (d.threads?.values && d.threads.values.length > MAX_DETAIL_THREADS) d.threads.values = d.threads.values.slice(0, MAX_DETAIL_THREADS);
1140
+ if (d.debug_meta?.images && d.debug_meta.images.length > MAX_DEBUG_IMAGES) d.debug_meta.images = d.debug_meta.images.slice(0, MAX_DEBUG_IMAGES);
1141
+ const stacks = () => [...d.exception?.values ?? [], ...d.threads?.values ?? []].map((x) => x.stacktrace).filter((s) => !!s);
1142
+ for (const s of stacks()) if (s.frames && s.frames.length > MAX_DETAIL_FRAMES) s.frames = s.frames.slice(-MAX_DETAIL_FRAMES);
1143
+ if (size(d) <= max) return d;
1144
+ while (d.breadcrumbs?.values.length && size(d) > max) d.breadcrumbs.values = d.breadcrumbs.values.slice(Math.ceil(d.breadcrumbs.values.length / 2));
1145
+ if (size(d) <= max) return d;
1146
+ for (const s of stacks())
1147
+ for (const f of s.frames ?? []) {
1148
+ delete f.vars;
1149
+ delete f.pre_context;
1150
+ delete f.post_context;
1151
+ }
1152
+ if (size(d) <= max) return d;
1153
+ if (d.threads?.values) d.threads.values = d.threads.values.filter((t) => t.crashed || t.current);
1154
+ if (size(d) <= max) return d;
1155
+ if (d.extra) d.extra = { _trimmed: true };
1156
+ if (d.request) delete d.request.data;
1157
+ for (const s of stacks()) while (s.frames && s.frames.length > 20 && size(d) > max) s.frames.splice(Math.floor(s.frames.length / 2) - 5, 10);
1158
+ if (d.debug_meta?.images && size(d) > max) d.debug_meta.images = d.debug_meta.images.slice(0, 50);
1159
+ return d;
1160
+ }
1161
+ var matches = (patterns, value) => patterns.some((p) => typeof p === "string" ? p !== "" && value.includes(p) : safeTest(p, value));
1162
+ function safeTest(re, value) {
1163
+ re.lastIndex = 0;
1164
+ return re.test(value);
1165
+ }
1166
+ function errorFilterDrops(e, opts) {
1167
+ const message = e.message ?? "";
1168
+ if (opts.ignoreErrors?.length && (matches(opts.ignoreErrors, `${e.type || "Error"}: ${message}`) || matches(opts.ignoreErrors, message))) return true;
1169
+ if (!e.file) return false;
1170
+ if (opts.denyUrls?.length && matches(opts.denyUrls, e.file)) return true;
1171
+ if (opts.allowUrls?.length && !matches(opts.allowUrls, e.file)) return true;
1172
+ return false;
1173
+ }
1174
+
1091
1175
  // src/events-util.ts
1092
1176
  var SENSITIVE_PROPERTY_PATTERN = /(password|passwd|secret|token|credit|card|cvv|ssn|iban)/i;
1093
1177
  var MAX_PROPERTY_BYTES = 8 * 1024;
1178
+ var MAX_APP_VERSION_LENGTH = 64;
1179
+ function normalizeAppVersion(input) {
1180
+ if (typeof input !== "string" && typeof input !== "number") return null;
1181
+ const printable = Array.from(String(input)).filter((c) => c.charCodeAt(0) > 31 && c.charCodeAt(0) !== 127).join("");
1182
+ const v = printable.trim().slice(0, MAX_APP_VERSION_LENGTH).trim();
1183
+ return v || null;
1184
+ }
1094
1185
  function sanitizeProperties(props) {
1095
1186
  if (!props) return {};
1096
1187
  const out = {};
1097
- let size = 0;
1188
+ let size2 = 0;
1098
1189
  for (const [k, v] of Object.entries(props)) {
1099
1190
  if (SENSITIVE_PROPERTY_PATTERN.test(k)) continue;
1100
1191
  if (typeof v === "function" || typeof v === "symbol") continue;
1101
1192
  const str2 = typeof v === "string" ? v : JSON.stringify(v ?? null);
1102
- size += k.length + (str2?.length ?? 0);
1103
- if (size > MAX_PROPERTY_BYTES) break;
1193
+ size2 += k.length + (str2?.length ?? 0);
1194
+ if (size2 > MAX_PROPERTY_BYTES) break;
1104
1195
  out[k.slice(0, 100)] = typeof v === "string" ? v.slice(0, 1e3) : v;
1105
1196
  }
1106
1197
  return out;
@@ -1110,16 +1201,23 @@ function sanitizeProperties(props) {
1110
1201
  var MAX_STACK_FRAMES = 30;
1111
1202
  var V8 = /^\s*at (?:(.+?) \()?((?:[a-z][\w+.-]*:)?[^\s()]+?):(\d+):(\d+)\)?\s*$/i;
1112
1203
  var GECKO = /^\s*(.*?)@(.+?):(\d+):(\d+)\s*$/;
1204
+ var HERMES = /^\s*at (?:(.+?) \()?address at ([^\s()]+?):(\d+):(\d+)\)?\s*$/;
1205
+ function reactNativeBundleUrl(file) {
1206
+ const base = file.replace(/[?#].*$/, "").split("/").pop() || file;
1207
+ return `app:///${base}`;
1208
+ }
1113
1209
  function parseStack(stack, max = MAX_STACK_FRAMES) {
1114
1210
  if (!stack || typeof stack !== "string") return [];
1115
1211
  const frames = [];
1116
1212
  for (const raw of stack.split("\n")) {
1117
1213
  if (frames.length >= max) break;
1118
1214
  const line = raw.slice(0, 1e3);
1119
- const m = V8.exec(line) ?? GECKO.exec(line);
1215
+ const hermes = HERMES.exec(line);
1216
+ const m = hermes ?? V8.exec(line) ?? GECKO.exec(line);
1120
1217
  if (!m) continue;
1121
1218
  const fn = (m[1] || "").trim();
1122
- frames.push({ fn: fn ? fn.slice(0, 200) : void 0, file: m[2]?.slice(0, 500), line: Number(m[3]), col: Number(m[4]) });
1219
+ const file = hermes ? reactNativeBundleUrl(m[2]) : m[2];
1220
+ frames.push({ fn: fn ? fn.slice(0, 200) : void 0, file: file?.slice(0, 500), line: Number(m[3]), col: Number(m[4]) });
1123
1221
  }
1124
1222
  return frames;
1125
1223
  }
@@ -1139,13 +1237,23 @@ function normalizeFrameFile(file) {
1139
1237
  var SOURCEMAP_MAX_FILE_BYTES = 100 * 1024 * 1024;
1140
1238
  var SOURCEMAP_MAX_FILES_PER_UPLOAD = 200;
1141
1239
  function fingerprintError(input) {
1142
- const top = (input.frames ?? []).find((f) => f.file);
1143
- const frameKey = input.original ? `src:${input.original.source}:${input.original.name || "?"}` : top ? `${normalizeFrameFile(top.file)}:${top.fn || "?"}` : "";
1240
+ const withFile = (input.frames ?? []).filter((f) => f.file || f.module);
1241
+ const top = withFile.find((f) => f.inApp === true) ?? withFile.find((f) => f.inApp !== false) ?? withFile[0];
1242
+ const frameKey = input.original ? `src:${input.original.source}:${input.original.name || "?"}` : top ? `${top.file ? normalizeFrameFile(top.file) : `mod:${top.module}`}:${top.fn || "?"}` : "";
1144
1243
  const key = [input.type || "Error", normalizeErrorMessage(input.message || ""), frameKey].join("|");
1145
1244
  const a = fnv1a(key).toString(16).padStart(8, "0");
1146
1245
  const b = fnv1a(`guidely:${key}`).toString(16).padStart(8, "0");
1147
1246
  return a + b;
1148
1247
  }
1248
+ function customFingerprint(parts, computed) {
1249
+ if (!Array.isArray(parts) || parts.length === 0) return computed;
1250
+ const items = parts.filter((p) => typeof p === "string" || typeof p === "number").map((p) => String(p).slice(0, 200)).slice(0, 20);
1251
+ if (items.length === 0) return computed;
1252
+ const isDefault = (p) => /^\{\{\s*default\s*\}\}$/i.test(p);
1253
+ if (items.every(isDefault)) return computed;
1254
+ const key = items.map((p) => isDefault(p) ? computed : p).join("|");
1255
+ return fnv1a(key).toString(16).padStart(8, "0") + fnv1a(`guidely:fp:${key}`).toString(16).padStart(8, "0");
1256
+ }
1149
1257
 
1150
1258
  // src/events.ts
1151
1259
  var EVENT_NAMES = [
@@ -1191,6 +1299,14 @@ var EVENT_NAMES = [
1191
1299
  var AUTOCAPTURE_EVENTS = ["page_view", "page_leave", "click", "rage_click", "exception", "heatmap", "app_install", "app_update", "app_open", "app_background"];
1192
1300
  var APP_LIFECYCLE_EVENTS = ["app_install", "app_update", "app_open", "app_background"];
1193
1301
  var GUIDE_LIFECYCLE_EVENTS = ["guide_viewed", "guide_started", "step_viewed", "step_completed", "guide_completed", "guide_skipped", "guide_dismissed", "guide_abandoned"];
1302
+ var ExceptionDetailField = import_zod3.z.preprocess((v) => {
1303
+ if (!v || typeof v !== "object" || Array.isArray(v)) return void 0;
1304
+ try {
1305
+ return JSON.stringify(v).length > MAX_EXCEPTION_DETAIL_RAW_BYTES ? void 0 : v;
1306
+ } catch {
1307
+ return void 0;
1308
+ }
1309
+ }, import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional());
1194
1310
  var SdkEventSchema = import_zod3.z.object({
1195
1311
  eventId: import_zod3.z.string().min(8).max(64),
1196
1312
  name: import_zod3.z.enum(EVENT_NAMES),
@@ -1206,7 +1322,19 @@ var SdkEventSchema = import_zod3.z.object({
1206
1322
  stepId: import_zod3.z.string().max(64).optional(),
1207
1323
  stepIndex: import_zod3.z.number().int().min(0).optional(),
1208
1324
  url: import_zod3.z.string().max(2e3).optional(),
1209
- properties: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional()
1325
+ /**
1326
+ * Version of the customer's app when the event happened (`appVersion` SDK option, auto-detected on
1327
+ * mobile). Stored per event so reports can filter and break down by version; see `normalizeAppVersion`.
1328
+ */
1329
+ appVersion: import_zod3.z.string().max(200).optional().nullable(),
1330
+ properties: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional(),
1331
+ /**
1332
+ * `exception` events only: breadcrumbs, contexts, tags, extra, the exception chain, threads and
1333
+ * debug images in the Sentry event shape (`ExceptionDetail`, docs/error-monitoring/sdks.md), outside
1334
+ * the 8 KB property budget. The server trims it to 64 KB and stores it in ErrorEventDetail; one over
1335
+ * 1 MB (or that isn't an object) is dropped without failing the batch.
1336
+ */
1337
+ detail: ExceptionDetailField
1210
1338
  });
1211
1339
  var EventBatchSchema = import_zod3.z.object({
1212
1340
  events: import_zod3.z.array(SdkEventSchema).min(1).max(50),
@@ -1337,9 +1465,38 @@ var FileComplaintSchema = import_zod6.z.object({
1337
1465
  }).optional().nullable()
1338
1466
  });
1339
1467
 
1340
- // src/agents.ts
1468
+ // src/bug-reports.ts
1341
1469
  var import_zod7 = require("zod");
1342
1470
 
1471
+ // src/bug-reports-limits.ts
1472
+ var MAX_BUG_REPORT_LENGTH = 4e3;
1473
+ var MAX_BUG_REPORT_SCREENSHOT_BYTES = 4 * 1024 * 1024;
1474
+
1475
+ // src/bug-reports.ts
1476
+ var BugReportSchema = import_zod7.z.object({
1477
+ anonymousId: import_zod7.z.string().min(1).max(128),
1478
+ userId: import_zod7.z.string().max(256).optional().nullable(),
1479
+ sessionId: import_zod7.z.string().max(128).optional().nullable(),
1480
+ message: import_zod7.z.string().trim().min(1).max(MAX_BUG_REPORT_LENGTH),
1481
+ email: import_zod7.z.string().trim().toLowerCase().email().max(254).optional().nullable(),
1482
+ name: import_zod7.z.string().trim().max(200).optional().nullable(),
1483
+ /** The exception event the report is about (the SDK sends the page's last error unless told otherwise). */
1484
+ associatedEventId: import_zod7.z.string().trim().max(64).optional().nullable(),
1485
+ url: import_zod7.z.string().max(2e3).optional().nullable(),
1486
+ appVersion: import_zod7.z.string().max(200).optional().nullable(),
1487
+ /** widget (the built-in dialog) or api (captureFeedback). */
1488
+ source: import_zod7.z.enum(["widget", "api"]).default("api"),
1489
+ tags: import_zod7.z.record(import_zod7.z.string().max(64), import_zod7.z.string().max(200)).optional(),
1490
+ sdk: import_zod7.z.object({ name: import_zod7.z.string().max(60), version: import_zod7.z.string().max(30) }).optional(),
1491
+ screenshot: import_zod7.z.object({
1492
+ fileName: import_zod7.z.string().trim().min(1).max(200),
1493
+ data: import_zod7.z.string().max(Math.ceil(MAX_BUG_REPORT_SCREENSHOT_BYTES * 4 / 3) + 64)
1494
+ }).optional().nullable()
1495
+ });
1496
+
1497
+ // src/agents.ts
1498
+ var import_zod8 = require("zod");
1499
+
1343
1500
  // src/agents-limits.ts
1344
1501
  var AGENT_TURN_ROLES = ["user", "assistant", "tool", "system"];
1345
1502
  var AGENT_OUTCOMES = ["success", "failure", "escalated", "abandoned"];
@@ -1352,51 +1509,51 @@ var AGENT_METADATA_MAX_BYTES = 4096;
1352
1509
  var SCOUT_AGENT_ID = "scout";
1353
1510
 
1354
1511
  // src/agents.ts
1355
- var ENVIRONMENTS = ["development", "staging", "production"];
1356
- var AgentToolCallSchema = import_zod7.z.object({
1357
- name: import_zod7.z.string().trim().min(1).max(100),
1358
- status: import_zod7.z.enum(AGENT_TOOL_STATUSES).optional(),
1359
- latencyMs: import_zod7.z.number().int().min(0).max(36e5).optional()
1512
+ var EnvironmentKey = import_zod8.z.string().trim().regex(/^[a-z][a-z0-9-]{0,29}$/, "environment: use an environment key such as production");
1513
+ var AgentToolCallSchema = import_zod8.z.object({
1514
+ name: import_zod8.z.string().trim().min(1).max(100),
1515
+ status: import_zod8.z.enum(AGENT_TOOL_STATUSES).optional(),
1516
+ latencyMs: import_zod8.z.number().int().min(0).max(36e5).optional()
1360
1517
  }).strip();
1361
- var AgentMetadataSchema = import_zod7.z.record(import_zod7.z.string().max(100), import_zod7.z.unknown()).transform((m) => {
1518
+ var AgentMetadataSchema = import_zod8.z.record(import_zod8.z.string().max(100), import_zod8.z.unknown()).transform((m) => {
1362
1519
  const out = {};
1363
- let size = 0;
1520
+ let size2 = 0;
1364
1521
  for (const [k, v] of Object.entries(m)) {
1365
1522
  const key = k.trim();
1366
1523
  if (!key || key.startsWith("$") || SENSITIVE_PROPERTY_PATTERN.test(key)) continue;
1367
1524
  if (!(typeof v === "string" || typeof v === "boolean" || v === null || typeof v === "number" && Number.isFinite(v))) continue;
1368
1525
  const value = typeof v === "string" ? v.slice(0, 500) : v;
1369
- size += key.length + String(value).length;
1370
- if (size > AGENT_METADATA_MAX_BYTES || Object.keys(out).length >= AGENT_METADATA_MAX_KEYS) break;
1526
+ size2 += key.length + String(value).length;
1527
+ if (size2 > AGENT_METADATA_MAX_BYTES || Object.keys(out).length >= AGENT_METADATA_MAX_KEYS) break;
1371
1528
  out[key] = value;
1372
1529
  }
1373
1530
  return out;
1374
1531
  });
1375
- var id = (max) => import_zod7.z.string().trim().min(1).max(max);
1376
- var optionalId = (max) => import_zod7.z.string().trim().max(max).optional().nullable().transform((v) => v || null);
1377
- var AgentTurnInputSchema = import_zod7.z.object({
1378
- type: import_zod7.z.literal("agent.conversation").optional(),
1532
+ var id = (max) => import_zod8.z.string().trim().min(1).max(max);
1533
+ var optionalId = (max) => import_zod8.z.string().trim().max(max).optional().nullable().transform((v) => v || null);
1534
+ var AgentTurnInputSchema = import_zod8.z.object({
1535
+ type: import_zod8.z.literal("agent.conversation").optional(),
1379
1536
  conversationId: id(128),
1380
1537
  agentId: id(64).refine((v) => v.toLowerCase() !== SCOUT_AGENT_ID, { message: `"${SCOUT_AGENT_ID}" is reserved for Guidely's built-in Scout agent` }),
1381
- agentName: import_zod7.z.string().trim().max(100).optional(),
1382
- turnId: import_zod7.z.string().trim().min(1).max(128).optional(),
1383
- role: import_zod7.z.enum(AGENT_TURN_ROLES),
1384
- text: import_zod7.z.string().max(AGENT_TURN_MAX_TEXT).default(""),
1385
- toolCalls: import_zod7.z.array(AgentToolCallSchema).max(AGENT_TOOL_CALLS_PER_TURN).default([]),
1386
- latencyMs: import_zod7.z.number().int().min(0).max(36e5).optional(),
1387
- outcome: import_zod7.z.enum(AGENT_OUTCOMES).optional(),
1388
- taskSuccess: import_zod7.z.boolean().optional(),
1389
- occurredAt: import_zod7.z.string().datetime({ offset: true }).optional(),
1538
+ agentName: import_zod8.z.string().trim().max(100).optional(),
1539
+ turnId: import_zod8.z.string().trim().min(1).max(128).optional(),
1540
+ role: import_zod8.z.enum(AGENT_TURN_ROLES),
1541
+ text: import_zod8.z.string().max(AGENT_TURN_MAX_TEXT).default(""),
1542
+ toolCalls: import_zod8.z.array(AgentToolCallSchema).max(AGENT_TOOL_CALLS_PER_TURN).default([]),
1543
+ latencyMs: import_zod8.z.number().int().min(0).max(36e5).optional(),
1544
+ outcome: import_zod8.z.enum(AGENT_OUTCOMES).optional(),
1545
+ taskSuccess: import_zod8.z.boolean().optional(),
1546
+ occurredAt: import_zod8.z.string().datetime({ offset: true }).optional(),
1390
1547
  userId: optionalId(256),
1391
1548
  anonymousId: optionalId(128),
1392
1549
  accountId: optionalId(256),
1393
1550
  sessionId: optionalId(128),
1394
1551
  metadata: AgentMetadataSchema.default({})
1395
1552
  });
1396
- var turns = import_zod7.z.array(AgentTurnInputSchema).min(1).max(AGENT_TURNS_PER_BATCH);
1397
- var sdkInfo = import_zod7.z.object({ name: import_zod7.z.string().max(60), version: import_zod7.z.string().max(30) }).optional();
1398
- var SdkAgentEventsSchema = import_zod7.z.object({ turns, sdk: sdkInfo });
1399
- var AgentEventsRequestSchema = import_zod7.z.preprocess(
1553
+ var turns = import_zod8.z.array(AgentTurnInputSchema).min(1).max(AGENT_TURNS_PER_BATCH);
1554
+ var sdkInfo = import_zod8.z.object({ name: import_zod8.z.string().max(60), version: import_zod8.z.string().max(30) }).optional();
1555
+ var SdkAgentEventsSchema = import_zod8.z.object({ turns, sdk: sdkInfo });
1556
+ var AgentEventsRequestSchema = import_zod8.z.preprocess(
1400
1557
  (v) => {
1401
1558
  if (Array.isArray(v)) return { turns: v };
1402
1559
  if (v && typeof v === "object" && !("turns" in v)) {
@@ -1405,11 +1562,11 @@ var AgentEventsRequestSchema = import_zod7.z.preprocess(
1405
1562
  }
1406
1563
  return v;
1407
1564
  },
1408
- import_zod7.z.object({ turns, environment: import_zod7.z.enum(ENVIRONMENTS).default("production"), sdk: sdkInfo })
1565
+ import_zod8.z.object({ turns, environment: EnvironmentKey.default("production"), sdk: sdkInfo })
1409
1566
  );
1410
1567
 
1411
1568
  // src/feedback.ts
1412
- var import_zod8 = require("zod");
1569
+ var import_zod9 = require("zod");
1413
1570
 
1414
1571
  // src/feedback-limits.ts
1415
1572
  var FEEDBACK_STATUSES = ["new", "under_review", "planned", "in_progress", "released", "declined"];
@@ -1433,58 +1590,60 @@ var feedbackReference = (number) => `#${number}`;
1433
1590
 
1434
1591
  // src/feedback.ts
1435
1592
  var visitor = {
1436
- anonymousId: import_zod8.z.string().min(1).max(128),
1437
- userId: import_zod8.z.string().max(256).optional().nullable()
1593
+ anonymousId: import_zod9.z.string().min(1).max(128),
1594
+ userId: import_zod9.z.string().max(256).optional().nullable()
1438
1595
  };
1439
- var FeedbackListRequestSchema = import_zod8.z.object({
1596
+ var FeedbackListRequestSchema = import_zod9.z.object({
1440
1597
  ...visitor,
1441
- q: import_zod8.z.string().trim().max(200).optional(),
1442
- sort: import_zod8.z.enum(["top", "new", "trending"]).default("top"),
1443
- status: import_zod8.z.enum(FEEDBACK_STATUSES).optional(),
1598
+ q: import_zod9.z.string().trim().max(200).optional(),
1599
+ sort: import_zod9.z.enum(["top", "new", "trending"]).default("top"),
1600
+ status: import_zod9.z.enum(FEEDBACK_STATUSES).optional(),
1444
1601
  /** "open" = not released or declined. */
1445
- filter: import_zod8.z.enum(["open", "all", "mine", "following"]).default("open"),
1446
- productArea: import_zod8.z.string().trim().max(60).optional(),
1447
- page: import_zod8.z.number().int().min(1).max(100).default(1)
1602
+ filter: import_zod9.z.enum(["open", "all", "mine", "following"]).default("open"),
1603
+ productArea: import_zod9.z.string().trim().max(60).optional(),
1604
+ page: import_zod9.z.number().int().min(1).max(100).default(1)
1448
1605
  });
1449
- var FeedbackVisitorSchema = import_zod8.z.object(visitor);
1450
- var SubmitFeedbackSchema = import_zod8.z.object({
1606
+ var FeedbackVisitorSchema = import_zod9.z.object(visitor);
1607
+ var SubmitFeedbackSchema = import_zod9.z.object({
1451
1608
  ...visitor,
1452
- title: import_zod8.z.string().trim().min(3, "Give your idea a short title").max(MAX_FEEDBACK_TITLE),
1453
- description: import_zod8.z.string().trim().max(MAX_FEEDBACK_DESCRIPTION).default(""),
1454
- productArea: import_zod8.z.string().trim().max(60).optional().nullable(),
1455
- priority: import_zod8.z.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
1609
+ title: import_zod9.z.string().trim().min(3, "Give your idea a short title").max(MAX_FEEDBACK_TITLE),
1610
+ description: import_zod9.z.string().trim().max(MAX_FEEDBACK_DESCRIPTION).default(""),
1611
+ productArea: import_zod9.z.string().trim().max(60).optional().nullable(),
1612
+ priority: import_zod9.z.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
1456
1613
  /** Filed from this Scout conversation (Scout offered it). */
1457
- conversationId: import_zod8.z.string().min(1).max(64).optional().nullable(),
1458
- pageUrl: import_zod8.z.string().max(2e3).optional()
1614
+ conversationId: import_zod9.z.string().min(1).max(64).optional().nullable(),
1615
+ pageUrl: import_zod9.z.string().max(2e3).optional()
1459
1616
  });
1460
- var FeedbackVoteSchema = import_zod8.z.object({
1617
+ var FeedbackVoteSchema = import_zod9.z.object({
1461
1618
  ...visitor,
1462
- priority: import_zod8.z.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
1463
- note: import_zod8.z.string().trim().max(MAX_FEEDBACK_NOTE).optional(),
1464
- conversationId: import_zod8.z.string().min(1).max(64).optional().nullable()
1619
+ priority: import_zod9.z.enum(FEEDBACK_PRIORITIES).default("nice_to_have"),
1620
+ note: import_zod9.z.string().trim().max(MAX_FEEDBACK_NOTE).optional(),
1621
+ conversationId: import_zod9.z.string().min(1).max(64).optional().nullable()
1465
1622
  });
1466
- var FeedbackFollowSchema = import_zod8.z.object({ ...visitor, follow: import_zod8.z.boolean() });
1467
- var FeedbackCommentSchema = import_zod8.z.object({ ...visitor, body: import_zod8.z.string().trim().min(1).max(MAX_FEEDBACK_COMMENT) });
1468
- var FeedbackSimilarSchema = import_zod8.z.object({ ...visitor, title: import_zod8.z.string().trim().min(3).max(MAX_FEEDBACK_TITLE) });
1469
- var FeedbackUpdatesReadSchema = import_zod8.z.object({ ...visitor, ids: import_zod8.z.array(import_zod8.z.string().min(1).max(64)).max(100).optional() });
1623
+ var FeedbackFollowSchema = import_zod9.z.object({ ...visitor, follow: import_zod9.z.boolean() });
1624
+ var FeedbackCommentSchema = import_zod9.z.object({ ...visitor, body: import_zod9.z.string().trim().min(1).max(MAX_FEEDBACK_COMMENT) });
1625
+ var FeedbackSimilarSchema = import_zod9.z.object({ ...visitor, title: import_zod9.z.string().trim().min(3).max(MAX_FEEDBACK_TITLE) });
1626
+ var FeedbackUpdatesReadSchema = import_zod9.z.object({ ...visitor, ids: import_zod9.z.array(import_zod9.z.string().min(1).max(64)).max(100).optional() });
1470
1627
 
1471
1628
  // src/capture.ts
1472
- var import_zod9 = require("zod");
1473
- var AutocaptureSettingsSchema = import_zod9.z.object({ pageviews: import_zod9.z.boolean(), pageLeave: import_zod9.z.boolean(), clicks: import_zod9.z.boolean(), rageClicks: import_zod9.z.boolean(), heatmaps: import_zod9.z.boolean(), mouseMovement: import_zod9.z.boolean(), appLifecycle: import_zod9.z.boolean() }).partial();
1474
- var ErrorTrackingSettingsSchema = import_zod9.z.object({ enabled: import_zod9.z.boolean() }).partial();
1475
- var ReplaySettingsSchema = import_zod9.z.object({
1476
- enabled: import_zod9.z.boolean(),
1477
- sampleRate: import_zod9.z.number().int().min(0).max(100),
1478
- recordConsole: import_zod9.z.boolean(),
1479
- recordNetwork: import_zod9.z.boolean(),
1480
- recordNetworkPayloads: import_zod9.z.boolean(),
1481
- maskAllText: import_zod9.z.boolean(),
1482
- blockSelectors: import_zod9.z.array(import_zod9.z.string().min(1).max(200)).max(50),
1483
- retentionDays: import_zod9.z.number().int().min(1).max(365)
1629
+ var import_zod10 = require("zod");
1630
+ var AutocaptureSettingsSchema = import_zod10.z.object({ pageviews: import_zod10.z.boolean(), pageLeave: import_zod10.z.boolean(), clicks: import_zod10.z.boolean(), rageClicks: import_zod10.z.boolean(), heatmaps: import_zod10.z.boolean(), mouseMovement: import_zod10.z.boolean(), appLifecycle: import_zod10.z.boolean() }).partial();
1631
+ var ErrorTrackingSettingsSchema = import_zod10.z.object({ enabled: import_zod10.z.boolean() }).partial();
1632
+ var PerformanceSettingsSchema = import_zod10.z.object({ enabled: import_zod10.z.boolean(), sampleRate: import_zod10.z.number().min(0).max(100) }).partial();
1633
+ var ReplaySettingsSchema = import_zod10.z.object({
1634
+ enabled: import_zod10.z.boolean(),
1635
+ sampleRate: import_zod10.z.number().int().min(0).max(100),
1636
+ recordConsole: import_zod10.z.boolean(),
1637
+ recordNetwork: import_zod10.z.boolean(),
1638
+ recordNetworkPayloads: import_zod10.z.boolean(),
1639
+ maskAllText: import_zod10.z.boolean(),
1640
+ blockSelectors: import_zod10.z.array(import_zod10.z.string().min(1).max(200)).max(50),
1641
+ retentionDays: import_zod10.z.number().int().min(1).max(365)
1484
1642
  }).partial();
1485
1643
  var DEFAULT_CAPTURE_SETTINGS = {
1486
1644
  autocapture: { pageviews: true, pageLeave: true, clicks: true, rageClicks: true, heatmaps: true, mouseMovement: true, appLifecycle: true },
1487
1645
  errorTracking: { enabled: true },
1646
+ performance: { enabled: false, sampleRate: 100 },
1488
1647
  replay: { enabled: false, sampleRate: 100, recordConsole: true, recordNetwork: true, recordNetworkPayloads: false, maskAllText: false, blockSelectors: [], retentionDays: 30 }
1489
1648
  };
1490
1649
  var RECORDING_LEVELS = ["off", "privacy", "standard", "full"];
@@ -1511,25 +1670,29 @@ function resolveCaptureSettings(settings) {
1511
1670
  const a = AutocaptureSettingsSchema.safeParse(obj(s.autocapture));
1512
1671
  const e = ErrorTrackingSettingsSchema.safeParse(obj(s.errorTracking));
1513
1672
  const r = ReplaySettingsSchema.safeParse(obj(s.replay));
1673
+ const p = PerformanceSettingsSchema.safeParse(obj(s.performance));
1514
1674
  return {
1515
1675
  autocapture: { ...d.autocapture, ...a.success ? a.data : {} },
1516
1676
  errorTracking: { ...d.errorTracking, ...e.success ? e.data : {} },
1517
- replay: { ...d.replay, ...r.success ? r.data : {} }
1677
+ replay: { ...d.replay, ...r.success ? r.data : {} },
1678
+ performance: { ...d.performance, ...p.success ? p.data : {} }
1518
1679
  };
1519
1680
  }
1520
1681
  var HEATMAP_VIEWPORTS = { mobile: [0, 767], tablet: [768, 1279], desktop: [1280, 1e5] };
1521
- var ReplayChunkSchema = import_zod9.z.object({
1522
- sessionId: import_zod9.z.string().min(1).max(128),
1523
- windowId: import_zod9.z.string().min(1).max(64),
1524
- seq: import_zod9.z.number().int().min(0).max(1e6),
1525
- anonymousId: import_zod9.z.string().min(1).max(128),
1526
- userId: import_zod9.z.string().max(256).optional().nullable(),
1682
+ var ReplayChunkSchema = import_zod10.z.object({
1683
+ sessionId: import_zod10.z.string().min(1).max(128),
1684
+ windowId: import_zod10.z.string().min(1).max(64),
1685
+ seq: import_zod10.z.number().int().min(0).max(1e6),
1686
+ anonymousId: import_zod10.z.string().min(1).max(128),
1687
+ userId: import_zod10.z.string().max(256).optional().nullable(),
1527
1688
  /** rrweb `eventWithTime` objects, in order. */
1528
- events: import_zod9.z.array(import_zod9.z.object({ type: import_zod9.z.number().int(), timestamp: import_zod9.z.number() }).passthrough()).min(1).max(5e4),
1529
- url: import_zod9.z.string().max(2e3).optional(),
1530
- device: import_zod9.z.object({ type: import_zod9.z.string().max(20), browser: import_zod9.z.string().max(40).optional(), os: import_zod9.z.string().max(40).optional() }).optional(),
1531
- viewport: import_zod9.z.object({ width: import_zod9.z.number().int().min(0).max(1e5), height: import_zod9.z.number().int().min(0).max(1e5) }).optional(),
1532
- sdk: import_zod9.z.object({ name: import_zod9.z.string().max(60), version: import_zod9.z.string().max(30) }).optional()
1689
+ events: import_zod10.z.array(import_zod10.z.object({ type: import_zod10.z.number().int(), timestamp: import_zod10.z.number() }).passthrough()).min(1).max(5e4),
1690
+ url: import_zod10.z.string().max(2e3).optional(),
1691
+ device: import_zod10.z.object({ type: import_zod10.z.string().max(20), browser: import_zod10.z.string().max(40).optional(), os: import_zod10.z.string().max(40).optional() }).optional(),
1692
+ viewport: import_zod10.z.object({ width: import_zod10.z.number().int().min(0).max(1e5), height: import_zod10.z.number().int().min(0).max(1e5) }).optional(),
1693
+ sdk: import_zod10.z.object({ name: import_zod10.z.string().max(60), version: import_zod10.z.string().max(30) }).optional(),
1694
+ /** The app's version (`appVersion` SDK option); recordings can be filtered by it. */
1695
+ appVersion: import_zod10.z.string().max(200).optional()
1533
1696
  });
1534
1697
  var REPLAY_MAX_COMPRESSED_BYTES = 2 * 1024 * 1024;
1535
1698
  var REPLAY_MAX_RAW_BYTES = 16 * 1024 * 1024;
@@ -1993,7 +2156,7 @@ function articleIdFromHref(href) {
1993
2156
  }
1994
2157
 
1995
2158
  // src/howto.ts
1996
- var import_zod10 = require("zod");
2159
+ var import_zod11 = require("zod");
1997
2160
 
1998
2161
  // src/howto-limits.ts
1999
2162
  var CAPTURE_PARAM = "guidely_capture";
@@ -2002,36 +2165,36 @@ var CAPTURE_SCREENSHOT_MAX_BYTES = 8 * 1024 * 1024;
2002
2165
  // src/howto.ts
2003
2166
  var HOWTO_STEP_KINDS = ["action", "text", "heading", "tip", "alert"];
2004
2167
  var HOWTO_ACTIONS = ["click", "type", "select", "navigate"];
2005
- var NormalizedRectSchema = import_zod10.z.object({
2006
- x: import_zod10.z.number().min(0).max(1),
2007
- y: import_zod10.z.number().min(0).max(1),
2008
- width: import_zod10.z.number().min(0).max(1),
2009
- height: import_zod10.z.number().min(0).max(1)
2168
+ var NormalizedRectSchema = import_zod11.z.object({
2169
+ x: import_zod11.z.number().min(0).max(1),
2170
+ y: import_zod11.z.number().min(0).max(1),
2171
+ width: import_zod11.z.number().min(0).max(1),
2172
+ height: import_zod11.z.number().min(0).max(1)
2010
2173
  });
2011
- var CapturedElementSchema = import_zod10.z.object({
2174
+ var CapturedElementSchema = import_zod11.z.object({
2012
2175
  /** Visible name: aria-label, associated label, text, placeholder, alt or title. */
2013
- label: import_zod10.z.string().max(200).default(""),
2176
+ label: import_zod11.z.string().max(200).default(""),
2014
2177
  /** button, link, tab, menuitem, checkbox, radio, field, dropdown, option, element… */
2015
- role: import_zod10.z.string().max(40).default("element"),
2016
- tag: import_zod10.z.string().max(40).default("")
2178
+ role: import_zod11.z.string().max(40).default("element"),
2179
+ tag: import_zod11.z.string().max(40).default("")
2017
2180
  });
2018
- var CaptureStepSchema = import_zod10.z.object({
2181
+ var CaptureStepSchema = import_zod11.z.object({
2019
2182
  /** Random id from the SDK; a retried upload with the same id is stored once. */
2020
- clientId: import_zod10.z.string().min(1).max(64),
2021
- action: import_zod10.z.enum(HOWTO_ACTIONS),
2022
- url: import_zod10.z.string().max(2e3),
2023
- pageTitle: import_zod10.z.string().max(300).default(""),
2183
+ clientId: import_zod11.z.string().min(1).max(64),
2184
+ action: import_zod11.z.enum(HOWTO_ACTIONS),
2185
+ url: import_zod11.z.string().max(2e3),
2186
+ pageTitle: import_zod11.z.string().max(300).default(""),
2024
2187
  element: CapturedElementSchema.optional(),
2025
2188
  /** Typed text or chosen option; absent when it was sensitive (`valueRedacted`). */
2026
- value: import_zod10.z.string().max(200).optional(),
2027
- valueRedacted: import_zod10.z.boolean().default(false),
2189
+ value: import_zod11.z.string().max(200).optional(),
2190
+ valueRedacted: import_zod11.z.boolean().default(false),
2028
2191
  /** Selectors for the element, so the step can later become an interactive tour step. */
2029
- selectors: import_zod10.z.array(SelectorStrategySchema).max(10).default([]),
2192
+ selectors: import_zod11.z.array(SelectorStrategySchema).max(10).default([]),
2030
2193
  /** Where the element sits in the screenshot. */
2031
2194
  highlight: NormalizedRectSchema.optional(),
2032
2195
  /** Number of regions the SDK blurred in the screenshot before upload. */
2033
- redactions: import_zod10.z.number().int().min(0).max(1e3).default(0),
2034
- occurredAt: import_zod10.z.string().datetime().optional()
2196
+ redactions: import_zod11.z.number().int().min(0).max(1e3).default(0),
2197
+ occurredAt: import_zod11.z.string().datetime().optional()
2035
2198
  });
2036
2199
  function quoted(s) {
2037
2200
  const t = (s ?? "").replace(/\s+/g, " ").trim();
@@ -2102,12 +2265,12 @@ function hostAndPath(url) {
2102
2265
  return url.slice(0, 80);
2103
2266
  }
2104
2267
  }
2105
- var NormalizedPointSchema = import_zod10.z.object({ x: import_zod10.z.number().min(0).max(1), y: import_zod10.z.number().min(0).max(1) });
2268
+ var NormalizedPointSchema = import_zod11.z.object({ x: import_zod11.z.number().min(0).max(1), y: import_zod11.z.number().min(0).max(1) });
2106
2269
  var ANNOTATION_COLORS = ["brand", "red", "amber", "green", "black", "white"];
2107
- var HowToAnnotationSchema = import_zod10.z.discriminatedUnion("type", [
2108
- import_zod10.z.object({ id: import_zod10.z.string().min(1).max(32), type: import_zod10.z.literal("arrow"), from: NormalizedPointSchema, to: NormalizedPointSchema, color: import_zod10.z.enum(ANNOTATION_COLORS).default("brand") }),
2109
- import_zod10.z.object({ id: import_zod10.z.string().min(1).max(32), type: import_zod10.z.literal("text"), at: NormalizedPointSchema, text: import_zod10.z.string().trim().min(1).max(120), color: import_zod10.z.enum(ANNOTATION_COLORS).default("brand") }),
2110
- import_zod10.z.object({ id: import_zod10.z.string().min(1).max(32), type: import_zod10.z.literal("box"), rect: NormalizedRectSchema, color: import_zod10.z.enum(ANNOTATION_COLORS).default("brand") })
2270
+ var HowToAnnotationSchema = import_zod11.z.discriminatedUnion("type", [
2271
+ import_zod11.z.object({ id: import_zod11.z.string().min(1).max(32), type: import_zod11.z.literal("arrow"), from: NormalizedPointSchema, to: NormalizedPointSchema, color: import_zod11.z.enum(ANNOTATION_COLORS).default("brand") }),
2272
+ import_zod11.z.object({ id: import_zod11.z.string().min(1).max(32), type: import_zod11.z.literal("text"), at: NormalizedPointSchema, text: import_zod11.z.string().trim().min(1).max(120), color: import_zod11.z.enum(ANNOTATION_COLORS).default("brand") }),
2273
+ import_zod11.z.object({ id: import_zod11.z.string().min(1).max(32), type: import_zod11.z.literal("box"), rect: NormalizedRectSchema, color: import_zod11.z.enum(ANNOTATION_COLORS).default("brand") })
2111
2274
  ]);
2112
2275
  var MAX_ANNOTATIONS = 30;
2113
2276
 
@@ -2709,6 +2872,16 @@ var SCRIPT_STUB_METHODS = [
2709
2872
  "openComplaint",
2710
2873
  "openIdeas",
2711
2874
  "captureException",
2875
+ "captureFeedback",
2876
+ "showBugReport",
2877
+ "captureMessage",
2878
+ "addBreadcrumb",
2879
+ "setTag",
2880
+ "setTags",
2881
+ "setExtra",
2882
+ "setExtras",
2883
+ "setContext",
2884
+ "setUser",
2712
2885
  "agentConversation",
2713
2886
  "trackAgentTurn",
2714
2887
  "on"
@@ -3240,7 +3413,7 @@ function parseTranslationCsv(text) {
3240
3413
 
3241
3414
  // src/index.ts
3242
3415
  var SDK_API_VERSION = "v1";
3243
- var SHARED_VERSION = "0.16.0";
3416
+ var SHARED_VERSION = "0.17.0";
3244
3417
  // Annotate the CommonJS export names for ESM import in node:
3245
3418
  0 && (module.exports = {
3246
3419
  ADVANCE_ON,
@@ -3265,6 +3438,7 @@ var SHARED_VERSION = "0.16.0";
3265
3438
  AuthoringPickSchema,
3266
3439
  AutocaptureSettingsSchema,
3267
3440
  BUTTON_ACTIONS,
3441
+ BugReportSchema,
3268
3442
  ButtonSchema,
3269
3443
  CAPTURE_PARAM,
3270
3444
  CAPTURE_SCREENSHOT_MAX_BYTES,
@@ -3330,6 +3504,10 @@ var SHARED_VERSION = "0.16.0";
3330
3504
  LocaleSchema,
3331
3505
  LocalizationSettingsSchema,
3332
3506
  MAX_ANNOTATIONS,
3507
+ MAX_APP_VERSION_LENGTH,
3508
+ MAX_BREADCRUMBS,
3509
+ MAX_BUG_REPORT_LENGTH,
3510
+ MAX_BUG_REPORT_SCREENSHOT_BYTES,
3333
3511
  MAX_COLLECTION_DEPTH,
3334
3512
  MAX_COMPLAINT_ANSWER_LENGTH,
3335
3513
  MAX_COMPLAINT_ATTACHMENT_BYTES,
@@ -3337,6 +3515,13 @@ var SHARED_VERSION = "0.16.0";
3337
3515
  MAX_COMPLAINT_FIELDS,
3338
3516
  MAX_COMPLAINT_LENGTH,
3339
3517
  MAX_CUSTOM_CSS,
3518
+ MAX_DEBUG_IMAGES,
3519
+ MAX_DETAIL_FRAMES,
3520
+ MAX_DETAIL_THREADS,
3521
+ MAX_ERROR_TAGS,
3522
+ MAX_EXCEPTION_CHAIN,
3523
+ MAX_EXCEPTION_DETAIL_BYTES,
3524
+ MAX_EXCEPTION_DETAIL_RAW_BYTES,
3340
3525
  MAX_FEEDBACK_COMMENT,
3341
3526
  MAX_FEEDBACK_DESCRIPTION,
3342
3527
  MAX_FEEDBACK_NOTE,
@@ -3364,6 +3549,7 @@ var SHARED_VERSION = "0.16.0";
3364
3549
  PDF_PAGES_CLASS,
3365
3550
  PLACEMENTS,
3366
3551
  PLATFORMS,
3552
+ PerformanceSettingsSchema,
3367
3553
  PostMessageSchema,
3368
3554
  ProjectThemeSchema,
3369
3555
  PublishedGuideSchema,
@@ -3433,11 +3619,13 @@ var SHARED_VERSION = "0.16.0";
3433
3619
  contrastIssues,
3434
3620
  contrastRatio,
3435
3621
  cssSelectorError,
3622
+ customFingerprint,
3436
3623
  defaultGuideConfig,
3437
3624
  defaultStep,
3438
3625
  describeCaptureStep,
3439
3626
  describeRule,
3440
3627
  emptyRuleGroup,
3628
+ errorFilterDrops,
3441
3629
  evaluateRule,
3442
3630
  evaluateRules,
3443
3631
  evenWeights,
@@ -3480,10 +3668,12 @@ var SHARED_VERSION = "0.16.0";
3480
3668
  mediaKind,
3481
3669
  mediaMaxBytes,
3482
3670
  needsReview,
3671
+ normalizeAppVersion,
3483
3672
  normalizeErrorMessage,
3484
3673
  normalizeFrameFile,
3485
3674
  normalizeLocale,
3486
3675
  normalizeSnapshot,
3676
+ normalizeTags,
3487
3677
  orderedModules,
3488
3678
  pageLabel,
3489
3679
  pageName,
@@ -3501,6 +3691,7 @@ var SHARED_VERSION = "0.16.0";
3501
3691
  propertyAttributeAllowed,
3502
3692
  queryConditionRegex,
3503
3693
  randomId,
3694
+ reactNativeBundleUrl,
3504
3695
  readableTextOn,
3505
3696
  recordingLevel,
3506
3697
  relativeLuminance,
@@ -3531,6 +3722,7 @@ var SHARED_VERSION = "0.16.0";
3531
3722
  toTranslationCsv,
3532
3723
  toXliff,
3533
3724
  translationCoverage,
3725
+ trimExceptionDetail,
3534
3726
  unreadAnnouncements,
3535
3727
  validateGuideConfig,
3536
3728
  variantProblems,