@burdenoff/microfe-botmanor 2026.1120.7 → 2026.1120.8

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 (39) hide show
  1. package/dist/botlit/components/DashboardUsagePanel.d.ts +8 -0
  2. package/dist/botlit/components/DashboardUsagePanel.js +277 -0
  3. package/dist/botlit/components/DashboardUsagePanel.js.map +1 -0
  4. package/dist/botlit/components/LiveIndicator.d.ts +9 -0
  5. package/dist/botlit/components/LiveIndicator.js +21 -0
  6. package/dist/botlit/components/LiveIndicator.js.map +1 -0
  7. package/dist/botlit/components/RunStatsCard.d.ts +9 -0
  8. package/dist/botlit/components/RunStatsCard.js +138 -0
  9. package/dist/botlit/components/RunStatsCard.js.map +1 -0
  10. package/dist/botlit/hooks/useExecutionLiveUpdates.d.ts +29 -0
  11. package/dist/botlit/hooks/useExecutionLiveUpdates.js +124 -0
  12. package/dist/botlit/hooks/useExecutionLiveUpdates.js.map +1 -0
  13. package/dist/botlit/hooks/useUsageStats.d.ts +71 -0
  14. package/dist/botlit/hooks/useUsageStats.js +115 -0
  15. package/dist/botlit/hooks/useUsageStats.js.map +1 -0
  16. package/dist/botlit/pages/AgentDetailPage.js +48 -43
  17. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  18. package/dist/botlit/pages/BotDetailPage.js +317 -309
  19. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  20. package/dist/botlit/pages/DashboardPage.js +155 -153
  21. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  22. package/dist/botlit/pages/ExecutionDetailPage.js +142 -132
  23. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  24. package/dist/botlit/pages/ExecutionsPage.js +150 -141
  25. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  26. package/dist/botlit/pages/PromptStudioPage.js +172 -172
  27. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  28. package/dist/botlit/permissions/botmanorPermissions.d.ts +1 -0
  29. package/dist/botlit/permissions/botmanorPermissions.js +1 -0
  30. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
  31. package/dist/botlit/utils/formatters.js +6 -2
  32. package/dist/botlit/utils/formatters.js.map +1 -1
  33. package/dist/generated/wspace-operations.d.ts +264 -0
  34. package/dist/generated/wspace-operations.js +95 -6
  35. package/dist/generated/wspace-operations.js.map +1 -1
  36. package/dist/generated/wspace-types.d.ts +98 -0
  37. package/dist/generated/wspace-types.js +8 -4
  38. package/dist/generated/wspace-types.js.map +1 -1
  39. package/package.json +1 -1
@@ -1,81 +1,81 @@
1
1
  import { PageLayout as e } from "../components/PageLayout.js";
2
2
  import { Card as t, CardContent as n, CardDescription as r, CardHeader as i, CardTitle as a } from "../components/Card.js";
3
3
  import { Button as o } from "../components/Button.js";
4
- import { FormField as s, Input as c, Textarea as ee } from "../components/Input.js";
5
- import { BOTMANOR_PERMISSIONS as l } from "../permissions/botmanorPermissions.js";
6
- import { BotmanorPermissionGate as u } from "../permissions/useBotmanorPermissions.js";
7
- import { Badge as d } from "../components/Badge.js";
8
- import { EmptyState as te } from "../components/EmptyState.js";
9
- import { ErrorState as ne } from "../components/ErrorState.js";
10
- import { useBotlit as re } from "../providers/BotlitProvider.js";
4
+ import { FormField as s, Input as c, Textarea as l } from "../components/Input.js";
5
+ import { BOTMANOR_PERMISSIONS as u } from "../permissions/botmanorPermissions.js";
6
+ import { BotmanorPermissionGate as d } from "../permissions/useBotmanorPermissions.js";
7
+ import { Badge as f } from "../components/Badge.js";
8
+ import { EmptyState as ee } from "../components/EmptyState.js";
9
+ import { ErrorState as te } from "../components/ErrorState.js";
10
+ import { useBotlit as ne } from "../providers/BotlitProvider.js";
11
11
  import "../hooks/index.js";
