@burdenoff/microfe-botmanor 2026.1127.1 → 2026.1127.2

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 (112) hide show
  1. package/dist/botlit/BotmanorRootInner.js +45 -44
  2. package/dist/botlit/BotmanorRootInner.js.map +1 -1
  3. package/dist/botlit/components/AgentA2APanel.js +63 -62
  4. package/dist/botlit/components/AgentA2APanel.js.map +1 -1
  5. package/dist/botlit/components/AgentBindingsPanel.js +125 -124
  6. package/dist/botlit/components/AgentBindingsPanel.js.map +1 -1
  7. package/dist/botlit/components/AgentFallbackModelsPicker.js +56 -55
  8. package/dist/botlit/components/AgentFallbackModelsPicker.js.map +1 -1
  9. package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
  10. package/dist/botlit/components/AssistantChannelPanel.js +40 -39
  11. package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
  12. package/dist/botlit/components/AssistantRuntimeSetupPanel.js +36 -35
  13. package/dist/botlit/components/AssistantRuntimeSetupPanel.js.map +1 -1
  14. package/dist/botlit/components/BotAgentsPanel.js +104 -103
  15. package/dist/botlit/components/BotAgentsPanel.js.map +1 -1
  16. package/dist/botlit/components/BotFormFields.js +118 -117
  17. package/dist/botlit/components/BotFormFields.js.map +1 -1
  18. package/dist/botlit/components/BucketDialogs.js +110 -110
  19. package/dist/botlit/components/BucketDialogs.js.map +1 -1
  20. package/dist/botlit/components/ChannelRoutesPanel.js +29 -28
  21. package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -1
  22. package/dist/botlit/components/CreateChannelRouteDialog.js +105 -105
  23. package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -1
  24. package/dist/botlit/components/DescribeBotDialog.js +86 -86
  25. package/dist/botlit/components/DescribeBotDialog.js.map +1 -1
  26. package/dist/botlit/components/EmptyState.d.ts +8 -0
  27. package/dist/botlit/components/EmptyState.js +43 -30
  28. package/dist/botlit/components/EmptyState.js.map +1 -1
  29. package/dist/botlit/components/HandoffConfigPanel.js +125 -124
  30. package/dist/botlit/components/HandoffConfigPanel.js.map +1 -1
  31. package/dist/botlit/components/HandoffTargetPickers.js +42 -41
  32. package/dist/botlit/components/HandoffTargetPickers.js.map +1 -1
  33. package/dist/botlit/components/KnowledgeBackendMigrationPanel.js +106 -105
  34. package/dist/botlit/components/KnowledgeBackendMigrationPanel.js.map +1 -1
  35. package/dist/botlit/components/KnowledgeRetrievalTestPanel.js +76 -75
  36. package/dist/botlit/components/KnowledgeRetrievalTestPanel.js.map +1 -1
  37. package/dist/botlit/components/KnowledgeSourceImportPanel.js +76 -75
  38. package/dist/botlit/components/KnowledgeSourceImportPanel.js.map +1 -1
  39. package/dist/botlit/components/ModelRegistrationPanel.js +70 -69
  40. package/dist/botlit/components/ModelRegistrationPanel.js.map +1 -1
  41. package/dist/botlit/components/StorePackageDraftCard.js +87 -86
  42. package/dist/botlit/components/StorePackageDraftCard.js.map +1 -1
  43. package/dist/botlit/components/SuggestionsPanel.js.map +1 -1
  44. package/dist/botlit/pages/A2AAgentDetailPage.js +263 -262
  45. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  46. package/dist/botlit/pages/A2ARegistryPage.js +47 -46
  47. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  48. package/dist/botlit/pages/AgentBuilderPage.js +426 -425
  49. package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
  50. package/dist/botlit/pages/AgentDetailPage.js +1 -0
  51. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  52. package/dist/botlit/pages/AgentsListPage.js +248 -247
  53. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  54. package/dist/botlit/pages/BotChannelsTab.js +324 -310
  55. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  56. package/dist/botlit/pages/BotDetailPage.js +1 -0
  57. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  58. package/dist/botlit/pages/BotWorkflowTab.js +126 -121
  59. package/dist/botlit/pages/BotWorkflowTab.js.map +1 -1
  60. package/dist/botlit/pages/BotsListPage.js +1 -0
  61. package/dist/botlit/pages/BotsListPage.js.map +1 -1
  62. package/dist/botlit/pages/BucketDetailPage.js +1 -0
  63. package/dist/botlit/pages/BucketDetailPage.js.map +1 -1
  64. package/dist/botlit/pages/BucketsPage.js +1 -0
  65. package/dist/botlit/pages/BucketsPage.js.map +1 -1
  66. package/dist/botlit/pages/ChannelDetailPage.js +267 -266
  67. package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
  68. package/dist/botlit/pages/ChannelsPage.js +187 -186
  69. package/dist/botlit/pages/ChannelsPage.js.map +1 -1
  70. package/dist/botlit/pages/ChatPage.js +69 -68
  71. package/dist/botlit/pages/ChatPage.js.map +1 -1
  72. package/dist/botlit/pages/ExecutionDetailPage.js +1 -0
  73. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  74. package/dist/botlit/pages/ExecutionsPage.js +191 -191
  75. package/dist/botlit/pages/ExecutionsPage.js.map +1 -1
  76. package/dist/botlit/pages/HandoffsPage.js +65 -64
  77. package/dist/botlit/pages/HandoffsPage.js.map +1 -1
  78. package/dist/botlit/pages/InstalledPackagesPage.js +146 -145
  79. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  80. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +235 -234
  81. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  82. package/dist/botlit/pages/KnowledgeBasesPage.js +152 -151
  83. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  84. package/dist/botlit/pages/MCPServerDetailPage.js +180 -179
  85. package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -1
  86. package/dist/botlit/pages/MCPServersPage.js +145 -145
  87. package/dist/botlit/pages/MCPServersPage.js.map +1 -1
  88. package/dist/botlit/pages/PoliciesPage.js.map +1 -1
  89. package/dist/botlit/pages/PolicyDetailPage.js +293 -292
  90. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  91. package/dist/botlit/pages/PromptStudioPage.js +229 -229
  92. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  93. package/dist/botlit/pages/PromptTemplateDetailPage.js +280 -279
  94. package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -1
  95. package/dist/botlit/pages/PromptTemplatesPage.js +31 -30
  96. package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -1
  97. package/dist/botlit/pages/RetrievalProfileDetailPage.js +204 -203
  98. package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -1
  99. package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -1
  100. package/dist/botlit/pages/SettingsPage.js +153 -153
  101. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  102. package/dist/botlit/pages/SkillDetailPage.js +305 -304
  103. package/dist/botlit/pages/SkillDetailPage.js.map +1 -1
  104. package/dist/botlit/pages/SkillsPage.js.map +1 -1
  105. package/dist/botlit/pages/StorePackageDetailPage.js +1 -0
  106. package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
  107. package/dist/botlit/pages/StorePage.js +173 -173
  108. package/dist/botlit/pages/StorePage.js.map +1 -1
  109. package/dist/botlit/utils/confirmAction.d.ts +13 -11
  110. package/dist/botlit/utils/confirmAction.js +26 -4
  111. package/dist/botlit/utils/confirmAction.js.map +1 -1
  112. package/package.json +3 -3
