@pagelines/sdk 1.0.823 → 1.0.824

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.css CHANGED
@@ -1,2 +1,2 @@
1
- .ring-circular{animation:1s linear infinite rotate}.ring-path{will-change:stroke-dasharray;will-change:stroke-dashoffset;stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;animation:2s ease-in-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}@keyframes pl-voice-bar-wave-62c3b75d{0%,to{opacity:.25}50%{opacity:.9}}.pl-voice-bar-wave[data-v-62c3b75d]{animation:1.4s ease-in-out infinite pl-voice-bar-wave-62c3b75d}@media (prefers-reduced-motion:reduce){.pl-voice-bar-wave[data-v-62c3b75d]{opacity:.5;animation:none}}.voice-call-enter-active[data-v-4b08d62d],.voice-call-leave-active[data-v-4b08d62d]{transition:opacity .22s}.voice-call-enter-active .voice-call-card[data-v-4b08d62d],.voice-call-leave-active .voice-call-card[data-v-4b08d62d]{transition:transform .42s cubic-bezier(.25,1,.33,1)}.voice-call-enter-from[data-v-4b08d62d],.voice-call-leave-to[data-v-4b08d62d]{opacity:0}.voice-call-enter-from .voice-call-card[data-v-4b08d62d]{transform:translateY(32px)}.voice-call-leave-to .voice-call-card[data-v-4b08d62d]{transform:translateY(12px)}@media (prefers-reduced-motion:reduce){.voice-call-enter-active[data-v-4b08d62d],.voice-call-leave-active[data-v-4b08d62d],.voice-call-enter-active .voice-call-card[data-v-4b08d62d],.voice-call-leave-active .voice-call-card[data-v-4b08d62d]{transition-duration:1ms}.voice-call-enter-from .voice-call-card[data-v-4b08d62d],.voice-call-leave-to .voice-call-card[data-v-4b08d62d]{transform:none}}.nlist-enter-active,.nlist-leave-active,.nlist-move{transition:all .6s cubic-bezier(.68,-.55,.27,1.55)}.nlist-enter-from{opacity:0;transform:translate(-30px)scale(.9)}.nlist-enter-to{opacity:1;transform:translate(0)scale(1)}.nlist-leave-active{position:absolute}.nlist-leave-to{opacity:0;transform:scale(.9)}.widget-container[data-v-96deba7b]{transition:width .4s cubic-bezier(.32,.72,0,1),height .4s cubic-bezier(.32,.72,0,1),border-radius .4s cubic-bezier(.32,.72,0,1),box-shadow .4s cubic-bezier(.32,.72,0,1)}
1
+ .ring-circular{animation:1s linear infinite rotate}.ring-path{will-change:stroke-dasharray;will-change:stroke-dashoffset;stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;animation:2s ease-in-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}@keyframes pl-voice-bar-wave-d175f3e2{0%,to{opacity:.25}50%{opacity:.9}}.pl-voice-bar-wave[data-v-d175f3e2]{animation:1.4s ease-in-out infinite pl-voice-bar-wave-d175f3e2}@media (prefers-reduced-motion:reduce){.pl-voice-bar-wave[data-v-d175f3e2]{opacity:.5;animation:none}}.voice-call-enter-active[data-v-4b08d62d],.voice-call-leave-active[data-v-4b08d62d]{transition:opacity .22s}.voice-call-enter-active .voice-call-card[data-v-4b08d62d],.voice-call-leave-active .voice-call-card[data-v-4b08d62d]{transition:transform .42s cubic-bezier(.25,1,.33,1)}.voice-call-enter-from[data-v-4b08d62d],.voice-call-leave-to[data-v-4b08d62d]{opacity:0}.voice-call-enter-from .voice-call-card[data-v-4b08d62d]{transform:translateY(32px)}.voice-call-leave-to .voice-call-card[data-v-4b08d62d]{transform:translateY(12px)}@media (prefers-reduced-motion:reduce){.voice-call-enter-active[data-v-4b08d62d],.voice-call-leave-active[data-v-4b08d62d],.voice-call-enter-active .voice-call-card[data-v-4b08d62d],.voice-call-leave-active .voice-call-card[data-v-4b08d62d]{transition-duration:1ms}.voice-call-enter-from .voice-call-card[data-v-4b08d62d],.voice-call-leave-to .voice-call-card[data-v-4b08d62d]{transform:none}}.nlist-enter-active,.nlist-leave-active,.nlist-move{transition:all .6s cubic-bezier(.68,-.55,.27,1.55)}.nlist-enter-from{opacity:0;transform:translate(-30px)scale(.9)}.nlist-enter-to{opacity:1;transform:translate(0)scale(1)}.nlist-leave-active{position:absolute}.nlist-leave-to{opacity:0;transform:scale(.9)}.widget-container[data-v-96deba7b]{transition:width .4s cubic-bezier(.32,.72,0,1),height .4s cubic-bezier(.32,.72,0,1),border-radius .4s cubic-bezier(.32,.72,0,1),box-shadow .4s cubic-bezier(.32,.72,0,1)}
2
2
  /*$vite$:1*/
