@synergenius/flow-weaver-pack-weaver 0.9.62 → 0.9.78

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 (162) 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 +173 -19
  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/bot-registry.js +2 -2
  14. package/dist/bot/bot-registry.js.map +1 -1
  15. package/dist/bot/conversation-store.d.ts +1 -0
  16. package/dist/bot/conversation-store.d.ts.map +1 -1
  17. package/dist/bot/conversation-store.js.map +1 -1
  18. package/dist/bot/improve-loop.js.map +1 -1
  19. package/dist/bot/instance-manager.d.ts +31 -0
  20. package/dist/bot/instance-manager.d.ts.map +1 -0
  21. package/dist/bot/instance-manager.js +115 -0
  22. package/dist/bot/instance-manager.js.map +1 -0
  23. package/dist/bot/orchestrator.d.ts +36 -0
  24. package/dist/bot/orchestrator.d.ts.map +1 -0
  25. package/dist/bot/orchestrator.js +176 -0
  26. package/dist/bot/orchestrator.js.map +1 -0
  27. package/dist/bot/profile-store.d.ts +36 -0
  28. package/dist/bot/profile-store.d.ts.map +1 -0
  29. package/dist/bot/profile-store.js +208 -0
  30. package/dist/bot/profile-store.js.map +1 -0
  31. package/dist/bot/profile-types.d.ts +126 -0
  32. package/dist/bot/profile-types.d.ts.map +1 -0
  33. package/dist/bot/profile-types.js +7 -0
  34. package/dist/bot/profile-types.js.map +1 -0
  35. package/dist/bot/session-state.d.ts +25 -0
  36. package/dist/bot/session-state.d.ts.map +1 -0
  37. package/dist/bot/session-state.js +110 -0
  38. package/dist/bot/session-state.js.map +1 -0
  39. package/dist/bot/swarm-controller.d.ts +37 -21
  40. package/dist/bot/swarm-controller.d.ts.map +1 -1
  41. package/dist/bot/swarm-controller.js +344 -163
  42. package/dist/bot/swarm-controller.js.map +1 -1
  43. package/dist/bot/task-prompt-builder.d.ts +2 -1
  44. package/dist/bot/task-prompt-builder.d.ts.map +1 -1
  45. package/dist/bot/task-prompt-builder.js +33 -10
  46. package/dist/bot/task-prompt-builder.js.map +1 -1
  47. package/dist/bot/task-queue.d.ts +46 -0
  48. package/dist/bot/task-queue.d.ts.map +1 -0
  49. package/dist/bot/task-queue.js +237 -0
  50. package/dist/bot/task-queue.js.map +1 -0
  51. package/dist/bot/task-store.d.ts +1 -6
  52. package/dist/bot/task-store.d.ts.map +1 -1
  53. package/dist/bot/task-store.js +27 -78
  54. package/dist/bot/task-store.js.map +1 -1
  55. package/dist/bot/task-types.d.ts +8 -4
  56. package/dist/bot/task-types.d.ts.map +1 -1
  57. package/dist/cli-handlers.d.ts.map +1 -1
  58. package/dist/cli-handlers.js +2 -3
  59. package/dist/cli-handlers.js.map +1 -1
  60. package/dist/cli.d.ts +3 -0
  61. package/dist/cli.d.ts.map +1 -0
  62. package/dist/cli.js +749 -0
  63. package/dist/cli.js.map +1 -0
  64. package/dist/docs/docs/weaver-bot-usage.md +35 -18
  65. package/dist/docs/docs/weaver-config.md +20 -0
  66. package/dist/docs/docs/weaver-task-queue.md +31 -19
  67. package/dist/docs/weaver-config.md +15 -9
  68. package/dist/mcp-tools.d.ts +17 -0
  69. package/dist/mcp-tools.d.ts.map +1 -1
  70. package/dist/mcp-tools.js +98 -232
  71. package/dist/mcp-tools.js.map +1 -1
  72. package/dist/node-types/orchestrator-dispatch.d.ts +17 -0
  73. package/dist/node-types/orchestrator-dispatch.d.ts.map +1 -0
  74. package/dist/node-types/orchestrator-dispatch.js +63 -0
  75. package/dist/node-types/orchestrator-dispatch.js.map +1 -0
  76. package/dist/node-types/orchestrator-load-state.d.ts +16 -0
  77. package/dist/node-types/orchestrator-load-state.d.ts.map +1 -0
  78. package/dist/node-types/orchestrator-load-state.js +60 -0
  79. package/dist/node-types/orchestrator-load-state.js.map +1 -0
  80. package/dist/node-types/orchestrator-route.d.ts +16 -0
  81. package/dist/node-types/orchestrator-route.d.ts.map +1 -0
  82. package/dist/node-types/orchestrator-route.js +28 -0
  83. package/dist/node-types/orchestrator-route.js.map +1 -0
  84. package/dist/node-types/receive-task.d.ts +2 -3
  85. package/dist/node-types/receive-task.d.ts.map +1 -1
  86. package/dist/node-types/receive-task.js +3 -28
  87. package/dist/node-types/receive-task.js.map +1 -1
  88. package/dist/templates/weaver-template.d.ts +11 -0
  89. package/dist/templates/weaver-template.d.ts.map +1 -0
  90. package/dist/templates/weaver-template.js +53 -0
  91. package/dist/templates/weaver-template.js.map +1 -0
  92. package/dist/ui/bot-constants.d.ts +14 -0
  93. package/dist/ui/bot-constants.d.ts.map +1 -0
  94. package/dist/ui/bot-constants.js +189 -0
  95. package/dist/ui/bot-constants.js.map +1 -0
  96. package/dist/ui/bot-panel.js +51 -90
  97. package/dist/ui/bot-slot-card.js +87 -122
  98. package/dist/ui/budget-bar.js +5 -3
  99. package/dist/ui/chat-task-result.js +4 -7
  100. package/dist/ui/decision-log.js +136 -0
  101. package/dist/ui/profile-card.js +158 -0
  102. package/dist/ui/profile-editor.js +597 -0
  103. package/dist/ui/swarm-controls.js +36 -27
  104. package/dist/ui/swarm-dashboard.js +2034 -736
  105. package/dist/ui/task-create-form.js +39 -116
  106. package/dist/ui/task-detail-view.js +490 -239
  107. package/dist/ui/task-pool-list.js +69 -94
  108. package/dist/workflows/orchestrator.d.ts +21 -0
  109. package/dist/workflows/orchestrator.d.ts.map +1 -0
  110. package/dist/workflows/orchestrator.js +281 -0
  111. package/dist/workflows/orchestrator.js.map +1 -0
  112. package/dist/workflows/weaver-bot-session.d.ts +65 -0
  113. package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
  114. package/dist/workflows/weaver-bot-session.js +68 -0
  115. package/dist/workflows/weaver-bot-session.js.map +1 -0
  116. package/dist/workflows/weaver.d.ts +24 -0
  117. package/dist/workflows/weaver.d.ts.map +1 -0
  118. package/dist/workflows/weaver.js +28 -0
  119. package/dist/workflows/weaver.js.map +1 -0
  120. package/flowweaver.manifest.json +253 -66
  121. package/package.json +1 -1
  122. package/src/ai-chat-provider.ts +184 -18
  123. package/src/bot/ai-router.ts +132 -0
  124. package/src/bot/bot-registry.ts +2 -2
  125. package/src/bot/conversation-store.ts +2 -1
  126. package/src/bot/improve-loop.ts +6 -6
  127. package/src/bot/instance-manager.ts +128 -0
  128. package/src/bot/orchestrator.ts +244 -0
  129. package/src/bot/profile-store.ts +225 -0
  130. package/src/bot/profile-types.ts +141 -0
  131. package/src/bot/swarm-controller.ts +385 -186
  132. package/src/bot/task-prompt-builder.ts +37 -6
  133. package/src/bot/task-store.ts +28 -89
  134. package/src/bot/task-types.ts +10 -4
  135. package/src/cli-handlers.ts +2 -3
  136. package/src/docs/weaver-bot-usage.md +35 -18
  137. package/src/docs/weaver-config.md +20 -0
  138. package/src/docs/weaver-task-queue.md +31 -19
  139. package/src/mcp-tools.ts +129 -320
  140. package/src/node-types/orchestrator-dispatch.ts +71 -0
  141. package/src/node-types/orchestrator-load-state.ts +66 -0
  142. package/src/node-types/orchestrator-route.ts +33 -0
  143. package/src/node-types/receive-task.ts +3 -26
  144. package/src/ui/bot-constants.ts +192 -0
  145. package/src/ui/bot-panel.tsx +55 -79
  146. package/src/ui/bot-slot-card.tsx +69 -117
  147. package/src/ui/budget-bar.tsx +5 -3
  148. package/src/ui/chat-task-result.tsx +6 -9
  149. package/src/ui/decision-log.tsx +148 -0
  150. package/src/ui/profile-card.tsx +157 -0
  151. package/src/ui/profile-editor.tsx +384 -0
  152. package/src/ui/swarm-controls.tsx +35 -31
  153. package/src/ui/swarm-dashboard.tsx +409 -80
  154. package/src/ui/task-create-form.tsx +29 -119
  155. package/src/ui/task-detail-view.tsx +461 -215
  156. package/src/ui/task-pool-list.tsx +74 -95
  157. package/src/workflows/orchestrator.ts +302 -0
  158. package/dist/docs/weaver-bot-usage.md +0 -34
  159. package/dist/docs/weaver-genesis.md +0 -32
  160. package/dist/docs/weaver-task-queue.md +0 -34
  161. package/src/bot/error-guide.ts +0 -4
  162. package/src/bot/retry-utils.ts +0 -4
