@visa/cli 4.1.0-rc.25 → 4.1.0-rc.251

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 (89) hide show
  1. package/README.md +273 -227
  2. package/dist/checkout-engine/adapters/generic.d.ts +69 -0
  3. package/dist/checkout-engine/adapters/generic.js +383 -58
  4. package/dist/checkout-engine/adapters/index.d.ts +4 -1
  5. package/dist/checkout-engine/adapters/index.js +10 -3
  6. package/dist/checkout-engine/adapters/shopify.d.ts +80 -0
  7. package/dist/checkout-engine/adapters/shopify.js +688 -0
  8. package/dist/checkout-engine/amount.d.ts +15 -0
  9. package/dist/checkout-engine/amount.js +72 -0
  10. package/dist/checkout-engine/browser-launch.d.ts +9 -4
  11. package/dist/checkout-engine/browser-launch.js +19 -4
  12. package/dist/checkout-engine/browserbase-browser.d.ts +24 -0
  13. package/dist/checkout-engine/browserbase-browser.js +186 -0
  14. package/dist/checkout-engine/cli-engine.d.ts +297 -4
  15. package/dist/checkout-engine/cli-engine.js +942 -48
  16. package/dist/checkout-engine/confirmed-merchants.d.ts +31 -0
  17. package/dist/checkout-engine/confirmed-merchants.js +165 -0
  18. package/dist/checkout-engine/detect.d.ts +1 -1
  19. package/dist/checkout-engine/detect.js +26 -0
  20. package/dist/checkout-engine/evidence.d.ts +4 -1
  21. package/dist/checkout-engine/evidence.js +51 -6
  22. package/dist/checkout-engine/executor.d.ts +64 -4
  23. package/dist/checkout-engine/executor.js +625 -146
  24. package/dist/checkout-engine/hosted-approval.d.ts +124 -7
  25. package/dist/checkout-engine/hosted-approval.js +384 -54
  26. package/dist/checkout-engine/index.d.ts +9 -2
  27. package/dist/checkout-engine/index.js +8 -1
  28. package/dist/checkout-engine/instrument.d.ts +7 -0
  29. package/dist/checkout-engine/instrument.js +4 -0
  30. package/dist/checkout-engine/known-merchants.d.ts +10 -0
  31. package/dist/checkout-engine/known-merchants.js +38 -0
  32. package/dist/checkout-engine/live-fill-approval.d.ts +5 -20
  33. package/dist/checkout-engine/live-fill-approval.js +20 -51
  34. package/dist/checkout-engine/mandate/card-mandate.d.ts +121 -0
  35. package/dist/checkout-engine/mandate/card-mandate.js +226 -0
  36. package/dist/checkout-engine/mandate/mandate-ledger.d.ts +174 -0
  37. package/dist/checkout-engine/mandate/mandate-ledger.js +410 -0
  38. package/dist/checkout-engine/outcome.d.ts +2 -2
  39. package/dist/checkout-engine/outcome.js +36 -1
  40. package/dist/checkout-engine/owner-only-file.d.ts +9 -0
  41. package/dist/checkout-engine/owner-only-file.js +20 -1
  42. package/dist/checkout-engine/receipt-dir.d.ts +6 -0
  43. package/dist/checkout-engine/receipt-dir.js +8 -0
  44. package/dist/checkout-engine/receipt.d.ts +56 -2
  45. package/dist/checkout-engine/receipt.js +55 -16
  46. package/dist/checkout-engine/shopify-primary-domain.d.ts +25 -0
  47. package/dist/checkout-engine/shopify-primary-domain.js +96 -0
  48. package/dist/checkout-engine/trace-handles.d.ts +8 -0
  49. package/dist/checkout-engine/trace-handles.js +12 -0
  50. package/dist/checkout-engine/types.d.ts +28 -2
  51. package/dist/checkout-engine/unresolved-charges.d.ts +34 -0
  52. package/dist/checkout-engine/unresolved-charges.js +134 -0
  53. package/dist/checkout-engine/vgs-gateway/server-mint-client.d.ts +53 -1
  54. package/dist/checkout-engine/vgs-gateway/server-mint-client.js +78 -10
  55. package/dist/checkout-engine/vgs-live-instrument.d.ts +38 -35
  56. package/dist/checkout-engine/vgs-live-instrument.js +51 -74
  57. package/dist/checkout-engine/vic-confirmation.d.ts +18 -0
  58. package/dist/checkout-engine/vic-confirmation.js +9 -3
  59. package/dist/checkout-engine/web-bot-auth.d.ts +98 -0
  60. package/dist/checkout-engine/web-bot-auth.js +218 -0
  61. package/dist/cli.js +905 -505
  62. package/dist/mcp-apps/ucp-checkout.html +280 -0
  63. package/dist/mcp-server/index.js +744 -175
  64. package/dist/merchant-ucp-mcp/index.js +6 -0
  65. package/dist/skills/pair-visa-agent/RUNTIMES.md +122 -79
  66. package/dist/skills/pair-visa-agent/SKILL.md +436 -279
  67. package/dist/skills/pair-visa-agent/scripts/__tests__/setup.test.mjs +407 -0
  68. package/dist/skills/pair-visa-agent/scripts/setup.mjs +310 -30
  69. package/dist/skills/visa-shopify-checkout/SKILL.md +122 -0
  70. package/dist/skills/visa-shopify-checkout/references/evidence-and-states.md +37 -0
  71. package/dist/skills/visa-ucp-shopping/SKILL.md +86 -0
  72. package/dist/subway-direct.mjs +1 -0
  73. package/install.ps1 +9 -46
  74. package/install.sh +5 -37
  75. package/native/bin/win32-x64/visa-keychain-win.exe +0 -0
  76. package/package.json +32 -28
  77. package/server.json +4 -4
  78. package/dist/checkout-engine/inline-target.d.ts +0 -13
  79. package/dist/checkout-engine/inline-target.js +0 -37
  80. package/dist/checkout-engine/pay-args.d.ts +0 -14
  81. package/dist/checkout-engine/pay-args.js +0 -44
  82. package/dist/checkout-engine/pay.d.ts +0 -1
  83. package/dist/checkout-engine/pay.js +0 -13
  84. package/dist/checkout-engine/repo-env.d.ts +0 -11
  85. package/dist/checkout-engine/repo-env.js +0 -23
  86. package/dist/checkout-engine/run-live-fill.d.ts +0 -1
  87. package/dist/checkout-engine/run-live-fill.js +0 -443
  88. package/dist/checkout-engine/vgs-gateway/fetch-credential.d.mts +0 -74
  89. package/dist/checkout-engine/vgs-gateway/fetch-credential.mjs +0 -248
