@burdenoff/microfe-botmanor 2026.1120.20 → 2026.1120.21
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/hooks/index.d.ts +1 -1
- package/dist/botlit/hooks/index.js +9 -9
- package/dist/botlit/hooks/usePromptTemplates.d.ts +26 -1
- package/dist/botlit/hooks/usePromptTemplates.js +119 -52
- package/dist/botlit/hooks/usePromptTemplates.js.map +1 -1
- package/dist/botlit/pages/PromptTemplateDetailPage.d.ts +5 -0
- package/dist/botlit/pages/PromptTemplateDetailPage.js +837 -670
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
- package/dist/botlit/pages/PromptTemplatesPage.js +264 -245
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
- package/dist/botlit/utils/leaveGuard.js +13 -12
- package/dist/botlit/utils/leaveGuard.js.map +1 -1
- package/dist/botlit/utils/promptTemplateForm.d.ts +94 -0
- package/dist/botlit/utils/promptTemplateForm.js +108 -0
- package/dist/botlit/utils/promptTemplateForm.js.map +1 -0
- package/dist/generated/wspace-operations.js +31 -33
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,66 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { useBotlit as t } from "../providers/BotlitProvider.js";
|
|
3
|
+
import { PageLayout as n } from "../components/PageLayout.js";
|
|
4
|
+
import { BOTMANOR_PERMISSIONS as r } from "../permissions/botmanorPermissions.js";
|
|
5
|
+
import { BotmanorPermissionGate as ee } from "../permissions/useBotmanorPermissions.js";
|
|
6
|
+
import { Card as i, CardContent as te, CardHeader as a } from "../components/Card.js";
|
|
7
|
+
import { Button as o } from "../components/Button.js";
|
|
8
|
+
import { Input as s } from "../components/Input.js";
|
|
9
|
+
import { Badge as c, StatusBadge as l } from "../components/Badge.js";
|
|
10
|
+
import { EmptyState as u } from "../components/EmptyState.js";
|
|
11
|
+
import { ErrorState as d } from "../components/ErrorState.js";
|
|
12
|
+
import { LoadMore as f } from "../components/LoadMore.js";
|
|
11
13
|
import "../hooks/index.js";
|
|
12
|
-
import { formatRelativeTime as
|
|
13
|
-
import { promptTemplateVariables as
|
|
14
|
+
import { formatRelativeTime as p } from "../utils/formatters.js";
|
|
15
|
+
import { promptTemplateVariables as m, usePagedPromptTemplates as h } from "../hooks/usePromptTemplates.js";
|
|
14
16
|
import "../permissions/index.js";
|
|
15
|
-
import { useState as
|
|
16
|
-
import { GlassCard as
|
|
17
|
-
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
18
|
-
import { Link as
|
|
19
|
-
import { Code as
|
|
17
|
+
import { useEffect as g, useState as _ } from "react";
|
|
18
|
+
import { GlassCard as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
19
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
20
|
+
import { Link as ne } from "react-router";
|
|
21
|
+
import { Code as C, FileText as w, Plus as T, Search as E, Tag as D, Variable as O } from "lucide-react";
|
|
20
22
|
// src/botlit/pages/PromptTemplatesPage.tsx
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
var k = 300, A = "h-10 rounded-md border border-border-default bg-bg-surface px-3 text-sm text-text-primary", j = [
|
|
24
|
+
"DRAFT",
|
|
25
|
+
"ACTIVE",
|
|
26
|
+
"DEPRECATED",
|
|
27
|
+
"ARCHIVED"
|
|
28
|
+
], M = [
|
|
29
|
+
"PRIVATE",
|
|
30
|
+
"WORKSPACE",
|
|
31
|
+
"PUBLIC"
|
|
32
|
+
], N = () => {
|
|
33
|
+
let N = e(), { getPath: P, navigateTo: F } = t(), [I, L] = _(""), [R, z] = _(""), [B, V] = _(""), [H, U] = _("");
|
|
34
|
+
g(() => {
|
|
35
|
+
let e = window.setTimeout(() => z(I.trim()), k);
|
|
36
|
+
return () => window.clearTimeout(e);
|
|
37
|
+
}, [I]);
|
|
38
|
+
let { data: W, loading: G, error: K, refetch: q, hasMore: J, loadingMore: Y, loadMore: X } = h({
|
|
39
|
+
search: R,
|
|
40
|
+
status: B,
|
|
41
|
+
visibility: H
|
|
42
|
+
}), Z = R !== "" || B !== "" || H !== "", Q = () => {
|
|
43
|
+
L(""), z(""), V(""), U("");
|
|
44
|
+
}, re = (e) => N(`botlit.promptTemplates.status.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()), ie = (e) => N(`botlit.promptTemplates.visibility.${e.toLowerCase()}`, e.charAt(0) + e.slice(1).toLowerCase()), $ = /* @__PURE__ */ x(ee, {
|
|
45
|
+
permission: r.PROMPT_TEMPLATE_CREATE,
|
|
46
|
+
children: /* @__PURE__ */ x(o, {
|
|
47
|
+
leftIcon: /* @__PURE__ */ x(T, { size: 16 }),
|
|
48
|
+
onClick: () => F("prompt-templates/new"),
|
|
49
|
+
children: N("botlit.promptTemplates.create", "Create Template")
|
|
50
|
+
})
|
|
51
|
+
}), ae = G || !!K || W.length > 0 || Z;
|
|
52
|
+
return /* @__PURE__ */ x(n, {
|
|
53
|
+
title: N("botlit.promptTemplates.title", "Prompt Templates"),
|
|
54
|
+
description: N("botlit.promptTemplates.description", "Reusable prompts with variables that agents and skills are built from"),
|
|
55
|
+
actions: ae ? $ : void 0,
|
|
36
56
|
children: /* @__PURE__ */ S("div", {
|
|
37
57
|
className: "space-y-6",
|
|
38
58
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
icon: /* @__PURE__ */ x(
|
|
41
|
-
children:
|
|
42
|
-
"Prompt templates are the reusable instructions that shape how an agent thinks and replies. Write the system prompt once with ",
|
|
43
|
-
/* @__PURE__ */ x("code", { children: "{{variables}}" }),
|
|
44
|
-
" for the bits that change (role, company name, tone), version it, and reuse it across agents — so you can refine wording in one place instead of editing every agent by hand."
|
|
45
|
-
]
|
|
59
|
+
/* @__PURE__ */ x(y, {
|
|
60
|
+
icon: /* @__PURE__ */ x(w, { size: 18 }),
|
|
61
|
+
children: N("botlit.promptTemplates.purpose", "A prompt template is reusable instruction text with {{variables}} for the parts that change (role, company name, tone). Bind a template to an agent on its Prompt & skills tab, or give it to a skill. Every agent that uses a template picks up an edit at its next run, so wording is refined in one place. Prompt Studio runs a template against a model and saves new versions with their history.", { variables: "{{variables}}" })
|
|
46
62
|
}),
|
|
47
63
|
/* @__PURE__ */ S("div", {
|
|
48
|
-
className: "flex items-center gap-
|
|
49
|
-
children: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
className: "flex flex-wrap items-center gap-3",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ S("div", {
|
|
67
|
+
className: "relative min-w-48 max-w-md flex-1",
|
|
68
|
+
children: [/* @__PURE__ */ x(E, {
|
|
69
|
+
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary",
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
}), /* @__PURE__ */ x(s, {
|
|
72
|
+
type: "search",
|
|
73
|
+
"aria-label": N("botlit.promptTemplates.search.label", "Search templates"),
|
|
74
|
+
placeholder: N("botlit.promptTemplates.search.placeholder", "Search templates..."),
|
|
75
|
+
value: I,
|
|
76
|
+
onChange: (e) => L(e.target.value),
|
|
77
|
+
className: "pl-9"
|
|
78
|
+
})]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ S("label", {
|
|
81
|
+
className: "flex items-center gap-2 text-sm",
|
|
82
|
+
children: [/* @__PURE__ */ x("span", {
|
|
83
|
+
className: "text-text-secondary",
|
|
84
|
+
children: N("botlit.promptTemplates.filter.status", "Status")
|
|
85
|
+
}), /* @__PURE__ */ S("select", {
|
|
86
|
+
className: A,
|
|
87
|
+
value: B,
|
|
88
|
+
onChange: (e) => V(e.target.value),
|
|
89
|
+
children: [/* @__PURE__ */ x("option", {
|
|
90
|
+
value: "",
|
|
91
|
+
children: N("botlit.promptTemplates.filter.allStatuses", "All statuses")
|
|
92
|
+
}), j.map((e) => /* @__PURE__ */ x("option", {
|
|
93
|
+
value: e,
|
|
94
|
+
children: re(e)
|
|
95
|
+
}, e))]
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ S("label", {
|
|
99
|
+
className: "flex items-center gap-2 text-sm",
|
|
100
|
+
children: [/* @__PURE__ */ x("span", {
|
|
101
|
+
className: "text-text-secondary",
|
|
102
|
+
children: N("botlit.promptTemplates.filter.visibility", "Visibility")
|
|
103
|
+
}), /* @__PURE__ */ S("select", {
|
|
104
|
+
className: A,
|
|
105
|
+
value: H,
|
|
106
|
+
onChange: (e) => U(e.target.value),
|
|
107
|
+
children: [/* @__PURE__ */ x("option", {
|
|
108
|
+
value: "",
|
|
109
|
+
children: N("botlit.promptTemplates.filter.allVisibilities", "Any visibility")
|
|
110
|
+
}), M.map((e) => /* @__PURE__ */ x("option", {
|
|
111
|
+
value: e,
|
|
112
|
+
children: ie(e)
|
|
113
|
+
}, e))]
|
|
114
|
+
})]
|
|
115
|
+
}),
|
|
116
|
+
Z && /* @__PURE__ */ x(o, {
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
onClick: Q,
|
|
119
|
+
children: N("botlit.promptTemplates.filter.clear", "Clear filters")
|
|
120
|
+
})
|
|
121
|
+
]
|
|
62
122
|
}),
|
|
63
|
-
|
|
123
|
+
G ? /* @__PURE__ */ x("div", {
|
|
124
|
+
role: "status",
|
|
125
|
+
"aria-busy": "true",
|
|
126
|
+
"aria-label": N("botlit.common.loading", "Loading"),
|
|
64
127
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
65
128
|
children: [
|
|
66
129
|
1,
|
|
@@ -70,209 +133,165 @@ var N = () => {
|
|
|
70
133
|
5,
|
|
71
134
|
6
|
|
72
135
|
].map((e) => /* @__PURE__ */ x("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
|
|
73
|
-
}) :
|
|
74
|
-
resource: "prompt templates",
|
|
75
|
-
error:
|
|
76
|
-
onRetry: () => void
|
|
77
|
-
}) :
|
|
136
|
+
}) : K ? /* @__PURE__ */ x(d, {
|
|
137
|
+
resource: N("botlit.promptTemplates.resource", "prompt templates"),
|
|
138
|
+
error: K,
|
|
139
|
+
onRetry: () => void q()
|
|
140
|
+
}) : W.length > 0 ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("ul", {
|
|
78
141
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
79
|
-
children:
|
|
80
|
-
let t =
|
|
81
|
-
return /* @__PURE__ */ x(
|
|
82
|
-
|
|
83
|
-
children: /* @__PURE__ */ S(
|
|
84
|
-
className: "
|
|
85
|
-
children: [/* @__PURE__ */
|
|
86
|
-
className: "flex items-
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
-
className: "
|
|
89
|
-
children:
|
|
90
|
-
className: "
|
|
91
|
-
|
|
92
|
-
}), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x(c, {
|
|
93
|
-
className: "text-base",
|
|
94
|
-
children: e.name
|
|
95
|
-
}), /* @__PURE__ */ x(o, {
|
|
96
|
-
className: "text-xs",
|
|
97
|
-
children: e.slug
|
|
98
|
-
})] })]
|
|
99
|
-
}), /* @__PURE__ */ x(f, { status: e.status })]
|
|
100
|
-
}) }), /* @__PURE__ */ x(a, { children: /* @__PURE__ */ S("div", {
|
|
101
|
-
className: "space-y-3",
|
|
102
|
-
children: [
|
|
103
|
-
/* @__PURE__ */ x("p", {
|
|
104
|
-
className: "text-sm text-text-secondary line-clamp-2",
|
|
105
|
-
children: e.description
|
|
106
|
-
}),
|
|
107
|
-
/* @__PURE__ */ S("div", {
|
|
108
|
-
className: "flex items-center gap-2",
|
|
109
|
-
children: [/* @__PURE__ */ x(M, {
|
|
110
|
-
size: 14,
|
|
111
|
-
className: "text-text-secondary"
|
|
112
|
-
}), /* @__PURE__ */ S("span", {
|
|
113
|
-
className: "text-sm",
|
|
114
|
-
children: [
|
|
115
|
-
t,
|
|
116
|
-
" variable",
|
|
117
|
-
t === 1 ? "" : "s"
|
|
118
|
-
]
|
|
119
|
-
})]
|
|
120
|
-
}),
|
|
121
|
-
/* @__PURE__ */ S("div", {
|
|
122
|
-
className: "flex items-center gap-2",
|
|
123
|
-
children: [/* @__PURE__ */ x(j, {
|
|
124
|
-
size: 14,
|
|
125
|
-
className: "text-text-secondary"
|
|
126
|
-
}), /* @__PURE__ */ S("span", {
|
|
127
|
-
className: "text-sm",
|
|
128
|
-
children: ["v", e.version]
|
|
129
|
-
})]
|
|
130
|
-
}),
|
|
131
|
-
/* @__PURE__ */ S("div", {
|
|
132
|
-
className: "pt-3 border-t border-border-subtle flex items-center justify-between",
|
|
133
|
-
children: [/* @__PURE__ */ x("span", {
|
|
134
|
-
className: "text-xs text-text-secondary",
|
|
135
|
-
children: h(e.createdAt)
|
|
136
|
-
}), /* @__PURE__ */ S("div", {
|
|
137
|
-
className: "flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
138
|
-
children: [/* @__PURE__ */ x(r, {
|
|
139
|
-
permission: n.PROMPT_TEMPLATE_CREATE,
|
|
140
|
-
children: /* @__PURE__ */ x(l, {
|
|
141
|
-
variant: "ghost",
|
|
142
|
-
size: "icon",
|
|
143
|
-
className: "h-7 w-7",
|
|
144
|
-
onClick: (e) => e.preventDefault(),
|
|
145
|
-
children: /* @__PURE__ */ x(T, { size: 14 })
|
|
146
|
-
})
|
|
147
|
-
}), /* @__PURE__ */ x(r, {
|
|
148
|
-
permission: n.PROMPT_TEMPLATE_EXECUTE,
|
|
149
|
-
children: /* @__PURE__ */ x(l, {
|
|
150
|
-
variant: "ghost",
|
|
151
|
-
size: "icon",
|
|
152
|
-
className: "h-7 w-7",
|
|
153
|
-
onClick: (e) => e.preventDefault(),
|
|
154
|
-
children: /* @__PURE__ */ x(O, { size: 14 })
|
|
155
|
-
})
|
|
156
|
-
})]
|
|
157
|
-
})]
|
|
142
|
+
children: W.map((e) => {
|
|
143
|
+
let t = m(e).length;
|
|
144
|
+
return /* @__PURE__ */ x("li", { children: /* @__PURE__ */ S(i, {
|
|
145
|
+
className: "h-full hover:border-primary/50 transition-colors",
|
|
146
|
+
children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ S("div", {
|
|
147
|
+
className: "flex items-start justify-between gap-3",
|
|
148
|
+
children: [/* @__PURE__ */ S("div", {
|
|
149
|
+
className: "flex min-w-0 items-center gap-3",
|
|
150
|
+
children: [/* @__PURE__ */ x("div", {
|
|
151
|
+
className: "p-2 bg-action-primary-bg/10 rounded-lg",
|
|
152
|
+
children: /* @__PURE__ */ x(w, {
|
|
153
|
+
className: "h-5 w-5 text-primary",
|
|
154
|
+
"aria-hidden": "true"
|
|
158
155
|
})
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
})
|
|
176
|
-
})
|
|
177
|
-
})
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ S(y, {
|
|
180
|
-
treatment: "glass",
|
|
181
|
-
glow: !0,
|
|
182
|
-
className: "p-6",
|
|
183
|
-
children: [
|
|
184
|
-
/* @__PURE__ */ S("div", {
|
|
185
|
-
className: "mb-4",
|
|
186
|
-
children: [/* @__PURE__ */ S("h2", {
|
|
187
|
-
className: "flex items-center gap-2 text-lg font-semibold tracking-tight text-text-primary",
|
|
188
|
-
children: [/* @__PURE__ */ x(w, { size: 18 }), "Template Syntax"]
|
|
189
|
-
}), /* @__PURE__ */ x("p", {
|
|
190
|
-
className: "text-sm text-text-secondary",
|
|
191
|
-
children: "Use variables in your prompts with double curly braces"
|
|
192
|
-
})]
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ S("div", {
|
|
195
|
-
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
196
|
-
children: [/* @__PURE__ */ S("div", {
|
|
156
|
+
}), /* @__PURE__ */ S("div", {
|
|
157
|
+
className: "min-w-0",
|
|
158
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
159
|
+
className: "truncate text-base font-semibold text-text-primary",
|
|
160
|
+
children: /* @__PURE__ */ x(ne, {
|
|
161
|
+
to: P(`prompt-templates/${e.id}`),
|
|
162
|
+
className: "hover:underline focus-visible:underline",
|
|
163
|
+
children: e.name
|
|
164
|
+
})
|
|
165
|
+
}), /* @__PURE__ */ x("p", {
|
|
166
|
+
className: "truncate font-mono text-xs text-text-secondary",
|
|
167
|
+
children: e.slug
|
|
168
|
+
})]
|
|
169
|
+
})]
|
|
170
|
+
}), /* @__PURE__ */ x(l, { status: e.status })]
|
|
171
|
+
}) }), /* @__PURE__ */ x(te, { children: /* @__PURE__ */ S("div", {
|
|
197
172
|
className: "space-y-3",
|
|
198
173
|
children: [
|
|
199
|
-
/* @__PURE__ */ x("
|
|
200
|
-
className: "
|
|
201
|
-
children:
|
|
174
|
+
e.description && /* @__PURE__ */ x("p", {
|
|
175
|
+
className: "text-sm text-text-secondary line-clamp-2",
|
|
176
|
+
children: e.description
|
|
202
177
|
}),
|
|
203
178
|
/* @__PURE__ */ S("div", {
|
|
204
|
-
className: "
|
|
205
|
-
children: [/* @__PURE__ */ x(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
179
|
+
className: "flex items-center gap-2 text-sm",
|
|
180
|
+
children: [/* @__PURE__ */ x(O, {
|
|
181
|
+
size: 14,
|
|
182
|
+
className: "text-text-secondary",
|
|
183
|
+
"aria-hidden": "true"
|
|
184
|
+
}), /* @__PURE__ */ x("span", { children: t === 1 ? N("botlit.promptTemplates.card.variable", "1 variable") : N("botlit.promptTemplates.card.variables", "{{count}} variables", { count: t }) })]
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ S("div", {
|
|
187
|
+
className: "flex items-center gap-2 text-sm",
|
|
188
|
+
children: [/* @__PURE__ */ x(D, {
|
|
189
|
+
size: 14,
|
|
190
|
+
className: "text-text-secondary",
|
|
191
|
+
"aria-hidden": "true"
|
|
192
|
+
}), /* @__PURE__ */ x("span", { children: N("botlit.promptTemplates.card.version", "v{{version}} · revision {{revision}}", {
|
|
193
|
+
version: e.version,
|
|
194
|
+
revision: e.revision
|
|
195
|
+
}) })]
|
|
209
196
|
}),
|
|
210
|
-
/* @__PURE__ */ x("
|
|
211
|
-
className: "
|
|
212
|
-
children:
|
|
197
|
+
/* @__PURE__ */ x("div", {
|
|
198
|
+
className: "pt-3 border-t border-border-subtle",
|
|
199
|
+
children: /* @__PURE__ */ x("span", {
|
|
200
|
+
className: "text-xs text-text-secondary",
|
|
201
|
+
children: N("botlit.promptTemplates.card.updated", "Updated {{when}}", { when: p(e.updatedAt) })
|
|
202
|
+
})
|
|
213
203
|
})
|
|
214
204
|
]
|
|
215
|
-
})
|
|
216
|
-
|
|
217
|
-
|
|
205
|
+
}) })]
|
|
206
|
+
}) }, e.id);
|
|
207
|
+
})
|
|
208
|
+
}), /* @__PURE__ */ x(f, {
|
|
209
|
+
hasMore: J,
|
|
210
|
+
loadingMore: Y,
|
|
211
|
+
onLoadMore: () => void X(),
|
|
212
|
+
loadedCount: W.length
|
|
213
|
+
})] }) : Z ? /* @__PURE__ */ x(u, {
|
|
214
|
+
illustration: "empty-search",
|
|
215
|
+
title: R ? N("botlit.promptTemplates.noResults.title", "No templates match \"{{query}}\"", { query: R }) : N("botlit.promptTemplates.noResults.titleFiltered", "No templates match these filters"),
|
|
216
|
+
description: N("botlit.promptTemplates.noResults.description", "Try another search or clear the filters."),
|
|
217
|
+
action: /* @__PURE__ */ x(o, {
|
|
218
|
+
variant: "outline",
|
|
219
|
+
onClick: Q,
|
|
220
|
+
children: N("botlit.promptTemplates.filter.clear", "Clear filters")
|
|
221
|
+
})
|
|
222
|
+
}) : /* @__PURE__ */ x(u, {
|
|
223
|
+
illustration: "empty-files",
|
|
224
|
+
title: N("botlit.promptTemplates.empty.title", "No prompt templates yet"),
|
|
225
|
+
description: N("botlit.promptTemplates.empty.description", "Create a reusable prompt with variables, then bind it to agents or skills."),
|
|
226
|
+
action: $
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ S(v, {
|
|
229
|
+
treatment: "glass",
|
|
230
|
+
className: "p-6",
|
|
231
|
+
children: [/* @__PURE__ */ S("div", {
|
|
232
|
+
className: "mb-4",
|
|
233
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
234
|
+
className: "flex items-center gap-2 text-lg font-semibold tracking-tight text-text-primary",
|
|
235
|
+
children: [/* @__PURE__ */ x(C, {
|
|
236
|
+
size: 18,
|
|
237
|
+
"aria-hidden": "true"
|
|
238
|
+
}), N("botlit.promptTemplates.guide.title", "Template syntax")]
|
|
239
|
+
}), /* @__PURE__ */ x("p", {
|
|
240
|
+
className: "text-sm text-text-secondary",
|
|
241
|
+
children: N("botlit.promptTemplates.guide.description", "Use variables in your prompts with double curly braces")
|
|
242
|
+
})]
|
|
243
|
+
}), /* @__PURE__ */ S("div", {
|
|
244
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
245
|
+
children: [/* @__PURE__ */ S("div", {
|
|
246
|
+
className: "space-y-3",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ x("h3", {
|
|
218
249
|
className: "font-medium",
|
|
219
|
-
children: "Variable
|
|
220
|
-
}),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}),
|
|
245
|
-
/* @__PURE__ */ S("li", {
|
|
246
|
-
className: "flex items-start gap-2",
|
|
247
|
-
children: [/* @__PURE__ */ x(d, {
|
|
248
|
-
variant: "outline",
|
|
249
|
-
className: "mt-0.5",
|
|
250
|
-
children: "object"
|
|
251
|
-
}), /* @__PURE__ */ x("span", {
|
|
252
|
-
className: "text-text-secondary",
|
|
253
|
-
children: "Structured data (JSON)"
|
|
254
|
-
})]
|
|
255
|
-
})
|
|
256
|
-
]
|
|
257
|
-
})]
|
|
258
|
-
})]
|
|
259
|
-
}),
|
|
260
|
-
/* @__PURE__ */ S("div", {
|
|
261
|
-
className: "mt-6 p-4 bg-bg-sunken/50 rounded-lg",
|
|
262
|
-
children: [/* @__PURE__ */ x("h4", {
|
|
263
|
-
className: "font-medium mb-2",
|
|
264
|
-
children: "Best Practices"
|
|
265
|
-
}), /* @__PURE__ */ S("ul", {
|
|
266
|
-
className: "text-sm text-text-secondary space-y-1",
|
|
250
|
+
children: N("botlit.promptTemplates.guide.syntax", "Variable syntax")
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ S("div", {
|
|
253
|
+
className: "bg-bg-sunken p-4 rounded-lg font-mono text-sm",
|
|
254
|
+
children: [/* @__PURE__ */ x("p", { children: "You are a {{role}} for {{company_name}}." }), /* @__PURE__ */ x("p", {
|
|
255
|
+
className: "mt-2",
|
|
256
|
+
children: "Guidelines: {{ guidelines }}"
|
|
257
|
+
})]
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ x("p", {
|
|
260
|
+
className: "text-sm text-text-secondary",
|
|
261
|
+
children: N("botlit.promptTemplates.guide.syntaxHelp", "Both {{name}} and {{ name }} work. Values come from the agent binding, a skill, or Prompt Studio, and are inserted once: a value that itself contains {{braces}} is kept as written.", {
|
|
262
|
+
name: "{{name}}",
|
|
263
|
+
spaced: "{{ name }}",
|
|
264
|
+
braces: "{{braces}}"
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}), /* @__PURE__ */ S("div", {
|
|
269
|
+
className: "space-y-3",
|
|
270
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
271
|
+
className: "font-medium",
|
|
272
|
+
children: N("botlit.promptTemplates.guide.types", "Variable types")
|
|
273
|
+
}), /* @__PURE__ */ x("ul", {
|
|
274
|
+
className: "text-sm space-y-2",
|
|
267
275
|
children: [
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
["string", "Text, inserted as written"],
|
|
277
|
+
["number", "A number, checked before the prompt is built"],
|
|
278
|
+
["boolean", "true or false"],
|
|
279
|
+
["array", "A JSON list, inserted as JSON"],
|
|
280
|
+
["object", "A JSON object, inserted as JSON"]
|
|
281
|
+
].map(([e, t]) => /* @__PURE__ */ S("li", {
|
|
282
|
+
className: "flex items-start gap-2",
|
|
283
|
+
children: [/* @__PURE__ */ x(c, {
|
|
284
|
+
variant: "outline",
|
|
285
|
+
className: "mt-0.5 font-mono",
|
|
286
|
+
children: e
|
|
287
|
+
}), /* @__PURE__ */ x("span", {
|
|
288
|
+
className: "text-text-secondary",
|
|
289
|
+
children: N(`botlit.promptTemplates.guide.type.${e}`, t)
|
|
290
|
+
})]
|
|
291
|
+
}, e))
|
|
273
292
|
})]
|
|
274
|
-
})
|
|
275
|
-
]
|
|
293
|
+
})]
|
|
294
|
+
})]
|
|
276
295
|
})
|
|
277
296
|
]
|
|
278
297
|
})
|