@pluno/product-agent-web 0.1.274 → 0.1.275

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.
@@ -37,7 +37,7 @@ function Wp(t, e, n, i) {
37
37
  function Vp(t) {
38
38
  return zr(t) > 0.5 ? [24, 24, 27] : [250, 250, 249];
39
39
  }
40
- const Gp = "0.1.274", ai = {
40
+ const Gp = "0.1.275", ai = {
41
41
  version: Gp
42
42
  }, me = (t) => typeof t == "string" && /^[a-zA-Z0-9:_.-]{1,160}$/.test(t) ? t : null;
43
43
  function qd(t) {
@@ -600,7 +600,7 @@ function at(t) {
600
600
  return JSON.parse(JSON.stringify(t));
601
601
  }
602
602
  function zd(t = "", e = 0) {
603
- return We({ authorityId: t, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, checkpointEffectId: null, checkpointError: null });
603
+ return We({ authorityId: t, generation: e, pendingRestoration: {}, proactiveQuestions: {}, sessions: {}, submissions: {}, submissionOrder: [], stops: {}, requests: {}, requestSequence: 0, deliveries: {}, operations: {}, effectsEnabled: !1, durableSubmissionIds: [], checkpointEffectId: null, checkpointError: null });
604
604
  }
605
605
  function Vr(t) {
606
606
  return {
@@ -684,7 +684,7 @@ function gn(t, e, n) {
684
684
  activity: { phase: S, activeItemId: z, userMessageId: N, executionKey: JSON.stringify([...Tt(u)].sort()) },
685
685
  // Staging transfers the immutable input to the core. Waiting for backend acceptance leaves
686
686
  // the same submitted text in the optimistic transcript and composer during delivery.
687
- receipts: i.filter((E) => !E.cancelled && e.clients[E.clientScopeId] === n).map((E) => ({ viewId: E.viewId, userMessageId: E.userMessageId, acceptedRendererRevision: E.rendererRevision }))
687
+ receipts: i.filter((E) => !E.cancelled && e.clients[E.clientScopeId] === n).map((E) => ({ viewId: E.viewId, userMessageId: E.userMessageId, acceptedRendererRevision: E.rendererRevision, durable: t.durableSubmissionIds.includes(E.userMessageId) || E.delivery === "accepted" }))
688
688
  });
689
689
  }
690
690
  function jd(t, e) {
@@ -2736,7 +2736,7 @@ function oa(t) {
2736
2736
  function Nh(t, e, n, i) {
2737
2737
  let s = t, o = e;
2738
2738
  if (e.type === "effect.completed" || e.type === "effect.failed") {
2739
- e.effectKind === "conversation.checkpoint" && e.effectId === t.checkpointEffectId && (s = { ...s, checkpointEffectId: null, checkpointError: e.type === "effect.failed" ? e.error : null });
2739
+ e.effectKind === "conversation.checkpoint" && e.effectId === t.checkpointEffectId && (s = { ...s, checkpointEffectId: null, checkpointError: e.type === "effect.failed" ? e.error : null }), e.type === "effect.completed" && e.effectKind === "conversation.checkpoint" && e.output && e.output.authorityId === t.authorityId && e.output.generation === t.generation && (s = { ...s, durableSubmissionIds: [.../* @__PURE__ */ new Set([...t.durableSubmissionIds, ...e.output.submissionIds])].filter((h) => !!t.submissions[h]) });
2740
2740
  const d = Object.keys(t.deliveries).find((h) => t.deliveries[h].effectId === e.effectId), u = Object.keys(t.operations).find((h) => t.operations[h].effectId === e.effectId);
2741
2741
  if (d) {
2742
2742
  const h = t.deliveries[d], f = t.submissions[d];
@@ -2841,6 +2841,7 @@ function Nh(t, e, n, i) {
2841
2841
  s = {
2842
2842
  ...t,
2843
2843
  ...b,
2844
+ durableSubmissionIds: [.../* @__PURE__ */ new Set([...t.durableSubmissionIds, ...Object.keys(d.submissions)])],
2844
2845
  pendingRestoration: _,
2845
2846
  requestSequence: Math.max(t.requestSequence, f.requestSequence),
2846
2847
  effectsEnabled: !0,
@@ -3552,7 +3553,7 @@ function tg(t) {
3552
3553
  clearTimeout(u), y(), g();
3553
3554
  });
3554
3555
  },
3555
- "conversation.checkpoint": async (r) => (st(t, r), await n(r.checkpoint, t.saveCancellation(r.checkpoint)).catch((l) => i(l, { operation: "conversation.checkpoint" })), st(t, r), null),
3556
+ "conversation.checkpoint": async (r) => (st(t, r), await n(r.checkpoint, t.saveCancellation(r.checkpoint)).catch((l) => i(l, { operation: "conversation.checkpoint" })), st(t, r), { ...t.authority, submissionIds: Object.keys(r.checkpoint.submissions) }),
3556
3557
  "conversation.receipt": (r) => Xe(t.onTiming, {
3557
3558
  operation: "send",
3558
3559
  layer: "http",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluno/product-agent-web",
3
- "version": "0.1.274",
3
+ "version": "0.1.275",
4
4
  "description": "Browser SDK and default widget for embedding Pluno Product Agent into customer web apps.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",