@asgard-js/core 0.3.24 → 0.3.25
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +378 -347
- package/dist/index.mjs.map +1 -1
- package/dist/lib/client.d.ts +8 -2
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/types/sandbox-fs.d.ts +9 -0
- package/dist/types/sandbox-fs.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class w extends Error {
|
|
2
2
|
status;
|
|
3
3
|
statusText;
|
|
4
4
|
body;
|
|
@@ -7,25 +7,153 @@ class I extends Error {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
function Tn(n) {
|
|
10
|
-
return n instanceof
|
|
10
|
+
return n instanceof w;
|
|
11
11
|
}
|
|
12
|
-
var $ = /* @__PURE__ */ ((n) => (n.RESET_CHANNEL = "RESET_CHANNEL", n.NONE = "NONE", n.RESPONSE_TOOL_CALL_CONSENT = "RESPONSE_TOOL_CALL_CONSENT", n.NUDGE = "NUDGE", 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.MESSAGE_USER = "asgard.message.user", n.MESSAGE_THINKING_START = "asgard.message.thinking.start", n.MESSAGE_THINKING_DELTA = "asgard.message.thinking.delta", n.MESSAGE_THINKING_COMPLETE = "asgard.message.thinking.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.SUBAGENT_START = "asgard.subagent.start", n.SUBAGENT_COMPLETE = "asgard.subagent.complete", n.CHANNEL_TITLE_UPDATE = "asgard.channel.title.update", n.SANDBOX_LAUNCH = "asgard.sandbox.launch", n.SANDBOX_READY = "asgard.sandbox.ready", n.DONE = "asgard.run.done", n.ERROR = "asgard.run.error", n))(d || {}),
|
|
13
|
-
|
|
12
|
+
var $ = /* @__PURE__ */ ((n) => (n.RESET_CHANNEL = "RESET_CHANNEL", n.NONE = "NONE", n.RESPONSE_TOOL_CALL_CONSENT = "RESPONSE_TOOL_CALL_CONSENT", n.NUDGE = "NUDGE", 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.MESSAGE_USER = "asgard.message.user", n.MESSAGE_THINKING_START = "asgard.message.thinking.start", n.MESSAGE_THINKING_DELTA = "asgard.message.thinking.delta", n.MESSAGE_THINKING_COMPLETE = "asgard.message.thinking.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.SUBAGENT_START = "asgard.subagent.start", n.SUBAGENT_COMPLETE = "asgard.subagent.complete", n.CHANNEL_TITLE_UPDATE = "asgard.channel.title.update", n.SANDBOX_LAUNCH = "asgard.sandbox.launch", n.SANDBOX_READY = "asgard.sandbox.ready", n.DONE = "asgard.run.done", n.ERROR = "asgard.run.error", n))(d || {}), Ke = /* @__PURE__ */ ((n) => (n.ALLOW_ONCE = "ALLOW_ONCE", n.ALLOW_ALWAYS = "ALLOW_ALWAYS", n.DENY_ONCE = "DENY_ONCE", n))(Ke || {}), qe = /* @__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))(qe || {});
|
|
13
|
+
async function Ye(n, t) {
|
|
14
|
+
const e = n.getReader();
|
|
15
|
+
let r;
|
|
16
|
+
for (; !(r = await e.read()).done; )
|
|
17
|
+
t(r.value);
|
|
18
|
+
}
|
|
19
|
+
function Xe(n) {
|
|
20
|
+
let t, e, r, s = !1;
|
|
21
|
+
return function(i) {
|
|
22
|
+
t === void 0 ? (t = i, e = 0, r = -1) : t = We(t, i);
|
|
23
|
+
const a = t.length;
|
|
24
|
+
let c = 0;
|
|
25
|
+
for (; e < a; ) {
|
|
26
|
+
s && (t[e] === 10 && (c = ++e), s = !1);
|
|
27
|
+
let u = -1;
|
|
28
|
+
for (; e < a && u === -1; ++e)
|
|
29
|
+
switch (t[e]) {
|
|
30
|
+
case 58:
|
|
31
|
+
r === -1 && (r = e - c);
|
|
32
|
+
break;
|
|
33
|
+
case 13:
|
|
34
|
+
s = !0;
|
|
35
|
+
case 10:
|
|
36
|
+
u = e;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
if (u === -1)
|
|
40
|
+
break;
|
|
41
|
+
n(t.subarray(c, u), r), c = e, r = -1;
|
|
42
|
+
}
|
|
43
|
+
c === a ? t = void 0 : c !== 0 && (t = t.subarray(c), e -= c);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function Ve(n, t, e) {
|
|
47
|
+
let r = ie();
|
|
48
|
+
const s = new TextDecoder();
|
|
49
|
+
return function(i, a) {
|
|
50
|
+
if (i.length === 0)
|
|
51
|
+
e?.(r), r = ie();
|
|
52
|
+
else if (a > 0) {
|
|
53
|
+
const c = s.decode(i.subarray(0, a)), u = a + (i[a + 1] === 32 ? 2 : 1), h = s.decode(i.subarray(u));
|
|
54
|
+
switch (c) {
|
|
55
|
+
case "data":
|
|
56
|
+
r.data = r.data ? r.data + `
|
|
57
|
+
` + h : h;
|
|
58
|
+
break;
|
|
59
|
+
case "event":
|
|
60
|
+
r.event = h;
|
|
61
|
+
break;
|
|
62
|
+
case "id":
|
|
63
|
+
n(r.id = h);
|
|
64
|
+
break;
|
|
65
|
+
case "retry":
|
|
66
|
+
const m = parseInt(h, 10);
|
|
67
|
+
isNaN(m) || t(r.retry = m);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function We(n, t) {
|
|
74
|
+
const e = new Uint8Array(n.length + t.length);
|
|
75
|
+
return e.set(n), e.set(t, n.length), e;
|
|
76
|
+
}
|
|
77
|
+
function ie() {
|
|
78
|
+
return {
|
|
79
|
+
data: "",
|
|
80
|
+
event: "",
|
|
81
|
+
id: "",
|
|
82
|
+
retry: void 0
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
var ze = function(n, t) {
|
|
86
|
+
var e = {};
|
|
87
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
|
|
88
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
89
|
+
for (var s = 0, r = Object.getOwnPropertySymbols(n); s < r.length; s++)
|
|
90
|
+
t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (e[r[s]] = n[r[s]]);
|
|
91
|
+
return e;
|
|
92
|
+
};
|
|
93
|
+
const Q = "text/event-stream", Je = 1e3, ae = "last-event-id";
|
|
94
|
+
function ve(n, t) {
|
|
95
|
+
var { signal: e, headers: r, onopen: s, onmessage: o, onclose: i, onerror: a, openWhenHidden: c, fetch: u } = t, h = ze(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
96
|
+
return new Promise((m, b) => {
|
|
97
|
+
const l = Object.assign({}, r);
|
|
98
|
+
l.accept || (l.accept = Q);
|
|
99
|
+
let f;
|
|
100
|
+
function p() {
|
|
101
|
+
f.abort(), document.hidden || V();
|
|
102
|
+
}
|
|
103
|
+
c || document.addEventListener("visibilitychange", p);
|
|
104
|
+
let L = Je, E = 0;
|
|
105
|
+
function _() {
|
|
106
|
+
document.removeEventListener("visibilitychange", p), window.clearTimeout(E), f.abort();
|
|
107
|
+
}
|
|
108
|
+
e?.addEventListener("abort", () => {
|
|
109
|
+
_(), m();
|
|
110
|
+
});
|
|
111
|
+
const Ge = u ?? window.fetch, Be = s ?? Qe;
|
|
112
|
+
async function V() {
|
|
113
|
+
var W;
|
|
114
|
+
f = new AbortController();
|
|
115
|
+
try {
|
|
116
|
+
const F = await Ge(n, Object.assign(Object.assign({}, h), { headers: l, signal: f.signal }));
|
|
117
|
+
await Be(F), await Ye(F.body, Xe(Ve((x) => {
|
|
118
|
+
x ? l[ae] = x : delete l[ae];
|
|
119
|
+
}, (x) => {
|
|
120
|
+
L = x;
|
|
121
|
+
}, o))), i?.(), _(), m();
|
|
122
|
+
} catch (F) {
|
|
123
|
+
if (!f.signal.aborted)
|
|
124
|
+
try {
|
|
125
|
+
const x = (W = a?.(F)) !== null && W !== void 0 ? W : L;
|
|
126
|
+
window.clearTimeout(E), E = window.setTimeout(V, x);
|
|
127
|
+
} catch (x) {
|
|
128
|
+
_(), b(x);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
V();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function Qe(n) {
|
|
136
|
+
const t = n.headers.get("content-type");
|
|
137
|
+
if (!t?.startsWith(Q))
|
|
138
|
+
throw new Error(`Expected content-type to be ${Q}, Actual: ${t}`);
|
|
139
|
+
}
|
|
140
|
+
var Z = function(n, t) {
|
|
141
|
+
return Z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
14
142
|
e.__proto__ = r;
|
|
15
143
|
} || function(e, r) {
|
|
16
144
|
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
17
|
-
},
|
|
145
|
+
}, Z(n, t);
|
|
18
146
|
};
|
|
19
147
|
function T(n, t) {
|
|
20
148
|
if (typeof t != "function" && t !== null)
|
|
21
149
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
22
|
-
|
|
150
|
+
Z(n, t);
|
|
23
151
|
function e() {
|
|
24
152
|
this.constructor = n;
|
|
25
153
|
}
|
|
26
154
|
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
27
155
|
}
|
|
28
|
-
function
|
|
156
|
+
function Ze(n, t, e, r) {
|
|
29
157
|
function s(o) {
|
|
30
158
|
return o instanceof e ? o : new e(function(i) {
|
|
31
159
|
i(o);
|
|
@@ -52,7 +180,7 @@ function qe(n, t, e, r) {
|
|
|
52
180
|
u((r = r.apply(n, t || [])).next());
|
|
53
181
|
});
|
|
54
182
|
}
|
|
55
|
-
function
|
|
183
|
+
function ye(n, t) {
|
|
56
184
|
var e = { label: 0, sent: function() {
|
|
57
185
|
if (o[0] & 1) throw o[1];
|
|
58
186
|
return o[1];
|
|
@@ -144,10 +272,10 @@ function H(n, t, e) {
|
|
|
144
272
|
(o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
|
|
145
273
|
return n.concat(o || Array.prototype.slice.call(t));
|
|
146
274
|
}
|
|
147
|
-
function
|
|
148
|
-
return this instanceof
|
|
275
|
+
function M(n) {
|
|
276
|
+
return this instanceof M ? (this.v = n, this) : new M(n);
|
|
149
277
|
}
|
|
150
|
-
function
|
|
278
|
+
function et(n, t, e) {
|
|
151
279
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
152
280
|
var r = e.apply(n, t || []), s, o = [];
|
|
153
281
|
return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", i), s[Symbol.asyncIterator] = function() {
|
|
@@ -160,8 +288,8 @@ function Ye(n, t, e) {
|
|
|
160
288
|
}
|
|
161
289
|
function a(l, f) {
|
|
162
290
|
r[l] && (s[l] = function(p) {
|
|
163
|
-
return new Promise(function(L,
|
|
164
|
-
o.push([l, p, L,
|
|
291
|
+
return new Promise(function(L, E) {
|
|
292
|
+
o.push([l, p, L, E]) > 1 || c(l, p);
|
|
165
293
|
});
|
|
166
294
|
}, f && (s[l] = f(s[l])));
|
|
167
295
|
}
|
|
@@ -173,7 +301,7 @@ function Ye(n, t, e) {
|
|
|
173
301
|
}
|
|
174
302
|
}
|
|
175
303
|
function u(l) {
|
|
176
|
-
l.value instanceof
|
|
304
|
+
l.value instanceof M ? Promise.resolve(l.value.v).then(h, m) : b(o[0][2], l);
|
|
177
305
|
}
|
|
178
306
|
function h(l) {
|
|
179
307
|
c("next", l);
|
|
@@ -185,7 +313,7 @@ function Ye(n, t, e) {
|
|
|
185
313
|
l(f), o.shift(), o.length && c(o[0][0], o[0][1]);
|
|
186
314
|
}
|
|
187
315
|
}
|
|
188
|
-
function
|
|
316
|
+
function tt(n) {
|
|
189
317
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
190
318
|
var t = n[Symbol.asyncIterator], e;
|
|
191
319
|
return t ? t.call(n) : (n = typeof k == "function" ? k(n) : n[Symbol.iterator](), e = {}, r("next"), r("throw"), r("return"), e[Symbol.asyncIterator] = function() {
|
|
@@ -207,13 +335,13 @@ function Xe(n) {
|
|
|
207
335
|
function g(n) {
|
|
208
336
|
return typeof n == "function";
|
|
209
337
|
}
|
|
210
|
-
function
|
|
338
|
+
function Se(n) {
|
|
211
339
|
var t = function(r) {
|
|
212
340
|
Error.call(r), r.stack = new Error().stack;
|
|
213
341
|
}, e = n(t);
|
|
214
342
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
215
343
|
}
|
|
216
|
-
var z =
|
|
344
|
+
var z = Se(function(n) {
|
|
217
345
|
return function(e) {
|
|
218
346
|
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
219
347
|
` + e.map(function(r, s) {
|
|
@@ -269,7 +397,7 @@ var R = (function() {
|
|
|
269
397
|
for (var b = k(m), l = b.next(); !l.done; l = b.next()) {
|
|
270
398
|
var f = l.value;
|
|
271
399
|
try {
|
|
272
|
-
|
|
400
|
+
ce(f);
|
|
273
401
|
} catch (p) {
|
|
274
402
|
o = o ?? [], p instanceof z ? o = H(H([], D(o)), D(p.errors)) : o.push(p);
|
|
275
403
|
}
|
|
@@ -291,7 +419,7 @@ var R = (function() {
|
|
|
291
419
|
var e;
|
|
292
420
|
if (t && t !== this)
|
|
293
421
|
if (this.closed)
|
|
294
|
-
|
|
422
|
+
ce(t);
|
|
295
423
|
else {
|
|
296
424
|
if (t instanceof n) {
|
|
297
425
|
if (t.closed || t._hasParent(this))
|
|
@@ -316,16 +444,16 @@ var R = (function() {
|
|
|
316
444
|
var t = new n();
|
|
317
445
|
return t.closed = !0, t;
|
|
318
446
|
})(), n;
|
|
319
|
-
})(),
|
|
320
|
-
function
|
|
447
|
+
})(), we = R.EMPTY;
|
|
448
|
+
function Ee(n) {
|
|
321
449
|
return n instanceof R || n && "closed" in n && g(n.remove) && g(n.add) && g(n.unsubscribe);
|
|
322
450
|
}
|
|
323
|
-
function
|
|
451
|
+
function ce(n) {
|
|
324
452
|
g(n) ? n() : n.unsubscribe();
|
|
325
453
|
}
|
|
326
|
-
var
|
|
454
|
+
var nt = {
|
|
327
455
|
Promise: void 0
|
|
328
|
-
},
|
|
456
|
+
}, rt = {
|
|
329
457
|
setTimeout: function(n, t) {
|
|
330
458
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
331
459
|
e[r - 2] = arguments[r];
|
|
@@ -336,12 +464,12 @@ var Ve = {
|
|
|
336
464
|
},
|
|
337
465
|
delegate: void 0
|
|
338
466
|
};
|
|
339
|
-
function
|
|
340
|
-
|
|
467
|
+
function Ie(n) {
|
|
468
|
+
rt.setTimeout(function() {
|
|
341
469
|
throw n;
|
|
342
470
|
});
|
|
343
471
|
}
|
|
344
|
-
function
|
|
472
|
+
function ee() {
|
|
345
473
|
}
|
|
346
474
|
function B(n) {
|
|
347
475
|
n();
|
|
@@ -350,10 +478,10 @@ var ne = (function(n) {
|
|
|
350
478
|
T(t, n);
|
|
351
479
|
function t(e) {
|
|
352
480
|
var r = n.call(this) || this;
|
|
353
|
-
return r.isStopped = !1, e ? (r.destination = e,
|
|
481
|
+
return r.isStopped = !1, e ? (r.destination = e, Ee(e) && e.add(r)) : r.destination = it, r;
|
|
354
482
|
}
|
|
355
483
|
return t.create = function(e, r, s) {
|
|
356
|
-
return new
|
|
484
|
+
return new te(e, r, s);
|
|
357
485
|
}, t.prototype.next = function(e) {
|
|
358
486
|
this.isStopped || this._next(e);
|
|
359
487
|
}, t.prototype.error = function(e) {
|
|
@@ -377,7 +505,7 @@ var ne = (function(n) {
|
|
|
377
505
|
this.unsubscribe();
|
|
378
506
|
}
|
|
379
507
|
}, t;
|
|
380
|
-
})(R),
|
|
508
|
+
})(R), st = (function() {
|
|
381
509
|
function n(t) {
|
|
382
510
|
this.partialObserver = t;
|
|
383
511
|
}
|
|
@@ -408,7 +536,7 @@ var ne = (function(n) {
|
|
|
408
536
|
G(e);
|
|
409
537
|
}
|
|
410
538
|
}, n;
|
|
411
|
-
})(),
|
|
539
|
+
})(), te = (function(n) {
|
|
412
540
|
T(t, n);
|
|
413
541
|
function t(e, r, s) {
|
|
414
542
|
var o = n.call(this) || this, i;
|
|
@@ -416,28 +544,28 @@ var ne = (function(n) {
|
|
|
416
544
|
next: e ?? void 0,
|
|
417
545
|
error: r ?? void 0,
|
|
418
546
|
complete: s ?? void 0
|
|
419
|
-
} : i = e, o.destination = new
|
|
547
|
+
} : i = e, o.destination = new st(i), o;
|
|
420
548
|
}
|
|
421
549
|
return t;
|
|
422
550
|
})(ne);
|
|
423
551
|
function G(n) {
|
|
424
|
-
|
|
552
|
+
Ie(n);
|
|
425
553
|
}
|
|
426
|
-
function
|
|
554
|
+
function ot(n) {
|
|
427
555
|
throw n;
|
|
428
556
|
}
|
|
429
|
-
var
|
|
557
|
+
var it = {
|
|
430
558
|
closed: !0,
|
|
431
|
-
next:
|
|
432
|
-
error:
|
|
433
|
-
complete:
|
|
559
|
+
next: ee,
|
|
560
|
+
error: ot,
|
|
561
|
+
complete: ee
|
|
434
562
|
}, re = (function() {
|
|
435
563
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
436
564
|
})();
|
|
437
565
|
function X(n) {
|
|
438
566
|
return n;
|
|
439
567
|
}
|
|
440
|
-
function
|
|
568
|
+
function at(n) {
|
|
441
569
|
return n.length === 0 ? X : n.length === 1 ? n[0] : function(e) {
|
|
442
570
|
return n.reduce(function(r, s) {
|
|
443
571
|
return s(r);
|
|
@@ -452,7 +580,7 @@ var S = (function() {
|
|
|
452
580
|
var e = new n();
|
|
453
581
|
return e.source = this, e.operator = t, e;
|
|
454
582
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
455
|
-
var s = this, o =
|
|
583
|
+
var s = this, o = ut(t) ? t : new te(t, e, r);
|
|
456
584
|
return B(function() {
|
|
457
585
|
var i = s, a = i.operator, c = i.source;
|
|
458
586
|
o.add(a ? a.call(o, c) : c ? s._subscribe(o) : s._trySubscribe(o));
|
|
@@ -465,8 +593,8 @@ var S = (function() {
|
|
|
465
593
|
}
|
|
466
594
|
}, n.prototype.forEach = function(t, e) {
|
|
467
595
|
var r = this;
|
|
468
|
-
return e =
|
|
469
|
-
var i = new
|
|
596
|
+
return e = ue(e), new e(function(s, o) {
|
|
597
|
+
var i = new te({
|
|
470
598
|
next: function(a) {
|
|
471
599
|
try {
|
|
472
600
|
t(a);
|
|
@@ -487,10 +615,10 @@ var S = (function() {
|
|
|
487
615
|
}, n.prototype.pipe = function() {
|
|
488
616
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
489
617
|
t[e] = arguments[e];
|
|
490
|
-
return
|
|
618
|
+
return at(t)(this);
|
|
491
619
|
}, n.prototype.toPromise = function(t) {
|
|
492
620
|
var e = this;
|
|
493
|
-
return t =
|
|
621
|
+
return t = ue(t), new t(function(r, s) {
|
|
494
622
|
var o;
|
|
495
623
|
e.subscribe(function(i) {
|
|
496
624
|
return o = i;
|
|
@@ -504,22 +632,22 @@ var S = (function() {
|
|
|
504
632
|
return new n(t);
|
|
505
633
|
}, n;
|
|
506
634
|
})();
|
|
507
|
-
function
|
|
635
|
+
function ue(n) {
|
|
508
636
|
var t;
|
|
509
|
-
return (t = n ??
|
|
637
|
+
return (t = n ?? nt.Promise) !== null && t !== void 0 ? t : Promise;
|
|
510
638
|
}
|
|
511
|
-
function
|
|
639
|
+
function ct(n) {
|
|
512
640
|
return n && g(n.next) && g(n.error) && g(n.complete);
|
|
513
641
|
}
|
|
514
|
-
function
|
|
515
|
-
return n && n instanceof ne ||
|
|
642
|
+
function ut(n) {
|
|
643
|
+
return n && n instanceof ne || ct(n) && Ee(n);
|
|
516
644
|
}
|
|
517
|
-
function
|
|
645
|
+
function lt(n) {
|
|
518
646
|
return g(n?.lift);
|
|
519
647
|
}
|
|
520
648
|
function A(n) {
|
|
521
649
|
return function(t) {
|
|
522
|
-
if (
|
|
650
|
+
if (lt(t))
|
|
523
651
|
return t.lift(function(e) {
|
|
524
652
|
try {
|
|
525
653
|
return n(e, this);
|
|
@@ -531,9 +659,9 @@ function A(n) {
|
|
|
531
659
|
};
|
|
532
660
|
}
|
|
533
661
|
function O(n, t, e, r, s) {
|
|
534
|
-
return new
|
|
662
|
+
return new dt(n, t, e, r, s);
|
|
535
663
|
}
|
|
536
|
-
var
|
|
664
|
+
var dt = (function(n) {
|
|
537
665
|
T(t, n);
|
|
538
666
|
function t(e, r, s, o, i, a) {
|
|
539
667
|
var c = n.call(this, e) || this;
|
|
@@ -568,7 +696,7 @@ var rt = (function(n) {
|
|
|
568
696
|
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
569
697
|
}
|
|
570
698
|
}, t;
|
|
571
|
-
})(ne),
|
|
699
|
+
})(ne), ht = Se(function(n) {
|
|
572
700
|
return function() {
|
|
573
701
|
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
574
702
|
};
|
|
@@ -579,11 +707,11 @@ var rt = (function(n) {
|
|
|
579
707
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
580
708
|
}
|
|
581
709
|
return t.prototype.lift = function(e) {
|
|
582
|
-
var r = new
|
|
710
|
+
var r = new le(this, this);
|
|
583
711
|
return r.operator = e, r;
|
|
584
712
|
}, t.prototype._throwIfClosed = function() {
|
|
585
713
|
if (this.closed)
|
|
586
|
-
throw new
|
|
714
|
+
throw new ht();
|
|
587
715
|
}, t.prototype.next = function(e) {
|
|
588
716
|
var r = this;
|
|
589
717
|
B(function() {
|
|
@@ -639,7 +767,7 @@ var rt = (function(n) {
|
|
|
639
767
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
640
768
|
}, t.prototype._innerSubscribe = function(e) {
|
|
641
769
|
var r = this, s = this, o = s.hasError, i = s.isStopped, a = s.observers;
|
|
642
|
-
return o || i ?
|
|
770
|
+
return o || i ? we : (this.currentObservers = null, a.push(e), new R(function() {
|
|
643
771
|
r.currentObservers = null, q(a, e);
|
|
644
772
|
}));
|
|
645
773
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
@@ -649,9 +777,9 @@ var rt = (function(n) {
|
|
|
649
777
|
var e = new S();
|
|
650
778
|
return e.source = this, e;
|
|
651
779
|
}, t.create = function(e, r) {
|
|
652
|
-
return new
|
|
780
|
+
return new le(e, r);
|
|
653
781
|
}, t;
|
|
654
|
-
})(S),
|
|
782
|
+
})(S), le = (function(n) {
|
|
655
783
|
T(t, n);
|
|
656
784
|
function t(e, r) {
|
|
657
785
|
var s = n.call(this) || this;
|
|
@@ -668,7 +796,7 @@ var rt = (function(n) {
|
|
|
668
796
|
(r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
|
|
669
797
|
}, t.prototype._subscribe = function(e) {
|
|
670
798
|
var r, s;
|
|
671
|
-
return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && s !== void 0 ? s :
|
|
799
|
+
return (s = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && s !== void 0 ? s : we;
|
|
672
800
|
}, t;
|
|
673
801
|
})(se), P = (function(n) {
|
|
674
802
|
T(t, n);
|
|
@@ -693,11 +821,11 @@ var rt = (function(n) {
|
|
|
693
821
|
}, t.prototype.next = function(e) {
|
|
694
822
|
n.prototype.next.call(this, this._value = e);
|
|
695
823
|
}, t;
|
|
696
|
-
})(se),
|
|
824
|
+
})(se), ft = {
|
|
697
825
|
now: function() {
|
|
698
826
|
return Date.now();
|
|
699
827
|
}
|
|
700
|
-
},
|
|
828
|
+
}, pt = (function(n) {
|
|
701
829
|
T(t, n);
|
|
702
830
|
function t(e, r) {
|
|
703
831
|
return n.call(this) || this;
|
|
@@ -705,7 +833,7 @@ var rt = (function(n) {
|
|
|
705
833
|
return t.prototype.schedule = function(e, r) {
|
|
706
834
|
return this;
|
|
707
835
|
}, t;
|
|
708
|
-
})(R),
|
|
836
|
+
})(R), de = {
|
|
709
837
|
setInterval: function(n, t) {
|
|
710
838
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
711
839
|
e[r - 2] = arguments[r];
|
|
@@ -715,7 +843,7 @@ var rt = (function(n) {
|
|
|
715
843
|
return clearInterval(n);
|
|
716
844
|
},
|
|
717
845
|
delegate: void 0
|
|
718
|
-
},
|
|
846
|
+
}, mt = (function(n) {
|
|
719
847
|
T(t, n);
|
|
720
848
|
function t(e, r) {
|
|
721
849
|
var s = n.call(this, e, r) || this;
|
|
@@ -729,11 +857,11 @@ var rt = (function(n) {
|
|
|
729
857
|
var o = this.id, i = this.scheduler;
|
|
730
858
|
return o != null && (this.id = this.recycleAsyncId(i, o, r)), this.pending = !0, this.delay = r, this.id = (s = this.id) !== null && s !== void 0 ? s : this.requestAsyncId(i, this.id, r), this;
|
|
731
859
|
}, t.prototype.requestAsyncId = function(e, r, s) {
|
|
732
|
-
return s === void 0 && (s = 0),
|
|
860
|
+
return s === void 0 && (s = 0), de.setInterval(e.flush.bind(e, this), s);
|
|
733
861
|
}, t.prototype.recycleAsyncId = function(e, r, s) {
|
|
734
862
|
if (s === void 0 && (s = 0), s != null && this.delay === s && this.pending === !1)
|
|
735
863
|
return r;
|
|
736
|
-
r != null &&
|
|
864
|
+
r != null && de.clearInterval(r);
|
|
737
865
|
}, t.prototype.execute = function(e, r) {
|
|
738
866
|
if (this.closed)
|
|
739
867
|
return new Error("executing a cancelled action");
|
|
@@ -757,17 +885,17 @@ var rt = (function(n) {
|
|
|
757
885
|
this.work = this.state = this.scheduler = null, this.pending = !1, q(o, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
758
886
|
}
|
|
759
887
|
}, t;
|
|
760
|
-
})(
|
|
888
|
+
})(pt), he = (function() {
|
|
761
889
|
function n(t, e) {
|
|
762
890
|
e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
|
|
763
891
|
}
|
|
764
892
|
return n.prototype.schedule = function(t, e, r) {
|
|
765
893
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
766
|
-
}, n.now =
|
|
767
|
-
})(),
|
|
894
|
+
}, n.now = ft.now, n;
|
|
895
|
+
})(), gt = (function(n) {
|
|
768
896
|
T(t, n);
|
|
769
897
|
function t(e, r) {
|
|
770
|
-
r === void 0 && (r =
|
|
898
|
+
r === void 0 && (r = he.now);
|
|
771
899
|
var s = n.call(this, e, r) || this;
|
|
772
900
|
return s.actions = [], s._active = !1, s;
|
|
773
901
|
}
|
|
@@ -789,60 +917,60 @@ var rt = (function(n) {
|
|
|
789
917
|
throw s;
|
|
790
918
|
}
|
|
791
919
|
}, t;
|
|
792
|
-
})(
|
|
920
|
+
})(he), Te = new gt(mt), bt = Te, vt = new S(function(n) {
|
|
793
921
|
return n.complete();
|
|
794
922
|
});
|
|
795
|
-
function
|
|
923
|
+
function xe(n) {
|
|
796
924
|
return n && g(n.schedule);
|
|
797
925
|
}
|
|
798
|
-
function
|
|
926
|
+
function Ce(n) {
|
|
799
927
|
return n[n.length - 1];
|
|
800
928
|
}
|
|
801
|
-
function
|
|
802
|
-
return g(
|
|
929
|
+
function yt(n) {
|
|
930
|
+
return g(Ce(n)) ? n.pop() : void 0;
|
|
803
931
|
}
|
|
804
|
-
function
|
|
805
|
-
return
|
|
932
|
+
function Oe(n) {
|
|
933
|
+
return xe(Ce(n)) ? n.pop() : void 0;
|
|
806
934
|
}
|
|
807
|
-
var
|
|
935
|
+
var Ae = (function(n) {
|
|
808
936
|
return n && typeof n.length == "number" && typeof n != "function";
|
|
809
937
|
});
|
|
810
|
-
function
|
|
938
|
+
function Le(n) {
|
|
811
939
|
return g(n?.then);
|
|
812
940
|
}
|
|
813
|
-
function
|
|
941
|
+
function _e(n) {
|
|
814
942
|
return g(n[re]);
|
|
815
943
|
}
|
|
816
|
-
function
|
|
944
|
+
function Pe(n) {
|
|
817
945
|
return Symbol.asyncIterator && g(n?.[Symbol.asyncIterator]);
|
|
818
946
|
}
|
|
819
|
-
function
|
|
947
|
+
function Ue(n) {
|
|
820
948
|
return new TypeError("You provided " + (n !== null && typeof n == "object" ? "an invalid object" : "'" + n + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
|
|
821
949
|
}
|
|
822
|
-
function
|
|
950
|
+
function St() {
|
|
823
951
|
return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
|
|
824
952
|
}
|
|
825
|
-
var Me =
|
|
826
|
-
function
|
|
953
|
+
var Me = St();
|
|
954
|
+
function ke(n) {
|
|
827
955
|
return g(n?.[Me]);
|
|
828
956
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
957
|
+
function Ne(n) {
|
|
958
|
+
return et(this, arguments, function() {
|
|
831
959
|
var e, r, s, o;
|
|
832
|
-
return
|
|
960
|
+
return ye(this, function(i) {
|
|
833
961
|
switch (i.label) {
|
|
834
962
|
case 0:
|
|
835
963
|
e = n.getReader(), i.label = 1;
|
|
836
964
|
case 1:
|
|
837
965
|
i.trys.push([1, , 9, 10]), i.label = 2;
|
|
838
966
|
case 2:
|
|
839
|
-
return [4,
|
|
967
|
+
return [4, M(e.read())];
|
|
840
968
|
case 3:
|
|
841
|
-
return r = i.sent(), s = r.value, o = r.done, o ? [4,
|
|
969
|
+
return r = i.sent(), s = r.value, o = r.done, o ? [4, M(void 0)] : [3, 5];
|
|
842
970
|
case 4:
|
|
843
971
|
return [2, i.sent()];
|
|
844
972
|
case 5:
|
|
845
|
-
return [4,
|
|
973
|
+
return [4, M(s)];
|
|
846
974
|
case 6:
|
|
847
975
|
return [4, i.sent()];
|
|
848
976
|
case 7:
|
|
@@ -857,29 +985,29 @@ function ke(n) {
|
|
|
857
985
|
});
|
|
858
986
|
});
|
|
859
987
|
}
|
|
860
|
-
function
|
|
988
|
+
function Re(n) {
|
|
861
989
|
return g(n?.getReader);
|
|
862
990
|
}
|
|
863
|
-
function
|
|
991
|
+
function U(n) {
|
|
864
992
|
if (n instanceof S)
|
|
865
993
|
return n;
|
|
866
994
|
if (n != null) {
|
|
867
|
-
if (Le(n))
|
|
868
|
-
return ft(n);
|
|
869
|
-
if (Oe(n))
|
|
870
|
-
return pt(n);
|
|
871
|
-
if (Ae(n))
|
|
872
|
-
return mt(n);
|
|
873
995
|
if (_e(n))
|
|
874
|
-
return
|
|
875
|
-
if (
|
|
876
|
-
return
|
|
877
|
-
if (
|
|
878
|
-
return
|
|
996
|
+
return wt(n);
|
|
997
|
+
if (Ae(n))
|
|
998
|
+
return Et(n);
|
|
999
|
+
if (Le(n))
|
|
1000
|
+
return It(n);
|
|
1001
|
+
if (Pe(n))
|
|
1002
|
+
return $e(n);
|
|
1003
|
+
if (ke(n))
|
|
1004
|
+
return Tt(n);
|
|
1005
|
+
if (Re(n))
|
|
1006
|
+
return xt(n);
|
|
879
1007
|
}
|
|
880
|
-
throw
|
|
1008
|
+
throw Ue(n);
|
|
881
1009
|
}
|
|
882
|
-
function
|
|
1010
|
+
function wt(n) {
|
|
883
1011
|
return new S(function(t) {
|
|
884
1012
|
var e = n[re]();
|
|
885
1013
|
if (g(e.subscribe))
|
|
@@ -887,23 +1015,23 @@ function ft(n) {
|
|
|
887
1015
|
throw new TypeError("Provided object does not correctly implement Symbol.observable");
|
|
888
1016
|
});
|
|
889
1017
|
}
|
|
890
|
-
function
|
|
1018
|
+
function Et(n) {
|
|
891
1019
|
return new S(function(t) {
|
|
892
1020
|
for (var e = 0; e < n.length && !t.closed; e++)
|
|
893
1021
|
t.next(n[e]);
|
|
894
1022
|
t.complete();
|
|
895
1023
|
});
|
|
896
1024
|
}
|
|
897
|
-
function
|
|
1025
|
+
function It(n) {
|
|
898
1026
|
return new S(function(t) {
|
|
899
1027
|
n.then(function(e) {
|
|
900
1028
|
t.closed || (t.next(e), t.complete());
|
|
901
1029
|
}, function(e) {
|
|
902
1030
|
return t.error(e);
|
|
903
|
-
}).then(null,
|
|
1031
|
+
}).then(null, Ie);
|
|
904
1032
|
});
|
|
905
1033
|
}
|
|
906
|
-
function
|
|
1034
|
+
function Tt(n) {
|
|
907
1035
|
return new S(function(t) {
|
|
908
1036
|
var e, r;
|
|
909
1037
|
try {
|
|
@@ -924,24 +1052,24 @@ function gt(n) {
|
|
|
924
1052
|
t.complete();
|
|
925
1053
|
});
|
|
926
1054
|
}
|
|
927
|
-
function
|
|
1055
|
+
function $e(n) {
|
|
928
1056
|
return new S(function(t) {
|
|
929
|
-
|
|
1057
|
+
Ct(n, t).catch(function(e) {
|
|
930
1058
|
return t.error(e);
|
|
931
1059
|
});
|
|
932
1060
|
});
|
|
933
1061
|
}
|
|
934
|
-
function
|
|
935
|
-
return
|
|
1062
|
+
function xt(n) {
|
|
1063
|
+
return $e(Ne(n));
|
|
936
1064
|
}
|
|
937
|
-
function
|
|
1065
|
+
function Ct(n, t) {
|
|
938
1066
|
var e, r, s, o;
|
|
939
|
-
return
|
|
1067
|
+
return Ze(this, void 0, void 0, function() {
|
|
940
1068
|
var i, a;
|
|
941
|
-
return
|
|
1069
|
+
return ye(this, function(c) {
|
|
942
1070
|
switch (c.label) {
|
|
943
1071
|
case 0:
|
|
944
|
-
c.trys.push([0, 5, 6, 11]), e =
|
|
1072
|
+
c.trys.push([0, 5, 6, 11]), e = tt(n), c.label = 1;
|
|
945
1073
|
case 1:
|
|
946
1074
|
return [4, e.next()];
|
|
947
1075
|
case 2:
|
|
@@ -980,7 +1108,7 @@ function C(n, t, e, r, s) {
|
|
|
980
1108
|
if (n.add(o), !s)
|
|
981
1109
|
return o;
|
|
982
1110
|
}
|
|
983
|
-
function
|
|
1111
|
+
function je(n, t) {
|
|
984
1112
|
return t === void 0 && (t = 0), A(function(e, r) {
|
|
985
1113
|
e.subscribe(O(r, function(s) {
|
|
986
1114
|
return C(r, n, function() {
|
|
@@ -997,20 +1125,20 @@ function $e(n, t) {
|
|
|
997
1125
|
}));
|
|
998
1126
|
});
|
|
999
1127
|
}
|
|
1000
|
-
function
|
|
1128
|
+
function De(n, t) {
|
|
1001
1129
|
return t === void 0 && (t = 0), A(function(e, r) {
|
|
1002
1130
|
r.add(n.schedule(function() {
|
|
1003
1131
|
return e.subscribe(r);
|
|
1004
1132
|
}, t));
|
|
1005
1133
|
});
|
|
1006
1134
|
}
|
|
1007
|
-
function
|
|
1008
|
-
return
|
|
1135
|
+
function Ot(n, t) {
|
|
1136
|
+
return U(n).pipe(De(t), je(t));
|
|
1009
1137
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1138
|
+
function At(n, t) {
|
|
1139
|
+
return U(n).pipe(De(t), je(t));
|
|
1012
1140
|
}
|
|
1013
|
-
function
|
|
1141
|
+
function Lt(n, t) {
|
|
1014
1142
|
return new S(function(e) {
|
|
1015
1143
|
var r = 0;
|
|
1016
1144
|
return t.schedule(function() {
|
|
@@ -1018,7 +1146,7 @@ function wt(n, t) {
|
|
|
1018
1146
|
});
|
|
1019
1147
|
});
|
|
1020
1148
|
}
|
|
1021
|
-
function
|
|
1149
|
+
function _t(n, t) {
|
|
1022
1150
|
return new S(function(e) {
|
|
1023
1151
|
var r;
|
|
1024
1152
|
return C(e, t, function() {
|
|
@@ -1037,7 +1165,7 @@ function Et(n, t) {
|
|
|
1037
1165
|
};
|
|
1038
1166
|
});
|
|
1039
1167
|
}
|
|
1040
|
-
function
|
|
1168
|
+
function He(n, t) {
|
|
1041
1169
|
if (!n)
|
|
1042
1170
|
throw new Error("Iterable cannot be null");
|
|
1043
1171
|
return new S(function(e) {
|
|
@@ -1051,36 +1179,36 @@ function De(n, t) {
|
|
|
1051
1179
|
});
|
|
1052
1180
|
});
|
|
1053
1181
|
}
|
|
1054
|
-
function
|
|
1055
|
-
return
|
|
1182
|
+
function Pt(n, t) {
|
|
1183
|
+
return He(Ne(n), t);
|
|
1056
1184
|
}
|
|
1057
|
-
function
|
|
1185
|
+
function Ut(n, t) {
|
|
1058
1186
|
if (n != null) {
|
|
1059
|
-
if (Le(n))
|
|
1060
|
-
return yt(n, t);
|
|
1061
|
-
if (Oe(n))
|
|
1062
|
-
return wt(n, t);
|
|
1063
|
-
if (Ae(n))
|
|
1064
|
-
return St(n, t);
|
|
1065
1187
|
if (_e(n))
|
|
1066
|
-
return
|
|
1067
|
-
if (
|
|
1068
|
-
return
|
|
1069
|
-
if (
|
|
1070
|
-
return
|
|
1188
|
+
return Ot(n, t);
|
|
1189
|
+
if (Ae(n))
|
|
1190
|
+
return Lt(n, t);
|
|
1191
|
+
if (Le(n))
|
|
1192
|
+
return At(n, t);
|
|
1193
|
+
if (Pe(n))
|
|
1194
|
+
return He(n, t);
|
|
1195
|
+
if (ke(n))
|
|
1196
|
+
return _t(n, t);
|
|
1197
|
+
if (Re(n))
|
|
1198
|
+
return Pt(n, t);
|
|
1071
1199
|
}
|
|
1072
|
-
throw
|
|
1200
|
+
throw Ue(n);
|
|
1073
1201
|
}
|
|
1074
1202
|
function oe(n, t) {
|
|
1075
|
-
return t ?
|
|
1203
|
+
return t ? Ut(n, t) : U(n);
|
|
1076
1204
|
}
|
|
1077
|
-
function
|
|
1205
|
+
function Mt() {
|
|
1078
1206
|
for (var n = [], t = 0; t < arguments.length; t++)
|
|
1079
1207
|
n[t] = arguments[t];
|
|
1080
|
-
var e =
|
|
1208
|
+
var e = Oe(n);
|
|
1081
1209
|
return oe(n, e);
|
|
1082
1210
|
}
|
|
1083
|
-
function
|
|
1211
|
+
function kt(n) {
|
|
1084
1212
|
return n instanceof Date && !isNaN(n);
|
|
1085
1213
|
}
|
|
1086
1214
|
function N(n, t) {
|
|
@@ -1091,23 +1219,23 @@ function N(n, t) {
|
|
|
1091
1219
|
}));
|
|
1092
1220
|
});
|
|
1093
1221
|
}
|
|
1094
|
-
var
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1222
|
+
var Nt = Array.isArray;
|
|
1223
|
+
function Rt(n, t) {
|
|
1224
|
+
return Nt(t) ? n.apply(void 0, H([], D(t))) : n(t);
|
|
1097
1225
|
}
|
|
1098
|
-
function
|
|
1226
|
+
function $t(n) {
|
|
1099
1227
|
return N(function(t) {
|
|
1100
|
-
return
|
|
1228
|
+
return Rt(n, t);
|
|
1101
1229
|
});
|
|
1102
1230
|
}
|
|
1103
|
-
var
|
|
1104
|
-
function
|
|
1231
|
+
var jt = Array.isArray, Dt = Object.getPrototypeOf, Ht = Object.prototype, Ft = Object.keys;
|
|
1232
|
+
function Gt(n) {
|
|
1105
1233
|
if (n.length === 1) {
|
|
1106
1234
|
var t = n[0];
|
|
1107
|
-
if (
|
|
1235
|
+
if (jt(t))
|
|
1108
1236
|
return { args: t, keys: null };
|
|
1109
|
-
if (
|
|
1110
|
-
var e =
|
|
1237
|
+
if (Bt(t)) {
|
|
1238
|
+
var e = Ft(t);
|
|
1111
1239
|
return {
|
|
1112
1240
|
args: e.map(function(r) {
|
|
1113
1241
|
return t[r];
|
|
@@ -1118,30 +1246,30 @@ function kt(n) {
|
|
|
1118
1246
|
}
|
|
1119
1247
|
return { args: n, keys: null };
|
|
1120
1248
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return n && typeof n == "object" &&
|
|
1249
|
+
function Bt(n) {
|
|
1250
|
+
return n && typeof n == "object" && Dt(n) === Ht;
|
|
1123
1251
|
}
|
|
1124
|
-
function
|
|
1252
|
+
function Kt(n, t) {
|
|
1125
1253
|
return n.reduce(function(e, r, s) {
|
|
1126
1254
|
return e[r] = t[s], e;
|
|
1127
1255
|
}, {});
|
|
1128
1256
|
}
|
|
1129
|
-
function
|
|
1257
|
+
function qt() {
|
|
1130
1258
|
for (var n = [], t = 0; t < arguments.length; t++)
|
|
1131
1259
|
n[t] = arguments[t];
|
|
1132
|
-
var e =
|
|
1260
|
+
var e = Oe(n), r = yt(n), s = Gt(n), o = s.args, i = s.keys;
|
|
1133
1261
|
if (o.length === 0)
|
|
1134
1262
|
return oe([], e);
|
|
1135
|
-
var a = new S(
|
|
1136
|
-
return
|
|
1263
|
+
var a = new S(Yt(o, e, i ? function(c) {
|
|
1264
|
+
return Kt(i, c);
|
|
1137
1265
|
} : X));
|
|
1138
|
-
return r ? a.pipe(
|
|
1266
|
+
return r ? a.pipe($t(r)) : a;
|
|
1139
1267
|
}
|
|
1140
|
-
function
|
|
1268
|
+
function Yt(n, t, e) {
|
|
1141
1269
|
return e === void 0 && (e = X), function(r) {
|
|
1142
|
-
|
|
1270
|
+
fe(t, function() {
|
|
1143
1271
|
for (var s = n.length, o = new Array(s), i = s, a = s, c = function(h) {
|
|
1144
|
-
|
|
1272
|
+
fe(t, function() {
|
|
1145
1273
|
var m = oe(n[h], t), b = !1;
|
|
1146
1274
|
m.subscribe(O(r, function(l) {
|
|
1147
1275
|
o[h] = l, b || (b = !0, a--), a || r.next(e(o.slice()));
|
|
@@ -1154,10 +1282,10 @@ function jt(n, t, e) {
|
|
|
1154
1282
|
}, r);
|
|
1155
1283
|
};
|
|
1156
1284
|
}
|
|
1157
|
-
function
|
|
1285
|
+
function fe(n, t, e) {
|
|
1158
1286
|
n ? C(e, n, t) : t();
|
|
1159
1287
|
}
|
|
1160
|
-
function
|
|
1288
|
+
function Xt(n, t, e, r, s, o, i, a) {
|
|
1161
1289
|
var c = [], u = 0, h = 0, m = !1, b = function() {
|
|
1162
1290
|
m && !c.length && !u && t.complete();
|
|
1163
1291
|
}, l = function(p) {
|
|
@@ -1165,19 +1293,19 @@ function Dt(n, t, e, r, s, o, i, a) {
|
|
|
1165
1293
|
}, f = function(p) {
|
|
1166
1294
|
u++;
|
|
1167
1295
|
var L = !1;
|
|
1168
|
-
|
|
1169
|
-
t.next(
|
|
1296
|
+
U(e(p, h++)).subscribe(O(t, function(E) {
|
|
1297
|
+
t.next(E);
|
|
1170
1298
|
}, function() {
|
|
1171
1299
|
L = !0;
|
|
1172
1300
|
}, void 0, function() {
|
|
1173
1301
|
if (L)
|
|
1174
1302
|
try {
|
|
1175
1303
|
u--;
|
|
1176
|
-
for (var
|
|
1304
|
+
for (var E = function() {
|
|
1177
1305
|
var _ = c.shift();
|
|
1178
1306
|
i || f(_);
|
|
1179
1307
|
}; c.length && u < r; )
|
|
1180
|
-
|
|
1308
|
+
E();
|
|
1181
1309
|
b();
|
|
1182
1310
|
} catch (_) {
|
|
1183
1311
|
t.error(_);
|
|
@@ -1193,16 +1321,16 @@ function Y(n, t, e) {
|
|
|
1193
1321
|
return e === void 0 && (e = 1 / 0), g(t) ? Y(function(r, s) {
|
|
1194
1322
|
return N(function(o, i) {
|
|
1195
1323
|
return t(r, o, s, i);
|
|
1196
|
-
})(
|
|
1324
|
+
})(U(n(r, s)));
|
|
1197
1325
|
}, e) : (typeof t == "number" && (e = t), A(function(r, s) {
|
|
1198
|
-
return
|
|
1326
|
+
return Xt(r, s, n, e);
|
|
1199
1327
|
}));
|
|
1200
1328
|
}
|
|
1201
|
-
function
|
|
1202
|
-
n === void 0 && (n = 0), e === void 0 && (e =
|
|
1329
|
+
function Vt(n, t, e) {
|
|
1330
|
+
n === void 0 && (n = 0), e === void 0 && (e = bt);
|
|
1203
1331
|
var r = -1;
|
|
1204
|
-
return t != null && (
|
|
1205
|
-
var o =
|
|
1332
|
+
return t != null && (xe(t) ? e = t : r = t), new S(function(s) {
|
|
1333
|
+
var o = kt(n) ? +n - e.now() : n;
|
|
1206
1334
|
o < 0 && (o = 0);
|
|
1207
1335
|
var i = 0;
|
|
1208
1336
|
return e.schedule(function() {
|
|
@@ -1210,12 +1338,12 @@ function Ht(n, t, e) {
|
|
|
1210
1338
|
}, o);
|
|
1211
1339
|
});
|
|
1212
1340
|
}
|
|
1213
|
-
function
|
|
1341
|
+
function Wt(n, t) {
|
|
1214
1342
|
return g(t) ? Y(n, t, 1) : Y(n, 1);
|
|
1215
1343
|
}
|
|
1216
|
-
function
|
|
1344
|
+
function zt(n) {
|
|
1217
1345
|
return n <= 0 ? function() {
|
|
1218
|
-
return
|
|
1346
|
+
return vt;
|
|
1219
1347
|
} : A(function(t, e) {
|
|
1220
1348
|
var r = 0;
|
|
1221
1349
|
t.subscribe(O(e, function(s) {
|
|
@@ -1223,25 +1351,25 @@ function Gt(n) {
|
|
|
1223
1351
|
}));
|
|
1224
1352
|
});
|
|
1225
1353
|
}
|
|
1226
|
-
function
|
|
1354
|
+
function Jt(n) {
|
|
1227
1355
|
return N(function() {
|
|
1228
1356
|
return n;
|
|
1229
1357
|
});
|
|
1230
1358
|
}
|
|
1231
|
-
function
|
|
1359
|
+
function Qt(n, t) {
|
|
1232
1360
|
return Y(function(e, r) {
|
|
1233
|
-
return
|
|
1361
|
+
return U(n(e, r)).pipe(zt(1), Jt(e));
|
|
1234
1362
|
});
|
|
1235
1363
|
}
|
|
1236
|
-
function
|
|
1237
|
-
t === void 0 && (t =
|
|
1238
|
-
var e =
|
|
1239
|
-
return
|
|
1364
|
+
function Zt(n, t) {
|
|
1365
|
+
t === void 0 && (t = Te);
|
|
1366
|
+
var e = Vt(n, t);
|
|
1367
|
+
return Qt(function() {
|
|
1240
1368
|
return e;
|
|
1241
1369
|
});
|
|
1242
1370
|
}
|
|
1243
1371
|
function j(n, t) {
|
|
1244
|
-
return t === void 0 && (t = X), n = n ??
|
|
1372
|
+
return t === void 0 && (t = X), n = n ?? en, A(function(e, r) {
|
|
1245
1373
|
var s, o = !0;
|
|
1246
1374
|
e.subscribe(O(r, function(i) {
|
|
1247
1375
|
var a = t(i);
|
|
@@ -1249,10 +1377,10 @@ function j(n, t) {
|
|
|
1249
1377
|
}));
|
|
1250
1378
|
});
|
|
1251
1379
|
}
|
|
1252
|
-
function
|
|
1380
|
+
function en(n, t) {
|
|
1253
1381
|
return n === t;
|
|
1254
1382
|
}
|
|
1255
|
-
function
|
|
1383
|
+
function tn(n) {
|
|
1256
1384
|
return A(function(t, e) {
|
|
1257
1385
|
try {
|
|
1258
1386
|
t.subscribe(e);
|
|
@@ -1261,140 +1389,13 @@ function Xt(n) {
|
|
|
1261
1389
|
}
|
|
1262
1390
|
});
|
|
1263
1391
|
}
|
|
1264
|
-
function
|
|
1392
|
+
function nn(n) {
|
|
1265
1393
|
return A(function(t, e) {
|
|
1266
|
-
|
|
1394
|
+
U(n).subscribe(O(e, function() {
|
|
1267
1395
|
return e.complete();
|
|
1268
|
-
},
|
|
1269
|
-
});
|
|
1270
|
-
}
|
|
1271
|
-
async function Wt(n, t) {
|
|
1272
|
-
const e = n.getReader();
|
|
1273
|
-
let r;
|
|
1274
|
-
for (; !(r = await e.read()).done; )
|
|
1275
|
-
t(r.value);
|
|
1276
|
-
}
|
|
1277
|
-
function zt(n) {
|
|
1278
|
-
let t, e, r, s = !1;
|
|
1279
|
-
return function(i) {
|
|
1280
|
-
t === void 0 ? (t = i, e = 0, r = -1) : t = Qt(t, i);
|
|
1281
|
-
const a = t.length;
|
|
1282
|
-
let c = 0;
|
|
1283
|
-
for (; e < a; ) {
|
|
1284
|
-
s && (t[e] === 10 && (c = ++e), s = !1);
|
|
1285
|
-
let u = -1;
|
|
1286
|
-
for (; e < a && u === -1; ++e)
|
|
1287
|
-
switch (t[e]) {
|
|
1288
|
-
case 58:
|
|
1289
|
-
r === -1 && (r = e - c);
|
|
1290
|
-
break;
|
|
1291
|
-
case 13:
|
|
1292
|
-
s = !0;
|
|
1293
|
-
case 10:
|
|
1294
|
-
u = e;
|
|
1295
|
-
break;
|
|
1296
|
-
}
|
|
1297
|
-
if (u === -1)
|
|
1298
|
-
break;
|
|
1299
|
-
n(t.subarray(c, u), r), c = e, r = -1;
|
|
1300
|
-
}
|
|
1301
|
-
c === a ? t = void 0 : c !== 0 && (t = t.subarray(c), e -= c);
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
function Jt(n, t, e) {
|
|
1305
|
-
let r = he();
|
|
1306
|
-
const s = new TextDecoder();
|
|
1307
|
-
return function(i, a) {
|
|
1308
|
-
if (i.length === 0)
|
|
1309
|
-
e?.(r), r = he();
|
|
1310
|
-
else if (a > 0) {
|
|
1311
|
-
const c = s.decode(i.subarray(0, a)), u = a + (i[a + 1] === 32 ? 2 : 1), h = s.decode(i.subarray(u));
|
|
1312
|
-
switch (c) {
|
|
1313
|
-
case "data":
|
|
1314
|
-
r.data = r.data ? r.data + `
|
|
1315
|
-
` + h : h;
|
|
1316
|
-
break;
|
|
1317
|
-
case "event":
|
|
1318
|
-
r.event = h;
|
|
1319
|
-
break;
|
|
1320
|
-
case "id":
|
|
1321
|
-
n(r.id = h);
|
|
1322
|
-
break;
|
|
1323
|
-
case "retry":
|
|
1324
|
-
const m = parseInt(h, 10);
|
|
1325
|
-
isNaN(m) || t(r.retry = m);
|
|
1326
|
-
break;
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
}
|
|
1331
|
-
function Qt(n, t) {
|
|
1332
|
-
const e = new Uint8Array(n.length + t.length);
|
|
1333
|
-
return e.set(n), e.set(t, n.length), e;
|
|
1334
|
-
}
|
|
1335
|
-
function he() {
|
|
1336
|
-
return {
|
|
1337
|
-
data: "",
|
|
1338
|
-
event: "",
|
|
1339
|
-
id: "",
|
|
1340
|
-
retry: void 0
|
|
1341
|
-
};
|
|
1342
|
-
}
|
|
1343
|
-
var Zt = function(n, t) {
|
|
1344
|
-
var e = {};
|
|
1345
|
-
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && t.indexOf(r) < 0 && (e[r] = n[r]);
|
|
1346
|
-
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1347
|
-
for (var s = 0, r = Object.getOwnPropertySymbols(n); s < r.length; s++)
|
|
1348
|
-
t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[s]) && (e[r[s]] = n[r[s]]);
|
|
1349
|
-
return e;
|
|
1350
|
-
};
|
|
1351
|
-
const te = "text/event-stream", en = 1e3, fe = "last-event-id";
|
|
1352
|
-
function tn(n, t) {
|
|
1353
|
-
var { signal: e, headers: r, onopen: s, onmessage: o, onclose: i, onerror: a, openWhenHidden: c, fetch: u } = t, h = Zt(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
1354
|
-
return new Promise((m, b) => {
|
|
1355
|
-
const l = Object.assign({}, r);
|
|
1356
|
-
l.accept || (l.accept = te);
|
|
1357
|
-
let f;
|
|
1358
|
-
function p() {
|
|
1359
|
-
f.abort(), document.hidden || V();
|
|
1360
|
-
}
|
|
1361
|
-
c || document.addEventListener("visibilitychange", p);
|
|
1362
|
-
let L = en, w = 0;
|
|
1363
|
-
function _() {
|
|
1364
|
-
document.removeEventListener("visibilitychange", p), window.clearTimeout(w), f.abort();
|
|
1365
|
-
}
|
|
1366
|
-
e?.addEventListener("abort", () => {
|
|
1367
|
-
_(), m();
|
|
1368
|
-
});
|
|
1369
|
-
const Fe = u ?? window.fetch, Ge = s ?? nn;
|
|
1370
|
-
async function V() {
|
|
1371
|
-
var W;
|
|
1372
|
-
f = new AbortController();
|
|
1373
|
-
try {
|
|
1374
|
-
const F = await Fe(n, Object.assign(Object.assign({}, h), { headers: l, signal: f.signal }));
|
|
1375
|
-
await Ge(F), await Wt(F.body, zt(Jt((x) => {
|
|
1376
|
-
x ? l[fe] = x : delete l[fe];
|
|
1377
|
-
}, (x) => {
|
|
1378
|
-
L = x;
|
|
1379
|
-
}, o))), i?.(), _(), m();
|
|
1380
|
-
} catch (F) {
|
|
1381
|
-
if (!f.signal.aborted)
|
|
1382
|
-
try {
|
|
1383
|
-
const x = (W = a?.(F)) !== null && W !== void 0 ? W : L;
|
|
1384
|
-
window.clearTimeout(w), w = window.setTimeout(V, x);
|
|
1385
|
-
} catch (x) {
|
|
1386
|
-
_(), b(x);
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
V();
|
|
1396
|
+
}, ee)), !e.closed && t.subscribe(e);
|
|
1391
1397
|
});
|
|
1392
1398
|
}
|
|
1393
|
-
function nn(n) {
|
|
1394
|
-
const t = n.headers.get("content-type");
|
|
1395
|
-
if (!t?.startsWith(te))
|
|
1396
|
-
throw new Error(`Expected content-type to be ${te}, Actual: ${t}`);
|
|
1397
|
-
}
|
|
1398
1399
|
function pe(n) {
|
|
1399
1400
|
const { endpoint: t, apiKey: e, payload: r, debugMode: s, customHeaders: o } = n, i = n.method ?? "POST";
|
|
1400
1401
|
return new S((a) => {
|
|
@@ -1406,7 +1407,7 @@ function pe(n) {
|
|
|
1406
1407
|
};
|
|
1407
1408
|
e && (m["X-API-KEY"] = e);
|
|
1408
1409
|
const b = new URL(t);
|
|
1409
|
-
return s && b.searchParams.set("is_debug", "true"),
|
|
1410
|
+
return s && b.searchParams.set("is_debug", "true"), ve(b.toString(), {
|
|
1410
1411
|
method: i,
|
|
1411
1412
|
headers: m,
|
|
1412
1413
|
body: i === "POST" && r ? JSON.stringify(r) : void 0,
|
|
@@ -1430,7 +1431,7 @@ function pe(n) {
|
|
|
1430
1431
|
f = null;
|
|
1431
1432
|
}
|
|
1432
1433
|
}
|
|
1433
|
-
a.error(new
|
|
1434
|
+
a.error(new w(l.status, l.statusText, f)), c.abort();
|
|
1434
1435
|
}
|
|
1435
1436
|
},
|
|
1436
1437
|
onmessage: (l) => {
|
|
@@ -1583,7 +1584,7 @@ class xn {
|
|
|
1583
1584
|
if (o.status === 404)
|
|
1584
1585
|
return null;
|
|
1585
1586
|
if (!o.ok)
|
|
1586
|
-
throw new
|
|
1587
|
+
throw new w(o.status, o.statusText, await o.text().catch(() => {
|
|
1587
1588
|
}));
|
|
1588
1589
|
const i = await o.json(), a = i.data ?? i;
|
|
1589
1590
|
return {
|
|
@@ -1606,11 +1607,11 @@ class xn {
|
|
|
1606
1607
|
// No RxJS-level retry: re-subscribing would re-POST and the backend would re-dispatch a duplicate
|
|
1607
1608
|
// run. Mid-stream resume is the library's job (native Last-Event-ID reconnect in
|
|
1608
1609
|
// create-sse-observable); a no-cursor failure surfaces via `error` below.
|
|
1609
|
-
|
|
1610
|
-
|
|
1610
|
+
Wt((r) => Mt(r).pipe(Zt(e?.delayTime ?? 50))),
|
|
1611
|
+
nn(this.destroy$),
|
|
1611
1612
|
// Settle the run accounting on every termination path — complete, error, AND a user-initiated
|
|
1612
1613
|
// unsubscribe (stop-generation aborts the connection without a terminal event).
|
|
1613
|
-
|
|
1614
|
+
tn(() => this.onRunSettled())
|
|
1614
1615
|
).subscribe({
|
|
1615
1616
|
next: (r) => {
|
|
1616
1617
|
this.detached || (e?.onSseMessage?.(r), this.handleEvent(r));
|
|
@@ -1721,7 +1722,7 @@ class xn {
|
|
|
1721
1722
|
this.apiKey && (s["X-API-KEY"] = this.apiKey);
|
|
1722
1723
|
const o = await fetch(r, { method: "POST", headers: s });
|
|
1723
1724
|
if (!o.ok)
|
|
1724
|
-
throw new
|
|
1725
|
+
throw new w(o.status, o.statusText, await o.text().catch(() => {
|
|
1725
1726
|
}));
|
|
1726
1727
|
const i = await o.json(), a = i.data?.openURL ?? i.openURL;
|
|
1727
1728
|
if (!a)
|
|
@@ -1750,7 +1751,7 @@ class xn {
|
|
|
1750
1751
|
r.searchParams.set("path", e);
|
|
1751
1752
|
const s = await fetch(r.toString(), { method: "GET", headers: this.sandboxFsHeaders() });
|
|
1752
1753
|
if (!s.ok)
|
|
1753
|
-
throw new
|
|
1754
|
+
throw new w(s.status, s.statusText, await s.text().catch(() => {
|
|
1754
1755
|
}));
|
|
1755
1756
|
const o = await s.json(), i = o.data ?? o;
|
|
1756
1757
|
return { entries: i.entries ?? [], truncated: i.truncated ?? !1 };
|
|
@@ -1764,7 +1765,7 @@ class xn {
|
|
|
1764
1765
|
s.searchParams.set("path", e), r?.offsetBytes != null && s.searchParams.set("offset_bytes", String(r.offsetBytes)), r?.limitBytes != null && s.searchParams.set("limit_bytes", String(r.limitBytes));
|
|
1765
1766
|
const o = await fetch(s.toString(), { method: "GET", headers: this.sandboxFsHeaders() });
|
|
1766
1767
|
if (!o.ok)
|
|
1767
|
-
throw new
|
|
1768
|
+
throw new w(o.status, o.statusText, await o.text().catch(() => {
|
|
1768
1769
|
}));
|
|
1769
1770
|
const i = await o.blob(), a = o.headers.get("X-Total-Bytes");
|
|
1770
1771
|
return {
|
|
@@ -1784,7 +1785,7 @@ class xn {
|
|
|
1784
1785
|
i.append("file", r instanceof Blob ? r : new Blob([r]));
|
|
1785
1786
|
const a = await fetch(o.toString(), { method: "PUT", headers: this.sandboxFsHeaders(), body: i });
|
|
1786
1787
|
if (!a.ok)
|
|
1787
|
-
throw new
|
|
1788
|
+
throw new w(a.status, a.statusText, await a.text().catch(() => {
|
|
1788
1789
|
}));
|
|
1789
1790
|
const c = await a.json();
|
|
1790
1791
|
return { bytesWritten: (c.data ?? c).bytesWritten ?? 0 };
|
|
@@ -1795,7 +1796,7 @@ class xn {
|
|
|
1795
1796
|
Object.entries(s).forEach(([a, c]) => o.searchParams.set(a, c));
|
|
1796
1797
|
const i = await fetch(o.toString(), { method: r, headers: this.sandboxFsHeaders() });
|
|
1797
1798
|
if (!i.ok)
|
|
1798
|
-
throw new
|
|
1799
|
+
throw new w(i.status, i.statusText, await i.text().catch(() => {
|
|
1799
1800
|
}));
|
|
1800
1801
|
return i.json().catch(() => null);
|
|
1801
1802
|
}
|
|
@@ -1805,7 +1806,7 @@ class xn {
|
|
|
1805
1806
|
r.searchParams.set("path", e);
|
|
1806
1807
|
const s = await fetch(r.toString(), { method: "GET", headers: this.sandboxFsHeaders() });
|
|
1807
1808
|
if (!s.ok)
|
|
1808
|
-
throw new
|
|
1809
|
+
throw new w(s.status, s.statusText, await s.text().catch(() => {
|
|
1809
1810
|
}));
|
|
1810
1811
|
const o = await s.json(), i = o.data ?? o;
|
|
1811
1812
|
return {
|
|
@@ -1841,6 +1842,36 @@ class xn {
|
|
|
1841
1842
|
const o = { src: e, dst: r };
|
|
1842
1843
|
s?.overwrite && (o.overwrite = "true"), await this.sandboxFsRequest(t, "move", "POST", o);
|
|
1843
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* F-021 — watch a sandbox path for changes (`GET fs/watch?path=`, SSE). Each `event: change` frame is one
|
|
1847
|
+
* `SandboxFsWatchEvent`. The backend probes the path first, so a missing path errors as HTTP rather than
|
|
1848
|
+
* as a dead stream. Unsubscribing aborts the request, which ends the sandbox-side watcher.
|
|
1849
|
+
*/
|
|
1850
|
+
sandboxFsWatch(t, e) {
|
|
1851
|
+
const r = new URL(`${this.deriveSandboxFsEndpoint(t)}/watch`);
|
|
1852
|
+
return r.searchParams.set("path", e), new S((s) => {
|
|
1853
|
+
const o = new AbortController();
|
|
1854
|
+
return ve(r.toString(), {
|
|
1855
|
+
headers: this.sandboxFsHeaders(),
|
|
1856
|
+
signal: o.signal,
|
|
1857
|
+
openWhenHidden: !0,
|
|
1858
|
+
onopen: async (i) => {
|
|
1859
|
+
if (!i.ok) {
|
|
1860
|
+
const a = await i.text().catch(() => {
|
|
1861
|
+
});
|
|
1862
|
+
s.error(new w(i.status, i.statusText, a)), o.abort();
|
|
1863
|
+
}
|
|
1864
|
+
},
|
|
1865
|
+
onmessage: (i) => {
|
|
1866
|
+
i.event === "change" && s.next(JSON.parse(i.data));
|
|
1867
|
+
},
|
|
1868
|
+
onclose: () => s.complete(),
|
|
1869
|
+
onerror: (i) => {
|
|
1870
|
+
throw s.error(i), o.abort(), i;
|
|
1871
|
+
}
|
|
1872
|
+
}), () => o.abort();
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1844
1875
|
/**
|
|
1845
1876
|
* 從 botProviderEndpoint 衍生 Blob API endpoint
|
|
1846
1877
|
*/
|
|
@@ -1881,7 +1912,7 @@ function un(n, t, e) {
|
|
|
1881
1912
|
throw new Error("Random bytes length must be >= 16");
|
|
1882
1913
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, sn(r);
|
|
1883
1914
|
}
|
|
1884
|
-
function
|
|
1915
|
+
function Fe(n, t, e) {
|
|
1885
1916
|
return me.randomUUID && !n ? me.randomUUID() : un(n);
|
|
1886
1917
|
}
|
|
1887
1918
|
class v {
|
|
@@ -2071,7 +2102,7 @@ class v {
|
|
|
2071
2102
|
return s.set(e.messageId, o), new v({ messages: s, pendingConsent: this.pendingConsent });
|
|
2072
2103
|
}
|
|
2073
2104
|
onMessageError(t) {
|
|
2074
|
-
const e =
|
|
2105
|
+
const e = Fe(), r = t.fact.runError.error, s = new Map(this.messages);
|
|
2075
2106
|
return s.set(e, {
|
|
2076
2107
|
type: "error",
|
|
2077
2108
|
eventType: d.ERROR,
|
|
@@ -2157,7 +2188,7 @@ function dn(n) {
|
|
|
2157
2188
|
function ge(n) {
|
|
2158
2189
|
return typeof n == "object" && n !== null ? n : void 0;
|
|
2159
2190
|
}
|
|
2160
|
-
function
|
|
2191
|
+
function I(n) {
|
|
2161
2192
|
return typeof n == "string" ? n : void 0;
|
|
2162
2193
|
}
|
|
2163
2194
|
function hn(n) {
|
|
@@ -2165,18 +2196,18 @@ function hn(n) {
|
|
|
2165
2196
|
for (const r of n) {
|
|
2166
2197
|
const s = r.parameter ?? {}, o = r.sidecar ?? {};
|
|
2167
2198
|
if (r.toolName === "TaskCreate") {
|
|
2168
|
-
const i = ge(o.task), a =
|
|
2199
|
+
const i = ge(o.task), a = I(i?.id);
|
|
2169
2200
|
if (!a) continue;
|
|
2170
2201
|
e.has(a) || t.push(a), e.set(a, {
|
|
2171
2202
|
id: a,
|
|
2172
|
-
subject:
|
|
2173
|
-
activeForm:
|
|
2174
|
-
description:
|
|
2203
|
+
subject: I(s.subject) || I(i?.subject) || "",
|
|
2204
|
+
activeForm: I(s.activeForm),
|
|
2205
|
+
description: I(s.description),
|
|
2175
2206
|
status: e.get(a)?.status ?? "pending"
|
|
2176
2207
|
// initial status = pending (keep existing on repeat)
|
|
2177
2208
|
});
|
|
2178
2209
|
} else if (r.toolName === "TaskUpdate") {
|
|
2179
|
-
const i = ge(o.statusChange), a =
|
|
2210
|
+
const i = ge(o.statusChange), a = I(s.taskId) || I(o.taskId), c = I(i?.to) || I(s.status);
|
|
2180
2211
|
if (!a || !c) continue;
|
|
2181
2212
|
const u = e.get(a);
|
|
2182
2213
|
u && e.set(a, { ...u, status: c });
|
|
@@ -2463,7 +2494,7 @@ class K {
|
|
|
2463
2494
|
}
|
|
2464
2495
|
}
|
|
2465
2496
|
subscribe() {
|
|
2466
|
-
this.statesSubscription =
|
|
2497
|
+
this.statesSubscription = qt([
|
|
2467
2498
|
this.isConnecting$,
|
|
2468
2499
|
this.conversation$,
|
|
2469
2500
|
this.derivedStores.tasks$,
|
|
@@ -2577,7 +2608,7 @@ class K {
|
|
|
2577
2608
|
);
|
|
2578
2609
|
}
|
|
2579
2610
|
sendMessage(t, e) {
|
|
2580
|
-
const r = t.text.trim(), s = t.customMessageId ??
|
|
2611
|
+
const r = t.text.trim(), s = t.customMessageId ?? Fe();
|
|
2581
2612
|
return this.currentUserMessageId = s, this.lastSentMessageId = s, this.conversation$.next(
|
|
2582
2613
|
this.conversation$.value.pushMessage({
|
|
2583
2614
|
type: "user",
|
|
@@ -2660,9 +2691,9 @@ export {
|
|
|
2660
2691
|
v as Conversation,
|
|
2661
2692
|
d as EventType,
|
|
2662
2693
|
$ as FetchSseAction,
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2694
|
+
w as HttpError,
|
|
2695
|
+
qe as MessageTemplateType,
|
|
2696
|
+
Ke as ToolCallConsentResult,
|
|
2666
2697
|
bn as conversationToSubagentEvents,
|
|
2667
2698
|
In as createDerivedStores,
|
|
2668
2699
|
yn as deriveSubagents,
|