@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.
- package/dist/ai-chat-provider.d.ts +12 -0
- package/dist/ai-chat-provider.d.ts.map +1 -1
- package/dist/ai-chat-provider.js +351 -335
- package/dist/ai-chat-provider.js.map +1 -1
- package/dist/bot/agent-loop.d.ts +20 -0
- package/dist/bot/agent-loop.d.ts.map +1 -0
- package/dist/bot/agent-loop.js +331 -0
- package/dist/bot/agent-loop.js.map +1 -0
- package/dist/bot/ai-router.d.ts +19 -0
- package/dist/bot/ai-router.d.ts.map +1 -0
- package/dist/bot/ai-router.js +104 -0
- package/dist/bot/ai-router.js.map +1 -0
- package/dist/bot/assistant-tools.d.ts.map +1 -1
- package/dist/bot/assistant-tools.js +49 -33
- package/dist/bot/assistant-tools.js.map +1 -1
- package/dist/bot/async-mutex.d.ts +13 -0
- package/dist/bot/async-mutex.d.ts.map +1 -0
- package/dist/bot/async-mutex.js +37 -0
- package/dist/bot/async-mutex.js.map +1 -0
- package/dist/bot/bot-manager.d.ts +2 -2
- package/dist/bot/bot-manager.d.ts.map +1 -1
- package/dist/bot/bot-manager.js +3 -3
- package/dist/bot/bot-manager.js.map +1 -1
- package/dist/bot/bot-registry.js +2 -2
- package/dist/bot/bot-registry.js.map +1 -1
- package/dist/bot/conversation-store.d.ts +1 -0
- package/dist/bot/conversation-store.d.ts.map +1 -1
- package/dist/bot/conversation-store.js.map +1 -1
- package/dist/bot/dashboard.d.ts.map +1 -1
- package/dist/bot/dashboard.js +17 -8
- package/dist/bot/dashboard.js.map +1 -1
- package/dist/bot/improve-loop.js.map +1 -1
- package/dist/bot/index.d.ts +2 -4
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js +1 -2
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/instance-manager.d.ts +31 -0
- package/dist/bot/instance-manager.d.ts.map +1 -0
- package/dist/bot/instance-manager.js +115 -0
- package/dist/bot/instance-manager.js.map +1 -0
- package/dist/bot/orchestrator.d.ts +36 -0
- package/dist/bot/orchestrator.d.ts.map +1 -0
- package/dist/bot/orchestrator.js +176 -0
- package/dist/bot/orchestrator.js.map +1 -0
- package/dist/bot/profile-store.d.ts +36 -0
- package/dist/bot/profile-store.d.ts.map +1 -0
- package/dist/bot/profile-store.js +208 -0
- package/dist/bot/profile-store.js.map +1 -0
- package/dist/bot/profile-types.d.ts +126 -0
- package/dist/bot/profile-types.d.ts.map +1 -0
- package/dist/bot/profile-types.js +7 -0
- package/dist/bot/profile-types.js.map +1 -0
- package/dist/bot/run-store.d.ts.map +1 -1
- package/dist/bot/run-store.js +8 -0
- package/dist/bot/run-store.js.map +1 -1
- package/dist/bot/runner.d.ts +4 -0
- package/dist/bot/runner.d.ts.map +1 -1
- package/dist/bot/runner.js +5 -1
- package/dist/bot/runner.js.map +1 -1
- package/dist/bot/swarm-controller.d.ts +109 -0
- package/dist/bot/swarm-controller.d.ts.map +1 -0
- package/dist/bot/swarm-controller.js +640 -0
- package/dist/bot/swarm-controller.js.map +1 -0
- package/dist/bot/swarm-event-log.d.ts +28 -0
- package/dist/bot/swarm-event-log.d.ts.map +1 -0
- package/dist/bot/swarm-event-log.js +54 -0
- package/dist/bot/swarm-event-log.js.map +1 -0
- package/dist/bot/task-prompt-builder.d.ts +22 -0
- package/dist/bot/task-prompt-builder.d.ts.map +1 -0
- package/dist/bot/task-prompt-builder.js +240 -0
- package/dist/bot/task-prompt-builder.js.map +1 -0
- package/dist/bot/task-store.d.ts +21 -0
- package/dist/bot/task-store.d.ts.map +1 -0
- package/dist/bot/task-store.js +364 -0
- package/dist/bot/task-store.js.map +1 -0
- package/dist/bot/task-types.d.ts +79 -0
- package/dist/bot/task-types.d.ts.map +1 -0
- package/dist/bot/task-types.js +6 -0
- package/dist/bot/task-types.js.map +1 -0
- package/dist/bot/types.d.ts +8 -0
- package/dist/bot/types.d.ts.map +1 -1
- package/dist/cli-handlers.d.ts.map +1 -1
- package/dist/cli-handlers.js +79 -54
- package/dist/cli-handlers.js.map +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +749 -0
- package/dist/cli.js.map +1 -0
- package/dist/docs/docs/weaver-bot-usage.md +35 -18
- package/dist/docs/docs/weaver-config.md +20 -0
- package/dist/docs/docs/weaver-task-queue.md +31 -19
- package/dist/docs/weaver-config.md +15 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-tools.d.ts +17 -0
- package/dist/mcp-tools.d.ts.map +1 -1
- package/dist/mcp-tools.js +98 -279
- package/dist/mcp-tools.js.map +1 -1
- package/dist/node-types/bot-report.d.ts.map +1 -1
- package/dist/node-types/bot-report.js +6 -24
- package/dist/node-types/bot-report.js.map +1 -1
- package/dist/node-types/orchestrator-dispatch.d.ts +17 -0
- package/dist/node-types/orchestrator-dispatch.d.ts.map +1 -0
- package/dist/node-types/orchestrator-dispatch.js +63 -0
- package/dist/node-types/orchestrator-dispatch.js.map +1 -0
- package/dist/node-types/orchestrator-load-state.d.ts +16 -0
- package/dist/node-types/orchestrator-load-state.d.ts.map +1 -0
- package/dist/node-types/orchestrator-load-state.js +60 -0
- package/dist/node-types/orchestrator-load-state.js.map +1 -0
- package/dist/node-types/orchestrator-route.d.ts +16 -0
- package/dist/node-types/orchestrator-route.d.ts.map +1 -0
- package/dist/node-types/orchestrator-route.js +28 -0
- package/dist/node-types/orchestrator-route.js.map +1 -0
- package/dist/node-types/receive-task.d.ts +2 -3
- package/dist/node-types/receive-task.d.ts.map +1 -1
- package/dist/node-types/receive-task.js +3 -48
- package/dist/node-types/receive-task.js.map +1 -1
- package/dist/templates/weaver-template.d.ts +11 -0
- package/dist/templates/weaver-template.d.ts.map +1 -0
- package/dist/templates/weaver-template.js +53 -0
- package/dist/templates/weaver-template.js.map +1 -0
- package/dist/ui/bot-activity.js +2 -2
- package/dist/ui/bot-constants.d.ts +14 -0
- package/dist/ui/bot-constants.d.ts.map +1 -0
- package/dist/ui/bot-constants.js +189 -0
- package/dist/ui/bot-constants.js.map +1 -0
- package/dist/ui/bot-panel.js +207 -245
- package/dist/ui/bot-slot-card.js +141 -0
- package/dist/ui/budget-bar.js +59 -0
- package/dist/ui/chat-task-result.js +178 -0
- package/dist/ui/decision-log.js +136 -0
- package/dist/ui/profile-card.js +158 -0
- package/dist/ui/profile-editor.js +597 -0
- package/dist/ui/swarm-controls.js +245 -0
- package/dist/ui/swarm-dashboard.js +3012 -0
- package/dist/ui/task-create-form.js +98 -0
- package/dist/ui/task-detail-view.js +1044 -0
- package/dist/ui/task-pool-list.js +156 -0
- package/dist/workflows/orchestrator.d.ts +21 -0
- package/dist/workflows/orchestrator.d.ts.map +1 -0
- package/dist/workflows/orchestrator.js +281 -0
- package/dist/workflows/orchestrator.js.map +1 -0
- package/dist/workflows/weaver-bot-session.d.ts +65 -0
- package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
- package/dist/workflows/weaver-bot-session.js +68 -0
- package/dist/workflows/weaver-bot-session.js.map +1 -0
- package/dist/workflows/weaver.d.ts +24 -0
- package/dist/workflows/weaver.d.ts.map +1 -0
- package/dist/workflows/weaver.js +28 -0
- package/dist/workflows/weaver.js.map +1 -0
- package/flowweaver.manifest.json +547 -133
- package/package.json +1 -1
- package/src/ai-chat-provider.ts +378 -371
- package/src/bot/ai-router.ts +132 -0
- package/src/bot/assistant-tools.ts +47 -29
- package/src/bot/async-mutex.ts +37 -0
- package/src/bot/bot-manager.ts +3 -3
- package/src/bot/bot-registry.ts +2 -2
- package/src/bot/conversation-store.ts +2 -1
- package/src/bot/dashboard.ts +17 -8
- package/src/bot/improve-loop.ts +6 -6
- package/src/bot/index.ts +2 -4
- package/src/bot/instance-manager.ts +128 -0
- package/src/bot/orchestrator.ts +244 -0
- package/src/bot/profile-store.ts +225 -0
- package/src/bot/profile-types.ts +141 -0
- package/src/bot/run-store.ts +8 -0
- package/src/bot/runner.ts +9 -1
- package/src/bot/swarm-controller.ts +780 -0
- package/src/bot/swarm-event-log.ts +57 -0
- package/src/bot/task-prompt-builder.ts +309 -0
- package/src/bot/task-store.ts +407 -0
- package/src/bot/task-types.ts +100 -0
- package/src/bot/types.ts +8 -0
- package/src/cli-handlers.ts +78 -53
- package/src/docs/weaver-bot-usage.md +35 -18
- package/src/docs/weaver-config.md +20 -0
- package/src/docs/weaver-task-queue.md +31 -19
- package/src/index.ts +5 -4
- package/src/mcp-tools.ts +129 -372
- package/src/node-types/bot-report.ts +6 -24
- package/src/node-types/orchestrator-dispatch.ts +71 -0
- package/src/node-types/orchestrator-load-state.ts +66 -0
- package/src/node-types/orchestrator-route.ts +33 -0
- package/src/node-types/receive-task.ts +3 -57
- package/src/ui/bot-activity.tsx +2 -2
- package/src/ui/bot-constants.ts +192 -0
- package/src/ui/bot-panel.tsx +213 -247
- package/src/ui/bot-slot-card.tsx +139 -0
- package/src/ui/budget-bar.tsx +30 -0
- package/src/ui/chat-task-result.tsx +236 -0
- package/src/ui/decision-log.tsx +148 -0
- package/src/ui/profile-card.tsx +157 -0
- package/src/ui/profile-editor.tsx +384 -0
- package/src/ui/swarm-controls.tsx +260 -0
- package/src/ui/swarm-dashboard.tsx +647 -0
- package/src/ui/task-create-form.tsx +87 -0
- package/src/ui/task-detail-view.tsx +841 -0
- package/src/ui/task-pool-list.tsx +187 -0
- package/src/workflows/orchestrator.ts +302 -0
- package/dist/docs/weaver-bot-usage.md +0 -34
- package/dist/docs/weaver-genesis.md +0 -32
- package/dist/docs/weaver-task-queue.md +0 -34
- package/dist/ui/bot-workspace.js +0 -1015
- package/dist/ui/chat-bot-result.js +0 -71
- package/dist/ui/queue-input.js +0 -82
- package/dist/ui/session-bar.js +0 -174
- package/src/bot/error-guide.ts +0 -4
- package/src/bot/retry-utils.ts +0 -4
- package/src/bot/session-state.ts +0 -116
- package/src/bot/task-queue.ts +0 -262
- package/src/ui/bot-workspace.tsx +0 -442
- package/src/ui/chat-bot-result.tsx +0 -81
- package/src/ui/queue-input.tsx +0 -56
- 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
|
|
20
|
-
*
|
|
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 { /*
|
|
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
|
}
|
package/src/ui/bot-activity.tsx
CHANGED
|
@@ -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('
|
|
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('
|
|
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
|
+
}
|