@pluno/product-agent-web 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/INTEGRATION.md CHANGED
@@ -67,7 +67,7 @@ redaction pipeline before data leaves the browser.
67
67
  type="module"
68
68
  src="https://app.pluno.ai/product-agent/product-agent-widget.js"
69
69
  data-pluno-token-endpoint="/api/pluno-product-agent-token"
70
- data-pluno-launcher-label="Ask AI..."
70
+ data-pluno-launcher-label="Ask for anything..."
71
71
  data-pluno-accent-color="#18181b"
72
72
  data-pluno-color-scheme="light"
73
73
  data-pluno-position="bottom-right"
package/README.md CHANGED
@@ -42,7 +42,7 @@ The SDK always captures product network activity by patching `fetch` and `XMLHtt
42
42
  type="module"
43
43
  src="https://app.pluno.ai/product-agent/product-agent-widget.js"
44
44
  data-pluno-token-endpoint="/api/pluno-product-agent-token"
45
- data-pluno-launcher-label="Ask AI..."
45
+ data-pluno-launcher-label="Ask for anything..."
46
46
  data-pluno-accent-color="#18181b"
47
47
  ></script>
48
48
  ```
@@ -1,11 +1,11 @@
1
- import { PlunoProductAgent as q } from "./product-agent-sdk.js";
1
+ import { PlunoProductAgent as K } from "./product-agent-sdk.js";
2
2
  const L = {
3
- launcherLabel: "Ask AI...",
3
+ launcherLabel: "Ask for anything...",
4
4
  accentColor: "#18181b",
5
5
  colorScheme: "light",
6
6
  position: "bottom-right"
7
7
  };
