@percher/core 1.7.0 → 2.0.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 (143) hide show
  1. package/dist/commands/claim.d.ts.map +1 -1
  2. package/dist/commands/claim.js +5 -8
  3. package/dist/commands/claim.js.map +1 -1
  4. package/dist/commands/diagnose.d.ts +7 -6
  5. package/dist/commands/diagnose.d.ts.map +1 -1
  6. package/dist/commands/diagnose.js +5 -4
  7. package/dist/commands/diagnose.js.map +1 -1
  8. package/dist/commands/doctor-access.d.ts +4 -0
  9. package/dist/commands/doctor-access.d.ts.map +1 -0
  10. package/dist/commands/doctor-access.js +32 -0
  11. package/dist/commands/doctor-access.js.map +1 -0
  12. package/dist/commands/doctor-build.d.ts +60 -0
  13. package/dist/commands/doctor-build.d.ts.map +1 -0
  14. package/dist/commands/doctor-build.js +470 -0
  15. package/dist/commands/doctor-build.js.map +1 -0
  16. package/dist/commands/doctor-evidence.d.ts +67 -0
  17. package/dist/commands/doctor-evidence.d.ts.map +1 -0
  18. package/dist/commands/doctor-evidence.js +102 -0
  19. package/dist/commands/doctor-evidence.js.map +1 -0
  20. package/dist/commands/doctor-observations.d.ts +19 -0
  21. package/dist/commands/doctor-observations.d.ts.map +1 -0
  22. package/dist/commands/doctor-observations.js +166 -0
  23. package/dist/commands/doctor-observations.js.map +1 -0
  24. package/dist/commands/doctor-route.d.ts +10 -0
  25. package/dist/commands/doctor-route.d.ts.map +1 -0
  26. package/dist/commands/doctor-route.js +104 -0
  27. package/dist/commands/doctor-route.js.map +1 -0
  28. package/dist/commands/doctor-runtime.d.ts +41 -0
  29. package/dist/commands/doctor-runtime.d.ts.map +1 -0
  30. package/dist/commands/doctor-runtime.js +276 -0
  31. package/dist/commands/doctor-runtime.js.map +1 -0
  32. package/dist/commands/doctor-state.d.ts +36 -0
  33. package/dist/commands/doctor-state.d.ts.map +1 -0
  34. package/dist/commands/doctor-state.js +671 -0
  35. package/dist/commands/doctor-state.js.map +1 -0
  36. package/dist/commands/doctor.d.ts +98 -13
  37. package/dist/commands/doctor.d.ts.map +1 -1
  38. package/dist/commands/doctor.js +217 -374
  39. package/dist/commands/doctor.js.map +1 -1
  40. package/dist/commands/env-scan.d.ts +1 -1
  41. package/dist/commands/env-scan.js +2 -2
  42. package/dist/commands/env-scan.js.map +1 -1
  43. package/dist/commands/preview-branch.d.ts +2 -0
  44. package/dist/commands/preview-branch.d.ts.map +1 -1
  45. package/dist/commands/preview-branch.js +1 -0
  46. package/dist/commands/preview-branch.js.map +1 -1
  47. package/dist/commands/publish-anonymous.d.ts +3 -0
  48. package/dist/commands/publish-anonymous.d.ts.map +1 -1
  49. package/dist/commands/publish-anonymous.js +6 -3
  50. package/dist/commands/publish-anonymous.js.map +1 -1
  51. package/dist/commands/publish-api-error.d.ts.map +1 -1
  52. package/dist/commands/publish-api-error.js +4 -1
  53. package/dist/commands/publish-api-error.js.map +1 -1
  54. package/dist/commands/publish-failure.d.ts +17 -0
  55. package/dist/commands/publish-failure.d.ts.map +1 -1
  56. package/dist/commands/publish-failure.js +30 -8
  57. package/dist/commands/publish-failure.js.map +1 -1
  58. package/dist/commands/publish-needs-login.d.ts +2 -2
  59. package/dist/commands/publish-needs-login.d.ts.map +1 -1
  60. package/dist/commands/publish-needs-login.js +4 -15
  61. package/dist/commands/publish-needs-login.js.map +1 -1
  62. package/dist/commands/publish.d.ts.map +1 -1
  63. package/dist/commands/publish.js +22 -20
  64. package/dist/commands/publish.js.map +1 -1
  65. package/dist/commands/restore.d.ts.map +1 -1
  66. package/dist/commands/restore.js +29 -2
  67. package/dist/commands/restore.js.map +1 -1
  68. package/dist/commands/wait-deploy.d.ts +1 -1
  69. package/dist/commands/wait-deploy.d.ts.map +1 -1
  70. package/dist/doctor.d.ts +2 -0
  71. package/dist/doctor.d.ts.map +1 -0
  72. package/dist/doctor.js +2 -0
  73. package/dist/doctor.js.map +1 -0
  74. package/dist/error-classifier.d.ts +1 -1
  75. package/dist/error-classifier.d.ts.map +1 -1
  76. package/dist/error-classifier.js +15 -15
  77. package/dist/error-classifier.js.map +1 -1
  78. package/dist/index.d.ts +3 -6
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +3 -6
  81. package/dist/index.js.map +1 -1
  82. package/dist/log-excerpt.d.ts +12 -0
  83. package/dist/log-excerpt.d.ts.map +1 -0
  84. package/dist/log-excerpt.js +88 -0
  85. package/dist/log-excerpt.js.map +1 -0
  86. package/dist/network-budget-recovery.d.ts +16 -0
  87. package/dist/network-budget-recovery.d.ts.map +1 -0
  88. package/dist/network-budget-recovery.js +32 -0
  89. package/dist/network-budget-recovery.js.map +1 -0
  90. package/dist/plans.d.ts +35 -0
  91. package/dist/plans.d.ts.map +1 -1
  92. package/dist/plans.js +20 -0
  93. package/dist/plans.js.map +1 -1
  94. package/dist/recovery.d.ts +9 -1
  95. package/dist/recovery.d.ts.map +1 -1
  96. package/dist/recovery.js +39 -15
  97. package/dist/recovery.js.map +1 -1
  98. package/dist/security-deployment-failure.d.ts.map +1 -1
  99. package/dist/security-deployment-failure.js +2 -1
  100. package/dist/security-deployment-failure.js.map +1 -1
  101. package/dist/static-docker.d.ts +1 -1
  102. package/dist/static-docker.js +3 -3
  103. package/dist/structured-error-codes.d.ts +6 -1
  104. package/dist/structured-error-codes.d.ts.map +1 -1
  105. package/dist/structured-error-codes.js +51 -0
  106. package/dist/structured-error-codes.js.map +1 -1
  107. package/dist/templates/ai-files/claude-md.d.ts.map +1 -1
  108. package/dist/templates/ai-files/claude-md.js +8 -1
  109. package/dist/templates/ai-files/claude-md.js.map +1 -1
  110. package/dist/templates/ai-files/cursor-percher-mdc.d.ts.map +1 -1
  111. package/dist/templates/ai-files/cursor-percher-mdc.js +5 -1
  112. package/dist/templates/ai-files/cursor-percher-mdc.js.map +1 -1
  113. package/dist/validation/blocked-names.d.ts +2 -0
  114. package/dist/validation/blocked-names.d.ts.map +1 -1
  115. package/dist/validation/blocked-names.js +30 -1
  116. package/dist/validation/blocked-names.js.map +1 -1
  117. package/package.json +10 -5
  118. package/templates/astro/Dockerfile +2 -2
  119. package/templates/capsule/Dockerfile +2 -5
  120. package/templates/eleventy/Dockerfile +2 -2
  121. package/templates/hugo/Dockerfile +2 -2
  122. package/templates/preact/Dockerfile +2 -2
  123. package/templates/solid/Dockerfile +2 -2
  124. package/templates/vite-react/Dockerfile +2 -2
  125. package/templates/vite-vue/Dockerfile +2 -2
  126. package/dist/commands/admin-legacy-audit.d.ts +0 -40
  127. package/dist/commands/admin-legacy-audit.d.ts.map +0 -1
  128. package/dist/commands/admin-legacy-audit.js +0 -57
  129. package/dist/commands/admin-legacy-audit.js.map +0 -1
  130. package/dist/commands/admin-legacy-inventory.d.ts +0 -27
  131. package/dist/commands/admin-legacy-inventory.d.ts.map +0 -1
  132. package/dist/commands/admin-legacy-inventory.js +0 -37
  133. package/dist/commands/admin-legacy-inventory.js.map +0 -1
  134. package/dist/commands/admin-migrate-networks.d.ts +0 -15
  135. package/dist/commands/admin-migrate-networks.d.ts.map +0 -1
  136. package/dist/commands/admin-migrate-networks.js +0 -15
  137. package/dist/commands/admin-migrate-networks.js.map +0 -1
  138. package/dist/commands/admin-reconcile-routes.d.ts +0 -18
  139. package/dist/commands/admin-reconcile-routes.d.ts.map +0 -1
  140. package/dist/commands/admin-reconcile-routes.js +0 -22
  141. package/dist/commands/admin-reconcile-routes.js.map +0 -1
  142. package/templates/capsule/src/lib/ai-client.ts +0 -193
  143. package/templates/capsule/src/lib/ai.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,gBAAgB;;;iBAS3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,MAAM,MAAM,WAAW,GACnB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,GAAE,UAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAoCtF"}
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,gBAAgB;;;iBAM3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,MAAM,MAAM,WAAW,GACnB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,GAAE,UAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAmCtF"}
@@ -5,11 +5,8 @@ export const claimInputSchema = z.object({
5
5
  app: z
6
6
  .string()
7
7
  .optional()
8
- .describe("App name to claim (defaults to the persisted anon state or percher.toml)"),
9
- claimToken: z
10
- .string()
11
- .optional()
12
- .describe("The one-time claim token returned by the anonymous publish (pcl_…)"),
8
+ .describe("App name to claim (defaults to percher.toml or a saved claim token)"),
9
+ claimToken: z.string().optional().describe("The app's one-time claim token (pcl_…)"),
13
10
  });
