@stackwright-pro/mcp 0.2.0-alpha.115 → 0.2.0-alpha.118

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/dist/server.mjs CHANGED
@@ -1290,7 +1290,7 @@ function answersToManifestFormat(answers, questions) {
1290
1290
  return qHeader.startsWith(headerLower.split("-")[0]);
1291
1291
  });
1292
1292
  if (matched) {
1293
- result[matched.id] = answer.selected_options[0] || "";
1293
+ result[matched.id] = answer.selected_options.length > 1 ? answer.selected_options : answer.selected_options[0] || "";
1294
1294
  }
1295
1295
  continue;
1296
1296
  }
@@ -1762,7 +1762,10 @@ function handleSavePhaseAnswers(input) {
1762
1762
  }
1763
1763
  } else {
1764
1764
  answers = Object.fromEntries(
1765
- input.rawAnswers.map((a) => [a.question_header, a.selected_options[0] ?? ""])
1765
+ input.rawAnswers.map((a) => [
1766
+ a.question_header,
1767
+ a.selected_options.length > 1 ? a.selected_options : a.selected_options[0] ?? ""
1768
+ ])
1766
1769
  );
1767
1770
  }
1768
1771
  const payload = {
@@ -4352,6 +4355,12 @@ function handleWritePhaseQuestions(input) {
4352
4355
  isError: true
4353
4356
  };
4354
4357
  }
4358
+ if (AUTO_EXECUTE_PHASES.has(phase)) {
4359
+ return {
4360
+ text: JSON.stringify({ success: true, phase, questionCount: 0, autoExecute: true }),
4361
+ isError: false
4362
+ };
4363
+ }
4355
4364
  try {
4356
4365
  const questions = parseLLMQuestionsResponse(responseText);
4357
4366
  let requiredPackages = {
@@ -7134,7 +7143,7 @@ var _checksums = /* @__PURE__ */ new Map([
7134
7143
  ],
7135
7144
  [
7136
7145
  "stackwright-pro-form-wizard-otter.json",
7137
- "941bb11b767530460f96fdd08af638b3ede9f7a1ae6f19de04b7d81c95cc62ad"
7146
+ "7d958f2873cb80955ba5453837b67bee427f8399868979f59fecebe380a35ab9"
7138
7147
  ],
7139
7148
  [
7140
7149
  "stackwright-pro-geo-otter.json",
@@ -8373,10 +8382,20 @@ var WriteWorkflowContainerPageInputSchema = z21.object({
8373
8382
  * Union of required roles across all steps in the workflow YAML.
8374
8383
  * Consumed by auth-reconcile to build protectedRoutes.
8375
8384
  * Must be non-empty — workflow pages are always auth-protected.
8385
+ *
8386
+ * ⚠️ MUST be a JSON array of strings: ["ROLE_A", "ROLE_B"].
8387
+ * Do NOT pass a YAML bracket string "[ROLE_A, ROLE_B]",
8388
+ * a JSON-encoded string "[\"ROLE_A\", \"ROLE_B\"]",
8389
+ * or a comma-separated string "ROLE_A,ROLE_B" — all are rejected.
8390
+ *
8391
+ * Regression guard (swp-zfa9): 3-of-4 workflow-otter fan-outs crashed on
8392
+ * runs 12-15 because the LLM passed a JSON-encoded string instead of an array.
8376
8393
  */
8377
8394
  requiredRoles: z21.array(z21.string().min(1)).min(1, {
8378
- message: "requiredRoles must have at least one role \u2014 workflow pages are always auth-protected"
8379
- }),
8395
+ message: 'requiredRoles must have at least one role \u2014 workflow pages are always auth-protected. Pass a JSON array: ["ROLE_A", "ROLE_B"] \u2014 NOT a string or CSV.'
8396
+ }).describe(
8397
+ 'JSON array of role strings. Example: ["ESF8_COORDINATOR", "HOSPITAL_EM"]. Must be a real JSON array \u2014 NOT a stringified array, YAML bracket sequence, or CSV string.'
8398
+ ),
8380
8399
  /**
8381
8400
  * Persistence key for workflow state (localStorage slot).
8382
8401
  * Defaults to `workflow-<workflowId>` when omitted.
@@ -8470,7 +8489,11 @@ function registerWriteWorkflowContainerPageTool(server2) {
8470
8489
  " - meta.authRequired: true, meta.requiredRoles: <your input>",
8471
8490
  " - One workflow_wizard content item binding workflowFile + workflowId",
8472
8491
  "",
8473
- "requiredRoles: supply the UNION of required roles from all steps in your workflow YAML.",
8492
+ "requiredRoles: MUST be a JSON array of strings (the union of all step auth.required_roles).",
8493
+ ' CORRECT: ["ESF8_COORDINATOR", "HOSPITAL_EM", "EMS_DISPATCHER"]',
8494
+ ' WRONG: "[\\"ESF8_COORDINATOR\\", \\"HOSPITAL_EM\\"]" (string containing JSON)',
8495
+ ' WRONG: "ESF8_COORDINATOR,HOSPITAL_EM" (comma-separated string)',
8496
+ ' WRONG: "[ESF8_COORDINATOR, HOSPITAL_EM]" (YAML bracket notation)',
8474
8497
  'pageSlug: convention is "workflows/<workflowId>" \u2014 must start with "workflows/".'
8475
8498
  ].join("\n"),
8476
8499
  WriteWorkflowContainerPageInputSchema.shape,
@@ -9618,7 +9641,7 @@ var package_default = {
9618
9641
  "@stackwright-pro/pulse": "workspace:*",
9619
9642
  "@stackwright-pro/telemetry": "workspace:*",
9620
9643
  "@stackwright-pro/types": "workspace:*",
9621
- "@stackwright/mcp": "0.6.0-alpha.2",
9644
+ "@stackwright/mcp": "0.6.0-alpha.5",
9622
9645
  "@types/js-yaml": "^4.0.9",
9623
9646
  "js-yaml": "^4.2.0",
9624
9647
  "proper-lockfile": "^4.1.2",
@@ -9640,7 +9663,7 @@ var package_default = {
9640
9663
  "test:coverage": "vitest run --coverage"
9641
9664
  },
9642
9665
  name: "@stackwright-pro/mcp",
9643
- version: "0.2.0-alpha.115",
9666
+ version: "0.2.0-alpha.118",
9644
9667
  description: "MCP tools for Stackwright Pro - Data Explorer, Security, ISR, and Dashboard generation",
9645
9668
  license: "SEE LICENSE IN LICENSE",
9646
9669
  main: "./dist/server.js",