@loopstack/loopstack-studio 0.35.0 → 0.36.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.
Files changed (35) hide show
  1. package/dist/features/documents/DocumentRenderer.js +7 -7
  2. package/dist/features/documents/renderers/DocumentFormRenderer.js +1 -1
  3. package/dist/features/oauth/OAuthCallbackPage.js +2 -0
  4. package/dist/features/run-view/RunView.js +153 -0
  5. package/dist/features/run-view/Transcript.js +127 -0
  6. package/dist/features/run-view/prompts/FormPrompt.js +129 -0
  7. package/dist/features/run-view/prompts/OAuthPrompt.js +94 -0
  8. package/dist/features/run-view/prompts/SandboxRunButton.js +35 -0
  9. package/dist/features/run-view/prompts/SecretPrompt.js +69 -0
  10. package/dist/features/run-view/prompts/SimplePrompts.js +196 -0
  11. package/dist/features/run-view/prompts/cards.js +90 -0
  12. package/dist/features/run-view/prompts/registry.js +16 -0
  13. package/dist/features/run-view/transcript.js +24 -0
  14. package/dist/features/run-view/useRunPrompts.js +111 -0
  15. package/dist/features/run-view/useRunTree.js +59 -0
  16. package/dist/features/run-view/useTreeLlmStreams.js +91 -0
  17. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  18. package/dist/features/secrets/renderers/SecretInputRenderer.js +1 -1
  19. package/dist/features/workbench/WorkflowList.js +111 -52
  20. package/dist/features/workbench/components/NewRunDialog.js +1 -1
  21. package/dist/features/workbench/index.js +1 -1
  22. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -1
  23. package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
  24. package/dist/index.d.ts +2 -0
  25. package/dist/node_modules/dompurify/dist/purify.es.js +351 -228
  26. package/dist/packages/client/dist/resources/workflows.js +2 -1
  27. package/dist/packages/client/dist/stream/invalidations.js +9 -2
  28. package/dist/packages/client/dist/stream/stream.js +73 -28
  29. package/dist/packages/contracts/dist/park-view/index.js +2 -0
  30. package/dist/packages/contracts/dist/park-view/park-view.rules.js +102 -0
  31. package/dist/packages/contracts/dist/park-view/park-view.types.js +15 -0
  32. package/dist/pages/PreviewWorkbenchPage.js +23 -23
  33. package/dist/providers/LoopstackClientProvider.js +18 -14
  34. package/dist/providers/StudioPreferencesProvider.js +2 -1
  35. package/package.json +4 -4
@@ -1,10 +1,13 @@
1
1
  import { useChildWorkflows, useWorkflowConfigByName } from "../../hooks/useWorkflows.js";
2
+ import { useOptionalStudioPreferences } from "../../providers/StudioPreferencesProvider.js";
3
+ import { cn } from "../../lib/utils.js";
2
4
  import { Button } from "../../components/ui/button.js";
3
5
  import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "../../components/ui/dialog.js";
4
6
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../components/ui/tooltip.js";
5
7
  import { ReactFlowProvider } from "../../node_modules/@xyflow/react/dist/esm/index.js";
6
8
  import WorkflowFlowViewer_default from "../debug/components/WorkflowFlowViewer.js";
7
9
  import "../debug/index.js";
10
+ import { RunView } from "../run-view/RunView.js";
8
11
  import WorkflowItem_default from "./WorkflowItem.js";
9
12
  import WorkbenchSettingsModal_default from "./components/WorkbenchSettingsModal.js";
10
13
  import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
@@ -13,35 +16,84 @@ import { useWorkflowListState } from "./hooks/useWorkflowListState.js";
13
16
  import { c } from "react/compiler-runtime";
14
17
  import React, { useState } from "react";
15
18
  import { jsx, jsxs } from "react/jsx-runtime";
