@burdenoff/microfe-botmanor 2026.1124.1 → 2026.1127.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.
- package/dist/botlit/BotmanorRootInner.js +45 -44
- package/dist/botlit/BotmanorRootInner.js.map +1 -1
- package/dist/botlit/components/AgentA2APanel.js +63 -62
- package/dist/botlit/components/AgentA2APanel.js.map +1 -1
- package/dist/botlit/components/AgentBindingsPanel.js +125 -124
- package/dist/botlit/components/AgentBindingsPanel.js.map +1 -1
- package/dist/botlit/components/AgentFallbackModelsPicker.js +56 -55
- package/dist/botlit/components/AgentFallbackModelsPicker.js.map +1 -1
- package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
- package/dist/botlit/components/AssistantChannelPanel.js +40 -39
- package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
- package/dist/botlit/components/AssistantRuntimeSetupPanel.js +36 -35
- package/dist/botlit/components/AssistantRuntimeSetupPanel.js.map +1 -1
- package/dist/botlit/components/BotAgentsPanel.js +104 -103
- package/dist/botlit/components/BotAgentsPanel.js.map +1 -1
- package/dist/botlit/components/BotFormFields.js +118 -117
- package/dist/botlit/components/BotFormFields.js.map +1 -1
- package/dist/botlit/components/BucketDialogs.js +110 -110
- package/dist/botlit/components/BucketDialogs.js.map +1 -1
- package/dist/botlit/components/ChannelRoutesPanel.js +29 -28
- package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -1
- package/dist/botlit/components/CreateChannelRouteDialog.js +105 -105
- package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -1
- package/dist/botlit/components/DescribeBotDialog.js +86 -86
- package/dist/botlit/components/DescribeBotDialog.js.map +1 -1
- package/dist/botlit/components/EmptyState.d.ts +8 -0
- package/dist/botlit/components/EmptyState.js +43 -30
- package/dist/botlit/components/EmptyState.js.map +1 -1
- package/dist/botlit/components/HandoffConfigPanel.js +125 -124
- package/dist/botlit/components/HandoffConfigPanel.js.map +1 -1
- package/dist/botlit/components/HandoffTargetPickers.js +42 -41
- package/dist/botlit/components/HandoffTargetPickers.js.map +1 -1
- package/dist/botlit/components/KnowledgeBackendMigrationPanel.js +106 -105
- package/dist/botlit/components/KnowledgeBackendMigrationPanel.js.map +1 -1
- package/dist/botlit/components/KnowledgeRetrievalTestPanel.js +76 -75
- package/dist/botlit/components/KnowledgeRetrievalTestPanel.js.map +1 -1
- package/dist/botlit/components/KnowledgeSourceImportPanel.js +76 -75
- package/dist/botlit/components/KnowledgeSourceImportPanel.js.map +1 -1
- package/dist/botlit/components/ModelRegistrationPanel.js +70 -69
- package/dist/botlit/components/ModelRegistrationPanel.js.map +1 -1
- package/dist/botlit/components/StorePackageDraftCard.js +87 -86
- package/dist/botlit/components/StorePackageDraftCard.js.map +1 -1
- package/dist/botlit/components/SuggestionsPanel.js.map +1 -1
- package/dist/botlit/hooks/internal/workspaceGateway.d.ts +12 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js +1 -1
- package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
- package/dist/botlit/hooks/useA2A.js +2 -1
- package/dist/botlit/hooks/useA2A.js.map +1 -1
- package/dist/botlit/hooks/useA2AConnections.js +30 -38
- package/dist/botlit/hooks/useA2AConnections.js.map +1 -1
- package/dist/botlit/hooks/useKnowledgeBases.js +91 -48
- package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
- package/dist/botlit/pages/A2AAgentDetailPage.js +263 -262
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/A2ARegistryPage.js +47 -46
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +426 -425
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
- package/dist/botlit/pages/AgentDetailPage.js +1 -0
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/AgentsListPage.js +248 -247
- package/dist/botlit/pages/AgentsListPage.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +324 -310
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +1 -0
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotWorkflowTab.js +126 -121
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/pages/BotsListPage.js +1 -0
- package/dist/botlit/pages/BotsListPage.js.map +1 -1
- package/dist/botlit/pages/BucketDetailPage.js +1 -0
- package/dist/botlit/pages/BucketDetailPage.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +1 -0
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/ChannelDetailPage.js +267 -266
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
- package/dist/botlit/pages/ChannelsPage.js +187 -186
- package/dist/botlit/pages/ChannelsPage.js.map +1 -1
- package/dist/botlit/pages/ChatPage.js +69 -68
- package/dist/botlit/pages/ChatPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionDetailPage.js +1 -0
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +191 -191
- package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
- package/dist/botlit/pages/HandoffsPage.js +65 -64
- package/dist/botlit/pages/HandoffsPage.js.map +1 -1
- package/dist/botlit/pages/InstalledPackagesPage.js +146 -145
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +235 -234
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBasesPage.js +152 -151
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +180 -179
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/MCPServersPage.js +145 -145
- package/dist/botlit/pages/MCPServersPage.js.map +1 -1
- package/dist/botlit/pages/PoliciesPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +293 -292
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +229 -229
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplateDetailPage.js +280 -279
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplatesPage.js +31 -30
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +204 -203
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
- package/dist/botlit/pages/SettingsPage.js +153 -153
- package/dist/botlit/pages/SettingsPage.js.map +1 -1
- package/dist/botlit/pages/SkillDetailPage.js +305 -304
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
- package/dist/botlit/pages/SkillsPage.js.map +1 -1
- package/dist/botlit/pages/StorePackageDetailPage.js +1 -0
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +173 -173
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/dist/botlit/utils/confirmAction.d.ts +13 -11
- package/dist/botlit/utils/confirmAction.js +26 -4
- package/dist/botlit/utils/confirmAction.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +106 -42
- package/dist/generated/wspace-operations.js +198 -172
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +9859 -49
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +3 -3
|
@@ -20,28 +20,28 @@ import { PROMPT_TEMPLATE_DESCRIPTION_MAX_LENGTH as ge, PROMPT_TEMPLATE_ERROR_MES
|
|
|
20
20
|
import { toUnion as b } from "../utils/unions.js";
|
|
21
21
|
import "../permissions/index.js";
|
|
22
22
|
import { useMemo as x, useRef as De, useState as S } from "react";
|
|
23
|
-
import { PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
|
|
24
|
-
import { Fragment as
|
|
23
|
+
import { PagePurpose as Oe, ThemedSelect as C } from "@burdenoff/fe-libs/ui";
|
|
24
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
25
25
|
import { useParams as ke } from "react-router";
|
|
26
|
-
import { AlertTriangle as
|
|
27
|
-
import { toast as
|
|
26
|
+
import { AlertTriangle as D, ArrowLeft as Ae, Check as je, Code as Me, Copy as Ne, CopyPlus as Pe, Edit3 as Fe, Eye as Ie, FileText as Le, Play as O, Plus as Re, Save as ze, Settings as Be, Trash2 as Ve, Variable as k } from "lucide-react";
|
|
27
|
+
import { toast as A } from "sonner";
|
|
28
28
|
// src/botlit/pages/PromptTemplateDetailPage.tsx
|
|
29
|
-
var
|
|
29
|
+
var He = [
|
|
30
30
|
"string",
|
|
31
31
|
"number",
|
|
32
32
|
"boolean",
|
|
33
33
|
"array",
|
|
34
34
|
"object"
|
|
35
|
-
],
|
|
35
|
+
], j = [
|
|
36
36
|
"PRIVATE",
|
|
37
37
|
"WORKSPACE",
|
|
38
38
|
"PUBLIC"
|
|
39
|
-
],
|
|
39
|
+
], M = [
|
|
40
40
|
"DRAFT",
|
|
41
41
|
"ACTIVE",
|
|
42
42
|
"DEPRECATED",
|
|
43
43
|
"ARCHIVED"
|
|
44
|
-
],
|
|
44
|
+
], Ue = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary", We = {
|
|
45
45
|
name: "",
|
|
46
46
|
slug: "",
|
|
47
47
|
description: "",
|
|
@@ -49,11 +49,11 @@ var Ue = [
|
|
|
49
49
|
visibility: "PRIVATE",
|
|
50
50
|
templateText: "",
|
|
51
51
|
variables: []
|
|
52
|
-
},
|
|
52
|
+
}, Ge = ({ text: e, emptyText: t }) => e ? /* @__PURE__ */ T(w, { children: y(e).map((e, t) => e.variable ? /* @__PURE__ */ T("span", {
|
|
53
53
|
className: "rounded bg-action-primary-bg/20 px-1 font-mono text-primary",
|
|
54
54
|
"data-variable": e.variable,
|
|
55
55
|
children: e.text
|
|
56
|
-
}, t) : /* @__PURE__ */
|
|
56
|
+
}, t) : /* @__PURE__ */ T("span", { children: e.text }, t)) }) : /* @__PURE__ */ T("span", {
|
|
57
57
|
className: "text-text-secondary",
|
|
58
58
|
children: t
|
|
59
59
|
});
|
|
@@ -61,47 +61,47 @@ function N(e) {
|
|
|
61
61
|
return e == null ? "" : typeof e == "string" ? e : JSON.stringify(e);
|
|
62
62
|
}
|
|
63
63
|
var P = ({ isNew: y }) => {
|
|
64
|
-
let P = a(), { templateId:
|
|
65
|
-
me(
|
|
66
|
-
let Y = (e) => U && e ? P(`botlit.promptTemplates.errors.${e}`, _e[e]) : void 0,
|
|
64
|
+
let P = a(), { templateId: Ke } = ke(), { navigateTo: F } = e(), { data: I, loading: qe, error: Je, refetch: Ye } = ue(y ? void 0 : Ke), { create: Xe, loading: Ze } = oe(), { update: Qe, loading: $e } = fe(), { remove: et, loading: tt } = se(), { render: nt, loading: rt } = de(), { duplicate: it, loading: at } = ce(), ot = le(), [L, st] = S("edit"), [ct, lt] = S(!1), [R, ut] = S({}), [dt, ft] = S(null), [pt, mt] = S(null), [z, B] = S(!1), [ht, gt] = S(!1), [V, H] = S(We), [_t, vt] = S(We), yt = De(!1), [U, W] = S(!1), [bt, G] = S(!1), xt = !!(y || z), St = x(() => JSON.stringify(V) !== JSON.stringify(_t), [V, _t]), Ct = xt && !bt && St, K = x(() => Te(V, !!y), [V, y]), q = xe(K), wt = x(() => we(V.templateText), [V.templateText]), J = x(() => Ee(V.templateText, V.variables), [V.templateText, V.variables]);
|
|
65
|
+
me(Ct, P);
|
|
66
|
+
let Y = (e) => U && e ? P(`botlit.promptTemplates.errors.${e}`, _e[e]) : void 0, Tt = (e) => U && e ? P(`botlit.promptTemplates.errors.${e}`, _e[e]) : void 0, Et = async () => !Ct || pe({
|
|
67
67
|
title: P("botlit.promptTemplates.discard.title", "Discard changes?"),
|
|
68
68
|
message: P("botlit.promptTemplates.discard.message", "You have unsaved changes. If you leave now they will be lost."),
|
|
69
69
|
confirmLabel: P("botlit.promptTemplates.discard.confirm", "Discard"),
|
|
70
70
|
cancelLabel: P("botlit.promptTemplates.discard.keepEditing", "Keep editing")
|
|
71
71
|
}), X = async (e) => {
|
|
72
|
-
await
|
|
73
|
-
},
|
|
74
|
-
await
|
|
75
|
-
},
|
|
72
|
+
await Et() && (G(!0), F(e));
|
|
73
|
+
}, Dt = async () => {
|
|
74
|
+
await Et() && (B(!1), W(!1));
|
|
75
|
+
}, Ot = (e) => e.map((e) => ({
|
|
76
76
|
name: e.name.trim(),
|
|
77
77
|
type: e.type,
|
|
78
78
|
required: e.required,
|
|
79
79
|
...e.description?.trim() ? { description: e.description.trim() } : {},
|
|
80
80
|
...e.defaultValue !== void 0 && e.defaultValue !== "" ? { defaultValue: N(e.defaultValue) } : {}
|
|
81
|
-
})),
|
|
81
|
+
})), kt = async (e) => {
|
|
82
82
|
if (e?.preventDefault(), W(!0), q) return;
|
|
83
83
|
let t = V.name.trim(), n;
|
|
84
84
|
try {
|
|
85
|
-
n = await
|
|
85
|
+
n = await Xe({
|
|
86
86
|
name: t,
|
|
87
87
|
slug: V.slug.trim(),
|
|
88
88
|
description: V.description.trim() || void 0,
|
|
89
89
|
status: V.status,
|
|
90
90
|
visibility: V.visibility,
|
|
91
91
|
templateText: V.templateText,
|
|
92
|
-
variables:
|
|
92
|
+
variables: Ot(V.variables),
|
|
93
93
|
exampleInputs: []
|
|
94
94
|
});
|
|
95
95
|
} catch (e) {
|
|
96
|
-
|
|
96
|
+
A.error(v(e, P("botlit.promptTemplates.createError", "Failed to create the prompt template")));
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
G(!0),
|
|
100
|
-
},
|
|
99
|
+
G(!0), A.success(P("botlit.promptTemplates.created", "Template \"{{name}}\" created", { name: t })), F(n?.id ? `prompt-templates/${n.id}` : "prompt-templates");
|
|
100
|
+
}, At = (e) => H((t) => ({
|
|
101
101
|
...t,
|
|
102
102
|
name: e,
|
|
103
|
-
slug: y && !
|
|
104
|
-
})),
|
|
103
|
+
slug: y && !yt.current ? Ce(e) : t.slug
|
|
104
|
+
})), jt = (e = "") => {
|
|
105
105
|
H((t) => ({
|
|
106
106
|
...t,
|
|
107
107
|
variables: [...t.variables, {
|
|
@@ -110,7 +110,7 @@ var P = ({ isNew: y }) => {
|
|
|
110
110
|
required: !1
|
|
111
111
|
}]
|
|
112
112
|
}));
|
|
113
|
-
},
|
|
113
|
+
}, Mt = () => {
|
|
114
114
|
H((e) => ({
|
|
115
115
|
...e,
|
|
116
116
|
variables: [...e.variables, ...J.undeclared.map((e) => ({
|
|
@@ -130,44 +130,44 @@ var P = ({ isNew: y }) => {
|
|
|
130
130
|
variables: r
|
|
131
131
|
};
|
|
132
132
|
});
|
|
133
|
-
},
|
|
133
|
+
}, Nt = (e) => {
|
|
134
134
|
H((t) => ({
|
|
135
135
|
...t,
|
|
136
136
|
variables: t.variables.filter((t, n) => n !== e)
|
|
137
137
|
}));
|
|
138
|
-
},
|
|
138
|
+
}, Pt = async () => {
|
|
139
139
|
if (I) {
|
|
140
|
-
|
|
140
|
+
mt(null);
|
|
141
141
|
try {
|
|
142
|
-
let e = await
|
|
142
|
+
let e = await nt({
|
|
143
143
|
templateId: I.id,
|
|
144
144
|
variables: R
|
|
145
145
|
});
|
|
146
|
-
|
|
146
|
+
ft(e ?? null);
|
|
147
147
|
} catch (e) {
|
|
148
148
|
let t = v(e, P("botlit.promptTemplates.renderError", "Failed to render the prompt template"));
|
|
149
|
-
|
|
149
|
+
ft(null), mt(t), A.error(t);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, Ft = async () => {
|
|
153
153
|
let e = I?.templateText || V.templateText;
|
|
154
|
-
await n(e),
|
|
155
|
-
},
|
|
154
|
+
await n(e), lt(!0), t() && i(P("botlit.promptTemplates.copied", "Copied")), setTimeout(() => lt(!1), 2e3);
|
|
155
|
+
}, It = () => {
|
|
156
156
|
if (!I) return;
|
|
157
157
|
let e = {
|
|
158
158
|
name: I.name,
|
|
159
159
|
slug: I.slug,
|
|
160
160
|
description: I.description || "",
|
|
161
|
-
status: b(I.status,
|
|
162
|
-
visibility: b(I.visibility,
|
|
161
|
+
status: b(I.status, M, "DRAFT"),
|
|
162
|
+
visibility: b(I.visibility, j, "PRIVATE"),
|
|
163
163
|
templateText: I.templateText,
|
|
164
164
|
variables: ae(I)
|
|
165
165
|
};
|
|
166
|
-
H(e),
|
|
167
|
-
},
|
|
166
|
+
H(e), vt(e), W(!1), G(!1), B(!0);
|
|
167
|
+
}, Lt = async (e) => {
|
|
168
168
|
if (e?.preventDefault(), I && (W(!0), !q)) {
|
|
169
169
|
try {
|
|
170
|
-
await
|
|
170
|
+
await Qe({
|
|
171
171
|
templateId: I.id,
|
|
172
172
|
input: {
|
|
173
173
|
name: V.name.trim(),
|
|
@@ -175,38 +175,38 @@ var P = ({ isNew: y }) => {
|
|
|
175
175
|
status: V.status,
|
|
176
176
|
visibility: V.visibility,
|
|
177
177
|
templateText: V.templateText,
|
|
178
|
-
variables:
|
|
178
|
+
variables: Ot(V.variables)
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
} catch (e) {
|
|
182
|
-
|
|
182
|
+
A.error(v(e, P("botlit.promptTemplates.updateError", "Failed to update the prompt template")));
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
A.success(P("botlit.promptTemplates.updated", "Template updated")), B(!1), W(!1), Ye();
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, Rt = async () => {
|
|
188
188
|
if (!I) return;
|
|
189
189
|
let e = P("botlit.promptTemplates.duplicate.suffix", " (copy)"), t = Math.max(100 - e.length, 1), n = `${I.name.slice(0, t)}${e}`.slice(0, 100), r;
|
|
190
190
|
try {
|
|
191
|
-
r = await
|
|
191
|
+
r = await it({
|
|
192
192
|
templateId: I.id,
|
|
193
193
|
name: n
|
|
194
194
|
});
|
|
195
195
|
} catch (e) {
|
|
196
|
-
|
|
196
|
+
A.error(v(e, P("botlit.promptTemplates.duplicate.error", "Failed to duplicate the prompt template")));
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
|
|
200
|
-
},
|
|
199
|
+
A.success(P("botlit.promptTemplates.duplicate.done", "Created \"{{name}}\" as a draft copy. Rename it and adjust it as needed.", { name: n })), r?.id && F(`prompt-templates/${r.id}`);
|
|
200
|
+
}, zt = async () => {
|
|
201
201
|
if (!I) return;
|
|
202
|
-
|
|
202
|
+
gt(!0);
|
|
203
203
|
let e = null;
|
|
204
204
|
try {
|
|
205
|
-
e = await
|
|
205
|
+
e = await ot(I.id);
|
|
206
206
|
} catch {
|
|
207
207
|
e = null;
|
|
208
208
|
} finally {
|
|
209
|
-
|
|
209
|
+
gt(!1);
|
|
210
210
|
}
|
|
211
211
|
if (await pe({
|
|
212
212
|
title: P("botlit.promptTemplates.delete.title", "Delete prompt template?"),
|
|
@@ -215,49 +215,49 @@ var P = ({ isNew: y }) => {
|
|
|
215
215
|
cancelLabel: P("botlit.common.cancel", "Cancel")
|
|
216
216
|
})) {
|
|
217
217
|
try {
|
|
218
|
-
if (await
|
|
219
|
-
|
|
218
|
+
if (await et(I.id) === !1) {
|
|
219
|
+
A.error(P("botlit.promptTemplates.delete.notDeleted", "The prompt template could not be deleted."));
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
} catch (e) {
|
|
223
|
-
t() && r("error"),
|
|
223
|
+
t() && r("error"), A.error(v(e, P("botlit.promptTemplates.delete.error", "Failed to delete the prompt template")));
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
t() && r("success"),
|
|
226
|
+
t() && r("success"), A.success(P("botlit.promptTemplates.delete.done", "Template \"{{name}}\" deleted", { name: I.name })), F("prompt-templates");
|
|
227
227
|
}
|
|
228
|
-
},
|
|
228
|
+
}, Bt = U && q ? /* @__PURE__ */ E("div", {
|
|
229
229
|
role: "alert",
|
|
230
230
|
className: "flex items-start gap-2 rounded-lg border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-text-primary",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ T(D, {
|
|
232
232
|
size: 16,
|
|
233
233
|
className: "mt-0.5 text-status-error-text",
|
|
234
234
|
"aria-hidden": "true"
|
|
235
|
-
}), /* @__PURE__ */
|
|
236
|
-
}) : null,
|
|
237
|
-
/* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ T("p", { children: P("botlit.promptTemplates.errors.summary", "Fix the highlighted fields before saving.") })]
|
|
236
|
+
}) : null, Vt = /* @__PURE__ */ E(w, { children: [
|
|
237
|
+
/* @__PURE__ */ E("div", {
|
|
238
238
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ T(h, {
|
|
240
240
|
label: P("botlit.promptTemplates.form.name", "Template name"),
|
|
241
241
|
htmlFor: "tpl-name",
|
|
242
242
|
required: !0,
|
|
243
243
|
error: Y(K.name),
|
|
244
244
|
description: P("botlit.promptTemplates.form.nameHelp", "Up to {{max}} characters.", { max: 100 }),
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ T(g, {
|
|
246
246
|
id: "tpl-name",
|
|
247
247
|
maxLength: 100,
|
|
248
248
|
"aria-invalid": !!Y(K.name),
|
|
249
249
|
"aria-describedby": Y(K.name) ? "tpl-name-error" : "tpl-name-description",
|
|
250
250
|
placeholder: P("botlit.promptTemplates.form.namePlaceholder", "e.g., Technical Support Template"),
|
|
251
251
|
value: V.name,
|
|
252
|
-
onChange: (e) =>
|
|
252
|
+
onChange: (e) => At(e.target.value)
|
|
253
253
|
})
|
|
254
|
-
}), y ? /* @__PURE__ */
|
|
254
|
+
}), y ? /* @__PURE__ */ T(h, {
|
|
255
255
|
label: P("botlit.promptTemplates.form.slug", "Slug"),
|
|
256
256
|
htmlFor: "tpl-slug",
|
|
257
257
|
required: !0,
|
|
258
258
|
error: Y(K.slug),
|
|
259
259
|
description: P("botlit.promptTemplates.form.slugHelp", "Suggested from the name. Lowercase letters, numbers and single hyphens, up to {{max}} characters. It cannot change after the template is created.", { max: 64 }),
|
|
260
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ T(g, {
|
|
261
261
|
id: "tpl-slug",
|
|
262
262
|
className: "font-mono",
|
|
263
263
|
maxLength: 64,
|
|
@@ -266,17 +266,17 @@ var P = ({ isNew: y }) => {
|
|
|
266
266
|
placeholder: P("botlit.promptTemplates.form.slugPlaceholder", "e.g., technical-support"),
|
|
267
267
|
value: V.slug,
|
|
268
268
|
onChange: (e) => {
|
|
269
|
-
|
|
269
|
+
yt.current = !0, H({
|
|
270
270
|
...V,
|
|
271
271
|
slug: e.target.value.toLowerCase()
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
|
-
}) : /* @__PURE__ */
|
|
275
|
+
}) : /* @__PURE__ */ T(h, {
|
|
276
276
|
label: P("botlit.promptTemplates.form.slug", "Slug"),
|
|
277
277
|
htmlFor: "tpl-slug",
|
|
278
278
|
description: P("botlit.promptTemplates.form.slugLocked", "The slug cannot change: lookups by slug depend on it."),
|
|
279
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ T(g, {
|
|
280
280
|
id: "tpl-slug",
|
|
281
281
|
className: "font-mono",
|
|
282
282
|
readOnly: !0,
|
|
@@ -285,11 +285,11 @@ var P = ({ isNew: y }) => {
|
|
|
285
285
|
})
|
|
286
286
|
})]
|
|
287
287
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ T(h, {
|
|
289
289
|
label: P("botlit.promptTemplates.form.description", "Description"),
|
|
290
290
|
htmlFor: "tpl-description",
|
|
291
291
|
error: Y(K.description),
|
|
292
|
-
children: /* @__PURE__ */
|
|
292
|
+
children: /* @__PURE__ */ T(ne, {
|
|
293
293
|
id: "tpl-description",
|
|
294
294
|
maxLength: ge,
|
|
295
295
|
placeholder: P("botlit.promptTemplates.form.descriptionPlaceholder", "What is this template used for?"),
|
|
@@ -301,47 +301,47 @@ var P = ({ isNew: y }) => {
|
|
|
301
301
|
rows: 2
|
|
302
302
|
})
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ E("div", {
|
|
305
305
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ T(h, {
|
|
307
307
|
label: P("botlit.promptTemplates.form.status", "Status"),
|
|
308
308
|
htmlFor: "tpl-status",
|
|
309
309
|
description: P("botlit.promptTemplates.form.statusHelp", "Archived templates are ignored by agents and skills, as if detached. Draft, active and deprecated templates are all used."),
|
|
310
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ T(C, {
|
|
311
311
|
id: "tpl-status",
|
|
312
|
-
className:
|
|
312
|
+
className: Ue,
|
|
313
313
|
"aria-describedby": "tpl-status-description",
|
|
314
314
|
value: V.status,
|
|
315
315
|
onChange: (e) => H({
|
|
316
316
|
...V,
|
|
317
|
-
status: b(e.target.value,
|
|
317
|
+
status: b(e.target.value, M, "DRAFT")
|
|
318
318
|
}),
|
|
319
|
-
children:
|
|
319
|
+
children: M.map((e) => /* @__PURE__ */ T("option", {
|
|
320
320
|
value: e,
|
|
321
321
|
children: P(`botlit.promptTemplates.status.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase())
|
|
322
322
|
}, e))
|
|
323
323
|
})
|
|
324
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ T(h, {
|
|
325
325
|
label: P("botlit.promptTemplates.form.visibility", "Visibility"),
|
|
326
326
|
htmlFor: "tpl-visibility",
|
|
327
327
|
description: P("botlit.promptTemplates.form.visibilityHelp", "Not enforced yet: every member who can view templates sees this one."),
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ T(C, {
|
|
329
329
|
id: "tpl-visibility",
|
|
330
|
-
className:
|
|
330
|
+
className: Ue,
|
|
331
331
|
"aria-describedby": "tpl-visibility-description",
|
|
332
332
|
value: V.visibility,
|
|
333
333
|
onChange: (e) => H({
|
|
334
334
|
...V,
|
|
335
|
-
visibility: b(e.target.value,
|
|
335
|
+
visibility: b(e.target.value, j, "PRIVATE")
|
|
336
336
|
}),
|
|
337
|
-
children:
|
|
337
|
+
children: j.map((e) => /* @__PURE__ */ T("option", {
|
|
338
338
|
value: e,
|
|
339
339
|
children: P(`botlit.promptTemplates.visibility.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase())
|
|
340
340
|
}, e))
|
|
341
341
|
})
|
|
342
342
|
})]
|
|
343
343
|
})
|
|
344
|
-
] }),
|
|
344
|
+
] }), Ht = /* @__PURE__ */ T(h, {
|
|
345
345
|
label: P("botlit.promptTemplates.form.content", "Template text"),
|
|
346
346
|
htmlFor: "tpl-content",
|
|
347
347
|
required: !0,
|
|
@@ -351,7 +351,7 @@ var P = ({ isNew: y }) => {
|
|
|
351
351
|
max: ve,
|
|
352
352
|
count: V.templateText.length
|
|
353
353
|
}),
|
|
354
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ T(ne, {
|
|
355
355
|
id: "tpl-content",
|
|
356
356
|
className: "font-mono text-sm min-h-[240px]",
|
|
357
357
|
maxLength: ve,
|
|
@@ -367,68 +367,68 @@ var P = ({ isNew: y }) => {
|
|
|
367
367
|
templateText: e.target.value
|
|
368
368
|
})
|
|
369
369
|
})
|
|
370
|
-
}),
|
|
370
|
+
}), Ut = J.undeclared.length > 0 || J.unused.length > 0 ? /* @__PURE__ */ E("div", {
|
|
371
371
|
role: "status",
|
|
372
372
|
className: "space-y-2 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-3 text-sm text-text-primary",
|
|
373
|
-
children: [J.undeclared.length > 0 && /* @__PURE__ */
|
|
373
|
+
children: [J.undeclared.length > 0 && /* @__PURE__ */ E("div", {
|
|
374
374
|
className: "flex flex-wrap items-center gap-2",
|
|
375
375
|
children: [
|
|
376
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ T(D, {
|
|
377
377
|
size: 16,
|
|
378
378
|
className: "text-status-warning-text",
|
|
379
379
|
"aria-hidden": "true"
|
|
380
380
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ T("span", { children: P("botlit.promptTemplates.variables.undeclared", "Used in the text but not declared: {{names}}. Rendering fails until they are declared.", { names: J.undeclared.join(", ") }) }),
|
|
382
|
+
/* @__PURE__ */ T(m, {
|
|
383
383
|
type: "button",
|
|
384
384
|
size: "sm",
|
|
385
385
|
variant: "outline",
|
|
386
|
-
onClick:
|
|
386
|
+
onClick: Mt,
|
|
387
387
|
children: P("botlit.promptTemplates.variables.addDetected", "Add detected variables")
|
|
388
388
|
})
|
|
389
389
|
]
|
|
390
|
-
}), J.unused.length > 0 && /* @__PURE__ */
|
|
390
|
+
}), J.unused.length > 0 && /* @__PURE__ */ E("div", {
|
|
391
391
|
className: "flex items-center gap-2",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ T(D, {
|
|
393
393
|
size: 16,
|
|
394
394
|
className: "text-status-warning-text",
|
|
395
395
|
"aria-hidden": "true"
|
|
396
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ T("span", { children: P("botlit.promptTemplates.variables.unused", "Declared but not used in the text: {{names}}.", { names: J.unused.join(", ") }) })]
|
|
397
397
|
})]
|
|
398
|
-
}) : null,
|
|
398
|
+
}) : null, Wt = /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ E(p, {
|
|
399
399
|
className: "flex items-center justify-between",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ E("span", {
|
|
401
401
|
className: "flex items-center gap-2",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ T(k, {
|
|
403
403
|
size: 18,
|
|
404
404
|
"aria-hidden": "true"
|
|
405
405
|
}), P("botlit.promptTemplates.variables.title", "Variables")]
|
|
406
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ T(m, {
|
|
407
407
|
type: "button",
|
|
408
408
|
variant: "outline",
|
|
409
409
|
size: "sm",
|
|
410
|
-
leftIcon: /* @__PURE__ */
|
|
411
|
-
onClick: () =>
|
|
410
|
+
leftIcon: /* @__PURE__ */ T(Re, { size: 14 }),
|
|
411
|
+
onClick: () => jt(),
|
|
412
412
|
children: P("botlit.promptTemplates.variables.add", "Add variable")
|
|
413
413
|
})]
|
|
414
|
-
}), /* @__PURE__ */
|
|
414
|
+
}), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.variables.description", "Declare each variable the text uses. A required variable must be given a value (or have a default) whenever the template is used; an optional one without a value is left out. Types are checked when the template is used.") })] }), /* @__PURE__ */ E(u, {
|
|
415
415
|
className: "space-y-4",
|
|
416
|
-
children: [
|
|
416
|
+
children: [Ut, V.variables.length > 0 ? /* @__PURE__ */ T("ul", {
|
|
417
417
|
className: "space-y-4",
|
|
418
418
|
children: V.variables.map((e, t) => {
|
|
419
|
-
let n = `tpl-var-${t}`, r = K.variables[t], i =
|
|
420
|
-
return /* @__PURE__ */
|
|
419
|
+
let n = `tpl-var-${t}`, r = K.variables[t], i = Tt(r?.name), a = Tt(r?.defaultValue), o = e.type === "array" || e.type === "object";
|
|
420
|
+
return /* @__PURE__ */ E("li", {
|
|
421
421
|
className: "space-y-3 rounded-lg border bg-bg-sunken/30 p-4",
|
|
422
422
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ E("div", {
|
|
424
424
|
className: "grid grid-cols-1 gap-3 md:grid-cols-3",
|
|
425
425
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ T(h, {
|
|
427
427
|
label: P("botlit.promptTemplates.variables.name", "Name"),
|
|
428
428
|
htmlFor: `${n}-name`,
|
|
429
429
|
required: !0,
|
|
430
430
|
error: i,
|
|
431
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ T(g, {
|
|
432
432
|
id: `${n}-name`,
|
|
433
433
|
className: "font-mono",
|
|
434
434
|
"aria-invalid": !!i,
|
|
@@ -438,26 +438,26 @@ var P = ({ isNew: y }) => {
|
|
|
438
438
|
onChange: (e) => Z(t, { name: e.target.value })
|
|
439
439
|
})
|
|
440
440
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ T(h, {
|
|
442
442
|
label: P("botlit.promptTemplates.variables.type", "Type"),
|
|
443
443
|
htmlFor: `${n}-type`,
|
|
444
|
-
children: /* @__PURE__ */
|
|
444
|
+
children: /* @__PURE__ */ T(C, {
|
|
445
445
|
id: `${n}-type`,
|
|
446
|
-
className:
|
|
446
|
+
className: Ue,
|
|
447
447
|
value: e.type,
|
|
448
|
-
onChange: (e) => Z(t, { type: b(e.target.value,
|
|
449
|
-
children:
|
|
448
|
+
onChange: (e) => Z(t, { type: b(e.target.value, He, "string") }),
|
|
449
|
+
children: He.map((e) => /* @__PURE__ */ T("option", {
|
|
450
450
|
value: e,
|
|
451
451
|
children: e
|
|
452
452
|
}, e))
|
|
453
453
|
})
|
|
454
454
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ T(h, {
|
|
456
456
|
label: P("botlit.promptTemplates.variables.default", "Default value"),
|
|
457
457
|
htmlFor: `${n}-default`,
|
|
458
458
|
error: a,
|
|
459
459
|
description: o ? P("botlit.promptTemplates.variables.defaultJsonHelp", "Optional. JSON, for example [\"a\", \"b\"] or {\"key\": \"value\"}.") : P("botlit.promptTemplates.variables.defaultHelp", "Optional. Used when no value is given."),
|
|
460
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ T(g, {
|
|
461
461
|
id: `${n}-default`,
|
|
462
462
|
className: o ? "font-mono" : void 0,
|
|
463
463
|
maxLength: ye,
|
|
@@ -469,310 +469,311 @@ var P = ({ isNew: y }) => {
|
|
|
469
469
|
})
|
|
470
470
|
]
|
|
471
471
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ T(h, {
|
|
473
473
|
label: P("botlit.promptTemplates.variables.descriptionLabel", "Description"),
|
|
474
474
|
htmlFor: `${n}-description`,
|
|
475
|
-
children: /* @__PURE__ */
|
|
475
|
+
children: /* @__PURE__ */ T(g, {
|
|
476
476
|
id: `${n}-description`,
|
|
477
477
|
placeholder: P("botlit.promptTemplates.variables.descriptionPlaceholder", "What is this variable for?"),
|
|
478
478
|
value: e.description || "",
|
|
479
479
|
onChange: (e) => Z(t, { description: e.target.value })
|
|
480
480
|
})
|
|
481
481
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ E("div", {
|
|
483
483
|
className: "flex items-center justify-between",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ E("label", {
|
|
485
485
|
className: "flex items-center gap-2 text-sm",
|
|
486
486
|
htmlFor: `${n}-required`,
|
|
487
|
-
children: [/* @__PURE__ */
|
|
487
|
+
children: [/* @__PURE__ */ T("input", {
|
|
488
488
|
id: `${n}-required`,
|
|
489
489
|
type: "checkbox",
|
|
490
490
|
checked: e.required,
|
|
491
491
|
onChange: (e) => Z(t, { required: e.target.checked }),
|
|
492
492
|
className: "h-4 w-4"
|
|
493
493
|
}), P("botlit.promptTemplates.variables.required", "Required: a value or default must be given")]
|
|
494
|
-
}), /* @__PURE__ */
|
|
494
|
+
}), /* @__PURE__ */ T(m, {
|
|
495
495
|
type: "button",
|
|
496
496
|
variant: "ghost",
|
|
497
497
|
size: "sm",
|
|
498
498
|
className: "text-status-error-text",
|
|
499
499
|
"aria-label": P("botlit.promptTemplates.variables.removeNamed", "Remove variable {{name}}", { name: e.name || String(t + 1) }),
|
|
500
|
-
onClick: () =>
|
|
500
|
+
onClick: () => Nt(t),
|
|
501
501
|
children: P("botlit.promptTemplates.variables.remove", "Remove")
|
|
502
502
|
})]
|
|
503
503
|
})
|
|
504
504
|
]
|
|
505
505
|
}, t);
|
|
506
506
|
})
|
|
507
|
-
}) : /* @__PURE__ */
|
|
507
|
+
}) : /* @__PURE__ */ E("div", {
|
|
508
508
|
className: "py-6 text-center text-text-secondary",
|
|
509
509
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ T(k, {
|
|
511
511
|
className: "mx-auto mb-2 h-8 w-8 opacity-50",
|
|
512
512
|
"aria-hidden": "true"
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ T("p", { children: P("botlit.promptTemplates.variables.empty", "No variables declared yet") }),
|
|
515
|
+
/* @__PURE__ */ T("p", {
|
|
516
516
|
className: "text-sm",
|
|
517
|
-
children:
|
|
517
|
+
children: wt.length > 0 ? P("botlit.promptTemplates.variables.emptyDetected", "The text uses {{count}} variable(s). Use \"Add detected variables\" to declare them.", { count: wt.length }) : P("botlit.promptTemplates.variables.emptyHelp", "Write {{name}} in the text, then declare it here.", { name: "{{name}}" })
|
|
518
518
|
})
|
|
519
519
|
]
|
|
520
520
|
})]
|
|
521
|
-
})] }),
|
|
521
|
+
})] }), Gt = /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ E(p, {
|
|
522
522
|
className: "flex items-center gap-2",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
523
|
+
children: [/* @__PURE__ */ T(Ie, {
|
|
524
524
|
size: 18,
|
|
525
525
|
"aria-hidden": "true"
|
|
526
526
|
}), P("botlit.promptTemplates.highlighted.title", "Template with variables highlighted")]
|
|
527
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.highlighted.description", "The text as written; values are filled in when an agent, a skill or Prompt Studio uses it.") })] }), /* @__PURE__ */ T(u, { children: /* @__PURE__ */ T("div", {
|
|
528
528
|
className: "whitespace-pre-wrap break-words rounded-lg bg-bg-sunken p-4 font-mono text-sm",
|
|
529
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ T(Ge, {
|
|
530
530
|
text: V.templateText,
|
|
531
531
|
emptyText: P("botlit.promptTemplates.highlighted.empty", "Enter template text...")
|
|
532
532
|
})
|
|
533
533
|
}) })] });
|
|
534
|
-
if (y) return /* @__PURE__ */
|
|
534
|
+
if (y) return /* @__PURE__ */ T(o, {
|
|
535
535
|
title: P("botlit.promptTemplates.createTitle", "Create Prompt Template"),
|
|
536
536
|
description: P("botlit.promptTemplates.createDescription", "Define a reusable prompt with variables"),
|
|
537
|
-
leading: /* @__PURE__ */
|
|
537
|
+
leading: /* @__PURE__ */ T(m, {
|
|
538
538
|
variant: "ghost",
|
|
539
539
|
size: "icon",
|
|
540
540
|
"aria-label": P("botlit.promptTemplates.back", "Back to prompt templates"),
|
|
541
541
|
onClick: () => void X("prompt-templates"),
|
|
542
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ T(Ae, {
|
|
543
543
|
size: 20,
|
|
544
544
|
"aria-hidden": "true"
|
|
545
545
|
})
|
|
546
546
|
}),
|
|
547
|
-
actions: /* @__PURE__ */
|
|
547
|
+
actions: /* @__PURE__ */ E("div", {
|
|
548
548
|
className: "flex gap-2",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ T(m, {
|
|
550
550
|
variant: "outline",
|
|
551
551
|
onClick: () => void X("prompt-templates"),
|
|
552
552
|
children: P("botlit.common.cancel", "Cancel")
|
|
553
|
-
}), /* @__PURE__ */
|
|
553
|
+
}), /* @__PURE__ */ T(m, {
|
|
554
554
|
type: "submit",
|
|
555
555
|
form: "tpl-create-form",
|
|
556
|
-
leftIcon: /* @__PURE__ */
|
|
557
|
-
isLoading:
|
|
556
|
+
leftIcon: /* @__PURE__ */ T(ze, { size: 16 }),
|
|
557
|
+
isLoading: Ze,
|
|
558
558
|
children: P("botlit.promptTemplates.createSubmit", "Create Template")
|
|
559
559
|
})]
|
|
560
560
|
}),
|
|
561
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ E("form", {
|
|
562
562
|
id: "tpl-create-form",
|
|
563
563
|
noValidate: !0,
|
|
564
|
-
onSubmit: (e) => void
|
|
564
|
+
onSubmit: (e) => void kt(e),
|
|
565
565
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ E("div", {
|
|
567
567
|
className: "space-y-6 lg:col-span-2",
|
|
568
568
|
children: [
|
|
569
|
-
|
|
570
|
-
/* @__PURE__ */
|
|
569
|
+
Bt,
|
|
570
|
+
/* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.form.basics", "Basic information") }) }), /* @__PURE__ */ T(u, {
|
|
571
571
|
className: "space-y-4",
|
|
572
|
-
children:
|
|
572
|
+
children: Vt
|
|
573
573
|
})] }),
|
|
574
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ E(p, {
|
|
575
575
|
className: "flex items-center gap-2",
|
|
576
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ T(Me, {
|
|
577
577
|
size: 18,
|
|
578
578
|
"aria-hidden": "true"
|
|
579
579
|
}), P("botlit.promptTemplates.form.contentTitle", "Template content")]
|
|
580
|
-
}) }), /* @__PURE__ */
|
|
581
|
-
|
|
580
|
+
}) }), /* @__PURE__ */ T(u, { children: Ht })] }),
|
|
581
|
+
Wt
|
|
582
582
|
]
|
|
583
|
-
}), /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ E("div", {
|
|
584
584
|
className: "space-y-6",
|
|
585
|
-
children: [
|
|
585
|
+
children: [Gt, /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.tips.title", "How templates are used") }) }), /* @__PURE__ */ T(u, {
|
|
586
586
|
className: "space-y-2 text-sm text-text-secondary",
|
|
587
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ E("ul", {
|
|
588
588
|
className: "list-inside list-disc space-y-1",
|
|
589
589
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ T("li", { children: P("botlit.promptTemplates.tips.bind", "Bind it to an agent on the agent’s Prompt & skills tab, or give it to a skill.") }),
|
|
591
|
+
/* @__PURE__ */ T("li", { children: P("botlit.promptTemplates.tips.edits", "Saving a change updates every agent that uses the template at its next run.") }),
|
|
592
|
+
/* @__PURE__ */ T("li", { children: P("botlit.promptTemplates.tips.versions", "Use Prompt Studio to try a draft against a model and save it as a new version with history.") }),
|
|
593
|
+
/* @__PURE__ */ T("li", { children: P("botlit.promptTemplates.tips.defaults", "Give optional variables a default so the template works without them.") })
|
|
594
594
|
]
|
|
595
595
|
})
|
|
596
596
|
})] })]
|
|
597
597
|
})]
|
|
598
598
|
})
|
|
599
599
|
});
|
|
600
|
-
if (
|
|
600
|
+
if (qe && !I) return /* @__PURE__ */ T(o, {
|
|
601
601
|
title: P("botlit.common.loading", "Loading"),
|
|
602
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ T("div", {
|
|
603
603
|
role: "status",
|
|
604
604
|
"aria-busy": "true",
|
|
605
605
|
"aria-label": P("botlit.common.loading", "Loading"),
|
|
606
606
|
className: "h-96 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer"
|
|
607
607
|
})
|
|
608
608
|
});
|
|
609
|
-
if (
|
|
609
|
+
if (Je && !I) return /* @__PURE__ */ T(o, {
|
|
610
610
|
title: P("botlit.promptTemplates.title", "Prompt Templates"),
|
|
611
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ T(te, {
|
|
612
612
|
resource: P("botlit.promptTemplates.resourceOne", "this prompt template"),
|
|
613
|
-
error:
|
|
614
|
-
onRetry: () => void
|
|
613
|
+
error: Je,
|
|
614
|
+
onRetry: () => void Ye()
|
|
615
615
|
})
|
|
616
616
|
});
|
|
617
|
-
if (!I) return /* @__PURE__ */
|
|
617
|
+
if (!I) return /* @__PURE__ */ T(o, {
|
|
618
618
|
title: P("botlit.promptTemplates.notFound.title", "Template not found"),
|
|
619
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ T(ee, {
|
|
620
|
+
kind: "not-found",
|
|
620
621
|
illustration: "empty-files",
|
|
621
622
|
title: P("botlit.promptTemplates.notFound.title", "Template not found"),
|
|
622
623
|
description: P("botlit.promptTemplates.notFound.description", "This prompt template does not exist or was deleted."),
|
|
623
|
-
action: /* @__PURE__ */
|
|
624
|
+
action: /* @__PURE__ */ T(m, {
|
|
624
625
|
onClick: () => F("prompt-templates"),
|
|
625
626
|
children: P("botlit.promptTemplates.back", "Back to prompt templates")
|
|
626
627
|
})
|
|
627
628
|
})
|
|
628
629
|
});
|
|
629
630
|
let Q = ae(I), $ = ie(I);
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ T(o, {
|
|
631
632
|
title: I.name,
|
|
632
|
-
leading: /* @__PURE__ */
|
|
633
|
+
leading: /* @__PURE__ */ T(m, {
|
|
633
634
|
variant: "ghost",
|
|
634
635
|
size: "icon",
|
|
635
636
|
"aria-label": P("botlit.promptTemplates.back", "Back to prompt templates"),
|
|
636
637
|
onClick: () => void X("prompt-templates"),
|
|
637
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ T(Ae, {
|
|
638
639
|
size: 20,
|
|
639
640
|
"aria-hidden": "true"
|
|
640
641
|
})
|
|
641
642
|
}),
|
|
642
|
-
meta: /* @__PURE__ */
|
|
643
|
+
meta: /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(re, { status: I.status }), /* @__PURE__ */ E(_, {
|
|
643
644
|
variant: "secondary",
|
|
644
645
|
className: "font-mono",
|
|
645
646
|
children: ["v", I.version]
|
|
646
647
|
})] }),
|
|
647
|
-
description: /* @__PURE__ */
|
|
648
|
+
description: /* @__PURE__ */ E("span", {
|
|
648
649
|
className: "font-mono",
|
|
649
650
|
children: [I.slug, I.description ? ` · ${I.description}` : ""]
|
|
650
651
|
}),
|
|
651
|
-
actions: /* @__PURE__ */
|
|
652
|
+
actions: /* @__PURE__ */ T("div", {
|
|
652
653
|
className: "flex flex-wrap gap-2",
|
|
653
|
-
children: z ? /* @__PURE__ */
|
|
654
|
+
children: z ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(m, {
|
|
654
655
|
variant: "outline",
|
|
655
|
-
onClick: () => void
|
|
656
|
+
onClick: () => void Dt(),
|
|
656
657
|
children: P("botlit.common.cancel", "Cancel")
|
|
657
|
-
}), /* @__PURE__ */
|
|
658
|
+
}), /* @__PURE__ */ T(m, {
|
|
658
659
|
type: "submit",
|
|
659
660
|
form: "tpl-edit-form",
|
|
660
|
-
leftIcon: /* @__PURE__ */
|
|
661
|
-
isLoading:
|
|
661
|
+
leftIcon: /* @__PURE__ */ T(ze, { size: 16 }),
|
|
662
|
+
isLoading: $e,
|
|
662
663
|
children: P("botlit.promptTemplates.save", "Save changes")
|
|
663
|
-
})] }) : /* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
664
|
+
})] }) : /* @__PURE__ */ E(w, { children: [
|
|
665
|
+
/* @__PURE__ */ T(m, {
|
|
665
666
|
variant: "outline",
|
|
666
|
-
leftIcon:
|
|
667
|
-
onClick: () => void
|
|
668
|
-
children:
|
|
667
|
+
leftIcon: T(ct ? je : Ne, { size: 16 }),
|
|
668
|
+
onClick: () => void Ft(),
|
|
669
|
+
children: ct ? P("botlit.promptTemplates.copiedButton", "Copied!") : P("botlit.promptTemplates.copy", "Copy text")
|
|
669
670
|
}),
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ T(c, {
|
|
671
672
|
permission: s.PROMPT_TEMPLATE_CREATE,
|
|
672
|
-
children: /* @__PURE__ */
|
|
673
|
+
children: /* @__PURE__ */ T(m, {
|
|
673
674
|
variant: "outline",
|
|
674
|
-
leftIcon: /* @__PURE__ */
|
|
675
|
-
onClick: () => void
|
|
676
|
-
isLoading:
|
|
675
|
+
leftIcon: /* @__PURE__ */ T(Pe, { size: 16 }),
|
|
676
|
+
onClick: () => void Rt(),
|
|
677
|
+
isLoading: at,
|
|
677
678
|
children: P("botlit.promptTemplates.duplicate.action", "Duplicate")
|
|
678
679
|
})
|
|
679
680
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ T(c, {
|
|
681
682
|
permission: s.PROMPT_TEMPLATE_UPDATE,
|
|
682
|
-
children: /* @__PURE__ */
|
|
683
|
+
children: /* @__PURE__ */ T(m, {
|
|
683
684
|
variant: "outline",
|
|
684
|
-
leftIcon: /* @__PURE__ */
|
|
685
|
-
onClick:
|
|
685
|
+
leftIcon: /* @__PURE__ */ T(Fe, { size: 16 }),
|
|
686
|
+
onClick: It,
|
|
686
687
|
children: P("botlit.promptTemplates.edit", "Edit Template")
|
|
687
688
|
})
|
|
688
689
|
}),
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ T(c, {
|
|
690
691
|
permission: s.PROMPT_TEMPLATE_DELETE,
|
|
691
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ T(m, {
|
|
692
693
|
variant: "outline",
|
|
693
|
-
leftIcon: /* @__PURE__ */
|
|
694
|
-
onClick: () => void
|
|
695
|
-
isLoading:
|
|
694
|
+
leftIcon: /* @__PURE__ */ T(Ve, { size: 16 }),
|
|
695
|
+
onClick: () => void zt(),
|
|
696
|
+
isLoading: tt || ht,
|
|
696
697
|
children: P("botlit.promptTemplates.delete.action", "Delete")
|
|
697
698
|
})
|
|
698
699
|
})
|
|
699
700
|
] })
|
|
700
701
|
}),
|
|
701
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ E("div", {
|
|
702
703
|
className: "space-y-6",
|
|
703
704
|
children: [
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
icon: /* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ T(Oe, {
|
|
706
|
+
icon: /* @__PURE__ */ T(Le, { size: 18 }),
|
|
706
707
|
children: P("botlit.promptTemplates.detailPurpose", "This is one reusable prompt template: its text with {{variables}}, its declared variables and example inputs. Agents bound to it and skills that carry it use the current text at their next run. To try a draft against a model or keep version history, open it in Prompt Studio.", { variables: "{{variables}}" })
|
|
707
708
|
}),
|
|
708
|
-
z && /* @__PURE__ */
|
|
709
|
+
z && /* @__PURE__ */ E("form", {
|
|
709
710
|
id: "tpl-edit-form",
|
|
710
711
|
noValidate: !0,
|
|
711
|
-
onSubmit: (e) => void
|
|
712
|
+
onSubmit: (e) => void Lt(e),
|
|
712
713
|
className: "space-y-6",
|
|
713
714
|
children: [
|
|
714
|
-
|
|
715
|
-
/* @__PURE__ */
|
|
715
|
+
Bt,
|
|
716
|
+
/* @__PURE__ */ E(l, { children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.editTitle", "Edit template") }), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.editDescription", "Saving updates the template in place for every agent and skill that uses it. Prompt Studio saves a new version instead and keeps the old one.") })] }), /* @__PURE__ */ E(u, {
|
|
716
717
|
className: "space-y-4",
|
|
717
|
-
children: [
|
|
718
|
+
children: [Vt, Ht]
|
|
718
719
|
})] }),
|
|
719
|
-
|
|
720
|
-
|
|
720
|
+
Wt,
|
|
721
|
+
Gt
|
|
721
722
|
]
|
|
722
723
|
}),
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ E("div", {
|
|
724
725
|
className: "grid grid-cols-2 gap-4 md:grid-cols-4",
|
|
725
726
|
children: [
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ T(l, { children: /* @__PURE__ */ E(u, {
|
|
727
728
|
className: "pt-6 text-center",
|
|
728
|
-
children: [/* @__PURE__ */
|
|
729
|
+
children: [/* @__PURE__ */ T("p", {
|
|
729
730
|
className: "text-3xl font-bold text-text-primary",
|
|
730
731
|
children: Q.length
|
|
731
|
-
}), /* @__PURE__ */
|
|
732
|
+
}), /* @__PURE__ */ T("p", {
|
|
732
733
|
className: "text-sm text-text-secondary",
|
|
733
734
|
children: P("botlit.promptTemplates.stats.variables", "Variables")
|
|
734
735
|
})]
|
|
735
736
|
}) }),
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ T(l, { children: /* @__PURE__ */ E(u, {
|
|
737
738
|
className: "pt-6 text-center",
|
|
738
|
-
children: [/* @__PURE__ */
|
|
739
|
+
children: [/* @__PURE__ */ E("p", {
|
|
739
740
|
className: "text-3xl font-bold text-text-primary",
|
|
740
741
|
children: ["v", I.version]
|
|
741
|
-
}), /* @__PURE__ */
|
|
742
|
+
}), /* @__PURE__ */ T("p", {
|
|
742
743
|
className: "text-sm text-text-secondary",
|
|
743
744
|
children: P("botlit.promptTemplates.stats.version", "Version (saved in Prompt Studio)")
|
|
744
745
|
})]
|
|
745
746
|
}) }),
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ T(l, { children: /* @__PURE__ */ E(u, {
|
|
747
748
|
className: "pt-6 text-center",
|
|
748
|
-
children: [/* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ T("p", {
|
|
749
750
|
className: "text-3xl font-bold text-text-primary",
|
|
750
751
|
children: I.revision
|
|
751
|
-
}), /* @__PURE__ */
|
|
752
|
+
}), /* @__PURE__ */ T("p", {
|
|
752
753
|
className: "text-sm text-text-secondary",
|
|
753
754
|
children: P("botlit.promptTemplates.stats.revision", "Revision (every save)")
|
|
754
755
|
})]
|
|
755
756
|
}) }),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ T(l, { children: /* @__PURE__ */ E(u, {
|
|
757
758
|
className: "pt-6 text-center",
|
|
758
|
-
children: [/* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ T("p", {
|
|
759
760
|
className: "text-lg font-bold text-text-primary",
|
|
760
761
|
children: P(`botlit.promptTemplates.visibility.${I.visibility.toLowerCase()}`, I.visibility.charAt(0) + I.visibility.slice(1).toLowerCase())
|
|
761
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ T("p", {
|
|
762
763
|
className: "text-sm text-text-secondary",
|
|
763
764
|
children: P("botlit.promptTemplates.stats.visibility", "Visibility (not enforced yet)")
|
|
764
765
|
})]
|
|
765
766
|
}) })
|
|
766
767
|
]
|
|
767
768
|
}),
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ T("div", {
|
|
769
770
|
className: "flex gap-2 border-b",
|
|
770
771
|
role: "tablist",
|
|
771
772
|
"aria-label": P("botlit.promptTemplates.tabs.label", "Template views"),
|
|
772
773
|
children: [
|
|
773
774
|
[
|
|
774
775
|
"edit",
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ T(Me, {
|
|
776
777
|
className: "mr-2 h-4 w-4",
|
|
777
778
|
"aria-hidden": "true"
|
|
778
779
|
}, "i"),
|
|
@@ -780,7 +781,7 @@ var P = ({ isNew: y }) => {
|
|
|
780
781
|
],
|
|
781
782
|
[
|
|
782
783
|
"preview",
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ T(Ie, {
|
|
784
785
|
className: "mr-2 h-4 w-4",
|
|
785
786
|
"aria-hidden": "true"
|
|
786
787
|
}, "i"),
|
|
@@ -788,72 +789,72 @@ var P = ({ isNew: y }) => {
|
|
|
788
789
|
],
|
|
789
790
|
[
|
|
790
791
|
"test",
|
|
791
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ T(O, {
|
|
792
793
|
className: "mr-2 h-4 w-4",
|
|
793
794
|
"aria-hidden": "true"
|
|
794
795
|
}, "i"),
|
|
795
796
|
P("botlit.promptTemplates.tabs.test", "Test render")
|
|
796
797
|
]
|
|
797
|
-
].map(([e, t, n]) => /* @__PURE__ */
|
|
798
|
+
].map(([e, t, n]) => /* @__PURE__ */ E(m, {
|
|
798
799
|
id: `prompt-template-tab-${e}`,
|
|
799
800
|
role: "tab",
|
|
800
801
|
"aria-selected": L === e,
|
|
801
802
|
"aria-controls": `prompt-template-panel-${e}`,
|
|
802
803
|
variant: L === e ? "default" : "ghost",
|
|
803
|
-
onClick: () =>
|
|
804
|
+
onClick: () => st(e),
|
|
804
805
|
children: [t, n]
|
|
805
806
|
}, e))
|
|
806
807
|
}),
|
|
807
|
-
L === "edit" && /* @__PURE__ */
|
|
808
|
+
L === "edit" && /* @__PURE__ */ E("div", {
|
|
808
809
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
809
810
|
role: "tabpanel",
|
|
810
811
|
id: "prompt-template-panel-edit",
|
|
811
812
|
"aria-labelledby": "prompt-template-tab-edit",
|
|
812
|
-
children: [/* @__PURE__ */
|
|
813
|
+
children: [/* @__PURE__ */ T("div", {
|
|
813
814
|
className: "lg:col-span-2",
|
|
814
|
-
children: /* @__PURE__ */
|
|
815
|
+
children: /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.form.contentTitle", "Template content") }) }), /* @__PURE__ */ T(u, { children: /* @__PURE__ */ T("div", {
|
|
815
816
|
className: "whitespace-pre-wrap break-words rounded-lg bg-bg-sunken p-4 font-mono text-sm",
|
|
816
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ T(Ge, { text: I.templateText })
|
|
817
818
|
}) })] })
|
|
818
|
-
}), /* @__PURE__ */
|
|
819
|
+
}), /* @__PURE__ */ T("div", { children: /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ E(p, {
|
|
819
820
|
className: "flex items-center gap-2",
|
|
820
|
-
children: [/* @__PURE__ */
|
|
821
|
+
children: [/* @__PURE__ */ T(k, {
|
|
821
822
|
size: 18,
|
|
822
823
|
"aria-hidden": "true"
|
|
823
824
|
}), P("botlit.promptTemplates.variables.titleCount", "Variables ({{count}})", { count: Q.length })]
|
|
824
|
-
}) }), /* @__PURE__ */
|
|
825
|
+
}) }), /* @__PURE__ */ T(u, { children: Q.length > 0 ? /* @__PURE__ */ T("ul", {
|
|
825
826
|
className: "space-y-3",
|
|
826
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
827
|
+
children: Q.map((e) => /* @__PURE__ */ E("li", {
|
|
827
828
|
className: "rounded-lg border p-3",
|
|
828
829
|
children: [
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ E("div", {
|
|
830
831
|
className: "mb-1 flex items-center justify-between",
|
|
831
|
-
children: [/* @__PURE__ */
|
|
832
|
+
children: [/* @__PURE__ */ T("span", {
|
|
832
833
|
className: "font-mono font-medium",
|
|
833
834
|
children: e.name
|
|
834
|
-
}), /* @__PURE__ */
|
|
835
|
+
}), /* @__PURE__ */ E("div", {
|
|
835
836
|
className: "flex gap-1",
|
|
836
|
-
children: [/* @__PURE__ */
|
|
837
|
+
children: [/* @__PURE__ */ T(_, {
|
|
837
838
|
variant: "outline",
|
|
838
839
|
className: "text-xs",
|
|
839
840
|
children: e.type
|
|
840
|
-
}), e.required && /* @__PURE__ */
|
|
841
|
+
}), e.required && /* @__PURE__ */ T(_, {
|
|
841
842
|
variant: "destructive",
|
|
842
843
|
className: "text-xs",
|
|
843
844
|
children: P("botlit.promptTemplates.variables.requiredBadge", "required")
|
|
844
845
|
})]
|
|
845
846
|
})]
|
|
846
847
|
}),
|
|
847
|
-
e.description && /* @__PURE__ */
|
|
848
|
+
e.description && /* @__PURE__ */ T("p", {
|
|
848
849
|
className: "text-sm text-text-secondary",
|
|
849
850
|
children: e.description
|
|
850
851
|
}),
|
|
851
|
-
e.defaultValue !== void 0 && /* @__PURE__ */
|
|
852
|
+
e.defaultValue !== void 0 && /* @__PURE__ */ E("p", {
|
|
852
853
|
className: "mt-1 text-xs text-text-secondary",
|
|
853
854
|
children: [
|
|
854
855
|
P("botlit.promptTemplates.variables.defaultShown", "Default:"),
|
|
855
856
|
" ",
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ T("code", {
|
|
857
858
|
className: "bg-bg-sunken px-1",
|
|
858
859
|
children: N(e.defaultValue)
|
|
859
860
|
})
|
|
@@ -861,85 +862,85 @@ var P = ({ isNew: y }) => {
|
|
|
861
862
|
})
|
|
862
863
|
]
|
|
863
864
|
}, e.name))
|
|
864
|
-
}) : /* @__PURE__ */
|
|
865
|
+
}) : /* @__PURE__ */ T("p", {
|
|
865
866
|
className: "py-4 text-center text-text-secondary",
|
|
866
867
|
children: P("botlit.promptTemplates.variables.none", "No variables declared")
|
|
867
868
|
}) })] }) })]
|
|
868
869
|
}),
|
|
869
|
-
L === "preview" && /* @__PURE__ */
|
|
870
|
+
L === "preview" && /* @__PURE__ */ E(l, {
|
|
870
871
|
role: "tabpanel",
|
|
871
872
|
id: "prompt-template-panel-preview",
|
|
872
873
|
"aria-labelledby": "prompt-template-tab-preview",
|
|
873
|
-
children: [/* @__PURE__ */
|
|
874
|
+
children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.preview.title", "Filled with the first example input") }), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.preview.description", "Placeholders without an example value stay as written. Use Test render to check required values and types.") })] }), /* @__PURE__ */ T(u, { children: /* @__PURE__ */ T("div", {
|
|
874
875
|
className: "whitespace-pre-wrap break-words rounded-lg bg-bg-sunken p-4 font-mono text-sm",
|
|
875
|
-
children: $[0] ? be(I.templateText, $[0]) : /* @__PURE__ */
|
|
876
|
+
children: $[0] ? be(I.templateText, $[0]) : /* @__PURE__ */ T("span", {
|
|
876
877
|
className: "text-text-secondary",
|
|
877
878
|
children: P("botlit.promptTemplates.preview.none", "This template has no example inputs. Use Test render to fill it with your own values.")
|
|
878
879
|
})
|
|
879
880
|
}) })]
|
|
880
881
|
}),
|
|
881
|
-
L === "test" && /* @__PURE__ */
|
|
882
|
+
L === "test" && /* @__PURE__ */ E("div", {
|
|
882
883
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
883
884
|
role: "tabpanel",
|
|
884
885
|
id: "prompt-template-panel-test",
|
|
885
886
|
"aria-labelledby": "prompt-template-tab-test",
|
|
886
|
-
children: [/* @__PURE__ */
|
|
887
|
+
children: [/* @__PURE__ */ E(l, { children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.test.inputs", "Test inputs") }), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.test.description", "Fill in values to see the prompt exactly as the server builds it. Nothing is sent to a model; Prompt Studio does that.") })] }), /* @__PURE__ */ E(u, {
|
|
887
888
|
className: "space-y-4",
|
|
888
|
-
children: [Q.map((e) => /* @__PURE__ */
|
|
889
|
+
children: [Q.map((e) => /* @__PURE__ */ T(h, {
|
|
889
890
|
label: e.name,
|
|
890
891
|
htmlFor: `tpl-test-${e.name}`,
|
|
891
892
|
required: e.required,
|
|
892
893
|
description: e.description,
|
|
893
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ T(g, {
|
|
894
895
|
id: `tpl-test-${e.name}`,
|
|
895
896
|
maxLength: 1e4,
|
|
896
897
|
placeholder: e.defaultValue === void 0 ? P("botlit.promptTemplates.test.enter", "Enter {{name}}", { name: e.name }) : N(e.defaultValue),
|
|
897
898
|
value: R[e.name] || "",
|
|
898
|
-
onChange: (t) =>
|
|
899
|
+
onChange: (t) => ut({
|
|
899
900
|
...R,
|
|
900
901
|
[e.name]: t.target.value
|
|
901
902
|
})
|
|
902
903
|
})
|
|
903
|
-
}, e.name)), /* @__PURE__ */
|
|
904
|
+
}, e.name)), /* @__PURE__ */ T(c, {
|
|
904
905
|
permission: s.PROMPT_TEMPLATE_EXECUTE,
|
|
905
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ T(m, {
|
|
906
907
|
className: "w-full",
|
|
907
|
-
leftIcon: /* @__PURE__ */
|
|
908
|
-
onClick: () => void
|
|
909
|
-
isLoading:
|
|
908
|
+
leftIcon: /* @__PURE__ */ T(O, { size: 16 }),
|
|
909
|
+
onClick: () => void Pt(),
|
|
910
|
+
isLoading: rt,
|
|
910
911
|
children: P("botlit.promptTemplates.test.render", "Render template")
|
|
911
912
|
})
|
|
912
913
|
})]
|
|
913
|
-
})] }), /* @__PURE__ */
|
|
914
|
+
})] }), /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.test.output", "Output") }) }), /* @__PURE__ */ T(u, { children: pt ? /* @__PURE__ */ T("div", {
|
|
914
915
|
role: "alert",
|
|
915
916
|
className: "flex items-start gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
916
|
-
children: /* @__PURE__ */
|
|
917
|
-
}) :
|
|
917
|
+
children: /* @__PURE__ */ T("p", { children: pt })
|
|
918
|
+
}) : dt === null ? /* @__PURE__ */ E("div", {
|
|
918
919
|
className: "p-8 text-center text-text-secondary",
|
|
919
|
-
children: [/* @__PURE__ */
|
|
920
|
+
children: [/* @__PURE__ */ T(O, {
|
|
920
921
|
className: "mx-auto mb-2 h-8 w-8 opacity-50",
|
|
921
922
|
"aria-hidden": "true"
|
|
922
|
-
}), /* @__PURE__ */
|
|
923
|
-
}) : /* @__PURE__ */
|
|
923
|
+
}), /* @__PURE__ */ T("p", { children: P("botlit.promptTemplates.test.empty", "Enter values and choose Render template to see the output.") })]
|
|
924
|
+
}) : /* @__PURE__ */ T("div", {
|
|
924
925
|
className: "whitespace-pre-wrap break-words rounded-lg bg-bg-sunken p-4 font-mono text-sm",
|
|
925
|
-
children:
|
|
926
|
+
children: dt
|
|
926
927
|
}) })] })]
|
|
927
928
|
}),
|
|
928
|
-
$.length > 0 && L === "edit" && /* @__PURE__ */
|
|
929
|
+
$.length > 0 && L === "edit" && /* @__PURE__ */ E(l, { children: [/* @__PURE__ */ E(f, { children: [/* @__PURE__ */ T(p, { children: P("botlit.promptTemplates.examples.title", "Example inputs") }), /* @__PURE__ */ T(d, { children: P("botlit.promptTemplates.examples.description", "Sample values for documentation and the Example values tab") })] }), /* @__PURE__ */ T(u, { children: /* @__PURE__ */ T("div", {
|
|
929
930
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
930
|
-
children: $.map((e, t) => /* @__PURE__ */
|
|
931
|
+
children: $.map((e, t) => /* @__PURE__ */ E("div", {
|
|
931
932
|
className: "rounded-lg border bg-bg-sunken/30 p-4",
|
|
932
|
-
children: [/* @__PURE__ */
|
|
933
|
+
children: [/* @__PURE__ */ T("p", {
|
|
933
934
|
className: "mb-2 text-sm font-medium",
|
|
934
935
|
children: P("botlit.promptTemplates.examples.item", "Example {{number}}", { number: t + 1 })
|
|
935
|
-
}), /* @__PURE__ */
|
|
936
|
+
}), /* @__PURE__ */ T("div", {
|
|
936
937
|
className: "space-y-1 text-sm",
|
|
937
|
-
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */
|
|
938
|
+
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ E("div", {
|
|
938
939
|
className: "flex justify-between",
|
|
939
|
-
children: [/* @__PURE__ */
|
|
940
|
+
children: [/* @__PURE__ */ E("span", {
|
|
940
941
|
className: "font-mono text-text-secondary",
|
|
941
942
|
children: [e, ":"]
|
|
942
|
-
}), /* @__PURE__ */
|
|
943
|
+
}), /* @__PURE__ */ T("span", {
|
|
943
944
|
className: "max-w-[60%] truncate font-mono",
|
|
944
945
|
children: N(t)
|
|
945
946
|
})]
|
|
@@ -947,47 +948,47 @@ var P = ({ isNew: y }) => {
|
|
|
947
948
|
})]
|
|
948
949
|
}, t))
|
|
949
950
|
}) })] }),
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ E(l, { children: [/* @__PURE__ */ T(f, { children: /* @__PURE__ */ E(p, {
|
|
951
952
|
className: "flex items-center gap-2",
|
|
952
|
-
children: [/* @__PURE__ */
|
|
953
|
+
children: [/* @__PURE__ */ T(Be, {
|
|
953
954
|
size: 18,
|
|
954
955
|
"aria-hidden": "true"
|
|
955
956
|
}), P("botlit.promptTemplates.metadata.title", "Details")]
|
|
956
|
-
}) }), /* @__PURE__ */
|
|
957
|
+
}) }), /* @__PURE__ */ T(u, { children: /* @__PURE__ */ E("dl", {
|
|
957
958
|
className: "grid grid-cols-2 gap-6 text-sm md:grid-cols-4",
|
|
958
959
|
children: [
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
960
961
|
className: "text-text-secondary",
|
|
961
962
|
children: P("botlit.promptTemplates.metadata.created", "Created")
|
|
962
|
-
}), /* @__PURE__ */
|
|
963
|
+
}), /* @__PURE__ */ T("dd", {
|
|
963
964
|
className: "font-medium",
|
|
964
965
|
children: he(I.createdAt)
|
|
965
966
|
})] }),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
967
968
|
className: "text-text-secondary",
|
|
968
969
|
children: P("botlit.promptTemplates.metadata.updated", "Updated")
|
|
969
|
-
}), /* @__PURE__ */
|
|
970
|
+
}), /* @__PURE__ */ T("dd", {
|
|
970
971
|
className: "font-medium",
|
|
971
972
|
children: he(I.updatedAt)
|
|
972
973
|
})] }),
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
974
975
|
className: "text-text-secondary",
|
|
975
976
|
children: P("botlit.promptTemplates.metadata.tags", "Tags")
|
|
976
|
-
}), /* @__PURE__ */
|
|
977
|
+
}), /* @__PURE__ */ T("dd", {
|
|
977
978
|
className: "flex flex-wrap gap-1",
|
|
978
|
-
children: I.tags.length > 0 ? I.tags.map((e) => /* @__PURE__ */
|
|
979
|
+
children: I.tags.length > 0 ? I.tags.map((e) => /* @__PURE__ */ T(_, {
|
|
979
980
|
variant: "secondary",
|
|
980
981
|
className: "text-xs",
|
|
981
982
|
children: e
|
|
982
|
-
}, e)) : /* @__PURE__ */
|
|
983
|
+
}, e)) : /* @__PURE__ */ T("span", {
|
|
983
984
|
className: "text-text-secondary",
|
|
984
985
|
children: P("botlit.promptTemplates.metadata.noTags", "None")
|
|
985
986
|
})
|
|
986
987
|
})] }),
|
|
987
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
|
|
988
989
|
className: "text-text-secondary",
|
|
989
990
|
children: P("botlit.promptTemplates.metadata.studio", "Versions")
|
|
990
|
-
}), /* @__PURE__ */
|
|
991
|
+
}), /* @__PURE__ */ T("dd", { children: /* @__PURE__ */ T(m, {
|
|
991
992
|
variant: "ghost",
|
|
992
993
|
size: "sm",
|
|
993
994
|
className: "px-0",
|
|
@@ -1000,6 +1001,6 @@ var P = ({ isNew: y }) => {
|
|
|
1000
1001
|
})
|
|
1001
1002
|
});
|
|
1002
1003
|
};
|
|
1003
|
-
export {
|
|
1004
|
+
export { Ge as HighlightedTemplate, P as PromptTemplateDetailPage };
|
|
1004
1005
|
|
|
1005
1006
|
//# sourceMappingURL=PromptTemplateDetailPage.js.map
|