@hve-squad/mcp 0.9.0 → 0.10.0

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
@@ -17,14 +17,14 @@ This server has **two execution modes**, at different maturity levels. Be precis
17
17
  | Mode | Host | State | Behaves as the full APM package? |
18
18
  | --- | --- | --- | --- |
19
19
  | **Delegated** (stdio) | VS Code GitHub Copilot (local) | Works | **Yes** — VS Code dispatches the real deployed cast. Needs the built package + `apm install` of the cast; install with `npx -y @hve-squad/mcp` or a local build. |
20
- | **Embedded advisory hero tools** (`squad_research`, `squad_review`, `squad_plan`, `squad_architect`) | Copilot Studio (remote HTTP) | Works, deployable via [host/RUNBOOK.md](host/RUNBOOK.md) | **Advisory parity.** Each runs one server-side dispatch via Azure OpenAI, resolving the **real from-disk persona from the full bundled cast** (91 agents), under Entra auth, gates, tenant isolation and cost caps. Advisory (text) output only — no code execution or deploy. |
20
+ | **Embedded advisory hero tools** (`squad_research`, `squad_review`, `squad_plan`, `squad_architect`) | Copilot Studio (remote HTTP) | Works, deployable via [host/RUNBOOK.md](host/RUNBOOK.md) | **Advisory parity.** Each runs one server-side dispatch via Azure OpenAI, resolving the **real from-disk persona from the full bundled cast** (99 agents), under Entra auth, gates, tenant isolation and cost caps. Advisory (text) output only — no code execution or deploy. |
21
21
  | **Embedded async advisory pipeline** (`squad_run`, `squad_status`) | Copilot Studio (remote HTTP) | **Works end-to-end; single-replica (file) or multi-replica (Azure Table)** | **Advisory parity — full cast, full advisory stages.** Data-driven routing runs research → plan → council → review → backlog over the real cast. Advisory (text) only; code-executing implement/deploy is a deferred execution expansion. |
22
22
  | **Deterministic render** (`squad_render_pptx`) | Copilot Studio (remote HTTP) | Opt-in (`SQUAD_MCP_ENABLE_RENDER_PPTX=true`) | **First file-output tool.** Renders content YAML to a `.pptx` with in-image `python-pptx` and returns a short-lived Azure Blob **user-delegation SAS** download link (tenant-scoped path, SAS never logged, `Squad.Render` fail-closed scope, caller YAML is DATA). No model call. |
23
23
 
24
24
  **The async pipeline (`squad_run`) runs the full advisory squad** — data-driven routing over the full bundled cast, sequencing research → plan → (council) → review → backlog-handoff and producing a finished, sectioned advisory artifact. It is **advisory parity**: finished text deliverables, not code-executing implement/deploy (that is a separate, deferred execution expansion). Specifics:
25
25
 
26
26
  - **Off by default** (`SQUAD_MCP_REMOTE_PIPELINE_ENABLED=false`); the default remote surface is the advisory hero tools. Enabling the async pipeline requires a durable run-state backend.
27
- - **Full cast + routing.** Requests are routed to the real roster roles (researcher → lead → council members → tester) resolved from the SHA-pinned 91-agent cast bundle; the council is task-fit (one seat per lens the request touches) and synthesizes a most-restrictive-wins Council Verdict (Go / Go-With-Conditions / Stop). It honors `mode` (interactive pauses per stage; `autopilot`/`autonomous` run to one compiled artifact).
27
+ - **Full cast + routing.** Requests are routed to the real roster roles (researcher → lead → council members → tester) resolved from the SHA-pinned 99-agent cast bundle; the council is task-fit (one seat per lens the request touches) and synthesizes a most-restrictive-wins Council Verdict (Go / Go-With-Conditions / Stop). It honors `mode` (interactive pauses per stage; `autopilot`/`autonomous` run to one compiled artifact).
28
28
  - **Releasable by an operator.** `squad_run` holds at a non-bypassable Human Gate; an operator with the distinct `Squad.Operate` app role releases a held run via the out-of-band `POST /admin/approve` route (never a `tools/call`), after which a `squad_status` poll drives it to completion. Approvals are audited (approver + timestamp) and tenant-scoped.
29
29
  - **Two run-state backends** (`SQUAD_MCP_RUN_STATE_BACKEND`): `file` (single-replica, local dir) or `table` (Azure Table Storage, cross-replica ETag compare-and-swap). The `table` backend + a store-backed approval channel make release visible across replicas, so a **multi-replica / scale-to-zero** deployment is supported (WI-06). Per-stage artifacts, the Council Verdict, and caller `request`/`context` are AES-256-GCM encrypted at rest when a key is configured.
30
30
  - **Long runs (>240s)** are handled by an optional background **worker** (an ACA Job): with `SQUAD_MCP_WORKER_ENABLED=true` the status poll is read-only and the worker drives approved runs off the request path (WI-1b4-WORKER).
@@ -112,9 +112,16 @@ The trigger is two or more of the first four lenses, or **any** responsible-AI c
112
112
 
113
113
  The **embedded/advisory pipeline** (`squad_run`) applies the same sizing in `route()`. When a needed council role is not in the seeded profile, the pipeline does not dispatch a partial council or synthesize a verdict for a lens it did not dispatch. Instead it records a `## Council Extension` section that names the roles to add (`full` seeds every council role) and continues to review, because the advisory pipeline has no implement stage to gate. In the **delegated** path, the coordinator persona carries the upstream contract: offer a missing role as a council extension, and treat a user's `## Council Waiver` as satisfying the Implementation Gate for that topic, never a Risk Gate.
114
114
 