package/dist/widget.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./rolldown-runtime.js";
2
2
  import { c as e, s as t, t as n } from "./sdkClient.js";
3
- import { d as r, f as i, g as a, i as o, n as s, p as c, t as l, u, v as d } from "./AgentWrap.js";
3
+ import { c as r, h as i, i as a, l as o, n as s, p as c, s as l, t as u, u as d } from "./AgentWrap.js";
4
4
  import { t as f } from "./useWidgetState.js";
5
5
  import { PAGELINES_APP_CONFIG as p, createLogger as m } from "@pagelines/core";
6
6
  import { Fragment as h, computed as g, createApp as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createStaticVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, normalizeClass as E, normalizeStyle as ee, onMounted as te, onUnmounted as ne, openBlock as D, ref as O, shallowRef as k, toDisplayString as A, unref as j, vModelText as re, watch as M, withCtx as N, withDirectives as ie, withKeys as P, withModifiers as ae } from "vue";
@@ -21,35 +21,35 @@ var F = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@lay
21
21
  __name: "ElAuthPanel",
22
22
  props: { sdk: {} },
23
23
  setup(e) {
24
- let t = O(!1), n = O("email"), a = O({
24
+ let t = O(!1), n = O("email"), i = O({
25
25
  email: "",
26
26
  code: ""
27
- }), o = O(!1);
27
+ }), a = O(!1);
28
28
  function signInWithGoogle() {
29
29
  e.sdk.error.value = null, e.sdk.auth.loginWithGoogle({ onError: (t) => {
30
30
  e.sdk.error.value = t;
31
31
  } });
32
32
  }
33
33
  async function sendCode() {
34
- if (!o.value) {
35
- o.value = !0, e.sdk.error.value = null;
34
+ if (!a.value) {
35
+ a.value = !0, e.sdk.error.value = null;
36
36
  try {
37
- await e.sdk.auth.requestAuthCode({ email: a.value.email }) && (n.value = "code");
37
+ await e.sdk.auth.requestAuthCode({ email: i.value.email }) && (n.value = "code");
38
38
  } finally {
39
- o.value = !1;
39
+ a.value = !1;
40
40
  }
41
41
  }
42
42
  }
43
43
  async function verifyCode() {
44
- if (!o.value) {
45
- o.value = !0, e.sdk.error.value = null;
44
+ if (!a.value) {
45
+ a.value = !0, e.sdk.error.value = null;
46
46
  try {
47
47
  await e.sdk.auth.loginWithCode({
48
- email: a.value.email,
49
- code: a.value.code
48
+ email: i.value.email,
49
+ code: i.value.code
50
50
  });
51
51
  } finally {
52
- o.value = !1;
52
+ a.value = !1;
53
53
  }
54
54
  }
55
55
  }
@@ -74,39 +74,39 @@ var F = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@lay
74
74
  onClick: c[0] || (c[0] = (e) => t.value = !0)
75
75
  }, " Use email instead ")])),
