warpmetal 0.1.0 → 0.2.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 CHANGED
@@ -4,7 +4,8 @@ The official command-line client and portable Agent Skill for WarpMetal.
4
4
 
5
5
  The CLI uses the public API at `https://api.warpmetal.com`, stores generated
6
6
  WarpMetal credentials in a user-private state file, and never reads or stores
7
- wallet private keys or SSH private-key contents.
7
+ wallet private keys or SSH private-key contents. Version 0.2 adds the optional
8
+ Agent Runtime workflow for fixed-size, isolated sandboxes on one owner's VPS.
8
9
 
9
10
  ## Distribution
10
11
 
@@ -68,8 +69,44 @@ alternate state directory.
68
69
  Wallet key management and signing remain outside this package.
69
70
  - Destructive or state-changing commands require explicit confirmations and
70
71
  generate idempotency keys by default.
72
+ - Runtime bootstrap credentials remain memory-only. Signed supervisor bundles
73
+ are checksum- and signature-verified before OpenSSH uploads them.
74
+ - Each agent gets a distinct SSH key forced into exactly one sandbox. Token-free
75
+ connection profiles pin the VPS host key and contain no owner credential or
76
+ private-key material.
77
+ - Sandboxes use the fixed runtime image and fixed sizes. Persistent is the
78
+ default; temporary sandboxes require explicit confirmation and permanently
79
+ delete their workspace after 15 minutes to 24 hours.
71
80
 
72
- ## Publishing status
81
+ ## Agent Runtime example
73
82
 
74
- This package is an initial development release. Choose the public-source
75
- license and replace `UNLICENSED` before publishing it to npm.
83
+ ```sh
84
+ warpmetal runtime enable --server <serverId> --json
85
+ warpmetal runtime install \
86
+ --server <serverId> \
87
+ --identity ~/.ssh/warpmetal-owner \
88
+ --ssh-user ubuntu \
89
+ --confirm INSTALL \
90
+ --wait \
91
+ --json
92
+ warpmetal sandbox create \
93
+ --server <serverId> \
94
+ --name planner \
95
+ --size small \
96
+ --wait \
97
+ --json
98
+ warpmetal sandbox access keygen \
99
+ --output ~/.ssh/warpmetal-planner \
100
+ --confirm GENERATE \
101
+ --json
102
+ ```
103
+
104
+ See `skills/warpmetal/references/runtime.md` for the complete lifecycle,
105
+ cleanup, access-grant, and strict host-key connection workflow.
106
+
107
+ ## Release status
108
+
109
+ The initial development release is published at
110
+ `https://www.npmjs.com/package/warpmetal`. The source is publicly visible but
111
+ remains `UNLICENSED`; choose an explicit license before describing the project
112
+ as open source or inviting third-party reuse.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "warpmetal",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Agent-safe CLI and skill for purchasing and managing WarpMetal VPS servers",
5
5
  "type": "module",
6
6
  "bin": {
7
- "warpmetal": "./bin/warpmetal.js"
7
+ "warpmetal": "bin/warpmetal.js"
8
8
  },
9
9
  "files": [
10
10
  "bin/",
@@ -16,7 +16,7 @@
16
16
  "node": ">=20.0.0"
17
17
  },
18
18
  "scripts": {
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/errors.js && node --check src/install-skill.js && node --check src/ssh.js && node --check src/state.js",
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/runtime.js && node --check src/ssh.js && node --check src/state.js && node --check src/version.js",
20
20
  "test": "node --test",
21
21
  "prepack": "npm run check && npm test"
22
22
  },
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: warpmetal
3
- description: Safely purchase and manage WarpMetal VPS servers with the warpmetal CLI. Use when Codex, Claude Code, Cursor, Windsurf, or another shell-capable agent needs to inspect live VPS plans and operating systems, prepare or pay for an x402 order, poll provisioning, prove ownership with an SSH key, inspect a server, or run supported lifecycle operations.
3
+ description: Safely purchase and manage WarpMetal VPS servers and Agent Runtime sandboxes with the official warpmetal CLI. Use when a shell-capable agent needs live VPS discovery, x402 ordering, provisioning, server management, optional runtime installation, fixed-size sandbox creation, persistent or temporary lifetime, per-agent SSH access, sandbox connection, access revocation, or workspace deletion.
4
4
  ---
