warpmetal 0.7.0 → 0.7.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/README.md
CHANGED
|
@@ -17,6 +17,8 @@ payment artifact, and submits it without absorbing wallet custody.
|
|
|
17
17
|
executable
|
|
18
18
|
- Skill: `skills/warpmetal` in the GitHub repository and bundled inside the
|
|
19
19
|
npm package
|
|
20
|
+
- Codex plugin: the skills-only package under `plugins/warpmetal`, exposed for
|
|
21
|
+
repository testing by `.agents/plugins/marketplace.json`
|
|
20
22
|
|
|
21
23
|
Keeping the skill beside the CLI gives Codex, Claude, and other Agent
|
|
22
24
|
Skills-compatible tools one canonical set of safety instructions while the CLI
|
|
@@ -32,7 +34,7 @@ published wallet CLI with the exact version WarpMetal reports:
|
|
|
32
34
|
npm install --global warpmetal
|
|
33
35
|
warpmetal --help
|
|
34
36
|
|
|
35
|
-
npm install --global @x402api/agent-wallet-cli@0.2.
|
|
37
|
+
npm install --global @x402api/agent-wallet-cli@0.2.4
|
|
36
38
|
x402api help --json
|
|
37
39
|
```
|
|
38
40
|
|
|
@@ -52,6 +54,29 @@ layout. Agents that support that layout but use another installation path can
|
|
|
52
54
|
consume that directory directly; they do not need a different WarpMetal API
|
|
53
55
|
integration.
|
|
54
56
|
|
|
57
|
+
## Codex plugin
|
|
58
|
+
|
|
59
|
+
The repository also contains a skills-only WarpMetal plugin for the public
|
|
60
|
+
Plugins Directory shared by Codex and ChatGPT. The plugin remains a separate
|
|
61
|
+
artifact from the npm CLI and requires `warpmetal` CLI version 0.7.1 or newer.
|
|
62
|
+
|
|
63
|
+
To test the repository marketplace after the plugin lands on `main`:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
codex plugin marketplace add warpmetal/agent-kit --ref main
|
|
67
|
+
codex plugin add warpmetal@warpmetal
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Run the plugin-specific repository checks with:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
npm run plugin:check
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Public submission materials, reviewer cases, and the owner checklist live in
|
|
77
|
+
`submission/openai`. Public publication happens through the OpenAI Platform;
|
|
78
|
+
the repo marketplace is only for development, testing, and direct distribution.
|
|
79
|
+
|
|
55
80
|
## First commands
|
|
56
81
|
|
|
57
82
|
```sh
|
|
@@ -94,7 +119,10 @@ handle. The handle is not a buyer payment identifier and is never a wallet
|
|
|
94
119
|
signing input. The published
|
|
95
120
|
launch wallet accepts sponsored Base USDC and sponsored Solana USDC/USDT only;
|
|
96
121
|
the returned terms identify compatible alternatives and confirm that the buyer
|
|
97
|
-
does not need ETH or SOL.
|
|
122
|
+
does not need ETH or SOL. x402api pays the actual network fee from its platform
|
|
123
|
+
treasury; the merchant tenant's active allowance controls sponsorship
|
|
124
|
+
admission but is not charged actual gas. Payment authority depends on execution
|
|
125
|
+
context:
|
|
98
126
|
|
|
99
127
|
- When a human is actively chatting with the agent, show the exact live terms
|
|
100
128
|
and ask for confirmation immediately before authorizing and submitting.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warpmetal",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Agent-safe CLI and skill for purchasing, renewing, and managing WarpMetal VPS servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"check": "node --check bin/warpmetal.js && node --check src/api.js && node --check src/args.js && node --check src/cli.js && node --check src/connection.js && node --check src/errors.js && node --check src/install-skill.js && node --check src/installer.js && node --check src/payment.js && node --check src/runtime.js && node --check src/ssh.js && node --check src/state.js && node --check src/version.js",
|
|
20
|
+
"plugin:check": "node --test test/plugin.test.js",
|
|
20
21
|
"test": "node --test",
|
|
21
22
|
"prepack": "npm run check && npm test"
|
|
22
23
|
},
|
|
@@ -11,9 +11,10 @@ with ad hoc HTTP commands.
|
|
|
11
11
|
|
|
12
12
|
## Start safely
|
|
13
13
|
|
|
14
|
-
1. Run `warpmetal --version
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
1. Run `warpmetal --version` and require version `0.7.1` or newer for this
|
|
15
|
+
plugin. If it is missing or older, explain the compatibility requirement,
|
|
16
|
+
ask before installing or upgrading software, and use only the official npm
|
|
17
|
+
package from `https://www.npmjs.com/package/warpmetal`.
|
|
17
18
|
3. Use `--json` for every agent-driven command.
|
|
18
19
|
4. Read [references/safety.md](references/safety.md) before preparing an order,
|
|
19
20
|
authorizing payment, using an SSH identity, or changing a server.
|
|
@@ -62,12 +62,16 @@ private WarpMetal state directory. An explicit output path must not already
|
|
|
62
62
|
contain different content. `challengeHandle` is intentionally absent from the
|
|
63
63
|
wallet envelope: it is neither a buyer payment identifier nor signing input.
|
|
64
64
|
|
|
65
|
-
The current integration targets `@x402api/agent-wallet-cli@0.2.
|
|
65
|
+
The current integration targets `@x402api/agent-wallet-cli@0.2.4`. A compatible
|
|
66
66
|
live term is marked `agentWalletSupported: true` and must use the sponsored
|
|
67
67
|
Base USDC or Solana USDC/USDT launch profile with buyer native fees disabled.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
For the current declaration, x402api pays actual gas from its platform treasury
|
|
69
|
+
while the merchant tenant's allowance controls sponsorship admission. WarpMetal
|
|
70
|
+
retains the matched legacy tenant-credit declaration during rollout and rejects
|
|
71
|
+
mixed policy pairs. WarpMetal rejects a challenge with no compatible sponsored
|
|
72
|
+
term. Because the checkout is authenticated, do not substitute `x402api pay`,
|
|
73
|
+
`payment submit`, or `payment reconcile` for the returned WarpMetal submission
|
|
74
|
+
command.
|
|
71
75
|
|
|
72
76
|
`--payment-artifact` accepts the owner-only JSON artifact produced by a
|
|
73
77
|
compatible pinned x402api Agent Wallet release. WarpMetal validates its request
|
|
@@ -16,10 +16,16 @@ The separate x402api Agent Wallet owns encrypted network keys, balance checks,
|
|
|
16
16
|
payment authorization, and durable payment attempts. Never merge their state
|
|
17
17
|
files or pass a WarpMetal credential to `x402api`.
|
|
18
18
|
|
|
19
|
+
The CLI includes the matching `@x402api/agent-wallet-core` SDK. That SDK is the
|
|
20
|
+
authoritative buyer-side parser and signer contract. WarpMetal retains its own
|
|
21
|
+
merchant-side validation because the backend is Python and additionally binds
|
|
22
|
+
the challenge to WarpMetal's exact resource, amount, recipient, and receipt
|
|
23
|
+
contract.
|
|
24
|
+
|
|
19
25
|
WarpMetal runs on Node.js 20 or 22. The x402api Agent Wallet currently requires
|
|
20
26
|
Node.js 22. Use the exact published package reported by
|
|
21
27
|
`paymentWorkflow.signerPackage.spec`; the current contract is
|
|
22
|
-
`@x402api/agent-wallet-cli@0.2.
|
|
28
|
+
`@x402api/agent-wallet-cli@0.2.4`. Do not add it as a WarpMetal dependency,
|
|
23
29
|
install executable wallet code from an unpinned repository URL, or substitute
|
|
24
30
|
a similarly named package.
|
|
25
31
|
|
|
@@ -91,7 +97,7 @@ Use this structure when asking a human to fund the wallet:
|
|
|
91
97
|
> wallet `<payer-wallet-address>`. Token contract/mint: `<asset-identifier>`.
|
|
92
98
|
> Send the token to the payer wallet address, not to the token contract/mint and
|
|
93
99
|
> not to WarpMetal's payment recipient. Do not send ETH or SOL; the network fee
|
|
94
|
-
> is
|
|
100
|
+
> is paid by x402api from its platform treasury.
|
|
95
101
|
|
|
96
102
|
## Exact purchase workflow
|
|
97
103
|
|
|
@@ -128,6 +134,12 @@ launch profiles are sponsored Base USDC and sponsored Solana USDC/USDT, bound
|
|
|
128
134
|
by the strict `com.x402api.gas-sponsorship` extension. Stop on an expired gas
|
|
129
135
|
reservation or any buyer-funded, unsupported, or unbound alternative.
|
|
130
136
|
|
|
137
|
+
x402api pays actual gas from its platform treasury. The merchant tenant's
|
|
138
|
+
active sponsorship allowance controls admission, but actual gas is not a
|
|
139
|
+
tenant debit. During the coordinated rollout, accept only the exact 0.2.4
|
|
140
|
+
platform-treasury declaration or the matched legacy tenant-credit declaration;
|
|
141
|
+
never accept a mixed billing and final-charge policy.
|
|
142
|
+
|
|
131
143
|
Among valid sponsored terms, honor an explicit task or operator network and
|
|
132
144
|
asset preference. Otherwise prefer a compatible wallet that is already
|
|
133
145
|
sufficiently funded. If several terms remain, choose the first compatible term
|
|
@@ -168,6 +180,12 @@ current `termEndsAt` generation are different.
|
|
|
168
180
|
challenge flow again, inspect the replacement terms, and authorize one new
|
|
169
181
|
artifact only when the protocol and current interactive or autonomous
|
|
170
182
|
payment authority allow it.
|
|
183
|
+
- `sponsorship_allowance_unavailable`, `sponsorship_payment_cap_exceeded`,
|
|
184
|
+
`sponsorship_payment_allowance_exhausted`,
|
|
185
|
+
`sponsorship_volume_allowance_exhausted`, or
|
|
186
|
+
`sponsorship_gas_budget_exhausted`: the wallet treats the authorization as
|
|
187
|
+
terminal. The merchant tenant must restore or change its allowance and issue
|
|
188
|
+
a fresh challenge; never retry the artifact or fall back to buyer-funded gas.
|
|
171
189
|
- `manual_review`: payment or fulfillment may be final. Stop all payment and
|
|
172
190
|
mutation retries.
|
|
173
191
|
- Expired or corrupt artifact, changed request digest, unexpected recipient,
|
|
@@ -110,6 +110,13 @@ Confirm the plan, hostname, OS, and public key before preparing it.
|
|
|
110
110
|
- A signed HTTP 402 rejects that signature. Use the new live challenge for one
|
|
111
111
|
replacement authorization after checking the new terms against the current
|
|
112
112
|
interactive or autonomous payment authority.
|
|
113
|
+
- Treat `sponsorship_allowance_unavailable`,
|
|
114
|
+
`sponsorship_payment_cap_exceeded`,
|
|
115
|
+
`sponsorship_payment_allowance_exhausted`,
|
|
116
|
+
`sponsorship_volume_allowance_exhausted`, and
|
|
117
|
+
`sponsorship_gas_budget_exhausted` as terminal for the current authorization.
|
|
118
|
+
Require the merchant tenant to restore or change its sponsorship allowance
|
|
119
|
+
and issue a fresh challenge; never switch to buyer-funded gas.
|
|
113
120
|
- On timeout or restart after wallet authorization, reuse the saved x402api
|
|
114
121
|
attempt and artifact through WarpMetal. Never authorize again merely because
|
|
115
122
|
submission or fulfillment is uncertain, and never send the private owner
|
package/src/payment.js
CHANGED
|
@@ -15,7 +15,7 @@ const MAX_ARTIFACT_BYTES = 1024 * 1024;
|
|
|
15
15
|
const MAX_SIGNATURE_BYTES = 512 * 1024;
|
|
16
16
|
|
|
17
17
|
export const AGENT_WALLET_PACKAGE = "@x402api/agent-wallet-cli";
|
|
18
|
-
export const AGENT_WALLET_VERSION = "0.2.
|
|
18
|
+
export const AGENT_WALLET_VERSION = "0.2.4";
|
|
19
19
|
const AGENT_WALLET_SPEC = `${AGENT_WALLET_PACKAGE}@${AGENT_WALLET_VERSION}`;
|
|
20
20
|
const GAS_SPONSORSHIP_EXTENSION = "com.x402api.gas-sponsorship";
|
|
21
21
|
const BASE_NETWORK = "eip155:8453";
|
|
@@ -183,6 +183,17 @@ function paymentResource(value, label) {
|
|
|
183
183
|
function validateGasSponsorship(declaration) {
|
|
184
184
|
const info = declaration.info;
|
|
185
185
|
const schema = declaration.schema;
|
|
186
|
+
// Mirror @x402api/agent-wallet-core: platform treasury is canonical, the
|
|
187
|
+
// matched tenant-credit pair remains rollout-compatible, and mixed pairs
|
|
188
|
+
// must fail closed.
|
|
189
|
+
const platformTreasuryPolicy =
|
|
190
|
+
isObject(info) &&
|
|
191
|
+
info.billingParty === "platform_treasury" &&
|
|
192
|
+
info.finalChargePolicy === "platform_treasury_actual_cost";
|
|
193
|
+
const legacyTenantCreditPolicy =
|
|
194
|
+
isObject(info) &&
|
|
195
|
+
info.billingParty === "tenant_service_credit" &&
|
|
196
|
+
info.finalChargePolicy === "canonical_actual_gas_capped_by_reservation";
|
|
186
197
|
const infoKeys = [
|
|
187
198
|
"billingParty",
|
|
188
199
|
"buyerNativeFeeRequired",
|
|
@@ -199,8 +210,7 @@ function validateGasSponsorship(declaration) {
|
|
|
199
210
|
info.version !== 1 ||
|
|
200
211
|
info.mode !== "facilitator_pays" ||
|
|
201
212
|
info.buyerNativeFeeRequired !== false ||
|
|
202
|
-
|
|
203
|
-
info.finalChargePolicy !== "canonical_actual_gas_capped_by_reservation" ||
|
|
213
|
+
(!platformTreasuryPolicy && !legacyTenantCreditPolicy) ||
|
|
204
214
|
typeof info.maximumReservationEvidenceDigest !== "string" ||
|
|
205
215
|
!SHA256.test(info.maximumReservationEvidenceDigest) ||
|
|
206
216
|
typeof info.expiresAt !== "string" ||
|