agental 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -536
- package/bin/agental.js +1 -1
- package/dist/cli.js +20 -20
- package/package.json +8 -26
- package/dist/client.d.ts +0 -321
- package/dist/client.js +0 -451
- package/dist/errors.d.ts +0 -62
- package/dist/errors.js +0 -65
- package/dist/http.d.ts +0 -69
- package/dist/http.js +0 -246
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -5
- package/dist/openapi.d.ts +0 -17070
- package/dist/openapi.js +0 -5
- package/dist/sandbox.d.ts +0 -605
- package/dist/sandbox.js +0 -846
- package/dist/template.d.ts +0 -183
- package/dist/template.js +0 -261
- package/dist/types.d.ts +0 -198
- package/dist/types.js +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -2
- package/dist/webhooks.d.ts +0 -6
- package/dist/webhooks.js +0 -16
package/dist/cli.js
CHANGED
|
@@ -37,21 +37,21 @@ var init_cli_operator = __esm({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// ../src/cli.ts
|
|
41
41
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
42
42
|
import { readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
43
43
|
import os5 from "node:os";
|
|
44
44
|
import { readFile } from "node:fs/promises";
|
|
45
45
|
import { parseArgs } from "node:util";
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// ../src/cli-build.ts
|
|
48
48
|
var PUBLISHED = true;
|
|
49
|
-
var CLI_VERSION = true ? "0.
|
|
49
|
+
var CLI_VERSION = true ? "0.2.0" : "dev";
|
|
50
50
|
var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
|
|
51
51
|
var PACKAGE_NAME = "agental";
|
|
52
52
|
var USER_AGENT = `agental-cli/${CLI_VERSION}`;
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// ../src/cli-credentials.ts
|
|
55
55
|
import { randomBytes } from "node:crypto";
|
|
56
56
|
import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
57
57
|
import os from "node:os";
|
|
@@ -117,7 +117,7 @@ function resolveApi(fallbackUrl, fallbackKey, env = process.env) {
|
|
|
117
117
|
return { base: trim(namedUrl ?? fallbackUrl), key: fallbackKey };
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
120
|
+
// ../src/cli-email.ts
|
|
121
121
|
var USAGE = "email requires <sandbox-id>, or one of on, off, list, read, delete, send and account. agental help shows each.";
|
|
122
122
|
async function readObject(response) {
|
|
123
123
|
try {
|
|
@@ -365,7 +365,7 @@ async function email(client, positionals, options) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
//
|
|
368
|
+
// ../src/key-actions.ts
|
|
369
369
|
var KEY_ACTIONS = [
|
|
370
370
|
"sandbox.read",
|
|
371
371
|
"sandbox.create",
|
|
@@ -423,7 +423,7 @@ var PRESETS = {
|
|
|
423
423
|
};
|
|
424
424
|
var PRESET_NAMES = Object.keys(PRESETS);
|
|
425
425
|
|
|
426
|
-
//
|
|
426
|
+
// ../src/cli-keys.ts
|
|
427
427
|
var USAGE2 = "key takes add, show, allow-from or delete. agental help shows each.";
|
|
428
428
|
var HOUR_MS = 36e5;
|
|
429
429
|
var SHOWN_ONCE = "is shown this once: only its hash is kept. Use it as AGENTAL_API_KEY, or as the Bearer token of each request.";
|
|
@@ -689,7 +689,7 @@ async function key(client, positionals, options) {
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
//
|
|
692
|
+
// ../src/cli-login.ts
|
|
693
693
|
import { spawn, spawnSync } from "node:child_process";
|
|
694
694
|
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
695
695
|
import { createServer } from "node:http";
|
|
@@ -998,7 +998,7 @@ async function readAll(stream) {
|
|
|
998
998
|
return Buffer.concat(chunks).toString("utf8");
|
|
999
999
|
}
|
|
1000
1000
|
|
|
1001
|
-
//
|
|
1001
|
+
// ../src/cli-onboard.ts
|
|
1002
1002
|
import { execFile, spawnSync as spawnSync3 } from "node:child_process";
|
|
1003
1003
|
import { randomUUID, randomBytes as randomBytes3 } from "node:crypto";
|
|
1004
1004
|
import { existsSync as existsSync2, realpathSync, statSync } from "node:fs";
|
|
@@ -1006,7 +1006,7 @@ import os4 from "node:os";
|
|
|
1006
1006
|
import path3 from "node:path";
|
|
1007
1007
|
import { createInterface } from "node:readline/promises";
|
|
1008
1008
|
|
|
1009
|
-
//
|
|
1009
|
+
// ../src/cli-ssh.ts
|
|
1010
1010
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
1011
1011
|
import { existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
1012
1012
|
import net from "node:net";
|
|
@@ -1235,7 +1235,7 @@ async function sshConnect(client, args) {
|
|
|
1235
1235
|
process.exit(0);
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
|
-
//
|
|
1238
|
+
// ../src/cli-onboard.ts
|
|
1239
1239
|
var SKILLS_CLI = "skills@1.7.2";
|
|
1240
1240
|
var READY_MS = 3 * 60 * 1e3;
|
|
1241
1241
|
var PLAN_MS = 15 * 60 * 1e3;
|
|
@@ -1632,7 +1632,7 @@ async function onboard(base, options) {
|
|
|
1632
1632
|
nextSteps(term, [[`agental ssh ${sandbox.id}`, "back in"], stopLine]);
|
|
1633
1633
|
}
|
|
1634
1634
|
|
|
1635
|
-
//
|
|
1635
|
+
// ../src/cli-teams.ts
|
|
1636
1636
|
var ORG_USAGE = "org takes list, use <organization> or create <name>. agental help shows each.";
|
|
1637
1637
|
var MEMBERS_USAGE = "members takes list, or remove <member> [--revoke-keys]. agental help shows each.";
|
|
1638
1638
|
var ROLES = ["member", "admin"];
|
|
@@ -1810,7 +1810,7 @@ async function invite(client, positionals, options) {
|
|
|
1810
1810
|
);
|
|
1811
1811
|
}
|
|
1812
1812
|
|
|
1813
|
-
//
|
|
1813
|
+
// ../src/cli-schedules.ts
|
|
1814
1814
|
var USAGE3 = "schedule takes add, show, runs, run, pause, resume, update or delete. agental help shows each.";
|
|
1815
1815
|
var OVERLAPS = ["skip", "replace", "parallel"];
|
|
1816
1816
|
async function ask5(client, method, pathname, body) {
|
|
@@ -2054,7 +2054,7 @@ async function schedule(client, positionals, options) {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
2056
|
|
|
2057
|
-
//
|
|
2057
|
+
// ../src/event-kinds.ts
|
|
2058
2058
|
var LIFECYCLE_EVENTS = [
|
|
2059
2059
|
"sandbox.created",
|
|
2060
2060
|
"sandbox.started",
|
|
@@ -2075,7 +2075,7 @@ var TEMPLATE_EVENTS = ["template.created", "template.updated", "template.secrets
|
|
|
2075
2075
|
var WEBHOOK_KINDS = [...WEBHOOK_EVENTS, ...EMAIL_EVENTS, ...MEMBER_EVENTS, ...TEMPLATE_EVENTS];
|
|
2076
2076
|
var WEBHOOK_RETRY_AFTER_MS = [6e4, 5 * 6e4, 15 * 6e4, 60 * 6e4, 3 * 36e5, 6 * 36e5, 12 * 36e5];
|
|
2077
2077
|
|
|
2078
|
-
//
|
|
2078
|
+
// ../src/cli-webhooks.ts
|
|
2079
2079
|
var USAGE4 = "webhook takes add, show, update, rotate or delete. agental help shows each.";
|
|
2080
2080
|
var EVERY = "*";
|
|
2081
2081
|
var TRIES = WEBHOOK_RETRY_AFTER_MS.length + 1;
|
|
@@ -2319,7 +2319,7 @@ function needId(id, what) {
|
|
|
2319
2319
|
// left-out:cli-dev-key
|
|
2320
2320
|
var DEV_KEY = null;
|
|
2321
2321
|
|
|
2322
|
-
//
|
|
2322
|
+
// ../src/domain.ts
|
|
2323
2323
|
var MACHINE_SIZES = {
|
|
2324
2324
|
tiny: { vcpu: 1, memoryMb: 2048, diskGb: 20 },
|
|
2325
2325
|
small: { vcpu: 2, memoryMb: 4096, diskGb: 40 },
|
|
@@ -2354,15 +2354,15 @@ function isMachineSize(value) {
|
|
|
2354
2354
|
return Object.hasOwn(MACHINE_SIZES, value);
|
|
2355
2355
|
}
|
|
2356
2356
|
|
|
2357
|
-
//
|
|
2357
|
+
// ../src/ssh-keys.ts
|
|
2358
2358
|
var KEY_TYPE = /^(ssh-(ed25519|rsa|dss)|ecdsa-sha2-nistp(256|384|521)|sk-ssh-ed25519(@openssh\.com)?|sk-ecdsa-sha2-nistp256(@openssh\.com)?)$/;
|
|
2359
2359
|
var SSH_PUBLIC_KEY = new RegExp(`^${KEY_TYPE.source.slice(1, -1)} [A-Za-z0-9+/]+={0,3}(?: .*)?$`);
|
|
2360
2360
|
|
|
2361
|
-
//
|
|
2361
|
+
// ../src/metrics-terms.ts
|
|
2362
2362
|
var METRICS_KEPT_DAYS = 15;
|
|
2363
2363
|
var METRICS_STEP_SECONDS = 60;
|
|
2364
2364
|
|
|
2365
|
-
//
|
|
2365
|
+
// ../src/plans.ts
|
|
2366
2366
|
var MICROS_PER_DOLLAR = 1e6;
|
|
2367
2367
|
function plan(id, dollarsPerMonth, sizes, runningUnits, freeBurstUnits) {
|
|
2368
2368
|
return { id, dollarsPerMonth, includedMicros: dollarsPerMonth * MICROS_PER_DOLLAR, sizes, runningUnits, freeBurstUnits };
|
|
@@ -2394,7 +2394,7 @@ function topUpByDollars(dollars) {
|
|
|
2394
2394
|
}
|
|
2395
2395
|
var TOP_UPS = [20, 50, 100, 250, 500, 1e3, 5e3, 1e4].map((dollars) => topUpByDollars(dollars));
|
|
2396
2396
|
|
|
2397
|
-
//
|
|
2397
|
+
// ../src/cli.ts
|
|
2398
2398
|
var DEFAULT_URL = DEFAULT_API_URL;
|
|
2399
2399
|
var SSH_COMMANDS = {
|
|
2400
2400
|
ssh,
|
package/package.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "agental
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The agental command: Linux sandboxes for your agents, from the terminal. npx agental@latest signs you in and installs the agent skills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "VERTIXER LTD",
|
|
7
|
-
"homepage": "https://agental.io",
|
|
7
|
+
"homepage": "https://agental.io/docs/cli",
|
|
8
8
|
"bugs": {
|
|
9
|
-
"
|
|
10
|
-
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/agental-io/agental-typescript.git"
|
|
9
|
+
"email": "squad@agental.io"
|
|
14
10
|
},
|
|
15
11
|
"type": "module",
|
|
16
12
|
"engines": {
|
|
@@ -19,27 +15,16 @@
|
|
|
19
15
|
"bin": {
|
|
20
16
|
"agental": "bin/agental.js"
|
|
21
17
|
},
|
|
22
|
-
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"types": "./dist/index.d.ts",
|
|
25
|
-
"default": "./dist/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./package.json": "./package.json"
|
|
28
|
-
},
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
18
|
"files": [
|
|
31
19
|
"bin",
|
|
32
20
|
"dist",
|
|
33
21
|
"README.md",
|
|
34
22
|
"LICENSE"
|
|
35
23
|
],
|
|
36
|
-
"sideEffects": false,
|
|
37
24
|
"scripts": {
|
|
38
|
-
"build": "
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"typecheck": "tsc --noEmit",
|
|
42
|
-
"prepublishOnly": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npm run build && npm run build:cli"
|
|
25
|
+
"build": "node scripts/bundle-cli.mjs",
|
|
26
|
+
"test": "node --test test/*.test.mjs",
|
|
27
|
+
"prepublishOnly": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && npm run build"
|
|
43
28
|
},
|
|
44
29
|
"keywords": [
|
|
45
30
|
"agental",
|
|
@@ -50,9 +35,6 @@
|
|
|
50
35
|
"virtual-machine"
|
|
51
36
|
],
|
|
52
37
|
"devDependencies": {
|
|
53
|
-
"
|
|
54
|
-
"esbuild": "0.28.2",
|
|
55
|
-
"tsx": "^4.23.15",
|
|
56
|
-
"typescript": "^5.9.3"
|
|
38
|
+
"esbuild": "0.28.2"
|
|
57
39
|
}
|
|
58
40
|
}
|
package/dist/client.d.ts
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { Http, type AgentalOptions } from "./http.js";
|
|
2
|
-
import { Email, Sandbox, type CreateOptions } from "./sandbox.js";
|
|
3
|
-
import { Templates } from "./template.js";
|
|
4
|
-
import type { AccountEmail, AccountExport, ApiKey, ApiKeyUsage, Billing, Burst, Catalog, HostRoute, Invite, Me, Member, Organization, Region, AutoReload, Checkout, DataRetention, CreateApiKey, CreatedApiKey, MetricsAtMoment, Policy, Prices, RunningOverTime, Size, Snapshot, Team, TeamRole, Telemetry, TelemetryTest, RunsOnRepository, RunsOnRepositories, Usage, Webhook } from "./types.js";
|
|
5
|
-
declare class Sandboxes {
|
|
6
|
-
private readonly http;
|
|
7
|
-
constructor(http: Http);
|
|
8
|
-
/**
|
|
9
|
-
* Makes a sandbox and waits until it is running. If the create fails part way or its
|
|
10
|
-
* answer is lost, it is sent again with the same key, which gives the same machine back
|
|
11
|
-
* and never a second one. What it paid in burst fees is in the sandbox's burstFeeMicros.
|
|
12
|
-
*/
|
|
13
|
-
create(options?: CreateOptions): Promise<Sandbox>;
|
|
14
|
-
/** One of your sandboxes, by its id. */
|
|
15
|
-
get(id: string): Promise<Sandbox>;
|
|
16
|
-
/**
|
|
17
|
-
* Your sandboxes, stopped ones included. Given a tag, or several, only those with every
|
|
18
|
-
* one of them; given metadata, only those with each key at that value. A template's
|
|
19
|
-
* tags and metadata count.
|
|
20
|
-
*/
|
|
21
|
-
list(filter?: {
|
|
22
|
-
tag?: string | string[];
|
|
23
|
-
metadata?: Record<string, string>;
|
|
24
|
-
}): Promise<Sandbox[]>;
|
|
25
|
-
/**
|
|
26
|
-
* The mail of one sandbox, by the sandbox's id, without reading the sandbox. It asks
|
|
27
|
-
* nothing by itself. It is the way in for a key made with only email.read and
|
|
28
|
-
* email.send on this sandbox, which may read and send its mail and is refused
|
|
29
|
-
* everything else, get(id) included.
|
|
30
|
-
*/
|
|
31
|
-
email(id: string): Email;
|
|
32
|
-
}
|
|
33
|
-
declare class Snapshots {
|
|
34
|
-
private readonly http;
|
|
35
|
-
constructor(http: Http);
|
|
36
|
-
/** Every snapshot you have, those of sandboxes since deleted included. */
|
|
37
|
-
list(): Promise<Snapshot[]>;
|
|
38
|
-
get(id: string): Promise<Snapshot>;
|
|
39
|
-
delete(id: string): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Your API keys. A key may do what it was made to do and nothing else, and a key used to
|
|
43
|
-
* make one makes only a weaker one. Using any of these takes a key with key.manage.
|
|
44
|
-
*/
|
|
45
|
-
declare class ApiKeys {
|
|
46
|
-
private readonly http;
|
|
47
|
-
constructor(http: Http);
|
|
48
|
-
/** Every key of the account, oldest first. Their secrets are never given. */
|
|
49
|
-
list(): Promise<ApiKey[]>;
|
|
50
|
-
get(id: string): Promise<ApiKey>;
|
|
51
|
-
/**
|
|
52
|
-
* Makes a key with a preset, or with the actions named, and limited by the rest: to some
|
|
53
|
-
* sandboxes and templates, until expiresAt, and to the addresses in allowFrom. The
|
|
54
|
-
* answer holds secret, the one time it is given. It is sent once, so a lost answer is
|
|
55
|
-
* not sent again.
|
|
56
|
-
*/
|
|
57
|
-
create(key: CreateApiKey): Promise<CreatedApiKey>;
|
|
58
|
-
/**
|
|
59
|
-
* Replaces the addresses and ranges a key may be used from, from its next request. It is
|
|
60
|
-
* the one thing about a key that changes after it is made. An empty list is anywhere.
|
|
61
|
-
*/
|
|
62
|
-
setAllowFrom(id: string, allowFrom: string[]): Promise<ApiKey>;
|
|
63
|
-
/** Deletes a key. Whatever holds it is refused from its next request, and the sandboxes it made stay the account's. */
|
|
64
|
-
delete(id: string): Promise<void>;
|
|
65
|
-
/** How long the sandboxes a key made ran, and what that comes to at the list price. Without since, everything they ever ran. */
|
|
66
|
-
usage(id: string, window?: {
|
|
67
|
-
since?: string | Date;
|
|
68
|
-
until?: string | Date;
|
|
69
|
-
}): Promise<ApiKeyUsage>;
|
|
70
|
-
private path;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* The organizations the key's person is in, and the team the key acts in. A key acts in the
|
|
74
|
-
* organization it was made in, for good: its person's own or a team. What a key may do of a
|
|
75
|
-
* team's is held by its actions, members.read and members.admin (or account.read and
|
|
76
|
-
* account.admin), and by its person's role in the team.
|
|
77
|
-
*/
|
|
78
|
-
declare class Organizations {
|
|
79
|
-
private readonly http;
|
|
80
|
-
constructor(http: Http);
|
|
81
|
-
/** Every organization the key's person is in, with their role in each, their own first. */
|
|
82
|
-
list(): Promise<Organization[]>;
|
|
83
|
-
/** The one the key acts in. */
|
|
84
|
-
current(): Promise<Organization>;
|
|
85
|
-
/**
|
|
86
|
-
* Makes a team, with the key's person as its owner. The key goes on acting where it was made:
|
|
87
|
-
* a key for the team is made in the console, or with the CLI's agental org use.
|
|
88
|
-
*/
|
|
89
|
-
createTeam(name: string): Promise<Team>;
|
|
90
|
-
/** Renames a team. Only an owner does. */
|
|
91
|
-
rename(id: string, name: string): Promise<Team>;
|
|
92
|
-
/** A team's members, the earliest first. Every member reads them. */
|
|
93
|
-
members(id: string): Promise<Member[]>;
|
|
94
|
-
/** Changes a member's role: an owner any, an admin up to admin and never an owner's. */
|
|
95
|
-
setRole(id: string, userId: string, role: TeamRole): Promise<TeamRole>;
|
|
96
|
-
/**
|
|
97
|
-
* Removes a member, or the key's person themself. The keys they made in the team go on
|
|
98
|
-
* working, as a member's, unless revokeKeys revokes them in the same request.
|
|
99
|
-
*/
|
|
100
|
-
removeMember(id: string, userId: string, options?: {
|
|
101
|
-
revokeKeys?: boolean;
|
|
102
|
-
}): Promise<{
|
|
103
|
-
revokedKeys: number;
|
|
104
|
-
}>;
|
|
105
|
-
/** The invites of the team the key acts in, for its owners and admins. */
|
|
106
|
-
invites(): Promise<Invite[]>;
|
|
107
|
-
/** Invites an email address to the team the key acts in, as a member or an admin. The team's plan has to allow members. */
|
|
108
|
-
invite(email: string, options?: {
|
|
109
|
-
role?: "member" | "admin";
|
|
110
|
-
}): Promise<Invite>;
|
|
111
|
-
/** Revokes an open invite: its link answers 410 from then on. */
|
|
112
|
-
revokeInvite(inviteId: string): Promise<void>;
|
|
113
|
-
private path;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The agental API.
|
|
117
|
-
*
|
|
118
|
-
* ```ts
|
|
119
|
-
* const agental = new Agental(); // reads AGENTAL_API_KEY
|
|
120
|
-
* const sandbox = await agental.sandboxes.create();
|
|
121
|
-
* const { stdout } = await sandbox.exec("uname -a");
|
|
122
|
-
* await sandbox.delete();
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
export declare class Agental {
|
|
126
|
-
readonly sandboxes: Sandboxes;
|
|
127
|
-
readonly snapshots: Snapshots;
|
|
128
|
-
/** What sandboxes are made as and held to: a start, the variables and files every sandbox on one gets, and what it may reach. */
|
|
129
|
-
readonly templates: Templates;
|
|
130
|
-
/** The account's API keys: what each may do, which sandboxes and templates it reaches, until when, and from where. */
|
|
131
|
-
readonly apiKeys: ApiKeys;
|
|
132
|
-
/** The organizations the key's person is in, and the members and invites of a team. */
|
|
133
|
-
readonly organizations: Organizations;
|
|
134
|
-
private readonly http;
|
|
135
|
-
constructor(options?: AgentalOptions);
|
|
136
|
-
/** The regions sandboxes can be made in now, the default first, with the sizes each has room for. */
|
|
137
|
-
regions(): Promise<Region[]>;
|
|
138
|
-
/** Who the key belongs to: the account's id, name and address, its role, and whether it is closed. */
|
|
139
|
-
me(): Promise<Me>;
|
|
140
|
-
/** Every port given an address, across the account's sandboxes that the key reaches. A sandbox's own are in its routes(). */
|
|
141
|
-
hostRoutes(): Promise<HostRoute[]>;
|
|
142
|
-
/** Hides a port's address: it answers not found from then on. There is no undoing it; give the port an address again instead. */
|
|
143
|
-
hideHostRoute(routeId: string): Promise<HostRoute>;
|
|
144
|
-
/** The sizes on offer, and how much room there is. */
|
|
145
|
-
limits(): Promise<Catalog>;
|
|
146
|
-
/** What applies to every account here: how many sandboxes, how long one runs, whether ports get public addresses. */
|
|
147
|
-
policy(): Promise<Policy>;
|
|
148
|
-
/**
|
|
149
|
-
* What is sold: the list price an hour of each size, the monthly plans, the top-ups offered
|
|
150
|
-
* with what each adds, the range a top-up may be and its bonus, and the free month. It needs
|
|
151
|
-
* no key.
|
|
152
|
-
*/
|
|
153
|
-
prices(): Promise<Prices>;
|
|
154
|
-
/**
|
|
155
|
-
* Where the account stands: its plan, in its free month or not, what it has used this month at list price,
|
|
156
|
-
* what is left of its top-ups, and whether it may run a sandbox. Amounts are millionths of a US dollar.
|
|
157
|
-
*/
|
|
158
|
-
billing(): Promise<Billing>;
|
|
159
|
-
/**
|
|
160
|
-
* Starts a purchase and gives the address of the payment page, for a person to open: a
|
|
161
|
-
* plan, or a top-up of credits that do not expire, any whole number of US dollars
|
|
162
|
-
* from 15 to 100,000. From $200 a top-up adds a bonus, 2% there and growing to 25% at
|
|
163
|
-
* $10,000: $500 adds $537. prices() says what each adds.
|
|
164
|
-
* An account that already has a plan and asks for another is moved to it at once: url is
|
|
165
|
-
* null and changed is true. Nothing is charged until the person pays.
|
|
166
|
-
*/
|
|
167
|
-
checkout(purchase: {
|
|
168
|
-
plan: "plan20" | "plan100" | "plan500" | "plan2000";
|
|
169
|
-
} | {
|
|
170
|
-
topUp: number;
|
|
171
|
-
}): Promise<Checkout>;
|
|
172
|
-
/**
|
|
173
|
-
* Sets the auto-reload, or turns it off with null: when the month's credits and the top-ups run
|
|
174
|
-
* out, the card saved at the last purchase is charged for a top-up of this many US dollars, with
|
|
175
|
-
* tax, and its credits are added at once, before any sandbox is stopped. At most three times a
|
|
176
|
-
* day, and not again for a day after a card that would not pay. It needs a plan or a top-up
|
|
177
|
-
* bought first, which saves the card: billing().canAutoReload says whether it can be set.
|
|
178
|
-
*/
|
|
179
|
-
setAutoReload(dollars: number | null): Promise<AutoReload>;
|
|
180
|
-
/** The account's mail: the handle every address of its sandboxes carries, what its plan allows, and what it has had of that today. */
|
|
181
|
-
email(): Promise<AccountEmail>;
|
|
182
|
-
/**
|
|
183
|
-
* Where your account stands against its plan: how many small sandboxes it runs and may run
|
|
184
|
-
* at once (runningUnits; a tiny counts half, a medium 2, a large 4), what its burst meter
|
|
185
|
-
* reads against the free burst, what it has spent on burst fees this month against its
|
|
186
|
-
* budget, and what one sandbox of each size would cost to start now. With a size, and a
|
|
187
|
-
* count, quote says what starting that many now would cost.
|
|
188
|
-
*
|
|
189
|
-
* Where `enforced` is true, a create, fork or start past the running count throws an
|
|
190
|
-
* `ApiError` 429 `running_limit_reached`; one faster than the free burst costs a burst fee,
|
|
191
|
-
* and is refused with `burst_budget_reached` past the monthly budget or
|
|
192
|
-
* `burst_in_free_month` in the free month. Amounts are millionths of a US dollar.
|
|
193
|
-
*/
|
|
194
|
-
burst(quote?: {
|
|
195
|
-
size: Size;
|
|
196
|
-
count?: number;
|
|
197
|
-
}): Promise<Burst>;
|
|
198
|
-
/**
|
|
199
|
-
* Sets the most the account spends on burst fees in a month, in millionths of a US dollar:
|
|
200
|
-
* 0 refuses every start that would cost one. null gives it the default again,
|
|
201
|
-
* defaultBudgetMicros. It answers with the account's burst as it stands now.
|
|
202
|
-
*/
|
|
203
|
-
setBurstBudget(budgetMicros: number | null): Promise<Burst>;
|
|
204
|
-
/**
|
|
205
|
-
* Running time and what it comes to at the list price, by sandbox, by key, by day and by hour, and the mail of the same
|
|
206
|
-
* window. With apiKeyId, one key or several, only the sandboxes those keys made, "console" standing for those made in
|
|
207
|
-
* the console: the keys stay the whole account's.
|
|
208
|
-
*/
|
|
209
|
-
usage(options?: {
|
|
210
|
-
since?: string | Date;
|
|
211
|
-
until?: string | Date;
|
|
212
|
-
apiKeyId?: string | string[];
|
|
213
|
-
}): Promise<Usage>;
|
|
214
|
-
/**
|
|
215
|
-
* What each of your sandboxes read at one moment: now, unless at says another. A sandbox
|
|
216
|
-
* that was stopped then has a null reading, and so has one on a server that did not
|
|
217
|
-
* answer, which complete says. Only where policy() says metrics.
|
|
218
|
-
*/
|
|
219
|
-
metrics(moment?: {
|
|
220
|
-
at?: string | Date;
|
|
221
|
-
}): Promise<MetricsAtMoment>;
|
|
222
|
-
/**
|
|
223
|
-
* How many of your sandboxes were running at each step between two moments. Without
|
|
224
|
-
* since, the last 24 hours. It is counted from the record of what ran, so it answers
|
|
225
|
-
* wherever sandboxes run, and a sandbox deleted since is still counted.
|
|
226
|
-
*/
|
|
227
|
-
runningOverTime(window?: {
|
|
228
|
-
since?: string | Date;
|
|
229
|
-
until?: string | Date;
|
|
230
|
-
stepSeconds?: number;
|
|
231
|
-
}): Promise<RunningOverTime>;
|
|
232
|
-
/**
|
|
233
|
-
* The OTLP/HTTP collector your sandboxes' metrics and lifecycle events are sent to, with
|
|
234
|
-
* the names of its headers and how the last export went. Null when none is set. Only
|
|
235
|
-
* where policy() says telemetry.
|
|
236
|
-
*/
|
|
237
|
-
getTelemetry(): Promise<Telemetry | null>;
|
|
238
|
-
/**
|
|
239
|
-
* Sets the collector your sandboxes' metrics and lifecycle events are sent to, in place of
|
|
240
|
-
* the one set before. endpoint is its base address, https on port 443 or 4318. headers are
|
|
241
|
-
* sent with each export, such as the collector's API key, and their values are never
|
|
242
|
-
* shown again. Nothing is sent now: testTelemetry() does that. From the next whole minute
|
|
243
|
-
* it is sent the metrics every minute, and each event as it happens.
|
|
244
|
-
*/
|
|
245
|
-
setTelemetry(collector: {
|
|
246
|
-
endpoint: string;
|
|
247
|
-
headers?: Record<string, string>;
|
|
248
|
-
}): Promise<Telemetry>;
|
|
249
|
-
/**
|
|
250
|
-
* Sends your collector one empty export, with its headers, and says what it answered. ok
|
|
251
|
-
* is false when it refused, did not answer in 10 seconds, or is at an address that is not
|
|
252
|
-
* sent to. Nothing else is changed.
|
|
253
|
-
*/
|
|
254
|
-
testTelemetry(): Promise<TelemetryTest>;
|
|
255
|
-
/** Removes your collector, with its headers, and nothing more is sent to it. When none is set it throws an ApiError with the status 404. */
|
|
256
|
-
deleteTelemetry(): Promise<void>;
|
|
257
|
-
/**
|
|
258
|
-
* GitHub Actions jobs on sandboxes: each repository's pool, how many sandboxes of each size it
|
|
259
|
-
* keeps and the template they are made on. available is false where jobs do not run on
|
|
260
|
-
* sandboxes here. GitHub itself is connected in the console.
|
|
261
|
-
*/
|
|
262
|
-
runsOnRepositories(): Promise<RunsOnRepositories>;
|
|
263
|
-
/**
|
|
264
|
-
* Sets a repository's pool, given as owner/name: poolMax, 1 to 50 sandboxes of each size, and
|
|
265
|
-
* templateId, one of your templates, each null for the default and left out to keep what was set.
|
|
266
|
-
* The template is used only where GitHub says the repository is private and runs no workflows
|
|
267
|
-
* from fork pull requests.
|
|
268
|
-
*/
|
|
269
|
-
setRunsOnRepository(repository: string, settings: {
|
|
270
|
-
poolMax?: number | null;
|
|
271
|
-
templateId?: string | null;
|
|
272
|
-
}): Promise<RunsOnRepository>;
|
|
273
|
-
/** Puts a repository's pool back to the defaults. Its sandboxes are kept. When it has no settings it throws an ApiError with the status 404. */
|
|
274
|
-
resetRunsOnRepository(repository: string): Promise<void>;
|
|
275
|
-
/**
|
|
276
|
-
* How long your sandboxes' history is kept: the output of their commands, their agent
|
|
277
|
-
* conversations and their events. keepDays is 1, 7, 30 or 90, or null to keep it until the
|
|
278
|
-
* sandbox is deleted; 30 until you choose. retained lists what is kept for periods agental sets.
|
|
279
|
-
*/
|
|
280
|
-
getDataRetention(): Promise<DataRetention>;
|
|
281
|
-
/**
|
|
282
|
-
* Sets how long your sandboxes' history is kept: 1, 7, 30 or 90 days, or null until the
|
|
283
|
-
* sandbox is deleted. History older than that is deleted within the hour and cannot be
|
|
284
|
-
* brought back. A deleted sandbox's history is deleted with it, whatever is set, its events a day later.
|
|
285
|
-
*/
|
|
286
|
-
setDataRetention(keepDays: 1 | 7 | 30 | 90 | null): Promise<DataRetention>;
|
|
287
|
-
/** The webhooks your account's events are posted to, each with its tries of the last 30 days. Their secrets are not given. */
|
|
288
|
-
listWebhooks(): Promise<Webhook[]>;
|
|
289
|
-
/**
|
|
290
|
-
* Adds a webhook. url is posted each event it takes, and has to be on the public internet.
|
|
291
|
-
* events names the kinds it takes, such as sandbox.stopped, or "*" for every one and any
|
|
292
|
-
* added later, which is what it takes when events is left out. The answer holds
|
|
293
|
-
* signingSecret, the one time it is given: each post's X-Agental-Signature is checked
|
|
294
|
-
* against it with verifyWebhook. It is sent once, so a lost answer is not sent again.
|
|
295
|
-
*/
|
|
296
|
-
createWebhook(webhook: {
|
|
297
|
-
url: string;
|
|
298
|
-
events?: string[];
|
|
299
|
-
description?: string;
|
|
300
|
-
}): Promise<Webhook>;
|
|
301
|
-
/** One webhook, with every try of the last 30 days: the status each was answered, the event it was a try of, and which try. */
|
|
302
|
-
getWebhook(id: string): Promise<Webhook>;
|
|
303
|
-
/** Changes a webhook's url, events or description, and keeps what is left out. A changed url is used from the next try on. */
|
|
304
|
-
updateWebhook(id: string, changes: {
|
|
305
|
-
url?: string;
|
|
306
|
-
events?: string[];
|
|
307
|
-
description?: string;
|
|
308
|
-
}): Promise<Webhook>;
|
|
309
|
-
/** Gives a webhook a new signing secret, in its signingSecret, once. The old one stops working at once. */
|
|
310
|
-
rotateWebhookSecret(id: string): Promise<Webhook>;
|
|
311
|
-
/** Deletes a webhook, the events still owed to it, and its tries. */
|
|
312
|
-
deleteWebhook(id: string): Promise<void>;
|
|
313
|
-
/**
|
|
314
|
-
* Everything agental keeps about your account and the person behind it: the account, its
|
|
315
|
-
* sessions with the address and browser each began from, its keys by name, billing,
|
|
316
|
-
* payments, usage, and what it has made. Secrets are named, never given. Closing an
|
|
317
|
-
* account is not here: only a person signed in to the console can close one.
|
|
318
|
-
*/
|
|
319
|
-
exportAccount(): Promise<AccountExport>;
|
|
320
|
-
}
|
|
321
|
-
export {};
|