@loopstack/loopstack-studio 0.29.4 → 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.
Files changed (114) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -1
  2. package/dist/api/config.js +5 -4
  3. package/dist/api/environments.js +5 -1
  4. package/dist/api/processor.js +4 -1
  5. package/dist/app/EnvironmentEmbedRoot.js +22 -30
  6. package/dist/components/ai-elements/code-block.js +4 -4
  7. package/dist/components/dynamic-form/CodeContent.js +1 -1
  8. package/dist/components/dynamic-form/Form.js +31 -51
  9. package/dist/components/dynamic-form/FormBody.js +1 -1
  10. package/dist/components/motion/FadeIn.js +72 -0
  11. package/dist/components/motion/StreamingText.js +49 -0
  12. package/dist/components/ui/accordion.js +2 -2
  13. package/dist/components/ui-widgets/UiWidget.js +11 -10
  14. package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
  15. package/dist/events/sse-client-events.js +7 -1
  16. package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
  17. package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
  18. package/dist/features/documents/DocumentRenderer.js +18 -17
  19. package/dist/features/documents/components/DocumentItem.js +42 -20
  20. package/dist/features/documents/components/DocumentList.js +34 -36
  21. package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
  22. package/dist/features/documents/document-details/DocumentDetails.js +577 -377
  23. package/dist/features/documents/document-details/PromptDetails.js +118 -130
  24. package/dist/features/documents/document-details/document-debug-utils.js +100 -0
  25. package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
  26. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
  27. package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
  28. package/dist/features/documents/renderers/LlmMessage.js +52 -47
  29. package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
  30. package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
  31. package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
  32. package/dist/features/feature-registry/available-features.js +12 -0
  33. package/dist/features/feature-registry/index.js +2 -1
  34. package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
  35. package/dist/features/git/components/GitBranchBadge.js +31 -0
  36. package/dist/features/git/components/GitCommitList.js +46 -0
  37. package/dist/features/git/components/GitRemoteStatus.js +84 -0
  38. package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
  39. package/dist/features/git/git-feature.js +12 -0
  40. package/dist/features/git/hooks/useGit.js +78 -0
  41. package/dist/features/git/index.js +1 -0
  42. package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
  43. package/dist/features/runs/Runs.js +4 -4
  44. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  45. package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
  46. package/dist/features/workbench/Workbench.js +25 -33
  47. package/dist/features/workbench/WorkflowItem.js +9 -9
  48. package/dist/features/workbench/WorkflowList.js +61 -62
  49. package/dist/features/workbench/components/NewRunDialog.js +237 -209
  50. package/dist/features/workbench/components/RecentRunItem.js +3 -3
  51. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
  52. package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
  53. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  54. package/dist/features/workbench/components/WorkflowForms.js +11 -10
  55. package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
  56. package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
  57. package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
  58. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
  59. package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
  60. package/dist/features/workbench/index.js +2 -2
  61. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
  62. package/dist/features/workspaces/Workspaces.js +134 -125
  63. package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
  64. package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
  65. package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
  66. package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
  67. package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
  68. package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
  69. package/dist/hooks/index.js +3 -2
  70. package/dist/hooks/query-keys.js +43 -30
  71. package/dist/hooks/useConfig.js +28 -22
  72. package/dist/hooks/useEnvironments.js +27 -2
  73. package/dist/hooks/useProcessor.js +14 -1
  74. package/dist/hooks/useWorkflows.js +4 -4
  75. package/dist/index.d.ts +116 -15
  76. package/dist/index.js +9 -8
  77. package/dist/node_modules/d3/src/index.js +13 -13
  78. package/dist/node_modules/d3-scale/src/continuous.js +16 -16
  79. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
  80. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
  81. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
  82. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
  83. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
  84. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
  85. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
  104. package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
  105. package/dist/node_modules/motion/dist/es/react.js +9 -2
  106. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  107. package/dist/pages/DebugWorkflowsPage.js +76 -106
  108. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  109. package/dist/pages/PreviewWorkbenchPage.js +6 -6
  110. package/dist/pages/WorkbenchPage.js +43 -47
  111. package/dist/pages/WorkflowDebugPage.js +6 -12
  112. package/dist/pages/WorkspacePage.js +40 -66
  113. package/dist/pages/WorkspaceRunsPage.js +24 -31
  114. package/package.json +2 -2
@@ -1,425 +1,625 @@
1
+ import { useDocumentConfigs } from "../../../hooks/useConfig.js";
1
2
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../../../components/ui/accordion.js";
3
+ import { Button } from "../../../components/ui/button.js";
2
4
  import { Badge } from "../../../components/ui/badge.js";
3
- import { Card, CardContent } from "../../../components/ui/card.js";
5
+ import { CodeBlock } from "../../../components/ai-elements/code-block.js";
6
+ import { extractApiResponseInfo, formatDurationMs, formatNumber, formatRelativeTime, summarizeDocumentContent } from "./document-debug-utils.js";
4
7
  import { c } from "react/compiler-runtime";
