@synergenius/flow-weaver-pack-weaver 0.9.59 → 0.9.77

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 (217) hide show
  1. package/dist/ai-chat-provider.d.ts +12 -0
  2. package/dist/ai-chat-provider.d.ts.map +1 -1
  3. package/dist/ai-chat-provider.js +351 -335
  4. package/dist/ai-chat-provider.js.map +1 -1
  5. package/dist/bot/agent-loop.d.ts +20 -0
  6. package/dist/bot/agent-loop.d.ts.map +1 -0
  7. package/dist/bot/agent-loop.js +331 -0
  8. package/dist/bot/agent-loop.js.map +1 -0
  9. package/dist/bot/ai-router.d.ts +19 -0
  10. package/dist/bot/ai-router.d.ts.map +1 -0
  11. package/dist/bot/ai-router.js +104 -0
  12. package/dist/bot/ai-router.js.map +1 -0
  13. package/dist/bot/assistant-tools.d.ts.map +1 -1
  14. package/dist/bot/assistant-tools.js +49 -33
  15. package/dist/bot/assistant-tools.js.map +1 -1
  16. package/dist/bot/async-mutex.d.ts +13 -0
  17. package/dist/bot/async-mutex.d.ts.map +1 -0
  18. package/dist/bot/async-mutex.js +37 -0
  19. package/dist/bot/async-mutex.js.map +1 -0
  20. package/dist/bot/bot-manager.d.ts +2 -2
  21. package/dist/bot/bot-manager.d.ts.map +1 -1
  22. package/dist/bot/bot-manager.js +3 -3
  23. package/dist/bot/bot-manager.js.map +1 -1
  24. package/dist/bot/bot-registry.js +2 -2
  25. package/dist/bot/bot-registry.js.map +1 -1
  26. package/dist/bot/conversation-store.d.ts +1 -0
  27. package/dist/bot/conversation-store.d.ts.map +1 -1
  28. package/dist/bot/conversation-store.js.map +1 -1
  29. package/dist/bot/dashboard.d.ts.map +1 -1
  30. package/dist/bot/dashboard.js +17 -8
  31. package/dist/bot/dashboard.js.map +1 -1
  32. package/dist/bot/improve-loop.js.map +1 -1
  33. package/dist/bot/index.d.ts +2 -4
  34. package/dist/bot/index.d.ts.map +1 -1
  35. package/dist/bot/index.js +1 -2
  36. package/dist/bot/index.js.map +1 -1
  37. package/dist/bot/instance-manager.d.ts +31 -0
  38. package/dist/bot/instance-manager.d.ts.map +1 -0
  39. package/dist/bot/instance-manager.js +115 -0
  40. package/dist/bot/instance-manager.js.map +1 -0
  41. package/dist/bot/orchestrator.d.ts +36 -0
  42. package/dist/bot/orchestrator.d.ts.map +1 -0
  43. package/dist/bot/orchestrator.js +176 -0
  44. package/dist/bot/orchestrator.js.map +1 -0
  45. package/dist/bot/profile-store.d.ts +36 -0
  46. package/dist/bot/profile-store.d.ts.map +1 -0
  47. package/dist/bot/profile-store.js +208 -0
  48. package/dist/bot/profile-store.js.map +1 -0
  49. package/dist/bot/profile-types.d.ts +126 -0
  50. package/dist/bot/profile-types.d.ts.map +1 -0
  51. package/dist/bot/profile-types.js +7 -0
  52. package/dist/bot/profile-types.js.map +1 -0
  53. package/dist/bot/run-store.d.ts.map +1 -1
  54. package/dist/bot/run-store.js +8 -0
  55. package/dist/bot/run-store.js.map +1 -1
  56. package/dist/bot/runner.d.ts +4 -0
  57. package/dist/bot/runner.d.ts.map +1 -1
  58. package/dist/bot/runner.js +5 -1
  59. package/dist/bot/runner.js.map +1 -1
  60. package/dist/bot/swarm-controller.d.ts +109 -0
  61. package/dist/bot/swarm-controller.d.ts.map +1 -0
  62. package/dist/bot/swarm-controller.js +640 -0
  63. package/dist/bot/swarm-controller.js.map +1 -0
  64. package/dist/bot/swarm-event-log.d.ts +28 -0
  65. package/dist/bot/swarm-event-log.d.ts.map +1 -0
  66. package/dist/bot/swarm-event-log.js +54 -0
  67. package/dist/bot/swarm-event-log.js.map +1 -0
  68. package/dist/bot/task-prompt-builder.d.ts +22 -0
  69. package/dist/bot/task-prompt-builder.d.ts.map +1 -0
  70. package/dist/bot/task-prompt-builder.js +240 -0
  71. package/dist/bot/task-prompt-builder.js.map +1 -0
  72. package/dist/bot/task-store.d.ts +21 -0
  73. package/dist/bot/task-store.d.ts.map +1 -0
  74. package/dist/bot/task-store.js +364 -0
  75. package/dist/bot/task-store.js.map +1 -0
  76. package/dist/bot/task-types.d.ts +79 -0
  77. package/dist/bot/task-types.d.ts.map +1 -0
  78. package/dist/bot/task-types.js +6 -0
  79. package/dist/bot/task-types.js.map +1 -0
  80. package/dist/bot/types.d.ts +8 -0
  81. package/dist/bot/types.d.ts.map +1 -1
  82. package/dist/cli-handlers.d.ts.map +1 -1
  83. package/dist/cli-handlers.js +79 -54
  84. package/dist/cli-handlers.js.map +1 -1
  85. package/dist/cli.d.ts +3 -0
  86. package/dist/cli.d.ts.map +1 -0
  87. package/dist/cli.js +749 -0
  88. package/dist/cli.js.map +1 -0
  89. package/dist/docs/docs/weaver-bot-usage.md +35 -18
  90. package/dist/docs/docs/weaver-config.md +20 -0
  91. package/dist/docs/docs/weaver-task-queue.md +31 -19
  92. package/dist/docs/weaver-config.md +15 -9
  93. package/dist/index.d.ts +2 -2
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +1 -1
  96. package/dist/index.js.map +1 -1
  97. package/dist/mcp-tools.d.ts +17 -0
  98. package/dist/mcp-tools.d.ts.map +1 -1
  99. package/dist/mcp-tools.js +98 -279
  100. package/dist/mcp-tools.js.map +1 -1
  101. package/dist/node-types/bot-report.d.ts.map +1 -1
  102. package/dist/node-types/bot-report.js +6 -24
  103. package/dist/node-types/bot-report.js.map +1 -1
  104. package/dist/node-types/orchestrator-dispatch.d.ts +17 -0
  105. package/dist/node-types/orchestrator-dispatch.d.ts.map +1 -0
  106. package/dist/node-types/orchestrator-dispatch.js +63 -0
  107. package/dist/node-types/orchestrator-dispatch.js.map +1 -0
  108. package/dist/node-types/orchestrator-load-state.d.ts +16 -0
  109. package/dist/node-types/orchestrator-load-state.d.ts.map +1 -0
  110. package/dist/node-types/orchestrator-load-state.js +60 -0
  111. package/dist/node-types/orchestrator-load-state.js.map +1 -0
  112. package/dist/node-types/orchestrator-route.d.ts +16 -0
  113. package/dist/node-types/orchestrator-route.d.ts.map +1 -0
  114. package/dist/node-types/orchestrator-route.js +28 -0
  115. package/dist/node-types/orchestrator-route.js.map +1 -0
  116. package/dist/node-types/receive-task.d.ts +2 -3
  117. package/dist/node-types/receive-task.d.ts.map +1 -1
  118. package/dist/node-types/receive-task.js +3 -48
  119. package/dist/node-types/receive-task.js.map +1 -1
  120. package/dist/templates/weaver-template.d.ts +11 -0
  121. package/dist/templates/weaver-template.d.ts.map +1 -0
  122. package/dist/templates/weaver-template.js +53 -0
  123. package/dist/templates/weaver-template.js.map +1 -0
  124. package/dist/ui/bot-activity.js +2 -2
  125. package/dist/ui/bot-constants.d.ts +14 -0
  126. package/dist/ui/bot-constants.d.ts.map +1 -0
  127. package/dist/ui/bot-constants.js +189 -0
  128. package/dist/ui/bot-constants.js.map +1 -0
  129. package/dist/ui/bot-panel.js +207 -245
  130. package/dist/ui/bot-slot-card.js +141 -0
  131. package/dist/ui/budget-bar.js +59 -0
  132. package/dist/ui/chat-task-result.js +178 -0
  133. package/dist/ui/decision-log.js +136 -0
  134. package/dist/ui/profile-card.js +158 -0
  135. package/dist/ui/profile-editor.js +597 -0
  136. package/dist/ui/swarm-controls.js +245 -0
  137. package/dist/ui/swarm-dashboard.js +3012 -0
  138. package/dist/ui/task-create-form.js +98 -0
  139. package/dist/ui/task-detail-view.js +1044 -0
  140. package/dist/ui/task-pool-list.js +156 -0
  141. package/dist/workflows/orchestrator.d.ts +21 -0
  142. package/dist/workflows/orchestrator.d.ts.map +1 -0
  143. package/dist/workflows/orchestrator.js +281 -0
  144. package/dist/workflows/orchestrator.js.map +1 -0
  145. package/dist/workflows/weaver-bot-session.d.ts +65 -0
  146. package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
  147. package/dist/workflows/weaver-bot-session.js +68 -0
  148. package/dist/workflows/weaver-bot-session.js.map +1 -0
  149. package/dist/workflows/weaver.d.ts +24 -0
  150. package/dist/workflows/weaver.d.ts.map +1 -0
  151. package/dist/workflows/weaver.js +28 -0
  152. package/dist/workflows/weaver.js.map +1 -0
  153. package/flowweaver.manifest.json +547 -133
  154. package/package.json +1 -1
  155. package/src/ai-chat-provider.ts +378 -371
  156. package/src/bot/ai-router.ts +132 -0
  157. package/src/bot/assistant-tools.ts +47 -29
  158. package/src/bot/async-mutex.ts +37 -0
  159. package/src/bot/bot-manager.ts +3 -3
  160. package/src/bot/bot-registry.ts +2 -2
  161. package/src/bot/conversation-store.ts +2 -1
  162. package/src/bot/dashboard.ts +17 -8
  163. package/src/bot/improve-loop.ts +6 -6
  164. package/src/bot/index.ts +2 -4
  165. package/src/bot/instance-manager.ts +128 -0
  166. package/src/bot/orchestrator.ts +244 -0
  167. package/src/bot/profile-store.ts +225 -0
  168. package/src/bot/profile-types.ts +141 -0
  169. package/src/bot/run-store.ts +8 -0
  170. package/src/bot/runner.ts +9 -1
  171. package/src/bot/swarm-controller.ts +780 -0
  172. package/src/bot/swarm-event-log.ts +57 -0
  173. package/src/bot/task-prompt-builder.ts +309 -0
  174. package/src/bot/task-store.ts +407 -0
  175. package/src/bot/task-types.ts +100 -0
  176. package/src/bot/types.ts +8 -0
  177. package/src/cli-handlers.ts +78 -53
  178. package/src/docs/weaver-bot-usage.md +35 -18
  179. package/src/docs/weaver-config.md +20 -0
  180. package/src/docs/weaver-task-queue.md +31 -19
  181. package/src/index.ts +5 -4
  182. package/src/mcp-tools.ts +129 -372
  183. package/src/node-types/bot-report.ts +6 -24
  184. package/src/node-types/orchestrator-dispatch.ts +71 -0
  185. package/src/node-types/orchestrator-load-state.ts +66 -0
  186. package/src/node-types/orchestrator-route.ts +33 -0
  187. package/src/node-types/receive-task.ts +3 -57
  188. package/src/ui/bot-activity.tsx +2 -2
  189. package/src/ui/bot-constants.ts +192 -0
  190. package/src/ui/bot-panel.tsx +213 -247
  191. package/src/ui/bot-slot-card.tsx +139 -0
  192. package/src/ui/budget-bar.tsx +30 -0
  193. package/src/ui/chat-task-result.tsx +236 -0
  194. package/src/ui/decision-log.tsx +148 -0
  195. package/src/ui/profile-card.tsx +157 -0
  196. package/src/ui/profile-editor.tsx +384 -0
  197. package/src/ui/swarm-controls.tsx +260 -0
  198. package/src/ui/swarm-dashboard.tsx +647 -0
  199. package/src/ui/task-create-form.tsx +87 -0
  200. package/src/ui/task-detail-view.tsx +841 -0
  201. package/src/ui/task-pool-list.tsx +187 -0
  202. package/src/workflows/orchestrator.ts +302 -0
  203. package/dist/docs/weaver-bot-usage.md +0 -34
  204. package/dist/docs/weaver-genesis.md +0 -32
  205. package/dist/docs/weaver-task-queue.md +0 -34
  206. package/dist/ui/bot-workspace.js +0 -1015
  207. package/dist/ui/chat-bot-result.js +0 -71
  208. package/dist/ui/queue-input.js +0 -82
  209. package/dist/ui/session-bar.js +0 -174
  210. package/src/bot/error-guide.ts +0 -4
  211. package/src/bot/retry-utils.ts +0 -4
  212. package/src/bot/session-state.ts +0 -116
  213. package/src/bot/task-queue.ts +0 -262
  214. package/src/ui/bot-workspace.tsx +0 -442
  215. package/src/ui/chat-bot-result.tsx +0 -81
  216. package/src/ui/queue-input.tsx +0 -56
  217. package/src/ui/session-bar.tsx +0 -157
