sandcovery 0.7.0 → 0.10.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 +11 -8
- package/dist/cli/index.mjs +13025 -19868
- package/dist/cli/sandcovery-docker.mjs +8550 -3
- package/dist/cli/sandcovery-kubectl.mjs +7 -4
- package/dist/cli/sandcovery-t3.mjs +143 -61
- package/dist/index.d.mts +9072 -135
- package/dist/index.mjs +1 -1
- package/dist/{kubectl-ClFWX65x.mjs → kubectl-BZIzN5z0.mjs} +131 -97
- package/dist/saved-sandboxes-XNeQ5SEm.mjs +389 -0
- package/dist/{x-account-BSasf-z-.mjs → src-Ce-b80jJ.mjs} +19731 -8599
- package/dist/sync-KX0CReEd.mjs +4171 -0
- package/dist/third-party-licenses.md +630 -0
- package/dist/types-DotsDqXt.d.mts +1264 -0
- package/dist/types.d.mts +2 -2
- package/package.json +4 -4
- package/dist/src-gAv6vIvE.mjs +0 -566
- package/dist/tool-B8KvfvY5.mjs +0 -12890
- package/dist/types-B52jOW9v.d.mts +0 -853
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ import { Sandcovery } from 'sandcovery'
|
|
|
24
24
|
const sandcovery = new Sandcovery()
|
|
25
25
|
|
|
26
26
|
const sandbox = await sandcovery.sandboxes.create({
|
|
27
|
+
api_key_id: null,
|
|
27
28
|
disk_mib: null,
|
|
28
29
|
egress: null,
|
|
29
30
|
env: null,
|
|
@@ -65,11 +66,11 @@ Sandcovery destroys every sandbox at its `ttl_seconds`, even when your process e
|
|
|
65
66
|
|
|
66
67
|
## Command line
|
|
67
68
|
|
|
68
|
-
The package also installs the `sandcovery` command. Each operation in the [OpenAPI document](https://www.sandcovery.com/
|
|
69
|
+
The package also installs the `sandcovery` command. Each operation in the [OpenAPI document](https://www.sandcovery.com/openapi.json) is one command, `sandcovery <group> <operation>`, named as the document names it, and each of its parameters and body fields is a flag of the same name.
|
|
69
70
|
|
|
70
71
|
```sh
|
|
71
72
|
npm install --global sandcovery
|
|
72
|
-
export SANDCOVERY_API_KEY=
|
|
73
|
+
export SANDCOVERY_API_KEY=ak_...
|
|
73
74
|
|
|
74
75
|
id=$(sandcovery sandboxes createSandbox --slug sandcovery/2x4:cheapest --ttl_seconds 600 | jq -r .id)
|
|
75
76
|
sandcovery sandboxes execSandbox --sandbox_id "$id" --command 'npm test'
|
|
@@ -78,7 +79,7 @@ sandcovery sandboxes destroySandbox --sandbox_id "$id"
|
|
|
78
79
|
|
|
79
80
|
- A command prints the API's answer body on stdout. An error answer goes to stderr as the API sent it, and the command exits 1.
|
|
80
81
|
- It sends `SANDCOVERY_API_KEY` as the key, and calls `SANDCOVERY_BASE_URL` when it is set, or https://www.sandcovery.com.
|
|
81
|
-
- A flag for a field that is not text, such as a number, a list, or an object, takes JSON. An operation whose body is a file, such as `sandboxes uploadFile`, reads that body from stdin.
|
|
82
|
+
- A flag for a body field that is not text, such as a number, a list, or an object, takes JSON, either as the flag value or as `@` and a path relative to the current directory to a file inside it, such as `--env @env.json`. Every other flag takes its value as text as written, so `--command @run.sh` sends the text `@run.sh`. An operation whose body is a file, such as `sandboxes uploadFile`, reads that body from stdin.
|
|
82
83
|
- `--help` works on every command.
|
|
83
84
|
|
|
84
85
|
## Docker, kubectl, and T3 Code
|
|
@@ -91,7 +92,7 @@ The package installs three more commands that run your tools on sandboxes throug
|
|
|
91
92
|
|
|
92
93
|
## Routing
|
|
93
94
|
|
|
94
|
-
A slug names a provider and a size, written `<provider>/<vcpu>x<memory_gib>`, in the shape of OpenRouter model slugs. `boat/2x4` pins boat at 2 vCPU and 4 GiB, and `sandcovery/2x4` routes across every candidate provider. Either number may be `n` for any value, so `sandcovery/nx16` runs each provider's cheapest size with 16 GiB. A slug routes as `:cheapest`, sorting candidates by
|
|
95
|
+
A slug names a provider and a size, written `<provider>/<vcpu>x<memory_gib>`, in the shape of OpenRouter model slugs. `boat/2x4` pins boat at 2 vCPU and 4 GiB, and `sandcovery/2x4` routes across every candidate provider. Either number may be `n` for any value, so `sandcovery/nx16` runs each provider's cheapest size with 16 GiB. A slug routes as `:cheapest`, sorting candidates by hourly price, and a provider that charges by the month has no per-use price to compare, so `:cheapest` never picks one. Add `:fastest` or `:most-reliable` to sort them by measured create latency or uptime over the last 15 minutes instead. With no slug, a create runs `sandcovery/2x4`.
|
|
95
96
|
|
|
96
97
|
`slugs` takes up to 8 slugs to try in order, as OpenRouter takes `models`, and `slug` goes first when both are set. Within a `sandcovery/` slug, a failed create falls back across that slug's candidates first, then moves to the next slug. `provider` takes `order`, `only`, `ignore`, `sort`, and `allow_fallbacks` and applies them to every slug. Every create attempt is listed in `sandbox.attempts`, and `sandbox.slug` is the provider and size it runs on.
|
|
97
98
|
|
|
@@ -99,17 +100,19 @@ Provider, region, and slug names are open strings, so a name the API adds later
|
|
|
99
100
|
|
|
100
101
|
## Keys and provider credentials
|
|
101
102
|
|
|
102
|
-
`keys`, `credentials`, `usage`, and `billing` need a management key, which an organization
|
|
103
|
+
`keys`, `credentials`, `usage`, and `billing` need a management key, which an organization admin mints in the dashboard. An API key receives 403 there.
|
|
103
104
|
|
|
104
105
|
```ts
|
|
105
106
|
const admin = new Sandcovery({ apiKey: process.env.SANDCOVERY_MANAGEMENT_KEY })
|
|
106
107
|
|
|
107
|
-
await admin.credentials.set('e2b', { api_key: process.env.E2B_API_KEY })
|
|
108
|
+
await admin.credentials.set('e2b', { api_key: process.env.E2B_API_KEY ?? '' })
|
|
108
109
|
```
|
|
109
110
|
|
|
110
111
|
On Pro or the Enterprise plan, an organization holds as many credentials per provider as it needs: `credentials.add(provider, fields)` adds another, a create tries a provider's credentials in the order they were added, and `credentials.deleteOne(provider, id)` deletes one. A Free organization routes one of its own keys per provider, so adding a second key of the same provider receives 403. When an organization leaves Pro or the Enterprise plan, it keeps every key, routes the oldest key of each provider, and `paused` is `true` on the others until it is on Pro or the Enterprise plan again.
|
|
111
112
|
|
|
112
|
-
The fields each provider takes are its `credential_fields` on `sandcovery.providers.get(provider)`. `sandcovery.providers.catalog()` lists every provider on the [provider board](https://www.sandcovery.com/providers), where `routed` is `false` for a provider that is coming soon. `credentials.offer()` reads the free
|
|
113
|
+
The fields each provider takes are its `credential_fields` on `sandcovery.providers.get(provider)`. `sandcovery.providers.catalog()` lists every provider on the [provider board](https://www.sandcovery.com/providers), where `routed` is `false` for a provider that is coming soon. `credentials.offer()` reads the free vCPUh your keys have earned, `credentials.countXPost()` finds your newest post on X of the last day that tags @Sandcovery and counts it as one key, reading X at most 10 times a UTC day and 30 seconds apart for an organization and otherwise answering `retry_later` with `retry_at`.
|
|
114
|
+
|
|
115
|
+
`billing.get()` reads the plan, the credit balance, whether credits are on sale, and auto top-up. `billing.startSubscription({ plan })` answers the Stripe Checkout page that starts a Pro or Enterprise subscription, and `billing.openBillingPortal()` answers the Stripe billing portal page where an admin manages the subscription, payment method, and invoices. `billing.buyCredits({ amount_micro_usd })` answers the Stripe Checkout page that takes a credit payment. `billing.setAutoTopUp({ amount_micro_usd, threshold_micro_usd })` sets the amount Sandcovery charges the saved card each time the credit balance falls below the threshold or a create needs credit that one top-up covers. While auto top-up is on, the change applies at once. While it is off, the answer carries the Stripe Checkout page that saves a card and then turns auto top-up on with these settings. `billing.stopAutoTopUp()` turns auto top-up off. Auto top-up charges the card its own Checkout page saved, not the card the billing portal sets, and removing that card in the portal turns auto top-up off at its next charge. To move it to another card, call `billing.stopAutoTopUp()` and then `billing.setAutoTopUp(...)` again. `billing.openBillingPortal()` throws with the error code `not_found` until the organization has a Stripe customer, which each of these Checkout pages makes.
|
|
113
116
|
|
|
114
117
|
## X account
|
|
115
118
|
|
|
@@ -117,7 +120,7 @@ The fields each provider takes are its `credential_fields` on `sandcovery.provid
|
|
|
117
120
|
|
|
118
121
|
## Interfaces
|
|
119
122
|
|
|
120
|
-
This client
|
|
123
|
+
This client and the Python client have a method for every operation of the REST API except CLI sign-in, the health check, and the choices for a credential field. The `sandcovery` command reaches every operation.
|
|
121
124
|
|
|
122
125
|
## Errors
|
|
123
126
|
|