115
- ### Model routing
115
+ ### Model routing and workflow controls
116
116
 
117
- `hve-squad@0.18.0` also added per-role model routing. **`squad_run`** and **`squad_federate`** take an optional `routing` input (`off`, `ranked`, or `manual`) that mirrors the new `/squad` and `/squad-federation` argument. In the **delegated** path it is forwarded verbatim: the coordinator persists it as the `Model routing:` line in `team.md`, `ranked` picks each role's model by fit from the squad model catalog, `manual` asks the user to choose from the models the host can run, and `off` dispatches with no model parameter. Omit it to keep the recorded mode. The **embedded** path ignores it (logged as `routing_ignored_unattended`), because it runs on the operator-configured backend.
117
+ `hve-squad@0.18.0` added per-role model routing, and `hve-squad@0.19.0`–`0.21.0` added `economy` routing, per-turn workflow `depth`, nine domain `pack` add-ons, and Contract 1.1 `execution` connector selection:
118
+
119
+ - **`routing`** (`off`, `ranked`, `economy`, or `manual` on **`squad_run`** and **`squad_federate`**) — forwarded verbatim on the **delegated** path and persisted as the `Model routing:` line in `team.md`. `ranked` selects each role's model capability-first from the squad model catalog; `economy` selects the lowest-priced qualified model within each role's floor after consent (with one `ranked` escalation after a failed review); `manual` asks the user to choose from the models the host can run; `off` dispatches with no model parameter. Omit it to keep the recorded mode.
120
+ - **`depth`** (`quick` or `standard` on **`squad_run`** and **`squad_federate`**) — per-turn workflow depth (`hve-squad@0.20.0+`). Controls how much work runs (bounded lane, shrink budgets, plan-driven parallelism), never which model runs, and never skips review, council, intake, or human gates.
121
+ - **`pack`** (`power-platform`, `m365-copilot`, `aws`, `foundry`, `fabric`, `dotnet`, `aks`, `azure-functions`, `azure-cloud` on **`squad_run`** and **`squad_federate`**) — comma-separated add-on pack hint(s) layered onto any of the eleven squad profiles (`default`, `full`, `security`, `design`, `accessibility`, `architecture`, `azure`, `modernization`, `compliance`, `operations`, `product`).
122
+ - **`execution`** (`original`, `connector:<binding-id>`, or `both` on **`squad_run`** and **`squad_federate`**) — post-classification connector selection against `team.md` `## Connector Bindings` (Contract 1.1); Coordinator, Scribe, and Council always stay internal.
123
+
124
+ The **embedded** path runs unattended on the operator-configured backend, so it ignores `routing`, `depth`, `pack`, and `execution` and logs `*_ignored_unattended`.
118
125
 
119
126
  ## Execution model — delegated (local VS Code)
120
127
 
@@ -1,4 +1,4 @@
1
- import { COORDINATOR_PERSONA, DISCOVERY_GATE_INSTRUCTIONS, FEDERATION_AUTOPILOT_NOTE, FEDERATION_COORDINATOR_PERSONA, FEDERATION_DETECTION_NOTE, GATE_INSTRUCTIONS, discoveryInstructions, modeInstructions, routingInstructions, squadStateRoot, } from "./persona.js";
1
+ import { COORDINATOR_PERSONA, DISCOVERY_GATE_INSTRUCTIONS, FEDERATION_AUTOPILOT_NOTE, FEDERATION_COORDINATOR_PERSONA, FEDERATION_DETECTION_NOTE, GATE_INSTRUCTIONS, depthInstructions, discoveryInstructions, executionInstructions, modeInstructions, packInstructions, routingInstructions, squadStateRoot, } from "./persona.js";
2
2
  import { LOCAL_MEMORY_TENANT } from "./squad-memory-resources.js";
3
3
  /** True for the federation meta tool (routes across named sub-squads). */