5
5
 
6
6
  # WarpMetal
@@ -19,6 +19,8 @@ with ad hoc HTTP commands.
19
19
  authorizing payment, using an SSH identity, or changing a server.
20
20
  5. Read [references/cli-reference.md](references/cli-reference.md) when choosing
21
21
  a command or interpreting an exit code.
22
+ 6. Read [references/runtime.md](references/runtime.md) before requesting,
23
+ installing, accessing, expiring, or deleting Agent Runtime sandboxes.
22
24
 
23
25
  Never read, print, summarize, upload, or commit the WarpMetal state file. Never
24
26
  read an SSH private-key file. Pass its path only to a command designed to use
@@ -109,3 +111,27 @@ warpmetal server power \
109
111
  Do not fall back to raw API calls for reload, deletion, networking, renewal,
110
112
  or another unsupported mutation. Explain that the installed CLI version does
111
113
  not yet expose that guarded operation.
114
+
115
+ ## Use Agent Runtime
116
+
117
+ Agent Runtime is optional and shares one owner's VPS only among that owner's
118
+ agents. Discover live `agentRuntime` capacity and OS support before choosing
119
+ sizes. Use `--runtime-file` to include sandbox intent in an unpaid order, or
120
+ `warpmetal runtime enable` after the VPS is ready. Supervisor installation is
121
+ separate and requires approval plus `--confirm INSTALL`.
122
+
123
+ Omitted lifetime means persistent. A temporary sandbox requires
124
+ `--confirm TEMPORARY`, expires 15 minutes to 24 hours after first reaching
125
+ running, and permanently deletes its workspace at expiry. Never describe a
126
+ pending HTTP 202 response as applied; poll runtime, sandbox, and grant state.
127
+
128
+ Every agent must use a distinct sandbox-specific SSH key. Ask before key
129
+ generation, create one access grant for one sandbox, wait for `applied` plus
130
+ pinned host keys, then connect only through `warpmetal sandbox connect`.
131
+ Never give an agent the owner host key, owner token, SSH-derived management
132
+ token, runtime bootstrap, or node token.
133
+
134
+ If the installed CLI lacks a required runtime command, stop, explain the
135
+ version limitation, and ask before upgrading the official npm package. Do not
136
+ reconstruct runtime changes with raw HTTP, ad hoc SSH, Podman, Docker, or host
137
+ configuration commands.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "WarpMetal VPS"
3
- short_description: "Purchase and manage WarpMetal VPS servers"
4
- default_prompt: "Use $warpmetal to choose, purchase, and manage a WarpMetal VPS safely."
3
+ short_description: "Manage WarpMetal VPS and agent sandboxes safely"
4
+ default_prompt: "Use $warpmetal to provision a VPS and manage isolated agent sandboxes safely."
@@ -5,6 +5,8 @@
5
5
  - Discovery
6
6
  - Purchase and provisioning
7
7
  - Server management
8
+ - Agent Runtime and sandboxes
9
+ - Per-agent access
8
10
  - Skill installation and state
9
11
  - Exit codes
10
12
 
@@ -26,6 +28,7 @@ warpmetal order prepare \
26
28
  --hostname <dns-label> \
27
29
  --os '<exact live OS name>' \
28
30
  --ssh-public-key-file <path> \
31
+ [--runtime-file <runtime.json>] [--confirm TEMPORARY] \
29
32
  [--email <address>] \
30
33
  [--idempotency-key <key>] \
31
34
  --json
@@ -77,6 +80,56 @@ Use `--token-file` only for recovery when local state is unavailable. Prefer
77
80
  shell argument, because command-line arguments can be recorded in history and
78
81
  process listings.
79
82
 