@@ -0,0 +1,66 @@
1
+ import type { OrchestratorInput } from '../bot/profile-types.js';
2
+
3
+ /**
4
+ * Loads the current swarm state for the orchestrator to make routing decisions.
5
+ *
6
+ * @flowWeaver nodeType
7
+ * @label Load Swarm State
8
+ * @input projectDir [order:0] - Project directory path
9
+ * @output state [order:0] - JSON OrchestratorInput snapshot
10
+ * @output onSuccess [order:-2] - Loaded successfully
11
+ * @output onFailure [order:-1] [hidden] - Load failed
12
+ */
13
+ export async function orchestratorLoadState(
14
+ execute: boolean,
15
+ projectDir: string,
16
+ ): Promise<{ onSuccess: boolean; onFailure: boolean; state: string | null }> {
17
+ if (!execute) {
18
+ return { onSuccess: true, onFailure: false, state: '{"pendingTasks":[],"profiles":[],"instances":[],"budgetRemaining":{"tokens":0,"cost":0}}' };
19
+ }
20
+
21
+ try {
22
+ const { SwarmController } = await import('../bot/swarm-controller.js');
23
+ const controller = SwarmController.getInstance(projectDir);
24
+ const profileStore = controller.getProfileStore();
25
+ const instanceManager = controller.getInstanceManager();
26
+ const swarmStatus = controller.getStatus();
27
+
28
+ // Load profiles
29
+ const profiles = profileStore.list();
30
+
31
+ // Load instances
32
+ const instances = instanceManager.listAll();
33
+
34
+ // Calculate budget remaining from swarm state
35
+ const { workspace, session } = swarmStatus.budgets;
36
+ const remainingTokens: number[] = [];
37
+ const remainingCost: number[] = [];
38
+ if (session.limitTokens > 0) remainingTokens.push(session.limitTokens - session.usedTokens);
39
+ if (workspace.limitTokens > 0) remainingTokens.push(workspace.limitTokens - workspace.usedTokens);
40
+ if (session.limitCost > 0) remainingCost.push(session.limitCost - session.usedCost);
41
+ if (workspace.limitCost > 0) remainingCost.push(workspace.limitCost - workspace.usedCost);
42
+
43
+ const budgetRemaining = {
44
+ tokens: remainingTokens.length > 0 ? Math.min(...remainingTokens) : Infinity,
45
+ cost: remainingCost.length > 0 ? Math.min(...remainingCost) : Infinity,
46
+ };
47
+
48
+ // Note: pending tasks are not loaded here — the node only loads
49
+ // profiles, instances, and budget. Task loading requires TaskStore
50
+ // access which is internal to SwarmController's dispatch loop.
51
+ // The caller should provide tasks via the workflow or the dispatch loop
52
+ // builds the full OrchestratorInput itself.
53
+ const input: OrchestratorInput = {
54
+ pendingTasks: [],
55
+ profiles,
56
+ instances,
57
+ budgetRemaining,
58
+ };
59
+
60
+ return { onSuccess: true, onFailure: false, state: JSON.stringify(input) };
61
+ } catch (err: unknown) {
62
+ const msg = err instanceof Error ? err.message : String(err);
63
+ console.error(`\x1b[31m→ Load swarm state failed: ${msg}\x1b[0m`);
64
+ return { onSuccess: false, onFailure: true, state: null };
65
+ }
66
+ }
@@ -0,0 +1,33 @@
1
+ import { Orchestrator } from '../bot/orchestrator.js';
2
+ import type { OrchestratorInput } from '../bot/profile-types.js';
3
+
4
+ /**
5
+ * Routes pending tasks to appropriate bot profiles using the orchestrator brain.
6
+ *
7
+ * @flowWeaver nodeType
8
+ * @label Route Tasks
9
+ * @input state [order:0] - JSON OrchestratorInput
10
+ * @output decisions [order:0] - JSON OrchestratorOutput
11
+ * @output onSuccess [order:-2] - Routing complete
12
+ * @output onFailure [order:-1] [hidden] - Routing failed
13
+ */
14
+ export async function orchestratorRoute(
15
+ execute: boolean,
16
+ state: string,
17
+ ): Promise<{ onSuccess: boolean; onFailure: boolean; decisions: string | null }> {
18
+ if (!execute) {
19
+ return { onSuccess: true, onFailure: false, decisions: '{"assignments":[],"scaleActions":[],"skippedTasks":[]}' };
20
+ }
21
+
22
+ try {
23
+ const input = JSON.parse(state) as OrchestratorInput;
24
+ const orchestrator = new Orchestrator();
25
+ const output = await orchestrator.route(input);
26
+
27
+ return { onSuccess: true, onFailure: false, decisions: JSON.stringify(output) };
28
+ } catch (err: unknown) {
29
+ const msg = err instanceof Error ? err.message : String(err);
30
+ console.error(`\x1b[31m→ Route tasks failed: ${msg}\x1b[0m`);
31
+ return { onSuccess: false, onFailure: true, decisions: null };
32
+ }
33
+ }
@@ -1,24 +1,8 @@
1
- import * as fs from 'node:fs';
2
- import * as path from 'node:path';
3
- import * as os from 'node:os';
4
1
  import type { WeaverEnv, WeaverContext } from '../bot/types.js';
