@onkernel/sdk 0.100.0 → 0.102.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 (110) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/browser-routing.d.mts.map +1 -1
  11. package/lib/browser-routing.d.ts.map +1 -1
  12. package/lib/browser-routing.js +23 -6
  13. package/lib/browser-routing.js.map +1 -1
  14. package/lib/browser-routing.mjs +23 -6
  15. package/lib/browser-routing.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/auth/connections.d.mts +6 -0
  18. package/resources/auth/connections.d.mts.map +1 -1
  19. package/resources/auth/connections.d.ts +6 -0
  20. package/resources/auth/connections.d.ts.map +1 -1
  21. package/resources/browsers/computer.d.mts +6 -2
  22. package/resources/browsers/computer.d.mts.map +1 -1
  23. package/resources/browsers/computer.d.ts +6 -2
  24. package/resources/browsers/computer.d.ts.map +1 -1
  25. package/resources/browsers/telemetry.d.mts +4 -3
  26. package/resources/browsers/telemetry.d.mts.map +1 -1
  27. package/resources/browsers/telemetry.d.ts +4 -3
  28. package/resources/browsers/telemetry.d.ts.map +1 -1
  29. package/resources/config-registry/config-registry.d.mts +58 -8
  30. package/resources/config-registry/config-registry.d.mts.map +1 -1
  31. package/resources/config-registry/config-registry.d.ts +58 -8
  32. package/resources/config-registry/config-registry.d.ts.map +1 -1
  33. package/resources/config-registry/config-registry.js.map +1 -1
  34. package/resources/config-registry/config-registry.mjs.map +1 -1
  35. package/resources/index.d.mts +1 -0
  36. package/resources/index.d.mts.map +1 -1
  37. package/resources/index.d.ts +1 -0
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +3 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +1 -0
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/invocations.d.mts +44 -15
  44. package/resources/invocations.d.mts.map +1 -1
  45. package/resources/invocations.d.ts +44 -15
  46. package/resources/invocations.d.ts.map +1 -1
  47. package/resources/organization/entitlements.d.mts +20 -0
  48. package/resources/organization/entitlements.d.mts.map +1 -1
  49. package/resources/organization/entitlements.d.ts +20 -0
  50. package/resources/organization/entitlements.d.ts.map +1 -1
  51. package/resources/organization/limits.d.mts +10 -1
  52. package/resources/organization/limits.d.mts.map +1 -1
  53. package/resources/organization/limits.d.ts +10 -1
  54. package/resources/organization/limits.d.ts.map +1 -1
  55. package/resources/organization/limits.js +1 -1
  56. package/resources/organization/limits.mjs +1 -1
  57. package/resources/proxies.d.mts +36 -18
  58. package/resources/proxies.d.mts.map +1 -1
  59. package/resources/proxies.d.ts +36 -18
  60. package/resources/proxies.d.ts.map +1 -1
  61. package/resources/vault-provider-configs.d.mts +179 -0
  62. package/resources/vault-provider-configs.d.mts.map +1 -0
  63. package/resources/vault-provider-configs.d.ts +179 -0
  64. package/resources/vault-provider-configs.d.ts.map +1 -0
  65. package/resources/vault-provider-configs.js +99 -0
  66. package/resources/vault-provider-configs.js.map +1 -0
  67. package/resources/vault-provider-configs.mjs +95 -0
  68. package/resources/vault-provider-configs.mjs.map +1 -0
  69. package/resources/vaults/index.d.mts +1 -1
  70. package/resources/vaults/index.d.mts.map +1 -1
  71. package/resources/vaults/index.d.ts +1 -1
  72. package/resources/vaults/index.d.ts.map +1 -1
  73. package/resources/vaults/index.js.map +1 -1
  74. package/resources/vaults/index.mjs.map +1 -1
  75. package/resources/vaults/items.d.mts +662 -36
  76. package/resources/vaults/items.d.mts.map +1 -1
  77. package/resources/vaults/items.d.ts +662 -36
  78. package/resources/vaults/items.d.ts.map +1 -1
  79. package/resources/vaults/items.js +99 -6
  80. package/resources/vaults/items.js.map +1 -1
  81. package/resources/vaults/items.mjs +99 -6
  82. package/resources/vaults/items.mjs.map +1 -1
  83. package/resources/vaults/vaults.d.mts +33 -4
  84. package/resources/vaults/vaults.d.mts.map +1 -1
  85. package/resources/vaults/vaults.d.ts +33 -4
  86. package/resources/vaults/vaults.d.ts.map +1 -1
  87. package/resources/vaults/vaults.js +31 -2
  88. package/resources/vaults/vaults.js.map +1 -1
  89. package/resources/vaults/vaults.mjs +31 -2
  90. package/resources/vaults/vaults.mjs.map +1 -1
  91. package/src/client.ts +19 -0
  92. package/src/lib/browser-routing.ts +27 -6
  93. package/src/resources/auth/connections.ts +7 -0
  94. package/src/resources/browsers/computer.ts +6 -2
  95. package/src/resources/browsers/telemetry.ts +5 -2
  96. package/src/resources/config-registry/config-registry.ts +71 -8
  97. package/src/resources/index.ts +8 -0
  98. package/src/resources/invocations.ts +44 -15
  99. package/src/resources/organization/entitlements.ts +23 -0
  100. package/src/resources/organization/limits.ts +12 -1
  101. package/src/resources/proxies.ts +36 -18
  102. package/src/resources/vault-provider-configs.ts +250 -0
  103. package/src/resources/vaults/index.ts +9 -0
  104. package/src/resources/vaults/items.ts +818 -35
  105. package/src/resources/vaults/vaults.ts +49 -2
  106. package/src/version.ts +1 -1
  107. package/version.d.mts +1 -1
  108. package/version.d.ts +1 -1
  109. package/version.js +1 -1
  110. package/version.mjs +1 -1
