@mercuryo-ai/magicpay-sdk 0.1.0-test.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/LICENSE.md ADDED
@@ -0,0 +1,56 @@
1
+ # Proprietary Commercial SDK License
2
+
3
+ This license governs the use and distribution of the `@mercuryo-ai/magicpay-sdk`
4
+ package and its accompanying documentation materials (collectively, the
5
+ "SDK").
6
+
7
+ The SDK is licensed, not sold. Subject to your compliance with this license,
8
+ the SDK distributor and copyright holder (the "Licensor") grants you a
9
+ limited, non-exclusive, non-transferable, non-sublicensable license to:
10
+
11
+ - install and use the SDK internally;
12
+ - reproduce the SDK as reasonably necessary to build, test, deploy, and run
13
+ your applications or internal services;
14
+ - integrate the SDK into your applications and internal systems solely to
15
+ interoperate with MagicPay-powered workflows and services.
16
+
17
+ Except as expressly permitted above, you may not:
18
+
19
+ - use the SDK, or any part of it, to build, offer, operate, or support any
20
+ competing product or service that is substantially similar to MagicPay or
21
+ materially substitutes for MagicPay;
22
+ - sell, resell, rent, lease, sublicense, assign, or otherwise transfer rights
23
+ to the SDK;
24
+ - distribute, publish, or make the SDK available as a standalone package,
25
+ toolkit, SDK, developer product, or reusable component for third parties;
26
+ - publish, disclose, or redistribute the SDK source code, except as strictly
27
+ required by applicable law;
28
+ - remove or obscure copyright, trademark, attribution, or license notices
29
+ included with the SDK.
30
+
31
+ You may distribute your own applications that incorporate or call the SDK only
32
+ as part of your broader application or service, and not in a manner that makes
33
+ the SDK itself available for third-party reuse as a standalone developer
34
+ offering.
35
+
36
+ All rights not expressly granted are reserved by the Licensor.
37
+
38
+ The SDK may include or depend on third-party software components that are made
39
+ available under separate license terms. Your use of those components remains
40
+ subject to their applicable third-party licenses.
41
+
42
+ This license automatically terminates if you breach it. Upon termination, you
43
+ must stop using the SDK and delete all copies in your possession or control,
44
+ except to the extent retention is required by law.
45
+
46
+ THE SDK IS PROVIDED "AS IS", WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
47
+ EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE, TITLE, OR NON-INFRINGEMENT. TO THE MAXIMUM
49
+ EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSOR WILL NOT BE LIABLE FOR ANY
50
+ INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES,
51
+ OR FOR ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL, OR BUSINESS INTERRUPTION,
52
+ ARISING OUT OF OR RELATED TO THE SDK OR THIS LICENSE. TO THE MAXIMUM EXTENT
53
+ PERMITTED BY APPLICABLE LAW, THE LICENSOR'S TOTAL LIABILITY ARISING OUT OF OR
54
+ RELATED TO THE SDK OR THIS LICENSE WILL NOT EXCEED THE AMOUNT YOU PAID, IF ANY,
55
+ FOR THE SDK DURING THE TWELVE MONTHS PRECEDING THE EVENT GIVING RISE TO THE
56
+ CLAIM.
package/README.md ADDED
@@ -0,0 +1,426 @@
1
+ # @mercuryo-ai/magicpay-sdk
2
+
3
+ MagicPay SDK is the TypeScript and Node client for MagicPay workflow sessions and
4
+ secret request flows. It gives a trusted runtime a consistent way to read
5
+ session state, fetch a stored-secret catalog, create a secret request, poll for
6
+ approval, and claim a one-time secret payload. The root package is the MagicPay
7
+ domain surface. AgentBrowse-specific form matching and protected-fill helpers
8
+ live in a separate `@mercuryo-ai/magicpay-sdk/agentbrowse` subpath.
9
+
10
+ ## Install
11
+
12
+ Install the MagicPay SDK:
13
+
14
+ ```bash
15
+ npm i @mercuryo-ai/magicpay-sdk
16
+ ```
17
+
18
+ For AgentBrowse-based browser execution, install both packages:
19
+
20
+ ```bash
21
+ npm i @mercuryo-ai/magicpay-sdk @mercuryo-ai/agentbrowse
22
+ ```
23
+
24
+ ## API Access
25
+
26
+ MagicPay API base URL:
27
+
28
+ ```text
29
+ https://agents-api.mercuryo.io/functions/v1/api
30
+ ```
31
+
32
+ Create an API key in your MagicPay control plane and pass both values into
33
+ `createMagicPayClient(...)`.
34
+
35
+ ## Entrypoints
36
+
37
+ | Entrypoint | Purpose |
38
+ | --- | --- |
39
+ | `@mercuryo-ai/magicpay-sdk` | Networked MagicPay client and consumer-facing types. |
40
+ | `@mercuryo-ai/magicpay-sdk/core` | Pure domain helpers for session state and secret request status interpretation. |
41
+ | `@mercuryo-ai/magicpay-sdk/agentbrowse` | Bridge helpers for AgentBrowse observed forms and protected fill execution. |
42
+
43
+ ## Runtime Model
44
+
45
+ MagicPay SDK is runtime-agnostic. The root package works with any trusted
46
+ runtime that can create a MagicPay request input and consume a claimed secret
47
+ payload. AgentBrowse is one browser runtime integration path. Claimed secret
48
+ values can be consumed by browser automation, API clients, MCP tools, or custom
49
+ agent runtimes.
50
+
51
+ ## Integration Modes
52
+
53
+ MagicPay SDK supports two explicit integration modes.
54
+
55
+ ### Mode A. Runtime-Agnostic Secret Flow
56
+
57
+ Use only the root `@mercuryo-ai/magicpay-sdk` entrypoint when your runtime already
58
+ knows how it wants to consume a claimed secret payload.
59
+
60
+ In this mode you:
61
+
62
+ - create or read sessions;
63
+ - fetch catalogs;
64
+ - create secret requests;
65
+ - poll until approval or another terminal status;
66
+ - claim the one-time payload;
67
+ - hand the payload to your own browser automation, API client, MCP tool, or
68
+ other runtime.
69
+
70
+ This mode does not require AgentBrowse imports.
71
+
72
+ ### Mode B. Explicit AgentBrowse Bridge
73
+
74
+ Use `@mercuryo-ai/magicpay-sdk/agentbrowse` only when your runtime already uses
75
+ `@mercuryo-ai/agentbrowse` and wants a typed bridge from observed forms to MagicPay
76
+ request inputs and protected-fill execution.
77
+
78
+ In this mode you:
79
+
80
+ - observe protected forms with AgentBrowse;
81
+ - build MagicPay request input from an observed form;
82
+ - enrich observed forms with catalog candidates;
83
+ - prepare protected-fill input from a fulfilled MagicPay claim.
84
+
85
+ AgentBrowse stays an explicit optional dependency. The root SDK does not
86
+ implicitly enable or require it.
87
+
88
+ ## Glossary
89
+
90
+ | Term | Meaning |
91
+ | --- | --- |
92
+ | `session` | One MagicPay workflow session. |
93
+ | `catalog` | Stored secrets available for a host inside a session. |
94
+ | `storedSecretRef` | The saved secret you want MagicPay to provide for a request. |
95
+ | `secret request` | A request for a one-time secret payload tied to a workflow step. |
96
+ | `claim` | The one-time retrieval of approved secret values. |
97
+ | `fillRef` | Stable identifier for the protected fill target tied to a request. |
98
+ | `pageRef` | Stable identifier for the observed page that contains the fill target. |
99
+ | `scopeRef` | Stable identifier for a protected surface inside the page. |
100
+
101
+ ## Main Flow
102
+
103
+ ```mermaid
104
+ flowchart LR
105
+ A[sessionId] --> B[fetchCatalog]
106
+ B --> C[pick storedSecretRef]
107
+ C --> D{input source}
108
+ D -->|manual| E[build request input]
109
+ D -->|AgentBrowse| F[buildRequestInputForObservedForm]
110
+ E --> G[client.secrets.createRequest]
111
+ F --> G
112
+ G --> H[pollUntil]
113
+ H -->|fulfilled| I[claim]
114
+ H -->|denied / expired / failed / canceled| J[branch in your app]
115
+ I --> K{payload consumer}
116
+ K -->|custom runtime| L[consume secret values]
117
+ K -->|AgentBrowse| M[prepareProtectedFillFromClaim]
118
+ M --> N[fillProtectedForm]
119
+ ```
120
+
121
+ ## Quick Start
122
+
123
+ ### Root Client
124
+
125
+ Use the root package when your runtime already knows the request context it
126
+ wants to send to MagicPay. This is Mode A: runtime-agnostic secret flow.
127
+
128
+ ```ts
129
+ import { createMagicPayClient } from '@mercuryo-ai/magicpay-sdk';
130
+
131
+ // Create a networked MagicPay client for your runtime.
132
+ const client = createMagicPayClient({
133
+ gateway: {
134
+ apiKey: process.env.MAGICPAY_API_KEY!,
135
+ apiUrl: 'https://agents-api.mercuryo.io/functions/v1/api',
136
+ },
137
+ });
138
+
139
+ const sessionId = 'sess_123';
140
+ const pageUrl = 'https://checkout.airline.example/payment';
141
+
142
+ // Load the stored-secret catalog for the current host.
143
+ const catalog = await client.secrets.fetchCatalog(sessionId, pageUrl);
144
+
145
+ // Create a request for one stored secret and the exact fields this step needs.
146
+ const created = await client.secrets.createRequest({
147
+ sessionId,
148
+ clientRequestId: 'checkout-card-1',
149
+ fillRef: 'checkout_card',
150
+ purpose: 'payment_card',
151
+ merchantName: 'Airline Example',
152
+ page: {
153
+ url: pageUrl,
154
+ title: 'Payment',
155
+ },
156
+ secretHint: {
157
+ storedSecretRef: 'secret_card_primary',
158
+ kind: 'payment_card',
159
+ host: catalog.host,
160
+ scopeRef: 'payment_surface',
161
+ fields: ['pan', 'exp_month', 'exp_year', 'cvv'],
162
+ },
163
+ });
164
+
165
+ // Wait for approval or another terminal outcome.
166
+ const ready = await client.secrets.pollUntil(sessionId, created.requestId);
167
+ if (!ready.success) {
168
+ throw new Error(ready.reason);
169
+ }
170
+ if (ready.result.snapshot.status !== 'fulfilled') {
171
+ throw new Error(`Request ended as ${ready.result.snapshot.status}`);
172
+ }
173
+
174
+ // Claim the one-time secret payload after approval.
175
+ const claim = await client.secrets.claim(sessionId, created.requestId);
176
+ if (!claim.success) {
177
+ throw new Error(claim.reason);
178
+ }
179
+
180
+ // Use the claimed values in your runtime.
181
+ console.log(claim.result.secret.values);
182
+ ```
183
+
184
+ ### AgentBrowse Bridge
185
+
186
+ Use the AgentBrowse subpath when your runtime starts from `observe(...)` and
187
+ then wants to request and fill a secret through MagicPay. This is Mode B:
188
+ explicit AgentBrowse bridge.
189
+
190
+ ```ts
191
+ import { act, observe } from '@mercuryo-ai/agentbrowse';
192
+ import {
193
+ fillProtectedForm,
194
+ type ProtectedFillForm,
195
+ } from '@mercuryo-ai/agentbrowse/protected-fill';
196
+ import { createMagicPayClient } from '@mercuryo-ai/magicpay-sdk';
197
+ import {
198
+ buildRequestInputForObservedForm,
199
+ enrichObservedFormsForUrl,
200
+ prepareProtectedFillFromClaim,
201
+ } from '@mercuryo-ai/magicpay-sdk/agentbrowse';
202
+
203
+ // Create the MagicPay client that will own the approval flow.
204
+ const client = createMagicPayClient({
205
+ gateway: {
206
+ apiKey: process.env.MAGICPAY_API_KEY!,
207
+ apiUrl: 'https://agents-api.mercuryo.io/functions/v1/api',
208
+ },
209
+ });
210
+
211
+ const sessionId = 'sess_123';
212
+
213
+ // Observe the current page and collect protected fill forms.
214
+ const observation = await observe(browserSession, 'Find the login form');
215
+ if (!observation.success || !observation.url || !Array.isArray(observation.fillableForms)) {
216
+ throw new Error('AgentBrowse did not return observed forms.');
217
+ }
218
+
219
+ const observedForms = observation.fillableForms as ProtectedFillForm[];
220
+
221
+ // Load the stored-secret catalog for the observed host.
222
+ const catalog = await client.secrets.fetchCatalog(sessionId, observation.url);
223
+
224
+ // Attach catalog candidates to the observed forms.
225
+ const enrichedForms = enrichObservedFormsForUrl(
226
+ observedForms,
227
+ { [catalog.host]: catalog },
228
+ observation.url
229
+ );
230
+ const loginForm =
231
+ enrichedForms.find((form) => form.purpose === 'login') ?? enrichedForms[0] ?? null;
232
+ if (!loginForm) {
233
+ throw new Error('No protected fill form was observed.');
234
+ }
235
+
236
+ // Convert the observed form into a MagicPay secret request input.
237
+ const requestInput = buildRequestInputForObservedForm({
238
+ sessionId,
239
+ merchantName: 'Airline Example',
240
+ storedSecretRef: 'secret_login_primary',
241
+ urlOrHost: observation.url,
242
+ catalog,
243
+ fillableForm: loginForm,
244
+ page: {
245
+ ref: loginForm.pageRef,
246
+ url: observation.url,
247
+ ...(observation.title ? { title: observation.title } : {}),
248
+ },
249
+ });
250
+
251
+ if (!requestInput.success) {
252
+ throw new Error(requestInput.reason);
253
+ }
254
+
255
+ // Create the approval request and wait until it is fulfilled.
256
+ const created = await client.secrets.createRequest(requestInput.input);
257
+ const ready = await client.secrets.pollUntil(sessionId, created.requestId);
258
+ if (!ready.success) {
259
+ throw new Error(ready.reason);
260
+ }
261
+ if (ready.result.snapshot.status !== 'fulfilled') {
262
+ throw new Error(`Request ended as ${ready.result.snapshot.status}`);
263
+ }
264
+
265
+ // Claim the one-time payload once the request is approved.
266
+ const claim = await client.secrets.claim(sessionId, created.requestId);
267
+ if (!claim.success) {
268
+ throw new Error(claim.reason);
269
+ }
270
+
271
+ // Convert the claim into AgentBrowse protected-fill input.
272
+ const prepared = prepareProtectedFillFromClaim({
273
+ fillableForm: loginForm,
274
+ catalog,
275
+ claim: claim.result,
276
+ request: created.snapshot,
277
+ });
278
+
279
+ // Fill the protected fields in the browser.
280
+ const browserFill = await fillProtectedForm({
281
+ session: browserSession,
282
+ fillableForm: prepared.fillableForm,
283
+ protectedValues: prepared.protectedValues,
284
+ fieldPolicies: prepared.fieldPolicies,
285
+ });
286
+
287
+ if (!browserFill.success) {
288
+ throw new Error(browserFill.reason);
289
+ }
290
+
291
+ // Re-observe after the protected fill. The submit button is a fresh action target,
292
+ // so reacquire it from the live page instead of guessing from older inventory.
293
+ const submitObservation = await observe(
294
+ browserSession,
295
+ 'Find the single actionable submit target that sends the filled login form.'
296
+ );
297
+ if (!submitObservation.success || submitObservation.targets.length === 0) {
298
+ throw new Error(submitObservation.reason ?? submitObservation.message);
299
+ }
300
+
301
+ // Goal-based observe narrows the inventory to the submit action we care about.
302
+ const submitTarget = submitObservation.targets[0];
303
+ if (!submitTarget?.ref || submitTarget.capability !== 'actionable') {
304
+ throw new Error('AgentBrowse did not return an actionable submit target.');
305
+ }
306
+
307
+ const submitAction = await act(browserSession, submitTarget.ref, 'click');
308
+ if (!submitAction.success) {
309
+ throw new Error(submitAction.reason ?? submitAction.message);
310
+ }
311
+ ```
312
+
313
+ ### Claim And Use Secrets Outside The Browser
314
+
315
+ Use the claimed payload directly when your runtime wants to authenticate to an
316
+ API, call a provider SDK, or pass a secret into an MCP tool flow.
317
+
318
+ ```ts
319
+ import { createMagicPayClient } from '@mercuryo-ai/magicpay-sdk';
320
+
321
+ // Create the MagicPay client for the claim step.
322
+ const client = createMagicPayClient({
323
+ gateway: {
324
+ apiKey: process.env.MAGICPAY_API_KEY!,
325
+ apiUrl: 'https://agents-api.mercuryo.io/functions/v1/api',
326
+ },
327
+ });
328
+
329
+ // Claim the approved secret payload.
330
+ const claim = await client.secrets.claim('sess_123', 'req_123');
331
+ if (!claim.success) {
332
+ throw new Error(claim.reason);
333
+ }
334
+
335
+ // Forward the claimed values to the API you want to call.
336
+ const response = await fetch('https://api.airline.example/login', {
337
+ method: 'POST',
338
+ headers: { 'content-type': 'application/json' },
339
+ body: JSON.stringify({
340
+ username: claim.result.secret.values.username,
341
+ password: claim.result.secret.values.password,
342
+ }),
343
+ });
344
+
345
+ if (!response.ok) {
346
+ throw new Error(`Provider login failed with ${response.status}`);
347
+ }
348
+ ```
349
+
350
+ ## Polling Defaults
351
+
352
+ `client.secrets.pollUntil(...)` uses a conservative profile by default:
353
+
354
+ - timeout: `180_000` ms
355
+ - initial interval: `10_000` ms
356
+ - max interval: `30_000` ms
357
+ - backoff multiplier: `1.2`
358
+
359
+ Override these values when your application needs a different approval window.
360
+
361
+ ## Error Reference
362
+
363
+ ### `buildRequestInputForObservedForm(...)`
364
+
365
+ | Kind | When it happens | What to do |
366
+ | --- | --- | --- |
367
+ | `host_resolution_failed` | No usable host could be resolved from the page URL, host, or catalog. | Pass a valid page URL or a catalog with a host. |
368
+ | `stored_secret_not_available` | The chosen `storedSecretRef` is not available for the observed form and host. | Fetch the catalog again or choose a different stored secret. |
369
+
370
+ ### `client.secrets.poll(...)` and `client.secrets.pollUntil(...)`
371
+
372
+ | Kind | When it happens | What to do |
373
+ | --- | --- | --- |
374
+ | `not_found` | The request ID does not exist in the session. | Recreate the request or refresh local state. |
375
+ | `aborted` | The caller aborted the poll. | Decide whether to resume or stop. |
376
+ | `other` | MagicPay returned another transport or backend failure. | Inspect `status`, `errorCode`, and logs. |
377
+ | `timeout` | `pollUntil(...)` exceeded its timeout. | Continue polling later or surface a timeout to the user. |
378
+
379
+ ### `client.secrets.claim(...)`
380
+
381
+ | Kind | When it happens | What to do |
382
+ | --- | --- | --- |
383
+ | `not_fulfilled` | The request is not approved yet. | Keep polling or ask the user to approve it. |
384
+ | `already_claimed` | The one-time secret payload was already claimed. | Create a new secret request. |
385
+ | `aborted` | The caller aborted the claim request. | Retry only if the application still needs the payload. |
386
+ | `other` | MagicPay returned another transport or backend failure. | Inspect `status`, `errorCode`, and logs. |
387
+
388
+ ## `nextAction` Reference
389
+
390
+ `describeSecretRequestStatus(...)` and `pollUntil(...)` return a status contract with
391
+ `nextAction` values that are useful for orchestration:
392
+
393
+ | `nextAction` | Meaning |
394
+ | --- | --- |
395
+ | `poll-secret` | Approval is still pending. |
396
+ | `fill-secret` | The request is fulfilled and can be claimed. |
397
+ | `ask-user` | A human decision or recovery step is needed. |
398
+ | `request-secret` | Create a new request instead of continuing the current one. |
399
+
400
+ ## Testing
401
+
402
+ Pass `fetchImpl` into `createMagicPayClient(...)` to fully control network
403
+ responses in tests.
404
+
405
+ ```ts
406
+ import { createMagicPayClient } from '@mercuryo-ai/magicpay-sdk';
407
+
408
+ const client = createMagicPayClient({
409
+ gateway: {
410
+ apiKey: 'test_api_key',
411
+ apiUrl: 'https://agents-api.mercuryo.io/functions/v1/api',
412
+ },
413
+ fetchImpl: async (url, init = {}) => {
414
+ const method = (init.method ?? 'GET').toUpperCase();
415
+ if (method === 'GET' && String(url).includes('/secrets/catalog')) {
416
+ return new Response(JSON.stringify([]), {
417
+ status: 200,
418
+ headers: { 'content-type': 'application/json' },
419
+ });
420
+ }
421
+ throw new Error(`Unexpected ${method} ${url}`);
422
+ },
423
+ });
424
+ ```
425
+
426
+ See [`docs/examples.md`](./docs/examples.md) for more complete recipes.
@@ -0,0 +1,66 @@
1
+ import type { ProtectedFieldPolicies, ProtectedFillForm } from '@mercuryo-ai/agentbrowse';
2
+ import type { ClaimSecretRequestResult, CreateSecretRequestInput, SecretCatalog, SecretCatalogByHost, SecretRequestSnapshot, StoredSecretFieldKey, StoredSecretFieldPolicies, StoredSecretKind, StoredSecretScope } from './secret-flow.js';
3
+ export interface ObservedFormStoredSecretCandidate {
4
+ storedSecretRef: string;
5
+ kind: StoredSecretKind;
6
+ scope: StoredSecretScope;
7
+ displayName: string;
8
+ matchConfidence: 'high' | 'medium' | 'low';
9
+ intentRequired: boolean;
10
+ fieldKeys?: StoredSecretFieldKey[];
11
+ fieldPolicies?: StoredSecretFieldPolicies;
12
+ }
13
+ export type ObservedFormWithStoredSecrets<TForm extends ProtectedFillForm = ProtectedFillForm> = TForm & {
14
+ storedSecretCandidates: ObservedFormStoredSecretCandidate[];
15
+ };
16
+ export type BuildRequestInputForObservedFormFailureKind = 'host_resolution_failed' | 'stored_secret_not_available';
17
+ export type BuildRequestInputForObservedFormOutcome<TForm extends ProtectedFillForm = ProtectedFillForm> = {
18
+ success: true;
19
+ host: string;
20
+ catalog: SecretCatalog;
21
+ candidate: ObservedFormStoredSecretCandidate;
22
+ input: CreateSecretRequestInput;
23
+ fillableForm: TForm;
24
+ } | {
25
+ success: false;
26
+ kind: BuildRequestInputForObservedFormFailureKind;
27
+ reason: string;
28
+ host: string | null;
29
+ catalog: SecretCatalog | null;
30
+ fillableForm: TForm;
31
+ };
32
+ export type PreparedProtectedFill<TForm extends ProtectedFillForm = ProtectedFillForm> = {
33
+ fillableForm: TForm;
34
+ storedSecretCandidate: ObservedFormStoredSecretCandidate | null;
35
+ protectedValues: ClaimSecretRequestResult['secret']['values'];
36
+ storedSecretRef: string | null;
37
+ fieldPolicies?: ProtectedFieldPolicies;
38
+ };
39
+ export declare function buildObservedFormStoredSecretCandidates(form: Pick<ProtectedFillForm, 'purpose' | 'fields'>, catalog: SecretCatalog | null): ObservedFormStoredSecretCandidate[];
40
+ export declare function findObservedFormStoredSecretCandidate(form: Pick<ProtectedFillForm, 'purpose' | 'fields'>, catalog: SecretCatalog | null, storedSecretRef: string | undefined): ObservedFormStoredSecretCandidate | null;
41
+ export declare function enrichObservedFormWithStoredSecrets<TForm extends ProtectedFillForm>(form: TForm, catalog: SecretCatalog | null): ObservedFormWithStoredSecrets<TForm>;
42
+ export declare function enrichObservedFormsWithStoredSecrets<TForm extends ProtectedFillForm>(forms: ReadonlyArray<TForm>, catalog: SecretCatalog | null): Array<ObservedFormWithStoredSecrets<TForm>>;
43
+ export declare function enrichObservedFormsForUrl<TForm extends ProtectedFillForm>(forms: ReadonlyArray<TForm>, catalogByHost: SecretCatalogByHost | undefined, urlOrHost: string): Array<ObservedFormWithStoredSecrets<TForm>>;
44
+ export declare function buildRequestInputForObservedForm<TForm extends ProtectedFillForm>(params: {
45
+ sessionId: string;
46
+ clientRequestId?: string;
47
+ merchantName: string;
48
+ fillableForm: TForm;
49
+ storedSecretRef: string;
50
+ urlOrHost?: string;
51
+ catalog?: SecretCatalog | null;
52
+ page?: {
53
+ ref?: string;
54
+ url?: string;
55
+ title?: string;
56
+ };
57
+ run?: CreateSecretRequestInput['run'];
58
+ step?: CreateSecretRequestInput['step'];
59
+ }): BuildRequestInputForObservedFormOutcome<TForm>;
60
+ export declare function prepareProtectedFillFromClaim<TForm extends ProtectedFillForm>(params: {
61
+ fillableForm: TForm;
62
+ catalog: SecretCatalog | null;
63
+ claim: ClaimSecretRequestResult;
64
+ request?: Pick<SecretRequestSnapshot, 'storedSecretRef'> | null;
65
+ }): PreparedProtectedFill<TForm>;
66
+ //# sourceMappingURL=agentbrowse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentbrowse.d.ts","sourceRoot":"","sources":["../src/agentbrowse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,GAAG,QAAQ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