5
- import { withFileLock } from '../bot/file-lock.js';
6
-
7
- interface QueuedTask {
8
- id: string;
9
- instruction: string;
10
- mode?: 'create' | 'modify' | 'read' | 'batch';
11
- targets?: string[];
12
- options?: Record<string, unknown>;
13
- priority: number;
14
- addedAt: number;
15
- status: string;
16
- }
17
2
 
18
3
  /**
19
- * Receives a task from CLI args, MCP tool call, or the task queue.
20
- * Parses the instruction into a structured BotTask. Creates the
21
- * WeaverContext that threads through the bot pipeline.
4
+ * Receives a pre-supplied task and creates the WeaverContext that
5
+ * threads through the bot pipeline.
22
6
  *
23
7
  * @flowWeaver nodeType
24
8
  * @label Receive Task
@@ -42,7 +26,6 @@ export async function weaverReceiveTask(
42
26
  return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
43
27
  }
44
28
 
45
- // If taskJson is pre-supplied, use it directly
46
29
  if (taskJson) {
47
30
  try {
48
31
  const parsed = JSON.parse(taskJson);
@@ -52,46 +35,9 @@ export async function weaverReceiveTask(
52
35
  context.hasTask = true;
53
36
  return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
54
37
  }
55
- } catch { /* fall through to queue check */ }
38
+ } catch { /* invalid JSON no task */ }
56
39
  }
