@synergenius/flow-weaver-pack-weaver 0.9.185 → 0.9.187

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 (51) hide show
  1. package/dist/bot/agent-loop.d.ts +20 -0
  2. package/dist/bot/agent-loop.d.ts.map +1 -0
  3. package/dist/bot/agent-loop.js +331 -0
  4. package/dist/bot/agent-loop.js.map +1 -0
  5. package/dist/bot/capability-registry.d.ts.map +1 -1
  6. package/dist/bot/capability-registry.js +15 -0
  7. package/dist/bot/capability-registry.js.map +1 -1
  8. package/dist/bot/error-guide.d.ts +5 -0
  9. package/dist/bot/error-guide.d.ts.map +1 -0
  10. package/dist/bot/error-guide.js +5 -0
  11. package/dist/bot/error-guide.js.map +1 -0
  12. package/dist/bot/retry-utils.d.ts +5 -0
  13. package/dist/bot/retry-utils.d.ts.map +1 -0
  14. package/dist/bot/retry-utils.js +5 -0
  15. package/dist/bot/retry-utils.js.map +1 -0
  16. package/dist/bot/session-state.d.ts +25 -0
  17. package/dist/bot/session-state.d.ts.map +1 -0
  18. package/dist/bot/session-state.js +110 -0
  19. package/dist/bot/session-state.js.map +1 -0
  20. package/dist/bot/task-queue.d.ts +46 -0
  21. package/dist/bot/task-queue.d.ts.map +1 -0
  22. package/dist/bot/task-queue.js +237 -0
  23. package/dist/bot/task-queue.js.map +1 -0
  24. package/dist/cli.d.ts +3 -0
  25. package/dist/cli.d.ts.map +1 -0
  26. package/dist/cli.js +749 -0
  27. package/dist/cli.js.map +1 -0
  28. package/dist/docs/weaver-config.md +14 -28
  29. package/dist/node-types/receive-task.js.bak +38 -0
  30. package/dist/templates/weaver-template.d.ts +11 -0
  31. package/dist/templates/weaver-template.d.ts.map +1 -0
  32. package/dist/templates/weaver-template.js +53 -0
  33. package/dist/templates/weaver-template.js.map +1 -0
  34. package/dist/ui/capability-editor.js +15 -0
  35. package/dist/ui/profile-editor.js +15 -0
  36. package/dist/ui/swarm-dashboard.js +15 -0
  37. package/dist/ui/task-create-form.js +98 -0
  38. package/dist/workflows/weaver-bot-session.d.ts +65 -0
  39. package/dist/workflows/weaver-bot-session.d.ts.map +1 -0
  40. package/dist/workflows/weaver-bot-session.js +68 -0
  41. package/dist/workflows/weaver-bot-session.js.map +1 -0
  42. package/dist/workflows/weaver.d.ts +24 -0
  43. package/dist/workflows/weaver.d.ts.map +1 -0
  44. package/dist/workflows/weaver.js +28 -0
  45. package/dist/workflows/weaver.js.map +1 -0
  46. package/flowweaver.manifest.json +1 -1
  47. package/package.json +1 -1
  48. package/src/bot/capability-registry.ts +15 -0
  49. package/dist/docs/weaver-bot-usage.md +0 -51
  50. package/dist/docs/weaver-genesis.md +0 -32
  51. package/dist/docs/weaver-task-queue.md +0 -46
@@ -48,6 +48,21 @@ Your only output is task_create calls + done.
48
48
  6. Maximize parallelism: tasks with no shared files should not depend on each other.
49
49
  7. Your LAST subtask: "Review & Steer" assigned to orchestrator, dependsOn all others.
50
50
 
51
+ ### Design First
52
+ For multi-file projects, your FIRST subtask should create a .design.md with:
53
+ - Module map: which files, what each exports (function signatures with types)
54
+ - Conventions: naming, error handling, patterns (e.g., factory functions for servers)
55
+ All subsequent developer tasks must read .design.md before writing code.
56
+
57
+ ### Acceptance Criteria
58
+ Every subtask MUST have acceptance.checks — shell commands that verify "done" (exit 0 = pass).
59
+ The system runs them automatically after each run. If any fail, the task stays open.
60
+ Examples:
61
+ - File exists: test -f url-shortener/src/store.ts
62
+ - Compiles: cd url-shortener && npx tsc --noEmit
63
+ - Tests pass: cd url-shortener && npx vitest run
64
+ - Export exists: grep -q "export.*startServer" url-shortener/src/server.ts
65
+
51
66
  ### Steering Mode (when running a Review & Steer task)
52
67
  Read sibling task statuses and acceptance results from your context, then decide:
53
68
  - All checks pass → done.
