@reclaimprotocol/client 0.1.1 → 0.1.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.
@@ -127,6 +127,10 @@ export declare const ROUTES: {
127
127
  readonly method: "delete";
128
128
  readonly path: "/orgs/{orgId}/themes/{themeId}";
129
129
  };
130
+ readonly DiscoverDataPoints: {
131
+ readonly method: "get";
132
+ readonly path: "/discover/data-points";
133
+ };
130
134
  readonly DiscoverResolve: {
131
135
  readonly method: "get";
132
136
  readonly path: "/discover/resolve";
@@ -343,6 +347,14 @@ export declare const ROUTES: {
343
347
  readonly method: "get";
344
348
  readonly path: "/site/{domain}/build";
345
349
  };
350
+ readonly SiteBuildAlternative: {
351
+ readonly method: "get";
352
+ readonly path: "/site/{domain}/alternative";
353
+ };
354
+ readonly SiteBuildRepair: {
355
+ readonly method: "get";
356
+ readonly path: "/site/{domain}/repair";
357
+ };
346
358
  readonly SiteBuildTry: {
347
359
  readonly method: "post";
348
360
  readonly path: "/site/{domain}/try";
package/lib/routes.gen.js CHANGED
@@ -35,6 +35,7 @@ export const ROUTES = {
35
35
  "DeleteProvider": { "method": "delete", "path": "/providers/{providerId}" },
36
36
  "DeleteProviderVersion": { "method": "delete", "path": "/providers/{providerId}/versions/{version}" },
37
37
  "DeleteTheme": { "method": "delete", "path": "/orgs/{orgId}/themes/{themeId}" },
38
+ "DiscoverDataPoints": { "method": "get", "path": "/discover/data-points" },
38
39
  "DiscoverResolve": { "method": "get", "path": "/discover/resolve" },
39
40
  "DiscoverTeachAgent": { "method": "get", "path": "/discover/teach" },
40
41
  "DiscoverWebsites": { "method": "get", "path": "/discover/websites" },
@@ -89,6 +90,8 @@ export const ROUTES = {
89
90
  "SetOrgKeypair": { "method": "put", "path": "/orgs/{orgId}/keypair" },
90
91
  "SetupProviderCreate": { "method": "post", "path": "/providers/setup" },
91
92
  "SiteBuild": { "method": "get", "path": "/site/{domain}/build" },
93
+ "SiteBuildAlternative": { "method": "get", "path": "/site/{domain}/alternative" },
94
+ "SiteBuildRepair": { "method": "get", "path": "/site/{domain}/repair" },
92
95
  "SiteBuildTry": { "method": "post", "path": "/site/{domain}/try" },
93
96
  "Sitemap": { "method": "get", "path": "/sitemap.xml" },
94
97
  "SitePage": { "method": "get", "path": "/site/{domain}" },
@@ -208,6 +208,46 @@ export interface paths {
208
208
  patch?: never;
209
209
  trace?: never;
210
210
  };
211
+ "/site/{domain}/repair": {
212
+ parameters: {
213
+ query?: never;
214
+ header?: never;
215
+ path?: never;
216
+ cookie?: never;
217
+ };
218
+ /**
219
+ * Failure-aware "Repair with an AI coding agent" wizard fragment
220
+ * @description Body of the build page's repair dialog, lazy-loaded after a sandbox Try fails so the agent prompt includes the REAL failure (which provider(s) failed + the error reason, read from the session's event log) and the resolved provider set. HTML / HTMX fragment.
221
+ */
222
+ get: operations["SiteBuildRepair"];
223
+ put?: never;
224
+ post?: never;
225
+ delete?: never;
226
+ options?: never;
227
+ head?: never;
228
+ patch?: never;
229
+ trace?: never;
230
+ };
231
+ "/site/{domain}/alternative": {
232
+ parameters: {
233
+ query?: never;
234
+ header?: never;
235
+ path?: never;
236
+ cookie?: never;
237
+ };
238
+ /**
239
+ * Re-resolve excluding a failed provider, else hand off to repair
240
+ * @description After a sandbox Try fails, reads which provider(s) failed from the session analytics and re-resolves the selection with them excluded. If the rest still cover it, responds with an `HX-Redirect` to the build page (failed providers excluded — the alternative set). Otherwise emits an `openRepair` HX-Trigger so the client opens the repair wizard.
241
+ */
242
+ get: operations["SiteBuildAlternative"];
243
+ put?: never;
244
+ post?: never;
245
+ delete?: never;
246
+ options?: never;
247
+ head?: never;
248
+ patch?: never;
249
+ trace?: never;
250
+ };
211
251
  "/discover/teach": {
212
252
  parameters: {
213
253
  query?: never;
@@ -236,8 +276,10 @@ export interface paths {
236
276
  cookie?: never;
237
277
  };
238
278
  /**
239
- * Resolve existing providers covering selected data points
240
- * @description The "resolve" step behind the Discover CTAs. Given a website and the data points the user picked, returns the existing verifications on that domain whose data points COVER the whole selection (smallest / most specific first), so a caller can reuse one instead of building a new verification. When nothing covers the selection, `needsCreation` is `true` — synthesising a new provider by stitching is a later stage. JSON only.
279
+ * Resolve a website + data points to verification providers
280
+ * @description Provider resolution: given a website and the data points the user wants their users to prove, return the smallest set of existing providers whose data points COVER the selection (greedy combine), the `requiredContext` inputs the consumer must supply, and any `uncovered` points no provider exposes yet (`needsCreation` is true then — author a provider with the agent tools). When the chosen providers can be fused into one (same start page, no clashing page scripts) `merge.mergeable` is true.
281
+ *
282
+ * Agent flow: pick a website (`GET /discover/data-points` lists what's verifiable there), confirm the data points with the user, call this to get the `providers` + `requiredContext`, collect those context values from the user, then `POST /verifications/sessions` with `providers` (pass every id) and `context` to mint a verification.
241
283
  */
242
284
  get: operations["DiscoverResolve"];
243
285
  put?: never;
@@ -248,6 +290,26 @@ export interface paths {
248
290
  patch?: never;
249
291
  trace?: never;
250
292
  };
293
+ "/discover/data-points": {
294
+ parameters: {
295
+ query?: never;
296
+ header?: never;
297
+ path?: never;
298
+ cookie?: never;
299
+ };
300
+ /**
301
+ * List the verifiable data points on a website
302
+ * @description The data points existing providers can prove on a website — the menu to pick from before `GET /discover/resolve`. Optionally filter by `q`.
303
+ */
304
+ get: operations["DiscoverDataPoints"];
305
+ put?: never;
306
+ post?: never;
307
+ delete?: never;
308
+ options?: never;
309
+ head?: never;
310
+ patch?: never;
311
+ trace?: never;
312
+ };
251
313
  "/providers/{providerId}/preview.png": {
252
314
  parameters: {
253
315
  query?: never;
@@ -3475,14 +3537,16 @@ export interface operations {
3475
3537
  query: {
3476
3538
  /** @description Selected data-point names. Repeat to pass several. */
3477
3539
  dataPoints: string[];
3478
- /** @description `combine` (default) minimizes to the fewest providers (set-cover); `list` uses one provider per data point. */
3479
- mode?: "list" | "combine";
3540
+ /** @description `combine` (default) minimizes to the fewest providers (set-cover); `ai` is a forward-compat alias that currently resolves like combine. */
3541
+ mode?: "combine" | "ai";
3480
3542
  /** @description Source pins: `pins[<dataPoint>]=id,id`. Maps each data-point name to a comma-joined list of preferred providerIds. Omit for Auto. */
3481
3543
  pins?: {
3482
3544
  [key: string]: string;
3483
3545
  };
3484
3546
  /** @description Data-point names the consumer opts to SUPPLY themselves (as verification `context`) instead of having a provider prove — shrinks the provider set. Repeat to pass several. Only names that are a provider input are honoured. Subset of `dataPoints`. */
3485
3547
  provided?: string[];
3548
+ /** @description ProviderIds to EXCLUDE from resolution (set after a sandbox Try fails, so a different provider / merge is picked). Repeat to pass several. */
3549
+ exclude?: components["schemas"]["ProviderID"][];
3486
3550
  };
3487
3551
  header?: never;
3488
3552
  path: {
@@ -3512,13 +3576,15 @@ export interface operations {
3512
3576
  /** @description Selected data-point names. Repeat to pass several. */
3513
3577
  dataPoints: string[];
3514
3578
  /** @description Resolution mode (`combine` default | `list`). */
3515
- mode?: "list" | "combine";
3579
+ mode?: "combine" | "ai";
3516
3580
  /** @description Source pins: `pins[<dataPoint>]=id,id`. Maps each data-point name to a comma-joined list of preferred providerIds. */
3517
3581
  pins?: {
3518
3582
  [key: string]: string;
3519
3583
  };
3520
3584
  /** @description Data-point names the consumer supplies themselves (as `context`) instead of proving. Repeat to pass several. Subset of `dataPoints`. */
3521
3585
  provided?: string[];
3586
+ /** @description ProviderIds to exclude from resolution. Repeat to pass several. */
3587
+ exclude?: components["schemas"]["ProviderID"][];
3522
3588
  };
3523
3589
  header?: never;
3524
3590
  path: {
@@ -3566,6 +3632,79 @@ export interface operations {
3566
3632
  default: components["responses"]["ProblemResponse"];
3567
3633
  };
3568
3634
  };
3635
+ SiteBuildRepair: {
3636
+ parameters: {
3637
+ query: {
3638
+ /** @description The failing sandbox session whose analytics seed the prompt. */
3639
+ sessionId: components["schemas"]["SessionID"];
3640
+ dataPoints?: string[];
3641
+ mode?: "combine" | "ai";
3642
+ provided?: string[];
3643
+ pins?: {
3644
+ [key: string]: string;
3645
+ };
3646
+ exclude?: components["schemas"]["ProviderID"][];
3647
+ };
3648
+ header?: never;
3649
+ path: {
3650
+ domain: string;
3651
+ };
3652
+ cookie?: never;
3653
+ };
3654
+ requestBody?: never;
3655
+ responses: {
3656
+ /** @description The repair wizard fragment. */
3657
+ 200: {
3658
+ headers: {
3659
+ [name: string]: unknown;
3660
+ };
3661
+ content: {
3662
+ "text/html": components["schemas"]["HtmlContent"];
3663
+ };
3664
+ };
3665
+ default: components["responses"]["ProblemResponse"];
3666
+ };
3667
+ };
3668
+ SiteBuildAlternative: {
3669
+ parameters: {
3670
+ query: {
3671
+ /** @description The failing sandbox session to analyze. */
3672
+ sessionId: components["schemas"]["SessionID"];
3673
+ dataPoints?: string[];
3674
+ mode?: "combine" | "ai";
3675
+ provided?: string[];
3676
+ pins?: {
3677
+ [key: string]: string;
3678
+ };
3679
+ exclude?: components["schemas"]["ProviderID"][];
3680
+ };
3681
+ header?: never;
3682
+ path: {
3683
+ domain: string;
3684
+ };
3685
+ cookie?: never;
3686
+ };
3687
+ requestBody?: never;
3688
+ responses: {
3689
+ /** @description No alternative — a fragment + `openRepair` HX-Trigger. */
3690
+ 200: {
3691
+ headers: {
3692
+ [name: string]: unknown;
3693
+ };
3694
+ content: {
3695
+ "text/html": components["schemas"]["HtmlContent"];
3696
+ };
3697
+ };
3698
+ /** @description Alternative found — `HX-Redirect` to the build page. */
3699
+ 204: {
3700
+ headers: {
3701
+ [name: string]: unknown;
3702
+ };
3703
+ content?: never;
3704
+ };
3705
+ default: components["responses"]["ProblemResponse"];
3706
+ };
3707
+ };
3569
3708
  DiscoverTeachAgent: {
3570
3709
  parameters: {
3571
3710
  query?: {
@@ -3591,6 +3730,8 @@ export interface operations {
3591
3730
  domain: string;
3592
3731
  /** @description Selected data-point names. Repeat to pass several. */
3593
3732
  dataPoints: string[];
3733
+ /** @description Resolution mode. `combine` (default) uses the fewest providers; `ai` is a forward-compat alias that resolves like combine for now. */
3734
+ mode?: "combine" | "ai";
3594
3735
  };
3595
3736
  header?: never;
3596
3737
  path?: never;
@@ -3598,21 +3739,78 @@ export interface operations {
3598
3739
  };
3599
3740
  requestBody?: never;
3600
3741
  responses: {
3601
- /** @description Covering providers (possibly none). */
3742
+ /** @description Resolved providers (possibly none). */
3602
3743
  200: {
3603
3744
  headers: {
3604
3745
  [name: string]: unknown;
3605
3746
  };
3606
3747
  content: {
3607
3748
  "application/json": {
3608
- /** @description The most specific covering provider's id, if any — a convenience for the common single-provider case. */
3749
+ /** @description The first resolved provider's id, if any — a convenience for the common single-provider case. */
3609
3750
  providerId?: components["schemas"]["ProviderID"];
3610
- /** @description True when no existing provider covers the full selection (a new one must be created/stitched). */
3751
+ /** @description True when some selected data point has no provider (see `uncovered`) — a new provider must be authored. */
3611
3752
  needsCreation: boolean;
3612
3753
  providers: {
3613
3754
  providerId: components["schemas"]["ProviderID"];
3614
3755
  slug: string;
3756
+ /** @description The selected data points this provider covers. */
3615
3757
  dataPoints: string[];
3758
+ /** @description Recent verification health for this provider (last 30 days). Present only when there is enough history (a minimum number of attempts) to be meaningful; absent for new or rarely-used providers. Used to break ranking ties between providers covering the same data points. */
3759
+ reliability?: {
3760
+ /**
3761
+ * Format: float
3762
+ * @description Fraction of recent sessions that started this provider and completed its claim without failure.
3763
+ */
3764
+ recentSuccessRate: number;
3765
+ /** @description Number of recent sessions that started this provider (the sample size behind `recentSuccessRate`). */
3766
+ attempts: number;
3767
+ };
3768
+ }[];
3769
+ /** @description Selected data points no existing provider exposes. */
3770
+ uncovered: string[];
3771
+ /** @description Inputs the consumer must supply at verification time (passed as session `context`). Collect these from the user. */
3772
+ requiredContext: {
3773
+ key: string;
3774
+ required: boolean;
3775
+ description?: string;
3776
+ }[];
3777
+ /** @description Whether the resolved providers fuse into one. Informational — `POST /verifications/sessions` already accepts the whole `providers` array. */
3778
+ merge: {
3779
+ mergeable: boolean;
3780
+ /** @description True when merging removes duplicate requests to the same endpoint (saved overfetch). */
3781
+ dedupedSomeRequests?: boolean;
3782
+ };
3783
+ };
3784
+ };
3785
+ };
3786
+ default: components["responses"]["ProblemResponse"];
3787
+ };
3788
+ };
3789
+ DiscoverDataPoints: {
3790
+ parameters: {
3791
+ query: {
3792
+ /** @description Website domain (normalized server-side). */
3793
+ domain: string;
3794
+ /** @description Case-insensitive filter over data-point names. */
3795
+ q?: string;
3796
+ };
3797
+ header?: never;
3798
+ path?: never;
3799
+ cookie?: never;
3800
+ };
3801
+ requestBody?: never;
3802
+ responses: {
3803
+ /** @description Verifiable data points (possibly none). */
3804
+ 200: {
3805
+ headers: {
3806
+ [name: string]: unknown;
3807
+ };
3808
+ content: {
3809
+ "application/json": {
3810
+ dataPoints: {
3811
+ name: string;
3812
+ description?: string;
3813
+ providerCount: number;
3616
3814
  }[];
3617
3815
  };
3618
3816
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/client",
3
3
  "title": "Reclaim Client",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "description": "Typed SDK client for @reclaimprotocol/app. Used by @reclaimprotocol/agent and any other consumer that needs programmatic API access without the full agent.",
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/src/routes.gen.ts CHANGED
@@ -36,6 +36,7 @@ export const ROUTES = {
36
36
  "DeleteProvider": {"method":"delete","path":"/providers/{providerId}"},
37
37
  "DeleteProviderVersion": {"method":"delete","path":"/providers/{providerId}/versions/{version}"},
38
38
  "DeleteTheme": {"method":"delete","path":"/orgs/{orgId}/themes/{themeId}"},
39
+ "DiscoverDataPoints": {"method":"get","path":"/discover/data-points"},
39
40
  "DiscoverResolve": {"method":"get","path":"/discover/resolve"},
40
41
  "DiscoverTeachAgent": {"method":"get","path":"/discover/teach"},
41
42
  "DiscoverWebsites": {"method":"get","path":"/discover/websites"},
@@ -90,6 +91,8 @@ export const ROUTES = {
90
91
  "SetOrgKeypair": {"method":"put","path":"/orgs/{orgId}/keypair"},
91
92
  "SetupProviderCreate": {"method":"post","path":"/providers/setup"},
92
93
  "SiteBuild": {"method":"get","path":"/site/{domain}/build"},
94
+ "SiteBuildAlternative": {"method":"get","path":"/site/{domain}/alternative"},
95
+ "SiteBuildRepair": {"method":"get","path":"/site/{domain}/repair"},
93
96
  "SiteBuildTry": {"method":"post","path":"/site/{domain}/try"},
94
97
  "Sitemap": {"method":"get","path":"/sitemap.xml"},
95
98
  "SitePage": {"method":"get","path":"/site/{domain}"},
@@ -209,6 +209,46 @@ export interface paths {
209
209
  patch?: never;
210
210
  trace?: never;
211
211
  };
212
+ "/site/{domain}/repair": {
213
+ parameters: {
214
+ query?: never;
215
+ header?: never;
216
+ path?: never;
217
+ cookie?: never;
218
+ };
219
+ /**
220
+ * Failure-aware "Repair with an AI coding agent" wizard fragment
221
+ * @description Body of the build page's repair dialog, lazy-loaded after a sandbox Try fails so the agent prompt includes the REAL failure (which provider(s) failed + the error reason, read from the session's event log) and the resolved provider set. HTML / HTMX fragment.
222
+ */
223
+ get: operations["SiteBuildRepair"];
224
+ put?: never;
225
+ post?: never;
226
+ delete?: never;
227
+ options?: never;
228
+ head?: never;
229
+ patch?: never;
230
+ trace?: never;
231
+ };
232
+ "/site/{domain}/alternative": {
233
+ parameters: {
234
+ query?: never;
235
+ header?: never;
236
+ path?: never;
237
+ cookie?: never;
238
+ };
239
+ /**
240
+ * Re-resolve excluding a failed provider, else hand off to repair
241
+ * @description After a sandbox Try fails, reads which provider(s) failed from the session analytics and re-resolves the selection with them excluded. If the rest still cover it, responds with an `HX-Redirect` to the build page (failed providers excluded — the alternative set). Otherwise emits an `openRepair` HX-Trigger so the client opens the repair wizard.
242
+ */
243
+ get: operations["SiteBuildAlternative"];
244
+ put?: never;
245
+ post?: never;
246
+ delete?: never;
247
+ options?: never;
248
+ head?: never;
249
+ patch?: never;
250
+ trace?: never;
251
+ };
212
252
  "/discover/teach": {
213
253
  parameters: {
214
254
  query?: never;
@@ -237,8 +277,10 @@ export interface paths {
237
277
  cookie?: never;
238
278
  };
239
279
  /**
240
- * Resolve existing providers covering selected data points
241
- * @description The "resolve" step behind the Discover CTAs. Given a website and the data points the user picked, returns the existing verifications on that domain whose data points COVER the whole selection (smallest / most specific first), so a caller can reuse one instead of building a new verification. When nothing covers the selection, `needsCreation` is `true` — synthesising a new provider by stitching is a later stage. JSON only.
280
+ * Resolve a website + data points to verification providers
281
+ * @description Provider resolution: given a website and the data points the user wants their users to prove, return the smallest set of existing providers whose data points COVER the selection (greedy combine), the `requiredContext` inputs the consumer must supply, and any `uncovered` points no provider exposes yet (`needsCreation` is true then — author a provider with the agent tools). When the chosen providers can be fused into one (same start page, no clashing page scripts) `merge.mergeable` is true.
282
+ *
283
+ * Agent flow: pick a website (`GET /discover/data-points` lists what's verifiable there), confirm the data points with the user, call this to get the `providers` + `requiredContext`, collect those context values from the user, then `POST /verifications/sessions` with `providers` (pass every id) and `context` to mint a verification.
242
284
  */
243
285
  get: operations["DiscoverResolve"];
244
286
  put?: never;
@@ -249,6 +291,26 @@ export interface paths {
249
291
  patch?: never;
250
292
  trace?: never;
251
293
  };
294
+ "/discover/data-points": {
295
+ parameters: {
296
+ query?: never;
297
+ header?: never;
298
+ path?: never;
299
+ cookie?: never;
300
+ };
301
+ /**
302
+ * List the verifiable data points on a website
303
+ * @description The data points existing providers can prove on a website — the menu to pick from before `GET /discover/resolve`. Optionally filter by `q`.
304
+ */
305
+ get: operations["DiscoverDataPoints"];
306
+ put?: never;
307
+ post?: never;
308
+ delete?: never;
309
+ options?: never;
310
+ head?: never;
311
+ patch?: never;
312
+ trace?: never;
313
+ };
252
314
  "/providers/{providerId}/preview.png": {
253
315
  parameters: {
254
316
  query?: never;
@@ -3476,14 +3538,16 @@ export interface operations {
3476
3538
  query: {
3477
3539
  /** @description Selected data-point names. Repeat to pass several. */
3478
3540
  dataPoints: string[];
3479
- /** @description `combine` (default) minimizes to the fewest providers (set-cover); `list` uses one provider per data point. */
3480
- mode?: "list" | "combine";
3541
+ /** @description `combine` (default) minimizes to the fewest providers (set-cover); `ai` is a forward-compat alias that currently resolves like combine. */
3542
+ mode?: "combine" | "ai";
3481
3543
  /** @description Source pins: `pins[<dataPoint>]=id,id`. Maps each data-point name to a comma-joined list of preferred providerIds. Omit for Auto. */
3482
3544
  pins?: {
3483
3545
  [key: string]: string;
3484
3546
  };
3485
3547
  /** @description Data-point names the consumer opts to SUPPLY themselves (as verification `context`) instead of having a provider prove — shrinks the provider set. Repeat to pass several. Only names that are a provider input are honoured. Subset of `dataPoints`. */
3486
3548
  provided?: string[];
3549
+ /** @description ProviderIds to EXCLUDE from resolution (set after a sandbox Try fails, so a different provider / merge is picked). Repeat to pass several. */
3550
+ exclude?: components["schemas"]["ProviderID"][];
3487
3551
  };
3488
3552
  header?: never;
3489
3553
  path: {
@@ -3513,13 +3577,15 @@ export interface operations {
3513
3577
  /** @description Selected data-point names. Repeat to pass several. */
3514
3578
  dataPoints: string[];
3515
3579
  /** @description Resolution mode (`combine` default | `list`). */
3516
- mode?: "list" | "combine";
3580
+ mode?: "combine" | "ai";
3517
3581
  /** @description Source pins: `pins[<dataPoint>]=id,id`. Maps each data-point name to a comma-joined list of preferred providerIds. */
3518
3582
  pins?: {
3519
3583
  [key: string]: string;
3520
3584
  };
3521
3585
  /** @description Data-point names the consumer supplies themselves (as `context`) instead of proving. Repeat to pass several. Subset of `dataPoints`. */
3522
3586
  provided?: string[];
3587
+ /** @description ProviderIds to exclude from resolution. Repeat to pass several. */
3588
+ exclude?: components["schemas"]["ProviderID"][];
3523
3589
  };
3524
3590
  header?: never;
3525
3591
  path: {
@@ -3567,6 +3633,79 @@ export interface operations {
3567
3633
  default: components["responses"]["ProblemResponse"];
3568
3634
  };
3569
3635
  };
3636
+ SiteBuildRepair: {
3637
+ parameters: {
3638
+ query: {
3639
+ /** @description The failing sandbox session whose analytics seed the prompt. */
3640
+ sessionId: components["schemas"]["SessionID"];
3641
+ dataPoints?: string[];
3642
+ mode?: "combine" | "ai";
3643
+ provided?: string[];
3644
+ pins?: {
3645
+ [key: string]: string;
3646
+ };
3647
+ exclude?: components["schemas"]["ProviderID"][];
3648
+ };
3649
+ header?: never;
3650
+ path: {
3651
+ domain: string;
3652
+ };
3653
+ cookie?: never;
3654
+ };
3655
+ requestBody?: never;
3656
+ responses: {
3657
+ /** @description The repair wizard fragment. */
3658
+ 200: {
3659
+ headers: {
3660
+ [name: string]: unknown;
3661
+ };
3662
+ content: {
3663
+ "text/html": components["schemas"]["HtmlContent"];
3664
+ };
3665
+ };
3666
+ default: components["responses"]["ProblemResponse"];
3667
+ };
3668
+ };
3669
+ SiteBuildAlternative: {
3670
+ parameters: {
3671
+ query: {
3672
+ /** @description The failing sandbox session to analyze. */
3673
+ sessionId: components["schemas"]["SessionID"];
3674
+ dataPoints?: string[];
3675
+ mode?: "combine" | "ai";
3676
+ provided?: string[];
3677
+ pins?: {
3678
+ [key: string]: string;
3679
+ };
3680
+ exclude?: components["schemas"]["ProviderID"][];
3681
+ };
3682
+ header?: never;
3683
+ path: {
3684
+ domain: string;
3685
+ };
3686
+ cookie?: never;
3687
+ };
3688
+ requestBody?: never;
3689
+ responses: {
3690
+ /** @description No alternative — a fragment + `openRepair` HX-Trigger. */
3691
+ 200: {
3692
+ headers: {
3693
+ [name: string]: unknown;
3694
+ };
3695
+ content: {
3696
+ "text/html": components["schemas"]["HtmlContent"];
3697
+ };
3698
+ };
3699
+ /** @description Alternative found — `HX-Redirect` to the build page. */
3700
+ 204: {
3701
+ headers: {
3702
+ [name: string]: unknown;
3703
+ };
3704
+ content?: never;
3705
+ };
3706
+ default: components["responses"]["ProblemResponse"];
3707
+ };
3708
+ };
3570
3709
  DiscoverTeachAgent: {
3571
3710
  parameters: {
3572
3711
  query?: {
@@ -3592,6 +3731,8 @@ export interface operations {
3592
3731
  domain: string;
3593
3732
  /** @description Selected data-point names. Repeat to pass several. */
3594
3733
  dataPoints: string[];
3734
+ /** @description Resolution mode. `combine` (default) uses the fewest providers; `ai` is a forward-compat alias that resolves like combine for now. */
3735
+ mode?: "combine" | "ai";
3595
3736
  };
3596
3737
  header?: never;
3597
3738
  path?: never;
@@ -3599,21 +3740,78 @@ export interface operations {
3599
3740
  };
3600
3741
  requestBody?: never;
3601
3742
  responses: {
3602
- /** @description Covering providers (possibly none). */
3743
+ /** @description Resolved providers (possibly none). */
3603
3744
  200: {
3604
3745
  headers: {
3605
3746
  [name: string]: unknown;
3606
3747
  };
3607
3748
  content: {
3608
3749
  "application/json": {
3609
- /** @description The most specific covering provider's id, if any — a convenience for the common single-provider case. */
3750
+ /** @description The first resolved provider's id, if any — a convenience for the common single-provider case. */
3610
3751
  providerId?: components["schemas"]["ProviderID"];
3611
- /** @description True when no existing provider covers the full selection (a new one must be created/stitched). */
3752
+ /** @description True when some selected data point has no provider (see `uncovered`) — a new provider must be authored. */
3612
3753
  needsCreation: boolean;
3613
3754
  providers: {
3614
3755
  providerId: components["schemas"]["ProviderID"];
3615
3756
  slug: string;
3757
+ /** @description The selected data points this provider covers. */
3616
3758
  dataPoints: string[];
3759
+ /** @description Recent verification health for this provider (last 30 days). Present only when there is enough history (a minimum number of attempts) to be meaningful; absent for new or rarely-used providers. Used to break ranking ties between providers covering the same data points. */
3760
+ reliability?: {
3761
+ /**
3762
+ * Format: float
3763
+ * @description Fraction of recent sessions that started this provider and completed its claim without failure.
3764
+ */
3765
+ recentSuccessRate: number;
3766
+ /** @description Number of recent sessions that started this provider (the sample size behind `recentSuccessRate`). */
3767
+ attempts: number;
3768
+ };
3769
+ }[];
3770
+ /** @description Selected data points no existing provider exposes. */
3771
+ uncovered: string[];
3772
+ /** @description Inputs the consumer must supply at verification time (passed as session `context`). Collect these from the user. */
3773
+ requiredContext: {
3774
+ key: string;
3775
+ required: boolean;
3776
+ description?: string;
3777
+ }[];
3778
+ /** @description Whether the resolved providers fuse into one. Informational — `POST /verifications/sessions` already accepts the whole `providers` array. */
3779
+ merge: {
3780
+ mergeable: boolean;
3781
+ /** @description True when merging removes duplicate requests to the same endpoint (saved overfetch). */
3782
+ dedupedSomeRequests?: boolean;
3783
+ };
3784
+ };
3785
+ };
3786
+ };
3787
+ default: components["responses"]["ProblemResponse"];
3788
+ };
3789
+ };
3790
+ DiscoverDataPoints: {
3791
+ parameters: {
3792
+ query: {
3793
+ /** @description Website domain (normalized server-side). */
3794
+ domain: string;
3795
+ /** @description Case-insensitive filter over data-point names. */
3796
+ q?: string;
3797
+ };
3798
+ header?: never;
3799
+ path?: never;
3800
+ cookie?: never;
3801
+ };
3802
+ requestBody?: never;
3803
+ responses: {
3804
+ /** @description Verifiable data points (possibly none). */
3805
+ 200: {
3806
+ headers: {
3807
+ [name: string]: unknown;
3808
+ };
3809
+ content: {
3810
+ "application/json": {
3811
+ dataPoints: {
3812
+ name: string;
3813
+ description?: string;
3814
+ providerCount: number;
3617
3815
  }[];
3618
3816
  };
3619
3817
  };