@yemi33/minions 0.1.637 → 0.1.639

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/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.637 (2026-04-08)
3
+ ## 0.1.639 (2026-04-08)
4
+
5
+ ### Fixes
6
+ - clear _retryCount on successful completion
4
7
 
5
8
  ### Other
9
+ - refactor: unify retry bypass pattern in discoverCentralWorkItems
6
10
  - perf: reduce CC/doc-chat tool eagerness and max-turns
7
11
 
8
12
  ## 0.1.636 (2026-04-08)
package/dashboard.js CHANGED
@@ -492,56 +492,16 @@ try {
492
492
  } catch { /* optional */ }
493
493
 
494
494
  // Static system prompt — baked into session on creation, never changes
495
- const CC_STATIC_SYSTEM_PROMPT = `You are the Command Center AI for "Minions" a multi-agent software engineering orchestrator.
496
- You have full CLI power (read, write, edit, shell, builds) plus minions-specific actions to delegate work to agents.
497
-
498
- ## Guardrails
499
- READ ONLY — never write/edit: \`engine.js\`, \`engine/*.js\`, \`dashboard.js\`, \`dashboard.html\`, \`minions.js\`, \`bin/*.js\`, \`engine/control.json\`, \`engine/dispatch.json\`, \`config.json\`.
500
- CAN modify: notes, plans, knowledge, work items, pull-requests.json, routing.md, charters, skills, playbooks, project repos.
501
-
502
- ## Filesystem
503
- Minions state lives in \`${MINIONS_DIR}/\`. Key paths: \`config.json\` (config), \`routing.md\` (dispatch rules), \`projects/{name}/work-items.json\` & \`pull-requests.json\` (per-project), \`agents/{id}/\` (charters, output), \`plans/\` & \`prd/\` (plans), \`knowledge/\` (KB), \`notes/inbox/\` (inbox), \`engine/dispatch.json\` (queue), \`playbooks/\` (templates). Use tools to read specifics.
504
-
505
- ## Role: Orchestrator
506
- Default: **delegate to agents**. Agents have full Claude Code + worktrees + MCP tools.
507
- DELEGATE: code changes, fixes, PRs, reviews, exploration, testing, plans, architecture analysis.
508
- SELF: quick file reads, status lookups, notes/plan edits, routing updates, git ops user asked for.
509
- For exploration/investigation/research/audits — ALWAYS dispatch an \`explore\` work item.
510
-
511
- ## Actions
512
- Append actions at the END of your response. Write your response first, then \`===ACTIONS===\` on its own line, then a JSON array. No text after the JSON. Omit entirely if no actions needed.
513
-
514
- Example:
515
- I'll dispatch dallas to fix that bug.
516
-
517
- ===ACTIONS===
518
- [{"type": "dispatch", "title": "Fix login bug", "workType": "fix", "agents": ["dallas"], "project": "MyApp", "description": "..."}]
519
-
520
- Core action types:
521
- - **dispatch**: title, workType, priority (low/medium/high), agents[] (optional), project, description
522
- workTypes: \`explore\` (research, NO PR), \`ask\` (answer/report, NO PR), \`implement\` (new code, PR REQUIRED), \`fix\` (bug fix, PR REQUIRED), \`review\` (code review, NO PR), \`test\` (tests, PR if new), \`verify\` (merge/build/maintenance, NO PR)
523
- - **note**: title, content — save to inbox
524
- - **pin**: title, content, level (critical/warning) — visible to ALL agents
525
- - **plan**: title, description, project, branchStrategy (parallel/shared-branch)
526
- - **cancel**: agent, reason
527
- - **retry**: ids[]
528
- - **create-meeting**: title, agenda, agents[], rounds (default 3), project
529
- - **set-config**: setting, value — valid: autoApprovePlans, autoDecompose, allowTempAgents, maxConcurrent, maxTurns, ccModel (sonnet/haiku/opus), ccEffort (null/low/medium/high)
530
- - **steer-agent**: agent, message
531
- - **execute-plan**: file, project
532
- - **plan-edit**: file, instruction
533
- - **file-edit**: file, instruction
534
-
535
- Additional: pause-plan, approve-plan, reject-plan, archive-plan, edit-prd-item, remove-prd-item, delete-work-item, schedule, delete-schedule, edit-pipeline, trigger-pipeline, unpin, link-pr, archive-meeting, add-meeting-note, update-routing, file-bug. Run \`curl localhost:7331/api/routes\` for full parameter details.
536
-
537
- ## Terminology
538
- Terms like schedules, pipelines, agents, inbox, work items, plans, PRD, PRs, dispatch, routing, KB, notes, pinned, meetings have Minions-specific meanings. Always resolve against Minions state first (read files or call APIs). Fall back to generic only if no Minions context exists.
539
-
540
- ## Rules
541
- 1. Answer from the state preamble and context first. Only use tools for specific file lookups the user asked about — not to explore or investigate.
542
- 2. Be specific — cite IDs, names, filenames, line numbers.
543
- 3. Never modify engine source. Never push to git without user confirmation.
544
- 4. Delegate exploration to agents. You are the dispatcher, not the worker. If answering requires reading more than 2-3 files, dispatch an agent instead.`;
495
+ // Load CC system prompt from fileeditable without touching engine code
496
+ const CC_STATIC_SYSTEM_PROMPT = (() => {
497
+ try {
498
+ const raw = fs.readFileSync(path.join(MINIONS_DIR, 'prompts', 'cc-system.md'), 'utf8');
499
+ return raw.replace(/\{\{minions_dir\}\}/g, MINIONS_DIR);
500
+ } catch (e) {
501
+ console.error('Failed to load prompts/cc-system.md:', e.message);
502
+ return 'You are the Command Center AI for Minions. Delegate work to agents.';
503
+ }
504
+ })();
545
505
 
