@burdenoff/microfe-botmanor 2026.1203.4 → 2026.1203.6
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/BotlitRoutes.js +0 -1
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/components/A2ACardVerificationCard.js +0 -1
- package/dist/botlit/components/A2ACardVerificationCard.js.map +1 -1
- package/dist/botlit/components/AgentA2APanel.js +20 -21
- package/dist/botlit/components/AgentA2APanel.js.map +1 -1
- package/dist/botlit/components/AgentApprovalPanel.js +22 -23
- package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
- package/dist/botlit/components/AgentBindingsPanel.js +66 -68
- package/dist/botlit/components/AgentBindingsPanel.js.map +1 -1
- package/dist/botlit/components/AiOperationsPanel.js +34 -35
- package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
- package/dist/botlit/components/BotAgentsPanel.js +59 -60
- package/dist/botlit/components/BotAgentsPanel.js.map +1 -1
- package/dist/botlit/components/BotVersionHistoryPanel.js +19 -20
- package/dist/botlit/components/BotVersionHistoryPanel.js.map +1 -1
- package/dist/botlit/components/BucketDialogs.js +0 -1
- package/dist/botlit/components/BucketDialogs.js.map +1 -1
- package/dist/botlit/components/ChannelRoutesPanel.js +82 -84
- package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -1
- package/dist/botlit/components/CreateChannelRouteDialog.js +4 -5
- package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -1
- package/dist/botlit/components/DescribeBotDialog.js +0 -1
- package/dist/botlit/components/DescribeBotDialog.js.map +1 -1
- package/dist/botlit/components/GettingStartedChecklist.js +9 -10
- package/dist/botlit/components/GettingStartedChecklist.js.map +1 -1
- package/dist/botlit/components/HandoffConfigPanel.js +0 -1
- package/dist/botlit/components/HandoffConfigPanel.js.map +1 -1
- package/dist/botlit/components/RetentionStatusPanel.js +10 -12
- package/dist/botlit/components/RetentionStatusPanel.js.map +1 -1
- package/dist/botlit/components/StewardApprovalsInbox.js +201 -212
- package/dist/botlit/components/StewardApprovalsInbox.js.map +1 -1
- package/dist/botlit/components/StoreOwnPackagesCard.js +21 -22
- package/dist/botlit/components/StoreOwnPackagesCard.js.map +1 -1
- package/dist/botlit/components/StorePackageDraftCard.js +38 -39
- package/dist/botlit/components/StorePackageDraftCard.js.map +1 -1
- package/dist/botlit/components/StorePolicyBundleCard.js +27 -29
- package/dist/botlit/components/StorePolicyBundleCard.js.map +1 -1
- package/dist/botlit/components/StoreSubmissionsCard.js +64 -65
- package/dist/botlit/components/StoreSubmissionsCard.js.map +1 -1
- package/dist/botlit/components/VersionHistoryPanel.js +18 -19
- package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
- package/dist/botlit/hooks/internal/workspaceGateway.d.ts +6 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js +40 -40
- package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
- package/dist/botlit/hooks/useChannels.js +2 -0
- package/dist/botlit/hooks/useChannels.js.map +1 -1
- package/dist/botlit/hooks/useToolApprovals.d.ts +8 -3
- package/dist/botlit/hooks/useToolApprovals.js +68 -73
- package/dist/botlit/hooks/useToolApprovals.js.map +1 -1
- package/dist/botlit/pages/A2AAgentDetailPage.js +331 -332
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/A2ARegistryPage.js +39 -41
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
- package/dist/botlit/pages/AgentApprovalsPage.js +24 -25
- package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +470 -471
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
- package/dist/botlit/pages/AgentDetailPage.js +68 -69
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/AgentsListPage.js +277 -278
- package/dist/botlit/pages/AgentsListPage.js.map +1 -1
- package/dist/botlit/pages/AiOperationsPage.js +44 -46
- package/dist/botlit/pages/AiOperationsPage.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +354 -356
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +138 -139
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotWorkflowTab.js +23 -24
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/pages/BotsListPage.js +32 -33
- package/dist/botlit/pages/BotsListPage.js.map +1 -1
- package/dist/botlit/pages/BucketDetailPage.js +110 -112
- package/dist/botlit/pages/BucketDetailPage.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +115 -117
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/ChannelDetailPage.js +105 -107
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
- package/dist/botlit/pages/ChannelsPage.js +38 -40
- package/dist/botlit/pages/ChannelsPage.js.map +1 -1
- package/dist/botlit/pages/DashboardPage.js +26 -27
- package/dist/botlit/pages/DashboardPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionDetailPage.js +70 -71
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +219 -220
- package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
- package/dist/botlit/pages/HandoffsPage.js +208 -210
- package/dist/botlit/pages/HandoffsPage.js.map +1 -1
- package/dist/botlit/pages/InstalledPackagesPage.js +179 -181
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +194 -195
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBasesPage.js +38 -39
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +178 -180
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/MCPServersPage.js +42 -43
- package/dist/botlit/pages/MCPServersPage.js.map +1 -1
- package/dist/botlit/pages/PoliciesPage.js +77 -78
- package/dist/botlit/pages/PoliciesPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +517 -519
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +81 -83
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplateDetailPage.js +137 -139
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplatesPage.js +28 -30
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +64 -65
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfilesPage.js +59 -60
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
- package/dist/botlit/pages/SettingsPage.js +30 -31
- package/dist/botlit/pages/SettingsPage.js.map +1 -1
- package/dist/botlit/pages/SkillDetailPage.js +205 -207
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
- package/dist/botlit/pages/SkillsPage.js +68 -69
- package/dist/botlit/pages/SkillsPage.js.map +1 -1
- package/dist/botlit/pages/StorePackageDetailPage.js +39 -41
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +169 -171
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/dist/botlit/pages/ToolApprovalsPage.js +61 -62
- package/dist/botlit/pages/ToolApprovalsPage.js.map +1 -1
- package/dist/generated/global-types.d.ts +540 -171
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +38 -4
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +9539 -686
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +0 -1
- package/package.json +4 -1
- package/dist/botlit/hooks/index.js +0 -21
- package/dist/botlit/index.js +0 -12
- package/dist/botlit/permissions/index.js +0 -4
|
@@ -2,37 +2,35 @@ import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
|
2
2
|
import { PageLayout as t } from "../components/PageLayout.js";
|
|
3
3
|
import { Card as n, CardContent as r, CardDescription as i, CardHeader as a, CardTitle as o } from "../components/Card.js";
|
|
4
4
|
import { Button as s } from "../components/Button.js";
|
|
5
|
-
import { FormField as c, Input as l, Textarea as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "../hooks/
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { formatRelativeTime as ue } from "../utils/formatters.js";
|
|
21
|
-
import "../permissions/index.js";
|
|
5
|
+
import { FormField as c, Input as l, Textarea as ee } from "../components/Input.js";
|
|
6
|
+
import { Badge as u } from "../components/Badge.js";
|
|
7
|
+
import { EmptyState as te } from "../components/EmptyState.js";
|
|
8
|
+
import { ErrorState as d } from "../components/ErrorState.js";
|
|
9
|
+
import { useBotlit as ne } from "../providers/BotlitProvider.js";
|
|
10
|
+
import { promptTemplateVariables as f, usePromptTemplates as re } from "../hooks/usePromptTemplates.js";
|
|
11
|
+
import { usePromptTemplateVersions as ie, useSavePromptTemplateVersion as ae, useTestPromptTemplate as oe } from "../hooks/useAgentBindings.js";
|
|
12
|
+
import { useLLMModels as se } from "../hooks/useLLMProviders.js";
|
|
13
|
+
import { PromptVersionBump as p } from "../../generated/wspace-types.js";
|
|
14
|
+
import { confirmAction as ce } from "../utils/confirmAction.js";
|
|
15
|
+
import { graphqlErrorMessage as le } from "../utils/errors.js";
|
|
16
|
+
import { typedVariableValue as ue } from "../utils/promptVariables.js";
|
|
17
|
+
import { formatRelativeTime as m } from "../utils/formatters.js";
|
|
18
|
+
import { BOTMANOR_PERMISSIONS as h } from "../permissions/botmanorPermissions.js";
|
|
19
|
+
import { BotmanorPermissionGate as g } from "../permissions/useBotmanorPermissions.js";
|
|
22
20
|
import { useEffect as _, useMemo as v, useRef as de, useState as y } from "react";
|
|
23
21
|
import { PagePurpose as fe, ThemedSelect as b } from "@burdenoff/fe-libs/ui";
|
|
24
22
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
25
23
|
import { GitCompare as pe, History as me, Play as he, Plus as ge, Save as _e } from "lucide-react";
|
|
26
|
-
import { toast as
|
|
24
|
+
import { toast as w } from "sonner";
|
|
27
25
|
// src/botlit/pages/PromptStudioPage.tsx
|
|
28
|
-
var
|
|
29
|
-
function
|
|
26
|
+
var T = (e) => e, E = (e) => ({ variables: e }), D = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm";
|
|
27
|
+
function O(e) {
|
|
30
28
|
return e.kind === "draft" ? "draft" : e.kind === "saved" ? `saved-v${e.version}` : `v${e.version}`;
|
|
31
29
|
}
|
|
32
|
-
var
|
|
30
|
+
var ve = ({ run: t }) => {
|
|
33
31
|
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
32
|
return /* @__PURE__ */ C(n, {
|
|
35
|
-
"data-testid": `prompt-run-${
|
|
33
|
+
"data-testid": `prompt-run-${O(c)}`,
|
|
36
34
|
children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, {
|
|
37
35
|
className: "text-base",
|
|
38
36
|
children: l
|
|
@@ -61,14 +59,14 @@ var ye = ({ run: t }) => {
|
|
|
61
59
|
})] })
|
|
62
60
|
})]
|
|
63
61
|
});
|
|
64
|
-
},
|
|
65
|
-
let x = e(), { navigateTo:
|
|
62
|
+
}, k = () => {
|
|
63
|
+
let x = e(), { navigateTo: k } = ne(), { data: A, loading: ye, error: be, refetch: xe } = re(), Se = se(), { run: Ce, loading: j } = oe(), { save: we, loading: M } = ae(), [N, Te] = y(null), [P, F] = y(""), [I, L] = y({}), [R, z] = y(""), [B, Ee] = y(""), [V, H] = y([]), [U, De] = y(p.Patch), [W, Oe] = y(""), [G, K] = y(null), q = de(null);
|
|
66
64
|
_(() => {
|
|
67
|
-
!
|
|
68
|
-
}, [
|
|
69
|
-
let J = v(() =>
|
|
65
|
+
!N && A.length > 0 && Te(A[0].id);
|
|
66
|
+
}, [A, N]);
|
|
67
|
+
let J = v(() => A.find((e) => e.id === N), [A, N]), Y = ie(J?.id), ke = v(() => J ? f(G === null ? J : E(G)) : [], [J, G]), X = v(() => Se.data.filter((e) => e.isActive), [Se.data]), Ae = v(() => {
|
|
70
68
|
let e = new Map(ke.map((e) => [e.name, e]));
|
|
71
|
-
for (let t of Y.data) for (let n of
|
|
69
|
+
for (let t of Y.data) for (let n of f(E(t.variables))) e.has(n.name) || e.set(n.name, n);
|
|
72
70
|
return [...e.values()];
|
|
73
71
|
}, [ke, Y.data]);
|
|
74
72
|
_(() => {
|
|
@@ -77,8 +75,8 @@ var ye = ({ run: t }) => {
|
|
|
77
75
|
!R && X.length > 0 && z(X[0].id);
|
|
78
76
|
}, [X, R]);
|
|
79
77
|
let Z = !!J && (P !== J?.templateText || G !== null), Q = !!(J && R && B.trim()), je = (e) => {
|
|
80
|
-
let t = new Map(
|
|
81
|
-
return Object.fromEntries(Object.entries(I).filter(([e, n]) => n !== "" && t.has(e)).map(([e, n]) => [e,
|
|
78
|
+
let t = new Map(f(e === null && J ? J : E(e)).map((e) => [e.name, e.type]));
|
|
79
|
+
return Object.fromEntries(Object.entries(I).filter(([e, n]) => n !== "" && t.has(e)).map(([e, n]) => [e, ue(t.get(e) ?? "string", n)]));
|
|
82
80
|
}, $ = async (e, t, n = null) => {
|
|
83
81
|
if (!J) return {
|
|
84
82
|
promptRun: e,
|
|
@@ -87,30 +85,30 @@ var ye = ({ run: t }) => {
|
|
|
87
85
|
try {
|
|
88
86
|
return {
|
|
89
87
|
promptRun: e,
|
|
90
|
-
result: await
|
|
88
|
+
result: await Ce({
|
|
91
89
|
templateId: J.id,
|
|
92
90
|
input: {
|
|
93
91
|
llmModelId: R,
|
|
94
92
|
userMessage: B,
|
|
95
93
|
variables: je(n),
|
|
96
94
|
...t === void 0 ? {} : { templateText: t },
|
|
97
|
-
...n === null ? {} : { variableDefinitions:
|
|
95
|
+
...n === null ? {} : { variableDefinitions: T(n) }
|
|
98
96
|
}
|
|
99
97
|
})
|
|
100
98
|
};
|
|
101
99
|
} catch (t) {
|
|
102
100
|
return {
|
|
103
101
|
promptRun: e,
|
|
104
|
-
error:
|
|
102
|
+
error: le(t, x("botlit.promptStudio.runError", "The model run failed"))
|
|
105
103
|
};
|
|
106
104
|
}
|
|
107
105
|
}, Me = async (e) => {
|
|
108
|
-
e !== J?.id && (!Z || await
|
|
106
|
+
e !== J?.id && (!Z || await ce({
|
|
109
107
|
title: x("botlit.promptStudio.discardTitle", "Discard draft?"),
|
|
110
108
|
message: x("botlit.promptStudio.discardDescription", "This prompt has an unsaved draft. Discard it and open the other prompt?"),
|
|
111
109
|
confirmLabel: x("botlit.promptStudio.discardConfirm", "Discard draft"),
|
|
112
110
|
cancelLabel: x("botlit.promptStudio.discardCancel", "Keep editing")
|
|
113
|
-
})) && (
|
|
111
|
+
})) && (Te(e), L({}), H([]));
|
|
114
112
|
}, Ne = (e, t) => {
|
|
115
113
|
e && e === q.current && H(t);
|
|
116
114
|
}, Pe = async () => {
|
|
@@ -121,28 +119,28 @@ var ye = ({ run: t }) => {
|
|
|
121
119
|
Ne(r, [i, a]);
|
|
122
120
|
}, Ie = async () => {
|
|
123
121
|
if (J) try {
|
|
124
|
-
let e = await
|
|
122
|
+
let e = await we({
|
|
125
123
|
templateId: J.id,
|
|
126
124
|
input: {
|
|
127
125
|
templateText: P,
|
|
128
|
-
...G === null ? {} : { variables:
|
|
126
|
+
...G === null ? {} : { variables: T(G) },
|
|
129
127
|
bump: U,
|
|
130
128
|
...W.trim() ? { changelog: W.trim() } : {}
|
|
131
129
|
}
|
|
132
130
|
});
|
|
133
|
-
|
|
131
|
+
w.success(x("botlit.promptStudio.savedVersion", "Saved version {{version}}", { version: e.version })), q.current === e.id && (Oe(""), F(e.templateText), K(null)), await xe(), q.current === e.id && Y.refetch();
|
|
134
132
|
} catch (e) {
|
|
135
|
-
|
|
133
|
+
w.error(le(e, x("botlit.promptStudio.saveError", "Failed to save the prompt version")));
|
|
136
134
|
}
|
|
137
135
|
};
|
|
138
136
|
return /* @__PURE__ */ S(t, {
|
|
139
137
|
title: x("botlit.promptStudio.title", "Prompt Studio"),
|
|
140
138
|
description: x("botlit.promptStudio.description", "Write a prompt, run it against a live model, compare and save versions"),
|
|
141
|
-
actions: /* @__PURE__ */ S(
|
|
142
|
-
permission:
|
|
139
|
+
actions: /* @__PURE__ */ S(g, {
|
|
140
|
+
permission: h.PROMPT_TEMPLATE_CREATE,
|
|
143
141
|
children: /* @__PURE__ */ S(s, {
|
|
144
142
|
leftIcon: /* @__PURE__ */ S(ge, { size: 16 }),
|
|
145
|
-
onClick: () =>
|
|
143
|
+
onClick: () => k("prompt-templates/new"),
|
|
146
144
|
children: x("botlit.promptStudio.newPrompt", "New Prompt")
|
|
147
145
|
})
|
|
148
146
|
}),
|
|
@@ -161,27 +159,27 @@ var ye = ({ run: t }) => {
|
|
|
161
159
|
children: x("botlit.promptStudio.prompts", "Prompts")
|
|
162
160
|
}) }), /* @__PURE__ */ S(r, {
|
|
163
161
|
className: "p-0",
|
|
164
|
-
children:
|
|
162
|
+
children: ye ? /* @__PURE__ */ S("div", {
|
|
165
163
|
className: "space-y-2 p-4",
|
|
166
164
|
children: [
|
|
167
165
|
1,
|
|
168
166
|
2,
|
|
169
167
|
3
|
|
170
168
|
].map((e) => /* @__PURE__ */ S("div", { className: "h-14 rounded bg-bg-sunken motion-safe:animate-vc-shimmer" }, e))
|
|
171
|
-
}) :
|
|
169
|
+
}) : be ? /* @__PURE__ */ S(d, {
|
|
172
170
|
resource: x("botlit.promptStudio.templatesResource", "prompt templates"),
|
|
173
|
-
error:
|
|
174
|
-
onRetry: () => void
|
|
171
|
+
error: be,
|
|
172
|
+
onRetry: () => void xe(),
|
|
175
173
|
className: "m-4"
|
|
176
|
-
}) :
|
|
174
|
+
}) : A.length === 0 ? /* @__PURE__ */ S("p", {
|
|
177
175
|
className: "p-4 text-sm text-text-secondary",
|
|
178
176
|
children: x("botlit.promptStudio.noTemplates", "No prompt templates yet. Create one to start iterating.")
|
|
179
177
|
}) : /* @__PURE__ */ S("div", {
|
|
180
178
|
className: "divide-y divide-border-subtle",
|
|
181
|
-
children:
|
|
179
|
+
children: A.map((e) => /* @__PURE__ */ C("button", {
|
|
182
180
|
type: "button",
|
|
183
181
|
className: `w-full p-4 text-left transition-colors hover:bg-accent ${J?.id === e.id ? "bg-accent" : ""}`,
|
|
184
|
-
disabled:
|
|
182
|
+
disabled: j || M,
|
|
185
183
|
onClick: () => void Me(e.id),
|
|
186
184
|
children: [
|
|
187
185
|
/* @__PURE__ */ S("p", {
|
|
@@ -194,13 +192,13 @@ var ye = ({ run: t }) => {
|
|
|
194
192
|
}),
|
|
195
193
|
/* @__PURE__ */ C("div", {
|
|
196
194
|
className: "mt-2 flex items-center gap-2",
|
|
197
|
-
children: [e.visibility === "PUBLIC" && /* @__PURE__ */ S(
|
|
195
|
+
children: [e.visibility === "PUBLIC" && /* @__PURE__ */ S(u, {
|
|
198
196
|
variant: "secondary",
|
|
199
197
|
className: "text-[10px]",
|
|
200
198
|
children: x("botlit.promptStudio.public", "Public")
|
|
201
199
|
}), /* @__PURE__ */ S("span", {
|
|
202
200
|
className: "text-xs text-text-secondary",
|
|
203
|
-
children: x("botlit.promptStudio.variableCount", "{{count}} vars", { count:
|
|
201
|
+
children: x("botlit.promptStudio.variableCount", "{{count}} vars", { count: f(e).length })
|
|
204
202
|
})]
|
|
205
203
|
})
|
|
206
204
|
]
|
|
@@ -215,12 +213,12 @@ var ye = ({ run: t }) => {
|
|
|
215
213
|
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C(o, { children: [
|
|
216
214
|
J.name,
|
|
217
215
|
" ",
|
|
218
|
-
/* @__PURE__ */ C(
|
|
216
|
+
/* @__PURE__ */ C(u, {
|
|
219
217
|
variant: "outline",
|
|
220
218
|
className: "ml-2",
|
|
221
219
|
children: ["v", J.version]
|
|
222
220
|
}),
|
|
223
|
-
Z && /* @__PURE__ */ S(
|
|
221
|
+
Z && /* @__PURE__ */ S(u, {
|
|
224
222
|
variant: "secondary",
|
|
225
223
|
className: "ml-2",
|
|
226
224
|
children: x("botlit.promptStudio.unsavedDraft", "Unsaved draft")
|
|
@@ -228,7 +226,7 @@ var ye = ({ run: t }) => {
|
|
|
228
226
|
] }), /* @__PURE__ */ S(i, { children: J.description })] }), /* @__PURE__ */ S(s, {
|
|
229
227
|
size: "sm",
|
|
230
228
|
variant: "outline",
|
|
231
|
-
onClick: () =>
|
|
229
|
+
onClick: () => k(`prompt-templates/${J.id}`),
|
|
232
230
|
children: x("botlit.promptStudio.openTemplate", "Open template")
|
|
233
231
|
})]
|
|
234
232
|
}), /* @__PURE__ */ C(r, {
|
|
@@ -236,17 +234,17 @@ var ye = ({ run: t }) => {
|
|
|
236
234
|
children: [
|
|
237
235
|
/* @__PURE__ */ S(c, {
|
|
238
236
|
label: x("botlit.promptStudio.draftPrompt", "Draft prompt"),
|
|
239
|
-
children: /* @__PURE__ */ S(
|
|
237
|
+
children: /* @__PURE__ */ S(ee, {
|
|
240
238
|
"aria-label": x("botlit.promptStudio.draftPrompt", "Draft prompt"),
|
|
241
|
-
readOnly:
|
|
239
|
+
readOnly: M || j,
|
|
242
240
|
value: P,
|
|
243
241
|
rows: 12,
|
|
244
242
|
onChange: (e) => F(e.target.value),
|
|
245
243
|
className: "font-mono text-sm"
|
|
246
244
|
})
|
|
247
245
|
}),
|
|
248
|
-
/* @__PURE__ */ S(
|
|
249
|
-
permission:
|
|
246
|
+
/* @__PURE__ */ S(g, {
|
|
247
|
+
permission: h.PROMPT_TEMPLATE_UPDATE,
|
|
250
248
|
children: /* @__PURE__ */ C("div", {
|
|
251
249
|
className: "grid gap-3 sm:grid-cols-[10rem_1fr_auto] sm:items-end",
|
|
252
250
|
children: [
|
|
@@ -254,20 +252,20 @@ var ye = ({ run: t }) => {
|
|
|
254
252
|
className: "grid gap-1 text-sm",
|
|
255
253
|
children: [x("botlit.promptStudio.versionBump", "Version bump"), /* @__PURE__ */ C(b, {
|
|
256
254
|
"aria-label": x("botlit.promptStudio.versionBump", "Version bump"),
|
|
257
|
-
className:
|
|
255
|
+
className: D,
|
|
258
256
|
value: U,
|
|
259
257
|
onChange: (e) => De(e.target.value),
|
|
260
258
|
children: [
|
|
261
259
|
/* @__PURE__ */ S("option", {
|
|
262
|
-
value:
|
|
260
|
+
value: p.Patch,
|
|
263
261
|
children: x("botlit.promptStudio.versionPatch", "Patch")
|
|
264
262
|
}),
|
|
265
263
|
/* @__PURE__ */ S("option", {
|
|
266
|
-
value:
|
|
264
|
+
value: p.Minor,
|
|
267
265
|
children: x("botlit.promptStudio.versionMinor", "Minor")
|
|
268
266
|
}),
|
|
269
267
|
/* @__PURE__ */ S("option", {
|
|
270
|
-
value:
|
|
268
|
+
value: p.Major,
|
|
271
269
|
children: x("botlit.promptStudio.versionMajor", "Major")
|
|
272
270
|
})
|
|
273
271
|
]
|
|
@@ -285,7 +283,7 @@ var ye = ({ run: t }) => {
|
|
|
285
283
|
/* @__PURE__ */ S(s, {
|
|
286
284
|
leftIcon: /* @__PURE__ */ S(_e, { size: 16 }),
|
|
287
285
|
onClick: () => void Ie(),
|
|
288
|
-
isLoading:
|
|
286
|
+
isLoading: M,
|
|
289
287
|
disabled: !Z || !P.trim(),
|
|
290
288
|
children: x("botlit.promptStudio.saveVersion", "Save as new version")
|
|
291
289
|
})
|
|
@@ -294,16 +292,16 @@ var ye = ({ run: t }) => {
|
|
|
294
292
|
}),
|
|
295
293
|
/* @__PURE__ */ S("div", {
|
|
296
294
|
className: "text-xs text-text-secondary",
|
|
297
|
-
children: x("botlit.promptStudio.updated", "Updated {{time}}", { time:
|
|
295
|
+
children: x("botlit.promptStudio.updated", "Updated {{time}}", { time: m(J.updatedAt) })
|
|
298
296
|
})
|
|
299
297
|
]
|
|
300
|
-
})] }) : /* @__PURE__ */ S(
|
|
298
|
+
})] }) : /* @__PURE__ */ S(te, {
|
|
301
299
|
illustration: "onboarding",
|
|
302
300
|
title: x("botlit.promptStudio.selectPrompt", "Select a prompt"),
|
|
303
301
|
description: x("botlit.promptStudio.selectPromptDescription", "Choose a prompt from the list to iterate on it")
|
|
304
302
|
}), V.length > 0 && /* @__PURE__ */ S("div", {
|
|
305
303
|
className: `grid gap-4 ${V.length > 1 ? "md:grid-cols-2" : ""}`,
|
|
306
|
-
children: V.map((e) => /* @__PURE__ */ S(
|
|
304
|
+
children: V.map((e) => /* @__PURE__ */ S(ve, { run: e }, O(e.promptRun)))
|
|
307
305
|
})]
|
|
308
306
|
}),
|
|
309
307
|
/* @__PURE__ */ C("div", {
|
|
@@ -318,8 +316,8 @@ var ye = ({ run: t }) => {
|
|
|
318
316
|
className: "grid gap-1 text-sm",
|
|
319
317
|
children: [x("botlit.promptStudio.model", "Model"), /* @__PURE__ */ C(b, {
|
|
320
318
|
"aria-label": x("botlit.promptStudio.model", "Model"),
|
|
321
|
-
disabled:
|
|
322
|
-
className:
|
|
319
|
+
disabled: j,
|
|
320
|
+
className: D,
|
|
323
321
|
value: R,
|
|
324
322
|
onChange: (e) => z(e.target.value),
|
|
325
323
|
children: [X.length === 0 && /* @__PURE__ */ S("option", {
|
|
@@ -335,7 +333,7 @@ var ye = ({ run: t }) => {
|
|
|
335
333
|
label: e.name,
|
|
336
334
|
children: /* @__PURE__ */ S(l, {
|
|
337
335
|
"aria-label": x("botlit.promptStudio.variableValue", "Value for {{name}}", { name: e.name }),
|
|
338
|
-
readOnly:
|
|
336
|
+
readOnly: j,
|
|
339
337
|
placeholder: typeof e.defaultValue == "string" ? x("botlit.promptStudio.variableDefault", "Default: {{value}}", { value: e.defaultValue }) : e.description || x("botlit.promptStudio.variablePlaceholder", "Enter {{name}}", { name: e.name }),
|
|
340
338
|
value: I[e.name] || "",
|
|
341
339
|
onChange: (t) => L({
|
|
@@ -346,22 +344,22 @@ var ye = ({ run: t }) => {
|
|
|
346
344
|
}, e.name)),
|
|
347
345
|
/* @__PURE__ */ S(c, {
|
|
348
346
|
label: x("botlit.promptStudio.testMessage", "Test message"),
|
|
349
|
-
children: /* @__PURE__ */ S(
|
|
347
|
+
children: /* @__PURE__ */ S(ee, {
|
|
350
348
|
"aria-label": x("botlit.promptStudio.testMessage", "Test message"),
|
|
351
|
-
readOnly:
|
|
349
|
+
readOnly: j,
|
|
352
350
|
rows: 3,
|
|
353
351
|
placeholder: x("botlit.promptStudio.testMessagePlaceholder", "What a user would ask"),
|
|
354
352
|
value: B,
|
|
355
353
|
onChange: (e) => Ee(e.target.value)
|
|
356
354
|
})
|
|
357
355
|
}),
|
|
358
|
-
/* @__PURE__ */ S(
|
|
359
|
-
permission:
|
|
356
|
+
/* @__PURE__ */ S(g, {
|
|
357
|
+
permission: h.PROMPT_TEMPLATE_EXECUTE,
|
|
360
358
|
children: /* @__PURE__ */ C("div", {
|
|
361
359
|
className: "grid gap-2",
|
|
362
360
|
children: [/* @__PURE__ */ S(s, {
|
|
363
361
|
onClick: () => void Pe(),
|
|
364
|
-
isLoading:
|
|
362
|
+
isLoading: j,
|
|
365
363
|
disabled: !Q,
|
|
366
364
|
children: x("botlit.promptStudio.runDraft", "Run draft")
|
|
367
365
|
}), /* @__PURE__ */ S(s, {
|
|
@@ -371,7 +369,7 @@ var ye = ({ run: t }) => {
|
|
|
371
369
|
kind: "saved",
|
|
372
370
|
version: J?.version ?? ""
|
|
373
371
|
}, J?.templateText ?? ""),
|
|
374
|
-
disabled: !Q ||
|
|
372
|
+
disabled: !Q || j,
|
|
375
373
|
children: x("botlit.promptStudio.compareWithSaved", "Compare with saved")
|
|
376
374
|
})]
|
|
377
375
|
})
|
|
@@ -382,7 +380,7 @@ var ye = ({ run: t }) => {
|
|
|
382
380
|
children: [/* @__PURE__ */ S(me, { size: 16 }), x("botlit.promptStudio.versions", "Versions")]
|
|
383
381
|
}) }), /* @__PURE__ */ S(r, {
|
|
384
382
|
className: "space-y-3",
|
|
385
|
-
children: Y.error ? /* @__PURE__ */ S(
|
|
383
|
+
children: Y.error ? /* @__PURE__ */ S(d, {
|
|
386
384
|
resource: x("botlit.promptStudio.versionsResource", "prompt versions"),
|
|
387
385
|
error: Y.error,
|
|
388
386
|
onRetry: () => void Y.refetch()
|
|
@@ -397,12 +395,12 @@ var ye = ({ run: t }) => {
|
|
|
397
395
|
children: [
|
|
398
396
|
/* @__PURE__ */ C("div", {
|
|
399
397
|
className: "flex items-center justify-between",
|
|
400
|
-
children: [/* @__PURE__ */ C(
|
|
398
|
+
children: [/* @__PURE__ */ C(u, {
|
|
401
399
|
variant: "outline",
|
|
402
400
|
children: ["v", e.version]
|
|
403
401
|
}), /* @__PURE__ */ S("span", {
|
|
404
402
|
className: "text-xs text-text-secondary",
|
|
405
|
-
children:
|
|
403
|
+
children: m(String(e.savedAt))
|
|
406
404
|
})]
|
|
407
405
|
}),
|
|
408
406
|
e.changelog && /* @__PURE__ */ S("p", {
|
|
@@ -414,17 +412,17 @@ var ye = ({ run: t }) => {
|
|
|
414
412
|
children: [/* @__PURE__ */ S(s, {
|
|
415
413
|
size: "sm",
|
|
416
414
|
variant: "ghost",
|
|
417
|
-
disabled:
|
|
415
|
+
disabled: j || M,
|
|
418
416
|
onClick: () => {
|
|
419
417
|
F(e.templateText), K(e.variables), L({});
|
|
420
418
|
},
|
|
421
419
|
children: x("botlit.promptStudio.loadVersion", "Load")
|
|
422
|
-
}), /* @__PURE__ */ S(
|
|
423
|
-
permission:
|
|
420
|
+
}), /* @__PURE__ */ S(g, {
|
|
421
|
+
permission: h.PROMPT_TEMPLATE_EXECUTE,
|
|
424
422
|
children: /* @__PURE__ */ S(s, {
|
|
425
423
|
size: "sm",
|
|
426
424
|
variant: "outline",
|
|
427
|
-
disabled: !Q ||
|
|
425
|
+
disabled: !Q || j,
|
|
428
426
|
onClick: () => void Fe({
|
|
429
427
|
kind: "version",
|
|
430
428
|
version: e.version
|
|
@@ -442,6 +440,6 @@ var ye = ({ run: t }) => {
|
|
|
442
440
|
})
|
|
443
441
|
});
|
|
444
442
|
};
|
|
445
|
-
export {
|
|
443
|
+
export { k as PromptStudioPage };
|
|
446
444
|
|
|
447
445
|
//# sourceMappingURL=PromptStudioPage.js.map
|