promigence 0.1.0-beta.12

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.
Files changed (97) hide show
  1. package/NOTICE +14 -0
  2. package/README.md +88 -0
  3. package/dist/account.js +850 -0
  4. package/dist/agent.js +374 -0
  5. package/dist/argv.js +159 -0
  6. package/dist/bin.js +332 -0
  7. package/dist/bundle.js +133 -0
  8. package/dist/capacity.js +69 -0
  9. package/dist/commands.d.ts +110 -0
  10. package/dist/commands.js +2675 -0
  11. package/dist/connectreq.js +125 -0
  12. package/dist/credfile.js +188 -0
  13. package/dist/credits.js +197 -0
  14. package/dist/devcontainer.d.ts +99 -0
  15. package/dist/devcontainer.js +744 -0
  16. package/dist/device.js +129 -0
  17. package/dist/dirsnap.js +378 -0
  18. package/dist/errfix.js +262 -0
  19. package/dist/generated.d.ts +35 -0
  20. package/dist/generated.js +307 -0
  21. package/dist/github.js +307 -0
  22. package/dist/gitlab.js +210 -0
  23. package/dist/guide.d.ts +19 -0
  24. package/dist/guide.js +366 -0
  25. package/dist/handlers.js +511 -0
  26. package/dist/index.d.ts +14 -0
  27. package/dist/index.js +7 -0
  28. package/dist/init.d.ts +40 -0
  29. package/dist/init.js +352 -0
  30. package/dist/install.d.ts +23 -0
  31. package/dist/install.js +127 -0
  32. package/dist/io.d.ts +37 -0
  33. package/dist/io.js +318 -0
  34. package/dist/live.js +469 -0
  35. package/dist/login.js +1063 -0
  36. package/dist/mcp.js +889 -0
  37. package/dist/money.js +5 -0
  38. package/dist/orgs.js +475 -0
  39. package/dist/pricing.d.ts +52 -0
  40. package/dist/pricing.js +181 -0
  41. package/dist/report.js +132 -0
  42. package/dist/routes.js +135 -0
  43. package/dist/runners-github.js +257 -0
  44. package/dist/runners-gitlab.js +125 -0
  45. package/dist/runners-spec.js +137 -0
  46. package/dist/runners.js +1458 -0
  47. package/dist/sdk/blake3.d.ts +10 -0
  48. package/dist/sdk/blake3.js +111 -0
  49. package/dist/sdk/bundle.d.ts +96 -0
  50. package/dist/sdk/bundle.js +227 -0
  51. package/dist/sdk/ca-guard.js +166 -0
  52. package/dist/sdk/caller.d.ts +73 -0
  53. package/dist/sdk/caller.js +47 -0
  54. package/dist/sdk/client.d.ts +3015 -0
  55. package/dist/sdk/client.js +2583 -0
  56. package/dist/sdk/command-errors.d.ts +41 -0
  57. package/dist/sdk/command-errors.js +36 -0
  58. package/dist/sdk/context.d.ts +119 -0
  59. package/dist/sdk/context.js +588 -0
  60. package/dist/sdk/core.d.ts +285 -0
  61. package/dist/sdk/core.js +266 -0
  62. package/dist/sdk/credstore.d.ts +90 -0
  63. package/dist/sdk/credstore.js +206 -0
  64. package/dist/sdk/dispatcher.js +86 -0
  65. package/dist/sdk/github.d.ts +158 -0
  66. package/dist/sdk/github.js +78 -0
  67. package/dist/sdk/gitlab.d.ts +104 -0
  68. package/dist/sdk/gitlab.js +20 -0
  69. package/dist/sdk/handles.d.ts +82 -0
  70. package/dist/sdk/handles.js +135 -0
  71. package/dist/sdk/hint.js +7 -0
  72. package/dist/sdk/http2.js +1921 -0
  73. package/dist/sdk/index.d.ts +34 -0
  74. package/dist/sdk/index.js +15 -0
  75. package/dist/sdk/keyed.gen.js +7 -0
  76. package/dist/sdk/models.gen.d.ts +6162 -0
  77. package/dist/sdk/models.gen.js +1 -0
  78. package/dist/sdk/proxy.js +249 -0
  79. package/dist/sdk/pty.d.ts +171 -0
  80. package/dist/sdk/pty.js +496 -0
  81. package/dist/sdk/sandbox.d.ts +537 -0
  82. package/dist/sdk/sandbox.js +725 -0
  83. package/dist/sdk/ssh.d.ts +25 -0
  84. package/dist/sdk/ssh.js +114 -0
  85. package/dist/sdk/trace.js +80 -0
  86. package/dist/sdk/transport-worker.js +466 -0
  87. package/dist/sdk/warm.js +40 -0
  88. package/dist/ssh.js +267 -0
  89. package/dist/surface.d.ts +95 -0
  90. package/dist/surface.js +1452 -0
  91. package/dist/templates.js +53 -0
  92. package/dist/term.js +50 -0
  93. package/dist/timing.js +71 -0
  94. package/dist/untar.js +324 -0
  95. package/dist/uploadguard.js +75 -0
  96. package/llms.txt +209 -0
  97. package/package.json +52 -0