4
4
  function isFederationTool(tool) {
@@ -27,10 +27,22 @@ function composeSystemPrompt(tool, request) {
27
27
  if (discoveryBlock.length > 0) {
28
28
  blocks.push(discoveryBlock);
29
29
  }
30
+ const packBlock = packInstructions(request.pack, federation);
31
+ if (packBlock.length > 0) {
32
+ blocks.push(packBlock);
33
+ }
34
+ const executionBlock = executionInstructions(request.execution, federation);
35
+ if (executionBlock.length > 0) {
36
+ blocks.push(executionBlock);
37
+ }
30
38
  const routingBlock = routingInstructions(request.routing, federation);
31
39
  if (routingBlock.length > 0) {
32
40
  blocks.push(routingBlock);
33
41
  }
42
+ const depthBlock = depthInstructions(request.depth, federation);
43
+ if (depthBlock.length > 0) {
44
+ blocks.push(depthBlock);
45
+ }
34
46
  // Surface federation resolution for the federation tool, or for any tool that
35
47
  // did not pin a sub-squad (a plain repo ignores it; a federation repo needs it).
36
48
  if (federation || !request.squad) {
@@ -152,11 +164,14 @@ async function composeStateContext(request, memory) {
152
164
  `- squad state root: \`${stateRoot}\` (create on first use via the Squad Scribe)`,
153
165
  `- sub-squad: ${request.squad ?? "(none / plain squad; resolve from meta-routing in a federation)"}`,
154
166
  `- profile: ${request.profile ?? "(coordinator discovers / proposes)"}`,
167
+ `- pack: ${request.pack ?? "(none; coordinator proposes from repository or request signals)"}`,
155
168
  `- tier: ${request.tier ?? "(cost-first default)"}`,
156
169
  `- owner: ${request.owner ?? "(role-only dispatch)"}`,
170
+ `- execution: ${request.execution ?? "(roster binding default or internal Primary)"}`,
157
171
  `- mode: ${request.mode ?? "(interactive)"}`,
158
172
  `- discovery: ${request.discovery ?? "(no explicit depth; offer once when the trigger holds)"}`,
159
173
  `- model routing: ${request.routing ?? "(as recorded in team.md; none recorded dispatches with no model parameter)"}`,
174
+ `- depth: ${request.depth ?? "(standard default; per-turn, never inferred)"}`,
160
175
  ];
161
176
  // Optional bounded prior-context digest (Step 4.1). With NO store injected the
162
177
  // block is never appended, so the output is BYTE-IDENTICAL to the advisory-only
@@ -181,6 +181,14 @@ export class EmbeddedCoordinator {
181
181
  return false;
182
182
  }
183
183
  }
184
+ /**
185
+ * Log any attended-only prompt controls supplied on an unattended embedded turn.
186
+ *
187
+ * `discovery` interviews a human; `pack`, `execution`, `routing`, and `depth`
188
+ * belong to the host coordinator's local roster, connector, and dispatch-plan
189
+ * contracts (`squad-discovery-gate.instructions.md`, `profiles-and-packs.md`,
190
+ * `connector-role-modes.md`, `model-routing.md`, `quick-depth.md`).
191
+ */
184
192
  decrementHeld(tenantId) {
185
193
  const current = this.heldCounts.get(tenantId) ?? 0;
186
194
  if (current <= 1) {
@@ -190,6 +198,46 @@ export class EmbeddedCoordinator {
190
198
  this.heldCounts.set(tenantId, current - 1);
191
199
  }
192
200
  }
201
+ /**
202
+ * Log any attended-only prompt controls supplied on an unattended embedded turn.
203
+ *
204
+ * `discovery` interviews a human; `pack`, `execution`, `routing`, and `depth`
205
+ * belong to the host coordinator's local roster, connector, and dispatch-plan
206
+ * contracts (`squad-discovery-gate.instructions.md`, `profiles-and-packs.md`,
207
+ * `connector-role-modes.md`, `model-routing.md`, `quick-depth.md`).
208
+ */
209
+ logIgnoredUnattendedControls(toolId, request) {
210
+ if (request.discovery) {
211
+ this.logger?.info("discovery_ignored_unattended", {
212
+ toolId,
213
+ requested: request.discovery,
214
+ });
215
+ }
216
+ if (request.pack) {
217
+ this.logger?.info("pack_ignored_unattended", {
218
+ toolId,
219
+ requested: request.pack,
220
+ });
221
+ }
222
+ if (request.execution) {
223
+ this.logger?.info("execution_ignored_unattended", {
224
+ toolId,
225
+ requested: request.execution,
226
+ });
227
+ }
228
+ if (request.routing) {
229
+ this.logger?.info("routing_ignored_unattended", {
230
+ toolId,
231
+ requested: request.routing,
232
+ });
233
+ }
234
+ if (request.depth) {
235
+ this.logger?.info("depth_ignored_unattended", {
236
+ toolId,
237
+ requested: request.depth,
238
+ });
239
+ }
240
+ }
193
241
  /**
194
242
  * Execute one hero-tool call server-side. Routing/scope/gate decisions are made
195
243
  * before any model call; on a hold or a quota denial NO backend call is made.
@@ -208,18 +256,7 @@ export class EmbeddedCoordinator {
208
256
  async handle(tool, request, ctx) {
209
257
  const matchedRouting = toMatchedRouting(tool);
210
258
  const tenantId = ctx.auth.tenantId;
211
- if (request.discovery) {
212
- this.logger?.info("discovery_ignored_unattended", {
213
- toolId: tool.id,
214
- requested: request.discovery,
215
- });
216
- }
217
- if (request.routing) {
218
- this.logger?.info("routing_ignored_unattended", {
219
- toolId: tool.id,
220
- requested: request.routing,
221
- });
222
- }
259
+ this.logIgnoredUnattendedControls(tool.id, request);
223
260
  // SEC-9 / COST-1 / COST-2 — admit under quota before any work.
224
261
  const admit = this.quota.acquire(tenantId);
225
262
  if (!admit.ok) {
@@ -628,6 +665,7 @@ export class EmbeddedCoordinator {
628
665
  async startHttpRun(tool, request, ctx) {
629
666
  const matchedRouting = toMatchedRouting(tool);
630
667
  const tenantId = ctx.auth.tenantId;
668
+ this.logIgnoredUnattendedControls(tool.id, request);
631
669
  const admit = this.quota.acquire(tenantId);
632
670
  if (!admit.ok) {
633
671
  return { kind: "embedded", outcome: "denied", matchedRouting, reason: admit.reason };
@@ -248,13 +248,87 @@ export function discoveryInstructions(discovery) {
248
248
  "you could not dispatch. Record the verdict with `Opt-In: explicit-input`.",
249
249
  ].join("\n");
250
250
  }
251
- /** The per-role model routing modes the `/squad` prompt accepts (hve-squad 0.18.0). */
252
- export const MODEL_ROUTING_MODES = ["off", "ranked", "manual"];
251
+ /** The registered add-on packs the `/squad` prompt accepts (hve-squad 0.21.0). */
252
+ export const REGISTERED_PACKS = [
253
+ "power-platform",
254
+ "m365-copilot",
255
+ "aws",
256
+ "foundry",
257
+ "fabric",
258
+ "dotnet",
259
+ "aks",
260
+ "azure-functions",
261
+ "azure-cloud",
262
+ ];
263
+ const REGISTERED_PACK_SET = new Set(REGISTERED_PACKS);
264
+ /**
265
+ * Normalize and validate a comma-separated `pack` input against {@link REGISTERED_PACKS}.
266
+ * Returns the deduplicated list in caller order, or `[]` when empty or invalid.
267
+ */
268
+ export function parsePackList(pack) {
269
+ const raw = (pack ?? "").trim();
270
+ if (raw.length === 0) {
271
+ return [];
272
+ }
273
+ const tokens = raw.split(",").map((token) => token.trim().toLowerCase());
274
+ if (tokens.some((token) => !REGISTERED_PACK_SET.has(token))) {
275
+ return [];
276
+ }
277
+ return [...new Set(tokens)];
278
+ }
279
+ /**
280
+ * The per-turn add-on pack disposition, paraphrased from `squad.prompt.md` and
281
+ * `references/profiles-and-packs.md`. Appended only when a valid `pack=` input was supplied.
282
+ */
283
+ export function packInstructions(pack, federation = false) {
284
+ const packs = parsePackList(pack);
285
+ if (packs.length === 0) {
286
+ return "";
287
+ }
288
+ const joined = packs.join(",");
289
+ const lines = [
290
+ `**Pack = ${joined} (explicit input).** Pass \`pack=${joined}\` to the coordinator as`,
291
+ "the pack hint: a pack layers its specialist roles and/or scoped guidance on top of the",
292
+ "seeded profile and never replaces it. On an existing squad it is an offer to apply the",
293
+ "pack via the sealed roster-expansion transaction rather than a re-seed; missing opt-in",
294
+ "external or preview resources still require explicit user confirmation and installation.",
295
+ ];
296
+ if (federation) {
297
+ lines.push("Forward the pack hint to the selected sub-squad run(s); pack state stays member-local.");
298
+ }
299
+ return lines.join("\n");
300
+ }
301
+ /** Validated shape for the post-classification `execution` input (Contract 1.1). */
302
+ export const EXECUTION_CHOICE_PATTERN = /^(original|both|connector:[a-z0-9][a-z0-9-]*)$/;
303
+ /**
304
+ * The per-turn connector execution disposition, paraphrased from `squad.prompt.md`
305
+ * and `references/connector-role-modes.md` (Contract 1.1).
306
+ */
307
+ export function executionInstructions(execution, federation = false) {
308
+ const choice = (execution ?? "").trim();
309
+ if (!EXECUTION_CHOICE_PATTERN.test(choice)) {
310
+ return "";
311
+ }
312
+ const lines = [
313
+ `**Execution = ${choice} (explicit input).** Pass \`execution=${choice}\` to the coordinator`,
314
+ "verbatim for post-classification connector selection against `team.md`'s `## Connector Bindings`",
315
+ "(`original` runs the internal roster agent, `connector:<binding-id>` runs the registered",
316
+ "Squad Connector binding, and `both` runs both). Coordinator, Scribe, and Council dispatches",
317
+ "always remain internal.",
318
+ ];
319
+ if (federation) {
320
+ lines.push("Forward `execution` only to selected child sub-squad runs; binding authority is member-local.");
321
+ }
322
+ return lines.join("\n");
323
+ }
324
+ /** The per-role model routing modes the `/squad` prompt accepts (hve-squad 0.19.0+ / 0.21.0). */
325
+ export const MODEL_ROUTING_MODES = ["off", "ranked", "economy", "manual"];
253
326
  /**
254
327
  * The per-turn model routing disposition, paraphrased from the `/squad` and
255
- * `/squad-federation` prompts and `references/model-routing.md`. Appended only
256
- * when the caller supplied an explicit `routing=` input; when it is omitted the
257
- * coordinator applies the mode already recorded in `team.md`.
328
+ * `/squad-federation` prompts, `references/model-routing.md`, and
329
+ * `references/economy-mode.md`. Appended only when the caller supplied an explicit
330
+ * `routing=` input; when it is omitted the coordinator applies the mode already
331
+ * recorded in `team.md`.
258
332
  */
259
333
  export function routingInstructions(routing, federation = false) {
260
334
  const mode = (routing ?? "").trim().toLowerCase();
@@ -266,10 +340,13 @@ export function routingInstructions(routing, federation = false) {
266
340
  "verbatim; it persists the mode as the `Model routing:` line in `team.md` until changed.",
267
341
  ];
268
342
  if (mode === "ranked") {
269
- lines.push("`ranked` picks each role's model by fit from the squad model catalog and shows the", "picks in `team.md`'s `Model` column; every non-Scribe dispatch passes that cell verbatim.");
343
+ lines.push("`ranked` is capability-first: it picks each role's model by task capability within its", "floor from the squad model catalog and shows the picks in `team.md`'s `Model` column;", "every non-Scribe dispatch passes that cell verbatim.");
344
+ }
345
+ else if (mode === "economy") {
346
+ lines.push("`economy` is cost-first across every routed role within its floor, after stating the", "all-roles trade once and recording `## Economy Mode Accepted` consent in `decisions.md`:", "it picks the lowest-Blended qualified model inside the role's floor, escalates an owner", "once to its `ranked` pick after a failed review, and never weakens floors or gates.");
270
347
  }
271
348
  else if (mode === "manual") {
272
- lines.push("`manual` asks the user, before any dispatch, to accept the suggestions or choose per", "assignment class and then per role, offering only models this host can run; every", "non-Scribe dispatch passes the recorded `Model` cell verbatim.");
349
+ lines.push("`manual` asks the user, before any dispatch, to accept capability-first suggestions or", "choose per assignment class and then per role, offering only models this host can run;", "every non-Scribe dispatch passes the recorded `Model` cell verbatim.");
273
350
  }
274
351
  else {
275
352
  lines.push("`off` removes the `Model` column and dispatches with no model parameter.");
@@ -280,6 +357,29 @@ export function routingInstructions(routing, federation = false) {
280
357
  }
281
358
  return lines.join("\n");
282
359
  }
360
+ /** The per-turn workflow depths the `/squad` prompt accepts (hve-squad 0.20.0+). */
361
+ export const WORKFLOW_DEPTHS = ["quick", "standard"];
362
+ /**
363
+ * The per-turn workflow depth disposition, paraphrased from `squad.prompt.md` and
364
+ * `references/quick-depth.md`. Appended only when an explicit `depth=` input is supplied.
365
+ */
366
+ export function depthInstructions(depth, federation = false) {
367
+ const normalized = (depth ?? "").trim().toLowerCase();
368
+ if (!WORKFLOW_DEPTHS.includes(normalized)) {
369
+ return "";
370
+ }
371
+ const source = federation ? "federation" : "input";
372
+ const lines = [
373
+ `**Depth = ${normalized} (explicit input).** Forward \`requestedDepth: "${normalized}"\` with`,
374
+ `\`depthSource: "${source}"\` to the dispatch planner. Depth is per-turn (never persisted`,
375
+ "to `team.md` or `state.json`), controls how much work runs rather than which model runs,",
376
+ "and never skips or relaxes review, council, intake, Risk, or Impactful-Action gates.",
377
+ ];
378
+ if (federation) {
379
+ lines.push("Forward explicit `depth` to each selected sub-squad; a child sub-squad never widens it.");
380
+ }
381
+ return lines.join("\n");
382
+ }
283
383
  /**
284
384
  * Federation-level autopilot note, paraphrased from
285
385
  * squad-src/.github/instructions/squad/squad-federation-autopilot.instructions.md.
@@ -40,7 +40,6 @@ export const DELIVERABLE_PRODUCING_ROLES = [
40
40
  "product-owner",
41
41
  "designer",
42
42
  "experimenter",
43
- "presenter",
44
43
  "technical-writer",
45
44
  "data-scientist",
46
45
  ];
@@ -25,7 +25,7 @@
25
25
  import { SQUAD_STATE_ROOT, } from "./artifact-store.js";
26
26
  import { deliverableRootFor } from "./profiles.js";
27
27
  /** The `state.json` schema this server writes (matches squad-state.instructions.md). */
28
- export const STATE_SCHEMA_VERSION = "1.3";
28
+ export const STATE_SCHEMA_VERSION = "1.4";
29
29
  export const TEAM_PATH = `${SQUAD_STATE_ROOT}/team.md`;
30
30
  export const ROUTING_PATH = `${SQUAD_STATE_ROOT}/routing.md`;
31
31
  export const STATE_PATH = `${SQUAD_STATE_ROOT}/state.json`;
@@ -105,7 +105,27 @@ export function initialState(profile, opts = {}) {
105
105
  mode: opts.mode?.trim() || "interactive",
106
106
  activeRoles: [],
107
107
  openEscalations: [],
108
- currentRun: { sessionModel: "", modelOverrides: {}, estCostUsd: 0, estCreditsTotal: 0 },
108
+ currentRun: {
109
+ sessionModel: "",
110
+ modelOverrides: {},
111
+ estCostUsd: 0,
112
+ estCreditsTotal: 0,
113
+ costPreflight: {
114
+ runId: "",
115
+ roundId: "",
116
+ ceilingUsd: null,
117
+ evaluatedSpendUsd: 0,
118
+ remainingUsd: null,
119
+ plannedDispatches: 0,
120
+ projectedCostUsd: 0,
121
+ reserveMultiplier: 3.0,
122
+ admissionCostUsd: 0,
123
+ confidence: "not-applicable",
124
+ basis: "not-requested",
125
+ decision: "not-requested",
126
+ reason: "No cost ceiling configured.",
127
+ },
128
+ },
109
129
  notify: {
110
130
  approvalChannel: "in-chat",
111
131
  enabled: false,
@@ -75,11 +75,14 @@ export class ToolRouter {
75
75
  toolId: tool.id,
76
76
  request: String(record.request ?? ""),
77
77
  profile: optionalString(record.profile),
78
+ pack: optionalString(record.pack),
78
79
  tier: optionalString(record.tier),
79
80
  owner: optionalString(record.owner),
81
+ execution: optionalString(record.execution),
80
82
  mode: optionalString(record.mode),
81
83
  discovery: optionalString(record.discovery),
82
84
  routing: optionalString(record.routing),
85
+ depth: optionalString(record.depth),
83
86
  context: optionalString(record.context),
84
87
  squad: optionalString(record.squad),
85
88
  init: record.init === true,
@@ -29,7 +29,7 @@ export const SERVER_NAME = "hve-squad-mcp";
29
29
  * image than in development. A constant plus a failing test is the cheaper and
30
30
  * more honest guarantee.
31
31
  */
32
- export const SERVER_VERSION = "0.9.0";
32
+ export const SERVER_VERSION = "0.10.0";
33
33
  /**
34
34
  * Render an engine result into MCP tool-call content. For delegated execution
35
35
  * this is the "charter contract": the persona to adopt, the matched routing,
@@ -27,8 +27,12 @@
27
27
  "full",
28
28
  "security",
29
29
  "design",
30
+ "accessibility",
30
31
  "architecture",
31
32
  "azure",
33
+ "modernization",
34
+ "compliance",
35
+ "operations",
32
36
  "product"
33
37
  ],
34
38
  "description": "Optional squad profile to seed when the project has no squad yet."
@@ -97,8 +101,12 @@
97
101
  "full",
98
102
  "security",
99
103
  "design",
104
+ "accessibility",
100
105
  "architecture",
101
106
  "azure",
107
+ "modernization",
108
+ "compliance",
109
+ "operations",
102
110
  "product"
103
111
  ],
104
112
  "description": "Optional squad profile to seed when the project has no squad yet."
@@ -167,8 +175,12 @@
167
175
  "full",
168
176
  "security",
169
177
  "design",
178
+ "accessibility",
170
179
  "architecture",
171
180
  "azure",
181
+ "modernization",
182
+ "compliance",
183
+ "operations",
172
184
  "product"
173
185
  ],
174
186
  "description": "Optional squad profile to seed when the project has no squad yet."
@@ -243,8 +255,12 @@
243
255
  "full",
244
256
  "security",
245
257
  "design",
258
+ "accessibility",
246
259
  "architecture",
247
260
  "azure",
261
+ "modernization",
262
+ "compliance",
263
+ "operations",
248
264
  "product"
249
265
  ],
250
266
  "description": "Optional squad profile to seed when the project has no squad yet."
@@ -313,12 +329,21 @@
313
329
  "full",
314
330
  "security",
315
331
  "design",
332
+ "accessibility",
316
333
  "architecture",
317
334
  "azure",
335
+ "modernization",
336
+ "compliance",
337
+ "operations",
318
338
  "product"
319
339
  ],
320
340
  "description": "Optional squad profile to seed when the project has no squad yet."
321
341
  },
342
+ "pack": {
343
+ "type": "string",
344
+ "pattern": "^(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud)(,(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud))*$",
345
+ "description": "Optional comma-separated add-on pack(s) layered onto the profile (power-platform, m365-copilot, aws, foundry, fabric, dotnet, aks, azure-functions, azure-cloud). A pack carries specialist roles, scoped guidance, or both and never replaces the profile. Ignored on an unattended run."
346
+ },
322
347
  "tier": {
323
348
  "type": "string",
324
349
  "enum": [
@@ -331,6 +356,11 @@
331
356
  "type": "string",
332
357
  "description": "Optional Member Name from team.md to pick a specific named member."
333
358
  },
359
+ "execution": {
360
+ "type": "string",
361
+ "pattern": "^(original|both|connector:[a-z0-9][a-z0-9-]*)$",
362
+ "description": "Optional post-classification connector execution choice (original, connector:<binding-id>, or both) per team.md Connector Bindings (Contract 1.1). Coordinator, Scribe, and Council always remain internal. Ignored on an unattended run."
363
+ },
334
364
  "mode": {
335
365
  "type": "string",
336
366
  "enum": [
@@ -354,9 +384,18 @@
354
384
  "enum": [
355
385
  "off",
356
386
  "ranked",
387
+ "economy",
357
388
  "manual"
358
389
  ],
359
- "description": "Optional per-role model routing mode, persisted in team.md until changed: ranked (pick each role's model by fit from the squad model catalog), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
390
+ "description": "Optional per-role model routing mode, persisted in team.md until changed: ranked (capability-first picks from the squad model catalog), economy (cost-first across every routed role within its floor after consent, with one ranked escalation after a failed review), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
391
+ },
392
+ "depth": {
393
+ "type": "string",
394
+ "enum": [
395
+ "quick",
396
+ "standard"
397
+ ],
398
+ "description": "Optional per-turn workflow depth (quick or standard; omission is standard, never inferred). Controls how much work runs (bounded lane, shrink budgets, plan-driven parallelism), never which model runs, and never skips review, council, intake, or human gates. Ignored on an unattended run."
360
399
  },
361
400
  "context": {
362
401
  "type": "string",
@@ -415,12 +454,21 @@
415
454
  "full",
416
455
  "security",
417
456
  "design",
457
+ "accessibility",
418
458
  "architecture",
419
459
  "azure",
460
+ "modernization",
461
+ "compliance",
462
+ "operations",
420
463
  "product"
421
464
  ],
422
465
  "description": "Optional profile hint forwarded to a sub-squad's Init when it has no squad yet."
423
466
  },
467
+ "pack": {
468
+ "type": "string",
469
+ "pattern": "^(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud)(,(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud))*$",
470
+ "description": "Optional comma-separated add-on pack(s) forwarded to the selected sub-squad's run (power-platform, m365-copilot, aws, foundry, fabric, dotnet, aks, azure-functions, azure-cloud). Ignored on an unattended run."
471
+ },
424
472
  "tier": {
425
473
  "type": "string",
426
474
  "enum": [
@@ -433,6 +481,11 @@
433
481
  "type": "string",
434
482
  "description": "Optional Member Name forwarded to the selected sub-squad's run."
435
483
  },
484
+ "execution": {
485
+ "type": "string",
486
+ "pattern": "^(original|both|connector:[a-z0-9][a-z0-9-]*)$",
487
+ "description": "Optional post-classification connector execution choice (original, connector:<binding-id>, or both), forwarded only to selected child sub-squad runs (binding authority remains member-local). Ignored on an unattended run."
488
+ },
436
489
  "mode": {
437
490
  "type": "string",
438
491
  "enum": [
@@ -456,9 +509,18 @@
456
509
  "enum": [
457
510
  "off",
458
511
  "ranked",
512
+ "economy",
459
513
  "manual"
460
514
  ],
461
- "description": "Optional per-role model routing mode (off, ranked, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
515
+ "description": "Optional per-role model routing mode (off, ranked, economy, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
516
+ },
517
+ "depth": {
518
+ "type": "string",
519
+ "enum": [
520
+ "quick",
521
+ "standard"
522
+ ],
523
+ "description": "Optional per-turn workflow depth (quick or standard; omission is standard), forwarded to each selected sub-squad with depthSource=federation; a child never widens it. Changes work, not models, and never skips gates. Ignored on an unattended run."
462
524
  },
463
525
  "context": {
464
526
  "type": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hve-squad/mcp",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Outbound Model Context Protocol (MCP) server that exposes the hve-squad as coarse intent tools (squad_research, squad_plan, squad_review, squad_architect, squad_run) plus squad_federate for the opt-in federation of named sub-squads, to MCP hosts such as VS Code GitHub Copilot. Phase 0: local stdio, delegated execution.",
6
6
  "license": "MIT",
@@ -48,15 +48,15 @@
48
48
  "start:worker": "node dist/src/worker-main.js"
49
49
  },
50
50
  "dependencies": {
51
- "@azure/identity": "^4.13.3",
52
- "@modelcontextprotocol/sdk": "^1.31.0",
51
+ "@azure/identity": "^4.14.1",
52
+ "@modelcontextprotocol/sdk": "^1.32.2",
53
53
  "ajv": "^8.17.1",
54
- "jose": "^6.2.12",
54
+ "jose": "^6.2.17",
55
55
  "yaml": "^2.9.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@11ty/eleventy": "3.1.6",
59
- "@types/node": "^26.6.3",
59
+ "@types/node": "^26.6.6",
60
60
  "cheerio": "1.2.0",
61
61
  "pagefind": "1.5.2",
62
62
  "tsx": "^4.23.15",
package/tools.catalog.yml CHANGED
@@ -40,18 +40,26 @@ schemaVersion: "0.1.0"
40
40
  # for documentation; each tool restates them inline so every tool input is a
41
41
  # complete, self-contained JSON Schema.
42
42
  conventions:
43
- profiles: [default, full, security, design, architecture, azure, product]
43
+ profiles: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
44
+ packs: [power-platform, m365-copilot, aws, foundry, fabric, dotnet, aks, azure-functions, azure-cloud]
44
45
  tiers: [fast, default]
45
46
  modes: [autonomous, autopilot]
46
47
  # Discovery-gate depths, offered only on the attended (delegated) path — the
47
48
  # gate interviews a human, so an unattended run ignores the input entirely.
48
49
  # See squad-src/.github/instructions/squad/squad-discovery-gate.instructions.md.
49
50
  discoveryDepths: [quick, standard, deep, skip]
50
- # Per-role model routing modes (hve-squad 0.18.0), forwarded to the coordinator
51
- # on the attended (delegated) path only; the embedded engine runs its own
52
- # configured backend and ignores the input.
53
- # See squad-src/.github/skills/squad/references/model-routing.md.
54
- modelRouting: [off, ranked, manual]
51
+ # Per-role model routing modes (hve-squad 0.18.0+; economy added in 0.19.0),
52
+ # forwarded to the coordinator on the attended (delegated) path only; the
53
+ # embedded engine runs its own configured backend and ignores the input.
54
+ # See squad-src/.github/skills/squad/references/{model-routing,economy-mode}.md.
55
+ modelRouting: [off, ranked, economy, manual]
56
+ # Per-turn workflow depths (hve-squad 0.20.0+), forwarded on the attended
57
+ # (delegated) path only; ignored unattended.
58
+ # See squad-src/.github/skills/squad/references/quick-depth.md.
59
+ depths: [quick, standard]
60
+ # Post-classification connector execution choice (Contract 1.1, hve-squad 0.19.0+).
61
+ # See squad-src/.github/skills/squad/references/connector-role-modes.md.
62
+ executionPattern: "^(original|both|connector:[a-z0-9][a-z0-9-]*)$"
55
63
  stateRoot: ".copilot-tracking/squad/"
56
64
  # Federation (opt-in): a repo may host several named sub-squads, each an
57
65
  # ordinary squad rooted at the sub-squad root below. The optional `squad`
@@ -89,7 +97,7 @@ tools:
89
97
  description: "The research question or topic for the squad this turn."
90
98
  profile:
91
99
  type: string
92
- enum: [default, full, security, design, architecture, azure, product]
100
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
93
101
  description: "Optional squad profile to seed when the project has no squad yet."
94
102
  tier:
95
103
  type: string
@@ -139,7 +147,7 @@ tools:
139
147
  description: "The work to plan this turn."
140
148
  profile:
141
149
  type: string
142
- enum: [default, full, security, design, architecture, azure, product]
150
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
143
151
  description: "Optional squad profile to seed when the project has no squad yet."
144
152
  tier:
145
153
  type: string
@@ -205,7 +213,7 @@ tools:
205
213
  description: "What to review, validate, or take to council this turn."
206
214
  profile:
207
215
  type: string
208
- enum: [default, full, security, design, architecture, azure, product]
216
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
209
217
  description: "Optional squad profile to seed when the project has no squad yet."
210
218
  tier:
211
219
  type: string
@@ -255,7 +263,7 @@ tools:
255
263
  description: "The architecture or system-design question this turn."
256
264
  profile:
257
265
  type: string
258
- enum: [default, full, security, design, architecture, azure, product]
266
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
259
267
  description: "Optional squad profile to seed when the project has no squad yet."
260
268
  tier:
261
269
  type: string
@@ -309,8 +317,12 @@ tools:
309
317
  description: "The work for the squad this turn (any intent; the Coordinator classifies it)."
310
318
  profile:
311
319
  type: string
312
- enum: [default, full, security, design, architecture, azure, product]
320
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
313
321
  description: "Optional squad profile to seed when the project has no squad yet."
322
+ pack:
323
+ type: string
324
+ pattern: "^(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud)(,(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud))*$"
325
+ description: "Optional comma-separated add-on pack(s) layered onto the profile (power-platform, m365-copilot, aws, foundry, fabric, dotnet, aks, azure-functions, azure-cloud). A pack carries specialist roles, scoped guidance, or both and never replaces the profile. Ignored on an unattended run."
314
326
  tier:
315
327
  type: string
316
328
  enum: [fast, default]
@@ -318,6 +330,10 @@ tools:
318
330
  owner:
319
331
  type: string
320
332
  description: "Optional Member Name from team.md to pick a specific named member."
333
+ execution:
334
+ type: string
335
+ pattern: "^(original|both|connector:[a-z0-9][a-z0-9-]*)$"
336
+ description: "Optional post-classification connector execution choice (original, connector:<binding-id>, or both) per team.md Connector Bindings (Contract 1.1). Coordinator, Scribe, and Council always remain internal. Ignored on an unattended run."
321
337
  mode:
322
338
  type: string
323
339
  enum: [autonomous, autopilot]
@@ -328,8 +344,12 @@ tools:
328
344
  description: "Optional discovery-gate depth for a request that states a goal with no requirement artifact behind it: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. An explicit depth beats the coordinator's one-time offer. Ignored on an unattended run, which has nobody for the gate to interview."
329
345
  routing:
330
346
  type: string
331
- enum: ["off", ranked, manual]
332
- description: "Optional per-role model routing mode, persisted in team.md until changed: ranked (pick each role's model by fit from the squad model catalog), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
347
+ enum: ["off", ranked, economy, manual]
348
+ description: "Optional per-role model routing mode, persisted in team.md until changed: ranked (capability-first picks from the squad model catalog), economy (cost-first across every routed role within its floor after consent, with one ranked escalation after a failed review), manual (ask you to choose each role's model from the models this host can run), or off (no Model column; dispatch with no model parameter). Omit to keep the recorded mode. Ignored on an unattended run."
349
+ depth:
350
+ type: string
351
+ enum: [quick, standard]
352
+ description: "Optional per-turn workflow depth (quick or standard; omission is standard, never inferred). Controls how much work runs (bounded lane, shrink budgets, plan-driven parallelism), never which model runs, and never skips review, council, intake, or human gates. Ignored on an unattended run."
333
353
  context:
334
354
  type: string
335
355
  description: "Optional free-form context to frame the pipeline."
@@ -387,8 +407,12 @@ tools:
387
407
  description: "When true on an existing single-squad project (a top-level team.md, no federation.md), run Federation Promotion Mode: adopt the existing squad into a federation as its first sub-squad, relocating its state intact, before routing."
388
408
  profile:
389
409
  type: string
390
- enum: [default, full, security, design, architecture, azure, product]
410
+ enum: [default, full, security, design, accessibility, architecture, azure, modernization, compliance, operations, product]
391
411
  description: "Optional profile hint forwarded to a sub-squad's Init when it has no squad yet."
412
+ pack:
413
+ type: string
414
+ pattern: "^(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud)(,(power-platform|m365-copilot|aws|foundry|fabric|dotnet|aks|azure-functions|azure-cloud))*$"
415
+ description: "Optional comma-separated add-on pack(s) forwarded to the selected sub-squad's run (power-platform, m365-copilot, aws, foundry, fabric, dotnet, aks, azure-functions, azure-cloud). Ignored on an unattended run."
392
416
  tier:
393
417
  type: string
394
418
  enum: [fast, default]
@@ -396,6 +420,10 @@ tools:
396
420
  owner:
397
421
  type: string
398
422
  description: "Optional Member Name forwarded to the selected sub-squad's run."
423
+ execution:
424
+ type: string
425
+ pattern: "^(original|both|connector:[a-z0-9][a-z0-9-]*)$"
426
+ description: "Optional post-classification connector execution choice (original, connector:<binding-id>, or both), forwarded only to selected child sub-squad runs (binding authority remains member-local). Ignored on an unattended run."
399
427
  mode:
400
428
  type: string
401
429
  enum: [autonomous, autopilot]
@@ -406,8 +434,12 @@ tools:
406
434
  description: "Optional discovery-gate depth, asked once at the federation level and applied per qualifying sub-squad: quick (analyst), standard (designer then analyst), deep (designer, then challenger and experimenter, then analyst), or skip. Each qualifying sub-squad runs its own session and writes its own brief and verdict under its own root. Ignored on an unattended run."
407
435
  routing:
408
436
  type: string
409
- enum: ["off", ranked, manual]
410
- description: "Optional per-role model routing mode (off, ranked, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
437
+ enum: ["off", ranked, economy, manual]
438
+ description: "Optional per-role model routing mode (off, ranked, economy, or manual), forwarded verbatim to every selected sub-squad's coordinator run; each sub-squad persists it in its own team.md and may only narrow it, never widen or substitute it. Ignored on an unattended run."
439
+ depth:
440
+ type: string
441
+ enum: [quick, standard]
442
+ description: "Optional per-turn workflow depth (quick or standard; omission is standard), forwarded to each selected sub-squad with depthSource=federation; a child never widens it. Changes work, not models, and never skips gates. Ignored on an unattended run."
411
443
  context:
412
444
  type: string
413
445
  description: "Optional free-form context to frame the federation turn."