@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.
Files changed (80) hide show
  1. package/dist/botlit/BotlitRoutes.js +142 -132
  2. package/dist/botlit/BotlitRoutes.js.map +1 -1
  3. package/dist/botlit/components/AgentApprovalPanel.js +144 -126
  4. package/dist/botlit/components/AgentApprovalPanel.js.map +1 -1
  5. package/dist/botlit/components/ModelRegistrationPanel.js +4 -4
  6. package/dist/botlit/components/VersionHistoryPanel.js +92 -83
  7. package/dist/botlit/components/VersionHistoryPanel.js.map +1 -1
  8. package/dist/botlit/pages/A2AAgentDetailPage.js +212 -203
  9. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  10. package/dist/botlit/pages/A2ARegistryPage.js +129 -117
  11. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  12. package/dist/botlit/pages/AgentApprovalsPage.js +122 -110
  13. package/dist/botlit/pages/AgentApprovalsPage.js.map +1 -1
  14. package/dist/botlit/pages/AgentBuilderPage.js +18 -18
  15. package/dist/botlit/pages/AgentDetailPage.js +298 -273
  16. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  17. package/dist/botlit/pages/AgentsListPage.js +145 -121
  18. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  19. package/dist/botlit/pages/BotChannelsTab.js +238 -226
  20. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  21. package/dist/botlit/pages/BotDetailPage.js +307 -288
  22. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  23. package/dist/botlit/pages/BotWorkflowTab.js +125 -116
  24. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  25. package/dist/botlit/pages/BotsListPage.js +159 -144
  26. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  27. package/dist/botlit/pages/BucketsPage.js +279 -258
  28. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  29. package/dist/botlit/pages/ChannelDetailPage.js +346 -328
  30. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  31. package/dist/botlit/pages/ChannelRoutesPage.js +10 -10
  32. package/dist/botlit/pages/ChannelsPage.js +163 -148
  33. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  34. package/dist/botlit/pages/DashboardPage.js +129 -114
  35. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  36. package/dist/botlit/pages/ExecutionDetailPage.js +145 -139
  37. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  38. package/dist/botlit/pages/ExecutionsPage.js +14 -14
  39. package/dist/botlit/pages/InstalledPackagesPage.js +245 -227
  40. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  41. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +168 -156
  42. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  43. package/dist/botlit/pages/KnowledgeBasesPage.js +91 -79
  44. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  45. package/dist/botlit/pages/MCPServerDetailPage.js +200 -188
  46. package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
  47. package/dist/botlit/pages/MCPServersPage.js +170 -155
  48. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  49. package/dist/botlit/pages/PoliciesPage.js +113 -104
  50. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  51. package/dist/botlit/pages/PolicyDetailPage.js +145 -133
  52. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  53. package/dist/botlit/pages/PromptStudioPage.js +106 -97
  54. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  55. package/dist/botlit/pages/PromptTemplateDetailPage.js +359 -347
  56. package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
  57. package/dist/botlit/pages/PromptTemplatesPage.js +127 -112
  58. package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
  59. package/dist/botlit/pages/RetrievalProfileDetailPage.js +219 -210
  60. package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
  61. package/dist/botlit/pages/RetrievalProfilesPage.js +112 -103
  62. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  63. package/dist/botlit/pages/SettingsPage.js +264 -252
  64. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  65. package/dist/botlit/pages/SkillDetailPage.js +235 -226
  66. package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
  67. package/dist/botlit/pages/SkillsPage.js +115 -106
  68. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  69. package/dist/botlit/pages/StorePackageDetailPage.js +194 -188
  70. package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
  71. package/dist/botlit/pages/StorePage.js +161 -155
  72. package/dist/botlit/pages/StorePage.js.map +1 -1
  73. package/dist/botlit/permissions/PermissionRequired.js +45 -0
  74. package/dist/botlit/permissions/PermissionRequired.js.map +1 -0
  75. package/dist/botlit/permissions/botmanorPermissions.js +72 -0
  76. package/dist/botlit/permissions/botmanorPermissions.js.map +1 -0
  77. package/dist/botlit/permissions/index.js +3 -0
  78. package/dist/botlit/permissions/useBotmanorPermissions.js +19 -0
  79. package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -0
  80. 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 { PageLayout as n } from "../components/PageLayout.js";
