@applica-software-guru/persona-sdk 0.1.61 → 0.1.63

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/bundle.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var K = Object.defineProperty;
2
- var q = (i, t, e) => t in i ? K(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var o = (i, t, e) => q(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { createContext as _, useContext as R, useState as x, useRef as B, useMemo as Y, useEffect as G, useCallback as E } from "react";
5
- import { useExternalStoreRuntime as V, CompositeAttachmentAdapter as H, SimpleImageAttachmentAdapter as Q, AssistantRuntimeProvider as X } from "@assistant-ui/react";
6
- var D = { exports: {} }, C = {};
2
+ var q = (i, e, t) => e in i ? K(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var o = (i, e, t) => q(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { createContext as B, useContext as A, useState as R, useRef as Y, useMemo as G, useEffect as V, useCallback as v } from "react";
5
+ import { useExternalStoreRuntime as H, CompositeAttachmentAdapter as Q, SimpleImageAttachmentAdapter as X, AssistantRuntimeProvider as Z } from "@assistant-ui/react";
6
+ var W = { exports: {} }, S = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,121 +13,122 @@ var D = { exports: {} }, C = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var M;
17
- function Z() {
18
- if (M) return C;
19
- M = 1;
20
- var i = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
21
- function e(n, s, a) {
22
- var c = null;
23
- if (a !== void 0 && (c = "" + a), s.key !== void 0 && (c = "" + s.key), "key" in s) {
16
+ var I;
17
+ function tt() {
18
+ if (I) return S;
19
+ I = 1;
20
+ var i = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
21
+ function t(s, n, a) {
22
+ var r = null;
23
+ if (a !== void 0 && (r = "" + a), n.key !== void 0 && (r = "" + n.key), "key" in n) {
24
24
  a = {};
25
- for (var l in s)
26
- l !== "key" && (a[l] = s[l]);
27
- } else a = s;
28
- return s = a.ref, {
25
+ for (var l in n)
26
+ l !== "key" && (a[l] = n[l]);
27
+ } else a = n;
28
+ return n = a.ref, {
29
29
  $$typeof: i,
30
- type: n,
31
- key: c,
32
- ref: s !== void 0 ? s : null,
30
+ type: s,
31
+ key: r,
32
+ ref: n !== void 0 ? n : null,
33
33
  props: a
34
34
  };
35
35
  }
36
- return C.Fragment = t, C.jsx = e, C.jsxs = e, C;
36
+ return S.Fragment = e, S.jsx = t, S.jsxs = t, S;
37
37
  }
38
- D.exports = Z();
39
- var T = D.exports;
40
- function ee(i) {
41
- return i.filter((t) => {
42
- var e;
43
- return t.finishReason === "stop" ? t.text !== null && ((e = t.text) == null ? void 0 : e.trim()) !== "" : !0;
38
+ W.exports = tt();
39
+ var $ = W.exports;
40
+ function et(i) {
41
+ return i.filter((e) => {
42
+ var t;
43
+ return e.finishReason === "stop" ? e.text !== null && ((t = e.text) == null ? void 0 : t.trim()) !== "" : !0;
44
44
  });
45
45
  }
46
- function $(i) {
47
- const t = [];
48
- let e = null;
49
- for (const s of i)
50
- s.type !== "transaction" && (s.type === "reasoning" ? (e != null && (t.push(e), e = null), t.push(s)) : s.functionCalls ? (e && t.push(e), t.push(s), e = null) : s.functionResponse ? t[t.length - 1] = {
51
- ...t[t.length - 1],
52
- functionResponse: s.functionResponse
53
- } : e && s.protocol === e.protocol && (e.role === s.role || s.finishReason === "stop") ? (e.text += s.text, e.files = [...e.files ?? [], ...s.files ?? []]) : (e && t.push(e), e = {
54
- ...s
46
+ function M(i) {
47
+ const e = [];
48
+ let t = null;
49
+ for (const n of i)
50
+ n.type !== "transaction" && (n.type === "reasoning" ? (t != null && (e.push(t), t = null), e.push(n)) : n.functionCalls ? (t && e.push(t), e.push(n), t = null) : n.functionResponse ? e[e.length - 1] = {
51
+ ...e[e.length - 1],
52
+ functionResponse: n.functionResponse
53
+ } : t && n.protocol === t.protocol && (t.role === n.role || n.finishReason === "stop") ? (t.text += n.text, t.files = [...t.files ?? [], ...n.files ?? []]) : (t && e.push(t), t = {
54
+ ...n
55
55
  }));
56
- return e && t.push(e), ee(t);
56
+ return t && e.push(t), et(e);
57
57
  }
58
- function te(i) {
59
- var e, n;
60
- const t = ((e = i.files) == null ? void 0 : e.map(
61
- (s) => ({
58
+ function st(i) {
59
+ var t, s;
60
+ const e = ((t = i.files) == null ? void 0 : t.map(
61
+ (n) => ({
62
62
  type: "file",
63
- data: s.url,
64
- mimeType: s.contentType
63
+ data: n.url,
64
+ mimeType: n.contentType
65
65
  })
66
66
  )) ?? [];
67
67
  return i.role === "function" ? {
68
68
  id: i.id,
69
69
  role: "assistant",
70
70
  status: (i == null ? void 0 : i.functionResponse) === null ? { type: "running" } : { type: "complete", reason: "stop" },
71
- content: ((n = i.functionCalls) == null ? void 0 : n.map((s) => {
71
+ content: ((s = i.functionCalls) == null ? void 0 : s.map((n) => {
72
72
  var a;
73
73
  return {
74
74
  type: "tool-call",
75
- toolName: s.name,
76
- toolCallId: s.id,
77
- args: s.args,
75
+ toolName: n.name,
76
+ toolCallId: n.id,
77
+ args: n.args,
78
78
  result: (a = i.functionResponse) == null ? void 0 : a.result
79
79
  };
80
80
  })) ?? []
81
81
  } : {
82
82
  id: i.id,
83
83
  role: i.role,
84
- content: i.type === "reasoning" ? [{ type: "reasoning", text: i.text }, ...t] : [{ type: "text", text: i.text }, ...t]
84
+ content: i.type === "reasoning" ? [{ type: "reasoning", text: i.text }, ...e] : [{ type: "text", text: i.text }, ...e]
85
85
  };
86
86
  }
87
- class A {
87
+ class E {
88
88
  constructor() {
89
89
  o(this, "statusChangeCallbacks", []);
90
90
  o(this, "messageCallbacks", []);
91
91
  }
92
- addStatusChangeListener(t) {
93
- this.statusChangeCallbacks.push(t);
92
+ addStatusChangeListener(e) {
93
+ this.statusChangeCallbacks.push(e);
94
94
  }
95
- addMessageListener(t) {
96
- this.messageCallbacks.push(t);
95
+ addPacketListener(e) {
96
+ this.messageCallbacks.push(e);
97
97
  }
98
- async syncSession(t) {
99
- this.session = t;
98
+ async syncSession(e) {
99
+ this.session = e;
100
100
  }
101
- async notifyMessage(t) {
102
- this.messageCallbacks.forEach((e) => e(t));
101
+ async notifyPacket(e) {
102
+ this.messageCallbacks.forEach((t) => t(e));
103
103
  }
104
- async notifyMessages(t) {
105
- t.forEach((e) => {
106
- this.messageCallbacks.forEach((n) => n(e));
104
+ async notifyPackets(e) {
105
+ e.forEach((t) => {
106
+ this.messageCallbacks.forEach((s) => s(t));
107
107
  });
108
108
  }
109
- async setSession(t) {
110
- this.session = t;
109
+ async setSession(e) {
110
+ this.session = e;
111
111
  }
112
- async setStatus(t) {
113
- const e = this.status !== t;
114
- this.status = t, e && this.statusChangeCallbacks.forEach((n) => n(t));
112
+ async setStatus(e) {
113
+ const t = this.status !== e;
114
+ this.status = e, t && this.statusChangeCallbacks.forEach((s) => s(e));
115
115
  }
116
116
  clearListeners() {
117
117
  this.statusChangeCallbacks = [], this.messageCallbacks = [];
118
118
  }
119
- onTransaction(t) {
119
+ onTransaction(e) {
120
120
  }
121
121
  }
122
- class N extends A {
123
- constructor(e) {
122
+ class z extends E {
123
+ constructor(t) {
124
124
  super();
125
125
  o(this, "status");
126
126
  o(this, "autostart");
127
127
  o(this, "session");
128
128
  o(this, "config");
129
129
  o(this, "notify", !0);
130
- this.config = e, this.status = "disconnected", this.autostart = !0;
130
+ o(this, "context", {});
131
+ this.config = t, this.status = "disconnected", this.autostart = !0;
131
132
  }
132
133
  getName() {
133
134
  return "rest";
@@ -135,42 +136,47 @@ class N extends A {
135
136
  getPriority() {
136
137
  return 100;
137
138
  }
138
- async connect(e) {
139
- return this.setStatus("connected"), e;
139
+ async connect(t) {
140
+ return this.setStatus("connected"), t;
140
141
  }
141
142
  async disconnect() {
142
143
  this.setStatus("disconnected"), this.session = null;
143
144
  }
144
- async syncSession(e) {
145
- this.session = e;
145
+ async syncSession(t) {
146
+ this.session = t;
146
147
  }
147
- async send(e) {
148
- const { apiUrl: n, apiKey: s, agentId: a } = this.config, c = this.session ?? "new", l = e, f = await (await fetch(`${n}/agents/${a}/sessions/${c}/messages`, {
149
- body: JSON.stringify({ userMessage: l }),
148
+ async sendPacket(t) {
149
+ var g, w;
150
+ const { apiUrl: s, apiKey: n, agentId: a } = this.config, r = this.session ?? "new";
151
+ if (t.type === "command" && ((g = t == null ? void 0 : t.payload) == null ? void 0 : g.command) == "set_initial_context") {
152
+ this.context = (w = t == null ? void 0 : t.payload) == null ? void 0 : w.arguments;
153
+ return;
154
+ }
155
+ const l = t.payload, p = await (await fetch(`${s}/sessions/${r}/messages`, {
156
+ body: JSON.stringify({ agentId: a, userMessage: l, initial_context: this.context }),
150
157
  method: "POST",
151
158
  headers: {
152
159
  "Content-Type": "application/json",
153
- "x-fox-apikey": s,
154
- "x-persona-apikey": s
160
+ "x-persona-apikey": n
155
161
  }
156
162
  })).json();
157
- this.notifyMessages(
158
- f.response.messages.map((b) => ({
163
+ this.notifyPackets(
164
+ p.response.messages.map((T) => ({
159
165
  type: "message",
160
- payload: b
166
+ payload: T
161
167
  }))
162
168
  );
163
169
  }
164
170
  }
165
- class I extends A {
166
- constructor(e) {
171
+ class D extends E {
172
+ constructor(t) {
167
173
  super();
168
174
  o(this, "status");
169
175
  o(this, "autostart");
170
176
  o(this, "session");
171
177
  o(this, "config");
172
178
  o(this, "webSocket");
173
- this.config = e, this.status = "disconnected", this.autostart = !0, this.session = null, this.webSocket = null;
179
+ this.config = t, this.status = "disconnected", this.autostart = !0, this.session = null, this.webSocket = null;
174
180
  }
175
181
  getName() {
176
182
  return "websocket";
@@ -178,40 +184,40 @@ class I extends A {
178
184
  getPriority() {
179
185
  return 500;
180
186
  }
181
- async syncSession(e) {
182
- var n;
183
- (n = this.config.logger) == null || n.debug("Syncing session with WebSocket protocol:", e), this.session = e, this.webSocket && this.status === "connected" && (this.disconnect(), this.connect(e));
187
+ async syncSession(t) {
188
+ var s;
189
+ (s = this.config.logger) == null || s.debug("Syncing session with WebSocket protocol:", t), this.session = t, this.webSocket && this.status === "connected" && (this.disconnect(), this.connect(t));
184
190
  }
185
- connect(e) {
191
+ connect(t) {
186
192
  var l;
187
193
  if (this.webSocket !== null && this.status === "connected")
188
194
  return Promise.resolve(this.session);
189
- const n = e || this.session || "new";
190
- (l = this.config.logger) == null || l.debug("Connecting to WebSocket with sessionId:", n);
191
- const s = encodeURIComponent(this.config.apiKey), a = this.config.agentId, c = `${this.config.webSocketUrl}?sessionCode=${n}&agentId=${a}&apiKey=${s}`;
192
- return this.setStatus("connecting"), this.webSocket = new WebSocket(c), this.webSocket.addEventListener("open", () => {
195
+ const s = t || this.session || "new";
196
+ (l = this.config.logger) == null || l.debug("Connecting to WebSocket with sessionId:", s);
197
+ const n = encodeURIComponent(this.config.apiKey), a = this.config.agentId, r = `${this.config.webSocketUrl}?sessionCode=${s}&agentId=${a}&apiKey=${n}`;
198
+ return this.setStatus("connecting"), this.webSocket = new WebSocket(r), this.webSocket.addEventListener("open", () => {
193
199
  this.setStatus("connected");
194
200
  }), this.webSocket.addEventListener("message", (u) => {
195
- const f = JSON.parse(u.data);
196
- this.notifyMessage(f);
201
+ const p = JSON.parse(u.data);
202
+ this.notifyPacket(p);
197
203
  }), this.webSocket.addEventListener("close", () => {
198
204
  var u;
199
205
  this.setStatus("disconnected"), this.webSocket = null, (u = this.config.logger) == null || u.warn("WebSocket connection closed");
200
206
  }), this.webSocket.addEventListener("error", (u) => {
201
- var f;
202
- this.setStatus("disconnected"), this.webSocket = null, (f = this.config.logger) == null || f.error("WebSocket error", u);
203
- }), Promise.resolve(n);
207
+ var p;
208
+ this.setStatus("disconnected"), this.webSocket = null, (p = this.config.logger) == null || p.error("WebSocket error", u);
209
+ }), Promise.resolve(s);
204
210
  }
205
211
  disconnect() {
206
- var e;
207
- return (e = this.config.logger) == null || e.debug("Disconnecting WebSocket"), this.webSocket && this.status === "connected" && (this.webSocket.close(), this.setStatus("disconnected"), this.webSocket = null), Promise.resolve();
212
+ var t;
213
+ return (t = this.config.logger) == null || t.debug("Disconnecting WebSocket"), this.webSocket && this.status === "connected" && (this.webSocket.close(), this.setStatus("disconnected"), this.webSocket = null), Promise.resolve();
208
214
  }
209
- send(e) {
210
- return this.webSocket && this.status === "connected" ? (this.webSocket.send(JSON.stringify({ type: "request", payload: e })), Promise.resolve()) : Promise.reject(new Error("WebSocket is not connected"));
215
+ sendPacket(t) {
216
+ return this.webSocket && this.status === "connected" ? (this.webSocket.send(JSON.stringify(t)), Promise.resolve()) : Promise.reject(new Error("WebSocket is not connected"));
211
217
  }
212
218
  }
213
- class se {
214
- constructor(t) {
219
+ class nt {
220
+ constructor(e) {
215
221
  o(this, "config");
216
222
  o(this, "pc", null);
217
223
  o(this, "ws", null);
@@ -225,16 +231,16 @@ class se {
225
231
  o(this, "isConnected", !1);
226
232
  o(this, "visualizerCallbacks", []);
227
233
  o(this, "messageCallbacks", []);
228
- this.config = t;
234
+ this.config = e;
229
235
  }
230
- async connect(t) {
231
- var n;
236
+ async connect(e) {
237
+ var s;
232
238
  if (this.isConnected) return;
233
239
  this.isConnected = !0;
234
240
  try {
235
241
  this.localStream = await navigator.mediaDevices.getUserMedia({ audio: !0 });
236
- } catch (s) {
237
- (n = this.config.logger) == null || n.error("Error accessing microphone:", s);
242
+ } catch (n) {
243
+ (s = this.config.logger) == null || s.error("Error accessing microphone:", n);
238
244
  return;
239
245
  }
240
246
  this.pc = new RTCPeerConnection({
@@ -248,137 +254,137 @@ class se {
248
254
  credential: "webrtc"
249
255
  }
250
256
  ]
251
- }), this.localStream.getTracks().forEach((s) => {
252
- this.pc.addTrack(s, this.localStream);
253
- }), this.pc.ontrack = (s) => {
254
- s.streams[0].getTracks().forEach((c) => {
255
- this.remoteStream.addTrack(c);
257
+ }), this.localStream.getTracks().forEach((n) => {
258
+ this.pc.addTrack(n, this.localStream);
259
+ }), this.pc.ontrack = (n) => {
260
+ n.streams[0].getTracks().forEach((r) => {
261
+ this.remoteStream.addTrack(r);
256
262
  }), this.audioCtx || this._startAnalyzers();
257
263
  const a = new Audio();
258
- a.srcObject = this.remoteStream, a.play().catch((c) => {
264
+ a.srcObject = this.remoteStream, a.play().catch((r) => {
259
265
  var l;
260
- (l = this.config.logger) == null || l.error("Error playing remote audio:", c);
266
+ (l = this.config.logger) == null || l.error("Error playing remote audio:", r);
261
267
  });
262
- }, this.pc.onicecandidate = (s) => {
268
+ }, this.pc.onicecandidate = (n) => {
263
269
  var a;
264
- s.candidate && ((a = this.ws) == null ? void 0 : a.readyState) === WebSocket.OPEN && this.ws.send(
270
+ n.candidate && ((a = this.ws) == null ? void 0 : a.readyState) === WebSocket.OPEN && this.ws.send(
265
271
  JSON.stringify({
266
272
  type: "CANDIDATE",
267
273
  src: "client",
268
- payload: { candidate: s.candidate }
274
+ payload: { candidate: n.candidate }
269
275
  })
270
276
  );
271
- }, this.pc.ondatachannel = (s) => {
272
- const a = s.channel;
273
- a.onmessage = (c) => {
277
+ }, this.pc.ondatachannel = (n) => {
278
+ const a = n.channel;
279
+ a.onmessage = (r) => {
274
280
  this.messageCallbacks.forEach((l) => {
275
- l(c);
281
+ l(r);
276
282
  });
277
283
  };
278
284
  };
279
- const e = this.config.webrtcUrl || "wss://persona.applica.guru/api/webrtc";
280
- this.ws = new WebSocket(`${e}?apiKey=${encodeURIComponent(this.config.apiKey)}`), this.ws.onopen = async () => {
285
+ const t = this.config.webrtcUrl || "wss://persona.applica.guru/api/webrtc";
286
+ this.ws = new WebSocket(`${t}?apiKey=${encodeURIComponent(this.config.apiKey)}`), this.ws.onopen = async () => {
281
287
  var l, u;
282
- const s = await this.pc.createOffer();
283
- await this.pc.setLocalDescription(s);
288
+ const n = await this.pc.createOffer();
289
+ await this.pc.setLocalDescription(n);
284
290
  const a = {
285
291
  apiKey: this.config.apiKey,
286
292
  agentId: this.config.agentId,
287
- sessionCode: t
293
+ sessionCode: e
288
294
  };
289
295
  (l = this.config.logger) == null || l.debug("Opening connection to WebRTC server: ", a);
290
- const c = {
296
+ const r = {
291
297
  type: "OFFER",
292
298
  src: ((u = crypto.randomUUID) == null ? void 0 : u.call(crypto)) || "client_" + Date.now(),
293
299
  payload: {
294
300
  sdp: {
295
- sdp: s.sdp,
296
- type: s.type
301
+ sdp: n.sdp,
302
+ type: n.type
297
303
  },
298
304
  connectionId: (Date.now() % 1e6).toString(),
299
305
  metadata: a
300
306
  }
301
307
  };
302
- this.ws.send(JSON.stringify(c));
303
- }, this.ws.onmessage = async (s) => {
304
- var c;
305
- const a = JSON.parse(s.data);
308
+ this.ws.send(JSON.stringify(r));
309
+ }, this.ws.onmessage = async (n) => {
310
+ var r;
311
+ const a = JSON.parse(n.data);
306
312
  if (a.type === "ANSWER")
307
313
  await this.pc.setRemoteDescription(new RTCSessionDescription(a.payload.sdp));
308
314
  else if (a.type === "CANDIDATE")
309
315
  try {
310
316
  await this.pc.addIceCandidate(new RTCIceCandidate(a.payload.candidate));
311
317
  } catch (l) {
312
- (c = this.config.logger) == null || c.error("Error adding ICE candidate:", l);
318
+ (r = this.config.logger) == null || r.error("Error adding ICE candidate:", l);
313
319
  }
314
320
  }, this.ws.onclose = () => {
315
321
  this._stopAnalyzers();
316
322
  };
317
323
  }
318
324
  async disconnect() {
319
- var t;
320
- this.isConnected && (this.isConnected = !1, ((t = this.ws) == null ? void 0 : t.readyState) === WebSocket.OPEN && this.ws.close(), this.pc && this.pc.close(), this.localStream && this.localStream.getTracks().forEach((e) => e.stop()), this.remoteStream = new MediaStream(), this.audioCtx && (await this.audioCtx.close(), this.audioCtx = null), this._stopAnalyzers());
325
+ var e;
326
+ this.isConnected && (this.isConnected = !1, ((e = this.ws) == null ? void 0 : e.readyState) === WebSocket.OPEN && this.ws.close(), this.pc && this.pc.close(), this.localStream && this.localStream.getTracks().forEach((t) => t.stop()), this.remoteStream = new MediaStream(), this.audioCtx && (await this.audioCtx.close(), this.audioCtx = null), this._stopAnalyzers());
321
327
  }
322
- addVisualizerCallback(t) {
323
- this.visualizerCallbacks.push(t);
328
+ addVisualizerCallback(e) {
329
+ this.visualizerCallbacks.push(e);
324
330
  }
325
- addMessageCallback(t) {
326
- this.messageCallbacks.push(t);
331
+ addMessageCallback(e) {
332
+ this.messageCallbacks.push(e);
327
333
  }
328
- createDataChannel(t = "messages") {
329
- this.pc && (this.dataChannel = this.pc.createDataChannel(t), this.dataChannel.onopen = () => {
330
- var e;
331
- return (e = this.config.logger) == null ? void 0 : e.info("Data channel opened");
332
- }, this.dataChannel.onmessage = (e) => {
333
- this.messageCallbacks.forEach((n) => {
334
- n(e);
334
+ createDataChannel(e = "messages") {
335
+ this.pc && (this.dataChannel = this.pc.createDataChannel(e), this.dataChannel.onopen = () => {
336
+ var t;
337
+ return (t = this.config.logger) == null ? void 0 : t.info("Data channel opened");
338
+ }, this.dataChannel.onmessage = (t) => {
339
+ this.messageCallbacks.forEach((s) => {
340
+ s(t);
335
341
  });
336
342
  });
337
343
  }
338
- sendMessage(t) {
339
- var e, n;
344
+ sendPacket(e) {
345
+ var t, s;
340
346
  if (!this.dataChannel) {
341
- (e = this.config.logger) == null || e.warn("Data channel is not open, cannot send message");
347
+ (t = this.config.logger) == null || t.warn("Data channel is not open, cannot send message");
342
348
  return;
343
349
  }
344
- this.dataChannel.send(JSON.stringify({ type: "request", payload: t })), (n = this.config.logger) == null || n.info("Sent message:", t);
350
+ this.dataChannel.send(JSON.stringify(e)), (s = this.config.logger) == null || s.info("Sent message:", e);
345
351
  }
346
352
  _startAnalyzers() {
347
353
  if (!this.localStream || !this.remoteStream || this.visualizerCallbacks.length === 0)
348
354
  return;
349
355
  this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
350
- const t = this.audioCtx.createMediaStreamSource(this.localStream), e = this.audioCtx.createMediaStreamSource(this.remoteStream);
351
- this.localAnalyser = this.audioCtx.createAnalyser(), this.remoteAnalyser = this.audioCtx.createAnalyser(), this.localAnalyser.fftSize = 256, this.remoteAnalyser.fftSize = 256, t.connect(this.localAnalyser), e.connect(this.remoteAnalyser);
352
- const n = () => {
356
+ const e = this.audioCtx.createMediaStreamSource(this.localStream), t = this.audioCtx.createMediaStreamSource(this.remoteStream);
357
+ this.localAnalyser = this.audioCtx.createAnalyser(), this.remoteAnalyser = this.audioCtx.createAnalyser(), this.localAnalyser.fftSize = 256, this.remoteAnalyser.fftSize = 256, e.connect(this.localAnalyser), t.connect(this.remoteAnalyser);
358
+ const s = () => {
353
359
  if (!this.localAnalyser || !this.remoteAnalyser || this.visualizerCallbacks.length === 0)
354
360
  return;
355
- const s = new Uint8Array(this.localAnalyser.frequencyBinCount), a = new Uint8Array(this.remoteAnalyser.frequencyBinCount);
356
- this.localAnalyser.getByteFrequencyData(s), this.remoteAnalyser.getByteFrequencyData(a);
357
- const c = s.reduce((u, f) => u + f, 0) / s.length, l = a.reduce((u, f) => u + f, 0) / a.length;
361
+ const n = new Uint8Array(this.localAnalyser.frequencyBinCount), a = new Uint8Array(this.remoteAnalyser.frequencyBinCount);
362
+ this.localAnalyser.getByteFrequencyData(n), this.remoteAnalyser.getByteFrequencyData(a);
363
+ const r = n.reduce((u, p) => u + p, 0) / n.length, l = a.reduce((u, p) => u + p, 0) / a.length;
358
364
  this.visualizerCallbacks.length > 0 && this.visualizerCallbacks.forEach((u) => {
359
365
  u({
360
- localAmplitude: c,
366
+ localAmplitude: r,
361
367
  remoteAmplitude: l
362
368
  });
363
- }), this.analyzerFrame = requestAnimationFrame(n);
369
+ }), this.analyzerFrame = requestAnimationFrame(s);
364
370
  };
365
- this.analyzerFrame = requestAnimationFrame(n);
371
+ this.analyzerFrame = requestAnimationFrame(s);
366
372
  }
367
373
  _stopAnalyzers() {
368
374
  this.analyzerFrame && (cancelAnimationFrame(this.analyzerFrame), this.analyzerFrame = null), this.localAnalyser = null, this.remoteAnalyser = null;
369
375
  }
370
376
  }
371
- class z extends A {
372
- constructor(e) {
377
+ class U extends E {
378
+ constructor(t) {
373
379
  super();
374
380
  o(this, "status");
375
381
  o(this, "session");
376
382
  o(this, "autostart");
377
383
  o(this, "config");
378
384
  o(this, "webRTCClient");
379
- this.config = e, this.status = "disconnected", this.session = null, this.autostart = (e == null ? void 0 : e.autostart) ?? !1, this.webRTCClient = new se(e), this.webRTCClient.addMessageCallback((n) => {
380
- const s = JSON.parse(n.data);
381
- this.notifyMessage(s);
385
+ this.config = t, this.status = "disconnected", this.session = null, this.autostart = (t == null ? void 0 : t.autostart) ?? !1, this.webRTCClient = new nt(t), this.webRTCClient.addMessageCallback((s) => {
386
+ const n = JSON.parse(s.data);
387
+ this.notifyPacket(n);
382
388
  });
383
389
  }
384
390
  getName() {
@@ -387,39 +393,39 @@ class z extends A {
387
393
  getPriority() {
388
394
  return 1e3;
389
395
  }
390
- async syncSession(e) {
391
- super.syncSession(e), this.status === "connected" && (await this.disconnect(), await this.connect(e));
396
+ async syncSession(t) {
397
+ super.syncSession(t), this.status === "connected" && (await this.disconnect(), await this.connect(t));
392
398
  }
393
- async connect(e) {
394
- var n;
395
- return this.status === "connected" ? Promise.resolve(this.session) : (this.session = e || this.session || "new", this.setStatus("connecting"), (n = this.config.logger) == null || n.debug("Connecting to WebRTC with sessionId:", this.session), await this.webRTCClient.connect(this.session), this.setStatus("connected"), await this.webRTCClient.createDataChannel(), this.session);
399
+ async connect(t) {
400
+ var s;
401
+ return this.status === "connected" ? Promise.resolve(this.session) : (this.session = t || this.session || "new", this.setStatus("connecting"), (s = this.config.logger) == null || s.debug("Connecting to WebRTC with sessionId:", this.session), await this.webRTCClient.connect(this.session), this.setStatus("connected"), await this.webRTCClient.createDataChannel(), this.session);
396
402
  }
397
403
  async disconnect() {
398
- var e, n, s;
404
+ var t, s, n;
399
405
  if (this.status === "disconnected")
400
- return (e = this.config.logger) == null || e.warn("Already disconnected"), Promise.resolve();
401
- await this.webRTCClient.disconnect(), this.setStatus("disconnected"), (s = (n = this.config) == null ? void 0 : n.logger) == null || s.debug("Disconnected from WebRTC");
406
+ return (t = this.config.logger) == null || t.warn("Already disconnected"), Promise.resolve();
407
+ await this.webRTCClient.disconnect(), this.setStatus("disconnected"), (n = (s = this.config) == null ? void 0 : s.logger) == null || n.debug("Disconnected from WebRTC");
402
408
  }
403
- send(e) {
404
- return this.status !== "connected" ? Promise.reject(new Error("Not connected")) : (this.webRTCClient.sendMessage(e), Promise.resolve());
409
+ sendPacket(t) {
410
+ return this.status !== "connected" ? Promise.reject(new Error("Not connected")) : (this.webRTCClient.sendPacket(t), Promise.resolve());
405
411
  }
406
412
  }
407
- class ne {
408
- constructor(t) {
413
+ class it {
414
+ constructor(e) {
409
415
  o(this, "config");
410
- this.config = t;
416
+ this.config = e;
411
417
  }
412
- async complete(t, e) {
413
- var n;
414
- await this.persist(t, { ...e, success: !0 }), (n = this.config.logger) == null || n.debug("Transaction completed:", t);
418
+ async complete(e, t) {
419
+ var s;
420
+ await this.persist(e, { ...t, success: !0 }), (s = this.config.logger) == null || s.debug("Transaction completed:", e);
415
421
  }
416
- async fail(t, e) {
417
- var n;
418
- await this.persist(t, { ...e, success: !1 }), (n = this.config.logger) == null || n.debug("Transaction failed:", { ...t, ...e });
422
+ async fail(e, t) {
423
+ var s;
424
+ await this.persist(e, { ...t, success: !1 }), (s = this.config.logger) == null || s.debug("Transaction failed:", { ...e, ...t });
419
425
  }
420
- async persist(t, e) {
421
- await fetch(`${this.config.apiUrl}/transactions/${t.id}`, {
422
- body: JSON.stringify(e),
426
+ async persist(e, t) {
427
+ await fetch(`${this.config.apiUrl}/transactions/${e.id}`, {
428
+ body: JSON.stringify(t),
423
429
  method: "POST",
424
430
  headers: {
425
431
  "Content-Type": "application/json",
@@ -429,49 +435,49 @@ class ne {
429
435
  });
430
436
  }
431
437
  }
432
- class ie {
433
- constructor(t, e) {
438
+ class at {
439
+ constructor(e, t) {
434
440
  o(this, "transaction");
435
441
  o(this, "manager");
436
- this.transaction = t, this.manager = e;
442
+ this.transaction = e, this.manager = t;
437
443
  }
438
444
  getFunctionCall() {
439
445
  return this.transaction.functionCall;
440
446
  }
441
- async invoke(t) {
442
- const e = this.transaction.functionCall;
443
- if (!e) {
447
+ async invoke(e) {
448
+ const t = this.transaction.functionCall;
449
+ if (!t) {
444
450
  await this.fail("No function call found");
445
451
  return;
446
452
  }
447
- const n = e.name, s = e.args, a = t[n];
453
+ const s = t.name, n = t.args, a = e[s];
448
454
  if (!a) {
449
- await this.fail(`Tool ${n} not found`);
455
+ await this.fail(`Tool ${s} not found`);
450
456
  return;
451
457
  }
452
458
  try {
453
- const c = await a(s);
454
- await this.complete(c);
455
- } catch (c) {
456
- await this.fail(`Error executing tool ${n}: ${c}`);
459
+ const r = await a(n);
460
+ await this.complete(r);
461
+ } catch (r) {
462
+ await this.fail(`Error executing tool ${s}: ${r}`);
457
463
  }
458
464
  }
459
- async complete(t) {
460
- await this.manager.complete(this.transaction, { success: !0, output: t, error: null });
465
+ async complete(e) {
466
+ await this.manager.complete(this.transaction, { success: !0, output: e, error: null });
461
467
  }
462
- async fail(t) {
463
- await this.manager.fail(this.transaction, { success: !1, output: null, error: t });
468
+ async fail(e) {
469
+ await this.manager.fail(this.transaction, { success: !1, output: null, error: e });
464
470
  }
465
471
  }
466
- class ae extends A {
467
- constructor(e) {
472
+ class ot extends E {
473
+ constructor(t) {
468
474
  super();
469
475
  o(this, "status");
470
476
  o(this, "autostart");
471
477
  o(this, "session");
472
478
  o(this, "config");
473
479
  o(this, "notify", !0);
474
- this.config = e, this.status = "disconnected", this.autostart = !0;
480
+ this.config = t, this.status = "disconnected", this.autostart = !0;
475
481
  }
476
482
  getName() {
477
483
  return "transaction";
@@ -479,240 +485,245 @@ class ae extends A {
479
485
  getPriority() {
480
486
  return 0;
481
487
  }
482
- async connect(e) {
483
- return this.setStatus("connected"), e;
488
+ async connect(t) {
489
+ return this.setStatus("connected"), t;
484
490
  }
485
491
  async disconnect() {
486
492
  this.setStatus("disconnected"), this.session = null;
487
493
  }
488
- async syncSession(e) {
489
- this.session = e;
494
+ async syncSession(t) {
495
+ this.session = t;
490
496
  }
491
- async send(e) {
492
- var n;
493
- throw (n = this.config.logger) == null || n.debug("Sending message:", e), new Error("Not implemented");
497
+ async sendPacket(t) {
494
498
  }
495
- onTransaction(e) {
499
+ onTransaction(t) {
496
500
  var a;
497
501
  if (!this.config.onTransaction) {
498
502
  (a = this.config.logger) == null || a.error("Transaction protocol config is not set");
499
503
  return;
500
504
  }
501
- const n = new ne(this.config), s = new ie(e, n);
502
- this.config.onTransaction(s);
505
+ const s = new it(this.config), n = new at(t, s);
506
+ this.config.onTransaction(n);
503
507
  }
504
508
  }
505
- const S = _(void 0);
506
- function oe(i) {
507
- return new Promise((t, e) => {
508
- const n = new FileReader();
509
- n.readAsDataURL(i), n.onload = () => {
510
- const a = n.result.split(";base64,")[1];
511
- t(a);
512
- }, n.onerror = (s) => {
513
- e(s);
509
+ const P = B(void 0);
510
+ function rt(i) {
511
+ return new Promise((e, t) => {
512
+ const s = new FileReader();
513
+ s.readAsDataURL(i), s.onload = () => {
514
+ const a = s.result.split(";base64,")[1];
515
+ e(a);
516
+ }, s.onerror = (n) => {
517
+ t(n);
514
518
  };
515
519
  });
516
520
  }
517
- function re({
521
+ function ct({
518
522
  dev: i = !1,
523
+ baseUrl: e,
519
524
  protocols: t,
520
- logger: e,
525
+ logger: s,
521
526
  children: n,
522
- session: s = "new",
523
- ...a
527
+ session: a = "new",
528
+ ...r
524
529
  }) {
525
- const [c, l] = x(!1), [u, f] = x([]), [b, U] = x(s), [P, W] = x(/* @__PURE__ */ new Map()), v = B(!1), m = Y(() => {
530
+ const [l, u] = R(!1), [p, g] = R([]), [w, T] = R(a), [k, j] = R(/* @__PURE__ */ new Map()), N = Y(!1), b = G(() => {
526
531
  if (Array.isArray(t))
527
532
  return t;
528
533
  if (typeof t == "object" && t !== null) {
529
- const r = i ? "localhost:8000" : "persona.applica.guru/api", p = i ? "http" : "https", d = i ? "ws" : "wss";
530
- let y = Object.keys(t).map((g) => {
531
- switch (g) {
534
+ const c = i ? "localhost:8000" : e || "persona.applica.guru/api", f = i ? "http" : "https", d = i ? "ws" : "wss";
535
+ let m = Object.keys(t).map((y) => {
536
+ switch (y) {
532
537
  case "rest":
533
- const h = t[g];
534
- return h === !0 ? new N({
535
- apiUrl: `${p}://${r}`,
536
- apiKey: a.apiKey,
537
- agentId: a.agentId,
538
- logger: e
539
- }) : typeof h == "object" && h !== null ? new N(h) : null;
538
+ const h = t[y];
539
+ return h === !0 ? new z({
540
+ apiUrl: `${f}://${c}`,
541
+ apiKey: r.apiKey,
542
+ agentId: r.agentId,
543
+ logger: s
544
+ }) : typeof h == "object" && h !== null ? new z(h) : null;
540
545
  case "webrtc":
541
- const w = t[g];
542
- return w === !0 ? new z({
543
- webrtcUrl: `${d}://${r}/webrtc`,
544
- apiKey: a.apiKey,
545
- agentId: a.agentId,
546
- logger: e
547
- }) : typeof w == "object" && w !== null ? new z(w) : null;
546
+ const C = t[y];
547
+ return C === !0 ? new U({
548
+ webrtcUrl: `${d}://${c}/webrtc`,
549
+ apiKey: r.apiKey,
550
+ agentId: r.agentId,
551
+ logger: s
552
+ }) : typeof C == "object" && C !== null ? new U(C) : null;
548
553
  case "websocket":
549
- const k = t[g];
550
- return k === !0 ? new I({
551
- webSocketUrl: `${d}://${r}/websocket`,
552
- apiKey: a.apiKey,
553
- agentId: a.agentId,
554
- logger: e
555
- }) : typeof k == "object" && k !== null ? new I(k) : null;
554
+ const x = t[y];
555
+ return x === !0 ? new D({
556
+ webSocketUrl: `${d}://${c}/websocket`,
557
+ apiKey: r.apiKey,
558
+ agentId: r.agentId,
559
+ logger: s
560
+ }) : typeof x == "object" && x !== null ? new D(x) : null;
556
561
  default:
557
- throw new Error(`Unknown protocol: ${g}`);
562
+ throw new Error(`Unknown protocol: ${y}`);
558
563
  }
559
- }).filter((g) => g !== null);
560
- return a.tools && y.push(
561
- new ae({
562
- apiUrl: `${p}://${r}`,
563
- apiKey: a.apiKey,
564
- agentId: a.agentId,
565
- onTransaction: async (g) => {
566
- await g.invoke(a.tools);
564
+ }).filter((y) => y !== null);
565
+ return r.tools && m.push(
566
+ new ot({
567
+ apiUrl: `${f}://${c}`,
568
+ apiKey: r.apiKey,
569
+ agentId: r.agentId,
570
+ onTransaction: async (y) => {
571
+ await y.invoke(r.tools);
567
572
  },
568
- logger: e
573
+ logger: s
569
574
  })
570
- ), y;
575
+ ), m;
571
576
  }
572
577
  throw new Error("Invalid protocols configuration");
573
578
  }, []);
574
- G(() => {
575
- v.current || (v.current = !0, e == null || e.debug(
579
+ V(() => {
580
+ N.current || (N.current = !0, s == null || s.debug(
576
581
  "Initializing protocols: ",
577
- m.map((r) => r.getName())
578
- ), m.forEach((r) => {
579
- r.setSession(b), r.clearListeners(), r.addStatusChangeListener((p) => {
580
- e == null || e.debug(`${r.getName()} has notified new status: ${p}`), P.set(r.getName(), p), W(new Map(P));
581
- }), r.addMessageListener((p) => {
582
- if (p.type === "message") {
583
- const d = p.payload;
584
- f(
585
- (y) => $([...y, { ...d, protocol: r.getName() }])
582
+ b.map((c) => c.getName())
583
+ ), b.forEach((c) => {
584
+ c.setSession(w), c.clearListeners(), c.addStatusChangeListener((f) => {
585
+ s == null || s.debug(`${c.getName()} has notified new status: ${f}`), k.set(c.getName(), f), f === "connected" && r.context && c.sendPacket({
586
+ type: "command",
587
+ payload: {
588
+ command: "set_initial_context",
589
+ arguments: r.context
590
+ }
591
+ }), j(new Map(k));
592
+ }), c.addPacketListener((f) => {
593
+ if (f.type === "message") {
594
+ const d = f.payload;
595
+ g(
596
+ (m) => M([...m, { ...d, protocol: c.getName() }])
586
597
  );
587
- } else if (p.type === "reasoning") {
588
- const d = p.payload;
589
- let y = d.thought;
590
- d.imageUrl && (y += `
598
+ } else if (f.type === "reasoning") {
599
+ const d = f.payload;
600
+ let m = d.thought;
601
+ d.imageUrl && (m += `
591
602
 
592
603
  ![image](https://persona.applica.guru/api/files/${d.imageUrl})`);
593
- const g = { type: "reasoning", text: y, role: "assistant", finishReason: "stop" };
594
- f(
595
- (h) => $([...h, { ...g, protocol: r.getName() }])
604
+ const y = { type: "reasoning", text: m, role: "assistant", finishReason: "stop" };
605
+ g(
606
+ (h) => M([...h, { ...y, protocol: c.getName() }])
596
607
  );
597
- } else p.type === "transaction" && m.filter((d) => d !== r).forEach((d) => d.onTransaction(p.payload));
598
- }), r.autostart && r.status === "disconnected" && (e == null || e.debug(`Connecting to protocol: ${r.getName()}`), r.connect(b));
608
+ } else f.type === "transaction" && b.filter((d) => d !== c).forEach((d) => d.onTransaction(f.payload));
609
+ }), c.autostart && c.status === "disconnected" && (s == null || s.debug(`Connecting to protocol: ${c.getName()}`), c.connect(w));
599
610
  }));
600
- }, [b, m, e, P]);
601
- const j = async (r) => {
602
- var g;
603
- if (((g = r.content[0]) == null ? void 0 : g.type) !== "text") throw new Error("Only text messages are supported");
604
- const p = r.content[0].text;
605
- f((h) => [...h, { role: "user", type: "text", text: p }]), l(!0);
606
- const d = m.sort((h, w) => w.getPriority() - h.getPriority()).find((h) => h.status === "connected"), y = [];
607
- if (r.attachments)
608
- for (const h of r.attachments)
609
- h.contentType.startsWith("image/") && h.file && y.push({
611
+ }, [w, b, s, k]);
612
+ const O = async (c) => {
613
+ var y;
614
+ if (((y = c.content[0]) == null ? void 0 : y.type) !== "text") throw new Error("Only text messages are supported");
615
+ const f = c.content[0].text;
616
+ g((h) => [...h, { role: "user", type: "text", text: f }]), u(!0);
617
+ const d = b.sort((h, C) => C.getPriority() - h.getPriority()).find((h) => h.status === "connected"), m = [];
618
+ if (c.attachments)
619
+ for (const h of c.attachments)
620
+ h.contentType.startsWith("image/") && h.file && m.push({
610
621
  role: "user",
611
622
  image: {
612
623
  contentType: h.contentType,
613
- content: await oe(h.file)
624
+ content: await rt(h.file)
614
625
  },
615
626
  text: "",
616
627
  type: "text"
617
628
  });
618
- r.content && y.push({
629
+ c.content && m.push({
619
630
  role: "user",
620
- text: r.content[0].text,
631
+ text: c.content[0].text,
621
632
  type: "text"
622
- }), e == null || e.debug("Sending message:", y), await (d == null ? void 0 : d.send(y)), l(!1);
623
- }, O = E(() => (l(!1), f([]), U("new"), Promise.resolve()), []), L = E(() => Promise.resolve(), []), F = E(() => u, [u]), J = V({
624
- isRunning: c,
625
- messages: u,
626
- convertMessage: te,
627
- onNew: j,
628
- onCancel: O,
629
- onReload: L,
633
+ }), s == null || s.debug("Sending message:", m), await (d == null ? void 0 : d.sendPacket({ type: "request", payload: m })), u(!1);
634
+ }, L = v(() => (u(!1), g([]), T("new"), Promise.resolve()), []), F = v(() => Promise.resolve(), []), _ = v(() => p, [p]), J = H({
635
+ isRunning: l,
636
+ messages: p,
637
+ convertMessage: st,
638
+ onNew: O,
639
+ onCancel: L,
640
+ onReload: F,
630
641
  adapters: {
631
- attachments: new H([new Q()])
642
+ attachments: new Q([new X()])
632
643
  }
633
644
  });
634
- return /* @__PURE__ */ T.jsx(S.Provider, { value: { protocols: m, protocolsStatus: P, getMessages: F }, children: /* @__PURE__ */ T.jsx(X, { runtime: J, children: n }) });
645
+ return /* @__PURE__ */ $.jsx(P.Provider, { value: { protocols: b, protocolsStatus: k, getMessages: _ }, children: /* @__PURE__ */ $.jsx(Z, { runtime: J, children: n }) });
635
646
  }
636
- function de({ children: i, ...t }) {
637
- return /* @__PURE__ */ T.jsx(re, { ...t, children: i });
647
+ function ft({ children: i, ...e }) {
648
+ return /* @__PURE__ */ $.jsx(ct, { ...e, children: i });
638
649
  }
639
- function fe() {
640
- const i = R(S);
650
+ function pt() {
651
+ const i = A(P);
641
652
  if (!i)
642
653
  throw new Error("usePersonaRuntime must be used within a PersonaRuntimeProvider");
643
654
  return i;
644
655
  }
645
- function ce(i) {
646
- const t = R(S);
647
- if (!t)
648
- throw new Error("usePersonaRuntimeProtocol must be used within a PersonaRuntimeProvider");
649
- const e = t.protocols.find((s) => s.getName() === i);
656
+ function lt(i) {
657
+ const e = A(P);
650
658
  if (!e)
659
+ throw new Error("usePersonaRuntimeProtocol must be used within a PersonaRuntimeProvider");
660
+ const t = e.protocols.find((n) => n.getName() === i);
661
+ if (!t)
651
662
  return null;
652
- const n = t.protocolsStatus.get(e.getName());
663
+ const s = e.protocolsStatus.get(t.getName());
653
664
  return {
654
- ...e,
655
- connect: e.connect.bind(e),
656
- disconnect: e.disconnect.bind(e),
657
- send: e.send.bind(e),
658
- setSession: e.setSession.bind(e),
659
- addStatusChangeListener: e.addStatusChangeListener.bind(e),
660
- addMessageListener: e.addMessageListener.bind(e),
661
- getName: e.getName.bind(e),
662
- getPriority: e.getPriority.bind(e),
663
- status: n || e.status
665
+ ...t,
666
+ connect: t.connect.bind(t),
667
+ disconnect: t.disconnect.bind(t),
668
+ sendPacket: t.sendPacket.bind(t),
669
+ setSession: t.setSession.bind(t),
670
+ addStatusChangeListener: t.addStatusChangeListener.bind(t),
671
+ addPacketListener: t.addPacketListener.bind(t),
672
+ getName: t.getName.bind(t),
673
+ getPriority: t.getPriority.bind(t),
674
+ status: s || t.status
664
675
  };
665
676
  }
666
- function pe() {
667
- const i = R(S);
677
+ function yt() {
678
+ const i = A(P);
668
679
  if (!i)
669
680
  throw new Error("usePersonaRuntimeEndpoint must be used within a PersonaRuntimeProvider");
670
- for (const t of i.protocols)
671
- if (t.getName() === "rest")
672
- return t.config.apiUrl;
681
+ for (const e of i.protocols)
682
+ if (e.getName() === "rest")
683
+ return e.config.apiUrl;
673
684
  throw new Error("REST protocol not found");
674
685
  }
675
- function ge() {
676
- return ce("webrtc");
686
+ function mt() {
687
+ return lt("webrtc");
677
688
  }
678
- function ye() {
679
- const i = R(S);
689
+ function gt() {
690
+ const i = A(P);
680
691
  if (!i)
681
692
  throw new Error("usePersonaRuntimeMessages must be used within a PersonaRuntimeProvider");
682
693
  return i.getMessages();
683
694
  }
684
- class me {
695
+ class wt {
685
696
  constructor() {
686
697
  o(this, "prefix", "[Persona]");
687
698
  }
688
- log(t, ...e) {
689
- console.log(`${this.prefix} - ${t}`, ...e);
699
+ log(e, ...t) {
700
+ console.log(`${this.prefix} - ${e}`, ...t);
690
701
  }
691
- info(t, ...e) {
692
- console.info(`${this.prefix} - ${t}`, ...e);
702
+ info(e, ...t) {
703
+ console.info(`${this.prefix} - ${e}`, ...t);
693
704
  }
694
- warn(t, ...e) {
695
- console.warn(`${this.prefix} - ${t}`, ...e);
705
+ warn(e, ...t) {
706
+ console.warn(`${this.prefix} - ${e}`, ...t);
696
707
  }
697
- error(t, ...e) {
698
- console.error(`${this.prefix} - ${t}`, ...e);
708
+ error(e, ...t) {
709
+ console.error(`${this.prefix} - ${e}`, ...t);
699
710
  }
700
- debug(t, ...e) {
701
- console.debug(`${this.prefix} - ${t}`, ...e);
711
+ debug(e, ...t) {
712
+ console.debug(`${this.prefix} - ${e}`, ...t);
702
713
  }
703
714
  }
704
715
  export {
705
- me as PersonaConsoleLogger,
706
- A as PersonaProtocolBase,
707
- N as PersonaRESTProtocol,
708
- de as PersonaRuntimeProvider,
709
- ae as PersonaTransactionProtocol,
710
- z as PersonaWebRTCProtocol,
711
- I as PersonaWebSocketProtocol,
712
- fe as usePersonaRuntime,
713
- pe as usePersonaRuntimeEndpoint,
714
- ye as usePersonaRuntimeMessages,
715
- ce as usePersonaRuntimeProtocol,
716
- ge as usePersonaRuntimeWebRTCProtocol
716
+ wt as PersonaConsoleLogger,
717
+ E as PersonaProtocolBase,
718
+ z as PersonaRESTProtocol,
719
+ ft as PersonaRuntimeProvider,
720
+ ot as PersonaTransactionProtocol,
721
+ U as PersonaWebRTCProtocol,
722
+ D as PersonaWebSocketProtocol,
723
+ pt as usePersonaRuntime,
724
+ yt as usePersonaRuntimeEndpoint,
725
+ gt as usePersonaRuntimeMessages,
726
+ lt as usePersonaRuntimeProtocol,
727
+ mt as usePersonaRuntimeWebRTCProtocol
717
728
  };
718
729
  //# sourceMappingURL=bundle.es.js.map