@burdenoff/microfe-botmanor 2026.1120.28 → 2026.1123.2

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