16
- import { ArrowDownIcon, ListOrdered, Workflow } from "lucide-react";
17
- var WorkflowList_default = (S) => {
18
- let C = c(43), { workflow: w } = S, [T, E] = useState(!1), D;
19
- C[0] === Symbol.for("react.memo_cache_sentinel") ? (D = {
19
+ import { ArrowDownIcon, Layers, ListOrdered, ListVideo, Workflow } from "lucide-react";
20
+ var WorkflowList_default = (t) => {
21
+ let n = c(72), { workflow: r } = t, [i, a] = useState(!1), o;
22
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {
20
23
  enableDebugMode: !1,
21
24
  showFullMessageHistory: !1
22
- }, C[0] = D) : D = C[0];
23
- let [O, k] = useState(D), { listRef: A, scrollTo: j, canScrollDown: M, scrollToBottom: N } = useWorkflowListState(), P = useWorkflowConfigByName(w.workflowName), F = useChildWorkflows(w.id), I;
24
- C[1] === F.data ? I = C[2] : (I = F.data ?? [], C[1] = F.data, C[2] = I);
25
- let L = I, R;
26
- C[3] !== M || C[4] !== N ? (R = M && /* @__PURE__ */ jsx(Button, {
25
+ }, n[0] = o) : o = n[0];
26
+ let [s, l] = useState(o), u = useOptionalStudioPreferences(), [ke, d] = useState("classic"), f = u?.preferences.workbenchView ?? ke, p;
27
+ n[1] === u ? p = n[2] : (p = (e) => u ? u.setPreference("workbenchView", e) : d(e), n[1] = u, n[2] = p);
28
+ let m = p, { listRef: h, scrollTo: g, canScrollDown: _, scrollToBottom: v } = useWorkflowListState(), y = useWorkflowConfigByName(r.workflowName), b = useChildWorkflows(r.id), x;
29
+ n[3] === b.data ? x = n[4] : (x = b.data ?? [], n[3] = b.data, n[4] = x);
30
+ let S = x, C;
31
+ n[5] !== _ || n[6] !== v ? (C = _ && /* @__PURE__ */ jsx(Button, {
27
32
  variant: "outline",
28
33
  size: "icon",
29
- onClick: N,
34
+ onClick: v,
30
35
  className: "bg-background/80 fixed right-[calc(var(--sidebar-width)+1.5rem)] bottom-6 z-50 rounded-full shadow-md backdrop-blur-sm",
31
36
  children: /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4" })
32
- }), C[3] = M, C[4] = N, C[5] = R) : R = C[5];
33
- let z = P.data?.title ?? w.workflowName, B;
34
- C[6] === z ? B = C[7] : (B = /* @__PURE__ */ jsx("span", {
37
+ }), n[5] = _, n[6] = v, n[7] = C) : C = n[7];
38
+ let w = y.data?.title ?? r.workflowName, T;
39
+ n[8] === w ? T = n[9] : (T = /* @__PURE__ */ jsx("span", {
35
40
  className: "flex-1 truncate text-sm",
36
- children: z
37
- }), C[6] = z, C[7] = B);
41
+ children: w
42
+ }), n[8] = w, n[9] = T);
43
+ let E = f === "classic" && "bg-accent text-accent-foreground", D;
44
+ n[10] === E ? D = n[11] : (D = cn("h-6 w-6", E), n[10] = E, n[11] = D);
45
+ let O;
46
+ n[12] === m ? O = n[13] : (O = () => m("classic"), n[12] = m, n[13] = O);
47
+ let k;
48
+ n[14] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx(Layers, { className: "h-3.5 w-3.5" }), n[14] = k) : k = n[14];
49
+ let A;
50
+ n[15] !== D || n[16] !== O ? (A = /* @__PURE__ */ jsx(TooltipTrigger, {
51
+ asChild: !0,
52
+ children: /* @__PURE__ */ jsx(Button, {
53
+ variant: "ghost",
54
+ size: "icon",
55
+ className: D,
56
+ onClick: O,
57
+ children: k
58
+ })
59
+ }), n[15] = D, n[16] = O, n[17] = A) : A = n[17];
60
+ let j;
61
+ n[18] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ jsx(TooltipContent, { children: "Classic view" }), n[18] = j) : j = n[18];
62
+ let M;
63
+ n[19] === A ? M = n[20] : (M = /* @__PURE__ */ jsxs(Tooltip, { children: [A, j] }), n[19] = A, n[20] = M);
64
+ let N = f === "run" && "bg-accent text-accent-foreground", P;
65
+ n[21] === N ? P = n[22] : (P = cn("h-6 w-6", N), n[21] = N, n[22] = P);
66
+ let F;
67
+ n[23] === m ? F = n[24] : (F = () => m("run"), n[23] = m, n[24] = F);
68
+ let I;
69
+ n[25] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ jsx(ListVideo, { className: "h-3.5 w-3.5" }), n[25] = I) : I = n[25];
70
+ let L;
71
+ n[26] !== P || n[27] !== F ? (L = /* @__PURE__ */ jsx(TooltipTrigger, {
72
+ asChild: !0,
73
+ children: /* @__PURE__ */ jsx(Button, {
74
+ variant: "ghost",
75
+ size: "icon",
76
+ className: P,
77
+ onClick: F,
78
+ children: I
79
+ })
80
+ }), n[26] = P, n[27] = F, n[28] = L) : L = n[28];
81
+ let R;
82
+ n[29] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ jsx(TooltipContent, { children: "Run view" }), n[29] = R) : R = n[29];
83
+ let z;
84
+ n[30] === L ? z = n[31] : (z = /* @__PURE__ */ jsxs(Tooltip, { children: [L, R] }), n[30] = L, n[31] = z);
85
+ let B;
86
+ n[32] !== M || n[33] !== z ? (B = /* @__PURE__ */ jsxs("div", {
87
+ className: "border-input mr-1 flex items-center rounded-md border p-0.5",
88
+ children: [M, z]
89
+ }), n[32] = M, n[33] = z, n[34] = B) : B = n[34];
38
90
  let V;
