agents-united 0.7.0 → 0.7.1

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/README.md CHANGED
@@ -426,7 +426,11 @@ Organization bundles can opt into a **delegation-first planning protocol**: the
426
426
  | `summaryWordCap` | 150 | Words per Scope-of-Work Statement |
427
427
  | `maxIterations` | 8 | Per-invocation iteration cap (`.cline/agents/*.yml`) |
428
428
 
429
- Currently enabled for `digital-agency` (`planningLoop.enabled` in `registry/bundles.json`); rollout to the remaining bundles is tracked in [`ROADMAP.md`](ROADMAP.md). See [ADR 0014](./docs/adr/0014-subagent-first-planning-loop.md) and [Plan 012](./plans/012-subagent-first-planning-loop.md).
429
+ Enabled for `digital-agency`. See [ADR 0014](./docs/adr/0014-subagent-first-planning-loop.md) and [Plan 012](./plans/012-subagent-first-planning-loop.md).
430
+
431
+ ### Planner-Orchestrator Mode (ADR 0015)
432
+
433
+ **Tier-1 Domain Bundles** operate in **Planner-Orchestrator Mode**: the orchestrator plans **solo** with the user — Socratic alignment via `/grill-me` / `/grill-with-docs`, direct skill consultation, no specialist spawns during planning. A **Planning Aid Boundary** allows provisional estimates during planning but defers concrete deliverables to the delegation map. Execution is then delegated to `subagent_*` tools via a solo-composed **Delegation Map**. This mode is the default for all 30 domain bundles (engineering, design, security, business, research, architecture, marketing); `digital-agency` and future Organization Bundles remain in Subagent-First Mode. See [ADR 0015](./docs/adr/0015-planner-orchestrator-mode-for-domain-bundles.md) and [Plan 013](./plans/013-planner-orchestrator-mode-for-domain-bundles.md).
430
434
 
431
435
  ---
432
436
  ## 🌐 One Library, Every Assistant
package/dist/cli.js CHANGED
@@ -41,6 +41,7 @@ var RegistryResolver = class {
41
41
  throw new Error(`Registry bundles.json not found at ${manifestPath}`);
42
42
  }
43
43
  this.bundlesManifest = await fs.readJson(manifestPath);
44
+ this.validateBundles(this.bundlesManifest);
44
45
  return this.bundlesManifest;
45
46
  }
46
47
  async getBundle(bundleName) {
@@ -193,6 +194,35 @@ var RegistryResolver = class {
193
194
  workflows: matchedWorkflows
194
195
  };
195
196
  }
197
+ /**
198
+ * ADR 0015 — fail-fast validation of planningLoop configuration.
199
+ * @throws if any bundle violates planner-orchestrator invariants.
200
+ */
201
+ validateBundles(manifest) {
202
+ const validModes = ["subagent-first", "planner-orchestrator"];
203
+ for (const [name, bundle] of Object.entries(manifest.bundles)) {
204
+ const pl = bundle.planningLoop;
205
+ if (!pl || !pl.enabled) continue;
206
+ const mode = pl.mode ?? "subagent-first";
207
+ if (!validModes.includes(mode)) {
208
+ throw new Error(
209
+ `Registry validation error: bundle "${name}" has unknown planningLoop.mode "${mode}". Valid modes: ${validModes.join(", ")}`
210
+ );
211
+ }
212
+ if (mode === "planner-orchestrator") {
213
+ if (pl.budget) {
214
+ throw new Error(
215
+ `Registry validation error: bundle "${name}" has planningLoop.mode "planner-orchestrator" but also declares a Consultation Budget (budget). Planner-orchestrator bundles must not declare budget.`
216
+ );
217
+ }
218
+ if (pl.sidekicks) {
219
+ throw new Error(
220
+ `Registry validation error: bundle "${name}" has planningLoop.mode "planner-orchestrator" but also declares sidekicks. Planner-orchestrator bundles must not declare sidekicks.`
221
+ );
222
+ }
223
+ }
224
+ }
225
+ }
196
226
  };
197
227
 
198
228
  // src/core/installer.ts
@@ -524,7 +554,14 @@ ${bodyStr}
524
554
  }
525
555
  };