@@ -1,8 +1,6 @@
1
- import { TaskStore } from '../bot/task-store.js';
2
1
  /**
3
- * Receives a task from CLI args, MCP tool call, or the task queue.
4
- * Parses the instruction into a structured BotTask. Creates the
5
- * WeaverContext that threads through the bot pipeline.
2
+ * Receives a pre-supplied task and creates the WeaverContext that
3
+ * threads through the bot pipeline.
6
4
  *
7
5
  * @flowWeaver nodeType
8
6
  * @label Receive Task
@@ -17,7 +15,6 @@ export async function weaverReceiveTask(execute, env, taskJson) {
17
15
  if (!execute) {
18
16
  return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
19
17
  }
20
- // If taskJson is pre-supplied, use it directly
21
18
  if (taskJson) {
22
19
  try {
23
20
  const parsed = JSON.parse(taskJson);
@@ -28,29 +25,7 @@ export async function weaverReceiveTask(execute, env, taskJson) {
28
25
  return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
29
26
  }
30
27
  }
31
- catch { /* fall through to queue check */ }
32
- }
33
- // Check task queue via TaskStore
34
- try {
35
- const store = new TaskStore(env.projectDir);
36
- const claimed = await store.claimNext('weaver-bot');
37
- if (claimed) {
38
- const botTask = {
39
- instruction: claimed.title,
40
- mode: 'create',
41
- targets: undefined,
42
- options: undefined,
43
- queueId: claimed.id,
44
- };
45
- console.log(`\x1b[36m→ Task from queue [${claimed.id}]: ${claimed.title.slice(0, 80)}\x1b[0m`);
46
- context.taskJson = JSON.stringify(botTask);
47
- context.hasTask = true;
48
- return { onSuccess: true, onFailure: false, ctx: JSON.stringify(context) };
49
- }
50
- }
51
- catch (err) {
52
- if (process.env.WEAVER_VERBOSE)
53
- console.error('[receive-task] queue error:', err);
28
+ catch { /* invalid JSON no task */ }
54
29
  }
