@synergenius/flow-weaver-pack-weaver 0.9.80 → 0.9.82

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.
@@ -913,8 +913,9 @@
913
913
  "usage": "<task>"
914
914
  },
915
915
  {
916
- "name": "session",
917
- "description": "Start interactive bot session"
916
+ "name": "swarm",
917
+ "description": "Manage the swarm: start, stop, pause, status, config",
918
+ "usage": "weaver swarm <start|stop|pause|status|config> [options]"
918
919
  },
919
920
  {
920
921
  "name": "steer",
@@ -922,9 +923,19 @@
922
923
  "usage": "<pause|resume|cancel|redirect|queue> [payload]"
923
924
  },
924
925
  {
925
- "name": "queue",
926
- "description": "Manage bot task queue",
927
- "usage": "<add|list|clear|remove> [task|id]"
926
+ "name": "task",
927
+ "description": "Manage tasks: create, list, get, clear, cancel, retry",
928
+ "usage": "weaver task <create|list|get|clear|cancel|retry> [options]"
929
+ },
930
+ {
931
+ "name": "profile",
932
+ "description": "Manage profiles: list, create, delete",
933
+ "usage": "weaver profile <list|create|delete> [options]"
934
+ },
935
+ {
936
+ "name": "reset",
937
+ "description": "Full reset: stop swarm, clear all data, recreate defaults",
938
+ "usage": "weaver reset --confirm"
928
939
  },
929
940
  {
930
941
  "name": "genesis",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver-pack-weaver",
3
- "version": "0.9.80",
3
+ "version": "0.9.82",
4
4
  "description": "AI bot for Flow Weaver. Execute tasks, run workflows, evolve autonomously.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -616,7 +616,45 @@ const toolHandlers: Record<
616
616
  // Clear the singleton so next getInstance() starts fresh
617
617
  SwarmController.clearInstances();
618
618
 
619
- return JSON.stringify({ reset: true, tasksCleared, profilesCleared });
619
+ // 7. Re-register default bots from manifest
620
+ let botsRegistered = 0;
621
+ try {
622
+ const manifestPath = path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'flowweaver.manifest.json');
623
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
624
+ if (Array.isArray(manifest.botRegistrations)) {
625
+ const registry = new BotRegistry(ctx.workspacePath);
626
+ for (const reg of manifest.botRegistrations) {
627
+ const id = reg.id as string;
628
+ if (!id) continue;
629
+ const slug = (reg.sourceTemplateId || id) as string;
630
+ registry.register({
631
+ id,
632
+ name: reg.name ?? id,
633
+ description: reg.description ?? '',
634
+ icon: reg.icon,
635
+ color: reg.color,
636
+ filePath: path.join('node_modules', '@synergenius', 'flow-weaver-pack-weaver', 'src', 'workflows', `${slug}.ts`),
637
+ workflowExport: reg.workflowExport ?? id,
638
+ paramName: reg.paramName ?? 'taskJson',
639
+ sourceTemplateId: reg.sourceTemplateId,
640
+ packId: manifest.name,
641
+ });
642
+ botsRegistered++;
643
+ }
644
+ }
645
+ } catch { /* non-fatal — bots can be re-registered manually */ }
646
+
647
+ // 8. Re-create default profiles from registered bots
648
+ let profilesCreated = 0;
649
+ try {
650
+ const freshProfileStore = new ProfileStore(ctx.workspacePath);
651
+ const freshRegistry = new BotRegistry(ctx.workspacePath);
652
+ const bots = freshRegistry.list();
653
+ freshProfileStore.ensureDefaultProfiles(bots);
654
+ profilesCreated = freshProfileStore.list().length;
655
+ } catch { /* non-fatal */ }
656
+
657
+ return JSON.stringify({ reset: true, tasksCleared, profilesCleared, botsRegistered, profilesCreated });
620
658
  },
621
659
  };
622
660
 
package/src/cli-bridge.ts CHANGED
@@ -2,7 +2,8 @@ import type { ParsedArgs } from './cli-handlers.js';
2
2
  import {
3
3
  handleRun, handleHistory, handleCosts, handleWatch,
4
4
  handleCron, handlePipeline, handleDashboard, handleProviders,
5
- handleEject, handleBot, handleSession, handleSteer, handleQueue,
5
+ handleEject, handleBot, handleSwarm, handleSteer, handleTask,
6
+ handleProfile, handleReset,
6
7
  handleStatus, handleGenesis, handleAudit, handleInit, handleAssistant,
7
8
  handleExamples, handleDoctor, handleImprove,
8
9
  printHelp,
@@ -19,9 +20,11 @@ const handlers: Record<string, (opts: ParsedArgs) => Promise<void>> = {
19
20
  providers: handleProviders,
20
21
  eject: handleEject,
21
22
  bot: handleBot,
22
- session: handleSession,
23
+ swarm: handleSwarm,
23
24
  steer: handleSteer,
24
- queue: handleQueue,
25
+ task: handleTask,
26
+ profile: handleProfile,
27
+ reset: handleReset,
25
28
  status: handleStatus,
26
29
  genesis: handleGenesis,
27
30
  audit: handleAudit,