5
- import React from "react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { Code, FileText, Tag } from "lucide-react";
8
+ import React, { useState } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ import { AlertCircle, CheckIcon, CopyIcon, Cpu, FileJson, Settings2, Timer, Workflow } from "lucide-react";
8
11
  var formatDate = (e) => {
9
12
  try {
10
13
  return new Date(e).toLocaleString();
11
14
  } catch {
12
- return e;
15
+ return String(e);
13
16
  }
14
- }, DocumentDetails_default = (he) => {
15
- let n = c(101), { data: r } = he;
16
- if (!r) return null;
17
+ }, DetailRow = (e) => {
18
+ let t = c(7), { label: n, children: r } = e, i;
19
+ t[0] === n ? i = t[1] : (i = /* @__PURE__ */ jsx("span", {
20
+ className: "text-muted-foreground font-medium",
21
+ children: n
22
+ }), t[0] = n, t[1] = i);
23
+ let a;
24
+ t[2] === r ? a = t[3] : (a = /* @__PURE__ */ jsx("span", {
25
+ className: "min-w-0 wrap-break-word",
26
+ children: r
27
+ }), t[2] = r, t[3] = a);
28
+ let o;
29
+ return t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ jsxs("div", {
30
+ className: "grid min-w-0 grid-cols-[7.5rem_1fr] gap-x-3 gap-y-0.5 text-sm",
31
+ children: [i, a]
32
+ }), t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
33
+ }, CopyableId = (e) => {
34
+ let t = c(12), { value: n } = e, [r, i] = useState(!1), o;
35
+ t[0] === n ? o = t[1] : (o = async () => {
36
+ await navigator.clipboard.writeText(n), i(!0), setTimeout(() => i(!1), 1500);
37
+ }, t[0] = n, t[1] = o);
38
+ let s = o, l;
39
+ t[2] === n ? l = t[3] : (l = /* @__PURE__ */ jsx("code", {
40
+ className: "bg-muted min-w-0 flex-1 truncate rounded px-1.5 py-0.5 font-mono text-xs",
41
+ children: n
42
+ }), t[2] = n, t[3] = l);
43
+ let u;
44
+ t[4] === r ? u = t[5] : (u = jsx(r ? CheckIcon : CopyIcon, { className: "size-3" }), t[4] = r, t[5] = u);
45
+ let d;
46
+ t[6] !== s || t[7] !== u ? (d = /* @__PURE__ */ jsx(Button, {
47
+ type: "button",
48
+ variant: "ghost",
49
+ size: "icon",
50
+ className: "size-6 shrink-0",
51
+ onClick: s,
52
+ children: u
53
+ }), t[6] = s, t[7] = u, t[8] = d) : d = t[8];
54
+ let f;
55
+ return t[9] !== l || t[10] !== d ? (f = /* @__PURE__ */ jsxs("span", {
56
+ className: "flex w-full min-w-0 items-center gap-1.5",
57
+ children: [l, d]
58
+ }), t[9] = l, t[10] = d, t[11] = f) : f = t[11], f;
59
+ }, BadgeList = (e) => {
60
+ let t = c(6), { items: n, emptyLabel: r } = e, i = r === void 0 ? "None" : r;
61
+ if (!n?.length) {
62
+ let e;
63
+ return t[0] === i ? e = t[1] : (e = /* @__PURE__ */ jsx("span", {
64
+ className: "text-muted-foreground",
65
+ children: i
66
+ }), t[0] = i, t[1] = e), e;
67
+ }
68
+ let a;
69
+ t[2] === n ? a = t[3] : (a = n.map(_temp), t[2] = n, t[3] = a);
70
+ let o;
71
+ return t[4] === a ? o = t[5] : (o = /* @__PURE__ */ jsx("span", {
72
+ className: "flex flex-wrap gap-1",
73
+ children: a
74
+ }), t[4] = a, t[5] = o), o;
75
+ }, ContentSummarySection = (e) => {
76
+ let t = c(25), { summary: n } = e, r;
77
+ t[0] === n.kind ? r = t[1] : (r = /* @__PURE__ */ jsx(DetailRow, {
78
+ label: "Type",
79
+ children: n.kind
80
+ }), t[0] = n.kind, t[1] = r);
17
81
  let i;
18
- n[0] === r.schema ? i = n[1] : (i = typeof r.schema == "string" ? r.schema : JSON.stringify(r.schema, null, 2), n[0] = r.schema, n[1] = i);
19
- let ge = i, a;
20
- n[2] === r.content ? a = n[3] : (a = typeof r.content == "string" ? r.content : JSON.stringify(r.content, null, 2), n[2] = r.content, n[3] = a);
21
- let _e = a, o;
22
- n[4] === Symbol.for("react.memo_cache_sentinel") ? (o = [
23
- "document-info",
24
- "content",
25
- "schema"
26
- ], n[4] = o) : o = n[4];
82
+ t[2] === n.role ? i = t[3] : (i = n.role && /* @__PURE__ */ jsx(DetailRow, {
83
+ label: "Role",
84
+ children: n.role
85
+ }), t[2] = n.role, t[3] = i);
86
+ let a;
87
+ t[4] === n.messageId ? a = t[5] : (a = n.messageId && /* @__PURE__ */ jsx(DetailRow, {
88
+ label: "Message ID",
89
+ children: /* @__PURE__ */ jsx(CopyableId, { value: n.messageId })
90
+ }), t[4] = n.messageId, t[5] = a);
91
+ let o;
92
+ t[6] === n.stopReason ? o = t[7] : (o = n.stopReason && /* @__PURE__ */ jsx(DetailRow, {
93
+ label: "Stop reason",
94
+ children: n.stopReason
95
+ }), t[6] = n.stopReason, t[7] = o);
27
96
  let s;
28
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ jsx(AccordionTrigger, {
29
- className: "text-base font-semibold",
30
- children: /* @__PURE__ */ jsxs("div", {
31
- className: "flex items-center gap-2",
32
- children: [/* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" }), "Document Information"]
33
- })
34
- }), n[5] = s) : s = n[5];
97
+ t[8] === n.charCount ? s = t[9] : (s = n.charCount != null && /* @__PURE__ */ jsxs(DetailRow, {
98
+ label: "Size",
99
+ children: [formatNumber(n.charCount), " chars"]
100
+ }), t[8] = n.charCount, t[9] = s);
35
101
  let l;
36
- n[6] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsx("span", {
37
- className: "font-medium",
38
- children: "ID:"
39
- }), n[6] = l) : l = n[6];
102
+ t[10] === n.itemCount ? l = t[11] : (l = n.itemCount != null && /* @__PURE__ */ jsx(DetailRow, {
103
+ label: "Items",
104
+ children: n.itemCount
105
+ }), t[10] = n.itemCount, t[11] = l);
40
106
  let u;
41
- n[7] === r.id ? u = n[8] : (u = /* @__PURE__ */ jsxs("div", {
42
- className: "text-sm",
43
- children: [
44
- l,
45
- " ",
46
- r.id
47
- ]
48
- }), n[7] = r.id, n[8] = u);
49
- let d;
50
- n[9] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx("span", {
51
- className: "font-medium",
52
- children: "Name:"
53
- }), n[9] = d) : d = n[9];
107
+ t[12] === n.topLevelKeys ? u = t[13] : (u = n.topLevelKeys && n.topLevelKeys.length > 0 && /* @__PURE__ */ jsx(DetailRow, {
108
+ label: "Fields",
109
+ children: /* @__PURE__ */ jsx(BadgeList, {
110
+ items: n.topLevelKeys,
111
+ emptyLabel: "—"
112
+ })
113
+ }), t[12] = n.topLevelKeys, t[13] = u);
54
114
  let f;
55
- n[10] === r.name ? f = n[11] : (f = /* @__PURE__ */ jsxs("div", {
56
- className: "text-sm",
57
- children: [
58
- d,
59
- " ",
60
- r.name
61
- ]
62
- }), n[10] = r.name, n[11] = f);
115
+ t[14] === n.blocks ? f = t[15] : (f = n.blocks && n.blocks.length > 0 && /* @__PURE__ */ jsx(DetailRow, {
116
+ label: "Blocks",
117
+ children: /* @__PURE__ */ jsx("span", {
118
+ className: "flex flex-col gap-1",
119
+ children: n.blocks.map(_temp3)
120
+ })
121
+ }), t[14] = n.blocks, t[15] = f);
63
122
  let p;
64
- n[12] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsx("span", {
65
- className: "font-medium",
66
- children: "Version:"
67
- }), n[12] = p) : p = n[12];
68
- let m;
69
- n[13] === r.version ? m = n[14] : (m = /* @__PURE__ */ jsxs("div", {
70
- className: "text-sm",
123
+ return t[16] !== r || t[17] !== i || t[18] !== a || t[19] !== o || t[20] !== s || t[21] !== l || t[22] !== u || t[23] !== f ? (p = /* @__PURE__ */ jsxs("div", {
124
+ className: "space-y-2 pb-1",
71
125
  children: [
72
- p,
73
- " ",
74
- r.version
126
+ r,
127
+ i,
128
+ a,
129
+ o,
130
+ s,
131
+ l,
132
+ u,
133
+ f
75
134
  ]
76
- }), n[13] = r.version, n[14] = m);
135
+ }), t[16] = r, t[17] = i, t[18] = a, t[19] = o, t[20] = s, t[21] = l, t[22] = u, t[23] = f, t[24] = p) : p = t[24], p;
136
+ }, LlmMetadataSection = (e) => {
137
+ let a = c(21), { provider: o, apiInfo: l, rawResponse: u } = e, f;
138
+ a[0] === o ? f = a[1] : (f = o && /* @__PURE__ */ jsx(DetailRow, {
139
+ label: "Provider",
140
+ children: o
141
+ }), a[0] = o, a[1] = f);
142
+ let p;
143
+ a[2] === l.model ? p = a[3] : (p = l.model && /* @__PURE__ */ jsx(DetailRow, {
144
+ label: "Model",
145
+ children: l.model
146
+ }), a[2] = l.model, a[3] = p);
77
147
  let h;
78
- n[15] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx("span", {
79
- className: "font-medium",
80
- children: "Index:"
81
- }), n[15] = h) : h = n[15];
148
+ a[4] === l.id ? h = a[5] : (h = l.id && /* @__PURE__ */ jsx(DetailRow, {
149
+ label: "Response ID",
150
+ children: /* @__PURE__ */ jsx(CopyableId, { value: l.id })
151
+ }), a[4] = l.id, a[5] = h);
82
152
  let g;
83
- n[16] === r.index ? g = n[17] : (g = /* @__PURE__ */ jsxs("div", {
84
- className: "text-sm",
153
+ a[6] === l.stopReason ? g = a[7] : (g = l.stopReason && /* @__PURE__ */ jsx(DetailRow, {
154
+ label: "Finish reason",
155
+ children: l.stopReason
156
+ }), a[6] = l.stopReason, a[7] = g);
157
+ let v;
158
+ a[8] === l.usage ? v = a[9] : (v = l.usage && /* @__PURE__ */ jsxs(Fragment$1, { children: [
159
+ /* @__PURE__ */ jsx(DetailRow, {
160
+ label: "Input tokens",
161
+ children: formatNumber(l.usage.input)
162
+ }),
163
+ /* @__PURE__ */ jsx(DetailRow, {
164
+ label: "Output tokens",
165
+ children: formatNumber(l.usage.output)
166
+ }),
167
+ l.usage.cacheRead != null && l.usage.cacheRead > 0 && /* @__PURE__ */ jsx(DetailRow, {
168
+ label: "Cache read",
169
+ children: formatNumber(l.usage.cacheRead)
170
+ }),
171
+ l.usage.cacheWrite != null && l.usage.cacheWrite > 0 && /* @__PURE__ */ jsx(DetailRow, {
172
+ label: "Cache write",
173
+ children: formatNumber(l.usage.cacheWrite)
174
+ }),
175
+ l.usage.reasoning != null && l.usage.reasoning > 0 && /* @__PURE__ */ jsx(DetailRow, {
176
+ label: "Reasoning",
177
+ children: formatNumber(l.usage.reasoning)
178
+ })
179
+ ] }), a[8] = l.usage, a[9] = v);
180
+ let y;
181
+ a[10] !== f || a[11] !== p || a[12] !== h || a[13] !== g || a[14] !== v ? (y = /* @__PURE__ */ jsxs("div", {
182
+ className: "space-y-2 pb-1",
85
183
  children: [
184
+ f,
185
+ p,
86
186
  h,
87
- " ",
88
- r.index
187
+ g,
188
+ v
89
189
  ]
90
- }), n[16] = r.index, n[17] = g);
91
- let _;
92
- n[18] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("div", {
93
- className: "mb-2 text-sm font-medium",
94
- children: "Labels:"
95
- }), n[18] = _) : _ = n[18];
96
- let v;
97
- n[19] === r.labels ? v = n[20] : (v = r.labels && r.labels.length > 0 ? r.labels.map(_temp) : /* @__PURE__ */ jsx("span", {
98
- className: "text-muted-foreground text-sm",
99
- children: "None"
100
- }), n[19] = r.labels, n[20] = v);
101
- let y;
102
- n[21] === v ? y = n[22] : (y = /* @__PURE__ */ jsxs("div", {
103
- className: "pt-2",
104
- children: [_, /* @__PURE__ */ jsx("div", {
105
- className: "flex flex-wrap gap-2",
106
- children: v
107
- })]
108
- }), n[21] = v, n[22] = y);
190
+ }), a[10] = f, a[11] = p, a[12] = h, a[13] = g, a[14] = v, a[15] = y) : y = a[15];
109
191
  let b;