8
- async function K(e = {}) {
8
+ async function G(e = {}) {
9
9
  const t = {
10
10
  launcherLabel: e.launcherLabel ?? L.launcherLabel,
11
11
  accentColor: e.accentColor ?? L.accentColor,
@@ -31,7 +31,7 @@ async function K(e = {}) {
31
31
  <section class="pluno-pa-widget__panel" hidden>
32
32
  <div class="pluno-pa-widget__timeline-wrap">
33
33
  <main class="pluno-pa-widget__timeline">
34
- <div class="pluno-pa-widget__empty">What can I help you with?</div>
34
+ <div class="pluno-pa-widget__empty">What do you want to do today?</div>
35
35
  </main>
36
36
  <button type="button" class="pluno-pa-widget__new-chat" aria-label="New chat" title="New chat" hidden>
37
37
  <svg viewBox="0 0 24 24" width="17" height="17" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
@@ -42,7 +42,7 @@ async function K(e = {}) {
42
42
  </div>
43
43
  <form class="pluno-pa-widget__composer">
44
44
  <div class="pluno-pa-widget__composer-inner">
45
- <textarea class="pluno-pa-widget__input" rows="1" placeholder="What can I help you with?"></textarea>
45
+ <textarea class="pluno-pa-widget__input" rows="1" placeholder="Ask for anything..."></textarea>
46
46
  <button type="button" class="pluno-pa-widget__send" aria-label="Send">
47
47
  <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
48
48
  <line x1="12" y1="19" x2="12" y2="5" />
@@ -54,35 +54,35 @@ async function K(e = {}) {
54
54
  </section>
55
55
  `, n.appendChild(a);
56
56
  const w = await R(), s = w.ownerDocument;
57
- w.appendChild(o), a.classList.add(`pluno-pa-widget--${t.colorScheme}`), I(n, t.accentColor);
58
- const l = a.querySelector(".pluno-pa-widget__launcher"), d = a.querySelector(".pluno-pa-widget__launcher-input"), r = a.querySelector(".pluno-pa-widget__panel"), c = a.querySelector(".pluno-pa-widget__close"), h = a.querySelector(".pluno-pa-widget__composer"), i = a.querySelector(".pluno-pa-widget__input"), p = a.querySelector(".pluno-pa-widget__send"), g = a.querySelector(".pluno-pa-widget__new-chat"), b = a.querySelector(".pluno-pa-widget__timeline");
59
- if (!l || !d || !r || !c || !h || !i || !p || !g || !b)
57
+ w.appendChild(o), a.classList.add(`pluno-pa-widget--${t.colorScheme}`), F(n, t.accentColor);
58
+ const l = a.querySelector(".pluno-pa-widget__launcher"), d = a.querySelector(".pluno-pa-widget__launcher-input"), r = a.querySelector(".pluno-pa-widget__panel"), u = a.querySelector(".pluno-pa-widget__close"), h = a.querySelector(".pluno-pa-widget__composer"), i = a.querySelector(".pluno-pa-widget__input"), p = a.querySelector(".pluno-pa-widget__send"), g = a.querySelector(".pluno-pa-widget__new-chat"), _ = a.querySelector(".pluno-pa-widget__timeline");
59
+ if (!l || !d || !r || !u || !h || !i || !p || !g || !_)
60
60
  throw new Error("Failed to mount Product Agent widget");
61
- const _ = t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
61
+ const b = t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
62
62
  if (!t.tokenEndpoint)
63
63
  throw new Error("Product Agent widget requires token or tokenEndpoint");
64
- const u = await fetch(t.tokenEndpoint, {
64
+ const c = await fetch(t.tokenEndpoint, {
65
65
  method: "POST",
66
66
  credentials: "include",
67
67
  headers: { "content-type": "application/json" },
68
68
  body: JSON.stringify({ origin: location.origin, url: location.href })
69
69
  });
70
- if (!u.ok)
70
+ if (!c.ok)
71
71
  throw new Error("Failed to load Product Agent token");
72
- const y = await u.json();
72
+ const y = await c.json();
73
73
  if (!y.token)
74
74
  throw new Error("Product Agent token endpoint did not return a token");
75
75
  return y.token;
76
- }), m = await q.init({
76
+ }), m = await K.init({
77
77
  token: t.token,
78
- tokenProvider: _,
78
+ tokenProvider: b,
79
79
  backendUrl: t.backendUrl,
80
80
  webSocketFactory: t.webSocketFactory
81
81
  }), E = J(t), S = new Set(E.openToolGroupKeys);
82
82
  let x = null, z = !1;
83
- const H = () => {
84
- z || typeof document > "u" || (I(n, t.accentColor), o.isConnected || s.body?.appendChild(o));
85
- }, P = new MutationObserver(H);
83
+ const q = () => {
84
+ z || typeof document > "u" || (F(n, t.accentColor), o.isConnected || s.body?.appendChild(o));
85
+ }, P = new MutationObserver(q);
86
86
  P.observe(s.documentElement, { childList: !0, subtree: !0 });
87
87
  const v = () => {
88
88
  Z(t, {
@@ -90,42 +90,42 @@ async function K(e = {}) {
90
90
  composerValue: i.value,
91
91
  openToolGroupKeys: [...S]
92
92
  });
93
- }, k = (u = "", y = !0) => {
94
- if (x !== null && (window.clearTimeout(x), x = null), r.hidden = !1, c.hidden = !1, a.classList.remove("pluno-pa-widget--closing"), !y) {
95
- a.classList.add("pluno-pa-widget--open"), l.hidden = !0, u && (i.value = u, C(i)), i.focus(), i.setSelectionRange(i.value.length, i.value.length), v();
93
+ }, k = (c = "", y = !0) => {
94
+ if (x !== null && (window.clearTimeout(x), x = null), r.hidden = !1, u.hidden = !1, a.classList.remove("pluno-pa-widget--closing"), !y) {
95
+ a.classList.add("pluno-pa-widget--open"), l.hidden = !0, c && (i.value = c, C(i)), i.focus(), i.setSelectionRange(i.value.length, i.value.length), v();
96
96
  return;
97
97
  }
98
98
  window.requestAnimationFrame(() => {
99
- a.classList.add("pluno-pa-widget--open"), u && (i.value = u, C(i)), i.focus(), i.setSelectionRange(i.value.length, i.value.length), v(), x = window.setTimeout(() => {
99
+ a.classList.add("pluno-pa-widget--open"), c && (i.value = c, C(i)), i.focus(), i.setSelectionRange(i.value.length, i.value.length), v(), x = window.setTimeout(() => {
100
100
  l.hidden = !0;
101
101
  }, 220);
102
102
  });
103
103
  }, A = () => {
104
104
  x !== null && (window.clearTimeout(x), x = null), l.hidden = !1, a.classList.add("pluno-pa-widget--closing"), a.classList.remove("pluno-pa-widget--open"), v(), x = window.setTimeout(() => {
105
- r.hidden = !0, c.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
105
+ r.hidden = !0, u.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
106
106
  }, 220);
107
107
  };
108
- l.addEventListener("submit", (u) => {
109
- u.preventDefault(), k(d.value), d.value = "";
108
+ l.addEventListener("submit", (c) => {
109
+ c.preventDefault(), k(d.value), d.value = "";
110
110
  }), d.addEventListener("focus", () => {
111
111
  k(d.value), d.value = "";
112
112
  }), d.addEventListener("input", () => {
113
113
  if (!d.value)
114
114
  return;
115
- const u = d.value;
116
- k(u), d.value = "";
117
- }), c.addEventListener("click", A);
118
- const M = (u) => {
119
- if (!(!u.metaKey || u.key.toLowerCase() !== "k")) {
120
- if (u.preventDefault(), r.hidden || !a.classList.contains("pluno-pa-widget--open")) {
115
+ const c = d.value;
116
+ k(c), d.value = "";
117
+ }), u.addEventListener("click", A);
118
+ const M = (c) => {
119
+ if (!(!c.metaKey || c.key.toLowerCase() !== "k")) {
120
+ if (c.preventDefault(), r.hidden || !a.classList.contains("pluno-pa-widget--open")) {
121
121
  k();
122
122
  return;
123
123
  }
124
124
  A();
125
125
  }
126
126
  };
127
- return s.addEventListener("keydown", M), h.addEventListener("submit", (u) => {
128
- u.preventDefault(), N(m, i);
127
+ return s.addEventListener("keydown", M), h.addEventListener("submit", (c) => {
128
+ c.preventDefault(), N(m, i);
129
129
  }), p.addEventListener("click", () => {
130
130
  if (m.getState().isThinking) {
131
131
  m.stop();
@@ -136,15 +136,15 @@ async function K(e = {}) {
136
136
  m.startNewSession(), S.clear(), i.value = "", C(i), v(), i.focus();
137
137
  }), i.addEventListener("input", () => {
138
138
  C(i), v();
139
- }), i.addEventListener("keydown", (u) => {
140
- u.key !== "Enter" || u.shiftKey || (u.preventDefault(), N(m, i));
139
+ }), i.addEventListener("keydown", (c) => {
140
+ c.key !== "Enter" || c.shiftKey || (c.preventDefault(), N(m, i));
141
141
  }), E.composerValue && (i.value = E.composerValue, C(i)), E.isOpen && k(i.value, !1), m.on(
142
142
  "state",
143
- (u) => $(b, p, g, u, S, v, (y) => {
143
+ (c) => $(_, p, g, c, S, v, (y) => {
144
144
  m.sendMessage(y);
145
145
  })
146
- ), $(b, p, g, m.getState(), S, v, (u) => {
147
- m.sendMessage(u);
146
+ ), $(_, p, g, m.getState(), S, v, (c) => {
147
+ m.sendMessage(c);
148
148
  }), {
149
149
  agent: m,
150
150
  destroy: () => {
@@ -154,11 +154,11 @@ async function K(e = {}) {
154
154
  }
155
155
  function N(e, t) {
156
156
  const o = t.value.trim();
157
- o && (t.value = "", t.style.height = "", t.style.overflowY = "hidden", e.sendMessage(o), t.dispatchEvent(new Event("input", { bubbles: !0 })));
157
+ o && (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o), t.dispatchEvent(new Event("input", { bubbles: !0 })));
158
158
  }
159
159
  function C(e) {
160
160
  e.style.height = "0px";
161
- const t = Math.min(e.scrollHeight, 140);
161
+ const t = Math.max(22, Math.min(e.scrollHeight, 140));
162
162
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
163
163
  }
164
164
  function $(e, t, o, n, a, w, s) {
@@ -167,28 +167,28 @@ function $(e, t, o, n, a, w, s) {
167
167
  const d = l.length > 0 || !!n.assistantDraft;
168
168
  if (o.hidden = !d, l.length === 0 && !n.assistantDraft && !n.lastError) {
169
169
  const p = document.createElement("div");
170
- p.className = "pluno-pa-widget__empty-state";
170
+ p.className = n.starterPrompts.length > 0 ? "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" : "pluno-pa-widget__empty-state";
171
171
  const g = document.createElement("div");
172
- if (g.className = "pluno-pa-widget__empty", g.textContent = "What can I help you with?", p.appendChild(g), n.starterPrompts.length > 0) {
173
- const b = document.createElement("div");
174
- b.className = "pluno-pa-widget__starter-prompts";
175
- for (const _ of n.starterPrompts) {
172
+ if (g.className = "pluno-pa-widget__empty", g.textContent = "What do you want to do today?", p.appendChild(g), n.starterPrompts.length > 0) {
173
+ const _ = document.createElement("div");
174
+ _.className = "pluno-pa-widget__starter-prompts";
175
+ for (const b of n.starterPrompts) {
176
176
  const m = document.createElement("button");
177
- m.type = "button", m.className = "pluno-pa-widget__starter-prompt", m.textContent = _, m.addEventListener("click", () => {
178
- s(_);
179
- }), b.appendChild(m);
177
+ m.type = "button", m.className = "pluno-pa-widget__starter-prompt", m.textContent = `"${b}"`, m.addEventListener("click", () => {
178
+ s(b);
179
+ }), _.appendChild(m);
180
180
  }
181
- p.appendChild(b);
181
+ p.appendChild(_);
182
182
  }
183
183
  e.appendChild(p);
184
184
  return;
185
185
  }
186
- let r = null, c = null, h = [];
186
+ let r = null, u = null, h = [];
187
187
  const i = () => {
188
188
  if (h.length === 0)
189
189
  return;
190
- const p = G(h, a, w);
191
- e.appendChild(p), r = null, c = p, h = [];
190
+ const p = I(h, a, w);
191
+ e.appendChild(p), r = null, u = p, h = [];
192
192
  };
193
193
  for (let p = 0; p < l.length; p += 1) {
194
194
  const g = l[p];
@@ -199,22 +199,22 @@ function $(e, t, o, n, a, w, s) {
199
199
  if (g.role === "system")
200
200
  continue;
201
201
  i();
202
- const b = O(g.content), _ = document.createElement("div");
203
- _.className = `pluno-pa-widget__message pluno-pa-widget__message--${g.role}`, g.role === "assistant" ? B(_, b) : _.textContent = b, _.appendChild(D(b)), e.appendChild(_), r = _, c = null;
202
+ const _ = O(g.content), b = document.createElement("div");
203
+ b.className = `pluno-pa-widget__message pluno-pa-widget__message--${g.role}`, g.role === "assistant" ? B(b, _) : b.textContent = _, b.appendChild(D(_)), e.appendChild(b), r = b, u = null;
204
204
  }
205
205
  if (i(), n.assistantDraft) {
206
206
  const p = O(n.assistantDraft), g = document.createElement("div");
207
- g.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", B(g, p), g.appendChild(D(p)), e.appendChild(g), r = g, c = null;
207
+ g.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", B(g, p), g.appendChild(D(p)), e.appendChild(g), r = g, u = null;
208
208
  }
209
209
  if (n.isThinking && !n.assistantDraft) {
210
210
  const p = document.createElement("div");
211
- p.className = "pluno-pa-widget__status", p.textContent = "Thinking...", e.appendChild(p), r = null, c = p;
211
+ p.className = "pluno-pa-widget__status", p.textContent = "Thinking...", e.appendChild(p), r = null, u = p;
212
212
  }
213
213
  if (n.lastError) {
214
214
  const p = document.createElement("div");
215
- p.className = "pluno-pa-widget__error", p.textContent = n.lastError, e.appendChild(p), r = p, c = null;
215
+ p.className = "pluno-pa-widget__error", p.textContent = n.lastError, e.appendChild(p), r = p, u = null;
216
216
  }
217
- r?.classList.add("pluno-pa-widget__message--bottom-reserve"), c?.classList.add("pluno-pa-widget__bottom-reserve-compact"), e.scrollTop = e.scrollHeight;
217
+ r?.classList.add("pluno-pa-widget__message--bottom-reserve"), u?.classList.add("pluno-pa-widget__bottom-reserve-compact"), e.scrollTop = e.scrollHeight;
218
218
  }
219
219
  function D(e) {
220
220
  const t = document.createElement("button");
@@ -225,7 +225,7 @@ function D(e) {
225
225
  function O(e) {
226
226
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
227
227
  }
228
- function G(e, t, o) {
228
+ function I(e, t, o) {
229
229
  const n = document.createElement("article");
230
230
  n.className = "pluno-pa-widget__tool-group", n.title = new Date(e[e.length - 1].createdAt).toLocaleString();
231
231
  const a = document.createElement("details"), w = U(e);
@@ -238,11 +238,11 @@ function G(e, t, o) {
238
238
  if (d.textContent = e[e.length - 1].content || "Run tool", s.appendChild(d), a.appendChild(s), e.length > 0) {
239
239
  const r = document.createElement("div");
240
240
  r.className = "pluno-pa-widget__tool-lines";
241
- for (const c of e) {
241
+ for (const u of e) {
242
242
  const h = document.createElement("div");
243
- h.className = "pluno-pa-widget__tool-line", c.loading && h.appendChild(j());
243
+ h.className = "pluno-pa-widget__tool-line", u.loading && h.appendChild(j());
244
244
  const i = document.createElement("span");
245
- i.textContent = c.content || "Run tool", h.appendChild(i), r.appendChild(h);
245
+ i.textContent = u.content || "Run tool", h.appendChild(i), r.appendChild(h);
246
246
  }
247
247
  a.appendChild(r);
248
248
  }
@@ -274,9 +274,9 @@ function B(e, t) {
274
274
  for (n += 1; n < o.length && !/^```\s*$/.test(o[n]); )
275
275
  r.push(o[n]), n += 1;
276
276
  n += n < o.length ? 1 : 0;
277
- const c = document.createElement("pre"), h = document.createElement("code");
277
+ const u = document.createElement("pre"), h = document.createElement("code");
278
278
  h.textContent = r.join(`
279
- `), c.appendChild(h), e.appendChild(c);
279
+ `), u.appendChild(h), e.appendChild(u);
280
280
  continue;
281
281
  }
282
282
  const s = a.match(/^(#{1,3})\s+(.+)$/);
@@ -288,8 +288,8 @@ function B(e, t) {
288
288
  if (/^\s*[-*+]\s+/.test(a)) {
289
289
  const r = document.createElement("ul");
290
290
  for (; n < o.length && /^\s*[-*+]\s+/.test(o[n]); ) {
291
- const c = document.createElement("li");
292
- T(c, o[n].replace(/^\s*[-*+]\s+/, "")), r.appendChild(c), n += 1;
291
+ const u = document.createElement("li");
292
+ T(u, o[n].replace(/^\s*[-*+]\s+/, "")), r.appendChild(u), n += 1;
293
293
  }
294
294
  e.appendChild(r);
295
295
  continue;
@@ -297,8 +297,8 @@ function B(e, t) {
297
297
  if (/^\s*\d+\.\s+/.test(a)) {
298
298
  const r = document.createElement("ol");
299
299
  for (; n < o.length && /^\s*\d+\.\s+/.test(o[n]); ) {
300
- const c = document.createElement("li");
301
- T(c, o[n].replace(/^\s*\d+\.\s+/, "")), r.appendChild(c), n += 1;
300
+ const u = document.createElement("li");
301
+ T(u, o[n].replace(/^\s*\d+\.\s+/, "")), r.appendChild(u), n += 1;
302
302
  }
303
303
  e.appendChild(r);
304
304
  continue;
@@ -307,8 +307,8 @@ function B(e, t) {
307
307
  for (n += 1; n < o.length && o[n].trim() && !/^```/.test(o[n]) && !/^(#{1,3})\s+/.test(o[n]) && !/^\s*[-*+]\s+/.test(o[n]) && !/^\s*\d+\.\s+/.test(o[n]); )
308
308
  l.push(o[n]), n += 1;
309
309
  const d = document.createElement("p");
310
- l.forEach((r, c) => {
311
- c > 0 && d.appendChild(document.createElement("br")), T(d, r);
310
+ l.forEach((r, u) => {
311
+ u > 0 && d.appendChild(document.createElement("br")), T(d, r);
312
312
  }), e.appendChild(d);
313
313
  }
314
314
  }
@@ -350,7 +350,7 @@ function Y(e) {
350
350
  return !1;
351
351
  }
352
352
  }
353
- function I(e, t) {
353
+ function F(e, t) {
354
354
  if (e.getElementById("pluno-pa-widget-styles"))
355
355
  return;
356
356
  const o = e.ownerDocument.createElement("style");
@@ -868,6 +868,7 @@ function I(e, t) {
868
868
  font: inherit;
869
869
  font-size: 14px;
870
870
  line-height: 1.45;
871
+ height: 22px;
871
872
  overflow-y: hidden;
872
873
  scrollbar-color: var(--pluno-pa-divider) transparent;
873
874
  scrollbar-width: thin;
@@ -924,32 +925,47 @@ function I(e, t) {
924
925
  justify-items: center;
925
926
  width: 100%;
926
927
  padding: 24px 0;
928
+ text-align: center;
927
929
  }
928
930
  .pluno-pa-widget__empty-state .pluno-pa-widget__empty {
929
931
  margin: 0;
930
932
  padding: 0;
931
933
  }
934
+ .pluno-pa-widget__empty-state--starter {
935
+ margin: auto 0 0;
936
+ gap: 24px;
937
+ justify-items: start;
938
+ padding: 36px 4px 28px;
939
+ text-align: left;
940
+ }
941
+ .pluno-pa-widget__empty-state--starter .pluno-pa-widget__empty {
942
+ color: var(--pluno-pa-text);
943
+ font-size: 24px;
944
+ font-weight: 500;
945
+ line-height: 1.18;
946
+ text-align: left;
947
+ }
932
948
  .pluno-pa-widget__starter-prompts {
933
949
  display: grid;
934
- gap: 8px;
950
+ gap: 18px;
935
951
  width: min(100%, 320px);
936
952
  }
937
953
  .pluno-pa-widget__starter-prompt {
938
- border: 1px solid var(--pluno-pa-border);
939
- border-radius: 16px;
940
- background: var(--pluno-pa-surface);
941
- color: var(--pluno-pa-text);
954
+ border: 0;
955
+ border-radius: 8px;
956
+ background: transparent;
957
+ color: color-mix(in srgb, var(--pluno-pa-text) 72%, transparent);
942
958
  font: inherit;
943
- font-size: 12px;
959
+ font-size: 14px;
944
960
  line-height: 1.45;
945
- padding: 10px 12px;
961
+ padding: 0;
946
962
  text-align: left;
947
963
  cursor: pointer;
948
- transition: border-color 120ms ease, background 120ms ease;
964
+ transition: color 120ms ease, background 120ms ease;
949
965
  }
950
966
  .pluno-pa-widget__starter-prompt:hover {
951
- border-color: rgba(255, 255, 255, 0.18);
952
- background: rgba(255, 255, 255, 0.05);
967
+ color: var(--pluno-pa-text);
968
+ background: transparent;
953
969
  }
954
970
  .pluno-pa-widget__status {
955
971
  display: inline-flex;
@@ -1004,12 +1020,12 @@ function W(e) {
1004
1020
  const t = document.createElement("span");
1005
1021
  return t.textContent = e, t.innerHTML;
1006
1022
  }
1007
- function F(e) {
1023
+ function H(e) {
1008
1024
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
1009
1025
  }
1010
1026
  function J(e) {
1011
1027
  try {
1012
- const t = window.localStorage.getItem(F(e));
1028
+ const t = window.localStorage.getItem(H(e));
1013
1029
  if (!t)
1014
1030
  return { isOpen: !1, composerValue: "", openToolGroupKeys: [] };
1015
1031
  const o = JSON.parse(t);
@@ -1024,13 +1040,13 @@ function J(e) {
1024
1040
  }
1025
1041
  function Z(e, t) {
1026
1042
  try {
1027
- window.localStorage.setItem(F(e), JSON.stringify(t));
1043
+ window.localStorage.setItem(H(e), JSON.stringify(t));
1028
1044
  } catch {
1029
1045
  return;
1030
1046
  }
1031
1047
  }
1032
1048
  const f = document.currentScript;
1033
- f && f.dataset.plunoAutoMount !== "false" && K({
1049
+ f && f.dataset.plunoAutoMount !== "false" && G({
1034
1050
  token: f?.dataset.plunoToken,
1035
1051
  tokenEndpoint: f?.dataset.plunoTokenEndpoint,
1036
1052
  backendUrl: f?.dataset.plunoBackendUrl,
@@ -1042,5 +1058,5 @@ f && f.dataset.plunoAutoMount !== "false" && K({
1042
1058
  console.error("Failed to mount Pluno Product Agent widget", e);
1043
1059
  });
1044
1060
  export {
1045
- K as mountPlunoProductAgentWidget
1061
+ G as mountPlunoProductAgentWidget
1046
1062
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluno/product-agent-web",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",