@@ -9,34 +9,127 @@ export declare class Items extends APIResource {
9
9
  * description before using it. Expanded data is fetched from the provider and is
10
10
  * not persisted in the vault item. Requesting an unavailable expansion returns 409
11
11
  * instead of a partial item.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const vaultItem = await client.vaults.items.retrieve('x', {
16
+ * id_or_name: 'id_or_name',
17
+ * });
18
+ * ```
12
19
  */
13
20
  retrieve(key: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<VaultItem>;
14
21
  /**
15
- * Update a card specification before or between authorizations
22
+ * Requested cards accept a replacement specification. Pending issuance requests
23
+ * may update provider-supported fields on their existing request, subject to
24
+ * atomic provider approval checks; omitted optional fields remain unchanged and
25
+ * explicit empty lists clear them. Wallet/provider binding and unsupported fields
26
+ * cannot change after authorization starts. An uncertain update enters
27
+ * recovery_required and must not be retried. Checkout cards may be edited between
28
+ * authorizations.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const vaultItem = await client.vaults.items.update('x', {
33
+ * id_or_name: 'id_or_name',
34
+ * spec: {
35
+ * provider: 'link',
36
+ * wallet: 'link-wallet',
37
+ * payment_method_id: 'pm_example',
38
+ * amount: 3000,
39
+ * currency: 'usd',
40
+ * merchant_name: 'Example Store',
41
+ * merchant_url: 'https://store.example.com',
42
+ * context:
43
+ * 'The order total changed to USD 30.00 including shipping and taxes for one notebook. Update this unapproved request rather than creating a second payment.',
44
+ * },
45
+ * });
46
+ * ```
16
47
  */
17
48
  update(key: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<VaultItem>;
18
49
  /**
19
50
  * List vault items without secret values
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const vaultItems = await client.vaults.items.list(
55
+ * 'id_or_name',
56
+ * );
57
+ * ```
20
58
  */
21
59
  list(idOrName: string, options?: RequestOptions): APIPromise<ItemListResponse>;
22
60
  /**
23
- * Delete a vault item and invalidate its secret value
61
+ * Unresolved payment operations normally block deletion, including operations on
62
+ * child cards of a wallet. An AgentCard card in recovery_required whose checkout
63
+ * create response returned no authorization ID may be explicitly abandoned by
64
+ * deleting that card directly; deleting its wallet or vault remains blocked.
65
+ * Deleting or recreating an item is not proof that a payment did not occur.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * await client.vaults.items.delete('x', {
70
+ * id_or_name: 'id_or_name',
71
+ * });
72
+ * ```
24
73
  */
25
74
  delete(key: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void>;
26
75
  /**
27
76
  * List immutable audit events for a vault item
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const vaultItemEvents = await client.vaults.items.events(
81
+ * 'key',
82
+ * { id_or_name: 'id_or_name' },
83
+ * );
84
+ * ```
28
85
  */
29
86
  events(key: string, params: ItemEventsParams, options?: RequestOptions): APIPromise<ItemEventsResponse>;
30
87
  /**
31
88
  * Retrieve the item first and invoke only an operation listed in
32
- * `available_operations`, following its natural-language description. Operations
33
- * may call an external provider and can return the item's updated state. If the
34
- * provider rate limits spend-request creation, returns HTTP 429 with code
89
+ * `available_operations`, following its natural-language description. Availability
90
+ * is rechecked at execution time; unavailable operations return 409. Authorization
91
+ * and preparation may call an external provider and return updated state. Link
92
+ * cards advertise authorize without checkout context. Eligible unused AgentCard
93
+ * cards advertise prepare_checkout, which requires checkout context and obtains
94
+ * device approval before native Square Pay. Keep the returned approval page open,
95
+ * poll until ready_to_submit, then submit before preparation.expires_at. Unused
96
+ * preparations expire automatically and cannot be reused. If spend-request
97
+ * creation is rate limited, returns HTTP 429 with code
35
98
  * `spend_request_rate_limited`; stop and back off before retrying.
99
+ *
100
+ * Fill returns a value-free execution result. Validation failures before writing
101
+ * return 400 (invalid request or targets), 403 (access or destination denied), 404
102
+ * (resource not found), or 409 (item or browser not ready). Once writing starts,
103
+ * known partial failures and indeterminate field outcomes return 200 with status
104
+ * `failed` or `unknown`, not an automatic-retry signal. A transport error may
105
+ * leave the outcome unknown; do not automatically retry.
106
+ *
107
+ * @example
108
+ * ```ts
109
+ * const vaultItemOperationResponse =
110
+ * await client.vaults.items.performOperation('key', {
111
+ * id_or_name: 'id_or_name',
112
+ * type: 'authorize',
113
+ * });
114
+ * ```
36
115
  */
37
- performOperation(key: string, params: ItemPerformOperationParams, options?: RequestOptions): APIPromise<VaultItem>;
116
+ performOperation(key: string, params: ItemPerformOperationParams, options?: RequestOptions): APIPromise<VaultItemOperationResponse>;
38
117
  /**
39
- * Create or retrieve an identical vault item by immutable key
118
+ * Create an item under a key unique within its vault, or retrieve the existing
119
+ * item when its specification matches. An identical card PUT returns the existing
120
+ * card in any lifecycle state without polling the provider, reauthorizing,
121
+ * replacing aliases, or resetting recovery. Conflicting specifications return 409.
122
+ * Provider-specific authorization requirements and retry behavior are described in
123
+ * the item's request schema.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * const vaultItem = await client.vaults.items.upsert('x', {
128
+ * id_or_name: 'id_or_name',
129
+ * spec: { provider: 'link' },
130
+ * type: 'card',
131
+ * });
132
+ * ```
40
133
  */
41
134
  upsert(key: string, params: ItemUpsertParams, options?: RequestOptions): APIPromise<VaultItem>;
42
135
  }
@@ -81,6 +174,41 @@ export interface AgentcardCheckoutAuthorization {
81
174
  */
82
175
  replay_status?: number;
83
176
  }
177
+ /**
178
+ * One-use Square checkout preparation. Keep the approval page open through token
179
+ * handoff. The amount is display-only and does not constrain the merchant's
180
+ * eventual charge.
181
+ */
182
+ export interface AgentcardCheckoutPreparation {
183
+ browser_id: string;
184
+ created_at: string;
185
+ environment: 'production' | 'sandbox';
186
+ merchant_origin: string;
187
+ /**
188
+ * Preparation consumed means egress claimed the preparation and it cannot be
189
+ * reused. It does not mean the attempt settled. Use the enclosing item's status as
190
+ * the lifecycle indicator; item consumed means the attempt settled, not that an
191
+ * order or charge succeeded.
192
+ */
193
+ status: 'creating' | 'awaiting_approval' | 'ready' | 'consumed' | 'cancelled' | 'expired' | 'unknown';
194
+ id?: string;
195
+ approval_url?: string;
196
+ /**
197
+ * When ready, the absolute deadline to submit the first native request; no later
198
+ * than provider readiness expiry or 30 seconds after Kernel first observes
199
+ * readiness. Polling never extends this deadline.
200
+ */
201
+ expires_at?: string;
202
+ }
203
+ /**
204
+ * Authorize a Link card using its existing purchase specification. Use only after
205
+ * explicit user approval and when the item advertises authorize. Do not
206
+ * automatically retry provider failures or indeterminate outcomes. Checkout
207
+ * context is not accepted.
208
+ */
209
+ export interface AuthorizeVaultItemOperationRequest {
210
+ type: 'authorize';
211
+ }
84
212
  /**
85
213
  * Live payment card. Test-mode card creation is not supported.
86
214
  */
@@ -181,7 +309,14 @@ export type CardVaultItemState = CardVaultItemState.LinkCardState | CardVaultIte
181
309
  export declare namespace CardVaultItemState {
182
310
  interface LinkCardState {
183
311
  provider: 'link';
184
- status: 'requested' | 'pending_authorization' | 'ready' | 'consumed' | 'expired' | 'declined';
312
+ /**
313
+ * recovery_required means an original provider operation has an unresolved
314
+ * outcome. Do not retry, delete, or replace it. Known references may be observed
315
+ * safely, but unknown creation without an ID and uncertain card-material retrieval
316
+ * require manual reconciliation with the provider or support. There is no reset or
317
+ * caller-asserted reconciliation operation.
318
+ */
319
+ status: 'requested' | 'pending_authorization' | 'ready' | 'consumed' | 'expired' | 'declined' | 'recovery_required';
185
320
  aliases?: ItemsAPI.VaultCardAliases;
186
321
  domains?: Array<string>;
187
322
  masks?: LinkCardState.Masks;
@@ -196,7 +331,18 @@ export declare namespace CardVaultItemState {
196
331
  }
197
332
  interface AgentCardCardState {
198
333
  provider: 'agentcard';
199
- status: 'requested' | 'ready' | 'pending_approval' | 'degraded';
334
+ /**
335
+ * ready_to_submit is device readiness for at most 30 seconds. consumed means the
336
+ * prepared attempt has settled, not that an order succeeded. stopped cannot be
337
+ * reused. outcome_unknown requires merchant reconciliation and blocks new
338
+ * requests. recovery_required means the original checkout outcome is unresolved.
339
+ * Automatic reuse is blocked. Known authorization IDs must be reconciled through
340
+ * provider observations or support. When no authorization ID was returned, an
341
+ * explicitly confirmed item deletion may abandon the unresolved attempt so the
342
+ * caller can create a replacement; deletion does not prove that the original
343
+ * attempt failed. It does not mean declined or expired.
344
+ */
345
+ status: 'requested' | 'ready' | 'preparing' | 'ready_to_submit' | 'pending_approval' | 'consumed' | 'stopped' | 'outcome_unknown' | 'degraded' | 'recovery_required';
200
346
  aliases?: ItemsAPI.VaultCardAliases;
201
347
  /**
202
348
  * The in-flight or most recent checkout authorization. Present while a checkout is
@@ -204,6 +350,12 @@ export declare namespace CardVaultItemState {
204
350
  */
205
351
  authorization?: ItemsAPI.AgentcardCheckoutAuthorization;
206
352
  masks?: AgentCardCardState.Masks;
353
+ /**
354
+ * One-use Square checkout preparation. Keep the approval page open through token
355
+ * handoff. The amount is display-only and does not constrain the merchant's
356
+ * eventual charge.
357
+ */
358
+ preparation?: ItemsAPI.AgentcardCheckoutPreparation;
207
359
  status_reason?: string;
208
360
  }
209
361
  namespace AgentCardCardState {
@@ -214,12 +366,168 @@ export declare namespace CardVaultItemState {
214
366
  }
215
367
  }
216
368
  }
369
+ /**
370
+ * Fill selected fields from one ready, unexpired card into a browser linked to its
371
+ * vault. Only supported for card items created from Link wallets. Only invoke when
372
+ * the item advertises `fill`. Browser and vault must belong to the same project.
373
+ * Kernel checks access and allowed destinations before filling; providing a page
374
+ * URL does not authorize a destination.
375
+ *
376
+ * Find exactly one open page matching `page_url`. For each selector, search the
377
+ * main frame and all descendant frames for editable inputs or selects matched
378
+ * directly or contained within matching elements. Each selector must resolve to
379
+ * one unique editable element across all frames; zero or multiple candidates fail.
380
+ * Count each element once, even if multiple matching containers contain it.
381
+ * Validate all bindings before filling. Select elements match an option by its
382
+ * value, not its label. If the page navigates or a target disappears during
383
+ * filling, stop rather than selecting a different page or element.
384
+ *
385
+ * Fill in request order and stop on the first failure. This operation is not
386
+ * atomic: previously filled fields are not rolled back. Never submit the form or
387
+ * click buttons, though input/change events may trigger site behavior. Fill is the
388
+ * preferred browser-checkout path. Aliases remain an alternative for explicitly
389
+ * chosen egress-substitution integrations. Do not automatically retry or fall back
390
+ * to aliases after a failed or indeterminate operation.
391
+ *
392
+ * Secret values are never returned or included in operation logs, traces, audit
393
+ * events, or error details. This does not prevent an agent with unrestricted
394
+ * browser access from reading values from the page or other browser observation
395
+ * surfaces.
396
+ */
397
+ export interface FillVaultItemOperationRequest {
398
+ /**
399
+ * Browser session ID, not a reusable browser name.
400
+ */
401
+ browser_id: string;
402
+ /**
403
+ * Field bindings for this step. No two bindings may resolve to the same element.
404
+ */
405
+ fields: Array<VaultCardFillField>;
406
+ /**
407
+ * Exact current top-level page URL, including path, query, and fragment. Must
408
+ * match exactly one open page in the browser; zero or multiple matches fail. No
409
+ * prefix or glob matching. Must use HTTPS without embedded credentials.
410
+ */
411
+ page_url: string;
412
+ type: 'fill';
413
+ /**
414
+ * Total operation deadline in milliseconds, not a per-field timeout.
415
+ */
416
+ timeout_ms?: number;
417
+ }
418
+ export interface FillVaultItemOperationResult {
419
+ /**
420
+ * Exactly one result per request binding, in request order. After the first failed
421
+ * or unknown field, all remaining fields are not_attempted.
422
+ */
423
+ fields: Array<VaultFillFieldResult>;
424
+ /**
425
+ * Completed only when all fields were filled. Failed when execution stopped with
426
+ * known outcomes. Unknown when any field's outcome cannot be determined. None of
427
+ * these statuses confirms payment or merchant acceptance.
428
+ */
429
+ status: 'completed' | 'failed' | 'unknown';
430
+ type: 'fill';
431
+ }
432
+ /**
433
+ * Prepare an unused AgentCard card for Square checkout. Deliver the returned
434
+ * approval URL and keep the approval page open. Poll the item until
435
+ * ready_to_submit, then submit native Pay before preparation.expires_at. Readiness
436
+ * lasts at most 30 seconds. Unused preparations expire automatically. Preparations
437
+ * are single-use even after failure or expiry; do not automatically retry and
438
+ * reconcile uncertain outcomes with the merchant.
439
+ */
440
+ export interface PrepareCheckoutVaultItemOperationRequest {
441
+ /**
442
+ * Required when preparing an unused AgentCard card for Square. Consent is bound to
443
+ * this browser and declared merchant origin, not a tab. Wait for the item's
444
+ * ready_to_submit status before native Pay and submit within its readiness
445
+ * deadline. Unused preparations expire automatically; every preparation is
446
+ * single-use, including after failure or expiry.
447
+ */
448
+ checkout: VaultCheckoutContext;
449
+ type: 'prepare_checkout';
450
+ }
217
451
  export interface VaultCardAliases {
218
452
  cvc: string;
219
453
  exp_month: string;
220
454
  exp_year: string;
221
455
  number: string;
222
456
  }
457
+ /**
458
+ * Combined expiration derived from the stored month and year; not a separate
459
+ * stored secret.
460
+ */
461
+ export type VaultCardFillField = VaultCardFillField.VaultCardStoredFillField | VaultCardFillField.VaultCardExpirationFillField;
462
+ export declare namespace VaultCardFillField {
463
+ interface VaultCardStoredFillField {
464
+ /**
465
+ * Field in the decrypted card, not an alias. Number and CVC preserve leading
466
+ * zeros; month uses two digits and year uses four digits. Billing fields use the
467
+ * provider's stored billing address (name, line1, line2, city, state, postal_code,
468
+ * country) without reformatting. Request only needed billing fields. An absent or
469
+ * empty requested billing field returns 400 field_unavailable before any browser
470
+ * writes; it does not make other card fields unavailable.
471
+ */
472
+ field: 'number' | 'exp_month' | 'exp_year' | 'cvc' | 'billing_name' | 'billing_line1' | 'billing_line2' | 'billing_city' | 'billing_state' | 'billing_postal_code' | 'billing_country';
473
+ /**
474
+ * CSS selector for an editable input or select, or a containing element. Must
475
+ * resolve to one unique editable element across all page frames.
476
+ */
477
+ selector: string;
478
+ }
479
+ /**
480
+ * Combined expiration derived from the stored month and year; not a separate
481
+ * stored secret.
482
+ */
483
+ interface VaultCardExpirationFillField {
484
+ field: 'expiration';
485
+ format: 'MM/YY' | 'MM/YYYY';
486
+ /**
487
+ * CSS selector for an editable input or select, or a containing element. Must
488
+ * resolve to one unique editable element across all page frames.
489
+ */
490
+ selector: string;
491
+ }
492
+ }
493
+ /**
494
+ * Required when preparing an unused AgentCard card for Square. Consent is bound to
495
+ * this browser and declared merchant origin, not a tab. Wait for the item's
496
+ * ready_to_submit status before native Pay and submit within its readiness
497
+ * deadline. Unused preparations expire automatically; every preparation is
498
+ * single-use, including after failure or expiry.
499
+ */
500
+ export interface VaultCheckoutContext {
501
+ /**
502
+ * Active browser session with this vault bound to it.
503
+ */
504
+ browser_id: string;
505
+ /**
506
+ * Square environment, independent of the AgentCard credential mode.
507
+ */
508
+ environment: 'production' | 'sandbox';
509
+ /**
510
+ * Canonical HTTPS origin of the top-level merchant document, not the Square
511
+ * iframe. HTTP localhost is accepted for tests.
512
+ */
513
+ merchant_origin: string;
514
+ }
515
+ export interface VaultFillFieldResult {
516
+ /**
517
+ * Zero-based index into the request fields array.
518
+ */
519
+ index: number;
520
+ /**
521
+ * Filled means the fill action completed, not that the website retained or
522
+ * accepted the value.
523
+ */
524
+ status: 'filled' | 'failed' | 'not_attempted' | 'unknown';
525
+ /**
526
+ * Present only for failed or unknown fields. Never includes secret values, DOM
527
+ * content, or raw browser errors.
528
+ */
529
+ error_code?: 'target_changed' | 'element_not_found' | 'ambiguous_selector' | 'element_not_editable' | 'option_not_found' | 'timeout' | 'execution_failed';
530
+ }
223
531
  export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem;
224
532
  export declare namespace VaultItem {
225
533
  interface WalletVaultItem {
@@ -232,9 +540,12 @@ export declare namespace VaultItem {
232
540
  */
233
541
  key: string;
234
542
  /**
235
- * AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
236
- * credential; there is no per-item test flag. user_id may only reference a user
237
- * already enrolled by a wallet in this organization.
543
+ * AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
544
+ * select a customer-owned configuration. Mode (sandbox vs live) is determined by
545
+ * the selected credential; there is no per-item test flag. Without user_id,
546
+ * creation returns a hosted enrollment action and Kernel polls until the user
547
+ * connects. user_id may only reference a user already enrolled by a wallet in this
548
+ * organization under the same configuration.
238
549
  */
239
550
  spec: ItemsAPI.WalletVaultItemSpec;
240
551
  state: ItemsAPI.WalletVaultItemState;
@@ -262,7 +573,7 @@ export declare namespace VaultItem {
262
573
  */
263
574
  interface AvailableOperation {
264
575
  description: string;
265
- type: 'authorize';
576
+ type: 'authorize' | 'prepare_checkout' | 'fill';
266
577
  }
267
578
  /**
268
579
  * Live, non-persisted data requested through the item GET expand parameter.
@@ -305,7 +616,7 @@ export declare namespace VaultItem {
305
616
  */
306
617
  interface AvailableOperation {
307
618
  description: string;
308
- type: 'authorize';
619
+ type: 'authorize' | 'prepare_checkout' | 'fill';
309
620
  }
310
621
  }
311
622
  }
@@ -348,6 +659,103 @@ export interface VaultItemEvent {
348
659
  [key: string]: unknown;
349
660
  };
350
661
  }
662
+ /**
663
+ * Authorization and preparation return the existing item shape. Fill returns a
664
+ * value-free execution result; it does not persist transient field outcomes on the
665
+ * item.
666
+ */
667
+ export type VaultItemOperationResponse = VaultItemOperationResponse.WalletVaultItem | VaultItemOperationResponse.CardVaultItem | FillVaultItemOperationResult;
668
+ export declare namespace VaultItemOperationResponse {
669
+ interface WalletVaultItem {
670
+ id: string;
671
+ available_expansions: Array<WalletVaultItem.AvailableExpansion>;
672
+ available_operations: Array<WalletVaultItem.AvailableOperation>;
673
+ created_at: string;
674
+ /**
675
+ * Immutable item key assigned when the item is created.
676
+ */
677
+ key: string;
678
+ /**
679
+ * AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
680
+ * select a customer-owned configuration. Mode (sandbox vs live) is determined by
681
+ * the selected credential; there is no per-item test flag. Without user_id,
682
+ * creation returns a hosted enrollment action and Kernel polls until the user
683
+ * connects. user_id may only reference a user already enrolled by a wallet in this
684
+ * organization under the same configuration.
685
+ */
686
+ spec: ItemsAPI.WalletVaultItemSpec;
687
+ state: ItemsAPI.WalletVaultItemState;
688
+ type: 'wallet';
689
+ updated_at: string;
690
+ action?: ItemsAPI.VaultItemAction;
691
+ /**
692
+ * Live, non-persisted data requested through the item GET expand parameter.
693
+ */
694
+ expanded?: WalletVaultItem.Expanded;
695
+ expires_at?: string;
696
+ }
697
+ namespace WalletVaultItem {
698
+ /**
699
+ * Live data that can currently be requested by passing its type to the item GET
700
+ * expand parameter.
701
+ */
702
+ interface AvailableExpansion {
703
+ description: string;
704
+ type: 'payment_methods';
705
+ }
706
+ /**
707
+ * An operation that is currently valid for this item. Read the description before
708
+ * invoking it through the item operations endpoint.
709
+ */
710
+ interface AvailableOperation {
711
+ description: string;
712
+ type: 'authorize' | 'prepare_checkout' | 'fill';
713
+ }
714
+ /**
715
+ * Live, non-persisted data requested through the item GET expand parameter.
716
+ */
717
+ interface Expanded {
718
+ payment_methods?: Array<ItemsAPI.VaultPaymentMethod>;
719
+ }
720
+ }
721
+ interface CardVaultItem {
722
+ id: string;
723
+ available_expansions: Array<CardVaultItem.AvailableExpansion>;
724
+ available_operations: Array<CardVaultItem.AvailableOperation>;
725
+ created_at: string;
726
+ /**
727
+ * Immutable item key assigned when the item is created.
728
+ */
729
+ key: string;
730
+ /**
731
+ * Live payment card. Test-mode card creation is not supported.
732
+ */
733
+ spec: ItemsAPI.CardVaultItemSpec;
734
+ state: ItemsAPI.CardVaultItemState;
735
+ type: 'card';
736
+ updated_at: string;
737
+ action?: ItemsAPI.VaultItemAction;
738
+ expires_at?: string;
739
+ }
740
+ namespace CardVaultItem {
741
+ /**
742
+ * Live data that can currently be requested by passing its type to the item GET
743
+ * expand parameter.
744
+ */
745
+ interface AvailableExpansion {
746
+ description: string;
747
+ type: 'payment_methods';
748
+ }
749
+ /**
750
+ * An operation that is currently valid for this item. Read the description before
751
+ * invoking it through the item operations endpoint.
752
+ */
753
+ interface AvailableOperation {
754
+ description: string;
755
+ type: 'authorize' | 'prepare_checkout' | 'fill';
756
+ }
757
+ }
758
+ }
351
759
  export interface VaultPaymentMethod {
352
760
  id: string;
353
761
  /**
@@ -387,9 +795,12 @@ export declare namespace VaultPaymentMethod {
387
795
  }
388
796
  }
389
797
  /**
390
- * AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
391
- * credential; there is no per-item test flag. user_id may only reference a user
392
- * already enrolled by a wallet in this organization.
798
+ * AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
799
+ * select a customer-owned configuration. Mode (sandbox vs live) is determined by
800
+ * the selected credential; there is no per-item test flag. Without user_id,
801
+ * creation returns a hosted enrollment action and Kernel polls until the user
802
+ * connects. user_id may only reference a user already enrolled by a wallet in this
803
+ * organization under the same configuration.
393
804
  */
394
805
  export type WalletVaultItemSpec = WalletVaultItemSpec.LinkWalletVaultItemSpec | WalletVaultItemSpec.AgentCardWalletVaultItemSpec;
395
806
  export declare namespace WalletVaultItemSpec {
@@ -399,24 +810,62 @@ export declare namespace WalletVaultItemSpec {
399
810
  }
400
811
  namespace LinkWalletVaultItemSpec {
401
812
  interface Authorization {
402
- client: Authorization.Client;
813
+ client: Authorization.KernelManagedOAuthClient | Authorization.CustomerManagedOAuthClient;
403
814
  method: 'oauth';
404
815
  }
405
816
  namespace Authorization {
406
- interface Client {
817
+ interface KernelManagedOAuthClient {
407
818
  type: 'kernel_managed';
408
819
  }
820
+ interface CustomerManagedOAuthClient {
821
+ /**
822
+ * Select a provider config by ID or name. Responses return the ID. Renaming a
823
+ * config does not change existing wallet bindings; a wallet cannot switch to a
824
+ * different config after creation.
825
+ */
826
+ provider_config: CustomerManagedOAuthClient.ProviderConfig;
827
+ type: 'customer_managed';
828
+ }
829
+ namespace CustomerManagedOAuthClient {
830
+ /**
831
+ * Select a provider config by ID or name. Responses return the ID. Renaming a
832
+ * config does not change existing wallet bindings; a wallet cannot switch to a
833
+ * different config after creation.
834
+ */
835
+ interface ProviderConfig {
836
+ id?: string;
837
+ name?: string;
838
+ }
839
+ }
409
840
  }
410
841
  }
411
842
  /**
412
- * AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
413
- * credential; there is no per-item test flag. user_id may only reference a user
414
- * already enrolled by a wallet in this organization.
843
+ * AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
844
+ * select a customer-owned configuration. Mode (sandbox vs live) is determined by
845
+ * the selected credential; there is no per-item test flag. Without user_id,
846
+ * creation returns a hosted enrollment action and Kernel polls until the user
847
+ * connects. user_id may only reference a user already enrolled by a wallet in this
848
+ * organization under the same configuration.
415
849
  */
416
850
  interface AgentCardWalletVaultItemSpec {
417
851
  provider: 'agentcard';
852
+ /**
853
+ * Select an AgentCard configuration. The wallet's configuration cannot be changed
854
+ * after creation.
855
+ */
856
+ provider_config?: AgentCardWalletVaultItemSpec.ProviderConfig;
418
857
  user_id?: string;
419
858
  }
859
+ namespace AgentCardWalletVaultItemSpec {
860
+ /**
861
+ * Select an AgentCard configuration. The wallet's configuration cannot be changed
862
+ * after creation.
863
+ */
864
+ interface ProviderConfig {
865
+ id?: string;
866
+ name?: string;
867
+ }
868
+ }
420
869
  }
421
870
  export type WalletVaultItemState = WalletVaultItemState.LinkWalletState | WalletVaultItemState.AgentCardWalletState;
422
871
  export declare namespace WalletVaultItemState {
@@ -480,15 +929,66 @@ export interface ItemEventsParams {
480
929
  */
481
930
  wait?: number;
482
931
  }
483
- export interface ItemPerformOperationParams {
484
- /**
485
- * Path param
486
- */
487
- id_or_name: string;
488
- /**
489
- * Body param
490
- */
491
- type: 'authorize';
932
+ export type ItemPerformOperationParams = ItemPerformOperationParams.AuthorizeVaultItemOperationRequest | ItemPerformOperationParams.PrepareCheckoutVaultItemOperationRequest | ItemPerformOperationParams.FillVaultItemOperationRequest;
933
+ export declare namespace ItemPerformOperationParams {
934
+ interface AuthorizeVaultItemOperationRequest {
935
+ /**
936
+ * Path param
937
+ */
938
+ id_or_name: string;
939
+ /**
940
+ * Body param
941
+ */
942
+ type: 'authorize';
943
+ }
944
+ interface PrepareCheckoutVaultItemOperationRequest {
945
+ /**
946
+ * Path param
947
+ */
948
+ id_or_name: string;
949
+ /**
950
+ * Body param: Required when preparing an unused AgentCard card for Square. Consent
951
+ * is bound to this browser and declared merchant origin, not a tab. Wait for the
952
+ * item's ready_to_submit status before native Pay and submit within its readiness
953
+ * deadline. Unused preparations expire automatically; every preparation is
954
+ * single-use, including after failure or expiry.
955
+ */
956
+ checkout: VaultCheckoutContext;
957
+ /**
958
+ * Body param
959
+ */
960
+ type: 'prepare_checkout';
961
+ }
962
+ interface FillVaultItemOperationRequest {
963
+ /**
964
+ * Path param
965
+ */
966
+ id_or_name: string;
967
+ /**
968
+ * Body param: Browser session ID, not a reusable browser name.
969
+ */
970
+ browser_id: string;
971
+ /**
972
+ * Body param: Field bindings for this step. No two bindings may resolve to the
973
+ * same element.
974
+ */
975
+ fields: Array<VaultCardFillField>;
976
+ /**
977
+ * Body param: Exact current top-level page URL, including path, query, and
978
+ * fragment. Must match exactly one open page in the browser; zero or multiple
979
+ * matches fail. No prefix or glob matching. Must use HTTPS without embedded
980
+ * credentials.
981
+ */
982
+ page_url: string;
983
+ /**
984
+ * Body param
985
+ */
986
+ type: 'fill';
987
+ /**
988
+ * Body param: Total operation deadline in milliseconds, not a per-field timeout.
989
+ */
990
+ timeout_ms?: number;
991
+ }
492
992
  }
493
993
  export type ItemUpsertParams = ItemUpsertParams.WalletVaultItemRequest | ItemUpsertParams.CardVaultItemRequest;
494
994
  export declare namespace ItemUpsertParams {
@@ -498,16 +998,142 @@ export declare namespace ItemUpsertParams {
498
998
  */
499
999
  id_or_name: string;
500
1000
  /**
501
- * Body param: AgentCard wallet. Mode (sandbox vs live) is fixed by the
502
- * deployment's AgentCard credential; there is no per-item test flag. user_id may
503
- * only reference a user already enrolled by a wallet in this organization.
1001
+ * Body param: AgentCard wallet. Omit provider_config to use Kernel-managed
1002
+ * credentials, or select a customer-owned configuration. Mode (sandbox vs live) is
1003
+ * determined by the selected credential; there is no per-item test flag. Without
1004
+ * user_id, creation returns a hosted enrollment action and Kernel polls until the
1005
+ * user connects. user_id may only reference a user already enrolled by a wallet in
1006
+ * this organization under the same configuration.
504
1007
  */
505
- spec: WalletVaultItemSpec;
1008
+ spec: WalletVaultItemRequest.LinkWalletVaultItemRequestSpec | WalletVaultItemRequest.AgentCardWalletVaultItemSpec;
506
1009
  /**
507
1010
  * Body param
508
1011
  */
509
1012
  type: 'wallet';
510
1013
  }
1014
+ namespace WalletVaultItemRequest {
1015
+ interface LinkWalletVaultItemRequestSpec {
1016
+ /**
1017
+ * Kernel starts and completes the user's Link authorization flow.
1018
+ */
1019
+ authorization: LinkWalletVaultItemRequestSpec.KernelManagedLinkAuthorizationInput | LinkWalletVaultItemRequestSpec.ImportedLinkAuthorizationInput;
1020
+ provider: 'link';
1021
+ }
1022
+ namespace LinkWalletVaultItemRequestSpec {
1023
+ /**
1024
+ * Kernel starts and completes the user's Link authorization flow.
1025
+ */
1026
+ interface KernelManagedLinkAuthorizationInput {
1027
+ client: KernelManagedLinkAuthorizationInput.Client;
1028
+ method: 'oauth';
1029
+ }
1030
+ namespace KernelManagedLinkAuthorizationInput {
1031
+ interface Client {
1032
+ type: 'kernel_managed';
1033
+ }
1034
+ }
1035
+ /**
1036
+ * The customer's backend completes Link OAuth and supplies the resulting tokens.
1037
+ * For a new wallet, Kernel verifies the access token can access Link payment
1038
+ * methods without consuming or rotating the refresh token. Valid access creates a
1039
+ * wallet with state.status=connected. An expired, invalid, revoked, or
1040
+ * insufficiently scoped access token returns 400 and no wallet is created. Refresh
1041
+ * expired tokens in your backend before importing them. A failed import does not
1042
+ * modify existing wallets. After successful import, Kernel owns subsequent
1043
+ * refresh-token rotation; the customer must stop refreshing this grant. Import
1044
+ * does not verify the refresh token: if it or the configured client credentials
1045
+ * are rejected during a later refresh, the imported wallet becomes degraded. An
1046
+ * unknown refresh outcome also leaves it degraded; Kernel does not retry a refresh
1047
+ * token that may already have been consumed. There is no in-place reauthorization
1048
+ * operation for an imported wallet. If this imported wallet's credentials become
1049
+ * unusable, obtain a fresh Link OAuth grant in your backend and create a wallet
1050
+ * under a NEW wallet key. Use the new wallet for NEW cards and payments, not to
1051
+ * retry an old payment whose outcome is uncertain. This does not replace the old
1052
+ * grant, rebind existing cards, or resolve their payment outcomes. Retain the old
1053
+ * wallet and its cards while reconciling any uncertain payments with the provider
1054
+ * or support. Do not repeat an uncertain payment on the new wallet, and do not
1055
+ * treat deletion as evidence that it did not execute. Deletion of the old wallet
1056
+ * can remain blocked by unresolved child cards. Repeating a create for the same
1057
+ * item key and non-secret spec returns the existing wallet without replacing
1058
+ * tokens, even if they have rotated or the wallet needs reconnection. ID and name
1059
+ * references resolving to the same config are equivalent. A different config or
1060
+ * non-secret spec returns 409. This create operation does not replace an existing
1061
+ * grant.
1062
+ */
1063
+ interface ImportedLinkAuthorizationInput {
1064
+ client: ImportedLinkAuthorizationInput.Client;
1065
+ method: 'oauth';
1066
+ /**
1067
+ * Send the token pair from your backend. Both tokens must be from the same Link
1068
+ * grant under the referenced client. Supply a currently valid access token. Kernel
1069
+ * refreshes when needed after import and uses the expiry returned by Link for
1070
+ * subsequent tokens. Tokens are never returned in wallet responses, events, or
1071
+ * logs.
1072
+ */
1073
+ tokens: ImportedLinkAuthorizationInput.Tokens;
1074
+ }
1075
+ namespace ImportedLinkAuthorizationInput {
1076
+ interface Client {
1077
+ /**
1078
+ * Select a provider config by ID or name. Responses return the ID. Renaming a
1079
+ * config does not change existing wallet bindings; a wallet cannot switch to a
1080
+ * different config after creation.
1081
+ */
1082
+ provider_config: Client.ProviderConfig;
1083
+ type: 'customer_managed';
1084
+ }
1085
+ namespace Client {
1086
+ /**
1087
+ * Select a provider config by ID or name. Responses return the ID. Renaming a
1088
+ * config does not change existing wallet bindings; a wallet cannot switch to a
1089
+ * different config after creation.
1090
+ */
1091
+ interface ProviderConfig {
1092
+ id?: string;
1093
+ name?: string;
1094
+ }
1095
+ }
1096
+ /**
1097
+ * Send the token pair from your backend. Both tokens must be from the same Link
1098
+ * grant under the referenced client. Supply a currently valid access token. Kernel
1099
+ * refreshes when needed after import and uses the expiry returned by Link for
1100
+ * subsequent tokens. Tokens are never returned in wallet responses, events, or
1101
+ * logs.
1102
+ */
1103
+ interface Tokens {
1104
+ access_token: string;
1105
+ refresh_token: string;
1106
+ }
1107
+ }
1108
+ }
1109
+ /**
1110
+ * AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
1111
+ * select a customer-owned configuration. Mode (sandbox vs live) is determined by
1112
+ * the selected credential; there is no per-item test flag. Without user_id,
1113
+ * creation returns a hosted enrollment action and Kernel polls until the user
1114
+ * connects. user_id may only reference a user already enrolled by a wallet in this
1115
+ * organization under the same configuration.
1116
+ */
1117
+ interface AgentCardWalletVaultItemSpec {
1118
+ provider: 'agentcard';
1119
+ /**
1120
+ * Select an AgentCard configuration. The wallet's configuration cannot be changed
1121
+ * after creation.
1122
+ */
1123
+ provider_config?: AgentCardWalletVaultItemSpec.ProviderConfig;
1124
+ user_id?: string;
1125
+ }
1126
+ namespace AgentCardWalletVaultItemSpec {
1127
+ /**
1128
+ * Select an AgentCard configuration. The wallet's configuration cannot be changed
1129
+ * after creation.
1130
+ */
1131
+ interface ProviderConfig {
1132
+ id?: string;
1133
+ name?: string;
1134
+ }
1135
+ }
1136
+ }
511
1137
  interface CardVaultItemRequest {
512
1138
  /**
513
1139
  * Path param
@@ -524,6 +1150,6 @@ export declare namespace ItemUpsertParams {
524
1150
  }
525
1151
  }
526
1152
  export declare namespace Items {
527
- export { type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization, type CardVaultItemSpec as CardVaultItemSpec, type CardVaultItemState as CardVaultItemState, type VaultCardAliases as VaultCardAliases, type VaultItem as VaultItem, type VaultItemAction as VaultItemAction, type VaultItemEvent as VaultItemEvent, type VaultPaymentMethod as VaultPaymentMethod, type WalletVaultItemSpec as WalletVaultItemSpec, type WalletVaultItemState as WalletVaultItemState, type ItemListResponse as ItemListResponse, type ItemEventsResponse as ItemEventsResponse, type ItemRetrieveParams as ItemRetrieveParams, type ItemUpdateParams as ItemUpdateParams, type ItemDeleteParams as ItemDeleteParams, type ItemEventsParams as ItemEventsParams, type ItemPerformOperationParams as ItemPerformOperationParams, type ItemUpsertParams as ItemUpsertParams, };
1153
+ export { type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization, type AgentcardCheckoutPreparation as AgentcardCheckoutPreparation, type AuthorizeVaultItemOperationRequest as AuthorizeVaultItemOperationRequest, type CardVaultItemSpec as CardVaultItemSpec, type CardVaultItemState as CardVaultItemState, type FillVaultItemOperationRequest as FillVaultItemOperationRequest, type FillVaultItemOperationResult as FillVaultItemOperationResult, type PrepareCheckoutVaultItemOperationRequest as PrepareCheckoutVaultItemOperationRequest, type VaultCardAliases as VaultCardAliases, type VaultCardFillField as VaultCardFillField, type VaultCheckoutContext as VaultCheckoutContext, type VaultFillFieldResult as VaultFillFieldResult, type VaultItem as VaultItem, type VaultItemAction as VaultItemAction, type VaultItemEvent as VaultItemEvent, type VaultItemOperationResponse as VaultItemOperationResponse, type VaultPaymentMethod as VaultPaymentMethod, type WalletVaultItemSpec as WalletVaultItemSpec, type WalletVaultItemState as WalletVaultItemState, type ItemListResponse as ItemListResponse, type ItemEventsResponse as ItemEventsResponse, type ItemRetrieveParams as ItemRetrieveParams, type ItemUpdateParams as ItemUpdateParams, type ItemDeleteParams as ItemDeleteParams, type ItemEventsParams as ItemEventsParams, type ItemPerformOperationParams as ItemPerformOperationParams, type ItemUpsertParams as ItemUpsertParams, };
528
1154
  }
529
1155
  //# sourceMappingURL=items.d.mts.map