110
- n[23] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx("div", {
111
- className: "mb-2 text-sm font-medium",
112
- children: "Tags:"
113
- }), n[23] = b) : b = n[23];
114
- let x;
115
- n[24] === r.tags ? x = n[25] : (x = r.tags && r.tags.length > 0 ? r.tags.map(_temp2) : /* @__PURE__ */ jsx("span", {
116
- className: "text-muted-foreground text-sm",
117
- children: "None"
118
- }), n[24] = r.tags, n[25] = x);
119
- let S;
120
- n[26] === x ? S = n[27] : (S = /* @__PURE__ */ jsxs("div", {
121
- className: "pt-2",
122
- children: [b, /* @__PURE__ */ jsx("div", {
192
+ a[16] === u ? b = a[17] : (b = u != null && /* @__PURE__ */ jsx(Accordion, {
193
+ type: "single",
194
+ collapsible: !0,
195
+ className: "min-w-0",
196
+ children: /* @__PURE__ */ jsxs(AccordionItem, {
197
+ value: "raw-response",
198
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
199
+ className: "py-2 text-sm font-medium",
200
+ children: "Raw API response"
201
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(CodeBlock, {
202
+ code: JSON.stringify(u, null, 2),
203
+ language: "json",
204
+ className: "max-h-48 min-w-0 max-w-full"
205
+ }) })]
206
+ })
207
+ }), a[16] = u, a[17] = b);
208
+ let pe;
209
+ return a[18] !== y || a[19] !== b ? (pe = /* @__PURE__ */ jsxs("div", {
210
+ className: "space-y-3",
211
+ children: [y, b]
212
+ }), a[18] = y, a[19] = b, a[20] = pe) : pe = a[20], pe;
213
+ }, DocumentDetails_default = (a) => {
214
+ let d = c(129), { data: h, content: g, workflowContext: _ } = a, y = useDocumentConfigs();
215
+ if (!h) return null;
216
+ let b, x, S, C, w, T, E, D, O, k, A, j, M, N;
217
+ if (d[0] !== g || d[1] !== h.createdAt || d[2] !== h.documentName || d[3] !== h.index || d[4] !== h.isInvalidated || d[5] !== h.labels || d[6] !== h.meta || d[7] !== h.place || d[8] !== h.tags || d[9] !== h.transition || d[10] !== h.updatedAt || d[11] !== h.validationError || d[12] !== y || d[13] !== _) {
218
+ let e = y.get(h.documentName), a = e?.meta, m = h.meta ?? {}, me = e?.ui?.widgets?.[0]?.widget ?? "form", P;
219
+ d[28] === g ? P = d[29] : (P = summarizeDocumentContent(g), d[28] = g, d[29] = P);
220
+ let F = P, I = extractApiResponseInfo(m.response), L = !!h.validationError, R = e?.schema && Object.keys(e.schema).length > 0, z = e?.ui && Object.keys(e.ui).length > 0, B = !!(m.provider || m.response || I.model || I.usage), V = F.kind !== "null", H, he;
221
+ if (d[30] !== h.createdAt || d[31] !== h.updatedAt) {
222
+ let e = new Date(h.createdAt);
223
+ d[34] === h.updatedAt ? H = d[35] : (H = new Date(h.updatedAt).getTime(), d[34] = h.updatedAt, d[35] = H), he = e.getTime(), d[30] = h.createdAt, d[31] = h.updatedAt, d[32] = H, d[33] = he;
224
+ } else H = d[32], he = d[33];
225
+ let ge = H - he, _e = Object.entries(m).filter(_temp4), U;
226
+ d[36] !== V || d[37] !== B || d[38] !== L || d[39] !== _ ? (U = ["overview", "context"], _ && U.push("workflow"), V && U.push("content-summary"), B && U.push("llm"), L && U.push("validation"), d[36] = V, d[37] = B, d[38] = L, d[39] = _, d[40] = U) : U = d[40], w = "min-w-0 space-y-3";
227
+ let ve;
228
+ d[41] === _?.isActive ? ve = d[42] : (ve = _?.isActive && /* @__PURE__ */ jsx(Badge, {
229
+ variant: "default",
230
+ className: "text-xs",
231
+ children: "Active"
232
+ }), d[41] = _?.isActive, d[42] = ve);
233
+ let ye;
234
+ d[43] === h.isInvalidated ? ye = d[44] : (ye = h.isInvalidated && /* @__PURE__ */ jsx(Badge, {
235
+ variant: "destructive",
236
+ className: "text-xs",
237
+ children: "Invalidated"
238
+ }), d[43] = h.isInvalidated, d[44] = ye);
239
+ let be;
240
+ d[45] === L ? be = d[46] : (be = L && /* @__PURE__ */ jsxs(Badge, {
241
+ variant: "destructive",
242
+ className: "gap-1 text-xs",
243
+ children: [/* @__PURE__ */ jsx(AlertCircle, { className: "size-3" }), "Validation error"]
244
+ }), d[45] = L, d[46] = be), T = /* @__PURE__ */ jsxs("div", {
123
245
  className: "flex flex-wrap gap-2",
124
- children: x
125
- })]
126
- }), n[26] = x, n[27] = S);
127
- let C;
128
- n[28] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx("span", {
129
- className: "font-medium",
130
- children: "Created:"
131
- }), n[28] = C) : C = n[28];
132
- let w;
133
- n[29] === r.createdAt ? w = n[30] : (w = formatDate(r.createdAt), n[29] = r.createdAt, n[30] = w);
134
- let T;
135
- n[31] === w ? T = n[32] : (T = /* @__PURE__ */ jsxs("div", {
136
- className: "text-sm",
137
- children: [
138
- C,
139
- " ",
140
- w
141
- ]
142
- }), n[31] = w, n[32] = T);
143
- let E;
144
- n[33] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx("span", {
145
- className: "font-medium",
146
- children: "Updated:"
147
- }), n[33] = E) : E = n[33];
148
- let D;
149
- n[34] === r.updatedAt ? D = n[35] : (D = formatDate(r.updatedAt), n[34] = r.updatedAt, n[35] = D);
150
- let O;
151
- n[36] === D ? O = n[37] : (O = /* @__PURE__ */ jsxs("div", {
152
- className: "text-sm",
153
- children: [
154
- E,
155
- " ",
156
- D
157
- ]
158
- }), n[36] = D, n[37] = O);
159
- let k;
160
- n[38] !== T || n[39] !== O ? (k = /* @__PURE__ */ jsxs("div", {
161
- className: "space-y-1 pt-2",
162
- children: [T, O]
163
- }), n[38] = T, n[39] = O, n[40] = k) : k = n[40];
164
- let A;
165
- n[41] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx("span", {
166
- className: "font-medium",
167
- children: "Workspace ID:"
168
- }), n[41] = A) : A = n[41];
169
- let j;
170
- n[42] === r.workspaceId ? j = n[43] : (j = /* @__PURE__ */ jsxs("div", {
171
- className: "text-sm",
172
- children: [
173
- A,
174
- " ",
175
- r.workspaceId
176
- ]
177
- }), n[42] = r.workspaceId, n[43] = j);
178
- let M;
179
- n[44] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx("span", {
180
- className: "font-medium",
181
- children: "Workflow ID:"
182
- }), n[44] = M) : M = n[44];
183
- let N;
184
- n[45] === r.workflowId ? N = n[46] : (N = /* @__PURE__ */ jsxs("div", {
185
- className: "text-sm",
186
- children: [
187
- M,
188
- " ",
189
- r.workflowId
190
- ]
191
- }), n[45] = r.workflowId, n[46] = N);
246
+ children: [
247
+ ve,
248
+ m.streaming && /* @__PURE__ */ jsx(Badge, {
249
+ variant: "secondary",
250
+ className: "text-xs",
251
+ children: "Streaming"
252
+ }),
253
+ ye,
254
+ be,
255
+ a?.level && /* @__PURE__ */ jsx(Badge, {
256
+ variant: "outline",
257
+ className: "text-xs capitalize",
258
+ children: a.level
259
+ }),
260
+ a?.hidden && /* @__PURE__ */ jsx(Badge, {
261
+ variant: "outline",
262
+ className: "text-xs",
263
+ children: "Hidden"
264
+ }),
265
+ m.invalidate && /* @__PURE__ */ jsx(Badge, {
266
+ variant: "outline",
267
+ className: "text-xs",
268
+ children: "Invalidates on update"
269
+ })
270
+ ]
271
+ }), b = Accordion, x = "multiple", E = U, D = "min-w-0 space-y-1";
272
+ let xe;
273
+ d[47] === Symbol.for("react.memo_cache_sentinel") ? (xe = /* @__PURE__ */ jsx(AccordionTrigger, {
274
+ className: "py-3 text-sm font-semibold",
275
+ children: /* @__PURE__ */ jsxs("span", {
276
+ className: "flex items-center gap-2",
277
+ children: [/* @__PURE__ */ jsx(Workflow, { className: "size-4" }), "Overview"]
278
+ })
279
+ }), d[47] = xe) : xe = d[47];
280
+ let Se;
281
+ d[48] === h.documentName ? Se = d[49] : (Se = /* @__PURE__ */ jsx(DetailRow, {
282
+ label: "Document name",
283
+ children: h.documentName
284
+ }), d[48] = h.documentName, d[49] = Se);
285
+ let Ce;
286
+ d[50] === h.index ? Ce = d[51] : (Ce = /* @__PURE__ */ jsx(DetailRow, {
287
+ label: "Index",
288
+ children: h.index
289
+ }), d[50] = h.index, d[51] = Ce);
290
+ let we = /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
291
+ className: "space-y-2 pb-1",
292
+ children: [
293
+ Se,
294
+ /* @__PURE__ */ jsx(DetailRow, {
295
+ label: "Widget",
296
+ children: /* @__PURE__ */ jsx(Badge, {
297
+ variant: "secondary",
298
+ className: "font-mono text-xs",
299
+ children: me
300
+ })
301
+ }),
302
+ Ce,
303
+ a?.mimeType && /* @__PURE__ */ jsx(DetailRow, {
304
+ label: "MIME",
305
+ children: a.mimeType
306
+ })
307
+ ]
308
+ }) });
309
+ d[52] === we ? O = d[53] : (O = /* @__PURE__ */ jsxs(AccordionItem, {
310
+ value: "overview",
311
+ children: [xe, we]
312
+ }), d[52] = we, d[53] = O), d[54] !== h.place || d[55] !== _ ? (k = _ && /* @__PURE__ */ jsxs(AccordionItem, {
313
+ value: "workflow",
314
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
315
+ className: "py-3 text-sm font-semibold",
316
+ children: "Workflow"
317
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
318
+ className: "space-y-2 pb-1",
319
+ children: [
320
+ /* @__PURE__ */ jsx(DetailRow, {
321
+ label: "Title",
322
+ children: _.title
323
+ }),
324
+ /* @__PURE__ */ jsx(DetailRow, {
325
+ label: "Workflow",
326
+ children: _.workflowName
327
+ }),
328
+ /* @__PURE__ */ jsx(DetailRow, {
329
+ label: "Status",
330
+ children: /* @__PURE__ */ jsx(Badge, {
331
+ variant: "outline",
332
+ className: "text-xs capitalize",
333
+ children: _.status
334
+ })
335
+ }),
336
+ /* @__PURE__ */ jsx(DetailRow, {
337
+ label: "Current place",
338
+ children: _.place
339
+ }),
340
+ /* @__PURE__ */ jsx(DetailRow, {
341
+ label: "Document place",
342
+ children: h.place ?? "—"
343
+ }),
344
+ /* @__PURE__ */ jsx(DetailRow, {
345
+ label: "Place match",
346
+ children: h.place === _.place ? "Same as current" : "Different place"
347
+ }),
348
+ /* @__PURE__ */ jsx(DetailRow, {
349
+ label: "Interactive",
350
+ children: _.isDocumentActive ? _.isActive ? "Yes — awaiting input" : "Eligible, workflow not waiting" : "No"
351
+ }),
352
+ _.parentTitle && /* @__PURE__ */ jsx(DetailRow, {
353
+ label: "Parent",
354
+ children: _.parentTitle
355
+ })
356
+ ]
357
+ }) })]
358
+ }), d[54] = h.place, d[55] = _, d[56] = k) : k = d[56];
359
+ let Te;
360
+ d[57] === Symbol.for("react.memo_cache_sentinel") ? (Te = /* @__PURE__ */ jsx(AccordionTrigger, {
361
+ className: "py-3 text-sm font-semibold",
362
+ children: /* @__PURE__ */ jsxs("span", {
363
+ className: "flex items-center gap-2",
364
+ children: [/* @__PURE__ */ jsx(Timer, { className: "size-4" }), "Execution context"]
365
+ })
366
+ }), d[57] = Te) : Te = d[57];
367
+ let Ee = h.transition ?? "—", W;
368
+ d[58] === Ee ? W = d[59] : (W = /* @__PURE__ */ jsx(DetailRow, {
369
+ label: "Transition",
370
+ children: Ee
371
+ }), d[58] = Ee, d[59] = W);
372
+ let De = h.place ?? "—", G;
373
+ d[60] === De ? G = d[61] : (G = /* @__PURE__ */ jsx(DetailRow, {
374
+ label: "Place",
375
+ children: De
376
+ }), d[60] = De, d[61] = G);
377
+ let K;
378
+ d[62] === h.labels ? K = d[63] : (K = /* @__PURE__ */ jsx(DetailRow, {
379
+ label: "Labels",
380
+ children: /* @__PURE__ */ jsx(BadgeList, { items: h.labels })
381
+ }), d[62] = h.labels, d[63] = K);
382
+ let q;
383
+ d[64] === h.tags ? q = d[65] : (q = /* @__PURE__ */ jsx(DetailRow, {
384
+ label: "Tags",
385
+ children: /* @__PURE__ */ jsx(BadgeList, { items: h.tags })
386
+ }), d[64] = h.tags, d[65] = q);
387
+ let J;
388
+ d[66] === h.createdAt ? J = d[67] : (J = formatDate(h.createdAt), d[66] = h.createdAt, d[67] = J);
389
+ let Y;
390
+ d[68] === h.createdAt ? Y = d[69] : (Y = formatRelativeTime(h.createdAt), d[68] = h.createdAt, d[69] = Y);
391
+ let X;
392
+ d[70] === Y ? X = d[71] : (X = /* @__PURE__ */ jsxs("span", {
393
+ className: "text-muted-foreground ml-1 text-xs",
394
+ children: [
395
+ "(",
396
+ Y,
397
+ ")"
398
+ ]
399
+ }), d[70] = Y, d[71] = X);
400
+ let Z;
401
+ d[72] !== J || d[73] !== X ? (Z = /* @__PURE__ */ jsxs(DetailRow, {
402
+ label: "Created",
403
+ children: [J, X]
404
+ }), d[72] = J, d[73] = X, d[74] = Z) : Z = d[74];
405
+ let Q;
406
+ d[75] === h.updatedAt ? Q = d[76] : (Q = formatDate(h.updatedAt), d[75] = h.updatedAt, d[76] = Q);
407
+ let Oe;
408
+ d[77] === h.updatedAt ? Oe = d[78] : (Oe = formatRelativeTime(h.updatedAt), d[77] = h.updatedAt, d[78] = Oe);
409
+ let ke;
410
+ d[79] === Oe ? ke = d[80] : (ke = /* @__PURE__ */ jsxs("span", {
411
+ className: "text-muted-foreground ml-1 text-xs",
412
+ children: [
413
+ "(",
414
+ Oe,
415
+ ")"
416
+ ]
417
+ }), d[79] = Oe, d[80] = ke);
418
+ let Ae;
419
+ d[81] !== Q || d[82] !== ke ? (Ae = /* @__PURE__ */ jsxs(DetailRow, {
420
+ label: "Updated",
421
+ children: [Q, ke]
422
+ }), d[81] = Q, d[82] = ke, d[83] = Ae) : Ae = d[83];
423
+ let $;
424
+ d[84] === ge ? $ = d[85] : ($ = ge > 0 && /* @__PURE__ */ jsx(DetailRow, {
425
+ label: "Edit window",
426
+ children: formatDurationMs(ge)
427
+ }), d[84] = ge, d[85] = $), d[86] !== W || d[87] !== G || d[88] !== K || d[89] !== q || d[90] !== Z || d[91] !== Ae || d[92] !== $ ? (A = /* @__PURE__ */ jsxs(AccordionItem, {
428
+ value: "context",
429
+ children: [Te, /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
430
+ className: "space-y-2 pb-1",
431
+ children: [
432
+ W,
433
+ G,
434
+ K,
435
+ q,
436
+ Z,
437
+ Ae,
438
+ $
439
+ ]
440
+ }) })]
441
+ }), d[86] = W, d[87] = G, d[88] = K, d[89] = q, d[90] = Z, d[91] = Ae, d[92] = $, d[93] = A) : A = d[93], d[94] !== F || d[95] !== V ? (j = V && /* @__PURE__ */ jsxs(AccordionItem, {
442
+ value: "content-summary",
443
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
444
+ className: "py-3 text-sm font-semibold",
445
+ children: /* @__PURE__ */ jsxs("span", {
446
+ className: "flex items-center gap-2",
447
+ children: [/* @__PURE__ */ jsx(FileJson, { className: "size-4" }), "Content summary"]
448
+ })
449
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(ContentSummarySection, { summary: F }) })]
450
+ }), d[94] = F, d[95] = V, d[96] = j) : j = d[96], M = B && /* @__PURE__ */ jsxs(AccordionItem, {
451
+ value: "llm",
452
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
453
+ className: "py-3 text-sm font-semibold",
454
+ children: /* @__PURE__ */ jsxs("span", {
455
+ className: "flex items-center gap-2",
456
+ children: [/* @__PURE__ */ jsx(Cpu, { className: "size-4" }), "LLM / API"]
457
+ })
458
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(LlmMetadataSection, {
459
+ provider: m.provider,
460
+ apiInfo: I,
461
+ rawResponse: m.response
462
+ }) })]
463
+ }), d[97] !== h.validationError || d[98] !== L ? (N = L && /* @__PURE__ */ jsxs(AccordionItem, {
464
+ value: "validation",
465
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
466
+ className: "py-3 text-sm font-semibold text-destructive",
467
+ children: "Validation error"
468
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(CodeBlock, {
469
+ code: JSON.stringify(h.validationError, null, 2),
470
+ language: "json",
471
+ className: "max-h-64 min-w-0 max-w-full"
472
+ }) })]
473
+ }), d[97] = h.validationError, d[98] = L, d[99] = N) : N = d[99], S = (z || R) && /* @__PURE__ */ jsxs(AccordionItem, {
474
+ value: "config",
475
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
476
+ className: "py-3 text-sm font-semibold",
477
+ children: /* @__PURE__ */ jsxs("span", {
478
+ className: "flex items-center gap-2",
479
+ children: [/* @__PURE__ */ jsx(Settings2, { className: "size-4" }), "Configuration"]
480
+ })
481
+ }), /* @__PURE__ */ jsxs(AccordionContent, {
482
+ className: "space-y-3",
483
+ children: [z && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
484
+ className: "text-muted-foreground mb-1.5 text-xs font-medium uppercase tracking-wide",
485
+ children: "UI"
486
+ }), /* @__PURE__ */ jsx(CodeBlock, {
487
+ code: JSON.stringify(e?.ui, null, 2),
488
+ language: "json",
489
+ className: "max-h-48 min-w-0 max-w-full"
490
+ })] }), R && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
491
+ className: "text-muted-foreground mb-1.5 text-xs font-medium uppercase tracking-wide",
492
+ children: "Schema"
493
+ }), /* @__PURE__ */ jsx(CodeBlock, {
494
+ code: JSON.stringify(e?.schema, null, 2),
495
+ language: "json",
496
+ className: "max-h-48 min-w-0 max-w-full"
497
+ })] })]
498
+ })]
499
+ }), C = (a || _e.length > 0) && /* @__PURE__ */ jsxs(AccordionItem, {
500
+ value: "meta",
501
+ children: [/* @__PURE__ */ jsx(AccordionTrigger, {
502
+ className: "py-3 text-sm font-semibold",
503
+ children: "Document meta"
504
+ }), /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
505
+ className: "space-y-2 pb-1",
506
+ children: [
507
+ a?.enableAtPlaces && /* @__PURE__ */ jsx(DetailRow, {
508
+ label: "Show at",
509
+ children: /* @__PURE__ */ jsx(BadgeList, {
510
+ items: a.enableAtPlaces,
511
+ emptyLabel: "—"
512
+ })
513
+ }),
514
+ a?.hideAtPlaces && /* @__PURE__ */ jsx(DetailRow, {
515
+ label: "Hide at",
516
+ children: /* @__PURE__ */ jsx(BadgeList, {
517
+ items: a.hideAtPlaces,
518
+ emptyLabel: "—"
519
+ })
520
+ }),
521
+ _e.map(_temp5)
522
+ ]
523
+ }) })]
524
+ }), d[0] = g, d[1] = h.createdAt, d[2] = h.documentName, d[3] = h.index, d[4] = h.isInvalidated, d[5] = h.labels, d[6] = h.meta, d[7] = h.place, d[8] = h.tags, d[9] = h.transition, d[10] = h.updatedAt, d[11] = h.validationError, d[12] = y, d[13] = _, d[14] = b, d[15] = x, d[16] = S, d[17] = C, d[18] = w, d[19] = T, d[20] = E, d[21] = D, d[22] = O, d[23] = k, d[24] = A, d[25] = j, d[26] = M, d[27] = N;
525
+ } else b = d[14], x = d[15], S = d[16], C = d[17], w = d[18], T = d[19], E = d[20], D = d[21], O = d[22], k = d[23], A = d[24], j = d[25], M = d[26], N = d[27];
192
526
  let P;
