@loopstack/loopstack-studio 0.23.0 → 0.23.1
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/components/dynamic-form/Form.js +50 -27
- package/dist/components/dynamic-form/InputController.js +3 -1
- package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +80 -4
- package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
- package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
- package/dist/features/code-explorer/index.js +2 -2
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
- package/dist/features/code-explorer/utils/fileIcons.js +7 -4
- package/dist/features/debug/components/PipelineFlowViewer.js +46 -45
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
- package/dist/features/documents/DocumentRenderer.js +20 -15
- package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
- package/dist/features/workbench/Workbench.js +64 -80
- package/dist/features/workbench/WorkflowItem.js +5 -5
- package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
- package/dist/features/workbench/components/RemoteFileTree.js +90 -0
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +60 -0
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +37 -29
- package/dist/features/workbench/hooks/useWorkflowData.js +4 -4
- package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +145 -0
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +46 -43
- package/dist/features/workspaces/components/PipelineForm.js +1 -1
- package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
- package/dist/hooks/useFiles.js +1 -43
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2 -1
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/pages/PipelineDebugPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +167 -70
- package/dist/pages/WorkspacePage.js +102 -50
- package/dist/pages/WorkspaceRunsPage.js +71 -0
- package/dist/routing/LocalRouter.js +6 -0
- package/package.json +2 -2
|
@@ -1,165 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../../hooks/useFiles.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
if (!e) return null;
|
|
7
|
-
if ("isAxiosError" in e && e.isAxiosError) {
|
|
8
|
-
let t = e.response?.data;
|
|
9
|
-
if (typeof t == "object" && t && "message" in t) return Error(String(t.message));
|
|
10
|
-
if (typeof t == "string") return Error(t);
|
|
11
|
-
}
|
|
12
|
-
return e;
|
|
13
|
-
}
|
|
14
|
-
var CodeExplorerContext = createContext(null);
|
|
15
|
-
function mapDtoToNode(e) {
|
|
16
|
-
return {
|
|
17
|
-
id: e.id,
|
|
18
|
-
name: e.name,
|
|
19
|
-
path: e.path,
|
|
20
|
-
type: e.type,
|
|
21
|
-
children: e.children?.map(mapDtoToNode)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function CodeExplorerProvider(r) {
|
|
25
|
-
let i = c(49), { children: a, pipelineId: o, initialSelectedPath: s, fileExplorerEnabled: l } = r, u = l === void 0 ? !1 : l, d;
|
|
26
|
-
i[0] === Symbol.for("react.memo_cache_sentinel") ? (d = [], i[0] = d) : d = i[0];
|
|
27
|
-
let [f, p] = useState(d), [m, h] = useState(null), [g, _] = useState(""), v;
|
|
28
|
-
i[1] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ new Set(), i[1] = v) : v = i[1];
|
|
29
|
-
let [y, b] = useState(v), x = useFileTree(o, u), S = useFileContent(o, m?.path, u), C;
|
|
30
|
-
bb0: {
|
|
31
|
-
if (!x.data) {
|
|
32
|
-
let e;
|
|
33
|
-
i[2] === Symbol.for("react.memo_cache_sentinel") ? (e = [], i[2] = e) : e = i[2], C = e;
|
|
34
|
-
break bb0;
|
|
35
|
-
}
|
|
36
|
-
let e;
|
|
37
|
-
i[3] === x.data ? e = i[4] : (e = x.data.map(mapDtoToNode), i[3] = x.data, i[4] = e), C = e;
|
|
38
|
-
}
|
|
39
|
-
let w = C, T = S.data?.content ?? null, E = S.data?.workflowConfig ?? null, D = x.isLoading && !x.data, O = S.isLoading && m !== null && !S.data, k;
|
|
40
|
-
i[5] !== S.error || i[6] !== x.error ? (k = extractErrorMessage(x.error) || extractErrorMessage(S.error) || null, i[5] = S.error, i[6] = x.error, i[7] = k) : k = i[7];
|
|
41
|
-
let A = k, j, M;
|
|
42
|
-
i[8] !== w || i[9] !== s || i[10] !== f.length || i[11] !== m ? (j = () => {
|
|
43
|
-
if (s && w.length > 0 && !m && f.length === 0) {
|
|
44
|
-
let e = (t, n) => {
|
|
45
|
-
for (let r of t) {
|
|
46
|
-
if (r.path === n) return r;
|
|
47
|
-
if (r.children) {
|
|
48
|
-
let t = e(r.children, n);
|
|
49
|
-
if (t) return t;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}, t = e(w, s);
|
|
54
|
-
t && t.type === "file" && (p([t]), h(t));
|
|
55
|
-
}
|
|
56
|
-
}, M = [
|
|
57
|
-
s,
|
|
58
|
-
w,
|
|
59
|
-
m,
|
|
60
|
-
f.length
|
|
61
|
-
], i[8] = w, i[9] = s, i[10] = f.length, i[11] = m, i[12] = j, i[13] = M) : (j = i[12], M = i[13]), useEffect(j, M);
|
|
62
|
-
let N;
|
|
63
|
-
i[14] === Symbol.for("react.memo_cache_sentinel") ? (N = (e) => {
|
|
64
|
-
e.type === "file" && p((t) => {
|
|
65
|
-
if (t.findIndex((t) => t.path === e.path) >= 0) return h(e), t;
|
|
66
|
-
{
|
|
67
|
-
let n = [...t, e];
|
|
68
|
-
return h(e), n;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}, i[14] = N) : N = i[14];
|
|
72
|
-
let P = N, F;
|
|
73
|
-
i[15] === m ? F = i[16] : (F = () => {
|
|
74
|
-
m && p((e) => {
|
|
75
|
-
let t = e.filter((e) => e.path !== m.path);
|
|
76
|
-
if (t.length > 0) {
|
|
77
|
-
let n = e.findIndex((e) => e.path === m.path);
|
|
78
|
-
h(t[n > 0 ? n - 1 : 0]);
|
|
79
|
-
} else h(null);
|
|
80
|
-
return t;
|
|
81
|
-
});
|
|
82
|
-
}, i[15] = m, i[16] = F);
|
|
83
|
-
let I = F, L;
|
|
84
|
-
i[17] === m?.path ? L = i[18] : (L = (e) => {
|
|
85
|
-
p((t) => {
|
|
86
|
-
let n = t.filter((t) => t.path !== e.path);
|
|
87
|
-
if (m?.path === e.path) if (n.length > 0) {
|
|
88
|
-
let r = t.findIndex((t) => t.path === e.path);
|
|
89
|
-
h(n[r > 0 ? r - 1 : 0]);
|
|
90
|
-
} else h(null);
|
|
91
|
-
return n;
|
|
92
|
-
});
|
|
93
|
-
}, i[17] = m?.path, i[18] = L);
|
|
94
|
-
let R = L, z;
|
|
95
|
-
i[19] === Symbol.for("react.memo_cache_sentinel") ? (z = () => {
|
|
96
|
-
p([]), h(null);
|
|
97
|
-
}, i[19] = z) : z = i[19];
|
|
98
|
-
let B = z, V;
|
|
99
|
-
i[20] === Symbol.for("react.memo_cache_sentinel") ? (V = (e) => {
|
|
100
|
-
p([e]), h(e);
|
|
101
|
-
}, i[20] = V) : V = i[20];
|
|
102
|
-
let H = V, U;
|
|
103
|
-
i[21] === m ? U = i[22] : (U = (e) => {
|
|
104
|
-
p((t) => {
|
|
105
|
-
let n = t.findIndex((t) => t.path === e.path);
|
|
106
|
-
if (n <= 0) return t;
|
|
107
|
-
let r = t.slice(n);
|
|
108
|
-
return m && t.findIndex((e) => e.path === m.path) < n && h(e), r;
|
|
109
|
-
});
|
|
110
|
-
}, i[21] = m, i[22] = U);
|
|
111
|
-
let W = U, G;
|
|
112
|
-
i[23] === m ? G = i[24] : (G = (e) => {
|
|
113
|
-
p((t) => {
|
|
114
|
-
let n = t.findIndex((t) => t.path === e.path);
|
|
115
|
-
if (n < 0 || n >= t.length - 1) return t;
|
|
116
|
-
let r = t.slice(0, n + 1);
|
|
117
|
-
return m && t.findIndex((e) => e.path === m.path) > n && h(e), r;
|
|
118
|
-
});
|
|
119
|
-
}, i[23] = m, i[24] = G);
|
|
120
|
-
let K = G, q;
|
|
121
|
-
i[25] !== S || i[26] !== x || i[27] !== m ? (q = async () => {
|
|
122
|
-
await x.refetch(), m && await S.refetch();
|
|
123
|
-
}, i[25] = S, i[26] = x, i[27] = m, i[28] = q) : q = i[28];
|
|
124
|
-
let J = q, Y;
|
|
125
|
-
i[29] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => {
|
|
126
|
-
b((t) => {
|
|
127
|
-
let n = new Set(t);
|
|
128
|
-
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
129
|
-
});
|
|
130
|
-
}, i[29] = Y) : Y = i[29];
|
|
131
|
-
let X = Y, Z;
|
|
132
|
-
i[30] !== I || i[31] !== R || i[32] !== W || i[33] !== K || i[34] !== A || i[35] !== y || i[36] !== T || i[37] !== w || i[38] !== O || i[39] !== D || i[40] !== f || i[41] !== J || i[42] !== g || i[43] !== m || i[44] !== E ? (Z = {
|
|
133
|
-
fileTree: w,
|
|
134
|
-
openFiles: f,
|
|
135
|
-
selectedFile: m,
|
|
136
|
-
fileContent: T,
|
|
137
|
-
workflowConfig: E,
|
|
138
|
-
isTreeLoading: D,
|
|
139
|
-
isContentLoading: O,
|
|
140
|
-
error: A,
|
|
141
|
-
searchQuery: g,
|
|
142
|
-
setSearchQuery: _,
|
|
143
|
-
selectFile: P,
|
|
144
|
-
clearSelection: I,
|
|
145
|
-
closeFile: R,
|
|
146
|
-
closeAll: B,
|
|
147
|
-
closeOthers: H,
|
|
148
|
-
closeToLeft: W,
|
|
149
|
-
closeToRight: K,
|
|
150
|
-
refresh: J,
|
|
151
|
-
expandedFolders: y,
|
|
152
|
-
toggleFolder: X
|
|
153
|
-
}, i[30] = I, i[31] = R, i[32] = W, i[33] = K, i[34] = A, i[35] = y, i[36] = T, i[37] = w, i[38] = O, i[39] = D, i[40] = f, i[41] = J, i[42] = g, i[43] = m, i[44] = E, i[45] = Z) : Z = i[45];
|
|
154
|
-
let Q = Z, $;
|
|
155
|
-
return i[46] !== a || i[47] !== Q ? ($ = /* @__PURE__ */ jsx(CodeExplorerContext.Provider, {
|
|
156
|
-
value: Q,
|
|
157
|
-
children: a
|
|
158
|
-
}), i[46] = a, i[47] = Q, i[48] = $) : $ = i[48], $;
|
|
159
|
-
}
|
|
160
|
-
function useCodeExplorerContext() {
|
|
161
|
-
let e = useContext(CodeExplorerContext);
|
|
162
|
-
if (!e) throw Error("useCodeExplorerContext must be used within CodeExplorerProvider");
|
|
163
|
-
return e;
|
|
164
|
-
}
|
|
165
|
-
export { CodeExplorerProvider, useCodeExplorerContext };
|
|
5
|
+
createContext(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { File, FileCode, FileJson, FileText } from "lucide-react";
|
|
1
|
+
import { File, FileCode, FileJson, FileText, Folder, FolderOpen } from "lucide-react";
|
|
2
2
|
var EXTENSION_ICON_MAP = {
|
|
3
3
|
".ts": FileCode,
|
|
4
4
|
".tsx": FileCode,
|
|
@@ -33,7 +33,10 @@ var EXTENSION_ICON_MAP = {
|
|
|
33
33
|
".log": FileText,
|
|
34
34
|
".env": FileText
|
|
35
35
|
};
|
|
36
|
-
function getFileIcon(
|
|
37
|
-
return EXTENSION_ICON_MAP[
|
|
36
|
+
function getFileIcon(c) {
|
|
37
|
+
return EXTENSION_ICON_MAP[c.includes(".") ? c.slice(c.lastIndexOf(".")).toLowerCase() : ""] ?? File;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
function getFolderIcon(e) {
|
|
40
|
+
return e ? FolderOpen : Folder;
|
|
41
|
+
}
|
|
42
|
+
export { getFileIcon, getFolderIcon };
|
|
@@ -9,23 +9,23 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Loader2 } from "lucide-react";
|
|
11
11
|
var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransition: WorkflowTransitionEdge_default }, PipelineFlowViewer_default = (b) => {
|
|
12
|
-
let x = c(
|
|
13
|
-
x[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
14
|
-
let [
|
|
15
|
-
x[1] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
16
|
-
let [
|
|
17
|
-
x[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
18
|
-
let [
|
|
19
|
-
x[3] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
20
|
-
let
|
|
21
|
-
x[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
22
|
-
|
|
12
|
+
let x = c(29), { pipelineId: S, workflows: C, pipelineConfig: w, direction: T } = b, E = T === void 0 ? "LR" : T, { data: D } = usePipeline(S), O;
|
|
13
|
+
x[0] === Symbol.for("react.memo_cache_sentinel") ? (O = [], x[0] = O) : O = x[0];
|
|
14
|
+
let [k, A, j] = useNodesState(O), M;
|
|
15
|
+
x[1] === Symbol.for("react.memo_cache_sentinel") ? (M = [], x[1] = M) : M = x[1];
|
|
16
|
+
let [N, P, F] = useEdgesState(M), { fitView: I } = useReactFlow(), L = useRef(!1), R;
|
|
17
|
+
x[2] === Symbol.for("react.memo_cache_sentinel") ? (R = {}, x[2] = R) : R = x[2];
|
|
18
|
+
let [z, B] = useState(R), V;
|
|
19
|
+
x[3] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ new Map(), x[3] = V) : V = x[3];
|
|
20
|
+
let H = useRef(V), U = Object.values(z).some(_temp), W;
|
|
21
|
+
x[4] === Symbol.for("react.memo_cache_sentinel") ? (W = (e, m) => {
|
|
22
|
+
B((h) => h[e] === m ? h : {
|
|
23
23
|
...h,
|
|
24
24
|
[e]: m
|
|
25
25
|
});
|
|
26
|
-
}, x[4] =
|
|
27
|
-
let
|
|
28
|
-
x[5] !==
|
|
26
|
+
}, x[4] = W) : W = x[4];
|
|
27
|
+
let G = W, K;
|
|
28
|
+
x[5] !== P || x[6] !== A || x[7] !== C ? (K = (e, m, h) => {
|
|
29
29
|
let g = C.findIndex((m) => m.id === e) * 250, _ = m.map((e) => ({
|
|
30
30
|
...e,
|
|
31
31
|
position: {
|
|
@@ -33,56 +33,57 @@ var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransiti
|
|
|
33
33
|
y: e.position.y + g
|
|
34
34
|
}
|
|
35
35
|
}));
|
|
36
|
-
|
|
36
|
+
H.current.set(e, {
|
|
37
37
|
nodes: _,
|
|
38
38
|
edges: h
|
|
39
39
|
});
|
|
40
40
|
let v = [], y = [];
|
|
41
|
-
|
|
41
|
+
H.current.forEach((e) => {
|
|
42
42
|
let { nodes: m, edges: h } = e;
|
|
43
43
|
v.push(...m), y.push(...h);
|
|
44
|
-
}),
|
|
45
|
-
}, x[5] =
|
|
46
|
-
let
|
|
47
|
-
if (x[9] !==
|
|
48
|
-
if (!
|
|
49
|
-
|
|
44
|
+
}), A(v), P(y);
|
|
45
|
+
}, x[5] = P, x[6] = A, x[7] = C, x[8] = K) : K = x[8];
|
|
46
|
+
let q = K, J, Y;
|
|
47
|
+
if (x[9] !== I || x[10] !== U || x[11] !== k.length ? (J = () => {
|
|
48
|
+
if (!U && k.length > 0 && !L.current) {
|
|
49
|
+
L.current = !0;
|
|
50
50
|
let e = setTimeout(() => {
|
|
51
|
-
|
|
51
|
+
I({ padding: .2 });
|
|
52
52
|
}, 150);
|
|
53
53
|
return () => clearTimeout(e);
|
|
54
54
|
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
], x[9] =
|
|
55
|
+
}, Y = [
|
|
56
|
+
U,
|
|
57
|
+
k.length,
|
|
58
|
+
I
|
|
59
|
+
], x[9] = I, x[10] = U, x[11] = k.length, x[12] = J, x[13] = Y) : (J = x[12], Y = x[13]), useEffect(J, Y), U && k.length === 0) {
|
|
60
60
|
let e;
|
|
61
61
|
return x[14] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
|
|
62
62
|
className: "flex h-full items-center justify-center",
|
|
63
63
|
children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-8 w-8 animate-spin" })
|
|
64
64
|
}), x[14] = e) : e = x[14], e;
|
|
65
65
|
}
|
|
66
|
-
let
|
|
67
|
-
x[15] !==
|
|
68
|
-
pipeline:
|
|
66
|
+
let X;
|
|
67
|
+
x[15] !== E || x[16] !== q || x[17] !== D || x[18] !== w || x[19] !== C ? (X = D && C.map((e) => /* @__PURE__ */ jsx(WorkflowGraph_default, {
|
|
68
|
+
pipeline: D,
|
|
69
69
|
workflow: e,
|
|
70
70
|
pipelineConfig: w,
|
|
71
|
-
onGraphReady:
|
|
72
|
-
onLoadingChange:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
onGraphReady: q,
|
|
72
|
+
onLoadingChange: G,
|
|
73
|
+
direction: E
|
|
74
|
+
}, e.id)), x[15] = E, x[16] = q, x[17] = D, x[18] = w, x[19] = C, x[20] = X) : X = x[20];
|
|
75
|
+
let Z;
|
|
76
|
+
x[21] !== N || x[22] !== k || x[23] !== F || x[24] !== j ? (Z = k.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
76
77
|
className: "text-muted-foreground flex h-full items-center justify-center",
|
|
77
78
|
children: /* @__PURE__ */ jsx("p", {
|
|
78
79
|
className: "font-medium",
|
|
79
80
|
children: "No workflow transitions available"
|
|
80
81
|
})
|
|
81
82
|
}) : /* @__PURE__ */ jsxs(index, {
|
|
82
|
-
nodes:
|
|
83
|
-
edges:
|
|
84
|
-
onNodesChange:
|
|
85
|
-
onEdgesChange:
|
|
83
|
+
nodes: k,
|
|
84
|
+
edges: N,
|
|
85
|
+
onNodesChange: j,
|
|
86
|
+
onEdgesChange: F,
|
|
86
87
|
nodeTypes,
|
|
87
88
|
edgeTypes,
|
|
88
89
|
fitView: !0,
|
|
@@ -96,12 +97,12 @@ var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransiti
|
|
|
96
97
|
size: 1,
|
|
97
98
|
className: "opacity-[0.15]"
|
|
98
99
|
}), /* @__PURE__ */ jsx(Controls, { className: "bg-card border-border rounded-lg border shadow-md" })]
|
|
99
|
-
}), x[
|
|
100
|
-
let
|
|
101
|
-
return x[
|
|
100
|
+
}), x[21] = N, x[22] = k, x[23] = F, x[24] = j, x[25] = Z) : Z = x[25];
|
|
101
|
+
let Q;
|
|
102
|
+
return x[26] !== X || x[27] !== Z ? (Q = /* @__PURE__ */ jsxs("div", {
|
|
102
103
|
className: "h-full w-full",
|
|
103
|
-
children: [
|
|
104
|
-
}), x[
|
|
104
|
+
children: [X, Z]
|
|
105
|
+
}), x[26] = X, x[27] = Z, x[28] = Q) : Q = x[28], Q;
|
|
105
106
|
};
|
|
106
107
|
function _temp(e) {
|
|
107
108
|
return e;
|
|
@@ -6,36 +6,36 @@ function countTransitions(e) {
|
|
|
6
6
|
return e ? getTransitions(e).length : 0;
|
|
7
7
|
}
|
|
8
8
|
var WorkflowGraph_default = (s) => {
|
|
9
|
-
let l = c(
|
|
10
|
-
l[0] !==
|
|
11
|
-
m(d.id,
|
|
12
|
-
},
|
|
9
|
+
let l = c(18), { pipeline: u, workflow: d, pipelineConfig: f, onGraphReady: p, onLoadingChange: m, direction: h } = s, g = h === void 0 ? "LR" : h, _ = useWorkflow(d.id), v = _.data, y = useRef(null), b, x;
|
|
10
|
+
l[0] !== _.isLoading || l[1] !== m || l[2] !== d.id ? (b = () => {
|
|
11
|
+
m(d.id, _.isLoading);
|
|
12
|
+
}, x = [
|
|
13
13
|
d.id,
|
|
14
|
-
|
|
14
|
+
_.isLoading,
|
|
15
15
|
m
|
|
16
|
-
], l[0] =
|
|
17
|
-
let
|
|
18
|
-
l[5] !==
|
|
16
|
+
], l[0] = _.isLoading, l[1] = m, l[2] = d.id, l[3] = b, l[4] = x) : (b = l[3], x = l[4]), useEffect(b, x);
|
|
17
|
+
let S;
|
|
18
|
+
l[5] !== g || l[6] !== p || l[7] !== u || l[8] !== f || l[9] !== d.id || l[10] !== v ? (S = () => {
|
|
19
19
|
let e = f ? getTransitions(f) : [], o = JSON.stringify({
|
|
20
20
|
p: countTransitions(u),
|
|
21
|
-
w: countTransitions(
|
|
21
|
+
w: countTransitions(v),
|
|
22
22
|
c: e.length,
|
|
23
|
-
history:
|
|
24
|
-
place:
|
|
23
|
+
history: v?.history?.length,
|
|
24
|
+
place: v?.place
|
|
25
25
|
});
|
|
26
|
-
if (o !==
|
|
27
|
-
|
|
28
|
-
let { nodes: a, edges: s } = buildWorkflowGraph(u,
|
|
26
|
+
if (o !== y.current) {
|
|
27
|
+
y.current = o;
|
|
28
|
+
let { nodes: a, edges: s } = buildWorkflowGraph(u, v, d.id, e, g);
|
|
29
29
|
p(d.id, a, s);
|
|
30
30
|
}
|
|
31
|
-
}, l[5] =
|
|
32
|
-
let
|
|
33
|
-
return l[
|
|
31
|
+
}, l[5] = g, l[6] = p, l[7] = u, l[8] = f, l[9] = d.id, l[10] = v, l[11] = S) : S = l[11];
|
|
32
|
+
let C;
|
|
33
|
+
return l[12] !== p || l[13] !== u || l[14] !== f || l[15] !== d || l[16] !== v ? (C = [
|
|
34
34
|
u,
|
|
35
35
|
d,
|
|
36
|
-
|
|
36
|
+
v,
|
|
37
37
|
f,
|
|
38
38
|
p
|
|
39
|
-
], l[
|
|
39
|
+
], l[12] = p, l[13] = u, l[14] = f, l[15] = d, l[16] = v, l[17] = C) : C = l[17], useEffect(S, C), null;
|
|
40
40
|
};
|
|
41
41
|
export { WorkflowGraph_default as default };
|
|
@@ -2,6 +2,7 @@ import CompletionMessagePaper_default from "../../components/messages/Completion
|
|
|
2
2
|
import OAuthPromptRenderer_default from "../oauth/OAuthPromptRenderer.js";
|
|
3
3
|
import "../oauth/index.js";
|
|
4
4
|
import AiMessage_default from "./renderers/AiMessage.js";
|
|
5
|
+
import ClaudeMessage_default from "./renderers/ClaudeMessage.js";
|
|
5
6
|
import DocumentDebugRenderer_default from "./renderers/DocumentDebugRenderer.js";
|
|
6
7
|
import DocumentFormRenderer_default from "./renderers/DocumentFormRenderer.js";
|
|
7
8
|
import DocumentMessageRenderer_default from "./renderers/DocumentMessageRenderer.js";
|
|
@@ -13,22 +14,26 @@ import { c } from "react/compiler-runtime";
|
|
|
13
14
|
import React from "react";
|
|
14
15
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
15
16
|
var rendererRegistry = new Map([
|
|
16
|
-
["ai-message", ({ document: e, isLastItem:
|
|
17
|
+
["ai-message", ({ document: e, isLastItem: p }) => /* @__PURE__ */ jsx(AiMessage_default, {
|
|
17
18
|
document: e,
|
|
18
|
-
isLastItem:
|
|
19
|
+
isLastItem: p
|
|
20
|
+
})],
|
|
21
|
+
["claude-message", ({ document: e, isLastItem: p }) => /* @__PURE__ */ jsx(ClaudeMessage_default, {
|
|
22
|
+
document: e,
|
|
23
|
+
isLastItem: p
|
|
19
24
|
})],
|
|
20
25
|
["debug", ({ document: e }) => /* @__PURE__ */ jsx("div", {
|
|
21
26
|
className: "mb-4 flex",
|
|
22
27
|
children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document: e })
|
|
23
28
|
})],
|
|
24
|
-
["object-form", ({ pipeline:
|
|
29
|
+
["object-form", ({ pipeline: p, workflow: m, document: h, isActive: g }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
|
|
25
30
|
role: "document",
|
|
26
31
|
fullWidth: !0,
|
|
27
|
-
timestamp: new Date(
|
|
32
|
+
timestamp: new Date(h.createdAt),
|
|
28
33
|
children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
|
|
29
|
-
pipeline:
|
|
30
|
-
workflow:
|
|
31
|
-
document:
|
|
34
|
+
pipeline: p,
|
|
35
|
+
workflow: m,
|
|
36
|
+
document: h,
|
|
32
37
|
enabled: g,
|
|
33
38
|
viewOnly: !g
|
|
34
39
|
})
|
|
@@ -38,16 +43,16 @@ var rendererRegistry = new Map([
|
|
|
38
43
|
["plain", ({ document: e }) => /* @__PURE__ */ jsx(PlainMessageRenderer_default, { document: e })],
|
|
39
44
|
["markdown", ({ document: e }) => /* @__PURE__ */ jsx(MarkdownMessageRenderer_default, { document: e })],
|
|
40
45
|
["link", ({ document: e }) => /* @__PURE__ */ jsx(LinkMessageRenderer_default, { document: e })],
|
|
41
|
-
["oauth-prompt", ({ pipeline: e, workflow:
|
|
46
|
+
["oauth-prompt", ({ pipeline: e, workflow: m, document: h, isActive: g }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
|
|
42
47
|
pipeline: e,
|
|
43
|
-
workflow:
|
|
44
|
-
document:
|
|
45
|
-
isActive:
|
|
48
|
+
workflow: m,
|
|
49
|
+
document: h,
|
|
50
|
+
isActive: g
|
|
46
51
|
})]
|
|
47
52
|
]), DocumentRenderer_default = (e) => {
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
return
|
|
53
|
+
let p = c(5), m = e.document.ui?.form?.widget ?? "object-form", h;
|
|
54
|
+
p[0] === m ? h = p[1] : (h = rendererRegistry.get(m), p[0] = m, p[1] = h);
|
|
55
|
+
let g = h, _;
|
|
56
|
+
return p[2] !== g || p[3] !== e ? (_ = /* @__PURE__ */ jsx("div", { children: g ? /* @__PURE__ */ jsx(g, { ...e }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), p[2] = g, p[3] = e, p[4] = _) : _ = p[4], _;
|
|
52
57
|
};
|
|
53
58
|
export { DocumentRenderer_default as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
|
|
2
|
+
import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
|
|
3
|
+
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/ai-elements/tool.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { Fragment } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { CopyIcon } from "lucide-react";
|
|
8
|
+
var ClaudeMessage_default = (y) => {
|
|
9
|
+
let b = c(19), { document: x } = y, S = x.content, C = S.id ?? x.id, w, T, E;
|
|
10
|
+
if (b[0] !== S.content || b[1] !== S.role || b[2] !== S.toolResults || b[3] !== C) {
|
|
11
|
+
E = Symbol.for("react.early_return_sentinel");
|
|
12
|
+
bb0: {
|
|
13
|
+
let _ = /* @__PURE__ */ new Map();
|
|
14
|
+
if (S.toolResults) for (let n of S.toolResults) _.set(n.tool_use_id, n);
|
|
15
|
+
if (typeof S.content == "string") {
|
|
16
|
+
let m;
|
|
17
|
+
b[7] === S.content ? m = b[8] : (m = /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: S.content }) }), b[7] = S.content, b[8] = m);
|
|
18
|
+
let h;
|
|
19
|
+
b[9] !== S.content || b[10] !== S.role ? (h = S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
|
|
20
|
+
onClick: () => void navigator.clipboard.writeText(S.content),
|
|
21
|
+
label: "Copy",
|
|
22
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
|
|
23
|
+
}) }), b[9] = S.content, b[10] = S.role, b[11] = h) : h = b[11];
|
|
24
|
+
let g;
|
|
25
|
+
b[12] !== S.role || b[13] !== m || b[14] !== h ? (g = /* @__PURE__ */ jsxs(Message, {
|
|
26
|
+
from: S.role,
|
|
27
|
+
children: [m, h]
|
|
28
|
+
}), b[12] = S.role, b[13] = m, b[14] = h, b[15] = g) : g = b[15], E = g;
|
|
29
|
+
break bb0;
|
|
30
|
+
}
|
|
31
|
+
let y = S.content;
|
|
32
|
+
w = Fragment, T = y.map((v, y) => {
|
|
33
|
+
switch (v.type) {
|
|
34
|
+
case "text": return /* @__PURE__ */ jsxs(Message, {
|
|
35
|
+
from: S.role,
|
|
36
|
+
children: [/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: v.text }) }), S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
|
|
37
|
+
onClick: () => void navigator.clipboard.writeText(v.text),
|
|
38
|
+
label: "Copy",
|
|
39
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
|
|
40
|
+
}) })]
|
|
41
|
+
}, `${C}-${y}`);
|
|
42
|
+
case "thinking": return /* @__PURE__ */ jsxs(Reasoning, {
|
|
43
|
+
className: "w-full",
|
|
44
|
+
isStreaming: !1,
|
|
45
|
+
children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children: v.thinking })]
|
|
46
|
+
}, `${C}-${y}`);
|
|
47
|
+
case "tool_use": {
|
|
48
|
+
let f = _.get(v.id), p;
|
|
49
|
+
if (f) try {
|
|
50
|
+
p = JSON.parse(f.content);
|
|
51
|
+
} catch {
|
|
52
|
+
p = f.content;
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ jsx(Message, {
|
|
55
|
+
from: "assistant",
|
|
56
|
+
children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
|
|
57
|
+
state: f ? f.is_error ? "output-error" : "output-available" : "input-available",
|
|
58
|
+
title: v.name,
|
|
59
|
+
type: "tool-call"
|
|
60
|
+
}), /* @__PURE__ */ jsxs(ToolContent, { children: [/* @__PURE__ */ jsx(ToolInput, { input: v.input }), f && /* @__PURE__ */ jsx(ToolOutput, {
|
|
61
|
+
output: p,
|
|
62
|
+
errorText: f.is_error ? f.content : ""
|
|
63
|
+
})] })] })
|
|
64
|
+
}, `${C}-${y}`);
|
|
65
|
+
}
|
|
66
|
+
case "tool_result": {
|
|
67
|
+
if (_.size > 0) return null;
|
|
68
|
+
let f;
|
|
69
|
+
try {
|
|
70
|
+
f = JSON.parse(v.content);
|
|
71
|
+
} catch {
|
|
72
|
+
f = v.content;
|
|
73
|
+
}
|
|
74
|
+
return /* @__PURE__ */ jsx(Message, {
|
|
75
|
+
from: "assistant",
|
|
76
|
+
children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
|
|
77
|
+
state: v.is_error ? "output-error" : "output-available",
|
|
78
|
+
title: "Tool Result",
|
|
79
|
+
type: "tool-result"
|
|
80
|
+
}), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolOutput, {
|
|
81
|
+
output: f,
|
|
82
|
+
errorText: v.is_error ? v.content : ""
|
|
83
|
+
}) })] })
|
|
84
|
+
}, `${C}-${y}`);
|
|
85
|
+
}
|
|
86
|
+
default: return null;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
b[0] = S.content, b[1] = S.role, b[2] = S.toolResults, b[3] = C, b[4] = w, b[5] = T, b[6] = E;
|
|
91
|
+
} else w = b[4], T = b[5], E = b[6];
|
|
92
|
+
if (E !== Symbol.for("react.early_return_sentinel")) return E;
|
|
93
|
+
let D;
|
|
94
|
+
return b[16] !== w || b[17] !== T ? (D = /* @__PURE__ */ jsx(w, { children: T }), b[16] = w, b[17] = T, b[18] = D) : D = b[18], D;
|
|
95
|
+
};
|
|
96
|
+
export { ClaudeMessage_default as default };
|