@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.
- package/dist/botlit/components/DashboardUsagePanel.d.ts +8 -0
- package/dist/botlit/components/DashboardUsagePanel.js +277 -0
- package/dist/botlit/components/DashboardUsagePanel.js.map +1 -0
- package/dist/botlit/components/LiveIndicator.d.ts +9 -0
- package/dist/botlit/components/LiveIndicator.js +21 -0
- package/dist/botlit/components/LiveIndicator.js.map +1 -0
- package/dist/botlit/components/RunStatsCard.d.ts +9 -0
- package/dist/botlit/components/RunStatsCard.js +138 -0
- package/dist/botlit/components/RunStatsCard.js.map +1 -0
- package/dist/botlit/hooks/useExecutionLiveUpdates.d.ts +29 -0
- package/dist/botlit/hooks/useExecutionLiveUpdates.js +124 -0
- package/dist/botlit/hooks/useExecutionLiveUpdates.js.map +1 -0
- package/dist/botlit/hooks/useUsageStats.d.ts +71 -0
- package/dist/botlit/hooks/useUsageStats.js +115 -0
- package/dist/botlit/hooks/useUsageStats.js.map +1 -0
- package/dist/botlit/pages/AgentDetailPage.js +48 -43
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +317 -309
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/DashboardPage.js +155 -153
- package/dist/botlit/pages/DashboardPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionDetailPage.js +142 -132
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +150 -141
- package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +172 -172
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/permissions/botmanorPermissions.d.ts +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js.map +1 -1
- package/dist/botlit/utils/formatters.js +6 -2
- package/dist/botlit/utils/formatters.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +264 -0
- package/dist/generated/wspace-operations.js +95 -6
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +98 -0
- package/dist/generated/wspace-types.js +8 -4
- package/dist/generated/wspace-types.js.map +1 -1
- 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
|
|
5
|
-
import { BOTMANOR_PERMISSIONS as
|
|
6
|
-
import { BotmanorPermissionGate as
|
|
7
|
-
import { Badge as
|
|
8
|
-
import { EmptyState as
|
|
9
|
-
import { ErrorState as
|
|
10
|
-
import { useBotlit as
|
|
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
|
|
13
|
-
import { PromptVersionBump as
|
|
14
|
-
import { confirmAction as
|
|
15
|
-
import { graphqlErrorMessage as
|
|
16
|
-
import {
|
|
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 {
|
|
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
|
|
22
|
-
import { PagePurpose as
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { GitCompare as
|
|
25
|
-
import { toast as
|
|
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
|
|
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__ */
|
|
29
|
+
children: [/* @__PURE__ */ S(i, { children: [/* @__PURE__ */ x(a, {
|
|
30
30
|
className: "text-base",
|
|
31
31
|
children: e.label
|
|
32
|
-
}), e.result && /* @__PURE__ */
|
|
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__ */
|
|
39
|
+
] })] }), /* @__PURE__ */ x(n, {
|
|
40
40
|
className: "space-y-3",
|
|
41
|
-
children: e.error ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
48
|
+
}), /* @__PURE__ */ S("details", {
|
|
49
49
|
className: "text-xs text-text-secondary",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ x("summary", {
|
|
51
51
|
className: "cursor-pointer",
|
|
52
52
|
children: "Rendered prompt"
|
|
53
|
-
}), /* @__PURE__ */
|
|
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
|
-
}),
|
|
60
|
-
let { navigateTo:
|
|
61
|
-
|
|
62
|
-
!j &&
|
|
63
|
-
}, [
|
|
64
|
-
let
|
|
65
|
-
let e = new Map(
|
|
66
|
-
for (let t of
|
|
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
|
-
}, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
!L &&
|
|
73
|
-
}, [
|
|
74
|
-
let
|
|
75
|
-
let t = new Map(
|
|
76
|
-
return Object.fromEntries(Object.entries(F).filter(([e, n]) => n !== "" && t.has(e)).map(([e, n]) => [e,
|
|
77
|
-
},
|
|
78
|
-
if (!
|
|
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:
|
|
86
|
+
templateId: q.id,
|
|
87
87
|
input: {
|
|
88
88
|
llmModelId: L,
|
|
89
89
|
userMessage: z,
|
|
90
|
-
variables:
|
|
90
|
+
variables: Oe(n),
|
|
91
91
|
...t === void 0 ? {} : { templateText: t },
|
|
92
|
-
...n === null ? {} : { variableDefinitions:
|
|
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:
|
|
99
|
+
error: m(t, "The model run failed")
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
},
|
|
103
|
-
e !==
|
|
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
|
-
},
|
|
110
|
-
e && e ===
|
|
109
|
+
}, $ = (e, t) => {
|
|
110
|
+
e && e === K.current && V(t);
|
|
111
111
|
}, Ae = async () => {
|
|
112
|
-
let e =
|
|
113
|
-
|
|
112
|
+
let e = q?.id;
|
|
113
|
+
$(e, [await Q("Draft", N, W)]);
|
|
114
114
|
}, je = async (e, t, n = null) => {
|
|
115
|
-
let r =
|
|
116
|
-
|
|
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 (
|
|
118
|
+
if (q) try {
|
|
119
119
|
let e = await Se({
|
|
120
|
-
templateId:
|
|
120
|
+
templateId: q.id,
|
|
121
121
|
input: {
|
|
122
122
|
templateText: N,
|
|
123
|
-
...
|
|
123
|
+
...W === null ? {} : { variables: ve(W) },
|
|
124
124
|
bump: H,
|
|
125
125
|
...U.trim() ? { changelog: U.trim() } : {}
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
-
|
|
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
|
-
|
|
130
|
+
_e.error(m(e, "Failed to save the prompt version"));
|
|
131
131
|
}
|
|
132
132
|
};
|
|
133
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
137
|
-
permission:
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
leftIcon: /* @__PURE__ */
|
|
140
|
-
onClick: () =>
|
|
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__ */
|
|
144
|
+
children: /* @__PURE__ */ S("div", {
|
|
145
145
|
className: "space-y-6",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
147
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
149
|
+
}), /* @__PURE__ */ S("div", {
|
|
150
150
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-12",
|
|
151
151
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ x("div", {
|
|
153
153
|
className: "lg:col-span-3",
|
|
154
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ x(a, {
|
|
155
155
|
className: "text-base",
|
|
156
156
|
children: "Prompts"
|
|
157
|
-
}) }), /* @__PURE__ */
|
|
157
|
+
}) }), /* @__PURE__ */ x(n, {
|
|
158
158
|
className: "p-0",
|
|
159
|
-
children:
|
|
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__ */
|
|
166
|
-
}) :
|
|
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:
|
|
169
|
-
onRetry: () => void
|
|
168
|
+
error: E,
|
|
169
|
+
onRetry: () => void D(),
|
|
170
170
|
className: "m-4"
|
|
171
|
-
}) :
|
|
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__ */
|
|
174
|
+
}) : /* @__PURE__ */ x("div", {
|
|
175
175
|
className: "divide-y divide-border-subtle",
|
|
176
|
-
children:
|
|
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 ${
|
|
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
|
|
180
|
+
onClick: () => void ke(e.id),
|
|
181
181
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ x("p", {
|
|
183
183
|
className: "truncate font-medium",
|
|
184
184
|
children: e.name
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
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__ */
|
|
190
|
+
/* @__PURE__ */ S("div", {
|
|
191
191
|
className: "mt-2 flex items-center gap-2",
|
|
192
|
-
children: [e.visibility === "PUBLIC" && /* @__PURE__ */
|
|
192
|
+
children: [e.visibility === "PUBLIC" && /* @__PURE__ */ x(f, {
|
|
193
193
|
variant: "secondary",
|
|
194
194
|
className: "text-[10px]",
|
|
195
195
|
children: "Public"
|
|
196
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ S("span", {
|
|
197
197
|
className: "text-xs text-text-secondary",
|
|
198
|
-
children: [
|
|
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__ */
|
|
206
|
+
/* @__PURE__ */ S("div", {
|
|
207
207
|
className: "space-y-6 lg:col-span-6",
|
|
208
|
-
children: [
|
|
208
|
+
children: [q ? /* @__PURE__ */ S(t, { children: [/* @__PURE__ */ S(i, {
|
|
209
209
|
className: "flex flex-row items-center justify-between",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
211
|
-
|
|
210
|
+
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S(a, { children: [
|
|
211
|
+
q.name,
|
|
212
212
|
" ",
|
|
213
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ S(f, {
|
|
214
214
|
variant: "outline",
|
|
215
215
|
className: "ml-2",
|
|
216
|
-
children: ["v",
|
|
216
|
+
children: ["v", q.version]
|
|
217
217
|
}),
|
|
218
|
-
|
|
218
|
+
X && /* @__PURE__ */ x(f, {
|
|
219
219
|
variant: "secondary",
|
|
220
220
|
className: "ml-2",
|
|
221
221
|
children: "Unsaved draft"
|
|
222
222
|
})
|
|
223
|
-
] }), /* @__PURE__ */
|
|
223
|
+
] }), /* @__PURE__ */ x(r, { children: q.description })] }), /* @__PURE__ */ x(o, {
|
|
224
224
|
size: "sm",
|
|
225
225
|
variant: "outline",
|
|
226
|
-
onClick: () =>
|
|
226
|
+
onClick: () => b(`prompt-templates/${q.id}`),
|
|
227
227
|
children: "Open template"
|
|
228
228
|
})]
|
|
229
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ S(n, {
|
|
230
230
|
className: "space-y-4",
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ x(s, {
|
|
233
233
|
label: "Draft prompt",
|
|
234
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
244
|
-
permission:
|
|
245
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
248
|
+
/* @__PURE__ */ S("label", {
|
|
249
249
|
className: "grid gap-1 text-sm",
|
|
250
|
-
children: ["Version bump", /* @__PURE__ */
|
|
250
|
+
children: ["Version bump", /* @__PURE__ */ S("select", {
|
|
251
251
|
"aria-label": "Version bump",
|
|
252
|
-
className:
|
|
252
|
+
className: w,
|
|
253
253
|
value: H,
|
|
254
254
|
onChange: (e) => we(e.target.value),
|
|
255
255
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
value:
|
|
256
|
+
/* @__PURE__ */ x("option", {
|
|
257
|
+
value: p.Patch,
|
|
258
258
|
children: "Patch"
|
|
259
259
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
value:
|
|
260
|
+
/* @__PURE__ */ x("option", {
|
|
261
|
+
value: p.Minor,
|
|
262
262
|
children: "Minor"
|
|
263
263
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
value:
|
|
264
|
+
/* @__PURE__ */ x("option", {
|
|
265
|
+
value: p.Major,
|
|
266
266
|
children: "Major"
|
|
267
267
|
})
|
|
268
268
|
]
|
|
269
269
|
})]
|
|
270
270
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ S("label", {
|
|
272
272
|
className: "grid gap-1 text-sm",
|
|
273
|
-
children: ["Change note", /* @__PURE__ */
|
|
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) =>
|
|
277
|
+
onChange: (e) => Te(e.target.value)
|
|
278
278
|
})]
|
|
279
279
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
leftIcon: /* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ x(o, {
|
|
281
|
+
leftIcon: /* @__PURE__ */ x(ge, { size: 16 }),
|
|
282
282
|
onClick: () => void Me(),
|
|
283
283
|
isLoading: A,
|
|
284
|
-
disabled: !
|
|
284
|
+
disabled: !X || !N.trim(),
|
|
285
285
|
children: "Save as new version"
|
|
286
286
|
})
|
|
287
287
|
]
|
|
288
288
|
})
|
|
289
289
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ S("div", {
|
|
291
291
|
className: "text-xs text-text-secondary",
|
|
292
|
-
children: ["Updated ",
|
|
292
|
+
children: ["Updated ", g(q.updatedAt)]
|
|
293
293
|
})
|
|
294
294
|
]
|
|
295
|
-
})] }) : /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
301
|
+
children: B.map((e) => /* @__PURE__ */ x(ye, { run: e }, e.label))
|
|
302
302
|
})]
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ S("div", {
|
|
305
305
|
className: "space-y-6 lg:col-span-3",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
309
|
-
}) }), /* @__PURE__ */
|
|
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__ */
|
|
312
|
+
/* @__PURE__ */ S("label", {
|
|
313
313
|
className: "grid gap-1 text-sm",
|
|
314
|
-
children: ["Model", /* @__PURE__ */
|
|
314
|
+
children: ["Model", /* @__PURE__ */ S("select", {
|
|
315
315
|
"aria-label": "Model",
|
|
316
316
|
disabled: k,
|
|
317
|
-
className:
|
|
317
|
+
className: w,
|
|
318
318
|
value: L,
|
|
319
319
|
onChange: (e) => R(e.target.value),
|
|
320
|
-
children: [
|
|
320
|
+
children: [Y.length === 0 && /* @__PURE__ */ x("option", {
|
|
321
321
|
value: "",
|
|
322
322
|
children: "No active models"
|
|
323
|
-
}),
|
|
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
|
-
|
|
329
|
+
De.map((e) => /* @__PURE__ */ x(s, {
|
|
330
330
|
label: e.name,
|
|
331
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
342
|
+
/* @__PURE__ */ x(s, {
|
|
343
343
|
label: "Test message",
|
|
344
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
354
|
-
permission:
|
|
355
|
-
children: /* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ x(d, {
|
|
354
|
+
permission: u.PROMPT_TEMPLATE_EXECUTE,
|
|
355
|
+
children: /* @__PURE__ */ S("div", {
|
|
356
356
|
className: "grid gap-2",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ x(o, {
|
|
358
358
|
onClick: () => void Ae(),
|
|
359
359
|
isLoading: k,
|
|
360
|
-
disabled: !
|
|
360
|
+
disabled: !Z,
|
|
361
361
|
children: "Run draft"
|
|
362
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ x(o, {
|
|
363
363
|
variant: "outline",
|
|
364
|
-
leftIcon: /* @__PURE__ */
|
|
365
|
-
onClick: () => void je(`Saved v${
|
|
366
|
-
disabled: !
|
|
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__ */
|
|
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__ */
|
|
375
|
-
}) }), /* @__PURE__ */
|
|
374
|
+
children: [/* @__PURE__ */ x(pe, { size: 16 }), "Versions"]
|
|
375
|
+
}) }), /* @__PURE__ */ x(n, {
|
|
376
376
|
className: "space-y-3",
|
|
377
|
-
children:
|
|
377
|
+
children: J.error ? /* @__PURE__ */ x(te, {
|
|
378
378
|
resource: "prompt versions",
|
|
379
|
-
error:
|
|
380
|
-
onRetry: () => void
|
|
381
|
-
}) :
|
|
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
|
-
}) :
|
|
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
|
-
}) :
|
|
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__ */
|
|
390
|
+
/* @__PURE__ */ S("div", {
|
|
391
391
|
className: "flex items-center justify-between",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ S(f, {
|
|
393
393
|
variant: "outline",
|
|
394
394
|
children: ["v", e.version]
|
|
395
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ x("span", {
|
|
396
396
|
className: "text-xs text-text-secondary",
|
|
397
|
-
children:
|
|
397
|
+
children: g(String(e.savedAt))
|
|
398
398
|
})]
|
|
399
399
|
}),
|
|
400
|
-
e.changelog && /* @__PURE__ */
|
|
400
|
+
e.changelog && /* @__PURE__ */ x("p", {
|
|
401
401
|
className: "text-xs",
|
|
402
402
|
children: e.changelog
|
|
403
403
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ S("div", {
|
|
405
405
|
className: "flex gap-2",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
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),
|
|
411
|
+
P(e.templateText), G(e.variables), I({});
|
|
412
412
|
},
|
|
413
413
|
children: "Load"
|
|
414
|
-
}), /* @__PURE__ */
|
|
415
|
-
permission:
|
|
416
|
-
children: /* @__PURE__ */
|
|
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: !
|
|
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 {
|
|
434
|
+
export { T as PromptStudioPage };
|
|
435
435
|
|
|
436
436
|
//# sourceMappingURL=PromptStudioPage.js.map
|