193
- n[47] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx("span", {
194
- className: "font-medium",
195
- children: "Workflow ID:"
196
- }), n[47] = P) : P = n[47];
527
+ d[100] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(AccordionTrigger, {
528
+ className: "py-3 text-sm font-semibold",
529
+ children: "Identifiers"
530
+ }), d[100] = P) : P = d[100];
197
531
  let F;
198
- n[48] === r.workflowId ? F = n[49] : (F = /* @__PURE__ */ jsxs("div", {
199
- className: "text-sm",
200
- children: [
201
- P,
202
- " ",
203
- r.workflowId
204
- ]
205
- }), n[48] = r.workflowId, n[49] = F);
532
+ d[101] === h.id ? F = d[102] : (F = /* @__PURE__ */ jsx(DetailRow, {
533
+ label: "Document",
534
+ children: /* @__PURE__ */ jsx(CopyableId, { value: h.id })
535
+ }), d[101] = h.id, d[102] = F);
206
536
  let I;
207
- n[50] !== j || n[51] !== N || n[52] !== F ? (I = /* @__PURE__ */ jsxs("div", {
208
- className: "space-y-1 pt-2",
209
- children: [
210
- j,
211
- N,
212
- F
213
- ]
214
- }), n[50] = j, n[51] = N, n[52] = F, n[53] = I) : I = n[53];
537
+ d[103] === h.workflowId ? I = d[104] : (I = /* @__PURE__ */ jsx(DetailRow, {
538
+ label: "Workflow",
539
+ children: /* @__PURE__ */ jsx(CopyableId, { value: h.workflowId })
540
+ }), d[103] = h.workflowId, d[104] = I);
215
541
  let L;
