@pluno/product-agent-web 0.1.252 → 0.1.253

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.
@@ -185,7 +185,7 @@ function Fi(s) {
185
185
  e ^= s.charCodeAt(t), e = Math.imul(e, 16777619);
186
186
  return `fnv1a-${(e >>> 0).toString(16).padStart(8, "0")}`;
187
187
  }
188
- const Es = "0.1.252", zi = {
188
+ const Es = "0.1.253", zi = {
189
189
  version: Es
190
190
  };
191
191
  function ze(s) {
@@ -404,15 +404,15 @@ function Ki(s, e) {
404
404
  updatedAt: t ? s.updatedAt : null
405
405
  };
406
406
  }
407
- function se(s) {
408
- return s !== null && typeof s == "object" && !Object.isFrozen(s) && (Object.values(s).forEach(se), Object.freeze(s)), s;
407
+ function ie(s) {
408
+ return s !== null && typeof s == "object" && !Object.isFrozen(s) && (Object.values(s).forEach(ie), Object.freeze(s)), s;
409
409
  }
410
410
  function J(s) {
411
411
  if (!je(s)) throw new Error("Conversation inputs must be JSON-safe values.");
412
412
  return JSON.parse(JSON.stringify(s));
413
413
  }
414
414
  function Wi(s = "", e = 0) {
415
- return se({ authorityId: s, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, checkpointEffectId: null, checkpointError: null });
415
+ return ie({ authorityId: s, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, checkpointEffectId: null, checkpointError: null });
416
416
  }
417
417
  function es(s) {
418
418
  return {
@@ -543,7 +543,7 @@ function rs(s, e) {
543
543
  queries: { ...a.queries, [r.lane]: { ...c, requestId: null, status: c.data === null ? "not_requested" : "ready" } }
544
544
  } } };
545
545
  }
546
- return se(i);
546
+ return ie(i);
547
547
  }
548
548
  function Ge(s) {
549
549
  return JSON.stringify(s, (e, t) => t && typeof t == "object" && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([i], [n]) => i.localeCompare(n))) : t);