76
76
  t.value && n.value === "email" ? (D(), b("div", V, [w(r, {
77
- modelValue: a.value.email,
78
- "onUpdate:modelValue": c[1] || (c[1] = (e) => a.value.email = e),
77
+ modelValue: i.value.email,
78
+ "onUpdate:modelValue": c[1] || (c[1] = (e) => i.value.email = e),
79
79
  "data-test": "auth-email-input",
80
80
  onKeyup: P(sendCode, ["enter"])
81
- }, null, 8, ["modelValue"]), w(i, {
81
+ }, null, 8, ["modelValue"]), w(o, {
82
82
  "data-test": "auth-send-code",
83
83
  theme: "dark",
84
84
  size: "md",
85
85
  class: "w-full",
86
- loading: o.value,
87
- disabled: !a.value.email || o.value,
86
+ loading: a.value,
87
+ disabled: !i.value.email || a.value,
88
88
  onClick: sendCode
89
89
  }, {
90
90
  default: N(() => [...c[6] || (c[6] = [C(" Send verification code ", -1)])]),
91
91
  _: 1
92
92
  }, 8, ["loading", "disabled"])])) : y("", !0),
93
93
  t.value && n.value === "code" ? (D(), b("div", H, [
94
- x("p", U, " Code sent to " + A(a.value.email), 1),
95
- w(u, {
96
- modelValue: a.value.code,
97
- "onUpdate:modelValue": c[2] || (c[2] = (e) => a.value.code = e),
94
+ x("p", U, " Code sent to " + A(i.value.email), 1),
95
+ w(l, {
96
+ modelValue: i.value.code,
97
+ "onUpdate:modelValue": c[2] || (c[2] = (e) => i.value.code = e),
98
98
  length: 6,
99
99
  "focus-first": !0,
100
100
  "data-test": "auth-code-input",
101
101
  onAutoSubmit: verifyCode
102
102
  }, null, 8, ["modelValue"]),
103
- w(i, {
103
+ w(o, {
104
104
  "data-test": "auth-verify-code",
105
105
  theme: "dark",
106
106
  size: "md",
107
107
  class: "w-full",
108
- loading: o.value,
109
- disabled: a.value.code.length !== 6 || o.value,
108
+ loading: a.value,
109
+ disabled: i.value.code.length !== 6 || a.value,
110
110
  onClick: verifyCode
111
111
  }, {
112
112
  default: N(() => [...c[7] || (c[7] = [C(" Verify ", -1)])]),
@@ -221,9 +221,9 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
221
221
  onClose: { type: Function }
222
222
  },
223
223
  setup(t) {
224
- let r = t, i = r.sdk || n.getInstance({ isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1 }), o = k(), c = O(!1), l = O(), u = O(!1), f = g(() => {
224
+ let r = t, a = r.sdk || n.getInstance({ isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1 }), o = k(), l = O(!1), u = O(), d = O(!1), f = g(() => {
225
225
  if (o.value) return o.value;
226
- let e = i.activeUser.value;
226
+ let e = a.activeUser.value;
227
227
  if (!e?.agents?.length) return;
228
228
  let t = e.primaryAgentId;
229
229
  return e.agents.find((e) => e.agentId === t) || e.agents[0];
@@ -233,12 +233,12 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
233
233
  p.value = void 0, m.value = void 0;
234
234
  return;
235
235
  }
236
- let t = new d({ config: f.value });
237
- p.value = t, m.value = new a({
238
- sdk: i,
236
+ let t = new i({ config: f.value });
237
+ p.value = t, m.value = new c({
238
+ sdk: a,
239
239
  agent: t,
240
240
  chatStreamFn: async (t) => {
241
- await i.chat.chatStreamAuthenticated({
241
+ await a.chat.chatStreamAuthenticated({
242
242
  agentId: e,
243
243
  message: t.message,
244
244
  attachments: t.attachments,
@@ -255,23 +255,23 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
255
255
  });
256
256
  }, { immediate: !0 });
257
257
  let h = g(() => deriveOnboardMode({
258
- hasToken: !!i.token.value,
258
+ hasToken: !!a.token.value,
259
259
  hasAgent: !!f.value,
260
- isNewAgent: u.value,
261
- botReady: c.value,
262
- provisionError: l.value
263
- })), _ = g(() => `${e(i.apiBase, i.isDev)}/dashboard`);
260
+ isNewAgent: d.value,
261
+ botReady: l.value,
262
+ provisionError: u.value
263
+ })), _ = g(() => `${e(a.apiBase, a.isDev)}/dashboard`);
264
264
  function onAgentCreated(e) {
265
- o.value = e, l.value = void 0, c.value = !1, u.value = !0;
265
+ o.value = e, u.value = void 0, l.value = !1, d.value = !0;
266
266
  }
267
267
  function onProvisionReady() {
268
- c.value = !0;
268
+ l.value = !0;
269
269
  }
270
270
  function onProvisionError(e) {
271
- l.value = e;
271
+ u.value = e;
272
272
  }
273
273
  function onRetry() {
274
- l.value = void 0, c.value = !1;
274
+ u.value = void 0, l.value = !1;
275
275
  }
276
276
  return (e, t) => (D(), b("div", {
277
277
  class: "size-full flex flex-col bg-theme-0",
@@ -295,16 +295,16 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
295
295
  x("div", ge, [
296
296
  h.value === "auth" ? (D(), v(W, {
297
297
  key: 0,
298
- sdk: j(i)
298
+ sdk: j(a)
299
299
  }, null, 8, ["sdk"])) : y("", !0),
300
300
  h.value === "create" ? (D(), v(se, {
301
301
  key: 1,
302
- sdk: j(i),
302
+ sdk: j(a),
303
303
  onCreated: onAgentCreated
304
304
  }, null, 8, ["sdk"])) : y("", !0),
305
305
  h.value === "provisioning" && f.value ? (D(), v(fe, {
306
306
  key: 2,
307
- sdk: j(i),
307
+ sdk: j(a),
308
308
  "agent-id": f.value.agentId || "",
309
309
  onReady: onProvisionReady,
310
310
  onError: onProvisionError
@@ -316,7 +316,7 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
316
316
  variant: "light",
317
317
  class: "size-full"
318
318
  }, null, 8, ["chat-controller", "agent"])) : y("", !0),
319
- h.value === "error" ? (D(), b("div", _e, [x("div", ve, [x("p", ye, A(l.value), 1), x("button", {
319
+ h.value === "error" ? (D(), b("div", _e, [x("div", ve, [x("p", ye, A(u.value), 1), x("button", {
320
320
  class: "px-6 py-2.5 rounded-lg bg-primary-600 text-white text-sm font-medium hover:bg-primary-500 transition-colors cursor-pointer",
321
321
  onClick: onRetry
322
322
  }, " Try again ")])])) : y("", !0)
@@ -328,7 +328,7 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
328
328
  }, " Go to Dashboard → ", 8, xe)])) : y("", !0)
329
329
  ], 8, pe));
330
330
  }
331
- }), Se = { class: "relative size-16 rounded-full overflow-hidden" }, Ce = ["src", "alt"], X = { class: "flex items-center shrink-0 border-b border-theme-100 px-4 py-3" }, we = { class: "flex items-center gap-3 flex-1 min-w-0" }, Te = ["src", "alt"], Ee = { class: "min-w-0" }, De = { class: "text-sm font-medium text-theme-900 truncate" }, Oe = { class: "flex-1 overflow-hidden" }, ke = { class: "shrink-0 flex items-center justify-center border-t border-theme-100 py-1.5" }, Ae = ["href"], Z = /*#__PURE__*/ o(/* @__PURE__ */ T({
331
+ }), Se = { class: "relative size-16 rounded-full overflow-hidden" }, Ce = ["src", "alt"], X = { class: "flex items-center shrink-0 border-b border-theme-100 px-4 py-3" }, we = { class: "flex items-center gap-3 flex-1 min-w-0" }, Te = ["src", "alt"], Ee = { class: "min-w-0" }, De = { class: "text-sm font-medium text-theme-900 truncate" }, Oe = { class: "flex-1 overflow-hidden" }, ke = { class: "shrink-0 flex items-center justify-center border-t border-theme-100 py-1.5" }, Ae = ["href"], Z = /*#__PURE__*/ a(/* @__PURE__ */ T({
332
332
  __name: "AgentWidgetPopup",
333
333
  props: {
334
334
  sdk: {},
@@ -340,7 +340,7 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
340
340
  chatController: {}
341
341
  },
342
342
  setup(e, { expose: t }) {
343
- let n = e, r = O(!1), i = O(!1), o = k(), { currentAgent: u, currentContext: d, currentFirstMessage: m, update: h } = f(n), _ = g(() => ({
343
+ let n = e, r = O(!1), i = O(!1), a = k(), { currentAgent: o, currentContext: l, currentFirstMessage: m, update: h } = f(n), _ = g(() => ({
344
344
  "bottom-left": "bottom-4 left-4 sm:bottom-6 sm:left-6",
345
345
  "top-right": "top-4 right-4 sm:top-6 sm:right-6",
346
346
  "top-left": "top-4 left-4 sm:top-6 sm:left-6",
@@ -357,17 +357,17 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
357
357
  "bottom-right": "bottom-0 right-0"
358
358
  })[n.position || "bottom-right"]);
359
359
  function initController(e, t) {
360
- n.chatController || o.value || (o.value = new a({
360
+ n.chatController || a.value || (a.value = new c({
361
361
  sdk: t,
362
362
  agent: e.toConfig(),
363
- context: d.value,
363
+ context: l.value,
364
364
  firstMessage: m.value
365
365
  }));
366
366
  }
367
367
  M(r, async (e) => {
368
368
  if (!e || i.value) return;
369
369
  i.value = !0;
370
- let t = n.chatController || o.value;
370
+ let t = n.chatController || a.value;
371
371
  if (t) try {
372
372
  await t.startTextConversation();
373
373
  } catch (e) {
@@ -388,16 +388,16 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
388
388
  open,
389
389
  close,
390
390
  update: h
391
- }), (t, n) => (D(), v(l, {
391
+ }), (t, n) => (D(), v(u, {
392
392
  sdk: e.sdk,
393
393
  handle: e.handle,
394
- agent: j(u),
395
- context: j(d),
394
+ agent: j(o),
395
+ context: j(l),
396
396
  "first-message": j(m)
397
397
  }, {
398
- default: N(({ agent: t, sdk: a }) => [t ? (D(), b("div", {
398
+ default: N(({ agent: t, sdk: o }) => [t ? (D(), b("div", {
399
399
  key: 0,
400
- ref: () => initController(t, a),
400
+ ref: () => initController(t, o),
401
401
  class: E(["fixed z-[999999] pointer-events-auto", _.value])
402
402
  }, [x("div", {
403
403
  class: E(["widget-container transform-gpu overflow-hidden", r.value ? "w-[min(400px,calc(100vw-2rem))] h-[min(600px,calc(100vh-4rem))] shadow-[0_24px_80px_-12px_rgba(0,0,0,0.2),0_8px_24px_-8px_rgba(0,0,0,0.08)]" : "w-16 h-16 shadow-[0_8px_32px_-4px_rgba(0,0,0,0.15)] cursor-pointer"]),
@@ -407,7 +407,7 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
407
407
  }),
408
408
  onClick: n[0] || (n[0] = (e) => r.value ? void 0 : toggle())
409
409
  }, [x("div", { class: E(["absolute size-16 transition-opacity duration-200", [C.value, r.value ? "opacity-0 pointer-events-none" : "opacity-100"]]) }, [x("div", Se, [x("img", {
410
- src: j(c)(t.toConfig()),
410
+ src: j(d)(t.toConfig()),
411
411
  alt: `${t.name.value} agent`,
412
412
  class: "h-full w-full object-cover pointer-events-none",
413
413
  width: "64",
@@ -423,7 +423,7 @@ var pe = ["data-test-state"], me = { class: "flex items-center justify-between p
423
423
  }, [...n[2] || (n[2] = [x("i", { class: "size-5 i-tabler-x" }, null, -1)])])]),
424
424
  x("div", Oe, [i.value ? (D(), v(s, {
425
425
  key: 0,
426
- "chat-controller": e.chatController || o.value,
426
+ "chat-controller": e.chatController || a.value,
427
427
  agent: t,
428
428
  variant: "light",
429
429
  "setup-hint": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagelines/sdk",
3
- "version": "1.0.823",
3
+ "version": "1.0.824",
4
4
  "description": "PageLines SDK for agent management, auth, and billing",
5
5
  "type": "module",
6
6
  "main": "./dist/sdk.js",