39
- C[8] === w ? V = C[9] : (V = /* @__PURE__ */ jsx(WorkflowButtons_default, {
40
- workflow: w,
41
- workflowId: w.id
42
- }), C[8] = w, C[9] = V);
91
+ n[35] === r ? V = n[36] : (V = /* @__PURE__ */ jsx(WorkflowButtons_default, {
92
+ workflow: r,
93
+ workflowId: r.id
94
+ }), n[35] = r, n[36] = V);
43
95
  let H;
44
- C[10] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
96
+ n[37] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
45
97
  asChild: !0,
46
98
  children: /* @__PURE__ */ jsx(DialogTrigger, {
47
99
  asChild: !0,
@@ -52,19 +104,19 @@ var WorkflowList_default = (S) => {
52
104
  children: /* @__PURE__ */ jsx(ListOrdered, { className: "h-5 w-5" })
53
105
  })
54
106
  })
55
- }), /* @__PURE__ */ jsx(TooltipContent, { children: "Run Log" })] }), C[10] = H) : H = C[10];
107
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: "Run Log" })] }), n[37] = H) : H = n[37];
56
108
  let U;
57
- C[11] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Run Log" }) }), C[11] = U) : U = C[11];
109
+ n[38] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Run Log" }) }), n[38] = U) : U = n[38];
58
110
  let W;
59
- C[12] === w ? W = C[13] : (W = /* @__PURE__ */ jsxs(Dialog, { children: [H, /* @__PURE__ */ jsxs(DialogContent, {
111
+ n[39] === r ? W = n[40] : (W = /* @__PURE__ */ jsxs(Dialog, { children: [H, /* @__PURE__ */ jsxs(DialogContent, {
60
112
  className: "sm:max-w-lg max-h-[80vh] overflow-hidden flex flex-col",
61
113
  children: [U, /* @__PURE__ */ jsx("div", {
62
114
  className: "flex-1 overflow-auto",
63
- children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: w })
115
+ children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: r })
64
116
  })]
65
- })] }), C[12] = w, C[13] = W);
117
+ })] }), n[39] = r, n[40] = W);
66
118
  let G;
67
- C[14] === Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
119
+ n[41] === Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
68
120
  asChild: !0,
69
121
  children: /* @__PURE__ */ jsx(DialogTrigger, {
70
122
  asChild: !0,
@@ -75,36 +127,37 @@ var WorkflowList_default = (S) => {
75
127
  children: /* @__PURE__ */ jsx(Workflow, { className: "h-5 w-5" })
76
128
  })
77
129
  })
