@hve-squad/mcp 0.7.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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +46 -0
  3. package/README.md +233 -0
  4. package/dist/src/auth/entra.js +164 -0
  5. package/dist/src/auth/jose-verifier.js +31 -0
  6. package/dist/src/auth/scopes.js +240 -0
  7. package/dist/src/catalog/catalog.js +80 -0
  8. package/dist/src/config/operator-config.js +281 -0
  9. package/dist/src/engine/advisory-pipeline.js +367 -0
  10. package/dist/src/engine/advisory-run-store.js +31 -0
  11. package/dist/src/engine/artifact-store.js +165 -0
  12. package/dist/src/engine/auto-memory.js +207 -0
  13. package/dist/src/engine/backends/azure-blob-artifact-store.js +246 -0
  14. package/dist/src/engine/backends/azure-openai.js +69 -0
  15. package/dist/src/engine/backends/azure-table-run-state.js +319 -0
  16. package/dist/src/engine/backends/azure-table-squad-memory.js +240 -0
  17. package/dist/src/engine/backends/file-squad-memory.js +208 -0
  18. package/dist/src/engine/backends/graph-squad-memory.js +271 -0
  19. package/dist/src/engine/backends/managed-identity-credential.js +33 -0
  20. package/dist/src/engine/backends/overflow-squad-memory.js +151 -0
  21. package/dist/src/engine/backlog-contract.js +200 -0
  22. package/dist/src/engine/business-tools.js +118 -0
  23. package/dist/src/engine/consumption.js +134 -0
  24. package/dist/src/engine/coordinator-engine.js +1 -0
  25. package/dist/src/engine/council.js +204 -0
  26. package/dist/src/engine/delegated.js +190 -0
  27. package/dist/src/engine/dispatch-loop.js +84 -0
  28. package/dist/src/engine/durable-run-state.js +251 -0
  29. package/dist/src/engine/embedded-prompt.js +35 -0
  30. package/dist/src/engine/embedded-roles.js +133 -0
  31. package/dist/src/engine/embedded.js +1023 -0
  32. package/dist/src/engine/federation.js +96 -0
  33. package/dist/src/engine/field-cipher.js +84 -0
  34. package/dist/src/engine/gates.js +241 -0
  35. package/dist/src/engine/markdown-table.js +43 -0
  36. package/dist/src/engine/model-backend.js +16 -0
  37. package/dist/src/engine/persona-loader.js +132 -0
  38. package/dist/src/engine/persona.js +287 -0
  39. package/dist/src/engine/profiles.js +237 -0
  40. package/dist/src/engine/render/pptx-render-service.js +60 -0
  41. package/dist/src/engine/render/python-pptx-render-backend.js +117 -0
  42. package/dist/src/engine/render/render-backend.js +25 -0
  43. package/dist/src/engine/render-embedded.js +69 -0
  44. package/dist/src/engine/routing.js +275 -0
  45. package/dist/src/engine/run-params.js +70 -0
  46. package/dist/src/engine/run-state.js +132 -0
  47. package/dist/src/engine/run-worker.js +60 -0
  48. package/dist/src/engine/squad-history.js +136 -0
  49. package/dist/src/engine/squad-ledger.js +215 -0
  50. package/dist/src/engine/squad-memory-resources.js +218 -0
  51. package/dist/src/engine/squad-memory-state.js +57 -0
  52. package/dist/src/engine/squad-run-recorder.js +212 -0
  53. package/dist/src/engine/targeted-squad-memory.js +94 -0
  54. package/dist/src/engine/workspace.js +68 -0
  55. package/dist/src/observability/logger.js +75 -0
  56. package/dist/src/observability/redact.js +77 -0
  57. package/dist/src/paths.js +108 -0
  58. package/dist/src/router/router.js +88 -0
  59. package/dist/src/server-http.js +304 -0
  60. package/dist/src/server.js +237 -0
  61. package/dist/src/transports/http-core.js +1240 -0
  62. package/dist/src/transports/http.js +90 -0
  63. package/dist/src/transports/session-store.js +78 -0
  64. package/dist/src/transports/stdio.js +12 -0
  65. package/dist/src/worker-main.js +87 -0
  66. package/generated/copilot-studio-connector/README.md +44 -0
  67. package/generated/copilot-studio-connector/agent-instructions.md +90 -0
  68. package/generated/copilot-studio-connector/apiDefinition.swagger.json +60 -0
  69. package/generated/copilot-studio-connector/apiProperties.json +35 -0
  70. package/generated/copilot-studio-connector/connector.manifest.json +86 -0
  71. package/generated/mcp-tools.schema.json +462 -0
  72. package/package.json +61 -0
  73. package/tools.catalog.yml +397 -0