83
+ ## Agent Runtime and sandboxes
84
+
85
+ ```sh
86
+ warpmetal runtime enable --server <serverId> [--idempotency-key <key>] --json
87
+ warpmetal runtime get --server <serverId> [--wait] [--timeout-seconds <n>] --json
88
+ warpmetal runtime install \
89
+ --server <serverId> --identity <owner-key> --ssh-user <admin-user> \
90
+ --confirm INSTALL [--wait] [--timeout-seconds <n>] --json
91
+
92
+ warpmetal sandbox create \
93
+ --server <serverId> --name <name> --size <small|medium|large|xlarge> \
94
+ [--lifetime temporary] [--expires-in-seconds <900-86400>] \
95
+ [--confirm TEMPORARY] [--wait] [--timeout-seconds <n>] --json
96
+ warpmetal sandbox create --server <serverId> --file <batch.json> \
97
+ [--confirm TEMPORARY] [--wait] [--timeout-seconds <n>] --json
98
+ warpmetal sandbox list --server <serverId> --json
99
+ warpmetal sandbox get --server <serverId> --sandbox <sandboxId> [--wait] --json
100
+ warpmetal sandbox action \
101
+ --server <serverId> --sandbox <sandboxId> \
102
+ --action <start|stop|restart|make_persistent> --confirm <same-action> \
103
+ [--wait] --json
104
+ warpmetal sandbox delete \
105
+ --server <serverId> --sandbox <sandboxId> --confirm DELETE [--wait] --json
106
+ ```
107
+
108
+ See [runtime.md](runtime.md) for capacity, lifetime, cleanup, polling, and
109
+ installation safety. Exit 8 means accepted or pending, never applied.
110
+
111
+ ## Per-agent access
112
+
113
+ ```sh
114
+ warpmetal sandbox access keygen --output <private-key-path> --confirm GENERATE --json
115
+ warpmetal sandbox access grant \
116
+ --server <serverId> --sandbox <sandboxId> --name <name> \
117
+ --ssh-public-key-file <public-key-path> \
118
+ [--connection-file <profile-path>] [--wait] --json
119
+ warpmetal sandbox access list --server <serverId> --sandbox <sandboxId> --json
120
+ warpmetal sandbox access get \
121
+ --server <serverId> --sandbox <sandboxId> --grant <grantId> [--wait] --json
122
+ warpmetal sandbox access revoke \
123
+ --server <serverId> --sandbox <sandboxId> --grant <grantId> \
124
+ --confirm REVOKE [--wait] --json
125
+ warpmetal sandbox connect --connection-file <profile-path> \
126
+ --identity <sandbox-private-key-path> [-- <remote-command> <arguments...>]
127
+ ```
128
+
129
+ `sandbox connect` is the only runtime command that does not use `--json`; it
130
+ returns the OpenSSH or remote exit status. `--connection-file` on grant
131
+ creation requires `--wait`.
132
+
80
133
  ## Skill installation and state
81
134
 
82
135
  ```sh
@@ -84,7 +137,8 @@ warpmetal agent install --target <codex|claude|all> [--scope user|project]
84
137
  warpmetal state list --json
85
138
  ```
86
139
 
87
- `state list` returns identifiers and credential-presence booleans only. Never
140
+ `state list` returns identifiers, public runtime metadata, and
141
+ credential-presence booleans only. Never
88
142
  open the underlying state file from an agent session.
89
143
 
90
144
  ## Exit codes
