@pagelines/sdk 1.0.823 → 1.0.825
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/AgentProvider.js +130 -130
- package/dist/AgentProvider.js.map +1 -1
- package/dist/AgentWrap.js +993 -1286
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/voice/provider.d.ts +12 -1
- package/dist/agent/voice/providers/livekit/provider.d.ts +7 -2
- package/dist/agent/voice/voice-session-client.d.ts +6 -3
- package/dist/agent.js +309 -27
- package/dist/agent.js.map +1 -1
- package/dist/provider.js +29 -16444
- package/dist/provider.js.map +1 -1
- package/dist/provider2.js +7549 -9545
- package/dist/provider2.js.map +1 -1
- package/dist/provider3.js +18469 -0
- package/dist/provider3.js.map +1 -0
- package/dist/sdk.css +1 -1
- package/dist/widget.js +55 -55
- package/package.json +1 -1
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-
|
|
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 {
|
|
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"),
|
|
24
|
+
let t = O(!1), n = O("email"), i = O({
|
|
25
25
|
email: "",
|
|
26
26
|
code: ""
|
|
27
|
-
}),
|
|
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 (!
|
|
35
|
-
|
|
34
|
+
if (!a.value) {
|
|
35
|
+
a.value = !0, e.sdk.error.value = null;
|
|
36
36
|
try {
|
|
37
|
-
await e.sdk.auth.requestAuthCode({ email:
|
|
37
|
+
await e.sdk.auth.requestAuthCode({ email: i.value.email }) && (n.value = "code");
|
|
38
38
|
} finally {
|
|
39
|
-
|
|
39
|
+
a.value = !1;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
async function verifyCode() {
|
|
44
|
-
if (!
|
|
45
|
-
|
|
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:
|
|
49
|
-
code:
|
|
48
|
+
email: i.value.email,
|
|
49
|
+
code: i.value.code
|
|
50
50
|
});
|
|
51
51
|
} finally {
|
|
52
|
-
|
|
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:
|
|
78
|
-
"onUpdate:modelValue": c[1] || (c[1] = (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(
|
|
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:
|
|
87
|
-
disabled: !
|
|
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(
|
|
95
|
-
w(
|
|
96
|
-
modelValue:
|
|
97
|
-
"onUpdate:modelValue": c[2] || (c[2] = (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(
|
|
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:
|
|
109
|
-
disabled:
|
|
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,
|
|
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 =
|
|
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
|
|
237
|
-
p.value = t, m.value = new
|
|
238
|
-
sdk:
|
|
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
|
|
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: !!
|
|
258
|
+
hasToken: !!a.token.value,
|
|
259
259
|
hasAgent: !!f.value,
|
|
260
|
-
isNewAgent:
|
|
261
|
-
botReady:
|
|
262
|
-
provisionError:
|
|
263
|
-
})), _ = g(() => `${e(
|
|
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,
|
|
265
|
+
o.value = e, u.value = void 0, l.value = !1, d.value = !0;
|
|
266
266
|
}
|
|
267
267
|
function onProvisionReady() {
|
|
268
|
-
|
|
268
|
+
l.value = !0;
|
|
269
269
|
}
|
|
270
270
|
function onProvisionError(e) {
|
|
271
|
-
|
|
271
|
+
u.value = e;
|
|
272
272
|
}
|
|
273
273
|
function onRetry() {
|
|
274
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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__*/
|
|
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),
|
|
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 ||
|
|
360
|
+
n.chatController || a.value || (a.value = new c({
|
|
361
361
|
sdk: t,
|
|
362
362
|
agent: e.toConfig(),
|
|
363
|
-
context:
|
|
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 ||
|
|
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(
|
|
391
|
+
}), (t, n) => (D(), v(u, {
|
|
392
392
|
sdk: e.sdk,
|
|
393
393
|
handle: e.handle,
|
|
394
|
-
agent: j(
|
|
395
|
-
context: j(
|
|
394
|
+
agent: j(o),
|
|
395
|
+
context: j(l),
|
|
396
396
|
"first-message": j(m)
|
|
397
397
|
}, {
|
|
398
|
-
default: N(({ agent: t, sdk:
|
|
398
|
+
default: N(({ agent: t, sdk: o }) => [t ? (D(), b("div", {
|
|
399
399
|
key: 0,
|
|
400
|
-
ref: () => initController(t,
|
|
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(
|
|
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 ||
|
|
426
|
+
"chat-controller": e.chatController || a.value,
|
|
427
427
|
agent: t,
|
|
428
428
|
variant: "light",
|
|
429
429
|
"setup-hint": "",
|