4
- import { Card as r, CardContent as i, CardDescription as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
5
- import { Button as c } from "../components/Button.js";
6
- import { Badge as l, StatusBadge as ee } from "../components/Badge.js";
7
- import { isNative as u, nativeCopyText as te, nativeImpact as ne, nativeNotify as d, nativeToast as f } from "../../utils/nativeBridge.js";
8
- import { EmptyState as p } from "../components/EmptyState.js";
9
- import { FormField as m, Input as h, Textarea as g } from "../components/Input.js";
10
- import { toUnion as _ } from "../utils/unions.js";
11
- import { promptTemplateExamples as v, promptTemplateVariables as y, useCreatePromptTemplate as re, useDeletePromptTemplate as ie, usePromptTemplate as ae, useRenderPromptTemplate as oe, useUpdatePromptTemplate as se } from "../hooks/usePromptTemplates.js";
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 ce, useState as b } from "react";
14
- import { PagePurpose as le } from "@burdenoff/fe-libs/ui";
15
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
16
- import { useParams as ue } from "react-router";
17
- import { ArrowLeft as de, Check as fe, Code as w, Copy as pe, Edit3 as me, Eye as T, FileText as E, Play as D, Save as O, Settings as he, Trash2 as k, Variable as A } from "lucide-react";
18
- import { toast as j } from "sonner";
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 M = [
23
+ var N = [
21
24
  "string",
22
25
  "number",
23
26
  "boolean",
24
27
  "array",
25
28
  "object"
26
- ], ge = [
29
+ ], _e = [
27
30
  "PRIVATE",
28
31
  "WORKSPACE",
29
32
  "PUBLIC"
30
- ], N = ({ isNew: N }) => {
31
- let { templateId: _e } = ue(), { navigateTo: P } = e(), { data: F, loading: I } = ae(N ? void 0 : _e), { create: ve, loading: ye } = re(), { update: be, loading: xe } = se(), { remove: Se, loading: Ce } = ie(), { render: we, loading: Te } = oe(), [L, R] = b("edit"), [z, B] = b(!1), [V, Ee] = b({}), [H, De] = b(null), [U, W] = b(!1), [Oe, G] = b(!1), [K, q] = b({
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
- }), J = ce(() => {
40
- let e = N ? K.templateText : F?.templateText || "", t = /\{\{(\w+)\}\}/g, n = /* @__PURE__ */ new Set(), r;
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
- N,
45
- K.templateText,
46
- F?.templateText
47
- ]), ke = async () => {
48
- if (!(!K.name || !K.slug)) {
47
+ P,
48
+ q.templateText,
49
+ I?.templateText
50
+ ]), Ae = async () => {
51
+ if (!(!q.name || !q.slug)) {
49
52
  try {
50
- await ve({
51
- name: K.name,
52
- slug: K.slug,
53
- description: K.description,
54
- visibility: K.visibility,
55
- templateText: K.templateText,
56
- variables: K.variables,
57
- exampleInputs: K.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
- j.error(e instanceof Error ? e.message : "Failed to create prompt template");
63
+ M.error(e instanceof Error ? e.message : "Failed to create prompt template");
61
64
  return;
62
65
  }
63
- j.success(`Template "${K.name}" created`), P("prompt-templates");
66
+ M.success(`Template "${q.name}" created`), F("prompt-templates");
64
67
  }
65
- }, Ae = () => {
66
- q({
67
- ...K,
68
- variables: [...K.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
- }, Y = (e, t) => {
76
- let n = [...K.variables];
78
+ }, X = (e, t) => {
79
+ let n = [...q.variables];
77
80
  n[e] = {
78
81
  ...n[e],
79
82
  ...t
80
- }, q({
81
- ...K,
83
+ }, J({
84
+ ...q,
82
85
  variables: n
83
86
  });
84
- }, je = (e) => {
85
- q({
86
- ...K,
87
- variables: K.variables.filter((t, n) => n !== e)
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
- await te(F?.templateText || K.templateText), B(!0), u() && f("Copied"), setTimeout(() => B(!1), 2e3);
96
- }, X = () => {
97
- F && (q({
98
- name: F.name,
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
- if (!(!F || !K.name || !K.slug)) {
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 be({
110
- templateId: F.id,
112
+ await xe({
113
+ templateId: I.id,
111
114
  input: {
112
- name: K.name,
113
- slug: K.slug,
114
- description: K.description,
115
- visibility: K.visibility,
116
- templateText: K.templateText,
117
- variables: K.variables,
118
- exampleInputs: K.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
- j.error(e instanceof Error ? e.message : "Failed to update prompt template");
125
+ M.error(e instanceof Error ? e.message : "Failed to update prompt template");
123
126
  return;
124
127
  }
125
- j.success("Template updated"), W(!1);
128
+ M.success("Template updated"), G(!1);
126
129
  }
127
- }, Fe = async () => {
128
- if (F) try {
129
- await Se(F.id), u() && d("success"), P("prompt-templates");
130
+ }, Le = async () => {
131
+ if (I) try {
132
+ await Ce(I.id), f() && m("success"), F("prompt-templates");
130
133
  } catch (e) {
131
- throw u() && d("error"), e;
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 (N) return /* @__PURE__ */ S(n, {
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__ */ C("div", {
140
+ actions: /* @__PURE__ */ w("div", {
138
141
  className: "flex gap-2",
139
- children: [/* @__PURE__ */ S(c, {
142
+ children: [/* @__PURE__ */ C(a, {
140
143
  variant: "outline",
141
- onClick: () => P("prompt-templates"),
144
+ onClick: () => F("prompt-templates"),
142
145
  children: "Cancel"
143
- }), /* @__PURE__ */ S(c, {
144
- leftIcon: /* @__PURE__ */ S(O, { size: 16 }),
145
- onClick: ke,
146
- isLoading: ye,
147
- disabled: !K.name || !K.slug,
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__ */ C("div", {
154
+ children: /* @__PURE__ */ w("div", {
152
155
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
153
- children: [/* @__PURE__ */ C("div", {
156
+ children: [/* @__PURE__ */ w("div", {
154
157
  className: "lg:col-span-2 space-y-6",
155
158
  children: [
156
- /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, { children: "Basic Information" }) }), /* @__PURE__ */ C(i, {
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__ */ C("div", {
162
+ /* @__PURE__ */ w("div", {
160
163
  className: "grid grid-cols-2 gap-4",
161
- children: [/* @__PURE__ */ S(m, {
164
+ children: [/* @__PURE__ */ C(h, {
162
165
  label: "Template Name",
163
166
  required: !0,
164
- children: /* @__PURE__ */ S(h, {
167
+ children: /* @__PURE__ */ C(g, {
165
168
  placeholder: "e.g., Technical Support Template",
166
- value: K.name,
167
- onChange: (e) => q({
168
- ...K,
169
+ value: q.name,
170
+ onChange: (e) => J({
171
+ ...q,
169
172
  name: e.target.value
170
173
  })
171
174
  })
172
- }), /* @__PURE__ */ S(m, {
175
+ }), /* @__PURE__ */ C(h, {
173
176
  label: "Slug",
174
177
  required: !0,
175
178
  description: "Unique identifier (lowercase, dashes)",
176
- children: /* @__PURE__ */ S(h, {
179
+ children: /* @__PURE__ */ C(g, {
177
180
  placeholder: "e.g., technical-support",
178
- value: K.slug,
179
- onChange: (e) => q({
180
- ...K,
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__ */ S(m, {
189
+ /* @__PURE__ */ C(h, {
187
190
  label: "Description",
188
- children: /* @__PURE__ */ S(g, {
191
+ children: /* @__PURE__ */ C(_, {
189
192
  placeholder: "What is this template used for?",
190
- value: K.description,
191
- onChange: (e) => q({
192
- ...K,
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__ */ S(m, {
201
+ /* @__PURE__ */ C(h, {
199
202
  label: "Visibility",
200
- children: /* @__PURE__ */ C("select", {
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: K.visibility,
203
- onChange: (e) => q({
204
- ...K,
205
+ value: q.visibility,
206
+ onChange: (e) => J({
207
+ ...q,
205
208
  visibility: e.target.value
206
209
  }),
207
210
  children: [
208
- /* @__PURE__ */ S("option", {
211
+ /* @__PURE__ */ C("option", {
209
212
  value: "PRIVATE",
210
213
  children: "Private"
211
214
  }),
212
- /* @__PURE__ */ S("option", {
215
+ /* @__PURE__ */ C("option", {
213
216
  value: "WORKSPACE",
214
217
  children: "Workspace"
215
218
  }),
216
- /* @__PURE__ */ S("option", {
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__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ C(s, {
228
+ /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(u, {
226
229
  className: "flex items-center gap-2",
227
- children: [/* @__PURE__ */ S(w, { size: 18 }), "Template Content"]
228
- }), /* @__PURE__ */ C(a, { children: [
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__ */ C(i, { children: [/* @__PURE__ */ S(g, {
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: K.templateText,
236
- onChange: (e) => q({
237
- ...K,
238
+ value: q.templateText,
239
+ onChange: (e) => J({
240
+ ...q,
238
241
  templateText: e.target.value
239
242
  })
240
- }), J.length > 0 && /* @__PURE__ */ C("div", {
243
+ }), Y.length > 0 && /* @__PURE__ */ w("div", {
241
244
  className: "mt-3 flex items-center gap-2",
242
- children: [/* @__PURE__ */ S("span", {
245
+ children: [/* @__PURE__ */ C("span", {
243
246
  className: "text-sm text-text-secondary",
244
247
  children: "Detected variables:"
245
- }), J.map((e) => /* @__PURE__ */ S(l, {
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__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ C(s, {
254
+ /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ w(l, { children: [/* @__PURE__ */ w(u, {
252
255
  className: "flex items-center justify-between",
253
- children: [/* @__PURE__ */ C("span", {
256
+ children: [/* @__PURE__ */ w("span", {
254
257
  className: "flex items-center gap-2",
255
- children: [/* @__PURE__ */ S(A, { size: 18 }), "Variables"]
256
- }), /* @__PURE__ */ S(c, {
258
+ children: [/* @__PURE__ */ C(j, { size: 18 }), "Variables"]
259
+ }), /* @__PURE__ */ C(a, {
257
260
  variant: "outline",
258
261
  size: "sm",
259
- onClick: Ae,
262
+ onClick: je,
260
263
  children: "Add Variable"
261
264
  })]
262
- }), /* @__PURE__ */ S(a, { children: "Define the variables used in your template" })] }), /* @__PURE__ */ S(i, { children: K.variables.length > 0 ? /* @__PURE__ */ S("div", {
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: K.variables.map((e, t) => /* @__PURE__ */ C("div", {
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__ */ C("div", {
269
+ children: [/* @__PURE__ */ w("div", {
267
270
  className: "grid grid-cols-4 gap-3",
268
271
  children: [
269
- /* @__PURE__ */ S(m, {
272
+ /* @__PURE__ */ C(h, {
270
273
  label: "Name",
271
- children: /* @__PURE__ */ S(h, {
274
+ children: /* @__PURE__ */ C(g, {
272
275
  className: "font-mono",
273
276
  placeholder: "variable_name",
274
277
  value: e.name,
275
- onChange: (e) => Y(t, { name: e.target.value })
278
+ onChange: (e) => X(t, { name: e.target.value })
276
279
  })
277
280
  }),
278
- /* @__PURE__ */ S(m, {
281
+ /* @__PURE__ */ C(h, {
279
282
  label: "Type",
280
- children: /* @__PURE__ */ S("select", {
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) => Y(t, { type: _(e.target.value, M, "string") }),
284
- children: M.map((e) => /* @__PURE__ */ S("option", {
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__ */ S(m, {
293
+ /* @__PURE__ */ C(h, {
291
294
  label: "Default Value",
292
- children: /* @__PURE__ */ S(h, {
295
+ children: /* @__PURE__ */ C(g, {
293
296
  placeholder: "Optional",
294
297
  value: String(e.defaultValue || ""),
295
- onChange: (e) => Y(t, { defaultValue: e.target.value || void 0 })
298
+ onChange: (e) => X(t, { defaultValue: e.target.value || void 0 })
296
299
  })
297
300
  }),
298
- /* @__PURE__ */ C("div", {
301
+ /* @__PURE__ */ w("div", {
299
302
  className: "flex items-end gap-2",
300
- children: [/* @__PURE__ */ C("label", {
303
+ children: [/* @__PURE__ */ w("label", {
301
304
  className: "flex items-center gap-2 h-10",
302
- children: [/* @__PURE__ */ S("input", {
305
+ children: [/* @__PURE__ */ C("input", {
303
306
  type: "checkbox",
304
307
  checked: e.required,
305
- onChange: (e) => Y(t, { required: e.target.checked }),
308
+ onChange: (e) => X(t, { required: e.target.checked }),
306
309
  className: "h-4 w-4"
307
- }), /* @__PURE__ */ S("span", {
310
+ }), /* @__PURE__ */ C("span", {
308
311
  className: "text-sm",
309
312
  children: "Required"
310
313
  })]
311
- }), /* @__PURE__ */ S(c, {
314
+ }), /* @__PURE__ */ C(a, {
312
315
  variant: "ghost",
313
316
  size: "sm",
314
317
  className: "text-status-error-text",
315
- onClick: () => je(t),
318
+ onClick: () => Me(t),
316
319
  children: "Remove"
317
320
  })]
318
321
  })
319
322
  ]
320
- }), /* @__PURE__ */ S(m, {
323
+ }), /* @__PURE__ */ C(h, {
321
324
  label: "Description",
322
- children: /* @__PURE__ */ S(h, {
325
+ children: /* @__PURE__ */ C(g, {
323
326
  placeholder: "What is this variable for?",
324
327
  value: e.description || "",
325
- onChange: (e) => Y(t, { description: e.target.value })
328
+ onChange: (e) => X(t, { description: e.target.value })
326
329
  })
327
330
  })]
328
331
  }, t))
329
- }) : /* @__PURE__ */ C("div", {
332
+ }) : /* @__PURE__ */ w("div", {
330
333
  className: "text-center py-8 text-text-secondary",
331
334
  children: [
332
- /* @__PURE__ */ S(A, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
333
- /* @__PURE__ */ S("p", { children: "No variables defined yet" }),
334
- /* @__PURE__ */ C("p", {
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__ */ C("div", {
348
+ }), /* @__PURE__ */ w("div", {
346
349
  className: "space-y-6",
347
- children: [/* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ C(s, {
350
+ children: [/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
348
351
  className: "flex items-center gap-2",
349
- children: [/* @__PURE__ */ S(T, { size: 18 }), "Preview"]
350
- }) }), /* @__PURE__ */ S(i, { children: /* @__PURE__ */ S("div", {
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(K.templateText || "Enter template text...") }
353
- }) })] }), /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, { children: "Quick Tips" }) }), /* @__PURE__ */ C(i, {
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__ */ C("p", { children: [
357
- /* @__PURE__ */ S("strong", { children: "Variables:" }),
359
+ /* @__PURE__ */ w("p", { children: [
360
+ /* @__PURE__ */ C("strong", { children: "Variables:" }),
358
361
  " Use ",
359
362
  "{{name}}",
360
363
  " syntax"
361
364
  ] }),
362
- /* @__PURE__ */ S("p", { children: /* @__PURE__ */ S("strong", { children: "Best Practices:" }) }),
363
- /* @__PURE__ */ C("ul", {
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__ */ S("li", { children: "Use descriptive variable names" }),
367
- /* @__PURE__ */ S("li", { children: "Provide default values when possible" }),
368
- /* @__PURE__ */ S("li", { children: "Include example inputs for testing" }),
369
- /* @__PURE__ */ S("li", { children: "Version your templates for changes" })
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 (I) return /* @__PURE__ */ S(n, {
380
+ if (ye) return /* @__PURE__ */ C(i, {
378
381
  title: "Loading...",
379
- children: /* @__PURE__ */ S("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
382
+ children: /* @__PURE__ */ C("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
380
383
  });
381
- if (!F) return /* @__PURE__ */ S(n, {
384
+ if (!I) return /* @__PURE__ */ C(i, {
382
385
  title: "Template Not Found",
383
- children: /* @__PURE__ */ S(p, {
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__ */ S(c, {
388
- onClick: () => P("prompt-templates"),
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 = y(F), $ = v(F);
394
- return /* @__PURE__ */ S(n, {
395
- title: /* @__PURE__ */ C("div", {
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__ */ S(c, {
401
+ /* @__PURE__ */ C(a, {
399
402
  variant: "ghost",
400
403
  size: "icon",
401
- onClick: () => P("prompt-templates"),
402
- children: /* @__PURE__ */ S(de, { size: 20 })
404
+ onClick: () => F("prompt-templates"),
405
+ children: /* @__PURE__ */ C(fe, { size: 20 })
403
406
  }),
404
- /* @__PURE__ */ S("div", {
407
+ /* @__PURE__ */ C("div", {
405
408
  className: "p-2 rounded-lg bg-action-primary-bg/10",
406
- children: /* @__PURE__ */ S(E, { className: "h-6 w-6 text-primary" })
409
+ children: /* @__PURE__ */ C(D, { className: "h-6 w-6 text-primary" })
407
410
  }),
408
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("div", {
411
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
409
412
  className: "flex items-center gap-2",
410
413
  children: [
411
- /* @__PURE__ */ S("span", { children: F.name }),
412
- /* @__PURE__ */ S(ee, { status: F.status }),
413
- /* @__PURE__ */ C(l, {
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", F.version]
419
+ children: ["v", I.version]
417
420
  })
418
421
  ]
419
- }), /* @__PURE__ */ C("p", {
422
+ }), /* @__PURE__ */ w("p", {
420
423
  className: "text-sm font-normal text-text-secondary",
421
424
  children: [
422
- F.slug,
425
+ I.slug,
423
426
  " - ",
424
- F.description
427
+ I.description
425
428
  ]
426
429
  })] })
427
430
  ]
428
431
  }),
429
- actions: /* @__PURE__ */ C("div", {
432
+ actions: /* @__PURE__ */ w("div", {
430
433
  className: "flex gap-2",
431
- children: [/* @__PURE__ */ S(c, {
434
+ children: [/* @__PURE__ */ C(a, {
432
435
  variant: "outline",
433
- leftIcon: S(z ? fe : pe, { size: 16 }),
434
- onClick: Ne,
435
- children: z ? "Copied!" : "Copy"
436
- }), U ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(c, {
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: () => W(!1),
441
+ onClick: () => G(!1),
439
442
  children: "Cancel"
440
- }), /* @__PURE__ */ S(c, {
441
- leftIcon: /* @__PURE__ */ S(O, { size: 16 }),
442
- onClick: Pe,
443
- isLoading: xe,
444
- disabled: !K.name || !K.slug,
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
- })] }) : Oe ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(c, {
449
+ })] }) : ke ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(a, {
447
450
  variant: "outline",
448
- onClick: () => G(!1),
451
+ onClick: () => K(!1),
449
452
  children: "Cancel"
450
- }), /* @__PURE__ */ S(c, {
453
+ }), /* @__PURE__ */ C(a, {
451
454
  variant: "destructive",
452
- leftIcon: /* @__PURE__ */ S(k, { size: 16 }),
455
+ leftIcon: /* @__PURE__ */ C(A, { size: 16 }),
453
456
  onClick: () => {
454
- ne("medium"), Fe();
457
+ te("medium"), Le();
455
458
  },
456
- isLoading: Ce,
459
+ isLoading: we,
457
460
  children: "Confirm Delete"
458
- })] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(c, {
459
- variant: "outline",
460
- leftIcon: /* @__PURE__ */ S(me, { size: 16 }),
461
- onClick: X,
462
- children: "Edit Template"
463
- }), /* @__PURE__ */ S(c, {
464
- variant: "outline",
465
- leftIcon: /* @__PURE__ */ S(k, { size: 16 }),
466
- onClick: () => G(!0),
467
- children: "Delete"
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__ */ C("div", {
479
+ children: /* @__PURE__ */ w("div", {
471
480
  className: "space-y-6",
472
481
  children: [
473
- /* @__PURE__ */ C(le, {
474
- icon: /* @__PURE__ */ S(E, { size: 18 }),
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__ */ S("code", { children: "{{variables}}" }),
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
- U && /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(s, { children: "Edit Template" }), /* @__PURE__ */ S(a, { children: "Update template details and content" })] }), /* @__PURE__ */ C(i, {
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__ */ C("div", {
494
+ /* @__PURE__ */ w("div", {
486
495
  className: "grid grid-cols-2 gap-4",
487
- children: [/* @__PURE__ */ S(m, {
496
+ children: [/* @__PURE__ */ C(h, {
488
497
  label: "Template Name",
489
498
  required: !0,
490
- children: /* @__PURE__ */ S(h, {
499
+ children: /* @__PURE__ */ C(g, {
491
500
  placeholder: "e.g., Technical Support Template",
492
- value: K.name,
493
- onChange: (e) => q({
494
- ...K,
501
+ value: q.name,
502
+ onChange: (e) => J({
503
+ ...q,
495
504
  name: e.target.value
496
505
  })
497
506
  })
498
- }), /* @__PURE__ */ S(m, {
507
+ }), /* @__PURE__ */ C(h, {
499
508
  label: "Slug",
500
509
  required: !0,
501
510
  description: "Unique identifier (lowercase, dashes)",
502
- children: /* @__PURE__ */ S(h, {
511
+ children: /* @__PURE__ */ C(g, {
503
512
  placeholder: "e.g., technical-support",
504
- value: K.slug,
505
- onChange: (e) => q({
506
- ...K,
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__ */ S(m, {
521
+ /* @__PURE__ */ C(h, {
513
522
  label: "Description",
514
- children: /* @__PURE__ */ S(g, {
523
+ children: /* @__PURE__ */ C(_, {
515
524
  placeholder: "What is this template used for?",
516
- value: K.description,
517
- onChange: (e) => q({
518
- ...K,
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__ */ S(m, {
533
+ /* @__PURE__ */ C(h, {
525
534
  label: "Visibility",
526
- children: /* @__PURE__ */ C("select", {
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: K.visibility,
529
- onChange: (e) => q({
530
- ...K,
537
+ value: q.visibility,
538
+ onChange: (e) => J({
539
+ ...q,
531
540
  visibility: e.target.value
532
541
  }),
533
542
  children: [
534
- /* @__PURE__ */ S("option", {
543
+ /* @__PURE__ */ C("option", {
535
544
  value: "PRIVATE",
536
545
  children: "Private"
537
546
  }),
538
- /* @__PURE__ */ S("option", {
547
+ /* @__PURE__ */ C("option", {
539
548
  value: "WORKSPACE",
540
549
  children: "Workspace"
541
550
  }),
542
- /* @__PURE__ */ S("option", {
551
+ /* @__PURE__ */ C("option", {
543
552
  value: "PUBLIC",
544
553
  children: "Public"
545
554
  })
546
555
  ]
547
556
  })
548
557
  }),
549
- /* @__PURE__ */ S(m, {
558
+ /* @__PURE__ */ C(h, {
550
559
  label: "Template Content",
551
560
  description: "Use {{variable_name}} syntax for variables",
552
- children: /* @__PURE__ */ S(g, {
561
+ children: /* @__PURE__ */ C(_, {
553
562
  className: "font-mono text-sm min-h-[200px]",
554
- value: K.templateText,
555
- onChange: (e) => q({
556
- ...K,
563
+ value: q.templateText,
564
+ onChange: (e) => J({
565
+ ...q,
557
566
  templateText: e.target.value
558
567
  })
559
568
  })
560
569
  }),
561
- J.length > 0 && /* @__PURE__ */ C("div", {
570
+ Y.length > 0 && /* @__PURE__ */ w("div", {
562
571
  className: "flex items-center gap-2",
563
- children: [/* @__PURE__ */ S("span", {
572
+ children: [/* @__PURE__ */ C("span", {
564
573
  className: "text-sm text-text-secondary",
565
574
  children: "Detected variables:"
566
- }), J.map((e) => /* @__PURE__ */ S(l, {
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__ */ C("div", {
583
+ /* @__PURE__ */ w("div", {
575
584
  className: "grid grid-cols-2 md:grid-cols-4 gap-4",
576
585
  children: [
577
- /* @__PURE__ */ S(r, {
586
+ /* @__PURE__ */ C(o, {
578
587
  treatment: "glass",
579
588
  glow: !0,
580
- children: /* @__PURE__ */ C(i, {
589
+ children: /* @__PURE__ */ w(s, {
581
590
  className: "pt-6 text-center",
582
- children: [/* @__PURE__ */ S("p", {
591
+ children: [/* @__PURE__ */ C("p", {
583
592
  className: "text-3xl font-bold text-text-primary",
584
593
  children: Q.length
585
- }), /* @__PURE__ */ S("p", {
594
+ }), /* @__PURE__ */ C("p", {
586
595
  className: "text-sm text-text-secondary",
587
596
  children: "Variables"
588
597
  })]
589
598
  })
590
599
  }),
591
- /* @__PURE__ */ S(r, { children: /* @__PURE__ */ C(i, {
600
+ /* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
592
601
  className: "pt-6 text-center",
593
- children: [/* @__PURE__ */ S("p", {
602
+ children: [/* @__PURE__ */ C("p", {
594
603
  className: "text-3xl font-bold text-text-primary",
595
604
  children: $.length
596
- }), /* @__PURE__ */ S("p", {
605
+ }), /* @__PURE__ */ C("p", {
597
606
  className: "text-sm text-text-secondary",
598
607
  children: "Examples"
599
608
  })]
600
609
  }) }),
601
- /* @__PURE__ */ S(r, { children: /* @__PURE__ */ C(i, {
610
+ /* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
602
611
  className: "pt-6 text-center",
603
- children: [/* @__PURE__ */ S("p", {
612
+ children: [/* @__PURE__ */ C("p", {
604
613
  className: "text-3xl font-bold text-text-primary",
605
- children: F.revision
606
- }), /* @__PURE__ */ S("p", {
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__ */ S(r, { children: /* @__PURE__ */ C(i, {
620
+ /* @__PURE__ */ C(o, { children: /* @__PURE__ */ w(s, {
612
621
  className: "pt-6 text-center",
613
- children: [/* @__PURE__ */ S("p", {
622
+ children: [/* @__PURE__ */ C("p", {
614
623
  className: "text-lg font-bold text-text-primary capitalize",
615
- children: F.visibility.toLowerCase()
616
- }), /* @__PURE__ */ S("p", {
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__ */ C("div", {
632
+ /* @__PURE__ */ w("div", {
624
633
  className: "flex gap-2 border-b",
625
634
  children: [
626
- /* @__PURE__ */ C(c, {
627
- variant: L === "edit" ? "default" : "ghost",
628
- onClick: () => R("edit"),
629
- children: [/* @__PURE__ */ S(w, { className: "h-4 w-4 mr-2" }), "Template"]
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__ */ C(c, {
632
- variant: L === "preview" ? "default" : "ghost",
633
- onClick: () => R("preview"),
634
- children: [/* @__PURE__ */ S(T, { className: "h-4 w-4 mr-2" }), "Preview"]
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__ */ C(c, {
637
- variant: L === "test" ? "default" : "ghost",
638
- onClick: () => R("test"),
639
- children: [/* @__PURE__ */ S(D, { className: "h-4 w-4 mr-2" }), "Test"]
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
- L === "edit" && /* @__PURE__ */ C("div", {
652
+ R === "edit" && /* @__PURE__ */ w("div", {
644
653
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
645
- children: [/* @__PURE__ */ S("div", {
654
+ children: [/* @__PURE__ */ C("div", {
646
655
  className: "lg:col-span-2",
647
- children: /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, { children: "Template Content" }) }), /* @__PURE__ */ S(i, { children: /* @__PURE__ */ S("div", {
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__ */ S("div", { dangerouslySetInnerHTML: { __html: Z(F.templateText) } })
658
+ children: /* @__PURE__ */ C("div", { dangerouslySetInnerHTML: { __html: Z(I.templateText) } })
650
659
  }) })] })
651
- }), /* @__PURE__ */ S("div", { children: /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ C(s, {
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__ */ S(A, { size: 18 }),
663
+ /* @__PURE__ */ C(j, { size: 18 }),
655
664
  "Variables (",
656
665
  Q.length,
657
666
  ")"
658
667
  ]
659
- }) }), /* @__PURE__ */ S(i, { children: Q.length > 0 ? /* @__PURE__ */ S("div", {
668
+ }) }), /* @__PURE__ */ C(s, { children: Q.length > 0 ? /* @__PURE__ */ C("div", {
660
669
  className: "space-y-3",
661
- children: Q.map((e, t) => /* @__PURE__ */ C("div", {
670
+ children: Q.map((e, t) => /* @__PURE__ */ w("div", {
662
671
  className: "p-3 border rounded-lg",
663
672
  children: [
664
- /* @__PURE__ */ C("div", {
673
+ /* @__PURE__ */ w("div", {
665
674
  className: "flex items-center justify-between mb-1",
666
- children: [/* @__PURE__ */ S("span", {
675
+ children: [/* @__PURE__ */ C("span", {
667
676
  className: "font-mono font-medium",
668
677
  children: e.name
669
- }), /* @__PURE__ */ C("div", {
678
+ }), /* @__PURE__ */ w("div", {
670
679
  className: "flex gap-1",
671
- children: [/* @__PURE__ */ S(l, {
680
+ children: [/* @__PURE__ */ C(d, {
672
681
  variant: "outline",
673
682
  className: "text-xs",
674
683
  children: e.type
675
- }), e.required && /* @__PURE__ */ S(l, {
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__ */ S("p", {
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__ */ C("p", {
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__ */ S("code", {
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__ */ S("p", {
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
- L === "preview" && /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(s, { children: "Rendered Preview" }), /* @__PURE__ */ S(a, { children: "Preview with example inputs (first example set)" })] }), /* @__PURE__ */ S(i, { children: /* @__PURE__ */ S("div", {
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] ? F.templateText.replace(/\{\{(\w+)\}\}/g, (e, t) => {
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__ */ S("span", {
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
- L === "test" && /* @__PURE__ */ C("div", {
723
+ R === "test" && /* @__PURE__ */ w("div", {
715
724
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
716
- children: [/* @__PURE__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(s, { children: "Test Inputs" }), /* @__PURE__ */ S(a, { children: "Enter values to test the template" })] }), /* @__PURE__ */ C(i, {
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__ */ C(m, {
727
+ children: [Q.map((e) => /* @__PURE__ */ w(h, {
719
728
  label: e.name,
720
729
  required: e.required,
721
- children: [/* @__PURE__ */ S(h, {
730
+ children: [/* @__PURE__ */ C(g, {
722
731
  placeholder: e.defaultValue ? String(e.defaultValue) : `Enter ${e.name}`,
723
- value: V[e.name] || "",
724
- onChange: (t) => Ee({
725
- ...V,
732
+ value: H[e.name] || "",
733
+ onChange: (t) => De({
734
+ ...H,
726
735
  [e.name]: t.target.value
727
736
  })
728
- }), e.description && /* @__PURE__ */ S("p", {
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__ */ S(c, {
733
- className: "w-full",
734
- leftIcon: /* @__PURE__ */ S(D, { size: 16 }),
735
- onClick: Me,
736
- isLoading: Te,
737
- children: "Render Template"
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__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ S(s, { children: "Output" }) }), /* @__PURE__ */ S(i, { children: H ? /* @__PURE__ */ S("div", {
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: H
742
- }) : /* @__PURE__ */ C("div", {
753
+ children: U
754
+ }) : /* @__PURE__ */ w("div", {
743
755
  className: "p-8 text-center text-text-secondary",
744
- children: [/* @__PURE__ */ S(D, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }), /* @__PURE__ */ S("p", { children: "Enter inputs and click \"Render Template\" to see output" })]
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 && L === "edit" && /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ C(o, { children: [/* @__PURE__ */ S(s, { children: "Example Inputs" }), /* @__PURE__ */ S(a, { children: "Pre-defined inputs for testing and documentation" })] }), /* @__PURE__ */ S(i, { children: /* @__PURE__ */ S("div", {
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__ */ C("div", {
761
+ children: $.map((e, t) => /* @__PURE__ */ w("div", {
750
762
  className: "p-4 border rounded-lg bg-bg-sunken/30",
751
- children: [/* @__PURE__ */ C("p", {
763
+ children: [/* @__PURE__ */ w("p", {
752
764
  className: "text-sm font-medium mb-2",
753
765
  children: ["Example ", t + 1]
754
- }), /* @__PURE__ */ S("div", {
766
+ }), /* @__PURE__ */ C("div", {
755
767
  className: "space-y-1 text-sm",
756
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ C("div", {
768
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ w("div", {
757
769
  className: "flex justify-between",
758
- children: [/* @__PURE__ */ C("span", {
770
+ children: [/* @__PURE__ */ w("span", {
759
771
  className: "font-mono text-text-secondary",
760
772
  children: [e, ":"]
761
- }), /* @__PURE__ */ S("span", {
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__ */ C(r, { children: [/* @__PURE__ */ S(o, { children: /* @__PURE__ */ C(s, {
781
+ /* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ w(u, {
770
782
  className: "flex items-center gap-2",
771
- children: [/* @__PURE__ */ S(he, { size: 18 }), "Metadata"]
772
- }) }), /* @__PURE__ */ S(i, { children: /* @__PURE__ */ C("div", {
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__ */ C("div", { children: [/* @__PURE__ */ S("p", {
787
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
776
788
  className: "text-text-secondary",
777
789
  children: "Created"
778
- }), /* @__PURE__ */ S("p", {
790
+ }), /* @__PURE__ */ C("p", {
779
791
  className: "font-medium",
780
- children: t(F.createdAt)
792
+ children: t(I.createdAt)
781
793
  })] }),
782
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
794
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
783
795
  className: "text-text-secondary",
784
796
  children: "Updated"
785
- }), /* @__PURE__ */ S("p", {
797
+ }), /* @__PURE__ */ C("p", {
786
798
  className: "font-medium",
787
- children: t(F.updatedAt)
799
+ children: t(I.updatedAt)
788
800
  })] }),
789
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
801
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
790
802
  className: "text-text-secondary",
791
803
  children: "Tags"
792
- }), /* @__PURE__ */ S("div", {
804
+ }), /* @__PURE__ */ C("div", {
793
805
  className: "flex gap-1",
794
- children: F.tags.length > 0 ? F.tags.map((e) => /* @__PURE__ */ S(l, {
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__ */ S("span", {
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 { N as PromptTemplateDetailPage };
822
+ export { P as PromptTemplateDetailPage };
811
823
 
812
824
  //# sourceMappingURL=PromptTemplateDetailPage.js.map