@burdenoff/microfe-botmanor 2026.1027.2 → 2026.1027.3
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 +142 -132
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/components/AgentApprovalPanel.js +144 -126
- package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
- package/dist/botlit/components/ModelRegistrationPanel.js +4 -4
- package/dist/botlit/components/VersionHistoryPanel.js +92 -83
- package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
- package/dist/botlit/pages/A2AAgentDetailPage.js +212 -203
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/A2ARegistryPage.js +129 -117
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
- package/dist/botlit/pages/AgentApprovalsPage.js +122 -110
- package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +18 -18
- package/dist/botlit/pages/AgentDetailPage.js +298 -273
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/AgentsListPage.js +145 -121
- package/dist/botlit/pages/AgentsListPage.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +238 -226
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +307 -288
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotWorkflowTab.js +125 -116
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
- package/dist/botlit/pages/BotsListPage.js +159 -144
- package/dist/botlit/pages/BotsListPage.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +279 -258
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/ChannelDetailPage.js +346 -328
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
- package/dist/botlit/pages/ChannelRoutesPage.js +10 -10
- package/dist/botlit/pages/ChannelsPage.js +163 -148
- package/dist/botlit/pages/ChannelsPage.js.map +1 -1
- package/dist/botlit/pages/DashboardPage.js +129 -114
- package/dist/botlit/pages/DashboardPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionDetailPage.js +145 -139
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +14 -14
- package/dist/botlit/pages/InstalledPackagesPage.js +245 -227
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +168 -156
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
- package/dist/botlit/pages/KnowledgeBasesPage.js +91 -79
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
- package/dist/botlit/pages/MCPServerDetailPage.js +200 -188
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
- package/dist/botlit/pages/MCPServersPage.js +170 -155
- package/dist/botlit/pages/MCPServersPage.js.map +1 -1
- package/dist/botlit/pages/PoliciesPage.js +113 -104
- package/dist/botlit/pages/PoliciesPage.js.map +1 -1
- package/dist/botlit/pages/PolicyDetailPage.js +145 -133
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +106 -97
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplateDetailPage.js +359 -347
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplatesPage.js +127 -112
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +219 -210
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
- package/dist/botlit/pages/RetrievalProfilesPage.js +112 -103
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
- package/dist/botlit/pages/SettingsPage.js +264 -252
- package/dist/botlit/pages/SettingsPage.js.map +1 -1
- package/dist/botlit/pages/SkillDetailPage.js +235 -226
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
- package/dist/botlit/pages/SkillsPage.js +115 -106
- package/dist/botlit/pages/SkillsPage.js.map +1 -1
- package/dist/botlit/pages/StorePackageDetailPage.js +194 -188
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +161 -155
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/dist/botlit/permissions/PermissionRequired.js +45 -0
- package/dist/botlit/permissions/PermissionRequired.js.map +1 -0
- package/dist/botlit/permissions/botmanorPermissions.js +72 -0
- package/dist/botlit/permissions/botmanorPermissions.js.map +1 -0
- package/dist/botlit/permissions/index.js +3 -0
- package/dist/botlit/permissions/useBotmanorPermissions.js +19 -0
- package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
2
|
import { formatRelativeTime as t } from "../utils/formatters.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { BOTMANOR_PERMISSIONS as n } from "../permissions/botmanorPermissions.js";
|
|
4
|
+
import { BotmanorPermissionGate as r } from "../permissions/useBotmanorPermissions.js";
|
|
5
|
+
import { PageLayout as i } from "../components/PageLayout.js";
|
|
6
|
+
import { Button as a } from "../components/Button.js";
|
|
7
|
+
import "../permissions/index.js";
|
|
8
|
+
import { Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u } from "../components/Card.js";
|
|
9
|
+
import { Badge as d, StatusBadge as ee } from "../components/Badge.js";
|
|
10
|
+
import { isNative as f, nativeCopyText as p, nativeImpact as te, nativeNotify as m, nativeToast as ne } from "../../utils/nativeBridge.js";
|
|
11
|
+
import { EmptyState as re } from "../components/EmptyState.js";
|
|
12
|
+
import { FormField as h, Input as g, Textarea as _ } from "../components/Input.js";
|
|
13
|
+
import { toUnion as v } from "../utils/unions.js";
|
|
14
|
+
import { promptTemplateExamples as y, promptTemplateVariables as b, useCreatePromptTemplate as ie, useDeletePromptTemplate as ae, usePromptTemplate as oe, useRenderPromptTemplate as se, useUpdatePromptTemplate as ce } from "../hooks/usePromptTemplates.js";
|
|
12
15
|
import "../hooks/index.js";
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { PagePurpose as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { useParams as
|
|
17
|
-
import { ArrowLeft as
|
|
18
|
-
import { toast as
|
|
16
|
+
import { useMemo as le, useState as x } from "react";
|
|
17
|
+
import { PagePurpose as ue } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
19
|
+
import { useParams as de } from "react-router";
|
|
20
|
+
import { ArrowLeft as fe, Check as pe, Code as T, Copy as me, Edit3 as he, Eye as E, FileText as D, Play as O, Save as k, Settings as ge, Trash2 as A, Variable as j } from "lucide-react";
|
|
21
|
+
import { toast as M } from "sonner";
|
|
19
22
|
//#region src/botlit/pages/PromptTemplateDetailPage.tsx
|
|
20
|
-
var
|
|
23
|
+
var N = [
|
|
21
24
|
"string",
|
|
22
25
|
"number",
|
|
23
26
|
"boolean",
|
|
24
27
|
"array",
|
|
25
28
|
"object"
|
|
26
|
-
],
|
|
29
|
+
], _e = [
|
|
27
30
|
"PRIVATE",
|
|
28
31
|
"WORKSPACE",
|
|
29
32
|
"PUBLIC"
|
|
30
|
-
],
|
|
31
|
-
let { templateId:
|
|
33
|
+
], P = ({ isNew: P }) => {
|
|
34
|
+
let { templateId: ve } = de(), { navigateTo: F } = e(), { data: I, loading: ye } = oe(P ? void 0 : ve), { create: be, loading: L } = ie(), { update: xe, loading: Se } = ce(), { remove: Ce, loading: we } = ae(), { render: Te, loading: Ee } = se(), [R, z] = x("edit"), [B, V] = x(!1), [H, De] = x({}), [U, Oe] = x(null), [W, G] = x(!1), [ke, K] = x(!1), [q, J] = x({
|
|
32
35
|
name: "",
|
|
33
36
|
slug: "",
|
|
34
37
|
description: "",
|
|
@@ -36,184 +39,184 @@ var M = [
|
|
|
36
39
|
templateText: "",
|
|
37
40
|
variables: [],
|
|
38
41
|
exampleInputs: [{}]
|
|
39
|
-
}),
|
|
40
|
-
let e =
|
|
42
|
+
}), Y = le(() => {
|
|
43
|
+
let e = P ? q.templateText : I?.templateText || "", t = /\{\{(\w+)\}\}/g, n = /* @__PURE__ */ new Set(), r;
|
|
41
44
|
for (; (r = t.exec(e)) !== null;) n.add(r[1]);
|
|
42
45
|
return Array.from(n);
|
|
43
46
|
}, [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
]),
|
|
48
|
-
if (!(!
|
|
47
|
+
P,
|
|
48
|
+
q.templateText,
|
|
49
|
+
I?.templateText
|
|
50
|
+
]), Ae = async () => {
|
|
51
|
+
if (!(!q.name || !q.slug)) {
|
|
49
52
|
try {
|
|
50
|
-
await
|
|
51
|
-
name:
|
|
52
|
-
slug:
|
|
53
|
-
description:
|
|
54
|
-
visibility:
|
|
55
|
-
templateText:
|
|
56
|
-
variables:
|
|
57
|
-
exampleInputs:
|
|
53
|
+
await be({
|
|
54
|
+
name: q.name,
|
|
55
|
+
slug: q.slug,
|
|
56
|
+
description: q.description,
|
|
57
|
+
visibility: q.visibility,
|
|
58
|
+
templateText: q.templateText,
|
|
59
|
+
variables: q.variables,
|
|
60
|
+
exampleInputs: q.exampleInputs
|
|
58
61
|
});
|
|
59
62
|
} catch (e) {
|
|
60
|
-
|
|
63
|
+
M.error(e instanceof Error ? e.message : "Failed to create prompt template");
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
M.success(`Template "${q.name}" created`), F("prompt-templates");
|
|
64
67
|
}
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
...
|
|
68
|
-
variables: [...
|
|
68
|
+
}, je = () => {
|
|
69
|
+
J({
|
|
70
|
+
...q,
|
|
71
|
+
variables: [...q.variables, {
|
|
69
72
|
name: "",
|
|
70
73
|
type: "string",
|
|
71
74
|
required: !0,
|
|
72
75
|
defaultValue: void 0
|
|
73
76
|
}]
|
|
74
77
|
});
|
|
75
|
-
},
|
|
76
|
-
let n = [...
|
|
78
|
+
}, X = (e, t) => {
|
|
79
|
+
let n = [...q.variables];
|
|
77
80
|
n[e] = {
|
|
78
81
|
...n[e],
|
|
79
82
|
...t
|
|
80
|
-
},
|
|
81
|
-
...
|
|
83
|
+
}, J({
|
|
84
|
+
...q,
|
|
82
85
|
variables: n
|
|
83
86
|
});
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
...
|
|
87
|
-
variables:
|
|
87
|
+
}, Me = (e) => {
|
|
88
|
+
J({
|
|
89
|
+
...q,
|
|
90
|
+
variables: q.variables.filter((t, n) => n !== e)
|
|
88
91
|
});
|
|
89
|
-
}, Me = async () => {
|
|
90
|
-
F && De(await we({
|
|
91
|
-
templateId: F.id,
|
|
92
|
-
variables: V
|
|
93
|
-
}));
|
|
94
92
|
}, Ne = async () => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
slug: F.slug,
|
|
100
|
-
description: F.description || "",
|
|
101
|
-
visibility: _(F.visibility, ge, "PRIVATE"),
|
|
102
|
-
templateText: F.templateText,
|
|
103
|
-
variables: y(F),
|
|
104
|
-
exampleInputs: v(F)
|
|
105
|
-
}), W(!0));
|
|
93
|
+
I && Oe(await Te({
|
|
94
|
+
templateId: I.id,
|
|
95
|
+
variables: H
|
|
96
|
+
}));
|
|
106
97
|
}, Pe = async () => {
|
|
107
|
-
|
|
98
|
+
await p(I?.templateText || q.templateText), V(!0), f() && ne("Copied"), setTimeout(() => V(!1), 2e3);
|
|
99
|
+
}, Fe = () => {
|
|
100
|
+
I && (J({
|
|
101
|
+
name: I.name,
|
|
102
|
+
slug: I.slug,
|
|
103
|
+
description: I.description || "",
|
|
104
|
+
visibility: v(I.visibility, _e, "PRIVATE"),
|
|
105
|
+
templateText: I.templateText,
|
|
106
|
+
variables: b(I),
|
|
107
|
+
exampleInputs: y(I)
|
|
108
|
+
}), G(!0));
|
|
109
|
+
}, Ie = async () => {
|
|
110
|
+
if (!(!I || !q.name || !q.slug)) {
|
|
108
111
|
try {
|
|
109
|
-
await
|
|
110
|
-
templateId:
|
|
112
|
+
await xe({
|
|
113
|
+
templateId: I.id,
|
|
111
114
|
input: {
|
|
112
|
-
name:
|
|
113
|
-
slug:
|
|
114
|
-
description:
|
|
115
|
-
visibility:
|
|
116
|
-
templateText:
|
|
117
|
-
variables:
|
|
118
|
-
exampleInputs:
|
|
115
|
+
name: q.name,
|
|
116
|
+
slug: q.slug,
|
|
117
|
+
description: q.description,
|
|
118
|
+
visibility: q.visibility,
|
|
119
|
+
templateText: q.templateText,
|
|
120
|
+
variables: q.variables,
|
|
121
|
+
exampleInputs: q.exampleInputs
|
|
119
122
|
}
|
|
120
123
|
});
|
|
121
124
|
} catch (e) {
|
|
122
|
-
|
|
125
|
+
M.error(e instanceof Error ? e.message : "Failed to update prompt template");
|
|
123
126
|
return;
|
|
124
127
|
}
|
|
125
|
-
|
|
128
|
+
M.success("Template updated"), G(!1);
|
|
126
129
|
}
|
|
127
|
-
},
|
|
128
|
-
if (
|
|
129
|
-
await
|
|
130
|
+
}, Le = async () => {
|
|
131
|
+
if (I) try {
|
|
132
|
+
await Ce(I.id), f() && m("success"), F("prompt-templates");
|
|
130
133
|
} catch (e) {
|
|
131
|
-
throw
|
|
134
|
+
throw f() && m("error"), e;
|
|
132
135
|
}
|
|
133
136
|
}, Z = (e) => e.replace(/\{\{(\w+)\}\}/g, "<span class=\"bg-action-primary-bg/20 text-primary px-1 rounded font-mono\">{{$1}}</span>");
|
|
134
|
-
if (
|
|
137
|
+
if (P) return /* @__PURE__ */ C(i, {
|
|
135
138
|
title: "Create Prompt Template",
|
|
136
139
|
description: "Define a reusable prompt template with variables",
|
|
137
|
-
actions: /* @__PURE__ */
|
|
140
|
+
actions: /* @__PURE__ */ w("div", {
|
|
138
141
|
className: "flex gap-2",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ C(a, {
|
|
140
143
|
variant: "outline",
|
|
141
|
-
onClick: () =>
|
|
144
|
+
onClick: () => F("prompt-templates"),
|
|
142
145
|
children: "Cancel"
|
|
143
|
-
}), /* @__PURE__ */
|
|
144
|
-
leftIcon: /* @__PURE__ */
|
|
145
|
-
onClick:
|
|
146
|
-
isLoading:
|
|
147
|
-
disabled: !
|
|
146
|
+
}), /* @__PURE__ */ C(a, {
|
|
147
|
+
leftIcon: /* @__PURE__ */ C(k, { size: 16 }),
|
|
148
|
+
onClick: Ae,
|
|
149
|
+
isLoading: L,
|
|
150
|
+
disabled: !q.name || !q.slug,
|
|
148
151
|
children: "Create Template"
|
|
149
152
|
})]
|
|
150
153
|
}),
|
|
151
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: /* @__PURE__ */ w("div", {
|
|
152
155
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
156
|
+
children: [/* @__PURE__ */ w("div", {
|
|
154
157
|
className: "lg:col-span-2 space-y-6",
|
|
155
158
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(u, { children: "Basic Information" }) }), /* @__PURE__ */ w(s, {
|
|
157
160
|
className: "space-y-4",
|
|
158
161
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ w("div", {
|
|
160
163
|
className: "grid grid-cols-2 gap-4",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ C(h, {
|
|
162
165
|
label: "Template Name",
|
|
163
166
|
required: !0,
|
|
164
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ C(g, {
|
|
165
168
|
placeholder: "e.g., Technical Support Template",
|
|
166
|
-
value:
|
|
167
|
-
onChange: (e) =>
|
|
168
|
-
...
|
|
169
|
+
value: q.name,
|
|
170
|
+
onChange: (e) => J({
|
|
171
|
+
...q,
|
|
169
172
|
name: e.target.value
|
|
170
173
|
})
|
|
171
174
|
})
|
|
172
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ C(h, {
|
|
173
176
|
label: "Slug",
|
|
174
177
|
required: !0,
|
|
175
178
|
description: "Unique identifier (lowercase, dashes)",
|
|
176
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ C(g, {
|
|
177
180
|
placeholder: "e.g., technical-support",
|
|
178
|
-
value:
|
|
179
|
-
onChange: (e) =>
|
|
180
|
-
...
|
|
181
|
+
value: q.slug,
|
|
182
|
+
onChange: (e) => J({
|
|
183
|
+
...q,
|
|
181
184
|
slug: e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, "-")
|
|
182
185
|
})
|
|
183
186
|
})
|
|
184
187
|
})]
|
|
185
188
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ C(h, {
|
|
187
190
|
label: "Description",
|
|
188
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ C(_, {
|
|
189
192
|
placeholder: "What is this template used for?",
|
|
190
|
-
value:
|
|
191
|
-
onChange: (e) =>
|
|
192
|
-
...
|
|
193
|
+
value: q.description,
|
|
194
|
+
onChange: (e) => J({
|
|
195
|
+
...q,
|
|
193
196
|
description: e.target.value
|
|
194
197
|
}),
|
|
195
198
|
rows: 2
|
|
196
199
|
})
|
|
197
200
|
}),
|
|
198
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ C(h, {
|
|
199
202
|
label: "Visibility",
|
|
200
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ w("select", {
|
|
201
204
|
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
202
|
-
value:
|
|
203
|
-
onChange: (e) =>
|
|
204
|
-
...
|
|
205
|
+
value: q.visibility,
|
|
206
|
+
onChange: (e) => J({
|
|
207
|
+
...q,
|
|
205
208
|
visibility: e.target.value
|
|
206
209
|
}),
|
|
207
210
|
children: [
|
|
208
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ C("option", {
|
|
209
212
|
value: "PRIVATE",
|
|
210
213
|
children: "Private"
|
|
211
214
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ C("option", {
|
|
213
216
|
value: "WORKSPACE",
|
|
214
217
|
children: "Workspace"
|
|
215
218
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ C("option", {
|
|
217
220
|
value: "PUBLIC",
|
|
218
221
|
children: "Public"
|
|
219
222
|
})
|
|
@@ -222,116 +225,116 @@ var M = [
|
|
|
222
225
|
})
|
|
223
226
|
]
|
|
224
227
|
})] }),
|
|
225
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(u, {
|
|
226
229
|
className: "flex items-center gap-2",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
-
}), /* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ C(T, { size: 18 }), "Template Content"]
|
|
231
|
+
}), /* @__PURE__ */ w(c, { children: [
|
|
229
232
|
"Use ",
|
|
230
233
|
"{{variable_name}}",
|
|
231
234
|
" syntax for variables"
|
|
232
|
-
] })] }), /* @__PURE__ */
|
|
235
|
+
] })] }), /* @__PURE__ */ w(s, { children: [/* @__PURE__ */ C(_, {
|
|
233
236
|
className: "font-mono text-sm min-h-[300px]",
|
|
234
237
|
placeholder: "You are a helpful assistant for {{company_name}}.\n\nYour role is to help users with {{task_type}}.\n\nGuidelines:\n- Be helpful and friendly\n- Provide accurate information\n- Reference: {{docs_url}}",
|
|
235
|
-
value:
|
|
236
|
-
onChange: (e) =>
|
|
237
|
-
...
|
|
238
|
+
value: q.templateText,
|
|
239
|
+
onChange: (e) => J({
|
|
240
|
+
...q,
|
|
238
241
|
templateText: e.target.value
|
|
239
242
|
})
|
|
240
|
-
}),
|
|
243
|
+
}), Y.length > 0 && /* @__PURE__ */ w("div", {
|
|
241
244
|
className: "mt-3 flex items-center gap-2",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ C("span", {
|
|
243
246
|
className: "text-sm text-text-secondary",
|
|
244
247
|
children: "Detected variables:"
|
|
245
|
-
}),
|
|
248
|
+
}), Y.map((e) => /* @__PURE__ */ C(d, {
|
|
246
249
|
variant: "secondary",
|
|
247
250
|
className: "font-mono",
|
|
248
251
|
children: e
|
|
249
252
|
}, e))]
|
|
250
253
|
})] })] }),
|
|
251
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(u, {
|
|
252
255
|
className: "flex items-center justify-between",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ w("span", {
|
|
254
257
|
className: "flex items-center gap-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
256
|
-
}), /* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ C(j, { size: 18 }), "Variables"]
|
|
259
|
+
}), /* @__PURE__ */ C(a, {
|
|
257
260
|
variant: "outline",
|
|
258
261
|
size: "sm",
|
|
259
|
-
onClick:
|
|
262
|
+
onClick: je,
|
|
260
263
|
children: "Add Variable"
|
|
261
264
|
})]
|
|
262
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ C(c, { children: "Define the variables used in your template" })] }), /* @__PURE__ */ C(s, { children: q.variables.length > 0 ? /* @__PURE__ */ C("div", {
|
|
263
266
|
className: "space-y-4",
|
|
264
|
-
children:
|
|
267
|
+
children: q.variables.map((e, t) => /* @__PURE__ */ w("div", {
|
|
265
268
|
className: "p-4 border rounded-lg bg-bg-sunken/30 space-y-3",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ w("div", {
|
|
267
270
|
className: "grid grid-cols-4 gap-3",
|
|
268
271
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ C(h, {
|
|
270
273
|
label: "Name",
|
|
271
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ C(g, {
|
|
272
275
|
className: "font-mono",
|
|
273
276
|
placeholder: "variable_name",
|
|
274
277
|
value: e.name,
|
|
275
|
-
onChange: (e) =>
|
|
278
|
+
onChange: (e) => X(t, { name: e.target.value })
|
|
276
279
|
})
|
|
277
280
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ C(h, {
|
|
279
282
|
label: "Type",
|
|
280
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ C("select", {
|
|
281
284
|
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
282
285
|
value: e.type,
|
|
283
|
-
onChange: (e) =>
|
|
284
|
-
children:
|
|
286
|
+
onChange: (e) => X(t, { type: v(e.target.value, N, "string") }),
|
|
287
|
+
children: N.map((e) => /* @__PURE__ */ C("option", {
|
|
285
288
|
value: e,
|
|
286
289
|
children: e
|
|
287
290
|
}, e))
|
|
288
291
|
})
|
|
289
292
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ C(h, {
|
|
291
294
|
label: "Default Value",
|
|
292
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ C(g, {
|
|
293
296
|
placeholder: "Optional",
|
|
294
297
|
value: String(e.defaultValue || ""),
|
|
295
|
-
onChange: (e) =>
|
|
298
|
+
onChange: (e) => X(t, { defaultValue: e.target.value || void 0 })
|
|
296
299
|
})
|
|
297
300
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ w("div", {
|
|
299
302
|
className: "flex items-end gap-2",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ w("label", {
|
|
301
304
|
className: "flex items-center gap-2 h-10",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ C("input", {
|
|
303
306
|
type: "checkbox",
|
|
304
307
|
checked: e.required,
|
|
305
|
-
onChange: (e) =>
|
|
308
|
+
onChange: (e) => X(t, { required: e.target.checked }),
|
|
306
309
|
className: "h-4 w-4"
|
|
307
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ C("span", {
|
|
308
311
|
className: "text-sm",
|
|
309
312
|
children: "Required"
|
|
310
313
|
})]
|
|
311
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ C(a, {
|
|
312
315
|
variant: "ghost",
|
|
313
316
|
size: "sm",
|
|
314
317
|
className: "text-status-error-text",
|
|
315
|
-
onClick: () =>
|
|
318
|
+
onClick: () => Me(t),
|
|
316
319
|
children: "Remove"
|
|
317
320
|
})]
|
|
318
321
|
})
|
|
319
322
|
]
|
|
320
|
-
}), /* @__PURE__ */
|
|
323
|
+
}), /* @__PURE__ */ C(h, {
|
|
321
324
|
label: "Description",
|
|
322
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ C(g, {
|
|
323
326
|
placeholder: "What is this variable for?",
|
|
324
327
|
value: e.description || "",
|
|
325
|
-
onChange: (e) =>
|
|
328
|
+
onChange: (e) => X(t, { description: e.target.value })
|
|
326
329
|
})
|
|
327
330
|
})]
|
|
328
331
|
}, t))
|
|
329
|
-
}) : /* @__PURE__ */
|
|
332
|
+
}) : /* @__PURE__ */ w("div", {
|
|
330
333
|
className: "text-center py-8 text-text-secondary",
|
|
331
334
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ C(j, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
|
|
336
|
+
/* @__PURE__ */ C("p", { children: "No variables defined yet" }),
|
|
337
|
+
/* @__PURE__ */ w("p", {
|
|
335
338
|
className: "text-sm",
|
|
336
339
|
children: [
|
|
337
340
|
"Variables are automatically detected from ",
|
|
@@ -342,31 +345,31 @@ var M = [
|
|
|
342
345
|
]
|
|
343
346
|
}) })] })
|
|
344
347
|
]
|
|
345
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ w("div", {
|
|
346
349
|
className: "space-y-6",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
|
|
348
351
|
className: "flex items-center gap-2",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
350
|
-
}) }), /* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ C(E, { size: 18 }), "Preview"]
|
|
353
|
+
}) }), /* @__PURE__ */ C(s, { children: /* @__PURE__ */ C("div", {
|
|
351
354
|
className: "p-4 bg-bg-sunken rounded-lg text-sm whitespace-pre-wrap font-mono",
|
|
352
|
-
dangerouslySetInnerHTML: { __html: Z(
|
|
353
|
-
}) })] }), /* @__PURE__ */
|
|
355
|
+
dangerouslySetInnerHTML: { __html: Z(q.templateText || "Enter template text...") }
|
|
356
|
+
}) })] }), /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(u, { children: "Quick Tips" }) }), /* @__PURE__ */ w(s, {
|
|
354
357
|
className: "text-sm space-y-2",
|
|
355
358
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ w("p", { children: [
|
|
360
|
+
/* @__PURE__ */ C("strong", { children: "Variables:" }),
|
|
358
361
|
" Use ",
|
|
359
362
|
"{{name}}",
|
|
360
363
|
" syntax"
|
|
361
364
|
] }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ C("p", { children: /* @__PURE__ */ C("strong", { children: "Best Practices:" }) }),
|
|
366
|
+
/* @__PURE__ */ w("ul", {
|
|
364
367
|
className: "list-disc list-inside text-text-secondary space-y-1",
|
|
365
368
|
children: [
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ C("li", { children: "Use descriptive variable names" }),
|
|
370
|
+
/* @__PURE__ */ C("li", { children: "Provide default values when possible" }),
|
|
371
|
+
/* @__PURE__ */ C("li", { children: "Include example inputs for testing" }),
|
|
372
|
+
/* @__PURE__ */ C("li", { children: "Version your templates for changes" })
|
|
370
373
|
]
|
|
371
374
|
})
|
|
372
375
|
]
|
|
@@ -374,196 +377,202 @@ var M = [
|
|
|
374
377
|
})]
|
|
375
378
|
})
|
|
376
379
|
});
|
|
377
|
-
if (
|
|
380
|
+
if (ye) return /* @__PURE__ */ C(i, {
|
|
378
381
|
title: "Loading...",
|
|
379
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ C("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
|
|
380
383
|
});
|
|
381
|
-
if (!
|
|
384
|
+
if (!I) return /* @__PURE__ */ C(i, {
|
|
382
385
|
title: "Template Not Found",
|
|
383
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ C(re, {
|
|
384
387
|
illustration: "empty-files",
|
|
385
388
|
title: "Template Not Found",
|
|
386
389
|
description: "This prompt template doesn't exist.",
|
|
387
|
-
action: /* @__PURE__ */
|
|
388
|
-
onClick: () =>
|
|
390
|
+
action: /* @__PURE__ */ C(a, {
|
|
391
|
+
onClick: () => F("prompt-templates"),
|
|
389
392
|
children: "Back to Templates"
|
|
390
393
|
})
|
|
391
394
|
})
|
|
392
395
|
});
|
|
393
|
-
let Q =
|
|
394
|
-
return /* @__PURE__ */
|
|
395
|
-
title: /* @__PURE__ */
|
|
396
|
+
let Q = b(I), $ = y(I);
|
|
397
|
+
return /* @__PURE__ */ C(i, {
|
|
398
|
+
title: /* @__PURE__ */ w("div", {
|
|
396
399
|
className: "flex items-center gap-3",
|
|
397
400
|
children: [
|
|
398
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ C(a, {
|
|
399
402
|
variant: "ghost",
|
|
400
403
|
size: "icon",
|
|
401
|
-
onClick: () =>
|
|
402
|
-
children: /* @__PURE__ */
|
|
404
|
+
onClick: () => F("prompt-templates"),
|
|
405
|
+
children: /* @__PURE__ */ C(fe, { size: 20 })
|
|
403
406
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ C("div", {
|
|
405
408
|
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
406
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ C(D, { className: "h-6 w-6 text-primary" })
|
|
407
410
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
|
|
409
412
|
className: "flex items-center gap-2",
|
|
410
413
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ C("span", { children: I.name }),
|
|
415
|
+
/* @__PURE__ */ C(ee, { status: I.status }),
|
|
416
|
+
/* @__PURE__ */ w(d, {
|
|
414
417
|
variant: "secondary",
|
|
415
418
|
className: "font-mono",
|
|
416
|
-
children: ["v",
|
|
419
|
+
children: ["v", I.version]
|
|
417
420
|
})
|
|
418
421
|
]
|
|
419
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ w("p", {
|
|
420
423
|
className: "text-sm font-normal text-text-secondary",
|
|
421
424
|
children: [
|
|
422
|
-
|
|
425
|
+
I.slug,
|
|
423
426
|
" - ",
|
|
424
|
-
|
|
427
|
+
I.description
|
|
425
428
|
]
|
|
426
429
|
})] })
|
|
427
430
|
]
|
|
428
431
|
}),
|
|
429
|
-
actions: /* @__PURE__ */
|
|
432
|
+
actions: /* @__PURE__ */ w("div", {
|
|
430
433
|
className: "flex gap-2",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ C(a, {
|
|
432
435
|
variant: "outline",
|
|
433
|
-
leftIcon:
|
|
434
|
-
onClick:
|
|
435
|
-
children:
|
|
436
|
-
}),
|
|
436
|
+
leftIcon: C(B ? pe : me, { size: 16 }),
|
|
437
|
+
onClick: Pe,
|
|
438
|
+
children: B ? "Copied!" : "Copy"
|
|
439
|
+
}), W ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(a, {
|
|
437
440
|
variant: "outline",
|
|
438
|
-
onClick: () =>
|
|
441
|
+
onClick: () => G(!1),
|
|
439
442
|
children: "Cancel"
|
|
440
|
-
}), /* @__PURE__ */
|
|
441
|
-
leftIcon: /* @__PURE__ */
|
|
442
|
-
onClick:
|
|
443
|
-
isLoading:
|
|
444
|
-
disabled: !
|
|
443
|
+
}), /* @__PURE__ */ C(a, {
|
|
444
|
+
leftIcon: /* @__PURE__ */ C(k, { size: 16 }),
|
|
445
|
+
onClick: Ie,
|
|
446
|
+
isLoading: Se,
|
|
447
|
+
disabled: !q.name || !q.slug,
|
|
445
448
|
children: "Save Changes"
|
|
446
|
-
})] }) :
|
|
449
|
+
})] }) : ke ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(a, {
|
|
447
450
|
variant: "outline",
|
|
448
|
-
onClick: () =>
|
|
451
|
+
onClick: () => K(!1),
|
|
449
452
|
children: "Cancel"
|
|
450
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ C(a, {
|
|
451
454
|
variant: "destructive",
|
|
452
|
-
leftIcon: /* @__PURE__ */
|
|
455
|
+
leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
|
|
453
456
|
onClick: () => {
|
|
454
|
-
|
|
457
|
+
te("medium"), Le();
|
|
455
458
|
},
|
|
456
|
-
isLoading:
|
|
459
|
+
isLoading: we,
|
|
457
460
|
children: "Confirm Delete"
|
|
458
|
-
})] }) : /* @__PURE__ */
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
461
|
+
})] }) : /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(r, {
|
|
462
|
+
permission: n.PROMPT_TEMPLATE_UPDATE,
|
|
463
|
+
children: /* @__PURE__ */ C(a, {
|
|
464
|
+
variant: "outline",
|
|
465
|
+
leftIcon: /* @__PURE__ */ C(he, { size: 16 }),
|
|
466
|
+
onClick: Fe,
|
|
467
|
+
children: "Edit Template"
|
|
468
|
+
})
|
|
469
|
+
}), /* @__PURE__ */ C(r, {
|
|
470
|
+
permission: n.PROMPT_TEMPLATE_DELETE,
|
|
471
|
+
children: /* @__PURE__ */ C(a, {
|
|
472
|
+
variant: "outline",
|
|
473
|
+
leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
|
|
474
|
+
onClick: () => K(!0),
|
|
475
|
+
children: "Delete"
|
|
476
|
+
})
|
|
468
477
|
})] })]
|
|
469
478
|
}),
|
|
470
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ w("div", {
|
|
471
480
|
className: "space-y-6",
|
|
472
481
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
icon: /* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ w(ue, {
|
|
483
|
+
icon: /* @__PURE__ */ C(D, { size: 18 }),
|
|
475
484
|
children: [
|
|
476
485
|
"This is a single reusable prompt template — its content with",
|
|
477
486
|
" ",
|
|
478
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ C("code", { children: "{{variables}}" }),
|
|
479
488
|
", its declared variables and example inputs, and its version history. Edit and preview it here to perfect the instructions, then reuse it across agents so they share consistent, version-controlled behaviour."
|
|
480
489
|
]
|
|
481
490
|
}),
|
|
482
|
-
|
|
491
|
+
W && /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(u, { children: "Edit Template" }), /* @__PURE__ */ C(c, { children: "Update template details and content" })] }), /* @__PURE__ */ w(s, {
|
|
483
492
|
className: "space-y-4",
|
|
484
493
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ w("div", {
|
|
486
495
|
className: "grid grid-cols-2 gap-4",
|
|
487
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ C(h, {
|
|
488
497
|
label: "Template Name",
|
|
489
498
|
required: !0,
|
|
490
|
-
children: /* @__PURE__ */
|
|
499
|
+
children: /* @__PURE__ */ C(g, {
|
|
491
500
|
placeholder: "e.g., Technical Support Template",
|
|
492
|
-
value:
|
|
493
|
-
onChange: (e) =>
|
|
494
|
-
...
|
|
501
|
+
value: q.name,
|
|
502
|
+
onChange: (e) => J({
|
|
503
|
+
...q,
|
|
495
504
|
name: e.target.value
|
|
496
505
|
})
|
|
497
506
|
})
|
|
498
|
-
}), /* @__PURE__ */
|
|
507
|
+
}), /* @__PURE__ */ C(h, {
|
|
499
508
|
label: "Slug",
|
|
500
509
|
required: !0,
|
|
501
510
|
description: "Unique identifier (lowercase, dashes)",
|
|
502
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ C(g, {
|
|
503
512
|
placeholder: "e.g., technical-support",
|
|
504
|
-
value:
|
|
505
|
-
onChange: (e) =>
|
|
506
|
-
...
|
|
513
|
+
value: q.slug,
|
|
514
|
+
onChange: (e) => J({
|
|
515
|
+
...q,
|
|
507
516
|
slug: e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, "-")
|
|
508
517
|
})
|
|
509
518
|
})
|
|
510
519
|
})]
|
|
511
520
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ C(h, {
|
|
513
522
|
label: "Description",
|
|
514
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ C(_, {
|
|
515
524
|
placeholder: "What is this template used for?",
|
|
516
|
-
value:
|
|
517
|
-
onChange: (e) =>
|
|
518
|
-
...
|
|
525
|
+
value: q.description,
|
|
526
|
+
onChange: (e) => J({
|
|
527
|
+
...q,
|
|
519
528
|
description: e.target.value
|
|
520
529
|
}),
|
|
521
530
|
rows: 2
|
|
522
531
|
})
|
|
523
532
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ C(h, {
|
|
525
534
|
label: "Visibility",
|
|
526
|
-
children: /* @__PURE__ */
|
|
535
|
+
children: /* @__PURE__ */ w("select", {
|
|
527
536
|
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
528
|
-
value:
|
|
529
|
-
onChange: (e) =>
|
|
530
|
-
...
|
|
537
|
+
value: q.visibility,
|
|
538
|
+
onChange: (e) => J({
|
|
539
|
+
...q,
|
|
531
540
|
visibility: e.target.value
|
|
532
541
|
}),
|
|
533
542
|
children: [
|
|
534
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ C("option", {
|
|
535
544
|
value: "PRIVATE",
|
|
536
545
|
children: "Private"
|
|
537
546
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ C("option", {
|
|
539
548
|
value: "WORKSPACE",
|
|
540
549
|
children: "Workspace"
|
|
541
550
|
}),
|
|
542
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ C("option", {
|
|
543
552
|
value: "PUBLIC",
|
|
544
553
|
children: "Public"
|
|
545
554
|
})
|
|
546
555
|
]
|
|
547
556
|
})
|
|
548
557
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ C(h, {
|
|
550
559
|
label: "Template Content",
|
|
551
560
|
description: "Use {{variable_name}} syntax for variables",
|
|
552
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ C(_, {
|
|
553
562
|
className: "font-mono text-sm min-h-[200px]",
|
|
554
|
-
value:
|
|
555
|
-
onChange: (e) =>
|
|
556
|
-
...
|
|
563
|
+
value: q.templateText,
|
|
564
|
+
onChange: (e) => J({
|
|
565
|
+
...q,
|
|
557
566
|
templateText: e.target.value
|
|
558
567
|
})
|
|
559
568
|
})
|
|
560
569
|
}),
|
|
561
|
-
|
|
570
|
+
Y.length > 0 && /* @__PURE__ */ w("div", {
|
|
562
571
|
className: "flex items-center gap-2",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ C("span", {
|
|
564
573
|
className: "text-sm text-text-secondary",
|
|
565
574
|
children: "Detected variables:"
|
|
566
|
-
}),
|
|
575
|
+
}), Y.map((e) => /* @__PURE__ */ C(d, {
|
|
567
576
|
variant: "secondary",
|
|
568
577
|
className: "font-mono",
|
|
569
578
|
children: e
|
|
@@ -571,124 +580,124 @@ var M = [
|
|
|
571
580
|
})
|
|
572
581
|
]
|
|
573
582
|
})] }),
|
|
574
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ w("div", {
|
|
575
584
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
576
585
|
children: [
|
|
577
|
-
/* @__PURE__ */
|
|
586
|
+
/* @__PURE__ */ C(o, {
|
|
578
587
|
treatment: "glass",
|
|
579
588
|
glow: !0,
|
|
580
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ w(s, {
|
|
581
590
|
className: "pt-6 text-center",
|
|
582
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ C("p", {
|
|
583
592
|
className: "text-3xl font-bold text-text-primary",
|
|
584
593
|
children: Q.length
|
|
585
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ C("p", {
|
|
586
595
|
className: "text-sm text-text-secondary",
|
|
587
596
|
children: "Variables"
|
|
588
597
|
})]
|
|
589
598
|
})
|
|
590
599
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
|
|
592
601
|
className: "pt-6 text-center",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
602
|
+
children: [/* @__PURE__ */ C("p", {
|
|
594
603
|
className: "text-3xl font-bold text-text-primary",
|
|
595
604
|
children: $.length
|
|
596
|
-
}), /* @__PURE__ */
|
|
605
|
+
}), /* @__PURE__ */ C("p", {
|
|
597
606
|
className: "text-sm text-text-secondary",
|
|
598
607
|
children: "Examples"
|
|
599
608
|
})]
|
|
600
609
|
}) }),
|
|
601
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
|
|
602
611
|
className: "pt-6 text-center",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ C("p", {
|
|
604
613
|
className: "text-3xl font-bold text-text-primary",
|
|
605
|
-
children:
|
|
606
|
-
}), /* @__PURE__ */
|
|
614
|
+
children: I.revision
|
|
615
|
+
}), /* @__PURE__ */ C("p", {
|
|
607
616
|
className: "text-sm text-text-secondary",
|
|
608
617
|
children: "Revision"
|
|
609
618
|
})]
|
|
610
619
|
}) }),
|
|
611
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
|
|
612
621
|
className: "pt-6 text-center",
|
|
613
|
-
children: [/* @__PURE__ */
|
|
622
|
+
children: [/* @__PURE__ */ C("p", {
|
|
614
623
|
className: "text-lg font-bold text-text-primary capitalize",
|
|
615
|
-
children:
|
|
616
|
-
}), /* @__PURE__ */
|
|
624
|
+
children: I.visibility.toLowerCase()
|
|
625
|
+
}), /* @__PURE__ */ C("p", {
|
|
617
626
|
className: "text-sm text-text-secondary",
|
|
618
627
|
children: "Visibility"
|
|
619
628
|
})]
|
|
620
629
|
}) })
|
|
621
630
|
]
|
|
622
631
|
}),
|
|
623
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ w("div", {
|
|
624
633
|
className: "flex gap-2 border-b",
|
|
625
634
|
children: [
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
variant:
|
|
628
|
-
onClick: () =>
|
|
629
|
-
children: [/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ w(a, {
|
|
636
|
+
variant: R === "edit" ? "default" : "ghost",
|
|
637
|
+
onClick: () => z("edit"),
|
|
638
|
+
children: [/* @__PURE__ */ C(T, { className: "h-4 w-4 mr-2" }), "Template"]
|
|
630
639
|
}),
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
variant:
|
|
633
|
-
onClick: () =>
|
|
634
|
-
children: [/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ w(a, {
|
|
641
|
+
variant: R === "preview" ? "default" : "ghost",
|
|
642
|
+
onClick: () => z("preview"),
|
|
643
|
+
children: [/* @__PURE__ */ C(E, { className: "h-4 w-4 mr-2" }), "Preview"]
|
|
635
644
|
}),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
variant:
|
|
638
|
-
onClick: () =>
|
|
639
|
-
children: [/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ w(a, {
|
|
646
|
+
variant: R === "test" ? "default" : "ghost",
|
|
647
|
+
onClick: () => z("test"),
|
|
648
|
+
children: [/* @__PURE__ */ C(O, { className: "h-4 w-4 mr-2" }), "Test"]
|
|
640
649
|
})
|
|
641
650
|
]
|
|
642
651
|
}),
|
|
643
|
-
|
|
652
|
+
R === "edit" && /* @__PURE__ */ w("div", {
|
|
644
653
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
645
|
-
children: [/* @__PURE__ */
|
|
654
|
+
children: [/* @__PURE__ */ C("div", {
|
|
646
655
|
className: "lg:col-span-2",
|
|
647
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(u, { children: "Template Content" }) }), /* @__PURE__ */ C(s, { children: /* @__PURE__ */ C("div", {
|
|
648
657
|
className: "p-4 bg-bg-sunken rounded-lg font-mono text-sm whitespace-pre-wrap",
|
|
649
|
-
children: /* @__PURE__ */
|
|
658
|
+
children: /* @__PURE__ */ C("div", { dangerouslySetInnerHTML: { __html: Z(I.templateText) } })
|
|
650
659
|
}) })] })
|
|
651
|
-
}), /* @__PURE__ */
|
|
660
|
+
}), /* @__PURE__ */ C("div", { children: /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
|
|
652
661
|
className: "flex items-center gap-2",
|
|
653
662
|
children: [
|
|
654
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ C(j, { size: 18 }),
|
|
655
664
|
"Variables (",
|
|
656
665
|
Q.length,
|
|
657
666
|
")"
|
|
658
667
|
]
|
|
659
|
-
}) }), /* @__PURE__ */
|
|
668
|
+
}) }), /* @__PURE__ */ C(s, { children: Q.length > 0 ? /* @__PURE__ */ C("div", {
|
|
660
669
|
className: "space-y-3",
|
|
661
|
-
children: Q.map((e, t) => /* @__PURE__ */
|
|
670
|
+
children: Q.map((e, t) => /* @__PURE__ */ w("div", {
|
|
662
671
|
className: "p-3 border rounded-lg",
|
|
663
672
|
children: [
|
|
664
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ w("div", {
|
|
665
674
|
className: "flex items-center justify-between mb-1",
|
|
666
|
-
children: [/* @__PURE__ */
|
|
675
|
+
children: [/* @__PURE__ */ C("span", {
|
|
667
676
|
className: "font-mono font-medium",
|
|
668
677
|
children: e.name
|
|
669
|
-
}), /* @__PURE__ */
|
|
678
|
+
}), /* @__PURE__ */ w("div", {
|
|
670
679
|
className: "flex gap-1",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
680
|
+
children: [/* @__PURE__ */ C(d, {
|
|
672
681
|
variant: "outline",
|
|
673
682
|
className: "text-xs",
|
|
674
683
|
children: e.type
|
|
675
|
-
}), e.required && /* @__PURE__ */
|
|
684
|
+
}), e.required && /* @__PURE__ */ C(d, {
|
|
676
685
|
variant: "destructive",
|
|
677
686
|
className: "text-xs",
|
|
678
687
|
children: "required"
|
|
679
688
|
})]
|
|
680
689
|
})]
|
|
681
690
|
}),
|
|
682
|
-
e.description && /* @__PURE__ */
|
|
691
|
+
e.description && /* @__PURE__ */ C("p", {
|
|
683
692
|
className: "text-sm text-text-secondary",
|
|
684
693
|
children: e.description
|
|
685
694
|
}),
|
|
686
|
-
e.defaultValue !== void 0 && /* @__PURE__ */
|
|
695
|
+
e.defaultValue !== void 0 && /* @__PURE__ */ w("p", {
|
|
687
696
|
className: "text-xs text-text-secondary mt-1",
|
|
688
697
|
children: [
|
|
689
698
|
"Default:",
|
|
690
699
|
" ",
|
|
691
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ C("code", {
|
|
692
701
|
className: "bg-bg-sunken px-1",
|
|
693
702
|
children: String(e.defaultValue)
|
|
694
703
|
})
|
|
@@ -696,69 +705,72 @@ var M = [
|
|
|
696
705
|
})
|
|
697
706
|
]
|
|
698
707
|
}, t))
|
|
699
|
-
}) : /* @__PURE__ */
|
|
708
|
+
}) : /* @__PURE__ */ C("p", {
|
|
700
709
|
className: "text-text-secondary text-center py-4",
|
|
701
710
|
children: "No variables defined"
|
|
702
711
|
}) })] }) })]
|
|
703
712
|
}),
|
|
704
|
-
|
|
713
|
+
R === "preview" && /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(u, { children: "Rendered Preview" }), /* @__PURE__ */ C(c, { children: "Preview with example inputs (first example set)" })] }), /* @__PURE__ */ C(s, { children: /* @__PURE__ */ C("div", {
|
|
705
714
|
className: "p-4 bg-bg-sunken rounded-lg font-mono text-sm whitespace-pre-wrap",
|
|
706
|
-
children: $[0] ?
|
|
715
|
+
children: $[0] ? I.templateText.replace(/\{\{(\w+)\}\}/g, (e, t) => {
|
|
707
716
|
let n = $[0][t];
|
|
708
717
|
return n === void 0 ? `{{${t}}}` : String(n);
|
|
709
|
-
}) : /* @__PURE__ */
|
|
718
|
+
}) : /* @__PURE__ */ C("span", {
|
|
710
719
|
className: "text-text-secondary",
|
|
711
720
|
children: "No example inputs defined. Add examples to preview rendered output."
|
|
712
721
|
})
|
|
713
722
|
}) })] }),
|
|
714
|
-
|
|
723
|
+
R === "test" && /* @__PURE__ */ w("div", {
|
|
715
724
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
716
|
-
children: [/* @__PURE__ */
|
|
725
|
+
children: [/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(u, { children: "Test Inputs" }), /* @__PURE__ */ C(c, { children: "Enter values to test the template" })] }), /* @__PURE__ */ w(s, {
|
|
717
726
|
className: "space-y-4",
|
|
718
|
-
children: [Q.map((e) => /* @__PURE__ */
|
|
727
|
+
children: [Q.map((e) => /* @__PURE__ */ w(h, {
|
|
719
728
|
label: e.name,
|
|
720
729
|
required: e.required,
|
|
721
|
-
children: [/* @__PURE__ */
|
|
730
|
+
children: [/* @__PURE__ */ C(g, {
|
|
722
731
|
placeholder: e.defaultValue ? String(e.defaultValue) : `Enter ${e.name}`,
|
|
723
|
-
value:
|
|
724
|
-
onChange: (t) =>
|
|
725
|
-
...
|
|
732
|
+
value: H[e.name] || "",
|
|
733
|
+
onChange: (t) => De({
|
|
734
|
+
...H,
|
|
726
735
|
[e.name]: t.target.value
|
|
727
736
|
})
|
|
728
|
-
}), e.description && /* @__PURE__ */
|
|
737
|
+
}), e.description && /* @__PURE__ */ C("p", {
|
|
729
738
|
className: "text-xs text-text-secondary mt-1",
|
|
730
739
|
children: e.description
|
|
731
740
|
})]
|
|
732
|
-
}, e.name)), /* @__PURE__ */
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
741
|
+
}, e.name)), /* @__PURE__ */ C(r, {
|
|
742
|
+
permission: n.PROMPT_TEMPLATE_EXECUTE,
|
|
743
|
+
children: /* @__PURE__ */ C(a, {
|
|
744
|
+
className: "w-full",
|
|
745
|
+
leftIcon: /* @__PURE__ */ C(O, { size: 16 }),
|
|
746
|
+
onClick: Ne,
|
|
747
|
+
isLoading: Ee,
|
|
748
|
+
children: "Render Template"
|
|
749
|
+
})
|
|
738
750
|
})]
|
|
739
|
-
})] }), /* @__PURE__ */
|
|
751
|
+
})] }), /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(u, { children: "Output" }) }), /* @__PURE__ */ C(s, { children: U ? /* @__PURE__ */ C("div", {
|
|
740
752
|
className: "p-4 bg-bg-sunken rounded-lg font-mono text-sm whitespace-pre-wrap",
|
|
741
|
-
children:
|
|
742
|
-
}) : /* @__PURE__ */
|
|
753
|
+
children: U
|
|
754
|
+
}) : /* @__PURE__ */ w("div", {
|
|
743
755
|
className: "p-8 text-center text-text-secondary",
|
|
744
|
-
children: [/* @__PURE__ */
|
|
756
|
+
children: [/* @__PURE__ */ C(O, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }), /* @__PURE__ */ C("p", { children: "Enter inputs and click \"Render Template\" to see output" })]
|
|
745
757
|
}) })] })]
|
|
746
758
|
}),
|
|
747
|
-
$.length > 0 &&
|
|
759
|
+
$.length > 0 && R === "edit" && /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ C(u, { children: "Example Inputs" }), /* @__PURE__ */ C(c, { children: "Pre-defined inputs for testing and documentation" })] }), /* @__PURE__ */ C(s, { children: /* @__PURE__ */ C("div", {
|
|
748
760
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
749
|
-
children: $.map((e, t) => /* @__PURE__ */
|
|
761
|
+
children: $.map((e, t) => /* @__PURE__ */ w("div", {
|
|
750
762
|
className: "p-4 border rounded-lg bg-bg-sunken/30",
|
|
751
|
-
children: [/* @__PURE__ */
|
|
763
|
+
children: [/* @__PURE__ */ w("p", {
|
|
752
764
|
className: "text-sm font-medium mb-2",
|
|
753
765
|
children: ["Example ", t + 1]
|
|
754
|
-
}), /* @__PURE__ */
|
|
766
|
+
}), /* @__PURE__ */ C("div", {
|
|
755
767
|
className: "space-y-1 text-sm",
|
|
756
|
-
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */
|
|
768
|
+
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ w("div", {
|
|
757
769
|
className: "flex justify-between",
|
|
758
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ w("span", {
|
|
759
771
|
className: "font-mono text-text-secondary",
|
|
760
772
|
children: [e, ":"]
|
|
761
|
-
}), /* @__PURE__ */
|
|
773
|
+
}), /* @__PURE__ */ C("span", {
|
|
762
774
|
className: "font-mono truncate max-w-[60%]",
|
|
763
775
|
children: String(t)
|
|
764
776
|
})]
|
|
@@ -766,36 +778,36 @@ var M = [
|
|
|
766
778
|
})]
|
|
767
779
|
}, t))
|
|
768
780
|
}) })] }),
|
|
769
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
|
|
770
782
|
className: "flex items-center gap-2",
|
|
771
|
-
children: [/* @__PURE__ */
|
|
772
|
-
}) }), /* @__PURE__ */
|
|
783
|
+
children: [/* @__PURE__ */ C(ge, { size: 18 }), "Metadata"]
|
|
784
|
+
}) }), /* @__PURE__ */ C(s, { children: /* @__PURE__ */ w("div", {
|
|
773
785
|
className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
|
|
774
786
|
children: [
|
|
775
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
776
788
|
className: "text-text-secondary",
|
|
777
789
|
children: "Created"
|
|
778
|
-
}), /* @__PURE__ */
|
|
790
|
+
}), /* @__PURE__ */ C("p", {
|
|
779
791
|
className: "font-medium",
|
|
780
|
-
children: t(
|
|
792
|
+
children: t(I.createdAt)
|
|
781
793
|
})] }),
|
|
782
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
783
795
|
className: "text-text-secondary",
|
|
784
796
|
children: "Updated"
|
|
785
|
-
}), /* @__PURE__ */
|
|
797
|
+
}), /* @__PURE__ */ C("p", {
|
|
786
798
|
className: "font-medium",
|
|
787
|
-
children: t(
|
|
799
|
+
children: t(I.updatedAt)
|
|
788
800
|
})] }),
|
|
789
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
790
802
|
className: "text-text-secondary",
|
|
791
803
|
children: "Tags"
|
|
792
|
-
}), /* @__PURE__ */
|
|
804
|
+
}), /* @__PURE__ */ C("div", {
|
|
793
805
|
className: "flex gap-1",
|
|
794
|
-
children:
|
|
806
|
+
children: I.tags.length > 0 ? I.tags.map((e) => /* @__PURE__ */ C(d, {
|
|
795
807
|
variant: "secondary",
|
|
796
808
|
className: "text-xs",
|
|
797
809
|
children: e
|
|
798
|
-
}, e)) : /* @__PURE__ */
|
|
810
|
+
}, e)) : /* @__PURE__ */ C("span", {
|
|
799
811
|
className: "text-text-secondary",
|
|
800
812
|
children: "None"
|
|
801
813
|
})
|
|
@@ -807,6 +819,6 @@ var M = [
|
|
|
807
819
|
});
|
|
808
820
|
};
|
|
809
821
|
//#endregion
|
|
810
|
-
export {
|
|
822
|
+
export { P as PromptTemplateDetailPage };
|
|
811
823
|
|
|
812
824
|
//# sourceMappingURL=PromptTemplateDetailPage.js.map
|