@amerged/ohmyhost-mcp 0.1.31 → 0.1.33

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.
@@ -1,3 +1,5 @@
1
+ import { frameworkConversionDetail } from "./framework-admission.js";
2
+
1
3
  const failures = {
2
4
  authorization_changed: [
3
5
  "Authorization changed before this operation could finish.",
@@ -114,7 +116,7 @@ const failures = {
114
116
  ],
115
117
  auto_deploy_plan_rejected: [
116
118
  "The GitHub push could not be planned for deployment.",
117
- "Read project status and the operation's error or deployment diagnostics. Correct the source or configuration named there, push the new commit and plan it before deploying. Replaying this failed operation cannot start a build.",
119
+ "Read error.detail: it names the file, the rule and the required change. Make that change, commit and push it; the next push is planned again. Without error.detail, plan the pushed commit explicitly with 'ohmyhost plan --project ULID --commit SHA --json' or MCP deployment_plan to read the reason. Replaying this failed operation cannot start a build.",
118
120
  ],
119
121
  promotion_source_stale: [
120
122
  "The Dev deployment changed before promotion could start.",
@@ -131,6 +133,8 @@ export interface PublicOperationFailure {
131
133
  readonly message: string;
132
134
  readonly retryable: false;
133
135
  readonly suggested_action: string;
136
+ /** The catalog sentence naming the refused file and its fix, only for an auto-deploy rejection. */
137
+ readonly detail?: string;
134
138
  }
135
139
 
136
140
  export interface OperationReconciliationObservation {
@@ -167,12 +171,26 @@ export function publicOperationReconciliation(
167
171
  });
168
172
  }
169
173
 
170
- /** Render only reviewed text; never return the internal/provider error message. */
171
- export function publicOperationFailure(internalCode: string): PublicOperationFailure {
174
+ /**
175
+ * Render only reviewed text; never return the internal/provider error message. A stored framework
176
+ * conversion diagnostic of an auto-deploy rejection is re-rendered from the catalog as `detail`.
177
+ */
178
+ export function publicOperationFailure(
179
+ internalCode: string,
180
+ diagnostic?: unknown,
181
+ ): PublicOperationFailure {
172
182
  const normalized = internalCode.toLowerCase();
173
183
  const code = Object.hasOwn(failures, normalized)
174
184
  ? (normalized as keyof typeof failures)
175
185
  : "operation_failed";
176
186
  const [message, suggested_action] = failures[code];
177
- return Object.freeze({ code, message, retryable: false, suggested_action });
187
+ const detail =
188
+ code === "auto_deploy_plan_rejected" ? frameworkConversionDetail(diagnostic) : null;
189
+ return Object.freeze({
190
+ code,
191
+ message,
192
+ retryable: false,
193
+ suggested_action,
194
+ ...(detail === null ? {} : { detail }),
195
+ });
178
196
  }
@@ -350,10 +350,10 @@ export const PROBLEM_POLICY = {
350
350
  status: 409,
351
351
  retryable: false,
352
352
  action:
353
- "Read detail for the file, reason and required change. Run ohmyhost init --dry-run --json at that commit, apply its blockers and the matching ohmyho.st framework Skill, then save or push the corrected version. Plan its commit; repeating the unchanged source cannot fix an admission error.",
353
+ "Read detail: a catalog sentence names the file, the rule and the required change. Apply it, save or push the corrected version and plan its commit. If detail names no file, run 'ohmyhost init --dry-run --json' at that commit and apply its blockers and the matching ohmyho.st framework Skill; init lists the install, build and server-only checks it cannot run locally under pending. Repeating the unchanged source cannot fix an admission error.",
354
354
  title: "Framework conversion required",
355
355
  restAction:
356
- "Read detail for the file, reason and required change. Run ohmyhost init --dry-run --json at that commit, apply its blockers and the matching ohmyho.st framework Skill, then save or push the corrected version. Plan its commit; repeating the unchanged source cannot fix an admission error.",
356
+ "Read detail: a catalog sentence names the file, the rule and the required change. Apply it, save or push the corrected version and plan its commit. If detail names no file, run 'ohmyhost init --dry-run --json' at that commit and apply its blockers and the matching ohmyho.st framework Skill; init lists the install, build and server-only checks it cannot run locally under pending. Repeating the unchanged source cannot fix an admission error.",
357
357
  },
358
358
  repository_configuration_missing: {
359
359
  status: 409,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohmyhost/sdk-ts",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -3290,7 +3290,7 @@ export const applyPaidProjectDomain = <ThrowOnError extends boolean = true>(
3290
3290
  /**
3291
3291
  * Plan a deployment
3292
3292
  *
3293
- * Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority.
3293
+ * Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority. A commit the platform does not admit answers 409 with a nonretryable problem code; for framework_conversion_required, detail is a fixed catalog sentence that names the file, the rule and the required change whenever the refusal is typed.
3294
3294
  */
3295
3295
  export const planDeployment = <ThrowOnError extends boolean = true>(
3296
3296
  parameters: {
@@ -1485,6 +1485,10 @@ export type OperationFailure = {
1485
1485
  */
1486
1486
  retryable: false;
1487
1487
  suggested_action: string;
1488
+ /**
1489
+ * Present only on auto_deploy_plan_rejected when planning the pushed commit returned a typed refusal. It is the same fixed catalog sentence that the planning 409 problem returns as detail, naming the file, the rule and the required change.
1490
+ */
1491
+ detail?: string;
1488
1492
  };
1489
1493
 
1490
1494
  export type AuditEvent = {
@@ -5839,6 +5843,10 @@ export type PlanDeploymentErrors = {
5839
5843
  * The resource does not exist or is not visible to the authenticated principal.
5840
5844
  */
5841
5845
  404: ProblemDetails;
5846
+ /**
5847
+ * The request failed.
5848
+ */
5849
+ 409: ProblemDetails;
5842
5850
  /**
5843
5851
  * The request failed.
5844
5852
  */