@loopstack/loopstack-studio 0.29.5 → 0.30.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/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/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 +4 -4
- 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 +1 -1
- 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 +134 -125
- 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 +116 -15
- package/dist/index.js +9 -8
- 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/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/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../hooks/useConfig.js";
|
|
1
2
|
import CompletionMessagePaper_default from "../../components/messages/CompletionMessagePaper.js";
|
|
2
|
-
import { useFeatureRegistry } from "../feature-registry/FeatureRegistryProvider.js";
|
|
3
|
-
import "../feature-registry/index.js";
|
|
4
3
|
import OAuthPromptRenderer_default from "../oauth/OAuthPromptRenderer.js";
|
|
5
4
|
import "../oauth/index.js";
|
|
6
5
|
import AiMessage_default from "./renderers/AiMessage.js";
|
|
@@ -15,6 +14,8 @@ import LlmMessage_default from "./renderers/LlmMessage.js";
|
|
|
15
14
|
import MarkdownMessageRenderer_default from "./renderers/MarkdownMessageRenderer.js";
|
|
16
15
|
import PlainMessageRenderer_default from "./renderers/PlainMessageRenderer.js";
|
|
17
16
|
import TextPromptRenderer_default from "./renderers/TextPromptRenderer.js";
|
|
17
|
+
import { useFeatureRegistry } from "../feature-registry/FeatureRegistryProvider.js";
|
|
18
|
+
import "../feature-registry/index.js";
|
|
18
19
|
import { c } from "react/compiler-runtime";
|
|
19
20
|
import React, { useMemo } from "react";
|
|
20
21
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
@@ -31,12 +32,12 @@ var coreRendererRegistry = new Map([
|
|
|
31
32
|
className: "mb-4 flex",
|
|
32
33
|
children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document: e })
|
|
33
34
|
})],
|
|
34
|
-
["form", ({ parentWorkflow:
|
|
35
|
+
["form", ({ parentWorkflow: e, workflow: v, document: y, isActive: b }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
|
|
35
36
|
role: "document",
|
|
36
37
|
fullWidth: !0,
|
|
37
38
|
timestamp: new Date(y.createdAt),
|
|
38
39
|
children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
|
|
39
|
-
parentWorkflow:
|
|
40
|
+
parentWorkflow: e,
|
|
40
41
|
workflow: v,
|
|
41
42
|
document: y,
|
|
42
43
|
enabled: b,
|
|
@@ -73,23 +74,23 @@ var coreRendererRegistry = new Map([
|
|
|
73
74
|
isActive: y
|
|
74
75
|
})]
|
|
75
76
|
]);
|
|
76
|
-
function
|
|
77
|
+
function resolveWidgetName(e) {
|
|
77
78
|
let _ = e;
|
|
78
79
|
return _?.widgets?.[0]?.widget ? _.widgets[0].widget : _?.form?.widget ? _.form.widget : "form";
|
|
79
80
|
}
|
|
80
|
-
var DocumentRenderer_default = (
|
|
81
|
-
let v = c(
|
|
82
|
-
if (v[0] !==
|
|
83
|
-
let e =
|
|
84
|
-
if (v[
|
|
81
|
+
var DocumentRenderer_default = (_) => {
|
|
82
|
+
let v = c(9), y = useFeatureRegistry(), b = useDocumentConfigs(), x = _.document, S;
|
|
83
|
+
if (v[0] !== x.documentName || v[1] !== b || v[2] !== y) {
|
|
84
|
+
let e = resolveWidgetName(b.get(x.documentName)?.ui), _;
|
|
85
|
+
if (v[4] !== y) {
|
|
85
86
|
_ = /* @__PURE__ */ new Map();
|
|
86
87
|
for (let e of y) if (e.documentRenderers) for (let [v, y] of Object.entries(e.documentRenderers)) _.set(v, y);
|
|
87
|
-
v[
|
|
88
|
-
} else _ = v[
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
} else
|
|
92
|
-
let
|
|
93
|
-
return v[
|
|
88
|
+
v[4] = y, v[5] = _;
|
|
89
|
+
} else _ = v[5];
|
|
90
|
+
let C = _;
|
|
91
|
+
S = coreRendererRegistry.get(e) ?? C.get(e), v[0] = x.documentName, v[1] = b, v[2] = y, v[3] = S;
|
|
92
|
+
} else S = v[3];
|
|
93
|
+
let C = S, w;
|
|
94
|
+
return v[6] !== C || v[7] !== _ ? (w = /* @__PURE__ */ jsx("div", { children: C ? /* @__PURE__ */ jsx(C, { ..._ }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), v[6] = C, v[7] = _, v[8] = w) : w = v[8], w;
|
|
94
95
|
};
|
|
95
96
|
export { DocumentRenderer_default as default };
|
|
@@ -1,27 +1,49 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
2
|
+
import { FadeIn } from "../../../components/motion/FadeIn.js";
|
|
1
3
|
import DocumentRenderer_default from "../DocumentRenderer.js";
|
|
2
4
|
import DocumentMetadataPills_default from "./DocumentMetadataPills.js";
|
|
3
5
|
import { c } from "react/compiler-runtime";
|
|
4
6
|
import React from "react";
|
|
5
|
-
import {
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { omit } from "lodash";
|
|
7
|
-
var DocumentItem_default = (
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
var DocumentItem_default = (l) => {
|
|
10
|
+
let u = c(27), { document: d, workflow: f, parentWorkflow: p, isActive: m, isLastItem: h, settings: g } = l, _ = useDocumentConfigs(), v;
|
|
11
|
+
if (u[0] !== d || u[1] !== _ || u[2] !== m || u[3] !== h || u[4] !== p || u[5] !== g.enableDebugMode || u[6] !== f) {
|
|
12
|
+
let e = _.get(d.documentName)?.meta, s = d.meta, l = d.place === f.place || !!e?.enableAtPlaces?.includes(f.place), y;
|
|
13
|
+
u[8] !== p.id || u[9] !== p.title || u[10] !== f.id ? (y = p.id === f.id ? {} : {
|
|
14
|
+
parentWorkflowId: p.id,
|
|
15
|
+
parentTitle: p.title
|
|
16
|
+
}, u[8] = p.id, u[9] = p.title, u[10] = f.id, u[11] = y) : y = u[11];
|
|
17
|
+
let b;
|
|
18
|
+
u[12] !== m || u[13] !== l || u[14] !== y || u[15] !== f.id || u[16] !== f.place || u[17] !== f.status || u[18] !== f.title || u[19] !== f.workflowName ? (b = {
|
|
19
|
+
workflowId: f.id,
|
|
20
|
+
workflowName: f.workflowName,
|
|
21
|
+
title: f.title,
|
|
22
|
+
status: f.status,
|
|
23
|
+
place: f.place,
|
|
24
|
+
isActive: m,
|
|
25
|
+
isDocumentActive: l,
|
|
26
|
+
...y
|
|
27
|
+
}, u[12] = m, u[13] = l, u[14] = y, u[15] = f.id, u[16] = f.place, u[17] = f.status, u[18] = f.title, u[19] = f.workflowName, u[20] = b) : b = u[20];
|
|
28
|
+
let x = b, S;
|
|
29
|
+
u[21] !== d || u[22] !== m || u[23] !== h || u[24] !== p || u[25] !== f ? (S = /* @__PURE__ */ jsx(DocumentRenderer_default, {
|
|
30
|
+
document: d,
|
|
31
|
+
workflow: f,
|
|
32
|
+
parentWorkflow: p,
|
|
33
|
+
isActive: m,
|
|
34
|
+
isLastItem: h
|
|
35
|
+
}), u[21] = d, u[22] = m, u[23] = h, u[24] = p, u[25] = f, u[26] = S) : S = u[26], v = /* @__PURE__ */ jsxs(FadeIn, { children: [S, g.enableDebugMode ? /* @__PURE__ */ jsx(DocumentMetadataPills_default, { metaData: {
|
|
36
|
+
...s?.data ?? {},
|
|
37
|
+
document: {
|
|
38
|
+
data: Object.assign({}, omit(d, ["content"]), {
|
|
39
|
+
meta: d.meta,
|
|
40
|
+
staticMeta: e
|
|
41
|
+
}),
|
|
42
|
+
content: d.content,
|
|
43
|
+
workflowContext: x
|
|
44
|
+
}
|
|
45
|
+
} }) : null] }), u[0] = d, u[1] = _, u[2] = m, u[3] = h, u[4] = p, u[5] = g.enableDebugMode, u[6] = f, u[7] = v;
|
|
46
|
+
} else v = u[7];
|
|
47
|
+
return v;
|
|
26
48
|
};
|
|
27
49
|
export { DocumentItem_default as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
1
2
|
import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
2
3
|
import "../../../packages/contracts/dist/enums/index.js";
|
|
3
4
|
import DocumentItem_default from "./DocumentItem.js";
|
|
@@ -5,44 +6,41 @@ import { c } from "react/compiler-runtime";
|
|
|
5
6
|
import React, { useEffect } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import { useParams } from "react-router-dom";
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
let _;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
function getDocumentKey(e) {
|
|
10
|
+
let o = e.content;
|
|
11
|
+
return e.documentName === "llm_message" && typeof o?.id == "string" ? `llm-message-${o.id}` : e.id;
|
|
12
|
+
}
|
|
13
|
+
var DocumentList_default = (l) => {
|
|
14
|
+
let u = c(25), { workflow: d, childWorkflow: f, documents: p, scrollTo: m, settings: h } = l, { workflowId: g, clickId: _ } = useParams(), v = useDocumentConfigs(), y;
|
|
15
|
+
u[0] !== f.id || u[1] !== g || u[2] !== m ? (y = () => {
|
|
16
|
+
g === f.id && m(f.id);
|
|
17
|
+
}, u[0] = f.id, u[1] = g, u[2] = m, u[3] = y) : y = u[3];
|
|
18
|
+
let b;
|
|
19
|
+
u[4] !== f.id || u[5] !== _ || u[6] !== g || u[7] !== m ? (b = [
|
|
20
|
+
f.id,
|
|
21
|
+
g,
|
|
22
|
+
_,
|
|
23
|
+
m
|
|
24
|
+
], u[4] = f.id, u[5] = _, u[6] = g, u[7] = m, u[8] = b) : b = u[8], useEffect(y, b);
|
|
25
|
+
let x = f.status === WorkflowState.Waiting, S;
|
|
26
|
+
if (u[9] !== f || u[10] !== v || u[11] !== p || u[12] !== x || u[13] !== h || u[14] !== d) {
|
|
22
27
|
let e;
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
return
|
|
26
|
-
isDocumentActive: o,
|
|
27
|
-
isWorkflowActive: v,
|
|
28
|
-
status: u.status,
|
|
29
|
-
place: u.place,
|
|
30
|
-
documentPlace: e.place,
|
|
31
|
-
availableTransitions: u.availableTransitions
|
|
32
|
-
}), /* @__PURE__ */ jsx(DocumentItem_default, {
|
|
28
|
+
u[16] !== f || u[17] !== v || u[18] !== p.length || u[19] !== x || u[20] !== h || u[21] !== d ? (e = (e, o) => {
|
|
29
|
+
let s = v.get(e.documentName), l = e.place === f.place || !!s?.meta?.enableAtPlaces?.includes(f.place);
|
|
30
|
+
return /* @__PURE__ */ jsx(DocumentItem_default, {
|
|
33
31
|
document: e,
|
|
34
|
-
workflow:
|
|
35
|
-
parentWorkflow:
|
|
36
|
-
isActive:
|
|
37
|
-
isLastItem:
|
|
38
|
-
settings:
|
|
39
|
-
}, e
|
|
40
|
-
},
|
|
41
|
-
} else
|
|
42
|
-
let
|
|
43
|
-
return
|
|
32
|
+
workflow: f,
|
|
33
|
+
parentWorkflow: d,
|
|
34
|
+
isActive: x && l,
|
|
35
|
+
isLastItem: o === p.length - 1,
|
|
36
|
+
settings: h
|
|
37
|
+
}, getDocumentKey(e));
|
|
38
|
+
}, u[16] = f, u[17] = v, u[18] = p.length, u[19] = x, u[20] = h, u[21] = d, u[22] = e) : e = u[22], S = p.map(e), u[9] = f, u[10] = v, u[11] = p, u[12] = x, u[13] = h, u[14] = d, u[15] = S;
|
|
39
|
+
} else S = u[15];
|
|
40
|
+
let C;
|
|
41
|
+
return u[23] === S ? C = u[24] : (C = /* @__PURE__ */ jsx("div", {
|
|
44
42
|
className: "flex flex-col gap-3",
|
|
45
|
-
children:
|
|
46
|
-
}),
|
|
43
|
+
children: S
|
|
44
|
+
}), u[23] = S, u[24] = C), C;
|
|
47
45
|
};
|
|
48
46
|
export { DocumentList_default as default };
|
|
@@ -5,59 +5,112 @@ import PromptDetails_default from "../document-details/PromptDetails.js";
|
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var PILL_LABELS = {
|
|
9
|
+
document: "Document",
|
|
10
|
+
prompt: "LLM prompt"
|
|
11
|
+
};
|
|
12
|
+
function formatPillLabel(e) {
|
|
13
|
+
return PILL_LABELS[e] ? PILL_LABELS[e] : e.replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase());
|
|
14
|
+
}
|
|
15
|
+
function isDocumentDebugPayload(e) {
|
|
16
|
+
return typeof e == "object" && !!e && "data" in e && "workflowContext" in e;
|
|
17
|
+
}
|
|
18
|
+
var StructuredMetadataRenderer = (e) => {
|
|
19
|
+
let l = c(2), { data: u } = e, d;
|
|
20
|
+
return l[0] === u ? d = l[1] : (d = /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "min-w-0 space-y-2",
|
|
22
|
+
children: Object.entries(u).map(_temp)
|
|
23
|
+
}), l[0] = u, l[1] = d), d;
|
|
24
|
+
}, DefaultMetadataRenderer = (e) => {
|
|
25
|
+
let l = c(6), { data: u } = e;
|
|
26
|
+
if (u && typeof u == "object" && !Array.isArray(u)) {
|
|
27
|
+
let e = u, d;
|
|
28
|
+
return l[0] === e ? d = l[1] : (d = /* @__PURE__ */ jsx(StructuredMetadataRenderer, { data: e }), l[0] = e, l[1] = d), d;
|
|
29
|
+
}
|
|
11
30
|
let d;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
31
|
+
l[2] === u ? d = l[3] : (d = JSON.stringify(u, null, 2), l[2] = u, l[3] = d);
|
|
32
|
+
let f;
|
|
33
|
+
return l[4] === d ? f = l[5] : (f = /* @__PURE__ */ jsx("pre", {
|
|
34
|
+
className: "bg-muted max-h-96 min-w-0 max-w-full overflow-x-auto overflow-y-auto rounded-md p-4 font-mono text-xs whitespace-pre-wrap",
|
|
35
|
+
children: d
|
|
36
|
+
}), l[4] = d, l[5] = f), f;
|
|
16
37
|
}, metadataRenderers = {
|
|
17
38
|
prompt: (e) => /* @__PURE__ */ jsx(PromptDetails_default, { promptData: e }),
|
|
18
|
-
document: (e) => /* @__PURE__ */ jsx(DocumentDetails_default, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, l)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
document: (e) => isDocumentDebugPayload(e) ? /* @__PURE__ */ jsx(DocumentDetails_default, {
|
|
40
|
+
data: e.data,
|
|
41
|
+
content: e.content,
|
|
42
|
+
workflowContext: e.workflowContext
|
|
43
|
+
}) : /* @__PURE__ */ jsx(DefaultMetadataRenderer, { data: e })
|
|
44
|
+
}, DocumentMetadataPills_default = (p) => {
|
|
45
|
+
let m = c(29), { metaData: h } = p, [g, _] = useState(null), [v, y] = useState(null), [b, x] = useState(!1), S, C, w, T;
|
|
46
|
+
if (m[0] !== h || m[1] !== g) {
|
|
47
|
+
T = Symbol.for("react.early_return_sentinel");
|
|
48
|
+
bb0: {
|
|
49
|
+
let l = Object.entries(h);
|
|
50
|
+
if (l.length === 0) {
|
|
51
|
+
T = null;
|
|
52
|
+
break bb0;
|
|
53
|
+
}
|
|
54
|
+
let u = (e, l) => {
|
|
55
|
+
_(e), y(l), x(!0);
|
|
56
|
+
}, d;
|
|
57
|
+
m[6] === g ? d = m[7] : (d = (e) => e && metadataRenderers[e] ? metadataRenderers[e](g) : /* @__PURE__ */ jsx(DefaultMetadataRenderer, { data: g }), m[6] = g, m[7] = d), S = d, C = "mb-8 flex flex-wrap items-center gap-2", w = l.map((l) => {
|
|
58
|
+
let [d, f] = l;
|
|
59
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
60
|
+
variant: "outline",
|
|
61
|
+
className: "hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-full px-3 py-1 transition-colors",
|
|
62
|
+
onClick: () => u(f, d),
|
|
63
|
+
children: formatPillLabel(d)
|
|
64
|
+
}, d);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
m[0] = h, m[1] = g, m[2] = S, m[3] = C, m[4] = w, m[5] = T;
|
|
68
|
+
} else S = m[2], C = m[3], w = m[4], T = m[5];
|
|
69
|
+
if (T !== Symbol.for("react.early_return_sentinel")) return T;
|
|
39
70
|
let E;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className: "max-h-3/4 max-w-2xl overflow-auto",
|
|
45
|
-
children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, {
|
|
46
|
-
className: "flex items-center gap-2",
|
|
47
|
-
children: [_, /* @__PURE__ */ jsx("span", {
|
|
48
|
-
className: "text-muted-foreground text-xs font-normal",
|
|
49
|
-
children: "Metadata"
|
|
50
|
-
})]
|
|
51
|
-
}) }), /* @__PURE__ */ jsx("div", {
|
|
52
|
-
className: "mt-4",
|
|
53
|
-
children: w(_)
|
|
54
|
-
})]
|
|
55
|
-
})
|
|
56
|
-
}), p[5] = w, p[6] = y, p[7] = h, p[8] = _, p[9] = E) : E = p[9];
|
|
71
|
+
m[8] !== C || m[9] !== w ? (E = /* @__PURE__ */ jsx("div", {
|
|
72
|
+
className: C,
|
|
73
|
+
children: w
|
|
74
|
+
}), m[8] = C, m[9] = w, m[10] = E) : E = m[10];
|
|
57
75
|
let D;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
m[11] === v ? D = m[12] : (D = v ? formatPillLabel(v) : "Debug", m[11] = v, m[12] = D);
|
|
77
|
+
let O;
|
|
78
|
+
m[13] === D ? O = m[14] : (O = /* @__PURE__ */ jsx(DialogHeader, {
|
|
79
|
+
className: "shrink-0",
|
|
80
|
+
children: /* @__PURE__ */ jsx(DialogTitle, { children: D })
|
|
81
|
+
}), m[13] = D, m[14] = O);
|
|
82
|
+
let k;
|
|
83
|
+
m[15] !== S || m[16] !== v ? (k = v && S(v), m[15] = S, m[16] = v, m[17] = k) : k = m[17];
|
|
84
|
+
let A;
|
|
85
|
+
m[18] === k ? A = m[19] : (A = /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: "min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto",
|
|
87
|
+
children: k
|
|
88
|
+
}), m[18] = k, m[19] = A);
|
|
89
|
+
let j;
|
|
90
|
+
m[20] !== O || m[21] !== A ? (j = /* @__PURE__ */ jsxs(DialogContent, {
|
|
91
|
+
className: "flex max-h-[85vh] w-full max-w-2xl flex-col overflow-hidden",
|
|
92
|
+
children: [O, A]
|
|
93
|
+
}), m[20] = O, m[21] = A, m[22] = j) : j = m[22];
|
|
94
|
+
let M;
|
|
95
|
+
m[23] !== b || m[24] !== j ? (M = /* @__PURE__ */ jsx(Dialog, {
|
|
96
|
+
open: b,
|
|
97
|
+
onOpenChange: x,
|
|
98
|
+
children: j
|
|
99
|
+
}), m[23] = b, m[24] = j, m[25] = M) : M = m[25];
|
|
100
|
+
let N;
|
|
101
|
+
return m[26] !== M || m[27] !== E ? (N = /* @__PURE__ */ jsxs("div", { children: [E, M] }), m[26] = M, m[27] = E, m[28] = N) : N = m[28], N;
|
|
62
102
|
};
|
|
103
|
+
function _temp(e) {
|
|
104
|
+
let [l, u] = e;
|
|
105
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: "grid min-w-0 grid-cols-[7.5rem_1fr] gap-x-3 text-sm",
|
|
107
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
108
|
+
className: "text-muted-foreground font-medium",
|
|
109
|
+
children: formatPillLabel(l)
|
|
110
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: "min-w-0 overflow-x-auto font-mono text-xs wrap-break-word",
|
|
112
|
+
children: typeof u == "object" ? JSON.stringify(u, null, 2) : String(u)
|
|
113
|
+
})]
|
|
114
|
+
}, l);
|
|
115
|
+
}
|
|
63
116
|
export { DocumentMetadataPills_default as default };
|