14
11
  /**
15
12
  * Claims an anonymous app into the signed-in account. App + token default
@@ -29,14 +26,14 @@ export async function claim(ctx, input = {}) {
29
26
  return {
30
27
  status: "needs_token",
31
28
  summary: remembered.length > 1
32
- ? `Multiple anonymous apps are remembered (${remembered.join(", ")}). Pass --app to choose one.`
29
+ ? `Claim tokens are saved for several apps (${remembered.join(", ")}). Pass --app to choose one.`
33
30
  : "No app to claim. Pass --app (or run from the project that published it) and the claim token.",
34
31
  };
35
32
  }
36
33
  if (!claimToken) {
37
34
  return {
38
35
  status: "needs_token",
39
- summary: "No claim token found. Pass claimToken explicitly — it was returned by the anonymous publish.",
36
+ summary: "No claim token found. Pass claimToken explicitly (pcl_…).",
40
37
  };
41
38
  }
42
39
  const result = await ctx.client.apps.claim(app, { claimToken });
@@ -46,7 +43,7 @@ export async function claim(ctx, input = {}) {
46
43
  status: "claimed",
47
44
  app: result.name,
48
45
  url: result.url,
49
- summary: `Claimed ${result.name} — anonymous restrictions lift on the next deploy.`,
46
+ summary: `Claimed ${result.name}. Its restrictions lift on the next deploy.`,
50
47
  };
51
48
  }
52
49
  //# sourceMappingURL=claim.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0EAA0E,CAAC;IACvF,UAAU,EAAE,CAAC;SACV,MAAM,EA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IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEvF,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,OAAO,EACL,UAAU,CAAC,MAAM,GAAG,CAAC;gBACnB,CAAC,CAAC,4CAA4C,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B;gBACjG,CAAC,CAAC,8FAA8F;SACrG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,2DAA2D;SACrE,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IAChE,mEAAmE;IACnE,cAAc,CAAC,GAAG,CAAC,CAAC;IACpB,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,GAAG,EAAE,MAAM,CAAC,IAAI;QAChB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,OAAO,EAAE,WAAW,MAAM,CAAC,IAAI,6CAA6C;KAC7E,CAAC;AACJ,CAAC"}
@@ -25,9 +25,9 @@ export interface DiagnoseResult {
25
25
  oomKilled: boolean;
26
26
  severity: "critical" | "warning" | "info" | null;
27
27
  createdAt: string;
28
- /** Human-readable analysis from the crash analyzer, if one ran. */
28
+ /** Human-readable analysis from the stored diagnosis, if any. */
29
29
  explanation: string | null;