@@ -0,0 +1,397 @@
1
+ # =============================================================================
2
+ # tools.catalog.yml — the single source of truth for the hve-squad MCP tool
3
+ # surface (Phase 0).
4
+ #
5
+ # This file authors the coarse intent tools the server exposes. Each of the
6
+ # five per-role tools maps 1:1 to a routing-table INTENT row in
7
+ # squad-src/.github/instructions/squad/squad-routing.instructions.md
8
+ # (NOT to one of the ~200 agents); the sixth tool, `squad_federate`, maps to the
9
+ # Squad Federation Coordinator and drives the opt-in federation meta layer
10
+ # (registry + meta-routing) defined in
11
+ # squad-src/.github/instructions/squad/squad-federation.instructions.md.
12
+ # The Squad Coordinator owns routing; these tools are model-invocable shortcuts
13
+ # into the existing routing table.
14
+ #
15
+ # Read-only inputs the generator validates this catalog against (see
16
+ # generators/build-manifests.ts):
17
+ # * squad-routing.instructions.md — the routing intent each tool maps onto.
18
+ # * squad-roster.instructions.md — the role -> agent resolution (cast catalog).
19
+ # * .github/agents/squad/*.agent.md — agent name frontmatter (drift check).
20
+ #
21
+ # Drift contract: the generator FAILS the build (exit non-zero) when a tool's
22
+ # `routingIntent` is not a real routing row or its `role` / `council` member is
23
+ # not an installed agent. tool descriptions are seeded from the matched role's
24
+ # agent persona where possible.
25
+ #
26
+ # Per-tool `input` mirrors the `/squad` prompt arguments
27
+ # (squad-src/.github/prompts/squad/squad.prompt.md):
28
+ # request (required), profile, tier, owner, mode, context, the optional
29
+ # discovery-gate depth on the two catch-all tools, and the optional federation
30
+ # `squad` sub-squad target (plus `init` on squad_federate).
31
+ #
32
+ # Execution model (Phase 0): DELEGATED. The tool returns the Coordinator
33
+ # persona + matched routing + framed request; the calling host (VS Code GitHub
34
+ # Copilot) runs its own runSubagent/task loop to dispatch the cast. The server
35
+ # calls no model.
36
+ # =============================================================================
37
+ schemaVersion: "0.1.0"
38
+
39
+ # Reusable enum values mirroring the /squad prompt argument-hint. Authored here
40
+ # for documentation; each tool restates them inline so every tool input is a
41
+ # complete, self-contained JSON Schema.
42
+ conventions:
43
+ profiles: [default, full, security, design, architecture, azure, product]
44
+ tiers: [fast, default]
45
+ modes: [autonomous, autopilot]
46
+ # Discovery-gate depths, offered only on the attended (delegated) path — the
47
+ # gate interviews a human, so an unattended run ignores the input entirely.
48
+ # See squad-src/.github/instructions/squad/squad-discovery-gate.instructions.md.
49
+ discoveryDepths: [quick, standard, deep, skip]
50
+ stateRoot: ".copilot-tracking/squad/"
51
+ # Federation (opt-in): a repo may host several named sub-squads, each an
52
+ # ordinary squad rooted at the sub-squad root below. The optional `squad`
53
+ # input targets one; `squad_federate` owns the meta layer (registry +
54
+ # meta-routing). See squad-src/.github/instructions/squad/squad-federation.instructions.md.
55
+ subSquadRoot: ".copilot-tracking/squad/members/<name>/"
56
+
57
+ tools:
58
+ - id: squad_research
59
+ title: Squad Research
60
+ # Seeded from the `researcher` role -> Squad Researcher (roster cast catalog).
61
+ description: >-
62
+ Run the squad's research stage on a question or codebase. Routes to the
63
+ Squad Researcher (squad `researcher` role) at the `auto`, parallel-eligible
64
+ tier to investigate, explore, and gather evidence before any plan or
65
+ change. Delegated execution: returns the Squad Coordinator persona, the
66
+ matched routing row, and a framed dispatch request; the calling host runs
67
+ the subagent loop. Use for "research", "investigate", "explore", or
68
+ "find out" requests.
69
+ routingIntent: "research, investigate, explore, find out"
70
+ role: "Squad Researcher"
71
+ tier: auto
72
+ parallelEligible: true
73
+ catchAll: false
74
+ gates: false
75
+ council: []
76
+ input:
77
+ type: object
78
+ additionalProperties: false
79
+ required: [request]
80
+ properties:
81
+ request:
82
+ type: string
83
+ minLength: 1
84
+ description: "The research question or topic for the squad this turn."
85
+ profile:
86
+ type: string
87
+ enum: [default, full, security, design, architecture, azure, product]
88
+ description: "Optional squad profile to seed when the project has no squad yet."
89
+ tier:
90
+ type: string
91
+ enum: [fast, default]
92
+ description: "Optional model-tier hint overriding the coordinator's cost-first default."
93
+ owner:
94
+ type: string
95
+ description: "Optional Member Name from team.md to pick a specific named member."
96
+ mode:
97
+ type: string
98
+ enum: [autonomous, autopilot]
99
+ description: "Optional autonomy mode for the turn (autonomous validator loop or autopilot pipeline)."
100
+ context:
101
+ type: string
102
+ description: "Optional free-form context (files, constraints, prior findings) to frame the request."
103
+ squad:
104
+ type: string
105
+ pattern: "^[a-z0-9][a-z0-9-]*$"
106
+ description: "Optional federation sub-squad to target (state under .copilot-tracking/squad/members/<name>/); omit outside a federation."
107
+
108
+ - id: squad_plan
109
+ title: Squad Plan
110
+ # Seeded from the `lead` role -> Squad Lead (roster cast catalog).
111
+ description: >-
112
+ Run the squad's planning stage. Routes to the Squad Lead (squad `lead`
113
+ role) at the `confirm` tier to break a task down, sequence the work, and
114
+ produce an implementation-ready plan. Planning is non-parallel and lands
115
+ no change without confirmation. Delegated execution: returns the
116
+ Coordinator persona, matched routing, and a framed dispatch request for
117
+ the host to run. Use for "plan", "break down", "sequence", or
118
+ "design plan" requests.
119
+ routingIntent: "plan, break down, sequence, design plan"
120
+ role: "Squad Lead"
121
+ tier: confirm
122
+ parallelEligible: false
123
+ catchAll: false
124
+ gates: false
125
+ council: []
126
+ input:
127
+ type: object
128
+ additionalProperties: false
129
+ required: [request]
130
+ properties:
131
+ request:
132
+ type: string
133
+ minLength: 1
134
+ description: "The work to plan this turn."
135
+ profile:
136
+ type: string
137
+ enum: [default, full, security, design, architecture, azure, product]
138
+ description: "Optional squad profile to seed when the project has no squad yet."
139
+ tier:
140
+ type: string
141
+ enum: [fast, default]
142
+ description: "Optional model-tier hint overriding the coordinator's cost-first default."
143
+ owner:
144
+ type: string
145
+ description: "Optional Member Name from team.md to pick a specific named member."
146
+ mode:
147
+ type: string
148
+ enum: [autonomous, autopilot]
149
+ description: "Optional autonomy mode for the turn."
150
+ context:
151
+ type: string
152
+ description: "Optional free-form context (research artifacts, constraints) to frame the plan."
153
+ squad:
154
+ type: string
155
+ pattern: "^[a-z0-9][a-z0-9-]*$"
156
+ description: "Optional federation sub-squad to target (state under .copilot-tracking/squad/members/<name>/); omit outside a federation."
157
+
158
+ - id: squad_review
159
+ title: Squad Review
160
+ # Seeded from the `tester` role -> Squad Reviewer; council row adds the
161
+ # multi-domain go/no-go reviewers (architect, security, cost, product, rai).
162
+ description: >-
163
+ Run the squad's review stage. Routes to the Squad Reviewer (squad `tester`
164
+ role) at the `auto` tier for quality, correctness, and standards review.
165
+ When the request asks for a pre-implementation go/no-go or crosses two or
166
+ more council domains, it engages the council row (architect, security,
167
+ cost-manager, product-owner, and optionally rai) at the `confirm` tier.
168
+ Delegated execution: returns the Coordinator persona, matched routing, and
169
+ a framed dispatch request. Use for "review", "validate", "check quality",
170
+ "council", or "go/no-go" requests.
171
+ routingIntent: "review, validate, check quality"
172
+ role: "Squad Reviewer"
173
+ tier: auto
174
+ parallelEligible: true
175
+ catchAll: false
176
+ gates: false
177
+ councilIntent: "validate, cross-check, pre-implementation review, council, design review, go/no-go, implement-and-cost, implement-and-risk"
178
+ councilTier: confirm
179
+ # Council members are the dispatchable Primary of each council role. The
180
+ # `product-owner` seat is Functional Planner: HVE Core's own `Backlog
181
+ # Manager` orchestrator is a user-invocable entry point `runSubagent`
182
+ # cannot reach.
183
+ council:
184
+ - "System Architecture Reviewer"
185
+ - "Security Planner"
186
+ - "Squad Cost Manager"
187
+ - "Functional Planner"
188
+ - "RAI Planner"
189
+ input:
190
+ type: object
191
+ additionalProperties: false
192
+ required: [request]
193
+ properties:
194
+ request:
195
+ type: string
196
+ minLength: 1
197
+ description: "What to review, validate, or take to council this turn."
198
+ profile:
199
+ type: string
200
+ enum: [default, full, security, design, architecture, azure, product]
201
+ description: "Optional squad profile to seed when the project has no squad yet."
202
+ tier:
203
+ type: string
204
+ enum: [fast, default]
205
+ description: "Optional model-tier hint overriding the coordinator's cost-first default."
206
+ owner:
207
+ type: string
208
+ description: "Optional Member Name from team.md to pick a specific named member."
209
+ mode:
210
+ type: string
211
+ enum: [autonomous, autopilot]
212
+ description: "Optional autonomy mode for the turn."
213
+ context:
214
+ type: string
215
+ description: "Optional free-form context (the change, plan, or design under review)."
216
+ squad:
217
+ type: string
218
+ pattern: "^[a-z0-9][a-z0-9-]*$"
219
+ description: "Optional federation sub-squad to target (state under .copilot-tracking/squad/members/<name>/); omit outside a federation."
220
+
221
+ - id: squad_architect
222
+ title: Squad Architect
223
+ # Seeded from the `architect` role -> System Architecture Reviewer.
224
+ description: >-
225
+ Run the squad's architecture stage. Routes to the System Architecture
226
+ Reviewer (squad `architect` role) at the `auto`, parallel-eligible tier to
227
+ review system design, component boundaries, and design tradeoffs (the
228
+ Squad Azure Architect authors Azure HLD/LLD as the alternate). Delegated
229
+ execution: returns the Coordinator persona, matched routing, and a framed
230
+ dispatch request. Use for "architecture", "system design", or
231
+ "components" requests.
232
+ routingIntent: "architecture, system design, components"
233
+ role: "System Architecture Reviewer"
234
+ tier: auto
235
+ parallelEligible: true
236
+ catchAll: false
237
+ gates: false
238
+ council: []
239
+ input:
240
+ type: object
241
+ additionalProperties: false
242
+ required: [request]
243
+ properties:
244
+ request:
245
+ type: string
246
+ minLength: 1
247
+ description: "The architecture or system-design question this turn."
248
+ profile:
249
+ type: string
250
+ enum: [default, full, security, design, architecture, azure, product]
251
+ description: "Optional squad profile to seed when the project has no squad yet."
252
+ tier:
253
+ type: string
254
+ enum: [fast, default]
255
+ description: "Optional model-tier hint overriding the coordinator's cost-first default."
256
+ owner:
257
+ type: string
258
+ description: "Optional Member Name from team.md to pick a specific named member."
259
+ mode:
260
+ type: string
261
+ enum: [autonomous, autopilot]
262
+ description: "Optional autonomy mode for the turn."
263
+ context:
264
+ type: string
265
+ description: "Optional free-form context (existing design, constraints, IaC) to frame the review."
266
+ squad:
267
+ type: string
268
+ pattern: "^[a-z0-9][a-z0-9-]*$"
269
+ description: "Optional federation sub-squad to target (state under .copilot-tracking/squad/members/<name>/); omit outside a federation."
270
+
271
+ - id: squad_run
272
+ title: Squad Run
273
+ # Seeded from the Squad Coordinator agent frontmatter (the orchestrator
274
+ # itself). catch-all: full classify-and-dispatch pipeline.
275
+ description: >-
276
+ Run the full squad pipeline for any request. Hands the request to the
277
+ Squad Coordinator, which classifies it against the routing table and
278
+ dispatches the matched roles through Research -> Plan -> Implement ->
279
+ Review, carrying the council Implementation Gate, the autopilot/autonomous
280
+ Human Gates, and the notification approval contract unchanged. This is the
281
+ catch-all entry point and runs at the `confirm` tier with gates. Set
282
+ `mode=autonomous` for the bounded validator loop or `mode=autopilot` for
283
+ the full gated pipeline. Delegated execution: returns the Coordinator
284
+ persona, matched routing, and a framed dispatch request for the host to
285
+ drive. Use when no narrower squad_* tool fits, or for end-to-end work.
286
+ routingIntent: "*"
287
+ role: "Squad Coordinator"
288
+ tier: confirm
289
+ parallelEligible: false
290
+ catchAll: true
291
+ gates: true
292
+ council: []
293
+ input:
294
+ type: object
295
+ additionalProperties: false
296
+ required: [request]
297
+ properties:
298
+ request:
299
+ type: string
300
+ minLength: 1
301
+ description: "The work for the squad this turn (any intent; the Coordinator classifies it)."
302
+ profile:
303
+ type: string
304
+ enum: [default, full, security, design, architecture, azure, product]
305
+ description: "Optional squad profile to seed when the project has no squad yet."
306
+ tier:
307
+ type: string
308
+ enum: [fast, default]
309
+ description: "Optional model-tier hint overriding the coordinator's cost-first default."
310
+ owner:
311
+ type: string
312
+ description: "Optional Member Name from team.md to pick a specific named member."
313
+ mode:
314
+ type: string
315
+ enum: [autonomous, autopilot]
316
+ description: "Optional autonomy mode: autonomous (bounded validator loop) or autopilot (full gated pipeline)."
317
+ discovery:
318
+ type: string
319
+ enum: [quick, standard, deep, skip]
320
+ 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."
321
+ context:
322
+ type: string
323
+ description: "Optional free-form context to frame the pipeline."
324
+ squad:
325
+ type: string
326
+ pattern: "^[a-z0-9][a-z0-9-]*$"
327
+ description: "Optional federation sub-squad to target (state under .copilot-tracking/squad/members/<name>/); omit outside a federation."
328
+
329
+ - id: squad_federate
330
+ title: Squad Federate
331
+ # Seeded from the Squad Federation Coordinator agent frontmatter (the meta
332
+ # orchestrator). catch-all: routes across named sub-squads via meta-routing.
333
+ description: >-
334
+ Run the squad **federation** meta layer for a repository that hosts several
335
+ named sub-squads (for example a `product` sub-squad for the business team
336
+ and an `azure` sub-squad for the architects). Hands the request to the
337
+ Squad Federation Coordinator, which reads the federation registry
338
+ (`federation.md`) and meta-routing (`meta-routing.md`), selects the target
339
+ sub-squad(s) — or honors an explicit `squad=<name>` — and runs each
340
+ sub-squad's normal per-turn protocol scoped to
341
+ `.copilot-tracking/squad/members/<name>/`. Set `init` to build a federation
342
+ (propose → confirm → create) on a fresh project, or `promote` to adopt an
343
+ existing single squad (a top-level `team.md`) into a federation as its first
344
+ sub-squad, relocating its state intact. This is the catch-all
345
+ federation entry point and runs at the `confirm` tier with gates.
346
+ Delegated execution: returns the Federation Coordinator persona, the
347
+ federation routing decision, and a framed dispatch request for the host to
348
+ drive. Use for cross-sub-squad requests, an explicit sub-squad target, or
349
+ federation setup.
350
+ routingIntent: "*"
351
+ role: "Squad Federation Coordinator"
352
+ tier: confirm
353
+ parallelEligible: false
354
+ catchAll: true
355
+ gates: true
356
+ council: []
357
+ input:
358
+ type: object
359
+ additionalProperties: false
360
+ required: [request]
361
+ properties:
362
+ request:
363
+ type: string
364
+ minLength: 1
365
+ description: "The work for the federation this turn (routed to one or more sub-squads)."
366
+ squad:
367
+ type: string
368
+ pattern: "^[a-z0-9][a-z0-9-]*$"
369
+ description: "Optional sub-squad name to target directly, overriding meta-routing."
370
+ init:
371
+ type: boolean
372
+ description: "When true, run Federation Init Mode (propose → confirm → create) on a fresh project, or Federation Expansion Mode (add a new sub-squad and register it) when a federation already exists, before routing."
373
+ promote:
374
+ type: boolean
375
+ 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."
376
+ profile:
377
+ type: string
378
+ enum: [default, full, security, design, architecture, azure, product]
379
+ description: "Optional profile hint forwarded to a sub-squad's Init when it has no squad yet."
380
+ tier:
381
+ type: string
382
+ enum: [fast, default]
383
+ description: "Optional model-tier hint forwarded to the selected sub-squad's run."
384
+ owner:
385
+ type: string
386
+ description: "Optional Member Name forwarded to the selected sub-squad's run."
387
+ mode:
388
+ type: string
389
+ enum: [autonomous, autopilot]
390
+ description: "Optional autonomy mode. With a single sub-squad target it is forwarded to that sub-squad's run; with mode=autopilot and no squad= target the Federation Coordinator runs the federation-level autopilot meta-pipeline (ordered sub-squad autopilot runs, aggregated federation gates, one consolidated final-outcome validation)."
391
+ discovery:
392
+ type: string
393
+ enum: [quick, standard, deep, skip]
394
+ 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."
395
+ context:
396
+ type: string
397
+ description: "Optional free-form context to frame the federation turn."