@pluno/product-agent-web 0.1.311 → 0.1.313

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.
@@ -1,4 +1,4 @@
1
- const Oi = [
1
+ const xi = [
2
2
  { value: "gpt-6-sol", label: "gpt-6-sol", price: "$$" },
3
3
  { value: "gpt-6-luna", label: "gpt-6-luna", price: "$" },
4
4
  { value: "deepseek/deepseek-v4-flash", label: "DeepSeek V4 Flash", price: "$" },
@@ -7,9 +7,9 @@ const Oi = [
7
7
  function Gr(t) {
8
8
  return t.length <= 4 ? { primary: t, more: [] } : { primary: t.slice(0, 3), more: t.slice(3) };
9
9
  }
10
- const xi = Gr(Oi), ns = xi.primary;
11
- xi.more;
12
- const Jr = (t) => Oi.some((e) => e.value === t), xe = (t) => t === "gpt-5.6-sol" || t === "gpt-5.6-terra" || t === "anthropic/claude-sonnet-5" ? "gpt-6-sol" : t === "anthropic/claude-opus-5" ? "anthropic/claude-opus-5.5" : Jr(t) ? t : void 0;
10
+ const Oi = Gr(xi), ns = Oi.primary;
11
+ Oi.more;
12
+ const Jr = (t) => xi.some((e) => e.value === t), Oe = (t) => t === "gpt-5.6-sol" || t === "gpt-5.6-terra" || t === "anthropic/claude-sonnet-5" ? "gpt-6-sol" : t === "anthropic/claude-opus-5" ? "anthropic/claude-opus-5.5" : Jr(t) ? t : void 0;
13
13
  function wt(t, e, s) {
14
14
  t.throwIfAborted();
15
15
  let n, i = () => {
@@ -327,15 +327,15 @@ function eo(t, e) {
327
327
  return s && n >= 0 ? s.slice(0, n + 1) : [e];
328
328
  }
329
329
  function ge(t, e, s) {
330
- const n = t.submissionOrder.map((S) => t.submissions[S]).filter((S) => S.conversationScopeId === s), i = e.selections[s]?.sessionId ?? n.find((S) => !S.cancelled && S.sessionId !== null)?.sessionId ?? null, r = i ? t.sessions[i] : void 0, a = t.submissionOrder.map((S) => t.submissions[S]).filter((S) => i ? S.sessionId === i || S.sessionId === null && S.conversationScopeId === s : S.conversationScopeId === s), o = Object.values(r?.items ?? {}).sort((S, O) => {
331
- const U = fe(S.created_at), H = fe(O.created_at);
332
- return U < H ? -1 : U > H ? 1 : S.id < O.id ? -1 : S.id > O.id ? 1 : 0;
330
+ const n = t.submissionOrder.map((S) => t.submissions[S]).filter((S) => S.conversationScopeId === s), i = e.selections[s]?.sessionId ?? n.find((S) => !S.cancelled && S.sessionId !== null)?.sessionId ?? null, r = i ? t.sessions[i] : void 0, a = t.submissionOrder.map((S) => t.submissions[S]).filter((S) => i ? S.sessionId === i || S.sessionId === null && S.conversationScopeId === s : S.conversationScopeId === s), o = Object.values(r?.items ?? {}).sort((S, x) => {
331
+ const U = fe(S.created_at), H = fe(x.created_at);
332
+ return U < H ? -1 : U > H ? 1 : S.id < x.id ? -1 : S.id > x.id ? 1 : 0;
333
333
  }), c = a.filter((S) => (!S.cancelled || S.conversationScopeId === s && (S.sessionId === null || S.sessionId === i || i === null && S === a[a.length - 1])) && !r?.items[S.userMessageId] && !r?.removedItems[S.userMessageId]), d = {};
334
334
  for (const S of o) {
335
- const O = Dt(S);
336
- if (O === null) continue;
335
+ const x = Dt(S);
336
+ if (x === null) continue;
337
337
  const U = r?.streams[S.id];
338
- d[S.id] = U ? U.state === "open" ? "open" : O < U.revision ? "awaiting_content" : U.state : "open";
338
+ d[S.id] = U ? U.state === "open" ? "open" : x < U.revision ? "awaiting_content" : U.state : "open";
339
339
  }
340
340
  const u = [];
341
341
  for (const S of o)
@@ -343,15 +343,15 @@ function ge(t, e, s) {
343
343
  u.push({ id: S.id, userMessageId: S.id, activityIds: [], outcomeIds: [], collapsed: !1 });
344
344
  else {
345
345
  u.length || u.push({ id: `leading:${S.id}`, userMessageId: null, activityIds: [], outcomeIds: [], collapsed: !1 });
346
- const O = u.length - 1, U = u[O], H = S.type === "commentary" || S.type === "tool_summary" ? "activityIds" : "outcomeIds";
347
- u[O] = { ...U, [H]: [...U[H], S.id] };
346
+ const x = u.length - 1, U = u[x], H = S.type === "commentary" || S.type === "tool_summary" ? "activityIds" : "outcomeIds";
347
+ u[x] = { ...U, [H]: [...U[H], S.id] };
348
348
  }
349
349
  for (const S of c) {
350
- const O = u.findIndex((U) => {
350
+ const x = u.findIndex((U) => {
351
351
  const H = a.find((ct) => ct.userMessageId === U.userMessageId), ze = r?.items[U.userMessageId ?? U.activityIds[0] ?? U.outcomeIds[0]];
352
352
  return (H?.submittedAt ?? (ze ? Date.parse(ze.created_at) : 1 / 0)) > S.submittedAt;
353
353
  });
354
- u.splice(O < 0 ? u.length : O, 0, {
354
+ u.splice(x < 0 ? u.length : x, 0, {
355
355
  id: S.userMessageId,
356
356
  userMessageId: S.userMessageId,
357
357
  activityIds: [],
@@ -361,11 +361,11 @@ function ge(t, e, s) {
361
361
  }
362
362
  const l = r?.execution, h = a.filter((S) => !S.cancelled && S.delivery !== "failed"), p = h.filter((S) => S.delivery !== "accepted" && S.executionVersion === null), m = h.filter((S) => S.delivery === "accepted" && S.executionVersion === null), f = h[h.length - 1], y = p.length > 0, b = f !== void 0 && m.includes(f);
363
363
  let k = y ? "submitting" : b ? "awaiting_execution" : l?.phase ?? "idle";
364
- const R = Object.entries(t.stops).filter(([S]) => S === s || i !== null && e.selections[S]?.sessionId === i).map(([, S]) => S).find((S) => (!a.length || S.userMessageIds.includes(a[a.length - 1].userMessageId) || !y && !b && le(l).some((O) => S.userMessageIds.includes(O))) && (!l || l.version <= S.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(l.phase) || a.some((O) => O.cancelled && O.executionVersion === null && S.userMessageIds.includes(O.userMessageId)))), g = l && ["thinking", "steering", "queued", "stopping"].includes(l.phase) || a.some((S) => S.delivery === "accepted" && S.executionVersion === null && R?.userMessageIds.includes(S.userMessageId));
364
+ const R = Object.entries(t.stops).filter(([S]) => S === s || i !== null && e.selections[S]?.sessionId === i).map(([, S]) => S).find((S) => (!a.length || S.userMessageIds.includes(a[a.length - 1].userMessageId) || !y && !b && le(l).some((x) => S.userMessageIds.includes(x))) && (!l || l.version <= S.executionVersion || ["thinking", "steering", "queued", "stopping"].includes(l.phase) || a.some((x) => x.cancelled && x.executionVersion === null && S.userMessageIds.includes(x.userMessageId)))), g = l && ["thinking", "steering", "queued", "stopping"].includes(l.phase) || a.some((S) => S.delivery === "accepted" && S.executionVersion === null && R?.userMessageIds.includes(S.userMessageId));
365
365
  R && g && !y && (!l || !["thinking", "steering", "queued", "stopping"].includes(l.phase) || le(l).every((S) => R.userMessageIds.includes(S))) && (k = "stopping"), R && !g && !y && a.some((S) => S.cancelled && S.executionVersion === null && R.userMessageIds.includes(S.userMessageId)) && (k = a.some((S) => R.userMessageIds.includes(S.userMessageId) && ["sending", "uncertain"].includes(S.delivery)) ? "stopping" : "stopped");
366
366
  const v = ["thinking", "steering", "queued"].includes(k), I = t.stops[s] ?? R, w = I?.userMessageIds.filter((S) => !["completed", "failed"].includes(r?.executionByUserMessage[S]?.phase ?? "")) ?? [], A = w.some((S) => {
367
- const O = a.find((H) => H.userMessageId === S);
368
- return !Object.values(t.operations).some((H) => H.command.type === "run.stop" && H.command.payload.expectedUserMessageId === S && H.phase === "done") && (O?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(O.delivery) || !!(l && le(l).includes(S) && ["thinking", "steering", "queued", "stopping"].includes(l.phase)));
367
+ const x = a.find((H) => H.userMessageId === S);
368
+ return !Object.values(t.operations).some((H) => H.command.type === "run.stop" && H.command.payload.expectedUserMessageId === S && H.phase === "done") && (x?.executionVersion === null && ["sending", "uncertain", "accepted"].includes(x.delivery) || !!(l && le(l).includes(S) && ["thinking", "steering", "queued", "stopping"].includes(l.phase)));
369
369
  }), _ = l?.user_message_ids ?? [], q = y || b ? f?.userMessageId ?? null : _[_.length - 1] ?? null, E = u.find((S) => S.userMessageId === q), C = v ? [...E?.activityIds ?? []].reverse().find((S) => d[S] === "open") ?? null : null, M = i !== null && !!e.selections[s]?.provisionalId && o.length === 0 && a.length === 0 && // The first persisted idle snapshot already has a positive synchronization version.
370
370
  (!r?.execution || r.execution.phase === "idle" && r.execution.user_message_ids.length === 0) && Object.values(t.operations).some((S) => S.conversationScopeId === s && S.phase === "done" && ["runtime.warmup", "attachment.prepare"].includes(S.command.type) && !S.command.payload.sessionId && S.result?.sessionId === i);
371
371
  return G({
@@ -386,7 +386,7 @@ function ge(t, e, s) {
386
386
  streamStates: d,
387
387
  preparation: r?.preparation ?? null,
388
388
  stop: I ? { ...I, userMessageIds: w, pending: A } : null,
389
- segments: u.map((S, O) => ({ ...S, collapsed: v ? S.userMessageId !== q : O < u.length - 1 || S.activityIds.length > 0 })),
389
+ segments: u.map((S, x) => ({ ...S, collapsed: v ? S.userMessageId !== q : x < u.length - 1 || S.activityIds.length > 0 })),
390
390
  activity: { phase: k, activeItemId: C, userMessageId: q, executionKey: JSON.stringify([...le(l)].sort()) },
391
391
  // Staging transfers the immutable input to the core. Waiting for backend acceptance leaves
392
392
  // the same submitted text in the optimistic transcript and composer during delivery.
@@ -896,9 +896,9 @@ function zs(t, e, s) {
896
896
  const I = { ...n.features.contextObservers }, w = I[g];
897
897
  if (v === null ? delete I[g] : I[g] = ie(o, { kind: "originContext", clientScopeId: g, origin: v, pageUrl: "" }), r({ contextObservers: I }), !w || Object.values(I).includes(w)) return;
898
898
  const A = { ...n.features.queries }, _ = { ...n.features.polls }, q = { ...n.features.contextReads }, E = { ...n.features.originContextQueries }, C = { ...n.features.pending }, M = E[w]?.origin, S = { ...n.features.contextRunOrigins };
899
- for (const [O, U] of Object.entries(S)) U === M && delete S[O];
899
+ for (const [x, U] of Object.entries(S)) U === M && delete S[x];
900
900
  delete A[w], delete _[w], delete q[w], delete E[w];
901
- for (const [O, U] of Object.entries(C)) U.mode === "query" && U.key === w && delete C[O];
901
+ for (const [x, U] of Object.entries(C)) U.mode === "query" && U.key === w && delete C[x];
902
902
  r({ queries: A, polls: _, contextReads: q, originContextQueries: E, contextRunOrigins: S, pending: C });
903
903
  };
904
904
  if (e.type === "stage7.account_fallback") return { state: { ...n, account: {
@@ -1292,7 +1292,7 @@ function zs(t, e, s) {
1292
1292
  for (const [C, M] of Object.entries(n.features.originContextQueries))
1293
1293
  if (M.origin === w) {
1294
1294
  A[C] = { ...A[C], data: I, status: "ready", error: null, requestId: null, updatedAt: e.output.completedAt }, q[C] = { settledAt: e.output.completedAt, failures: 0 }, delete E[C];
1295
- for (const [S, O] of Object.entries(_)) O.mode === "query" && O.key === C && delete _[S];
1295
+ for (const [S, x] of Object.entries(_)) x.mode === "query" && x.key === C && delete _[S];
1296
1296
  ["queued", "pending", "running", "in_progress", "stopping", "cancel_requested"].includes(I.value.status) && (E[C] = { query: { ...M, kind: "originContext", trigger: "poll" }, deadline: n.features.now + 5e3 });
1297
1297
  }
1298
1298
  r({ queries: A, pending: _, contextReads: q, polls: E });
@@ -1527,7 +1527,7 @@ function P(t) {
1527
1527
  function de(t) {
1528
1528
  return t == null ? null : P(t);
1529
1529
  }
1530
- function Oe(t) {
1530
+ function xe(t) {
1531
1531
  if (typeof t != "number" || !Number.isSafeInteger(t) || t < 0) throw new Error("Invalid feature revision.");
1532
1532
  return t;
1533
1533
  }
@@ -1552,23 +1552,23 @@ function Ve(t) {
1552
1552
  return {
1553
1553
  taskNotificationsEnabled: as(e.taskNotificationsEnabled),
1554
1554
  tabGroupingEnabled: as(e.tabGroupingEnabled),
1555
- preferencesVersion: Oe(e.preferencesVersion),
1555
+ preferencesVersion: xe(e.preferencesVersion),
1556
1556
  scribbleStyleEnabled: as(e.scribbleStyleEnabled),
1557
1557
  blockedOrigins: St(e.blockedServiceOrigins),
1558
1558
  personalInstructions: de(e.personalInstructions),
1559
- securityPolicyVersion: Oe(e.securityPolicyVersion)
1559
+ securityPolicyVersion: xe(e.securityPolicyVersion)
1560
1560
  };
1561
1561
  }
1562
1562
  function jt(t) {
1563
1563
  const e = N(t);
1564
- return { eligibleSince: Nt(e.eligibleSince), revision: Oe(e.revision), requestId: de(e.requestId), snoozedUntil: Nt(e.snoozedUntil) };
1564
+ return { eligibleSince: Nt(e.eligibleSince), revision: xe(e.revision), requestId: de(e.requestId), snoozedUntil: Nt(e.snoozedUntil) };
1565
1565
  }
1566
1566
  function ho(t) {
1567
1567
  const e = N(t);
1568
1568
  return { notifications: jt(e.notifications), tab_grouping: jt(e.tabGrouping) };
1569
1569
  }
1570
1570
  function $n(t) {
1571
- const e = N(t), s = N(e.request), n = P(s.category), i = P(s.action), r = { category: n, action: i, promptKey: P(s.promptKey), expectedRevision: Oe(s.expectedRevision) };
1571
+ const e = N(t), s = N(e.request), n = P(s.category), i = P(s.action), r = { category: n, action: i, promptKey: P(s.promptKey), expectedRevision: xe(s.expectedRevision) };
1572
1572
  un(r);
1573
1573
  const a = P(e.outcome);
1574
1574
  if (!["resolved", "snoozed", "suppressed"].includes(a)) throw new Error("Invalid decision outcome.");
@@ -1578,7 +1578,7 @@ function $n(t) {
1578
1578
  if (a === "snoozed" && c === null) throw new Error("Missing decision deadline.");
1579
1579
  return {
1580
1580
  decisionKey: P(e.decisionKey),
1581
- revision: Oe(e.revision),
1581
+ revision: xe(e.revision),
1582
1582
  decidedAt: o,
1583
1583
  request: { ...r, requestId: P(s.requestId) },
1584
1584
  outcome: a,
@@ -1601,11 +1601,11 @@ function po(t) {
1601
1601
  if (s.template === "semantic_interaction") return { ...n, condition: { template: s.template, event: cs(s.event) } };
1602
1602
  if (s.template === "event_sequence") {
1603
1603
  if (!Array.isArray(s.steps)) throw new Error("Invalid proactive sequence.");
1604
- return { ...n, condition: { template: s.template, steps: s.steps.map(cs), withinSeconds: Oe(s.withinSeconds) } };
1604
+ return { ...n, condition: { template: s.template, steps: s.steps.map(cs), withinSeconds: xe(s.withinSeconds) } };
1605
1605
  }
1606
1606
  if (s.template === "page_state_after_event") {
1607
1607
  const i = N(s.state);
1608
- return { ...n, condition: { template: s.template, event: cs(s.event), withinSeconds: Oe(s.withinSeconds), state: {
1608
+ return { ...n, condition: { template: s.template, event: cs(s.event), withinSeconds: xe(s.withinSeconds), state: {
1609
1609
  urlRegex: P(i.urlRegex),
1610
1610
  ...i.textRegex == null ? {} : { textRegex: P(i.textRegex) },
1611
1611
  ...i.roleRegex == null ? {} : { roleRegex: P(i.roleRegex) },
@@ -1987,7 +1987,7 @@ function _o(t, e = null) {
1987
1987
  } : void 0);
1988
1988
  return { ...n, ...o ? { auth: o } : {}, submissionGate: a, usingPaidCreditFallback: e ? t.paidFallbackBySession[e] ?? !1 : !1 };
1989
1989
  }
1990
- const So = "0.1.311", zt = {
1990
+ const So = "0.1.313", zt = {
1991
1991
  version: So
1992
1992
  }, Ki = (t) => t.selectedModel ?? t.historyModel ?? t.defaultModel, ko = (t, e) => t.scopes[e];
1993
1993
  function Ht(t) {
@@ -2899,7 +2899,7 @@ function Q(t, e) {
2899
2899
  }
2900
2900
  };
2901
2901
  }
2902
- function Oo(t) {
2902
+ function xo(t) {
2903
2903
  let e = [], s;
2904
2904
  const n = () => {
2905
2905
  clearTimeout(s), s = void 0;
@@ -2911,7 +2911,7 @@ function Oo(t) {
2911
2911
  ot(i) && (JSON.stringify([...e, i]).length > 2800 && n(), e.push(i), e.length === 8 ? n() : s ??= setTimeout(n, 250));
2912
2912
  };
2913
2913
  }
2914
- function xo(t) {
2914
+ function Oo(t) {
2915
2915
  let e = Promise.resolve(), s = null, n = null;
2916
2916
  const i = () => n ??= t.read().catch((a) => {
2917
2917
  throw n = null, a;
@@ -4417,7 +4417,7 @@ function Et(t, e) {
4417
4417
  return !0;
4418
4418
  return !1;
4419
4419
  }
4420
- function Oa(t) {
4420
+ function xa(t) {
4421
4421
  const e = [], s = t.data, n = t;
4422
4422
  return n.data = Tt(s, e), n.attachments = e.length, { packet: n, buffers: e };
4423
4423
  }
@@ -4442,7 +4442,7 @@ function Tt(t, e, s) {
4442
4442
  }
4443
4443
  return t;
4444
4444
  }
4445
- function xa(t, e) {
4445
+ function Oa(t, e) {
4446
4446
  return t.data = tn(t.data, e), delete t.attachments, t;
4447
4447
  }
4448
4448
  function tn(t, e) {
@@ -4474,10 +4474,10 @@ const Pa = [
4474
4474
  "removeListener"
4475
4475
  // used by the Node.js EventEmitter
4476
4476
  ];
4477
- var x;
4477
+ var O;
4478
4478
  (function(t) {
4479
4479
  t[t.CONNECT = 0] = "CONNECT", t[t.DISCONNECT = 1] = "DISCONNECT", t[t.EVENT = 2] = "EVENT", t[t.ACK = 3] = "ACK", t[t.CONNECT_ERROR = 4] = "CONNECT_ERROR", t[t.BINARY_EVENT = 5] = "BINARY_EVENT", t[t.BINARY_ACK = 6] = "BINARY_ACK";
4480
- })(x || (x = {}));
4480
+ })(O || (O = {}));
4481
4481
  class Da {
4482
4482
  /**
4483
4483
  * Encoder constructor
@@ -4494,8 +4494,8 @@ class Da {
4494
4494
  * @param {Object} obj - packet object
4495
4495
  */
4496
4496
  encode(e) {
4497
- return (e.type === x.EVENT || e.type === x.ACK) && Et(e) ? this.encodeAsBinary({
4498
- type: e.type === x.EVENT ? x.BINARY_EVENT : x.BINARY_ACK,
4497
+ return (e.type === O.EVENT || e.type === O.ACK) && Et(e) ? this.encodeAsBinary({
4498
+ type: e.type === O.EVENT ? O.BINARY_EVENT : O.BINARY_ACK,
4499
4499
  nsp: e.nsp,
4500
4500
  data: e.data,
4501
4501
  id: e.id
@@ -4506,7 +4506,7 @@ class Da {
4506
4506
  */
4507
4507
  encodeAsString(e) {
4508
4508
  let s = "" + e.type;
4509
- return (e.type === x.BINARY_EVENT || e.type === x.BINARY_ACK) && (s += e.attachments + "-"), e.nsp && e.nsp !== "/" && (s += e.nsp + ","), e.id != null && (s += e.id), e.data != null && (s += JSON.stringify(e.data, this.replacer)), s;
4509
+ return (e.type === O.BINARY_EVENT || e.type === O.BINARY_ACK) && (s += e.attachments + "-"), e.nsp && e.nsp !== "/" && (s += e.nsp + ","), e.id != null && (s += e.id), e.data != null && (s += JSON.stringify(e.data, this.replacer)), s;
4510
4510
  }
4511
4511
  /**
4512
4512
  * Encode packet as 'buffer sequence' by removing blobs, and
@@ -4514,7 +4514,7 @@ class Da {
4514
4514
  * a list of buffers.
4515
4515
  */
4516
4516
  encodeAsBinary(e) {
4517
- const s = Oa(e), n = this.encodeAsString(s.packet), i = s.buffers;
4517
+ const s = xa(e), n = this.encodeAsString(s.packet), i = s.buffers;
4518
4518
  return i.unshift(n), i;
4519
4519
  }
4520
4520
  }
@@ -4539,8 +4539,8 @@ class wn extends F {
4539
4539
  if (this.reconstructor)
4540
4540
  throw new Error("got plaintext data when reconstructing a packet");
4541
4541
  s = this.decodeString(e);
4542
- const n = s.type === x.BINARY_EVENT;
4543
- n || s.type === x.BINARY_ACK ? (s.type = n ? x.EVENT : x.ACK, this.reconstructor = new Ua(s)) : super.emitReserved("decoded", s);
4542
+ const n = s.type === O.BINARY_EVENT;
4543
+ n || s.type === O.BINARY_ACK ? (s.type = n ? O.EVENT : O.ACK, this.reconstructor = new Ua(s)) : super.emitReserved("decoded", s);
4544
4544
  } else if (In(e) || e.base64)
4545
4545
  if (this.reconstructor)
4546
4546
  s = this.reconstructor.takeBinaryData(e), s && (this.reconstructor = null, super.emitReserved("decoded", s));
@@ -4560,9 +4560,9 @@ class wn extends F {
4560
4560
  const n = {
4561
4561
  type: Number(e.charAt(0))
4562
4562
  };
4563
- if (x[n.type] === void 0)
4563
+ if (O[n.type] === void 0)
4564
4564
  throw new Error("unknown packet type " + n.type);
4565
- if (n.type === x.BINARY_EVENT || n.type === x.BINARY_ACK) {
4565
+ if (n.type === O.BINARY_EVENT || n.type === O.BINARY_ACK) {
4566
4566
  const r = s + 1;
4567
4567
  for (; e.charAt(++s) !== "-" && s != e.length; )
4568
4568
  ;
@@ -4615,17 +4615,17 @@ class wn extends F {
4615
4615
  }
4616
4616
  static isPayloadValid(e, s) {
4617
4617
  switch (e) {
4618
- case x.CONNECT:
4618
+ case O.CONNECT:
4619
4619
  return Yn(s);
4620
- case x.DISCONNECT:
4620
+ case O.DISCONNECT:
4621
4621
  return s === void 0;
4622
- case x.CONNECT_ERROR:
4622
+ case O.CONNECT_ERROR:
4623
4623
  return typeof s == "string" || Yn(s);
4624
- case x.EVENT:
4625
- case x.BINARY_EVENT:
4624
+ case O.EVENT:
4625
+ case O.BINARY_EVENT:
4626
4626
  return Array.isArray(s) && (typeof s[0] == "number" || typeof s[0] == "string" && Pa.indexOf(s[0]) === -1);
4627
- case x.ACK:
4628
- case x.BINARY_ACK:
4627
+ case O.ACK:
4628
+ case O.BINARY_ACK:
4629
4629
  return Array.isArray(s);
4630
4630
  }
4631
4631
  }
@@ -4650,7 +4650,7 @@ class Ua {
4650
4650
  */
4651
4651
  takeBinaryData(e) {
4652
4652
  if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
4653
- const s = xa(this.reconPack, this.buffers);
4653
+ const s = Oa(this.reconPack, this.buffers);
4654
4654
  return this.finishedReconstruction(), s;
4655
4655
  }
4656
4656
  return null;
@@ -4673,7 +4673,7 @@ const ja = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4673
4673
  Decoder: wn,
4674
4674
  Encoder: Da,
4675
4675
  get PacketType() {
4676
- return x;
4676
+ return O;
4677
4677
  }
4678
4678
  }, Symbol.toStringTag, { value: "Module" }));
4679
4679
  function ce(t, e, s) {
@@ -4811,7 +4811,7 @@ class ur extends F {
4811
4811
  if (s.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
4812
4812
  return this._addToQueue(s), this;
4813
4813
  const a = {
4814
- type: x.EVENT,
4814
+ type: O.EVENT,
4815
4815
  data: s
4816
4816
  };
4817
4817
  if (a.options = {}, a.options.compress = this.flags.compress !== !1, typeof s[s.length - 1] == "function") {
@@ -4919,7 +4919,7 @@ class ur extends F {
4919
4919
  */
4920
4920
  _sendConnectPacket(e) {
4921
4921
  this.packet({
4922
- type: x.CONNECT,
4922
+ type: O.CONNECT,
4923
4923
  data: this._pid ? Object.assign({ pid: this._pid, offset: this._lastOffset }, e) : e
4924
4924
  });
4925
4925
  }
@@ -4965,21 +4965,21 @@ class ur extends F {
4965
4965
  onpacket(e) {
4966
4966
  if (e.nsp === this.nsp)
4967
4967
  switch (e.type) {
4968
- case x.CONNECT:
4968
+ case O.CONNECT:
4969
4969
  e.data && e.data.sid ? this.onconnect(e.data.sid, e.data.pid) : this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
4970
4970
  break;
4971
- case x.EVENT:
4972
- case x.BINARY_EVENT:
4971
+ case O.EVENT:
4972
+ case O.BINARY_EVENT:
4973
4973
  this.onevent(e);
4974
4974
  break;
4975
- case x.ACK:
4976
- case x.BINARY_ACK:
4975
+ case O.ACK:
4976
+ case O.BINARY_ACK:
4977
4977
  this.onack(e);
4978
4978
  break;
4979
- case x.DISCONNECT:
4979
+ case O.DISCONNECT:
4980
4980
  this.ondisconnect();
4981
4981
  break;
4982
- case x.CONNECT_ERROR:
4982
+ case O.CONNECT_ERROR:
4983
4983
  this.destroy();
4984
4984
  const n = new Error(e.data.message);
4985
4985
  n.data = e.data.data, this.emitReserved("connect_error", n);
@@ -5014,7 +5014,7 @@ class ur extends F {
5014
5014
  let n = !1;
5015
5015
  return function(...i) {
5016
5016
  n || (n = !0, s.packet({
5017
- type: x.ACK,
5017
+ type: O.ACK,
5018
5018
  id: e,
5019
5019
  data: i
5020
5020
  }));
@@ -5083,7 +5083,7 @@ class ur extends F {
5083
5083
  * @return self
5084
5084
  */
5085
5085
  disconnect() {
5086
- return this.connected && this.packet({ type: x.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
5086
+ return this.connected && this.packet({ type: O.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
5087
5087
  }
5088
5088
  /**
5089
5089
  * Alias for {@link disconnect()}.
@@ -6820,8 +6820,8 @@ class hr {
6820
6820
  ...typeof M.blockedOrigin == "string" ? { blockedOrigin: M.blockedOrigin } : {},
6821
6821
  ...typeof M.securitySettingsUrl == "string" ? { securitySettingsUrl: M.securitySettingsUrl } : {}
6822
6822
  }, r === "conversations" && e === "/commands");
6823
- const S = M === "Token expired" ? "token_expired" : M === "Invalid token" ? "invalid_token" : M?.reason, O = E.status === 401 && ["missing_token", "token_expired", "invalid_token", "user_not_found"].includes(S) ? { requestId: g, authTransport: "http", authEndpoint: `${r ?? (d ? "embed" : "runtime")}:${["snapshot", "me", "bootstrap", "commands", "activity", "session-history"].includes(e.split("/").pop()) ? e.split("/").pop() : "other"}`, reason: S, retryable: S === "token_expired" && (M === "Token expired" || M.retryable === !0) } : void 0;
6824
- throw new T(E.status === 401 ? "Your session expired or is invalid. Reconnect to continue." : E.status === 403 ? "You don't have access to this conversation. Check your access and reconnect." : `Product Agent request failed (${E.status})`, C, !1, O);
6823
+ const S = M === "Token expired" ? "token_expired" : M === "Invalid token" ? "invalid_token" : M?.reason, x = E.status === 401 && ["missing_token", "token_expired", "invalid_token", "user_not_found"].includes(S) ? { requestId: g, authTransport: "http", authEndpoint: `${r ?? (d ? "embed" : "runtime")}:${["snapshot", "me", "bootstrap", "commands", "activity", "session-history"].includes(e.split("/").pop()) ? e.split("/").pop() : "other"}`, reason: S, retryable: S === "token_expired" && (M === "Token expired" || M.retryable === !0) } : void 0;
6824
+ throw new T(E.status === 401 ? "Your session expired or is invalid. Reconnect to continue." : E.status === 403 ? "You don't have access to this conversation. Check your access and reconnect." : `Product Agent request failed (${E.status})`, C, !1, x);
6825
6825
  }
6826
6826
  return await E.json();
6827
6827
  } catch (E) {
@@ -6849,10 +6849,10 @@ class hr {
6849
6849
  });
6850
6850
  const S = he(M) ? { httpRequest: M } : void 0;
6851
6851
  if (C !== null) {
6852
- const O = C !== "deadline" && C !== "unexpected_abort";
6852
+ const x = C !== "deadline" && C !== "unexpected_abort";
6853
6853
  throw new T(
6854
- O ? "The request was cancelled." : C === "deadline" ? "The request timed out. Please try again." : "The connection was interrupted. Please try again.",
6855
- O ? "request_cancelled" : C === "deadline" ? "request_timed_out" : "connection_interrupted",
6854
+ x ? "The request was cancelled." : C === "deadline" ? "The request timed out. Please try again." : "The connection was interrupted. Please try again.",
6855
+ x ? "request_cancelled" : C === "deadline" ? "request_timed_out" : "connection_interrupted",
6856
6856
  !0,
6857
6857
  S
6858
6858
  );
@@ -8621,7 +8621,7 @@ function br(t, e, s) {
8621
8621
  };
8622
8622
  }
8623
8623
  const Ir = "suggest_share_on_socials";
8624
- function Oc(t) {
8624
+ function xc(t) {
8625
8625
  let e = t;
8626
8626
  if (typeof t == "string")
8627
8627
  try {
@@ -8629,10 +8629,10 @@ function Oc(t) {
8629
8629
  } catch {
8630
8630
  return null;
8631
8631
  }
8632
- const s = xc(e);
8632
+ const s = Oc(e);
8633
8633
  return s ? typeof s.showSharePrompt == "boolean" ? s.showSharePrompt : s.ok === !0 && typeof s.message == "string" && s.message.includes("social-sharing prompt") ? !0 : null : null;
8634
8634
  }
8635
- function xc(t) {
8635
+ function Oc(t) {
8636
8636
  return t && typeof t == "object" && !Array.isArray(t) ? t : null;
8637
8637
  }
8638
8638
  const Pc = "save_runtime_captured_skill";
@@ -8641,7 +8641,7 @@ function Dc(t) {
8641
8641
  }
8642
8642
  const bs = "pluno.productAgent.transportId", Uc = "pluno.productAgent.transportIdentity", Is = "pluno.productAgent.transportIdentity.event", Nc = 50, jc = globalThis.setTimeout.bind(globalThis);
8643
8643
  let Qe = null;
8644
- const Ot = /* @__PURE__ */ new Set(), ws = /* @__PURE__ */ new Map();
8644
+ const xt = /* @__PURE__ */ new Set(), ws = /* @__PURE__ */ new Map();
8645
8645
  async function Bc(t = wr()) {
8646
8646
  const e = t.randomUUID(), s = t.storage.getItem(bs);
8647
8647
  let n = s ?? t.randomUUID(), i = !1, r = !1;
@@ -8686,24 +8686,24 @@ async function Lc(t = !1) {
8686
8686
  skipStoredIdentityCollisionCheck: t
8687
8687
  }), Qe.then((i) => {
8688
8688
  const r = (a) => {
8689
- a.persisted || (i.release(), Qe = null, Ot.clear(), window.removeEventListener("pagehide", r));
8689
+ a.persisted || (i.release(), Qe = null, xt.clear(), window.removeEventListener("pagehide", r));
8690
8690
  };
8691
8691
  window.addEventListener("pagehide", r);
8692
8692
  }));
8693
8693
  const e = await Qe, s = Fc();
8694
- Ot.add(s);
8694
+ xt.add(s);
8695
8695
  let n = !1;
8696
8696
  return {
8697
8697
  // A stable per-tab base keeps reload routing intact, while slots isolate multiple live SDK instances in one tab.
8698
8698
  transportId: s === 0 ? e.transportId : `${e.transportId}.${s}`,
8699
8699
  release: () => {
8700
- n || (n = !0, Ot.delete(s));
8700
+ n || (n = !0, xt.delete(s));
8701
8701
  }
8702
8702
  };
8703
8703
  }
8704
8704
  function Fc() {
8705
8705
  let t = 0;
8706
- for (; Ot.has(t); )
8706
+ for (; xt.has(t); )
8707
8707
  t += 1;
8708
8708
  return t;
8709
8709
  }
@@ -9920,7 +9920,7 @@ function As(t) {
9920
9920
  const r = (c) => {
9921
9921
  if (!c || typeof c != "object")
9922
9922
  return null;
9923
- const d = c, u = d.data, l = u && typeof u == "object" ? u : {}, h = Or(c);
9923
+ const d = c, u = d.data, l = u && typeof u == "object" ? u : {}, h = xr(c);
9924
9924
  return {
9925
9925
  id: typeof d.id == "string" ? d.id : null,
9926
9926
  streamId: l.type === "message" && l.role === "assistant" && typeof l.id == "string" ? l.id : null,
@@ -9981,7 +9981,7 @@ const ud = "https://app.pluno.ai", hd = 2e4, pd = 1e4, fd = 6e4, gd = 6e4, md =
9981
9981
  ".pdf:application/pdf",
9982
9982
  ".png:image/png",
9983
9983
  ".webp:image/webp"
9984
- ]), gu = ".pdf,.png,.jpg,.jpeg,.webp", kn = 64e3, qs = 4e3, Rn = 30, Sd = 2e3, kd = 1e3, Ar = "Image is too large for model vision input.", Rd = "pluno.productAgent.state.", ln = "pluno.productAgent.pendingEvents.", Gt = "pluno.productAgent.activeToolCalls.", Ad = 100, xt = /* @__PURE__ */ new Set();
9984
+ ]), gu = ".pdf,.png,.jpg,.jpeg,.webp", kn = 64e3, qs = 4e3, Rn = 30, Sd = 2e3, kd = 1e3, Ar = "Image is too large for model vision input.", Rd = "pluno.productAgent.state.", ln = "pluno.productAgent.pendingEvents.", Gt = "pluno.productAgent.activeToolCalls.", Ad = 100, Ot = /* @__PURE__ */ new Set();
9985
9985
  let vt = null;
9986
9986
  function Ed(t, e = Math.random) {
9987
9987
  const s = Math.min(dn, vd * 2 ** t), n = 1 - bi + e() * bi * 2;
@@ -10058,13 +10058,13 @@ class Jt {
10058
10058
  now: () => Date.now(),
10059
10059
  onError: (i) => this.handleDirectoryTransportError(i),
10060
10060
  onPersonalModel: (i) => {
10061
- const r = xe(i);
10061
+ const r = Oe(i);
10062
10062
  this.options.productVariant !== "personal" || !r || (this.lastPersonalModel = r, this.state.sessionId === null && !this.draftModelExplicit && this.draftModel !== r && (this.draftModel = r, this.emit("state", this.getState())));
10063
10063
  }
10064
10064
  }), void 0, $o(async () => {
10065
10065
  if (!this.token || !this.state.user || this.state.status === "closed") throw new Error("Product Agent is not authenticated");
10066
10066
  return this.options.activeUsersLoader ? (await this.options.activeUsersLoader()).count : zo(this.options.backendUrl);
10067
- })), this.draftModel = (e.productVariant === "personal" ? xe(e.model) : e.model) ?? (e.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.modelClientScopeId = Gc(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
10067
+ })), this.draftModel = (e.productVariant === "personal" ? Oe(e.model) : e.model) ?? (e.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.modelClientScopeId = Gc(e.clientId, () => crypto.randomUUID()), this.directoryConversationScopeId = `conversation:${this.modelClientScopeId}`, this.createDirectoryAdapters(), this.clientRuntime.engine.dispatch({
10068
10068
  type: "model.scope_open",
10069
10069
  clientScopeId: this.modelClientScopeId,
10070
10070
  sessionId: null,
@@ -10090,6 +10090,7 @@ class Jt {
10090
10090
  socketAuthTimer = null;
10091
10091
  reconnectAttempts = 0;
10092
10092
  embeddedRecoveryTimer = null;
10093
+ embeddedRecoveryTokenExpired = !1;
10093
10094
  recoveryDiagnosticId = crypto.randomUUID();
10094
10095
  rejectedDiagnosticsToken = null;
10095
10096
  lastRecoveryStage = "token_provider";
@@ -10247,12 +10248,12 @@ class Jt {
10247
10248
  const e = ++this.conversationAdapterGeneration;
10248
10249
  this.conversationObservation?.dispose(), this.conversationUnsubscribe?.();
10249
10250
  const s = this.directoryAuthority, n = () => e === this.conversationAdapterGeneration;
10250
- this.operationTimingReporter = Oo((f) => {
10251
+ this.operationTimingReporter = xo((f) => {
10251
10252
  n() && !this.clientRuntime.isDisposed && this.reportHealthSignal("operation_timing", { timings: f.map((y) => ({ ...y, entrySurface: this.options.entrySurface })) });
10252
10253
  });
10253
10254
  const i = `pa.conversation.delivery:${this.modelClientScopeId}:${s.authorityId}`, r = `${i}:cancellations`;
10254
10255
  this.authenticatedUserId && this.options.restorePersistedState === !1 && sessionStorage.removeItem(r);
10255
- const a = this.authenticatedUserId ? hs(r) : null, o = xo({
10256
+ const a = this.authenticatedUserId ? hs(r) : null, o = Oo({
10256
10257
  authorityId: s.authorityId,
10257
10258
  isCurrent: n,
10258
10259
  read: async () => a ? JSON.parse(a) : null,
@@ -10896,7 +10897,7 @@ class Jt {
10896
10897
  return this.draftModel;
10897
10898
  }
10898
10899
  setModel(e) {
10899
- const s = this.options.productVariant === "personal" ? xe(e) ?? e : e;
10900
+ const s = this.options.productVariant === "personal" ? Oe(e) ?? e : e;
10900
10901
  this.draftModelExplicit = !0, this.draftModel !== s && (this.draftModel = s, this.emit("state", this.getState()));
10901
10902
  }
10902
10903
  retryLastMessage(e) {
@@ -11042,7 +11043,7 @@ class Jt {
11042
11043
  warmupId: this.activeComposerWarmupId,
11043
11044
  page: ae()
11044
11045
  }
11045
- } }), this.activeComposerWarmupId = null, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? this.lastPersonalModel ?? xe(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: null }), this.beginDirectoryProvisional();
11046
+ } }), this.activeComposerWarmupId = null, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? this.lastPersonalModel ?? Oe(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: null }), this.beginDirectoryProvisional();
11046
11047
  }
11047
11048
  listSessions(e = {}) {
11048
11049
  return this.clientRuntime.route("directory", { core: async () => {
@@ -11369,7 +11370,7 @@ class Jt {
11369
11370
  if (Object.values(s.optimisticEntries).some((i) => i.id === e && i.sessionId === null)) return;
11370
11371
  !this.options.keepRunsActiveOnSessionNavigation && this.state.sessionId !== e && this.stopConversation("session_switch"), this.retainNavigatedConversation();
11371
11372
  const n = "conversation:" + this.modelClientScopeId + ":" + z();
11372
- this.directoryConversationScopeId = n, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? xe(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: e }), this.directoryScope.bind(this.modelClientScopeId, this.directoryConversationScopeId, e).then(async () => {
11373
+ this.directoryConversationScopeId = n, this.lastUserMessagePageUrl = null, this.draftModelExplicit = !1, this.draftModel = (this.options.productVariant === "personal" ? Oe(this.options.model) : this.options.model) ?? (this.options.productVariant === "personal" ? ns[0].value : "gpt-6.1-sol"), this.clientRuntime.engine.dispatch({ type: "model.scope_navigate", clientScopeId: this.modelClientScopeId, sessionId: e }), this.directoryScope.bind(this.modelClientScopeId, this.directoryConversationScopeId, e).then(async () => {
11373
11374
  await this.directoryScope.persist(), this.state.sessionId === e && (s.intents[e]?.observe && this.conversationObservation?.refresh(e).catch((i) => this.handleDirectoryTransportError(i)), this.send({ type: "page.upsert", sessionId: e, page: ae(), model: this.getModel() }));
11374
11375
  });
11375
11376
  }
@@ -11815,7 +11816,7 @@ class Jt {
11815
11816
  }
11816
11817
  if ((e.code === "unauthorized" || e.code === "401") && e.reason === "token_expired" && e.retryable === !0 && this.options.tokenProvider) {
11817
11818
  const s = this.socket;
11818
- s instanceof L ? this.refreshDefaultTransportCredentials(s) : (this.invalidateProviderToken(), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.setReconnectingState(), this.socket = null, this.scheduleReconnect(), s?.close());
11819
+ s instanceof L ? this.refreshDefaultTransportCredentials(s) : (this.invalidateProviderToken(), this.startEmbeddedRecoveryBudget(!0), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.setReconnectingState(), this.socket = null, this.scheduleReconnect(), s?.close());
11819
11820
  return;
11820
11821
  }
11821
11822
  if (this.options.productVariant === "customer_embedded" && /^4[0-9]{2}$/.test(String(e.code)) && !["401", "408", "425", "429"].includes(String(e.code)) && e.retryable !== !0 && (e.stage === "executor_registration" || e.stage === "socket_admission" || e.stage === "bootstrap")) {
@@ -11842,7 +11843,7 @@ class Jt {
11842
11843
  if (!e || typeof e != "object") return;
11843
11844
  const s = It(e, "id");
11844
11845
  if (!s) return;
11845
- const n = e.metadata, i = n && typeof n == "object" ? n.model : void 0, r = this.options.productVariant === "personal" ? xe(typeof i == "string" ? i : void 0) : i;
11846
+ const n = e.metadata, i = n && typeof n == "object" ? n.model : void 0, r = this.options.productVariant === "personal" ? Oe(typeof i == "string" ? i : void 0) : i;
11846
11847
  this.clientRuntime.engine.accept({
11847
11848
  type: "model.history_received",
11848
11849
  clientScopeId: this.modelClientScopeId,
@@ -11940,7 +11941,7 @@ class Jt {
11940
11941
  if (this.pageLifecycleCleanup)
11941
11942
  return;
11942
11943
  const e = () => {
11943
- xr(this.options.clientId, this.activeBrowserToolCalls.values());
11944
+ Or(this.options.clientId, this.activeBrowserToolCalls.values());
11944
11945
  };
11945
11946
  window.addEventListener("pagehide", e), window.addEventListener("beforeunload", e), this.pageLifecycleCleanup = () => {
11946
11947
  window.removeEventListener("pagehide", e), window.removeEventListener("beforeunload", e);
@@ -11975,10 +11976,14 @@ class Jt {
11975
11976
  });
11976
11977
  }, bd)));
11977
11978
  }
11978
- startEmbeddedRecoveryBudget() {
11979
- if (this.options.productVariant !== "customer_embedded" || this.embeddedRecoveryTimer !== null || this.authenticationFailure) return;
11980
- this.recoveryDiagnosticId = crypto.randomUUID();
11981
- const e = this.authenticatedUserId ? 10 * 6e4 : 12e4;
11979
+ startEmbeddedRecoveryBudget(e = !1) {
11980
+ if (this.options.productVariant !== "customer_embedded" || this.authenticationFailure) return;
11981
+ if (this.embeddedRecoveryTimer !== null) {
11982
+ if (!e || this.embeddedRecoveryTokenExpired || !this.authenticatedUserId) return;
11983
+ this.clearEmbeddedRecoveryBudget();
11984
+ }
11985
+ this.embeddedRecoveryTokenExpired = e, this.recoveryDiagnosticId = crypto.randomUUID();
11986
+ const s = this.authenticatedUserId ? (e ? 30 : 10) * 6e4 : 12e4;
11982
11987
  this.embeddedRecoveryTimer = window.setTimeout(() => {
11983
11988
  this.embeddedRecoveryTimer = null, this.connectionAttemptId += 1, this.tokenAbortController?.abort(), this.tokenAbortController = null, this.tokenRequest = null, this.connectionInProgress = !1, this.reportTransportDiagnostic("auth_refresh_failed", {
11984
11989
  stage: this.lastRecoveryStage,
@@ -11989,10 +11994,10 @@ class Jt {
11989
11994
  "connection_failed",
11990
11995
  !1
11991
11996
  ), !0);
11992
- }, e);
11997
+ }, s);
11993
11998
  }
11994
11999
  clearEmbeddedRecoveryBudget() {
11995
- this.embeddedRecoveryTimer !== null && window.clearTimeout(this.embeddedRecoveryTimer), this.embeddedRecoveryTimer = null;
12000
+ this.embeddedRecoveryTimer !== null && window.clearTimeout(this.embeddedRecoveryTimer), this.embeddedRecoveryTimer = null, this.embeddedRecoveryTokenExpired = !1;
11996
12001
  }
11997
12002
  connectionFailureDiagnostic(e, s) {
11998
12003
  const n = e instanceof ue ? e.status : e instanceof T && e.code === "unauthorized" ? 401 : e instanceof T && /^[45][0-9]{2}$/.test(e.code) ? Number(e.code) : void 0, i = n !== void 0 && Number.isInteger(n) && n >= 400 && n <= 599 ? n : void 0, a = !(e instanceof T && ["unauthorized", "403", "update_required", "executor_replaced"].includes(e.code)) && Cs(e) && i !== 401 && i !== 403;
@@ -12096,7 +12101,7 @@ class Jt {
12096
12101
  !1,
12097
12102
  { reason: s ? "invalid_token" : "token_expired" }
12098
12103
  ));
12099
- s && (this.invalidCredentialRecoveryAttempted = !0), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.refreshingDefaultCredentials = !0, this.reportTransportDiagnostic("auth_refresh_started", r), e.pause(), this.setReconnectingState(), this.directoryObservation.reconcile(), this.conversationObservation?.wake();
12104
+ s && (this.invalidCredentialRecoveryAttempted = !0), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.refreshingDefaultCredentials = !0, this.reportTransportDiagnostic("auth_refresh_started", r), e.pause(), this.startEmbeddedRecoveryBudget(r.authReason === "token_expired"), this.setReconnectingState(), this.directoryObservation.reconcile(), this.conversationObservation?.wake();
12100
12105
  let a = "token_provider";
12101
12106
  this.lastRecoveryStage = a;
12102
12107
  const o = (async () => {
@@ -12166,7 +12171,7 @@ class Jt {
12166
12171
  this.listeners[e]?.forEach((i) => i(s));
12167
12172
  }
12168
12173
  }
12169
- const Os = /* @__PURE__ */ new WeakMap();
12174
+ const xs = /* @__PURE__ */ new WeakMap();
12170
12175
  function Er(t) {
12171
12176
  const e = window.__plunoProductAgentNetworkCapture ?? qd();
12172
12177
  return e.subscribers.add(t), () => {
@@ -12225,7 +12230,7 @@ function qd() {
12225
12230
  return y;
12226
12231
  }, o = function(p, m, f, y, b) {
12227
12232
  const k = n.call(this, p, m, f ?? !0, y ?? void 0, b ?? void 0), R = typeof m == "string" ? m : m.toString();
12228
- return Os.set(this, {
12233
+ return xs.set(this, {
12229
12234
  requestId: Ps("xhr"),
12230
12235
  method: String(p ?? "GET").toUpperCase(),
12231
12236
  url: me(R, qs),
@@ -12235,11 +12240,11 @@ function qd() {
12235
12240
  excluded: De(R)
12236
12241
  }), k;
12237
12242
  }, c = function(p, m) {
12238
- const f = i.call(this, p, m), y = Os.get(this);
12243
+ const f = i.call(this, p, m), y = xs.get(this);
12239
12244
  return y && Object.keys(y.requestHeaders).length < Rn && (y.requestHeaders[p] = qn(p, m), y.excluded = y.excluded || De(y.url, y.requestHeaders)), f;
12240
12245
  }, d = function(p) {
12241
12246
  try {
12242
- const m = Os.get(this);
12247
+ const m = xs.get(this);
12243
12248
  m && (m.excluded = m.excluded || De(m.url, m.requestHeaders, p), m.requestBody = Ci(p), m.excluded || this.addEventListener(
12244
12249
  "loadend",
12245
12250
  () => {
@@ -12354,8 +12359,8 @@ function _i(t) {
12354
12359
  const Cd = 5e3, Md = 12e4;
12355
12360
  function Tr() {
12356
12361
  const t = [
12357
- xd(),
12358
- Od()
12362
+ Od(),
12363
+ xd()
12359
12364
  ].filter((e) => typeof e == "function");
12360
12365
  return () => {
12361
12366
  for (const e of t.reverse())
@@ -12368,10 +12373,10 @@ function mu(t) {
12368
12373
  s(), e();
12369
12374
  };
12370
12375
  }
12371
- function Od() {
12376
+ function xd() {
12372
12377
  return br(globalThis, "getPageSnapshot", async () => An());
12373
12378
  }
12374
- function xd() {
12379
+ function Od() {
12375
12380
  return br(globalThis, "pageImages", {
12376
12381
  inspectImage: async (e, s) => await Pd(e, s)
12377
12382
  });
@@ -12586,13 +12591,13 @@ function Kd() {
12586
12591
  };
12587
12592
  }
12588
12593
  function Wd(t) {
12589
- return xt.add(t), vt || (vt = Gd()), () => {
12590
- xt.delete(t), xt.size === 0 && (vt?.(), vt = null);
12594
+ return Ot.add(t), vt || (vt = Gd()), () => {
12595
+ Ot.delete(t), Ot.size === 0 && (vt?.(), vt = null);
12591
12596
  };
12592
12597
  }
12593
12598
  function Gd() {
12594
12599
  const t = () => {
12595
- for (const r of Array.from(xt))
12600
+ for (const r of Array.from(Ot))
12596
12601
  r();
12597
12602
  }, e = window.history.pushState.bind(window.history), s = window.history.replaceState.bind(window.history), n = ((...r) => {
12598
12603
  const a = e(...r);
@@ -12617,9 +12622,9 @@ function An() {
12617
12622
  (f) => qr(f) && !f.parentElement?.closest(n)
12618
12623
  );
12619
12624
  for (const f of i.slice(0, 3))
12620
- s("Active overlay", xs(nt(f), e));
12621
- const r = Jd(), a = r ? xs(nt(r), e) : "";
12622
- s("Main page content", a), s("Additional visible page text", xs(nt(document.body), e));
12625
+ s("Active overlay", Os(nt(f), e));
12626
+ const r = Jd(), a = r ? Os(nt(r), e) : "";
12627
+ s("Main page content", a), s("Additional visible page text", Os(nt(document.body), e));
12623
12628
  const o = t.map(([f, y]) => `${f}:
12624
12629
  ${y}`).join(`
12625
12630
 
@@ -12641,7 +12646,7 @@ function Fe(t) {
12641
12646
 
12642
12647
  `).trim();
12643
12648
  }
12644
- function xs(t, e) {
12649
+ function Os(t, e) {
12645
12650
  let s = Fe(t);
12646
12651
  for (const n of e)
12647
12652
  s = s.replace(n, "");
@@ -12749,18 +12754,18 @@ function Qd(t, e) {
12749
12754
  if (p >= 1e3 && !E || v.has(w) || r.has(_) || w.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || q.display === "none" || q.visibility === "hidden")
12750
12755
  return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
12751
12756
  p += 1;
12752
- const C = m(w), M = Mr(w), S = o.has(C) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(_) || _ === "a" && w.hasAttribute("href"), O = Array.from(w.children).filter((D) => D instanceof HTMLElement), U = /* @__PURE__ */ new Map();
12753
- for (const D of O) {
12757
+ const C = m(w), M = Mr(w), S = o.has(C) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(_) || _ === "a" && w.hasAttribute("href"), x = Array.from(w.children).filter((D) => D instanceof HTMLElement), U = /* @__PURE__ */ new Map();
12758
+ for (const D of x) {
12754
12759
  const $ = f(D);
12755
12760
  U.set($, (U.get($) ?? 0) + 1);
12756
12761
  }
12757
12762
  const H = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map();
12758
- for (const D of O) {
12763
+ for (const D of x) {
12759
12764
  const $ = f(D), be = ze.get($) ?? 0;
12760
12765
  ze.set($, be + 1), (U.get($) ?? 0) > 8 && be >= 6 && !u.has(D) && H.set($, (H.get($) ?? 0) + 1);
12761
12766
  }
12762
12767
  const ct = /* @__PURE__ */ new Map(), Cn = /* @__PURE__ */ new Set(), Xt = [], Mn = [];
12763
- for (const D of O) {
12768
+ for (const D of x) {
12764
12769
  const $ = f(D), be = U.get($) ?? 0, Pn = ct.get($) ?? 0;
12765
12770
  if (ct.set($, Pn + 1), be > 8 && Pn >= 6 && !u.has(D)) {
12766
12771
  Cn.has($) || (Xt.push([`… ${H.get($) ?? 0} similar siblings omitted`]), Cn.add($));
@@ -12773,11 +12778,11 @@ function Qd(t, e) {
12773
12778
  if (w.shadowRoot)
12774
12779
  for (const D of Array.from(w.shadowRoot.children))
12775
12780
  D instanceof HTMLElement && Yt.push(I(D, A + 1));
12776
- const dt = [...Mn, ...Yt], Zt = M.length > 0 || S || dt.some((D) => D.hasUsefulContent), On = Fe(
12781
+ const dt = [...Mn, ...Yt], Zt = M.length > 0 || S || dt.some((D) => D.hasUsefulContent), xn = Fe(
12777
12782
  [M, ...dt.map((D) => D.textPreview)].filter(Boolean).join(" ")
12778
- ).slice(0, 180), Wr = w.hasAttribute("contenteditable") && (M.length > 0 || !w.querySelector("[contenteditable]")), xn = d.some((D) => w.hasAttribute(D)) || !!C || Wr, es = (w.getClientRects().length > 0 || q.display === "contents") && (s.has(_) || xn || E) && (Zt || E) && (!i.has(_) || Zt || xn || E), ts = es ? 1 : 0, He = [];
12783
+ ).slice(0, 180), Wr = w.hasAttribute("contenteditable") && (M.length > 0 || !w.querySelector("[contenteditable]")), On = d.some((D) => w.hasAttribute(D)) || !!C || Wr, es = (w.getClientRects().length > 0 || q.display === "contents") && (s.has(_) || On || E) && (Zt || E) && (!i.has(_) || Zt || On || E), ts = es ? 1 : 0, He = [];
12779
12784
  if (es) {
12780
- const D = dt.some((be) => be.containsTextElement), $ = n.has(_) && !D ? On : M;
12785
+ const D = dt.some((be) => be.containsTextElement), $ = n.has(_) && !D ? xn : M;
12781
12786
  He.push(Cr(w, c, a, $.slice(0, 180)));
12782
12787
  }
12783
12788
  for (const D of Xt)
@@ -12796,7 +12801,7 @@ function Qd(t, e) {
12796
12801
  return {
12797
12802
  lines: He,
12798
12803
  hasUsefulContent: Zt,
12799
- textPreview: On,
12804
+ textPreview: xn,
12800
12805
  containsTextElement: n.has(_) || dt.some((D) => D.containsTextElement)
12801
12806
  };
12802
12807
  };
@@ -13029,10 +13034,10 @@ function Ai(t) {
13029
13034
  }
13030
13035
  function vu(t, e) {
13031
13036
  return Array.isArray(t) ? fl(
13032
- t.map((s) => Or(s, e)).filter((s) => s !== null)
13037
+ t.map((s) => xr(s, e)).filter((s) => s !== null)
13033
13038
  ) : [];
13034
13039
  }
13035
- function Or(t, e) {
13040
+ function xr(t, e) {
13036
13041
  if (!t || typeof t != "object")
13037
13042
  return null;
13038
13043
  const s = t, n = s.data;
@@ -13087,7 +13092,7 @@ function Or(t, e) {
13087
13092
  }), a;
13088
13093
  }
13089
13094
  if (i.type === "function_call_output") {
13090
- const r = Oc(i.output);
13095
+ const r = xc(i.output);
13091
13096
  if (r !== null)
13092
13097
  return {
13093
13098
  id: String(s.id ?? crypto.randomUUID()),
@@ -13349,7 +13354,7 @@ function Sl(t, e) {
13349
13354
  const n = JSON.parse(s), i = typeof n.sessionId == "string" ? n.sessionId : null;
13350
13355
  if (e !== void 0 && i !== e)
13351
13356
  return null;
13352
- const r = Array.isArray(n.messages) ? n.messages.map(xl).filter((a) => !!a) : [];
13357
+ const r = Array.isArray(n.messages) ? n.messages.map(Ol).filter((a) => !!a) : [];
13353
13358
  return {
13354
13359
  sessionId: i,
13355
13360
  messages: r
@@ -13384,7 +13389,7 @@ function Re(t, e) {
13384
13389
  return;
13385
13390
  }
13386
13391
  }
13387
- function xr(t, e) {
13392
+ function Or(t, e) {
13388
13393
  try {
13389
13394
  const s = `${Gt}${t}`, n = location.href, i = location.origin, r = Array.from(e, (a) => ({
13390
13395
  ...a,
@@ -13407,7 +13412,7 @@ function Ti(t, e) {
13407
13412
  } catch {
13408
13413
  return;
13409
13414
  }
13410
- xr(t, e);
13415
+ Or(t, e);
13411
13416
  }
13412
13417
  function Rl(t) {
13413
13418
  try {
@@ -13494,7 +13499,7 @@ function Dr(t, e) {
13494
13499
  } : t;
13495
13500
  }
13496
13501
  function Ur(t) {
13497
- return t.type || Ol(t.name) || "application/octet-stream";
13502
+ return t.type || xl(t.name) || "application/octet-stream";
13498
13503
  }
13499
13504
  function Cl(t) {
13500
13505
  Nr({
@@ -13514,11 +13519,11 @@ function Ml(t) {
13514
13519
  const e = t.trim().toLowerCase(), s = e.lastIndexOf(".");
13515
13520
  return s >= 0 ? e.slice(s) : "";
13516
13521
  }
13517
- function Ol(t) {
13522
+ function xl(t) {
13518
13523
  const e = t.toLowerCase();
13519
13524
  return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
13520
13525
  }
13521
- function xl(t) {
13526
+ function Ol(t) {
13522
13527
  if (!t || typeof t != "object")
13523
13528
  return null;
13524
13529
  const e = t;