@@ -0,0 +1,194 @@
1
+ # WarpMetal Agent Runtime
2
+
3
+ ## Product boundary
4
+
5
+ Agent Runtime is optional. One VPS owner uses it to divide that owner's VPS
6
+ among that owner's agents; it is not a multi-customer hosting or billing
7
+ system. VPS price, term, renewal, power, and payment remain unchanged.
8
+
9
+ All V1 sandboxes use one WarpMetal-pinned image. Callers choose a published
10
+ size, not an arbitrary image, template, command, mount, environment, CPU,
11
+ memory, or disk value.
12
+
13
+ ## Discover capacity and OS support
14
+
15
+ Run `warpmetal catalog --json`. Use only the selected product's live:
16
+
17
+ - `agentRuntime.supported`;
18
+ - `agentRuntime.capacity`;
19
+ - `agentRuntime.sizes[]`; and
20
+ - `operatingSystems[].agentRuntimeSupported`.
21
+
22
+ The API checks admission again and the installed supervisor may reject work
23
+ when actual host capacity is lower. Never assume every size fits every VPS.
24
+
25
+ ## Order-time versus after provisioning
26
+
27
+ For order-time intent, write a JSON file containing only `sandboxes` and the
28
+ fields `name`, `size`, optional `lifetime`, and optional `expiresInSeconds`:
29
+
30
+ ```json
31
+ {
32
+ "sandboxes": [
33
+ { "name": "planner", "size": "small" },
34
+ { "name": "builder", "size": "medium" },
35
+ {
36
+ "name": "reviewer",
37
+ "size": "small",
38
+ "lifetime": "temporary",
39
+ "expiresInSeconds": 14400
40
+ }
41
+ ]
42
+ }
43
+ ```
44
+
45
+ Pass it to `warpmetal order prepare --runtime-file <path>`. If it contains a
46
+ temporary sandbox, pass `--confirm TEMPORARY`. Preparing remains unpaid; keep
47
+ the existing separate payment approval.
48
+
49
+ For an existing ready server:
50
+
51
+ ```sh
52
+ warpmetal runtime enable --server <serverId> --json
53
+ warpmetal runtime install \
54
+ --server <serverId> \
55
+ --identity <owner-private-key-path> \
56
+ --ssh-user <os-admin-user> \
57
+ --confirm INSTALL \
58
+ --wait \
59
+ --json
60
+ warpmetal runtime get --server <serverId> --wait --json
61
+ ```
62
+
63
+ Ask before installation. Pass the owner key path without reading the file.
64
+ The CLI holds the one-time bootstrap only in memory, verifies the signed
65
+ artifact, uploads it through OpenSSH without a shell-enabled local spawn, and
66
+ does not print or store the bootstrap.
67
+
68
+ ## Sizes and lifetime
69
+
70
+ Use `small`, `medium`, `large`, or `xlarge` exactly as the live catalog
71
+ publishes them. Create one sandbox or an atomic JSON batch:
72
+
73
+ ```sh
74
+ warpmetal sandbox create \
75
+ --server <serverId> \
76
+ --name <name> \
77
+ --size <size> \
78
+ [--lifetime temporary] \
79
+ [--expires-in-seconds <900-86400>] \
80
+ [--confirm TEMPORARY] \
81
+ --wait \
82
+ --json
83
+
84
+ warpmetal sandbox create \
85
+ --server <serverId> \
86
+ --file <batch.json> \
87
+ [--confirm TEMPORARY] \
88
+ --wait \
89
+ --json
90
+ ```
91
+
92
+ Lifetime rules:
93
+
94
+ - Omitted lifetime is persistent and has no automatic deletion.
95
+ - Temporary defaults to 86,400 seconds, with a 900-second minimum and
96
+ 86,400-second maximum.
97
+ - The clock begins on first `running`; restart and stop do not reset or pause
98
+ it.
99
+ - `expiresAt` is authoritative after first running.
100
+ - Expiry revokes access, terminates sessions, removes the container, and
101
+ permanently deletes the workspace even during a control-plane outage.
102
+ - Before `expiring`, `make_persistent` removes automatic expiry. V1 cannot
103
+ extend a temporary duration.
104
+
105
+ Use `sandbox list`, `sandbox get --wait`, and guarded `sandbox action` commands
106
+ to observe and change desired state. HTTP 202 and CLI exit 8 mean accepted or
107
+ pending, not complete.
108
+
109
+ Manual deletion is irreversible:
110
+
111
+ ```sh
112
+ warpmetal sandbox delete \
113
+ --server <serverId> \
114
+ --sandbox <sandboxId> \
115
+ --confirm DELETE \
116
+ --wait \
117
+ --json
118
+ ```
119
+
120
+ State the workspace-loss consequence and get approval before running it.
121
+
122
+ ## One key and grant per agent sandbox
123
+
124
+ The owner host key is never an agent sandbox credential. For each agent and
125
+ sandbox, ask before generating a distinct Ed25519 keypair:
126
+
127
+ ```sh
128
+ warpmetal sandbox access keygen \
129
+ --output <sandbox-private-key-path> \
130
+ --confirm GENERATE \
131
+ --json
132
+
133
+ warpmetal sandbox access grant \
134
+ --server <serverId> \
135
+ --sandbox <sandboxId> \
136
+ --name <grant-name> \
137
+ --ssh-public-key-file <sandbox-public-key-path> \
138
+ --connection-file <profile-path> \
139
+ --wait \
140
+ --json
141
+ ```
142
+
143
+ Only the public key goes to WarpMetal. The private key stays with the agent.
144
+ The token-free profile is written only after the grant is `applied` and the
145
+ API supplies verified VPS host keys. Do not print or open that profile in an
146
+ agent conversation.
147
+
148
+ Connect without an owner management credential:
149
+
150
+ ```sh
151
+ warpmetal sandbox connect \
152
+ --connection-file <profile-path> \
153
+ --identity <sandbox-private-key-path>
154
+
155
+ warpmetal sandbox connect \
156
+ --connection-file <profile-path> \
157
+ --identity <sandbox-private-key-path> \
158
+ -- <remote-command> <arguments...>
159
+ ```
160
+
161
+ `sandbox connect` is direct SSH transport and does not use `--json`. It pins
162
+ the API-provided host key, disables forwarding, never reads the private key,
163
+ and returns the remote exit status. The forced gateway maps the key to exactly
164
+ one sandbox and cannot start a host shell.
165
+
166
+ Revoke access with explicit approval:
167
+
168
+ ```sh
169
+ warpmetal sandbox access revoke \
170
+ --server <serverId> \
171
+ --sandbox <sandboxId> \
172
+ --grant <grantId> \
173
+ --confirm REVOKE \
174
+ --wait \
175
+ --json
176
+ ```
177
+
178
+ Revocation removes new access and terminates tracked active sessions while
179
+ leaving the sandbox itself intact.
180
+
181
+ ## Stop conditions
182
+
183
+ Stop rather than improvise when:
184
+
185
+ - the CLI lacks a required runtime command;
186
+ - the live catalog does not support the plan, size, or OS;
187
+ - runtime is `degraded`, `offline`, or `needs_reinstall` and the documented
188
+ repair is not approved;
189
+ - a sandbox or grant reaches `failed`;
190
+ - pinned host keys are missing or differ;
191
+ - deletion, temporary expiry, key generation, installation, or revocation has
192
+ not received the required approval; or
193
+ - any command would require raw API, raw Podman/Docker, ad hoc SSH host
194
+ mutation, the owner key inside a sandbox, or exposure of a credential.
@@ -23,7 +23,12 @@
23
23
  - Treat an SSH-derived access token as a short-lived bearer credential. Let