package/llms.txt ADDED
@@ -0,0 +1,209 @@
1
+ # Promigence — promigence@0.1.0-beta.12
2
+
3
+ > Verified, reproducible, forkable execution environments for agents. The CLI is the
4
+ > `promigence` command (package `promigence`, which is also the TypeScript SDK).
5
+
6
+ ## Index
7
+
8
+ - `promigence login` — sign up or sign in (email; GitHub/Google where enabled); stores a new API key
9
+ - `promigence signup` — create an account
10
+ - `promigence logout` — forget this CLI's key (revoked when `promigence login` minted it)
11
+ - `promigence auth login` — store an API key (--from-env VAR | stdin; never on argv)
12
+ - `promigence keys list` — your org's API keys
13
+ - `promigence keys create` — mint a key (secret printed once)
14
+ - `promigence keys revoke` — revoke a key
15
+ - `promigence org list` — your organizations (* = default)
16
+ - `promigence org create` — create one you own (no trial credit)
17
+ - `promigence org switch` — sign in, make ORG the default, store a key for it
18
+ - `promigence org members` — members and roles
19
+ - `promigence org invite` — invite an email (owners)
20
+ - `promigence org invites` — pending invites (14-day expiry)
21
+ - `promigence org uninvite` — revoke an invite (owners)
22
+ - `promigence org resend` — send an invite again (owners)
23
+ - `promigence org role` — set owner|member (owners)
24
+ - `promigence org remove` — remove a member; their keys die (owners)
25
+ - `promigence org leave` — leave an organization
26
+ - `promigence org join` — accept an invite sent to you
27
+ - `promigence org audit` — who did what (owners; needs --sign-in)
28
+ - `promigence org rename` — rename it (owners)
29
+ - `promigence org delete` — delete it; keys die (owners)
30
+ - `promigence project list` — projects and their spend this month
31
+ - `promigence project create` — create a project
32
+ - `promigence project rename` — rename (not `default`)
33
+ - `promigence project delete` — delete an empty one (owners)
34
+ - `promigence project cap` — monthly USD cap, or off (owners)
35
+ - `promigence project move` — to another org; keys die (owners)
36
+ - `promigence me` — plan, concurrency in use, trial credit, spend, limits
37
+ - `promigence billing card` — add a card: prints a checkout URL (trial credits kept)
38
+ - `promigence doctor` — check client, auth and API
39
+ - `promigence ping` — your distance to our servers
40
+ - `promigence init` — write promigence.toml
41
+ - `promigence examples` — what forks with no build (no auth)
42
+ - `promigence templates` — the templates: ready-made starting points to fork (no auth)
43
+ - `promigence templates show` — one template: everything it has installed, and its versions (no auth)
44
+ - `promigence agent-guide` — ~1.4k-token guide for agents (--section commands|errors|cost)
45
+ - `promigence mcp` — MCP server on stdio: `claude mcp add promigence -- promigence mcp` (Windows: `-- cmd /c promigence mcp`)
46
+ - `promigence snapshot create` — build + verify a snapshot (--image | --dockerfile | --devcontainer)
47
+ - `promigence snapshot status` — poll a build by build_id
48
+ - `promigence snapshot list` — list snapshots in your org
49
+ - `promigence snapshot inspect` — show a snapshot's record
50
+ - `promigence snapshot verify` — re-verify a snapshot in a fork
51
+ - `promigence snapshot export` — write a portable .promigence bundle (commit it, cite it, mail it)
52
+ - `promigence image resolve` — resolve REF (python:3.12) to REF@sha256:… without a local container runtime
53
+ - `promigence github connect` — connect GitHub in the console; waits for it
54
+ - `promigence github status` — connected accounts, pending installs, tracked branches
55
+ - `promigence github disconnect` — stop building from a GitHub account
56
+ - `promigence github untrack` — stop rebuilding on push (the snapshot stays)
57
+ - `promigence repos` — repos your GitHub/GitLab connection reads (for --repo)
58
+ - `promigence gitlab connect` — connect GitLab read-only in the console; waits
59
+ - `promigence gitlab status` — GitLab users, pending confirmations, tracks
60
+ - `promigence gitlab disconnect` — revoke a GitLab connection
61
+ - `promigence gitlab untrack` — stop rebuilding on commits (snapshot stays)
62
+ - `promigence run` — fork N, exec CMD in each, print the validity report
63
+ - `promigence run quote` — price a run before launch
64
+ - `promigence run report` — validity report: env vs task failures
65
+ - `promigence run status` — poll a run
66
+ - `promigence run cancel` — stop queued starts
67
+ - `promigence run kill` — kill every sandbox of a run
68
+ - `promigence run replay` — replay sandboxes (client-triggered, never automatic)
69
+ - `promigence run open` — reopen a failed sandbox as a live one, at the moment it failed
70
+ - `promigence run captures` — what of this run is preserved, and when it expires
71
+ - `promigence fork` — fork N sandboxes from a snapshot (--count --cap)
72
+ - `promigence exec` — run CMD in a sandbox (--sandbox SID) or a run (--run ID --all)
73
+ - `promigence exec output` — an exec's output by id (background x_…: --follow)
74
+ - `promigence exec ps` — list a sandbox's background execs
75
+ - `promigence exec stdin` — write to a background exec's stdin (needs `exec --background --stdin`)
76
+ - `promigence exec kill` — signal a background exec (default SIGKILL)
77
+ - `promigence files put` — copy a local file into a sandbox (--recursive: a directory)
78
+ - `promigence files get` — copy a file out of a sandbox (--recursive: a directory)
79
+ - `promigence files ls` — list a directory in a sandbox (lstat per entry)
80
+ - `promigence files search` — find files by name glob and/or text inside them
81
+ - `promigence files mkdir` — create a directory in a sandbox
82
+ - `promigence files mv` — move or rename a path inside a sandbox
83
+ - `promigence files cp` — copy a path inside a sandbox (both ends are in the sandbox)
84
+ - `promigence files chmod` — change mode and/or owner of a path in a sandbox
85
+ - `promigence agent start` — a coding agent in a new sandbox
86
+ - `promigence sandbox kill` — kill one sandbox
87
+ - `promigence sandbox network` — what it may reach; with an allow-list, hosts it was refused
88
+ - `promigence sandbox shell` — interactive terminal (raw TTY, follows window size)
89
+ - `promigence sandbox ssh` — log in over SSH (scp, sftp and -L work too)
90
+ - `promigence port expose` — publish a port as a preview URL (anyone with it can reach it) (not on the hosted service yet)
91
+ - `promigence port list` — list a sandbox's preview URLs (not on the hosted service yet)
92
+ - `promigence port revoke` — take a preview URL down (a token, or every URL for a port) (not on the hosted service yet)
93
+ - `promigence secrets set` — store secret NAME (env/file/stdin, never argv)
94
+ - `promigence bench burst` — N sandboxes at once: hand-off percentiles + success rate
95
+ - `promigence runners github` — GitHub Actions jobs in sandboxes: `runs-on: promigence` (until Ctrl-C)
96
+ - `promigence runners gitlab` — GitLab CI jobs in sandboxes, as a runner with your tags (until Ctrl-C)
97
+ - `promigence status` — services · your concurrency in use vs your limit
98
+ - `promigence billing usage` — this month's spend: plan, usage by tier, credits, next invoice
99
+ - `promigence billing history` — credits and payments, newest first (owners)
100
+ - `promigence referrals` — your referral code, its offer, your referrals
101
+ - `promigence referrals apply` — apply a code (owner, before the first paid invoice)
102
+ - `promigence pricing` — your prices, live (list prices with no key)
103
+ - `promigence credits` — your free-credit offer: state, credit, expiry, campaign
104
+ - `promigence credits claim` — open the claim page (accept the terms in the browser); prints its URL
105
+ - `promigence snapshot delete` — remove one of your snapshots (refused while a fork of it is alive)
106
+ - `promigence sandbox list` — your sandboxes, newest first
107
+ - `promigence sandbox pause` — park a sandbox: it bills no seconds and does not count against your limit
108
+ - `promigence sandbox resume` — bring a paused sandbox back and restart its clock
109
+ - `promigence sandbox snapshot` — snapshot it without stopping it
110
+ - `promigence secrets list` — stored secret names (never a value)
111
+ - `promigence secrets delete` — remove a stored secret
112
+ - `promigence billing portal` — manage the card on file and past invoices: prints a portal URL
113
+ - `promigence snapshot builds` — your builds, newest first (a rejected build keeps its reason)
114
+ - `promigence snapshot alias` — name a snapshot, or clear its name (unique per org)
115
+ - `promigence run list` — your runs, newest first
116
+ - `promigence sandbox info` — one sandbox: state, tier, time left, cost so far, and its execs
117
+ - `promigence sandbox extend` — give a live sandbox more time, within its run's quote and --cap (exit 5 past them)
118
+ - `promigence sandbox autopause` — pause it once it has sat idle, or read the rule it is under
119
+ - `promigence sandbox probe` — is this still the verified environment? (its recorded paths, or --path)
120
+ - `promigence files rm` — delete a path in a sandbox
121
+
122
+ - `promigence agent-guide` — this document's first section
123
+ - `promigence agent-guide --section commands` — every command with its flags
124
+ - `promigence agent-guide --section errors` — every error code and exit code
125
+ - `promigence agent-guide --section cost` — tiers and per-second prices
126
+ - https://promigence.ai
127
+
128
+ ---
129
+
130
+ # Promigence — agent guide (promigence@0.1.0-beta.12)
131
+
132
+ Promigence is an **environment runtime**: verified, reproducible, forkable execution
133
+ environments, billed per second (vCPU + memory). The model is one line:
134
+
135
+ verify → snapshot → fork(N) → exec → validity report
136
+
137
+ - **snapshot** — an image (pinned) + ordered `setup` steps + a `verify` command that, if given, must exit 0.
138
+ If verify fails nothing is stored; the build's own time is billed. A branch is not a pin.
139
+ - **fork** — a warm copy of that workspace, with its `start` service ready;
140
+ N at once, each checked before you get it.
141
+ - **validity report** — per sandbox, and this split is the product: **env** failures are ours
142
+ (exit 3, replayable; when our side shows the cause, the time since your last snapshot is
143
+ credited back, up to 24 h) and **task** failures are yours (exit 4, billed).
144
+
145
+ ## Golden path
146
+
147
+ promigence run --snapshot promigence/base --count 2 --cap 1 --json -- python3 -c 'print(6*7)'
148
+
149
+ That forks 2 sandboxes of the built-in base, runs the command in each, prints the report and
150
+ kills them. Find public snapshots with `promigence examples` (no API key needed).
151
+ Build your own: `promigence init` in a repo prints the `snapshot create --image … --wait` to run.
152
+
153
+ ## Output contract
154
+
155
+ Exactly one JSON document on stdout per invocation, whenever `--json` is passed or stdout is
156
+ not a TTY; `exec --sandbox` needs `--json` for it:
157
+
158
+ {"schema":"promigence.cli/v1","command":…,"ok":…,
159
+ "error":{"code","message","fix","docs","guide"},"next":[{"cmd","why"}]}
160
+
161
+ Progress, prices and diagnostics go to **stderr** — never parse them. `next[].cmd` is
162
+ id-based, runnable verbatim (fill any UPPERCASE word); use it, never invent one.
163
+
164
+ Exit codes: 0 ok · 1 internal · 2 usage · 3 env_failed · 4 task_failed · 5 spend_cap · 6 not_verified · 7 auth (auth, forbidden, setup_required, account_exists, invite_invalid, invite_required, key_expired, account_blocked) · 8 not_found · 9 unreachable · 10 rate_limited (rate_limited only: retry after Retry-After) · 11 timeout · 12 partial (some sandboxes cap_killed, stopped_by_support, expired, not_started) · 13 changes_pending (agent-guide --check: files would change) · 125 passthrough (exec --sandbox: ours; else the command's code) · 130 interrupted.
165
+ Highest-precedence code wins: 2 > 5 > 6 > 7/8/9/10 > 11 > 3 > 12 > 4 > 1 > 0.
166
+
167
+ ## The seven you will actually hit
168
+
169
+ (`{name}` in a fix is filled from the failure's evidence.)
170
+
171
+ - `auth` (exit 7) — Set PROMIGENCE_API_KEY or run `promigence auth login --from-env VAR`. No key yet: `promigence login` (sign in) or https://promigence.ai.
172
+ - `credit_unclaimed` (exit 5) — Claim it in your browser: `promigence credits claim` (owners; members ask an owner). Or add a card: `promigence billing card`. Nothing was started or charged.
173
+ - `not_found` (exit 8) — Check the id; aliases resolve in your org first, then public snapshots (`promigence examples`).
174
+ - `not_verified` (exit 6) — Wait for the build: `promigence snapshot status {build_id} --wait`.
175
+ - `cap_exceeded` (exit 5) — Raise `--cap`, lower `--count`/`--timeout`, or pass `--allow-partial` to launch what fits.
176
+ - `timeout` (exit 11) — Run the id-based command: `{next}`.
177
+ - `nonzero_exit` (exit 4) — The environment was verified; the command failed. Inspect: `promigence exec output {exec_id}`.
178
+
179
+ ## Limits and stops
180
+
181
+ - `setup_required` (exit 7): answer the account's setup questions in the console first.
182
+ - `egress_cap_reached` (exit 5): the month's data out is spent; `--network none` still starts; it resets on the 1st (UTC).
183
+ - A paused sandbox is kept 30 days (`pause_expires_at`); resuming keeps it, else it is deleted (`expired`).
184
+ - `stopped_by_support` (exit 12): support stopped it; the message says why.
185
+
186
+ ## Do
187
+
188
+ - Pass `--cap USD` on every `fork`/`run`: a run over it is refused (exit 5) before anything starts.
189
+ - Pass `--json`, and read `ok`, `error.code` and `next` — not the text.
190
+ - Use `--wait`. **Every wait is bounded to 100s**: exit 11 means the wait expired and
191
+ **nothing was killed** — run the id-based `next` command to keep waiting.
192
+ - Treat exit 3 as ours (re-run or `run replay`) and exit 4 as yours (fix the task).
193
+ - Pass the full 40-character commit sha to `snapshot create`.
194
+
195
+ ## Don't
196
+
197
+ - Never put a key or a secret on argv: `auth login` reads `--from-env VAR` or stdin, `secrets
198
+ set` also `--from-file P`. Secrets are given at run time, never baked in.
199
+ - Don't poll in a loop — `--wait` long-polls server-side and costs one request.
200
+ - Don't re-fork blindly on an env failure: `promigence run replay <run_id>` re-runs it.
201
+
202
+ ## More
203
+
204
+ `promigence agent-guide --section commands|errors|cost` · `promigence agent-guide --code <code>`
205
+ · `promigence <command> --help` · https://promigence.ai
206
+ Same surface as MCP tools: `promigence mcp` (stdio; `claude mcp add promigence -- promigence mcp`).
207
+
208
+ Live in v0.1.0-beta.12: login · signup · logout · auth login · keys list/create/revoke · org list/create/switch/members/invite/invites/uninvite/resend/role/remove/leave/join/audit/rename/delete · project list/create/rename/delete/cap/move · me · billing card/usage/history/portal · doctor · ping · init · examples · templates +show · agent-guide · mcp · snapshot create/status/list/inspect/verify/export/delete/builds/alias · image resolve · github connect/status/disconnect/untrack · repos · gitlab connect/status/disconnect/untrack · run +quote/report/status/cancel/kill/replay/open/captures/list · fork · exec +output/ps/stdin/kill · files put/get/ls/search/mkdir/mv/cp/chmod/rm · agent start · sandbox kill/network/shell/ssh/list/pause/resume/snapshot/info/extend/autopause/probe · secrets set/list/delete · bench burst · runners github/gitlab · status · referrals +apply · pricing · credits +claim
209
+ Not on the hosted service yet: port expose/list/revoke (preview URLs).
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "promigence",
3
+ "version": "0.1.0-beta.12",
4
+ "description": "The fastest sandboxes for AI agents and code. Snapshot an environment once, fork it as often as you need, run commands in every copy, and get a report that tells environment failures from task failures. Billed per second, with a quote before a run and a hard spend cap. One package: the promigence command and the TypeScript SDK.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://www.promigence.ai",
7
+ "bugs": {
8
+ "email": "support@promigence.ai",
9
+ "url": "https://www.promigence.ai/docs"
10
+ },
11
+ "author": "Promigence AI, Inc. <support@promigence.ai>",
12
+ "type": "module",
13
+ "bin": {
14
+ "promigence": "./dist/bin.js"
15
+ },
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "llms.txt",
27
+ "README.md",
28
+ "NOTICE"
29
+ ],
30
+ "engines": {
31
+ "node": ">=20"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public",
35
+ "tag": "beta",
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "keywords": [
39
+ "promigence",
40
+ "sandbox",
41
+ "sandboxes",
42
+ "agents",
43
+ "ai-agents",
44
+ "code-execution",
45
+ "cli",
46
+ "sdk",
47
+ "evals",
48
+ "ci",
49
+ "snapshots",
50
+ "fork"
51
+ ]
52
+ }