@amerged/ohmyhost-mcp 0.1.31 → 0.1.32

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.
@@ -7,7 +7,10 @@ import {
7
7
  parseProjectDataChangePlan as readProjectDataChangePlan,
8
8
  type ProjectDataChangePlan,
9
9
  } from "@ohmyhost/contracts/project-data-changes";
10
- import { parseFrameworkConversionDetail } from "@ohmyhost/contracts/framework-admission";
10
+ import {
11
+ frameworkConversionDiagnosticFromDetail,
12
+ parseFrameworkConversionDetail,
13
+ } from "@ohmyhost/contracts/framework-admission";
11
14
  import {
12
15
  parseOperationDeploymentProgress,
13
16
  type OperationDeploymentProgress,
@@ -1459,17 +1462,27 @@ export const parseOperation = (value: unknown): PublicOperation => {
1459
1462
  };
1460
1463
  };
1461
1464
 
1465
+ /**
1466
+ * The client's own catalog copy of an operation failure. Only a rejected GitHub push carries a
1467
+ * detail, and only an exact catalog sentence naming the refused file; it is rendered again here.
1468
+ */
1462
1469
  function parseOperationFailure(value: unknown): PublicOperationFailure {
1463
- const input = exactRecord(value, ["code", "message", "retryable", "suggested_action"]);
1470
+ const input = exactRecord(value, ["code", "message", "retryable", "suggested_action", "detail"]);
1471
+ const detail = input["detail"];
1472
+ const diagnostic =
1473
+ detail === undefined || input["code"] !== "auto_deploy_plan_rejected"
1474
+ ? null
1475
+ : frameworkConversionDiagnosticFromDetail(detail);
1464
1476
  if (
1465
1477
  typeof input["code"] !== "string" ||
1466
1478
  !boundedString(input["message"], 1, 512) ||
1467
1479
  input["retryable"] !== false ||
1468
- !boundedString(input["suggested_action"], 1, 500)
1480
+ !boundedString(input["suggested_action"], 1, 500) ||
1481
+ (detail !== undefined && diagnostic === null)
1469
1482
  )
1470
1483
  throw new ResponseContractError();
1471
- const safe = publicOperationFailure(input["code"]);
1472
- if (safe.code !== input["code"]) throw new ResponseContractError();
1484
+ const safe = publicOperationFailure(input["code"], diagnostic);
1485
+ if (safe.code !== input["code"] || safe.detail !== detail) throw new ResponseContractError();
1473
1486
  return safe;
1474
1487
  }
1475
1488