@asgard-js/core 0.3.59 → 0.3.60
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -37
- package/dist/index.mjs.map +1 -1
- package/dist/lib/channel.d.ts.map +1 -1
- package/dist/lib/conversation.d.ts.map +1 -1
- package/dist/types/channel.d.ts +0 -6
- package/dist/types/channel.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -150,16 +150,16 @@ function Ee(n, t) {
|
|
|
150
150
|
var V;
|
|
151
151
|
p = new AbortController();
|
|
152
152
|
try {
|
|
153
|
-
const
|
|
154
|
-
await We(
|
|
153
|
+
const D = await Ye(n, Object.assign(Object.assign({}, h), { headers: d, signal: p.signal }));
|
|
154
|
+
await We(D), await ze(D.body, Je(Qe((C) => {
|
|
155
155
|
C ? d[le] = C : delete d[le];
|
|
156
156
|
}, (C) => {
|
|
157
157
|
L = C;
|
|
158
158
|
}, o))), i?.(), _(), m();
|
|
159
|
-
} catch (
|
|
159
|
+
} catch (D) {
|
|
160
160
|
if (!p.signal.aborted)
|
|
161
161
|
try {
|
|
162
|
-
const C = (V = a?.(
|
|
162
|
+
const C = (V = a?.(D)) !== null && V !== void 0 ? V : L;
|
|
163
163
|
window.clearTimeout(E), E = window.setTimeout(X, C);
|
|
164
164
|
} catch (C) {
|
|
165
165
|
_(), v(C);
|
|
@@ -287,7 +287,7 @@ function N(n) {
|
|
|
287
287
|
};
|
|
288
288
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function F(n, t) {
|
|
291
291
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
292
292
|
if (!e) return n;
|
|
293
293
|
var r = e.call(n), s, o = [], i;
|
|
@@ -304,7 +304,7 @@ function D(n, t) {
|
|
|
304
304
|
}
|
|
305
305
|
return o;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function H(n, t, e) {
|
|
308
308
|
if (e || arguments.length === 2) for (var r = 0, s = t.length, o; r < s; r++)
|
|
309
309
|
(o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
|
|
310
310
|
return n.concat(o || Array.prototype.slice.call(t));
|
|
@@ -436,7 +436,7 @@ var j = (function() {
|
|
|
436
436
|
try {
|
|
437
437
|
de(p);
|
|
438
438
|
} catch (f) {
|
|
439
|
-
o = o ?? [], f instanceof z ? o =
|
|
439
|
+
o = o ?? [], f instanceof z ? o = H(H([], F(o)), F(f.errors)) : o.push(f);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
} catch (f) {
|
|
@@ -494,7 +494,7 @@ var it = {
|
|
|
494
494
|
setTimeout: function(n, t) {
|
|
495
495
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
496
496
|
e[r - 2] = arguments[r];
|
|
497
|
-
return setTimeout.apply(void 0,
|
|
497
|
+
return setTimeout.apply(void 0, H([n, t], F(e)));
|
|
498
498
|
},
|
|
499
499
|
clearTimeout: function(n) {
|
|
500
500
|
return clearTimeout(n);
|
|
@@ -874,7 +874,7 @@ var mt = (function(n) {
|
|
|
874
874
|
setInterval: function(n, t) {
|
|
875
875
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
876
876
|
e[r - 2] = arguments[r];
|
|
877
|
-
return setInterval.apply(void 0,
|
|
877
|
+
return setInterval.apply(void 0, H([n, t], F(e)));
|
|
878
878
|
},
|
|
879
879
|
clearInterval: function(n) {
|
|
880
880
|
return clearInterval(n);
|
|
@@ -991,7 +991,7 @@ var je = Tt();
|
|
|
991
991
|
function $e(n) {
|
|
992
992
|
return g(n?.[je]);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Fe(n) {
|
|
995
995
|
return st(this, arguments, function() {
|
|
996
996
|
var e, r, s, o;
|
|
997
997
|
return Ie(this, function(i) {
|
|
@@ -1022,7 +1022,7 @@ function De(n) {
|
|
|
1022
1022
|
});
|
|
1023
1023
|
});
|
|
1024
1024
|
}
|
|
1025
|
-
function
|
|
1025
|
+
function He(n) {
|
|
1026
1026
|
return g(n?.getReader);
|
|
1027
1027
|
}
|
|
1028
1028
|
function U(n) {
|
|
@@ -1036,10 +1036,10 @@ function U(n) {
|
|
|
1036
1036
|
if (Me(n))
|
|
1037
1037
|
return Ot(n);
|
|
1038
1038
|
if (Ne(n))
|
|
1039
|
-
return
|
|
1039
|
+
return De(n);
|
|
1040
1040
|
if ($e(n))
|
|
1041
1041
|
return At(n);
|
|
1042
|
-
if (
|
|
1042
|
+
if (He(n))
|
|
1043
1043
|
return Pt(n);
|
|
1044
1044
|
}
|
|
1045
1045
|
throw Re(n);
|
|
@@ -1089,7 +1089,7 @@ function At(n) {
|
|
|
1089
1089
|
t.complete();
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function De(n) {
|
|
1093
1093
|
return new S(function(t) {
|
|
1094
1094
|
Lt(n, t).catch(function(e) {
|
|
1095
1095
|
return t.error(e);
|
|
@@ -1097,7 +1097,7 @@ function He(n) {
|
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
function Pt(n) {
|
|
1100
|
-
return
|
|
1100
|
+
return De(Fe(n));
|
|
1101
1101
|
}
|
|
1102
1102
|
function Lt(n, t) {
|
|
1103
1103
|
var e, r, s, o;
|
|
@@ -1217,7 +1217,7 @@ function qe(n, t) {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
}
|
|
1219
1219
|
function Nt(n, t) {
|
|
1220
|
-
return qe(
|
|
1220
|
+
return qe(Fe(n), t);
|
|
1221
1221
|
}
|
|
1222
1222
|
function Rt(n, t) {
|
|
1223
1223
|
if (n != null) {
|
|
@@ -1231,7 +1231,7 @@ function Rt(n, t) {
|
|
|
1231
1231
|
return qe(n, t);
|
|
1232
1232
|
if ($e(n))
|
|
1233
1233
|
return kt(n, t);
|
|
1234
|
-
if (
|
|
1234
|
+
if (He(n))
|
|
1235
1235
|
return Nt(n, t);
|
|
1236
1236
|
}
|
|
1237
1237
|
throw Re(n);
|
|
@@ -1256,13 +1256,13 @@ function R(n, t) {
|
|
|
1256
1256
|
}));
|
|
1257
1257
|
});
|
|
1258
1258
|
}
|
|
1259
|
-
var
|
|
1260
|
-
function
|
|
1261
|
-
return
|
|
1259
|
+
var Ft = Array.isArray;
|
|
1260
|
+
function Ht(n, t) {
|
|
1261
|
+
return Ft(t) ? n.apply(void 0, H([], F(t))) : n(t);
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function Dt(n) {
|
|
1264
1264
|
return R(function(t) {
|
|
1265
|
-
return
|
|
1265
|
+
return Ht(n, t);
|
|
1266
1266
|
});
|
|
1267
1267
|
}
|
|
1268
1268
|
var Bt = Array.isArray, Gt = Object.getPrototypeOf, qt = Object.prototype, Kt = Object.keys;
|
|
@@ -1300,7 +1300,7 @@ function Vt() {
|
|
|
1300
1300
|
var a = new S(zt(o, e, i ? function(c) {
|
|
1301
1301
|
return Xt(i, c);
|
|
1302
1302
|
} : W));
|
|
1303
|
-
return r ? a.pipe(
|
|
1303
|
+
return r ? a.pipe(Dt(r)) : a;
|
|
1304
1304
|
}
|
|
1305
1305
|
function zt(n, t, e) {
|
|
1306
1306
|
return e === void 0 && (e = W), function(r) {
|
|
@@ -2104,7 +2104,6 @@ class b {
|
|
|
2104
2104
|
typingText: "",
|
|
2105
2105
|
messageId: e.messageId,
|
|
2106
2106
|
message: e,
|
|
2107
|
-
time: /* @__PURE__ */ new Date(),
|
|
2108
2107
|
traceId: t.traceId,
|
|
2109
2108
|
raw: ""
|
|
2110
2109
|
}), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2122,7 +2121,6 @@ class b {
|
|
|
2122
2121
|
typingText: `${s?.typingText ?? ""}${e.text}`,
|
|
2123
2122
|
messageId: e.messageId,
|
|
2124
2123
|
message: e,
|
|
2125
|
-
time: /* @__PURE__ */ new Date(),
|
|
2126
2124
|
traceId: t.traceId ?? s?.traceId,
|
|
2127
2125
|
raw: s?.raw ?? ""
|
|
2128
2126
|
}), new b({ messages: o, pendingConsent: this.pendingConsent });
|
|
@@ -2138,7 +2136,6 @@ class b {
|
|
|
2138
2136
|
typingText: null,
|
|
2139
2137
|
messageId: e.messageId,
|
|
2140
2138
|
message: e,
|
|
2141
|
-
time: /* @__PURE__ */ new Date(),
|
|
2142
2139
|
traceId: t.traceId ?? (s?.type === "bot" ? s.traceId : void 0),
|
|
2143
2140
|
raw: JSON.stringify(t)
|
|
2144
2141
|
}), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2152,7 +2149,6 @@ class b {
|
|
|
2152
2149
|
messageId: e.messageId,
|
|
2153
2150
|
text: e.text,
|
|
2154
2151
|
isThinking: !0,
|
|
2155
|
-
time: /* @__PURE__ */ new Date(),
|
|
2156
2152
|
traceId: t.traceId
|
|
2157
2153
|
};
|
|
2158
2154
|
return r.set(e.messageId, s), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2167,7 +2163,6 @@ class b {
|
|
|
2167
2163
|
messageId: e.messageId,
|
|
2168
2164
|
text: `${s?.text ?? ""}${e.text}`,
|
|
2169
2165
|
isThinking: !0,
|
|
2170
|
-
time: s?.time ?? /* @__PURE__ */ new Date(),
|
|
2171
2166
|
traceId: t.traceId ?? s?.traceId
|
|
2172
2167
|
};
|
|
2173
2168
|
return o.set(e.messageId, i), new b({ messages: o, pendingConsent: this.pendingConsent });
|
|
@@ -2182,7 +2177,6 @@ class b {
|
|
|
2182
2177
|
// replay (no start/delta) still renders the whole text.
|
|
2183
2178
|
text: e.text,
|
|
2184
2179
|
isThinking: !1,
|
|
2185
|
-
time: s?.time ?? /* @__PURE__ */ new Date(),
|
|
2186
2180
|
traceId: t.traceId ?? s?.traceId
|
|
2187
2181
|
};
|
|
2188
2182
|
return o.set(e.messageId, i), new b({ messages: o, pendingConsent: this.pendingConsent });
|
|
@@ -2197,7 +2191,6 @@ class b {
|
|
|
2197
2191
|
blobIds: e.blobIds,
|
|
2198
2192
|
customMessageId: e.customMessageId,
|
|
2199
2193
|
identityHint: e.identityHint,
|
|
2200
|
-
time: /* @__PURE__ */ new Date(),
|
|
2201
2194
|
traceId: t.traceId
|
|
2202
2195
|
};
|
|
2203
2196
|
return s.set(e.messageId, o), new b({ messages: s, pendingConsent: this.pendingConsent });
|
|
@@ -2209,7 +2202,6 @@ class b {
|
|
|
2209
2202
|
eventType: l.ERROR,
|
|
2210
2203
|
messageId: e,
|
|
2211
2204
|
error: r,
|
|
2212
|
-
time: /* @__PURE__ */ new Date(),
|
|
2213
2205
|
traceId: t.traceId
|
|
2214
2206
|
}), new b({ messages: s, pendingConsent: this.pendingConsent });
|
|
2215
2207
|
}
|
|
@@ -2229,7 +2221,6 @@ class b {
|
|
|
2229
2221
|
toolUseId: e.toolUseId,
|
|
2230
2222
|
parentToolUseId: e.parentToolUseId,
|
|
2231
2223
|
isComplete: !1,
|
|
2232
|
-
time: /* @__PURE__ */ new Date(),
|
|
2233
2224
|
traceId: t.traceId
|
|
2234
2225
|
};
|
|
2235
2226
|
return r.set(s, o), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2264,7 +2255,6 @@ class b {
|
|
|
2264
2255
|
isError: e.isError,
|
|
2265
2256
|
sidecar: e.toolUseResultSidecar,
|
|
2266
2257
|
isComplete: !0,
|
|
2267
|
-
time: /* @__PURE__ */ new Date(),
|
|
2268
2258
|
traceId: t.traceId
|
|
2269
2259
|
};
|
|
2270
2260
|
r.set(s, i);
|
|
@@ -2284,7 +2274,6 @@ class b {
|
|
|
2284
2274
|
agentId: e.agentId,
|
|
2285
2275
|
subagentType: e.subagentType,
|
|
2286
2276
|
description: e.description,
|
|
2287
|
-
time: /* @__PURE__ */ new Date(),
|
|
2288
2277
|
traceId: t.traceId
|
|
2289
2278
|
};
|
|
2290
2279
|
return r.delete(s), r.set(s, o), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2299,7 +2288,6 @@ class b {
|
|
|
2299
2288
|
subagentType: e.subagentType,
|
|
2300
2289
|
status: e.status,
|
|
2301
2290
|
summary: e.summary,
|
|
2302
|
-
time: /* @__PURE__ */ new Date(),
|
|
2303
2291
|
traceId: t.traceId
|
|
2304
2292
|
};
|
|
2305
2293
|
return r.delete(s), r.set(s, o), new b({ messages: r, pendingConsent: this.pendingConsent });
|
|
@@ -2804,8 +2792,7 @@ class q {
|
|
|
2804
2792
|
text: o,
|
|
2805
2793
|
blobIds: t.blobIds,
|
|
2806
2794
|
filePreviewUrls: t.filePreviewUrls,
|
|
2807
|
-
documentNames: t.documentNames
|
|
2808
|
-
time: /* @__PURE__ */ new Date()
|
|
2795
|
+
documentNames: t.documentNames
|
|
2809
2796
|
})
|
|
2810
2797
|
), this.fetchSse(
|
|
2811
2798
|
"user",
|