@burdenoff/microfe-botmanor 2026.1120.9 → 2026.1120.11

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 (31) hide show
  1. package/dist/botlit/components/ChannelSetupPanels.d.ts +5 -0
  2. package/dist/botlit/components/ChannelSetupPanels.js +19 -15
  3. package/dist/botlit/components/ChannelSetupPanels.js.map +1 -1
  4. package/dist/botlit/components/ExecutionFeedback.d.ts +5 -0
  5. package/dist/botlit/components/ExecutionFeedback.js +55 -0
  6. package/dist/botlit/components/ExecutionFeedback.js.map +1 -0
  7. package/dist/botlit/components/KnowledgeReviewSchedule.d.ts +7 -0
  8. package/dist/botlit/components/KnowledgeReviewSchedule.js +92 -0
  9. package/dist/botlit/components/KnowledgeReviewSchedule.js.map +1 -0
  10. package/dist/botlit/components/SuggestionsPanel.d.ts +12 -0
  11. package/dist/botlit/components/SuggestionsPanel.js +219 -0
  12. package/dist/botlit/components/SuggestionsPanel.js.map +1 -0
  13. package/dist/botlit/hooks/useAgentTuning.d.ts +87 -0
  14. package/dist/botlit/hooks/useAgentTuning.js +170 -0
  15. package/dist/botlit/hooks/useAgentTuning.js.map +1 -0
  16. package/dist/botlit/hooks/useAiOperations.js +1 -1
  17. package/dist/botlit/hooks/useAiOperations.js.map +1 -1
  18. package/dist/botlit/hooks/useChannelSetup.d.ts +21 -4
  19. package/dist/botlit/hooks/useChannelSetup.js +128 -32
  20. package/dist/botlit/hooks/useChannelSetup.js.map +1 -1
  21. package/dist/botlit/pages/AgentDetailPage.js +75 -70
  22. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  23. package/dist/botlit/pages/BotChannelsTab.js +1 -0
  24. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  25. package/dist/botlit/pages/ChannelDetailPage.js +381 -380
  26. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  27. package/dist/botlit/pages/ExecutionDetailPage.js +141 -136
  28. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  29. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +356 -354
  30. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  31. package/package.json +1 -1
@@ -15,6 +15,11 @@ interface InboundWebhookCardProps {
15
15
  workspaceId: string | undefined;
16
16
  /** Platform-specific instructions for where the URL goes. */
17
17
  hint?: string;
18
+ /**
19
+ * False when the platform does not call a URL (Discord delivers over the
20
+ * bot's Gateway): once bound, only the setup instructions are shown.
21
+ */
22
+ usesInboundUrl?: boolean;
18
23
  onRefresh: () => void;
19
24
  }
20
25
  export declare const InboundWebhookCard: FC<InboundWebhookCardProps>;