57
40
 
58
- // Check task queue (with file locking to prevent race conditions)
59
- const queuePath = path.join(os.homedir(), '.weaver', 'task-queue.ndjson');
60
- try {
61
- const claimed = await withFileLock(queuePath, () => {
62
- if (!fs.existsSync(queuePath)) return null;
63
- const content = fs.readFileSync(queuePath, 'utf-8').trim();
64
- if (!content) return null;
65
-
66
- const tasks: QueuedTask[] = content.split('\n').filter(Boolean).map(l => JSON.parse(l));
67
- const pending = tasks
68
- .filter(t => t.status === 'pending')
69
- .sort((a, b) => b.priority - a.priority || a.addedAt - b.addedAt);
70
-
71
- if (pending.length === 0) return null;
72
-
73
- const task = pending[0]!;
74
- // Atomically mark as running inside the lock
75
- const updated = tasks.map(t => t.id === task.id ? { ...t, status: 'running' } : t);
76
- fs.writeFileSync(queuePath, updated.map(t => JSON.stringify(t)).join('\n') + '\n', 'utf-8');
77
- return task;
78
- });
79
-
80
- if (claimed) {
81
- const botTask = {
82
- instruction: claimed.instruction,
83
- mode: claimed.mode ?? 'create',
84
- targets: claimed.targets,
85
- options: claimed.options,
86
- queueId: claimed.id,
87
- };
88
- console.log(`\x1b[36m→ Task from queue [${claimed.id}]: ${claimed.instruction.slice(0, 80)}\x1b[0m`);
89
- context.taskJson = JSON.stringify(botTask);
90
- context.hasTask = true;
91
- return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
92
- }
93
- } catch (err) { if (process.env.WEAVER_VERBOSE) console.error('[receive-task] queue error:', err); }
94
-
95
41
  console.log('\x1b[33m→ No task found\x1b[0m');