12
- import { useLLMModels as ie } from "../hooks/useLLMProviders.js";
13
- import { PromptVersionBump as f } from "../../generated/wspace-types.js";
14
- import { confirmAction as ae } from "../utils/confirmAction.js";
15
- import { graphqlErrorMessage as p } from "../utils/errors.js";
16
- import { promptTemplateVariables as m, usePromptTemplates as oe } from "../hooks/usePromptTemplates.js";
12
+ import { useLLMModels as re } from "../hooks/useLLMProviders.js";
13
+ import { PromptVersionBump as p } from "../../generated/wspace-types.js";
14
+ import { confirmAction as ie } from "../utils/confirmAction.js";
15
+ import { graphqlErrorMessage as m } from "../utils/errors.js";
16
+ import { typedVariableValue as ae } from "../utils/promptVariables.js";
17
+ import { promptTemplateVariables as h, usePromptTemplates as oe } from "../hooks/usePromptTemplates.js";
17
18
  import { usePromptTemplateVersions as se, useSavePromptTemplateVersion as ce, useTestPromptTemplate as le } from "../hooks/useAgentBindings.js";
18
- import { typedVariableValue as ue } from "../utils/promptVariables.js";
19
- import { formatRelativeTime as h } from "../utils/formatters.js";
19
+ import { formatRelativeTime as g } from "../utils/formatters.js";
20
20
  import "../permissions/index.js";
21
- import { useEffect as g, useMemo as _, useRef as de, useState as v } from "react";
22
- import { PagePurpose as fe } from "@burdenoff/fe-libs/ui";
23
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
24
- import { GitCompare as pe, History as me, Play as S, Plus as he, Save as ge } from "lucide-react";
25
- import { toast as C } from "sonner";
21
+ import { useEffect as _, useMemo as v, useRef as ue, useState as y } from "react";
22
+ import { PagePurpose as de } from "@burdenoff/fe-libs/ui";
23
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
24
+ import { GitCompare as fe, History as pe, Play as me, Plus as he, Save as ge } from "lucide-react";
25
+ import { toast as _e } from "sonner";
26
26
  // src/botlit/pages/PromptStudioPage.tsx
27
- var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm", _e = ({ run: e }) => /* @__PURE__ */ x(t, {
27
+ var ve = (e) => e, C = (e) => ({ variables: e }), w = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm", ye = ({ run: e }) => /* @__PURE__ */ S(t, {
28
28
  "data-testid": `prompt-run-${e.label.toLowerCase().replace(/\s+/g, "-")}`,
