@loopstack/loopstack-studio 0.23.1 → 0.24.0
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/api/index.js +12 -10
- package/dist/api/secrets.js +16 -0
- package/dist/components/dynamic-form/ArrayController.js +68 -64
- package/dist/components/dynamic-form/Form.js +46 -40
- package/dist/components/dynamic-form/FormElement.js +1 -1
- package/dist/components/dynamic-form/FormElementHeader.js +2 -2
- package/dist/components/dynamic-form/ObjectController.js +24 -21
- package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
- package/dist/components/dynamic-form/fields/InputField.js +20 -19
- package/dist/components/dynamic-form/fields/RadioField.js +18 -18
- package/dist/components/dynamic-form/fields/SelectField.js +19 -19
- package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
- package/dist/components/layout/MainLayout.js +18 -31
- package/dist/components/layout/StudioSidebar.js +168 -108
- package/dist/components/page/PageBreadcrumbs.js +79 -32
- package/dist/components/ui-widgets/UiWidget.js +36 -27
- package/dist/components/ui-widgets/widgets/SecretInput.js +42 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +47 -30
- package/dist/features/documents/components/DocumentList.js +5 -1
- package/dist/features/documents/renderers/AiMessage.js +11 -11
- package/dist/features/documents/renderers/DocumentFormRenderer.js +17 -11
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +32 -25
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +57 -49
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +46 -34
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/query-keys.js +41 -34
- package/dist/hooks/useSecrets.js +69 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +2 -2
- package/dist/pages/DashboardPage.js +87 -35
- package/dist/pages/EmbedWorkbenchPage.js +43 -39
- package/dist/types/ai.types.js +13 -0
- package/package.json +2 -3
- package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
- package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
- package/dist/node_modules/ai/dist/index.js +0 -1083
- package/dist/node_modules/zod/v3/ZodError.js +0 -79
- package/dist/node_modules/zod/v3/errors.js +0 -6
- package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
- package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
- package/dist/node_modules/zod/v3/helpers/util.js +0 -72
- package/dist/node_modules/zod/v3/locales/en.js +0 -58
- package/dist/node_modules/zod/v3/types.js +0 -2425
- package/dist/node_modules/zod/v4/classic/errors.js +0 -21
- package/dist/node_modules/zod/v4/classic/iso.js +0 -29
- package/dist/node_modules/zod/v4/classic/parse.js +0 -4
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
- package/dist/node_modules/zod/v4/core/api.js +0 -532
- package/dist/node_modules/zod/v4/core/checks.js +0 -283
- package/dist/node_modules/zod/v4/core/core.js +0 -44
- package/dist/node_modules/zod/v4/core/doc.js +0 -21
- package/dist/node_modules/zod/v4/core/errors.js +0 -40
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
- package/dist/node_modules/zod/v4/core/parse.js +0 -66
- package/dist/node_modules/zod/v4/core/regexes.js +0 -28
- package/dist/node_modules/zod/v4/core/registries.js +0 -38
- package/dist/node_modules/zod/v4/core/schemas.js +0 -863
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
- package/dist/node_modules/zod/v4/core/util.js +0 -267
- package/dist/node_modules/zod/v4/core/versions.js +0 -6
|
@@ -1,58 +1,110 @@
|
|
|
1
1
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Button } from "../components/ui/button.js";
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from "../components/ui/alert.js";
|
|
3
4
|
import MainLayout_default from "../components/layout/MainLayout.js";
|
|
4
5
|
import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
|
|
5
6
|
import Dashboard from "../features/dashboard/Dashboard.js";
|
|
6
7
|
import { useDashboardStats } from "../hooks/useDashboard.js";
|
|
7
8
|
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Home } from "lucide-react";
|
|
10
|
+
import { Home, TriangleAlert } from "lucide-react";
|
|
10
11
|
function DashboardPage() {
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
12
|
+
let h = c(38), { environment: g } = useStudio(), { data: _, isLoading: v, error: y, refetch: b, isRefetching: x } = useDashboardStats();
|
|
13
|
+
if (v) {
|
|
13
14
|
let e;
|
|
14
|
-
return
|
|
15
|
+
return h[0] === v ? e = h[1] : (e = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: v }), h[0] = v, h[1] = e), e;
|
|
15
16
|
}
|
|
16
|
-
if (
|
|
17
|
+
if (y) {
|
|
17
18
|
let e;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
h[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[2] = e) : e = h[2];
|
|
20
|
+
let d;
|
|
21
|
+
h[3] === g.name ? d = h[4] : (d = {
|
|
22
|
+
label: g.name,
|
|
23
|
+
href: "#",
|
|
24
|
+
icon: e
|
|
25
|
+
}, h[3] = g.name, h[4] = d);
|
|
26
|
+
let f;
|
|
27
|
+
h[5] === Symbol.for("react.memo_cache_sentinel") ? (f = {
|
|
28
|
+
label: "Dashboard",
|
|
29
|
+
current: !0
|
|
30
|
+
}, h[5] = f) : f = h[5];
|
|
31
|
+
let p;
|
|
32
|
+
h[6] === d ? p = h[7] : (p = [d, f], h[6] = d, h[7] = p);
|
|
33
|
+
let m = p, _;
|
|
34
|
+
h[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("h1", {
|
|
35
|
+
className: "mb-4 text-3xl font-bold tracking-tight",
|
|
36
|
+
children: "Dashboard"
|
|
37
|
+
}), h[8] = _) : _ = h[8];
|
|
38
|
+
let v, S;
|
|
39
|
+
h[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(TriangleAlert, {}), S = /* @__PURE__ */ jsx(AlertTitle, { children: "Dashboard konnte nicht geladen werden" }), h[9] = v, h[10] = S) : (v = h[9], S = h[10]);
|
|
40
|
+
let C;
|
|
41
|
+
h[11] === y.message ? C = h[12] : (C = /* @__PURE__ */ jsxs("p", {
|
|
42
|
+
className: "wrap-break-word",
|
|
43
|
+
children: ["Bitte versuch’s nochmal. ", y.message]
|
|
44
|
+
}), h[11] = y.message, h[12] = C);
|
|
45
|
+
let w;
|
|
46
|
+
h[13] === b ? w = h[14] : (w = () => void b(), h[13] = b, h[14] = w);
|
|
47
|
+
let T = x ? "Lade neu…" : "Neu versuchen", E;
|
|
48
|
+
h[15] !== x || h[16] !== w || h[17] !== T ? (E = /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "mt-3 flex flex-wrap gap-2",
|
|
50
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
variant: "destructive",
|
|
52
|
+
onClick: w,
|
|
53
|
+
disabled: x,
|
|
54
|
+
children: T
|
|
55
|
+
})
|
|
56
|
+
}), h[15] = x, h[16] = w, h[17] = T, h[18] = E) : E = h[18];
|
|
57
|
+
let D;
|
|
58
|
+
h[19] !== E || h[20] !== C ? (D = /* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: "mx-auto w-full max-w-2xl",
|
|
60
|
+
children: /* @__PURE__ */ jsxs(Alert, {
|
|
61
|
+
variant: "destructive",
|
|
62
|
+
children: [
|
|
63
|
+
v,
|
|
64
|
+
S,
|
|
65
|
+
/* @__PURE__ */ jsxs(AlertDescription, { children: [C, E] })
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
}), h[19] = E, h[20] = C, h[21] = D) : D = h[21];
|
|
69
|
+
let O;
|
|
70
|
+
return h[22] !== m || h[23] !== D ? (O = /* @__PURE__ */ jsxs(MainLayout_default, {
|
|
71
|
+
breadcrumbsData: m,
|
|
72
|
+
children: [_, D]
|
|
73
|
+
}), h[22] = m, h[23] = D, h[24] = O) : O = h[24], O;
|
|
22
74
|
}
|
|
23
|
-
if (!
|
|
75
|
+
if (!_) {
|
|
24
76
|
let e;
|
|
25
|
-
return
|
|
77
|
+
return h[25] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
|
|
26
78
|
className: "p-4",
|
|
27
79
|
children: "No data available"
|
|
28
|
-
}),
|
|
80
|
+
}), h[25] = e) : e = h[25], e;
|
|
29
81
|
}
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
label:
|
|
82
|
+
let S;
|
|
83
|
+
h[26] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[26] = S) : S = h[26];
|
|
84
|
+
let C;
|
|
85
|
+
h[27] === g.name ? C = h[28] : (C = {
|
|
86
|
+
label: g.name,
|
|
35
87
|
href: "#",
|
|
36
|
-
icon:
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
|
|
88
|
+
icon: S
|
|
89
|
+
}, h[27] = g.name, h[28] = C);
|
|
90
|
+
let w;
|
|
91
|
+
h[29] === Symbol.for("react.memo_cache_sentinel") ? (w = {
|
|
40
92
|
label: "Dashboard",
|
|
41
93
|
current: !0
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
94
|
+
}, h[29] = w) : w = h[29];
|
|
95
|
+
let T;
|
|
96
|
+
h[30] === C ? T = h[31] : (T = [C, w], h[30] = C, h[31] = T);
|
|
97
|
+
let E = T, D;
|
|
98
|
+
h[32] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx("h1", {
|
|
47
99
|
className: "mb-4 text-3xl font-bold tracking-tight",
|
|
48
100
|
children: "Dashboard"
|
|
49
|
-
}),
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
return
|
|
54
|
-
breadcrumbsData:
|
|
55
|
-
children: [
|
|
56
|
-
}),
|
|
101
|
+
}), h[32] = D) : D = h[32];
|
|
102
|
+
let O;
|
|
103
|
+
h[33] === _ ? O = h[34] : (O = /* @__PURE__ */ jsx(Dashboard, { dashboardStats: _ }), h[33] = _, h[34] = O);
|
|
104
|
+
let k;
|
|
105
|
+
return h[35] !== E || h[36] !== O ? (k = /* @__PURE__ */ jsxs(MainLayout_default, {
|
|
106
|
+
breadcrumbsData: E,
|
|
107
|
+
children: [D, O]
|
|
108
|
+
}), h[35] = E, h[36] = O, h[37] = k) : k = h[37], k;
|
|
57
109
|
}
|
|
58
110
|
export { DashboardPage as default };
|
|
@@ -4,6 +4,7 @@ import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
|
|
|
4
4
|
import { require_enums } from "../packages/contracts/dist/enums/index.js";
|
|
5
5
|
import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
|
|
6
6
|
import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
|
|
7
|
+
import { WorkbenchLayoutProvider } from "../features/workbench/providers/WorkbenchLayoutProvider.js";
|
|
7
8
|
import "../features/workbench/index.js";
|
|
8
9
|
import { requireParam } from "../lib/requireParam.js";
|
|
9
10
|
import { c } from "react/compiler-runtime";
|
|
@@ -12,61 +13,64 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
13
|
import { useParams } from "react-router-dom";
|
|
13
14
|
var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
|
|
14
15
|
function EmbedWorkbenchPage() {
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
!
|
|
16
|
+
let v = c(24), y = useParams(), b;
|
|
17
|
+
v[0] === y ? b = v[1] : (b = requireParam(y, "pipelineId"), v[0] = y, v[1] = b);
|
|
18
|
+
let x = b, S = useRef(null), C = usePipeline(x), w = useFetchWorkflowsByPipeline(x), T = useRef(!1), E, D;
|
|
19
|
+
v[2] !== w.data || v[3] !== x ? (E = () => {
|
|
20
|
+
!w.data || T.current || w.data.length > 0 && w.data.every(_temp) && window.parent !== window && (T.current = !0, window.parent.postMessage({
|
|
20
21
|
type: EMBED_MESSAGE_TYPE,
|
|
21
|
-
pipelineId:
|
|
22
|
+
pipelineId: x
|
|
22
23
|
}, window.location.origin));
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
if (window.parent === window || !
|
|
24
|
+
}, D = [w.data, x], v[2] = w.data, v[3] = x, v[4] = E, v[5] = D) : (E = v[4], D = v[5]), useEffect(E, D);
|
|
25
|
+
let O, k;
|
|
26
|
+
v[6] === x ? (O = v[7], k = v[8]) : (O = () => {
|
|
27
|
+
if (window.parent === window || !S.current) return;
|
|
27
28
|
let t = new ResizeObserver(() => {
|
|
28
|
-
if (!
|
|
29
|
+
if (!S.current) return;
|
|
29
30
|
let t = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
|
|
30
31
|
window.parent.postMessage({
|
|
31
32
|
type: EMBED_RESIZE_MESSAGE_TYPE,
|
|
32
|
-
pipelineId:
|
|
33
|
+
pipelineId: x,
|
|
33
34
|
height: t
|
|
34
35
|
}, window.location.origin);
|
|
35
36
|
});
|
|
36
|
-
return t.observe(
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
|
|
37
|
+
return t.observe(S.current), () => t.disconnect();
|
|
38
|
+
}, k = [x], v[6] = x, v[7] = O, v[8] = k), useEffect(O, k);
|
|
39
|
+
let A = _temp2, j;
|
|
40
|
+
v[9] === Symbol.for("react.memo_cache_sentinel") ? (j = {
|
|
40
41
|
enableDebugMode: !1,
|
|
41
42
|
showFullMessageHistory: !1
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
pipeline:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
children: F
|
|
59
|
-
}), _[17] = P, _[18] = F, _[19] = I) : I = _[19];
|
|
43
|
+
}, v[9] = j) : j = v[9];
|
|
44
|
+
let M = j, N;
|
|
45
|
+
v[10] === C.error ? N = v[11] : (N = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: C.error }), v[10] = C.error, v[11] = N);
|
|
46
|
+
let P;
|
|
47
|
+
v[12] === w.error ? P = v[13] : (P = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), v[12] = w.error, v[13] = P);
|
|
48
|
+
let F = C.isLoading || w.isLoading, I;
|
|
49
|
+
v[14] !== C.data || v[15] !== w.data ? (I = C.data && w.data ? /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
|
|
50
|
+
pipeline: C.data,
|
|
51
|
+
children: w.data.map((t) => /* @__PURE__ */ jsx(WorkflowItem_default, {
|
|
52
|
+
pipeline: C.data,
|
|
53
|
+
workflowId: t.id,
|
|
54
|
+
scrollTo: A,
|
|
55
|
+
settings: M,
|
|
56
|
+
embed: !0
|
|
57
|
+
}, t.id))
|
|
58
|
+
}) : null, v[14] = C.data, v[15] = w.data, v[16] = I) : I = v[16];
|
|
60
59
|
let L;
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
v[17] !== F || v[18] !== I ? (L = /* @__PURE__ */ jsx(LoadingCentered_default, {
|
|
61
|
+
loading: F,
|
|
62
|
+
children: I
|
|
63
|
+
}), v[17] = F, v[18] = I, v[19] = L) : L = v[19];
|
|
64
|
+
let R;
|
|
65
|
+
return v[20] !== L || v[21] !== N || v[22] !== P ? (R = /* @__PURE__ */ jsxs("div", {
|
|
66
|
+
ref: S,
|
|
63
67
|
className: "overflow-hidden px-6 py-4",
|
|
64
68
|
children: [
|
|
65
|
-
M,
|
|
66
69
|
N,
|
|
67
|
-
|
|
70
|
+
P,
|
|
71
|
+
L
|
|
68
72
|
]
|
|
69
|
-
}),
|
|
73
|
+
}), v[20] = L, v[21] = N, v[22] = P, v[23] = R) : R = v[23], R;
|
|
70
74
|
}
|
|
71
75
|
function _temp2() {}
|
|
72
76
|
function _temp(t) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function isTextUIPart(e) {
|
|
2
|
+
return e.type === "text";
|
|
3
|
+
}
|
|
4
|
+
function isReasoningUIPart(e) {
|
|
5
|
+
return e.type === "reasoning";
|
|
6
|
+
}
|
|
7
|
+
function isToolOrDynamicToolUIPart(e) {
|
|
8
|
+
return e.type.startsWith("tool-");
|
|
9
|
+
}
|
|
10
|
+
function getToolOrDynamicToolName(e) {
|
|
11
|
+
return e.type.replace(/^tool-/, "");
|
|
12
|
+
}
|
|
13
|
+
export { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopstack/loopstack-studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"repository": "loopstack-ai/loopstack-studio",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fontsource/roboto": "^5.2.10",
|
|
28
28
|
"@hookform/resolvers": "^5.2.2",
|
|
29
|
-
"@loopstack/contracts": "^0.
|
|
29
|
+
"@loopstack/contracts": "^0.24.0",
|
|
30
30
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
31
31
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
32
32
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"@tailwindcss/vite": "^4.2.1",
|
|
54
54
|
"@tanstack/react-query": "^5.90.21",
|
|
55
55
|
"@xyflow/react": "^12.10.1",
|
|
56
|
-
"ai": "^6.0.97",
|
|
57
56
|
"axios": "^1.13.5",
|
|
58
57
|
"class-variance-authority": "^0.7.1",
|
|
59
58
|
"clsx": "^2.1.1",
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var marker = "vercel.ai.error", symbol = Symbol.for(marker), _a, _b, AISDKError = class C extends (_b = Error, _a = symbol, _b) {
|
|
2
|
-
constructor({ name: e, message: b, cause: S }) {
|
|
3
|
-
super(b), this[_a] = !0, this.name = e, this.cause = S;
|
|
4
|
-
}
|
|
5
|
-
static isInstance(b) {
|
|
6
|
-
return C.hasMarker(b, marker);
|
|
7
|
-
}
|
|
8
|
-
static hasMarker(e, b) {
|
|
9
|
-
let x = Symbol.for(b);
|
|
10
|
-
return typeof e == "object" && !!e && x in e && typeof e[x] == "boolean" && e[x] === !0;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
function getErrorMessage(e) {
|
|
14
|
-
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
|
15
|
-
}
|
|
16
|
-
var name3 = "AI_InvalidArgumentError", marker4 = `vercel.ai.error.${name3}`, symbol4 = Symbol.for(marker4), _a4, _b4, InvalidArgumentError = class extends (_b4 = AISDKError, _a4 = symbol4, _b4) {
|
|
17
|
-
constructor({ message: e, cause: b, argument: x }) {
|
|
18
|
-
super({
|
|
19
|
-
name: name3,
|
|
20
|
-
message: e,
|
|
21
|
-
cause: b
|
|
22
|
-
}), this[_a4] = !0, this.argument = x;
|
|
23
|
-
}
|
|
24
|
-
static isInstance(e) {
|
|
25
|
-
return AISDKError.hasMarker(e, marker4);
|
|
26
|
-
}
|
|
27
|
-
}, name6 = "AI_JSONParseError", marker7 = `vercel.ai.error.${name6}`, symbol7 = Symbol.for(marker7), _a7, _b7, JSONParseError = class extends (_b7 = AISDKError, _a7 = symbol7, _b7) {
|
|
28
|
-
constructor({ text: e, cause: b }) {
|
|
29
|
-
super({
|
|
30
|
-
name: name6,
|
|
31
|
-
message: `JSON parsing failed: Text: ${e}.
|
|
32
|
-
Error message: ${getErrorMessage(b)}`,
|
|
33
|
-
cause: b
|
|
34
|
-
}), this[_a7] = !0, this.text = e;
|
|
35
|
-
}
|
|
36
|
-
static isInstance(e) {
|
|
37
|
-
return AISDKError.hasMarker(e, marker7);
|
|
38
|
-
}
|
|
39
|
-
}, name12 = "AI_TypeValidationError", marker13 = `vercel.ai.error.${name12}`, symbol13 = Symbol.for(marker13), _a13, _b13, TypeValidationError = class e extends (_b13 = AISDKError, _a13 = symbol13, _b13) {
|
|
40
|
-
constructor({ value: e, cause: b, context: x }) {
|
|
41
|
-
let S = "Type validation failed";
|
|
42
|
-
if (x?.field && (S += ` for ${x.field}`), x?.entityName || x?.entityId) {
|
|
43
|
-
S += " (";
|
|
44
|
-
let e = [];
|
|
45
|
-
x.entityName && e.push(x.entityName), x.entityId && e.push(`id: "${x.entityId}"`), S += e.join(", "), S += ")";
|
|
46
|
-
}
|
|
47
|
-
super({
|
|
48
|
-
name: name12,
|
|
49
|
-
message: `${S}: Value: ${JSON.stringify(e)}.
|
|
50
|
-
Error message: ${getErrorMessage(b)}`,
|
|
51
|
-
cause: b
|
|
52
|
-
}), this[_a13] = !0, this.value = e, this.context = x;
|
|
53
|
-
}
|
|
54
|
-
static isInstance(e) {
|
|
55
|
-
return AISDKError.hasMarker(e, marker13);
|
|
56
|
-
}
|
|
57
|
-
static wrap({ value: b, cause: x, context: S }) {
|
|
58
|
-
return e.isInstance(x) && x.value === b && x.context?.field === S?.field && x.context?.entityName === S?.entityName && x.context?.entityId === S?.entityId ? x : new e({
|
|
59
|
-
value: b,
|
|
60
|
-
cause: x,
|
|
61
|
-
context: S
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
export { AISDKError, InvalidArgumentError, JSONParseError, TypeValidationError };
|