@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.
- package/README.md +273 -227
- package/dist/checkout-engine/adapters/generic.d.ts +69 -0
- package/dist/checkout-engine/adapters/generic.js +383 -58
- package/dist/checkout-engine/adapters/index.d.ts +4 -1
- package/dist/checkout-engine/adapters/index.js +10 -3
- package/dist/checkout-engine/adapters/shopify.d.ts +80 -0
- package/dist/checkout-engine/adapters/shopify.js +688 -0
- package/dist/checkout-engine/amount.d.ts +15 -0
- package/dist/checkout-engine/amount.js +72 -0
- package/dist/checkout-engine/browser-launch.d.ts +9 -4
- package/dist/checkout-engine/browser-launch.js +19 -4
- package/dist/checkout-engine/browserbase-browser.d.ts +24 -0
- package/dist/checkout-engine/browserbase-browser.js +186 -0
- package/dist/checkout-engine/cli-engine.d.ts +297 -4
- package/dist/checkout-engine/cli-engine.js +942 -48
- package/dist/checkout-engine/confirmed-merchants.d.ts +31 -0
- package/dist/checkout-engine/confirmed-merchants.js +165 -0
- package/dist/checkout-engine/detect.d.ts +1 -1
- package/dist/checkout-engine/detect.js +26 -0
- package/dist/checkout-engine/evidence.d.ts +4 -1
- package/dist/checkout-engine/evidence.js +51 -6
- package/dist/checkout-engine/executor.d.ts +64 -4
- package/dist/checkout-engine/executor.js +625 -146
- package/dist/checkout-engine/hosted-approval.d.ts +124 -7
- package/dist/checkout-engine/hosted-approval.js +384 -54
- package/dist/checkout-engine/index.d.ts +9 -2
- package/dist/checkout-engine/index.js +8 -1
- package/dist/checkout-engine/instrument.d.ts +7 -0
- package/dist/checkout-engine/instrument.js +4 -0
- package/dist/checkout-engine/known-merchants.d.ts +10 -0
- package/dist/checkout-engine/known-merchants.js +38 -0
- package/dist/checkout-engine/live-fill-approval.d.ts +5 -20
- package/dist/checkout-engine/live-fill-approval.js +20 -51
- package/dist/checkout-engine/mandate/card-mandate.d.ts +121 -0
- package/dist/checkout-engine/mandate/card-mandate.js +226 -0
- package/dist/checkout-engine/mandate/mandate-ledger.d.ts +174 -0
- package/dist/checkout-engine/mandate/mandate-ledger.js +410 -0
- package/dist/checkout-engine/outcome.d.ts +2 -2
- package/dist/checkout-engine/outcome.js +36 -1
- package/dist/checkout-engine/owner-only-file.d.ts +9 -0
- package/dist/checkout-engine/owner-only-file.js +20 -1
- package/dist/checkout-engine/receipt-dir.d.ts +6 -0
- package/dist/checkout-engine/receipt-dir.js +8 -0
- package/dist/checkout-engine/receipt.d.ts +56 -2
- package/dist/checkout-engine/receipt.js +55 -16
- package/dist/checkout-engine/shopify-primary-domain.d.ts +25 -0
- package/dist/checkout-engine/shopify-primary-domain.js +96 -0
- package/dist/checkout-engine/trace-handles.d.ts +8 -0
- package/dist/checkout-engine/trace-handles.js +12 -0
- package/dist/checkout-engine/types.d.ts +28 -2
- package/dist/checkout-engine/unresolved-charges.d.ts +34 -0
- package/dist/checkout-engine/unresolved-charges.js +134 -0
- package/dist/checkout-engine/vgs-gateway/server-mint-client.d.ts +53 -1
- package/dist/checkout-engine/vgs-gateway/server-mint-client.js +78 -10
- package/dist/checkout-engine/vgs-live-instrument.d.ts +38 -35
- package/dist/checkout-engine/vgs-live-instrument.js +51 -74
- package/dist/checkout-engine/vic-confirmation.d.ts +18 -0
- package/dist/checkout-engine/vic-confirmation.js +9 -3
- package/dist/checkout-engine/web-bot-auth.d.ts +98 -0
- package/dist/checkout-engine/web-bot-auth.js +218 -0
- package/dist/cli.js +905 -505
- package/dist/mcp-apps/ucp-checkout.html +280 -0
- package/dist/mcp-server/index.js +744 -175
- package/dist/merchant-ucp-mcp/index.js +6 -0
- package/dist/skills/pair-visa-agent/RUNTIMES.md +122 -79
- package/dist/skills/pair-visa-agent/SKILL.md +436 -279
- package/dist/skills/pair-visa-agent/scripts/__tests__/setup.test.mjs +407 -0
- package/dist/skills/pair-visa-agent/scripts/setup.mjs +310 -30
- package/dist/skills/visa-shopify-checkout/SKILL.md +122 -0
- package/dist/skills/visa-shopify-checkout/references/evidence-and-states.md +37 -0
- package/dist/skills/visa-ucp-shopping/SKILL.md +86 -0
- package/dist/subway-direct.mjs +1 -0
- package/install.ps1 +9 -46
- package/install.sh +5 -37
- package/native/bin/win32-x64/visa-keychain-win.exe +0 -0
- package/package.json +32 -28
- package/server.json +4 -4
- package/dist/checkout-engine/inline-target.d.ts +0 -13
- package/dist/checkout-engine/inline-target.js +0 -37
- package/dist/checkout-engine/pay-args.d.ts +0 -14
- package/dist/checkout-engine/pay-args.js +0 -44
- package/dist/checkout-engine/pay.d.ts +0 -1
- package/dist/checkout-engine/pay.js +0 -13
- package/dist/checkout-engine/repo-env.d.ts +0 -11
- package/dist/checkout-engine/repo-env.js +0 -23
- package/dist/checkout-engine/run-live-fill.d.ts +0 -1
- package/dist/checkout-engine/run-live-fill.js +0 -443
- package/dist/checkout-engine/vgs-gateway/fetch-credential.d.mts +0 -74
- 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 {};
|