@@ -648,8 +648,8 @@ function hr(s, e, t, i) {
648
648
  if (t.clients[e.clientScopeId] !== e.conversationScopeId) throw new Error("Submission selection has changed.");
649
649
  const { type: a, authorityId: c, generation: d, prepareContext: l, ...u } = e, h = s.submissions[e.userMessageId];
650
650
  if (h) {
651
- const { contextPreparation: w, requestedModel: I, sessionId: _, delivery: A, cancelled: C, cancellationReason: M, error: ie, executionVersion: B, ...S } = h;
652
- if (Ge(S) !== Ge(u)) throw new Error("User-message identity cannot be reused with different input.");
651
+ const { contextPreparation: w, requestedModel: I, sessionId: _, delivery: E, cancelled: C, cancellationReason: M, error: te, executionVersion: B, ...W } = h;
652
+ if (Ge(W) !== Ge(u)) throw new Error("User-message identity cannot be reused with different input.");
653
653
  return { state: s, effects: r };
654
654
  }
655
655
  const p = t.selections[e.conversationScopeId], f = Object.values(s.submissions).find((w) => w.conversationScopeId === e.conversationScopeId && !w.cancelled && w.sessionId !== null), m = i.scopes[e.clientScopeId], g = {
@@ -750,7 +750,7 @@ function hr(s, e, t, i) {
750
750
  const c = a.sessionId ? n.sessions[a.sessionId]?.execution : null;
751
751
  c?.user_message_ids.includes(a.userMessageId) && a.executionVersion !== c.version && (n = { ...n, submissions: { ...n.submissions, [a.userMessageId]: { ...a, executionVersion: c.version } } });
752
752
  }
753
- return o && (n = { ...n, requestSequence: n.requestSequence + 1 }, r.push({ id: `conversation:${n.generation}:${n.requestSequence}`, kind: "conversation.interactions", input: o })), { state: se(n), effects: r };
753
+ return o && (n = { ...n, requestSequence: n.requestSequence + 1 }, r.push({ id: `conversation:${n.generation}:${n.requestSequence}`, kind: "conversation.interactions", input: o })), { state: ie(n), effects: r };
754
754
  }
755
755
  const Zs = (s, e) => ({
756
756
  acceptance: "unissued",
@@ -789,7 +789,7 @@ function Qi(s, e) {
789
789
  const u = l.command.payload.source;
790
790
  return !Object.values(s.submissions).some((h) => h.conversationScopeId === l.conversationScopeId && h.delivery === "accepted" && h.attachments.some((p) => p.sourceId === u.sourceId));
791
791
  }));
792
- return se({
792
+ return ie({
793
793
  schema: 1,
794
794
  authorityId: s.authorityId,
795
795
  submissions: r,
@@ -809,7 +809,7 @@ function he(s, e) {
809
809
  }
810
810
  function os(s, e, t, i = !1) {
811
811
  if (!e.effectsEnabled || !i && s.submissions === e.submissions && s.deliveries === e.deliveries && s.operations === e.operations && s.stops === e.stops && s.sessions === e.sessions) return { state: e, effects: [] };
812
- const n = e.requestSequence + 1, r = `conversation:${e.generation}:${n}`, o = se({ ...e, requestSequence: n, checkpointEffectId: r });
812
+ const n = e.requestSequence + 1, r = `conversation:${e.generation}:${n}`, o = ie({ ...e, requestSequence: n, checkpointEffectId: r });
813
813
  return { state: o, effects: [{ id: r, kind: "conversation.checkpoint", input: {
814
814
  authorityId: o.authorityId,
815
815
  generation: o.generation,
@@ -928,7 +928,7 @@ function cs(s) {
928
928
  }
929
929
  } }) : t.push({ id: h, kind: "conversation.command", input: { ...i, command: c.command } });
930
930
  }
931
- return { state: se(e), effects: t };
931
+ return { state: ie(e), effects: t };
932
932
  }
933
933
  function fr(s, e, t, i) {
934
934
  let n = s, r = e;
@@ -1038,18 +1038,18 @@ function fr(s, e, t, i) {
1038
1038
  error: v.contextPreparation === null && !v.cancelled ? { code: "context_preparation_interrupted", message: "Page context preparation was interrupted. Please send this message again.", retryable: !1 } : !l.deliveries[g] && v.delivery !== "accepted" && !v.cancelled ? { code: "submission_interrupted", message: "Message preparation was interrupted. Retry this message.", retryable: !0 } : v.error
1039
1039
  }])),
1040
1040
  deliveries: Object.fromEntries(Object.entries(l.submissions).map(([g, v], w) => {
1041
- const I = l.deliveries[g], _ = v.contextPreparation === null, A = v.delivery === "accepted" ? "accepted" : I?.acceptance ?? (I && (I.step === "send" || I.step === "receipt") ? "uncertain" : "unissued");
1041
+ const I = l.deliveries[g], _ = v.contextPreparation === null, E = v.delivery === "accepted" ? "accepted" : I?.acceptance ?? (I && (I.step === "send" || I.step === "receipt") ? "uncertain" : "unissued");
1042
1042
  return [g, {
1043
1043
  ...Zs(v, w),
1044
1044
  ...I,
1045
- acceptance: A,
1045
+ acceptance: E,
1046
1046
  allocation: v.sessionId !== null ? "resolved" : I?.allocation ?? (I?.step === "upload" ? "uncertain" : "unissued"),
1047
1047
  effectId: null,
1048
1048
  // Readiness is authority-local and must be re-established after restart. Captured input stays immutable.
1049
- step: A === "uncertain" && I?.step === "send" && I.phase !== "done" ? "receipt" : I?.step ?? null,
1050
- prepared: A === "accepted",
1049
+ step: E === "uncertain" && I?.step === "send" && I.phase !== "done" ? "receipt" : I?.step ?? null,
1050
+ prepared: E === "accepted",
1051
1051
  queuePosition: I?.queuePosition ?? w,
1052
- phase: A === "accepted" ? "done" : _ || !I ? "failed" : ["running", "waiting"].includes(I.phase) ? "uncertain" : I.phase
1052
+ phase: E === "accepted" ? "done" : _ || !I ? "failed" : ["running", "waiting"].includes(I.phase) ? "uncertain" : I.phase
1053
1053
  }];
1054
1054
  })),
1055
1055
  operations: Object.fromEntries(Object.entries(l.operations).map(([g, v]) => [g, {
@@ -1227,7 +1227,7 @@ function Q(s) {
1227
1227
  const e = s.runtime(), t = e.engine.getState().slices.directory;
1228
1228
  return !e.isDisposed && (s.isCurrent?.() ?? !0) && t.authorityId === s.authority.authorityId && t.generation === s.authority.generation;
1229
1229
  }
1230
- function K(s, e) {
1230
+ function H(s, e) {
1231
1231
  if (!Q(s) || e.authorityId !== s.authority.authorityId || e.generation !== s.authority.generation)
1232
1232
  throw Object.assign(new Error("Conversation authority was retired."), { code: "authority_retired", retryable: !0 });
1233
1233
  }
@@ -1252,7 +1252,7 @@ function fe(s, e) {
1252
1252
  function mr(s) {
1253
1253
  let e = Promise.resolve();
1254
1254
  const t = (o = Qi(s.runtime().engine.getState().slices.conversation, s.runtime().engine.getState().slices.directory)) => {
1255
- const a = () => (K(s, s.authority), s.saveDelivery(o));
1255
+ const a = () => (H(s, s.authority), s.saveDelivery(o));
1256
1256
  return e = e.then(a, a), e;
1257
1257
  }, i = (o, a) => {
1258
1258
  throw Q(s) && !(o instanceof Error && "code" in o && ["executor_not_ready", "request_timed_out"].includes(String(o.code))) && s.onError?.(o, a), fe(o, a);
@@ -1260,7 +1260,7 @@ function mr(s) {
1260
1260
  const { token: o, protocol: a, ...c } = s.http.auth;
1261
1261
  return { ...c, ...s.connectionId() ? { connection_id: s.connectionId() } : {} };
1262
1262
  }, r = (o) => {
1263
- if (K(s, s.authority), s.runtime().engine.getState().slices.conversation.submissions[o]?.cancelled)
1263
+ if (H(s, s.authority), s.runtime().engine.getState().slices.conversation.submissions[o]?.cancelled)
1264
1264
  throw Object.assign(new Error("Submission was cancelled."), { code: "submission_cancelled", retryable: !1 });
1265
1265
  };
1266
1266
  return {
@@ -1282,7 +1282,7 @@ function mr(s) {
1282
1282
  clearTimeout(a), d();
1283
1283
  });
1284
1284
  },
1285
- "conversation.checkpoint": async (o) => (K(s, o), await t(o.checkpoint).catch((a) => i(a, { operation: "conversation.checkpoint" })), K(s, o), null),
1285
+ "conversation.checkpoint": async (o) => (H(s, o), await t(o.checkpoint).catch((a) => i(a, { operation: "conversation.checkpoint" })), H(s, o), null),
1286
1286
  "conversation.receipt": (o) => ee(s.onTiming, {
1287
1287
  operation: "send",
1288
1288
  layer: "http",
@@ -1290,13 +1290,13 @@ function mr(s) {
1290
1290
  clientMessageId: o.userMessageId,
1291
1291
  sessionId: o.sessionId
1292
1292
  }).measure("receipt_http", () => Promise.resolve().then(async () => {
1293
- K(s, o);
1293
+ H(s, o);
1294
1294
  const a = await s.http.request("/receipt", {}, {
1295
1295
  context: n(),
1296
1296
  session_id: o.sessionId,
1297
1297
  client_message_id: o.userMessageId
1298
1298
  }, "POST", "conversations", { readOnly: !0 });
1299
- if (K(s, o), a !== null && (typeof a.sessionId != "string" || !a.sessionId || a.clientMessageId !== o.userMessageId || o.sessionId !== null && a.sessionId !== o.sessionId)) throw Object.assign(new Error("Conversation receipt identity mismatch."), { code: "acceptance_identity_mismatch" });
1299
+ if (H(s, o), a !== null && (typeof a.sessionId != "string" || !a.sessionId || a.clientMessageId !== o.userMessageId || o.sessionId !== null && a.sessionId !== o.sessionId)) throw Object.assign(new Error("Conversation receipt identity mismatch."), { code: "acceptance_identity_mismatch" });
1300
1300
  return a !== null && ee(s.onTiming, {
1301
1301
  operation: "send",
1302
1302
  layer: "http",
@@ -1308,7 +1308,7 @@ function mr(s) {
1308
1308
  "conversation.command": (o) => {
1309
1309
  let a = !1;
1310
1310
  return Promise.resolve().then(async () => {
1311
- K(s, o), (o.command.type === "chat.user_message" || o.command.type === "attachment.upload_completed") && r(String(o.command.payload.clientMessageId));
1311
+ H(s, o), (o.command.type === "chat.user_message" || o.command.type === "attachment.upload_completed") && r(String(o.command.payload.clientMessageId));
1312
1312
  const c = o.command.payload, d = ee(["chat.user_message", "chat.retry_last_user_message", "run.stop", "attachment.upload_completed"].includes(o.command.type) ? s.onTiming : void 0, {
1313
1313
  operation: o.command.type === "run.stop" ? "stop" : "send",
1314
1314
  layer: "http",
@@ -1316,7 +1316,7 @@ function mr(s) {
1316
1316
  clientMessageId: String(c.clientMessageId ?? c.expectedUserMessageId ?? o.command.request_id),
1317
1317
  sessionId: typeof c.sessionId == "string" ? c.sessionId : null
1318
1318
  });
1319
- return await d.measure("checkpoint", () => t()), K(s, o), (o.command.type === "chat.user_message" || o.command.type === "attachment.upload_completed") && r(String(o.command.payload.clientMessageId)), s.onCommand?.(o.command), a = !0, await d.measure("command_http", async () => {
1319
+ return await d.measure("checkpoint", () => t()), H(s, o), (o.command.type === "chat.user_message" || o.command.type === "attachment.upload_completed") && r(String(o.command.payload.clientMessageId)), s.onCommand?.(o.command), a = !0, await d.measure("command_http", async () => {
1320
1320
  const l = await s.http.request(
1321
1321
  "/commands",
1322
1322
  {},
@@ -1325,7 +1325,7 @@ function mr(s) {
1325
1325
  "conversations",
1326
1326
  { timing: d }
1327
1327
  );
1328
- if (K(s, o), l.request_id !== o.command.request_id || !je(l.result)) throw Object.assign(new Error("Conversation response identity mismatch."), { code: "acceptance_identity_mismatch" });
1328
+ if (H(s, o), l.request_id !== o.command.request_id || !je(l.result)) throw Object.assign(new Error("Conversation response identity mismatch."), { code: "acceptance_identity_mismatch" });
1329
1329
  if (o.command.type.startsWith("chat.")) {
1330
1330
  const u = l.result;
1331
1331
  if (typeof u?.sessionId != "string" || !u.sessionId || u.clientMessageId !== o.command.payload.clientMessageId || o.command.payload.sessionId && u.sessionId !== o.command.payload.sessionId) throw Object.assign(new Error("Conversation acceptance identity mismatch."), { code: "acceptance_identity_mismatch" });
@@ -1362,7 +1362,7 @@ function mr(s) {
1362
1362
  sessionId: o.submission.sessionId
1363
1363
  }).measure("attachment_upload", () => Promise.resolve().then(async () => {
1364
1364
  const c = () => {
1365
- if (K(s, o), !o.preparationId) return r(o.submission.userMessageId);
1365
+ if (H(s, o), !o.preparationId) return r(o.submission.userMessageId);
1366
1366
  const f = s.runtime().engine.getState().slices.directory;
1367
1367
  if (!Object.values(f.clients).includes(o.submission.conversationScopeId))
1368
1368
  throw Object.assign(new Error("Attachment preparation was cancelled."), { code: "submission_cancelled", retryable: !1 });
@@ -1412,7 +1412,7 @@ function mr(s) {
1412
1412
  }));
1413
1413
  },
1414
1414
  "conversation.snapshot": (o) => Promise.resolve().then(async () => {
1415
- K(s, o);
1415
+ H(s, o);
1416
1416
  const a = s.runtime(), c = new AbortController(), d = () => {
1417
1417
  const h = a.engine.getState().slices;
1418
1418
  Q(s) ? h.directory.memberships[o.sessionId]?.members.length ? h.conversation.sessions[o.sessionId]?.queries[o.lane].requestId !== o.requestId && c.abort("request_replaced") : c.abort("observation_released") : c.abort("authority_retired");
@@ -1421,7 +1421,7 @@ function mr(s) {
1421
1421
  try {
1422
1422
  const h = [];
1423
1423
  for (let g = 0; g < Math.max(1, o.refreshItemIds.length); g += 200) {
1424
- if (K(s, o), !s.runtime().engine.getState().slices.directory.memberships[o.sessionId]?.members.length) throw new Error("Conversation observation was retired.");
1424
+ if (H(s, o), !s.runtime().engine.getState().slices.directory.memberships[o.sessionId]?.members.length) throw new Error("Conversation observation was retired.");
1425
1425
  const v = await s.http.request(
1426
1426
  `/${encodeURIComponent(o.sessionId)}/snapshot`,
1427
1427
  {},
@@ -1439,7 +1439,7 @@ function mr(s) {
1439
1439
  const I = fe(w);
1440
1440
  throw Object.assign(I, { details: { ...I.details, successfulRequests: h.length } });
1441
1441
  });
1442
- if (K(s, o), v.conversation_id !== o.sessionId) throw new Error("Snapshot conversation identity mismatch.");
1442
+ if (H(s, o), v.conversation_id !== o.sessionId) throw new Error("Snapshot conversation identity mismatch.");
1443
1443
  if (h.push(v), !v.projection_ready) break;
1444
1444
  }
1445
1445
  const p = h[0];
@@ -1587,15 +1587,15 @@ class gr {
1587
1587
  }
1588
1588
  }
1589
1589
  function Re(s, e, t) {
1590
- const i = s.submissionOrder.map((y) => s.submissions[y]).filter((y) => y.conversationScopeId === t), n = e.selections[t]?.sessionId ?? i.find((y) => !y.cancelled && y.sessionId !== null)?.sessionId ?? null, r = n ? s.sessions[n] : void 0, o = s.submissionOrder.map((y) => s.submissions[y]).filter((y) => n ? y.sessionId === n || y.sessionId === null && y.conversationScopeId === t : y.conversationScopeId === t), a = Object.values(r?.items ?? {}).sort((y, q) => {
1591
- const O = re(y.created_at), L = re(q.created_at);
1592
- return O < L ? -1 : O > L ? 1 : y.id < q.id ? -1 : y.id > q.id ? 1 : 0;
1590
+ const i = s.submissionOrder.map((y) => s.submissions[y]).filter((y) => y.conversationScopeId === t), n = e.selections[t]?.sessionId ?? i.find((y) => !y.cancelled && y.sessionId !== null)?.sessionId ?? null, r = n ? s.sessions[n] : void 0, o = s.submissionOrder.map((y) => s.submissions[y]).filter((y) => n ? y.sessionId === n || y.sessionId === null && y.conversationScopeId === t : y.conversationScopeId === t), a = Object.values(r?.items ?? {}).sort((y, T) => {
1591
+ const O = re(y.created_at), L = re(T.created_at);
1592
+ return O < L ? -1 : O > L ? 1 : y.id < T.id ? -1 : y.id > T.id ? 1 : 0;
1593
1593
  }), c = o.filter((y) => (!y.cancelled || y.conversationScopeId === t && (y.sessionId === null || y.sessionId === n || n === null && y === o[o.length - 1])) && !r?.items[y.userMessageId] && !r?.removedItems[y.userMessageId]), d = {};
1594
1594
  for (const y of a) {
1595
- const q = pt(y);
1596
- if (q === null) continue;
1595
+ const T = pt(y);
1596
+ if (T === null) continue;
1597
1597
  const O = r?.streams[y.id];
1598
- d[y.id] = O ? O.state === "open" ? "open" : q < O.revision ? "awaiting_content" : O.state : "open";
1598
+ d[y.id] = O ? O.state === "open" ? "open" : T < O.revision ? "awaiting_content" : O.state : "open";
1599
1599
  }
1600
1600
  const l = [];
1601
1601
  for (const y of a)
@@ -1603,15 +1603,15 @@ function Re(s, e, t) {
1603
1603
  l.push({ id: y.id, userMessageId: y.id, activityIds: [], outcomeIds: [], collapsed: !1 });
1604
1604
  else {
1605
1605
  l.length || l.push({ id: `leading:${y.id}`, userMessageId: null, activityIds: [], outcomeIds: [], collapsed: !1 });
1606
- const q = l.length - 1, O = l[q], L = y.type === "commentary" || y.type === "tool_summary" ? "activityIds" : "outcomeIds";
1607
- l[q] = { ...O, [L]: [...O[L], y.id] };
1606
+ const T = l.length - 1, O = l[T], L = y.type === "commentary" || y.type === "tool_summary" ? "activityIds" : "outcomeIds";
1607
+ l[T] = { ...O, [L]: [...O[L], y.id] };
1608
1608
  }
1609
1609
  for (const y of c) {
1610
- const q = l.findIndex((O) => {
1610
+ const T = l.findIndex((O) => {
1611
1611
  const L = o.find((Ke) => Ke.userMessageId === O.userMessageId), ke = r?.items[O.userMessageId ?? O.activityIds[0] ?? O.outcomeIds[0]];
1612
1612
  return (L?.submittedAt ?? (ke ? Date.parse(ke.created_at) : 1 / 0)) > y.submittedAt;
1613
1613
  });
1614
- l.splice(q < 0 ? l.length : q, 0, {
1614
+ l.splice(T < 0 ? l.length : T, 0, {
1615
1615
  id: y.userMessageId,
1616
1616
  userMessageId: y.userMessageId,
1617
1617
  activityIds: [],
@@ -1621,17 +1621,17 @@ function Re(s, e, t) {
1621
1621
  }
1622
1622
  const u = r?.execution, h = o.filter((y) => !y.cancelled && y.delivery !== "failed"), p = h.filter((y) => y.delivery !== "accepted" && y.executionVersion === null), f = h.filter((y) => y.delivery === "accepted" && y.executionVersion === null), m = h[h.length - 1], g = p.length > 0, v = m !== void 0 && f.includes(m);
1623
1623
  let w = g ? "submitting" : v ? "awaiting_execution" : u?.phase ?? "idle";
1624
- const I = Object.entries(s.stops).filter(([y]) => y === t || n !== null && e.selections[y]?.sessionId === n).map(([, y]) => y).find((y) => (!o.length || y.userMessageIds.includes(o[o.length - 1].userMessageId) || !g && !v && oe(u).some((q) => y.userMessageIds.includes(q))) && (!u || u.version <= y.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(u.phase) || o.some((q) => q.cancelled && q.executionVersion === null && y.userMessageIds.includes(q.userMessageId)))), _ = u && ["thinking", "steering", "queued", "stopping"].includes(u.phase) || o.some((y) => y.delivery === "accepted" && y.executionVersion === null && I?.userMessageIds.includes(y.userMessageId));
1624
+ const I = Object.entries(s.stops).filter(([y]) => y === t || n !== null && e.selections[y]?.sessionId === n).map(([, y]) => y).find((y) => (!o.length || y.userMessageIds.includes(o[o.length - 1].userMessageId) || !g && !v && oe(u).some((T) => y.userMessageIds.includes(T))) && (!u || u.version <= y.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(u.phase) || o.some((T) => T.cancelled && T.executionVersion === null && y.userMessageIds.includes(T.userMessageId)))), _ = u && ["thinking", "steering", "queued", "stopping"].includes(u.phase) || o.some((y) => y.delivery === "accepted" && y.executionVersion === null && I?.userMessageIds.includes(y.userMessageId));
1625
1625
  I && _ && !g && (!u || !["thinking", "steering", "queued", "stopping"].includes(u.phase) || oe(u).every((y) => I.userMessageIds.includes(y))) && (w = "stopping"), I && !_ && !g && o.some((y) => y.cancelled && y.executionVersion === null && I.userMessageIds.includes(y.userMessageId)) && (w = o.some((y) => I.userMessageIds.includes(y.userMessageId) && ["sending", "uncertain"].includes(y.delivery)) ? "stopping" : "stopped");
1626
- const A = ["thinking", "steering", "queued"].includes(w), C = s.stops[t] ?? I, M = C?.userMessageIds.filter((y) => !["completed", "failed"].includes(r?.executionByUserMessage[y]?.phase ?? "")) ?? [], ie = M.some((y) => {
1627
- const q = o.find((L) => L.userMessageId === y);
1628
- return !Object.values(s.operations).some((L) => L.command.type === "run.stop" && L.command.payload.expectedUserMessageId === y && L.phase === "done") && (q?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(q.delivery) || !!(u && oe(u).includes(y) && ["thinking", "steering", "queued", "stopping"].includes(u.phase)));
1629
- }), B = u?.user_message_ids ?? [], S = g || v ? m?.userMessageId ?? null : B[B.length - 1] ?? null, k = l.find((y) => y.userMessageId === S), E = A ? [...k?.activityIds ?? []].reverse().find((y) => d[y] === "open") ?? null : null, F = n !== null && !!e.selections[t]?.provisionalId && a.length === 0 && o.length === 0 && // The first persisted idle snapshot already has a positive synchronization version.
1626
+ const E = ["thinking", "steering", "queued"].includes(w), C = s.stops[t] ?? I, M = C?.userMessageIds.filter((y) => !["completed", "failed"].includes(r?.executionByUserMessage[y]?.phase ?? "")) ?? [], te = M.some((y) => {
1627
+ const T = o.find((L) => L.userMessageId === y);
1628
+ return !Object.values(s.operations).some((L) => L.command.type === "run.stop" && L.command.payload.expectedUserMessageId === y && L.phase === "done") && (T?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(T.delivery) || !!(u && oe(u).includes(y) && ["thinking", "steering", "queued", "stopping"].includes(u.phase)));
1629
+ }), B = u?.user_message_ids ?? [], W = g || v ? m?.userMessageId ?? null : B[B.length - 1] ?? null, S = l.find((y) => y.userMessageId === W), q = E ? [...S?.activityIds ?? []].reverse().find((y) => d[y] === "open") ?? null : null, A = n !== null && !!e.selections[t]?.provisionalId && a.length === 0 && o.length === 0 && // The first persisted idle snapshot already has a positive synchronization version.
1630
1630
  (!r?.execution || r.execution.phase === "idle" && r.execution.user_message_ids.length === 0) && Object.values(s.operations).some((y) => y.conversationScopeId === t && y.phase === "done" && ["runtime.warmup", "attachment.prepare"].includes(y.command.type) && !y.command.payload.sessionId && y.result?.sessionId === n);
1631
- return se({
1631
+ return ie({
1632
1632
  historyRefreshFailure: r?.historyRefreshFailure ?? null,
1633
1633
  selectionKey: t ? JSON.stringify([s.authorityId, s.generation, t]) : void 0,
1634
- isDraftSession: F,
1634
+ isDraftSession: A,
1635
1635
  proactiveQuestion: s.proactiveQuestions[t] ?? null,
1636
1636
  sessionId: n,
1637
1637
  items: a,
@@ -1643,9 +1643,9 @@ function Re(s, e, t) {
1643
1643
  removedItems: r?.removedItems ?? {},
1644
1644
  streamStates: d,
1645
1645
  preparation: r?.preparation ?? null,
1646
- stop: C ? { ...C, userMessageIds: M, pending: ie } : null,
1647
- segments: l.map((y, q) => ({ ...y, collapsed: A ? y.userMessageId !== S : q < l.length - 1 || y.activityIds.length > 0 })),
1648
- activity: { phase: w, activeItemId: E, userMessageId: S, executionKey: JSON.stringify([...oe(u)].sort()) },
1646
+ stop: C ? { ...C, userMessageIds: M, pending: te } : null,
1647
+ segments: l.map((y, T) => ({ ...y, collapsed: E ? y.userMessageId !== W : T < l.length - 1 || y.activityIds.length > 0 })),
1648
+ activity: { phase: w, activeItemId: q, userMessageId: W, executionKey: JSON.stringify([...oe(u)].sort()) },
1649
1649
  // Staging transfers the immutable input to the core. Waiting for backend acceptance leaves
1650
1650
  // the same submitted text in the optimistic transcript and composer during delivery.
1651
1651
  receipts: i.filter((y) => !y.cancelled && e.clients[y.clientScopeId] === t).map((y) => ({ viewId: y.viewId, userMessageId: y.userMessageId, acceptedRendererRevision: y.rendererRevision }))
@@ -1665,7 +1665,7 @@ function Xi(s, e) {
1665
1665
  return s.sessionId && o ? { type: "execution", userMessageId: o, sessionId: s.sessionId } : null;
1666
1666
  }
1667
1667
  function yr(s, e) {
1668
- return se({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((t) => [t, Re(s, e, t)])) });
1668
+ return ie({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((t) => [t, Re(s, e, t)])) });
1669
1669
  }
1670
1670
  function vr(s, e) {
1671
1671
  if (!e) return !1;
@@ -2042,19 +2042,19 @@ const Tr = "Pluno is reconnecting. Try again in a moment.";
2042
2042
  function kr(s) {
2043
2043
  return (s instanceof Error ? s.message : s) === Tr;
2044
2044
  }
2045
- const te = /* @__PURE__ */ Object.create(null);
2046
- te.open = "0";
2047
- te.close = "1";
2048
- te.ping = "2";
2049
- te.pong = "3";
2050
- te.message = "4";
2051
- te.upgrade = "5";
2052
- te.noop = "6";
2045
+ const se = /* @__PURE__ */ Object.create(null);
2046
+ se.open = "0";
2047
+ se.close = "1";
2048
+ se.ping = "2";
2049
+ se.pong = "3";
2050
+ se.message = "4";
2051
+ se.upgrade = "5";
2052
+ se.noop = "6";
2053
2053
  const rt = /* @__PURE__ */ Object.create(null);
2054
- Object.keys(te).forEach((s) => {
2055
- rt[te[s]] = s;
2054
+ Object.keys(se).forEach((s) => {
2055
+ rt[se[s]] = s;
2056
2056
  });
2057
- const ls = { type: "error", data: "parser error" }, Yi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Zi = typeof ArrayBuffer == "function", en = (s) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(s) : s && s.buffer instanceof ArrayBuffer, ks = ({ type: s, data: e }, t, i) => Yi && e instanceof Blob ? t ? i(e) : ni(e, i) : Zi && (e instanceof ArrayBuffer || en(e)) ? t ? i(e) : ni(new Blob([e]), i) : i(te[s] + (e || "")), ni = (s, e) => {
2057
+ const ls = { type: "error", data: "parser error" }, Yi = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Zi = typeof ArrayBuffer == "function", en = (s) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(s) : s && s.buffer instanceof ArrayBuffer, ks = ({ type: s, data: e }, t, i) => Yi && e instanceof Blob ? t ? i(e) : ni(e, i) : Zi && (e instanceof ArrayBuffer || en(e)) ? t ? i(e) : ni(new Blob([e]), i) : i(se[s] + (e || "")), ni = (s, e) => {
2058
2058
  const t = new FileReader();
2059
2059
  return t.onload = function() {
2060
2060
  const i = t.result.split(",")[1];
@@ -4732,15 +4732,15 @@ class hn {
4732
4732
  }
4733
4733
  async requestOnce(e, t, i, n, r, o, a, c = 1) {
4734
4734
  const d = this.auth.client_kind === "embed", l = new URL(`/api/product-agent/${r ?? (d ? "embed" : "runtime")}${e}`, this.options.backendUrl), u = r === "conversations" ? {} : d ? { client_id: this.auth.client_id, transport_id: this.auth.transport_id } : { community_id: this.auth.community_id, automation_run_id: this.auth.automation_run_id };
4735
- for (const [S, k] of Object.entries({ ...u, ...t }))
4736
- k != null && l.searchParams.set(S, String(k));
4735
+ for (const [S, q] of Object.entries({ ...u, ...t }))
4736
+ q != null && l.searchParams.set(S, String(q));
4737
4737
  this.requests.signal.throwIfAborted(), o?.throwIfAborted();
4738
4738
  const h = new AbortController(), p = { trigger: null }, f = (S) => {
4739
4739
  h.signal.aborted || (p.trigger = S, h.abort());
4740
4740
  }, m = () => f("transport_disposed"), g = () => f(["owner_disposed", "authority_retired", "observation_released", "request_replaced"].includes(o?.reason) ? o.reason : "caller_cancelled");
4741
4741
  this.requests.signal.addEventListener("abort", m, { once: !0 }), o?.addEventListener("abort", g, { once: !0 });
4742
- const v = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && n === "POST", w = /^\/conversations(?:\/[^/]+)?$/.test(e) && (n ?? (i === void 0 ? "GET" : "POST")) === "GET", I = setTimeout(() => f("deadline"), w ? 6e4 : v ? 3e4 : 15e3), _ = Eo(), A = Date.now();
4743
- let C = null, M = null, ie = null, B = null;
4742
+ const v = r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) && n === "POST", w = /^\/conversations(?:\/[^/]+)?$/.test(e) && (n ?? (i === void 0 ? "GET" : "POST")) === "GET", I = setTimeout(() => f("deadline"), w ? 6e4 : v ? 3e4 : 15e3), _ = Eo(), E = Date.now();
4743
+ let C = null, M = !1, te = null, B = null, W = null;
4744
4744
  try {
4745
4745
  const S = await Promise.resolve(fetch(l, {
4746
4746
  method: n ?? (i === void 0 ? "GET" : "POST"),
@@ -4748,64 +4748,64 @@ class hn {
4748
4748
  signal: h.signal,
4749
4749
  headers: { "x-product-agent-auth-request-id": _, authorization: d || r === "conversations" ? `Bearer ${this.auth.token}` : this.auth.token, "content-type": "application/json", ...v ? { "x-request-id": _ } : {} },
4750
4750
  ...i === void 0 ? {} : { body: JSON.stringify(i) }
4751
- })).catch((k) => {
4752
- throw v && k instanceof TypeError ? new b("The connection was interrupted. Please try again.", "connection_interrupted", !0) : k;
4751
+ })).catch((q) => {
4752
+ throw M = !0, q;
4753
4753
  });
4754
- if (C = Date.now(), M = S.status, ie = li(S.headers.get("x-request-id")), B = li(S.headers.get("x-cloud-trace-context")), !S.ok) {
4755
- const k = S.status === 401 ? "unauthorized" : S.status === 426 ? "update_required" : String(S.status), E = (await S.json().catch(() => null))?.detail;
4756
- if (d && S.status === 403 && (r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) || (!r || r === "embed") && /^\/conversations\/[^/]+$/.test(e)) && ["Conversation unavailable", "Integration mismatch", "Embedded origin mismatch"].includes(E))
4754
+ if (C = Date.now(), te = S.status, B = li(S.headers.get("x-request-id")), W = li(S.headers.get("x-cloud-trace-context")), !S.ok) {
4755
+ const q = S.status === 401 ? "unauthorized" : S.status === 426 ? "update_required" : String(S.status), A = (await S.json().catch(() => null))?.detail;
4756
+ if (d && S.status === 403 && (r === "conversations" && /^\/[^/]+\/snapshot$/.test(e) || (!r || r === "embed") && /^\/conversations\/[^/]+$/.test(e)) && ["Conversation unavailable", "Integration mismatch", "Embedded origin mismatch"].includes(A))
4757
4757
  throw new b("Conversation unavailable", "conversation_access_denied");
4758
- if (r === "conversations" && e.endsWith("/snapshot") && S.status === 409 && E === "Display projection is not enabled")
4758
+ if (r === "conversations" && e.endsWith("/snapshot") && S.status === 409 && A === "Display projection is not enabled")
4759
4759
  throw new b("Conversation history is unavailable. Try loading this chat again after the service is ready.", "display_projection_disabled");
4760
- if (r === "conversations" && e === "/commands" && (S.status === 409 && E?.code === "executor_not_ready" && E.retryable === !0 || S.status === 403 && E === "Register the executor before commands"))
4760
+ if (r === "conversations" && e === "/commands" && (S.status === 409 && A?.code === "executor_not_ready" && A.retryable === !0 || S.status === 403 && A === "Register the executor before commands"))
4761
4761
  throw new b("Reconnecting the browser before continuing.", "executor_not_ready");
4762
- if (S.status !== 401 && E && typeof E == "object" && (["service_origin_not_allowed", "security_control_enforcement_unavailable"].includes(E.code) || !nt(void 0, E.code).allowed) && typeof E.message == "string")
4763
- throw new b(E.message, E.code, !1, {
4764
- ...typeof E.blockedOrigin == "string" ? { blockedOrigin: E.blockedOrigin } : {},
4765
- ...typeof E.securitySettingsUrl == "string" ? { securitySettingsUrl: E.securitySettingsUrl } : {}
4762
+ if (S.status !== 401 && A && typeof A == "object" && (["service_origin_not_allowed", "security_control_enforcement_unavailable"].includes(A.code) || !nt(void 0, A.code).allowed) && typeof A.message == "string")
4763
+ throw new b(A.message, A.code, !1, {
4764
+ ...typeof A.blockedOrigin == "string" ? { blockedOrigin: A.blockedOrigin } : {},
4765
+ ...typeof A.securitySettingsUrl == "string" ? { securitySettingsUrl: A.securitySettingsUrl } : {}
4766
4766
  }, r === "conversations" && e === "/commands");
4767
- const F = E === "Token expired" ? "token_expired" : E === "Invalid token" ? "invalid_token" : E?.reason, y = S.status === 401 && ["missing_token", "token_expired", "invalid_token", "user_not_found"].includes(F) ? { requestId: _, authTransport: "http", authEndpoint: `${r ?? (d ? "embed" : "runtime")}:${["snapshot", "me", "bootstrap", "commands", "activity", "session-history"].includes(e.split("/").pop()) ? e.split("/").pop() : "other"}`, reason: F, retryable: F === "token_expired" && (E === "Token expired" || E.retryable === !0) } : void 0;
4768
- throw new b(S.status === 401 ? "Your session expired or is invalid. Reconnect to continue." : S.status === 403 ? "You don't have access to this conversation. Check your access and reconnect." : `Product Agent request failed (${S.status})`, k, !1, y);
4767
+ const y = A === "Token expired" ? "token_expired" : A === "Invalid token" ? "invalid_token" : A?.reason, T = S.status === 401 && ["missing_token", "token_expired", "invalid_token", "user_not_found"].includes(y) ? { requestId: _, authTransport: "http", authEndpoint: `${r ?? (d ? "embed" : "runtime")}:${["snapshot", "me", "bootstrap", "commands", "activity", "session-history"].includes(e.split("/").pop()) ? e.split("/").pop() : "other"}`, reason: y, retryable: y === "token_expired" && (A === "Token expired" || A.retryable === !0) } : void 0;
4768
+ throw new b(S.status === 401 ? "Your session expired or is invalid. Reconnect to continue." : S.status === 403 ? "You don't have access to this conversation. Check your access and reconnect." : `Product Agent request failed (${S.status})`, q, !1, T);
4769
4769
  }
4770
4770
  return await S.json();
4771
4771
  } catch (S) {
4772
- const k = p.trigger ?? ((S instanceof Error || S instanceof DOMException) && S.name === "AbortError" ? "unexpected_abort" : null), E = {
4772
+ const q = p.trigger ?? ((S instanceof Error || S instanceof DOMException) && S.name === "AbortError" ? "unexpected_abort" : null), A = {
4773
4773
  requestId: _,
4774
4774
  method: n ?? (i === void 0 ? "GET" : "POST"),
4775
4775
  route: v ? "/api/product-agent/conversations/:sessionId/snapshot" : e === "/commands" ? "/api/product-agent/:namespace/commands" : "/api/product-agent/:namespace/:operation",
4776
- status: M,
4777
- abortTrigger: k,
4778
- category: k === "deadline" ? "request_timed_out" : k === "unexpected_abort" ? "connection_interrupted" : k ? "request_cancelled" : S instanceof b ? S.code : "invalid_response",
4779
- responseHeadersMs: C === null ? null : Math.max(0, C - A),
4776
+ status: te,
4777
+ abortTrigger: q,
4778
+ category: q === "deadline" ? "request_timed_out" : q === "unexpected_abort" ? "connection_interrupted" : q ? "request_cancelled" : S instanceof b ? S.code : M ? "connection_interrupted" : "invalid_response",
4779
+ responseHeadersMs: C === null ? null : Math.max(0, C - E),
4780
4780
  responseBodyMs: C === null ? null : Math.max(0, Date.now() - C),
4781
- owner: k === "deadline" ? "http_deadline" : k === "transport_disposed" ? "http_transport" : k && k !== "unexpected_abort" ? "conversation_query" : M === null ? "browser" : "http_response",
4782
- elapsedMs: Math.max(0, Date.now() - A),
4781
+ owner: q === "deadline" ? "http_deadline" : q === "transport_disposed" ? "http_transport" : q && q !== "unexpected_abort" ? "conversation_query" : te === null ? "browser" : "http_response",
4782
+ elapsedMs: Math.max(0, Date.now() - E),
4783
4783
  attempt: c,
4784
4784
  queryRequestId: P(a?.queryRequestId),
4785
4785
  ownerId: P(a?.ownerId),
4786
4786
  authorityGeneration: a?.authorityGeneration ?? null,
4787
4787
  sessionId: P(a?.sessionId),
4788
4788
  release: this.auth.extension_version ? `extension-${this.auth.extension_version}` : `sdk-${zi.version}`,
4789
- upstreamRequestId: ie,
4790
- upstreamTraceId: B
4789
+ upstreamRequestId: B,
4790
+ upstreamTraceId: W
4791
4791
  };
4792
- de(E) && Promise.resolve().then(() => this.options.onRequestFailure ? this.options.onRequestFailure(E) : console.warn("Product Agent HTTP request failed", E)).catch(() => {
4792
+ de(A) && Promise.resolve().then(() => this.options.onRequestFailure ? this.options.onRequestFailure(A) : console.warn("Product Agent HTTP request failed", A)).catch(() => {
4793
4793
  });
4794
- const F = de(E) ? { httpRequest: E } : void 0;
4795
- if (k !== null) {
4796
- const y = k !== "deadline" && k !== "unexpected_abort";
4794
+ const y = de(A) ? { httpRequest: A } : void 0;
4795
+ if (q !== null) {
4796
+ const T = q !== "deadline" && q !== "unexpected_abort";
4797
4797
  throw new b(
4798
- y ? "The request was cancelled." : k === "deadline" ? "The request timed out. Please try again." : "The connection was interrupted. Please try again.",
4799
- y ? "request_cancelled" : k === "deadline" ? "request_timed_out" : "connection_interrupted",
4798
+ T ? "The request was cancelled." : q === "deadline" ? "The request timed out. Please try again." : "The connection was interrupted. Please try again.",
4799
+ T ? "request_cancelled" : q === "deadline" ? "request_timed_out" : "connection_interrupted",
4800
4800
  !0,
4801
- F
4801
+ y
4802
4802
  );
4803
4803
  }
4804
- throw S instanceof b && F ? new b(S.message, S.code, S.outcomeUnknown, { ...S.detail, ...F }, S.backendRefusal) : v && F ? new b(
4805
- "The conversation response could not be read. Please try again.",
4804
+ throw S instanceof b && y ? new b(S.message, S.code, S.outcomeUnknown, { ...S.detail, ...y }, S.backendRefusal) : y ? new b(
4805
+ M ? "The connection was interrupted. Please try again." : v ? "The conversation response could not be read. Please try again." : "The response could not be read. Please try again.",
4806
4806
  "connection_interrupted",
4807
4807
  !0,
4808
- F
4808
+ y
4809
4809
  ) : S;
4810
4810
  } finally {
4811
4811
  clearTimeout(I), this.requests.signal.removeEventListener("abort", m), o?.removeEventListener("abort", g);
@@ -4856,12 +4856,12 @@ function Ue(s) {
4856
4856
  return s.status === "error" && s.consecutiveFailures < 10 && e !== null && !["unauthorized", "401", "403", "authority_retired"].includes(e.code) && (e.retryable || /^5\d\d$/.test(e.code) || ["runtime_error", "connection_interrupted", "request_timed_out", "408", "429"].includes(e.code));
4857
4857
  }
4858
4858
  const xt = { activeIntervalMs: 3e3, idleIntervalMs: 15e3, maxFailureIntervalMs: 3e4 };
4859
- function W(s) {
4859
+ function K(s) {
4860
4860
  const e = s.currentAuthority();
4861
4861
  return e.authorityId === s.authority.authorityId && e.generation === s.authority.generation;
4862
4862
  }
4863
4863
  function Me(s, e) {
4864
- if (!W(s) || e.authorityId !== s.authority.authorityId || e.generation !== s.authority.generation)
4864
+ if (!K(s) || e.authorityId !== s.authority.authorityId || e.generation !== s.authority.generation)
4865
4865
  throw new Error("Directory authority is no longer current.");
4866
4866
  }
4867
4867
  function ge(s) {
@@ -4908,7 +4908,7 @@ function qo(s) {
4908
4908
  o = await s.http.request("/conversations", r, void 0, "GET", e);
4909
4909
  return Me(s, i), { ...o, updatedAt: s.now() };
4910
4910
  } catch (n) {
4911
- throw W({ authority: i, currentAuthority: s.currentAuthority }) && s.onError?.(n), n;
4911
+ throw K({ authority: i, currentAuthority: s.currentAuthority }) && s.onError?.(n), n;
4912
4912
  }
4913
4913
  },
4914
4914
  "directory.mutate": (i) => {
@@ -4919,7 +4919,7 @@ function qo(s) {
4919
4919
  const a = await s.http.request(`/conversations/${encodeURIComponent(i.sessionId)}`, {}, i.patch, "PATCH", e);
4920
4920
  return Me(s, i), a;
4921
4921
  } catch (a) {
4922
- throw W({ authority: i, currentAuthority: s.currentAuthority }) && s.onError?.(a), a;
4922
+ throw K({ authority: i, currentAuthority: s.currentAuthority }) && s.onError?.(a), a;
4923
4923
  }
4924
4924
  });
4925
4925
  t.set(i.sessionId, r);
@@ -4945,7 +4945,7 @@ class Co {
4945
4945
  disposed = !1;
4946
4946
  boundary;
4947
4947
  reconcile() {
4948
- const e = this.options.runtime.engine.getProjection().directory.intents, t = !this.disposed && W(this.boundary) && (this.options.enabled?.() ?? !0);
4948
+ const e = this.options.runtime.engine.getProjection().directory.intents, t = !this.disposed && K(this.boundary) && (this.options.enabled?.() ?? !0);
4949
4949
  for (const [n, r] of this.observations)
4950
4950
  t && e[n]?.observe || (r.metadata.stop(), r.recovery?.transcript.stop(), r.recovery?.activity.stop(), this.observations.delete(n), this.options.socket?.release(n, this.owner).catch((o) => this.report(o)));
4951
4951
  if (t) for (const [n, r] of Object.entries(e)) {
@@ -4997,14 +4997,14 @@ class Co {
4997
4997
  this.observations.size ? this.options.wakeup.start() : this.options.wakeup.stop();
4998
4998
  }
4999
4999
  metadata(e) {
5000
- if (this.disposed || !W(this.boundary) || !this.observations.has(e.conversation_id)) return;
5000
+ if (this.disposed || !K(this.boundary) || !this.observations.has(e.conversation_id)) return;
5001
5001
  const t = this.options.runtime.engine.getState().slices.directory.metadataRevision;
5002
5002
  if (this.options.runtime.engine.accept({ ...this.options.authority, type: "directory.metadata_received", metadata: e }), this.options.runtime.engine.getState().slices.directory.metadataRevision !== t)
5003
5003
  for (const n of this.observedQueryStates())
5004
5004
  n.invalidated && this.refreshObservedQuery(n.query).catch((r) => this.report(r));
5005
5005
  }
5006
5006
  open(e, t = "replace", i) {
5007
- if (this.disposed || !W(this.boundary)) return Promise.resolve();
5007
+ if (this.disposed || !K(this.boundary)) return Promise.resolve();
5008
5008
  e = ge(e);
5009
5009
  const n = x(e);
5010
5010
  return t === "replace" && this.options.runtime.engine.getState().slices.directory.queries[n]?.requestId ? (this.refreshAfterRequest.add(n), Promise.resolve()) : (this.requestPage(e, t, i).catch((r) => this.report(r)), Promise.resolve());
@@ -5025,9 +5025,9 @@ class Co {
5025
5025
  }), r;
5026
5026
  }
5027
5027
  async readPage(e, t, i, n = !1) {
5028
- for (; !this.disposed && W(this.boundary) && this.options.runtime.engine.getState().slices.directory.queries[x(e)]?.requestId; )
5028
+ for (; !this.disposed && K(this.boundary) && this.options.runtime.engine.getState().slices.directory.queries[x(e)]?.requestId; )
5029
5029
  await this.waitForQuery(e, !1);
5030
- if (this.disposed || !W(this.boundary)) throw new Error("Directory authority is no longer current.");
5030
+ if (this.disposed || !K(this.boundary)) throw new Error("Directory authority is no longer current.");
5031
5031
  return await this.options.runtime.engine.dispatch({
5032
5032
  ...this.options.authority,
5033
5033
  type: "directory.query",
@@ -5068,26 +5068,26 @@ class Co {
5068
5068
  o?.(), o = null, this.queryWaiters.delete(c);
5069
5069
  }, c = () => {
5070
5070
  const d = this.options.runtime.engine.getState().slices.directory.queries[i];
5071
- return this.disposed || !W(this.boundary) || !d ? (a(), t ? r(new Error("Directory authority is no longer current.")) : n(), !0) : d.requestId !== null ? !1 : (a(), t && d.status === "error" ? r(new Error(d.error?.message ?? "Conversation directory failed")) : n(), !0);
5071
+ return this.disposed || !K(this.boundary) || !d ? (a(), t ? r(new Error("Directory authority is no longer current.")) : n(), !0) : d.requestId !== null ? !1 : (a(), t && d.status === "error" ? r(new Error(d.error?.message ?? "Conversation directory failed")) : n(), !0);
5072
5072
  };
5073
5073
  c() || (this.queryWaiters.add(c), o = this.options.runtime.engine.subscribe(c));
5074
5074
  });
5075
5075
  }
5076
5076
  async focus() {
5077
- this.disposed || !W(this.boundary) || !(this.options.enabled?.() ?? !0) || this.refreshObservedQueries().catch((e) => this.report(e));
5077
+ this.disposed || !K(this.boundary) || !(this.options.enabled?.() ?? !0) || this.refreshObservedQueries().catch((e) => this.report(e));
5078
5078
  }
5079
5079
  observedQueryStates() {
5080
5080
  const e = this.options.runtime.engine.getState().slices.directory.queries;
5081
5081
  return this.options.observedQueries().flatMap((t) => e[x(ge(t))] ?? []);
5082
5082
  }
5083
5083
  isObserved(e) {
5084
- return !this.disposed && W(this.boundary) && (this.options.enabled?.() ?? !0) && this.observedQueryStates().some((t) => x(t.query) === x(e));
5084
+ return !this.disposed && K(this.boundary) && (this.options.enabled?.() ?? !0) && this.observedQueryStates().some((t) => x(t.query) === x(e));
5085
5085
  }
5086
5086
  async refreshObservedQueries() {
5087
5087
  await Promise.all(this.observedQueryStates().map((e) => this.refreshObservedQuery(e.query)));
5088
5088
  }
5089
5089
  async reconnect() {
5090
- if (!(this.disposed || !W(this.boundary) || !(this.options.enabled?.() ?? !0))) {
5090
+ if (!(this.disposed || !K(this.boundary) || !(this.options.enabled?.() ?? !0))) {
5091
5091
  this.reconcile();
5092
5092
  for (const [e, t] of this.observations)
5093
5093
  this.options.socket?.retain(e, this.owner).catch((i) => this.report(i)), t.metadata.refresh(), t.recovery?.transcript.refresh(), t.recovery?.activity.refresh();
@@ -5095,7 +5095,7 @@ class Co {
5095
5095
  }
5096
5096
  }
5097
5097
  report(e) {
5098
- !this.disposed && W(this.boundary) && this.options.onError(e);
5098
+ !this.disposed && K(this.boundary) && this.options.onError(e);
5099
5099
  }
5100
5100
  dispose() {
5101
5101
  this.disposed = !0;
@@ -6390,7 +6390,7 @@ class Zo {
6390
6390
  })
6391
6391
  },
6392
6392
  errorAdapter: (n) => {
6393
- const r = Se(n), o = n !== null && typeof n == "object" && "details" in n ? n.details : void 0, a = o && typeof o == "object" && "httpRequest" in o ? o.httpRequest : void 0;
6393
+ const r = Se(n), o = n !== null && typeof n == "object" ? "details" in n ? n.details : "detail" in n ? n.detail : void 0 : void 0, a = o && typeof o == "object" && "httpRequest" in o ? o.httpRequest : void 0;
6394
6394
  return { ...r, ...de(a) ? { details: { ...r.details, httpRequest: a } } : {} };
6395
6395
  }
6396
6396
  });
@@ -6813,7 +6813,7 @@ class ka {
6813
6813
  if (n && n.version >= t.version) continue;
6814
6814
  if (n && n.payload.kind !== t.payload.kind) throw new Error("Interaction kind changed.");
6815
6815
  const r = n?.payload.kind === "personal_channel" && n.lifecycle === "completed" ? "completed" : t.lifecycle, o = n?.payload.kind === "sharing" && t.payload.kind === "sharing" ? { ...t.payload, variant: n.payload.variant } : t.payload;
6816
- this.sources.set(i, se(J({ ...t, lifecycle: r, payload: o }))), t.payload.kind === "integration_auth" && this.invalidateAuth(t.payload.request_id);
6816
+ this.sources.set(i, ie(J({ ...t, lifecycle: r, payload: o }))), t.payload.kind === "integration_auth" && this.invalidateAuth(t.payload.request_id);
6817
6817
  }
6818
6818
  }
6819
6819
  /** @internal */
@@ -8612,12 +8612,12 @@ class _t {
8612
8612
  return this.clientRuntime.isDisposed ? null : new Promise((g, v) => {
8613
8613
  let w = null, I = null;
8614
8614
  const _ = () => {
8615
- const A = this.clientRuntime.engine.getState().slices.conversation.submissions[r];
8616
- if (!(A && !A.cancelled && A.delivery !== "accepted" && A.delivery !== "failed"))
8617
- if (w?.(), I?.(), A?.delivery === "failed" && !A.cancelled) v(new Error(A.error?.message ?? "Message delivery failed."));
8615
+ const E = this.clientRuntime.engine.getState().slices.conversation.submissions[r];
8616
+ if (!(E && !E.cancelled && E.delivery !== "accepted" && E.delivery !== "failed"))
8617
+ if (w?.(), I?.(), E?.delivery === "failed" && !E.cancelled) v(new Error(E.error?.message ?? "Message delivery failed."));
8618
8618
  else {
8619
- const C = A?.invocation === "user" && A.contextPreparation?.pageContent ? A.context.page?.url : null;
8620
- A?.delivery === "accepted" && !A.cancelled && typeof C == "string" && c === this.submissionIntentRevision && m === this.directoryAuthority && this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId] === f && (this.lastUserMessagePageUrl = C), g(A?.delivery === "accepted" && !A.cancelled ? r : null);
8619
+ const C = E?.invocation === "user" && E.contextPreparation?.pageContent ? E.context.page?.url : null;
8620
+ E?.delivery === "accepted" && !E.cancelled && typeof C == "string" && c === this.submissionIntentRevision && m === this.directoryAuthority && this.clientRuntime.engine.getState().slices.directory.clients[this.modelClientScopeId] === f && (this.lastUserMessagePageUrl = C), g(E?.delivery === "accepted" && !E.cancelled ? r : null);
8621
8621
  }
8622
8622
  };
8623
8623
  w = this.clientRuntime.engine.subscribe(_), I = this.clientRuntime.onDispose(() => {
@@ -9171,7 +9171,7 @@ class _t {
9171
9171
  }
9172
9172
  reportHealthSignal(e, t = {}) {
9173
9173
  const i = this.getState();
9174
- if (t.httpRequest && (!de(t.httpRequest) || t.httpRequest.sessionId !== i.sessionId) || t.historyRefreshFailure && (t.historyRefreshFailure.consecutiveFailures < 3 || t.historyRefreshFailure.sessionId !== i.sessionId) || t.renderedError && t.renderedError.sessionId !== i.sessionId || t.uiInvariant && t.uiInvariant.current.sessionId !== i.sessionId) return;
9174
+ if (t.httpRequest && (!de(t.httpRequest) || t.httpRequest.sessionId !== null && t.httpRequest.sessionId !== i.sessionId) || t.historyRefreshFailure && (t.historyRefreshFailure.consecutiveFailures < 3 || t.historyRefreshFailure.sessionId !== i.sessionId) || t.renderedError && t.renderedError.sessionId !== i.sessionId || t.uiInvariant && t.uiInvariant.current.sessionId !== i.sessionId) return;
9175
9175
  const n = t.historyRefreshFailure?.episodeId ?? (t.renderedError ? `${t.errorFingerprint}:${t.renderedError.itemId}` : void 0) ?? t.errorFingerprint ?? t.clientMessageId ?? (t.previousPhase && t.nextPhase ? `${t.previousPhase}:${t.nextPhase}:${t.reason ?? "unknown"}` : null);
9176
9176
  if (n) {
9177
9177
  const f = `${e}:${n}:${e === "invalid_state_transition" ? t.reason ?? "unknown" : ""}`;
@@ -9940,7 +9940,7 @@ function dc() {
9940
9940
  try {
9941
9941
  const v = p instanceof Request ? p : null, w = yd(p, v), I = Dn(f?.headers ?? v?.headers);
9942
9942
  if (!we(w, I, f?.body)) {
9943
- const A = {
9943
+ const E = {
9944
9944
  requestId: Zt("fetch"),
9945
9945
  url: ae(w, Vt),
9946
9946
  method: (f?.method ?? v?.method ?? "GET").toUpperCase(),
@@ -9951,9 +9951,9 @@ function dc() {
9951
9951
  };
9952
9952
  g.then(
9953
9953
  (C) => {
9954
- vd(C, A, m, e).catch(() => {
9954
+ vd(C, E, m, e).catch(() => {
9955
9955
  e({
9956
- ...A,
9956
+ ...E,
9957
9957
  responseStatus: C.status,
9958
9958
  durationMs: Date.now() - m
9959
9959
  });
@@ -9961,7 +9961,7 @@ function dc() {
9961
9961
  },
9962
9962
  (C) => {
9963
9963
  e({
9964
- ...A,
9964
+ ...E,
9965
9965
  errorText: ae(C instanceof Error ? C.message : String(C)),
9966
9966
  durationMs: Date.now() - m
9967
9967
  });
@@ -10488,61 +10488,61 @@ function Pc(s, e) {
10488
10488
  }, m = (I) => {
10489
10489
  const _ = I.getAttribute("data-testid") || I.getAttribute("data-test") || I.getAttribute("data-qa") || I.getAttribute("data-cy") || "";
10490
10490
  return `${I.tagName.toLowerCase()}|${f(I)}|${_}`;
10491
- }, g = (I, _, A) => {
10492
- const C = (M, ie) => {
10493
- const B = M.tagName.toLowerCase(), S = window.getComputedStyle(M), k = l.has(M);
10494
- if (p >= 1e3 && !k || A.has(M) || r.has(B) || M.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || S.display === "none" || S.visibility === "hidden")
10491
+ }, g = (I, _, E) => {
10492
+ const C = (M, te) => {
10493
+ const B = M.tagName.toLowerCase(), W = window.getComputedStyle(M), S = l.has(M);
10494
+ if (p >= 1e3 && !S || E.has(M) || r.has(B) || M.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || W.display === "none" || W.visibility === "hidden")
10495
10495
  return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
10496
10496
  p += 1;
10497
- const E = f(M), F = Tn(M), y = a.has(E) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(B) || B === "a" && M.hasAttribute("href"), q = Array.from(M.children).filter((T) => T instanceof HTMLElement), O = /* @__PURE__ */ new Map();
10498
- for (const T of q) {
10499
- const U = m(T);
10497
+ const q = f(M), A = Tn(M), y = a.has(q) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(B) || B === "a" && M.hasAttribute("href"), T = Array.from(M.children).filter((k) => k instanceof HTMLElement), O = /* @__PURE__ */ new Map();
10498
+ for (const k of T) {
10499
+ const U = m(k);
10500
10500
  O.set(U, (O.get(U) ?? 0) + 1);
10501
10501
  }
10502
10502
  const L = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
10503
- for (const T of q) {
10504
- const U = m(T), le = ke.get(U) ?? 0;
10505
- ke.set(U, le + 1), (O.get(U) ?? 0) > 8 && le >= 6 && !l.has(T) && L.set(U, (L.get(U) ?? 0) + 1);
10503
+ for (const k of T) {
10504
+ const U = m(k), le = ke.get(U) ?? 0;
10505
+ ke.set(U, le + 1), (O.get(U) ?? 0) > 8 && le >= 6 && !l.has(k) && L.set(U, (L.get(U) ?? 0) + 1);
10506
10506
  }
10507
10507
  const Ke = /* @__PURE__ */ new Map(), zs = /* @__PURE__ */ new Set(), Rt = [], Hs = [];
10508
- for (const T of q) {
10509
- const U = m(T), le = O.get(U) ?? 0, Vs = Ke.get(U) ?? 0;
10510
- if (Ke.set(U, Vs + 1), le > 8 && Vs >= 6 && !l.has(T)) {
10508
+ for (const k of T) {
10509
+ const U = m(k), le = O.get(U) ?? 0, Vs = Ke.get(U) ?? 0;
10510
+ if (Ke.set(U, Vs + 1), le > 8 && Vs >= 6 && !l.has(k)) {
10511
10511
  zs.has(U) || (Rt.push([`… ${L.get(U) ?? 0} similar siblings omitted`]), zs.add(U));
10512
10512
  continue;
10513
10513
  }
10514
- const Gs = C(T, ie);
10514
+ const Gs = C(k, te);
10515
10515
  Hs.push(Gs), Rt.push(Gs.lines);
10516
10516
  }
10517
10517
  const At = [];
10518
10518
  if (M.shadowRoot)
10519
- for (const T of Array.from(M.shadowRoot.children))
10520
- T instanceof HTMLElement && At.push(C(T, ie + 1));
10521
- const We = [...Hs, ...At], Et = F.length > 0 || y || We.some((T) => T.hasUsefulContent), Ks = Ee(
10522
- [F, ...We.map((T) => T.textPreview)].filter(Boolean).join(" ")
10523
- ).slice(0, 180), Hn = M.hasAttribute("contenteditable") && (F.length > 0 || !M.querySelector("[contenteditable]")), Ws = d.some((T) => M.hasAttribute(T)) || !!E || Hn, Tt = (M.getClientRects().length > 0 || S.display === "contents") && (t.has(B) || Ws || k) && (Et || k) && (!n.has(B) || Et || Ws || k), kt = Tt ? 1 : 0, qe = [];
10519
+ for (const k of Array.from(M.shadowRoot.children))
10520
+ k instanceof HTMLElement && At.push(C(k, te + 1));
10521
+ const We = [...Hs, ...At], Et = A.length > 0 || y || We.some((k) => k.hasUsefulContent), Ks = Ee(
10522
+ [A, ...We.map((k) => k.textPreview)].filter(Boolean).join(" ")
10523
+ ).slice(0, 180), Hn = M.hasAttribute("contenteditable") && (A.length > 0 || !M.querySelector("[contenteditable]")), Ws = d.some((k) => M.hasAttribute(k)) || !!q || Hn, Tt = (M.getClientRects().length > 0 || W.display === "contents") && (t.has(B) || Ws || S) && (Et || S) && (!n.has(B) || Et || Ws || S), kt = Tt ? 1 : 0, qe = [];
10524
10524
  if (Tt) {
10525
- const T = We.some((le) => le.containsTextElement), U = i.has(B) && !T ? Ks : F;
10525
+ const k = We.some((le) => le.containsTextElement), U = i.has(B) && !k ? Ks : A;
10526
10526
  qe.push(En(M, c, o, U.slice(0, 180)));
10527
10527
  }
10528
- for (const T of Rt)
10529
- qe.push(...Ze(T, kt));
10530
- const qt = At.flatMap((T) => T.lines);
10528
+ for (const k of Rt)
10529
+ qe.push(...Ze(k, kt));
10530
+ const qt = At.flatMap((k) => k.lines);
10531
10531
  if (qt.length > 0) {
10532
- const T = qt.slice(0, 20);
10533
- qt.length > T.length && T.push("… shadow DOM omitted");
10532
+ const k = qt.slice(0, 20);
10533
+ qt.length > k.length && k.push("… shadow DOM omitted");
10534
10534
  const U = B.includes("tooltip") || B.includes("popper") || B.includes("loader");
10535
- if (ie < 2 && !U) {
10535
+ if (te < 2 && !U) {
10536
10536
  const le = Tt ? "#shadow-root" : `${B} #shadow-root`;
10537
- qe.push(...Ze([le, ...Ze(T, 1)], kt));
10537
+ qe.push(...Ze([le, ...Ze(k, 1)], kt));
10538
10538
  } else
10539
- qe.push(...Ze(T, kt));
10539
+ qe.push(...Ze(k, kt));
10540
10540
  }
10541
10541
  return {
10542
10542
  lines: qe,
10543
10543
  hasUsefulContent: Et,
10544
10544
  textPreview: Ks,
10545
- containsTextElement: i.has(B) || We.some((T) => T.containsTextElement)
10545
+ containsTextElement: i.has(B) || We.some((k) => k.containsTextElement)
10546
10546
  };
10547
10547
  };
10548
10548
  return [`--- ${_} ---`, ...C(I, 0).lines].join(`
@@ -10802,10 +10802,10 @@ function qn(s, e) {
10802
10802
  e
10803
10803
  ),
10804
10804
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10805
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10805
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10806
10806
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10807
10807
  respondsToUserMessageId: ue(n) ?? void 0,
10808
- ...H(n) ? { runId: H(n) } : {},
10808
+ ...z(n) ? { runId: z(n) } : {},
10809
10809
  dataType: "assistant_draft",
10810
10810
  ...n.steered === !0 ? { steered: !0 } : {}
10811
10811
  };
@@ -10819,10 +10819,10 @@ function qn(s, e) {
10819
10819
  e
10820
10820
  ),
10821
10821
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10822
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10822
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10823
10823
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10824
10824
  respondsToUserMessageId: ue(n) ?? void 0,
10825
- ...H(n) ? { runId: H(n) } : {},
10825
+ ...z(n) ? { runId: z(n) } : {},
10826
10826
  attachments: Mn(n.attachments, e),
10827
10827
  ...n.steered === !0 ? { steered: !0 } : {}
10828
10828
  };
@@ -10845,9 +10845,9 @@ function qn(s, e) {
10845
10845
  role: "tool",
10846
10846
  content: "",
10847
10847
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10848
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10848
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10849
10849
  respondsToUserMessageId: ue(n) ?? void 0,
10850
- ...H(n) ? { runId: H(n) } : {},
10850
+ ...z(n) ? { runId: z(n) } : {},
10851
10851
  dataType: "function_call_output",
10852
10852
  toolName: Ds,
10853
10853
  callId: xe(n) ?? void 0,
@@ -10860,9 +10860,9 @@ function qn(s, e) {
10860
10860
  role: "tool",
10861
10861
  content: "",
10862
10862
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10863
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10863
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10864
10864
  respondsToUserMessageId: ue(n) ?? void 0,
10865
- ...H(n) ? { runId: H(n) } : {},
10865
+ ...z(n) ? { runId: z(n) } : {},
10866
10866
  dataType: "scheduled_check_in",
10867
10867
  toolName: wn,
10868
10868
  callId: xe(n) ?? void 0,
@@ -10875,10 +10875,10 @@ function qn(s, e) {
10875
10875
  role: "tool",
10876
10876
  content: `Connect ${a.appName} to continue`,
10877
10877
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10878
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10878
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10879
10879
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10880
10880
  respondsToUserMessageId: ue(n) ?? void 0,
10881
- ...H(n) ? { runId: H(n) } : {},
10881
+ ...z(n) ? { runId: z(n) } : {},
10882
10882
  dataType: "function_call_output",
10883
10883
  toolName: "authenticate_pipedream_app",
10884
10884
  callId: xe(n) ?? void 0,
@@ -10888,10 +10888,10 @@ function qn(s, e) {
10888
10888
  role: "tool",
10889
10889
  content: "Connect WhatsApp to continue",
10890
10890
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10891
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10891
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10892
10892
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10893
10893
  respondsToUserMessageId: ue(n) ?? void 0,
10894
- ...H(n) ? { runId: H(n) } : {},
10894
+ ...z(n) ? { runId: z(n) } : {},
10895
10895
  dataType: "function_call_output",
10896
10896
  toolName: "request_personal_channel_connection",
10897
10897
  callId: xe(n) ?? void 0,
@@ -10903,10 +10903,10 @@ function qn(s, e) {
10903
10903
  role: "tool",
10904
10904
  content: n.type === "mcp_call" ? zc(n) : Vc(n),
10905
10905
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10906
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10906
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10907
10907
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10908
10908
  respondsToUserMessageId: ue(n) ?? void 0,
10909
- ...H(n) ? { runId: H(n) } : {},
10909
+ ...z(n) ? { runId: z(n) } : {},
10910
10910
  dataType: String(n.type),
10911
10911
  toolName: n.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof n.name == "string" ? n.name : void 0,
10912
10912
  callId: xe(n) ?? void 0,
@@ -10917,10 +10917,10 @@ function qn(s, e) {
10917
10917
  role: "system",
10918
10918
  content: Wc(n),
10919
10919
  createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
10920
- ...z(n) !== null ? { displaySequence: z(n) } : {},
10920
+ ...F(n) !== null ? { displaySequence: F(n) } : {},
10921
10921
  ...V(n) !== null ? { causalSequence: V(n) } : {},
10922
10922
  respondsToUserMessageId: ue(n) ?? void 0,
10923
- ...H(n) ? { runId: H(n) } : {},
10923
+ ...z(n) ? { runId: z(n) } : {},
10924
10924
  dataType: String(n.type),
10925
10925
  loading: n.steered !== !0 && n.type === "run_status" && (n.status === "running" || n.status === "retrying"),
10926
10926
  ...n.steered === !0 || n.type === "run_status" && n.status === "steered" ? { steered: !0 } : {},
@@ -11005,7 +11005,7 @@ function xe(s) {
11005
11005
  function V(s) {
11006
11006
  return typeof s.causalSequence == "number" && Number.isSafeInteger(s.causalSequence) ? s.causalSequence : null;
11007
11007
  }
11008
- function z(s) {
11008
+ function F(s) {
11009
11009
  return typeof s.displaySequence == "number" && Number.isSafeInteger(s.displaySequence) ? s.displaySequence : null;
11010
11010
  }
11011
11011
  function Di(s) {
@@ -11305,7 +11305,7 @@ function ue(s) {
11305
11305
  const e = s.respondsToUserMessageId;
11306
11306
  return typeof e == "string" && e ? e : null;
11307
11307
  }
11308
- function H(s) {
11308
+ function z(s) {
11309
11309
  const e = s.runId;
11310
11310
  return typeof e == "string" && e ? e : null;
11311
11311
  }