@loopstack/loopstack-studio 0.29.5 → 0.31.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/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/layout/StudioSidebar.js +116 -131
- package/dist/components/lists/ListView.js +46 -46
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/dashboard/AppLauncher.js +84 -0
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +73 -73
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +166 -136
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +119 -18
- package/dist/index.js +10 -9
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DashboardPage.js +20 -74
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/dist/routing/LocalRouter.js +1 -1
- package/package.json +2 -2
- package/dist/features/dashboard/Dashboard.js +0 -125
- package/dist/features/dashboard/RunItem.js +0 -78
- package/dist/features/dashboard/RunList.js +0 -32
- package/dist/hooks/useDashboard.js +0 -16
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { SseClientEvents } from "../../../events/sse-client-events.js";
|
|
2
|
+
import { eventBus } from "../../../services/eventEmitter.js";
|
|
3
|
+
import "../../../services/index.js";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
var WORD_DRAIN_INTERVAL_MS = 35;
|
|
6
|
+
function takeNextWord(e) {
|
|
7
|
+
let r = e.match(/^(\s*\S+\s*)/)?.[0] ?? e.slice(0, 1);
|
|
8
|
+
return {
|
|
9
|
+
word: r,
|
|
10
|
+
remaining: e.slice(r.length)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function createStreamingDocument(e, r, i) {
|
|
14
|
+
let a = [];
|
|
15
|
+
i.thinking && a.push({
|
|
16
|
+
type: "thinking",
|
|
17
|
+
text: i.thinking
|
|
18
|
+
}), a.push({
|
|
19
|
+
type: "text",
|
|
20
|
+
text: i.error ? `Error while streaming response: ${i.error}` : i.text
|
|
21
|
+
}), a.push(...i.toolCalls);
|
|
22
|
+
let o = /* @__PURE__ */ new Date();
|
|
23
|
+
return {
|
|
24
|
+
id: `streaming-${i.messageId}`,
|
|
25
|
+
documentName: "llm_message",
|
|
26
|
+
content: {
|
|
27
|
+
id: i.messageId,
|
|
28
|
+
role: "assistant",
|
|
29
|
+
content: a
|
|
30
|
+
},
|
|
31
|
+
validationError: null,
|
|
32
|
+
meta: {
|
|
33
|
+
streaming: !i.readyForFinal && !i.error,
|
|
34
|
+
streamReadyForFinal: i.readyForFinal
|
|
35
|
+
},
|
|
36
|
+
isInvalidated: !1,
|
|
37
|
+
index: 2 ** 53 - 1,
|
|
38
|
+
transition: null,
|
|
39
|
+
place: r,
|
|
40
|
+
labels: [],
|
|
41
|
+
tags: ["message"],
|
|
42
|
+
createdAt: o,
|
|
43
|
+
updatedAt: o,
|
|
44
|
+
workspaceId: "",
|
|
45
|
+
workflowId: e
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function useLlmStreamingDocuments(l, u) {
|
|
49
|
+
let [d, f] = useState({}), p = useRef({}), m = useRef(null);
|
|
50
|
+
return useEffect(() => {
|
|
51
|
+
function i() {
|
|
52
|
+
m.current === null && (m.current = window.setTimeout(() => {
|
|
53
|
+
m.current = null, a();
|
|
54
|
+
}, WORD_DRAIN_INTERVAL_MS));
|
|
55
|
+
}
|
|
56
|
+
function a(e) {
|
|
57
|
+
let r = Object.entries(p.current).filter(([r]) => !e || r === e);
|
|
58
|
+
if (!r.length) return;
|
|
59
|
+
let a = {};
|
|
60
|
+
for (let [e, i] of r) {
|
|
61
|
+
if (a[e] = {
|
|
62
|
+
text: "",
|
|
63
|
+
thinking: ""
|
|
64
|
+
}, i.thinking) {
|
|
65
|
+
let r = takeNextWord(i.thinking);
|
|
66
|
+
a[e].thinking = r.word, i.thinking = r.remaining;
|
|
67
|
+
} else if (i.text) {
|
|
68
|
+
let r = takeNextWord(i.text);
|
|
69
|
+
a[e].text = r.word, i.text = r.remaining;
|
|
70
|
+
}
|
|
71
|
+
!i.text && !i.thinking && delete p.current[e];
|
|
72
|
+
}
|
|
73
|
+
let o = Object.values(p.current).some((e) => e.text || e.thinking);
|
|
74
|
+
f((e) => {
|
|
75
|
+
let r = { ...e };
|
|
76
|
+
for (let [e, i] of Object.entries(a)) {
|
|
77
|
+
let a = r[e] ?? {
|
|
78
|
+
messageId: e,
|
|
79
|
+
text: "",
|
|
80
|
+
thinking: "",
|
|
81
|
+
toolCalls: [],
|
|
82
|
+
completed: !1,
|
|
83
|
+
readyForFinal: !1
|
|
84
|
+
}, o = !p.current[e]?.text && !p.current[e]?.thinking;
|
|
85
|
+
r[e] = {
|
|
86
|
+
...a,
|
|
87
|
+
text: a.text + i.text,
|
|
88
|
+
thinking: a.thinking + i.thinking,
|
|
89
|
+
readyForFinal: a.completed && o
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return r;
|
|
93
|
+
}), o && i();
|
|
94
|
+
}
|
|
95
|
+
function o(e, r) {
|
|
96
|
+
if (e.workflowId !== l || !e.messageId || !e.delta) return;
|
|
97
|
+
let a = p.current[e.messageId] ?? {
|
|
98
|
+
text: "",
|
|
99
|
+
thinking: ""
|
|
100
|
+
};
|
|
101
|
+
a[r] += e.delta, p.current[e.messageId] = a, i();
|
|
102
|
+
}
|
|
103
|
+
function s(e, r) {
|
|
104
|
+
e.workflowId !== l || !e.messageId || f((i) => ({
|
|
105
|
+
...i,
|
|
106
|
+
[e.messageId]: r(i[e.messageId] ?? {
|
|
107
|
+
messageId: e.messageId,
|
|
108
|
+
text: "",
|
|
109
|
+
thinking: "",
|
|
110
|
+
toolCalls: [],
|
|
111
|
+
completed: !1,
|
|
112
|
+
readyForFinal: !1
|
|
113
|
+
})
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
let c = eventBus.on(SseClientEvents.LLM_RESPONSE_START, (e) => {
|
|
117
|
+
s(e, (e) => ({
|
|
118
|
+
...e,
|
|
119
|
+
completed: !1,
|
|
120
|
+
readyForFinal: !1,
|
|
121
|
+
error: void 0
|
|
122
|
+
}));
|
|
123
|
+
}), u = eventBus.on(SseClientEvents.LLM_RESPONSE_TEXT_DELTA, (e) => {
|
|
124
|
+
o(e, "text");
|
|
125
|
+
}), d = eventBus.on(SseClientEvents.LLM_RESPONSE_THINKING_DELTA, (e) => {
|
|
126
|
+
o(e, "thinking");
|
|
127
|
+
}), h = eventBus.on(SseClientEvents.LLM_RESPONSE_TOOL_CALL, (e) => {
|
|
128
|
+
s(e, (r) => ({
|
|
129
|
+
...r,
|
|
130
|
+
toolCalls: e.id ? [...r.toolCalls, {
|
|
131
|
+
type: "tool_call",
|
|
132
|
+
id: e.id,
|
|
133
|
+
name: e.name ?? "tool",
|
|
134
|
+
args: e.args ?? {}
|
|
135
|
+
}] : r.toolCalls
|
|
136
|
+
}));
|
|
137
|
+
}), g = eventBus.on(SseClientEvents.LLM_RESPONSE_DONE, (e) => {
|
|
138
|
+
s(e, (r) => ({
|
|
139
|
+
...r,
|
|
140
|
+
completed: !0,
|
|
141
|
+
readyForFinal: !e.messageId || !p.current[e.messageId]
|
|
142
|
+
}));
|
|
143
|
+
}), _ = eventBus.on(SseClientEvents.LLM_RESPONSE_ERROR, (e) => {
|
|
144
|
+
s(e, (r) => ({
|
|
145
|
+
...r,
|
|
146
|
+
completed: !0,
|
|
147
|
+
error: e.error ?? "Unknown error"
|
|
148
|
+
}));
|
|
149
|
+
});
|
|
150
|
+
return () => {
|
|
151
|
+
c(), u(), d(), h(), g(), _(), m.current !== null && (window.clearTimeout(m.current), m.current = null), p.current = {};
|
|
152
|
+
};
|
|
153
|
+
}, [l]), useMemo(() => Object.values(d).map((e) => createStreamingDocument(l, u ?? "", e)), [
|
|
154
|
+
u,
|
|
155
|
+
d,
|
|
156
|
+
l
|
|
157
|
+
]);
|
|
158
|
+
}
|
|
159
|
+
export { useLlmStreamingDocuments };
|
|
@@ -1,49 +1,76 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
1
2
|
import { useWorkflow } from "../../../hooks/useWorkflows.js";
|
|
2
3
|
import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
3
4
|
import "../../../packages/contracts/dist/enums/index.js";
|
|
4
5
|
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
5
6
|
import { useFilterDocuments } from "../../../hooks/useDocuments.js";
|
|
7
|
+
import { useLlmStreamingDocuments } from "./useLlmStreamingDocuments.js";
|
|
6
8
|
import { c } from "react/compiler-runtime";
|
|
7
9
|
import { useCallback, useMemo } from "react";
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
function getLlmMessageId(e) {
|
|
11
|
+
let s = e.content;
|
|
12
|
+
return e.documentName === "llm_message" && typeof s?.id == "string" ? s.id : void 0;
|
|
13
|
+
}
|
|
14
|
+
function isStreamReadyForFinal(e) {
|
|
15
|
+
return !!e.meta?.streamReadyForFinal;
|
|
16
|
+
}
|
|
17
|
+
function useWorkflowData(p) {
|
|
18
|
+
let m = c(22), { workflowId: h, showFullMessageHistory: g } = p, _ = useWorkflow(h), v = useFilterDocuments(h), y = useRunWorkflow(), b = useLlmStreamingDocuments(h, _.data?.place), x = useDocumentConfigs(), S;
|
|
19
|
+
m[0] !== x || m[1] !== _.data?.place || m[2] !== g ? (S = (e) => {
|
|
20
|
+
let s = x.get(e.documentName)?.meta, l = s?.hidden || !!s?.hideAtPlaces?.includes(_.data?.place ?? "");
|
|
21
|
+
return !g && e.tags?.includes("internal") && (l = !0), !l;
|
|
22
|
+
}, m[0] = x, m[1] = _.data?.place, m[2] = g, m[3] = S) : S = m[3];
|
|
23
|
+
let C = S, w;
|
|
15
24
|
bb0: {
|
|
16
|
-
if (!
|
|
17
|
-
|
|
18
|
-
o[3] === Symbol.for("react.memo_cache_sentinel") ? (e = [], o[3] = e) : e = o[3], h = e;
|
|
25
|
+
if (!v.data) {
|
|
26
|
+
w = b;
|
|
19
27
|
break bb0;
|
|
20
28
|
}
|
|
21
29
|
let e;
|
|
22
|
-
|
|
30
|
+
if (m[4] !== v.data || m[5] !== C || m[6] !== b) {
|
|
31
|
+
let s = v.data.filter(C), l = new Map(b.map(_temp).filter(_temp2)), u = s.filter((e) => {
|
|
32
|
+
let s = getLlmMessageId(e), u = s ? l.get(s) : void 0;
|
|
33
|
+
return !u || isStreamReadyForFinal(u);
|
|
34
|
+
}), d = new Set(u.map(getLlmMessageId).filter(_temp3)), f = b.filter((e) => {
|
|
35
|
+
let s = getLlmMessageId(e);
|
|
36
|
+
return !s || !d.has(s);
|
|
37
|
+
});
|
|
38
|
+
e = [...u, ...f], m[4] = v.data, m[5] = C, m[6] = b, m[7] = e;
|
|
39
|
+
} else e = m[7];
|
|
40
|
+
w = e;
|
|
23
41
|
}
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
workflowId:
|
|
42
|
+
let T = w, E;
|
|
43
|
+
m[8] !== y || m[9] !== h ? (E = (e, s) => {
|
|
44
|
+
y.mutate({
|
|
45
|
+
workflowId: h,
|
|
28
46
|
runWorkflowPayloadDto: { transition: {
|
|
29
47
|
id: e,
|
|
30
|
-
workflowId:
|
|
31
|
-
payload:
|
|
48
|
+
workflowId: h,
|
|
49
|
+
payload: s
|
|
32
50
|
} }
|
|
33
51
|
});
|
|
34
|
-
},
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
workflow:
|
|
38
|
-
workflowLoading:
|
|
39
|
-
workflowReady:
|
|
40
|
-
workflowError:
|
|
41
|
-
documents:
|
|
42
|
-
documentsLoading:
|
|
43
|
-
documentsReady:
|
|
44
|
-
documentsError:
|
|
45
|
-
isLoading:
|
|
46
|
-
handleRun:
|
|
47
|
-
},
|
|
52
|
+
}, m[8] = y, m[9] = h, m[10] = E) : E = m[10];
|
|
53
|
+
let D = E, O = y.isPending || _.data?.status === WorkflowState.Running, k = _.data?.errorMessage, A;
|
|
54
|
+
return m[11] !== T || m[12] !== v.error || m[13] !== v.isLoading || m[14] !== v.isSuccess || m[15] !== _.data || m[16] !== _.isLoading || m[17] !== _.isSuccess || m[18] !== D || m[19] !== O || m[20] !== k ? (A = {
|
|
55
|
+
workflow: _.data,
|
|
56
|
+
workflowLoading: _.isLoading,
|
|
57
|
+
workflowReady: _.isSuccess,
|
|
58
|
+
workflowError: k,
|
|
59
|
+
documents: T,
|
|
60
|
+
documentsLoading: v.isLoading,
|
|
61
|
+
documentsReady: v.isSuccess,
|
|
62
|
+
documentsError: v.error,
|
|
63
|
+
isLoading: O,
|
|
64
|
+
handleRun: D
|
|
65
|
+
}, m[11] = T, m[12] = v.error, m[13] = v.isLoading, m[14] = v.isSuccess, m[15] = _.data, m[16] = _.isLoading, m[17] = _.isSuccess, m[18] = D, m[19] = O, m[20] = k, m[21] = A) : A = m[21], A;
|
|
66
|
+
}
|
|
67
|
+
function _temp3(e) {
|
|
68
|
+
return !!e;
|
|
69
|
+
}
|
|
70
|
+
function _temp2(e) {
|
|
71
|
+
return !!e[0];
|
|
72
|
+
}
|
|
73
|
+
function _temp(e) {
|
|
74
|
+
return [getLlmMessageId(e), e];
|
|
48
75
|
}
|
|
49
76
|
export { useWorkflowData };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
|
|
2
|
-
import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
|
|
3
1
|
import WorkflowItem_default from "./WorkflowItem.js";
|
|
4
2
|
import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
|
|
5
3
|
import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
|
|
6
4
|
import WorkflowList_default from "./WorkflowList.js";
|
|
5
|
+
import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
|
|
7
6
|
import Workbench from "./Workbench.js";
|
|
8
7
|
import { NewRunDialog } from "./components/NewRunDialog.js";
|
|
9
8
|
import "./hooks/useEmbedBridge.js";
|
|
10
9
|
import "./components/PreviewWorkbench.js";
|
|
11
10
|
import { RecentRunItem } from "./components/RecentRunItem.js";
|
|
12
11
|
import "./components/PreviewEmptyState.js";
|
|
12
|
+
import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
+
import { useWorkspaceEnvironments } from "../../../hooks/useEnvironments.js";
|
|
1
2
|
import { useOptionalStudioPreferences } from "../../../providers/StudioPreferencesProvider.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
var WorkbenchLayoutContext = createContext(null);
|
|
6
|
-
function WorkbenchLayoutProvider(
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
let [b, x] = useState(y), S =
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
7
|
+
function WorkbenchLayoutProvider(s) {
|
|
8
|
+
let l = c(35), { children: u, workspaceId: d, workflow: f, getPreviewUrl: p, getEnvironmentPreviewUrl: m } = s, h = useOptionalStudioPreferences(), { data: g } = useWorkspaceEnvironments(d), [_, v] = useState(null), y;
|
|
9
|
+
l[0] === Symbol.for("react.memo_cache_sentinel") ? (y = {}, l[0] = y) : y = l[0];
|
|
10
|
+
let [b, x] = useState(y), S = h ? h.preferences.activePanel : _, C = h ? h.preferences.panelSizes : b, [w, T] = useState(null), [E, D] = useState(""), O;
|
|
11
|
+
l[1] === g ? O = l[2] : (O = g === void 0 || g.some(_temp), l[1] = g, l[2] = O);
|
|
12
|
+
let k = O, A;
|
|
13
|
+
l[3] === Symbol.for("react.memo_cache_sentinel") ? (A = {
|
|
13
14
|
runs: "medium",
|
|
14
15
|
preview: "medium",
|
|
15
16
|
files: "medium",
|
|
16
17
|
environment: "small"
|
|
17
|
-
},
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
let
|
|
31
|
-
|
|
18
|
+
}, l[3] = A) : A = l[3];
|
|
19
|
+
let j = A, M = S ? C[S] ?? j[S] ?? "small" : "small", N;
|
|
20
|
+
l[4] === h ? N = l[5] : (N = (e) => {
|
|
21
|
+
h ? h.setPreference("activePanel", e) : v(e);
|
|
22
|
+
}, l[4] = h, l[5] = N);
|
|
23
|
+
let P = N, F;
|
|
24
|
+
l[6] !== S || l[7] !== P ? (F = (e) => {
|
|
25
|
+
P(S === e ? null : e);
|
|
26
|
+
}, l[6] = S, l[7] = P, l[8] = F) : F = l[8];
|
|
27
|
+
let I = F, L;
|
|
28
|
+
l[9] === P ? L = l[10] : (L = () => {
|
|
29
|
+
P(null);
|
|
30
|
+
}, l[9] = P, l[10] = L);
|
|
31
|
+
let R = L, z;
|
|
32
|
+
l[11] !== S || l[12] !== C || l[13] !== h ? (z = (e) => {
|
|
32
33
|
if (!S) return;
|
|
33
|
-
let
|
|
34
|
+
let o = {
|
|
34
35
|
...C,
|
|
35
|
-
[S]:
|
|
36
|
+
[S]: e
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
D(
|
|
42
|
-
},
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
workspaceId:
|
|
46
|
-
workflow:
|
|
47
|
-
previewPanelEnabled:
|
|
48
|
-
workspaceConfig: f,
|
|
38
|
+
h ? h.setPreference("panelSizes", o) : x(o);
|
|
39
|
+
}, l[11] = S, l[12] = C, l[13] = h, l[14] = z) : z = l[14];
|
|
40
|
+
let B = z, V;
|
|
41
|
+
l[15] === P ? V = l[16] : (V = (e) => {
|
|
42
|
+
D(e), P("preview");
|
|
43
|
+
}, l[15] = P, l[16] = V);
|
|
44
|
+
let H = V, U;
|
|
45
|
+
l[17] !== S || l[18] !== w || l[19] !== R || l[20] !== g || l[21] !== m || l[22] !== p || l[23] !== H || l[24] !== M || l[25] !== k || l[26] !== E || l[27] !== B || l[28] !== I || l[29] !== f || l[30] !== d ? (U = {
|
|
46
|
+
workspaceId: d,
|
|
47
|
+
workflow: f,
|
|
48
|
+
previewPanelEnabled: k,
|
|
49
49
|
getPreviewUrl: p,
|
|
50
50
|
getEnvironmentPreviewUrl: m,
|
|
51
|
-
environments:
|
|
51
|
+
environments: g,
|
|
52
52
|
activePanel: S,
|
|
53
|
-
panelSize:
|
|
54
|
-
togglePanel:
|
|
55
|
-
closePanel:
|
|
56
|
-
setPanelSize:
|
|
53
|
+
panelSize: M,
|
|
54
|
+
togglePanel: I,
|
|
55
|
+
closePanel: R,
|
|
56
|
+
setPanelSize: B,
|
|
57
57
|
selectedSlotId: E,
|
|
58
58
|
setSelectedSlotId: D,
|
|
59
|
-
openPreviewWithEnvironment:
|
|
59
|
+
openPreviewWithEnvironment: H,
|
|
60
60
|
activeSectionId: w,
|
|
61
61
|
setActiveSectionId: T
|
|
62
|
-
},
|
|
63
|
-
let
|
|
64
|
-
return
|
|
65
|
-
value:
|
|
66
|
-
children:
|
|
67
|
-
}),
|
|
62
|
+
}, l[17] = S, l[18] = w, l[19] = R, l[20] = g, l[21] = m, l[22] = p, l[23] = H, l[24] = M, l[25] = k, l[26] = E, l[27] = B, l[28] = I, l[29] = f, l[30] = d, l[31] = U) : U = l[31];
|
|
63
|
+
let W = U, G;
|
|
64
|
+
return l[32] !== u || l[33] !== W ? (G = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
|
|
65
|
+
value: W,
|
|
66
|
+
children: u
|
|
67
|
+
}), l[32] = u, l[33] = W, l[34] = G) : G = l[34], G;
|
|
68
68
|
}
|
|
69
|
-
function _temp(
|
|
70
|
-
return !!
|
|
69
|
+
function _temp(e) {
|
|
70
|
+
return !!e.connectionUrl && (!!e.workerId || e.local);
|
|
71
71
|
}
|
|
72
72
|
function useWorkbenchLayout() {
|
|
73
|
-
let
|
|
74
|
-
if (!
|
|
75
|
-
return
|
|
73
|
+
let e = useContext(WorkbenchLayoutContext);
|
|
74
|
+
if (!e) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
|
|
75
|
+
return e;
|
|
76
76
|
}
|
|
77
77
|
export { WorkbenchLayoutProvider, useWorkbenchLayout };
|