@loopstack/loopstack-studio 0.24.0 → 0.25.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/config.js +3 -3
- package/dist/api/index.js +9 -13
- package/dist/api/processor.js +1 -1
- package/dist/api/workflows.js +7 -1
- package/dist/components/dynamic-form/CodeContent.js +3 -3
- package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
- package/dist/components/feedback/LoadingCentered.js +1 -1
- package/dist/components/layout/StudioSidebar.js +2 -2
- package/dist/components/loopstack-elements/link.js +77 -76
- package/dist/components/loopstack-elements/tool.js +171 -0
- package/dist/components/ui-widgets/UiActions.js +10 -4
- package/dist/components/ui-widgets/UiWidget.js +27 -36
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
- package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
- package/dist/features/code-explorer/components/FileContentViewer.js +87 -112
- package/dist/features/dashboard/RunItem.js +1 -1
- package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
- package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
- package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
- package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
- package/dist/features/debug/index.js +2 -2
- package/dist/features/debug/lib/flow-utils.js +142 -150
- package/dist/features/documents/DocumentRenderer.js +66 -30
- package/dist/features/documents/components/DocumentItem.js +2 -2
- package/dist/features/documents/components/DocumentList.js +15 -12
- package/dist/features/documents/document-details/DocumentDetails.js +4 -4
- package/dist/features/documents/renderers/AiMessage.js +1 -1
- package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
- package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
- package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -71
- package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
- package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
- package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
- package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
- package/dist/features/runs/Runs.js +8 -8
- package/dist/features/workbench/Workbench.js +35 -35
- package/dist/features/workbench/WorkflowItem.js +10 -9
- package/dist/features/workbench/WorkflowList.js +56 -73
- package/dist/features/workbench/components/NewRunDialog.js +18 -18
- package/dist/features/workbench/components/WorkbenchFilesPanel.js +1 -1
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +33 -72
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +30 -42
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
- package/dist/features/workbench/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
- package/dist/features/workbench/components/WorkflowForms.js +14 -13
- package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
- package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
- package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
- package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
- package/dist/features/workbench/index.js +2 -3
- package/dist/features/workbench/providers/ScrollProvider.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
- package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
- package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
- package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
- package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/query-keys.js +31 -72
- package/dist/hooks/useConfig.js +5 -5
- package/dist/hooks/useProcessor.js +5 -5
- package/dist/hooks/useWorkflows.js +155 -68
- package/dist/index.d.ts +127 -128
- package/dist/index.js +5 -5
- package/dist/packages/contracts/dist/enums/index.js +11 -12
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
- package/dist/pages/DebugWorkflowsPage.js +10 -10
- package/dist/pages/EmbedWorkbenchPage.js +42 -52
- package/dist/pages/PreviewWorkbenchPage.js +130 -255
- package/dist/pages/RunsListPage.js +1 -1
- package/dist/pages/StudioLandingPage.js +13 -13
- package/dist/pages/WorkbenchPage.js +6 -6
- package/dist/pages/WorkflowDebugPage.js +114 -0
- package/dist/pages/WorkspacePage.js +4 -2
- package/dist/providers/InvalidationEventsProvider.js +19 -19
- package/dist/providers/SseProvider.js +0 -1
- package/dist/routing/LocalRouter.js +14 -17
- package/package.json +2 -2
- package/dist/api/namespaces.js +0 -7
- package/dist/api/pipelines.js +0 -13
- package/dist/components/ai-elements/tool.js +0 -158
- package/dist/components/ui-widgets/widgets/SecretInput.js +0 -42
- package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
- package/dist/features/workbench/NavigationItems.js +0 -52
- package/dist/features/workbench/WorkbenchNavigation.js +0 -38
- package/dist/features/workbench/components/NavigationItem.js +0 -68
- package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
- package/dist/hooks/useNamespaceTree.js +0 -27
- package/dist/hooks/useNamespaces.js +0 -25
- package/dist/hooks/usePipelines.js +0 -161
- package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
- package/dist/pages/PipelineDebugPage.js +0 -115
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
- /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
- /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
|
@@ -8,59 +8,59 @@ var NODE_WIDTH = 130, NODE_HEIGHT = 70, CONDITION_OPERATORS = {
|
|
|
8
8
|
ge: ">=",
|
|
9
9
|
le: "<="
|
|
10
10
|
};
|
|
11
|
-
function getLayoutedElements(e,
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
rankdir:
|
|
11
|
+
function getLayoutedElements(e, u, d = "LR") {
|
|
12
|
+
let f = new dagre_esm_default.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
|
|
13
|
+
f.setGraph({
|
|
14
|
+
rankdir: d,
|
|
15
15
|
nodesep: 100,
|
|
16
16
|
ranksep: 200
|
|
17
17
|
});
|
|
18
|
-
for (let
|
|
18
|
+
for (let o of e) f.setNode(o.id, {
|
|
19
19
|
width: NODE_WIDTH,
|
|
20
20
|
height: NODE_HEIGHT
|
|
21
21
|
});
|
|
22
|
-
for (let e of
|
|
23
|
-
return dagre_esm_default.layout(
|
|
22
|
+
for (let e of u) f.setEdge(e.source, e.target);
|
|
23
|
+
return dagre_esm_default.layout(f), {
|
|
24
24
|
nodes: e.map((e) => {
|
|
25
|
-
let
|
|
25
|
+
let s = f.node(e.id);
|
|
26
26
|
return {
|
|
27
27
|
...e,
|
|
28
|
-
targetPosition:
|
|
29
|
-
sourcePosition:
|
|
28
|
+
targetPosition: d === "LR" ? Position.Left : Position.Top,
|
|
29
|
+
sourcePosition: d === "LR" ? Position.Right : Position.Bottom,
|
|
30
30
|
position: {
|
|
31
|
-
x:
|
|
32
|
-
y:
|
|
31
|
+
x: s.x - NODE_WIDTH / 2,
|
|
32
|
+
y: s.y - NODE_HEIGHT / 2
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}),
|
|
36
|
-
edges:
|
|
36
|
+
edges: u
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function getTransitions(e,
|
|
40
|
-
if (!e || typeof e != "object" ||
|
|
39
|
+
function getTransitions(e, o = /* @__PURE__ */ new Set()) {
|
|
40
|
+
if (!e || typeof e != "object" || o.has(e)) return [];
|
|
41
41
|
try {
|
|
42
|
-
|
|
42
|
+
o.add(e);
|
|
43
43
|
} catch {
|
|
44
44
|
return [];
|
|
45
45
|
}
|
|
46
|
-
let
|
|
47
|
-
if (Array.isArray(
|
|
48
|
-
if (
|
|
49
|
-
let e = getTransitions(
|
|
46
|
+
let s = e;
|
|
47
|
+
if (Array.isArray(s.transitions)) return s.transitions;
|
|
48
|
+
if (s.definition) {
|
|
49
|
+
let e = getTransitions(s.definition, o);
|
|
50
50
|
if (e.length > 0) return e;
|
|
51
51
|
}
|
|
52
|
-
if (
|
|
53
|
-
let e = getTransitions(
|
|
52
|
+
if (s.specification) {
|
|
53
|
+
let e = getTransitions(s.specification, o);
|
|
54
54
|
if (e.length > 0) return e;
|
|
55
55
|
}
|
|
56
|
-
for (let e in
|
|
56
|
+
for (let e in s) {
|
|
57
57
|
if (e === "history" || e === "data") continue;
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
let e = getTransitions(
|
|
58
|
+
let c = s[e];
|
|
59
|
+
if (c && typeof c == "object") {
|
|
60
|
+
let e = getTransitions(c, o);
|
|
61
61
|
if (e.length > 0) return e;
|
|
62
|
-
} else if (typeof
|
|
63
|
-
let e = getTransitions(JSON.parse(
|
|
62
|
+
} else if (typeof c == "string" && c.includes("\"transitions\":")) try {
|
|
63
|
+
let e = getTransitions(JSON.parse(c), o);
|
|
64
64
|
if (e.length > 0) return e;
|
|
65
65
|
} catch {}
|
|
66
66
|
}
|
|
@@ -68,125 +68,117 @@ function getTransitions(e, s = /* @__PURE__ */ new Set()) {
|
|
|
68
68
|
}
|
|
69
69
|
function formatCondition(e) {
|
|
70
70
|
if (!e) return "";
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
let [e,
|
|
74
|
-
if (
|
|
71
|
+
let o = e.replace(/\{\{|\}\}/g, "").trim(), s = o.split(/\s+/);
|
|
72
|
+
if (s.length === 3) {
|
|
73
|
+
let [e, o, c] = s, l = CONDITION_OPERATORS[e];
|
|
74
|
+
if (l) return `${o} ${l} ${c}`;
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return o;
|
|
77
77
|
}
|
|
78
|
-
function buildWorkflowGraph(e, s, c
|
|
79
|
-
let p = collectTransitions(e,
|
|
80
|
-
workflowId:
|
|
81
|
-
currentPlace:
|
|
82
|
-
endStates:
|
|
83
|
-
visitedStates:
|
|
84
|
-
visitCounts: buildVisitCounts(
|
|
85
|
-
direction:
|
|
86
|
-
forceVisible:
|
|
87
|
-
}),
|
|
88
|
-
workflowId:
|
|
89
|
-
executedMap:
|
|
90
|
-
stateRanks:
|
|
91
|
-
forceVisible:
|
|
78
|
+
function buildWorkflowGraph(e, o, s, c = [], l, u = !1, f = []) {
|
|
79
|
+
let p = collectTransitions(e, o, c), m = collectStates(p, f), b = buildExecutedMap(f), x = resolveTransitions(p, f), S = findEndStates(m, x), C = findVisitedStates(f), w = computeStateRanks(x), T = buildNodes(m, {
|
|
80
|
+
workflowId: s,
|
|
81
|
+
currentPlace: o?.place,
|
|
82
|
+
endStates: S,
|
|
83
|
+
visitedStates: C,
|
|
84
|
+
visitCounts: buildVisitCounts(f),
|
|
85
|
+
direction: l,
|
|
86
|
+
forceVisible: u
|
|
87
|
+
}), E = buildEdges(x, {
|
|
88
|
+
workflowId: s,
|
|
89
|
+
executedMap: b,
|
|
90
|
+
stateRanks: w,
|
|
91
|
+
forceVisible: u
|
|
92
92
|
});
|
|
93
|
-
return
|
|
94
|
-
nodes:
|
|
95
|
-
edges:
|
|
93
|
+
return T.length > 1 ? getLayoutedElements(T, E, l) : {
|
|
94
|
+
nodes: T,
|
|
95
|
+
edges: E
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
function collectTransitions(e,
|
|
99
|
-
let
|
|
100
|
-
e &&
|
|
101
|
-
let
|
|
102
|
-
return
|
|
103
|
-
let
|
|
104
|
-
return
|
|
98
|
+
function collectTransitions(e, o, s) {
|
|
99
|
+
let c = [...s];
|
|
100
|
+
e && c.push(...getTransitions(e)), o && c.push(...getTransitions(o));
|
|
101
|
+
let l = /* @__PURE__ */ new Set();
|
|
102
|
+
return c.filter((e) => {
|
|
103
|
+
let o = Array.isArray(e.from) ? e.from.join(",") : e.from, s = `${e.id}-${o}-${e.to}`;
|
|
104
|
+
return l.has(s) ? !1 : (l.add(s), !0);
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
let e = Array.isArray(s.from) ? s.from : [s.from];
|
|
114
|
-
for (let s of e) c.add(s ?? "start");
|
|
115
|
-
c.add(s.to);
|
|
107
|
+
function collectStates(e, o) {
|
|
108
|
+
let s = new Set(["start"]);
|
|
109
|
+
for (let o of e) {
|
|
110
|
+
let e = Array.isArray(o.from) ? o.from : [o.from];
|
|
111
|
+
for (let o of e) s.add(o ?? "start");
|
|
112
|
+
s.add(o.to);
|
|
116
113
|
}
|
|
117
|
-
for (let e of
|
|
118
|
-
return
|
|
114
|
+
for (let e of o) e.place && s.add(e.place), e.transitionFrom && s.add(e.transitionFrom);
|
|
115
|
+
return s;
|
|
119
116
|
}
|
|
120
117
|
function buildVisitCounts(e) {
|
|
121
|
-
let
|
|
122
|
-
for (let
|
|
123
|
-
|
|
124
|
-
e && s.set(e, (s.get(e) ?? 0) + 1);
|
|
125
|
-
}
|
|
126
|
-
return s;
|
|
118
|
+
let o = new Map([["start", 1]]);
|
|
119
|
+
for (let s of e) s.place && o.set(s.place, (o.get(s.place) ?? 0) + 1);
|
|
120
|
+
return o;
|
|
127
121
|
}
|
|
128
122
|
function buildExecutedMap(e) {
|
|
129
|
-
let
|
|
130
|
-
for (let
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
s.set(l, (s.get(l) ?? 0) + 1);
|
|
123
|
+
let o = /* @__PURE__ */ new Map();
|
|
124
|
+
for (let s of e) {
|
|
125
|
+
if (!s.transitionId) continue;
|
|
126
|
+
let e = `${s.transitionFrom ?? "start"}->${s.place}:${s.transitionId}`;
|
|
127
|
+
o.set(e, (o.get(e) ?? 0) + 1);
|
|
135
128
|
}
|
|
136
|
-
return
|
|
129
|
+
return o;
|
|
137
130
|
}
|
|
138
|
-
function resolveTransitions(e,
|
|
139
|
-
let
|
|
140
|
-
for (let
|
|
141
|
-
let e = Array.isArray(
|
|
142
|
-
for (let
|
|
143
|
-
id:
|
|
144
|
-
from:
|
|
145
|
-
to:
|
|
146
|
-
condition:
|
|
147
|
-
trigger:
|
|
148
|
-
call:
|
|
131
|
+
function resolveTransitions(e, o) {
|
|
132
|
+
let s = [];
|
|
133
|
+
for (let o of e) {
|
|
134
|
+
let e = Array.isArray(o.from) ? o.from : [o.from], c = o;
|
|
135
|
+
for (let l of e) s.push({
|
|
136
|
+
id: o.id,
|
|
137
|
+
from: l ?? "start",
|
|
138
|
+
to: o.to,
|
|
139
|
+
condition: c.if ?? c.condition,
|
|
140
|
+
trigger: o.trigger,
|
|
141
|
+
call: o.call
|
|
149
142
|
});
|
|
150
143
|
}
|
|
151
|
-
for (let e of
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
to: s.to
|
|
144
|
+
for (let e of o) {
|
|
145
|
+
if (!e.transitionId) continue;
|
|
146
|
+
let o = e.transitionFrom ?? "start";
|
|
147
|
+
s.some((s) => s.from === o && s.to === e.place && s.id === e.transitionId) || s.push({
|
|
148
|
+
id: e.transitionId,
|
|
149
|
+
from: o,
|
|
150
|
+
to: e.place
|
|
159
151
|
});
|
|
160
152
|
}
|
|
161
|
-
return
|
|
153
|
+
return s;
|
|
162
154
|
}
|
|
163
|
-
function findEndStates(e,
|
|
164
|
-
let
|
|
165
|
-
for (let
|
|
166
|
-
return
|
|
155
|
+
function findEndStates(e, o) {
|
|
156
|
+
let s = new Set(o.map((e) => e.from)), c = /* @__PURE__ */ new Set();
|
|
157
|
+
for (let o of e) !s.has(o) && o !== "start" && c.add(o);
|
|
158
|
+
return c;
|
|
167
159
|
}
|
|
168
160
|
function findVisitedStates(e) {
|
|
169
|
-
let
|
|
170
|
-
for (let
|
|
171
|
-
return
|
|
161
|
+
let o = new Set(["start"]);
|
|
162
|
+
for (let s of e) s.place && o.add(s.place);
|
|
163
|
+
return o;
|
|
172
164
|
}
|
|
173
165
|
function computeStateRanks(e) {
|
|
174
|
-
let
|
|
175
|
-
for (let
|
|
176
|
-
if (
|
|
177
|
-
let e =
|
|
178
|
-
e.push(
|
|
166
|
+
let o = /* @__PURE__ */ new Map();
|
|
167
|
+
for (let s of e) {
|
|
168
|
+
if (s.from === s.to) continue;
|
|
169
|
+
let e = o.get(s.from) ?? [];
|
|
170
|
+
e.push(s.to), o.set(s.from, e);
|
|
179
171
|
}
|
|
180
|
-
let
|
|
181
|
-
for (;
|
|
182
|
-
let e =
|
|
183
|
-
for (let
|
|
172
|
+
let s = new Map([["start", 0]]), c = ["start"];
|
|
173
|
+
for (; c.length > 0;) {
|
|
174
|
+
let e = c.shift(), l = s.get(e);
|
|
175
|
+
for (let u of o.get(e) ?? []) s.has(u) || (s.set(u, l + 1), c.push(u));
|
|
184
176
|
}
|
|
185
|
-
return
|
|
177
|
+
return s;
|
|
186
178
|
}
|
|
187
|
-
function buildNodes(e,
|
|
179
|
+
function buildNodes(e, o) {
|
|
188
180
|
return Array.from(e).map((e) => ({
|
|
189
|
-
id: `${
|
|
181
|
+
id: `${o.workflowId}-${e}`,
|
|
190
182
|
type: "stateNode",
|
|
191
183
|
position: {
|
|
192
184
|
x: 0,
|
|
@@ -195,53 +187,53 @@ function buildNodes(e, s) {
|
|
|
195
187
|
data: {
|
|
196
188
|
label: e,
|
|
197
189
|
isStart: e === "start",
|
|
198
|
-
isEnd:
|
|
199
|
-
isCurrent: e ===
|
|
200
|
-
isVisited:
|
|
201
|
-
visitCount:
|
|
202
|
-
direction:
|
|
203
|
-
forceVisible:
|
|
190
|
+
isEnd: o.endStates.has(e),
|
|
191
|
+
isCurrent: e === o.currentPlace,
|
|
192
|
+
isVisited: o.visitedStates.has(e),
|
|
193
|
+
visitCount: o.visitCounts.get(e) ?? 0,
|
|
194
|
+
direction: o.direction,
|
|
195
|
+
forceVisible: o.forceVisible
|
|
204
196
|
}
|
|
205
197
|
}));
|
|
206
198
|
}
|
|
207
|
-
function buildEdges(
|
|
208
|
-
let
|
|
209
|
-
for (let
|
|
210
|
-
let
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
let
|
|
214
|
-
...
|
|
215
|
-
isExecuted:
|
|
216
|
-
isSelfLoop:
|
|
217
|
-
isBackEdge:
|
|
218
|
-
forceVisible:
|
|
199
|
+
function buildEdges(o, s) {
|
|
200
|
+
let c = /* @__PURE__ */ new Set(), l = [], u = 0;
|
|
201
|
+
for (let d of o) {
|
|
202
|
+
let o = `${d.from}->${d.to}:${d.id}`;
|
|
203
|
+
if (c.has(o)) continue;
|
|
204
|
+
c.add(o);
|
|
205
|
+
let f = s.executedMap.has(o), p = d.trigger === "onEntry", m = d.from === d.to, h = s.stateRanks.get(d.from) ?? 0, g = s.stateRanks.get(d.to) ?? 0, _ = !m && g <= h, v = f ? "var(--primary)" : "var(--muted-foreground)", y = {
|
|
206
|
+
...d,
|
|
207
|
+
isExecuted: f,
|
|
208
|
+
isSelfLoop: m,
|
|
209
|
+
isBackEdge: _,
|
|
210
|
+
forceVisible: s.forceVisible
|
|
219
211
|
};
|
|
220
|
-
|
|
221
|
-
id: `edge-${
|
|
222
|
-
source: `${
|
|
223
|
-
target: `${
|
|
224
|
-
...
|
|
212
|
+
l.push({
|
|
213
|
+
id: `edge-${s.workflowId}-${u++}`,
|
|
214
|
+
source: `${s.workflowId}-${d.from}`,
|
|
215
|
+
target: `${s.workflowId}-${d.to}`,
|
|
216
|
+
..._ && {
|
|
225
217
|
sourceHandle: "bottom-source",
|
|
226
218
|
targetHandle: "bottom-target"
|
|
227
219
|
},
|
|
228
220
|
type: "workflowTransition",
|
|
229
221
|
animated: !1,
|
|
230
222
|
style: {
|
|
231
|
-
strokeWidth:
|
|
232
|
-
stroke:
|
|
233
|
-
strokeDasharray:
|
|
234
|
-
opacity:
|
|
223
|
+
strokeWidth: f ? 2.5 : 1.5,
|
|
224
|
+
stroke: v,
|
|
225
|
+
strokeDasharray: p ? "4,4" : f ? void 0 : "5,5",
|
|
226
|
+
opacity: f || s.forceVisible ? 1 : .3
|
|
235
227
|
},
|
|
236
228
|
markerEnd: {
|
|
237
229
|
type: MarkerType.ArrowClosed,
|
|
238
230
|
width: 18,
|
|
239
231
|
height: 18,
|
|
240
|
-
color:
|
|
232
|
+
color: v
|
|
241
233
|
},
|
|
242
|
-
data:
|
|
234
|
+
data: y
|
|
243
235
|
});
|
|
244
236
|
}
|
|
245
|
-
return
|
|
237
|
+
return l;
|
|
246
238
|
}
|
|
247
239
|
export { buildWorkflowGraph, formatCondition, getTransitions };
|
|
@@ -2,7 +2,9 @@ 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 ChoicesRenderer_default from "./renderers/ChoicesRenderer.js";
|
|
5
6
|
import ClaudeMessage_default from "./renderers/ClaudeMessage.js";
|
|
7
|
+
import ConfirmPromptRenderer_default from "./renderers/ConfirmPromptRenderer.js";
|
|
6
8
|
import DocumentDebugRenderer_default from "./renderers/DocumentDebugRenderer.js";
|
|
7
9
|
import DocumentFormRenderer_default from "./renderers/DocumentFormRenderer.js";
|
|
8
10
|
import DocumentMessageRenderer_default from "./renderers/DocumentMessageRenderer.js";
|
|
@@ -10,49 +12,83 @@ import ErrorMessageRenderer_default from "./renderers/ErrorMessageRenderer.js";
|
|
|
10
12
|
import LinkMessageRenderer_default from "./renderers/LinkMessageRenderer.js";
|
|
11
13
|
import MarkdownMessageRenderer_default from "./renderers/MarkdownMessageRenderer.js";
|
|
12
14
|
import PlainMessageRenderer_default from "./renderers/PlainMessageRenderer.js";
|
|
15
|
+
import SecretInputRenderer_default from "./renderers/SecretInputRenderer.js";
|
|
16
|
+
import TextPromptRenderer_default from "./renderers/TextPromptRenderer.js";
|
|
13
17
|
import { c } from "react/compiler-runtime";
|
|
14
18
|
import React from "react";
|
|
15
19
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
16
20
|
var rendererRegistry = new Map([
|
|
17
|
-
["ai-message", ({ document:
|
|
18
|
-
document:
|
|
19
|
-
isLastItem:
|
|
21
|
+
["ai-message", ({ document: t, isLastItem: v }) => /* @__PURE__ */ jsx(AiMessage_default, {
|
|
22
|
+
document: t,
|
|
23
|
+
isLastItem: v
|
|
20
24
|
})],
|
|
21
|
-
["claude-message", ({ document:
|
|
22
|
-
document:
|
|
23
|
-
isLastItem:
|
|
25
|
+
["claude-message", ({ document: t, isLastItem: v }) => /* @__PURE__ */ jsx(ClaudeMessage_default, {
|
|
26
|
+
document: t,
|
|
27
|
+
isLastItem: v
|
|
24
28
|
})],
|
|
25
|
-
["debug", ({ document:
|
|
29
|
+
["debug", ({ document: t }) => /* @__PURE__ */ jsx("div", {
|
|
26
30
|
className: "mb-4 flex",
|
|
27
|
-
children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document:
|
|
31
|
+
children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document: t })
|
|
28
32
|
})],
|
|
29
|
-
["
|
|
33
|
+
["form", ({ parentWorkflow: v, workflow: y, document: b, isActive: x }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
|
|
30
34
|
role: "document",
|
|
31
35
|
fullWidth: !0,
|
|
32
|
-
timestamp: new Date(
|
|
36
|
+
timestamp: new Date(b.createdAt),
|
|
33
37
|
children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
|
|
34
|
-
|
|
35
|
-
workflow:
|
|
36
|
-
document:
|
|
37
|
-
enabled:
|
|
38
|
-
viewOnly: !
|
|
38
|
+
parentWorkflow: v,
|
|
39
|
+
workflow: y,
|
|
40
|
+
document: b,
|
|
41
|
+
enabled: x,
|
|
42
|
+
viewOnly: !x
|
|
39
43
|
})
|
|
40
44
|
})],
|
|
41
|
-
["message", ({ document:
|
|
42
|
-
["error", ({ document:
|
|
43
|
-
["plain", ({ document:
|
|
44
|
-
["markdown", ({ document:
|
|
45
|
-
["link", ({ document:
|
|
46
|
-
["oauth-prompt", ({
|
|
47
|
-
|
|
48
|
-
workflow:
|
|
49
|
-
document:
|
|
50
|
-
isActive:
|
|
45
|
+
["message", ({ document: t }) => /* @__PURE__ */ jsx(DocumentMessageRenderer_default, { document: t })],
|
|
46
|
+
["error", ({ document: t }) => /* @__PURE__ */ jsx(ErrorMessageRenderer_default, { document: t })],
|
|
47
|
+
["plain", ({ document: t }) => /* @__PURE__ */ jsx(PlainMessageRenderer_default, { document: t })],
|
|
48
|
+
["markdown", ({ document: t }) => /* @__PURE__ */ jsx(MarkdownMessageRenderer_default, { document: t })],
|
|
49
|
+
["link", ({ document: t }) => /* @__PURE__ */ jsx(LinkMessageRenderer_default, { document: t })],
|
|
50
|
+
["oauth-prompt", ({ parentWorkflow: t, workflow: y, document: b, isActive: x }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
|
|
51
|
+
parentWorkflow: t,
|
|
52
|
+
workflow: y,
|
|
53
|
+
document: b,
|
|
54
|
+
isActive: x
|
|
55
|
+
})],
|
|
56
|
+
["text-prompt", ({ parentWorkflow: t, workflow: v, document: y, isActive: b }) => /* @__PURE__ */ jsx(TextPromptRenderer_default, {
|
|
57
|
+
parentWorkflow: t,
|
|
58
|
+
workflow: v,
|
|
59
|
+
document: y,
|
|
60
|
+
isActive: b
|
|
61
|
+
})],
|
|
62
|
+
["choices", ({ parentWorkflow: t, workflow: v, document: y, isActive: x }) => /* @__PURE__ */ jsx(ChoicesRenderer_default, {
|
|
63
|
+
parentWorkflow: t,
|
|
64
|
+
workflow: v,
|
|
65
|
+
document: y,
|
|
66
|
+
isActive: x
|
|
67
|
+
})],
|
|
68
|
+
["confirm-prompt", ({ parentWorkflow: t, workflow: v, document: y, isActive: b }) => /* @__PURE__ */ jsx(ConfirmPromptRenderer_default, {
|
|
69
|
+
parentWorkflow: t,
|
|
70
|
+
workflow: v,
|
|
71
|
+
document: y,
|
|
72
|
+
isActive: b
|
|
73
|
+
})],
|
|
74
|
+
["secret-input", ({ parentWorkflow: t, workflow: v, document: y, isActive: b }) => /* @__PURE__ */ jsx(SecretInputRenderer_default, {
|
|
75
|
+
parentWorkflow: t,
|
|
76
|
+
workflow: v,
|
|
77
|
+
document: y,
|
|
78
|
+
isActive: b
|
|
51
79
|
})]
|
|
52
|
-
])
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
80
|
+
]);
|
|
81
|
+
function resolveDocumentWidget(t) {
|
|
82
|
+
let v = t;
|
|
83
|
+
return v?.widgets?.[0]?.widget ? v.widgets[0].widget : v?.form?.widget ? v.form.widget : "form";
|
|
84
|
+
}
|
|
85
|
+
var DocumentRenderer_default = (t) => {
|
|
86
|
+
let v = c(5), y = t.document, b;
|
|
87
|
+
if (v[0] !== y.ui) {
|
|
88
|
+
let t = resolveDocumentWidget(y.ui);
|
|
89
|
+
b = rendererRegistry.get(t), v[0] = y.ui, v[1] = b;
|
|
90
|
+
} else b = v[1];
|
|
91
|
+
let x = b, S;
|
|
92
|
+
return v[2] !== x || v[3] !== t ? (S = /* @__PURE__ */ jsx("div", { children: x ? /* @__PURE__ */ jsx(x, { ...t }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), v[2] = x, v[3] = t, v[4] = S) : S = v[4], S;
|
|
57
93
|
};
|
|
58
94
|
export { DocumentRenderer_default as default };
|
|
@@ -5,11 +5,11 @@ import React from "react";
|
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { omit } from "lodash";
|
|
7
7
|
var DocumentItem_default = (s) => {
|
|
8
|
-
let l = c(13), { document: u, workflow: d,
|
|
8
|
+
let l = c(13), { document: u, workflow: d, parentWorkflow: f, isActive: p, isLastItem: m, settings: h } = s, g = u.meta, _;
|
|
9
9
|
l[0] !== u || l[1] !== p || l[2] !== m || l[3] !== f || l[4] !== d ? (_ = /* @__PURE__ */ jsx(DocumentRenderer_default, {
|
|
10
10
|
document: u,
|
|
11
11
|
workflow: d,
|
|
12
|
-
|
|
12
|
+
parentWorkflow: f,
|
|
13
13
|
isActive: p,
|
|
14
14
|
isLastItem: m
|
|
15
15
|
}), l[0] = u, l[1] = p, l[2] = m, l[3] = f, l[4] = d, l[5] = _) : _ = l[5];
|
|
@@ -5,39 +5,42 @@ import React, { useEffect } from "react";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useParams } from "react-router-dom";
|
|
7
7
|
var import_enums = require_enums(), DocumentList_default = (e) => {
|
|
8
|
-
let o = c(23), {
|
|
9
|
-
o[0] !==
|
|
8
|
+
let o = c(23), { workflow: l, childWorkflow: u, documents: d, scrollTo: f, settings: p } = e, { workflowId: m, clickId: h } = useParams(), g;
|
|
9
|
+
o[0] !== u.id || o[1] !== m || o[2] !== f ? (g = () => {
|
|
10
10
|
m === u.id && f(u.id);
|
|
11
|
-
}, o[0] =
|
|
11
|
+
}, o[0] = u.id, o[1] = m, o[2] = f, o[3] = g) : g = o[3];
|
|
12
12
|
let _;
|
|
13
|
-
o[4] !==
|
|
13
|
+
o[4] !== u.id || o[5] !== h || o[6] !== m || o[7] !== f ? (_ = [
|
|
14
14
|
u.id,
|
|
15
15
|
m,
|
|
16
16
|
h,
|
|
17
17
|
f
|
|
18
|
-
], o[4] =
|
|
18
|
+
], o[4] = u.id, o[5] = h, o[6] = m, o[7] = f, o[8] = _) : _ = o[8], useEffect(g, _);
|
|
19
19
|
let v = u.status === import_enums.WorkflowState.Waiting, y;
|
|
20
|
-
if (o[9] !==
|
|
20
|
+
if (o[9] !== u || o[10] !== d || o[11] !== v || o[12] !== p || o[13] !== l) {
|
|
21
21
|
let e;
|
|
22
|
-
o[15] !==
|
|
22
|
+
o[15] !== u || o[16] !== d.length || o[17] !== v || o[18] !== p || o[19] !== l ? (e = (e, a) => {
|
|
23
23
|
let o = e, s = e.place === u.place || !!o.meta?.enableAtPlaces?.includes(u.place);
|
|
24
24
|
return console.log({
|
|
25
25
|
isDocumentActive: s,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
isWorkflowActive: v,
|
|
27
|
+
status: u.status,
|
|
28
|
+
place: u.place,
|
|
29
|
+
documentPlace: e.place,
|
|
30
|
+
availableTransitions: u.availableTransitions
|
|
28
31
|
}), /* @__PURE__ */ jsx(DocumentItem_default, {
|
|
29
32
|
document: e,
|
|
30
33
|
workflow: u,
|
|
31
|
-
|
|
34
|
+
parentWorkflow: l,
|
|
32
35
|
isActive: v && s,
|
|
33
36
|
isLastItem: a === d.length - 1,
|
|
34
37
|
settings: p
|
|
35
38
|
}, e.id);
|
|
36
|
-
}, o[15] =
|
|
39
|
+
}, o[15] = u, o[16] = d.length, o[17] = v, o[18] = p, o[19] = l, o[20] = e) : e = o[20], y = d.map(e), o[9] = u, o[10] = d, o[11] = v, o[12] = p, o[13] = l, o[14] = y;
|
|
37
40
|
} else y = o[14];
|
|
38
41
|
let b;
|
|
39
42
|
return o[21] === y ? b = o[22] : (b = /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: "flex flex-col gap-
|
|
43
|
+
className: "flex flex-col gap-3",
|
|
41
44
|
children: y
|
|
42
45
|
}), o[21] = y, o[22] = b), b;
|
|
43
46
|
};
|
|
@@ -178,17 +178,17 @@ var formatDate = (e) => {
|
|
|
178
178
|
let M;
|
|
179
179
|
n[44] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx("span", {
|
|
180
180
|
className: "font-medium",
|
|
181
|
-
children: "
|
|
181
|
+
children: "Workflow ID:"
|
|
182
182
|
}), n[44] = M) : M = n[44];
|
|
183
183
|
let N;
|
|
184
|
-
n[45] === r.
|
|
184
|
+
n[45] === r.workflowId ? N = n[46] : (N = /* @__PURE__ */ jsxs("div", {
|
|
185
185
|
className: "text-sm",
|
|
186
186
|
children: [
|
|
187
187
|
M,
|
|
188
188
|
" ",
|
|
189
|
-
r.
|
|
189
|
+
r.workflowId
|
|
190
190
|
]
|
|
191
|
-
}), n[45] = r.
|
|
191
|
+
}), n[45] = r.workflowId, n[46] = N);
|
|
192
192
|
let P;
|
|
193
193
|
n[47] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx("span", {
|
|
194
194
|
className: "font-medium",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
|
|
2
2
|
import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
|
|
3
3
|
import { Source, Sources, SourcesContent, SourcesTrigger } from "../../../components/ai-elements/sources.js";
|
|
4
|
-
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/
|
|
4
|
+
import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/loopstack-elements/tool.js";
|
|
5
5
|
import { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart } from "../../../types/ai.types.js";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
7
|
import { Fragment } from "react";
|