@crewhaus/errors 0.3.2 → 0.4.2

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/index.d.ts CHANGED
@@ -74,7 +74,20 @@ export declare class ProviderAuthError extends AdapterError {
74
74
  * (which tags where an error was raised): a `FailureClass` tags *why the run
75
75
  * stopped*, in end-user vocabulary, and maps 1:1 onto an exit code.
76
76
  */
77
- export type FailureClass = "billing" | "auth" | "rate_limit" | "crewhaus_budget" | "mcp_boot" | "context_overflow" | "spec" | "config" | "tool" | "unknown";
77
+ export type FailureClass = "billing" | "auth" | "rate_limit" | "crewhaus_budget" | "timeout"
78
+ /** Loop contract 0.4 (G02) — the spec's in-loop `evaluation:` gate scored
79
+ * the run's final answer below threshold with `on_fail: halt`. Like
80
+ * `crewhaus_budget`/`timeout`, this is CrewHaus's OWN configured ceiling
81
+ * ending the run, not a provider failure. */
82
+ | "evaluation"
83
+ /** Loop contract 0.4 (G11) — a tool permission resolved to `ask` on a
84
+ * NON-interactive surface with `permissions.ask_mode: "pause"` (the
85
+ * default) and no prior grant/deny for the call: the runtime persisted a
86
+ * `PendingApproval`, published `approval_requested`, and PARKED the run
87
+ * to await an out-of-band decision. Unlike the other 3x-band classes this
88
+ * is not a hard error — it is a resumable pause; the run re-executes
89
+ * pre-resolved once the approval is granted (one-shot) or denied. */
90
+ | "approval_pending" | "mcp_boot" | "context_overflow" | "spec" | "config" | "tool" | "unknown";
78
91
  /**
79
92
  * The single structured description of a terminal run failure. `detail`
80
93
  * carries the raw provider text (with attribution, e.g. `Anthropic said:
@@ -111,6 +124,22 @@ export declare const EXIT_CODES: {
111
124
  readonly rate_limit: 32;
112
125
  /** CrewHaus's own configured budget cap ended the run. */
113
126
  readonly crewhaus_budget: 33;
127
+ /** Loop contract 0.4 (G10) — a configured wall-clock limit
128
+ * (`limits.deadline_ms` / `turn_timeout_ms` / `model_call_timeout_ms`)
129
+ * ended the run. Sits in the 3x band beside `crewhaus_budget`: like the
130
+ * spend cap, it is CrewHaus's OWN configured ceiling, not a provider
131
+ * failure. */
132
+ readonly timeout: 34;
133
+ /** Loop contract 0.4 (G02) — the spec's in-loop `evaluation:` gate failed
134
+ * the final answer with `on_fail: halt`. Same 3x band rationale: a
135
+ * CrewHaus-configured quality floor, not a provider failure. */
136
+ readonly evaluation: 35;
137
+ /** Loop contract 0.4 (G11) — the run PARKED on a headless tool-approval
138
+ * ask (`permissions.ask_mode: "pause"`). Sits in the 3x band beside the
139
+ * other CrewHaus-configured stops: a resumable pause awaiting an
140
+ * out-of-band grant/deny, distinguishable from a hard failure so `fleet`
141
+ * / the UI host can surface "needs approval" and resume rather than alert. */
142
+ readonly approval_pending: 36;
114
143
  /** Tool or MCP failure (including MCP boot). */
115
144
  readonly tool: 40;
116
145
  };
package/dist/index.js CHANGED
@@ -123,6 +123,22 @@ export const EXIT_CODES = {
123
123
  rate_limit: 32,
124
124
  /** CrewHaus's own configured budget cap ended the run. */
125
125
  crewhaus_budget: 33,
126
+ /** Loop contract 0.4 (G10) — a configured wall-clock limit
127
+ * (`limits.deadline_ms` / `turn_timeout_ms` / `model_call_timeout_ms`)
128
+ * ended the run. Sits in the 3x band beside `crewhaus_budget`: like the
129
+ * spend cap, it is CrewHaus's OWN configured ceiling, not a provider
130
+ * failure. */
131
+ timeout: 34,
132
+ /** Loop contract 0.4 (G02) — the spec's in-loop `evaluation:` gate failed
133
+ * the final answer with `on_fail: halt`. Same 3x band rationale: a
134
+ * CrewHaus-configured quality floor, not a provider failure. */
135
+ evaluation: 35,
136
+ /** Loop contract 0.4 (G11) — the run PARKED on a headless tool-approval
137
+ * ask (`permissions.ask_mode: "pause"`). Sits in the 3x band beside the
138
+ * other CrewHaus-configured stops: a resumable pause awaiting an
139
+ * out-of-band grant/deny, distinguishable from a hard failure so `fleet`
140
+ * / the UI host can surface "needs approval" and resume rather than alert. */
141
+ approval_pending: 36,
126
142
  /** Tool or MCP failure (including MCP boot). */
127
143
  tool: 40,
128
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/errors",
3
- "version": "0.3.2",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "Typed error hierarchy shared across factory layers",
6
6
  "main": "dist/index.js",