29
- children: [/* @__PURE__ */ x(i, { children: [/* @__PURE__ */ b(a, {
29
+ children: [/* @__PURE__ */ S(i, { children: [/* @__PURE__ */ x(a, {
30
30
  className: "text-base",
31
31
  children: e.label
32
- }), e.result && /* @__PURE__ */ x(r, { children: [
32
+ }), e.result && /* @__PURE__ */ S(r, { children: [
33
33
  e.result.model,
34
34
  " · ",
35
35
  e.result.tokensUsed,
36
36
  " tokens · ",
37
37
  e.result.latencyMs,
38
38
  " ms"
39
- ] })] }), /* @__PURE__ */ b(n, {
39
+ ] })] }), /* @__PURE__ */ x(n, {
40
40
  className: "space-y-3",
41
- children: e.error ? /* @__PURE__ */ b("p", {
41
+ children: e.error ? /* @__PURE__ */ x("p", {
42
42
  role: "alert",
43
43
  className: "text-sm text-status-error-text",
44
44
  children: e.error
45
- }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
45
+ }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("div", {
46
46
  className: "whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 text-sm",
47
47
  children: e.result?.output
48
- }), /* @__PURE__ */ x("details", {
48
+ }), /* @__PURE__ */ S("details", {
49
49
  className: "text-xs text-text-secondary",
50
- children: [/* @__PURE__ */ b("summary", {
50
+ children: [/* @__PURE__ */ x("summary", {
51
51
  className: "cursor-pointer",
52
52
  children: "Rendered prompt"
53
- }), /* @__PURE__ */ b("pre", {
53
+ }), /* @__PURE__ */ x("pre", {
54
54
  className: "mt-2 whitespace-pre-wrap font-mono",
55
55
  children: e.result?.renderedPrompt
56
56
  })]
57
57
  })] })
58
58
  })]
59
- }), D = () => {
60
- let { navigateTo: y } = re(), { data: D, loading: ve, error: O, refetch: ye } = oe(), be = ie(), { run: xe, loading: k } = le(), { save: Se, loading: A } = ce(), [j, M] = v(null), [N, P] = v(""), [F, I] = v({}), [L, R] = v(""), [z, Ce] = v(""), [B, V] = v([]), [H, we] = v(f.Patch), [U, W] = v(""), [G, K] = v(null), q = de(null);
61
- g(() => {
62
- !j && D.length > 0 && M(D[0].id);
63
- }, [D, j]);
64
- let J = _(() => D.find((e) => e.id === j), [D, j]), Y = se(J?.id), Te = _(() => J ? m(G === null ? J : T(G)) : [], [J, G]), X = _(() => be.data.filter((e) => e.isActive), [be.data]), Ee = _(() => {
65
- let e = new Map(Te.map((e) => [e.name, e]));
66
- for (let t of Y.data) for (let n of m(T(t.variables))) e.has(n.name) || e.set(n.name, n);
59
+ }), T = () => {
60
+ let { navigateTo: b } = ne(), { data: T, loading: be, error: E, refetch: D } = oe(), O = re(), { run: xe, loading: k } = le(), { save: Se, loading: A } = ce(), [j, M] = y(null), [N, P] = y(""), [F, I] = y({}), [L, R] = y(""), [z, Ce] = y(""), [B, V] = y([]), [H, we] = y(p.Patch), [U, Te] = y(""), [W, G] = y(null), K = ue(null);
61
+ _(() => {
62
+ !j && T.length > 0 && M(T[0].id);
63
+ }, [T, j]);
64
+ let q = v(() => T.find((e) => e.id === j), [T, j]), J = se(q?.id), Ee = v(() => q ? h(W === null ? q : C(W)) : [], [q, W]), Y = v(() => O.data.filter((e) => e.isActive), [O.data]), De = v(() => {
65
+ let e = new Map(Ee.map((e) => [e.name, e]));
66
+ for (let t of J.data) for (let n of h(C(t.variables))) e.has(n.name) || e.set(n.name, n);
67
67
  return [...e.values()];
68
- }, [Te, Y.data]);
69
- g(() => {
70
- q.current = J?.id ?? null, P(J?.templateText ?? ""), K(null);
71
- }, [J?.id, J?.templateText]), g(() => {
72
- !L && X.length > 0 && R(X[0].id);
73
- }, [X, L]);
74
- let Z = !!J && (N !== J?.templateText || G !== null), Q = !!(J && L && z.trim()), De = (e) => {
75
- let t = new Map(m(e === null && J ? J : T(e)).map((e) => [e.name, e.type]));
76
- return Object.fromEntries(Object.entries(F).filter(([e, n]) => n !== "" && t.has(e)).map(([e, n]) => [e, ue(t.get(e) ?? "string", n)]));
77
- }, $ = async (e, t, n = null) => {
78
- if (!J) return {
68
+ }, [Ee, J.data]);
69
+ _(() => {
70
+ K.current = q?.id ?? null, P(q?.templateText ?? ""), G(null);
71
+ }, [q?.id, q?.templateText]), _(() => {
72
+ !L && Y.length > 0 && R(Y[0].id);
73
+ }, [Y, L]);
74
+ let X = !!q && (N !== q?.templateText || W !== null), Z = !!(q && L && z.trim()), Oe = (e) => {
75
+ let t = new Map(h(e === null && q ? q : C(e)).map((e) => [e.name, e.type]));
76
+ return Object.fromEntries(Object.entries(F).filter(([e, n]) => n !== "" && t.has(e)).map(([e, n]) => [e, ae(t.get(e) ?? "string", n)]));
77
+ }, Q = async (e, t, n = null) => {
78
+ if (!q) return {
79
79
  label: e,
80
80
  error: "Select a prompt"
81
81
  };
@@ -83,119 +83,119 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
83
83
  return {
84
84
  label: e,
85
85
  result: await xe({
86
- templateId: J.id,
86
+ templateId: q.id,
87
87
  input: {
88
88
  llmModelId: L,
89
89
  userMessage: z,
90
- variables: De(n),
90
+ variables: Oe(n),
91
91
  ...t === void 0 ? {} : { templateText: t },
92
- ...n === null ? {} : { variableDefinitions: w(n) }
92
+ ...n === null ? {} : { variableDefinitions: ve(n) }
93
93
  }
94
94
  })
95
95
  };
96
96
  } catch (t) {
97
97
  return {
98
98
  label: e,
99
- error: p(t, "The model run failed")
99
+ error: m(t, "The model run failed")
100
100
  };
101
101
  }
102
- }, Oe = async (e) => {
103
- e !== J?.id && (!Z || await ae({
102
+ }, ke = async (e) => {
103
+ e !== q?.id && (!X || await ie({
104
104
  title: "Discard draft?",
105
105
  message: "This prompt has an unsaved draft. Discard it and open the other prompt?",
106
106
  confirmLabel: "Discard draft",
107
107
  cancelLabel: "Keep editing"
108
108
  })) && (M(e), I({}), V([]));
109
- }, ke = (e, t) => {
110
- e && e === q.current && V(t);
109
+ }, $ = (e, t) => {
110
+ e && e === K.current && V(t);
111
111
  }, Ae = async () => {
112
- let e = J?.id;
113
- ke(e, [await $("Draft", N, G)]);
112
+ let e = q?.id;
113
+ $(e, [await Q("Draft", N, W)]);
114
114
  }, je = async (e, t, n = null) => {
115
- let r = J?.id, [i, a] = await Promise.all([$(e, t, n), $("Draft", N, G)]);
116
- ke(r, [i, a]);
115
+ let r = q?.id, [i, a] = await Promise.all([Q(e, t, n), Q("Draft", N, W)]);
116
+ $(r, [i, a]);
117
117
  }, Me = async () => {
118
- if (J) try {
118
+ if (q) try {
119
119
  let e = await Se({
120
- templateId: J.id,
120
+ templateId: q.id,
121
121
  input: {
122
122
  templateText: N,
123
- ...G === null ? {} : { variables: w(G) },
123
+ ...W === null ? {} : { variables: ve(W) },
124
124
  bump: H,
125
125
  ...U.trim() ? { changelog: U.trim() } : {}
126
126
  }
127
127
  });
128
- C.success(`Saved version ${e.version}`), q.current === e.id && (W(""), P(e.templateText), K(null)), await ye(), q.current === e.id && Y.refetch();
128
+ _e.success(`Saved version ${e.version}`), K.current === e.id && (Te(""), P(e.templateText), G(null)), await D(), K.current === e.id && J.refetch();
129
129
  } catch (e) {
130
- C.error(p(e, "Failed to save the prompt version"));
130
+ _e.error(m(e, "Failed to save the prompt version"));
131
131
  }
132
132
  };
133
- return /* @__PURE__ */ b(e, {
133
+ return /* @__PURE__ */ x(e, {
134
134
  title: "Prompt Studio",
135
135
  description: "Write a prompt, run it against a live model, compare and save versions",
136
- actions: /* @__PURE__ */ b(u, {
137
- permission: l.PROMPT_TEMPLATE_CREATE,
138
- children: /* @__PURE__ */ b(o, {
139
- leftIcon: /* @__PURE__ */ b(he, { size: 16 }),
140
- onClick: () => y("prompt-templates/new"),
136
+ actions: /* @__PURE__ */ x(d, {
137
+ permission: u.PROMPT_TEMPLATE_CREATE,
138
+ children: /* @__PURE__ */ x(o, {
139
+ leftIcon: /* @__PURE__ */ x(he, { size: 16 }),
140
+ onClick: () => b("prompt-templates/new"),
141
141
  children: "New Prompt"
142
142
  })
143
143
  }),
144
- children: /* @__PURE__ */ x("div", {
144
+ children: /* @__PURE__ */ S("div", {
145
145
  className: "space-y-6",
146
- children: [/* @__PURE__ */ b(fe, {
147
- icon: /* @__PURE__ */ b(S, { size: 18 }),
146
+ children: [/* @__PURE__ */ x(de, {
147
+ icon: /* @__PURE__ */ x(me, { size: 18 }),
148
148
  children: "Prompt Studio is your workbench for prompts. Pick a template, edit the draft, fill in variable values and a test message, then run it against one of your workspace's models. Compare the draft with the saved or an earlier version side by side, and save the draft as the template's next version when it answers the way you want."
149
- }), /* @__PURE__ */ x("div", {
149
+ }), /* @__PURE__ */ S("div", {
150
150
  className: "grid grid-cols-1 gap-6 lg:grid-cols-12",
151
151
  children: [
152
- /* @__PURE__ */ b("div", {
152
+ /* @__PURE__ */ x("div", {
153
153
  className: "lg:col-span-3",
154
- children: /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(a, {
154
+ children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ x(a, {
155
155
  className: "text-base",
156
156
  children: "Prompts"
157
- }) }), /* @__PURE__ */ b(n, {
157
+ }) }), /* @__PURE__ */ x(n, {
158
158
  className: "p-0",
159
- children: ve ? /* @__PURE__ */ b("div", {
159
+ children: be ? /* @__PURE__ */ x("div", {
160
160
  className: "space-y-2 p-4",
161
161
  children: [
162
162
  1,
163
163
  2,
164
164
  3
165
- ].map((e) => /* @__PURE__ */ b("div", { className: "h-14 rounded bg-bg-sunken motion-safe:animate-vc-shimmer" }, e))
166
- }) : O ? /* @__PURE__ */ b(ne, {
165
+ ].map((e) => /* @__PURE__ */ x("div", { className: "h-14 rounded bg-bg-sunken motion-safe:animate-vc-shimmer" }, e))
166
+ }) : E ? /* @__PURE__ */ x(te, {
167
167
  resource: "prompt templates",
168
- error: O,
169
- onRetry: () => void ye(),
168
+ error: E,
169
+ onRetry: () => void D(),
170
170
  className: "m-4"
171
- }) : D.length === 0 ? /* @__PURE__ */ b("p", {
171
+ }) : T.length === 0 ? /* @__PURE__ */ x("p", {
172
172
  className: "p-4 text-sm text-text-secondary",
173
173
  children: "No prompt templates yet. Create one to start iterating."
174
- }) : /* @__PURE__ */ b("div", {
174
+ }) : /* @__PURE__ */ x("div", {
175
175
  className: "divide-y divide-border-subtle",
176
- children: D.map((e) => /* @__PURE__ */ x("button", {
176
+ children: T.map((e) => /* @__PURE__ */ S("button", {
177
177
  type: "button",
178
- className: `w-full p-4 text-left transition-colors hover:bg-accent ${J?.id === e.id ? "bg-accent" : ""}`,
178
+ className: `w-full p-4 text-left transition-colors hover:bg-accent ${q?.id === e.id ? "bg-accent" : ""}`,
179
179
  disabled: k || A,
180
- onClick: () => void Oe(e.id),
180
+ onClick: () => void ke(e.id),
181
181
  children: [
182
- /* @__PURE__ */ b("p", {
182
+ /* @__PURE__ */ x("p", {
183
183
  className: "truncate font-medium",
184
184
  children: e.name
185
185
  }),
186
- /* @__PURE__ */ x("p", {
186
+ /* @__PURE__ */ S("p", {
187
187
  className: "mt-1 truncate text-xs text-text-secondary",
188
188
  children: ["v", e.version]
189
189
  }),
190
- /* @__PURE__ */ x("div", {
190
+ /* @__PURE__ */ S("div", {
191
191
  className: "mt-2 flex items-center gap-2",
192
- children: [e.visibility === "PUBLIC" && /* @__PURE__ */ b(d, {
192
+ children: [e.visibility === "PUBLIC" && /* @__PURE__ */ x(f, {
193
193
  variant: "secondary",
194
194
  className: "text-[10px]",
195
195
  children: "Public"
196
- }), /* @__PURE__ */ x("span", {
196
+ }), /* @__PURE__ */ S("span", {
197
197
  className: "text-xs text-text-secondary",
198
- children: [m(e).length, " vars"]
198
+ children: [h(e).length, " vars"]
199
199
  })]
200
200
  })
201
201
  ]
@@ -203,35 +203,35 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
203
203
  })
204
204
  })] })
205
205
  }),
206
- /* @__PURE__ */ x("div", {
206
+ /* @__PURE__ */ S("div", {
207
207
  className: "space-y-6 lg:col-span-6",
208
- children: [J ? /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ x(i, {
208
+ children: [q ? /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ S(i, {
209
209
  className: "flex flex-row items-center justify-between",
210
- children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x(a, { children: [
211
- J.name,
210
+ children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S(a, { children: [
211
+ q.name,
212
212
  " ",
213
- /* @__PURE__ */ x(d, {
213
+ /* @__PURE__ */ S(f, {
214
214
  variant: "outline",
215
215
  className: "ml-2",
216
- children: ["v", J.version]
216
+ children: ["v", q.version]
217
217
  }),
218
- Z && /* @__PURE__ */ b(d, {
218
+ X && /* @__PURE__ */ x(f, {
219
219
  variant: "secondary",
220
220
  className: "ml-2",
221
221
  children: "Unsaved draft"
222
222
  })
223
- ] }), /* @__PURE__ */ b(r, { children: J.description })] }), /* @__PURE__ */ b(o, {
223
+ ] }), /* @__PURE__ */ x(r, { children: q.description })] }), /* @__PURE__ */ x(o, {
224
224
  size: "sm",
225
225
  variant: "outline",
226
- onClick: () => y(`prompt-templates/${J.id}`),
226
+ onClick: () => b(`prompt-templates/${q.id}`),
227
227
  children: "Open template"
228
228
  })]
229
- }), /* @__PURE__ */ x(n, {
229
+ }), /* @__PURE__ */ S(n, {
230
230
  className: "space-y-4",
231
231
  children: [
232
- /* @__PURE__ */ b(s, {
232
+ /* @__PURE__ */ x(s, {
233
233
  label: "Draft prompt",
234
- children: /* @__PURE__ */ b(ee, {
234
+ children: /* @__PURE__ */ x(l, {
235
235
  "aria-label": "Draft prompt",
236
236
  readOnly: A || k,
237
237
  value: N,
@@ -240,95 +240,95 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
240
240
  className: "font-mono text-sm"
241
241
  })
242
242
  }),
243
- /* @__PURE__ */ b(u, {
244
- permission: l.PROMPT_TEMPLATE_UPDATE,
245
- children: /* @__PURE__ */ x("div", {
243
+ /* @__PURE__ */ x(d, {
244
+ permission: u.PROMPT_TEMPLATE_UPDATE,
245
+ children: /* @__PURE__ */ S("div", {
246
246
  className: "grid gap-3 sm:grid-cols-[10rem_1fr_auto] sm:items-end",
247
247
  children: [
248
- /* @__PURE__ */ x("label", {
248
+ /* @__PURE__ */ S("label", {
249
249
  className: "grid gap-1 text-sm",
250
- children: ["Version bump", /* @__PURE__ */ x("select", {
250
+ children: ["Version bump", /* @__PURE__ */ S("select", {
251
251
  "aria-label": "Version bump",
252
- className: E,
252
+ className: w,
253
253
  value: H,
254
254
  onChange: (e) => we(e.target.value),
255
255
  children: [
256
- /* @__PURE__ */ b("option", {
257
- value: f.Patch,
256
+ /* @__PURE__ */ x("option", {
257
+ value: p.Patch,
258
258
  children: "Patch"
259
259
  }),
260
- /* @__PURE__ */ b("option", {
261
- value: f.Minor,
260
+ /* @__PURE__ */ x("option", {
261
+ value: p.Minor,
262
262
  children: "Minor"
263
263
  }),
264
- /* @__PURE__ */ b("option", {
265
- value: f.Major,
264
+ /* @__PURE__ */ x("option", {
265
+ value: p.Major,
266
266
  children: "Major"
267
267
  })
268
268
  ]
269
269
  })]
270
270
  }),
271
- /* @__PURE__ */ x("label", {
271
+ /* @__PURE__ */ S("label", {
272
272
  className: "grid gap-1 text-sm",
273
- children: ["Change note", /* @__PURE__ */ b(c, {
273
+ children: ["Change note", /* @__PURE__ */ x(c, {
274
274
  "aria-label": "Change note",
275
275
  placeholder: "What changed in this version",
276
276
  value: U,
277
- onChange: (e) => W(e.target.value)
277
+ onChange: (e) => Te(e.target.value)
278
278
  })]
279
279
  }),
280
- /* @__PURE__ */ b(o, {
281
- leftIcon: /* @__PURE__ */ b(ge, { size: 16 }),
280
+ /* @__PURE__ */ x(o, {
281
+ leftIcon: /* @__PURE__ */ x(ge, { size: 16 }),
282
282
  onClick: () => void Me(),
283
283
  isLoading: A,
284
- disabled: !Z || !N.trim(),
284
+ disabled: !X || !N.trim(),
285
285
  children: "Save as new version"
286
286
  })
287
287
  ]
288
288
  })
289
289
  }),
290
- /* @__PURE__ */ x("div", {
290
+ /* @__PURE__ */ S("div", {
291
291
  className: "text-xs text-text-secondary",
292
- children: ["Updated ", h(J.updatedAt)]
292
+ children: ["Updated ", g(q.updatedAt)]
293
293
  })
294
294
  ]
295
- })] }) : /* @__PURE__ */ b(te, {
295
+ })] }) : /* @__PURE__ */ x(ee, {
296
296
  illustration: "onboarding",
297
297
  title: "Select a prompt",
298
298
  description: "Choose a prompt from the list to iterate on it"
299
- }), B.length > 0 && /* @__PURE__ */ b("div", {
299
+ }), B.length > 0 && /* @__PURE__ */ x("div", {
300
300
  className: `grid gap-4 ${B.length > 1 ? "md:grid-cols-2" : ""}`,
301
- children: B.map((e) => /* @__PURE__ */ b(_e, { run: e }, e.label))
301
+ children: B.map((e) => /* @__PURE__ */ x(ye, { run: e }, e.label))
302
302
  })]
303
303
  }),
304
- /* @__PURE__ */ x("div", {
304
+ /* @__PURE__ */ S("div", {
305
305
  className: "space-y-6 lg:col-span-3",
306
- children: [/* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ x(a, {
306
+ children: [/* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ S(a, {
307
307
  className: "flex items-center gap-2 text-base",
308
- children: [/* @__PURE__ */ b(S, { size: 16 }), "Run against a model"]
309
- }) }), /* @__PURE__ */ x(n, {
308
+ children: [/* @__PURE__ */ x(me, { size: 16 }), "Run against a model"]
309
+ }) }), /* @__PURE__ */ S(n, {
310
310
  className: "space-y-4",
311
311
  children: [
312
- /* @__PURE__ */ x("label", {
312
+ /* @__PURE__ */ S("label", {
313
313
  className: "grid gap-1 text-sm",
314
- children: ["Model", /* @__PURE__ */ x("select", {
314
+ children: ["Model", /* @__PURE__ */ S("select", {
315
315
  "aria-label": "Model",
316
316
  disabled: k,
317
- className: E,
317
+ className: w,
318
318
  value: L,
319
319
  onChange: (e) => R(e.target.value),
320
- children: [X.length === 0 && /* @__PURE__ */ b("option", {
320
+ children: [Y.length === 0 && /* @__PURE__ */ x("option", {
321
321
  value: "",
322
322
  children: "No active models"
323
- }), X.map((e) => /* @__PURE__ */ b("option", {
323
+ }), Y.map((e) => /* @__PURE__ */ x("option", {
324
324
  value: e.id,
325
325
  children: e.name
326
326
  }, e.id))]
327
327
  })]
328
328
  }),
329
- Ee.map((e) => /* @__PURE__ */ b(s, {
329
+ De.map((e) => /* @__PURE__ */ x(s, {
330
330
  label: e.name,
331
- children: /* @__PURE__ */ b(c, {
331
+ children: /* @__PURE__ */ x(c, {
332
332
  "aria-label": `Value for ${e.name}`,
333
333
  readOnly: k,
334
334
  placeholder: typeof e.defaultValue == "string" ? `Default: ${e.defaultValue}` : e.description || `Enter ${e.name}`,
@@ -339,9 +339,9 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
339
339
  })
340
340
  })
341
341
  }, e.name)),
342
- /* @__PURE__ */ b(s, {
342
+ /* @__PURE__ */ x(s, {
343
343
  label: "Test message",
344
- children: /* @__PURE__ */ b(ee, {
344
+ children: /* @__PURE__ */ x(l, {
345
345
  "aria-label": "Test message",
346
346
  readOnly: k,
347
347
  rows: 3,
@@ -350,73 +350,73 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
350
350
  onChange: (e) => Ce(e.target.value)
351
351
  })
352
352
  }),
353
- /* @__PURE__ */ b(u, {
354
- permission: l.PROMPT_TEMPLATE_EXECUTE,
355
- children: /* @__PURE__ */ x("div", {
353
+ /* @__PURE__ */ x(d, {
354
+ permission: u.PROMPT_TEMPLATE_EXECUTE,
355
+ children: /* @__PURE__ */ S("div", {
356
356
  className: "grid gap-2",
357
- children: [/* @__PURE__ */ b(o, {
357
+ children: [/* @__PURE__ */ x(o, {
358
358
  onClick: () => void Ae(),
359
359
  isLoading: k,
360
- disabled: !Q,
360
+ disabled: !Z,
361
361
  children: "Run draft"
362
- }), /* @__PURE__ */ b(o, {
362
+ }), /* @__PURE__ */ x(o, {
363
363
  variant: "outline",
364
- leftIcon: /* @__PURE__ */ b(pe, { size: 16 }),
365
- onClick: () => void je(`Saved v${J?.version}`, J?.templateText ?? ""),
366
- disabled: !Q || k,
364
+ leftIcon: /* @__PURE__ */ x(fe, { size: 16 }),
365
+ onClick: () => void je(`Saved v${q?.version}`, q?.templateText ?? ""),
366
+ disabled: !Z || k,
367
367
  children: "Compare with saved"
368
368
  })]
369
369
  })
370
370
  })
371
371
  ]
372
- })] }), /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ x(a, {
372
+ })] }), /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ S(a, {
373
373
  className: "flex items-center gap-2 text-base",
374
- children: [/* @__PURE__ */ b(me, { size: 16 }), "Versions"]
375
- }) }), /* @__PURE__ */ b(n, {
374
+ children: [/* @__PURE__ */ x(pe, { size: 16 }), "Versions"]
375
+ }) }), /* @__PURE__ */ x(n, {
376
376
  className: "space-y-3",
377
- children: Y.error ? /* @__PURE__ */ b(ne, {
377
+ children: J.error ? /* @__PURE__ */ x(te, {
378
378
  resource: "prompt versions",
379
- error: Y.error,
380
- onRetry: () => void Y.refetch()
381
- }) : Y.loading && Y.data.length === 0 ? /* @__PURE__ */ b("p", {
379
+ error: J.error,
380
+ onRetry: () => void J.refetch()
381
+ }) : J.loading && J.data.length === 0 ? /* @__PURE__ */ x("p", {
382
382
  className: "text-sm text-text-secondary",
383
383
  children: "Loading versions…"
384
- }) : Y.data.length === 0 ? /* @__PURE__ */ b("p", {
384
+ }) : J.data.length === 0 ? /* @__PURE__ */ x("p", {
385
385
  className: "text-sm text-text-secondary",
386
386
  children: "No earlier versions. Saving a draft keeps the current one here."
387
- }) : Y.data.map((e) => /* @__PURE__ */ x("div", {
387
+ }) : J.data.map((e) => /* @__PURE__ */ S("div", {
388
388
  className: "space-y-2 rounded-lg border border-border-subtle p-3",
389
389
  children: [
390
- /* @__PURE__ */ x("div", {
390
+ /* @__PURE__ */ S("div", {
391
391
  className: "flex items-center justify-between",
392
- children: [/* @__PURE__ */ x(d, {
392
+ children: [/* @__PURE__ */ S(f, {
393
393
  variant: "outline",
394
394
  children: ["v", e.version]
395
- }), /* @__PURE__ */ b("span", {
395
+ }), /* @__PURE__ */ x("span", {
396
396
  className: "text-xs text-text-secondary",
397
- children: h(String(e.savedAt))
397
+ children: g(String(e.savedAt))
398
398
  })]
399
399
  }),
400
- e.changelog && /* @__PURE__ */ b("p", {
400
+ e.changelog && /* @__PURE__ */ x("p", {
401
401
  className: "text-xs",
402
402
  children: e.changelog
403
403
  }),
404
- /* @__PURE__ */ x("div", {
404
+ /* @__PURE__ */ S("div", {
405
405
  className: "flex gap-2",
406
- children: [/* @__PURE__ */ b(o, {
406
+ children: [/* @__PURE__ */ x(o, {
407
407
  size: "sm",
408
408
  variant: "ghost",
409
409
  disabled: k || A,
410
410
  onClick: () => {
411
- P(e.templateText), K(e.variables), I({});
411
+ P(e.templateText), G(e.variables), I({});
412
412
  },
413
413
  children: "Load"
414
- }), /* @__PURE__ */ b(u, {
415
- permission: l.PROMPT_TEMPLATE_EXECUTE,
416
- children: /* @__PURE__ */ b(o, {
414
+ }), /* @__PURE__ */ x(d, {
415
+ permission: u.PROMPT_TEMPLATE_EXECUTE,
416
+ children: /* @__PURE__ */ x(o, {
417
417
  size: "sm",
418
418
  variant: "outline",
419
- disabled: !Q || k,
419
+ disabled: !Z || k,
420
420
  onClick: () => void je(`v${e.version}`, e.templateText, e.variables),
421
421
  children: "Compare"
422
422
  })
@@ -431,6 +431,6 @@ var w = (e) => e, T = (e) => ({ variables: e }), E = "h-10 w-full rounded-md bor
431
431
  })
432
432
  });
433
433
  };
434
- export { D as PromptStudioPage };
434
+ export { T as PromptStudioPage };
435
435
 
436
436
  //# sourceMappingURL=PromptStudioPage.js.map