55
30
  console.log('\x1b[33m→ No task found\x1b[0m');
56
31
  return { onSuccess: false, onFailure: true, ctx: JSON.stringify(context) };
@@ -1 +1 @@
1
- {"version":3,"file":"receive-task.js","sourceRoot":"","sources":["../../src/node-types/receive-task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAgB,EAChB,GAAc,EACd,QAAiB;IAKjB,MAAM,OAAO,GAAkB,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAEvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,+CAA+C;IAC/C,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YACpC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,4BAA4B,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;gBAClF,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC5B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;gBACvB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC;QAAC,MAAM,CAAC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4
+ description: string;
5
+ category: string;
6
+ generate: (opts: {
7
+ projectDir?: string;
8
+ }) => string;
9
+ }
10
+ export declare const weaverTemplate: WorkflowTemplate;
11
+ //# sourceMappingURL=weaver-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-template.d.ts","sourceRoot":"","sources":["../../src/templates/weaver-template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CACrD;AAED,eAAO,MAAM,cAAc,EAAE,gBAmD5B,CAAC"}
@@ -0,0 +1,53 @@
1
+ export const weaverTemplate = {
2
+ id: 'weaver',
3
+ name: 'Weaver: Autonomous workflow runner',
4
+ description: 'AI-powered runner that executes any Flow Weaver workflow autonomously, with auto-detected providers and notification support',
5
+ category: 'automation',
6
+ generate: (_opts) => {
7
+ return `// Generated by flowweaver-pack-weaver. Compile before running:
8
+ // flow-weaver compile weaver.ts
9
+ // flow-weaver run weaver.ts
10
+ // Or use the CLI directly: npx weaver weaver.ts
11
+ //
12
+ // Node types are provided by @synergenius/flowweaver-pack-weaver.
13
+ // Install it: npm install @synergenius/flowweaver-pack-weaver
14
+
15
+ import { weaverLoadConfig } from '@synergenius/flowweaver-pack-weaver/node-types';
16
+ import { weaverDetectProvider } from '@synergenius/flowweaver-pack-weaver/node-types';
17
+ import { weaverResolveTarget } from '@synergenius/flowweaver-pack-weaver/node-types';
18
+ import { weaverExecuteTarget } from '@synergenius/flowweaver-pack-weaver/node-types';
19
+ import { weaverSendNotify } from '@synergenius/flowweaver-pack-weaver/node-types';
20
+ import { weaverReport } from '@synergenius/flowweaver-pack-weaver/node-types';
21
+
22
+ /**
23
+ * @flowWeaver workflow
24
+ * @node cfg weaverLoadConfig [color: "teal"] [icon: "settings"] [position: 100 0]
25
+ * @node detect weaverDetectProvider [color: "cyan"] [icon: "search"] [position: 250 0]
26
+ * @node target weaverResolveTarget [color: "blue"] [icon: "code"] [position: 400 0]
27
+ * @node exec weaverExecuteTarget [color: "purple"] [icon: "psychology"] [position: 550 0]
28
+ * @node notify weaverSendNotify [color: "yellow"] [icon: "notifications"] [position: 700 0]
29
+ * @node rep weaverReport [color: "green"] [icon: "description"] [position: 850 0]
30
+ * @path Start -> cfg -> detect -> target -> exec -> notify -> rep -> Exit
31
+ * @position Start 0 0
32
+ * @position Exit 1000 0
33
+ * @connect rep.summary -> Exit.summary
34
+ * @param execute [order:-1] - Execute
35
+ * @param params [order:0] - Params
36
+ * @returns onSuccess [order:-2] - On Success
37
+ * @returns onFailure [order:-1] - On Failure
38
+ * @returns summary [order:0] - Summary text
39
+ */
40
+ export async function weaver(
41
+ execute: boolean,
42
+ params: Record<string, never> = {},
43
+ __abortSignal__?: AbortSignal,
44
+ ): Promise<{ onSuccess: boolean; onFailure: boolean; summary: string | null }> {
45
+ // @flow-weaver-body-start
46
+ // (auto-generated by compiler)
47
+ // @flow-weaver-body-end
48
+ return { onSuccess: false, onFailure: true, summary: null };
49
+ }
50
+ `;
51
+ },
52
+ };
53
+ //# sourceMappingURL=weaver-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weaver-template.js","sourceRoot":"","sources":["../../src/templates/weaver-template.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,8HAA8H;IAC3I,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAClB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CV,CAAC;IACA,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared constants for bot panel components: icon catalog, colors, helpers.
3
+ */
4
+ export declare const ICON_CATALOG: {
5
+ category: string;
6
+ icons: string[];
7
+ }[];
8
+ export declare const BOT_COLORS: {
9
+ label: string;
10
+ token: string;
11
+ }[];
12
+ /** Convert camelCase icon name to searchable words: "cloudSync" -> "cloud sync" */
13
+ export declare function iconToWords(name: string): string;
14
+ //# sourceMappingURL=bot-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot-constants.d.ts","sourceRoot":"","sources":["../../src/ui/bot-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,eAAO,MAAM,YAAY,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,EAuK/D,CAAC;AAEF,eAAO,MAAM,UAAU;;;GAWtB,CAAC;AAEF,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Shared constants for bot panel components: icon catalog, colors, helpers.
3
+ */
4
+ /* ── Categorised icon catalog ──────────────────────────────────────── */
5
+ export const ICON_CATALOG = [
6
+ {
7
+ category: 'Actions',
8
+ icons: [
9
+ 'playArrow',
10
+ 'stop',
11
+ 'pause',
12
+ 'restart',
13
+ 'send',
14
+ 'check',
15
+ 'edit',
16
+ 'copy',
17
+ 'add',
18
+ 'reset',
19
+ 'resume',
20
+ ],
21
+ },
22
+ {
23
+ category: 'AI & Science',
24
+ icons: ['smartToy', 'psychology', 'autoAwesome', 'modelTraining', 'biotech', 'science', 'ai'],
25
+ },
26
+ {
27
+ category: 'Data & Storage',
28
+ icons: ['database', 'dataObject', 'dataArray', 'tableChart', 'token', 'dns', 'cloudStorage'],
29
+ },
30
+ {
31
+ category: 'Logic & Flow',
32
+ icons: [
33
+ 'altRoute',
34
+ 'callSplit',
35
+ 'callMerge',
36
+ 'rule',
37
+ 'filterAlt',
38
+ 'sort',
39
+ 'loop',
40
+ 'repeat',
41
+ 'compareArrows',
42
+ 'swapHoriz',
43
+ 'syncAlt',
44
+ 'changeCircle',
45
+ 'allInclusive',
46
+ ],
47
+ },
48
+ {
49
+ category: 'Cloud & Network',
50
+ icons: [
51
+ 'cloudSync',
52
+ 'cloudUpload',
53
+ 'cloudDownload',
54
+ 'cloudDone',
55
+ 'api',
56
+ 'webhook',
57
+ 'public',
58
+ 'router',
59
+ ],
60
+ },
61
+ {
62
+ category: 'Communication',
63
+ icons: ['email', 'chat', 'forum', 'notifications', 'campaign', 'rssFeed', 'sms'],
64
+ },
65
+ {
66
+ category: 'Security',
67
+ icons: [
68
+ 'key',
69
+ 'shield',
70
+ 'security',
71
+ 'vpnKey',
72
+ 'adminPanel',
73
+ 'policy',
74
+ 'verified',
75
+ 'lockClosed',
76
+ 'lockOpened',
77
+ ],
78
+ },
79
+ {
80
+ category: 'Time',
81
+ icons: [
82
+ 'timer',
83
+ 'alarm',
84
+ 'hourglassEmpty',
85
+ 'pendingActions',
86
+ 'update',
87
+ 'watchLater',
88
+ 'scheduled',
89
+ ],
90
+ },
91
+ {
92
+ category: 'Tasks & Workflow',
93
+ icons: [
94
+ 'task',
95
+ 'taskAlt',
96
+ 'checklist',
97
+ 'assignment',
98
+ 'publish',
99
+ 'build',
100
+ 'construction',
101
+ 'engineering',
102
+ ],
103
+ },
104
+ {
105
+ category: 'Analytics',
106
+ icons: [
107
+ 'analytics',
108
+ 'insights',
109
+ 'barChart',
110
+ 'pieChart',
111
+ 'trendingUp',
112
+ 'showChart',
113
+ 'leaderboard',
114
+ 'monitoring',
115
+ ],
116
+ },
117
+ {
118
+ category: 'Flow Nodes',
119
+ icons: [
120
+ 'schema',
121
+ 'hub',
122
+ 'deviceHub',
123
+ 'source',
124
+ 'trigger',
125
+ 'pulse',
126
+ 'step',
127
+ 'event',
128
+ 'outlinedFlow',
129
+ ],
130
+ },
131
+ {
132
+ category: 'Files & Documents',
133
+ icons: [
134
+ 'file',
135
+ 'filePresent',
136
+ 'fileCopy',
137
+ 'textSnippet',
138
+ 'attachFile',
139
+ 'uploadFile',
140
+ 'save',
141
+ 'upload',
142
+ 'download',
143
+ ],
144
+ },
145
+ {
146
+ category: 'General',
147
+ icons: [
148
+ 'rocketLaunch',
149
+ 'code',
150
+ 'terminal',
151
+ 'logs',
152
+ 'info',
153
+ 'help',
154
+ 'list',
155
+ 'category',
156
+ 'hash',
157
+ 'calendar',
158
+ 'history',
159
+ 'integration',
160
+ 'layers',
161
+ 'link',
162
+ 'search',
163
+ 'outlinedSettings',
164
+ 'outlinedBug',
165
+ 'collaboration',
166
+ 'person',
167
+ 'people',
168
+ 'backup',
169
+ 'healthAndSafety',
170
+ ],
171
+ },
172
+ ];
173
+ export const BOT_COLORS = [
174
+ { label: 'Blue', token: 'color-node-blue-icon' },
175
+ { label: 'Purple', token: 'color-node-purple-icon' },
176
+ { label: 'Cyan', token: 'color-node-cyan-icon' },
177
+ { label: 'Orange', token: 'color-node-orange-icon' },
178
+ { label: 'Pink', token: 'color-node-pink-icon' },
179
+ { label: 'Green', token: 'color-node-green-icon' },
180
+ { label: 'Brand', token: 'color-brand-main' },
181
+ { label: 'Accent', token: 'color-brand-alt' },
182
+ { label: 'Positive', token: 'color-status-positive' },
183
+ { label: 'Info', token: 'color-status-info' },
184
+ ];
185
+ /** Convert camelCase icon name to searchable words: "cloudSync" -> "cloud sync" */
186
+ export function iconToWords(name) {
187
+ return name.replace(/([A-Z])/g, ' $1').toLowerCase();
188
+ }
189
+ //# sourceMappingURL=bot-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot-constants.js","sourceRoot":"","sources":["../../src/ui/bot-constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0EAA0E;AAE1E,MAAM,CAAC,MAAM,YAAY,GAA4C;IACnE;QACE,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE;YACL,WAAW;YACX,MAAM;YACN,OAAO;YAC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ChD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAAE;IAClD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE;IAC7C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE;IAC7C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE;IACrD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE;CAC9C,CAAC;AAEF,mFAAmF;AACnF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC"}
@@ -11,6 +11,7 @@ var {
11
11
  Icon,
12
12
  EmptyState,
13
13
  ScrollArea,
14
+ StatusIcon,
14
15
  usePackWorkspace
15
16
  } = require("@fw/plugin-ui-kit");
16
17
  function parseToolResult(raw) {
@@ -23,18 +24,18 @@ function parseToolResult(raw) {
23
24
  }
24
25
  return raw;
25
26
  }
26
- function statusColor(status) {
27
+ function statusToIconStatus(status) {
27
28
  switch (status) {
28
29
  case "executing":
29
30
  case "running":
30
- return "var(--color-success)";
31
+ return "running";
31
32
  case "paused":
32
- return "var(--color-warning)";
33
+ return "pending";
33
34
  case "stopped":
34
35
  case "stopping":
35
- return "var(--color-danger)";
36
+ return "failed";
36
37
  default:
37
- return "var(--color-text-subtle)";
38
+ return "completed";
38
39
  }
39
40
  }
40
41
  function statusLabel(status) {
@@ -101,10 +102,10 @@ function BotPanel() {
101
102
  type: "custom",
102
103
  title: "Swarm Dashboard",
103
104
  icon: "dashboard",
104
- contentType: "workspace",
105
+ contentType: "bot-workspace",
105
106
  displayState: "docked",
106
107
  dockZone: "center",
107
- definitionId: "workspace",
108
+ definitionId: "bot-workspace",
108
109
  size: { width: 1e3, height: 700 },
109
110
  singleton: true,
110
111
  data: { packId }
@@ -113,7 +114,7 @@ function BotPanel() {
113
114
  const header = React.createElement(
114
115
  Flex,
115
116
  {
116
- variant: "row-center-between-nowrap-8",
117
+ variant: "row-center-space-between-nowrap-8",
117
118
  style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", flexShrink: 0 }
118
119
  },
119
120
  React.createElement(
@@ -122,24 +123,13 @@ function BotPanel() {
122
123
  React.createElement(Icon, { name: "smartToy", size: 16, color: "color-text-medium" }),
123
124
  React.createElement(Typography, { variant: "caption-thick", color: "color-text-high" }, "Swarm")
124
125
  ),
125
- React.createElement(
126
- Flex,
127
- { variant: "row-center-start-nowrap-4" },
128
- React.createElement(IconButton, {
129
- icon: "refresh",
130
- size: "xs",
131
- variant: "clear",
132
- onClick: fetchStatus,
133
- title: "Refresh"
134
- }),
135
- React.createElement(IconButton, {
136
- icon: "dashboard",
137
- size: "xs",
138
- variant: "clear",
139
- onClick: handleOpenDashboard,
140
- title: "Open Dashboard"
141
- })
142
- )
126
+ React.createElement(IconButton, {
127
+ icon: "reset",
128
+ size: "xs",
129
+ variant: "clear",
130
+ onClick: fetchStatus,
131
+ title: "Refresh"
132
+ })
143
133
  );
144
134
  if (loading) {
145
135
  return React.createElement(
@@ -153,7 +143,7 @@ function BotPanel() {
153
143
  Flex,
154
144
  {
155
145
  variant: "column-center-center-nowrap-8",
156
- style: { flex: 1, padding: "24px" }
146
+ style: { flex: 1 }
157
147
  },
158
148
  React.createElement(Typography, { variant: "caption-regular", color: "color-text-subtle" }, "Loading swarm status...")
159
149
  )
@@ -171,33 +161,27 @@ function BotPanel() {
171
161
  Flex,
172
162
  {
173
163
  variant: "column-center-center-nowrap-8",
174
- style: { flex: 1, padding: "24px" }
164
+ style: { flex: 1 }
175
165
  },
176
- React.createElement(Typography, { variant: "caption-regular", color: "color-danger" }, error),
166
+ React.createElement(Typography, { variant: "caption-regular", color: "color-status-negative" }, error),
177
167
  React.createElement(Button, { size: "xs", variant: "outlined", onClick: fetchStatus }, "Retry")
178
168
  )
179
169
  );
180
170
  }
181
171
  const swarmStatus = swarm?.status ?? "idle";
182
- const statusDot = React.createElement("div", {
183
- style: {
184
- width: 8,
185
- height: 8,
186
- borderRadius: "50%",
187
- backgroundColor: statusColor(swarmStatus),
188
- flexShrink: 0
189
- }
190
- });
191
172
  const statusRow = React.createElement(
192
173
  Flex,
193
174
  {
194
- variant: "row-center-between-nowrap-8",
175
+ variant: "row-center-space-between-nowrap-8",
195
176
  style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)" }
196
177
  },
197
178
  React.createElement(
198
179
  Flex,
199
180
  { variant: "row-center-start-nowrap-6" },
200
- statusDot,
181
+ React.createElement(StatusIcon, {
182
+ status: statusToIconStatus(swarmStatus),
183
+ size: "sm"
184
+ }),
201
185
  React.createElement(
202
186
  Typography,
203
187
  { variant: "caption-thick", color: "color-text-high" },
@@ -214,12 +198,8 @@ function BotPanel() {
214
198
  const statsRow = React.createElement(
215
199
  Flex,
216
200
  {
217
- variant: "row-center-between-nowrap-8",
218
- style: {
219
- padding: "8px 12px",
220
- borderBottom: "1px solid var(--color-border-default)",
221
- backgroundColor: "var(--color-surface-low)"
222
- }
201
+ variant: "row-center-space-between-nowrap-8",
202
+ style: { padding: "8px 12px", borderBottom: "1px solid var(--color-border-default)", backgroundColor: "var(--color-surface-low)" }
223
203
  },
224
204
  React.createElement(
225
205
  Flex,
@@ -262,40 +242,25 @@ function BotPanel() {
262
242
  React.createElement(Typography, { variant: "smallCaption-regular", color: "color-text-subtle" }, "Cost")
263
243
  )
264
244
  );
265
- const botEntries = Object.values(swarm?.bots ?? {});
266
- const hasBots = botEntries.length > 0;
267
- const botCards = botEntries.map((bot) => {
268
- const botDot = React.createElement("div", {
269
- style: {
270
- width: 6,
271
- height: 6,
272
- borderRadius: "50%",
273
- backgroundColor: statusColor(bot.status),
274
- flexShrink: 0
275
- }
276
- });
277
- return React.createElement(
245
+ const instanceEntries = Object.values(swarm?.instances ?? {});
246
+ const hasBots = instanceEntries.length > 0;
247
+ const botCards = instanceEntries.map(
248
+ (inst) => React.createElement(
278
249
  Flex,
279
250
  {
280
- key: bot.botId,
251
+ key: inst.instanceId,
281
252
  variant: "row-center-start-nowrap-8",
282
- style: {
283
- padding: "6px 8px",
284
- borderRadius: "var(--border-radius-secondary)",
285
- border: "1px solid var(--color-border-default)"
286
- }
253
+ style: { padding: "8px", borderRadius: "var(--border-radius-regular)", border: "1px solid var(--color-border-default)" }
287
254
  },
288
255
  // Bot icon
289
256
  React.createElement(
290
- "div",
257
+ Flex,
291
258
  {
259
+ variant: "row-center-center-nowrap-0",
292
260
  style: {
293
261
  width: 26,
294
262
  height: 26,
295
263
  borderRadius: "var(--border-radius-compact)",
296
- display: "flex",
297
- alignItems: "center",
298
- justifyContent: "center",
299
264
  flexShrink: 0,
300
265
  background: "var(--color-surface-low)"
301
266
  }
@@ -314,28 +279,24 @@ function BotPanel() {
314
279
  { variant: "row-center-start-nowrap-4" },
315
280
  React.createElement(Typography, {
316
281
  variant: "caption-thick",
317
- color: "color-text-high",
318
- style: { wordBreak: "break-word" }
319
- }, bot.botName),
320
- botDot,
282
+ color: "color-text-high"
283
+ }, `${inst.profileId} #${inst.index}`),
284
+ React.createElement(StatusIcon, {
285
+ status: statusToIconStatus(inst.status),
286
+ size: "sm"
287
+ }),
321
288
  React.createElement(Typography, {
322
289
  variant: "smallCaption-regular",
323
290
  color: "color-text-subtle"
324
- }, statusLabel(bot.status))
291
+ }, statusLabel(inst.status))
325
292
  ),
326
- bot.currentTaskId ? React.createElement(Typography, {
293
+ inst.currentTaskId ? React.createElement(Typography, {
327
294
  variant: "smallCaption-regular",
328
295
  color: "color-text-medium",
329
- style: {
330
- wordBreak: "break-word",
331
- overflow: "hidden",
332
- textOverflow: "ellipsis",
333
- whiteSpace: "nowrap",
334
- maxWidth: "100%"
335
- }
336
- }, `Task: ${bot.currentTaskId}`) : null
296
+ truncate: true
297
+ }, `Task: ${inst.currentTaskId}`) : null
337
298
  ),
338
- // Per-bot stats
299
+ // Per-instance stats
339
300
  React.createElement(
340
301
  Flex,
341
302
  {
@@ -345,28 +306,28 @@ function BotPanel() {
345
306
  React.createElement(
346
307
  Typography,
347
308
  { variant: "smallCaption-regular", color: "color-text-subtle" },
348
- formatTokens(bot.tokensUsed)
309
+ formatTokens(inst.tokensUsed)
349
310
  ),
350
311
  React.createElement(
351
312
  Typography,
352
313
  { variant: "smallCaption-regular", color: "color-text-subtle" },
353
- formatCost(bot.cost)
314
+ formatCost(inst.cost)
354
315
  )
355
316
  )
356
- );
357
- });
317
+ )
318
+ );
358
319
  const content = hasBots ? React.createElement(
359
320
  ScrollArea,
360
321
  { style: { flex: 1 } },
361
322
  React.createElement(Flex, {
362
- variant: "column-stretch-start-nowrap-4",
323
+ variant: "column-stretch-start-nowrap-6",
363
324
  style: { padding: "8px 12px" }
364
325
  }, ...botCards)
365
326
  ) : React.createElement(
366
327
  Flex,
367
328
  {
368
329
  variant: "column-center-center-nowrap-0",
369
- style: { flex: 1, padding: "24px" }
330
+ style: { flex: 1 }
370
331
  },
371
332
  React.createElement(EmptyState, {
372
333
  icon: "smartToy",