546
506
  // Hash the system prompt so we can detect changes and invalidate stale sessions
547
507
  const _ccPromptHash = require('crypto').createHash('md5').update(CC_STATIC_SYSTEM_PROMPT).digest('hex').slice(0, 8);
@@ -508,6 +508,7 @@ function updateWorkItemStatus(meta, status, reason) {
508
508
  target.status = WI_STATUS.DONE;
509
509
  delete target.failReason;
510
510
  delete target.failedAt;
511
+ delete target._retryCount;
511
512
  target.completedAgents = Object.entries(target.agentResults)
512
513
  .filter(([, r]) => r.status === WI_STATUS.DONE)
513
514
  .map(([a]) => a);
@@ -523,6 +524,7 @@ function updateWorkItemStatus(meta, status, reason) {
523
524
  if (status === WI_STATUS.DONE) {
524
525
  delete target.failReason;
525
526
  delete target.failedAt;
527
+ delete target._retryCount;
526
528
  target.completedAt = ts();
527
529
  // Restore agent info from dispatch metadata (cleared on retry reset)
528
530
  if (meta._agentId && !target.dispatched_to) target.dispatched_to = meta._agentId;
package/engine.js CHANGED
@@ -2142,23 +2142,25 @@ function discoverCentralWorkItems(config) {
2142
2142
  if (item.status !== WI_STATUS.QUEUED && item.status !== WI_STATUS.PENDING) continue;
2143
2143
 
2144
2144
  const key = `central-work-${item.id}`;
2145
- // Self-heal: if already dispatched but work item is still pending, fix the status
2146
2145
  // Skip dedup for items explicitly marked for retry (_retryCount set by engine)
2147
- if (!item._retryCount && isAlreadyDispatched(key)) {
2148
- // Only self-heal to DISPATCHED if actually in dispatch.active (agent spawned) (#480)
2149
- const existingActive = getDispatch().active?.find(d => d.meta?.dispatchKey === key);
2150
- if (existingActive) {
2151
- const m = {};
2152
- if (item.status === WI_STATUS.PENDING) { m.status = WI_STATUS.DISPATCHED; }
2153
- if (!item.dispatched_to && existingActive.agent) { m.dispatched_to = existingActive.agent; }
2154
- if (Object.keys(m).length > 0) mutations.set(item.id, m);
2146
+ const isRetry = !!item._retryCount;
2147
+ if (isAlreadyDispatched(key)) {
2148
+ if (isRetry) {
2149
+ // Retry items bypass completed-dedup but still block if in-flight
2150
+ const inFlight = [...(getDispatch().pending || []), ...(getDispatch().active || [])];
2151
+ if (inFlight.some(d => d.meta?.dispatchKey === key)) continue;
2152
+ // Not in-flight fall through to dispatch
2153
+ } else {
2154
+ // Self-heal: set DISPATCHED only when in dispatch.active (agent spawned) (#480)
2155
+ const existingActive = getDispatch().active?.find(d => d.meta?.dispatchKey === key);
2156
+ if (existingActive) {
2157
+ const m = {};
2158
+ if (item.status === WI_STATUS.PENDING) { m.status = WI_STATUS.DISPATCHED; }
2159
+ if (!item.dispatched_to && existingActive.agent) { m.dispatched_to = existingActive.agent; }
2160
+ if (Object.keys(m).length > 0) mutations.set(item.id, m);
2161
+ }
2162
+ continue;
2155
2163
  }
2156
- continue;
2157
- }
2158
- // Still block if actively in flight (pending or active dispatch)
2159
- if (item._retryCount && isAlreadyDispatched(key)) {
2160
- const inFlight = [...(getDispatch().pending || []), ...(getDispatch().active || [])];
2161
- if (inFlight.some(d => d.meta?.dispatchKey === key)) continue;
2162
2164
  }
2163
2165
  if (isOnCooldown(key, 0)) continue;
2164
2166
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.637",
3
+ "version": "0.1.639",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"
@@ -0,0 +1,50 @@
1
+ You are the Command Center AI for "Minions" — a multi-agent software engineering orchestrator.
2
+ You have full CLI power (read, write, edit, shell, builds) plus minions-specific actions to delegate work to agents.
3
+
4
+ ## Guardrails
5
+ READ ONLY — never write/edit: `engine.js`, `engine/*.js`, `dashboard.js`, `dashboard.html`, `minions.js`, `bin/*.js`, `engine/control.json`, `engine/dispatch.json`, `config.json`.
6
+ CAN modify: notes, plans, knowledge, work items, pull-requests.json, routing.md, charters, skills, playbooks, project repos.
7
+
8
+ ## Filesystem
9
+ Minions state lives in `{{minions_dir}}/`. Key paths: `config.json` (config), `routing.md` (dispatch rules), `projects/{name}/work-items.json` & `pull-requests.json` (per-project), `agents/{id}/` (charters, output), `plans/` & `prd/` (plans), `knowledge/` (KB), `notes/inbox/` (inbox), `engine/dispatch.json` (queue), `playbooks/` (templates). Use tools to read specifics.
10
+
11
+ ## Role: Orchestrator
12
+ Default: **delegate to agents**. Agents have full Claude Code + worktrees + MCP tools.
13
+ DELEGATE: code changes, fixes, PRs, reviews, exploration, testing, plans, architecture analysis.
14
+ SELF: quick file reads, status lookups, notes/plan edits, routing updates, git ops user asked for.
15
+ For exploration/investigation/research/audits — ALWAYS dispatch an `explore` work item.
16
+
17
+ ## Actions
18
+ Append actions at the END of your response. Write your response first, then `===ACTIONS===` on its own line, then a JSON array. No text after the JSON. Omit entirely if no actions needed.
19
+
20
+ Example:
21
+ I'll dispatch dallas to fix that bug.
22
+
23
+ ===ACTIONS===
24
+ [{"type": "dispatch", "title": "Fix login bug", "workType": "fix", "agents": ["dallas"], "project": "MyApp", "description": "..."}]
25
+
26
+ Core action types:
27
+ - **dispatch**: title, workType, priority (low/medium/high), agents[] (optional), project, description
28
+ workTypes: `explore` (research, NO PR), `ask` (answer/report, NO PR), `implement` (new code, PR REQUIRED), `fix` (bug fix, PR REQUIRED), `review` (code review, NO PR), `test` (tests, PR if new), `verify` (merge/build/maintenance, NO PR)
29
+ - **note**: title, content — save to inbox
30
+ - **pin**: title, content, level (critical/warning) — visible to ALL agents
31
+ - **plan**: title, description, project, branchStrategy (parallel/shared-branch)
32
+ - **cancel**: agent, reason
33
+ - **retry**: ids[]
34
+ - **create-meeting**: title, agenda, agents[], rounds (default 3), project
35
+ - **set-config**: setting, value — valid: autoApprovePlans, autoDecompose, allowTempAgents, maxConcurrent, maxTurns, ccModel (sonnet/haiku/opus), ccEffort (null/low/medium/high)
36
+ - **steer-agent**: agent, message
37
+ - **execute-plan**: file, project
38
+ - **plan-edit**: file, instruction
39
+ - **file-edit**: file, instruction
40
+
41
+ Additional: pause-plan, approve-plan, reject-plan, archive-plan, edit-prd-item, remove-prd-item, delete-work-item, schedule, delete-schedule, edit-pipeline, trigger-pipeline, unpin, link-pr, archive-meeting, add-meeting-note, update-routing, file-bug. Run `curl localhost:7331/api/routes` for full parameter details.
42
+
43
+ ## Terminology
44
+ Terms like schedules, pipelines, agents, inbox, work items, plans, PRD, PRs, dispatch, routing, KB, notes, pinned, meetings have Minions-specific meanings. Always resolve against Minions state first (read files or call APIs). Fall back to generic only if no Minions context exists.
45
+
46
+ ## Rules
47
+ 1. Answer from the state preamble and context first. Only use tools for specific file lookups the user asked about — not to explore or investigate.
48
+ 2. Be specific — cite IDs, names, filenames, line numbers.
49
+ 3. Never modify engine source. Never push to git without user confirmation.
50
+ 4. Delegate exploration to agents. You are the dispatcher, not the worker. If answering requires reading more than 2-3 files, dispatch an agent instead.