@burdenoff/microfe-botmanor 2026.1118.5 → 2026.1118.7

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 (46) hide show
  1. package/dist/botlit/components/AgentBindingsPanel.d.ts +4 -0
  2. package/dist/botlit/components/AgentBindingsPanel.js +305 -0
  3. package/dist/botlit/components/AgentBindingsPanel.js.map +1 -0
  4. package/dist/botlit/components/ChannelSetupPanels.d.ts +21 -0
  5. package/dist/botlit/components/ChannelSetupPanels.js +139 -0
  6. package/dist/botlit/components/ChannelSetupPanels.js.map +1 -0
  7. package/dist/botlit/hooks/index.d.ts +5 -1
  8. package/dist/botlit/hooks/index.js +14 -12
  9. package/dist/botlit/hooks/useAgentBindings.d.ts +58 -0
  10. package/dist/botlit/hooks/useAgentBindings.js +87 -0
  11. package/dist/botlit/hooks/useAgentBindings.js.map +1 -0
  12. package/dist/botlit/hooks/useChannelSetup.d.ts +96 -0
  13. package/dist/botlit/hooks/useChannelSetup.js +199 -0
  14. package/dist/botlit/hooks/useChannelSetup.js.map +1 -0
  15. package/dist/botlit/hooks/useChannels.d.ts +6 -0
  16. package/dist/botlit/hooks/useChannels.js +80 -58
  17. package/dist/botlit/hooks/useChannels.js.map +1 -1
  18. package/dist/botlit/hooks/useUserPlatformConnection.d.ts +1 -0
  19. package/dist/botlit/hooks/useUserPlatformConnection.js +1 -0
  20. package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -1
  21. package/dist/botlit/pages/AgentDetailPage.js +56 -55
  22. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  23. package/dist/botlit/pages/BotChannelsTab.js +204 -186
  24. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  25. package/dist/botlit/pages/ChannelDetailPage.js +658 -526
  26. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  27. package/dist/botlit/pages/ChannelsPage.js +2 -1
  28. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  29. package/dist/botlit/pages/PromptStudioPage.js +365 -175
  30. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  31. package/dist/botlit/providers/BotlitProvider.js +39 -35
  32. package/dist/botlit/providers/BotlitProvider.js.map +1 -1
  33. package/dist/botlit/types/index.d.ts +2 -0
  34. package/dist/botlit/utils/channelConnectors.d.ts +16 -0
  35. package/dist/botlit/utils/channelConnectors.js +24 -0
  36. package/dist/botlit/utils/channelConnectors.js.map +1 -0
  37. package/dist/botlit/utils/promptVariables.d.ts +6 -0
  38. package/dist/botlit/utils/promptVariables.js +20 -0
  39. package/dist/botlit/utils/promptVariables.js.map +1 -0
  40. package/dist/generated/wspace-operations.d.ts +314 -0
  41. package/dist/generated/wspace-operations.js +189 -101
  42. package/dist/generated/wspace-operations.js.map +1 -1
  43. package/dist/generated/wspace-types.d.ts +139 -0
  44. package/dist/generated/wspace-types.js +3 -1
  45. package/dist/generated/wspace-types.js.map +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ export declare const AgentBindingsPanel: FC<{
3
+ agentId: string;
4
+ }>;
@@ -0,0 +1,305 @@
1
+ import { Card as e, CardContent as t, CardDescription as n, CardHeader as r, CardTitle as i } from "./Card.js";
2
+ import { BOTMANOR_PERMISSIONS as a } from "../permissions/botmanorPermissions.js";
3
+ import { useBotmanorCan as o } from "../permissions/useBotmanorPermissions.js";
4
+ import { Button as s } from "./Button.js";
5
+ import { Input as ee } from "./Input.js";
6
+ import { Badge as c } from "./Badge.js";
7
+ import "../hooks/index.js";
8
+ import { graphqlErrorMessage as l } from "../utils/errors.js";
9
+ import { useRetrievalProfiles as u } from "../hooks/useRetrievalProfiles.js";
10
+ import { useSkills as d } from "../hooks/useSkills.js";
11
+ import { promptTemplateVariables as f, usePromptTemplate as p, usePromptTemplates as m } from "../hooks/usePromptTemplates.js";
12
+ import { useAgentBindings as h, useSetAgentBindings as g } from "../hooks/useAgentBindings.js";
13
+ import { typedVariableValue as _ } from "../utils/promptVariables.js";
14
+ import "../permissions/index.js";
15
+ import { useEffect as v, useMemo as y, useState as b } from "react";
16
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
17
+ import { ArrowDown as C, ArrowUp as te, Layers as w } from "lucide-react";
18
+ import { toast as T } from "sonner";
19
+ // src/botlit/components/AgentBindingsPanel.tsx
20
+ var E = "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm";
21
+ function D(e) {
22
+ let t = e?.promptTemplate?.variables;
23
+ return t && typeof t == "object" && !Array.isArray(t) ? t : {};
24
+ }
25
+ function O(e) {
26
+ let t = {};
27
+ for (let [n, r] of Object.entries(D(e))) t[n] = typeof r == "string" ? r : JSON.stringify(r);
28
+ return {
29
+ promptTemplateId: e?.promptTemplate?.promptTemplateId ?? "",
30
+ variables: t,
31
+ edited: [],
32
+ skillIds: [...e?.skills ?? []].sort((e, t) => e.position - t.position).map((e) => e.skillId),
33
+ retrievalProfileId: e?.retrievalProfile?.retrievalProfileId ?? ""
34
+ };
35
+ }
36
+ var k = (e) => e !== "ARCHIVED", A = ({ agentId: A }) => {
37
+ let j = o(), [M, N] = b(!1), P = j(a.AGENT_UPDATE), F = h(A), I = P && !M && !!F.data && !F.loading, L = m(), R = d(), z = u(), { save: B } = g(A), [V, H] = b(() => O(null)), U = p(V.promptTemplateId || void 0), W = U.data && U.data.id === V.promptTemplateId ? U.data : null, G = !!V.promptTemplateId && !U.loading && !!U.data && U.data?.id !== V.promptTemplateId, { refetch: K } = U;
38
+ v(() => {
39
+ G && K();
40
+ }, [G, K]);
41
+ let q = !!F.data && (!V.promptTemplateId || W !== null && !U.loading) && !F.loading && !F.error && !L.loading && !L.error && !R.loading && !R.error && !z.loading && !z.error;
42
+ v(() => {
43
+ H(O(F.data));
44
+ }, [F.data]);
45
+ let J = y(() => W ? f(W) : [], [W]), Y = F.data?.retrievalProfile, X = V.retrievalProfileId ? z.data.find((e) => e.id === V.retrievalProfileId) ?? (Y?.retrievalProfileId === V.retrievalProfileId ? Y : null) : null, Z = y(() => new Map(R.data.map((e) => [e.id, e])), [R.data]), Q = R.data.filter((e) => k(e.status) && !V.skillIds.includes(e.id)), $ = (e, t) => {
46
+ let n = [...V.skillIds], r = e + t;
47
+ r < 0 || r >= n.length || ([n[e], n[r]] = [n[r], n[e]], H({
48
+ ...V,
49
+ skillIds: n
50
+ }));
51
+ }, ne = async () => {
52
+ let e = F.data?.promptTemplate?.promptTemplateId ?? "", t = V.promptTemplateId !== e, n = t ? {} : D(F.data), r = {};
53
+ for (let e of J) {
54
+ let t = V.variables[e.name] ?? "";
55
+ !V.edited.includes(e.name) && e.name in n ? r[e.name] = n[e.name] : t !== "" && (r[e.name] = _(e.type, t));
56
+ }
57
+ let i = !!V.promptTemplateId && (t || V.edited.length > 0);
58
+ N(!0);
59
+ try {
60
+ await B({
61
+ promptTemplateId: V.promptTemplateId || null,
62
+ ...i ? { promptVariables: r } : {},
63
+ skillIds: V.skillIds,
64
+ retrievalProfileId: V.retrievalProfileId || null
65
+ }), T.success("Agent bindings saved"), await F.refetch();
66
+ } catch (e) {
67
+ T.error(l(e, "Failed to save the agent bindings"));
68
+ } finally {
69
+ N(!1);
70
+ }
71
+ };
72
+ return /* @__PURE__ */ S(e, { children: [/* @__PURE__ */ S(r, { children: [/* @__PURE__ */ S(i, {
73
+ className: "flex items-center gap-2",
74
+ children: [/* @__PURE__ */ x(w, { size: 18 }), "Prompt template, skills & retrieval"]
75
+ }), /* @__PURE__ */ x(n, { children: "Every run of this agent starts from the bound prompt template, adds the agent's own system prompt and the skills below, and searches its knowledge with the retrieval profile." })] }), /* @__PURE__ */ S(t, {
76
+ className: "space-y-6",
77
+ children: [
78
+ F.error && /* @__PURE__ */ x("p", {
79
+ role: "alert",
80
+ className: "text-sm text-status-error-text",
81
+ children: l(F.error, "Failed to load the agent bindings")
82
+ }),
83
+ /* @__PURE__ */ S("section", {
84
+ className: "space-y-3",
85
+ children: [/* @__PURE__ */ S("label", {
86
+ className: "grid gap-2 text-sm font-medium",
87
+ children: ["Prompt template", /* @__PURE__ */ S("select", {
88
+ "aria-label": "Prompt template",
89
+ className: E,
90
+ value: V.promptTemplateId,
91
+ disabled: !I,
92
+ onChange: (e) => H({
93
+ ...V,
94
+ promptTemplateId: e.target.value,
95
+ variables: {},
96
+ edited: []
97
+ }),
98
+ children: [
99
+ /* @__PURE__ */ x("option", {
100
+ value: "",
101
+ children: "No prompt template"
102
+ }),
103
+ W && !L.data.some((e) => e.id === W.id) && /* @__PURE__ */ S("option", {
104
+ value: W.id,
105
+ children: [
106
+ W.name,
107
+ " · v",
108
+ W.version
109
+ ]
110
+ }),
111
+ L.data.filter((e) => k(e.status) || e.id === V.promptTemplateId).map((e) => /* @__PURE__ */ S("option", {
112
+ value: e.id,
113
+ children: [
114
+ e.name,
115
+ " · v",
116
+ e.version
117
+ ]
118
+ }, e.id))
119
+ ]
120
+ })]
121
+ }), J.length > 0 && /* @__PURE__ */ x("div", {
122
+ className: "grid gap-3 sm:grid-cols-2",
123
+ children: J.map((e) => /* @__PURE__ */ S("label", {
124
+ className: "grid gap-1 text-sm",
125
+ children: [/* @__PURE__ */ S("span", { children: [`{{${e.name}}}`, e.required && /* @__PURE__ */ x("span", {
126
+ className: "ml-1 text-status-error-text",
127
+ children: "*"
128
+ })] }), /* @__PURE__ */ x(ee, {
129
+ "aria-label": `Variable ${e.name}`,
130
+ disabled: !I,
131
+ placeholder: typeof e.defaultValue == "string" ? `Default: ${e.defaultValue}` : e.description ?? e.type,
132
+ value: V.variables[e.name] ?? "",
133
+ onChange: (t) => H({
134
+ ...V,
135
+ variables: {
136
+ ...V.variables,
137
+ [e.name]: t.target.value
138
+ },
139
+ edited: V.edited.includes(e.name) ? V.edited : [...V.edited, e.name]
140
+ })
141
+ })]
142
+ }, e.name))
143
+ })]
144
+ }),
145
+ /* @__PURE__ */ S("section", {
146
+ className: "space-y-3",
147
+ children: [
148
+ /* @__PURE__ */ x("p", {
149
+ className: "text-sm font-medium",
150
+ children: "Skills"
151
+ }),
152
+ V.skillIds.length === 0 ? /* @__PURE__ */ x("p", {
153
+ className: "text-sm text-text-secondary",
154
+ children: "No skills attached."
155
+ }) : /* @__PURE__ */ x("ol", {
156
+ className: "space-y-2",
157
+ children: V.skillIds.map((e, t) => {
158
+ let n = Z.get(e);
159
+ return /* @__PURE__ */ S("li", {
160
+ className: "flex items-center gap-3 rounded-lg border border-border-subtle p-3",
161
+ children: [
162
+ /* @__PURE__ */ S(c, {
163
+ variant: "outline",
164
+ children: ["#", t + 1]
165
+ }),
166
+ /* @__PURE__ */ S("div", {
167
+ className: "min-w-0 flex-1",
168
+ children: [/* @__PURE__ */ x("p", {
169
+ className: "truncate text-sm font-medium",
170
+ children: n?.name ?? F.data?.skills.find((t) => t.skillId === e)?.name ?? e
171
+ }), n?.description && /* @__PURE__ */ x("p", {
172
+ className: "truncate text-xs text-text-secondary",
173
+ children: n.description
174
+ })]
175
+ }),
176
+ I && /* @__PURE__ */ S("div", {
177
+ className: "flex items-center gap-1",
178
+ children: [
179
+ /* @__PURE__ */ x(s, {
180
+ size: "sm",
181
+ variant: "ghost",
182
+ "aria-label": "Move skill up",
183
+ onClick: () => $(t, -1),
184
+ children: /* @__PURE__ */ x(te, { size: 14 })
185
+ }),
186
+ /* @__PURE__ */ x(s, {
187
+ size: "sm",
188
+ variant: "ghost",
189
+ "aria-label": "Move skill down",
190
+ onClick: () => $(t, 1),
191
+ children: /* @__PURE__ */ x(C, { size: 14 })
192
+ }),
193
+ /* @__PURE__ */ x(s, {
194
+ size: "sm",
195
+ variant: "outline",
196
+ onClick: () => H({
197
+ ...V,
198
+ skillIds: V.skillIds.filter((t) => t !== e)
199
+ }),
200
+ children: "Remove"
201
+ })
202
+ ]
203
+ })
204
+ ]
205
+ }, e);
206
+ })
207
+ }),
208
+ I && Q.length > 0 && /* @__PURE__ */ S("select", {
209
+ "aria-label": "Add skill",
210
+ className: E,
211
+ value: "",
212
+ onChange: (e) => e.target.value && H({
213
+ ...V,
214
+ skillIds: [...V.skillIds, e.target.value]
215
+ }),
216
+ children: [/* @__PURE__ */ x("option", {
217
+ value: "",
218
+ children: "Add a skill…"
219
+ }), Q.map((e) => /* @__PURE__ */ x("option", {
220
+ value: e.id,
221
+ children: e.name
222
+ }, e.id))]
223
+ })
224
+ ]
225
+ }),
226
+ /* @__PURE__ */ S("section", {
227
+ className: "space-y-2",
228
+ children: [/* @__PURE__ */ S("label", {
229
+ className: "grid gap-2 text-sm font-medium",
230
+ children: ["Retrieval profile", /* @__PURE__ */ S("select", {
231
+ "aria-label": "Retrieval profile",
232
+ className: E,
233
+ value: V.retrievalProfileId,
234
+ disabled: !I,
235
+ onChange: (e) => H({
236
+ ...V,
237
+ retrievalProfileId: e.target.value
238
+ }),
239
+ children: [
240
+ /* @__PURE__ */ x("option", {
241
+ value: "",
242
+ children: "Default retrieval (vector, top 5)"
243
+ }),
244
+ F.data?.retrievalProfile && !z.data.some((e) => e.id === F.data?.retrievalProfile?.retrievalProfileId) && /* @__PURE__ */ S("option", {
245
+ value: F.data.retrievalProfile.retrievalProfileId,
246
+ children: [
247
+ F.data.retrievalProfile.name,
248
+ " ·",
249
+ " ",
250
+ F.data.retrievalProfile.strategyMode,
251
+ " · top",
252
+ " ",
253
+ F.data.retrievalProfile.topK
254
+ ]
255
+ }),
256
+ z.data.filter((e) => k(e.status) || e.id === V.retrievalProfileId).map((e) => /* @__PURE__ */ S("option", {
257
+ value: e.id,
258
+ children: [
259
+ e.name,
260
+ " · ",
261
+ e.strategyMode,
262
+ " · top ",
263
+ e.topK
264
+ ]
265
+ }, e.id))
266
+ ]
267
+ })]
268
+ }), X && /* @__PURE__ */ S("p", {
269
+ className: "text-xs text-text-secondary",
270
+ children: [
271
+ X.strategyMode,
272
+ " search, top ",
273
+ X.topK,
274
+ X.minRelevanceScore != null && `, minimum relevance ${X.minRelevanceScore}`,
275
+ X.noAnswerIfBelowThreshold && ", abstains when nothing clears the threshold",
276
+ "."
277
+ ]
278
+ })]
279
+ }),
280
+ P && /* @__PURE__ */ x("div", {
281
+ className: "flex justify-end",
282
+ children: /* @__PURE__ */ x(s, {
283
+ onClick: () => void ne(),
284
+ isLoading: M,
285
+ disabled: !q || M,
286
+ children: "Save bindings"
287
+ })
288
+ }),
289
+ F.data && /* @__PURE__ */ S("section", {
290
+ className: "space-y-2",
291
+ children: [/* @__PURE__ */ x("p", {
292
+ className: "text-sm font-medium",
293
+ children: "Effective system prompt"
294
+ }), /* @__PURE__ */ x("pre", {
295
+ "data-testid": "effective-system-prompt",
296
+ className: "max-h-80 overflow-auto whitespace-pre-wrap rounded-lg bg-bg-sunken p-4 font-mono text-sm",
297
+ children: F.data.effectiveSystemPrompt
298
+ })]
299
+ })
300
+ ]
301
+ })] });
302
+ };
303
+ export { A as AgentBindingsPanel };
304
+
305
+ //# sourceMappingURL=AgentBindingsPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBindingsPanel.js","names":["SELECT_CLASS","storedVariables","stored","bindings","draftFrom","variables","key","value","a","b","skill","isLive","status","AgentBindingsPanel","can","useBotmanorCan","busy","setBusy","useState","canUpdate","BOTMANOR_PERMISSIONS","useAgentBindings","agentId","editable","templates","usePromptTemplates","skills","useSkills","profiles","useRetrievalProfiles","useSetAgentBindings","draft","setDraft","selectedTemplate","usePromptTemplate","boundTemplate","staleTemplate","refetchTemplate","ready","declared","useMemo","promptTemplateVariables","boundProfile","selectedProfile","row","skillsById","availableSkills","moveSkill","next","target","index","delta","handleSave","boundTemplateId","templateChanged","promptVariables","variable","text","typedVariableValue","sendVariables","save","toast","error","graphqlErrorMessage","Card","CardHeader","CardTitle","Layers","CardDescription","CardContent","event","Input","skillId","Badge","bound","Button","ArrowUp","ArrowDown","id"],"sources":["../../../src/botlit/components/AgentBindingsPanel.tsx"],"sourcesContent":["/**\n * Agent Bindings Panel (BOFF-15360)\n * @module botlit/components\n *\n * Attach a prompt template (with its variable values), skills and a retrieval\n * profile to an agent. Every run of the agent — test chat, website assistant,\n * channels, A2A — composes its system prompt from them and retrieves\n * knowledge with the profile. Saved through `setAgentBindings`.\n */\nimport type { FC } from 'react';\nimport { useEffect, useMemo, useState } from 'react';\nimport { ArrowDown, ArrowUp, Layers } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from './Card';\nimport { Button } from './Button';\nimport { Input } from './Input';\nimport { Badge } from './Badge';\nimport {\n promptTemplateVariables,\n usePromptTemplate,\n useAgentBindings,\n usePromptTemplates,\n useRetrievalProfiles,\n useSetAgentBindings,\n useSkills,\n type AgentBindingsRecord,\n} from '../hooks';\nimport { graphqlErrorMessage } from '../utils/errors';\nimport { typedVariableValue } from '../utils/promptVariables';\nimport { BOTMANOR_PERMISSIONS, useBotmanorCan } from '../permissions';\n\nconst SELECT_CLASS =\n 'h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 text-sm';\n\ninterface Draft {\n promptTemplateId: string;\n /** Text shown in each variable field. */\n variables: Record<string, string>;\n /** Names whose field was edited since the bindings loaded. */\n edited: string[];\n skillIds: string[];\n retrievalProfileId: string;\n}\n\nfunction storedVariables(bindings: AgentBindingsRecord | null): Record<string, unknown> {\n const stored = bindings?.promptTemplate?.variables;\n return stored && typeof stored === 'object' && !Array.isArray(stored)\n ? (stored as Record<string, unknown>)\n : {};\n}\n\nfunction draftFrom(bindings: AgentBindingsRecord | null): Draft {\n const variables: Record<string, string> = {};\n for (const [key, value] of Object.entries(storedVariables(bindings))) {\n variables[key] = typeof value === 'string' ? value : JSON.stringify(value);\n }\n return {\n promptTemplateId: bindings?.promptTemplate?.promptTemplateId ?? '',\n variables,\n edited: [],\n skillIds: [...(bindings?.skills ?? [])]\n .sort((a, b) => a.position - b.position)\n .map((skill) => skill.skillId),\n retrievalProfileId: bindings?.retrievalProfile?.retrievalProfileId ?? '',\n };\n}\n\nconst isLive = (status: string) => status !== 'ARCHIVED';\n\nexport const AgentBindingsPanel: FC<{ agentId: string }> = ({ agentId }) => {\n const can = useBotmanorCan();\n // Controls lock from Save until the saved bindings have been read back, so\n // an edit made meanwhile cannot be replaced by the refetched snapshot.\n const [busy, setBusy] = useState(false);\n const canUpdate = can(BOTMANOR_PERMISSIONS.AGENT_UPDATE);\n const bindings = useAgentBindings(agentId);\n // Nothing is editable before the stored bindings arrive: they would\n // replace any edit made meanwhile.\n const editable = canUpdate && !busy && Boolean(bindings.data) && !bindings.loading;\n const templates = usePromptTemplates();\n const skills = useSkills();\n const profiles = useRetrievalProfiles();\n const { save } = useSetAgentBindings(agentId);\n // Saving sends the complete binding set, so it waits until the stored\n // bindings and every catalog have loaded: an early click must never detach\n // what it has not seen yet.\n const [draft, setDraft] = useState<Draft>(() => draftFrom(null));\n // The selected template is read on its own: the catalog list is paged and\n // may not include it.\n const selectedTemplate = usePromptTemplate(draft.promptTemplateId || undefined);\n // A detail response for a template that is no longer selected is ignored.\n const boundTemplate =\n selectedTemplate.data && selectedTemplate.data.id === draft.promptTemplateId\n ? selectedTemplate.data\n : null;\n // A detail response for an earlier selection that landed last is replaced\n // by a fresh read of the selected template.\n const staleTemplate =\n Boolean(draft.promptTemplateId) &&\n !selectedTemplate.loading &&\n Boolean(selectedTemplate.data) &&\n selectedTemplate.data?.id !== draft.promptTemplateId;\n const { refetch: refetchTemplate } = selectedTemplate;\n useEffect(() => {\n if (staleTemplate) void refetchTemplate();\n }, [staleTemplate, refetchTemplate]);\n const ready =\n Boolean(bindings.data) &&\n (!draft.promptTemplateId || (boundTemplate !== null && !selectedTemplate.loading)) &&\n !bindings.loading &&\n !bindings.error &&\n !templates.loading &&\n !templates.error &&\n !skills.loading &&\n !skills.error &&\n !profiles.loading &&\n !profiles.error;\n\n useEffect(() => {\n setDraft(draftFrom(bindings.data));\n }, [bindings.data]);\n\n const declared = useMemo(\n () => (boundTemplate ? promptTemplateVariables(boundTemplate) : []),\n [boundTemplate]\n );\n // The details shown are those of the profile Save will attach.\n const boundProfile = bindings.data?.retrievalProfile;\n const selectedProfile = draft.retrievalProfileId\n ? (profiles.data.find((row) => row.id === draft.retrievalProfileId) ??\n (boundProfile?.retrievalProfileId === draft.retrievalProfileId ? boundProfile : null))\n : null;\n const skillsById = useMemo(() => new Map(skills.data.map((row) => [row.id, row])), [skills.data]);\n const availableSkills = skills.data.filter(\n (row) => isLive(row.status) && !draft.skillIds.includes(row.id)\n );\n\n const moveSkill = (index: number, delta: number) => {\n const next = [...draft.skillIds];\n const target = index + delta;\n if (target < 0 || target >= next.length) return;\n [next[index], next[target]] = [next[target], next[index]];\n setDraft({ ...draft, skillIds: next });\n };\n\n const handleSave = async () => {\n const boundTemplateId = bindings.data?.promptTemplate?.promptTemplateId ?? '';\n const templateChanged = draft.promptTemplateId !== boundTemplateId;\n // Unedited stored values are sent back exactly as stored (typed); an\n // edited field is converted for its declared type; empty fields are left\n // out so defaults apply.\n const stored = templateChanged ? {} : storedVariables(bindings.data);\n const promptVariables: Record<string, unknown> = {};\n for (const variable of declared) {\n const text = draft.variables[variable.name] ?? '';\n if (!draft.edited.includes(variable.name) && variable.name in stored) {\n promptVariables[variable.name] = stored[variable.name];\n } else if (text !== '') {\n promptVariables[variable.name] = typedVariableValue(variable.type, text);\n }\n }\n const sendVariables =\n Boolean(draft.promptTemplateId) && (templateChanged || draft.edited.length > 0);\n setBusy(true);\n try {\n await save({\n promptTemplateId: draft.promptTemplateId || null,\n // Variables are only sent when the template or a value changed, so a\n // skill or profile edit never rewrites the stored values.\n ...(sendVariables ? { promptVariables } : {}),\n skillIds: draft.skillIds,\n retrievalProfileId: draft.retrievalProfileId || null,\n });\n toast.success('Agent bindings saved');\n await bindings.refetch();\n } catch (error) {\n toast.error(graphqlErrorMessage(error, 'Failed to save the agent bindings'));\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Layers size={18} />\n Prompt template, skills &amp; retrieval\n </CardTitle>\n <CardDescription>\n Every run of this agent starts from the bound prompt template, adds the agent&apos;s own\n system prompt and the skills below, and searches its knowledge with the retrieval profile.\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {bindings.error && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {graphqlErrorMessage(bindings.error, 'Failed to load the agent bindings')}\n </p>\n )}\n\n <section className=\"space-y-3\">\n <label className=\"grid gap-2 text-sm font-medium\">\n Prompt template\n <select\n aria-label=\"Prompt template\"\n className={SELECT_CLASS}\n value={draft.promptTemplateId}\n disabled={!editable}\n onChange={(event) =>\n setDraft({\n ...draft,\n promptTemplateId: event.target.value,\n variables: {},\n edited: [],\n })\n }\n >\n <option value=\"\">No prompt template</option>\n {boundTemplate && !templates.data.some((row) => row.id === boundTemplate.id) && (\n <option value={boundTemplate.id}>\n {boundTemplate.name} · v{boundTemplate.version}\n </option>\n )}\n {templates.data\n .filter((row) => isLive(row.status) || row.id === draft.promptTemplateId)\n .map((row) => (\n <option key={row.id} value={row.id}>\n {row.name} · v{row.version}\n </option>\n ))}\n </select>\n </label>\n {declared.length > 0 && (\n <div className=\"grid gap-3 sm:grid-cols-2\">\n {declared.map((variable) => (\n <label key={variable.name} className=\"grid gap-1 text-sm\">\n <span>\n {`{{${variable.name}}}`}\n {variable.required && <span className=\"ml-1 text-status-error-text\">*</span>}\n </span>\n <Input\n aria-label={`Variable ${variable.name}`}\n disabled={!editable}\n placeholder={\n typeof variable.defaultValue === 'string'\n ? `Default: ${variable.defaultValue}`\n : (variable.description ?? variable.type)\n }\n value={draft.variables[variable.name] ?? ''}\n onChange={(event) =>\n setDraft({\n ...draft,\n variables: { ...draft.variables, [variable.name]: event.target.value },\n edited: draft.edited.includes(variable.name)\n ? draft.edited\n : [...draft.edited, variable.name],\n })\n }\n />\n </label>\n ))}\n </div>\n )}\n </section>\n\n <section className=\"space-y-3\">\n <p className=\"text-sm font-medium\">Skills</p>\n {draft.skillIds.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">No skills attached.</p>\n ) : (\n <ol className=\"space-y-2\">\n {draft.skillIds.map((skillId, index) => {\n const skill = skillsById.get(skillId);\n return (\n <li\n key={skillId}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle p-3\"\n >\n <Badge variant=\"outline\">#{index + 1}</Badge>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">\n {skill?.name ??\n bindings.data?.skills.find((bound) => bound.skillId === skillId)?.name ??\n skillId}\n </p>\n {skill?.description && (\n <p className=\"truncate text-xs text-text-secondary\">{skill.description}</p>\n )}\n </div>\n {editable && (\n <div className=\"flex items-center gap-1\">\n <Button\n size=\"sm\"\n variant=\"ghost\"\n aria-label=\"Move skill up\"\n onClick={() => moveSkill(index, -1)}\n >\n <ArrowUp size={14} />\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n aria-label=\"Move skill down\"\n onClick={() => moveSkill(index, 1)}\n >\n <ArrowDown size={14} />\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() =>\n setDraft({\n ...draft,\n skillIds: draft.skillIds.filter((id) => id !== skillId),\n })\n }\n >\n Remove\n </Button>\n </div>\n )}\n </li>\n );\n })}\n </ol>\n )}\n {editable && availableSkills.length > 0 && (\n <select\n aria-label=\"Add skill\"\n className={SELECT_CLASS}\n value=\"\"\n onChange={(event) =>\n event.target.value &&\n setDraft({ ...draft, skillIds: [...draft.skillIds, event.target.value] })\n }\n >\n <option value=\"\">Add a skill…</option>\n {availableSkills.map((row) => (\n <option key={row.id} value={row.id}>\n {row.name}\n </option>\n ))}\n </select>\n )}\n </section>\n\n <section className=\"space-y-2\">\n <label className=\"grid gap-2 text-sm font-medium\">\n Retrieval profile\n <select\n aria-label=\"Retrieval profile\"\n className={SELECT_CLASS}\n value={draft.retrievalProfileId}\n disabled={!editable}\n onChange={(event) => setDraft({ ...draft, retrievalProfileId: event.target.value })}\n >\n <option value=\"\">Default retrieval (vector, top 5)</option>\n {bindings.data?.retrievalProfile &&\n !profiles.data.some(\n (row) => row.id === bindings.data?.retrievalProfile?.retrievalProfileId\n ) && (\n <option value={bindings.data.retrievalProfile.retrievalProfileId}>\n {bindings.data.retrievalProfile.name} ·{' '}\n {bindings.data.retrievalProfile.strategyMode} · top{' '}\n {bindings.data.retrievalProfile.topK}\n </option>\n )}\n {profiles.data\n .filter((row) => isLive(row.status) || row.id === draft.retrievalProfileId)\n .map((row) => (\n <option key={row.id} value={row.id}>\n {row.name} · {row.strategyMode} · top {row.topK}\n </option>\n ))}\n </select>\n </label>\n {selectedProfile && (\n <p className=\"text-xs text-text-secondary\">\n {selectedProfile.strategyMode} search, top {selectedProfile.topK}\n {selectedProfile.minRelevanceScore != null &&\n `, minimum relevance ${selectedProfile.minRelevanceScore}`}\n {selectedProfile.noAnswerIfBelowThreshold &&\n ', abstains when nothing clears the threshold'}\n .\n </p>\n )}\n </section>\n\n {canUpdate && (\n <div className=\"flex justify-end\">\n <Button onClick={() => void handleSave()} isLoading={busy} disabled={!ready || busy}>\n Save bindings\n </Button>\n </div>\n )}\n\n {bindings.data && (\n <section className=\"space-y-2\">\n <p className=\"text-sm font-medium\">Effective system prompt</p>\n <pre\n data-testid=\"effective-system-prompt\"\n className=\"max-h-80 overflow-auto whitespace-pre-wrap rounded-lg bg-bg-sunken p-4 font-mono text-sm\"\n >\n {bindings.data.effectiveSystemPrompt}\n </pre>\n </section>\n )}\n </CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAMA,IACJ;AAYF,SAASC,EAAgB,GAA+D;CACtF,IAAMC,IAASC,GAAU,gBAAgB;CACzC,OAAOD,KAAU,OAAOA,KAAW,YAAY,CAAC,MAAM,QAAQA,CAAM,IAC/DA,IACD,CAAC;AACP;AAEA,SAASE,EAAU,GAA6C;CAC9D,IAAMC,IAAoC,CAAC;CAC3C,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQN,EAAgBE,CAAQ,CAAC,GACjE,EAAUG,KAAO,OAAOC,KAAU,WAAWA,IAAQ,KAAK,UAAUA,CAAK;CAE3E,OA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GAAAA,EAAI,EAET,CACT;MACG;KACH,CAAA,CAAA;IACN,CAAA,GAAAD,KACC,kBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MACGA,EAAgB;MAAa;MAAcA,EAAgB;MAC3DA,EAAgB,qBAAqB,QACpC,uBAAuBA,EAAgB;MACxCA,EAAgB,4BACf;MAA+C;KAEhD;IAEE,CAAA,CAAA;;GAERxB,KACC,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,kBAACwD,GAAD;KAAQ,eAAe,KAAKvB,GAAW;KAAG,WAAWpC;KAAM,UAAU,CAACsB,KAAStB;KAAM,UAAA;IAE7E,CAAA;GACL,CAAA;GAGNb,EAAS,QACR,kBAAC,WAAD;IAAS,WAAU;IAAnB,UAAA,CACE,kBAAC,KAAD;KAAG,WAAU;KAAsB,UAAA;IAA0B,CAAA,GAC7D,kBAAC,OAAD;KACE,eAAY;KACZ,WAAU;KAET,UAAAA,EAAS,KAAK;IACZ,CAAA,CACE;;EAEA;CACT,CAAA,CAAA,EAAA,CAAA;AAEV"}
@@ -0,0 +1,21 @@
1
+ import { FC } from 'react';
2
+ import { InboundChannelData, PlatformCredentialDefinition } from '../hooks/useChannelSetup';
3
+ interface ChannelCredentialFieldsProps {
4
+ definition: PlatformCredentialDefinition;
5
+ values: Record<string, string>;
6
+ onChange: (values: Record<string, string>) => void;
7
+ }
8
+ export declare const ChannelCredentialFields: FC<ChannelCredentialFieldsProps>;
9
+ interface InboundWebhookCardProps {
10
+ channel: InboundChannelData | null;
11
+ loading: boolean;
12
+ error: Error | undefined;
13
+ /** Is the connector ACTIVE? Only an ACTIVE connector binds the channel. */
14
+ connectorActive: boolean;
15
+ workspaceId: string | undefined;
16
+ /** Platform-specific instructions for where the URL goes. */
17
+ hint?: string;
18
+ onRefresh: () => void;
19
+ }
20
+ export declare const InboundWebhookCard: FC<InboundWebhookCardProps>;
21
+ export {};
@@ -0,0 +1,139 @@
1
+ import { Card as e, CardContent as t, CardDescription as n, CardHeader as r, CardTitle as i } from "./Card.js";
2
+ import { Button as a } from "./Button.js";
3
+ import { Badge as o } from "./Badge.js";
4
+ import { FormField as s, Input as c } from "./Input.js";
5
+ import { isNative as l, nativeCopyText as u, nativeToast as d } from "../../utils/nativeBridge.js";
6
+ import { generateSigningSecret as f } from "../hooks/useChannelSetup.js";
7
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ import { Copy as h, KeyRound as g, Link2 as _, Loader2 as v, RefreshCw as y } from "lucide-react";
9
+ import { toast as b } from "sonner";
10
+ // src/botlit/components/ChannelSetupPanels.tsx
11
+ var x = ({ definition: e, values: t, onChange: n }) => /* @__PURE__ */ m("div", {
12
+ className: "space-y-4",
13
+ children: [e.fields.map((e) => /* @__PURE__ */ p(s, {
14
+ label: e.label,
15
+ description: e.description,
16
+ required: !0,
17
+ children: /* @__PURE__ */ m("div", {
18
+ className: "flex gap-2",
19
+ children: [
20
+ /* @__PURE__ */ p(c, {
21
+ "aria-label": e.label,
22
+ type: e.secret ? "password" : e.url ? "url" : "text",
23
+ autoComplete: "off",
24
+ placeholder: e.placeholder,
25
+ value: t[e.key] ?? "",
26
+ onChange: (r) => n({
27
+ ...t,
28
+ [e.key]: r.target.value
29
+ })
30
+ }),
31
+ e.generatable && /* @__PURE__ */ p(a, {
32
+ type: "button",
33
+ variant: "outline",
34
+ leftIcon: /* @__PURE__ */ p(y, { size: 14 }),
35
+ onClick: () => n({
36
+ ...t,
37
+ [e.key]: f()
38
+ }),
39
+ children: "Generate"
40
+ }),
41
+ e.generatable && t[e.key] && /* @__PURE__ */ p(a, {
42
+ type: "button",
43
+ variant: "outline",
44
+ size: "icon",
45
+ "aria-label": `Copy ${e.label}`,
46
+ title: `Copy ${e.label}`,
47
+ onClick: () => void S(t[e.key] ?? "", e.label),
48
+ children: /* @__PURE__ */ p(h, { size: 14 })
49
+ })
50
+ ]
51
+ })
52
+ }, e.key)), /* @__PURE__ */ m("p", {
53
+ className: "flex items-start gap-2 text-xs text-text-secondary",
54
+ children: [/* @__PURE__ */ p(g, {
55
+ size: 14,
56
+ className: "mt-0.5 shrink-0"
57
+ }), "Credentials are stored encrypted on the channel and are never shown again. Copy a generated secret now if your sender needs it."]
58
+ })]
59
+ });
60
+ async function S(e, t) {
61
+ await u(e) ? (b.success(`${t} copied`), l() && d("Copied")) : b.error(`Could not copy the ${t.toLowerCase()}`);
62
+ }
63
+ var C = ({ channel: s, loading: l, error: u, connectorActive: d, workspaceId: f, hint: g, onRefresh: b }) => {
64
+ let x = !!(s && f && s.inboundWorkspaceId === f), C;
65
+ if (l && !s) C = /* @__PURE__ */ m("div", {
66
+ className: "flex items-center gap-2 py-2 text-sm text-text-secondary",
67
+ children: [/* @__PURE__ */ p(v, {
68
+ size: 14,
69
+ className: "animate-spin"
70
+ }), "Loading the channel…"]
71
+ });
72
+ else if (u) C = /* @__PURE__ */ p("p", {
73
+ className: "text-sm text-status-error-text",
74
+ children: u.message
75
+ });
76
+ else if (!s) C = /* @__PURE__ */ p("p", {
77
+ className: "text-sm text-text-secondary",
78
+ children: "The linked channel was not found. Edit the connector or create a new one with credentials."
79
+ });
80
+ else if (!d) C = /* @__PURE__ */ p("p", {
81
+ className: "text-sm text-text-secondary",
82
+ children: "Activate this connector to bind the channel to this workspace. The platform can only deliver messages to an active connector."
83
+ });
84
+ else if (!x) C = /* @__PURE__ */ p("p", {
85
+ className: "text-sm text-text-secondary",
86
+ children: "The channel is not bound to this workspace yet. Refresh in a moment; if it stays unbound, deactivate and activate the connector again."
87
+ });
88
+ else if (!s.inboundWebhookUrl) C = /* @__PURE__ */ p("p", {
89
+ className: "text-sm text-text-secondary",
90
+ children: "The channel is bound, but the platform does not publish an inbound webhook URL in this environment yet."
91
+ });
92
+ else {
93
+ let e = s.inboundWebhookUrl;
94
+ C = /* @__PURE__ */ m("div", {
95
+ className: "space-y-3",
96
+ children: [/* @__PURE__ */ m("div", {
97
+ className: "flex gap-2",
98
+ children: [/* @__PURE__ */ p(c, {
99
+ "aria-label": "Inbound webhook URL",
100
+ value: e,
101
+ readOnly: !0,
102
+ className: "font-mono text-xs",
103
+ onFocus: (e) => e.currentTarget.select()
104
+ }), /* @__PURE__ */ p(a, {
105
+ variant: "outline",
106
+ leftIcon: /* @__PURE__ */ p(h, { size: 14 }),
107
+ onClick: () => void S(e, "Webhook URL"),
108
+ children: "Copy"
109
+ })]
110
+ }), g && /* @__PURE__ */ p("p", {
111
+ className: "text-sm text-text-secondary",
112
+ children: g
113
+ })]
114
+ });
115
+ }
116
+ return /* @__PURE__ */ m(e, { children: [/* @__PURE__ */ m(r, {
117
+ className: "flex flex-row items-start justify-between",
118
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m(i, {
119
+ className: "flex items-center gap-2",
120
+ children: [/* @__PURE__ */ p(_, { size: 18 }), "Inbound Webhook"]
121
+ }), /* @__PURE__ */ p(n, { children: "The platform sends incoming messages for this channel to this URL" })] }), /* @__PURE__ */ m("div", {
122
+ className: "flex items-center gap-2",
123
+ children: [s && /* @__PURE__ */ p(o, {
124
+ variant: x ? "success" : "outline",
125
+ children: x ? "Bound to this workspace" : "Not bound"
126
+ }), /* @__PURE__ */ p(a, {
127
+ variant: "ghost",
128
+ size: "icon",
129
+ "aria-label": "Refresh the channel",
130
+ title: "Refresh",
131
+ onClick: b,
132
+ children: /* @__PURE__ */ p(y, { size: 14 })
133
+ })]
134
+ })]
135
+ }), /* @__PURE__ */ p(t, { children: C })] });
136
+ };
137
+ export { x as ChannelCredentialFields, C as InboundWebhookCard };
138
+
139
+ //# sourceMappingURL=ChannelSetupPanels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelSetupPanels.js","names":["ChannelCredentialFields","definition","FormField","field","Input","values","onChange","event","Button","RefreshCw","generateSigningSecret","copyToClipboard","Copy","KeyRound","nativeCopyText","value","toast","label","isNative","nativeToast","InboundWebhookCard","boundHere","channel","workspaceId","body","loading","Loader2","error","connectorActive","url","hint","Card","CardHeader","CardTitle","Link2","CardDescription","Badge","onRefresh","CardContent"],"sources":["../../../src/botlit/components/ChannelSetupPanels.tsx"],"sourcesContent":["/**\n * Channel setup panels (BOFF-15360)\n * @module botlit/components\n *\n * - `ChannelCredentialFields`: the platform credentials a new connector's\n * global channel is created with (Slack bot token + signing secret, a\n * webhook's reply URL + signing secret).\n * - `InboundWebhookCard`: the public URL the platform must call with inbound\n * events (`Channel.inboundWebhookUrl`), with a copy button and the\n * platform-specific instructions.\n */\n\nimport type { FC } from 'react';\nimport { Copy, KeyRound, Link2, Loader2, RefreshCw } from 'lucide-react';\nimport { toast } from 'sonner';\n\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from './Card';\nimport { Button } from './Button';\nimport { Badge } from './Badge';\nimport { Input, FormField } from './Input';\nimport { isNative, nativeCopyText, nativeToast } from '../../utils/nativeBridge';\nimport {\n generateSigningSecret,\n type InboundChannelData,\n type PlatformCredentialDefinition,\n} from '../hooks/useChannelSetup';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ChannelCredentialFields\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface ChannelCredentialFieldsProps {\n definition: PlatformCredentialDefinition;\n values: Record<string, string>;\n onChange: (values: Record<string, string>) => void;\n}\n\nexport const ChannelCredentialFields: FC<ChannelCredentialFieldsProps> = ({\n definition,\n values,\n onChange,\n}) => (\n <div className=\"space-y-4\">\n {definition.fields.map((field) => (\n <FormField key={field.key} label={field.label} description={field.description} required>\n <div className=\"flex gap-2\">\n <Input\n aria-label={field.label}\n type={field.secret ? 'password' : field.url ? 'url' : 'text'}\n autoComplete=\"off\"\n placeholder={field.placeholder}\n value={values[field.key] ?? ''}\n onChange={(event) => onChange({ ...values, [field.key]: event.target.value })}\n />\n {field.generatable && (\n <Button\n type=\"button\"\n variant=\"outline\"\n leftIcon={<RefreshCw size={14} />}\n onClick={() => onChange({ ...values, [field.key]: generateSigningSecret() })}\n >\n Generate\n </Button>\n )}\n {field.generatable && values[field.key] && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n aria-label={`Copy ${field.label}`}\n title={`Copy ${field.label}`}\n onClick={() => void copyToClipboard(values[field.key] ?? '', field.label)}\n >\n <Copy size={14} />\n </Button>\n )}\n </div>\n </FormField>\n ))}\n <p className=\"flex items-start gap-2 text-xs text-text-secondary\">\n <KeyRound size={14} className=\"mt-0.5 shrink-0\" />\n Credentials are stored encrypted on the channel and are never shown again. Copy a generated\n secret now if your sender needs it.\n </p>\n </div>\n);\n\nasync function copyToClipboard(value: string, label: string): Promise<void> {\n const copied = await nativeCopyText(value);\n if (copied) {\n toast.success(`${label} copied`);\n if (isNative()) void nativeToast('Copied');\n } else {\n toast.error(`Could not copy the ${label.toLowerCase()}`);\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// InboundWebhookCard\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface InboundWebhookCardProps {\n channel: InboundChannelData | null;\n loading: boolean;\n error: Error | undefined;\n /** Is the connector ACTIVE? Only an ACTIVE connector binds the channel. */\n connectorActive: boolean;\n workspaceId: string | undefined;\n /** Platform-specific instructions for where the URL goes. */\n hint?: string;\n onRefresh: () => void;\n}\n\nexport const InboundWebhookCard: FC<InboundWebhookCardProps> = ({\n channel,\n loading,\n error,\n connectorActive,\n workspaceId,\n hint,\n onRefresh,\n}) => {\n const boundHere = Boolean(channel && workspaceId && channel.inboundWorkspaceId === workspaceId);\n\n let body;\n if (loading && !channel) {\n body = (\n <div className=\"flex items-center gap-2 py-2 text-sm text-text-secondary\">\n <Loader2 size={14} className=\"animate-spin\" />\n Loading the channel…\n </div>\n );\n } else if (error) {\n body = <p className=\"text-sm text-status-error-text\">{error.message}</p>;\n } else if (!channel) {\n body = (\n <p className=\"text-sm text-text-secondary\">\n The linked channel was not found. Edit the connector or create a new one with credentials.\n </p>\n );\n } else if (!connectorActive) {\n body = (\n <p className=\"text-sm text-text-secondary\">\n Activate this connector to bind the channel to this workspace. The platform can only deliver\n messages to an active connector.\n </p>\n );\n } else if (!boundHere) {\n body = (\n <p className=\"text-sm text-text-secondary\">\n The channel is not bound to this workspace yet. Refresh in a moment; if it stays unbound,\n deactivate and activate the connector again.\n </p>\n );\n } else if (!channel.inboundWebhookUrl) {\n body = (\n <p className=\"text-sm text-text-secondary\">\n The channel is bound, but the platform does not publish an inbound webhook URL in this\n environment yet.\n </p>\n );\n } else {\n const url = channel.inboundWebhookUrl;\n body = (\n <div className=\"space-y-3\">\n <div className=\"flex gap-2\">\n <Input\n aria-label=\"Inbound webhook URL\"\n value={url}\n readOnly\n className=\"font-mono text-xs\"\n onFocus={(event) => event.currentTarget.select()}\n />\n <Button\n variant=\"outline\"\n leftIcon={<Copy size={14} />}\n onClick={() => void copyToClipboard(url, 'Webhook URL')}\n >\n Copy\n </Button>\n </div>\n {hint && <p className=\"text-sm text-text-secondary\">{hint}</p>}\n </div>\n );\n }\n\n return (\n <Card>\n <CardHeader className=\"flex flex-row items-start justify-between\">\n <div>\n <CardTitle className=\"flex items-center gap-2\">\n <Link2 size={18} />\n Inbound Webhook\n </CardTitle>\n <CardDescription>\n The platform sends incoming messages for this channel to this URL\n </CardDescription>\n </div>\n <div className=\"flex items-center gap-2\">\n {channel && (\n <Badge variant={boundHere ? 'success' : 'outline'}>\n {boundHere ? 'Bound to this workspace' : 'Not bound'}\n </Badge>\n )}\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Refresh the channel\"\n title=\"Refresh\"\n onClick={onRefresh}\n >\n <RefreshCw size={14} />\n </Button>\n </div>\n </CardHeader>\n <CardContent>{body}</CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;;;;;;AAqCA,IAAaA,KAA6D,EACxE,eACA,WACA,kBAEA,kBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACGC,EAAW,OAAO,KAAK,MACtB,kBAACC,GAAD;EAA2B,OAAOC,EAAM;EAAO,aAAaA,EAAM;EAAa,UAAA;EAC7E,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAACC,GA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D,EAAA,UAAiB,oEAEA,CAAA,CACd,EAAA,CAAA,GACL,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACGb,KACC,kBAACc,GAAD;IAAO,SAASf,IAAY,YAAY;IACrC,UAAAA,IAAY,4BAA4B;GACpC,CAAA,GAET,kBAACb,GAAD;IACE,SAAQ;IACR,MAAK;IACL,cAAW;IACX,OAAM;IACN,SAAS6B;IAET,UAAA,kBAAC5B,GAAD,EAAW,MAAM,GAAK,CAAA;GAChB,CAAA,CACL;EACK,CAAA,CAAA;CACZ,CAAA,GAAA,kBAAC6B,GAAD,EAAA,UAAcd,EAAkB,CAAA,CAC5B,EAAA,CAAA;AAEV"}
@@ -12,8 +12,10 @@ export { useMCPServers, useMCPServer, useMCPResources, useMCPTools, useCreateMCP
12
12
  export type { MCPServerRecord, MCPToolRecord, MCPResourceRecord } from './useMCPServers';
13
13
  export { useA2AAgents, useA2AAgent, useRegisterA2AAgent, useUpdateA2AAgent, useDeleteA2AAgent, useValidateA2AAgent, validateAgentCard, a2aAgentSkillCount, a2aKeys, } from './useA2A';
14
14
  export type { A2AAgentRecord } from './useA2A';
15
- export { useChannelConnectors, useChannelConnector, useCreateChannelConnector, useUpdateChannelConnector, useDeleteChannelConnector, useChannelRoutes, useBotChannelRoutes, useChannelRoute, useCreateChannelRoute, useUpdateChannelRoute, useDeleteChannelRoute, routeMetadataString, channelKeys, } from './useChannels';
15
+ export { useChannelConnectors, useChannelConnector, useCreateChannelConnector, useUpdateChannelConnector, useDeleteChannelConnector, useFindChannelConnector, useChannelRoutes, useBotChannelRoutes, useChannelRoute, useCreateChannelRoute, useUpdateChannelRoute, useDeleteChannelRoute, routeMetadataString, channelKeys, } from './useChannels';
16
16
  export type { ChannelConnectorRecord, ChannelRouteRecord } from './useChannels';
17
+ export { PLATFORM_CREDENTIALS, connectorPlatform, generateSigningSecret, validateCredentials, useActiveOrganizationId, useInboundChannel, useProvisionChannel, } from './useChannelSetup';
18
+ export type { CredentialFieldDefinition, PlatformCredentialDefinition, InboundChannelData, } from './useChannelSetup';
17
19
  export { usePolicies, usePolicy, useCreatePolicy, useUpdatePolicy, useDeletePolicy, usePoliciesByType, policyKeys, } from './usePolicies';
18
20
  export type { PolicyRecord } from './usePolicies';
19
21
  export { useRetentionStatus, useApplyRetention } from './useRetention';
@@ -22,6 +24,8 @@ export { useSkills, useSkill, useCreateSkill, useUpdateSkill, useDeleteSkill, sk
22
24
  export type { SkillRecord } from './useSkills';
23
25
  export { usePromptTemplates, usePromptTemplate, useCreatePromptTemplate, useUpdatePromptTemplate, useDeletePromptTemplate, useRenderPromptTemplate, promptTemplateVariables, promptTemplateKeys, } from './usePromptTemplates';
24
26
  export type { PromptTemplateRecord } from './usePromptTemplates';
27
+ export { useAgentBindings, useSetAgentBindings, useTestPromptTemplate, useSavePromptTemplateVersion, usePromptTemplateVersions, } from './useAgentBindings';
28
+ export type { AgentBindingsRecord, PromptTemplateTestRecord, PromptTemplateVersionRecord, } from './useAgentBindings';
25
29
  export { useExecutions, useExecution, useCreateExecution, useUpdateExecutionStatus, useExecutionMetrics, summariseExecutions, executionKeys, } from './useExecutions';
26
30
  export type { ExecutionRecord, ExecutionRollup } from './useExecutions';
27
31
  export { useBuckets, useBucketTree, useBucket, useChildBuckets, useCreateBucket, useUpdateBucket, useDeleteBucket, buildBucketTree, bucketKeys, } from './useBuckets';
@@ -4,16 +4,18 @@ import "./useKnowledgeBases.js";
4
4
  import { useRetrievalProfiles as n } from "./useRetrievalProfiles.js";
5
5
  import { isMCPServerHealthy as r, mcpServerDescription as i, mcpServerEndpoint as a, useCreateMCPServer as o, useDeleteMCPServer as s, useMCPResources as c, useMCPServer as l, useMCPTools as u, useTestMCPConnection as d, useUpdateMCPServer as f, useUpdateMCPTool as p } from "./useMCPServers.js";
6
6
  import { a2aAgentSkillCount as m, useA2AAgents as h } from "./useA2A.js";
7
- import { routeMetadataString as g, useBotChannelRoutes as _, useChannelConnector as v, useChannelConnectors as y, useChannelRoutes as b, useCreateChannelConnector as x, useCreateChannelRoute as S, useDeleteChannelConnector as C, useDeleteChannelRoute as w, useUpdateChannelConnector as T } from "./useChannels.js";
8
- import { useCreatePolicy as E, useDeletePolicy as D, usePolicies as O, usePolicy as k, useUpdatePolicy as A } from "./usePolicies.js";
9
- import { useApplyRetention as j, useRetentionStatus as M } from "./useRetention.js";
10
- import { useCreateSkill as N, useDeleteSkill as P, useSkill as F, useSkills as I, useUpdateSkill as L } from "./useSkills.js";
11
- import { promptTemplateVariables as R, useCreatePromptTemplate as z, useDeletePromptTemplate as B, usePromptTemplate as V, usePromptTemplates as H, useRenderPromptTemplate as U, useUpdatePromptTemplate as W } from "./usePromptTemplates.js";
12
- import { summariseExecutions as G, useExecutions as K } from "./useExecutions.js";
13
- import { useBucket as q, useBucketTree as J, useBuckets as Y, useChildBuckets as X, useCreateBucket as Z, useDeleteBucket as Q, useUpdateBucket as $ } from "./useBuckets.js";
14
- import { storePackageDescription as ee, storePackageName as te, useInstallPackage as ne, useInstalledPackages as re, usePinPackageVersion as ie, useStorePackage as ae, useStorePackages as oe, useUninstallPackage as se, useUpdateInstalledPackage as ce } from "./useStore.js";
7
+ import { routeMetadataString as g, useBotChannelRoutes as _, useChannelConnector as v, useChannelConnectors as y, useChannelRoutes as b, useCreateChannelConnector as x, useCreateChannelRoute as S, useDeleteChannelConnector as C, useDeleteChannelRoute as w, useFindChannelConnector as T, useUpdateChannelConnector as E } from "./useChannels.js";
8
+ import { PLATFORM_CREDENTIALS as D, connectorPlatform as O, useActiveOrganizationId as k, useInboundChannel as A, useProvisionChannel as j, validateCredentials as M } from "./useChannelSetup.js";
9
+ import { useCreatePolicy as N, useDeletePolicy as P, usePolicies as F, usePolicy as I, useUpdatePolicy as L } from "./usePolicies.js";
10
+ import { useApplyRetention as R, useRetentionStatus as z } from "./useRetention.js";
11
+ import { useCreateSkill as B, useDeleteSkill as V, useSkill as H, useSkills as U, useUpdateSkill as W } from "./useSkills.js";
12
+ import { promptTemplateVariables as G, useCreatePromptTemplate as K, useDeletePromptTemplate as q, usePromptTemplate as J, usePromptTemplates as Y, useRenderPromptTemplate as X, useUpdatePromptTemplate as Z } from "./usePromptTemplates.js";
13
+ import { useAgentBindings as Q, usePromptTemplateVersions as $, useSavePromptTemplateVersion as ee, useSetAgentBindings as te, useTestPromptTemplate as ne } from "./useAgentBindings.js";
14
+ import { summariseExecutions as re, useExecutions as ie } from "./useExecutions.js";
15
+ import { useBucket as ae, useBucketTree as oe, useBuckets as se, useChildBuckets as ce, useCreateBucket as le, useDeleteBucket as ue, useUpdateBucket as de } from "./useBuckets.js";
16
+ import { storePackageDescription as fe, storePackageName as pe, useInstallPackage as me, useInstalledPackages as he, usePinPackageVersion as ge, useStorePackage as _e, useStorePackages as ve, useUninstallPackage as ye, useUpdateInstalledPackage as be } from "./useStore.js";
15
17
  import "./useLLMProviders.js";
16
- import { useInitiateSlackConnect as le, useLinkIntegrationConnection as ue, useMyUserPlatformConnection as de, useRevokeSlackConnection as fe, useToggleSlackNotifications as pe } from "./useUserPlatformConnection.js";
17
- import { useConfigureSupervisor as me, useRunSupervisorNow as he, useSupervisorConfig as ge, useSupervisorRuns as _e } from "./useAiOperations.js";
18
- import { useAcceptHandoff as ve, useHandoffConfig as ye, useHandoffQueue as be, useRejectHandoff as xe, useReleaseHandoff as Se, useResolveHandoff as Ce, useUpsertHandoffConfig as we } from "./useHandoffs.js";
19
- export { m as a2aAgentSkillCount, r as isMCPServerHealthy, i as mcpServerDescription, a as mcpServerEndpoint, R as promptTemplateVariables, g as routeMetadataString, ee as storePackageDescription, te as storePackageName, G as summariseExecutions, h as useA2AAgents, ve as useAcceptHandoff, t as useAgents, j as useApplyRetention, _ as useBotChannelRoutes, e as useBots, q as useBucket, J as useBucketTree, Y as useBuckets, v as useChannelConnector, y as useChannelConnectors, b as useChannelRoutes, X as useChildBuckets, me as useConfigureSupervisor, Z as useCreateBucket, x as useCreateChannelConnector, S as useCreateChannelRoute, o as useCreateMCPServer, E as useCreatePolicy, z as useCreatePromptTemplate, N as useCreateSkill, Q as useDeleteBucket, C as useDeleteChannelConnector, w as useDeleteChannelRoute, s as useDeleteMCPServer, D as useDeletePolicy, B as useDeletePromptTemplate, P as useDeleteSkill, K as useExecutions, ye as useHandoffConfig, be as useHandoffQueue, le as useInitiateSlackConnect, ne as useInstallPackage, re as useInstalledPackages, ue as useLinkIntegrationConnection, c as useMCPResources, l as useMCPServer, u as useMCPTools, de as useMyUserPlatformConnection, ie as usePinPackageVersion, O as usePolicies, k as usePolicy, V as usePromptTemplate, H as usePromptTemplates, xe as useRejectHandoff, Se as useReleaseHandoff, U as useRenderPromptTemplate, Ce as useResolveHandoff, M as useRetentionStatus, n as useRetrievalProfiles, fe as useRevokeSlackConnection, he as useRunSupervisorNow, F as useSkill, I as useSkills, ae as useStorePackage, oe as useStorePackages, ge as useSupervisorConfig, _e as useSupervisorRuns, d as useTestMCPConnection, pe as useToggleSlackNotifications, se as useUninstallPackage, $ as useUpdateBucket, T as useUpdateChannelConnector, ce as useUpdateInstalledPackage, f as useUpdateMCPServer, p as useUpdateMCPTool, A as useUpdatePolicy, W as useUpdatePromptTemplate, L as useUpdateSkill, we as useUpsertHandoffConfig };
18
+ import { useGlobalChannels as xe, useInitiateSlackConnect as Se, useLinkIntegrationConnection as Ce, useMyUserPlatformConnection as we, useRevokeSlackConnection as Te, useToggleSlackNotifications as Ee } from "./useUserPlatformConnection.js";
19
+ import { useConfigureSupervisor as De, useRunSupervisorNow as Oe, useSupervisorConfig as ke, useSupervisorRuns as Ae } from "./useAiOperations.js";
20
+ import { useAcceptHandoff as je, useHandoffConfig as Me, useHandoffQueue as Ne, useRejectHandoff as Pe, useReleaseHandoff as Fe, useResolveHandoff as Ie, useUpsertHandoffConfig as Le } from "./useHandoffs.js";
21
+ export { D as PLATFORM_CREDENTIALS, m as a2aAgentSkillCount, O as connectorPlatform, r as isMCPServerHealthy, i as mcpServerDescription, a as mcpServerEndpoint, G as promptTemplateVariables, g as routeMetadataString, fe as storePackageDescription, pe as storePackageName, re as summariseExecutions, h as useA2AAgents, je as useAcceptHandoff, k as useActiveOrganizationId, Q as useAgentBindings, t as useAgents, R as useApplyRetention, _ as useBotChannelRoutes, e as useBots, ae as useBucket, oe as useBucketTree, se as useBuckets, v as useChannelConnector, y as useChannelConnectors, b as useChannelRoutes, ce as useChildBuckets, De as useConfigureSupervisor, le as useCreateBucket, x as useCreateChannelConnector, S as useCreateChannelRoute, o as useCreateMCPServer, N as useCreatePolicy, K as useCreatePromptTemplate, B as useCreateSkill, ue as useDeleteBucket, C as useDeleteChannelConnector, w as useDeleteChannelRoute, s as useDeleteMCPServer, P as useDeletePolicy, q as useDeletePromptTemplate, V as useDeleteSkill, ie as useExecutions, T as useFindChannelConnector, xe as useGlobalChannels, Me as useHandoffConfig, Ne as useHandoffQueue, A as useInboundChannel, Se as useInitiateSlackConnect, me as useInstallPackage, he as useInstalledPackages, Ce as useLinkIntegrationConnection, c as useMCPResources, l as useMCPServer, u as useMCPTools, we as useMyUserPlatformConnection, ge as usePinPackageVersion, F as usePolicies, I as usePolicy, J as usePromptTemplate, $ as usePromptTemplateVersions, Y as usePromptTemplates, j as useProvisionChannel, Pe as useRejectHandoff, Fe as useReleaseHandoff, X as useRenderPromptTemplate, Ie as useResolveHandoff, z as useRetentionStatus, n as useRetrievalProfiles, Te as useRevokeSlackConnection, Oe as useRunSupervisorNow, ee as useSavePromptTemplateVersion, te as useSetAgentBindings, H as useSkill, U as useSkills, _e as useStorePackage, ve as useStorePackages, ke as useSupervisorConfig, Ae as useSupervisorRuns, d as useTestMCPConnection, ne as useTestPromptTemplate, Ee as useToggleSlackNotifications, ye as useUninstallPackage, de as useUpdateBucket, E as useUpdateChannelConnector, be as useUpdateInstalledPackage, f as useUpdateMCPServer, p as useUpdateMCPTool, L as useUpdatePolicy, Z as useUpdatePromptTemplate, W as useUpdateSkill, Le as useUpsertHandoffConfig, M as validateCredentials };