96
42
  return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
97
43
  }
@@ -181,7 +181,7 @@ function BotActivity({ packName, botId }: { packName: string; botId: string }) {
181
181
  const fetchAll = useCallback(async () => {
182
182
  const [hist, q, ins, st] = await Promise.allSettled([
183
183
  callTool('fw_weaver_history', { limit: 15 }),
184
- callTool('fw_weaver_queue', { action: 'list' }),
184
+ callTool('fw_weaver_task_list', { status: 'pending' }),
185
185
  callTool('fw_weaver_insights'),
186
186
  callTool('fw_weaver_status'),
187
187
  ]);
@@ -212,7 +212,7 @@ function BotActivity({ packName, botId }: { packName: string; botId: string }) {
212
212
  }, [botId]);
213
213
 
214
214
  const handleRemoveQueueItem = useCallback(async (id: string) => {
215
- await callTool('fw_weaver_queue', { action: 'remove', id });
215
+ await callTool('fw_weaver_task_cancel', { id });
216
216
  setQueue((prev) => prev.filter((q) => q.id !== id));
217
217
  }, []);
218
218
 
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Shared constants for bot panel components: icon catalog, colors, helpers.
3
+ */
4
+
5
+ /* ── Categorised icon catalog ──────────────────────────────────────── */
6
+
7
+ export const ICON_CATALOG: { category: string; icons: string[] }[] = [
8
+ {
9
+ category: 'Actions',
10
+ icons: [
11
+ 'playArrow',
12
+ 'stop',
13
+ 'pause',
14
+ 'restart',
15
+ 'send',
16
+ 'check',
17
+ 'edit',
18
+ 'copy',
19
+ 'add',
20
+ 'reset',
21
+ 'resume',
22
+ ],
23
+ },
24
+ {
25
+ category: 'AI & Science',
26
+ icons: ['smartToy', 'psychology', 'autoAwesome', 'modelTraining', 'biotech', 'science', 'ai'],
27
+ },
28
+ {
29
+ category: 'Data & Storage',
30
+ icons: ['database', 'dataObject', 'dataArray', 'tableChart', 'token', 'dns', 'cloudStorage'],
31
+ },
32
+ {
33
+ category: 'Logic & Flow',
34
+ icons: [
35
+ 'altRoute',
36
+ 'callSplit',
37
+ 'callMerge',
38
+ 'rule',
39
+ 'filterAlt',
40
+ 'sort',
41
+ 'loop',
42
+ 'repeat',
43
+ 'compareArrows',
44
+ 'swapHoriz',
45
+ 'syncAlt',
46
+ 'changeCircle',
47
+ 'allInclusive',
48
+ ],
49
+ },
50
+ {
51
+ category: 'Cloud & Network',
52
+ icons: [
53
+ 'cloudSync',
54
+ 'cloudUpload',
55
+ 'cloudDownload',
56
+ 'cloudDone',
57
+ 'api',
58
+ 'webhook',
59
+ 'public',
60
+ 'router',
61
+ ],
62
+ },
63
+ {
64
+ category: 'Communication',
65
+ icons: ['email', 'chat', 'forum', 'notifications', 'campaign', 'rssFeed', 'sms'],
66
+ },
67
+ {
68
+ category: 'Security',
69
+ icons: [
70
+ 'key',
71
+ 'shield',
72
+ 'security',
73
+ 'vpnKey',
74
+ 'adminPanel',
75
+ 'policy',
76
+ 'verified',
77
+ 'lockClosed',
78
+ 'lockOpened',
79
+ ],
80
+ },
81
+ {
82
+ category: 'Time',
83
+ icons: [
84
+ 'timer',
85
+ 'alarm',
86
+ 'hourglassEmpty',
87
+ 'pendingActions',
88
+ 'update',
89
+ 'watchLater',
90
+ 'scheduled',
91
+ ],
92
+ },
93
+ {
94
+ category: 'Tasks & Workflow',
95
+ icons: [
96
+ 'task',
97
+ 'taskAlt',
98
+ 'checklist',
99
+ 'assignment',
100
+ 'publish',
101
+ 'build',
102
+ 'construction',
103
+ 'engineering',
104
+ ],
105
+ },
106
+ {
107
+ category: 'Analytics',
108
+ icons: [
109
+ 'analytics',
110
+ 'insights',
111
+ 'barChart',
112
+ 'pieChart',
113
+ 'trendingUp',
114
+ 'showChart',
115
+ 'leaderboard',
116
+ 'monitoring',
117
+ ],
118
+ },
119
+ {
120
+ category: 'Flow Nodes',
121
+ icons: [
122
+ 'schema',
123
+ 'hub',
124
+ 'deviceHub',
125
+ 'source',
126
+ 'trigger',
127
+ 'pulse',
128
+ 'step',
129
+ 'event',
130
+ 'outlinedFlow',
131
+ ],
132
+ },
133
+ {
134
+ category: 'Files & Documents',
135
+ icons: [
136
+ 'file',
137
+ 'filePresent',
138
+ 'fileCopy',
139
+ 'textSnippet',
140
+ 'attachFile',
141
+ 'uploadFile',
142
+ 'save',
143
+ 'upload',
144
+ 'download',
145
+ ],
146
+ },
147
+ {
148
+ category: 'General',
149
+ icons: [
150
+ 'rocketLaunch',
151
+ 'code',
152
+ 'terminal',
153
+ 'logs',
154
+ 'info',
155
+ 'help',
156
+ 'list',
157
+ 'category',
158
+ 'hash',
159
+ 'calendar',
160
+ 'history',
161
+ 'integration',
162
+ 'layers',
163
+ 'link',
164
+ 'search',
165
+ 'outlinedSettings',
166
+ 'outlinedBug',
167
+ 'collaboration',
168
+ 'person',
169
+ 'people',
170
+ 'backup',
171
+ 'healthAndSafety',
172
+ ],
173
+ },
174
+ ];
175
+
176
+ export const BOT_COLORS = [
177
+ { label: 'Blue', token: 'color-node-blue-icon' },
178
+ { label: 'Purple', token: 'color-node-purple-icon' },
179
+ { label: 'Cyan', token: 'color-node-cyan-icon' },
180
+ { label: 'Orange', token: 'color-node-orange-icon' },
181
+ { label: 'Pink', token: 'color-node-pink-icon' },
182
+ { label: 'Green', token: 'color-node-green-icon' },
183
+ { label: 'Brand', token: 'color-brand-main' },
184
+ { label: 'Accent', token: 'color-brand-alt' },
185
+ { label: 'Positive', token: 'color-status-positive' },
186
+ { label: 'Info', token: 'color-status-info' },
187
+ ];
188
+
189
+ /** Convert camelCase icon name to searchable words: "cloudSync" -> "cloud sync" */
190
+ export function iconToWords(name: string): string {
191
+ return name.replace(/([A-Z])/g, ' $1').toLowerCase();
192
+ }