526
556
  if (bundle.planningLoop?.enabled) {
527
- manifest.planningLoop = bundle.planningLoop;
557
+ const mode = bundle.planningLoop.mode ?? "subagent-first";
558
+ manifest.planningLoop = {
559
+ enabled: true,
560
+ mode,
561
+ // Only emit budget/sidekicks for subagent-first bundles
562
+ ...mode === "subagent-first" && bundle.planningLoop.budget ? { budget: bundle.planningLoop.budget } : {},
563
+ ...mode === "subagent-first" && bundle.planningLoop.sidekicks ? { sidekicks: bundle.planningLoop.sidekicks } : {}
564
+ };
528
565
  if (bundle.personaAliases && Object.keys(bundle.personaAliases).length > 0) {
529
566
  manifest.personas = Object.entries(bundle.personaAliases).map(([persona, role]) => ({ persona, role }));
530
567
  }
@@ -551,30 +588,10 @@ ${bodyStr}
551
588
  ### Recommended Addon Policy
552
589
  When user tasks require capabilities from: ${addons.join(", ")}, explain the capability and request user confirmation to install via \`agents add <addon> -t cline -y\` before running the installation.` : "";
553
590
  const planning = bundle.planningLoop?.enabled === true ? bundle.planningLoop : void 0;
591
+ const mode = planning?.mode ?? "subagent-first";
554
592
  const budget = planning?.budget;
555
- const delegationStep = planning ? "2. **Subagent-First Delegation Policy (ADR 0014)**: execute specialist work through the configured `subagent_*` agent tools (projected under `.cline/agents/`), assigning non-overlapping scopes. Complete specialist work in the main session ONLY if the subagent tools are genuinely absent from this runtime or the task is trivial (single-file read, one-line answer, formatting) \u2014 never as a convenience or speed choice." : "2. Delegate specialist tasks using the configured `subagent_*` agent tools (projected under `.cline/agents/`) when available, assigning non-overlapping scopes; fall back to Agent Teams (`team_spawn_teammate`) or session subagents as needed.";
556
- const planningSection = planning ? `
557
-
558
- ## Subagent-First Planning Dialogue Loop (ADR 0014)
559
- Run this loop BEFORE any substantive execution on a non-trivial task. Delegation-first is mandatory, not advisory.
560
-
561
- ### Phase 0 \u2014 User Alignment
562
- If the user's brief is ambiguous, grill it Socratically with the user first: \`/grill-me\` (strategy / non-code) or \`/grill-with-docs\` (code & docs; writes ADRs and updates CONTEXT.md).
563
-
564
- ### Phase 0.5 \u2014 Sidekick Clarification
565
- Spawn at most ${planning.sidekicks?.max ?? 2} relevant specialists (spawnable \`subagent_*\` tools) INTO this planning conversation to resolve remaining ambiguity. Sidekicks advise you; you relay their questions to the user.
566
-
567
- ### Phase 1 \u2014 Specialist Council
568
- Have every relevant specialist return a Scope-of-Work Statement (max ${budget?.summaryWordCap ?? 150} words): (1) my scope, (2) inputs I need from peers, (3) my deliverable per my own workflows, (4) at most 2 open questions.
569
-
570
- ### Phase 2 \u2014 Delegation Map
571
- Synthesize the council output into a task \u2192 specialist map and present it to the user BEFORE execution. Then delegate per the map.
572
-
573
- ### Consultation Budget (hard caps)
574
- - Planning rounds (orchestrator \u2194 council): max ${budget?.maxPlanningRounds ?? 2}
575
- - Peer exchanges per specialist pair: max ${budget?.maxPeerExchangesPerPair ?? 2} directed questions
576
- - Scope-of-Work statement length: max ${budget?.summaryWordCap ?? 150} words
577
- - Specialist per-invocation iteration cap: maxIterations: ${budget?.maxIterations ?? 8} (rendered into .cline/agents/*.yml)` : "";
593
+ const delegationStep = planning ? mode === "subagent-first" ? "2. **Subagent-First Delegation Policy (ADR 0014)**: execute specialist work through the configured `subagent_*` agent tools (projected under `.cline/agents/`), assigning non-overlapping scopes. Complete specialist work in the main session ONLY if the subagent tools are genuinely absent from this runtime or the task is trivial (single-file read, one-line answer, formatting) \u2014 never as a convenience or speed choice." : "2. **Planner-Orchestrator Delegation Policy (ADR 0015)**: execute specialist work through the configured `subagent_*` agent tools (projected under `.cline/agents/`), assigning non-overlapping scopes. Complete specialist work in the main session ONLY if the subagent tools are genuinely absent from this runtime or the task is trivial (single-file read, one-line answer, formatting) \u2014 never as a convenience or speed choice." : "2. Delegate specialist tasks using the configured `subagent_*` agent tools (projected under `.cline/agents/`) when available, assigning non-overlapping scopes; fall back to Agent Teams (`team_spawn_teammate`) or session subagents as needed.";
594
+ const planningSection = planning ? mode === "subagent-first" ? "\n\n## Subagent-First Planning Dialogue Loop (ADR 0014)Run this loop BEFORE any substantive execution on a non-trivial task. Delegation-first is mandatory, not advisory.\n\n### Phase 0 \u2014 User Alignment\nIf the user's brief is ambiguous, grill it Socratically with the user first: `/grill-me` (strategy / non-code) or `/grill-with-docs` (code & docs; writes ADRs and updates CONTEXT.md).\n\n### Phase 0.5 \u2014 Sidekick Clarification\nSpawn at most " + (planning.sidekicks?.max ?? 2) + " relevant specialists (spawnable `subagent_*` tools) INTO this planning conversation to resolve remaining ambiguity. Sidekicks advise you; you relay their questions to the user.\n\n### Phase 1 \u2014 Specialist Council\nHave every relevant specialist return a Scope-of-Work Statement (max " + (budget?.summaryWordCap ?? 150) + " words): (1) my scope, (2) inputs I need from peers, (3) my deliverable per my own workflows, (4) at most 2 open questions.\n\n### Phase 2 \u2014 Delegation Map\nSynthesize the council output into a task \u2192 specialist map and present it to the user BEFORE execution. Then delegate per the map.\n\n### Consultation Budget (hard caps)\n- Planning rounds (orchestrator \u2194 council): max " + (budget?.maxPlanningRounds ?? 2) + "\n- Peer exchanges per specialist pair: max " + (budget?.maxPeerExchangesPerPair ?? 2) + " directed questions\n- Scope-of-Work statement length: max " + (budget?.summaryWordCap ?? 150) + " words\n- Specialist per-invocation iteration cap: maxIterations: " + (budget?.maxIterations ?? 8) + " (rendered into .cline/agents/*.yml)" : "\n\n## Planner-Orchestrator Policy (ADR 0015)Plan solo, delegate execution. This mode replaces the Subagent-First Planning Dialogue Loop for single-discipline domain bundles.\n\n### Phase 0 \u2014 User Alignment (solo)\nIf the user's brief is ambiguous, grill it Socratically yourself: `/grill-me` (strategy / non-code) or `/grill-with-docs` (code & docs). Consult the bundle's skills directly whenever they help you plan \u2014 you have the same skill access as your specialists. Do NOT spawn specialists during planning.\n\n### Planning Aid Boundary\nWhile planning you may consult skills and reason to give the user PROVISIONAL answers and estimates. A concrete deliverable \u2014 data analysis, code, assets, documents \u2014 is specialist work: defer it to the delegation map, never produce it yourself during planning.\n\n### Phase 2 \u2014 Delegation Map (solo-composed)\nCompose the task \u2192 specialist map from your own domain expertise and the skill runbooks, and present it to the user BEFORE execution.\n\n### Execution\nDelegate every deliverable to the configured `subagent_*` agent tools (projected under `.cline/agents/`), assigning non-overlapping scopes. Complete specialist work in the main session ONLY if the subagent tools are genuinely absent from this runtime or the task is trivial (single-file read, one-line answer, formatting) \u2014 never as a convenience or speed choice." : "";
578
595
  const personaSection = planning && bundle.personaAliases && Object.keys(bundle.personaAliases).length > 0 ? `
579
596
 
580
597
  ### Persona \u2192 Spawnable Tool Map
@@ -632,6 +649,7 @@ ${addonSection}
632
649
  content,
633
650
  canonicalRel,
634
651
  bundle.planningLoop?.enabled === true ? bundle.planningLoop.budget?.maxIterations : void 0
652
+ // ADR 0015: planner-orchestrator has no budget → undefined → key absent from .yml
635
653
  );
636
654
  const roleName = this.stripSubagentPrefix(agentFile.replace(/\.md$/i, ""));
637
655
  artifacts.push({