@@ -1,51 +0,0 @@
1
- ## Weaver Bot (Swarm)
2
-
3
- The Weaver bot is an autonomous AI agent that creates and modifies Flow Weaver workflows. Tasks are executed via the swarm orchestrator, which routes work to the best available bot profile.
4
-
5
- ### Running tasks
6
-
7
- Use `fw_weaver_task_create` to submit work:
8
- - `title`: Short task title (required)
9
- - `description`: Detailed instructions
10
- - `assignedProfile`: Target a specific bot profile
11
- - `complexity`: trivial, simple, moderate, complex
12
- - `subtasks`: Inline subtask definitions with dependency chaining
13
-
14
- Then start the swarm with `fw_weaver_swarm_start` to begin execution.
15
-
16
- ### Execution flow
17
-
18
- 1. **Create task** — `fw_weaver_task_create` adds task to the pool
19
- 2. **Orchestrator routes** — matches task to best bot profile via fast-path cascade (exact-match, capability-match, single-eligible, ai-routed, round-robin)
20
- 3. **Build context** — gathers project state, templates, and relevant files
21
- 4. **Plan** — AI generates a step-by-step execution plan
22
- 5. **Execute + validate + retry** — runs steps, validates output, retries on errors (up to maxAttempts)
23
- 6. **Git ops** — commits changes if successful
24
- 7. **Report** — task marked done/failed with run summary
25
-
26
- ### Steering a running bot
27
-
28
- Use `fw_weaver_steer` with a `botId` to control execution:
29
- - `pause` — pause at next safe point
30
- - `resume` — continue after pause
31
- - `cancel` — abort execution
32
-
33
- ### Checking status
34
-
35
- - `fw_weaver_status` — quick swarm summary (active bots, tasks completed, budget)
36
- - `fw_weaver_swarm_status` — full swarm state with per-instance details
37
- - `fw_weaver_swarm_events` — live event stream
38
- - `fw_weaver_orchestrator_status` — routing decisions, stats, active instances
39
-
40
- ### Profiles
41
-
42
- Use `fw_weaver_profile_create` to create specialized bot profiles. Each profile defines:
43
-
44
- - **capabilities** — free-form list of `{ name, description }` objects describing what the profile can do. Names are arbitrary strings (e.g. `code-generation`, `testing`, `deployment`). The orchestrator uses the description text to match tasks to profiles.
45
- - **preferences** — intent-based settings that control profile behavior:
46
- - `costStrategy` — `"economy"` (minimize cost), `"balanced"` (default), or `"quality"` (maximize quality regardless of cost)
47
- - `requireApproval` — whether tasks routed to this profile need human approval before execution
48
- - `instructions` — optional free-text instructions appended to the bot's system prompt
49
- - **scaling** — `minInstances` and `maxInstances` control how many concurrent bots can run this profile
50
-
51
- The orchestrator routes tasks to profiles based on `assignedProfile` or by matching task intent against profile capabilities.
@@ -1,32 +0,0 @@
1
- ## Genesis Self-Evolution
2
-
3
- Genesis is Weaver's self-evolution protocol. It autonomously observes, proposes, applies, and validates changes to workflows.
4
-
5
- ### Running a Genesis cycle
6
-
7
- Use `fw_weaver_genesis` to trigger a single cycle:
8
- - `projectDir`: Project directory (defaults to workspace)
9
- - `dryRun`: Preview changes without applying
10
-
11
- ### How it works
12
-
13
- 1. **Observe** — scans project for workflows and their health
14
- 2. **Fingerprint** — detects if workflows changed since last cycle (avoids duplicate proposals)
15
- 3. **Stabilize check** — prevents rapid churn (cooldown between cycles)
16
- 4. **Propose** — AI analyzes project state and proposes modifications within a budget
17
- 5. **Validate proposal** — checks proposed changes are safe
18
- 6. **Snapshot** — creates backup before applying
19
- 7. **Apply** — executes proposed operations via `flow-weaver modify`
20
- 8. **Validate result** — compiles and validates the modified workflow
21
- 9. **Threshold check** — decides if changes meet the quality bar
22
- 10. **Approve** — human approval gate (configurable)
23
- 11. **Commit** — git commit with rollback capability
24
- 12. **Escrow** — data safety pipeline for recovery
25
-
26
- ### Safety features
27
-
28
- - Pre-apply snapshots for rollback
29
- - Escrow recovery from previous cycles
30
- - Fingerprinting prevents duplicate proposals
31
- - Threshold checking before committing
32
- - Budget limits on proposed changes
@@ -1,46 +0,0 @@
1
- ## Task Management & Steering
2
-
3
- Weaver uses a swarm-based task system for background processing and real-time bot control.
4
-
5
- ### Creating tasks
6
-
7
- Use `fw_weaver_task_create` to create tasks:
8
- - `title` — short task title (required)
9
- - `description` — detailed instructions
10
- - `priority` — higher number = picked first (default 0)
11
- - `assignedProfile` — route to a specific bot profile
12
- - `complexity` — trivial, simple, moderate, complex
13
- - `subtasks` — inline subtask definitions with `^prev` dependency shorthand
14
- - `budgetTokens` / `budgetCost` — per-task budget limits
15
-
16
- ### Listing and managing tasks
17
-
18
- - `fw_weaver_task_list` — list tasks (filter by status, parentId, botId)
19
- - `fw_weaver_task_get` — get task details including subtasks
20
- - `fw_weaver_task_update` — update task fields
21
- - `fw_weaver_task_cancel` — cancel a pending or running task
22
- - `fw_weaver_task_retry` — reset a failed task back to pending
23
-
24
- ### Steering commands
25
-
26
- Use `fw_weaver_steer` to control a running bot instance:
27
- - `pause` — pause execution at the next safe point
28
- - `resume` — continue after a pause
29
- - `cancel` — abort the current task
30
-
31
- ### Swarm control
32
-
33
- - `fw_weaver_swarm_start` — start the swarm (spawns bot loops that claim and execute tasks)
34
- - `fw_weaver_swarm_pause` — pause all bot loops
35
- - `fw_weaver_swarm_stop` — stop the swarm gracefully
36
- - `fw_weaver_swarm_status` — full swarm state with per-bot details
37
- - `fw_weaver_swarm_config` — configure max concurrency, budgets, auto-retry
38
- - `fw_weaver_swarm_events` — stream swarm-level events for live updates
39
-
40
- ### Monitoring
41
-
42
- Use `fw_weaver_status` to check the current swarm state:
43
- - Swarm phase (idle, running, paused, stopping)
44
- - Active/total bot instances
45
- - Tasks completed/failed
46
- - Budget usage