@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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
1
2
|
import { Button } from "../../../components/ui/button.js";
|
|
2
|
-
import Form_default from "../../../components/dynamic-form/Form.js";
|
|
3
3
|
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
4
|
+
import Form_default from "../../../components/dynamic-form/Form.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import React, { useEffect } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -8,9 +9,9 @@ import { Loader2 } from "lucide-react";
|
|
|
8
9
|
import { useForm } from "react-hook-form";
|
|
9
10
|
import "zod";
|
|
10
11
|
function resolveFormConfig(e) {
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
let e =
|
|
12
|
+
let d = e, f = (d?.widgets)?.find((e) => e.widget === "form");
|
|
13
|
+
if (f?.options) {
|
|
14
|
+
let e = f.options;
|
|
14
15
|
return {
|
|
15
16
|
formUi: { form: {
|
|
16
17
|
properties: e.properties,
|
|
@@ -24,82 +25,73 @@ function resolveFormConfig(e) {
|
|
|
24
25
|
}
|
|
25
26
|
return {
|
|
26
27
|
formUi: e,
|
|
27
|
-
actions: (
|
|
28
|
+
actions: (d?.actions ?? []).map((e) => ({
|
|
28
29
|
type: "button",
|
|
29
30
|
transition: e.options?.transition,
|
|
30
31
|
label: e.options?.label
|
|
31
32
|
}))
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
|
-
var DocumentFormRenderer_default = (
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
m[3] === x ? S = m[4] : (S = {
|
|
39
|
-
defaultValues: x,
|
|
35
|
+
var DocumentFormRenderer_default = (m) => {
|
|
36
|
+
let h = c(15), { parentWorkflow: g, workflow: _, document: v, enabled: y, viewOnly: b } = m, x = useRunWorkflow(), S = useDocumentConfigs().get(v.documentName), C = S?.schema, w = C?.type === "object" ? v.content : { raw: v.content }, T;
|
|
37
|
+
h[0] === w ? T = h[1] : (T = {
|
|
38
|
+
defaultValues: w,
|
|
40
39
|
mode: "onChange"
|
|
41
|
-
},
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
|
|
40
|
+
}, h[0] = w, h[1] = T);
|
|
41
|
+
let E = useForm(T), D, O;
|
|
42
|
+
h[2] !== v.validationError || h[3] !== E ? (D = () => {
|
|
43
|
+
v.validationError ? v.validationError.issues.forEach((e) => {
|
|
44
|
+
let d = e.path.join(".");
|
|
45
|
+
E.setError(d, {
|
|
47
46
|
type: e.code,
|
|
48
47
|
message: e.message
|
|
49
48
|
});
|
|
50
|
-
}) :
|
|
51
|
-
},
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
actions: O
|
|
97
|
-
}), m[28] = E, m[29] = D, m[30] = O, m[31] = A, m[32] = j, m[33] = M, m[34] = N, m[35] = P, m[36] = F) : F = m[36];
|
|
98
|
-
let I;
|
|
99
|
-
return m[37] !== k || m[38] !== F ? (I = /* @__PURE__ */ jsx("div", {
|
|
100
|
-
className: k,
|
|
101
|
-
children: F
|
|
102
|
-
}), m[37] = k, m[38] = F, m[39] = I) : I = m[39], I;
|
|
49
|
+
}) : E.clearErrors();
|
|
50
|
+
}, O = [v.validationError, E], h[2] = v.validationError, h[3] = E, h[4] = D, h[5] = O) : (D = h[4], O = h[5]), useEffect(D, O);
|
|
51
|
+
let k = _.availableTransitions?.map(_temp) ?? [], A = (e, d) => {
|
|
52
|
+
if (!k.includes(e)) {
|
|
53
|
+
console.error(`Transition ${e} not available.`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
x.mutate({
|
|
57
|
+
workflowId: g.id,
|
|
58
|
+
runWorkflowPayloadDto: { transition: {
|
|
59
|
+
id: e,
|
|
60
|
+
workflowId: _.id,
|
|
61
|
+
payload: d
|
|
62
|
+
} }
|
|
63
|
+
});
|
|
64
|
+
}, j = (e) => (d) => {
|
|
65
|
+
C?.type === "object" ? A(e, d) : A(e, d.raw);
|
|
66
|
+
}, M = (e) => {
|
|
67
|
+
e.transition && E.handleSubmit((d) => j(e.transition)(d), _temp2)();
|
|
68
|
+
}, { formUi: N, actions: P } = resolveFormConfig(S?.ui), F = !!N?.form?.disabled, I = !y || F || !1, L = Form_default, R = C ?? {}, z = N ?? void 0, B = S?.meta?.mimeType, V = !b && P.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: "flex w-full flex-col items-end gap-4",
|
|
70
|
+
children: P.map((e, f) => {
|
|
71
|
+
let p = I || e.transition !== void 0 && !k.includes(e.transition);
|
|
72
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
73
|
+
type: "button",
|
|
74
|
+
variant: e.variant ?? "default",
|
|
75
|
+
disabled: p || x.isPending,
|
|
76
|
+
onClick: () => M(e),
|
|
77
|
+
className: e.type === "button-full-w" ? "w-full" : "w-48",
|
|
78
|
+
...e.props ?? {},
|
|
79
|
+
children: [x.isPending && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), e.label ?? "Submit"]
|
|
80
|
+
}, f);
|
|
81
|
+
})
|
|
82
|
+
}) : void 0, H;
|
|
83
|
+
return h[6] !== L || h[7] !== I || h[8] !== E || h[9] !== R || h[10] !== z || h[11] !== B || h[12] !== V || h[13] !== b ? (H = /* @__PURE__ */ jsx("div", {
|
|
84
|
+
className: "flex",
|
|
85
|
+
children: /* @__PURE__ */ jsx(L, {
|
|
86
|
+
form: E,
|
|
87
|
+
schema: R,
|
|
88
|
+
ui: z,
|
|
89
|
+
mimeType: B,
|
|
90
|
+
disabled: I,
|
|
91
|
+
viewOnly: b,
|
|
92
|
+
actions: V
|
|
93
|
+
})
|
|
94
|
+
}), h[6] = L, h[7] = I, h[8] = E, h[9] = R, h[10] = z, h[11] = B, h[12] = V, h[13] = b, h[14] = H) : H = h[14], H;
|
|
103
95
|
};
|
|
104
96
|
function _temp(e) {
|
|
105
97
|
return e.id;
|
|
@@ -1,89 +1,94 @@
|
|
|
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 { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/loopstack-elements/tool.js";
|
|
4
|
+
import { FadeInBlock } from "../../../components/motion/FadeIn.js";
|
|
5
|
+
import { StreamingText } from "../../../components/motion/StreamingText.js";
|
|
4
6
|
import { c } from "react/compiler-runtime";
|
|
5
7
|
import { Fragment } from "react";
|
|
6
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
import { CopyIcon } from "lucide-react";
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
+
var CopyActions = (e) => {
|
|
11
|
+
let g = c(5), { text: _ } = e, v;
|
|
12
|
+
g[0] === _ ? v = g[1] : (v = () => void navigator.clipboard.writeText(_), g[0] = _, g[1] = v);
|
|
13
|
+
let y;
|
|
14
|
+
g[2] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" }), g[2] = y) : y = g[2];
|
|
15
|
+
let b;
|
|
16
|
+
return g[3] === v ? b = g[4] : (b = /* @__PURE__ */ jsx(FadeInBlock, { children: /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
|
|
17
|
+
onClick: v,
|
|
18
|
+
label: "Copy",
|
|
19
|
+
children: y
|
|
20
|
+
}) }) }), g[3] = v, g[4] = b), b;
|
|
21
|
+
}, LlmMessage_default = (m) => {
|
|
22
|
+
let h = c(18), { document: x } = m, S = x.content, C = S.id ?? x.id, w = !!x.meta?.streaming;
|
|
10
23
|
if (typeof S.content == "string") {
|
|
11
24
|
let m;
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
|
|
18
|
-
}) }), b[2] = S.content, b[3] = S.role, b[4] = h) : h = b[4];
|
|
19
|
-
let g;
|
|
20
|
-
return b[5] !== S.role || b[6] !== m || b[7] !== h ? (g = /* @__PURE__ */ jsxs(Message, {
|
|
25
|
+
h[0] !== w || h[1] !== S.content ? (m = /* @__PURE__ */ jsx(MessageContent, { children: w ? /* @__PURE__ */ jsx(StreamingText, { text: S.content }) : /* @__PURE__ */ jsx(MessageResponse, { children: S.content }) }), h[0] = w, h[1] = S.content, h[2] = m) : m = h[2];
|
|
26
|
+
let v;
|
|
27
|
+
h[3] !== w || h[4] !== S.content || h[5] !== S.role ? (v = S.role === "assistant" && !w && /* @__PURE__ */ jsx(CopyActions, { text: S.content }), h[3] = w, h[4] = S.content, h[5] = S.role, h[6] = v) : v = h[6];
|
|
28
|
+
let y;
|
|
29
|
+
return h[7] !== S.role || h[8] !== m || h[9] !== v ? (y = /* @__PURE__ */ jsxs(Message, {
|
|
21
30
|
from: S.role,
|
|
22
|
-
children: [m,
|
|
23
|
-
}),
|
|
31
|
+
children: [m, v]
|
|
32
|
+
}), h[7] = S.role, h[8] = m, h[9] = v, h[10] = y) : y = h[10], y;
|
|
24
33
|
}
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
switch (
|
|
34
|
+
let T = S.content, E;
|
|
35
|
+
h[11] !== T || h[12] !== w || h[13] !== S.role || h[14] !== C ? (E = T.map((m, h) => {
|
|
36
|
+
switch (m.type) {
|
|
28
37
|
case "text": return /* @__PURE__ */ jsxs(Message, {
|
|
29
38
|
from: S.role,
|
|
30
|
-
children: [/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children:
|
|
31
|
-
|
|
32
|
-
label: "Copy",
|
|
33
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
|
|
34
|
-
}) })]
|
|
35
|
-
}, `${C}-${v}`);
|
|
39
|
+
children: [/* @__PURE__ */ jsx(MessageContent, { children: w ? /* @__PURE__ */ jsx(StreamingText, { text: m.text }) : /* @__PURE__ */ jsx(MessageResponse, { children: m.text }) }), S.role === "assistant" && !w && /* @__PURE__ */ jsx(CopyActions, { text: m.text })]
|
|
40
|
+
}, `${C}-${h}`);
|
|
36
41
|
case "thinking": return /* @__PURE__ */ jsxs(Reasoning, {
|
|
37
42
|
className: "w-full",
|
|
38
|
-
isStreaming:
|
|
39
|
-
children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children:
|
|
40
|
-
}, `${C}-${
|
|
41
|
-
case "tool_call": return /* @__PURE__ */ jsx(Message, {
|
|
43
|
+
isStreaming: w,
|
|
44
|
+
children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children: m.text })]
|
|
45
|
+
}, `${C}-${h}`);
|
|
46
|
+
case "tool_call": return /* @__PURE__ */ jsx(FadeInBlock, { children: /* @__PURE__ */ jsx(Message, {
|
|
42
47
|
from: "assistant",
|
|
43
48
|
children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
|
|
44
49
|
state: "input-available",
|
|
45
|
-
title:
|
|
50
|
+
title: m.name,
|
|
46
51
|
type: "tool-call"
|
|
47
|
-
}), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolInput, { input:
|
|
48
|
-
}, `${C}-${
|
|
52
|
+
}), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolInput, { input: m.args }) })] })
|
|
53
|
+
}) }, `${C}-${h}`);
|
|
49
54
|
case "tool_result": {
|
|
50
|
-
let
|
|
55
|
+
let g;
|
|
51
56
|
try {
|
|
52
|
-
|
|
57
|
+
g = JSON.parse(m.content);
|
|
53
58
|
} catch {
|
|
54
|
-
|
|
59
|
+
g = m.content;
|
|
55
60
|
}
|
|
56
|
-
return /* @__PURE__ */ jsx(Message, {
|
|
61
|
+
return /* @__PURE__ */ jsx(FadeInBlock, { children: /* @__PURE__ */ jsx(Message, {
|
|
57
62
|
from: "assistant",
|
|
58
63
|
children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
|
|
59
|
-
state:
|
|
64
|
+
state: m.isError ? "output-error" : "output-available",
|
|
60
65
|
title: "Tool Result",
|
|
61
66
|
type: "tool-call"
|
|
62
67
|
}), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolOutput, {
|
|
63
|
-
output:
|
|
64
|
-
errorText:
|
|
68
|
+
output: g,
|
|
69
|
+
errorText: m.isError ? m.content : ""
|
|
65
70
|
}) })] })
|
|
66
|
-
}, `${C}-${
|
|
71
|
+
}) }, `${C}-${h}`);
|
|
67
72
|
}
|
|
68
73
|
case "server_tool_use": {
|
|
69
|
-
let
|
|
70
|
-
return /* @__PURE__ */ jsx(Message, {
|
|
74
|
+
let g = T.find((e) => e.type === "server_tool_result" && e.toolUseId === m.id);
|
|
75
|
+
return /* @__PURE__ */ jsx(FadeInBlock, { children: /* @__PURE__ */ jsx(Message, {
|
|
71
76
|
from: "assistant",
|
|
72
77
|
children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
|
|
73
|
-
state:
|
|
74
|
-
title:
|
|
78
|
+
state: g ? "output-available" : "input-available",
|
|
79
|
+
title: m.name,
|
|
75
80
|
type: "tool-call"
|
|
76
|
-
}), /* @__PURE__ */ jsxs(ToolContent, { children: [/* @__PURE__ */ jsx(ToolInput, { input:
|
|
77
|
-
output:
|
|
81
|
+
}), /* @__PURE__ */ jsxs(ToolContent, { children: [/* @__PURE__ */ jsx(ToolInput, { input: m.input }), g && /* @__PURE__ */ jsx(ToolOutput, {
|
|
82
|
+
output: g.content,
|
|
78
83
|
errorText: ""
|
|
79
84
|
})] })] })
|
|
80
|
-
}, `${C}-${
|
|
85
|
+
}) }, `${C}-${h}`);
|
|
81
86
|
}
|
|
82
87
|
case "server_tool_result": return null;
|
|
83
88
|
default: return null;
|
|
84
89
|
}
|
|
85
|
-
}),
|
|
86
|
-
let
|
|
87
|
-
return
|
|
90
|
+
}), h[11] = T, h[12] = w, h[13] = S.role, h[14] = C, h[15] = E) : E = h[15];
|
|
91
|
+
let D;
|
|
92
|
+
return h[16] === E ? D = h[17] : (D = /* @__PURE__ */ jsx(Fragment, { children: E }), h[16] = E, h[17] = D), D;
|
|
88
93
|
};
|
|
89
94
|
export { LlmMessage_default as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
1
2
|
import { Button } from "../../../components/ui/button.js";
|
|
2
3
|
import { Textarea } from "../../../components/ui/textarea.js";
|
|
3
4
|
import CompletionMessagePaper_default from "../../../components/messages/CompletionMessagePaper.js";
|
|
@@ -7,51 +8,53 @@ import { c } from "react/compiler-runtime";
|
|
|
7
8
|
import React, { useState } from "react";
|
|
8
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { Loader2 } from "lucide-react";
|
|
10
|
-
var TextPromptRenderer_default = (
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let k;
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
|
|
11
|
+
var TextPromptRenderer_default = (p) => {
|
|
12
|
+
let m = c(23), { parentWorkflow: h, workflow: g, document: _, isActive: v } = p, y = _.content, b = useDocumentConfigs(), x;
|
|
13
|
+
m[0] !== _.documentName || m[1] !== b ? (x = b.get(_.documentName), m[0] = _.documentName, m[1] = b, m[2] = x) : x = m[2];
|
|
14
|
+
let { submit: S, canSubmit: C, isLoading: w } = useDocumentTransition(h, g, x), [T, E] = useState(""), D = !!y.answer, O = !v || !C || D, k;
|
|
15
|
+
m[3] !== S || m[4] !== T ? (k = () => {
|
|
16
|
+
let e = T.trim();
|
|
17
|
+
e && S({ answer: e });
|
|
18
|
+
}, m[3] = S, m[4] = T, m[5] = k) : k = m[5];
|
|
19
|
+
let A = k, j;
|
|
20
|
+
m[6] === _.createdAt ? j = m[7] : (j = new Date(_.createdAt), m[6] = _.createdAt, m[7] = j);
|
|
21
|
+
let M;
|
|
22
|
+
m[8] === y.question ? M = m[9] : (M = /* @__PURE__ */ jsx(MarkdownContent_default, { content: y.question }), m[8] = y.question, m[9] = M);
|
|
23
|
+
let N;
|
|
24
|
+
m[10] !== y.answer || m[11] !== O || m[12] !== A || m[13] !== D || m[14] !== w || m[15] !== T ? (N = D ? /* @__PURE__ */ jsxs("div", {
|
|
22
25
|
className: "text-muted-foreground text-sm",
|
|
23
26
|
children: ["Answered: ", /* @__PURE__ */ jsx("span", {
|
|
24
27
|
className: "text-foreground font-medium",
|
|
25
|
-
children:
|
|
28
|
+
children: y.answer
|
|
26
29
|
})]
|
|
27
30
|
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Textarea, {
|
|
28
31
|
placeholder: "Type your answer...",
|
|
29
|
-
value:
|
|
30
|
-
onChange: (e) =>
|
|
31
|
-
disabled:
|
|
32
|
+
value: T,
|
|
33
|
+
onChange: (e) => E(e.target.value),
|
|
34
|
+
disabled: O,
|
|
32
35
|
rows: 3
|
|
33
36
|
}), /* @__PURE__ */ jsx("div", {
|
|
34
37
|
className: "flex justify-end",
|
|
35
38
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
36
39
|
type: "button",
|
|
37
40
|
variant: "default",
|
|
38
|
-
disabled:
|
|
39
|
-
onClick:
|
|
41
|
+
disabled: O || w || !T.trim(),
|
|
42
|
+
onClick: A,
|
|
40
43
|
className: "w-48",
|
|
41
|
-
children: [
|
|
44
|
+
children: [w && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), "Submit"]
|
|
42
45
|
})
|
|
43
|
-
})] }),
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
+
})] }), m[10] = y.answer, m[11] = O, m[12] = A, m[13] = D, m[14] = w, m[15] = T, m[16] = N) : N = m[16];
|
|
47
|
+
let P;
|
|
48
|
+
m[17] !== M || m[18] !== N ? (P = /* @__PURE__ */ jsxs("div", {
|
|
46
49
|
className: "flex flex-col gap-4 p-1",
|
|
47
|
-
children: [
|
|
48
|
-
}),
|
|
49
|
-
let
|
|
50
|
-
return
|
|
50
|
+
children: [M, N]
|
|
51
|
+
}), m[17] = M, m[18] = N, m[19] = P) : P = m[19];
|
|
52
|
+
let F;
|
|
53
|
+
return m[20] !== j || m[21] !== P ? (F = /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
|
|
51
54
|
role: "document",
|
|
52
55
|
fullWidth: !0,
|
|
53
|
-
timestamp:
|
|
54
|
-
children:
|
|
55
|
-
}),
|
|
56
|
+
timestamp: j,
|
|
57
|
+
children: P
|
|
58
|
+
}), m[20] = j, m[21] = P, m[22] = F) : F = m[22], F;
|
|
56
59
|
};
|
|
57
60
|
export { TextPromptRenderer_default as default };
|
|
@@ -2,14 +2,14 @@ import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
function resolveTransition(e) {
|
|
5
|
-
let r = e
|
|
6
|
-
|
|
5
|
+
let r = e?.widgets;
|
|
6
|
+
if (r?.[0]?.options?.transition) return r[0].options.transition;
|
|
7
7
|
}
|
|
8
8
|
function useDocumentTransition(i, a, o) {
|
|
9
9
|
let s = c(14), l = useRunWorkflow(), u, d;
|
|
10
|
-
if (s[0] !== o || s[1] !== a.availableTransitions) {
|
|
10
|
+
if (s[0] !== o?.ui || s[1] !== a.availableTransitions) {
|
|
11
11
|
let e = a.availableTransitions?.map(_temp) ?? [];
|
|
12
|
-
d = resolveTransition(o), u = !!d && e.includes(d), s[0] = o, s[1] = a.availableTransitions, s[2] = u, s[3] = d;
|
|
12
|
+
d = resolveTransition(o?.ui), u = !!d && e.includes(d), s[0] = o?.ui, s[1] = a.availableTransitions, s[2] = u, s[3] = d;
|
|
13
13
|
} else u = s[2], d = s[3];
|
|
14
14
|
let f = u, p;
|
|
15
15
|
s[4] !== f || s[5] !== i.id || s[6] !== l || s[7] !== d || s[8] !== a.id ? (p = (e) => {
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
+
import { useAppsConfig } from "../../hooks/useConfig.js";
|
|
2
|
+
import { AVAILABLE_FEATURES } from "./available-features.js";
|
|
1
3
|
import { c } from "react/compiler-runtime";
|
|
2
4
|
import { createContext, useContext, useMemo } from "react";
|
|
3
5
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
var FeatureRegistryContext = createContext([]);
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
var FeatureRegistryContext = createContext([]), BackendFeaturesContext = createContext([]);
|
|
7
|
+
function resolveFeatures(e, o) {
|
|
8
|
+
return e?.length ? e.filter((e) => e.enabled !== !1).map((e) => AVAILABLE_FEATURES[e.id]).filter(Boolean) : o;
|
|
9
|
+
}
|
|
10
|
+
function FeatureRegistryProvider(a) {
|
|
11
|
+
let s = c(13), { features: l, children: u } = a, d;
|
|
12
|
+
s[0] === l ? d = s[1] : (d = l === void 0 ? [] : l, s[0] = l, s[1] = d);
|
|
13
|
+
let f = d, { data: p } = useAppsConfig(), m = p?.[0]?.features, h;
|
|
14
|
+
s[2] !== m || s[3] !== f ? (h = resolveFeatures(m, f), s[2] = m, s[3] = f, s[4] = h) : h = s[4];
|
|
15
|
+
let g = h, _;
|
|
16
|
+
s[5] === m ? _ = s[6] : (_ = m ?? [], s[5] = m, s[6] = _);
|
|
17
|
+
let v = _, y;
|
|
18
|
+
s[7] !== g || s[8] !== u ? (y = /* @__PURE__ */ jsx(FeatureRegistryContext.Provider, {
|
|
19
|
+
value: g,
|
|
20
|
+
children: u
|
|
21
|
+
}), s[7] = g, s[8] = u, s[9] = y) : y = s[9];
|
|
22
|
+
let b;
|
|
23
|
+
return s[10] !== v || s[11] !== y ? (b = /* @__PURE__ */ jsx(BackendFeaturesContext.Provider, {
|
|
24
|
+
value: v,
|
|
25
|
+
children: y
|
|
26
|
+
}), s[10] = v, s[11] = y, s[12] = b) : b = s[12], b;
|
|
13
27
|
}
|
|
14
28
|
function useFeatureRegistry() {
|
|
15
29
|
return useContext(FeatureRegistryContext);
|
|
16
30
|
}
|
|
17
|
-
|
|
31
|
+
function useFeatureConfig(e) {
|
|
32
|
+
let a = c(5), s = useContext(BackendFeaturesContext), u;
|
|
33
|
+
if (a[0] !== e || a[1] !== s) {
|
|
34
|
+
let o;
|
|
35
|
+
a[3] === e ? o = a[4] : (o = (a) => a.id === e, a[3] = e, a[4] = o), u = s.find(o), a[0] = e, a[1] = s, a[2] = u;
|
|
36
|
+
} else u = a[2];
|
|
37
|
+
return u;
|
|
38
|
+
}
|
|
39
|
+
export { FeatureRegistryProvider, useFeatureConfig, useFeatureRegistry };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { fileExplorerFeature } from "../file-explorer/file-explorer-feature.js";
|
|
2
|
+
import "../file-explorer/index.js";
|
|
3
|
+
import { gitFeature } from "../git/git-feature.js";
|
|
4
|
+
import "../git/index.js";
|
|
5
|
+
import { secretsFeature } from "../secrets/secrets-feature.js";
|
|
6
|
+
import "../secrets/index.js";
|
|
7
|
+
const AVAILABLE_FEATURES = {
|
|
8
|
+
git: gitFeature,
|
|
9
|
+
fileExplorer: fileExplorerFeature,
|
|
10
|
+
secrets: secretsFeature
|
|
11
|
+
};
|
|
12
|
+
export { AVAILABLE_FEATURES };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AVAILABLE_FEATURES } from "./available-features.js";
|
|
2
|
+
import { FeatureRegistryProvider, useFeatureConfig, useFeatureRegistry } from "./FeatureRegistryProvider.js";
|