@mcp-use/inspector 20.0.0-beta.13 → 20.0.0-beta.15

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 (145) hide show
  1. package/README.md +4 -4
  2. package/dist/cdn/inspector.js +76858 -9272
  3. package/dist/cli.js +69 -24
  4. package/dist/server/asset-urls.d.ts +1 -4
  5. package/dist/server/asset-urls.d.ts.map +1 -1
  6. package/dist/server/asset-urls.js +3 -7
  7. package/dist/server/cdn-shell.d.ts.map +1 -1
  8. package/dist/server/cdn-shell.js +3 -3
  9. package/dist/server/{chunk-H6ZCIKBS.js → chunk-JZT7N2BJ.js} +10 -15
  10. package/dist/server/{chunk-YAYRN4DW.js → chunk-WNQGHIZ3.js} +61 -15
  11. package/dist/server/{chunk-QQP554HG.js → chunk-XKCUJ6ZJ.js} +1 -1
  12. package/dist/server/{chunk-2XQWLYOZ.js → chunk-ZPGABKXL.js} +1 -1
  13. package/dist/server/cli.js +3 -3
  14. package/dist/server/index.js +4 -4
  15. package/dist/server/middleware.js +4 -4
  16. package/dist/server/version.js +1 -1
  17. package/dist/web/assets/index-Bqfsh_Rp.js +643 -0
  18. package/dist/web/index.html +2 -10
  19. package/package.json +2 -2
  20. package/dist/cdn/AnimatePresence-D1bZ5_-l.js +0 -394
  21. package/dist/cdn/ChatTab-CokP5UlL.js +0 -6811
  22. package/dist/cdn/CheckboxIndicator-BjF73mGX.js +0 -252
  23. package/dist/cdn/ConnectionSettingsForm-CXCKdMZh.js +0 -929
  24. package/dist/cdn/ConnectionSettingsTab-Ag4WD55h.js +0 -151
  25. package/dist/cdn/ElicitationTab-PEmEDvC5.js +0 -655
  26. package/dist/cdn/FormContext-NtUiZclE.js +0 -135
  27. package/dist/cdn/InspectorContext-BBKCdfmK.js +0 -123
  28. package/dist/cdn/JSONDisplay-BJqMz7Ny.js +0 -324
  29. package/dist/cdn/ListTabHeader-DzmTtN1e.js +0 -89
  30. package/dist/cdn/MCPAppsDebugControls-C01DPDJv.js +0 -2174
  31. package/dist/cdn/ManufactOAuthCallback-ChbbjFIT.js +0 -31
  32. package/dist/cdn/MarkdownRenderer-CrG5JHAZ.js +0 -3610
  33. package/dist/cdn/McpAppsViewPanel-07_iHrne.js +0 -56
  34. package/dist/cdn/NotificationsTab-B7uebqMV.js +0 -290
  35. package/dist/cdn/OAuthCallback-Cku-R2uM.js +0 -58
  36. package/dist/cdn/PromptsTab-98ugje_q.js +0 -902
  37. package/dist/cdn/ResourcesTab-CxHilZjd.js +0 -566
  38. package/dist/cdn/SamplingTab-gOUjg7bt.js +0 -659
  39. package/dist/cdn/ServerMetadataTab-BM3VhSLf.js +0 -244
  40. package/dist/cdn/StatusIcon-Q3n3YRtE.js +0 -65
  41. package/dist/cdn/ToolsTab-Dm6n5OxE.js +0 -2045
  42. package/dist/cdn/ViewPreview-CCKWd8Qt.js +0 -238
  43. package/dist/cdn/WidgetDebugContext-B6yoOVVV.js +0 -314
  44. package/dist/cdn/WidgetWrapper-BlbQAh_X.js +0 -12
  45. package/dist/cdn/basePath-B8HuhIMu.js +0 -25
  46. package/dist/cdn/bell-GrTZcnD2.js +0 -10
  47. package/dist/cdn/browser-DG2Z8392.js +0 -42
  48. package/dist/cdn/brush-CelVvMGp.js +0 -17
  49. package/dist/cdn/button-CB4uOoUV.js +0 -2509
  50. package/dist/cdn/card-BA-DQk-G.js +0 -41
  51. package/dist/cdn/cfWorker-Bxcs9rNe.js +0 -10799
  52. package/dist/cdn/checkbox-kwVa4gRX.js +0 -20
  53. package/dist/cdn/chunk-QUQL4437-XnDcYQEx.js +0 -1508
  54. package/dist/cdn/clock-YMF8Gtw5.js +0 -12
  55. package/dist/cdn/code-C8sN2OGR.js +0 -10
  56. package/dist/cdn/createLucideIcon-BONxC1L5.js +0 -213
  57. package/dist/cdn/dialog-CJGnC5Ag.js +0 -1028
  58. package/dist/cdn/dist-C-AJLM5q.js +0 -2307
  59. package/dist/cdn/dist-CTJnCYmk.js +0 -616
  60. package/dist/cdn/external-link-Bo4lQxr1.js +0 -17
  61. package/dist/cdn/eye-pSGG7nvf.js +0 -29
  62. package/dist/cdn/folder-open-aM8CPtBO.js +0 -7
  63. package/dist/cdn/hash-DDs2vE1k.js +0 -33
  64. package/dist/cdn/history-BfUFpL1d.js +0 -17
  65. package/dist/cdn/index-browser-CCygKh3z.js +0 -1853
  66. package/dist/cdn/info-BMkB68mB.js +0 -19
  67. package/dist/cdn/input-BCpgLXU1.js +0 -9654
  68. package/dist/cdn/inspector-settings-layout-0VDsjeqb.js +0 -4
  69. package/dist/cdn/label-A0UGV8FE.js +0 -60
  70. package/dist/cdn/loader-circle-BKRHJEB7.js +0 -7
  71. package/dist/cdn/manufact-auth-BQMHhbLV.js +0 -423
  72. package/dist/cdn/maximize-2-DdrB_spi.js +0 -21
  73. package/dist/cdn/maximize-hSOCz133.js +0 -21
  74. package/dist/cdn/message-square-D3tKB3uJ.js +0 -7
  75. package/dist/cdn/not-found-BajFyZpp.js +0 -32
  76. package/dist/cdn/play-B1leulYf.js +0 -7
  77. package/dist/cdn/providerMeta-CjGU4rID.js +0 -436
  78. package/dist/cdn/react-BIs9pQ3H.js +0 -926
  79. package/dist/cdn/react-BiVEwoxA.js +0 -5421
  80. package/dist/cdn/refresh-cw-CyvXrS91.js +0 -21
  81. package/dist/cdn/save-CmdEPUAm.js +0 -34
  82. package/dist/cdn/schemaHelpers-DTV38jGq.js +0 -16
  83. package/dist/cdn/select-CCFHjOGk.js +0 -2595
  84. package/dist/cdn/servers-Dd0Vcp81.js +0 -30
  85. package/dist/cdn/shared-CJVHJhag.js +0 -1700
  86. package/dist/cdn/sheet-oyq1mIyg.js +0 -2078
  87. package/dist/cdn/sparkles-CxeZpVtX.js +0 -23
  88. package/dist/cdn/spinner-Be1GlSGX.js +0 -15
  89. package/dist/cdn/square-check-big-C_4wbfwF.js +0 -10
  90. package/dist/cdn/switch-DHXEA_N5.js +0 -665
  91. package/dist/cdn/tabs-subtle-Dubd6Kj8.js +0 -788
  92. package/dist/cdn/telemetry-DyrOzsAR.js +0 -208
  93. package/dist/cdn/textarea-CwmI8_uI.js +0 -14
  94. package/dist/cdn/trash-2-BhumJAFE.js +0 -25
  95. package/dist/cdn/useAriaLabelledBy-Cra6w3YY.js +0 -30
  96. package/dist/cdn/useCompositeItem-Dhnm-7el.js +0 -26
  97. package/dist/cdn/useConfig-BTDwEhra.js +0 -235
  98. package/dist/cdn/useSavedRequests-mSIsDd4c.js +0 -51
  99. package/dist/cdn/useViewHostProps-C5NRGTzJ.js +0 -364
  100. package/dist/cdn/wrench-DvK20LUT.js +0 -7
  101. package/dist/cdn/x-EilKPiCX.js +0 -10
  102. package/dist/cdn/zap-0Wr9QO7N.js +0 -10
  103. package/dist/web/assets/AnimatePresence-FfDQQNFJ.js +0 -9
  104. package/dist/web/assets/ChatTab-BEfFVccY.js +0 -18
  105. package/dist/web/assets/ConnectionSettingsTab-Bb_6a0Iv.js +0 -1
  106. package/dist/web/assets/ElicitationTab-BP4GKiyX.js +0 -1
  107. package/dist/web/assets/FormContext-sV-yByKz.js +0 -1
  108. package/dist/web/assets/ListTabHeader-CrGae306.js +0 -1
  109. package/dist/web/assets/MCPAppsDebugControls-BIyFdqol.js +0 -34
  110. package/dist/web/assets/ManufactOAuthCallback-C7FmBqhm.js +0 -1
  111. package/dist/web/assets/MarkdownRenderer-Dh79xxF3.js +0 -47
  112. package/dist/web/assets/McpAppsViewPanel-eC3j1-Vq.js +0 -1
  113. package/dist/web/assets/NotificationsTab-BiZcGnsE.js +0 -1
  114. package/dist/web/assets/OAuthCallback-0QMKMr_h.js +0 -1
  115. package/dist/web/assets/PromptsTab-DP25ApgP.js +0 -15
  116. package/dist/web/assets/ResourcesTab-CptaN3NT.js +0 -2
  117. package/dist/web/assets/SamplingTab-BcdnfiwQ.js +0 -1
  118. package/dist/web/assets/ServerMetadataTab-DfM-a-Kp.js +0 -1
  119. package/dist/web/assets/ToolsTab-hSGwy5-P.js +0 -8
  120. package/dist/web/assets/ViewPreview-r5Me72Dm.js +0 -1
  121. package/dist/web/assets/WidgetWrapper-cv_BM1bY.js +0 -1
  122. package/dist/web/assets/brush-DX0UZ_pI.js +0 -1
  123. package/dist/web/assets/button-C8Xa2k4x.js +0 -1
  124. package/dist/web/assets/checkbox-CiCqaf9B.js +0 -1
  125. package/dist/web/assets/code-B14rVdNt.js +0 -1
  126. package/dist/web/assets/createLucideIcon-BEHeJH0M.js +0 -1
  127. package/dist/web/assets/dist-igO5zKmw.js +0 -21
  128. package/dist/web/assets/index-lCF-0iyi.js +0 -499
  129. package/dist/web/assets/input-C0OQCUZy.js +0 -1
  130. package/dist/web/assets/inspector-settings-layout-yjKRJDai.js +0 -1
  131. package/dist/web/assets/label-CI7JWQOo.js +0 -1
  132. package/dist/web/assets/maximize-2-Br1WQzT2.js +0 -1
  133. package/dist/web/assets/maximize-CJNgRe6S.js +0 -1
  134. package/dist/web/assets/react-CU_d2d5K.js +0 -1
  135. package/dist/web/assets/refresh-cw-B5iaAZKn.js +0 -1
  136. package/dist/web/assets/save-TM6fvNrt.js +0 -1
  137. package/dist/web/assets/schemaHelpers-DLNTQr_6.js +0 -1
  138. package/dist/web/assets/select-D6jzbLJn.js +0 -1
  139. package/dist/web/assets/shared-ChslWC1c.js +0 -1
  140. package/dist/web/assets/sparkles-BGYTDThM.js +0 -1
  141. package/dist/web/assets/tabs-subtle-BqKfSXAk.js +0 -1
  142. package/dist/web/assets/textarea-CRTXuRmE.js +0 -1
  143. package/dist/web/assets/useConfig-BoaEj10z.js +0 -1
  144. package/dist/web/assets/useViewHostProps-BUcH84Z-.js +0 -1
  145. package/dist/web/assets/zap-BDWHCVHU.js +0 -1