78
- }), /* @__PURE__ */ jsx(TooltipContent, { children: "Graph" })] }), C[14] = G) : G = C[14];
130
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: "Graph" })] }), n[41] = G) : G = n[41];
79
131
  let K;
80
- C[15] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Graph" }) }), C[15] = K) : K = C[15];
132
+ n[42] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Graph" }) }), n[42] = K) : K = n[42];
81
133
  let q;
82
- C[16] !== L || C[17] !== w ? (q = [w, ...L], C[16] = L, C[17] = w, C[18] = q) : q = C[18];
134
+ n[43] !== S || n[44] !== r ? (q = [r, ...S], n[43] = S, n[44] = r, n[45] = q) : q = n[45];
83
135
  let J;
84
- C[19] !== P.data || C[20] !== q || C[21] !== w.id ? (J = /* @__PURE__ */ jsxs(Dialog, { children: [G, /* @__PURE__ */ jsxs(DialogContent, {
136
+ n[46] !== y.data || n[47] !== q || n[48] !== r.id ? (J = /* @__PURE__ */ jsxs(Dialog, { children: [G, /* @__PURE__ */ jsxs(DialogContent, {
85
137
  className: "sm:max-w-4xl h-[70vh] overflow-hidden flex flex-col",
86
138
  children: [K, /* @__PURE__ */ jsx("div", {
87
139
  className: "flex-1 overflow-hidden",
88
140
  children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
89
- workflowId: w.id,
141
+ workflowId: r.id,
90
142
  workflows: q,
91
- workflowConfig: P.data
143
+ workflowConfig: y.data
92
144
  }) })
93
145
  })]
94
- })] }), C[19] = P.data, C[20] = q, C[21] = w.id, C[22] = J) : J = C[22];
146
+ })] }), n[46] = y.data, n[47] = q, n[48] = r.id, n[49] = J) : J = n[49];
95
147
  let Y;
96
- C[23] !== T || C[24] !== O ? (Y = /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
97
- settings: O,
98
- onSettingsChange: k,
99
- open: T,
100
- onOpenChange: E
101
- }), C[23] = T, C[24] = O, C[25] = Y) : Y = C[25];
148
+ n[50] !== i || n[51] !== s ? (Y = /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
149
+ settings: s,
150
+ onSettingsChange: l,
151
+ open: i,
152
+ onOpenChange: a
153
+ }), n[50] = i, n[51] = s, n[52] = Y) : Y = n[52];
102
154
  let X;