@@ -0,0 +1,80 @@
1
+ import type { Page } from 'playwright-core';
2
+ import { type PageAmountRead } from '../amount.js';
3
+ import { type DetectResult, type FieldMap } from '../detect.js';
4
+ import type { CardCredential } from '../instrument.js';
5
+ import type { Contact, FillResult, FilledField } from '../types.js';
6
+ import { type CheckoutAdapter } from './generic.js';
7
+ type ShopifySummary = {
8
+ subtotalMinor: number | null;
9
+ shippingMinor: number | null;
10
+ taxMinor: number | null;
11
+ discountMinor: number;
12
+ totalMinor: number | null;
13
+ currency: string | null;
14
+ verified: boolean;
15
+ };
16
+ export declare function parseShopifySummary(text: string): ShopifySummary;
17
+ export declare function readShopifyAmount(page: Page, requireVerified: boolean): Promise<PageAmountRead>;
18
+ export declare function readStableShopifyAmount(page: Page, timeoutMs?: number): Promise<PageAmountRead>;
19
+ export declare function isShopifyCheckoutPage(page: Page): Promise<boolean>;
20
+ export type ShopifyCheckoutSurface = {
21
+ signal: string;
22
+ subtype: 'recognition' | 'authentication' | 'wallet';
23
+ };
24
+ export type ShopifyGuestCheckoutResult = {
25
+ status: 'guest-ready';
26
+ signal: 'guest-card-form';
27
+ } | {
28
+ status: 'transitioned';
29
+ signal: string;
30
+ } | {
31
+ status: 'action-required';
32
+ signal: string;
33
+ detail: string;
34
+ };
35
+ export declare function detectShopifyCheckoutSurface(page: Page): Promise<ShopifyCheckoutSurface | null>;
36
+ /**
37
+ * Resolve Shopify's reversible Shop-wallet takeover before review. The helper
38
+ * only clicks an exact guest action or a scoped accessible close control inside
39
+ * a positively identified Shop surface. It never solves authentication, uses a
40
+ * Shop-saved payment method, force-clicks, or mutates the DOM.
41
+ */
42
+ export declare function ensureShopifyGuestCheckout(page: Page, options?: {
43
+ timeoutMs?: number;
44
+ stableMs?: number;
45
+ }): Promise<ShopifyGuestCheckoutResult>;
46
+ /** Read-only assertion for the irreversible credential boundary. */
47
+ export declare function assertShopifyGuestCheckout(page: Page): Promise<ShopifyGuestCheckoutResult>;
48
+ /**
49
+ * The en-US variant of a localized Shopify checkout URL, or null when it is
50
+ * already English (or not locale-suffixed). Shopify renders the checkout in
51
+ * the URL's trailing locale segment, and amount reconciliation reads the
52
+ * order summary by its ENGLISH labels — a store whose primary market is not
53
+ * English serves /checkouts/cn/<token>/<locale> and the total never parses
54
+ * (observed live 2026-08-16: /es-us rendered "Precio total" and the review
55
+ * refused fail-closed on a good checkout). The locale segment is
56
+ * presentation-only: swapping it keeps the same checkout session and token.
57
+ */
58
+ export declare function shopifyEnglishCheckoutUrl(current: string): string | null;
59
+ export declare function missingContactRoles(filled: FilledField[], expected: string[]): string[];
60
+ /**
61
+ * The contact surface to prefill. Shipping fields when the checkout has them —
62
+ * but a digital-goods (no-shipping) Shopify checkout renders exactly one
63
+ * address block and marks every field autocomplete="billing ..." (observed
64
+ * live 2026-08-16: all 18 candidates billing-classified, so the shipping map
65
+ * came back empty and the prefill reported every role missing). That billing
66
+ * block IS the primary contact surface, under its base roles.
67
+ */
68
+ export declare function contactPrefillFieldMap(detected: DetectResult): {
69
+ fields: FieldMap;
70
+ surface: 'shipping' | 'billing-only';
71
+ };
72
+ export declare class ShopifyAdapter implements CheckoutAdapter {
73
+ private readonly detected;
74
+ name: string;
75
+ constructor(detected: DetectResult);
76
+ matches(detected: DetectResult): boolean;
77
+ prepareContact(page: Page, contact: Contact): Promise<FillResult>;
78
+ fill(page: Page, _fields: FieldMap, credential: CardCredential, _contact: Contact): Promise<FillResult>;
79
+ }
80
+ export {};