@@ -1,29 +1,30 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
- import { useBotWorkflowDefinition as t, useCreateBotWorkflow as n } from "../hooks/useBotWorkflow.js";
3
- import { Card as r, CardContent as i, CardDescription as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
4
- import { BOTMANOR_PERMISSIONS as c } from "../permissions/botmanorPermissions.js";
5
- import { BotmanorPermissionGate as l } from "../permissions/useBotmanorPermissions.js";
6
- import { Button as u } from "../components/Button.js";
7
- import { Badge as d, StatusBadge as f } from "../components/Badge.js";
8
- import { EmptyState as p } from "../components/EmptyState.js";
9
- import { useUpdateBot as m } from "../hooks/useBots.js";
10
- import { useBotlit as h } from "../providers/BotlitProvider.js";
2
+ import { confirmAction as t } from "../utils/confirmAction.js";
3
+ import { useBotWorkflowDefinition as n, useCreateBotWorkflow as r } from "../hooks/useBotWorkflow.js";
4
+ import { BOTMANOR_PERMISSIONS as i } from "../permissions/botmanorPermissions.js";
5
+ import { BotmanorPermissionGate as a } from "../permissions/useBotmanorPermissions.js";
6
+ import { Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u } from "../components/Card.js";
7
+ import { Button as d } from "../components/Button.js";
8
+ import { Badge as f, StatusBadge as p } from "../components/Badge.js";
9
+ import { EmptyState as m } from "../components/EmptyState.js";
10
+ import { useUpdateBot as h } from "../hooks/useBots.js";
11
+ import { useBotlit as g } from "../providers/BotlitProvider.js";
11
12
  import "../permissions/index.js";
12
- import { useCallback as g, useState as _ } from "react";
13
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import { ExternalLink as b, Sparkles as x, Unlink as S, Workflow as C } from "lucide-react";
15
- import { toast as w } from "sonner";
13
+ import { useCallback as _, useState as v } from "react";
14
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
15
+ import { ExternalLink as x, Sparkles as S, Unlink as C, Workflow as w } from "lucide-react";
16
+ import { toast as T } from "sonner";
16
17
  // src/botlit/pages/BotWorkflowTab.tsx
17
- var T = "v1", E = "internal:api", D = "1.0.0", O = "onManualTrigger", k = "Trigger Manually", A = "Runs the flow when you click 'Test workflow', or when this bot is invoked.", j = [
18
+ var E = "v1", D = "internal:api", O = "1.0.0", k = "onManualTrigger", A = "Trigger Manually", j = "Runs the flow when you click 'Test workflow', or when this bot is invoked.", M = [
18
19
  "trigger",
19
20
  "manual",
20
21
  "entry"
21
22
  ];
22
- function M() {
23
+ function N() {
23
24
  let e = globalThis.crypto;
24
25
  return e && typeof e.randomUUID == "function" ? e.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
25
26
  }
26
- function N(e, t) {
27
+ function P(e, t) {
27
28
  return {
28
29
  key: e,
29
30
  name: t,
@@ -32,38 +33,38 @@ function N(e, t) {
32
33
  data: {
33
34
  id: e,
34
35
  workflowKey: e,
35
- version: T,
36
+ version: E,
36
37
  name: t,
37
38
  nodes: [{
38
- id: M(),
39
- type: E,
39
+ id: N(),
40
+ type: D,
40
41
  position: {
41
42
  x: 160,
42
43
  y: 160
43
44
  },
44
- kind: j,
45
+ kind: M,
45
46
  data: {
46
- operation_name: O,
47
+ operation_name: k,
47
48
  operation_type: "trigger",
48
- version: D,
49
+ version: O,
49
50
  nodeData: {
50
- nodeType: E,
51
- name: k,
52
- description: A,
53
- version: D,
54
- kind: j,
51
+ nodeType: D,
52
+ name: A,
53
+ description: j,
54
+ version: O,
55
+ kind: M,
55
56
  operations: [{
56
- name: O,
57
+ name: k,
57
58
  type: "trigger",
58
59
  role: "trigger",
59
- description: A
60
+ description: j
60
61
  }]
61
62
  },
62
63
  args: {
63
64
  context: { node: {
64
- id: E,
65
- type: E,
66
- kind: j
65
+ id: D,
66
+ type: D,
67
+ kind: M
67
68
  } },
68
69
  state: {},
69
70
  credentials: []
@@ -79,156 +80,160 @@ function N(e, t) {
79
80
  },
80
81
  meta: {
81
82
  creator: "botlit_bot_design",
82
- version: T
83
+ version: E
83
84
  },
84
85
  tags: []
85
86
  };
86
87
  }
87
- var P = ({ botId: E, botName: D, workflowId: O, onWorkflowChanged: k }) => {
88
- let A = e(), { navigateTo: j } = h(), { createWorkflow: P } = n(), [F] = m(), [I, L] = _(!1), { workflow: R, loading: z } = t(void 0, O ?? void 0), B = g((e, t) => {
89
- j(`workflows/workflow/${e}/${t || T}`);
90
- }, [j]), V = g(async () => {
91
- L(!0);
88
+ var F = ({ botId: D, botName: O, workflowId: k, onWorkflowChanged: A }) => {
89
+ let j = e(), { navigateTo: M } = g(), { createWorkflow: F } = r(), [I] = h(), [L, R] = v(!1), { workflow: z, loading: B } = n(void 0, k ?? void 0), V = _((e, t) => {
90
+ M(`workflows/workflow/${e}/${t || E}`);
91
+ }, [M]), H = _(async () => {
92
+ R(!0);
92
93
  try {
93
- let e = M(), t = `${D} workflow`, n = await P({
94
+ let e = N(), t = `${O} workflow`, n = await F({
94
95
  workflowKey: e,
95
- version: T,
96
+ version: E,
96
97
  name: t,
97
- description: A("botlit.botDetail.workflow.createdDescription", "Behaviour designed for this BotManor bot."),
98
- definitionJson: N(e, t)
98
+ description: j("botlit.botDetail.workflow.createdDescription", "Behaviour designed for this BotManor bot."),
99
+ definitionJson: P(e, t)
99
100
  });
100
- if (!n) throw Error(A("botlit.botDetail.workflow.createError", "Failed to create the workflow"));
101
- await F({
102
- botId: E,
101
+ if (!n) throw Error(j("botlit.botDetail.workflow.createError", "Failed to create the workflow"));
102
+ await I({
103
+ botId: D,
103
104
  input: { workflowId: n.id }
104
- }), await k(), w.success(A("botlit.botDetail.workflow.createSuccess", "Workflow created and bound to this bot")), B(n.workflowKey, n.version);
105
+ }), await A(), T.success(j("botlit.botDetail.workflow.createSuccess", "Workflow created and bound to this bot")), V(n.workflowKey, n.version);
105
106
  } catch (e) {
106
- let t = e instanceof Error ? e.message : A("botlit.botDetail.workflow.createError", "Failed to create the workflow");
107
- w.error(t);
107
+ let t = e instanceof Error ? e.message : j("botlit.botDetail.workflow.createError", "Failed to create the workflow");
108
+ T.error(t);
108
109
  } finally {
109
- L(!1);
110
+ R(!1);
110
111
  }
111
112
  }, [
112
- E,
113
113
  D,
114
- P,
115
- k,
116
- B,
114
+ O,
115
+ F,
117
116
  A,
118
- F
119
- ]), H = g(async () => {
120
- if (confirm(A("botlit.botDetail.workflow.unbindConfirm", "Unbind this workflow from the bot? The workflow itself is not deleted."))) {
121
- L(!0);
117
+ V,
118
+ j,
119
+ I
120
+ ]), U = _(async () => {
121
+ if (await t({
122
+ title: j("botlit.botDetail.workflow.unbindConfirm", "Unbind this workflow from the bot? The workflow itself is not deleted."),
123
+ confirmLabel: j("botlit.botDetail.workflow.unbindConfirmAction", "Unbind"),
124
+ cancelLabel: j("botlit.common.cancel", "Cancel")
125
+ })) {
126
+ R(!0);
122
127
  try {
123
- await F({
124
- botId: E,
128
+ await I({
129
+ botId: D,
125
130
  input: { workflowId: null }
126
- }), await k(), w.success(A("botlit.botDetail.workflow.unbindSuccess", "Workflow unbound"));
131
+ }), await A(), T.success(j("botlit.botDetail.workflow.unbindSuccess", "Workflow unbound"));
127
132
  } catch (e) {
128
- let t = e instanceof Error ? e.message : A("botlit.botDetail.workflow.unbindError", "Failed to unbind the workflow");
129
- w.error(t);
133
+ let t = e instanceof Error ? e.message : j("botlit.botDetail.workflow.unbindError", "Failed to unbind the workflow");
134
+ T.error(t);
130
135
  } finally {
131
- L(!1);
136
+ R(!1);
132
137
  }
133
138
  }
134
139
  }, [
135
- E,
136
- k,
140
+ D,
137
141
  A,
138
- F
142
+ j,
143
+ I
139
144
  ]);
140
- return O ? /* @__PURE__ */ v("div", {
145
+ return k ? /* @__PURE__ */ y("div", {
141
146
  className: "space-y-6",
142
- children: /* @__PURE__ */ y(r, { children: [/* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(s, {
147
+ children: /* @__PURE__ */ b(o, { children: [/* @__PURE__ */ b(l, { children: [/* @__PURE__ */ b(u, {
143
148
  className: "flex items-center gap-2",
144
- children: [/* @__PURE__ */ v(C, { size: 18 }), A("botlit.botDetail.workflow.bound.title", "Bound workflow")]
145
- }), /* @__PURE__ */ v(a, { children: A("botlit.botDetail.workflow.bound.description", "This workflow defines what the bot does when it is invoked.") })] }), /* @__PURE__ */ y(i, {
149
+ children: [/* @__PURE__ */ y(w, { size: 18 }), j("botlit.botDetail.workflow.bound.title", "Bound workflow")]
150
+ }), /* @__PURE__ */ y(c, { children: j("botlit.botDetail.workflow.bound.description", "This workflow defines what the bot does when it is invoked.") })] }), /* @__PURE__ */ b(s, {
146
151
  className: "space-y-6",
147
- children: [z ? /* @__PURE__ */ v("div", { className: "h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer" }) : R ? /* @__PURE__ */ y("div", {
152
+ children: [B ? /* @__PURE__ */ y("div", { className: "h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer" }) : z ? /* @__PURE__ */ b("div", {
148
153
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
149
154
  children: [
150
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
155
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
151
156
  className: "text-sm text-text-secondary",
152
- children: A("botlit.botDetail.workflow.fields.name", "Name")
153
- }), /* @__PURE__ */ v("p", {
157
+ children: j("botlit.botDetail.workflow.fields.name", "Name")
158
+ }), /* @__PURE__ */ y("p", {
154
159
  className: "font-medium text-text-primary",
155
- children: R.name
160
+ children: z.name
156
161
  })] }),
157
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
162
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
158
163
  className: "text-sm text-text-secondary",
159
- children: A("botlit.botDetail.workflow.fields.key", "Key")
160
- }), /* @__PURE__ */ v("p", {
164
+ children: j("botlit.botDetail.workflow.fields.key", "Key")
165
+ }), /* @__PURE__ */ y("p", {
161
166
  className: "mt-1 break-all font-mono text-sm text-text-primary",
162
- children: R.workflowKey
167
+ children: z.workflowKey
163
168
  })] }),
164
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
169
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
165
170
  className: "text-sm text-text-secondary",
166
- children: A("botlit.botDetail.workflow.fields.version", "Version")
167
- }), /* @__PURE__ */ v(d, {
171
+ children: j("botlit.botDetail.workflow.fields.version", "Version")
172
+ }), /* @__PURE__ */ y(f, {
168
173
  variant: "outline",
169
174
  className: "mt-1",
170
- children: R.version
175
+ children: z.version
171
176
  })] }),
172
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
177
+ /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
173
178
  className: "text-sm text-text-secondary",
174
- children: A("botlit.botDetail.workflow.fields.status", "Status")
175
- }), /* @__PURE__ */ v("div", {
179
+ children: j("botlit.botDetail.workflow.fields.status", "Status")
180
+ }), /* @__PURE__ */ y("div", {
176
181
  className: "mt-1",
177
- children: /* @__PURE__ */ v(f, { status: R.status })
182
+ children: /* @__PURE__ */ y(p, { status: z.status })
178
183
  })] })
179
184
  ]
180
- }) : /* @__PURE__ */ y("div", { children: [
181
- /* @__PURE__ */ v("p", {
185
+ }) : /* @__PURE__ */ b("div", { children: [
186
+ /* @__PURE__ */ y("p", {
182
187
  className: "text-sm text-text-secondary",
183
- children: A("botlit.botDetail.workflow.fields.workflowId", "Workflow ID")
188
+ children: j("botlit.botDetail.workflow.fields.workflowId", "Workflow ID")
184
189
  }),
185
- /* @__PURE__ */ v("p", {
190
+ /* @__PURE__ */ y("p", {
186
191
  className: "mt-1 break-all font-mono text-sm text-text-primary",
187
- children: O
192
+ children: k
188
193
  }),
189
- /* @__PURE__ */ v("p", {
194
+ /* @__PURE__ */ y("p", {
190
195
  className: "mt-2 text-sm text-text-secondary",
191
- children: A("botlit.botDetail.workflow.unresolved", "This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.")
196
+ children: j("botlit.botDetail.workflow.unresolved", "This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.")
192
197
  })
193
- ] }), /* @__PURE__ */ y("div", {
198
+ ] }), /* @__PURE__ */ b("div", {
194
199
  className: "flex flex-wrap gap-2",
195
- children: [R && /* @__PURE__ */ v(u, {
196
- leftIcon: /* @__PURE__ */ v(b, { size: 16 }),
197
- disabled: I,
198
- onClick: () => B(R.workflowKey, R.version),
199
- children: A("botlit.botDetail.workflow.actions.openBuilder", "Open in builder")
200
- }), /* @__PURE__ */ v(l, {
201
- permission: c.APP_UPDATE,
202
- children: /* @__PURE__ */ v(u, {
200
+ children: [z && /* @__PURE__ */ y(d, {
201
+ leftIcon: /* @__PURE__ */ y(x, { size: 16 }),
202
+ disabled: L,
203
+ onClick: () => V(z.workflowKey, z.version),
204
+ children: j("botlit.botDetail.workflow.actions.openBuilder", "Open in builder")
205
+ }), /* @__PURE__ */ y(a, {
206
+ permission: i.APP_UPDATE,
207
+ children: /* @__PURE__ */ y(d, {
203
208
  variant: "outline",
204
- leftIcon: /* @__PURE__ */ v(S, { size: 16 }),
205
- isLoading: I,
206
- disabled: I,
207
- onClick: () => void H(),
208
- children: A("botlit.botDetail.workflow.actions.unbind", "Unbind")
209
+ leftIcon: /* @__PURE__ */ y(C, { size: 16 }),
210
+ isLoading: L,
211
+ disabled: L,
212
+ onClick: () => void U(),
213
+ children: j("botlit.botDetail.workflow.actions.unbind", "Unbind")
209
214
  })
210
215
  })]
211
216
  })]
212
217
  })] })
213
- }) : /* @__PURE__ */ v(r, { children: /* @__PURE__ */ v(i, {
218
+ }) : /* @__PURE__ */ y(o, { children: /* @__PURE__ */ y(s, {
214
219
  className: "pt-6",
215
- children: /* @__PURE__ */ v(p, {
220
+ children: /* @__PURE__ */ y(m, {
216
221
  illustration: "empty-generic",
217
- title: A("botlit.botDetail.workflow.empty.title", "Design this bot as a workflow"),
218
- description: A("botlit.botDetail.workflow.empty.description", "A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you."),
219
- action: /* @__PURE__ */ v(l, {
220
- permission: c.APP_UPDATE,
221
- children: /* @__PURE__ */ v(u, {
222
- leftIcon: /* @__PURE__ */ v(x, { size: 16 }),
223
- isLoading: I,
224
- disabled: I,
225
- onClick: () => void V(),
226
- children: A("botlit.botDetail.workflow.empty.action", "Design in workflow builder")
222
+ title: j("botlit.botDetail.workflow.empty.title", "Design this bot as a workflow"),
223
+ description: j("botlit.botDetail.workflow.empty.description", "A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you."),
224
+ action: /* @__PURE__ */ y(a, {
225
+ permission: i.APP_UPDATE,
226
+ children: /* @__PURE__ */ y(d, {
227
+ leftIcon: /* @__PURE__ */ y(S, { size: 16 }),
228
+ isLoading: L,
229
+ disabled: L,
230
+ onClick: () => void H(),
231
+ children: j("botlit.botDetail.workflow.empty.action", "Design in workflow builder")
227
232
  })
228
233
  })
229
234
  })
230
235
  }) });
231
236
  };
232
- export { P as BotWorkflowTab };
237
+ export { F as BotWorkflowTab };
233
238
 
234
239
  //# sourceMappingURL=BotWorkflowTab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BotWorkflowTab.js","names":["useCreateWorkflow","useWorkflowDefinition","INITIAL_VERSION","MANUAL_TRIGGER_NODE_TYPE","MANUAL_TRIGGER_NODE_VERSION","MANUAL_TRIGGER_OPERATION","MANUAL_TRIGGER_NAME","MANUAL_TRIGGER_DESCRIPTION","MANUAL_TRIGGER_KIND","generateId","webCrypto","buildSeedDefinition","workflowKey","name","BotWorkflowTab","t","useTr","useBotlit","useCreateBotWorkflow","updateBot","useUpdateBot","busy","setBusy","useState","workflowLoading","useBotWorkflowDefinition","workflowId","openBuilder","useCallback","version","navigateTo","handleDesign","botName","created","createWorkflow","onWorkflowChanged","toast","err","message","botId","handleUnbind","Card","CardHeader","CardTitle","Workflow","CardDescription","CardContent","workflow","Badge","StatusBadge","Button","ExternalLink","BotmanorPermissionGate","BOTMANOR_PERMISSIONS","Unlink","EmptyState","Sparkles"],"sources":["../../../src/botlit/pages/BotWorkflowTab.tsx"],"sourcesContent":["/**\n * BotWorkflowTab\n * @module botlit/pages\n *\n * Shown inside BotDetailPage → \"Workflow\" tab.\n *\n * A bot's behaviour is designed as a FluidGrids workflow. `BotApp.workflowId`\n * holds the binding (validated server-side by `assertWorkflowBindingsResolvable`\n * on wspace-botlit-svc), and the FluidGrids builder is already mounted INSIDE\n * BotManor at `workflows/workflow/:id/:version` — so this tab never leaves the\n * product.\n *\n * Flow:\n * 1. Bound → resolve the definition by id (`useWorkflowDefinition`), show\n * name / key / version / status, \"Open in builder\", \"Unbind\".\n * A binding that no longer resolves falls back to the raw id so\n * the user can still clear it.\n * 2. Not bound → zero state whose primary action creates a seeded workflow\n * definition, binds it via `updateBotApp(workflowId)` and drops\n * the user straight into the embedded builder.\n *\n * IMPORTANT — seed graph shape. `BotlitFluidGridsBridge.extractTriggerNodeIds`\n * reads nodes from `definitionJson.data.nodes` (NOT the top level) and treats a\n * node as a trigger when its `type` is `trigger`/`trigger:*`/`*_trigger`, OR its\n * `kind[]` / `data.nodeData.kind[]` contains `trigger`. The seed below uses the\n * workflow service's own BUILTIN manual trigger (`internal:api`, \"Trigger\n * Manually\") — the node the executor resolves as the entry point — and carries\n * `kind: ['trigger', ...]` in both places, so a freshly designed bot is\n * immediately runnable instead of failing with `WORKFLOW_NO_TRIGGER_NODE`.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useState } from 'react';\nimport { ExternalLink, Sparkles, Unlink, Workflow } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n useCreateBotWorkflow as useCreateWorkflow,\n useBotWorkflowDefinition as useWorkflowDefinition,\n} from '../hooks/useBotWorkflow';\nimport { Card, CardHeader, CardTitle, CardContent, CardDescription } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge, StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { useUpdateBot } from '../hooks/useBots';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { BOTMANOR_PERMISSIONS, BotmanorPermissionGate } from '../permissions';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Seed graph\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** First version minted for a bot's workflow — matches the builder's own default. */\nconst INITIAL_VERSION = 'v1';\n\n/**\n * BUILTIN \"Trigger Manually\" node (`MANUAL_TRIGGER_MANIFEST` in\n * wspace-workflow-svc). The executor resolves this type as a workflow's entry\n * node, and the builder renders it from the seeded node registry.\n */\nconst MANUAL_TRIGGER_NODE_TYPE = 'internal:api';\nconst MANUAL_TRIGGER_NODE_VERSION = '1.0.0';\nconst MANUAL_TRIGGER_OPERATION = 'onManualTrigger';\nconst MANUAL_TRIGGER_NAME = 'Trigger Manually';\nconst MANUAL_TRIGGER_DESCRIPTION =\n \"Runs the flow when you click 'Test workflow', or when this bot is invoked.\";\n\n/** `kind[]` the BotManor bridge scans for when classifying a node as a trigger. */\nconst MANUAL_TRIGGER_KIND = ['trigger', 'manual', 'entry'];\n\n/** Node shape written into `definitionJson.data.nodes`. */\ntype SeedNode = {\n id: string;\n type: string;\n position: { x: number; y: number };\n /** Top-level kind — the bridge's second trigger-detection path. */\n kind: string[];\n data: {\n operation_name: string;\n operation_type: string;\n version: string;\n nodeData: {\n nodeType: string;\n name: string;\n description: string;\n version: string;\n /** The bridge's third trigger-detection path. */\n kind: string[];\n operations: { name: string; type: string; role: string; description: string }[];\n };\n args: {\n context: { node: { id: string; type: string; kind: string[] } };\n state: Record<string, never>;\n credentials: never[];\n };\n };\n};\n\n/**\n * `definitionJson` document. Mirrors what the builder itself persists\n * (`useSaveWorkflow`) so the graph round-trips through the builder unchanged.\n */\ntype SeedDefinition = {\n key: string;\n name: string;\n description: string;\n workflow_type: string;\n data: {\n id: string;\n workflowKey: string;\n version: string;\n name: string;\n nodes: SeedNode[];\n edges: never[];\n sidebar: { active: string; panels: { nodeProperties: { selectedNode: null } } };\n stickyNotes: never[];\n };\n meta: { creator: string; version: string };\n tags: string[];\n};\n\n/**\n * Generate an opaque id. `crypto.randomUUID` is unavailable on insecure origins\n * and in some test environments, so fall back to a time+random token rather than\n * throwing mid-create.\n */\nfunction generateId(): string {\n const webCrypto = globalThis.crypto as Crypto | undefined;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n return webCrypto.randomUUID();\n }\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Build the starter graph: one manual trigger, nothing else. */\nfunction buildSeedDefinition(workflowKey: string, name: string): SeedDefinition {\n const triggerNode: SeedNode = {\n id: generateId(),\n type: MANUAL_TRIGGER_NODE_TYPE,\n position: { x: 160, y: 160 },\n kind: MANUAL_TRIGGER_KIND,\n data: {\n operation_name: MANUAL_TRIGGER_OPERATION,\n operation_type: 'trigger',\n version: MANUAL_TRIGGER_NODE_VERSION,\n nodeData: {\n nodeType: MANUAL_TRIGGER_NODE_TYPE,\n name: MANUAL_TRIGGER_NAME,\n description: MANUAL_TRIGGER_DESCRIPTION,\n version: MANUAL_TRIGGER_NODE_VERSION,\n kind: MANUAL_TRIGGER_KIND,\n operations: [\n {\n name: MANUAL_TRIGGER_OPERATION,\n type: 'trigger',\n role: 'trigger',\n description: MANUAL_TRIGGER_DESCRIPTION,\n },\n ],\n },\n args: {\n context: {\n node: {\n id: MANUAL_TRIGGER_NODE_TYPE,\n type: MANUAL_TRIGGER_NODE_TYPE,\n kind: MANUAL_TRIGGER_KIND,\n },\n },\n state: {},\n credentials: [],\n },\n },\n };\n\n return {\n key: workflowKey,\n name,\n description: name,\n workflow_type: 'query-conditional',\n data: {\n id: workflowKey,\n workflowKey,\n version: INITIAL_VERSION,\n name,\n nodes: [triggerNode],\n edges: [],\n sidebar: { active: 'store-browse', panels: { nodeProperties: { selectedNode: null } } },\n stickyNotes: [],\n },\n meta: { creator: 'botlit_bot_design', version: INITIAL_VERSION },\n tags: [],\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Component\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface BotWorkflowTabProps {\n botId: string;\n botName: string;\n /** `BotApp.workflowId` — the bound workflow definition id, if any. */\n workflowId: string | null | undefined;\n /** Refetch the bot so the tab reflects the new binding. */\n onWorkflowChanged: () => Promise<void> | void;\n}\n\nexport const BotWorkflowTab: FC<BotWorkflowTabProps> = ({\n botId,\n botName,\n workflowId,\n onWorkflowChanged,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n const { createWorkflow } = useCreateWorkflow();\n const [updateBot] = useUpdateBot();\n const [busy, setBusy] = useState(false);\n\n // Resolve by id — `BotApp.workflowId` stores the definition's opaque id, not\n // its workflowKey (which is what the builder route takes). The hook refetches\n // on its own when the bound id changes, so binding/unbinding only has to\n // refresh the bot.\n const { workflow, loading: workflowLoading } = useWorkflowDefinition(\n undefined,\n workflowId ?? undefined\n );\n\n const openBuilder = useCallback(\n (workflowKey: string, version: string) => {\n navigateTo(`workflows/workflow/${workflowKey}/${version || INITIAL_VERSION}`);\n },\n [navigateTo]\n );\n\n const handleDesign = useCallback(async () => {\n setBusy(true);\n try {\n const workflowKey = generateId();\n const name = `${botName} workflow`;\n const created = await createWorkflow({\n workflowKey,\n version: INITIAL_VERSION,\n name,\n description: t(\n 'botlit.botDetail.workflow.createdDescription',\n 'Behaviour designed for this BotManor bot.'\n ),\n definitionJson: buildSeedDefinition(workflowKey, name),\n });\n\n if (!created) {\n throw new Error(\n t('botlit.botDetail.workflow.createError', 'Failed to create the workflow')\n );\n }\n\n await updateBot({ botId, input: { workflowId: created.id } });\n await onWorkflowChanged();\n toast.success(\n t('botlit.botDetail.workflow.createSuccess', 'Workflow created and bound to this bot')\n );\n openBuilder(created.workflowKey, created.version);\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.createError', 'Failed to create the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, botName, createWorkflow, onWorkflowChanged, openBuilder, t, updateBot]);\n\n const handleUnbind = useCallback(async () => {\n if (\n !confirm(\n t(\n 'botlit.botDetail.workflow.unbindConfirm',\n 'Unbind this workflow from the bot? The workflow itself is not deleted.'\n )\n )\n ) {\n return;\n }\n setBusy(true);\n try {\n await updateBot({ botId, input: { workflowId: null } });\n await onWorkflowChanged();\n toast.success(t('botlit.botDetail.workflow.unbindSuccess', 'Workflow unbound'));\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.unbindError', 'Failed to unbind the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, onWorkflowChanged, t, updateBot]);\n\n // ── Not bound ─────────────────────────────────────────────────────────────\n if (!workflowId) {\n return (\n <Card>\n <CardContent className=\"pt-6\">\n <EmptyState\n illustration=\"empty-generic\"\n title={t('botlit.botDetail.workflow.empty.title', 'Design this bot as a workflow')}\n description={t(\n 'botlit.botDetail.workflow.empty.description',\n \"A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you.\"\n )}\n action={\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.APP_UPDATE}>\n <Button\n leftIcon={<Sparkles size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleDesign()}\n >\n {t('botlit.botDetail.workflow.empty.action', 'Design in workflow builder')}\n </Button>\n </BotmanorPermissionGate>\n }\n />\n </CardContent>\n </Card>\n );\n }\n\n // ── Bound ─────────────────────────────────────────────────────────────────\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Workflow size={18} />\n {t('botlit.botDetail.workflow.bound.title', 'Bound workflow')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.botDetail.workflow.bound.description',\n 'This workflow defines what the bot does when it is invoked.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {workflowLoading ? (\n <div className=\"h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer\" />\n ) : workflow ? (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.name', 'Name')}\n </p>\n <p className=\"font-medium text-text-primary\">{workflow.name}</p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.key', 'Key')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">\n {workflow.workflowKey}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.version', 'Version')}\n </p>\n <Badge variant=\"outline\" className=\"mt-1\">\n {workflow.version}\n </Badge>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.status', 'Status')}\n </p>\n <div className=\"mt-1\">\n <StatusBadge status={workflow.status} />\n </div>\n </div>\n </div>\n ) : (\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.workflowId', 'Workflow ID')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">{workflowId}</p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {t(\n 'botlit.botDetail.workflow.unresolved',\n 'This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.'\n )}\n </p>\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {workflow && (\n <Button\n leftIcon={<ExternalLink size={16} />}\n disabled={busy}\n onClick={() => openBuilder(workflow.workflowKey, workflow.version)}\n >\n {t('botlit.botDetail.workflow.actions.openBuilder', 'Open in builder')}\n </Button>\n )}\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.APP_UPDATE}>\n <Button\n variant=\"outline\"\n leftIcon={<Unlink size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleUnbind()}\n >\n {t('botlit.botDetail.workflow.actions.unbind', 'Unbind')}\n </Button>\n </BotmanorPermissionGate>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAqDA,IAAME,IAAkB,MAOlBC,IAA2B,gBAC3BC,IAA8B,SAC9BC,IAA2B,mBAC3BC,IAAsB,oBACtBC,IACJ,8EAGIC,IAAsB;CAAC;CAAW;CAAU;AAAO;AA0DzD,SAASC,IAAqB;CAC5B,IAAMC,IAAY,WAAW;CAI7B,OAHIA,KAAa,OAAOA,EAAU,cAAe,aACxCA,EAAU,WAAW,IAEvB,GAAG,KAAK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B,CAAA;CACU,CAAA,EACT,CAAA;AAiGZ"}
1
+ {"version":3,"file":"BotWorkflowTab.js","names":["useCreateWorkflow","useWorkflowDefinition","INITIAL_VERSION","MANUAL_TRIGGER_NODE_TYPE","MANUAL_TRIGGER_NODE_VERSION","MANUAL_TRIGGER_OPERATION","MANUAL_TRIGGER_NAME","MANUAL_TRIGGER_DESCRIPTION","MANUAL_TRIGGER_KIND","generateId","webCrypto","buildSeedDefinition","workflowKey","name","BotWorkflowTab","t","useTr","useBotlit","useCreateBotWorkflow","updateBot","useUpdateBot","busy","setBusy","useState","workflowLoading","useBotWorkflowDefinition","workflowId","openBuilder","useCallback","version","navigateTo","handleDesign","botName","created","createWorkflow","onWorkflowChanged","toast","err","message","botId","handleUnbind","confirmAction","Card","CardHeader","CardTitle","Workflow","CardDescription","CardContent","workflow","Badge","StatusBadge","Button","ExternalLink","BotmanorPermissionGate","BOTMANOR_PERMISSIONS","Unlink","EmptyState","Sparkles"],"sources":["../../../src/botlit/pages/BotWorkflowTab.tsx"],"sourcesContent":["/**\n * BotWorkflowTab\n * @module botlit/pages\n *\n * Shown inside BotDetailPage → \"Workflow\" tab.\n *\n * A bot's behaviour is designed as a FluidGrids workflow. `BotApp.workflowId`\n * holds the binding (validated server-side by `assertWorkflowBindingsResolvable`\n * on wspace-botlit-svc), and the FluidGrids builder is already mounted INSIDE\n * BotManor at `workflows/workflow/:id/:version` — so this tab never leaves the\n * product.\n *\n * Flow:\n * 1. Bound → resolve the definition by id (`useWorkflowDefinition`), show\n * name / key / version / status, \"Open in builder\", \"Unbind\".\n * A binding that no longer resolves falls back to the raw id so\n * the user can still clear it.\n * 2. Not bound → zero state whose primary action creates a seeded workflow\n * definition, binds it via `updateBotApp(workflowId)` and drops\n * the user straight into the embedded builder.\n *\n * IMPORTANT — seed graph shape. `BotlitFluidGridsBridge.extractTriggerNodeIds`\n * reads nodes from `definitionJson.data.nodes` (NOT the top level) and treats a\n * node as a trigger when its `type` is `trigger`/`trigger:*`/`*_trigger`, OR its\n * `kind[]` / `data.nodeData.kind[]` contains `trigger`. The seed below uses the\n * workflow service's own BUILTIN manual trigger (`internal:api`, \"Trigger\n * Manually\") — the node the executor resolves as the entry point — and carries\n * `kind: ['trigger', ...]` in both places, so a freshly designed bot is\n * immediately runnable instead of failing with `WORKFLOW_NO_TRIGGER_NODE`.\n */\n\nimport type { FC } from 'react';\nimport { useCallback, useState } from 'react';\nimport { ExternalLink, Sparkles, Unlink, Workflow } from 'lucide-react';\nimport { toast } from 'sonner';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { confirmAction } from '../utils/confirmAction';\nimport {\n useCreateBotWorkflow as useCreateWorkflow,\n useBotWorkflowDefinition as useWorkflowDefinition,\n} from '../hooks/useBotWorkflow';\nimport { Card, CardHeader, CardTitle, CardContent, CardDescription } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Badge, StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { useUpdateBot } from '../hooks/useBots';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { BOTMANOR_PERMISSIONS, BotmanorPermissionGate } from '../permissions';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Seed graph\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** First version minted for a bot's workflow — matches the builder's own default. */\nconst INITIAL_VERSION = 'v1';\n\n/**\n * BUILTIN \"Trigger Manually\" node (`MANUAL_TRIGGER_MANIFEST` in\n * wspace-workflow-svc). The executor resolves this type as a workflow's entry\n * node, and the builder renders it from the seeded node registry.\n */\nconst MANUAL_TRIGGER_NODE_TYPE = 'internal:api';\nconst MANUAL_TRIGGER_NODE_VERSION = '1.0.0';\nconst MANUAL_TRIGGER_OPERATION = 'onManualTrigger';\nconst MANUAL_TRIGGER_NAME = 'Trigger Manually';\nconst MANUAL_TRIGGER_DESCRIPTION =\n \"Runs the flow when you click 'Test workflow', or when this bot is invoked.\";\n\n/** `kind[]` the BotManor bridge scans for when classifying a node as a trigger. */\nconst MANUAL_TRIGGER_KIND = ['trigger', 'manual', 'entry'];\n\n/** Node shape written into `definitionJson.data.nodes`. */\ntype SeedNode = {\n id: string;\n type: string;\n position: { x: number; y: number };\n /** Top-level kind — the bridge's second trigger-detection path. */\n kind: string[];\n data: {\n operation_name: string;\n operation_type: string;\n version: string;\n nodeData: {\n nodeType: string;\n name: string;\n description: string;\n version: string;\n /** The bridge's third trigger-detection path. */\n kind: string[];\n operations: { name: string; type: string; role: string; description: string }[];\n };\n args: {\n context: { node: { id: string; type: string; kind: string[] } };\n state: Record<string, never>;\n credentials: never[];\n };\n };\n};\n\n/**\n * `definitionJson` document. Mirrors what the builder itself persists\n * (`useSaveWorkflow`) so the graph round-trips through the builder unchanged.\n */\ntype SeedDefinition = {\n key: string;\n name: string;\n description: string;\n workflow_type: string;\n data: {\n id: string;\n workflowKey: string;\n version: string;\n name: string;\n nodes: SeedNode[];\n edges: never[];\n sidebar: { active: string; panels: { nodeProperties: { selectedNode: null } } };\n stickyNotes: never[];\n };\n meta: { creator: string; version: string };\n tags: string[];\n};\n\n/**\n * Generate an opaque id. `crypto.randomUUID` is unavailable on insecure origins\n * and in some test environments, so fall back to a time+random token rather than\n * throwing mid-create.\n */\nfunction generateId(): string {\n const webCrypto = globalThis.crypto as Crypto | undefined;\n if (webCrypto && typeof webCrypto.randomUUID === 'function') {\n return webCrypto.randomUUID();\n }\n return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\n/** Build the starter graph: one manual trigger, nothing else. */\nfunction buildSeedDefinition(workflowKey: string, name: string): SeedDefinition {\n const triggerNode: SeedNode = {\n id: generateId(),\n type: MANUAL_TRIGGER_NODE_TYPE,\n position: { x: 160, y: 160 },\n kind: MANUAL_TRIGGER_KIND,\n data: {\n operation_name: MANUAL_TRIGGER_OPERATION,\n operation_type: 'trigger',\n version: MANUAL_TRIGGER_NODE_VERSION,\n nodeData: {\n nodeType: MANUAL_TRIGGER_NODE_TYPE,\n name: MANUAL_TRIGGER_NAME,\n description: MANUAL_TRIGGER_DESCRIPTION,\n version: MANUAL_TRIGGER_NODE_VERSION,\n kind: MANUAL_TRIGGER_KIND,\n operations: [\n {\n name: MANUAL_TRIGGER_OPERATION,\n type: 'trigger',\n role: 'trigger',\n description: MANUAL_TRIGGER_DESCRIPTION,\n },\n ],\n },\n args: {\n context: {\n node: {\n id: MANUAL_TRIGGER_NODE_TYPE,\n type: MANUAL_TRIGGER_NODE_TYPE,\n kind: MANUAL_TRIGGER_KIND,\n },\n },\n state: {},\n credentials: [],\n },\n },\n };\n\n return {\n key: workflowKey,\n name,\n description: name,\n workflow_type: 'query-conditional',\n data: {\n id: workflowKey,\n workflowKey,\n version: INITIAL_VERSION,\n name,\n nodes: [triggerNode],\n edges: [],\n sidebar: { active: 'store-browse', panels: { nodeProperties: { selectedNode: null } } },\n stickyNotes: [],\n },\n meta: { creator: 'botlit_bot_design', version: INITIAL_VERSION },\n tags: [],\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Component\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface BotWorkflowTabProps {\n botId: string;\n botName: string;\n /** `BotApp.workflowId` — the bound workflow definition id, if any. */\n workflowId: string | null | undefined;\n /** Refetch the bot so the tab reflects the new binding. */\n onWorkflowChanged: () => Promise<void> | void;\n}\n\nexport const BotWorkflowTab: FC<BotWorkflowTabProps> = ({\n botId,\n botName,\n workflowId,\n onWorkflowChanged,\n}) => {\n const t = useTr();\n const { navigateTo } = useBotlit();\n const { createWorkflow } = useCreateWorkflow();\n const [updateBot] = useUpdateBot();\n const [busy, setBusy] = useState(false);\n\n // Resolve by id — `BotApp.workflowId` stores the definition's opaque id, not\n // its workflowKey (which is what the builder route takes). The hook refetches\n // on its own when the bound id changes, so binding/unbinding only has to\n // refresh the bot.\n const { workflow, loading: workflowLoading } = useWorkflowDefinition(\n undefined,\n workflowId ?? undefined\n );\n\n const openBuilder = useCallback(\n (workflowKey: string, version: string) => {\n navigateTo(`workflows/workflow/${workflowKey}/${version || INITIAL_VERSION}`);\n },\n [navigateTo]\n );\n\n const handleDesign = useCallback(async () => {\n setBusy(true);\n try {\n const workflowKey = generateId();\n const name = `${botName} workflow`;\n const created = await createWorkflow({\n workflowKey,\n version: INITIAL_VERSION,\n name,\n description: t(\n 'botlit.botDetail.workflow.createdDescription',\n 'Behaviour designed for this BotManor bot.'\n ),\n definitionJson: buildSeedDefinition(workflowKey, name),\n });\n\n if (!created) {\n throw new Error(\n t('botlit.botDetail.workflow.createError', 'Failed to create the workflow')\n );\n }\n\n await updateBot({ botId, input: { workflowId: created.id } });\n await onWorkflowChanged();\n toast.success(\n t('botlit.botDetail.workflow.createSuccess', 'Workflow created and bound to this bot')\n );\n openBuilder(created.workflowKey, created.version);\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.createError', 'Failed to create the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, botName, createWorkflow, onWorkflowChanged, openBuilder, t, updateBot]);\n\n const handleUnbind = useCallback(async () => {\n const confirmed = await confirmAction({\n title: t(\n 'botlit.botDetail.workflow.unbindConfirm',\n 'Unbind this workflow from the bot? The workflow itself is not deleted.'\n ),\n confirmLabel: t('botlit.botDetail.workflow.unbindConfirmAction', 'Unbind'),\n cancelLabel: t('botlit.common.cancel', 'Cancel'),\n });\n if (!confirmed) return;\n setBusy(true);\n try {\n await updateBot({ botId, input: { workflowId: null } });\n await onWorkflowChanged();\n toast.success(t('botlit.botDetail.workflow.unbindSuccess', 'Workflow unbound'));\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.botDetail.workflow.unbindError', 'Failed to unbind the workflow');\n toast.error(message);\n } finally {\n setBusy(false);\n }\n }, [botId, onWorkflowChanged, t, updateBot]);\n\n // ── Not bound ─────────────────────────────────────────────────────────────\n if (!workflowId) {\n return (\n <Card>\n <CardContent className=\"pt-6\">\n <EmptyState\n illustration=\"empty-generic\"\n title={t('botlit.botDetail.workflow.empty.title', 'Design this bot as a workflow')}\n description={t(\n 'botlit.botDetail.workflow.empty.description',\n \"A bot's behaviour is designed as a FluidGrids workflow — the visual canvas where you wire triggers, agents, tools and conditions together. Start one and we will create it, bind it to this bot and open the builder for you.\"\n )}\n action={\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.APP_UPDATE}>\n <Button\n leftIcon={<Sparkles size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleDesign()}\n >\n {t('botlit.botDetail.workflow.empty.action', 'Design in workflow builder')}\n </Button>\n </BotmanorPermissionGate>\n }\n />\n </CardContent>\n </Card>\n );\n }\n\n // ── Bound ─────────────────────────────────────────────────────────────────\n return (\n <div className=\"space-y-6\">\n <Card>\n <CardHeader>\n <CardTitle className=\"flex items-center gap-2\">\n <Workflow size={18} />\n {t('botlit.botDetail.workflow.bound.title', 'Bound workflow')}\n </CardTitle>\n <CardDescription>\n {t(\n 'botlit.botDetail.workflow.bound.description',\n 'This workflow defines what the bot does when it is invoked.'\n )}\n </CardDescription>\n </CardHeader>\n <CardContent className=\"space-y-6\">\n {workflowLoading ? (\n <div className=\"h-24 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer\" />\n ) : workflow ? (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.name', 'Name')}\n </p>\n <p className=\"font-medium text-text-primary\">{workflow.name}</p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.key', 'Key')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">\n {workflow.workflowKey}\n </p>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.version', 'Version')}\n </p>\n <Badge variant=\"outline\" className=\"mt-1\">\n {workflow.version}\n </Badge>\n </div>\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.status', 'Status')}\n </p>\n <div className=\"mt-1\">\n <StatusBadge status={workflow.status} />\n </div>\n </div>\n </div>\n ) : (\n <div>\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.botDetail.workflow.fields.workflowId', 'Workflow ID')}\n </p>\n <p className=\"mt-1 break-all font-mono text-sm text-text-primary\">{workflowId}</p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {t(\n 'botlit.botDetail.workflow.unresolved',\n 'This workflow could not be loaded — it may have been deleted. Unbind it and design a new one.'\n )}\n </p>\n </div>\n )}\n\n <div className=\"flex flex-wrap gap-2\">\n {workflow && (\n <Button\n leftIcon={<ExternalLink size={16} />}\n disabled={busy}\n onClick={() => openBuilder(workflow.workflowKey, workflow.version)}\n >\n {t('botlit.botDetail.workflow.actions.openBuilder', 'Open in builder')}\n </Button>\n )}\n <BotmanorPermissionGate permission={BOTMANOR_PERMISSIONS.APP_UPDATE}>\n <Button\n variant=\"outline\"\n leftIcon={<Unlink size={16} />}\n isLoading={busy}\n disabled={busy}\n onClick={() => void handleUnbind()}\n >\n {t('botlit.botDetail.workflow.actions.unbind', 'Unbind')}\n </Button>\n </BotmanorPermissionGate>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,IAAME,IAAkB,MAOlBC,IAA2B,gBAC3BC,IAA8B,SAC9BC,IAA2B,mBAC3BC,IAAsB,oBACtBC,IACJ,8EAGIC,IAAsB;CAAC;CAAW;CAAU;AAAO;AA0DzD,SAASC,IAAqB;CAC5B,IAAMC,IAAY,WAAW;CAI7B,OAHIA,KAAa,OAAOA,EAAU,cAAe,aACxCA,EAAU,WAAW,IAEvB,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;AAC7E;AAGA,SAASC,EAAoB,GAAqB,GAA8B;CAuC9E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var N = "after:absolute after:inset-0 after:content-[\"\"] focus-visible:outline
325
325
  description: P("botlit.botsList.empty.description", "A bot puts your agents in front of real users. Create an agent first, then create a bot to connect it to channels."),
326
326
  action: Q
327
327
  }) : /* @__PURE__ */ D(p, {
328
+ kind: "filtered",
328
329
  illustration: "empty-agents",
329
330
  title: P("botlit.botsList.noResults.title", "No bots match \"{{query}}\"", { query: J }),
330
331
  description: P("botlit.botsList.noResults.description", "Check the spelling or try a different search term."),