216
- n[54] === r.meta ? L = n[55] : (L = r.meta?.mimeType && /* @__PURE__ */ jsxs("div", {
217
- className: "pt-2 text-sm",
218
- children: [
219
- /* @__PURE__ */ jsx("span", {
220
- className: "font-medium",
221
- children: "MIME Type:"
222
- }),
223
- " ",
224
- r.meta.mimeType
225
- ]
226
- }), n[54] = r.meta, n[55] = L);
542
+ d[105] === h.workspaceId ? L = d[106] : (L = /* @__PURE__ */ jsx(DetailRow, {
543
+ label: "Workspace",
544
+ children: /* @__PURE__ */ jsx(CopyableId, { value: h.workspaceId })
545
+ }), d[105] = h.workspaceId, d[106] = L);
227
546
  let R;
228
- n[56] === r.meta ? R = n[57] : (R = r.meta?.enableAtPlaces && /* @__PURE__ */ jsxs("div", {
229
- className: "pt-2",
230
- children: [/* @__PURE__ */ jsx("div", {
231
- className: "mb-2 text-sm font-medium",
232
- children: "Enable At Places:"
233
- }), /* @__PURE__ */ jsx("div", {
234
- className: "flex flex-wrap gap-2",
235
- children: r.meta.enableAtPlaces.map(_temp3)
236
- })]
237
- }), n[56] = r.meta, n[57] = R);
238
- let z;
239
- n[58] === r.meta ? z = n[59] : (z = r.meta && Object.entries(r.meta).filter(_temp4).map(_temp5), n[58] = r.meta, n[59] = z);
240
- let B;
241
- n[60] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx("span", {
242
- className: "font-medium",
243
- children: "Invalidated:"
244
- }), n[60] = B) : B = n[60];
245
- let ve = r.isInvalidated ? "Yes" : "No", V;
246
- n[61] === ve ? V = n[62] : (V = /* @__PURE__ */ jsxs("div", {
247
- className: "text-sm",
248
- children: [
249
- B,
250
- " ",
251
- ve
252
- ]
253
- }), n[61] = ve, n[62] = V);
254
- let H;
255
- n[63] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx("span", {
256
- className: "font-medium",
257
- children: "Pending Removal:"
258
- }), n[63] = H) : H = n[63];
259
- let ye = r.isPendingRemoval ? "Yes" : "No", U;
260
- n[64] === ye ? U = n[65] : (U = /* @__PURE__ */ jsxs("div", {
261
- className: "text-sm",
262
- children: [
263
- H,
264
- " ",
265
- ye
266
- ]
267
- }), n[64] = ye, n[65] = U);
268
- let W;
269
- n[66] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsx("span", {
270
- className: "font-medium",
271
- children: "Transition:"
272
- }), n[66] = W) : W = n[66];
273
- let G;
274
- n[67] === r.transition ? G = n[68] : (G = /* @__PURE__ */ jsxs("div", {
275
- className: "text-sm",
276
- children: [
277
- W,
278
- " ",
279
- r.transition
280
- ]
281
- }), n[67] = r.transition, n[68] = G);
282
- let K;
283
- n[69] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ jsx("span", {
284
- className: "font-medium",
285
- children: "Place:"
286
- }), n[69] = K) : K = n[69];
287
- let q;
288
- n[70] === r.place ? q = n[71] : (q = /* @__PURE__ */ jsxs("div", {
289
- className: "text-sm",
290
- children: [
291
- K,
292
- " ",
293
- r.place
294
- ]
295
- }), n[70] = r.place, n[71] = q);
296
- let J;
297
- n[72] !== V || n[73] !== U || n[74] !== G || n[75] !== q ? (J = /* @__PURE__ */ jsxs("div", {
298
- className: "space-y-1 pt-2",
299
- children: [
300
- V,
301
- U,
302
- G,
303
- q
304
- ]
305
- }), n[72] = V, n[73] = U, n[74] = G, n[75] = q, n[76] = J) : J = n[76];
306
- let Y;
307
- n[77] !== m || n[78] !== g || n[79] !== y || n[80] !== S || n[81] !== k || n[82] !== I || n[83] !== L || n[84] !== R || n[85] !== z || n[86] !== J || n[87] !== u || n[88] !== f ? (Y = /* @__PURE__ */ jsxs(AccordionItem, {
308
- value: "document-info",
309
- children: [s, /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
310
- className: "ml-6 space-y-2",
547
+ d[107] !== F || d[108] !== I || d[109] !== L ? (R = /* @__PURE__ */ jsxs(AccordionItem, {
548
+ value: "ids",
549
+ children: [P, /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsxs("div", {
550
+ className: "space-y-2 pb-1",
311
551
  children: [
312
- u,
313
- f,
314
- m,
315
- g,
316
- y,
317
- S,
318
- k,
552
+ F,
319
553
  I,
320
- L,
321
- R,
322
- z,
323
- J
554
+ L
324
555
  ]
325
556
  }) })]
326
- }), n[77] = m, n[78] = g, n[79] = y, n[80] = S, n[81] = k, n[82] = I, n[83] = L, n[84] = R, n[85] = z, n[86] = J, n[87] = u, n[88] = f, n[89] = Y) : Y = n[89];
327
- let X;
328
- n[90] === Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ jsx(AccordionTrigger, {
329
- className: "text-base font-semibold",
330
- children: /* @__PURE__ */ jsxs("div", {
331
- className: "flex items-center gap-2",
332
- children: [/* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" }), "Content"]
333
- })
334
- }), n[90] = X) : X = n[90];
335
- let be = `max-h-96 overflow-auto rounded bg-gray-100 p-2 text-xs wrap-break-word whitespace-pre-wrap ${r.meta?.mimeType === "text/markdown" ? "font-sans" : "font-mono"}`, Z;
336
- n[91] !== _e || n[92] !== be ? (Z = /* @__PURE__ */ jsxs(AccordionItem, {
337
- value: "content",
338
- children: [X, /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(Card, {
339
- className: "bg-gray-50",
340
- children: /* @__PURE__ */ jsx(CardContent, {
341
- className: "p-4",
342
- children: /* @__PURE__ */ jsx("pre", {
343
- className: be,
344
- children: _e
345
- })
346
- })
347
- }) })]
348
- }), n[91] = _e, n[92] = be, n[93] = Z) : Z = n[93];
349
- let Q;
350
- n[94] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ jsx(AccordionTrigger, {
351
- className: "text-base font-semibold",
352
- children: /* @__PURE__ */ jsxs("div", {
353
- className: "flex items-center gap-2",
354
- children: [/* @__PURE__ */ jsx(Code, { className: "h-4 w-4" }), "Schema"]
355
- })
356
- }), n[94] = Q) : Q = n[94];
357
- let $;
358
- n[95] === ge ? $ = n[96] : ($ = /* @__PURE__ */ jsxs(AccordionItem, {
359
- value: "schema",
360
- children: [Q, /* @__PURE__ */ jsx(AccordionContent, { children: /* @__PURE__ */ jsx(Card, {
361
- className: "bg-gray-50",
362
- children: /* @__PURE__ */ jsx(CardContent, {
363
- className: "p-4",
364
- children: /* @__PURE__ */ jsx("pre", {
365
- className: "rounded bg-gray-100 p-2 font-mono text-xs wrap-break-word whitespace-pre-wrap",
366
- children: ge
367
- })
368
- })
369
- }) })]
370
- }), n[95] = ge, n[96] = $);
371
- let xe;
372
- return n[97] !== Y || n[98] !== Z || n[99] !== $ ? (xe = /* @__PURE__ */ jsx("div", {
373
- className: "mt-4",
374
- children: /* @__PURE__ */ jsxs(Accordion, {
375
- type: "multiple",
376
- defaultValue: o,
377
- className: "space-y-2",
378
- children: [
379
- Y,
380
- Z,
381
- $
382
- ]
383
- })
384
- }), n[97] = Y, n[98] = Z, n[99] = $, n[100] = xe) : xe = n[100], xe;
557
+ }), d[107] = F, d[108] = I, d[109] = L, d[110] = R) : R = d[110];
558
+ let z;
559
+ d[111] !== b || d[112] !== x || d[113] !== S || d[114] !== C || d[115] !== R || d[116] !== E || d[117] !== D || d[118] !== O || d[119] !== k || d[120] !== A || d[121] !== j || d[122] !== M || d[123] !== N ? (z = /* @__PURE__ */ jsxs(b, {
560
+ type: x,
561
+ defaultValue: E,
562
+ className: D,
563
+ children: [
564
+ O,
565
+ k,
566
+ A,
567
+ j,
568
+ M,
569
+ N,
570
+ S,
571
+ C,
572
+ R
573
+ ]
574
+ }), d[111] = b, d[112] = x, d[113] = S, d[114] = C, d[115] = R, d[116] = E, d[117] = D, d[118] = O, d[119] = k, d[120] = A, d[121] = j, d[122] = M, d[123] = N, d[124] = z) : z = d[124];
575
+ let B;
576
+ return d[125] !== w || d[126] !== T || d[127] !== z ? (B = /* @__PURE__ */ jsxs("div", {
577
+ className: w,
578
+ children: [T, z]
579
+ }), d[125] = w, d[126] = T, d[127] = z, d[128] = B) : B = d[128], B;
385
580
  };