30
- /** Suggested fix from the crash analyzer, if one ran. */
30
+ /** Suggested fix from the stored diagnosis, if any. */
31
31
  suggestion: string | null;
32
32
  analysisStatus: "completed" | "skipped" | "failed" | "pending";
33
33
  logTail: string[];
@@ -41,14 +41,15 @@ export interface DiagnoseResult {
41
41
  /**
42
42
  * AI-native crash diagnosis tool (MCP).
43
43
  *
44
- * Reads the most recent crash report for an app and returns the stored AI
45
- * analysis (explanation + suggestion) alongside exit code, OOM flag, and a
44
+ * Reads the most recent crash report for an app and returns its stored
45
+ * rule-based diagnosis (explanation + suggestion) alongside exit code, OOM flag, and a
46
46
  * tail of the crash log. Designed to be called from Claude Code / Cursor /
47
47
  * other MCP clients when a user says "my app isn't working" — the assistant
48
48
  * can surface the diagnosis + proposed fix without the user leaving chat.
49
49
  *
50
- * The crash analyzer already runs inside the API and stores results on the
51
- * `crash_reports` row; this command is a thin formatter on top of the
50
+ * Crash diagnosis is deterministic (fixed-rule classification); there is no AI
51
+ * analysis. Reports written before the analyzer was removed may still carry
52
+ * analyzer prose. The API stores results on the `crash_reports` row; this command is a thin formatter on top of the
52
53
  * existing `/apps/:appRef/crash-report` endpoint.
53
54
  */
54
55
  export declare function diagnose(ctx: Context, input?: DiagnoseInput): Promise<DiagnoseResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,mBAAmB;;;;iBAoB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAIhE,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAAC;IAC9C,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;QACjD,SAAS,EAAE,MAAM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D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,cAAc,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;QAC/D,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,GAAG,IAAI,CAAC;IACT;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,GAAE,aAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CAsE/F"}
@@ -26,14 +26,15 @@ const DEFAULT_RECENCY_HOURS = 24;
26
26
  /**
27
27
  * AI-native crash diagnosis tool (MCP).
28
28
  *
29
- * Reads the most recent crash report for an app and returns the stored AI
30
- * analysis (explanation + suggestion) alongside exit code, OOM flag, and a
29
+ * Reads the most recent crash report for an app and returns its stored
30
+ * rule-based diagnosis (explanation + suggestion) alongside exit code, OOM flag, and a
31
31
  * tail of the crash log. Designed to be called from Claude Code / Cursor /
32
32
  * other MCP clients when a user says "my app isn't working" — the assistant
33
33
  * can surface the diagnosis + proposed fix without the user leaving chat.
34
34
  *
35
- * The crash analyzer already runs inside the API and stores results on the
36
- * `crash_reports` row; this command is a thin formatter on top of the
35
+ * Crash diagnosis is deterministic (fixed-rule classification); there is no AI
36
+ * analysis. Reports written before the analyzer was removed may still carry
37
+ * analyzer prose. The API stores results on the `crash_reports` row; this command is a thin formatter on top of the
37
38
  * existing `/apps/:appRef/crash-report` endpoint.
38
39
  */
39
40
  export async function diagnose(ctx, input = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,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zB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { VerdictRule } from "./doctor.js";
2
+ /** Before every rule that reads diagnostics: nothing was read. */
3
+ export declare const ACCESS_RULES: ReadonlyArray<VerdictRule>;
4
+ //# sourceMappingURL=doctor-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-access.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-access.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiC5C,kEAAkE;AAClE,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,WAAW,CAA8B,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { recoveryAsk } from "../recovery.js";
2
+ /**
3
+ * The API refused the diagnostics read with 429: its per-user, per-app limit
4
+ * protects the proxy's admin lock. Fixed text only, never the API's message,
5
+ * and no automatic retry: the agent waits, then runs doctor again.
6
+ */
7
+ const DIAGNOSTICS_RATE_LIMITED = {
8
+ id: "diagnostics-rate-limited",
9
+ when: ({ vctx }) => vctx.diagnosticsRateLimited !== undefined,
10
+ verdict: ({ vctx }) => ({
11
+ status: "needs_action",
12
+ diagnosis: {
13
+ title: "Diagnostics rate limited",
14
+ explanation: vctx.diagnosticsRateLimited === "app"
15
+ ? "This app's diagnostics were read too often, so Percher refused this read for now. Nothing about the app was checked."
16
+ : "Percher refused the request because too many requests arrived. Nothing about the app was checked.",
17
+ reasonCode: "quota_exceeded",
18
+ phase: "infra",
19
+ },
20
+ recovery: recoveryAsk({
21
+ reasonCode: "quota_exceeded",
22
+ prompt: vctx.diagnosticsRateLimited === "app"
23
+ ? "This app's diagnostics were read too often, so nothing was checked. Wait about a minute, then run percher_doctor again. Shall I do that?"
24
+ : "Percher received too many requests, so nothing was checked. Wait about a minute, then run percher_doctor again. Shall I do that?",
25
+ options: ["wait a minute and run doctor again", "cancel"],
26
+ }),
27
+ summary: `Diagnostics for ${vctx.appName ?? "the app"} are rate limited; wait about a minute and run doctor again.`,
28
+ }),
29
+ };
30
+ /** Before every rule that reads diagnostics: nothing was read. */
31
+ export const ACCESS_RULES = [DIAGNOSTICS_RATE_LIMITED];
32
+ //# sourceMappingURL=doctor-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-access.js","sourceRoot":"","sources":["../../src/commands/doctor-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,MAAM,wBAAwB,GAAgB;IAC5C,EAAE,EAAE,0BAA0B;IAC9B,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,KAAK,SAAS;IAC7D,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACtB,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE;YACT,KAAK,EAAE,0BAA0B;YACjC,WAAW,EACT,IAAI,CAAC,sBAAsB,KAAK,KAAK;gBACnC,CAAC,CAAC,sHAAsH;gBACxH,CAAC,CAAC,mGAAmG;YACzG,UAAU,EAAE,gBAAgB;YAC5B,KAAK,EAAE,OAAO;SACf;QACD,QAAQ,EAAE,WAAW,CAAC;YACpB,UAAU,EAAE,gBAAgB;YAC5B,MAAM,EACJ,IAAI,CAAC,sBAAsB,KAAK,KAAK;gBACnC,CAAC,CAAC,0IAA0I;gBAC5I,CAAC,CAAC,kIAAkI;YACxI,OAAO,EAAE,CAAC,oCAAoC,EAAE,QAAQ,CAAC;SAC1D,CAAC;QACF,OAAO,EAAE,mBAAmB,IAAI,CAAC,OAAO,IAAI,SAAS,8DAA8D;KACpH,CAAC;CACH,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAA+B,CAAC,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { ClassifiedError } from "../error-classifier.js";
2
+ import { type ReasonCode } from "../recovery.js";
3
+ import type { DoctorDiagnosis, VerdictContext, VerdictRule } from "./doctor.js";
4
+ import { type FailedStage } from "./doctor-evidence.js";
5
+ type Evidence = NonNullable<DoctorDiagnosis["evidence"]>;
6
+ type Advice = Pick<ClassifiedError, "cause" | "suggestion" | "relevantFiles">;
7
+ /**
8
+ * Everything deploy mode knows about a failed build, as evidence: the matched
9
+ * class's own advice, file-less build errors and the masked log excerpt. The
10
+ * advice is Percher-authored but chosen by matching build output, and the
11
+ * classifier quotes a module name from the log into it, so it is diagnostic.
12
+ */
13
+ export declare function deployEvidence(vctx: VerdictContext, advice?: Advice | null): {
14
+ evidence?: Evidence;
15
+ };
16
+ /**
17
+ * The structured evidence a question's own words need (doctor-evidence.ts).
18
+ * `stages`: the deploy failed in one of these steps. `code`: the deployment
19
+ * carries this platform code. `message`: the deployment's own error message,
20
+ * read alone, matches the same class too (an observation that picks between
21
+ * questions the step allows; it never establishes the step).
22
+ */
23
+ interface Requirement {
24
+ stages?: readonly FailedStage[];
25
+ code?: string;
26
+ message?: true;
27
+ }
28
+ interface CauseQuestion {
29
+ question: string;
30
+ /** The same question for a result with no log excerpt (unreadable, pruned or empty log). */
31
+ questionWithoutExcerpt?: string;
32
+ options: string[];
33
+ reasonCode?: ReasonCode;
34
+ /**
35
+ * Set on every question that asserts a deploy step, a platform limit or a
36
+ * platform result; without the evidence it names, the question is not used.
37
+ * A question without it describes only what the output shows.
38
+ */
39
+ requires?: Requirement;
40
+ /** Shown instead of the classifier's title or explanation, which claim more than `requires` backs. */
41
+ title?: string;
42
+ explanation?: string;
43
+ }
44
+ /**
45
+ * One fixed question per failure type: the 27 regex classifier causes and the
46
+ * causes of the build codes that hand deploy mode back to the log
47
+ * (BUILD_FAILED, BUILD_TIMEOUT, CANARY_FAILED). The cause is a literal from
48
+ * Percher's own tables, so it only picks which text is shown; nothing from
49
+ * the log is copied in. A test pins the set against the classifier source.
50
+ */
51
+ export declare const BUILD_CAUSE_QUESTIONS: Record<string, CauseQuestion>;
52
+ /**
53
+ * The mode='deploy' rules after the coded one, most- to least-actionable. The
54
+ * build log and the deployment were fetched in doctor(); these only read them.
55
+ * The step named in titles, explanations and `phase` is the recorded one
56
+ * (doctor-evidence.ts); the log only says what the output shows.
57
+ */
58
+ export declare const DEPLOY_BUILD_RULES: ReadonlyArray<VerdictRule>;
59
+ export {};
60
+ //# sourceMappingURL=doctor-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor-build.d.ts","sourceRoot":"","sources":["../../src/commands/doctor-build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAIL,KAAK,UAAU,EAKhB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,KAAK,WAAW,EAA6B,MAAM,mBAAmB,CAAC;AAEhF,KAAK,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;AACzD,KAAK,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,YAAY,GAAG,eAAe,CAAC,CAAC;AAsB9E;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,cAAc,EACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,CAUzB;AAED;;;;;;GAMG;AACH,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU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