warpmetal 0.5.0 → 0.6.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 +7 -8
- package/package.json +1 -1
- package/src/api.js +28 -28
- package/src/cli.js +2 -2
package/README.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
The official command-line client and portable Agent Skill for WarpMetal.
|
|
4
4
|
|
|
5
|
-
The CLI uses
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
absorbing wallet custody.
|
|
5
|
+
The CLI uses `https://api.warpmetal.com` as the API root; endpoints begin at
|
|
6
|
+
`/health`, `/catalog`, `/orders`, and so on, without a second `/api` prefix. It
|
|
7
|
+
stores generated WarpMetal credentials in a user-private state file and never
|
|
8
|
+
reads or stores wallet private keys or SSH private-key contents. Version 0.6
|
|
9
|
+
adopts this canonical root-path API. WarpMetal writes the exact credential-free
|
|
10
|
+
payment request, explains the next commands to an agent, validates the returned
|
|
11
|
+
payment artifact, and submits it without absorbing wallet custody.
|
|
13
12
|
|
|
14
13
|
## Distribution
|
|
15
14
|
|
package/package.json
CHANGED
package/src/api.js
CHANGED
|
@@ -128,19 +128,19 @@ export class WarpMetalClient {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
health() {
|
|
131
|
-
return this.request("GET", "/
|
|
131
|
+
return this.request("GET", "/health");
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
catalog() {
|
|
135
|
-
return this.request("GET", "/
|
|
135
|
+
return this.request("GET", "/catalog");
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
prepareOrder(body, idempotencyKey) {
|
|
139
|
-
return this.request("POST", "/
|
|
139
|
+
return this.request("POST", "/orders", { body, idempotencyKey });
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
getTask(taskId, token) {
|
|
143
|
-
return this.request("GET", `/
|
|
143
|
+
return this.request("GET", `/tasks/${encodeURIComponent(taskId)}`, {
|
|
144
144
|
token,
|
|
145
145
|
});
|
|
146
146
|
}
|
|
@@ -157,7 +157,7 @@ export class WarpMetalClient {
|
|
|
157
157
|
issueSshChallenge(serverId) {
|
|
158
158
|
return this.request(
|
|
159
159
|
"POST",
|
|
160
|
-
`/
|
|
160
|
+
`/servers/${encodeURIComponent(serverId)}/auth/challenges`,
|
|
161
161
|
{ body: {} },
|
|
162
162
|
);
|
|
163
163
|
}
|
|
@@ -165,13 +165,13 @@ export class WarpMetalClient {
|
|
|
165
165
|
exchangeSshChallenge(serverId, challengeId, signature) {
|
|
166
166
|
return this.request(
|
|
167
167
|
"POST",
|
|
168
|
-
`/
|
|
168
|
+
`/servers/${encodeURIComponent(serverId)}/auth/tokens`,
|
|
169
169
|
{ body: { challengeId, signature } },
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
getServer(serverId, token) {
|
|
174
|
-
return this.request("GET", `/
|
|
174
|
+
return this.request("GET", `/servers/${encodeURIComponent(serverId)}`, {
|
|
175
175
|
token,
|
|
176
176
|
});
|
|
177
177
|
}
|
|
@@ -179,7 +179,7 @@ export class WarpMetalClient {
|
|
|
179
179
|
getRenewalPolicy(serverId, token) {
|
|
180
180
|
return this.request(
|
|
181
181
|
"GET",
|
|
182
|
-
`/
|
|
182
|
+
`/servers/${encodeURIComponent(serverId)}/renewal-policy`,
|
|
183
183
|
{ token },
|
|
184
184
|
);
|
|
185
185
|
}
|
|
@@ -187,7 +187,7 @@ export class WarpMetalClient {
|
|
|
187
187
|
putRenewalPolicy(serverId, body, token) {
|
|
188
188
|
return this.request(
|
|
189
189
|
"PUT",
|
|
190
|
-
`/
|
|
190
|
+
`/servers/${encodeURIComponent(serverId)}/renewal-policy`,
|
|
191
191
|
{ body, token },
|
|
192
192
|
);
|
|
193
193
|
}
|
|
@@ -195,7 +195,7 @@ export class WarpMetalClient {
|
|
|
195
195
|
deleteRenewalPolicy(serverId, token) {
|
|
196
196
|
return this.request(
|
|
197
197
|
"DELETE",
|
|
198
|
-
`/
|
|
198
|
+
`/servers/${encodeURIComponent(serverId)}/renewal-policy`,
|
|
199
199
|
{ token },
|
|
200
200
|
);
|
|
201
201
|
}
|
|
@@ -203,7 +203,7 @@ export class WarpMetalClient {
|
|
|
203
203
|
getNotifications(serverId, token) {
|
|
204
204
|
return this.request(
|
|
205
205
|
"GET",
|
|
206
|
-
`/
|
|
206
|
+
`/servers/${encodeURIComponent(serverId)}/notifications`,
|
|
207
207
|
{ token },
|
|
208
208
|
);
|
|
209
209
|
}
|
|
@@ -211,13 +211,13 @@ export class WarpMetalClient {
|
|
|
211
211
|
putNotifications(serverId, body, token) {
|
|
212
212
|
return this.request(
|
|
213
213
|
"PUT",
|
|
214
|
-
`/
|
|
214
|
+
`/servers/${encodeURIComponent(serverId)}/notifications`,
|
|
215
215
|
{ body, token },
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
renewalCheckout(planId, { bodyText, token, paymentSignature }) {
|
|
220
|
-
return this.checkout(`/
|
|
220
|
+
return this.checkout(`/checkout/${encodeURIComponent(planId)}/renew`, {
|
|
221
221
|
bodyText,
|
|
222
222
|
token,
|
|
223
223
|
paymentSignature,
|
|
@@ -227,7 +227,7 @@ export class WarpMetalClient {
|
|
|
227
227
|
powerServer(serverId, action, token, idempotencyKey) {
|
|
228
228
|
return this.request(
|
|
229
229
|
"POST",
|
|
230
|
-
`/
|
|
230
|
+
`/servers/${encodeURIComponent(serverId)}/power`,
|
|
231
231
|
{
|
|
232
232
|
body: { action },
|
|
233
233
|
token,
|
|
@@ -239,7 +239,7 @@ export class WarpMetalClient {
|
|
|
239
239
|
reloadServer(serverId, body, token, idempotencyKey) {
|
|
240
240
|
return this.request(
|
|
241
241
|
"POST",
|
|
242
|
-
`/
|
|
242
|
+
`/servers/${encodeURIComponent(serverId)}/reload`,
|
|
243
243
|
{
|
|
244
244
|
body,
|
|
245
245
|
token,
|
|
@@ -251,7 +251,7 @@ export class WarpMetalClient {
|
|
|
251
251
|
getOperation(operationId, token) {
|
|
252
252
|
return this.request(
|
|
253
253
|
"GET",
|
|
254
|
-
`/
|
|
254
|
+
`/operations/${encodeURIComponent(operationId)}`,
|
|
255
255
|
{
|
|
256
256
|
token,
|
|
257
257
|
},
|
|
@@ -261,7 +261,7 @@ export class WarpMetalClient {
|
|
|
261
261
|
enableRuntime(serverId, token, idempotencyKey) {
|
|
262
262
|
return this.request(
|
|
263
263
|
"POST",
|
|
264
|
-
`/
|
|
264
|
+
`/servers/${encodeURIComponent(serverId)}/runtime/enable`,
|
|
265
265
|
{
|
|
266
266
|
body: {},
|
|
267
267
|
token,
|
|
@@ -273,7 +273,7 @@ export class WarpMetalClient {
|
|
|
273
273
|
getRuntime(serverId, token) {
|
|
274
274
|
return this.request(
|
|
275
275
|
"GET",
|
|
276
|
-
`/
|
|
276
|
+
`/servers/${encodeURIComponent(serverId)}/runtime`,
|
|
277
277
|
{ token },
|
|
278
278
|
);
|
|
279
279
|
}
|
|
@@ -281,7 +281,7 @@ export class WarpMetalClient {
|
|
|
281
281
|
bootstrapRuntime(serverId, token, idempotencyKey) {
|
|
282
282
|
return this.request(
|
|
283
283
|
"POST",
|
|
284
|
-
`/
|
|
284
|
+
`/servers/${encodeURIComponent(serverId)}/runtime/bootstrap`,
|
|
285
285
|
{ body: {}, token, idempotencyKey },
|
|
286
286
|
);
|
|
287
287
|
}
|
|
@@ -289,7 +289,7 @@ export class WarpMetalClient {
|
|
|
289
289
|
listSandboxes(serverId, token) {
|
|
290
290
|
return this.request(
|
|
291
291
|
"GET",
|
|
292
|
-
`/
|
|
292
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes`,
|
|
293
293
|
{ token },
|
|
294
294
|
);
|
|
295
295
|
}
|
|
@@ -297,7 +297,7 @@ export class WarpMetalClient {
|
|
|
297
297
|
createSandboxes(serverId, sandboxes, token, idempotencyKey) {
|
|
298
298
|
return this.request(
|
|
299
299
|
"POST",
|
|
300
|
-
`/
|
|
300
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes`,
|
|
301
301
|
{
|
|
302
302
|
body: { sandboxes },
|
|
303
303
|
token,
|
|
@@ -309,7 +309,7 @@ export class WarpMetalClient {
|
|
|
309
309
|
getSandbox(serverId, sandboxId, token) {
|
|
310
310
|
return this.request(
|
|
311
311
|
"GET",
|
|
312
|
-
`/
|
|
312
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}`,
|
|
313
313
|
{ token },
|
|
314
314
|
);
|
|
315
315
|
}
|
|
@@ -317,7 +317,7 @@ export class WarpMetalClient {
|
|
|
317
317
|
sandboxAction(serverId, sandboxId, action, token, idempotencyKey) {
|
|
318
318
|
return this.request(
|
|
319
319
|
"POST",
|
|
320
|
-
`/
|
|
320
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/actions`,
|
|
321
321
|
{ body: { action }, token, idempotencyKey },
|
|
322
322
|
);
|
|
323
323
|
}
|
|
@@ -325,7 +325,7 @@ export class WarpMetalClient {
|
|
|
325
325
|
deleteSandbox(serverId, sandboxId, token, idempotencyKey) {
|
|
326
326
|
return this.request(
|
|
327
327
|
"POST",
|
|
328
|
-
`/
|
|
328
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/delete`,
|
|
329
329
|
{ body: { confirm: "DELETE" }, token, idempotencyKey },
|
|
330
330
|
);
|
|
331
331
|
}
|
|
@@ -333,7 +333,7 @@ export class WarpMetalClient {
|
|
|
333
333
|
listAccessGrants(serverId, sandboxId, token) {
|
|
334
334
|
return this.request(
|
|
335
335
|
"GET",
|
|
336
|
-
`/
|
|
336
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/access-grants`,
|
|
337
337
|
{ token },
|
|
338
338
|
);
|
|
339
339
|
}
|
|
@@ -341,7 +341,7 @@ export class WarpMetalClient {
|
|
|
341
341
|
createAccessGrant(serverId, sandboxId, body, token, idempotencyKey) {
|
|
342
342
|
return this.request(
|
|
343
343
|
"POST",
|
|
344
|
-
`/
|
|
344
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/access-grants`,
|
|
345
345
|
{ body, token, idempotencyKey },
|
|
346
346
|
);
|
|
347
347
|
}
|
|
@@ -349,7 +349,7 @@ export class WarpMetalClient {
|
|
|
349
349
|
getAccessGrant(serverId, sandboxId, grantId, token) {
|
|
350
350
|
return this.request(
|
|
351
351
|
"GET",
|
|
352
|
-
`/
|
|
352
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/access-grants/${encodeURIComponent(grantId)}`,
|
|
353
353
|
{ token },
|
|
354
354
|
);
|
|
355
355
|
}
|
|
@@ -357,7 +357,7 @@ export class WarpMetalClient {
|
|
|
357
357
|
revokeAccessGrant(serverId, sandboxId, grantId, token, idempotencyKey) {
|
|
358
358
|
return this.request(
|
|
359
359
|
"POST",
|
|
360
|
-
`/
|
|
360
|
+
`/servers/${encodeURIComponent(serverId)}/sandboxes/${encodeURIComponent(sandboxId)}/access-grants/${encodeURIComponent(grantId)}/revoke`,
|
|
361
361
|
{ body: { confirm: "REVOKE" }, token, idempotencyKey },
|
|
362
362
|
);
|
|
363
363
|
}
|
package/src/cli.js
CHANGED
|
@@ -870,7 +870,7 @@ async function attachRenewalPaymentWorkflow(
|
|
|
870
870
|
requestedEnvelopePath,
|
|
871
871
|
) {
|
|
872
872
|
const bodyText = JSON.stringify({ serverId });
|
|
873
|
-
const checkoutPath = `/
|
|
873
|
+
const checkoutPath = `/checkout/${server.planId}/renew`;
|
|
874
874
|
const safe = challengeResult(serverId, bodyText, response);
|
|
875
875
|
if (!safe.paymentRequired) return safe;
|
|
876
876
|
const request = createPaymentRequestEnvelope({
|
|
@@ -934,7 +934,7 @@ async function attachRenewalPaymentWorkflow(
|
|
|
934
934
|
: term.amountAtomic;
|
|
935
935
|
const refillWorkflow = {
|
|
936
936
|
environment: {
|
|
937
|
-
X402API_NOTIFICATION_URL: `${client.baseUrl}/
|
|
937
|
+
X402API_NOTIFICATION_URL: `${client.baseUrl}/notifications/x402api/refill`,
|
|
938
938
|
},
|
|
939
939
|
argv: [
|
|
940
940
|
"x402api",
|