@@ -1,902 +0,0 @@
1
- import { s as e, t } from "./react-BIs9pQ3H.js";
2
- import { f as n, sr as r, t as i } from "./input-BCpgLXU1.js";
3
- import { n as a } from "./createLucideIcon-BONxC1L5.js";
4
- import { U as o, i as s, n as c, r as l, t as u } from "./button-CB4uOoUV.js";
5
- import { t as d } from "./label-A0UGV8FE.js";
6
- import { t as ee } from "./AnimatePresence-D1bZ5_-l.js";
7
- import { a as f, i as p, n as m, r as te, t as h } from "./select-CCFHjOGk.js";
8
- import { a as g, i as _, t as v } from "./browser-DG2Z8392.js";
9
- import { n as y, t as ne } from "./zap-0Wr9QO7N.js";
10
- import { t as b } from "./clock-YMF8Gtw5.js";
11
- import { t as re } from "./JSONDisplay-BJqMz7Ny.js";
12
- import { a as x, i as S, n as C, o as w, r as T, s as E } from "./shared-CJVHJhag.js";
13
- import { t as ie } from "./history-BfUFpL1d.js";
14
- import { t as D } from "./maximize-hSOCz133.js";
15
- import { t as O } from "./message-square-D3tKB3uJ.js";
16
- import { n as k, t as A } from "./save-CmdEPUAm.js";
17
- import { t as j } from "./play-B1leulYf.js";
18
- import { t as M } from "./trash-2-BhumJAFE.js";
19
- import { t as N } from "./not-found-BajFyZpp.js";
20
- import { t as P } from "./spinner-Be1GlSGX.js";
21
- import { n as ae } from "./InspectorContext-BBKCdfmK.js";
22
- import { n as oe, t as F } from "./MarkdownRenderer-CrG5JHAZ.js";
23
- import { t as I } from "./textarea-CwmI8_uI.js";
24
- import { t as se } from "./ListTabHeader-DzmTtN1e.js";
25
- //#region src/client/components/prompts/PromptInputForm.tsx
26
- var L = /* @__PURE__ */ e(t(), 1), R = a();
27
- function z({ selectedPrompt: e, promptArgs: t, onArgChange: n }) {
28
- let r = e?.arguments || [];
29
- if (!(r.length > 0)) return /* @__PURE__ */ (0, R.jsx)("div", {
30
- className: "flex items-center justify-center h-32 text-gray-500 dark:text-gray-400 text-sm",
31
- children: "No arguments required"
32
- });
33
- let a = (e) => {
34
- let r = e.name, a = t[r], o = typeof a == "string" ? a : JSON.stringify(a);
35
- return e.type === "boolean" ? /* @__PURE__ */ (0, R.jsxs)("div", {
36
- className: "space-y-2",
37
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsxs)(d, {
38
- htmlFor: r,
39
- className: "text-sm font-medium",
40
- children: [r, e.required && /* @__PURE__ */ (0, R.jsx)("span", {
41
- className: "text-red-500 ml-1",
42
- children: "*"
43
- })]
44
- }), e.description && /* @__PURE__ */ (0, R.jsx)("p", {
45
- className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
46
- children: e.description
47
- })] }), /* @__PURE__ */ (0, R.jsx)("input", {
48
- id: r,
49
- type: "checkbox",
50
- checked: !!a,
51
- onChange: (e) => n(r, e.target.checked),
52
- className: "rounded",
53
- "aria-label": `Toggle ${r}`
54
- })]
55
- }, r) : e.type === "number" ? /* @__PURE__ */ (0, R.jsxs)("div", {
56
- className: "space-y-2",
57
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsxs)(d, {
58
- htmlFor: r,
59
- className: "text-sm font-medium",
60
- children: [r, e.required && /* @__PURE__ */ (0, R.jsx)("span", {
61
- className: "text-red-500 ml-1",
62
- children: "*"
63
- })]
64
- }), e.description && /* @__PURE__ */ (0, R.jsx)("p", {
65
- className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
66
- children: e.description
67
- })] }), /* @__PURE__ */ (0, R.jsx)(i, {
68
- id: r,
69
- type: "number",
70
- value: Number(a) || 0,
71
- onChange: (e) => n(r, Number(e.target.value)),
72
- placeholder: `Enter ${r}`
73
- })]
74
- }, r) : e.type === "array" || e.type === "object" ? /* @__PURE__ */ (0, R.jsxs)("div", {
75
- className: "space-y-2",
76
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsxs)(d, {
77
- htmlFor: r,
78
- className: "text-sm font-medium",
79
- children: [r, e.required && /* @__PURE__ */ (0, R.jsx)("span", {
80
- className: "text-red-500 ml-1",
81
- children: "*"
82
- })]
83
- }), e.description && /* @__PURE__ */ (0, R.jsx)("p", {
84
- className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
85
- children: e.description
86
- })] }), /* @__PURE__ */ (0, R.jsx)(I, {
87
- id: r,
88
- value: o,
89
- onChange: (e) => {
90
- try {
91
- n(r, JSON.parse(e.target.value));
92
- } catch {
93
- n(r, e.target.value);
94
- }
95
- },
96
- placeholder: `Enter ${r} as JSON`,
97
- className: "font-mono text-sm min-h-[100px]"
98
- })]
99
- }, r) : /* @__PURE__ */ (0, R.jsxs)("div", {
100
- className: "space-y-2",
101
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsxs)(d, {
102
- htmlFor: r,
103
- className: "text-sm font-medium",
104
- children: [r, e.required && /* @__PURE__ */ (0, R.jsx)("span", {
105
- className: "text-red-500 ml-1",
106
- children: "*"
107
- })]
108
- }), e.description && /* @__PURE__ */ (0, R.jsx)("p", {
109
- className: "mt-0.5 text-xs text-gray-500 dark:text-gray-400",
110
- children: e.description
111
- })] }), /* @__PURE__ */ (0, R.jsx)(i, {
112
- id: r,
113
- "data-testid": `prompt-param-${r}`,
114
- value: o,
115
- onChange: (e) => n(r, e.target.value),
116
- placeholder: `Enter ${r}`
117
- })]
118
- }, r);
119
- };
120
- return /* @__PURE__ */ (0, R.jsx)("div", {
121
- className: "space-y-4",
122
- children: r.map((e) => a(e))
123
- });
124
- }
125
- //#endregion
126
- //#region src/client/components/prompts/PromptExecutionPanel.tsx
127
- function ce({ selectedPrompt: e, promptArgs: t, isExecuting: n, isConnected: r, onArgChange: i, onExecute: a, onSave: d }) {
128
- return (0, L.useEffect)(() => {
129
- let t = (t) => {
130
- (t.metaKey || t.ctrlKey) && t.key === "Enter" && e && !n && r && (t.preventDefault(), a());
131
- };
132
- return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
133
- }, [
134
- e,
135
- n,
136
- r,
137
- a
138
- ]), e ? /* @__PURE__ */ (0, R.jsxs)("div", {
139
- className: "flex flex-col h-full",
140
- children: [/* @__PURE__ */ (0, R.jsx)("div", {
141
- className: "flex-shrink-0 p-3 sm:p-6 pt-3 pb-4 pr-3",
142
- children: /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsxs)("div", {
143
- className: "flex flex-row items-center justify-between mb-0 gap-2",
144
- children: [/* @__PURE__ */ (0, R.jsx)("h3", {
145
- className: "text-base sm:text-lg font-semibold",
146
- children: e.name
147
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
148
- className: "flex gap-2 flex-shrink-0",
149
- children: [/* @__PURE__ */ (0, R.jsx)(u, {
150
- onClick: a,
151
- disabled: n || !r,
152
- size: "sm",
153
- className: c,
154
- "data-testid": "prompt-execute-button",
155
- children: n ? /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(P, {}), /* @__PURE__ */ (0, R.jsx)("span", {
156
- className: "hidden sm:inline",
157
- children: "Executing..."
158
- })] }) : /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
159
- /* @__PURE__ */ (0, R.jsx)(j, {}),
160
- /* @__PURE__ */ (0, R.jsx)("span", {
161
- className: "hidden sm:inline",
162
- children: "Execute"
163
- }),
164
- /* @__PURE__ */ (0, R.jsx)("span", {
165
- className: l,
166
- children: "⌘↵"
167
- })
168
- ] })
169
- }), /* @__PURE__ */ (0, R.jsxs)(u, {
170
- variant: "outline",
171
- onClick: d,
172
- disabled: n,
173
- size: "sm",
174
- className: o(s, "gap-2"),
175
- children: [/* @__PURE__ */ (0, R.jsx)(A, {}), /* @__PURE__ */ (0, R.jsx)("span", {
176
- className: "hidden sm:inline",
177
- children: "Save"
178
- })]
179
- })]
180
- })]
181
- }), e.description && /* @__PURE__ */ (0, R.jsx)("p", {
182
- className: "text-sm text-gray-600 dark:text-gray-400 leading-relaxed mt-2",
183
- children: e.description
184
- })] })
185
- }), /* @__PURE__ */ (0, R.jsx)("div", {
186
- className: "flex-1 overflow-y-auto px-3 sm:px-6 pb-4 pr-3",
187
- children: /* @__PURE__ */ (0, R.jsx)(z, {
188
- selectedPrompt: e,
189
- promptArgs: t,
190
- onArgChange: i
191
- })
192
- })]
193
- }) : /* @__PURE__ */ (0, R.jsxs)("div", {
194
- className: "flex flex-col items-center justify-center h-full p-4 text-center",
195
- children: [/* @__PURE__ */ (0, R.jsx)("p", {
196
- className: "text-gray-500 dark:text-gray-400 mb-2",
197
- children: "Select a prompt to get started"
198
- }), /* @__PURE__ */ (0, R.jsx)("p", {
199
- className: "text-xs text-gray-400 dark:text-gray-500",
200
- children: "Choose a prompt from the list to view its details and execute it"
201
- })]
202
- });
203
- }
204
- //#endregion
205
- //#region src/client/components/prompts/PromptMessageCard.tsx
206
- function B(e) {
207
- switch (e) {
208
- case "system": return "default";
209
- case "user": return "outline";
210
- case "assistant": return "secondary";
211
- default: return "outline";
212
- }
213
- }
214
- function V(e) {
215
- return e.charAt(0).toUpperCase() + e.slice(1);
216
- }
217
- function H(e) {
218
- return typeof e == "string" ? e : e.text ? e.text : e.type === "resource" && e.resource?.text ? e.resource.text : e.type === "image" ? `[Image: ${e.mimeType || "unknown type"}]` : JSON.stringify(e, null, 2);
219
- }
220
- function U({ message: e, index: t }) {
221
- let [n, i] = (0, L.useState)(!1);
222
- return /* @__PURE__ */ (0, R.jsxs)("div", {
223
- className: "border border-border rounded-lg overflow-hidden bg-white dark:bg-zinc-900",
224
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
225
- className: "flex items-center justify-between px-4 py-2 bg-muted/30 border-b border-border",
226
- children: [/* @__PURE__ */ (0, R.jsx)(r, {
227
- variant: B(e.role),
228
- children: V(e.role)
229
- }), /* @__PURE__ */ (0, R.jsx)(u, {
230
- variant: "ghost",
231
- size: "sm",
232
- onClick: async () => {
233
- await v(H(e.content)), i(!0), setTimeout(() => i(!1), 2e3);
234
- },
235
- className: "h-6 px-2",
236
- title: "Copy message content",
237
- children: n ? /* @__PURE__ */ (0, R.jsx)(g, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, R.jsx)(_, { className: "h-3.5 w-3.5" })
238
- })]
239
- }), /* @__PURE__ */ (0, R.jsx)("div", {
240
- className: "px-4 py-3",
241
- "data-testid": `prompt-message-content-${t}`,
242
- children: (() => {
243
- let t = e.content;
244
- return typeof t == "string" ? /* @__PURE__ */ (0, R.jsx)(F, { content: t }) : t.type === "text" && t.text ? /* @__PURE__ */ (0, R.jsx)(F, { content: t.text }) : t.type === "image" ? /* @__PURE__ */ (0, R.jsxs)("div", {
245
- className: "flex items-center gap-2 text-sm text-muted-foreground",
246
- children: [/* @__PURE__ */ (0, R.jsxs)("span", {
247
- className: "font-mono bg-muted px-2 py-1 rounded",
248
- children: ["Image: ", t.mimeType || "unknown type"]
249
- }), t.data && /* @__PURE__ */ (0, R.jsx)("img", {
250
- src: `data:${t.mimeType};base64,${t.data}`,
251
- alt: "Prompt image",
252
- className: "max-w-full max-h-[300px] object-contain rounded-lg border border-border mt-2"
253
- })]
254
- }) : t.type === "resource" && t.resource ? /* @__PURE__ */ (0, R.jsxs)("div", {
255
- className: "space-y-2",
256
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
257
- className: "flex items-center gap-2 text-sm",
258
- children: [/* @__PURE__ */ (0, R.jsx)("span", {
259
- className: "text-muted-foreground font-medium",
260
- children: "Resource:"
261
- }), /* @__PURE__ */ (0, R.jsx)("code", {
262
- className: "bg-muted px-2 py-0.5 rounded text-xs font-mono",
263
- children: t.resource.uri
264
- })]
265
- }), t.resource.text && /* @__PURE__ */ (0, R.jsx)("div", {
266
- className: "mt-2",
267
- children: /* @__PURE__ */ (0, R.jsx)(F, { content: t.resource.text })
268
- })]
269
- }) : /* @__PURE__ */ (0, R.jsx)("pre", {
270
- className: "bg-muted p-3 rounded-lg text-sm overflow-x-auto",
271
- children: /* @__PURE__ */ (0, R.jsx)("code", { children: JSON.stringify(t, null, 2) })
272
- });
273
- })()
274
- })]
275
- });
276
- }
277
- //#endregion
278
- //#region src/client/components/prompts/PromptResultDisplay.tsx
279
- function W(e) {
280
- let t = Date.now() - e, n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24);
281
- return n < 10 ? "now" : n < 60 ? `${n}s ago` : r < 60 ? `${r}m ago` : i < 24 ? `${i}h ago` : `${a}d ago`;
282
- }
283
- function G(e) {
284
- return "isError" in e && !e.isError ? null : "error" in e && e.error ? String(e.error) : "isError" in e && e.isError ? "An error occurred" : null;
285
- }
286
- function le({ results: e, copiedResult: t, previewMode: n = !0, onCopy: r, onDelete: i, onFullscreen: a, onTogglePreview: o, onMaximize: s, isMaximized: c = !1 }) {
287
- let [l, d] = (0, L.useState)(0), [ee, v] = (0, L.useState)(""), [y, b] = (0, L.useState)(!0), x = e[0], S = x ? e.filter((e) => e.promptName === x.promptName) : [], C = S[l] || S[0], w = e.findIndex((e) => e === C);
288
- if ((0, L.useEffect)(() => {
289
- S.length > 0 && l >= S.length && d(0);
290
- }, [S.length, l]), (0, L.useEffect)(() => {
291
- let e = () => {
292
- C && v(W(C.timestamp));
293
- };
294
- e();
295
- let t = setInterval(e, 1e3);
296
- return () => clearInterval(t);
297
- }, [C]), e.length === 0) return /* @__PURE__ */ (0, R.jsx)("div", {
298
- className: "flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",
299
- children: /* @__PURE__ */ (0, R.jsx)("div", {
300
- className: "flex-1 overflow-y-auto h-full",
301
- children: /* @__PURE__ */ (0, R.jsx)("div", {
302
- className: "flex items-center justify-center h-full",
303
- children: /* @__PURE__ */ (0, R.jsx)("div", {
304
- className: "text-center",
305
- children: /* @__PURE__ */ (0, R.jsx)(N, {
306
- vertical: !0,
307
- noBorder: !0,
308
- message: "No Results yet"
309
- })
310
- })
311
- })
312
- })
313
- });
314
- let T = C.error || G(C.result), E = "messages" in C.result && Array.isArray(C.result.messages);
315
- return /* @__PURE__ */ (0, R.jsx)("div", {
316
- className: "flex flex-col h-full bg-white dark:bg-black border-t dark:border-zinc-700",
317
- children: /* @__PURE__ */ (0, R.jsx)("div", {
318
- className: "flex-1 overflow-y-auto h-full",
319
- children: /* @__PURE__ */ (0, R.jsxs)("div", {
320
- className: "space-y-0 flex-1 h-full flex flex-col",
321
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
322
- className: "flex items-center gap-2 px-4 pt-2 border-b border-gray-200 dark:border-zinc-600 pb-2",
323
- children: [
324
- /* @__PURE__ */ (0, R.jsx)("h3", {
325
- className: "text-sm font-medium hidden sm:block",
326
- children: "Response"
327
- }),
328
- C.duration !== void 0 && /* @__PURE__ */ (0, R.jsxs)("div", {
329
- className: "hidden sm:flex items-center gap-1",
330
- children: [/* @__PURE__ */ (0, R.jsx)(ne, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ (0, R.jsxs)("span", {
331
- className: "text-xs text-gray-500 dark:text-gray-400",
332
- children: [C.duration, "ms"]
333
- })]
334
- }),
335
- E && /* @__PURE__ */ (0, R.jsx)("div", {
336
- className: "flex items-center gap-4 sm:ml-4",
337
- children: /* @__PURE__ */ (0, R.jsxs)("div", {
338
- className: "flex items-center gap-2",
339
- children: [
340
- /* @__PURE__ */ (0, R.jsx)("button", {
341
- onClick: () => b(!0),
342
- className: `text-xs font-medium ${y ? "text-black dark:text-white" : "text-zinc-500 dark:text-zinc-400"}`,
343
- children: "Formatted"
344
- }),
345
- /* @__PURE__ */ (0, R.jsx)("span", {
346
- className: "text-xs text-zinc-400",
347
- children: "|"
348
- }),
349
- /* @__PURE__ */ (0, R.jsx)("button", {
350
- onClick: () => b(!1),
351
- className: `text-xs font-medium ${y ? "text-zinc-500 dark:text-zinc-400" : "text-black dark:text-white"}`,
352
- children: "Raw"
353
- })
354
- ]
355
- })
356
- }),
357
- /* @__PURE__ */ (0, R.jsxs)("div", {
358
- className: "ml-auto flex items-center gap-1",
359
- children: [
360
- S.length > 1 && /* @__PURE__ */ (0, R.jsxs)("div", {
361
- className: "flex items-center gap-2 mr-2",
362
- children: [/* @__PURE__ */ (0, R.jsx)(ie, { className: "h-3 w-3 text-gray-400" }), /* @__PURE__ */ (0, R.jsxs)(h, {
363
- value: l.toString(),
364
- onValueChange: (e) => d(parseInt(e)),
365
- children: [/* @__PURE__ */ (0, R.jsx)(p, {
366
- className: "h-7 w-[120px] text-xs",
367
- children: /* @__PURE__ */ (0, R.jsx)(f, {})
368
- }), /* @__PURE__ */ (0, R.jsx)(m, { children: S.map((e, t) => /* @__PURE__ */ (0, R.jsx)(te, {
369
- value: t.toString(),
370
- children: t === 0 ? "Latest" : `${t + 1} call ago`
371
- }, t)) })]
372
- })]
373
- }),
374
- /* @__PURE__ */ (0, R.jsx)("span", {
375
- className: "text-xs text-gray-500 dark:text-gray-400 mr-2",
376
- children: ee
377
- }),
378
- /* @__PURE__ */ (0, R.jsx)(u, {
379
- variant: "ghost",
380
- size: "sm",
381
- onClick: () => r(w, C.result),
382
- className: "h-7 w-7 p-0",
383
- title: "Copy result",
384
- children: t === w ? /* @__PURE__ */ (0, R.jsx)(g, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, R.jsx)(_, { className: "h-4 w-4" })
385
- }),
386
- i && /* @__PURE__ */ (0, R.jsx)(u, {
387
- variant: "ghost",
388
- size: "sm",
389
- onClick: () => i(w),
390
- className: "h-7 w-7 p-0",
391
- title: "Delete result",
392
- children: /* @__PURE__ */ (0, R.jsx)(M, { className: "h-4 w-4" })
393
- }),
394
- a && /* @__PURE__ */ (0, R.jsx)(u, {
395
- variant: "ghost",
396
- size: "sm",
397
- onClick: () => a(w),
398
- className: "h-7 w-7 p-0 sm:hidden",
399
- title: "Fullscreen",
400
- children: /* @__PURE__ */ (0, R.jsx)(D, { className: "h-4 w-4" })
401
- }),
402
- s && /* @__PURE__ */ (0, R.jsx)(u, {
403
- variant: "ghost",
404
- size: "sm",
405
- onClick: s,
406
- className: "h-7 w-7 p-0 hidden sm:flex",
407
- title: c ? "Restore" : "Maximize",
408
- children: c ? /* @__PURE__ */ (0, R.jsx)(k, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, R.jsx)(D, { className: "h-4 w-4" })
409
- })
410
- ]
411
- })
412
- ]
413
- }), /* @__PURE__ */ (0, R.jsx)("div", {
414
- className: "flex-1 overflow-y-auto p-4",
415
- children: T ? /* @__PURE__ */ (0, R.jsxs)("div", {
416
- className: "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded p-3",
417
- children: [/* @__PURE__ */ (0, R.jsx)("p", {
418
- className: "text-red-800 dark:text-red-300 font-medium",
419
- children: "Error:"
420
- }), /* @__PURE__ */ (0, R.jsx)("p", {
421
- className: "text-red-700 dark:text-red-400 text-sm",
422
- children: T
423
- })]
424
- }) : y && E ? /* @__PURE__ */ (0, R.jsx)("div", {
425
- className: "space-y-3",
426
- children: ("messages" in C.result ? C.result.messages : []).map((e, t) => /* @__PURE__ */ (0, R.jsx)(U, {
427
- message: e,
428
- index: t
429
- }, t))
430
- }) : /* @__PURE__ */ (0, R.jsx)(re, {
431
- data: C.result,
432
- filename: `prompt-result-${C.promptName}-${Date.now()}.json`
433
- })
434
- })]
435
- })
436
- })
437
- });
438
- }
439
- //#endregion
440
- //#region src/client/components/prompts/PromptsList.tsx
441
- function ue({ prompts: e, selectedPrompt: t, onPromptSelect: n, focusedIndex: i }) {
442
- return e.length === 0 ? /* @__PURE__ */ (0, R.jsxs)("div", {
443
- className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
444
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }), /* @__PURE__ */ (0, R.jsx)("p", {
445
- className: "text-gray-500 dark:text-gray-400",
446
- children: "No prompts available"
447
- })]
448
- }) : /* @__PURE__ */ (0, R.jsx)("div", { children: e.map((e, a) => /* @__PURE__ */ (0, R.jsx)(T, {
449
- id: `prompt-${e.name}`,
450
- "data-testid": `prompt-item-${e.name}`,
451
- isSelected: t?.name === e.name,
452
- isFocused: i === a,
453
- title: e.name,
454
- description: e.description,
455
- metadata: e.arguments && e.arguments.length > 0 && /* @__PURE__ */ (0, R.jsxs)(r, {
456
- variant: "outline",
457
- className: "text-xs border-gray-300 dark:border-zinc-600 text-gray-600 dark:text-gray-400",
458
- children: [e.arguments.length, " args"]
459
- }),
460
- onClick: () => n(e)
461
- }, e.name)) });
462
- }
463
- //#endregion
464
- //#region src/client/components/prompts/SavedPromptsList.tsx
465
- function de({ savedPrompts: e, selectedPrompt: t, onLoadPrompt: n, onDeletePrompt: r, focusedIndex: i }) {
466
- return e.length === 0 ? /* @__PURE__ */ (0, R.jsxs)("div", {
467
- className: "flex flex-1 flex-col items-center justify-center p-4 text-center",
468
- children: [
469
- /* @__PURE__ */ (0, R.jsx)(b, { className: "h-12 w-12 text-gray-400 dark:text-gray-600 mb-3" }),
470
- /* @__PURE__ */ (0, R.jsx)("p", {
471
- className: "text-gray-500 dark:text-gray-400",
472
- children: "No history"
473
- }),
474
- /* @__PURE__ */ (0, R.jsx)("p", {
475
- className: "text-sm text-gray-400 dark:text-gray-500 mt-1",
476
- children: "Prompts you execute will appear here"
477
- })
478
- ]
479
- }) : /* @__PURE__ */ (0, R.jsx)("div", { children: e.map((e, r) => /* @__PURE__ */ (0, R.jsx)(T, {
480
- id: `saved-prompt-${e.id}`,
481
- isSelected: t?.id === e.id,
482
- isFocused: i === r,
483
- title: e.name,
484
- description: `${e.promptName} - ${new Date(e.savedAt).toLocaleString()}`,
485
- onClick: () => n(e)
486
- }, e.id)) });
487
- }
488
- //#endregion
489
- //#region src/client/components/PromptsTab.tsx
490
- var fe = "mcp-inspector-saved-prompts";
491
- function K({ ref: e, prompts: t, callPrompt: r, serverId: i, isConnected: a, refreshPrompts: o }) {
492
- let [s, c] = (0, L.useState)(!1), [l, d] = (0, L.useState)(null), { selectedPromptName: f, setSelectedPromptName: p } = ae(), [m, te] = (0, L.useState)(null), [h, g] = (0, L.useState)("prompts"), [_, ne] = (0, L.useState)([]), [re, T] = (0, L.useState)(!1), [ie, D] = (0, L.useState)(""), [k, A] = (0, L.useState)(!1), [j, M] = (0, L.useState)(-1), N = (0, L.useRef)(null), [P, F] = (0, L.useState)(!1), [I, z] = (0, L.useState)("list"), [B, V] = (0, L.useState)(!1), { filteredPrompts: H, selectedPrompt: U, setSelectedPrompt: W, results: G, handleDeleteResult: K, promptArgs: pe, setPromptArgs: me, isExecuting: q, handlePromptSelect: J, handleArgChange: he, executeSelectedPrompt: ge, searchQuery: Y, setSearchQuery: X } = oe({
493
- prompts: t,
494
- callPrompt: r,
495
- serverId: i
496
- }), Z = E(), Q = E();
497
- (0, L.useEffect)(() => {
498
- let e = () => {
499
- F(window.innerWidth < 1024);
500
- };
501
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
502
- }, []), (0, L.useEffect)(() => {
503
- z(U ? "detail" : "list");
504
- }, [U]), (0, L.useEffect)(() => {
505
- P && G.length > 0 && !q && z("response");
506
- }, [
507
- G,
508
- q,
509
- P
510
- ]), (0, L.useImperativeHandle)(e, () => ({
511
- focusSearch: () => {
512
- A(!0), setTimeout(() => {
513
- N.current && N.current.focus();
514
- }, 0);
515
- },
516
- blurSearch: () => {
517
- X(""), A(!1), N.current && N.current.blur();
518
- }
519
- })), (0, L.useEffect)(() => {
520
- try {
521
- let e = localStorage.getItem(fe);
522
- e && ne(JSON.parse(e));
523
- } catch (e) {
524
- console.error("[PromptsTab] Failed to load saved prompts:", e);
525
- }
526
- }, []);
527
- let _e = (0, L.useCallback)((e) => {
528
- try {
529
- localStorage.setItem(fe, JSON.stringify(e));
530
- } catch (e) {
531
- console.error("[PromptsTab] Failed to save prompts:", e);
532
- }
533
- }, []);
534
- (0, L.useEffect)(() => {
535
- k && N.current && N.current.focus();
536
- }, [k]);
537
- let ve = (0, L.useCallback)(() => {
538
- Y.trim() || A(!1);
539
- }, [Y]), ye = (0, L.useCallback)(async () => {
540
- if (o) {
541
- c(!0);
542
- try {
543
- await o();
544
- } finally {
545
- c(!1);
546
- }
547
- }
548
- }, [o]), $ = (0, L.useCallback)((e) => {
549
- let n = t.find((t) => t.name === e.promptName);
550
- n && (W(n), me(e.args), d(e));
551
- }, [
552
- t,
553
- W,
554
- me
555
- ]);
556
- (0, L.useEffect)(() => {
557
- M(-1);
558
- }, [Y, h]), (0, L.useEffect)(() => {
559
- let e = (e) => {
560
- let t = e.target;
561
- if (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.contentEditable === "true" || e.metaKey || e.ctrlKey || e.altKey) return;
562
- let n = h === "prompts" ? H : _;
563
- if (e.key === "ArrowDown") e.preventDefault(), M((e) => {
564
- let t = e + 1;
565
- return t >= n.length ? 0 : t;
566
- });
567
- else if (e.key === "ArrowUp") e.preventDefault(), M((e) => {
568
- let t = e - 1;
569
- return t < 0 ? n.length - 1 : t;
570
- });
571
- else if (e.key === "Enter" && j >= 0) if (e.preventDefault(), h === "prompts") {
572
- let e = H[j];
573
- e && J(e);
574
- } else {
575
- let e = _[j];
576
- e && $(e);
577
- }
578
- };
579
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
580
- }, [
581
- j,
582
- H,
583
- _,
584
- h,
585
- J,
586
- $
587
- ]), (0, L.useEffect)(() => {
588
- if (j >= 0) {
589
- let e = h === "prompts" ? `prompt-${H[j]?.name}` : `saved-prompt-${_[j]?.id}`, t = document.getElementById(e);
590
- t && t.scrollIntoView({
591
- behavior: "smooth",
592
- block: "nearest"
593
- });
594
- }
595
- }, [
596
- j,
597
- H,
598
- _,
599
- h
600
- ]), (0, L.useEffect)(() => {
601
- if (console.warn("[PromptsTab] Auto-selection effect triggered:", {
602
- selectedPromptName: f,
603
- promptsCount: t.length,
604
- currentSelectedPrompt: U?.name
605
- }), f && t.length > 0) {
606
- let e = t.find((e) => e.name === f);
607
- if (console.warn("[PromptsTab] Prompt lookup result:", {
608
- selectedPromptName: f,
609
- promptFound: !!e,
610
- promptName: e?.name,
611
- shouldSelect: e && U?.name !== e.name
612
- }), e && U?.name !== e.name) {
613
- console.warn("[PromptsTab] Selecting prompt:", e.name), p(null);
614
- let t = setTimeout(() => {
615
- J(e);
616
- let t = document.getElementById(`prompt-${e.name}`);
617
- t && (console.warn("[PromptsTab] Scrolling to prompt element"), t.scrollIntoView({
618
- behavior: "smooth",
619
- block: "nearest"
620
- }));
621
- }, 100);
622
- return () => clearTimeout(t);
623
- }
624
- }
625
- }, [
626
- f,
627
- t,
628
- U,
629
- J,
630
- p
631
- ]);
632
- let be = (0, L.useCallback)(async (e, t) => {
633
- try {
634
- await v(JSON.stringify(t, null, 2)), te(e), setTimeout(() => te(null), 2e3);
635
- } catch (e) {
636
- console.error("[PromptsTab] Failed to copy result:", e);
637
- }
638
- }, []), xe = (0, L.useCallback)((e) => {
639
- if (P) z("response");
640
- else {
641
- let t = G[e];
642
- if (t) {
643
- let e = window.open("", "_blank", "width=800,height=600");
644
- if (e) {
645
- let n = t.result;
646
- e.document.write(`
647
- <html>
648
- <head>
649
- <title>${t.promptName} Result</title>
650
- <style>
651
- body { font-family: monospace; padding: 20px; background: #1e1e1e; color: #d4d4d4; }
652
- pre { white-space: pre-wrap; word-wrap: break-word; }
653
- </style>
654
- </head>
655
- <body>
656
- <h2>${t.promptName}</h2>
657
- <pre>${JSON.stringify(n, null, 2)}</pre>
658
- </body>
659
- </html>
660
- `), e.document.close();
661
- }
662
- }
663
- }
664
- }, [P, G]), Se = (0, L.useCallback)(() => {
665
- B ? (Z.current && Z.current.expand(), Q.current && Q.current.expand(), V(!1)) : (Z.current && Z.current.collapse(), Q.current && Q.current.collapse(), V(!0));
666
- }, [
667
- B,
668
- Z,
669
- Q
670
- ]), Ce = (0, L.useCallback)(() => {
671
- U && (D(""), T(!0));
672
- }, [U]), we = (0, L.useCallback)((e) => {
673
- _e(_.filter((t) => t.id !== e)), l?.id === e && d(null);
674
- }, [
675
- _,
676
- _e,
677
- l
678
- ]);
679
- return P ? /* @__PURE__ */ (0, R.jsxs)("div", {
680
- className: "h-full flex flex-col overflow-hidden relative bg-background",
681
- children: [I !== "list" && /* @__PURE__ */ (0, R.jsxs)("div", {
682
- className: "flex items-center gap-2 p-2 border-b shrink-0 bg-background z-10",
683
- children: [/* @__PURE__ */ (0, R.jsx)(u, {
684
- variant: "ghost",
685
- size: "sm",
686
- onClick: () => {
687
- I === "response" ? z("detail") : (W(null), z("list"));
688
- },
689
- className: "p-0 h-8 w-8",
690
- children: /* @__PURE__ */ (0, R.jsx)(y, { className: "h-4 w-4" })
691
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
692
- className: "flex items-center text-sm font-medium",
693
- children: [
694
- /* @__PURE__ */ (0, R.jsx)("button", {
695
- onClick: () => {
696
- W(null), z("list");
697
- },
698
- className: "text-muted-foreground hover:text-foreground hover:underline cursor-pointer",
699
- children: "Prompts"
700
- }),
701
- I === "detail" && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)("span", {
702
- className: "mx-2 text-muted-foreground",
703
- children: "/"
704
- }), /* @__PURE__ */ (0, R.jsx)("button", {
705
- onClick: () => {
706
- z("response");
707
- },
708
- className: I === "detail" ? "text-foreground hover:underline" : I === "response" ? "text-muted-foreground hover:text-foreground hover:underline cursor-pointer" : "text-muted-foreground",
709
- children: "Execute"
710
- })] }),
711
- I === "response" && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)("span", {
712
- className: "mx-2 text-muted-foreground",
713
- children: "/"
714
- }), /* @__PURE__ */ (0, R.jsx)("span", {
715
- className: "text-foreground",
716
- children: "Response"
717
- })] })
718
- ]
719
- })]
720
- }), /* @__PURE__ */ (0, R.jsx)("div", {
721
- className: "flex-1 relative overflow-hidden",
722
- children: /* @__PURE__ */ (0, R.jsxs)(ee, {
723
- initial: !1,
724
- mode: "popLayout",
725
- children: [
726
- I === "list" && /* @__PURE__ */ (0, R.jsx)(n.div, {
727
- initial: { x: "-100%" },
728
- animate: { x: 0 },
729
- exit: { x: "-100%" },
730
- transition: {
731
- type: "spring",
732
- stiffness: 300,
733
- damping: 30
734
- },
735
- className: "absolute inset-0 flex flex-col bg-background z-0",
736
- children: /* @__PURE__ */ (0, R.jsx)(C, { children: (e) => /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(se, {
737
- isScrolled: e,
738
- activeTab: h,
739
- isSearchExpanded: k,
740
- searchQuery: Y,
741
- primaryTabName: "prompts",
742
- secondaryTabName: "saved",
743
- primaryTabTitle: "Prompts",
744
- secondaryTabTitle: "History",
745
- primaryCount: H.length,
746
- secondaryCount: _.length,
747
- primaryIcon: O,
748
- secondaryIcon: b,
749
- searchPlaceholder: "Search prompts...",
750
- onSearchExpand: () => A(!0),
751
- onSearchChange: X,
752
- onSearchBlur: ve,
753
- onTabSwitch: () => g(h === "prompts" ? "saved" : "prompts"),
754
- searchInputRef: N,
755
- onRefresh: o ? ye : void 0,
756
- isRefreshing: s
757
- }), h === "prompts" ? /* @__PURE__ */ (0, R.jsx)(ue, {
758
- prompts: H,
759
- selectedPrompt: U,
760
- onPromptSelect: J,
761
- focusedIndex: j
762
- }) : /* @__PURE__ */ (0, R.jsx)(de, {
763
- savedPrompts: _,
764
- selectedPrompt: l,
765
- onLoadPrompt: $,
766
- onDeletePrompt: we,
767
- focusedIndex: j
768
- })] }) })
769
- }, "list"),
770
- I === "detail" && /* @__PURE__ */ (0, R.jsx)(n.div, {
771
- initial: { x: "100%" },
772
- animate: { x: 0 },
773
- exit: { x: "-100%" },
774
- transition: {
775
- type: "spring",
776
- stiffness: 300,
777
- damping: 30
778
- },
779
- className: "absolute inset-0 bg-background z-10",
780
- children: /* @__PURE__ */ (0, R.jsx)(ce, {
781
- selectedPrompt: U,
782
- promptArgs: pe,
783
- isExecuting: q,
784
- isConnected: a,
785
- onArgChange: he,
786
- onExecute: ge,
787
- onSave: Ce
788
- })
789
- }, "detail"),
790
- I === "response" && /* @__PURE__ */ (0, R.jsx)(n.div, {
791
- initial: { x: "100%" },
792
- animate: { x: 0 },
793
- exit: { x: "100%" },
794
- transition: {
795
- type: "spring",
796
- stiffness: 300,
797
- damping: 30
798
- },
799
- className: "absolute inset-0 bg-background z-20",
800
- children: /* @__PURE__ */ (0, R.jsx)(le, {
801
- results: G,
802
- copiedResult: m,
803
- onCopy: be,
804
- onDelete: K,
805
- onFullscreen: xe
806
- })
807
- }, "response")
808
- ]
809
- })
810
- })]
811
- }) : /* @__PURE__ */ (0, R.jsxs)(w, {
812
- orientation: "horizontal",
813
- className: "h-full",
814
- children: [
815
- /* @__PURE__ */ (0, R.jsx)(x, {
816
- id: "left-panel",
817
- panelRef: Z,
818
- defaultSize: "33%",
819
- collapsible: !0,
820
- className: "flex flex-col h-full relative",
821
- children: /* @__PURE__ */ (0, R.jsx)("div", {
822
- className: "flex h-full flex-col overflow-hidden border-r dark:border-zinc-700",
823
- children: /* @__PURE__ */ (0, R.jsx)(C, { children: (e) => /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(se, {
824
- isScrolled: e,
825
- activeTab: h,
826
- isSearchExpanded: k,
827
- searchQuery: Y,
828
- primaryTabName: "prompts",
829
- secondaryTabName: "saved",
830
- primaryTabTitle: "Prompts",
831
- secondaryTabTitle: "History",
832
- primaryCount: H.length,
833
- secondaryCount: _.length,
834
- primaryIcon: O,
835
- secondaryIcon: b,
836
- searchPlaceholder: "Search prompts...",
837
- onSearchExpand: () => A(!0),
838
- onSearchChange: X,
839
- onSearchBlur: ve,
840
- onTabSwitch: () => g(h === "prompts" ? "saved" : "prompts"),
841
- searchInputRef: N,
842
- onRefresh: o ? ye : void 0,
843
- isRefreshing: s
844
- }), h === "prompts" ? /* @__PURE__ */ (0, R.jsx)(ue, {
845
- prompts: H,
846
- selectedPrompt: U,
847
- onPromptSelect: J,
848
- focusedIndex: j
849
- }) : /* @__PURE__ */ (0, R.jsx)(de, {
850
- savedPrompts: _,
851
- selectedPrompt: l,
852
- onLoadPrompt: $,
853
- onDeletePrompt: we,
854
- focusedIndex: j
855
- })] }) })
856
- })
857
- }),
858
- /* @__PURE__ */ (0, R.jsx)(S, { withHandle: !0 }),
859
- /* @__PURE__ */ (0, R.jsx)(x, {
860
- defaultSize: "67%",
861
- children: /* @__PURE__ */ (0, R.jsxs)(w, {
862
- orientation: "vertical",
863
- children: [
864
- /* @__PURE__ */ (0, R.jsx)(x, {
865
- panelRef: Q,
866
- defaultSize: "40%",
867
- collapsible: !0,
868
- children: /* @__PURE__ */ (0, R.jsx)(ce, {
869
- selectedPrompt: U,
870
- promptArgs: pe,
871
- isExecuting: q,
872
- isConnected: a,
873
- onArgChange: he,
874
- onExecute: ge,
875
- onSave: Ce
876
- })
877
- }),
878
- /* @__PURE__ */ (0, R.jsx)(S, { withHandle: !0 }),
879
- /* @__PURE__ */ (0, R.jsx)(x, {
880
- defaultSize: "60%",
881
- children: /* @__PURE__ */ (0, R.jsx)("div", {
882
- className: "flex flex-col h-full",
883
- children: /* @__PURE__ */ (0, R.jsx)(le, {
884
- results: G,
885
- copiedResult: m,
886
- onCopy: be,
887
- onDelete: K,
888
- onFullscreen: xe,
889
- onMaximize: Se,
890
- isMaximized: B
891
- })
892
- })
893
- })
894
- ]
895
- })
896
- })
897
- ]
898
- });
899
- }
900
- K.displayName = "PromptsTab";
901
- //#endregion
902
- export { K as PromptsTab };