z-zero-mcp-server 1.11.0 → 1.12.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.
- package/README.md +13 -2
- package/dist/base_backend.d.ts +46 -1
- package/dist/base_backend.js +124 -10
- package/dist/failure_taxonomy.js +5 -0
- package/dist/index.js +336 -20
- package/dist/lib/deal-search.d.ts +75 -0
- package/dist/lib/deal-search.js +182 -0
- package/dist/lib/domain-lock.d.ts +8 -0
- package/dist/lib/domain-lock.js +20 -0
- package/dist/lib/extract-total-price.d.ts +27 -0
- package/dist/lib/extract-total-price.js +141 -0
- package/dist/playwright_bridge.d.ts +17 -2
- package/dist/playwright_bridge.js +504 -24
- package/dist/types.d.ts +36 -1
- package/package.json +2 -1
package/dist/types.d.ts
CHANGED
|
@@ -31,10 +31,35 @@ export interface CardData {
|
|
|
31
31
|
intent_id?: string;
|
|
32
32
|
intent_hash?: string;
|
|
33
33
|
merchant_domain?: string | null;
|
|
34
|
+
/** Set when the card was issued for an Agent Deal order (server-computed figures). */
|
|
35
|
+
deal?: DealFigures;
|
|
34
36
|
error?: string;
|
|
35
37
|
message?: string;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
/** A deal order's figures, as the server holds them. USD. */
|
|
40
|
+
export interface DealFigures {
|
|
41
|
+
order_id: string;
|
|
42
|
+
/** L — what the checkout page shows BEFORE the discount code. */
|
|
43
|
+
checkout_total: number;
|
|
44
|
+
discount: number;
|
|
45
|
+
/** C — what the page must show AFTER the code; the card is for exactly this. */
|
|
46
|
+
card_amount: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What the card filler needs to pay a deal order: the single-use code (a secret of the same
|
|
50
|
+
* kind as the card number — never returned, logged or echoed) and the most the page may show
|
|
51
|
+
* once it is applied. `code: null` = a deal with nothing to type; the total is still checked.
|
|
52
|
+
*/
|
|
53
|
+
export interface DealPayment {
|
|
54
|
+
code: string | null;
|
|
55
|
+
/** C — the page total must be at or under this once the code is on. */
|
|
56
|
+
maxTotal: number;
|
|
57
|
+
/** L — the page total must not be above this BEFORE the code (what the order was priced for). */
|
|
58
|
+
listTotal: number;
|
|
59
|
+
/** D — the page total must come down by at least this for the code to count as applied. */
|
|
60
|
+
discount: number;
|
|
61
|
+
}
|
|
62
|
+
export type PaymentOutcome = 'confirmed' | 'declined' | 'unconfirmed' | 'not_submitted' | 'no_fields' | 'blocked' | 'deal_not_applied' | 'error';
|
|
38
63
|
export interface PaymentResult {
|
|
39
64
|
success: boolean;
|
|
40
65
|
status: PaymentOutcome;
|
|
@@ -42,6 +67,13 @@ export interface PaymentResult {
|
|
|
42
67
|
receipt_id?: string;
|
|
43
68
|
page_detail?: string;
|
|
44
69
|
amount?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Deal orders, attempt NOT confirmed: what the caller does with the order's discount code.
|
|
72
|
+
* 'release' — no order can exist (nothing was submitted, or the shop declined): ask the server to delete the code at the shop now.
|
|
73
|
+
* 'hold' — Pay was pressed and the outcome is unknown: leave the code alone until the order's fate is known.
|
|
74
|
+
* Internal to the MCP: never put in a tool result.
|
|
75
|
+
*/
|
|
76
|
+
deal_code_next?: 'release' | 'hold';
|
|
45
77
|
}
|
|
46
78
|
export interface CheckoutHints {
|
|
47
79
|
pre_steps?: string[];
|
|
@@ -53,6 +85,9 @@ export interface CheckoutHints {
|
|
|
53
85
|
cvv_selector?: string;
|
|
54
86
|
name_selector?: string;
|
|
55
87
|
submit_selector?: string;
|
|
88
|
+
discount_selector?: string;
|
|
89
|
+
discount_apply_selector?: string;
|
|
90
|
+
total_selector?: string;
|
|
56
91
|
payment_type?: string;
|
|
57
92
|
notes?: string;
|
|
58
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "z-zero-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Z-ZERO MCP Server — Secure JIT Virtual Card Payment tools for AI Agents (Claude, Cursor, AutoGPT) — Real Single-Use Virtual Cards, settled in USDC on Base",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"test:ucp-offline": "npm run build && node --experimental-strip-types --test tests/ucp_bridge_offline.test.mts",
|
|
15
15
|
"test:domain-lock": "npm run build && node --experimental-strip-types --test tests/domain_lock.test.mts",
|
|
16
16
|
"test:audit-wave-m": "npm run build && bash tests/audit-wave-m/run.sh",
|
|
17
|
+
"test:agent-deal": "npm run build && bash tests/agent-deal/run.sh",
|
|
17
18
|
"test:ucp-dryrun:live": "npm run build && node --experimental-strip-types tests/ucp_dryrun_meanblvd.mts",
|
|
18
19
|
"test:ucp-smoke:live": "npm run build && node --experimental-strip-types tests/ucp_smoke_colourpop.mts",
|
|
19
20
|
"prepublishOnly": "npm run build"
|