withruntime 0.37.0 → 0.45.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/DAYTONA.md +1 -1
- package/dist/agents-cli.d.ts +1 -1
- package/dist/agents-cli.js +252 -5
- package/dist/agents-deploy.d.ts +1 -1
- package/dist/agents-deploy.js +62 -1
- package/dist/apps-cli.d.ts +3 -3
- package/dist/apps-cli.js +10 -5
- package/dist/browsers-cli.d.ts +1 -1
- package/dist/browsers-cli.js +122 -3
- package/dist/ci-cli.d.ts +5 -1
- package/dist/ci-cli.js +44 -5
- package/dist/cli-update.d.ts +11 -0
- package/dist/cli-update.js +46 -0
- package/dist/cli-words.js +1 -0
- package/dist/cli.d.ts +3 -5
- package/dist/cli.js +233 -57
- package/dist/daytona/daytona.js +1 -1
- package/dist/e2b/sandbox.d.ts +6 -5
- package/dist/e2b/sandbox.js +6 -5
- package/dist/errors.d.ts +3 -2
- package/dist/errors.js +3 -2
- package/dist/index.d.ts +3 -3
- package/dist/products/agents.d.ts +252 -1
- package/dist/products/agents.js +136 -0
- package/dist/products/apps.d.ts +2 -1
- package/dist/products/browsers.d.ts +87 -0
- package/dist/products/browsers.js +67 -0
- package/dist/products/builds.d.ts +11 -2
- package/dist/products/ci.d.ts +2 -0
- package/dist/products/observability.d.ts +31 -3
- package/dist/products/plans.d.ts +5 -3
- package/dist/products/secrets.d.ts +67 -14
- package/dist/products/secrets.js +41 -12
- package/dist/transport.d.ts +2 -1
- package/dist/transport.js +32 -1
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/DAYTONA.md
CHANGED
|
@@ -111,7 +111,7 @@ Each of these throws `NotSupportedError` before anything happens. The error's
|
|
|
111
111
|
| `clicks` above 2 | One click, or two with `double`. To select a line, click once and press shift+End. |
|
|
112
112
|
| `resize`, `recover` | Set labels and resources at create time. Or create a new sandbox. |
|
|
113
113
|
| Signed preview URLs, signed upload and download URLs, SSH access | `getPreviewLink`, `fs.uploadFile` and `downloadFile`, or `npx withruntime sandboxes ssh <id>`. |
|
|
114
|
-
| `getMetrics` | `sandbox.withruntime.metrics()`, which gives CPU and
|
|
114
|
+
| `getMetrics` | `sandbox.withruntime.metrics()`, which gives CPU, memory, disk and network over time. |
|
|
115
115
|
| `Image.pipInstallFromPyproject`, snapshot `resources` or `entrypoint` | `pipInstallFromRequirements`. Resources at create time. A session after create. |
|
|
116
116
|
| `volume.create(name)` | Runtime volumes have a size: `runtime.volumes.create({ name, sizeMiB })`. |
|
|
117
117
|
| `secret`, `warmPool` | A Runtime secret for credentials. Runtime starts from warm templates already. |
|
package/dist/agents-cli.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ type Out = {
|
|
|
5
5
|
write: (text: string) => void;
|
|
6
6
|
error: (text: string) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const AGENT_HELP = "runtime agents <command>\n\n An agent runs a harness (Claude Code, Codex, Gemini CLI, or your own code on\n an agents SDK) in a sandbox of its own for each session, on your model key.\n In a private beta: outside it, each command says how to ask to join.\n\n templates The harnesses and uses to start from\n init [name] [--template <harness>] [--use support|team] [--file runtime.yml]\n Write a starter agents: section into runtime.yml\n deploy [--file runtime.yml] [--dry-run] [--prune [--prune-memory]]\n Make your agents match runtime.yml: create, update\n (a new version only when it changed) and set\n triggers; one line per change. --prune deletes the\n agents a deploy made that the file no longer names,\n with their triggers; one holding memory files only\n with --prune-memory too, which deletes them for good\n create <name> (--template <harness> | --command \"<cmd>\") [--use support|team]\n [--instructions <text> | --instructions-file <path>] [--secret NAME]... [--pool NAME]...\n [--env KEY=VALUE]... [--image <image> | --snapshot <id>] [--vcpu n] [--memory n]\n [--max-concurrent n] [--idle-pause n] [--permissions '<json>'] [--label key=value]...\n Make an agent; prints its id. --secret names an egress\n secret it may use: its model key, of any provider.\n --pool names a Claude account's secret (each one\n given replaces the template's): each session takes\n the one with the most usage left\n ls Your agents\n get <agent> One agent, in full (an id or its name)\n update <agent> [the options of create] A new version: what you give changes, the rest stays\n rm <agent> Delete it, its triggers, and stop its sessions\n start <agent> <words...> [--key <key>] [--follow]\n A session with these words, or the open one with the\n key (such as customer:42); --follow prints its log\n until it ends\n send <session> <words...> Words into a session\n events <session> [--after <seq>] [--follow] A session's log; --follow until it ends\n trace <session> [--otlp] [--export [--endpoint <url>] [--header key=value]...]\n Every model turn and tool call: timing, tokens and\n cost, totals by model and tool. --otlp prints\n OpenTelemetry traces (OTLP/JSON); --export sends them\n to a collector (--endpoint, or\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT /\n OTEL_EXPORTER_OTLP_ENDPOINT and _HEADERS)\n sessions [--agent <agent>] [--state <state>]...\n Sessions, newest first\n sessions delete <session> Delete an ended session and its log; its history is\n storage, kept until you delete it\n stop <session> Stop a session\n switch anthropic Run Claude Managed Agents code on Runtime: the\n base URL to give Anthropic's SDK, and whether\n the model key (ANTHROPIC_API_KEY) is set\n asks [--state <state>]... [--agent <agent>] [--label key=value]...\n The inbox: what your agents' sessions need answered,\n one row per step however many sessions ask it\n asks get <ask> One ask: its options, pick and the sessions asking\n answer <ask> [<option>] [--text <words>] Answer it with an option's label, words, or both:\n every session asking reads it next and wakes\n approve <ask> Let a tool call the agent's permissions held run\n deny <ask> [--message <words>] Keep a held tool call from running; the message is\n told to the agent\n triggers <agent> Its triggers\n triggers add <agent> --kind <slack|github|schedule|webhook> --config '<json>' [--rules '<json>']\n triggers rules <triggerId> '<json>' Set its rules in place: priority, maxStartsPerHour,\n onEnded (start|note|ask), notify (email|webhook)\n and a webhook's key (\"{cause}\"); its secret stays\n triggers call <triggerId> <words...> [--key <key>] [--label key=value]... [--secret <secret>]\n Call a webhook as its sender would, by its secret\n (or RUNTIME_TRIGGER_SECRET): starts, joins, notes or\n holds\n triggers held <triggerId> [--state held|started|dismissed]...\n Calls it held for you; none is dropped\n triggers held start <triggerId> <callId> Start one, with every call held for its key since\n triggers held dismiss <triggerId> <callId> Dismiss one; nothing runs\n triggers pause <triggerId> --why <words> Hold it: a webhook's calls are kept for you, saying why\n triggers resume <triggerId>\n triggers rm <triggerId>\n memory ls <agent> [--scope <key>] [--prefix <path>]\n Its memory files, with their scope (shared or a key)\n memory search <agent> <words...> [--scope <key>] [--limit n]\n Files whose words match, best first\n memory cat <agent> <path> [--scope <key>] A file's text\n memory put <agent> <path> [<file> | - | --content <text>] [--scope <key>]\n Seed or replace a file (from a file, or - for stdin)\n memory rm <agent> <path> [--scope <key>] Delete a file\n Without --scope: the shared memory, which every\n session reads and only a shared agent's write\n\n A subscription is for your own team's agents; an agent that serves your\n customers uses an API key.\n\nExamples\n printf %s \"$ANTHROPIC_API_KEY\" | runtime secrets set ANTHROPIC_API_KEY --host api.anthropic.com\n runtime agents create helper --template claude-code --use support --instructions \"Answer briefly.\"\n runtime agents start helper \"How do I reset my password?\" --key customer:42 --follow\n runtime agents memory put helper faq/refunds.md refunds.md\n runtime agents asks && runtime agents answer <ask> \"Raise to 20 TB\"\n runtime agents update helper --permissions '{\"default\":\"auto\",\"tools\":{\"shell\":\"always_ask\"}}'\n runtime agents approve <ask>\n runtime agents trace <session> --export --endpoint https://otel.example.com\n runtime agents init --template claude-code && runtime agents deploy --dry-run\n runtime agents create ci-review --template review --pool CLAUDE_1 --pool CLAUDE_2\n runtime agents switch anthropic\n";
|
|
8
|
+
export declare const AGENT_HELP = "runtime agents <command>\n\n An agent runs a harness (Claude Code, Codex, Gemini CLI, or your own code on\n an agents SDK) in a sandbox of its own for each session, on your model key.\n In a private beta: outside it, each command says how to ask to join.\n\n templates The harnesses and uses to start from\n init [name] [--template <harness>] [--use support|team] [--file runtime.yml]\n Write a starter agents: section into runtime.yml\n deploy [--file runtime.yml] [--dry-run] [--prune [--prune-memory]]\n Make your agents match runtime.yml: create, update\n (a new version only when it changed) and set\n triggers; one line per change. --prune deletes the\n agents a deploy made that the file no longer names,\n with their triggers; one holding memory files only\n with --prune-memory too, which deletes them for good\n create <name> (--template <harness> | --command \"<cmd>\") [--use support|team]\n [--instructions <text> | --instructions-file <path>] [--secret NAME]... [--pool NAME]...\n [--env KEY=VALUE]... [--image <image> | --snapshot <id>] [--vcpu n] [--memory n]\n [--max-concurrent n] [--idle-pause n] [--max-children n] [--advisor <model>]\n [--advisor-secret NAME] [--model <model>] [--session-overrides '<json>']\n [--permissions '<json>'] [--label key=value]...\n Make an agent; prints its id. --secret names an egress\n secret it may use: its model key, of any provider.\n --pool names a Claude account's secret (each one\n given replaces the template's): each session takes\n the one with the most usage left. --advisor names a\n model its sessions may ask for advice (advise), its\n key the egress secret --advisor-secret names (that\n provider's usual one by default, among --secret).\n --session-overrides sets what a session's start may\n override:\n '{\"models\":[\"claude-opus-5-5\"],\"instructions\":\"replace\",\n \"maxVcpu\":8,\"maxMemoryMiB\":16384,\"maxSessionDollars\":20}'\n ls Your agents\n get <agent> One agent, in full (an id or its name)\n update <agent> [the options of create] A new version: what you give changes, the rest stays\n rm <agent> Delete it, its triggers, and stop its sessions\n start <agent> <words...> [--key <key>] [--follow] [--model <model>]\n [--instructions <text> | --instructions-file <path>] [--replace-instructions]\n [--mcp <server>]... [--no-mcp] [--disallow <tool>]... [--vcpu n] [--memory n]\n [--max-dollars n]\n A session with these words, or the open one with the\n key (such as customer:42); --follow prints its log\n until it ends. The other options override the\n agent's definition for this session alone, within\n its session overrides: its model, instructions added\n (or in place of the agent's), the MCP servers it\n keeps, tools it may not use, its size and budget\n send <session> <words...> Words into a session\n events <session> [--after <seq>] [--follow] A session's log; --follow until it ends\n trace <session> [--otlp] [--export [--endpoint <url>] [--header key=value]...]\n Every model turn and tool call: timing, tokens and\n cost, totals by model and tool. --otlp prints\n OpenTelemetry traces (OTLP/JSON); --export sends them\n to a collector (--endpoint, or\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT /\n OTEL_EXPORTER_OTLP_ENDPOINT and _HEADERS)\n sessions [--agent <agent>] [--state <state>]...\n Sessions, newest first\n sessions delete <session> Delete an ended session and its log; its history is\n storage, kept until you delete it\n stop <session> Stop a session\n switch anthropic Run Claude Managed Agents code on Runtime: the\n base URL to give Anthropic's SDK, and whether\n the model key (ANTHROPIC_API_KEY) is set\n asks [--state <state>]... [--agent <agent>] [--label key=value]...\n The inbox: what your agents' sessions need answered,\n one row per step however many sessions ask it\n asks get <ask> One ask: its options, pick and the sessions asking\n answer <ask> [<option>] [--text <words>] Answer it with an option's label, words, or both:\n every session asking reads it next and wakes\n workflow run <file.json | -> [--follow] Run a workflow: many sessions in phases, fanned out\n and pipelined, with maxSessions, maxConcurrent and\n maxDollars; prints its id, or --follow prints each\n phase's progress until it ends, then its result\n workflow get <workflow> Its state, each phase's progress, cost and result\n workflow watch <workflow> Its progress as it changes, until it ends\n workflow steps <workflow> [--state <state>]...\n Each step: its phase, item, session and state\n workflow stop <workflow> Nothing more starts; its open sessions stop\n workflows [--state running|done|failed|stopped]...\n Workflows, newest first\n approve <ask> Let a tool call the agent's permissions held run\n deny <ask> [--message <words>] Keep a held tool call from running; the message is\n told to the agent\n slack install A link that adds Runtime's Slack app to a workspace\n slack ls | rm <team> The workspaces added; remove one\n triggers <agent> Its triggers\n triggers add <agent> --kind <slack|github|schedule|webhook> --config '<json>' [--rules '<json>']\n triggers rules <triggerId> '<json>' Set its rules in place: priority, maxStartsPerHour,\n onEnded (start|note|ask), notify (email|webhook)\n and a webhook's key (\"{cause}\"); its secret stays\n triggers call <triggerId> <words...> [--key <key>] [--label key=value]... [--secret <secret>]\n Call a webhook as its sender would, by its secret\n (or RUNTIME_TRIGGER_SECRET): starts, joins, notes or\n holds\n triggers held <triggerId> [--state held|started|dismissed]...\n Calls it held for you; none is dropped\n triggers held start <triggerId> <callId> Start one, with every call held for its key since\n triggers held dismiss <triggerId> <callId> Dismiss one; nothing runs\n triggers pause <triggerId> --why <words> Hold it: a webhook's calls are kept for you, saying why\n triggers resume <triggerId>\n triggers rm <triggerId>\n memory ls <agent> [--scope <key>] [--prefix <path>]\n Its memory files, with their scope (shared or a key)\n memory search <agent> <words...> [--scope <key>] [--limit n]\n Files whose words match, best first\n memory cat <agent> <path> [--scope <key>] A file's text\n memory put <agent> <path> [<file> | - | --content <text>] [--scope <key>]\n Seed or replace a file (from a file, or - for stdin)\n memory rm <agent> <path> [--scope <key>] Delete a file\n Without --scope: the shared memory, which every\n session reads and only a shared agent's write\n\n A subscription is for your own team's agents; an agent that serves your\n customers uses an API key.\n\nExamples\n printf %s \"$ANTHROPIC_API_KEY\" | runtime secrets set ANTHROPIC_API_KEY --host api.anthropic.com\n runtime agents create helper --template claude-code --use support --instructions \"Answer briefly.\"\n runtime agents start helper \"How do I reset my password?\" --key customer:42 --follow\n runtime agents start helper \"Summarize this ticket\" --model claude-haiku-5-5 --disallow Bash\n runtime agents memory put helper faq/refunds.md refunds.md\n runtime agents asks && runtime agents answer <ask> \"Raise to 20 TB\"\n runtime agents workflow run review.json --follow\n runtime agents update helper --permissions '{\"default\":\"auto\",\"tools\":{\"shell\":\"always_ask\"}}'\n runtime agents approve <ask>\n runtime agents trace <session> --export --endpoint https://otel.example.com\n runtime agents init --template claude-code && runtime agents deploy --dry-run\n runtime agents create ci-review --template review --pool CLAUDE_1 --pool CLAUDE_2\n runtime agents switch anthropic\n";
|
|
9
9
|
/** Where --export sends OTLP: --endpoint, else the OpenTelemetry SDK's own
|
|
10
10
|
* variables; a base URL gets /v1/traces, as an OTLP/HTTP exporter adds it. */
|
|
11
11
|
export declare function otlpTarget(endpoint: string | undefined, env: NodeJS.ProcessEnv, headers: Record<string, string>): {
|
package/dist/agents-cli.js
CHANGED
|
@@ -22,20 +22,36 @@ export const AGENT_HELP = `runtime agents <command>
|
|
|
22
22
|
create <name> (--template <harness> | --command "<cmd>") [--use support|team]
|
|
23
23
|
[--instructions <text> | --instructions-file <path>] [--secret NAME]... [--pool NAME]...
|
|
24
24
|
[--env KEY=VALUE]... [--image <image> | --snapshot <id>] [--vcpu n] [--memory n]
|
|
25
|
-
[--max-concurrent n] [--idle-pause n] [--
|
|
25
|
+
[--max-concurrent n] [--idle-pause n] [--max-children n] [--advisor <model>]
|
|
26
|
+
[--advisor-secret NAME] [--model <model>] [--session-overrides '<json>']
|
|
27
|
+
[--permissions '<json>'] [--label key=value]...
|
|
26
28
|
Make an agent; prints its id. --secret names an egress
|
|
27
29
|
secret it may use: its model key, of any provider.
|
|
28
30
|
--pool names a Claude account's secret (each one
|
|
29
31
|
given replaces the template's): each session takes
|
|
30
|
-
the one with the most usage left
|
|
32
|
+
the one with the most usage left. --advisor names a
|
|
33
|
+
model its sessions may ask for advice (advise), its
|
|
34
|
+
key the egress secret --advisor-secret names (that
|
|
35
|
+
provider's usual one by default, among --secret).
|
|
36
|
+
--session-overrides sets what a session's start may
|
|
37
|
+
override:
|
|
38
|
+
'{"models":["claude-opus-5-5"],"instructions":"replace",
|
|
39
|
+
"maxVcpu":8,"maxMemoryMiB":16384,"maxSessionDollars":20}'
|
|
31
40
|
ls Your agents
|
|
32
41
|
get <agent> One agent, in full (an id or its name)
|
|
33
42
|
update <agent> [the options of create] A new version: what you give changes, the rest stays
|
|
34
43
|
rm <agent> Delete it, its triggers, and stop its sessions
|
|
35
|
-
start <agent> <words...> [--key <key>] [--follow]
|
|
44
|
+
start <agent> <words...> [--key <key>] [--follow] [--model <model>]
|
|
45
|
+
[--instructions <text> | --instructions-file <path>] [--replace-instructions]
|
|
46
|
+
[--mcp <server>]... [--no-mcp] [--disallow <tool>]... [--vcpu n] [--memory n]
|
|
47
|
+
[--max-dollars n]
|
|
36
48
|
A session with these words, or the open one with the
|
|
37
49
|
key (such as customer:42); --follow prints its log
|
|
38
|
-
until it ends
|
|
50
|
+
until it ends. The other options override the
|
|
51
|
+
agent's definition for this session alone, within
|
|
52
|
+
its session overrides: its model, instructions added
|
|
53
|
+
(or in place of the agent's), the MCP servers it
|
|
54
|
+
keeps, tools it may not use, its size and budget
|
|
39
55
|
send <session> <words...> Words into a session
|
|
40
56
|
events <session> [--after <seq>] [--follow] A session's log; --follow until it ends
|
|
41
57
|
trace <session> [--otlp] [--export [--endpoint <url>] [--header key=value]...]
|
|
@@ -59,9 +75,22 @@ export const AGENT_HELP = `runtime agents <command>
|
|
|
59
75
|
asks get <ask> One ask: its options, pick and the sessions asking
|
|
60
76
|
answer <ask> [<option>] [--text <words>] Answer it with an option's label, words, or both:
|
|
61
77
|
every session asking reads it next and wakes
|
|
78
|
+
workflow run <file.json | -> [--follow] Run a workflow: many sessions in phases, fanned out
|
|
79
|
+
and pipelined, with maxSessions, maxConcurrent and
|
|
80
|
+
maxDollars; prints its id, or --follow prints each
|
|
81
|
+
phase's progress until it ends, then its result
|
|
82
|
+
workflow get <workflow> Its state, each phase's progress, cost and result
|
|
83
|
+
workflow watch <workflow> Its progress as it changes, until it ends
|
|
84
|
+
workflow steps <workflow> [--state <state>]...
|
|
85
|
+
Each step: its phase, item, session and state
|
|
86
|
+
workflow stop <workflow> Nothing more starts; its open sessions stop
|
|
87
|
+
workflows [--state running|done|failed|stopped]...
|
|
88
|
+
Workflows, newest first
|
|
62
89
|
approve <ask> Let a tool call the agent's permissions held run
|
|
63
90
|
deny <ask> [--message <words>] Keep a held tool call from running; the message is
|
|
64
91
|
told to the agent
|
|
92
|
+
slack install A link that adds Runtime's Slack app to a workspace
|
|
93
|
+
slack ls | rm <team> The workspaces added; remove one
|
|
65
94
|
triggers <agent> Its triggers
|
|
66
95
|
triggers add <agent> --kind <slack|github|schedule|webhook> --config '<json>' [--rules '<json>']
|
|
67
96
|
triggers rules <triggerId> '<json>' Set its rules in place: priority, maxStartsPerHour,
|
|
@@ -96,8 +125,10 @@ Examples
|
|
|
96
125
|
printf %s "$ANTHROPIC_API_KEY" | runtime secrets set ANTHROPIC_API_KEY --host api.anthropic.com
|
|
97
126
|
runtime agents create helper --template claude-code --use support --instructions "Answer briefly."
|
|
98
127
|
runtime agents start helper "How do I reset my password?" --key customer:42 --follow
|
|
128
|
+
runtime agents start helper "Summarize this ticket" --model claude-haiku-5-5 --disallow Bash
|
|
99
129
|
runtime agents memory put helper faq/refunds.md refunds.md
|
|
100
130
|
runtime agents asks && runtime agents answer <ask> "Raise to 20 TB"
|
|
131
|
+
runtime agents workflow run review.json --follow
|
|
101
132
|
runtime agents update helper --permissions '{"default":"auto","tools":{"shell":"always_ask"}}'
|
|
102
133
|
runtime agents approve <ask>
|
|
103
134
|
runtime agents trace <session> --export --endpoint https://otel.example.com
|
|
@@ -136,6 +167,11 @@ const OPTIONS = [
|
|
|
136
167
|
"memory",
|
|
137
168
|
"max-concurrent",
|
|
138
169
|
"idle-pause",
|
|
170
|
+
"model",
|
|
171
|
+
"session-overrides",
|
|
172
|
+
"max-children",
|
|
173
|
+
"advisor",
|
|
174
|
+
"advisor-secret",
|
|
139
175
|
"permissions",
|
|
140
176
|
"label",
|
|
141
177
|
];
|
|
@@ -210,6 +246,21 @@ function definitionOf(args, kit, env, base) {
|
|
|
210
246
|
set("memoryMiB", integer(args, "memory"));
|
|
211
247
|
set("maxConcurrent", integer(args, "max-concurrent"));
|
|
212
248
|
set("idlePauseSeconds", integer(args, "idle-pause"));
|
|
249
|
+
set("model", flag(args, "model"));
|
|
250
|
+
const limits = flag(args, "session-overrides");
|
|
251
|
+
if (limits !== undefined)
|
|
252
|
+
set("sessionOverrides", jsonObject(limits, "--session-overrides", kit));
|
|
253
|
+
set("maxChildren", integer(args, "max-children"));
|
|
254
|
+
const advisor = flag(args, "advisor");
|
|
255
|
+
const advisorSecret = flag(args, "advisor-secret");
|
|
256
|
+
if (advisorSecret !== undefined && advisor === undefined && !definition.advisor)
|
|
257
|
+
throw usage("Give --advisor <model> with --advisor-secret.");
|
|
258
|
+
if (advisor !== undefined || advisorSecret !== undefined)
|
|
259
|
+
set("advisor", {
|
|
260
|
+
...(definition.advisor ?? {}),
|
|
261
|
+
...(advisor === undefined ? {} : { model: advisor }),
|
|
262
|
+
...(advisorSecret === undefined ? {} : { secret: advisorSecret }),
|
|
263
|
+
});
|
|
213
264
|
const permissions = flag(args, "permissions");
|
|
214
265
|
if (permissions !== undefined) {
|
|
215
266
|
try {
|
|
@@ -221,6 +272,63 @@ function definitionOf(args, kit, env, base) {
|
|
|
221
272
|
}
|
|
222
273
|
return definition;
|
|
223
274
|
}
|
|
275
|
+
/** A flag's JSON object, or a usage error that says so. */
|
|
276
|
+
function jsonObject(text, name, kit) {
|
|
277
|
+
let value;
|
|
278
|
+
try {
|
|
279
|
+
value = JSON.parse(text);
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
value = undefined;
|
|
283
|
+
}
|
|
284
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
285
|
+
throw kit.usage(`${name} takes a JSON object, such as '{"models":["claude-opus-5-5"]}'.`);
|
|
286
|
+
return value;
|
|
287
|
+
}
|
|
288
|
+
/** A session's overrides, from start's options; none given, none. */
|
|
289
|
+
function overridesOf(args, kit) {
|
|
290
|
+
const { flag, has, integer, usage } = kit;
|
|
291
|
+
const file = flag(args, "instructions-file");
|
|
292
|
+
const instructions = file !== undefined ? readFileSync(file, "utf8") : flag(args, "instructions");
|
|
293
|
+
if (has(args, "replace-instructions") && instructions === undefined)
|
|
294
|
+
throw usage("--replace-instructions needs --instructions or --instructions-file.");
|
|
295
|
+
if (has(args, "no-mcp") && args.flags.has("mcp"))
|
|
296
|
+
throw usage("Give --mcp or --no-mcp, not both.");
|
|
297
|
+
const dollars = flag(args, "max-dollars");
|
|
298
|
+
if (dollars !== undefined && !(Number(dollars) > 0))
|
|
299
|
+
throw usage("--max-dollars takes a number of dollars, such as 2.5.");
|
|
300
|
+
const o = {};
|
|
301
|
+
const model = flag(args, "model");
|
|
302
|
+
if (model !== undefined)
|
|
303
|
+
o.model = model;
|
|
304
|
+
if (instructions !== undefined)
|
|
305
|
+
o.instructions = instructions;
|
|
306
|
+
if (has(args, "replace-instructions"))
|
|
307
|
+
o.instructionsMode = "replace";
|
|
308
|
+
if (has(args, "no-mcp"))
|
|
309
|
+
o.mcp = [];
|
|
310
|
+
else if (args.flags.has("mcp"))
|
|
311
|
+
o.mcp = [...new Set(args.flags.get("mcp"))];
|
|
312
|
+
if (args.flags.has("disallow"))
|
|
313
|
+
o.disallowedTools = [...new Set(args.flags.get("disallow"))];
|
|
314
|
+
const vcpu = integer(args, "vcpu");
|
|
315
|
+
if (vcpu !== undefined)
|
|
316
|
+
o.vcpu = vcpu;
|
|
317
|
+
const memory = integer(args, "memory");
|
|
318
|
+
if (memory !== undefined)
|
|
319
|
+
o.memoryMiB = memory;
|
|
320
|
+
if (dollars !== undefined)
|
|
321
|
+
o.maxSessionDollars = Number(dollars);
|
|
322
|
+
return Object.keys(o).length ? o : undefined;
|
|
323
|
+
}
|
|
324
|
+
const WORKFLOW_STATES = ["running", "done", "failed", "stopped"];
|
|
325
|
+
/** A workflow in a few lines: its state, cost, each phase's progress and,
|
|
326
|
+
* once ended, its result. */
|
|
327
|
+
const workflowLines = (w) => [
|
|
328
|
+
`${w.id}${w.name ? ` ${w.name}` : ""} ${w.state}${w.reason && w.reason !== "done" ? ` (${w.reason})` : ""}, ${w.started} session${w.started === 1 ? "" : "s"}, $${w.cost.dollars.toFixed(2)} of $${w.maxDollars}`,
|
|
329
|
+
...w.phases.map((p) => ` ${p.name.padEnd(16)} ${p.done}/${p.total}${p.ready ? "" : "+"} done, ${p.running} running, ${p.pending} waiting${p.failed ? `, ${p.failed} failed` : ""}`),
|
|
330
|
+
...(w.result !== null ? ["", w.result] : []),
|
|
331
|
+
].join("\n");
|
|
224
332
|
const line = (e) => `${String(e.seq).padStart(4)} ${e.kind.padEnd(6)} ${e.actor}: ${e.kind === "turn"
|
|
225
333
|
? turnLine(e.body)
|
|
226
334
|
: e.kind === "tool"
|
|
@@ -375,15 +483,27 @@ export async function agentsCommand(argv, env, out, client, kit) {
|
|
|
375
483
|
return 0;
|
|
376
484
|
}
|
|
377
485
|
case "start": {
|
|
378
|
-
const args = parse(rest, ["follow"
|
|
486
|
+
const args = parse(rest, ["follow", "replace-instructions", "no-mcp"], [
|
|
487
|
+
"key",
|
|
488
|
+
"model",
|
|
489
|
+
"instructions",
|
|
490
|
+
"instructions-file",
|
|
491
|
+
"mcp",
|
|
492
|
+
"disallow",
|
|
493
|
+
"vcpu",
|
|
494
|
+
"memory",
|
|
495
|
+
"max-dollars",
|
|
496
|
+
]);
|
|
379
497
|
const target = need(args.positional[0], "an agent's id or name");
|
|
380
498
|
const input = args.positional.slice(1).join(" ");
|
|
381
499
|
if (!input)
|
|
382
500
|
throw usage(`Give the words: ${me} agents start ${target} "Fix the failing test"`);
|
|
383
501
|
const key = flag(args, "key");
|
|
502
|
+
const overrides = overridesOf(args, kit);
|
|
384
503
|
const session = await api.start(target, {
|
|
385
504
|
input,
|
|
386
505
|
...(key === undefined ? {} : { key }),
|
|
506
|
+
...(overrides ? { overrides } : {}),
|
|
387
507
|
});
|
|
388
508
|
if (!has(args, "follow")) {
|
|
389
509
|
print(session.id, { session: session.session, joined: session.joined, seq: session.seq });
|
|
@@ -581,6 +701,109 @@ export async function agentsCommand(argv, env, out, client, kit) {
|
|
|
581
701
|
print(`${answered.id} answered; ${answered.sessions.filter((x) => x.state === "answered").length} session(s) woken.`, answered);
|
|
582
702
|
return 0;
|
|
583
703
|
}
|
|
704
|
+
case "workflows": {
|
|
705
|
+
const args = parse(rest, [], ["state"]);
|
|
706
|
+
const states = args.flags.get("state");
|
|
707
|
+
for (const state of states ?? [])
|
|
708
|
+
if (!WORKFLOW_STATES.includes(state))
|
|
709
|
+
throw usage(`--state takes ${WORKFLOW_STATES.join(", ")}.`);
|
|
710
|
+
const page = await api.workflows.list({
|
|
711
|
+
limit: 100,
|
|
712
|
+
...(states ? { state: states } : {}),
|
|
713
|
+
});
|
|
714
|
+
print(page.data.length
|
|
715
|
+
? table([
|
|
716
|
+
["ID", "NAME", "STATE", "SESSIONS", "COST", "CREATED"],
|
|
717
|
+
...page.data.map((w) => [
|
|
718
|
+
w.id,
|
|
719
|
+
w.name ?? "-",
|
|
720
|
+
w.reason && w.reason !== "done" ? `${w.state} (${w.reason})` : w.state,
|
|
721
|
+
String(w.started),
|
|
722
|
+
`$${w.cost.dollars.toFixed(2)}`,
|
|
723
|
+
when(w.createdAt),
|
|
724
|
+
]),
|
|
725
|
+
])
|
|
726
|
+
: `No workflows. Run one: ${me} agents workflow run workflow.json`, page.data);
|
|
727
|
+
return 0;
|
|
728
|
+
}
|
|
729
|
+
case "workflow": {
|
|
730
|
+
const [sub, ...more] = rest;
|
|
731
|
+
const watch = async (id, after) => {
|
|
732
|
+
let last;
|
|
733
|
+
for await (const now of api.workflows.follow(id, { after })) {
|
|
734
|
+
last = now;
|
|
735
|
+
out.write(out.json ? JSON.stringify(now) : `${workflowLines({ ...now, result: null })}\n`);
|
|
736
|
+
}
|
|
737
|
+
last ??= await api.workflows.get(id);
|
|
738
|
+
if (!out.json && last.result !== null)
|
|
739
|
+
out.write(last.result);
|
|
740
|
+
return last.state === "done" ? 0 : 1;
|
|
741
|
+
};
|
|
742
|
+
if (sub === "run") {
|
|
743
|
+
const args = parse(more, ["follow"], []);
|
|
744
|
+
const file = need(args.positional[0], "a workflow's JSON file, or - for stdin");
|
|
745
|
+
let text;
|
|
746
|
+
if (file === "-") {
|
|
747
|
+
const chunks = [];
|
|
748
|
+
for await (const chunk of process.stdin)
|
|
749
|
+
chunks.push(chunk);
|
|
750
|
+
text = Buffer.concat(chunks).toString("utf8");
|
|
751
|
+
}
|
|
752
|
+
else
|
|
753
|
+
text = readFileSync(file, "utf8");
|
|
754
|
+
let spec;
|
|
755
|
+
try {
|
|
756
|
+
spec = JSON.parse(text);
|
|
757
|
+
}
|
|
758
|
+
catch (error) {
|
|
759
|
+
throw usage(`${file} is not JSON: ${error.message}`);
|
|
760
|
+
}
|
|
761
|
+
const made = await api.workflows.run(spec);
|
|
762
|
+
if (!has(args, "follow")) {
|
|
763
|
+
print(made.id, made.workflow);
|
|
764
|
+
return 0;
|
|
765
|
+
}
|
|
766
|
+
if (!out.json)
|
|
767
|
+
out.error(`Workflow ${made.id}`);
|
|
768
|
+
out.write(out.json ? JSON.stringify(made.workflow) : `${workflowLines(made.workflow)}\n`);
|
|
769
|
+
return watch(made.id, made.workflow.version);
|
|
770
|
+
}
|
|
771
|
+
if (sub === "get") {
|
|
772
|
+
const w = await api.workflows.get(need(more[0], "a workflow's id"));
|
|
773
|
+
print(workflowLines(w), w);
|
|
774
|
+
return 0;
|
|
775
|
+
}
|
|
776
|
+
if (sub === "watch")
|
|
777
|
+
return watch(need(more[0], "a workflow's id"), 0);
|
|
778
|
+
if (sub === "steps") {
|
|
779
|
+
const args = parse(more, [], ["state"]);
|
|
780
|
+
const id = need(args.positional[0], "a workflow's id");
|
|
781
|
+
const states = args.flags.get("state");
|
|
782
|
+
const all = await (await api.workflows.steps(id, {
|
|
783
|
+
limit: 100,
|
|
784
|
+
...(states ? { state: states } : {}),
|
|
785
|
+
})).toArray(Infinity);
|
|
786
|
+
print(all.length
|
|
787
|
+
? table([
|
|
788
|
+
["PHASE", "ITEM", "STATE", "SESSION", "ITEM TEXT"],
|
|
789
|
+
...all.map((x) => [
|
|
790
|
+
x.phase,
|
|
791
|
+
String(x.item + 1),
|
|
792
|
+
x.state,
|
|
793
|
+
x.sessionId ?? "-",
|
|
794
|
+
(x.itemText ?? "-").replace(/\s+/g, " ").slice(0, 60),
|
|
795
|
+
]),
|
|
796
|
+
])
|
|
797
|
+
: "No steps yet.", all);
|
|
798
|
+
return 0;
|
|
799
|
+
}
|
|
800
|
+
if (sub === "stop") {
|
|
801
|
+
const w = await api.workflows.stop(need(more[0], "a workflow's id"));
|
|
802
|
+
print(`${w.id} ${w.state}.`, w);
|
|
803
|
+
return 0;
|
|
804
|
+
}
|
|
805
|
+
throw unknown("agents workflow command", sub ?? "", ["run", "get", "watch", "steps", "stop"]);
|
|
806
|
+
}
|
|
584
807
|
case "approve":
|
|
585
808
|
case "deny": {
|
|
586
809
|
const args = parse(rest, [], verb === "deny" ? ["message"] : []);
|
|
@@ -625,6 +848,28 @@ export async function agentsCommand(argv, env, out, client, kit) {
|
|
|
625
848
|
].join("\n"), value);
|
|
626
849
|
return 0;
|
|
627
850
|
}
|
|
851
|
+
case "slack": {
|
|
852
|
+
const [sub, ...more] = rest;
|
|
853
|
+
if (sub === "install") {
|
|
854
|
+
const link = await api.slack.install();
|
|
855
|
+
print(`Open this link to add Runtime's Slack app to a workspace (good until ${link.expiresAt}):\n${link.url}`, link);
|
|
856
|
+
return 0;
|
|
857
|
+
}
|
|
858
|
+
if (sub === "rm") {
|
|
859
|
+
const team = need(more[0], "a workspace's id (T…), from `agents slack ls`");
|
|
860
|
+
await api.slack.remove(team);
|
|
861
|
+
print(`${team} removed.`, { team, removed: true });
|
|
862
|
+
return 0;
|
|
863
|
+
}
|
|
864
|
+
if (sub === undefined || sub === "ls") {
|
|
865
|
+
const teams = await api.slack.teams();
|
|
866
|
+
print(teams.length
|
|
867
|
+
? teams.map((w) => `${w.team} ${w.name ?? ""} added ${w.installedAt}`).join("\n")
|
|
868
|
+
: `No Slack workspace is added. Add one: ${me} agents slack install`, teams);
|
|
869
|
+
return 0;
|
|
870
|
+
}
|
|
871
|
+
throw usage(`Use ${me} agents slack install, ls or rm <team>.`);
|
|
872
|
+
}
|
|
628
873
|
case "triggers": {
|
|
629
874
|
const [sub, ...more] = rest;
|
|
630
875
|
if (sub === "add") {
|
|
@@ -765,6 +1010,8 @@ export async function agentsCommand(argv, env, out, client, kit) {
|
|
|
765
1010
|
"stop",
|
|
766
1011
|
"asks",
|
|
767
1012
|
"answer",
|
|
1013
|
+
"workflow",
|
|
1014
|
+
"workflows",
|
|
768
1015
|
"approve",
|
|
769
1016
|
"deny",
|
|
770
1017
|
"triggers",
|
package/dist/agents-deploy.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type AgentsFileTrigger = {
|
|
|
12
12
|
* what it leaves out, then each definition field it sets. */
|
|
13
13
|
export type AgentsFileAgent = Omit<Partial<AgentDefinition>, "template"> & {
|
|
14
14
|
/** A harness: claude-code, codex, gemini-cli, claude-agent-sdk,
|
|
15
|
-
* openai-agents-sdk, review, judge. Fills in `command` and its model keys. */
|
|
15
|
+
* openai-agents-sdk, review, judge, browser. Fills in `command` and its model keys. */
|
|
16
16
|
template?: string;
|
|
17
17
|
/** support or team: a size and bounds for that use (`agents.uses`). */
|
|
18
18
|
use?: "support" | "team";
|
package/dist/agents-deploy.js
CHANGED
|
@@ -31,13 +31,19 @@ const DEFINITION_FIELDS = [
|
|
|
31
31
|
"maxSessionDollars",
|
|
32
32
|
"maxDayDollars",
|
|
33
33
|
"memory",
|
|
34
|
+
"model",
|
|
35
|
+
"sessionOverrides",
|
|
36
|
+
"maxChildren",
|
|
37
|
+
"advisor",
|
|
34
38
|
];
|
|
35
39
|
const FILE_FIELDS = ["template", "use", "instructionsFile", "triggers", ...DEFINITION_FIELDS];
|
|
36
40
|
const TRIGGER_KINDS = ["slack", "github", "schedule", "webhook"];
|
|
37
|
-
const RESERVED = new Set(["sessions", "triggers", "approvals", "templates"]);
|
|
41
|
+
const RESERVED = new Set(["sessions", "triggers", "approvals", "templates", "asks", "workflows"]);
|
|
38
42
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/;
|
|
39
43
|
const SHELL_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
|
|
40
44
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
45
|
+
const MODEL = /^[A-Za-z0-9][A-Za-z0-9._:/@-]{0,127}$/;
|
|
46
|
+
const VCPUS = [1, 2, 4, 8, 16];
|
|
41
47
|
const bytes = (text) => new TextEncoder().encode(text).length;
|
|
42
48
|
/** The file's agents, checked as the API checks them, with every mistake
|
|
43
49
|
* named by file, agent and field (and line, when the source knows it).
|
|
@@ -322,9 +328,64 @@ function checkAgent(name, entry, source, say) {
|
|
|
322
328
|
else
|
|
323
329
|
def.memory = { scope: v.scope };
|
|
324
330
|
}
|
|
331
|
+
if (entry.model !== undefined) {
|
|
332
|
+
if (typeof entry.model !== "string" || !MODEL.test(entry.model))
|
|
333
|
+
note(at("model"), "takes a model as its provider names it, such as claude-opus-5-5.");
|
|
334
|
+
else
|
|
335
|
+
def.model = entry.model;
|
|
336
|
+
}
|
|
337
|
+
if (entry.sessionOverrides !== undefined) {
|
|
338
|
+
const v = entry.sessionOverrides;
|
|
339
|
+
const keys = ["models", "instructions", "maxVcpu", "maxMemoryMiB", "maxSessionDollars"];
|
|
340
|
+
if (!isObject(v) || Object.keys(v).some((k) => !keys.includes(k)))
|
|
341
|
+
note(at("sessionOverrides"), `takes { ${keys.join(", ")} }.`);
|
|
342
|
+
else {
|
|
343
|
+
if (v.models !== undefined &&
|
|
344
|
+
(!Array.isArray(v.models) ||
|
|
345
|
+
v.models.length > 32 ||
|
|
346
|
+
v.models.some((m) => typeof m !== "string" || !MODEL.test(m))))
|
|
347
|
+
note(at("sessionOverrides", "models"), "takes a list of at most 32 models.");
|
|
348
|
+
if (v.instructions !== undefined &&
|
|
349
|
+
!["append", "replace", "none"].includes(v.instructions))
|
|
350
|
+
note(at("sessionOverrides", "instructions"), "takes append, replace or none.");
|
|
351
|
+
if (v.maxVcpu !== undefined && !VCPUS.includes(v.maxVcpu))
|
|
352
|
+
note(at("sessionOverrides", "maxVcpu"), "takes 1, 2, 4, 8 or 16.");
|
|
353
|
+
const mib = v.maxMemoryMiB;
|
|
354
|
+
if (mib !== undefined &&
|
|
355
|
+
(typeof mib !== "number" || mib % 256 !== 0 || mib < 512 || mib > 65536))
|
|
356
|
+
note(at("sessionOverrides", "maxMemoryMiB"), "takes 512 to 65536, a multiple of 256.");
|
|
357
|
+
const most = v.maxSessionDollars;
|
|
358
|
+
if (most !== undefined &&
|
|
359
|
+
(typeof most !== "number" || !Number.isFinite(most) || most < 0.01 || most > 10000))
|
|
360
|
+
note(at("sessionOverrides", "maxSessionDollars"), "takes dollars from 0.01 to 10000.");
|
|
361
|
+
def.sessionOverrides = v;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
325
364
|
integer("idlePauseSeconds", 10, 86400);
|
|
326
365
|
integer("maxSessionSeconds", 60, 604800);
|
|
327
366
|
integer("maxConcurrent", 1, 1000);
|
|
367
|
+
integer("maxChildren", 1, 1000);
|
|
368
|
+
if (entry.advisor !== undefined) {
|
|
369
|
+
const v = entry.advisor;
|
|
370
|
+
const fields = ["model", "provider", "secret", "baseUrl", "maxCalls", "instructions"];
|
|
371
|
+
if (!isObject(v) ||
|
|
372
|
+
Object.keys(v).some((k) => !fields.includes(k)) ||
|
|
373
|
+
typeof v.model !== "string" ||
|
|
374
|
+
!/^[A-Za-z0-9][A-Za-z0-9._:/@-]{0,127}$/.test(v.model) ||
|
|
375
|
+
(v.provider !== undefined &&
|
|
376
|
+
!["anthropic", "openai", "google", "openrouter", "openai-compatible"].includes(v.provider)) ||
|
|
377
|
+
(v.secret !== undefined && (typeof v.secret !== "string" || !SHELL_NAME.test(v.secret))) ||
|
|
378
|
+
(v.baseUrl !== undefined &&
|
|
379
|
+
(typeof v.baseUrl !== "string" || !/^https:\/\/\S+$/.test(v.baseUrl))) ||
|
|
380
|
+
(v.maxCalls !== undefined &&
|
|
381
|
+
(!Number.isInteger(v.maxCalls) ||
|
|
382
|
+
v.maxCalls < 1 ||
|
|
383
|
+
v.maxCalls > 200)) ||
|
|
384
|
+
(v.instructions !== undefined && typeof v.instructions !== "string"))
|
|
385
|
+
note(at("advisor"), "takes { model, provider?, secret?, baseUrl?, maxCalls? (1 to 200), instructions? }: a model's name such as claude-opus-5-5.");
|
|
386
|
+
else
|
|
387
|
+
def.advisor = v;
|
|
388
|
+
}
|
|
328
389
|
dollars("maxSessionDollars", 10000);
|
|
329
390
|
dollars("maxDayDollars", 100000);
|
|
330
391
|
if (def.command === undefined)
|
package/dist/apps-cli.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ type Out = {
|
|
|
5
5
|
write: (text: string) => void;
|
|
6
6
|
error: (text: string) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const APP_HELP = "runtime apps <command>\n\n An App serves your web server from an image or a build. Copies start when\n requests come and stop when they end, between --min-copies and --max-copies.\n In a private beta: outside it, each command says how to ask to join.\n\n create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-
|
|
9
|
-
export declare const FUNCTION_HELP = "runtime functions <command>\n\n A Function serves your HTTP handler from an image or a build, at its own\n address. Copies start when calls come, up to --max-copies, and sleep when\n they stop: an idle Function has no copy awake.\n In a private beta: outside it, each command says how to ask to join.\n\n create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-
|
|
10
|
-
export declare const BUILD_HELP = "runtime builds <command>\n\n A build turns a commit of a connected repository into a saved server an App\n deploys. A push to the production branch builds and deploys by itself.\n In a private beta: outside it, each command says how to ask to join.\n\n repos connect <owner/name | https URL> --deploy <app name> [--branch main] [--no-previews]\n [--root <folder>] [--install <command>] [--build <command>] [--start <command>]\n [--port 8080] [--health-path /healthz] [--build-env KEY=VALUE]... [--name <name>]\n Connect a repository; prints its id. --deploy takes an\n App's name, or function:<name>. --start runs once the\n build is done, with PORT set: the server the App deploys\n repos ls Connected repositories\n repos change <repoId> [the options of connect but the repository]\n Change its settings; its id and builds stay\n repos disconnect <repoId> Stop building it; its builds stay\n repos install A link to install Runtime's GitHub App, so a private\n repository builds\n create <repoId> [--ref main] [--branch <name>] [--name <name>]\n Build a branch, tag or commit now; prints the build's id\n run <repoId> [--ref main] [--branch <name>] [--name <name>] [--raw]\n The same, then follows its log; exits 0 once it succeeds\n ls [--repository <repoId>] [--commit <sha>] [--state <state>]...\n Builds, oldest first; --commit: a full sha\n get <buildId> One build: state, commit, step times, what it
|
|
8
|
+
export declare const APP_HELP = "runtime apps <command>\n\n An App serves your web server from an image or a build. Copies start when\n requests come and stop when they end, between --min-copies and --max-copies.\n In a private beta: outside it, each command says how to ask to join.\n\n create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-plan limit>\n [--min-copies 0] [--concurrency 100] [--spares 2] [--port 8080]\n [--health-path /healthz] [--health-fail 60] [--stop-grace 30] [--cdn on|off]\n [--release at-once|staged] [--soak 300] [--volume <volumeId>:<path>] [--label key=value]...\n Make an App, waiting for its first deploy; prints its id.\n --health-fail: seconds a live copy may fail its health\n check before it is replaced. --stop-grace: seconds a\n stopped copy has after SIGTERM. --release staged: a new\n version goes live on one copy, then about 10%, 50% and\n all of them, each stage running --soak seconds (60 to\n 3600) and judged on its visitors' errors and speed\n before the next; a stage that does worse goes back and\n the deploy fails, the live version never stopping.\n --volume mounts one\n volume of yours at a path under /data, /mnt, /state,\n /storage or /volumes, in the App's one copy: it needs\n --max-copies 1 (--min-copies is then 1, --spares 0), and\n each deploy stops the old copy before the new one boots\n ls [--all] Your Apps: state, live version, copies; --all, deleted too\n get <app> One App, in full (an id or its name)\n update <app> [--name <name>] [--vcpu n] [--memory n] [--min-copies n] [--max-copies n]\n [--concurrency n] [--spares n] [--port n] [--health-path /path] [--health-fail n]\n [--stop-grace n] [--volume <volumeId>:<path> | none] [--cdn on|off]\n [--release at-once|staged] [--soak n] [--label key=value]...\n Change its settings; --volume none takes the volume\n away, only before its first deploy;\n --cdn off sends visitors straight to Runtime's routers,\n with nothing cached (on: Cloudflare's CDN in front)\n rm <app> Delete it and stop its copies\n deploy <app> (--image <image> | --build <buildId>) [--env KEY=VALUE]... [--keep-env]\n [--port 8080] [--health-path /healthz] [--no-wait]\n A new version. Waits until it is live, or says why it\n failed; --no-wait prints the deploy's id at once.\n --image: an image of yours (id, name, name:tag);\n --build: a build that succeeded (runtime builds).\n --env KEY alone sends KEY's value from your environment.\n --keep-env keeps the last deploy's environment, sealed\n deploys <app> [<deployId>] [--wait] Each version's deploy: state and address; with an id,\n that one (--wait: until it ends)\n versions <app> Its versions; the live and previous ones keep saved copies\n copies <app> Its copies now: version, region, state\n logs <app> [--follow] [--since 1h] [--version n] [--copy <copyId>] [--stream stdout|stderr]\n [--limit 100] [--raw] What its copies printed: the newest lines since --since\n (a time, or 30s, 15m, 2h, 7d; kept 14 days), or with\n --follow every line as it comes, until Ctrl-C. On a\n terminal control characters show as \\uXXXX unless --raw\n exec <app> [--copy <id>] [--root] [--cwd <dir>] [--env K=V]... [--timeout <ms>] [--trace-files <file.json>] -- <command>\n Run a command in its live copy\n cp <file> <app>:/<path> [--copy <id>] Copy a file onto its live copy\n cp <app>:/<path> <file> [--copy <id>] Copy a file off it\n exec and cp go to a serving copy of the live version unless --copy names\n one. A copy holds the App's secrets, so only an owner's or admin's key\n reaches into one. A file written to a copy lasts as long as that copy; a\n deploy replaces its copies.\n rollback <app> [--no-wait] Put the previous version live again\n restart <app> [--no-wait] Start the live version afresh, as a deploy of its own;\n with a volume, the old copy stops first and the\n downtime is said\n\nExamples\n runtime apps create web --vcpu 1 --memory 512 --max-copies 3\n runtime apps deploy web --image web:latest --env NODE_ENV=production\n runtime apps logs web --follow\n runtime apps rollback web\n runtime apps create db --vcpu 1 --memory 1024 --max-copies 1 --volume <volumeId>:/data\n";
|
|
9
|
+
export declare const FUNCTION_HELP = "runtime functions <command>\n\n A Function serves your HTTP handler from an image or a build, at its own\n address. Copies start when calls come, up to --max-copies, and sleep when\n they stop: an idle Function has no copy awake.\n In a private beta: outside it, each command says how to ask to join.\n\n create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-plan limit>\n [--concurrency 100] [--spares 2] [--port 8080]\n [--health-path /healthz] [--health-fail 60] [--label key=value]...\n Make a Function, waiting for its first deploy; prints its id.\n --health-fail: seconds a live copy may fail its health\n check before it is replaced\n ls [--all] Your Functions: state, live version, copies; --all, deleted too\n get <function> One Function, in full (an id or its name)\n update <function> [--name <name>] [--vcpu n] [--memory n] [--max-copies n]\n [--concurrency n] [--spares n] [--port n] [--health-path /path] [--health-fail n]\n [--label key=value]...\n Change its settings\n rm <function> Delete it and stop its copies\n deploy <function> (--image <image> | --build <buildId>) [--env KEY=VALUE]... [--keep-env]\n [--port 8080] [--health-path /healthz] [--no-wait]\n A new version. Waits until it is live, or says why it\n failed; --no-wait prints the deploy's id at once.\n --image: an image of yours (id, name, name:tag);\n --build: a build that succeeded (runtime builds).\n --env KEY alone sends KEY's value from your environment.\n --keep-env keeps the last deploy's environment, sealed\n deploys <function> [<deployId>] [--wait] Each version's deploy: state and address; with an id,\n that one (--wait: until it ends)\n versions <function> Its versions; the live and previous ones keep saved copies\n copies <function> Its copies now: version, region, state\n logs <function> [--follow] [--since 1h] [--version n] [--copy <copyId>] [--stream stdout|stderr]\n [--limit 100] [--raw] What its copies printed: the newest lines since --since\n (a time, or 30s, 15m, 2h, 7d; kept 14 days), or with\n --follow every line as it comes, until Ctrl-C. On a\n terminal control characters show as \\uXXXX unless --raw\n rollback <function> [--no-wait] Put the previous version live again\n restart <function> [--no-wait] Start the live version afresh, as a deploy of its own\n\nExamples\n runtime functions create resize --vcpu 1 --memory 512 --max-copies 10\n runtime functions deploy resize --image resize:latest\n runtime functions logs resize --follow\n runtime functions rollback resize\n";
|
|
10
|
+
export declare const BUILD_HELP = "runtime builds <command>\n\n A build turns a commit of a connected repository into a saved server an App\n deploys. A push to the production branch builds and deploys by itself.\n In a private beta: outside it, each command says how to ask to join.\n\n repos connect <owner/name | https URL> --deploy <app name> [--branch main] [--no-previews]\n [--root <folder>] [--install <command>] [--build <command>] [--start <command>]\n [--port 8080] [--health-path /healthz] [--build-env KEY=VALUE]... [--name <name>]\n Connect a repository; prints its id. --deploy takes an\n App's name, or function:<name>. --start runs once the\n build is done, with PORT set: the server the App deploys.\n A command left out is the detected framework's (Next.js,\n Vite, Remix, Astro, SvelteKit, Nuxt, Express, Hono,\n FastAPI, Django, Flask, Rails, Go, Rust, a Dockerfile)\n repos ls Connected repositories\n repos change <repoId> [the options of connect but the repository]\n Change its settings; its id and builds stay\n repos disconnect <repoId> Stop building it; its builds stay\n repos install A link to install Runtime's GitHub App, so a private\n repository builds\n create <repoId> [--ref main] [--branch <name>] [--name <name>]\n Build a branch, tag or commit now; prints the build's id\n run <repoId> [--ref main] [--branch <name>] [--name <name>] [--raw]\n The same, then follows its log; exits 0 once it succeeds\n ls [--repository <repoId>] [--commit <sha>] [--state <state>]...\n Builds, oldest first; --commit: a full sha\n get <buildId> One build: state, commit, framework, step times, what it\n made\n cancel <buildId> Stop a build that has not ended\n logs <buildId> [--follow] [--raw] Its last 200 lines, or every line as it comes until it\n ends; on a terminal control characters show as \\uXXXX\n unless --raw\n\nExamples\n runtime builds repos connect acme/web --deploy web\n runtime builds repos connect acme/api --deploy api --start \"node dist/server.js\"\n runtime builds run <repoId> --ref main\n runtime builds ls --commit $(git rev-parse HEAD)\n";
|
|
11
11
|
export declare const CONTAINER_HELP = "runtime containers <command>\n\n A container runs one OCI image's process on its own microVM, billed at the\n sandbox rates. It never sleeps unless --sleep; on exit it restarts when it\n serves a port, else it stops (--on-exit sets either).\n In a private beta: outside it, each command says how to ask to join.\n\n create <image> --vcpu <1-16> --memory <128-65536> [--name <name>] [--label key=value]...\n [--env KEY[=VALUE]]... [--entrypoint <program>] [--workdir /app] [--user <user>]\n [--port <1-65535>] [--on-exit restart|stop] [--sleep] [-- <command...>]\n Run it; prints its id. The image's digest is pinned.\n --env KEY alone sends KEY's value from your environment.\n --entrypoint drops the image's command; after --, the\n command replaces the image's\n ls [--all] [--state <state>]... [--label key=value]...\n Your containers: all but deleting and deleted, unless\n --all or --state\n get <container> One container, in full (an id or its name): its\n environment's names, never their values\n update <container> [--name <name>] [--label key=value]...\n Rename it or replace its labels\n rm <container> [--wait] Delete it and stop its process; --wait: until deleted\n\nExamples\n runtime containers create nginx:1.27 --vcpu 1 --memory 512 --name web\n runtime containers create python:3.12 --vcpu 1 --memory 1024 -- python3 -m http.server 8000\n runtime containers rm web --wait\n";
|
|
12
12
|
export declare function appsCommand(argv: string[], env: NodeJS.ProcessEnv, out: Out, client: () => Promise<Runtime>, kit: CliKit): Promise<number>;
|
|
13
13
|
export declare function functionsCommand(argv: string[], env: NodeJS.ProcessEnv, out: Out, client: () => Promise<Runtime>, kit: CliKit): Promise<number>;
|
package/dist/apps-cli.js
CHANGED
|
@@ -10,7 +10,7 @@ export const APP_HELP = `runtime apps <command>
|
|
|
10
10
|
requests come and stop when they end, between --min-copies and --max-copies.
|
|
11
11
|
In a private beta: outside it, each command says how to ask to join.
|
|
12
12
|
|
|
13
|
-
create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-
|
|
13
|
+
create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-plan limit>
|
|
14
14
|
[--min-copies 0] [--concurrency 100] [--spares 2] [--port 8080]
|
|
15
15
|
[--health-path /healthz] [--health-fail 60] [--stop-grace 30] [--cdn on|off]
|
|
16
16
|
[--release at-once|staged] [--soak 300] [--volume <volumeId>:<path>] [--label key=value]...
|
|
@@ -83,7 +83,7 @@ export const FUNCTION_HELP = `runtime functions <command>
|
|
|
83
83
|
they stop: an idle Function has no copy awake.
|
|
84
84
|
In a private beta: outside it, each command says how to ask to join.
|
|
85
85
|
|
|
86
|
-
create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-
|
|
86
|
+
create [<name>] --vcpu <1-16> --memory <128-65536> --max-copies <1-plan limit>
|
|
87
87
|
[--concurrency 100] [--spares 2] [--port 8080]
|
|
88
88
|
[--health-path /healthz] [--health-fail 60] [--label key=value]...
|
|
89
89
|
Make a Function, waiting for its first deploy; prints its id.
|
|
@@ -133,7 +133,10 @@ export const BUILD_HELP = `runtime builds <command>
|
|
|
133
133
|
[--port 8080] [--health-path /healthz] [--build-env KEY=VALUE]... [--name <name>]
|
|
134
134
|
Connect a repository; prints its id. --deploy takes an
|
|
135
135
|
App's name, or function:<name>. --start runs once the
|
|
136
|
-
build is done, with PORT set: the server the App deploys
|
|
136
|
+
build is done, with PORT set: the server the App deploys.
|
|
137
|
+
A command left out is the detected framework's (Next.js,
|
|
138
|
+
Vite, Remix, Astro, SvelteKit, Nuxt, Express, Hono,
|
|
139
|
+
FastAPI, Django, Flask, Rails, Go, Rust, a Dockerfile)
|
|
137
140
|
repos ls Connected repositories
|
|
138
141
|
repos change <repoId> [the options of connect but the repository]
|
|
139
142
|
Change its settings; its id and builds stay
|
|
@@ -146,14 +149,16 @@ export const BUILD_HELP = `runtime builds <command>
|
|
|
146
149
|
The same, then follows its log; exits 0 once it succeeds
|
|
147
150
|
ls [--repository <repoId>] [--commit <sha>] [--state <state>]...
|
|
148
151
|
Builds, oldest first; --commit: a full sha
|
|
149
|
-
get <buildId> One build: state, commit, step times, what it
|
|
152
|
+
get <buildId> One build: state, commit, framework, step times, what it
|
|
153
|
+
made
|
|
150
154
|
cancel <buildId> Stop a build that has not ended
|
|
151
155
|
logs <buildId> [--follow] [--raw] Its last 200 lines, or every line as it comes until it
|
|
152
156
|
ends; on a terminal control characters show as \\uXXXX
|
|
153
157
|
unless --raw
|
|
154
158
|
|
|
155
159
|
Examples
|
|
156
|
-
runtime builds repos connect acme/web --deploy web
|
|
160
|
+
runtime builds repos connect acme/web --deploy web
|
|
161
|
+
runtime builds repos connect acme/api --deploy api --start "node dist/server.js"
|
|
157
162
|
runtime builds run <repoId> --ref main
|
|
158
163
|
runtime builds ls --commit $(git rev-parse HEAD)
|
|
159
164
|
`;
|