@loopops/mcp-server 3.34.0 → 3.35.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.
@@ -137,7 +137,23 @@ export function registerConfigTools(server, allowed) {
137
137
  })));
138
138
  }
139
139
  if (allowed.has("promote_scenario")) {
140
- server.tool("promote_scenario", "Promote a scenario to active by editing `active_scenario` in config/design/capacity_config.yaml. Fails hard if the scenario doesn't resolve (missing or dangling components) — won't promote a broken plan. Dry-run by default — returns the diff; pass dryRun:false to commit the change.", {
140
+ server.tool("promote_scenario", [
141
+ "Promote a scenario to active by editing `active_scenario` in",
142
+ "config/design/capacity_config.yaml. Fails hard if the scenario",
143
+ "doesn't resolve (missing or dangling components) — won't promote",
144
+ "a broken plan. Dry-run by default — returns the diff; pass",
145
+ "dryRun:false to commit.",
146
+ "Open-cycle conflict: when the org has an open planning cycle",
147
+ "bound to a different scenario, promote refuses by default — the",
148
+ "cycle's scenarioId needs to move with the active scenario or",
149
+ "commit_cycle promotes the wrong scenario at cutover. Re-run with",
150
+ "rebindOpenCycle:true to apply the rebind atomically — the open",
151
+ "cycle's scenarioId moves, every non-superseded proposal across",
152
+ "all three phases is superseded (re-run propose after rebind),",
153
+ "and the planning scope snapshot is cleared (re-run",
154
+ "snapshot_planning_scope). A cycle-level audit row of",
155
+ "action='rebind_scenario' captures the impact counts.",
156
+ ].join(" "), {
141
157
  scenarioId: z
142
158
  .string()
143
159
  .describe("Scenario id to promote (e.g. 'stretch'). Must exist in config/design/scenarios/ and be complete."),
@@ -145,11 +161,20 @@ export function registerConfigTools(server, allowed) {
145
161
  .boolean()
146
162
  .default(true)
147
163
  .describe("When true (default), return the diff without writing. Pass dryRun:false to commit."),
164
+ rebindOpenCycle: z
165
+ .boolean()
166
+ .default(false)
167
+ .describe("Required acknowledgement when an open cycle is bound to a different scenario. Default false → refuse with structured impact counts. Pass true to apply the rebind: update planning_cycle.scenarioId, supersede every non-superseded user / quota / account proposal in the cycle, delete planning_cycle_account_scope rows, then flip active_scenario in capacity_config.yaml. Atomic; audited as action='rebind_scenario'."),
148
168
  branch: z
149
169
  .string()
150
170
  .optional()
151
171
  .describe("Git branch to read from and write back to. Default: main. Writing to main = live promotion."),
152
- }, safeTool(async ({ scenarioId, dryRun, branch }) => trpcMutation("mcp.promoteScenario", { scenarioId, dryRun, branch })));
172
+ }, safeTool(async ({ scenarioId, dryRun, rebindOpenCycle, branch }) => trpcMutation("mcp.promoteScenario", {
173
+ scenarioId,
174
+ dryRun,
175
+ rebindOpenCycle,
176
+ branch,
177
+ })));
153
178
  }
154
179
  if (allowed.has("gap_analysis")) {
155
180
  server.tool("gap_analysis", "Use a Claude agent to find the smallest change set that closes a scenario's capacity gap on the target measure. The agent iterates simulate_capacity calls (mutating roster + target_productivity in memory, calling the existing /capacity endpoint) up to a budget cap, then submits a structured proposal. Output is exploratory by default — pass `writeFile: true` to materialize the proposal as a draft scenario at `config/design/scenarios/proposed-gap-{measure}-{ts}.yaml`, then use `compare_scenarios` to verify and `promote_scenario` to make it active.", {
@@ -596,17 +596,16 @@ export function registerDeployTools(server, allowed) {
596
596
  }
597
597
  if (allowed.has("commit_cycle")) {
598
598
  server.tool("commit_cycle", [
599
- "Ops only. Phase 4.3 atomic cutover for directory-shape",
600
- "scenarios. Reads all approved rows across user / quota /",
601
- "account placement tables, promotes scenario inputs (territories,",
602
- "hierarchy, composition, account_placement) to canonical",
603
- "config/deploy/, writes assignments.yaml + quotas.yaml outputs,",
604
- "updates account.territory_slug for committed account placements,",
599
+ "Ops only. Atomic cutover for a planning cycle. Reads all",
600
+ "approved rows across user / quota / account placement tables,",
601
+ "promotes scenario inputs (territories, hierarchy, composition,",
602
+ "account_placement) to canonical config/deploy/, writes",
603
+ "assignments.yaml + quotas.yaml outputs, propagates",
604
+ "rep_input_override rows to the scenario roster, updates",
605
+ "account.territory_slug for committed account placements,",
605
606
  "transitions all rows to 'committed', closes the cycle. ONE",
606
607
  "GitHub commit + ONE DB transaction — either everything lands",
607
- "or nothing does. Force two-step (default dryRun:true). Refuses",
608
- "on legacy single-file scenarios; per-phase commits still work",
609
- "for those.",
608
+ "or nothing does. Force two-step (default dryRun:true).",
610
609
  ].join(" "), {
611
610
  planningCycleId: z.string().uuid().optional().describe("Planning cycle. Defaults to the org's currently-open cycle."),
612
611
  dryRun: z.boolean().optional().describe("Default true. Pass false to perform the atomic commit."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopops/mcp-server",
3
- "version": "3.34.0",
3
+ "version": "3.35.0",
4
4
  "description": "Loop Operations MCP Server — AI skills for RevOps",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",