24
24
  the CLI store and refresh it.
25
25
  - Never read or transmit an SSH private key. Pass only its filesystem path to
26
- `warpmetal server login` or `ssh-keygen`.
26
+ `warpmetal server login`, `warpmetal runtime install`,
27
+ `warpmetal sandbox connect`, or `ssh-keygen`.
28
+ - Never place the owner SSH key, owner token, management access token, runtime
29
+ bootstrap, supervisor node token, or state file inside a sandbox.
30
+ - Give each agent a distinct sandbox-specific SSH key and grant. Never reuse
31
+ the owner host key or one agent key across multiple sandboxes.
27
32
  - Never request, read, transmit, or store a wallet seed phrase or private key.
28
33
  - Never put a token, payment signature, private key, or state-file content in
29
34
  a prompt, URL, log, screenshot, source file, or shell argument.
@@ -33,11 +38,14 @@
33
38
  Obtain explicit user approval immediately before:
34
39
 
35
40
  - installing the CLI or skill;
41
+ - installing or repairing the Agent Runtime supervisor;
36
42
  - generating a new SSH key pair;
37
43
  - creating or funding a wallet;
38
44
  - signing or submitting an x402 payment authorization;
39
45
  - booting, rebooting, or shutting down a server; and
40
- - any destructive reload, deletion, or replacement-key operation.
46
+ - creating a temporary sandbox after explaining its irreversible expiry;
47
+ - revoking a sandbox access grant; and
48
+ - any destructive reload, sandbox deletion, or replacement-key operation.
41
49
 
42
50
  An order preparation is unpaid but consumes a limited prepared-order slot.
43
51
  Confirm the plan, hostname, OS, and public key before preparing it.
@@ -53,3 +61,8 @@ Confirm the plan, hostname, OS, and public key before preparing it.
53
61
  mutation.
54
62
  - Treat HTTP 202 as accepted or pending, never as proof of success. Poll the
55
63
  returned task or operation until a documented terminal state.
64
+ - Temporary sandbox expiry is a local hard deadline. Stop, restart, and
65
+ control-plane outages do not pause it; expiry permanently deletes the
66
+ workspace and revokes access.
67
+ - Stop when the installed CLI lacks a runtime command. Do not fall back to raw
68
+ HTTP, raw Podman/Docker, or ad hoc SSH host mutation.