react-semaphor 0.1.546 → 0.1.548
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/analytics-protocol/index.js +71 -68
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-BPXhulAx.js → assistant-chat-DCcWsoGm.js} +106 -106
- package/dist/chunks/{bookmark-state-C4vetoa0.js → bookmark-state-Cu-a5ie_.js} +2 -8
- package/dist/chunks/{custom-visual-inputs-CkJW9pBS.js → custom-visual-inputs-BTRnwsfd.js} +1 -1
- package/dist/chunks/{dashboard-C3CoKbGY.js → dashboard-BZHL9a-z.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Be4h-7My.js → dashboard-briefing-launcher-DML-cAzB.js} +528 -528
- package/dist/chunks/{dashboard-controls-bxPrlSyp.js → dashboard-controls-BGoBTPS7.js} +45 -45
- package/dist/chunks/{dashboard-json-BrjxIiRt.js → dashboard-json-iHPsdn3j.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-CRVHpIHp.js → document-dashboard-inputs-B2AqPfrq.js} +94 -94
- package/dist/chunks/{edit-dashboard-visual-DYYYDjY6.js → edit-dashboard-visual-CLEFFf2T.js} +281 -281
- package/dist/chunks/{column-catalog-BYnochWQ.js → filter-reach-copy-ByzGadUk.js} +978 -861
- package/dist/chunks/{global-date-filter-utils-9d6m9-FE.js → global-date-filter-utils-CeeFJ1CP.js} +4070 -3792
- package/dist/chunks/{index-DkQkMKa1.js → index-DeDHr3iz.js} +30 -30
- package/dist/chunks/{raw-temporal-presentation-CBzrDOjM.js → raw-temporal-presentation-CrUM2I_o.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-4QEZWe5U.js → report-preferences-dialog-CM7kXmXp.js} +59 -59
- package/dist/chunks/{resolve-dashboard-input-context-UpK_LBpL.js → resolve-dashboard-input-context-BmWF9hSl.js} +1511 -1612
- package/dist/chunks/{saved-dashboard-context-D_I3Lxk0.js → saved-dashboard-context-qtfzl9Eb.js} +5 -5
- package/dist/chunks/{semaphor-ready-indicator-4zpRHE-X.js → semaphor-ready-indicator-Ol6VcaR7.js} +36548 -35855
- package/dist/chunks/{shelf-drop-preview-context-Cfw7TRAx.js → shelf-drop-preview-context-C2SEC3I9.js} +80 -80
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{table-settings-CunhoDUi.js → table-settings-WysCBj62.js} +133 -124
- package/dist/chunks/{use-create-flow-overlay-state-DZBZiiD-.js → use-create-flow-overlay-state-CbGIjaVD.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1419 -1340
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +14 -14
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -4
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +383 -22
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +83 -13
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +26 -4
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/package.json +1 -1
|
@@ -2,10 +2,10 @@ var Er = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Tr = (e, t, r) => t.has(e) || Er("Cannot " + r);
|
|
5
|
-
var F = (e, t, r) => (Tr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), pe = (e, t, r) => t.has(e) ? Er("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r),
|
|
5
|
+
var F = (e, t, r) => (Tr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), pe = (e, t, r) => t.has(e) ? Er("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), H = (e, t, r, n) => (Tr(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
6
6
|
import { jsx as f, jsxs as T, Fragment as et } from "react/jsx-runtime";
|
|
7
7
|
import { useRef as le, useLayoutEffect as we, useCallback as X, useMemo as tt, useEffect as ze, useState as U, useId as Is } from "react";
|
|
8
|
-
import { u as W, dq as Ss, c4 as ks, c6 as Ns, X as Ar, b4 as Es, cT as Nn, T as En, dr as Ts, ds as As, W as Ue, b1 as Cs, dt as $s, bp as Os, du as ar, cO as zs, dv as Ms, dw as sr, dx as Tn, dy as Ps, aX as or, cj as Cr, dz as An, Y as Rs, ck as Zs, aO as Cn, de as Ds, dA as js, dB as Fs, dC as Ls, c2 as $n, b0 as On, b2 as Us, bo as pt, dD as Bs, dE as Vs, dF as qs, dG as Js, a3 as zn, cg as Ws, ch as Ks, ci as Gs, cn as
|
|
8
|
+
import { u as W, dq as Ss, c4 as ks, c6 as Ns, X as Ar, b4 as Es, cT as Nn, T as En, dr as Ts, ds as As, W as Ue, b1 as Cs, dt as $s, bp as Os, du as ar, cO as zs, dv as Ms, dw as sr, dx as Tn, dy as Ps, aX as or, cj as Cr, dz as An, Y as Rs, ck as Zs, aO as Cn, de as Ds, dA as js, dB as Fs, dC as Ls, c2 as $n, b0 as On, b2 as Us, bo as pt, dD as Bs, dE as Vs, dF as qs, dG as Js, a3 as zn, cg as Ws, ch as Ks, ci as Gs, cn as Ys, dH as Hs, dI as Xs, dJ as Qs } from "./semaphor-ready-indicator-Ol6VcaR7.js";
|
|
9
9
|
import { i as eo } from "./conversation-sQiWYUOb.js";
|
|
10
10
|
import { B as ae, i as to, j as ro, c as Mn, L as Je, I as no, R as ao, P as Pn, a as Rn, b as Zn } from "./switch-CEBOR4n7.js";
|
|
11
11
|
import "./index-CuHybtft.js";
|
|
@@ -16,14 +16,14 @@ import "zod";
|
|
|
16
16
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as so } from "../value-format-preferences/index.js";
|
|
17
17
|
import { g as oo, c as G } from "./_commonjsHelpers-DimLPMtv.js";
|
|
18
18
|
import { f as Dn } from "./editor-draft-sync-BN5qYHPF.js";
|
|
19
|
-
import { H as io } from "./table-settings-
|
|
19
|
+
import { H as io } from "./table-settings-WysCBj62.js";
|
|
20
20
|
import { l as lo, m as rt, c as Jt, A as We, d as jn } from "./context-BerEBuFR.js";
|
|
21
|
-
import { p as $r, a as co, A as Fn } from "./saved-dashboard-context-
|
|
22
|
-
import {
|
|
23
|
-
import { d as fo } from "./document-dashboard-inputs-
|
|
21
|
+
import { p as $r, a as co, A as Fn } from "./saved-dashboard-context-qtfzl9Eb.js";
|
|
22
|
+
import { dY as uo, as as po, v as Or } from "./global-date-filter-utils-CeeFJ1CP.js";
|
|
23
|
+
import { d as fo } from "./document-dashboard-inputs-B2AqPfrq.js";
|
|
24
24
|
import { w as mo, c as Ln } from "./visual-choice-JiJ-_3bi.js";
|
|
25
25
|
import { A as ho, v as Un, t as go, g as ge, d as vo, b as bo, h as ir, w as yo, s as Wt, a as xo } from "./add-to-dashboard-BQRAAnc3.js";
|
|
26
|
-
import { a as wo } from "./
|
|
26
|
+
import { a as wo } from "./filter-reach-copy-ByzGadUk.js";
|
|
27
27
|
import { S as zr, U as Mr, V as Pr, O as Rr, f as _o, F as Io } from "./temporal-bucket-CQOSbv9-.js";
|
|
28
28
|
import { C as So, a as ko } from "./selection-reducer-CJzkTZio.js";
|
|
29
29
|
import { c as Nt, X as nt } from "./x-4f5U2XwU.js";
|
|
@@ -184,7 +184,7 @@ function Do(e) {
|
|
|
184
184
|
async (i, g) => {
|
|
185
185
|
var E, O;
|
|
186
186
|
const u = W.getState(), v = (E = u.dashboard) == null ? void 0 : E.id, w = u.selectedSheetId;
|
|
187
|
-
if (!v || !w) throw new
|
|
187
|
+
if (!v || !w) throw new He(zt);
|
|
188
188
|
const S = { title: i.title, type: ho[g], ...i.card }, _ = !Fo({ ...S, id: "check" }, i, g), x = { ...S, ..._ ? { type: "table" } : {}, id: Or() }, y = { id: Or(), cards: [x], activeCardId: x.id }, I = await s(y, { reuseLoaded: !0 }).catch((J) => {
|
|
189
189
|
console.warn("Adding the result without refreshed semantic metadata:", J);
|
|
190
190
|
}), h = structuredClone(W.getState().semanticExecutionPayload);
|
|
@@ -194,11 +194,11 @@ function Do(e) {
|
|
|
194
194
|
Lo(x, w, h, o)
|
|
195
195
|
), b = d === (x.config ?? {}) ? y : { ...y, cards: [{ ...x, config: d }] }, m = W.getState();
|
|
196
196
|
if (((O = m.dashboard) == null ? void 0 : O.id) !== v || m.selectedSheetId !== w || m.isVisualEditing)
|
|
197
|
-
throw new
|
|
198
|
-
if (!r()) throw new
|
|
197
|
+
throw new He(zt);
|
|
198
|
+
if (!r()) throw new He(jo);
|
|
199
199
|
const { actions: N } = m;
|
|
200
200
|
if (N.setIsDashboardEditing(!0), N.addFrame(w, b, { semanticExecutionPayload: I }), !Jn(W.getState().dashboard, b.id))
|
|
201
|
-
throw m.isDashboardEditing || N.setIsDashboardEditing(!1), new
|
|
201
|
+
throw m.isDashboardEditing || N.setIsDashboardEditing(!1), new He(zt);
|
|
202
202
|
return N.setSelectedFrameId(b.id), { frameId: b.id, asTable: _ };
|
|
203
203
|
},
|
|
204
204
|
[r, s, o]
|
|
@@ -212,7 +212,7 @@ function Fo(e, t, r) {
|
|
|
212
212
|
const { x: a, y: o = [], series: s } = n.visual.encodings, c = Ts({ card: e, cardType: e.type, records: t.records }), p = (i, g, u) => JSON.stringify([i, g ?? null, [...u].sort()]);
|
|
213
213
|
return p(c.axisKeys, c.seriesKey, c.valueKeys) === p(a ? [a] : [], s, o);
|
|
214
214
|
}
|
|
215
|
-
class
|
|
215
|
+
class He extends Error {
|
|
216
216
|
constructor(t) {
|
|
217
217
|
super(t), this.name = "AddToDashboardRefusedError";
|
|
218
218
|
}
|
|
@@ -293,7 +293,7 @@ var Q = class Kn extends Error {
|
|
|
293
293
|
return t != null && typeof t == "object" && n in t && typeof t[n] == "boolean" && t[n] === !0;
|
|
294
294
|
}
|
|
295
295
|
};
|
|
296
|
-
const Gn = "AI_APICallError",
|
|
296
|
+
const Gn = "AI_APICallError", Yn = `vercel.ai.error.${Gn}`, qo = Symbol.for(Yn);
|
|
297
297
|
var Jo = class extends Q {
|
|
298
298
|
constructor({ message: e, url: t, requestBodyValues: r, statusCode: n, responseHeaders: a, responseBody: o, cause: s, isRetryable: c = n != null && (n === 408 || n === 409 || n === 429 || n >= 500), data: p }) {
|
|
299
299
|
super({
|
|
@@ -303,14 +303,14 @@ var Jo = class extends Q {
|
|
|
303
303
|
}), this[qo] = !0, this.url = t, this.requestBodyValues = r, this.statusCode = n, this.responseHeaders = a, this.responseBody = o, this.isRetryable = c, this.data = p;
|
|
304
304
|
}
|
|
305
305
|
static isInstance(e) {
|
|
306
|
-
return Q.hasMarker(e,
|
|
306
|
+
return Q.hasMarker(e, Yn);
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
-
const
|
|
309
|
+
const Hn = "AI_EmptyResponseBodyError", Xn = `vercel.ai.error.${Hn}`, Wo = Symbol.for(Xn);
|
|
310
310
|
var Fr = class extends Q {
|
|
311
311
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
312
312
|
super({
|
|
313
|
-
name:
|
|
313
|
+
name: Hn,
|
|
314
314
|
message: e
|
|
315
315
|
}), this[Wo] = !0;
|
|
316
316
|
}
|
|
@@ -334,7 +334,7 @@ var Go = class extends Q {
|
|
|
334
334
|
return Q.hasMarker(t, ta);
|
|
335
335
|
}
|
|
336
336
|
};
|
|
337
|
-
const ra = "AI_JSONParseError", na = `vercel.ai.error.${ra}`,
|
|
337
|
+
const ra = "AI_JSONParseError", na = `vercel.ai.error.${ra}`, Yo = Symbol.for(na);
|
|
338
338
|
var Lr = class extends Q {
|
|
339
339
|
constructor({ text: e, cause: t }) {
|
|
340
340
|
super({
|
|
@@ -342,13 +342,13 @@ var Lr = class extends Q {
|
|
|
342
342
|
message: `JSON parsing failed: Text: ${e}.
|
|
343
343
|
Error message: ${Qn(t)}`,
|
|
344
344
|
cause: t
|
|
345
|
-
}), this[
|
|
345
|
+
}), this[Yo] = !0, this.text = e;
|
|
346
346
|
}
|
|
347
347
|
static isInstance(e) {
|
|
348
348
|
return Q.hasMarker(e, na);
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
|
-
const aa = "AI_TypeValidationError", sa = `vercel.ai.error.${aa}`,
|
|
351
|
+
const aa = "AI_TypeValidationError", sa = `vercel.ai.error.${aa}`, Ho = Symbol.for(sa);
|
|
352
352
|
var xt = class Kt extends Q {
|
|
353
353
|
constructor({ value: t, cause: r, context: n }) {
|
|
354
354
|
let a = "Type validation failed";
|
|
@@ -362,7 +362,7 @@ var xt = class Kt extends Q {
|
|
|
362
362
|
message: `${a}: Value: ${JSON.stringify(t)}.
|
|
363
363
|
Error message: ${Qn(r)}`,
|
|
364
364
|
cause: r
|
|
365
|
-
}), this[
|
|
365
|
+
}), this[Ho] = !0, this.value = t, this.context = n;
|
|
366
366
|
}
|
|
367
367
|
static isInstance(t) {
|
|
368
368
|
return Q.hasMarker(t, sa);
|
|
@@ -946,7 +946,7 @@ const ji = (e) => {
|
|
|
946
946
|
continue: !t.abort
|
|
947
947
|
});
|
|
948
948
|
};
|
|
949
|
-
}),
|
|
949
|
+
}), Yi = /* @__PURE__ */ k("$ZodCheckLengthEquals", (e, t) => {
|
|
950
950
|
var r;
|
|
951
951
|
ce.init(e, t), (r = e._zod.def).when ?? (r.when = (n) => {
|
|
952
952
|
const a = n.value;
|
|
@@ -986,7 +986,7 @@ const ji = (e) => {
|
|
|
986
986
|
});
|
|
987
987
|
}) : (n = e._zod).check ?? (n.check = () => {
|
|
988
988
|
});
|
|
989
|
-
}),
|
|
989
|
+
}), Hi = /* @__PURE__ */ k("$ZodCheckRegex", (e, t) => {
|
|
990
990
|
Tt.init(e, t), e._zod.check = (r) => {
|
|
991
991
|
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
992
992
|
origin: "string",
|
|
@@ -1847,7 +1847,7 @@ const Gl = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1847
1847
|
input: r.value
|
|
1848
1848
|
}), r.issues = []), r);
|
|
1849
1849
|
};
|
|
1850
|
-
}),
|
|
1850
|
+
}), Yl = /* @__PURE__ */ k("$ZodPipe", (e, t) => {
|
|
1851
1851
|
L.init(e, t), Z(e._zod, "values", () => t.in._zod.values), Z(e._zod, "optin", () => t.in._zod.optin), Z(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
|
|
1852
1852
|
const a = t.in._zod.run(r, n);
|
|
1853
1853
|
return a instanceof Promise ? a.then((o) => Gr(o, t, n)) : Gr(a, t, n);
|
|
@@ -1856,13 +1856,13 @@ const Gl = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1856
1856
|
function Gr(e, t, r) {
|
|
1857
1857
|
return Qe(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, r);
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1859
|
+
const Hl = /* @__PURE__ */ k("$ZodReadonly", (e, t) => {
|
|
1860
1860
|
L.init(e, t), Z(e._zod, "propValues", () => t.innerType._zod.propValues), Z(e._zod, "values", () => t.innerType._zod.values), Z(e._zod, "optin", () => t.innerType._zod.optin), Z(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (r, n) => {
|
|
1861
1861
|
const a = t.innerType._zod.run(r, n);
|
|
1862
|
-
return a instanceof Promise ? a.then(
|
|
1862
|
+
return a instanceof Promise ? a.then(Yr) : Yr(a);
|
|
1863
1863
|
};
|
|
1864
1864
|
});
|
|
1865
|
-
function
|
|
1865
|
+
function Yr(e) {
|
|
1866
1866
|
return e.value = Object.freeze(e.value), e;
|
|
1867
1867
|
}
|
|
1868
1868
|
const Xl = /* @__PURE__ */ k("$ZodLazy", (e, t) => {
|
|
@@ -1871,11 +1871,11 @@ const Xl = /* @__PURE__ */ k("$ZodLazy", (e, t) => {
|
|
|
1871
1871
|
ce.init(e, t), L.init(e, t), e._zod.parse = (r, n) => r, e._zod.check = (r) => {
|
|
1872
1872
|
const n = r.value, a = t.fn(n);
|
|
1873
1873
|
if (a instanceof Promise)
|
|
1874
|
-
return a.then((o) =>
|
|
1875
|
-
|
|
1874
|
+
return a.then((o) => Hr(o, r, n, e));
|
|
1875
|
+
Hr(a, r, n, e);
|
|
1876
1876
|
};
|
|
1877
1877
|
});
|
|
1878
|
-
function
|
|
1878
|
+
function Hr(e, t, r, n) {
|
|
1879
1879
|
if (!e) {
|
|
1880
1880
|
const a = {
|
|
1881
1881
|
code: "custom",
|
|
@@ -2262,14 +2262,14 @@ function It(e, t) {
|
|
|
2262
2262
|
});
|
|
2263
2263
|
}
|
|
2264
2264
|
function Ea(e, t) {
|
|
2265
|
-
return new
|
|
2265
|
+
return new Yi({
|
|
2266
2266
|
check: "length_equals",
|
|
2267
2267
|
...C(t),
|
|
2268
2268
|
length: e
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
function zc(e, t) {
|
|
2272
|
-
return new
|
|
2272
|
+
return new Hi({
|
|
2273
2273
|
check: "string_format",
|
|
2274
2274
|
format: "regex",
|
|
2275
2275
|
...C(t),
|
|
@@ -2879,14 +2879,14 @@ function Kc(e) {
|
|
|
2879
2879
|
const Gc = /* @__PURE__ */ k("ZodISODate", (e, t) => {
|
|
2880
2880
|
bl.init(e, t), q.init(e, t);
|
|
2881
2881
|
});
|
|
2882
|
-
function
|
|
2882
|
+
function Yc(e) {
|
|
2883
2883
|
return Sc(Gc, e);
|
|
2884
2884
|
}
|
|
2885
|
-
const
|
|
2885
|
+
const Hc = /* @__PURE__ */ k("ZodISOTime", (e, t) => {
|
|
2886
2886
|
yl.init(e, t), q.init(e, t);
|
|
2887
2887
|
});
|
|
2888
2888
|
function Xc(e) {
|
|
2889
|
-
return kc(
|
|
2889
|
+
return kc(Hc, e);
|
|
2890
2890
|
}
|
|
2891
2891
|
const Qc = /* @__PURE__ */ k("ZodISODuration", (e, t) => {
|
|
2892
2892
|
xl.init(e, t), q.init(e, t);
|
|
@@ -2930,7 +2930,7 @@ const tu = (e, t) => {
|
|
|
2930
2930
|
]
|
|
2931
2931
|
}
|
|
2932
2932
|
// { parent: true }
|
|
2933
|
-
), e.clone = (r, n) => Pe(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => ru(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => au(e, r, n), e.parseAsync = async (r, n) => nu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ta(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(od(r, n)), e.superRefine = (r) => e.check(id(r)), e.overwrite = (r) => e.check(ct(r)), e.optional = () => sn(e), e.nullable = () => on(e), e.nullish = () => sn(on(e)), e.nonoptional = (r) =>
|
|
2933
|
+
), e.clone = (r, n) => Pe(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => ru(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => au(e, r, n), e.parseAsync = async (r, n) => nu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ta(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(od(r, n)), e.superRefine = (r) => e.check(id(r)), e.overwrite = (r) => e.check(ct(r)), e.optional = () => sn(e), e.nullable = () => on(e), e.nullish = () => sn(on(e)), e.nonoptional = (r) => Yu(e, r), e.array = () => Oa(e), e.or = (r) => Pa([e, r]), e.and = (r) => Du(e, r), e.transform = (r) => ln(e, Vu(r)), e.default = (r) => Wu(e, r), e.prefault = (r) => Gu(e, r), e.catch = (r) => Xu(e, r), e.pipe = (r) => ln(e, r), e.readonly = () => td(e), e.describe = (r) => {
|
|
2934
2934
|
const n = e.clone();
|
|
2935
2935
|
return Xe.add(n, { description: r }), n;
|
|
2936
2936
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2949,7 +2949,7 @@ const tu = (e, t) => {
|
|
|
2949
2949
|
const r = e._zod.bag;
|
|
2950
2950
|
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(zc(...n)), e.includes = (...n) => e.check(Rc(...n)), e.startsWith = (...n) => e.check(Zc(...n)), e.endsWith = (...n) => e.check(Dc(...n)), e.min = (...n) => e.check(It(...n)), e.max = (...n) => e.check(Na(...n)), e.length = (...n) => e.check(Ea(...n)), e.nonempty = (...n) => e.check(It(1, ...n)), e.lowercase = (n) => e.check(Mc(n)), e.uppercase = (n) => e.check(Pc(n)), e.trim = () => e.check(Fc()), e.normalize = (...n) => e.check(jc(...n)), e.toLowerCase = () => e.check(Lc()), e.toUpperCase = () => e.check(Uc());
|
|
2951
2951
|
}), su = /* @__PURE__ */ k("ZodString", (e, t) => {
|
|
2952
|
-
pr.init(e, t), Aa.init(e, t), e.email = (r) => e.check(rc(iu, r)), e.url = (r) => e.check(ic(lu, r)), e.jwt = (r) => e.check(_c(Iu, r)), e.emoji = (r) => e.check(lc(cu, r)), e.guid = (r) => e.check(Xr(nn, r)), e.uuid = (r) => e.check(nc(gt, r)), e.uuidv4 = (r) => e.check(ac(gt, r)), e.uuidv6 = (r) => e.check(sc(gt, r)), e.uuidv7 = (r) => e.check(oc(gt, r)), e.nanoid = (r) => e.check(cc(uu, r)), e.guid = (r) => e.check(Xr(nn, r)), e.cuid = (r) => e.check(uc(du, r)), e.cuid2 = (r) => e.check(dc(pu, r)), e.ulid = (r) => e.check(pc(fu, r)), e.base64 = (r) => e.check(yc(xu, r)), e.base64url = (r) => e.check(xc(wu, r)), e.xid = (r) => e.check(fc(mu, r)), e.ksuid = (r) => e.check(mc(hu, r)), e.ipv4 = (r) => e.check(hc(gu, r)), e.ipv6 = (r) => e.check(gc(vu, r)), e.cidrv4 = (r) => e.check(vc(bu, r)), e.cidrv6 = (r) => e.check(bc(yu, r)), e.e164 = (r) => e.check(wc(_u, r)), e.datetime = (r) => e.check(Kc(r)), e.date = (r) => e.check(
|
|
2952
|
+
pr.init(e, t), Aa.init(e, t), e.email = (r) => e.check(rc(iu, r)), e.url = (r) => e.check(ic(lu, r)), e.jwt = (r) => e.check(_c(Iu, r)), e.emoji = (r) => e.check(lc(cu, r)), e.guid = (r) => e.check(Xr(nn, r)), e.uuid = (r) => e.check(nc(gt, r)), e.uuidv4 = (r) => e.check(ac(gt, r)), e.uuidv6 = (r) => e.check(sc(gt, r)), e.uuidv7 = (r) => e.check(oc(gt, r)), e.nanoid = (r) => e.check(cc(uu, r)), e.guid = (r) => e.check(Xr(nn, r)), e.cuid = (r) => e.check(uc(du, r)), e.cuid2 = (r) => e.check(dc(pu, r)), e.ulid = (r) => e.check(pc(fu, r)), e.base64 = (r) => e.check(yc(xu, r)), e.base64url = (r) => e.check(xc(wu, r)), e.xid = (r) => e.check(fc(mu, r)), e.ksuid = (r) => e.check(mc(hu, r)), e.ipv4 = (r) => e.check(hc(gu, r)), e.ipv6 = (r) => e.check(gc(vu, r)), e.cidrv4 = (r) => e.check(vc(bu, r)), e.cidrv6 = (r) => e.check(bc(yu, r)), e.e164 = (r) => e.check(wc(_u, r)), e.datetime = (r) => e.check(Kc(r)), e.date = (r) => e.check(Yc(r)), e.time = (r) => e.check(Xc(r)), e.duration = (r) => e.check(eu(r));
|
|
2953
2953
|
});
|
|
2954
2954
|
function ou(e) {
|
|
2955
2955
|
return tc(su, e);
|
|
@@ -3103,7 +3103,7 @@ function Fu(e, t, r) {
|
|
|
3103
3103
|
...C(r)
|
|
3104
3104
|
});
|
|
3105
3105
|
}
|
|
3106
|
-
const
|
|
3106
|
+
const Yt = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
3107
3107
|
Ll.init(e, t), V.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3108
3108
|
const r = new Set(Object.keys(t.entries));
|
|
3109
3109
|
e.extract = (n, a) => {
|
|
@@ -3113,7 +3113,7 @@ const Ht = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
3113
3113
|
o[s] = t.entries[s];
|
|
3114
3114
|
else
|
|
3115
3115
|
throw new Error(`Key ${s} not found in enum`);
|
|
3116
|
-
return new
|
|
3116
|
+
return new Yt({
|
|
3117
3117
|
...t,
|
|
3118
3118
|
checks: [],
|
|
3119
3119
|
...C(a),
|
|
@@ -3126,7 +3126,7 @@ const Ht = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
3126
3126
|
delete o[s];
|
|
3127
3127
|
else
|
|
3128
3128
|
throw new Error(`Key ${s} not found in enum`);
|
|
3129
|
-
return new
|
|
3129
|
+
return new Yt({
|
|
3130
3130
|
...t,
|
|
3131
3131
|
checks: [],
|
|
3132
3132
|
...C(a),
|
|
@@ -3136,7 +3136,7 @@ const Ht = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
3136
3136
|
});
|
|
3137
3137
|
function Ra(e, t) {
|
|
3138
3138
|
const r = Array.isArray(e) ? Object.fromEntries(e.map((n) => [n, n])) : e;
|
|
3139
|
-
return new
|
|
3139
|
+
return new Yt({
|
|
3140
3140
|
type: "enum",
|
|
3141
3141
|
entries: r,
|
|
3142
3142
|
...C(t)
|
|
@@ -3223,25 +3223,25 @@ function Gu(e, t) {
|
|
|
3223
3223
|
const Da = /* @__PURE__ */ k("ZodNonOptional", (e, t) => {
|
|
3224
3224
|
Kl.init(e, t), V.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
3225
3225
|
});
|
|
3226
|
-
function
|
|
3226
|
+
function Yu(e, t) {
|
|
3227
3227
|
return new Da({
|
|
3228
3228
|
type: "nonoptional",
|
|
3229
3229
|
innerType: e,
|
|
3230
3230
|
...C(t)
|
|
3231
3231
|
});
|
|
3232
3232
|
}
|
|
3233
|
-
const
|
|
3233
|
+
const Hu = /* @__PURE__ */ k("ZodCatch", (e, t) => {
|
|
3234
3234
|
Gl.init(e, t), V.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3235
3235
|
});
|
|
3236
3236
|
function Xu(e, t) {
|
|
3237
|
-
return new
|
|
3237
|
+
return new Hu({
|
|
3238
3238
|
type: "catch",
|
|
3239
3239
|
innerType: e,
|
|
3240
3240
|
catchValue: typeof t == "function" ? t : () => t
|
|
3241
3241
|
});
|
|
3242
3242
|
}
|
|
3243
3243
|
const Qu = /* @__PURE__ */ k("ZodPipe", (e, t) => {
|
|
3244
|
-
|
|
3244
|
+
Yl.init(e, t), V.init(e, t), e.in = t.in, e.out = t.out;
|
|
3245
3245
|
});
|
|
3246
3246
|
function ln(e, t) {
|
|
3247
3247
|
return new Qu({
|
|
@@ -3252,7 +3252,7 @@ function ln(e, t) {
|
|
|
3252
3252
|
});
|
|
3253
3253
|
}
|
|
3254
3254
|
const ed = /* @__PURE__ */ k("ZodReadonly", (e, t) => {
|
|
3255
|
-
|
|
3255
|
+
Hl.init(e, t), V.init(e, t);
|
|
3256
3256
|
});
|
|
3257
3257
|
function td(e) {
|
|
3258
3258
|
return new ed({
|
|
@@ -3424,8 +3424,8 @@ ${$}`, u++;
|
|
|
3424
3424
|
I(O, "", O);
|
|
3425
3425
|
return;
|
|
3426
3426
|
}
|
|
3427
|
-
const
|
|
3428
|
-
I(
|
|
3427
|
+
const Y = O.slice(0, J), Re = O.charCodeAt(J + 1) === Ne ? 2 : 1, Ze = O.slice(J + Re);
|
|
3428
|
+
I(Y, Ze, O);
|
|
3429
3429
|
}
|
|
3430
3430
|
function I(b, m, N) {
|
|
3431
3431
|
switch (b) {
|
|
@@ -4013,7 +4013,7 @@ function Pd() {
|
|
|
4013
4013
|
function Rd() {
|
|
4014
4014
|
return { type: "null" };
|
|
4015
4015
|
}
|
|
4016
|
-
const
|
|
4016
|
+
const Ht = {
|
|
4017
4017
|
ZodString: "string",
|
|
4018
4018
|
ZodNumber: "number",
|
|
4019
4019
|
ZodBigInt: "integer",
|
|
@@ -4022,9 +4022,9 @@ const Yt = {
|
|
|
4022
4022
|
};
|
|
4023
4023
|
function Zd(e, t) {
|
|
4024
4024
|
const r = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
4025
|
-
if (r.every((n) => n._def.typeName in
|
|
4025
|
+
if (r.every((n) => n._def.typeName in Ht && (!n._def.checks || !n._def.checks.length))) {
|
|
4026
4026
|
const n = r.reduce((a, o) => {
|
|
4027
|
-
const s =
|
|
4027
|
+
const s = Ht[o._def.typeName];
|
|
4028
4028
|
return s && !a.includes(s) ? [...a, s] : a;
|
|
4029
4029
|
}, []);
|
|
4030
4030
|
return { type: n.length > 1 ? n : n[0] };
|
|
@@ -4075,7 +4075,7 @@ function jd(e, t) {
|
|
|
4075
4075
|
"ZodBigInt",
|
|
4076
4076
|
"ZodBoolean",
|
|
4077
4077
|
"ZodNull"
|
|
4078
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
4078
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Ht[e.innerType._def.typeName], "null"] };
|
|
4079
4079
|
const r = D(e.innerType._def, {
|
|
4080
4080
|
...t,
|
|
4081
4081
|
currentPath: [
|
|
@@ -4231,10 +4231,10 @@ function Kd(e, t) {
|
|
|
4231
4231
|
function Gd() {
|
|
4232
4232
|
return { not: de() };
|
|
4233
4233
|
}
|
|
4234
|
-
function
|
|
4234
|
+
function Yd() {
|
|
4235
4235
|
return de();
|
|
4236
4236
|
}
|
|
4237
|
-
const
|
|
4237
|
+
const Hd = (e, t) => D(e.innerType._def, t), Xd = (e, t, r) => {
|
|
4238
4238
|
switch (t) {
|
|
4239
4239
|
case "ZodString":
|
|
4240
4240
|
return La(e, r);
|
|
@@ -4289,13 +4289,13 @@ const Yd = (e, t) => D(e.innerType._def, t), Xd = (e, t, r) => {
|
|
|
4289
4289
|
case "ZodAny":
|
|
4290
4290
|
return de();
|
|
4291
4291
|
case "ZodUnknown":
|
|
4292
|
-
return
|
|
4292
|
+
return Yd();
|
|
4293
4293
|
case "ZodDefault":
|
|
4294
4294
|
return kd(e, r);
|
|
4295
4295
|
case "ZodBranded":
|
|
4296
4296
|
return ja(e, r);
|
|
4297
4297
|
case "ZodReadonly":
|
|
4298
|
-
return
|
|
4298
|
+
return Hd(e, r);
|
|
4299
4299
|
case "ZodCatch":
|
|
4300
4300
|
return Id(e, r);
|
|
4301
4301
|
case "ZodPipeline":
|
|
@@ -4633,7 +4633,7 @@ const l = {
|
|
|
4633
4633
|
l.instanceof(Uint8Array),
|
|
4634
4634
|
l.instanceof(ArrayBuffer),
|
|
4635
4635
|
l.custom(fd, { message: "Must be a Buffer" })
|
|
4636
|
-
]), hr = l.record(l.string(), l.string()),
|
|
4636
|
+
]), hr = l.record(l.string(), l.string()), Ya = l.object({
|
|
4637
4637
|
type: l.literal("text"),
|
|
4638
4638
|
text: l.string(),
|
|
4639
4639
|
providerOptions: M.optional()
|
|
@@ -4646,7 +4646,7 @@ const l = {
|
|
|
4646
4646
|
]),
|
|
4647
4647
|
mediaType: l.string().optional(),
|
|
4648
4648
|
providerOptions: M.optional()
|
|
4649
|
-
}),
|
|
4649
|
+
}), Ha = l.discriminatedUnion("type", [
|
|
4650
4650
|
l.object({
|
|
4651
4651
|
type: l.literal("data"),
|
|
4652
4652
|
data: ut
|
|
@@ -4672,7 +4672,7 @@ const l = {
|
|
|
4672
4672
|
})]), Xa = l.object({
|
|
4673
4673
|
type: l.literal("file"),
|
|
4674
4674
|
data: l.union([
|
|
4675
|
-
|
|
4675
|
+
Ha,
|
|
4676
4676
|
ut,
|
|
4677
4677
|
l.instanceof(URL),
|
|
4678
4678
|
hr
|
|
@@ -4740,7 +4740,7 @@ const l = {
|
|
|
4740
4740
|
}),
|
|
4741
4741
|
l.object({
|
|
4742
4742
|
type: l.literal("file"),
|
|
4743
|
-
data:
|
|
4743
|
+
data: Ha,
|
|
4744
4744
|
mediaType: l.string(),
|
|
4745
4745
|
filename: l.string().optional(),
|
|
4746
4746
|
providerOptions: M.optional()
|
|
@@ -4821,7 +4821,7 @@ const l = {
|
|
|
4821
4821
|
}), kp = l.object({
|
|
4822
4822
|
role: l.literal("user"),
|
|
4823
4823
|
content: l.union([l.string(), l.array(l.union([
|
|
4824
|
-
|
|
4824
|
+
Ya,
|
|
4825
4825
|
hp,
|
|
4826
4826
|
Xa
|
|
4827
4827
|
]))]),
|
|
@@ -4829,7 +4829,7 @@ const l = {
|
|
|
4829
4829
|
}), Np = l.object({
|
|
4830
4830
|
role: l.literal("assistant"),
|
|
4831
4831
|
content: l.union([l.string(), l.array(l.union([
|
|
4832
|
-
|
|
4832
|
+
Ya,
|
|
4833
4833
|
bp,
|
|
4834
4834
|
Xa,
|
|
4835
4835
|
vp,
|
|
@@ -5094,7 +5094,7 @@ ee({
|
|
|
5094
5094
|
});
|
|
5095
5095
|
}
|
|
5096
5096
|
});
|
|
5097
|
-
const
|
|
5097
|
+
const Ye = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
5098
5098
|
l.looseObject({
|
|
5099
5099
|
type: l.literal("text-start"),
|
|
5100
5100
|
id: l.string(),
|
|
@@ -5121,7 +5121,7 @@ const He = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
|
5121
5121
|
toolName: l.string(),
|
|
5122
5122
|
providerExecuted: l.boolean().optional(),
|
|
5123
5123
|
providerMetadata: M.optional(),
|
|
5124
|
-
toolMetadata:
|
|
5124
|
+
toolMetadata: Ye.optional(),
|
|
5125
5125
|
dynamic: l.boolean().optional(),
|
|
5126
5126
|
title: l.string().optional()
|
|
5127
5127
|
}),
|
|
@@ -5137,7 +5137,7 @@ const He = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
|
5137
5137
|
input: l.unknown(),
|
|
5138
5138
|
providerExecuted: l.boolean().optional(),
|
|
5139
5139
|
providerMetadata: M.optional(),
|
|
5140
|
-
toolMetadata:
|
|
5140
|
+
toolMetadata: Ye.optional(),
|
|
5141
5141
|
dynamic: l.boolean().optional(),
|
|
5142
5142
|
title: l.string().optional()
|
|
5143
5143
|
}),
|
|
@@ -5148,7 +5148,7 @@ const He = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
|
5148
5148
|
input: l.unknown(),
|
|
5149
5149
|
providerExecuted: l.boolean().optional(),
|
|
5150
5150
|
providerMetadata: M.optional(),
|
|
5151
|
-
toolMetadata:
|
|
5151
|
+
toolMetadata: Ye.optional(),
|
|
5152
5152
|
dynamic: l.boolean().optional(),
|
|
5153
5153
|
errorText: l.string(),
|
|
5154
5154
|
title: l.string().optional()
|
|
@@ -5177,7 +5177,7 @@ const He = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
|
5177
5177
|
output: l.unknown(),
|
|
5178
5178
|
providerExecuted: l.boolean().optional(),
|
|
5179
5179
|
providerMetadata: M.optional(),
|
|
5180
|
-
toolMetadata:
|
|
5180
|
+
toolMetadata: Ye.optional(),
|
|
5181
5181
|
dynamic: l.boolean().optional(),
|
|
5182
5182
|
preliminary: l.boolean().optional()
|
|
5183
5183
|
}),
|
|
@@ -5187,7 +5187,7 @@ const He = l.record(l.string(), Me.optional()), Cp = ap(() => Ba(l.union([
|
|
|
5187
5187
|
errorText: l.string(),
|
|
5188
5188
|
providerExecuted: l.boolean().optional(),
|
|
5189
5189
|
providerMetadata: M.optional(),
|
|
5190
|
-
toolMetadata:
|
|
5190
|
+
toolMetadata: Ye.optional(),
|
|
5191
5191
|
dynamic: l.boolean().optional()
|
|
5192
5192
|
}),
|
|
5193
5193
|
l.looseObject({
|
|
@@ -6334,8 +6334,8 @@ var jp = class {
|
|
|
6334
6334
|
const E = (O) => this.jobExecutor.run(() => m.abortController.signal.aborted ? Promise.resolve() : O({
|
|
6335
6335
|
state: m.state,
|
|
6336
6336
|
write: ({ updateStatus: J = !0 } = {}) => {
|
|
6337
|
-
var
|
|
6338
|
-
m.abortController.signal.aborted || (J && this.setStatus({ status: "streaming" }), _ ? this.state.replaceMessage(v, m.state.message) : m.state.message.id === ((
|
|
6337
|
+
var Y;
|
|
6338
|
+
m.abortController.signal.aborted || (J && this.setStatus({ status: "streaming" }), _ ? this.state.replaceMessage(v, m.state.message) : m.state.message.id === ((Y = this.lastMessage) == null ? void 0 : Y.id) ? this.state.replaceMessage(this.state.messages.length - 1, m.state.message) : this.state.pushMessage(m.state.message));
|
|
6339
6339
|
}
|
|
6340
6340
|
}));
|
|
6341
6341
|
if (await Mp({
|
|
@@ -6428,12 +6428,12 @@ var ue, Ve, qe, Ae, Ce, $e, xe, ot, it, Sn, Jp = (Sn = class {
|
|
|
6428
6428
|
pe(this, xe);
|
|
6429
6429
|
pe(this, ot);
|
|
6430
6430
|
pe(this, it);
|
|
6431
|
-
|
|
6432
|
-
|
|
6431
|
+
H(this, Ve, "ready"), H(this, qe, void 0), H(this, Ae, /* @__PURE__ */ new Set()), H(this, Ce, /* @__PURE__ */ new Set()), H(this, $e, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
|
|
6432
|
+
H(this, ue, F(this, ue).concat(t)), F(this, xe).call(this);
|
|
6433
6433
|
}, this.popMessage = () => {
|
|
6434
|
-
|
|
6434
|
+
H(this, ue, F(this, ue).slice(0, -1)), F(this, xe).call(this);
|
|
6435
6435
|
}, this.replaceMessage = (t, r) => {
|
|
6436
|
-
|
|
6436
|
+
H(this, ue, [
|
|
6437
6437
|
...F(this, ue).slice(0, t),
|
|
6438
6438
|
this.snapshot(r),
|
|
6439
6439
|
...F(this, ue).slice(t + 1)
|
|
@@ -6454,31 +6454,31 @@ var ue, Ve, qe, Ae, Ce, $e, xe, ot, it, Sn, Jp = (Sn = class {
|
|
|
6454
6454
|
F(this, Ce).delete(t);
|
|
6455
6455
|
}), this["~registerErrorCallback"] = (t) => (F(this, $e).add(t), () => {
|
|
6456
6456
|
F(this, $e).delete(t);
|
|
6457
|
-
}),
|
|
6457
|
+
}), H(this, xe, () => {
|
|
6458
6458
|
F(this, Ae).forEach((t) => t());
|
|
6459
|
-
}),
|
|
6459
|
+
}), H(this, ot, () => {
|
|
6460
6460
|
F(this, Ce).forEach((t) => t());
|
|
6461
|
-
}),
|
|
6461
|
+
}), H(this, it, () => {
|
|
6462
6462
|
F(this, $e).forEach((t) => t());
|
|
6463
|
-
}),
|
|
6463
|
+
}), H(this, ue, e);
|
|
6464
6464
|
}
|
|
6465
6465
|
get status() {
|
|
6466
6466
|
return F(this, Ve);
|
|
6467
6467
|
}
|
|
6468
6468
|
set status(e) {
|
|
6469
|
-
|
|
6469
|
+
H(this, Ve, e), F(this, ot).call(this);
|
|
6470
6470
|
}
|
|
6471
6471
|
get error() {
|
|
6472
6472
|
return F(this, qe);
|
|
6473
6473
|
}
|
|
6474
6474
|
set error(e) {
|
|
6475
|
-
|
|
6475
|
+
H(this, qe, e), F(this, it).call(this);
|
|
6476
6476
|
}
|
|
6477
6477
|
get messages() {
|
|
6478
6478
|
return F(this, ue);
|
|
6479
6479
|
}
|
|
6480
6480
|
set messages(e) {
|
|
6481
|
-
|
|
6481
|
+
H(this, ue, [...e]), F(this, xe).call(this);
|
|
6482
6482
|
}
|
|
6483
6483
|
}, ue = new WeakMap(), Ve = new WeakMap(), qe = new WeakMap(), Ae = new WeakMap(), Ce = new WeakMap(), $e = new WeakMap(), xe = new WeakMap(), ot = new WeakMap(), it = new WeakMap(), Sn), Oe, kn, ts = (kn = class extends Fp {
|
|
6484
6484
|
constructor({ messages: t, ...r }) {
|
|
@@ -6488,7 +6488,7 @@ var ue, Ve, qe, Ae, Ce, $e, xe, ot, it, Sn, Jp = (Sn = class {
|
|
|
6488
6488
|
state: n
|
|
6489
6489
|
});
|
|
6490
6490
|
pe(this, Oe);
|
|
6491
|
-
this["~registerMessagesCallback"] = (a, o) => F(this, Oe)["~registerMessagesCallback"](a, o), this["~registerStatusCallback"] = (a) => F(this, Oe)["~registerStatusCallback"](a), this["~registerErrorCallback"] = (a) => F(this, Oe)["~registerErrorCallback"](a),
|
|
6491
|
+
this["~registerMessagesCallback"] = (a, o) => F(this, Oe)["~registerMessagesCallback"](a, o), this["~registerStatusCallback"] = (a) => F(this, Oe)["~registerStatusCallback"](a), this["~registerErrorCallback"] = (a) => F(this, Oe)["~registerErrorCallback"](a), H(this, Oe, n);
|
|
6492
6492
|
}
|
|
6493
6493
|
}, Oe = new WeakMap(), kn);
|
|
6494
6494
|
const Ft = /* @__PURE__ */ new WeakMap();
|
|
@@ -6622,10 +6622,10 @@ async function rr(e, t) {
|
|
|
6622
6622
|
async function Gp(e, t) {
|
|
6623
6623
|
return (await br(e, "sources", t)).sources;
|
|
6624
6624
|
}
|
|
6625
|
-
async function
|
|
6625
|
+
async function Yp(e, t) {
|
|
6626
6626
|
return (await br(e, "conversations", t)).conversations;
|
|
6627
6627
|
}
|
|
6628
|
-
function
|
|
6628
|
+
function Hp(e, t, r) {
|
|
6629
6629
|
return br(e, `conversations/${encodeURIComponent(t)}`, r);
|
|
6630
6630
|
}
|
|
6631
6631
|
async function Xp(e, t) {
|
|
@@ -6759,7 +6759,7 @@ function nf(e) {
|
|
|
6759
6759
|
$.beside && p.aboutCardId !== z && O();
|
|
6760
6760
|
},
|
|
6761
6761
|
[p, O]
|
|
6762
|
-
),
|
|
6762
|
+
), Y = X((z) => {
|
|
6763
6763
|
x(
|
|
6764
6764
|
($) => $.some((P) => ge(P) === ge(z)) ? $ : [...$, z]
|
|
6765
6765
|
);
|
|
@@ -6774,7 +6774,7 @@ function nf(e) {
|
|
|
6774
6774
|
const $ = new AbortController();
|
|
6775
6775
|
y.current = $, h(!0), S(void 0);
|
|
6776
6776
|
try {
|
|
6777
|
-
const j = await
|
|
6777
|
+
const j = await Hp(c.connection(), z, $.signal);
|
|
6778
6778
|
return $.signal.aborted ? "not_opened" : (i(Ut(c, j)), x(j.addedSources), "opened");
|
|
6779
6779
|
} catch (j) {
|
|
6780
6780
|
return $.signal.aborted || S(
|
|
@@ -6800,7 +6800,7 @@ function nf(e) {
|
|
|
6800
6800
|
/** A stored conversation is loading; sending waits. */
|
|
6801
6801
|
loading: I,
|
|
6802
6802
|
addedSources: _,
|
|
6803
|
-
addSource:
|
|
6803
|
+
addSource: Y,
|
|
6804
6804
|
removeSource: Re,
|
|
6805
6805
|
/** What went wrong with the last send, in plain words; never a raw error. */
|
|
6806
6806
|
failure: v ? lf(v) : void 0,
|
|
@@ -7068,7 +7068,7 @@ function bf(e, t, r) {
|
|
|
7068
7068
|
(c) => a({ status: "added", ...c }),
|
|
7069
7069
|
(c) => a({
|
|
7070
7070
|
status: "failed",
|
|
7071
|
-
message: c instanceof
|
|
7071
|
+
message: c instanceof He ? c.message : "This result could not be added. Try again."
|
|
7072
7072
|
})
|
|
7073
7073
|
);
|
|
7074
7074
|
},
|
|
@@ -7699,7 +7699,7 @@ function Gf({
|
|
|
7699
7699
|
using: t,
|
|
7700
7700
|
trace: r
|
|
7701
7701
|
}) {
|
|
7702
|
-
const n =
|
|
7702
|
+
const n = Yf(e), a = e.length ? `${e.length} ${e.length === 1 ? "step" : "steps"}` : "Details";
|
|
7703
7703
|
return /* @__PURE__ */ f(
|
|
7704
7704
|
wr,
|
|
7705
7705
|
{
|
|
@@ -7726,7 +7726,7 @@ function Gf({
|
|
|
7726
7726
|
}
|
|
7727
7727
|
);
|
|
7728
7728
|
}
|
|
7729
|
-
function
|
|
7729
|
+
function Yf(e) {
|
|
7730
7730
|
const t = [];
|
|
7731
7731
|
for (const r of e) {
|
|
7732
7732
|
const n = t.at(-1);
|
|
@@ -7735,7 +7735,7 @@ function Hf(e) {
|
|
|
7735
7735
|
return t;
|
|
7736
7736
|
}
|
|
7737
7737
|
function gs({ step: e }) {
|
|
7738
|
-
return /* @__PURE__ */ f("div", { className: "flex h-5 min-w-0 items-center", "data-testid": "assistant-working-line", children: e ? /* @__PURE__ */ f("p", { role: "status", "aria-label": "Working", className: "min-w-0 truncate text-[12px] text-muted-foreground", children: /* @__PURE__ */ f("span", { className:
|
|
7738
|
+
return /* @__PURE__ */ f("div", { className: "flex h-5 min-w-0 items-center", "data-testid": "assistant-working-line", children: e ? /* @__PURE__ */ f("p", { role: "status", "aria-label": "Working", className: "min-w-0 truncate text-[12px] text-muted-foreground", children: /* @__PURE__ */ f("span", { className: Hf, children: e }) }) : /* @__PURE__ */ f("div", { className: "flex h-5 items-center gap-[3px] pl-0.5", role: "status", "aria-label": "Working", "data-testid": "assistant-working", children: [0, 160, 320].map((t) => /* @__PURE__ */ f(
|
|
7739
7739
|
"span",
|
|
7740
7740
|
{
|
|
7741
7741
|
"aria-hidden": "true",
|
|
@@ -7745,7 +7745,7 @@ function gs({ step: e }) {
|
|
|
7745
7745
|
t
|
|
7746
7746
|
)) }) });
|
|
7747
7747
|
}
|
|
7748
|
-
const
|
|
7748
|
+
const Hf = "motion-safe:bg-[linear-gradient(90deg,hsl(var(--semaphor-muted-foreground))_40%,hsl(var(--semaphor-foreground))_50%,hsl(var(--semaphor-muted-foreground))_60%)] motion-safe:bg-[length:200%_100%] motion-safe:bg-clip-text motion-safe:text-transparent motion-safe:animate-assistant-shimmer";
|
|
7749
7749
|
function Xf({ text: e }) {
|
|
7750
7750
|
return /* @__PURE__ */ f("div", { className: "break-words text-[13px] leading-[1.6] text-foreground", children: /* @__PURE__ */ f(
|
|
7751
7751
|
js,
|
|
@@ -7781,7 +7781,7 @@ function Qf({
|
|
|
7781
7781
|
var I;
|
|
7782
7782
|
const c = $n({
|
|
7783
7783
|
queryKey: tr(e),
|
|
7784
|
-
queryFn: ({ signal: h }) =>
|
|
7784
|
+
queryFn: ({ signal: h }) => Yp(t(), h),
|
|
7785
7785
|
staleTime: 0,
|
|
7786
7786
|
// A failed read says so at once, whichever client the host mounted.
|
|
7787
7787
|
retry: !1
|
|
@@ -8051,10 +8051,10 @@ function qm({
|
|
|
8051
8051
|
onFailed: (A) => {
|
|
8052
8052
|
A instanceof Ke && A.code === "context_invalid" && rr(h, rs(e.id));
|
|
8053
8053
|
}
|
|
8054
|
-
}), [O, J] = U(""),
|
|
8054
|
+
}), [O, J] = U(""), Y = le(null);
|
|
8055
8055
|
ze(() => {
|
|
8056
8056
|
var A;
|
|
8057
|
-
(s || n) && ((A =
|
|
8057
|
+
(s || n) && ((A = Y.current) == null || A.focus());
|
|
8058
8058
|
}, [s, c, n]);
|
|
8059
8059
|
const Re = le(E.askedAbout);
|
|
8060
8060
|
we(() => {
|
|
@@ -8066,22 +8066,22 @@ function qm({
|
|
|
8066
8066
|
const Ze = (w == null ? void 0 : w.id) ?? (v == null ? void 0 : v.id), z = am(Ze), $ = Ze ? x : [], [P, j] = U(), se = P ? z.available($).filter((A) => A.label.toLowerCase().includes(P.query.toLowerCase())) : [], oe = P && se.length ? { ...P, active: Math.min(P.active, se.length - 1) } : void 0, ie = le(void 0);
|
|
8067
8067
|
we(() => {
|
|
8068
8068
|
var A;
|
|
8069
|
-
ie.current !== void 0 && ((A =
|
|
8069
|
+
ie.current !== void 0 && ((A = Y.current) == null || A.setSelectionRange(ie.current, ie.current), ie.current = void 0);
|
|
8070
8070
|
}, [O]);
|
|
8071
8071
|
const Se = (A) => {
|
|
8072
8072
|
z.add(A);
|
|
8073
|
-
const R =
|
|
8073
|
+
const R = Y.current, re = sm(O, (R == null ? void 0 : R.selectionStart) ?? O.length);
|
|
8074
8074
|
re.text !== O && (ie.current = re.caret, J(re.text)), j(void 0), R == null || R.focus();
|
|
8075
8075
|
}, te = (A) => {
|
|
8076
8076
|
A == null || A.preventDefault(), E.send(O, z.shown) === "sent" && (J(""), z.clear());
|
|
8077
8077
|
}, De = (A) => {
|
|
8078
8078
|
var re;
|
|
8079
8079
|
const R = E.send(A) === "sent";
|
|
8080
|
-
return R && ((re =
|
|
8080
|
+
return R && ((re = Y.current) == null || re.focus()), R;
|
|
8081
8081
|
}, be = (A) => {
|
|
8082
8082
|
var re;
|
|
8083
8083
|
const R = E.askAgain(A) === "sent";
|
|
8084
|
-
return R && ((re =
|
|
8084
|
+
return R && ((re = Y.current) == null || re.focus()), R;
|
|
8085
8085
|
}, xs = (A) => {
|
|
8086
8086
|
if (oe) {
|
|
8087
8087
|
if (A.key === "ArrowDown" || A.key === "ArrowUp") {
|
|
@@ -8117,7 +8117,7 @@ function qm({
|
|
|
8117
8117
|
disabled: $t && !E.busy && !E.loading,
|
|
8118
8118
|
onClick: () => {
|
|
8119
8119
|
var A;
|
|
8120
|
-
E.startNew(), (A =
|
|
8120
|
+
E.startNew(), (A = Y.current) == null || A.focus();
|
|
8121
8121
|
},
|
|
8122
8122
|
children: /* @__PURE__ */ f(Js, { className: "h-3.5 w-3.5" })
|
|
8123
8123
|
}
|
|
@@ -8177,7 +8177,7 @@ function qm({
|
|
|
8177
8177
|
/* @__PURE__ */ f(
|
|
8178
8178
|
"textarea",
|
|
8179
8179
|
{
|
|
8180
|
-
ref:
|
|
8180
|
+
ref: Y,
|
|
8181
8181
|
"aria-label": "Message",
|
|
8182
8182
|
placeholder: w ? "Ask about this visual" : v ? "Ask about this card" : n ? "Ask about your data" : "Ask about this dashboard",
|
|
8183
8183
|
value: O,
|
|
@@ -8217,7 +8217,7 @@ function qm({
|
|
|
8217
8217
|
disabled: z.full,
|
|
8218
8218
|
onClick: () => {
|
|
8219
8219
|
var A;
|
|
8220
|
-
j((R) => R ? void 0 : { query: "", active: 0 }), (A =
|
|
8220
|
+
j((R) => R ? void 0 : { query: "", active: 0 }), (A = Y.current) == null || A.focus();
|
|
8221
8221
|
},
|
|
8222
8222
|
children: /* @__PURE__ */ f(Bs, { className: "h-4 w-4" })
|
|
8223
8223
|
}
|
|
@@ -8262,11 +8262,11 @@ function qm({
|
|
|
8262
8262
|
onOpen: async (A) => {
|
|
8263
8263
|
var re;
|
|
8264
8264
|
const R = await E.open(A);
|
|
8265
|
-
return R === "opened" && ((re =
|
|
8265
|
+
return R === "opened" && ((re = Y.current) == null || re.focus()), R;
|
|
8266
8266
|
},
|
|
8267
8267
|
onDeleted: (A) => {
|
|
8268
8268
|
var R;
|
|
8269
|
-
A === E.conversationId && (E.startNew(), (R =
|
|
8269
|
+
A === E.conversationId && (E.startNew(), (R = Y.current) == null || R.focus());
|
|
8270
8270
|
},
|
|
8271
8271
|
answeringId: E.busy ? E.conversationId : void 0,
|
|
8272
8272
|
header: /* @__PURE__ */ T("div", { className: "flex h-11 shrink-0 items-center justify-between gap-2 px-3", children: [
|
|
@@ -8309,7 +8309,7 @@ function qm({
|
|
|
8309
8309
|
className: "h-7 gap-1 px-1.5 text-[11.5px] text-muted-foreground hover:text-foreground",
|
|
8310
8310
|
onClick: () => {
|
|
8311
8311
|
var A;
|
|
8312
|
-
e.leaveBeside(), (A =
|
|
8312
|
+
e.leaveBeside(), (A = Y.current) == null || A.focus();
|
|
8313
8313
|
},
|
|
8314
8314
|
children: [
|
|
8315
8315
|
/* @__PURE__ */ f(Bn, { className: "h-3.5 w-3.5" }),
|
|
@@ -8405,9 +8405,9 @@ function _n({ layout: e, onChange: t }) {
|
|
|
8405
8405
|
}
|
|
8406
8406
|
) }),
|
|
8407
8407
|
/* @__PURE__ */ T(Gs, { align: "end", className: "w-40", children: [
|
|
8408
|
-
/* @__PURE__ */ f(
|
|
8408
|
+
/* @__PURE__ */ f(Ys, { className: "text-[11px] font-medium text-muted-foreground", children: "Layout" }),
|
|
8409
8409
|
/* @__PURE__ */ f(
|
|
8410
|
-
|
|
8410
|
+
Hs,
|
|
8411
8411
|
{
|
|
8412
8412
|
value: e,
|
|
8413
8413
|
onValueChange: (a) => {
|