@usefidel/contracts 0.2.0 → 0.3.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.
@@ -15,7 +15,7 @@
15
15
  * When editing this file, run `npx tsx scripts/check-vendor-sync.ts` and
16
16
  * update all consumer copies.
17
17
  */
18
- export declare const RUN_ERROR_CODES: readonly ["TARGET_AUTH_WALL", "TARGET_UNREACHABLE", "TARGET_TIMEOUT", "TARGET_CSP_BLOCKED", "FIGMA_ACCESS_DENIED", "FIGMA_TOKEN_EXPIRED", "FIGMA_NOT_FOUND", "FIGMA_RATE_LIMITED", "PIPELINE_TIMEOUT", "PIPELINE_ERROR", "ZERO_ELEMENTS_MATCHED", "PERSIST_FAILED", "SESSION_EXPIRED", "INVALID_REFERENCE_URL", "INVALID_TARGET_URL", "DESIGN_SYSTEM_NOT_AVAILABLE", "DESIGN_SYSTEM_CONTEXT_NOT_AVAILABLE", "DESIGN_SYSTEM_INCOMPATIBLE", "FLOW_STEP_FAILED", "UNKNOWN_ERROR"];
18
+ export declare const RUN_ERROR_CODES: readonly ["TARGET_AUTH_WALL", "TARGET_UNREACHABLE", "TARGET_TIMEOUT", "TARGET_CSP_BLOCKED", "FIGMA_ACCESS_DENIED", "FIGMA_TOKEN_EXPIRED", "FIGMA_NOT_FOUND", "FIGMA_RATE_LIMITED", "PIPELINE_TIMEOUT", "PIPELINE_ERROR", "ZERO_ELEMENTS_MATCHED", "PERSIST_FAILED", "SESSION_EXPIRED", "INVALID_REFERENCE_URL", "INVALID_TARGET_URL", "DESIGN_SYSTEM_NOT_AVAILABLE", "DESIGN_SYSTEM_CONTEXT_NOT_AVAILABLE", "DESIGN_SYSTEM_INCOMPATIBLE", "FLOW_STEP_FAILED", "CAPABILITY_UNAVAILABLE", "PROVIDER_REQUEST_REJECTED", "UNKNOWN_ERROR"];
19
19
  export type RunErrorCode = (typeof RUN_ERROR_CODES)[number];
20
20
  export interface RunErrorMeta {
21
21
  retryable: boolean;
@@ -66,6 +66,23 @@ export const RUN_ERROR_CODES = [
66
66
  // (e.g. a transition target is missing or the step response is invalid).
67
67
  // retryable: false — this is a structural design problem, not a transient error.
68
68
  'FLOW_STEP_FAILED',
69
+ // Plan G-10 follow-up: replay-provider outcomes that cannot recover by
70
+ // retrying. Both are deliberately provider-NEUTRAL, in name and in message.
71
+ // The provider, its status codes and its response bodies stay in structured
72
+ // logs (`replay_provider_failed`); error_message is owner-readable AND
73
+ // projected through get_shared_run to anon share viewers, so it must not
74
+ // name a vendor or describe our configuration (same H-4 reasoning as the
75
+ // DESIGN_SYSTEM_* codes above).
76
+ //
77
+ // CAPABILITY_UNAVAILABLE — the saved-session capability itself is not
78
+ // usable: credential absent, rejected, or the plan/quota is exhausted.
79
+ // Operator-side. retryable: false — no number of retries configures a key.
80
+ 'CAPABILITY_UNAVAILABLE',
81
+ // PROVIDER_REQUEST_REJECTED — a deterministic rejection of this specific
82
+ // request (a 4xx that is not auth, not "gone", not rate limiting), or a 2xx
83
+ // whose body was structurally unusable. retryable: false — the same request
84
+ // will be rejected the same way.
85
+ 'PROVIDER_REQUEST_REJECTED',
69
86
  'UNKNOWN_ERROR',
70
87
  ];
71
88
  export const ERROR_CODE_META = {
@@ -134,6 +151,16 @@ export const ERROR_CODE_META = {
134
151
  userMessage: "This site's saved session has expired. Reconnect it to validate again.",
135
152
  shortLabel: 'Session expired',
136
153
  },
154
+ CAPABILITY_UNAVAILABLE: {
155
+ retryable: false,
156
+ userMessage: "Validating sites that need a saved sign-in isn't available right now. This one's on us — contact support and we'll get it working.",
157
+ shortLabel: 'Capability unavailable',
158
+ },
159
+ PROVIDER_REQUEST_REJECTED: {
160
+ retryable: false,
161
+ userMessage: "This validation couldn't be completed. Trying again won't change the result — contact support if you need it looked at.",
162
+ shortLabel: 'Validation rejected',
163
+ },
137
164
  INVALID_REFERENCE_URL: {
138
165
  retryable: false,
139
166
  userMessage: 'The reference URL is invalid. It must start with https:// and point to a real page.',
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "The source of truth still lives in the monorepo at packages/contracts/."
8
8
  ],
9
9
  "name": "@usefidel/contracts",
10
- "version": "0.2.0",
10
+ "version": "0.3.0",
11
11
  "description": "Shared, code-free contracts between Fidel surfaces. Run-error taxonomy and theme-intake wire types.",
12
12
  "license": "UNLICENSED",
13
13
  "private": false,