withruntime 0.33.2 → 0.33.3
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/dist/ci-cli.d.ts +1 -1
- package/dist/ci-cli.js +50 -10
- package/dist/index.d.ts +1 -1
- package/dist/products/ci.d.ts +39 -3
- package/dist/products/ci.js +7 -1
- package/dist/transport.d.ts +1 -1
- package/dist/transport.js +1 -1
- package/package.json +2 -2
package/dist/ci-cli.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ type Out = {
|
|
|
5
5
|
write: (text: string) => void;
|
|
6
6
|
error: (text: string) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const CI_HELP = "runtime ci <command>\n\n CI/CD checks each push and pull request of a connected GitHub repository in\n sandboxes, as the steps its config file names. A fork's pull request
|
|
8
|
+
export declare const CI_HELP = "runtime ci <command>\n\n CI/CD checks each push and pull request of a connected GitHub repository in\n sandboxes, as the steps its config file names. A fork's pull request runs\n nothing; a writer can open it again from a branch of the repository. In a\n private beta: outside it, each command says how to ask to join.\n\n import [dir] [--write] [--force] This folder's GitHub Actions workflows and CircleCI\n config as a runtime.yml: printed, or written with\n --write; what isn't carried over is noted at its top.\n Needs no key and sends nothing\n connect <owner/name> [--branch main] [--config runtime.yml] [--installation <id>]\n [--trust <app-slug>[bot]]... [--name <name>]\n Connect a repository; prints its id. Takes a full key.\n --trust runs that App's pushes as its own from the start\n repos [ls] [--all] Connected repositories, with the Apps each trusts;\n --all: disconnected ones too\n repos trust <repoId | owner/name> <app-slug>[bot]...\n Run that App's pushes as the repository's own code,\n keeping the Apps it trusts already\n repos untrust <repoId | owner/name> <app-slug>[bot]...\n Stop trusting those Apps, keeping the rest\n repos undo <repoId | owner/name> on|off When main's check fails, find the first commit that\n fails it and open a pull request reverting it, which\n lands once its check passes. Off until turned on;\n takes an owner's or admin's full key\n disconnect <repoId | owner/name> Stop checking it; its checks still going are cancelled\n checks [--repository <repoId>] [--branch <name>] [--commit <sha>] [--pr <number>]\n [--state <state>]... [--limit 20] Checks, newest first, with their jobs by state (or ls)\n check <checkId> One check and its jobs in plan order (or get)\n cancel <checkId> Cancel a queued or running check: its jobs end,\n its machines are let go, GitHub is told\n logs <jobId> A job's output, its last 256 KiB, and its sandboxes\n tests <repoId> [--quarantined] Its test files: time, recent outcomes, quarantine\n flakes [--repository <repoId>] [--all] Flaky tests: each quarantined (or still gating), its\n owner and 48-hour deadline; --all: ended ones too\n flake <flakeId> One flaky test: its proof, owner, and recent runs\n flake prove <flakeId> Its 100 proof runs again at main's next commit\n flake hand <flakeId> <login | org/team> Hand it to someone else\n flake delete <flakeId> --reason <why> Say why its test is deleted; it ends once main\n no longer holds the file\n releases [--repository <repoId>] [--commit <sha>] [--limit 50]\n A release's steps as they were taken, oldest\n first: migrations, deploys, servers, waits\n\n A failed job's sandbox may be kept paused: `runtime sandboxes wake <id>`, then\n `runtime sandboxes shell <id>` to look around where it failed. A key reads the\n checks of repositories its own agent connected; an account-wide key reads and\n cancels every check of the account (switch one at withruntime.com/account/keys).\n\nExamples\n runtime ci import --write\n runtime ci connect acme/web --config .runtime/ci.yml\n runtime ci repos trust acme/web acme-bot[bot]\n runtime ci repos undo acme/web on\n runtime ci checks --commit $(git rev-parse HEAD)\n runtime ci cancel <checkId>\n runtime ci logs <jobId>\n";
|
|
9
9
|
export declare function ciCommand(argv: string[], out: Out, client: () => Promise<Runtime>, kit: CliKit): Promise<number>;
|
|
10
10
|
export {};
|
package/dist/ci-cli.js
CHANGED
|
@@ -6,9 +6,9 @@ import { ci, } from "./products/ci.js";
|
|
|
6
6
|
export const CI_HELP = `runtime ci <command>
|
|
7
7
|
|
|
8
8
|
CI/CD checks each push and pull request of a connected GitHub repository in
|
|
9
|
-
sandboxes, as the steps its config file names. A fork's pull request
|
|
10
|
-
|
|
11
|
-
command says how to ask to join.
|
|
9
|
+
sandboxes, as the steps its config file names. A fork's pull request runs
|
|
10
|
+
nothing; a writer can open it again from a branch of the repository. In a
|
|
11
|
+
private beta: outside it, each command says how to ask to join.
|
|
12
12
|
|
|
13
13
|
import [dir] [--write] [--force] This folder's GitHub Actions workflows and CircleCI
|
|
14
14
|
config as a runtime.yml: printed, or written with
|
|
@@ -30,9 +30,9 @@ export const CI_HELP = `runtime ci <command>
|
|
|
30
30
|
lands once its check passes. Off until turned on;
|
|
31
31
|
takes an owner's or admin's full key
|
|
32
32
|
disconnect <repoId | owner/name> Stop checking it; its checks still going are cancelled
|
|
33
|
-
|
|
34
|
-
[--state <state>]... [--limit 20] Checks, newest first, with their jobs by state
|
|
35
|
-
|
|
33
|
+
checks [--repository <repoId>] [--branch <name>] [--commit <sha>] [--pr <number>]
|
|
34
|
+
[--state <state>]... [--limit 20] Checks, newest first, with their jobs by state (or ls)
|
|
35
|
+
check <checkId> One check and its jobs in plan order (or get)
|
|
36
36
|
cancel <checkId> Cancel a queued or running check: its jobs end,
|
|
37
37
|
its machines are let go, GitHub is told
|
|
38
38
|
logs <jobId> A job's output, its last 256 KiB, and its sandboxes
|
|
@@ -44,16 +44,22 @@ export const CI_HELP = `runtime ci <command>
|
|
|
44
44
|
flake hand <flakeId> <login | org/team> Hand it to someone else
|
|
45
45
|
flake delete <flakeId> --reason <why> Say why its test is deleted; it ends once main
|
|
46
46
|
no longer holds the file
|
|
47
|
+
releases [--repository <repoId>] [--commit <sha>] [--limit 50]
|
|
48
|
+
A release's steps as they were taken, oldest
|
|
49
|
+
first: migrations, deploys, servers, waits
|
|
47
50
|
|
|
48
51
|
A failed job's sandbox may be kept paused: \`runtime sandboxes wake <id>\`, then
|
|
49
|
-
\`runtime sandboxes shell <id>\` to look around where it failed.
|
|
52
|
+
\`runtime sandboxes shell <id>\` to look around where it failed. A key reads the
|
|
53
|
+
checks of repositories its own agent connected; an account-wide key reads and
|
|
54
|
+
cancels every check of the account (switch one at withruntime.com/account/keys).
|
|
50
55
|
|
|
51
56
|
Examples
|
|
52
57
|
runtime ci import --write
|
|
53
58
|
runtime ci connect acme/web --config .runtime/ci.yml
|
|
54
59
|
runtime ci repos trust acme/web acme-bot[bot]
|
|
55
60
|
runtime ci repos undo acme/web on
|
|
56
|
-
runtime ci
|
|
61
|
+
runtime ci checks --commit $(git rev-parse HEAD)
|
|
62
|
+
runtime ci cancel <checkId>
|
|
57
63
|
runtime ci logs <jobId>
|
|
58
64
|
`;
|
|
59
65
|
const when = (ms) => (ms === null ? "-" : new Date(ms).toISOString());
|
|
@@ -236,7 +242,8 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
236
242
|
case "disconnect":
|
|
237
243
|
return disconnect(need(rest[0], "the repository's id or owner/name"));
|
|
238
244
|
case "ls":
|
|
239
|
-
case "list":
|
|
245
|
+
case "list":
|
|
246
|
+
case "checks": {
|
|
240
247
|
const args = parse(rest, [], ["repository", "branch", "commit", "pr", "state", "limit"]);
|
|
241
248
|
const commit = flag(args, "commit");
|
|
242
249
|
if (commit !== undefined && !/^([0-9a-f]{40}|[0-9a-f]{64})$/.test(commit))
|
|
@@ -273,7 +280,8 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
273
280
|
: "No checks.", all);
|
|
274
281
|
return 0;
|
|
275
282
|
}
|
|
276
|
-
case "get":
|
|
283
|
+
case "get":
|
|
284
|
+
case "check": {
|
|
277
285
|
const check = await api.checks.get(need(rest[0], "a check's id"));
|
|
278
286
|
const job = (j) => [
|
|
279
287
|
j.id,
|
|
@@ -294,6 +302,11 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
294
302
|
}
|
|
295
303
|
case "cancel": {
|
|
296
304
|
const check = await api.checks.cancel(need(rest[0], "a check's id (runtime ci ls)"));
|
|
305
|
+
// A key that may cancel the check but not read it is told its state alone.
|
|
306
|
+
if (!("commit" in check)) {
|
|
307
|
+
print(`${check.id}: ${check.state}`, check);
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
297
310
|
print(`${check.repository} ${check.commit.slice(0, 12)} ${where(check)}: ${check.state}${check.reason ? ` (${check.reason})` : ""}`, check);
|
|
298
311
|
return 0;
|
|
299
312
|
}
|
|
@@ -370,6 +383,30 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
370
383
|
].join("\n"), f);
|
|
371
384
|
return 0;
|
|
372
385
|
}
|
|
386
|
+
case "releases": {
|
|
387
|
+
const args = parse(rest, [], ["repository", "commit", "limit"]);
|
|
388
|
+
const repositoryId = flag(args, "repository");
|
|
389
|
+
const commit = flag(args, "commit");
|
|
390
|
+
const limit = flag(args, "limit");
|
|
391
|
+
const steps = (await api.releases.list({
|
|
392
|
+
limit: limit ? whole(limit, "--limit") : 50,
|
|
393
|
+
...(repositoryId ? { repositoryId } : {}),
|
|
394
|
+
...(commit ? { commit } : {}),
|
|
395
|
+
})).data.reverse();
|
|
396
|
+
print(steps.length
|
|
397
|
+
? table([
|
|
398
|
+
["AT", "RELEASE", "BY", "SERVER", "STEP"],
|
|
399
|
+
...steps.map((s) => [
|
|
400
|
+
when(s.at),
|
|
401
|
+
s.commit.slice(0, 9),
|
|
402
|
+
s.source,
|
|
403
|
+
s.host ?? "-",
|
|
404
|
+
s.line,
|
|
405
|
+
]),
|
|
406
|
+
])
|
|
407
|
+
: "No release steps.", steps);
|
|
408
|
+
return 0;
|
|
409
|
+
}
|
|
373
410
|
case "tests": {
|
|
374
411
|
const args = parse(rest, ["quarantined"], []);
|
|
375
412
|
const repositoryId = need(args.positional[0], "a repository's id (runtime ci repos)");
|
|
@@ -398,6 +435,8 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
398
435
|
"connect",
|
|
399
436
|
"repos",
|
|
400
437
|
"disconnect",
|
|
438
|
+
"checks",
|
|
439
|
+
"check",
|
|
401
440
|
"ls",
|
|
402
441
|
"get",
|
|
403
442
|
"cancel",
|
|
@@ -405,6 +444,7 @@ export async function ciCommand(argv, out, client, kit) {
|
|
|
405
444
|
"tests",
|
|
406
445
|
"flakes",
|
|
407
446
|
"flake",
|
|
447
|
+
"releases",
|
|
408
448
|
]);
|
|
409
449
|
}
|
|
410
450
|
/** A review's verdict in words: each finding with its place and fix, then
|
package/dist/index.d.ts
CHANGED
|
@@ -82,4 +82,4 @@ export type { Agent, AgentDefinition, AgentEvent, AgentMemoryEntry, AgentMemoryF
|
|
|
82
82
|
export { AGENT_TEMPLATES, AGENT_USES } from "./products/agents.js";
|
|
83
83
|
export type { AgentsDeployChange, AgentsDeployOptions, AgentsDeployResult, AgentsFile, AgentsFileAgent, AgentsFileTrigger, AgentsSource, } from "./agents-deploy.js";
|
|
84
84
|
export type { Container, ContainerState, CreateContainer, UpdateContainer, } from "./products/containers.js";
|
|
85
|
-
export type { CiFlake, CiFlakeDetail, CiRepository, CiTestResult, ConnectCiRepository, ListCiFlakes, ListCiRepositories, UpdateCiFlake, } from "./products/ci.js";
|
|
85
|
+
export type { CiFlake, CiFlakeDetail, CiReleaseStep, CiRepository, CiTestResult, ConnectCiRepository, ListCiFlakes, ListCiReleaseSteps, ListCiRepositories, UpdateCiFlake, } from "./products/ci.js";
|
package/dist/products/ci.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export type CiCheck = {
|
|
|
65
65
|
/** The GitHub login that pushed, opened or re-ran it. */
|
|
66
66
|
actor: string | null;
|
|
67
67
|
/** The repository's writers' code. A fork's pull request is not, and runs
|
|
68
|
-
* nothing
|
|
68
|
+
* nothing; a writer can open it again from a branch of the repository. */
|
|
69
69
|
trusted: boolean;
|
|
70
70
|
/** Queued for a writer's approval: nothing of it runs. */
|
|
71
71
|
waiting: boolean;
|
|
@@ -168,6 +168,12 @@ export type CiReview = {
|
|
|
168
168
|
export type CiCheckDetail = CiCheck & {
|
|
169
169
|
jobs: CiJob[];
|
|
170
170
|
};
|
|
171
|
+
/** A cancel's answer to a key that may cancel the check but not read it:
|
|
172
|
+
* its id and state, nothing of its jobs or logs. */
|
|
173
|
+
export type CiCancelled = {
|
|
174
|
+
id: string;
|
|
175
|
+
state: CiCheckState;
|
|
176
|
+
};
|
|
171
177
|
/** A job with the tail of its output: at most 256 KiB, the oldest dropped first. */
|
|
172
178
|
export type CiJobDetail = CiJob & {
|
|
173
179
|
log: string;
|
|
@@ -291,6 +297,30 @@ export type UpdateCiFlake = {
|
|
|
291
297
|
owner?: string;
|
|
292
298
|
deleteReason?: string;
|
|
293
299
|
};
|
|
300
|
+
/** One step a release took, as it took it: a migration's copy test or
|
|
301
|
+
* apply, a deploy ref moved, a server's canary or release, the website's
|
|
302
|
+
* deploy or promote, or a wait with why. */
|
|
303
|
+
export type CiReleaseStep = {
|
|
304
|
+
id: number;
|
|
305
|
+
repositoryId: string;
|
|
306
|
+
/** The commit this step of the release is of. */
|
|
307
|
+
commit: string;
|
|
308
|
+
/** Who took it: `mover` (the release on CI/CD's pass) or the deploy
|
|
309
|
+
* target that walks it (`hostd`, `controller`, `settings`, `follower`). */
|
|
310
|
+
source: string;
|
|
311
|
+
/** The server it was on, when it was on one. */
|
|
312
|
+
host: string | null;
|
|
313
|
+
line: string;
|
|
314
|
+
/** Unix milliseconds. */
|
|
315
|
+
at: number;
|
|
316
|
+
};
|
|
317
|
+
export type ListCiReleaseSteps = {
|
|
318
|
+
repositoryId?: string;
|
|
319
|
+
/** Only this commit's release. */
|
|
320
|
+
commit?: string;
|
|
321
|
+
limit?: number;
|
|
322
|
+
cursor?: string;
|
|
323
|
+
};
|
|
294
324
|
export declare function ci(t: Transport): {
|
|
295
325
|
repositories: {
|
|
296
326
|
/** Connect a GitHub repository for checks. Only a full key connects
|
|
@@ -320,8 +350,9 @@ export declare function ci(t: Transport): {
|
|
|
320
350
|
/** A check with its jobs in plan order. */
|
|
321
351
|
get: (id: string, options?: RequestOptions) => Promise<CiCheckDetail>;
|
|
322
352
|
/** Cancel a queued or running check: its jobs end and its machines
|
|
323
|
-
* are let go. A check that has ended is answered as it is
|
|
324
|
-
|
|
353
|
+
* are let go. A check that has ended is answered as it is; to a key
|
|
354
|
+
* that may cancel it but not read it, with its id and state alone. */
|
|
355
|
+
cancel: (id: string, options?: RequestOptions) => Promise<CiCheckDetail | CiCancelled>;
|
|
325
356
|
};
|
|
326
357
|
jobs: {
|
|
327
358
|
/** A job with the tail of its log and the sandboxes it ran in. */
|
|
@@ -331,6 +362,11 @@ export declare function ci(t: Transport): {
|
|
|
331
362
|
/** A repository's test files by name, with their quarantine. */
|
|
332
363
|
list: (repositoryId: string, query?: ListCiTests, options?: RequestOptions) => Promise<Page<CiTest>>;
|
|
333
364
|
};
|
|
365
|
+
releases: {
|
|
366
|
+
/** The steps releases took, newest first, of one repository or one
|
|
367
|
+
* commit: only repositories whose releases CI/CD runs have any. */
|
|
368
|
+
list: (query?: ListCiReleaseSteps, options?: RequestOptions) => Promise<Page<CiReleaseStep>>;
|
|
369
|
+
};
|
|
334
370
|
flakes: {
|
|
335
371
|
/** Flaky tests, newest first; `state: ["quarantined", "gating"]`
|
|
336
372
|
* lists the open ones. */
|
package/dist/products/ci.js
CHANGED
|
@@ -85,7 +85,8 @@ export function ci(t) {
|
|
|
85
85
|
/** A check with its jobs in plan order. */
|
|
86
86
|
get: (id, options) => t.json({ method: "GET", path: at("/v1/ci/checks", id), ...options }),
|
|
87
87
|
/** Cancel a queued or running check: its jobs end and its machines
|
|
88
|
-
* are let go. A check that has ended is answered as it is
|
|
88
|
+
* are let go. A check that has ended is answered as it is; to a key
|
|
89
|
+
* that may cancel it but not read it, with its id and state alone. */
|
|
89
90
|
cancel: (id, options) => t.json({
|
|
90
91
|
method: "POST",
|
|
91
92
|
path: `${at("/v1/ci/checks", id)}:cancel`,
|
|
@@ -100,6 +101,11 @@ export function ci(t) {
|
|
|
100
101
|
/** A repository's test files by name, with their quarantine. */
|
|
101
102
|
list: (repositoryId, query = {}, options) => paged("/v1/ci/tests", { ...query, repositoryId }, options),
|
|
102
103
|
},
|
|
104
|
+
releases: {
|
|
105
|
+
/** The steps releases took, newest first, of one repository or one
|
|
106
|
+
* commit: only repositories whose releases CI/CD runs have any. */
|
|
107
|
+
list: (query = {}, options) => paged("/v1/ci/releases", query, options),
|
|
108
|
+
},
|
|
103
109
|
flakes: {
|
|
104
110
|
/** Flaky tests, newest first; `state: ["quarantined", "gating"]`
|
|
105
111
|
* lists the open ones. */
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeError } from "./errors.js";
|
|
2
|
-
export declare const VERSION = "0.33.
|
|
2
|
+
export declare const VERSION = "0.33.3";
|
|
3
3
|
export declare const DEFAULT_BASE_URL = "https://api.withruntime.com";
|
|
4
4
|
/** Runtime's API as code inside a Runtime sandbox reaches it: the sandbox's
|
|
5
5
|
* own host sends each request on to DEFAULT_BASE_URL over HTTPS. The API runs
|
package/dist/transport.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionError, DELIBERATE, errorFor, NOTHING_RAN, RuntimeError, WAITS_FOR_ROOM, } from "./errors.js";
|
|
2
2
|
import { describeRoute, envFetch, openWebSocket, untrustedCertificate } from "./proxy.js";
|
|
3
3
|
import { warningText } from "./product-renames.js";
|
|
4
|
-
export const VERSION = "0.33.
|
|
4
|
+
export const VERSION = "0.33.3";
|
|
5
5
|
export const DEFAULT_BASE_URL = "https://api.withruntime.com";
|
|
6
6
|
/** Runtime's API as code inside a Runtime sandbox reaches it: the sandbox's
|
|
7
7
|
* own host sends each request on to DEFAULT_BASE_URL over HTTPS. The API runs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "withruntime",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"mcpName": "com.withruntime/runtime",
|
|
6
6
|
"type": "module",
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
"llm"
|
|
259
259
|
],
|
|
260
260
|
"dependencies": {
|
|
261
|
-
"undici": "^7.
|
|
261
|
+
"undici": "^7.30.1",
|
|
262
262
|
"yaml": "^2.8.1"
|
|
263
263
|
},
|
|
264
264
|
"peerDependencies": {
|