103
- C[26] !== J || C[27] !== Y || C[28] !== B || C[29] !== V || C[30] !== W ? (X = /* @__PURE__ */ jsx("div", {
155
+ n[53] !== B || n[54] !== V || n[55] !== W || n[56] !== J || n[57] !== Y || n[58] !== T ? (X = /* @__PURE__ */ jsx("div", {
104
156
  className: "bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-10 backdrop-blur",
105
157
  children: /* @__PURE__ */ jsxs("div", {
106
158
  className: "flex w-full items-center gap-2 rounded-md p-2 px-3 text-left text-sm font-medium",
107
159
  children: [
160
+ T,
108
161
  B,
109
162
  V,
110
163
  W,
@@ -112,24 +165,30 @@ var WorkflowList_default = (S) => {
112
165
  Y
113
166
  ]
114
167
  })
115
- }), C[26] = J, C[27] = Y, C[28] = B, C[29] = V, C[30] = W, C[31] = X) : X = C[31];
168
+ }), n[53] = B, n[54] = V, n[55] = W, n[56] = J, n[57] = Y, n[58] = T, n[59] = X) : X = n[59];
116
169
  let Z;
117
- C[32] !== j || C[33] !== O || C[34] !== w ? (Z = /* @__PURE__ */ jsx("div", {
170
+ n[60] !== g || n[61] !== s || n[62] !== f || n[63] !== r ? (Z = /* @__PURE__ */ jsx("div", {
118
171
  className: "max-w-4xl py-1",
119
- children: /* @__PURE__ */ jsx(WorkflowItem_default, {
120
- workflow: w,
121
- workflowId: w.id,
122
- scrollTo: j,
123
- settings: O
172
+ children: f === "run" ? /* @__PURE__ */ jsx("div", {
173
+ className: "p-4",
174
+ children: /* @__PURE__ */ jsx(RunView, {
175
+ workflowId: r.id,
176
+ settings: s
177
+ })
178
+ }) : /* @__PURE__ */ jsx(WorkflowItem_default, {
179
+ workflow: r,
180
+ workflowId: r.id,
181
+ scrollTo: g,
182
+ settings: s
124
183
  })
125
- }), C[32] = j, C[33] = O, C[34] = w, C[35] = Z) : Z = C[35];
184
+ }), n[60] = g, n[61] = s, n[62] = f, n[63] = r, n[64] = Z) : Z = n[64];
126
185
  let Q;
127
- C[36] !== A || C[37] !== X || C[38] !== Z ? (Q = /* @__PURE__ */ jsxs("div", {
186
+ n[65] !== h || n[66] !== X || n[67] !== Z ? (Q = /* @__PURE__ */ jsxs("div", {
128
187
  className: "mb-10",
129
- ref: A,
188
+ ref: h,
130
189
  children: [X, Z]
131
- }), C[36] = A, C[37] = X, C[38] = Z, C[39] = Q) : Q = C[39];
190
+ }), n[65] = h, n[66] = X, n[67] = Z, n[68] = Q) : Q = n[68];
132
191
  let $;
133
- return C[40] !== Q || C[41] !== R ? ($ = /* @__PURE__ */ jsxs("div", { children: [R, Q] }), C[40] = Q, C[41] = R, C[42] = $) : $ = C[42], $;
192
+ return n[69] !== Q || n[70] !== C ? ($ = /* @__PURE__ */ jsxs("div", { children: [C, Q] }), n[69] = Q, n[70] = C, n[71] = $) : $ = n[71], $;
134
193
  };
135
194
  export { WorkflowList_default as default };
@@ -8,8 +8,8 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../co
8
8
  import { Dialog, DialogContent, DialogTitle } from "../../../components/ui/dialog.js";
9
9
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
10
10
  import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
11
- import "../../../hooks/useProcessor.js";
12
11
  import Form_default from "../../../components/dynamic-form/Form.js";
12
+ import "../../../hooks/useProcessor.js";
13
13
  import CreateWorkspace_default from "../../workspaces/components/CreateWorkspace.js";
14
14
  import "../../workspaces/index.js";
15
15
  import { c } from "react/compiler-runtime";
@@ -2,7 +2,7 @@ import WorkflowItem_default from "./WorkflowItem.js";
2
2
  import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
3
3
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
4
4
  import WorkflowList_default from "./WorkflowList.js";
5
- import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
5
+ import { useOptionalWorkbenchLayout, useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
6
6
  import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
7
7
  import Workbench from "./Workbench.js";
8
8
  import { NewRunDialog } from "./components/NewRunDialog.js";
@@ -74,4 +74,7 @@ function useWorkbenchLayout() {
74
74
  if (!e) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
75
75
  return e;
76
76
  }
77
- export { WorkbenchLayoutProvider, useWorkbenchLayout };
77
+ function useOptionalWorkbenchLayout() {
78
+ return useContext(WorkbenchLayoutContext);
79
+ }
80
+ export { WorkbenchLayoutProvider, useOptionalWorkbenchLayout, useWorkbenchLayout };
@@ -2,8 +2,8 @@ import "../../../hooks/useWorkflows.js";
2
2
  import "../../../providers/StudioProvider.js";
3
3
  import "../../../components/ui/button.js";
4
4
  import "../../../components/feedback/ErrorSnackbar.js";
5
- import "../../../hooks/useProcessor.js";
6
5
  import "../../../components/dynamic-form/Form.js";
6
+ import "../../../hooks/useProcessor.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Loader2, Play } from "lucide-react";
package/dist/index.d.ts CHANGED
@@ -954,6 +954,8 @@ declare interface StudioPreferences {
954
954
  leftSidebarOpen: boolean;
955
955
  activePanel: PanelId | null;
956
956
  panelSizes: Partial<Record<PanelId, PanelSize>>;
957
+ /** Workbench workflow area: legacy document tree or the canonical run view. */
958
+ workbenchView: 'classic' | 'run';
957
959
  }
958
960
 
959
961
  declare interface StudioPreferencesContextType {