@@ -60,38 +60,42 @@ var x = ({ definition: e, values: t, onChange: n }) => /* @__PURE__ */ m("div",
60
60
  async function S(e, t) {
61
61
  await u(e) ? (b.success(`${t} copied`), l() && d("Copied")) : b.error(`Could not copy the ${t.toLowerCase()}`);
62
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", {
63
+ var C = ({ channel: s, loading: l, error: u, connectorActive: d, workspaceId: f, hint: g, usesInboundUrl: b = !0, onRefresh: x }) => {
64
+ let C = !!(s && f && s.inboundWorkspaceId === f), w;
65
+ if (l && !s) w = /* @__PURE__ */ m("div", {
66
66
  className: "flex items-center gap-2 py-2 text-sm text-text-secondary",
67
67
  children: [/* @__PURE__ */ p(v, {
68
68
  size: 14,
69
69
  className: "animate-spin"
70
70
  }), "Loading the channel…"]
71
71
  });
72
- else if (u) C = /* @__PURE__ */ p("p", {
72
+ else if (u) w = /* @__PURE__ */ p("p", {
73
73
  className: "text-sm text-status-error-text",
74
74
  children: u.message
75
75
  });
76
- else if (!s) C = /* @__PURE__ */ p("p", {
76
+ else if (!s) w = /* @__PURE__ */ p("p", {
77
77
  className: "text-sm text-text-secondary",
78
78
  children: "The linked channel was not found. Edit the connector or create a new one with credentials."
79
79
  });
80
- else if (!d) C = /* @__PURE__ */ p("p", {
80
+ else if (!d) w = /* @__PURE__ */ p("p", {
81
81
  className: "text-sm text-text-secondary",
82
82
  children: "Activate this connector to bind the channel to this workspace. The platform can only deliver messages to an active connector."
83
83
  });
84
- else if (!x) C = /* @__PURE__ */ p("p", {
84
+ else if (!C) w = /* @__PURE__ */ p("p", {
85
85
  className: "text-sm text-text-secondary",
86
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
87
  });
88
- else if (!s.inboundWebhookUrl) C = /* @__PURE__ */ p("p", {
88
+ else if (!b) w = /* @__PURE__ */ p("p", {
89
+ className: "text-sm text-text-secondary",
90
+ children: g ?? "The channel is bound to this workspace and receives messages."
91
+ });
92
+ else if (!s.inboundWebhookUrl) w = /* @__PURE__ */ p("p", {
89
93
  className: "text-sm text-text-secondary",
90
94
  children: "The channel is bound, but the platform does not publish an inbound webhook URL in this environment yet."
91
95
  });
92
96
  else {
93
97
  let e = s.inboundWebhookUrl;
94
- C = /* @__PURE__ */ m("div", {
98
+ w = /* @__PURE__ */ m("div", {
95
99
  className: "space-y-3",
96
100
  children: [/* @__PURE__ */ m("div", {
97
101
  className: "flex gap-2",
@@ -117,22 +121,22 @@ var C = ({ channel: s, loading: l, error: u, connectorActive: d, workspaceId: f,
117
121
  className: "flex flex-row items-start justify-between",
118
122
  children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m(i, {
119
123
  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", {
124
+ children: [/* @__PURE__ */ p(_, { size: 18 }), b ? "Inbound Webhook" : "Inbound Messages"]
125
+ }), /* @__PURE__ */ p(n, { children: b ? "The platform sends incoming messages for this channel to this URL" : "How the platform delivers incoming messages for this channel" })] }), /* @__PURE__ */ m("div", {
122
126
  className: "flex items-center gap-2",
123
127
  children: [s && /* @__PURE__ */ p(o, {
124
- variant: x ? "success" : "outline",
125
- children: x ? "Bound to this workspace" : "Not bound"
128
+ variant: C ? "success" : "outline",
129
+ children: C ? "Bound to this workspace" : "Not bound"
126
130
  }), /* @__PURE__ */ p(a, {
127
131
  variant: "ghost",
128
132
  size: "icon",
129
133
  "aria-label": "Refresh the channel",
130
134
  title: "Refresh",
131
- onClick: b,
135
+ onClick: x,
132
136
  children: /* @__PURE__ */ p(y, { size: 14 })
133
137
  })]
134
138
  })]
135
- }), /* @__PURE__ */ p(t, { children: C })] });
139
+ }), /* @__PURE__ */ p(t, { children: w })] });
136
140
  };
137
141
  export { x as ChannelCredentialFields, C as InboundWebhookCard };
138
142
 
@@ -1 +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,GAAD;KACE,cAAYD,EAAM;KAClB,MAAMA,EAAM,SAAS,aAAaA,EAAM,MAAM,QAAQ;KACtD,cAAa;KACb,aAAaA,EAAM;KACnB,OAAOE,EAAOF,EAAM,QAAQ;KAC5B,WAAW,MAAUG,EAAS;MAAE,GAAGD;OAASF,EAAM,MAAMI,EAAM,OAAO;KAAM,CAAC;IAC7E,CAAA;IACAJ,EAAM,eACL,kBAACK,GAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,kBAACC,GAAD,EAAW,MAAM,GAAK,CAAA;KAChC,eAAeH,EAAS;MAAE,GAAGD;OAASF,EAAM,MAAMO,EAAsB;KAAE,CAAC;KAC5E,UAAA;IAEO,CAAA;IAETP,EAAM,eAAeE,EAAOF,EAAM,QACjC,kBAACK,GAAD;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G,WAAU;EAA8B,UAAA;CAGxC,CAAA;MAEA;EACL,IAAMO,IAAMP,EAAQ;EACpB,IACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAClB,GAAD;KACE,cAAW;KACX,OAAOyB;KACP,UAAA;KACA,WAAU;KACV,UAAU,MAAUtB,EAAM,cAAc,OAAO;IAChD,CAAA,GACD,kBAACC,GAAD;KACE,SAAQ;KACR,UAAU,kBAACI,GAAD,EAAM,MAAM,GAAK,CAAA;KAC3B,eAAe,KAAKD,EAAgBkB,GAAK,aAAa;KACvD,UAAA;IAEO,CAAA,CACL;GACJ,CAAA,GAAAC,KAAQ,kBAAC,KAAD;IAAG,WAAU;IAA+B,UAAAA;GAAQ,CAAA,CAC1D;;CAET;CAEA,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAY,WAAU;EAAtB,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAACC,GAAD;GAAW,WAAU;GAArB,UAAA,CACE,kBAACC,GAAD,EAAO,MAAM,GAAK,CAAA,GAAC,iBAEV;EACX,CAAA,GAAA,kBAACC,GAAD,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"}
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","usesInboundUrl","hint","url","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 /**\n * False when the platform does not call a URL (Discord delivers over the\n * bot's Gateway): once bound, only the setup instructions are shown.\n */\n usesInboundUrl?: boolean;\n onRefresh: () => void;\n}\n\nexport const InboundWebhookCard: FC<InboundWebhookCardProps> = ({\n channel,\n loading,\n error,\n connectorActive,\n workspaceId,\n hint,\n usesInboundUrl = true,\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 (!usesInboundUrl) {\n body = (\n <p className=\"text-sm text-text-secondary\">\n {hint ?? 'The channel is bound to this workspace and receives messages.'}\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 {usesInboundUrl ? 'Inbound Webhook' : 'Inbound Messages'}\n </CardTitle>\n <CardDescription>\n {usesInboundUrl\n ? 'The platform sends incoming messages for this channel to this URL'\n : 'How the platform delivers incoming messages for this channel'}\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,GAAD;KACE,cAAYD,EAAM;KAClB,MAAMA,EAAM,SAAS,aAAaA,EAAM,MAAM,QAAQ;KACtD,cAAa;KACb,aAAaA,EAAM;KACnB,OAAOE,EAAOF,EAAM,QAAQ;KAC5B,WAAW,MAAUG,EAAS;MAAE,GAAGD;OAASF,EAAM,MAAMI,EAAM,OAAO;KAAM,CAAC;IAC7E,CAAA;IACAJ,EAAM,eACL,kBAACK,GAAD;KACE,MAAK;KACL,SAAQ;KACR,UAAU,kBAACC,GAAD,EAAW,MAAM,GAAK,CAAA;KAChC,eAAeH,EAAS;MAAE,GAAGD;OAASF,EAAM,MAAMO,EAAsB;KAAE,CAAC;KAC5E,UAAA;IAEO,CAAA;IAETP,EAAM,eAAeE,EAAOF,EAAM,QACjC,kBAACK,GAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,cAAY,QAAQL,EAAM;KAC1B,OAAO,QAAQA,EAAM;KACrB,eAAe,KAAKQ,EAAgBN,EAAOF,EAAM,QAAQ,IAAIA,EAAM,KAAK;KAExE,UAAA,kBAACS,GAAD,EAAM,MAAM,GAAK,CAAA;IACX,CAAA;GAEP;;CACI,GAjCKT,EAAM,GAiCX,CACZ,GACD,kBAAC,KAAD;EAAG,W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E,cAAW;KACX,OAAO2B;KACP,UAAA;KACA,WAAU;KACV,UAAU,MAAUxB,EAAM,cAAc,OAAO;IAChD,CAAA,GACD,kBAACC,GAAD;KACE,SAAQ;KACR,UAAU,kBAACI,GAAD,EAAM,MAAM,GAAK,CAAA;KAC3B,eAAe,KAAKD,EAAgBoB,GAAK,aAAa;KACvD,UAAA;IAEO,CAAA,CACL;GACJ,CAAA,GAAAD,KAAQ,kBAAC,KAAD;IAAG,WAAU;IAA+B,UAAAA;GAAQ,CAAA,CAC1D;;CAET;CAEA,OACE,kBAACE,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAY,WAAU;EAAtB,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAACC,GAAD;GAAW,WAAU;GAArB,UAAA,CACE,kBAACC,GAAD,EAAO,MAAM,GAAK,CAAA,GACjBN,IAAiB,oBAAoB,kBAC7B;EACX,CAAA,GAAA,kBAACO,GAAD,EAAA,UACGP,IACG,sEACA,+DACW,CAAA,CACd,EAAA,CAAA,GACL,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACGP,KACC,kBAACe,GAAD;IAAO,SAAShB,IAAY,YAAY;IACrC,UAAAA,IAAY,4BAA4B;GACpC,CAAA,GAET,kBAACb,GAAD;IACE,SAAQ;IACR,MAAK;IACL,cAAW;IACX,OAAM;IACN,SAAS8B;IAET,UAAA,kBAAC7B,GAAD,EAAW,MAAM,GAAK,CAAA;GAChB,CAAA,CACL;EACK,CAAA,CAAA;CACZ,CAAA,GAAA,kBAAC8B,GAAD,EAAA,UAAcf,EAAkB,CAAA,CAC5B,EAAA,CAAA;AAEV"}
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ export declare const ExecutionFeedback: FC<{
3
+ executionId: string;
4
+ status: string;
5
+ }>;
@@ -0,0 +1,55 @@
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { useExecutionFeedback as t, useRateExecution as n } from "../hooks/useAgentTuning.js";
3
+ import { Button as r } from "./Button.js";
4
+ import { Card as i, CardContent as a } from "./Card.js";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { ThumbsDown as c, ThumbsUp as l } from "lucide-react";
7
+ import { toast as u } from "sonner";
8
+ // src/botlit/components/ExecutionFeedback.tsx
9
+ var d = ({ executionId: d, status: f }) => {
10
+ let p = e(), { data: m, refetch: h } = t(f === "COMPLETED" ? d : void 0), [g, _] = n();
11
+ if (f !== "COMPLETED") return null;
12
+ let v = m?.feedbackRating ?? null, y = async (e) => {
13
+ try {
14
+ await g({
15
+ id: d,
16
+ rating: e
17
+ }), await h(), u.success(e === "CLEAR" ? p("botlit.executionFeedback.cleared", "Rating removed.") : p("botlit.executionFeedback.saved", "Rating saved. It is used for this agent’s tuning suggestions."));
18
+ } catch (e) {
19
+ u.error(e instanceof Error ? e.message : String(e));
20
+ }
21
+ };
22
+ return /* @__PURE__ */ o(i, {
23
+ "data-testid": "execution-feedback",
24
+ children: /* @__PURE__ */ s(a, {
25
+ className: "flex flex-wrap items-center gap-3 pt-5",
26
+ children: [
27
+ /* @__PURE__ */ o("p", {
28
+ className: "text-sm text-text-secondary",
29
+ children: p("botlit.executionFeedback.prompt", "Was this answer good?")
30
+ }),
31
+ /* @__PURE__ */ o(r, {
32
+ size: "sm",
33
+ variant: v === 1 ? "primary" : "outline",
34
+ leftIcon: /* @__PURE__ */ o(l, { size: 14 }),
35
+ "aria-pressed": v === 1,
36
+ disabled: _.loading,
37
+ onClick: () => void y(v === 1 ? "CLEAR" : "GOOD"),
38
+ children: p("botlit.executionFeedback.good", "Good")
39
+ }),
40
+ /* @__PURE__ */ o(r, {
41
+ size: "sm",
42
+ variant: v === -1 ? "destructive" : "outline",
43
+ leftIcon: /* @__PURE__ */ o(c, { size: 14 }),
44
+ "aria-pressed": v === -1,
45
+ disabled: _.loading,
46
+ onClick: () => void y(v === -1 ? "CLEAR" : "POOR"),
47
+ children: p("botlit.executionFeedback.poor", "Poor")
48
+ })
49
+ ]
50
+ })
51
+ });
52
+ };
53
+ export { d as ExecutionFeedback };
54
+
55
+ //# sourceMappingURL=ExecutionFeedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionFeedback.js","names":["ExecutionFeedback","t","useTr","useExecutionFeedback","status","executionId","rate","rateState","useRateExecution","rating","data","submit","next","refetch","toast","err","Card","CardContent","Button","ThumbsUp","ThumbsDown"],"sources":["../../../src/botlit/components/ExecutionFeedback.tsx"],"sourcesContent":["/**\n * A reviewer's rating of a run's answer (BOFF-15360).\n *\n * Good/poor ratings are evidence for the agent's tuning suggestions: answers\n * rated poor feed a prompt-edit suggestion. Only a completed run can be rated.\n * @module botlit/components\n */\nimport type { FC } from 'react';\nimport { toast } from 'sonner';\nimport { ThumbsDown, ThumbsUp } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n type ExecutionFeedbackRating,\n useExecutionFeedback,\n useRateExecution,\n} from '../hooks/useAgentTuning';\nimport { Button } from './Button';\nimport { Card, CardContent } from './Card';\n\nexport const ExecutionFeedback: FC<{ executionId: string; status: string }> = ({\n executionId,\n status,\n}) => {\n const t = useTr();\n // Only a completed run can be rated, so only then is its rating read.\n const { data, refetch } = useExecutionFeedback(status === 'COMPLETED' ? executionId : undefined);\n const [rate, rateState] = useRateExecution();\n if (status !== 'COMPLETED') return null;\n const rating = data?.feedbackRating ?? null;\n\n const submit = async (next: ExecutionFeedbackRating) => {\n try {\n await rate({ id: executionId, rating: next });\n await refetch();\n toast.success(\n next === 'CLEAR'\n ? t('botlit.executionFeedback.cleared', 'Rating removed.')\n : t(\n 'botlit.executionFeedback.saved',\n 'Rating saved. It is used for this agent’s tuning suggestions.'\n )\n );\n } catch (err) {\n toast.error(err instanceof Error ? err.message : String(err));\n }\n };\n\n return (\n <Card data-testid=\"execution-feedback\">\n <CardContent className=\"flex flex-wrap items-center gap-3 pt-5\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.executionFeedback.prompt', 'Was this answer good?')}\n </p>\n <Button\n size=\"sm\"\n variant={rating === 1 ? 'primary' : 'outline'}\n leftIcon={<ThumbsUp size={14} />}\n aria-pressed={rating === 1}\n disabled={rateState.loading}\n onClick={() => void submit(rating === 1 ? 'CLEAR' : 'GOOD')}\n >\n {t('botlit.executionFeedback.good', 'Good')}\n </Button>\n <Button\n size=\"sm\"\n variant={rating === -1 ? 'destructive' : 'outline'}\n leftIcon={<ThumbsDown size={14} />}\n aria-pressed={rating === -1}\n disabled={rateState.loading}\n onClick={() => void submit(rating === -1 ? 'CLEAR' : 'POOR')}\n >\n {t('botlit.executionFeedback.poor', 'Poor')}\n </Button>\n </CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;;;;AAmBA,IAAaA,KAAkE,EAC7E,gBACA,gBACI;CACJ,IAAMC,IAAIC,EAAM,GAEV,EAAE,SAAM,eAAYC,EAAqBC,MAAW,cAAcC,IAAc,KAAA,CAAS,GACzF,CAACC,GAAMC,KAAaC,EAAiB;CAC3C,IAAIJ,MAAW,aAAa,OAAO;CACnC,IAAMK,IAASC,GAAM,kBAAkB,MAEjCC,IAAS,OAAO,MAAkC;EACtD,IAAI;GAGF,AAFA,MAAML,EAAK;IAAE,IAAID;IAAa,QAAQO;GAAK,CAAC,GAC5C,MAAMC,EAAQ,GACdC,EAAM,QACJF,MAAS,UACLX,EAAE,oCAAoC,iBAAiB,IACvDA,EACE,kCACA,+DACF,CACN;EACF,SAASc,GAAK;GACZ,EAAM,MAAMA,aAAe,QAAQA,EAAI,UAAU,OAAOA,CAAG,CAAC;EAC9D;CACF;CAEA,OACE,kBAACC,GAAD;EAAM,eAAY;EAChB,UAAA,kBAACC,GAAD;GAAa,WAAU;GAAvB,UAAA;IACE,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAhB,EAAE,mCAAmC,uBAAuB;IAC5D,CAAA;IACH,kBAACiB,GAAD;KACE,MAAK;KACL,SAAST,MAAW,IAAI,YAAY;KACpC,UAAU,kBAACU,GAAD,EAAU,MAAM,GAAK,CAAA;KAC/B,gBAAcV,MAAW;KACzB,UAAUF,EAAU;KACpB,eAAe,KAAKI,EAAOF,MAAW,IAAI,UAAU,MAAM;KAEzD,UAAAR,EAAE,iCAAiC,MAAM;IACpC,CAAA;IACR,kBAACiB,GAAD;KACE,MAAK;KACL,SAAST,MAAW,KAAK,gBAAgB;KACzC,UAAU,kBAACW,GAAD,EAAY,MAAM,GAAK,CAAA;KACjC,gBAAcX,MAAW;KACzB,UAAUF,EAAU;KACpB,eAAe,KAAKI,EAAOF,MAAW,KAAK,UAAU,MAAM;KAE1D,UAAAR,EAAE,iCAAiC,MAAM;IACpC,CAAA;GACG;;CACT,CAAA;AAEV"}
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ export declare const MAX_REVIEW_INTERVAL_DAYS = 3650;
3
+ /** Parse the interval field: null for blank (no schedule), undefined for invalid. */
4
+ export declare function parseIntervalDays(value: string): number | null | undefined;
5
+ export declare const KnowledgeReviewSchedule: FC<{
6
+ knowledgeBaseId: string;
7
+ }>;
@@ -0,0 +1,92 @@
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { useKnowledgeReviewSchedule as t, useMarkKnowledgeReviewed as n, useSetKnowledgeRefreshInterval as r } from "../hooks/useAgentTuning.js";
3
+ import { formatRelativeTime as i } from "../utils/formatters.js";
4
+ import { Button as a } from "./Button.js";
5
+ import { Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u } from "./Card.js";
6
+ import { useEffect as d, useState as f } from "react";
7
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ import { CalendarClock as h } from "lucide-react";
9
+ import { toast as g } from "sonner";
10
+ // src/botlit/components/KnowledgeReviewSchedule.tsx
11
+ var _ = 3650;
12
+ function v(e) {
13
+ let t = e.trim();
14
+ if (t === "") return null;
15
+ if (!/^\d+$/u.test(t)) return;
16
+ let n = Number(t);
17
+ return n >= 1 && n <= 3650 ? n : void 0;
18
+ }
19
+ var y = ({ knowledgeBaseId: _ }) => {
20
+ let y = e(), { data: b, refetch: x } = t(_), [S, C] = r(), [w, T] = n(), [E, D] = f("");
21
+ d(() => {
22
+ D(b?.refreshIntervalDays == null ? "" : String(b.refreshIntervalDays));
23
+ }, [b?.refreshIntervalDays]);
24
+ let O = v(E), k = O === (b?.refreshIntervalDays ?? null), A = async () => {
25
+ if (O !== void 0) try {
26
+ await S({
27
+ id: _,
28
+ days: O
29
+ }), await x(), g.success(y("botlit.kbReview.saved", "Review schedule saved."));
30
+ } catch (e) {
31
+ g.error(e instanceof Error ? e.message : String(e));
32
+ }
33
+ }, j = async () => {
34
+ try {
35
+ await w(_), await x(), g.success(y("botlit.kbReview.markedReviewed", "Marked reviewed."));
36
+ } catch (e) {
37
+ g.error(e instanceof Error ? e.message : String(e));
38
+ }
39
+ };
40
+ return /* @__PURE__ */ m(o, {
41
+ "data-testid": "knowledge-review-schedule",
42
+ children: [/* @__PURE__ */ m(l, { children: [/* @__PURE__ */ m(u, {
43
+ className: "flex items-center gap-2",
44
+ children: [/* @__PURE__ */ p(h, {
45
+ size: 18,
46
+ "aria-hidden": "true"
47
+ }), y("botlit.kbReview.title", "Review schedule")]
48
+ }), /* @__PURE__ */ p(c, { children: y("botlit.kbReview.description", "How often these sources must be checked. Past the interval, agents using this knowledge base get an overdue-knowledge suggestion.") })] }), /* @__PURE__ */ m(s, {
49
+ className: "flex flex-wrap items-end gap-3",
50
+ children: [
51
+ /* @__PURE__ */ m("label", {
52
+ className: "flex flex-col gap-1 text-sm text-text-secondary",
53
+ children: [y("botlit.kbReview.intervalLabel", "Review every (days)"), /* @__PURE__ */ p("input", {
54
+ type: "text",
55
+ inputMode: "numeric",
56
+ value: E,
57
+ onChange: (e) => D(e.target.value),
58
+ placeholder: y("botlit.kbReview.noSchedule", "No schedule"),
59
+ "aria-invalid": O === void 0,
60
+ className: "w-40 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary"
61
+ })]
62
+ }),
63
+ /* @__PURE__ */ p(a, {
64
+ size: "sm",
65
+ disabled: O === void 0 || k || C.loading,
66
+ isLoading: C.loading,
67
+ onClick: () => void A(),
68
+ children: y("botlit.kbReview.save", "Save")
69
+ }),
70
+ /* @__PURE__ */ p(a, {
71
+ size: "sm",
72
+ variant: "outline",
73
+ isLoading: T.loading,
74
+ onClick: () => void j(),
75
+ children: y("botlit.kbReview.markReviewed", "Mark reviewed")
76
+ }),
77
+ /* @__PURE__ */ p("p", {
78
+ className: "text-sm text-text-secondary",
79
+ children: b?.lastReviewedAt ? y("botlit.kbReview.lastReviewed", "Last reviewed {{when}}", { when: i(b.lastReviewedAt) }) : y("botlit.kbReview.neverReviewed", "Never reviewed")
80
+ }),
81
+ O === void 0 && /* @__PURE__ */ p("p", {
82
+ className: "w-full text-sm text-status-error-text",
83
+ role: "alert",
84
+ children: y("botlit.kbReview.invalid", "Enter a whole number of days from 1 to {{max}}, or leave it blank.", { max: 3650 })
85
+ })
86
+ ]
87
+ })]
88
+ });
89
+ };
90
+ export { y as KnowledgeReviewSchedule, _ as MAX_REVIEW_INTERVAL_DAYS, v as parseIntervalDays };
91
+
92
+ //# sourceMappingURL=KnowledgeReviewSchedule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnowledgeReviewSchedule.js","names":["MAX_REVIEW_INTERVAL_DAYS","parseIntervalDays","trimmed","value","days","KnowledgeReviewSchedule","t","useTr","useKnowledgeReviewSchedule","knowledgeBaseId","setRefreshInterval","setState","useSetKnowledgeRefreshInterval","markReviewed","markState","useMarkKnowledgeReviewed","setValue","useState","data","parsed","unchanged","save","refetch","toast","err","reviewed","Card","CardHeader","CardTitle","CalendarClock","CardDescription","CardContent","event","Button","formatRelativeTime"],"sources":["../../../src/botlit/components/KnowledgeReviewSchedule.tsx"],"sourcesContent":["/**\n * Review schedule of a knowledge base's sources (BOFF-15360, ABOUT §9).\n *\n * The owner sets how often the sources must be reviewed. Past that interval,\n * the knowledge base is overdue: the supervisor raises a finding and agents\n * that use it get an overdue-knowledge suggestion. \"Mark reviewed\" records\n * that a person confirmed the sources are current.\n * @module botlit/components\n */\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { toast } from 'sonner';\nimport { CalendarClock } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n useKnowledgeReviewSchedule,\n useMarkKnowledgeReviewed,\n useSetKnowledgeRefreshInterval,\n} from '../hooks/useAgentTuning';\nimport { formatRelativeTime } from '../utils/formatters';\nimport { Button } from './Button';\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from './Card';\n\nexport const MAX_REVIEW_INTERVAL_DAYS = 3650;\n\n/** Parse the interval field: null for blank (no schedule), undefined for invalid. */\nexport function parseIntervalDays(value: string): number | null | undefined {\n const trimmed = value.trim();\n if (trimmed === '') return null;\n if (!/^\\d+$/u.test(trimmed)) return undefined;\n const days = Number(trimmed);\n return days >= 1 && days <= MAX_REVIEW_INTERVAL_DAYS ? days : undefined;\n}\n\nexport const KnowledgeReviewSchedule: FC<{ knowledgeBaseId: string }> = ({ knowledgeBaseId }) => {\n const t = useTr();\n const { data, refetch } = useKnowledgeReviewSchedule(knowledgeBaseId);\n const [setRefreshInterval, setState] = useSetKnowledgeRefreshInterval();\n const [markReviewed, markState] = useMarkKnowledgeReviewed();\n const [value, setValue] = useState('');\n\n useEffect(() => {\n setValue(data?.refreshIntervalDays != null ? String(data.refreshIntervalDays) : '');\n }, [data?.refreshIntervalDays]);\n\n const parsed = parseIntervalDays(value);\n const unchanged = parsed === (data?.refreshIntervalDays ?? null);\n\n const save = async () => {\n if (parsed === undefined) return;\n try {\n await setRefreshInterval({ id: knowledgeBaseId, days: parsed });\n await refetch();\n toast.success(t('botlit.kbReview.saved', 'Review schedule saved.'));\n } catch (err) {\n toast.error(err instanceof Error ? err.message : String(err));\n }\n };\n\n const reviewed = async () => {\n try {\n await markReviewed(knowledgeBaseId);\n await refetch();\n toast.success(t('botlit.kbReview.markedReviewed', 'Marked reviewed.'));\n } catch (err) {\n toast.error(err instanceof Error ? err.message : String(err));\n }\n };\n\n return (\n <Card data-testid=\"knowledge-review-schedule\">\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <CalendarClock size={18} aria-hidden=\"true\" />\n {t('botlit.kbReview.title', 'Review schedule')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.kbReview.description',\n 'How often these sources must be checked. Past the interval, agents using this knowledge base get an overdue-knowledge suggestion.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"flex flex-wrap items-end gap-3\">\n <label className=\"flex flex-col gap-1 text-sm text-text-secondary\">\n {t('botlit.kbReview.intervalLabel', 'Review every (days)')}\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={value}\n onChange={(event) => setValue(event.target.value)}\n placeholder={t('botlit.kbReview.noSchedule', 'No schedule')}\n aria-invalid={parsed === undefined}\n className=\"w-40 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n />\n </label>\n <Button\n size=\"sm\"\n disabled={parsed === undefined || unchanged || setState.loading}\n isLoading={setState.loading}\n onClick={() => void save()}\n >\n {t('botlit.kbReview.save', 'Save')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n isLoading={markState.loading}\n onClick={() => void reviewed()}\n >\n {t('botlit.kbReview.markReviewed', 'Mark reviewed')}\n </Button>\n <p className=\"text-sm text-text-secondary\">\n {data?.lastReviewedAt\n ? t('botlit.kbReview.lastReviewed', 'Last reviewed {{when}}', {\n when: formatRelativeTime(data.lastReviewedAt),\n })\n : t('botlit.kbReview.neverReviewed', 'Never reviewed')}\n </p>\n {parsed === undefined && (\n <p className=\"w-full text-sm text-status-error-text\" role=\"alert\">\n {t(\n 'botlit.kbReview.invalid',\n 'Enter a whole number of days from 1 to {{max}}, or leave it blank.',\n {\n max: MAX_REVIEW_INTERVAL_DAYS,\n }\n )}\n </p>\n )}\n </CardContent>\n </Card>\n );\n};\n"],"mappings":";;;;;;;;;;AAuBA,IAAaA,IAA2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3
+ /** Execution ids the card's evidence links to, by signal. */
4
+ export declare function evidenceExecutionIds(evidence: Record<string, unknown>): string[];
5
+ /** Whether accepting the suggestion changes the agent draft. */
6
+ export declare function changesDraft(suggestion: AgentSuggestion): boolean;
7
+ export interface SuggestionsPanelProps {
8
+ agentId: string;
9
+ /** Called after an accepted suggestion changed the agent draft, so the page can refresh it. */
10
+ onDraftChanged?: () => void;
11
+ }
12
+ export declare const SuggestionsPanel: FC<SuggestionsPanelProps>;
@@ -0,0 +1,219 @@
1
+ import { useTr as e } from "../../shared/hooks/useTr.js";
2
+ import { useAcceptAgentSuggestion as t, useAgentSuggestions as n, useDismissAgentSuggestion as r, useSuggestAgentImprovements as i } from "../hooks/useAgentTuning.js";
3
+ import { useBotlit as a } from "../providers/BotlitProvider.js";
4
+ import { formatRelativeTime as o } from "../utils/formatters.js";
5
+ import { Badge as s } from "./Badge.js";
6
+ import { Button as c } from "./Button.js";
7
+ import { Card as l, CardContent as u, CardDescription as d, CardHeader as f, CardTitle as p } from "./Card.js";
8
+ import { EmptyState as m } from "./EmptyState.js";
9
+ import { useState as h } from "react";
10
+ import { AlertDialog as g, AlertDialogAction as _, AlertDialogCancel as v, AlertDialogContent as y, AlertDialogDescription as b, AlertDialogFooter as x, AlertDialogHeader as S, AlertDialogTitle as C } from "@burdenoff/fe-libs/ui";
11
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
12
+ import { Link as E } from "react-router";
13
+ import { Check as D, Lightbulb as O, RefreshCw as k, X as A } from "lucide-react";
14
+ import { toast as j } from "sonner";
15
+ // src/botlit/components/SuggestionsPanel.tsx
16
+ var M = {
17
+ CRITICAL: "destructive",
18
+ WARNING: "warning",
19
+ INFO: "secondary"
20
+ };
21
+ function N(e) {
22
+ let t = e.executionIds;
23
+ if (!t || typeof t != "object") return [];
24
+ let n = Object.values(t).flatMap((e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : []);
25
+ return [...new Set(n)];
26
+ }
27
+ function P(e) {
28
+ return e.change?.type === "SYSTEM_PROMPT" || e.change?.type === "MODEL";
29
+ }
30
+ var F = ({ suggestion: t, busy: n, onAccept: r, onDismiss: i }) => {
31
+ let d = e(), { getPath: f } = a(), [p, m] = h(!1), g = N(t.evidence), _ = typeof t.evidence.runs == "number" ? t.evidence.runs : null, v = t.change;
32
+ return /* @__PURE__ */ w(l, {
33
+ "data-testid": "agent-suggestion-card",
34
+ children: /* @__PURE__ */ T(u, {
35
+ className: "space-y-3 pt-5",
36
+ children: [
37
+ /* @__PURE__ */ T("div", {
38
+ className: "flex flex-wrap items-center gap-2",
39
+ children: [
40
+ /* @__PURE__ */ w("h3", {
41
+ className: "font-semibold text-text-primary",
42
+ children: t.title
43
+ }),
44
+ /* @__PURE__ */ w(s, {
45
+ variant: M[t.severity] ?? "secondary",
46
+ children: t.severity
47
+ }),
48
+ /* @__PURE__ */ w(s, {
49
+ variant: "outline",
50
+ children: t.draftedBy === "MODEL" ? d("botlit.suggestions.draftedByModel", "Drafted by the agent model") : d("botlit.suggestions.draftedByRules", "Drafted from rules")
51
+ }),
52
+ /* @__PURE__ */ w("span", {
53
+ className: "text-xs text-text-tertiary",
54
+ children: o(t.generatedAt)
55
+ })
56
+ ]
57
+ }),
58
+ /* @__PURE__ */ w("p", {
59
+ className: "text-sm text-text-secondary",
60
+ children: t.recommendation
61
+ }),
62
+ t.topics.length > 0 && /* @__PURE__ */ w("div", {
63
+ className: "flex flex-wrap gap-2",
64
+ "aria-label": d("botlit.suggestions.topics", "Topics"),
65
+ children: t.topics.map((e) => /* @__PURE__ */ w(s, {
66
+ variant: "secondary",
67
+ children: e
68
+ }, e))
69
+ }),
70
+ v?.type === "MODEL" && /* @__PURE__ */ w("p", {
71
+ className: "text-sm text-text-secondary",
72
+ children: d("botlit.suggestions.modelChange", "Primary model: {{before}} → {{after}}", {
73
+ before: v.before ?? d("botlit.suggestions.none", "none"),
74
+ after: v.after ?? ""
75
+ })
76
+ }),
77
+ v?.type === "SYSTEM_PROMPT" && /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(c, {
78
+ variant: "ghost",
79
+ size: "sm",
80
+ onClick: () => m((e) => !e),
81
+ children: p ? d("botlit.suggestions.hidePrompt", "Hide proposed prompt") : d("botlit.suggestions.showPrompt", "Show proposed prompt")
82
+ }), p && /* @__PURE__ */ T("div", {
83
+ className: "mt-2 grid gap-3 md:grid-cols-2",
84
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
85
+ className: "mb-1 text-xs font-medium text-text-secondary",
86
+ children: d("botlit.suggestions.currentPrompt", "Current draft")
87
+ }), /* @__PURE__ */ w("pre", {
88
+ className: "max-h-64 overflow-auto whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 font-mono text-xs",
89
+ children: v.before ?? ""
90
+ })] }), /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
91
+ className: "mb-1 text-xs font-medium text-text-secondary",
92
+ children: d("botlit.suggestions.proposedPrompt", "Proposed")
93
+ }), /* @__PURE__ */ w("pre", {
94
+ className: "max-h-64 overflow-auto whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 font-mono text-xs",
95
+ "data-testid": "agent-suggestion-proposed-prompt",
96
+ children: v.after ?? ""
97
+ })] })]
98
+ })] }),
99
+ (_ !== null || g.length > 0) && /* @__PURE__ */ T("div", {
100
+ className: "flex flex-wrap items-center gap-2 text-xs text-text-secondary",
101
+ children: [
102
+ _ !== null && /* @__PURE__ */ w("span", { children: d("botlit.suggestions.runsAnalyzed", "From {{runs}} recent runs", { runs: _ }) }),
103
+ g.map((e, t) => /* @__PURE__ */ w(E, {
104
+ to: f(`executions/${e}`),
105
+ className: "text-text-link underline",
106
+ children: d("botlit.suggestions.runLink", "Run {{n}}", { n: t + 1 })
107
+ }, e)),
108
+ v?.type === "KNOWLEDGE_REVIEW" && v.knowledgeBaseId && /* @__PURE__ */ w(E, {
109
+ to: f(`knowledge/${v.knowledgeBaseId}`),
110
+ className: "text-text-link underline",
111
+ children: d("botlit.suggestions.openKnowledgeBase", "Open knowledge base")
112
+ })
113
+ ]
114
+ }),
115
+ /* @__PURE__ */ T("div", {
116
+ className: "flex gap-2",
117
+ children: [/* @__PURE__ */ w(c, {
118
+ size: "sm",
119
+ leftIcon: /* @__PURE__ */ w(D, { size: 14 }),
120
+ disabled: n,
121
+ onClick: () => r(t),
122
+ children: P(t) ? d("botlit.suggestions.applyToDraft", "Apply to draft") : v?.type === "KNOWLEDGE_REVIEW" ? d("botlit.suggestions.markReviewed", "Mark reviewed") : d("botlit.suggestions.acknowledge", "Accept")
123
+ }), /* @__PURE__ */ w(c, {
124
+ size: "sm",
125
+ variant: "outline",
126
+ leftIcon: /* @__PURE__ */ w(A, { size: 14 }),
127
+ disabled: n,
128
+ onClick: () => i(t),
129
+ children: d("botlit.suggestions.dismiss", "Dismiss")
130
+ })]
131
+ })
132
+ ]
133
+ })
134
+ });
135
+ }, I = ({ agentId: a, onDraftChanged: o }) => {
136
+ let s = e(), { data: E, loading: D, error: A, refetch: M } = n(a), [N, I] = i(), [L, R] = t(), [z, B] = r(), [V, H] = h(null), U = I.loading || R.loading || B.loading, W = async () => {
137
+ try {
138
+ let e = await N(a);
139
+ await M(), j.success(e.suggestions.length > 0 ? s("botlit.suggestions.generated", "{{count}} suggestions from {{runs}} runs", {
140
+ count: e.suggestions.length,
141
+ runs: e.runsAnalyzed
142
+ }) : s("botlit.suggestions.noneFound", "No suggestions: {{runs}} runs in the last {{days}} days do not show a pattern to act on.", {
143
+ runs: e.runsAnalyzed,
144
+ days: e.windowDays
145
+ }));
146
+ } catch (e) {
147
+ j.error(e instanceof Error ? e.message : String(e));
148
+ }
149
+ }, G = async () => {
150
+ let e = V;
151
+ if (H(null), e) try {
152
+ let t = await L(e.id);
153
+ await M(), t.draftChanged ? (o?.(), j.success(s("botlit.suggestions.appliedToDraft", "Applied to the draft. Publish the agent to put the change live."))) : j.success(s("botlit.suggestions.accepted", "Suggestion accepted."));
154
+ } catch (e) {
155
+ j.error(e instanceof Error ? e.message : String(e));
156
+ }
157
+ }, K = async (e) => {
158
+ try {
159
+ await z(e.id), await M(), j.success(s("botlit.suggestions.dismissed", "Suggestion dismissed."));
160
+ } catch (e) {
161
+ j.error(e instanceof Error ? e.message : String(e));
162
+ }
163
+ };
164
+ return /* @__PURE__ */ T(l, {
165
+ "data-testid": "suggestions-panel",
166
+ children: [
167
+ /* @__PURE__ */ T(f, {
168
+ className: "flex flex-row items-start justify-between gap-4",
169
+ children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T(p, {
170
+ className: "flex items-center gap-2",
171
+ children: [/* @__PURE__ */ w(O, {
172
+ size: 18,
173
+ "aria-hidden": "true"
174
+ }), s("botlit.suggestions.title", "Suggestions")]
175
+ }), /* @__PURE__ */ w(d, { children: s("botlit.suggestions.description", "Improvements drawn from this agent’s recent runs and the knowledge it uses. Accepting edits the draft; nothing goes live until you publish.") })] }), /* @__PURE__ */ w(c, {
176
+ variant: "outline",
177
+ size: "sm",
178
+ leftIcon: /* @__PURE__ */ w(k, { size: 14 }),
179
+ isLoading: I.loading,
180
+ disabled: U,
181
+ onClick: () => void W(),
182
+ children: s("botlit.suggestions.generate", "Suggest improvements")
183
+ })]
184
+ }),
185
+ /* @__PURE__ */ w(u, {
186
+ className: "space-y-3",
187
+ children: A ? /* @__PURE__ */ w("p", {
188
+ className: "text-sm text-status-error-text",
189
+ role: "alert",
190
+ children: A.message
191
+ }) : D && E.length === 0 ? /* @__PURE__ */ w("p", {
192
+ className: "text-sm text-text-secondary",
193
+ "aria-busy": "true",
194
+ children: s("botlit.suggestions.loading", "Loading suggestions…")
195
+ }) : E.length === 0 ? /* @__PURE__ */ w(m, {
196
+ icon: /* @__PURE__ */ w(O, { className: "h-8 w-8" }),
197
+ title: s("botlit.suggestions.emptyTitle", "No open suggestions"),
198
+ description: s("botlit.suggestions.emptyDescription", "Run “Suggest improvements” to analyse the last 14 days of runs.")
199
+ }) : E.map((e) => /* @__PURE__ */ w(F, {
200
+ suggestion: e,
201
+ busy: U,
202
+ onAccept: H,
203
+ onDismiss: (e) => void K(e)
204
+ }, e.id))
205
+ }),
206
+ /* @__PURE__ */ w(g, {
207
+ open: V != null,
208
+ onOpenChange: (e) => !e && H(null),
209
+ children: /* @__PURE__ */ T(y, { children: [/* @__PURE__ */ T(S, { children: [/* @__PURE__ */ w(C, { children: V && P(V) ? s("botlit.suggestions.confirmApplyTitle", "Apply this change to the draft?") : s("botlit.suggestions.confirmAcceptTitle", "Accept this suggestion?") }), /* @__PURE__ */ w(b, { children: V && P(V) ? s("botlit.suggestions.confirmApplyBody", "The agent draft is updated. Production keeps running the published version until you publish the draft.") : V?.change?.type === "KNOWLEDGE_REVIEW" ? s("botlit.suggestions.confirmReviewBody", "The knowledge base is marked reviewed today. Do this after updating its outdated documents.") : s("botlit.suggestions.confirmAcknowledgeBody", "Nothing on the agent changes. The suggestion is recorded as accepted.") })] }), /* @__PURE__ */ T(x, { children: [/* @__PURE__ */ w(v, { children: s("botlit.suggestions.cancel", "Cancel") }), /* @__PURE__ */ w(_, {
210
+ onClick: () => void G(),
211
+ children: s("botlit.suggestions.confirm", "Confirm")
212
+ })] })] })
213
+ })
214
+ ]
215
+ });
216
+ };
217
+ export { I as SuggestionsPanel, P as changesDraft, N as evidenceExecutionIds };
218
+
219
+ //# sourceMappingURL=SuggestionsPanel.js.map