386
- function _temp(e, t) {
581
+ function _temp(e) {
387
582
  return /* @__PURE__ */ jsx(Badge, {
388
583
  variant: "outline",
389
584
  className: "text-xs",
390
585
  children: e
391
- }, t);
586
+ }, e);
392
587
  }
393
- function _temp2(e, t) {
394
- return /* @__PURE__ */ jsxs(Badge, {
395
- variant: "secondary",
396
- className: "text-xs",
397
- children: [/* @__PURE__ */ jsx(Tag, { className: "mr-1 h-3 w-3" }), e]
398
- }, t);
399
- }
400
- function _temp3(e, t) {
588
+ function _temp2(e) {
401
589
  return /* @__PURE__ */ jsx(Badge, {
402
590
  variant: "outline",
403
- className: "bg-blue-50 text-xs",
591
+ className: "text-xs",
404
592
  children: e
405
- }, t);
593
+ }, e);
594
+ }
595
+ function _temp3(e) {
596
+ return /* @__PURE__ */ jsxs("span", {
597
+ className: "flex flex-wrap items-center gap-1",
598
+ children: [/* @__PURE__ */ jsxs(Badge, {
599
+ variant: "secondary",
600
+ className: "font-mono text-xs",
601
+ children: [
602
+ e.type,
603
+ " × ",
604
+ e.count
605
+ ]
606
+ }), e.labels?.map(_temp2)]
607
+ }, e.type);
406
608
  }
407
609
  function _temp4(e) {
408
- let [t] = e;
409
- return !["mimeType", "enableAtPlaces"].includes(t);
610
+ let [t, n] = e;
611
+ return ![
612
+ "data",
613
+ "response",
614
+ "provider",
615
+ "streaming"
616
+ ].includes(t) && n != null && n !== "";
410
617
  }
411
618
  function _temp5(e) {
412
- let [t, me] = e;
413
- return /* @__PURE__ */ jsxs("div", {
414
- className: "text-sm",
415
- children: [
416
- /* @__PURE__ */ jsxs("span", {
417
- className: "font-medium",
418
- children: [t, ":"]
419
- }),
420
- " ",
421
- typeof me == "object" ? JSON.stringify(me) : String(me)
422
- ]
619
+ let [t, n] = e;
620
+ return /* @__PURE__ */ jsx(DetailRow, {
621
+ label: t,
622
+ children: typeof n == "object" ? JSON.stringify(n) : String(n)
423
623
  }, t);
424
624
  }
425
625
  export { DocumentDetails_default as default };