@asgard-js/core 0.2.45-canary.1 → 0.2.46

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/index.mjs CHANGED
@@ -9,7 +9,7 @@ class de extends Error {
9
9
  function on(n) {
10
10
  return n instanceof de;
11
11
  }
12
- var $ = /* @__PURE__ */ ((n) => (n.RESET_CHANNEL = "RESET_CHANNEL", n.NONE = "NONE", n.RESPONSE_TOOL_CALL_CONSENT = "RESPONSE_TOOL_CALL_CONSENT", n))($ || {}), d = /* @__PURE__ */ ((n) => (n.INIT = "asgard.run.init", n.PROCESS = "asgard.process", n.PROCESS_START = "asgard.process.start", n.PROCESS_COMPLETE = "asgard.process.complete", n.MESSAGE = "asgard.message", n.MESSAGE_START = "asgard.message.start", n.MESSAGE_DELTA = "asgard.message.delta", n.MESSAGE_COMPLETE = "asgard.message.complete", n.TOOL_CALL = "asgard.tool_call", n.TOOL_CALL_START = "asgard.tool_call.start", n.TOOL_CALL_COMPLETE = "asgard.tool_call.complete", n.TOOL_CALL_CONSENT = "asgard.tool_call.consent", n.DONE = "asgard.run.done", n.ERROR = "asgard.run.error", n))(d || {}), De = /* @__PURE__ */ ((n) => (n.ALLOW_ONCE = "ALLOW_ONCE", n.ALLOW_ALWAYS = "ALLOW_ALWAYS", n.DENY_ONCE = "DENY_ONCE", n))(De || {}), He = /* @__PURE__ */ ((n) => (n.TEXT = "TEXT", n.HINT = "HINT", n.BUTTON = "BUTTON", n.IMAGE = "IMAGE", n.VIDEO = "VIDEO", n.AUDIO = "AUDIO", n.LOCATION = "LOCATION", n.CAROUSEL = "CAROUSEL", n.CHART = "CHART", n.TABLE = "TABLE", n))(He || {}), B = function(n, e) {
12
+ var $ = /* @__PURE__ */ ((n) => (n.RESET_CHANNEL = "RESET_CHANNEL", n.NONE = "NONE", n.RESPONSE_TOOL_CALL_CONSENT = "RESPONSE_TOOL_CALL_CONSENT", n))($ || {}), d = /* @__PURE__ */ ((n) => (n.INIT = "asgard.run.init", n.PROCESS = "asgard.process", n.PROCESS_START = "asgard.process.start", n.PROCESS_COMPLETE = "asgard.process.complete", n.MESSAGE = "asgard.message", n.MESSAGE_START = "asgard.message.start", n.MESSAGE_DELTA = "asgard.message.delta", n.MESSAGE_COMPLETE = "asgard.message.complete", n.TOOL_CALL = "asgard.tool_call", n.TOOL_CALL_START = "asgard.tool_call.start", n.TOOL_CALL_COMPLETE = "asgard.tool_call.complete", n.TOOL_CALL_CONSENT = "asgard.tool_call.consent", n.DONE = "asgard.run.done", n.ERROR = "asgard.run.error", n))(d || {}), De = /* @__PURE__ */ ((n) => (n.ALLOW_ONCE = "ALLOW_ONCE", n.ALLOW_ALWAYS = "ALLOW_ALWAYS", n.DENY_ONCE = "DENY_ONCE", n))(De || {}), He = /* @__PURE__ */ ((n) => (n.TEXT = "TEXT", n.HINT = "HINT", n.BUTTON = "BUTTON", n.IMAGE = "IMAGE", n.VIDEO = "VIDEO", n.AUDIO = "AUDIO", n.LOCATION = "LOCATION", n.CAROUSEL = "CAROUSEL", n.CHART = "CHART", n.TABLE = "TABLE", n.ATTACHMENT = "ATTACHMENT", n))(He || {}), B = function(n, e) {
13
13
  return B = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
14
14
  t.__proto__ = r;
15
15
  } || function(t, r) {
@@ -822,9 +822,9 @@ function Ae(n) {
822
822
  function ct() {
823
823
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
824
824
  }
825
- var _e = ct();
826
- function Te(n) {
827
- return m(n?.[_e]);
825
+ var Te = ct();
826
+ function _e(n) {
827
+ return m(n?.[Te]);
828
828
  }
829
829
  function Le(n) {
830
830
  return Fe(this, arguments, function() {
@@ -860,7 +860,7 @@ function Le(n) {
860
860
  function xe(n) {
861
861
  return m(n?.getReader);
862
862
  }
863
- function _(n) {
863
+ function T(n) {
864
864
  if (n instanceof g)
865
865
  return n;
866
866
  if (n != null) {
@@ -872,7 +872,7 @@ function _(n) {
872
872
  return ft(n);
873
873
  if (Ce(n))
874
874
  return Pe(n);
875
- if (Te(n))
875
+ if (_e(n))
876
876
  return dt(n);
877
877
  if (xe(n))
878
878
  return ht(n);
@@ -1005,10 +1005,10 @@ function Re(n, e) {
1005
1005
  });
1006
1006
  }
1007
1007
  function vt(n, e) {
1008
- return _(n).pipe(Re(e), Me(e));
1008
+ return T(n).pipe(Re(e), Me(e));
1009
1009
  }
1010
1010
  function yt(n, e) {
1011
- return _(n).pipe(Re(e), Me(e));
1011
+ return T(n).pipe(Re(e), Me(e));
1012
1012
  }
1013
1013
  function mt(n, e) {
1014
1014
  return new g(function(t) {
@@ -1022,7 +1022,7 @@ function bt(n, e) {
1022
1022
  return new g(function(t) {
1023
1023
  var r;
1024
1024
  return A(t, e, function() {
1025
- r = n[_e](), A(t, e, function() {
1025
+ r = n[Te](), A(t, e, function() {
1026
1026
  var o, i, s;
1027
1027
  try {
1028
1028
  o = r.next(), i = o.value, s = o.done;
@@ -1064,7 +1064,7 @@ function St(n, e) {
1064
1064
  return yt(n, e);
1065
1065
  if (Ce(n))
1066
1066
  return Ne(n, e);
1067
- if (Te(n))
1067
+ if (_e(n))
1068
1068
  return bt(n, e);
1069
1069
  if (xe(n))
1070
1070
  return gt(n, e);
@@ -1072,7 +1072,7 @@ function St(n, e) {
1072
1072
  throw Ae(n);
1073
1073
  }
1074
1074
  function te(n, e) {
1075
- return e ? St(n, e) : _(n);
1075
+ return e ? St(n, e) : T(n);
1076
1076
  }
1077
1077
  function Et() {
1078
1078
  for (var n = [], e = 0; e < arguments.length; e++)
@@ -1100,7 +1100,7 @@ function Ct(n) {
1100
1100
  return It(n, e);
1101
1101
  });
1102
1102
  }
1103
- var At = Array.isArray, _t = Object.getPrototypeOf, Tt = Object.prototype, Lt = Object.keys;
1103
+ var At = Array.isArray, Tt = Object.getPrototypeOf, _t = Object.prototype, Lt = Object.keys;
1104
1104
  function xt(n) {
1105
1105
  if (n.length === 1) {
1106
1106
  var e = n[0];
@@ -1119,7 +1119,7 @@ function xt(n) {
1119
1119
  return { args: n, keys: null };
1120
1120
  }
1121
1121
  function Pt(n) {
1122
- return n && typeof n == "object" && _t(n) === Tt;
1122
+ return n && typeof n == "object" && Tt(n) === _t;
1123
1123
  }
1124
1124
  function Mt(n, e) {
1125
1125
  return n.reduce(function(t, r, o) {
@@ -1165,7 +1165,7 @@ function Ut(n, e, t, r, o, i, s, a) {
1165
1165
  }, y = function(v) {
1166
1166
  u++;
1167
1167
  var E = !1;
1168
- _(t(v, f++)).subscribe(O(e, function(w) {
1168
+ T(t(v, f++)).subscribe(O(e, function(w) {
1169
1169
  e.next(w);
1170
1170
  }, function() {
1171
1171
  E = !0;
@@ -1174,13 +1174,13 @@ function Ut(n, e, t, r, o, i, s, a) {
1174
1174
  try {
1175
1175
  u--;
1176
1176
  for (var w = function() {
1177
- var T = c.shift();
1178
- s || y(T);
1177
+ var _ = c.shift();
1178
+ s || y(_);
1179
1179
  }; c.length && u < r; )
1180
1180
  w();
1181
1181
  h();
1182
- } catch (T) {
1183
- e.error(T);
1182
+ } catch (_) {
1183
+ e.error(_);
1184
1184
  }
1185
1185
  }));
1186
1186
  };
@@ -1193,7 +1193,7 @@ function H(n, e, t) {
1193
1193
  return t === void 0 && (t = 1 / 0), m(e) ? H(function(r, o) {
1194
1194
  return F(function(i, s) {
1195
1195
  return e(r, i, o, s);
1196
- })(_(n(r, o)));
1196
+ })(T(n(r, o)));
1197
1197
  }, t) : (typeof e == "number" && (t = e), L(function(r, o) {
1198
1198
  return Ut(r, o, n, t);
1199
1199
  }));
@@ -1230,7 +1230,7 @@ function jt(n) {
1230
1230
  }
1231
1231
  function Dt(n, e) {
1232
1232
  return H(function(t, r) {
1233
- return _(n(t, r)).pipe($t(1), jt(t));
1233
+ return T(n(t, r)).pipe($t(1), jt(t));
1234
1234
  });
1235
1235
  }
1236
1236
  function Ht(n, e) {
@@ -1257,7 +1257,7 @@ function Gt(n) {
1257
1257
  f ? (f.unsubscribe(), f = null, p()) : h = !0;
1258
1258
  };
1259
1259
  if (o != null) {
1260
- var v = typeof o == "number" ? Ue(o) : _(o(l, u)), E = O(c, function() {
1260
+ var v = typeof o == "number" ? Ue(o) : T(o(l, u)), E = O(c, function() {
1261
1261
  E.unsubscribe(), y();
1262
1262
  }, function() {
1263
1263
  c.complete();
@@ -1274,7 +1274,7 @@ function Gt(n) {
1274
1274
  }
1275
1275
  function Ft(n) {
1276
1276
  return L(function(e, t) {
1277
- _(n).subscribe(O(t, function() {
1277
+ T(n).subscribe(O(t, function() {
1278
1278
  return t.complete();
1279
1279
  }, W)), !t.closed && e.subscribe(t);
1280
1280
  });
@@ -1371,11 +1371,11 @@ function Xt(n, e) {
1371
1371
  }
1372
1372
  c || document.addEventListener("visibilitychange", v);
1373
1373
  let E = Wt, w = 0;
1374
- function T() {
1374
+ function _() {
1375
1375
  document.removeEventListener("visibilitychange", v), window.clearTimeout(w), y.abort();
1376
1376
  }
1377
1377
  t?.addEventListener("abort", () => {
1378
- T(), p();
1378
+ _(), p();
1379
1379
  });
1380
1380
  const $e = u ?? window.fetch, je = o ?? Jt;
1381
1381
  async function V() {
@@ -1387,14 +1387,14 @@ function Xt(n, e) {
1387
1387
  C ? l[le] = C : delete l[le];
1388
1388
  }, (C) => {
1389
1389
  E = C;
1390
- }, i))), s?.(), T(), p();
1390
+ }, i))), s?.(), _(), p();
1391
1391
  } catch (U) {
1392
1392
  if (!y.signal.aborted)
1393
1393
  try {
1394
1394
  const C = (Y = a?.(U)) !== null && Y !== void 0 ? Y : E;
1395
1395
  window.clearTimeout(w), w = window.setTimeout(V, C);
1396
1396
  } catch (C) {
1397
- T(), h(C);
1397
+ _(), h(C);
1398
1398
  }
1399
1399
  }
1400
1400
  }