agental 0.56.0 → 0.59.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/dist/cli.js +198 -17
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7411,7 +7411,7 @@ import { parseArgs } from "node:util";
|
|
|
7411
7411
|
|
|
7412
7412
|
// ../src/cli-build.ts
|
|
7413
7413
|
var PUBLISHED = true;
|
|
7414
|
-
var CLI_VERSION = true ? "0.
|
|
7414
|
+
var CLI_VERSION = true ? "0.59.0" : "dev";
|
|
7415
7415
|
var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
|
|
7416
7416
|
var PACKAGE_NAME = "agental";
|
|
7417
7417
|
var USER_AGENT = `agental-cli/${CLI_VERSION}`;
|
|
@@ -9614,12 +9614,18 @@ var COMMANDS = [
|
|
|
9614
9614
|
"agental guild attach <guild> <template> [--roles <role,...>] | detach <guild> <template>",
|
|
9615
9615
|
"agental guild mine",
|
|
9616
9616
|
"agental guild join <guild> --as <name> --role <role> [--answer <key=value>]...",
|
|
9617
|
-
"agental guild members <guild> | leave <guild> <identity> | handover <guild> <identity> <sandbox>"
|
|
9617
|
+
"agental guild members <guild> | leave <guild> <identity> | handover <guild> <identity> <sandbox>",
|
|
9618
|
+
"agental guild post <guild> <text> [--as <identity>] [--to <identity,...> | --to-role <role>] [--request] [--answers <request>]",
|
|
9619
|
+
"agental guild read <guild> [--as <identity>] [--wait-seconds <n>] [--done]",
|
|
9620
|
+
"agental guild requests <guild> | claim <guild> <request> | answer <guild> <request> <text> | close <guild> <request>",
|
|
9621
|
+
"agental guild notes <guild> [<identity>] [--text <notes>] | pause <guild> | resume <guild>"
|
|
9618
9622
|
],
|
|
9619
9623
|
examples: [
|
|
9620
9624
|
'agental guild create marketing --roles "blog manager:1,reviewer:2" --brief "Reviewers answer pass or fail."',
|
|
9621
9625
|
"agental guild attach marketing writers",
|
|
9622
|
-
"agental guild join marketing --as Atlas --role reviewer --answer model=claude"
|
|
9626
|
+
"agental guild join marketing --as Atlas --role reviewer --answer model=claude",
|
|
9627
|
+
'agental guild post marketing "Review a1b2c3, please." --to-role reviewer --request',
|
|
9628
|
+
"agental guild read marketing --wait-seconds 30 --done"
|
|
9623
9629
|
],
|
|
9624
9630
|
flags: [
|
|
9625
9631
|
["--roles <name[:seats],...>", "create: the roles, each with its seats; attach: the roles its sandboxes may take"],
|
|
@@ -9628,7 +9634,15 @@ var COMMANDS = [
|
|
|
9628
9634
|
["--as <name>", "join: the name you will be known by in the guild"],
|
|
9629
9635
|
["--role <role>", "join: one of the guild's roles with a free seat"],
|
|
9630
9636
|
["--answer <key=value>", "join: an answer to the guild's form (may be given again)"],
|
|
9631
|
-
["--yes", "delete: without asking"]
|
|
9637
|
+
["--yes", "delete: without asking"],
|
|
9638
|
+
["--to <identity,...>", "post: the identities it is for, by name or ID"],
|
|
9639
|
+
["--to-role <role>", "post: the role it is for"],
|
|
9640
|
+
["--request", "post: a request, open until answered"],
|
|
9641
|
+
["--answers <request>", "post: the request this answers and closes"],
|
|
9642
|
+
["--channel <name>", "post, read: the channel; general by default"],
|
|
9643
|
+
["--wait-seconds <n>", "read: wait up to n seconds (at most 30) for a message"],
|
|
9644
|
+
["--done", "read: confirm you are done with what was read, so the next read starts after it"],
|
|
9645
|
+
["--text <notes>", "notes: overwrite the identity's notes with this"]
|
|
9632
9646
|
]
|
|
9633
9647
|
},
|
|
9634
9648
|
{
|
|
@@ -9776,6 +9790,7 @@ var COMMANDS = [
|
|
|
9776
9790
|
["--json", "print the API's answer as JSON"]
|
|
9777
9791
|
]
|
|
9778
9792
|
},
|
|
9793
|
+
{ name: "insights", summary: "See what needs your attention now, and where to put it right: a CI pool too small, a webhook failing, credits running low." },
|
|
9779
9794
|
{ name: "webhooks", summary: "List the addresses your account's events are sent to." },
|
|
9780
9795
|
{ name: "webhook", summary: "Add, change, turn off and remove the addresses your account's events are sent to.", examples: ["agental webhook add https://example.com/agental --all"] },
|
|
9781
9796
|
{ name: "servers", summary: "List your organization's own servers, and say whether new sandboxes go to agental's when they are full.", examples: ["agental servers", "agental servers offload on --over 80"] },
|
|
@@ -10159,7 +10174,7 @@ var SUBCOMMANDS = {
|
|
|
10159
10174
|
limits: ["budget"],
|
|
10160
10175
|
egress: ["budget", "use-case"],
|
|
10161
10176
|
tailscale: ["status", "connect", "disconnect"],
|
|
10162
|
-
guild: ["list", "show", "create", "delete", "attach", "detach", "mine", "join", "members", "leave", "handover"],
|
|
10177
|
+
guild: ["list", "show", "create", "delete", "attach", "detach", "mine", "join", "members", "leave", "handover", "post", "read", "requests", "claim", "answer", "close", "notes", "pause", "resume"],
|
|
10163
10178
|
subscriptions: ["list", "sign-in", "delete"],
|
|
10164
10179
|
telemetry: ["set", "test", "unset"],
|
|
10165
10180
|
ci: ["jobs", "set", "reset"],
|
|
@@ -12694,6 +12709,31 @@ async function readings(client, found, options) {
|
|
|
12694
12709
|
}
|
|
12695
12710
|
}
|
|
12696
12711
|
|
|
12712
|
+
// ../src/cli-insights.ts
|
|
12713
|
+
var AREAS = { ci_runners: "CI runners", webhooks: "Webhooks", billing: "Billing" };
|
|
12714
|
+
async function listInsights(client, asJson) {
|
|
12715
|
+
const response = await client.request("/v1/insights", { method: "GET" });
|
|
12716
|
+
const body = await response.json().catch(() => null);
|
|
12717
|
+
if (!response.ok) {
|
|
12718
|
+
client.fail(response.status, body);
|
|
12719
|
+
}
|
|
12720
|
+
if (asJson) {
|
|
12721
|
+
process.stdout.write(`${JSON.stringify(body, null, 2)}
|
|
12722
|
+
`);
|
|
12723
|
+
return;
|
|
12724
|
+
}
|
|
12725
|
+
const insights = Array.isArray(body?.insights) ? body.insights : [];
|
|
12726
|
+
if (insights.length === 0) {
|
|
12727
|
+
process.stdout.write("Nothing needs your attention.\n");
|
|
12728
|
+
return;
|
|
12729
|
+
}
|
|
12730
|
+
const blocks = insights.map(
|
|
12731
|
+
(insight) => [`\u25CF ${AREAS[insight.area] ?? insight.area} \xB7 ${insight.subject.name}`, ` ${insight.title}`, ` ${insight.detail}`, ` ${insight.action.label}: ${insight.action.url}`].join("\n")
|
|
12732
|
+
);
|
|
12733
|
+
process.stdout.write(`${blocks.join("\n\n")}
|
|
12734
|
+
`);
|
|
12735
|
+
}
|
|
12736
|
+
|
|
12697
12737
|
// ../src/event-kinds.ts
|
|
12698
12738
|
var LIFECYCLE_EVENTS = [
|
|
12699
12739
|
"sandbox.created",
|
|
@@ -12724,7 +12764,8 @@ var HEADROOM_EVENTS = [
|
|
|
12724
12764
|
];
|
|
12725
12765
|
var JOB_EVENTS = ["job.created", "job.updated", "job.deleted", "job.run_started", "job.run_finished", "job.run_failed", "job.recovered", "job.paused"];
|
|
12726
12766
|
var TAILSCALE_EVENTS = ["tailscale.node_down", "tailscale.disconnected"];
|
|
12727
|
-
var
|
|
12767
|
+
var GUILD_EVENTS = ["guild.message", "guild.request_open", "guild.member_joined", "guild.member_left", "guild.paused", "guild.resumed"];
|
|
12768
|
+
var WEBHOOK_KINDS = [...WEBHOOK_EVENTS, ...EMAIL_EVENTS, ...MEMBER_EVENTS, ...TEMPLATE_EVENTS, ...HEADROOM_EVENTS, ...JOB_EVENTS, ...TAILSCALE_EVENTS, ...GUILD_EVENTS];
|
|
12728
12769
|
var WEBHOOK_GROUPS = [...new Set(WEBHOOK_KINDS.map((kind) => kind.slice(0, kind.indexOf("."))))];
|
|
12729
12770
|
function closestEvent(asked2) {
|
|
12730
12771
|
if (asked2.length > 64) {
|
|
@@ -13881,7 +13922,7 @@ function createTailnet(given, flags2 = {}) {
|
|
|
13881
13922
|
|
|
13882
13923
|
// ../src/cli-guilds.ts
|
|
13883
13924
|
import { readFileSync as readFileSync7 } from "node:fs";
|
|
13884
|
-
var USAGE9 = "guild takes list, show
|
|
13925
|
+
var USAGE9 = "guild takes list, show, create, delete, attach, detach, mine, join, members, leave, handover, post, read, requests, claim, answer, close, notes, pause or resume. agental guild --help shows each.";
|
|
13885
13926
|
async function ask11(client, method, pathname, body) {
|
|
13886
13927
|
const response = await client.request(pathname, { method, ...body === void 0 ? {} : { body: JSON.stringify(body) } });
|
|
13887
13928
|
let answered = null;
|
|
@@ -13949,6 +13990,30 @@ function memberLine(member) {
|
|
|
13949
13990
|
return `${member.id} ${member.name}, ${member.role}, ${held}
|
|
13950
13991
|
`;
|
|
13951
13992
|
}
|
|
13993
|
+
async function actingAs(client, guild2, given) {
|
|
13994
|
+
if (given !== void 0) {
|
|
13995
|
+
return await memberNamed2(client, guild2, given);
|
|
13996
|
+
}
|
|
13997
|
+
const answer6 = await client.request("/v1/guilds/mine", { method: "GET" });
|
|
13998
|
+
const mine = answer6.ok ? (await answer6.json())["guilds"] ?? [] : [];
|
|
13999
|
+
const held = mine.filter((one) => one["guild"]["name"] === guild2).flatMap((one) => one["held"]);
|
|
14000
|
+
if (held.length === 1) {
|
|
14001
|
+
return held[0] ?? null;
|
|
14002
|
+
}
|
|
14003
|
+
if (held.length > 1) {
|
|
14004
|
+
throw new Error(`You hold ${held.length} identities in ${guild2}: say which with --as ${held.map((member) => member.name).join(" | ")}.`);
|
|
14005
|
+
}
|
|
14006
|
+
return null;
|
|
14007
|
+
}
|
|
14008
|
+
function messageLine(message) {
|
|
14009
|
+
const to = message.toRole ? ` to ${message.toRole}` : message.to ? ` to ${message.to.length} identit${message.to.length === 1 ? "y" : "ies"}` : "";
|
|
14010
|
+
const what = message.kind === "request" ? ` request ${message.id}${message.request?.open ? message.request.claimedBy ? ", taken" : ", open" : `, ${message.request?.closedReason ?? "closed"}`}` : message.kind === "answer" ? ` answer to ${message.answers ?? ""}` : "";
|
|
14011
|
+
return `#${message.seq} ${message.from.name}${to}${what}: ${message.text}
|
|
14012
|
+
`;
|
|
14013
|
+
}
|
|
14014
|
+
function channelOf(options) {
|
|
14015
|
+
return encodeURIComponent((options.channel ?? "general").replace(/^#/, ""));
|
|
14016
|
+
}
|
|
13952
14017
|
async function memberNamed2(client, guild2, given) {
|
|
13953
14018
|
const members2 = (await ask11(client, "GET", `${at4(guild2)}/members`))["members"] ?? [];
|
|
13954
14019
|
const found = members2.find((member) => member.id === given) ?? members2.find((member) => member.name.toLowerCase() === given.toLowerCase());
|
|
@@ -14068,6 +14133,94 @@ ${held}`;
|
|
|
14068
14133
|
const sandbox = await ask11(client, "GET", `/v1/sandboxes/${encodeURIComponent(needed(fourth, "handover takes a sandbox"))}`);
|
|
14069
14134
|
const handed = await ask11(client, "POST", `${at4(guildName)}/members/${encodeURIComponent(member.id)}/handover`, { sandboxId: String(sandbox["id"]) });
|
|
14070
14135
|
print4(options.json, handed, `${member.name} is held by ${String(sandbox["name"] ?? sandbox["id"])} now.
|
|
14136
|
+
`);
|
|
14137
|
+
return;
|
|
14138
|
+
}
|
|
14139
|
+
case "post": {
|
|
14140
|
+
const guildName = needed(name, "post takes a guild and the text");
|
|
14141
|
+
const text = needed(positionals.slice(2).join(" ") || options.text, "post takes the text, after the guild");
|
|
14142
|
+
const as = await actingAs(client, guildName, options.as);
|
|
14143
|
+
const members2 = options.to === void 0 ? [] : (await ask11(client, "GET", `${at4(guildName)}/members`))["members"] ?? [];
|
|
14144
|
+
const to = options.to?.split(",").map((one) => one.trim()).filter((one) => one !== "").map((one) => (members2.find((member) => member.id === one || member.name.toLowerCase() === one.toLowerCase()) ?? { id: one }).id);
|
|
14145
|
+
const posted = await ask11(client, "POST", `${at4(guildName)}/channels/${channelOf(options)}/messages`, {
|
|
14146
|
+
text,
|
|
14147
|
+
...as === null ? {} : { as: as.id },
|
|
14148
|
+
...to === void 0 ? {} : { to },
|
|
14149
|
+
...options.toRole === void 0 ? {} : { toRole: options.toRole },
|
|
14150
|
+
...options.request ? { request: true } : {},
|
|
14151
|
+
...options.answers === void 0 ? {} : { answers: options.answers },
|
|
14152
|
+
...options.retryKey === void 0 ? {} : { retryKey: options.retryKey }
|
|
14153
|
+
});
|
|
14154
|
+
print4(options.json, posted, messageLine(posted));
|
|
14155
|
+
return;
|
|
14156
|
+
}
|
|
14157
|
+
case "answer": {
|
|
14158
|
+
const guildName = needed(name, "answer takes a guild, a request and the text");
|
|
14159
|
+
await guild(client, ["post", guildName, ...positionals.slice(3)], { ...options, answers: needed(third, "answer takes the request's ID") });
|
|
14160
|
+
return;
|
|
14161
|
+
}
|
|
14162
|
+
case "read": {
|
|
14163
|
+
const guildName = needed(name, "read takes a guild");
|
|
14164
|
+
const as = await actingAs(client, guildName, options.as);
|
|
14165
|
+
const query = new URLSearchParams({
|
|
14166
|
+
...as === null ? {} : { as: as.id },
|
|
14167
|
+
...options.after === void 0 ? {} : { after: options.after },
|
|
14168
|
+
...options.waitSeconds === void 0 ? {} : { wait: options.waitSeconds }
|
|
14169
|
+
});
|
|
14170
|
+
const read2 = await ask11(client, "GET", `${at4(guildName)}/channels/${channelOf(options)}/messages?${query.toString()}`);
|
|
14171
|
+
const messages = read2["messages"] ?? [];
|
|
14172
|
+
const last = messages.at(-1);
|
|
14173
|
+
if (options.done && as !== null && last !== void 0) {
|
|
14174
|
+
await ask11(client, "POST", `${at4(guildName)}/channels/${channelOf(options)}/place`, { as: as.id, upTo: last.seq });
|
|
14175
|
+
}
|
|
14176
|
+
print4(options.json, read2, messages.map(messageLine).join("") || "No new messages.\n");
|
|
14177
|
+
return;
|
|
14178
|
+
}
|
|
14179
|
+
case "requests": {
|
|
14180
|
+
const guildName = needed(name, "requests takes a guild");
|
|
14181
|
+
const as = await actingAs(client, guildName, options.as);
|
|
14182
|
+
const found = await ask11(client, "GET", `${at4(guildName)}/requests${as === null ? "" : `?as=${encodeURIComponent(as.id)}`}`);
|
|
14183
|
+
const section = (title, list6) => list6.length ? `${title}
|
|
14184
|
+
${list6.map((one) => ` ${messageLine(one)}`).join("")}` : "";
|
|
14185
|
+
print4(options.json, found, section("you owe", found["owed"]) + section("you wait on", found["waiting"]) + section("open", found["open"]) || "No open requests.\n");
|
|
14186
|
+
return;
|
|
14187
|
+
}
|
|
14188
|
+
case "claim": {
|
|
14189
|
+
const guildName = needed(name, "claim takes a guild and a request");
|
|
14190
|
+
const as = await actingAs(client, guildName, options.as);
|
|
14191
|
+
if (as === null) {
|
|
14192
|
+
throw new Error(`claim takes the identity you hold in ${guildName}: --as <identity>.`);
|
|
14193
|
+
}
|
|
14194
|
+
const claimed = await ask11(client, "POST", `${at4(guildName)}/requests/${encodeURIComponent(needed(third, "claim takes the request's ID"))}/claim`, { as: as.id });
|
|
14195
|
+
print4(options.json, claimed, `${as.name} took request ${claimed.id} for 30 minutes. Answer it with agental guild answer ${guildName} ${claimed.id} <text>.
|
|
14196
|
+
`);
|
|
14197
|
+
return;
|
|
14198
|
+
}
|
|
14199
|
+
case "close": {
|
|
14200
|
+
const guildName = needed(name, "close takes a guild and a request");
|
|
14201
|
+
const as = await actingAs(client, guildName, options.as);
|
|
14202
|
+
const closed = await ask11(client, "POST", `${at4(guildName)}/requests/${encodeURIComponent(needed(third, "close takes the request's ID"))}/close`, as === null ? {} : { as: as.id });
|
|
14203
|
+
print4(options.json, closed, `Request ${closed.id} is closed (${closed.request?.closedReason ?? "closed"}).
|
|
14204
|
+
`);
|
|
14205
|
+
return;
|
|
14206
|
+
}
|
|
14207
|
+
case "notes": {
|
|
14208
|
+
const guildName = needed(name, "notes takes a guild");
|
|
14209
|
+
const member = third === void 0 ? await actingAs(client, guildName, options.as) : await memberNamed2(client, guildName, third);
|
|
14210
|
+
if (member === null) {
|
|
14211
|
+
throw new Error(`notes takes an identity: agental guild notes ${guildName} <identity>.`);
|
|
14212
|
+
}
|
|
14213
|
+
const path6 = `${at4(guildName)}/members/${encodeURIComponent(member.id)}/notes`;
|
|
14214
|
+
const notes = options.text === void 0 ? await ask11(client, "GET", path6) : await ask11(client, "PUT", path6, { text: options.text });
|
|
14215
|
+
print4(options.json, notes, `${String(notes["text"]) || `${member.name} has no notes yet.`}
|
|
14216
|
+
`);
|
|
14217
|
+
return;
|
|
14218
|
+
}
|
|
14219
|
+
case "pause":
|
|
14220
|
+
case "resume": {
|
|
14221
|
+
const found = await ask11(client, "POST", `${at4(needed(name, `${verb} takes a guild`))}/${verb}`);
|
|
14222
|
+
print4(options.json, found, verb === "pause" ? `${String(name)}'s agents are paused until you resume them.
|
|
14223
|
+
` : `${String(name)}'s agents may post again.
|
|
14071
14224
|
`);
|
|
14072
14225
|
return;
|
|
14073
14226
|
}
|
|
@@ -15466,6 +15619,14 @@ async function main() {
|
|
|
15466
15619
|
form: { type: "string" },
|
|
15467
15620
|
as: { type: "string" },
|
|
15468
15621
|
answer: { type: "string", multiple: true },
|
|
15622
|
+
// Guild messages: a role it is to, a request, the request it answers, the channel, a retry key, where to read from, and a place confirmed.
|
|
15623
|
+
"to-role": { type: "string" },
|
|
15624
|
+
request: { type: "boolean" },
|
|
15625
|
+
answers: { type: "string" },
|
|
15626
|
+
channel: { type: "string" },
|
|
15627
|
+
"retry-key": { type: "string" },
|
|
15628
|
+
after: { type: "string" },
|
|
15629
|
+
done: { type: "boolean" },
|
|
15469
15630
|
"revoke-keys": { type: "boolean", default: false },
|
|
15470
15631
|
// agental list in a terminal: every column, as piped.
|
|
15471
15632
|
wide: { type: "boolean", default: false },
|
|
@@ -15633,7 +15794,17 @@ async function main() {
|
|
|
15633
15794
|
...values.brief === void 0 ? {} : { brief: values.brief },
|
|
15634
15795
|
...values.form === void 0 ? {} : { form: values.form },
|
|
15635
15796
|
...values.as === void 0 ? {} : { as: values.as },
|
|
15636
|
-
...values.answer === void 0 ? {} : { answer: values.answer }
|
|
15797
|
+
...values.answer === void 0 ? {} : { answer: values.answer },
|
|
15798
|
+
...values.to === void 0 ? {} : { to: values.to },
|
|
15799
|
+
...values["to-role"] === void 0 ? {} : { toRole: values["to-role"] },
|
|
15800
|
+
...values.request === void 0 ? {} : { request: values.request },
|
|
15801
|
+
...values.answers === void 0 ? {} : { answers: values.answers },
|
|
15802
|
+
...values.channel === void 0 ? {} : { channel: values.channel },
|
|
15803
|
+
...values["retry-key"] === void 0 ? {} : { retryKey: values["retry-key"] },
|
|
15804
|
+
...values["wait-seconds"] === void 0 ? {} : { waitSeconds: values["wait-seconds"] },
|
|
15805
|
+
...values.after === void 0 ? {} : { after: values.after },
|
|
15806
|
+
...values.done === void 0 ? {} : { done: values.done },
|
|
15807
|
+
...values.text === void 0 ? {} : { text: values.text }
|
|
15637
15808
|
}
|
|
15638
15809
|
);
|
|
15639
15810
|
return;
|
|
@@ -15673,7 +15844,7 @@ async function main() {
|
|
|
15673
15844
|
await telemetry(positionals.slice(1), values.header, values.json);
|
|
15674
15845
|
return;
|
|
15675
15846
|
case "ci":
|
|
15676
|
-
await ci(positionals.slice(1), { pool: values.pool, template: once(values.template, "--template"), limit: values.limit, json: values.json });
|
|
15847
|
+
await ci(positionals.slice(1), { pool: values.pool, template: once(values.template, "--template"), size: values.size, limit: values.limit, json: values.json });
|
|
15677
15848
|
return;
|
|
15678
15849
|
case "data-retention":
|
|
15679
15850
|
await dataRetention(positionals.slice(1), values.json);
|
|
@@ -15696,6 +15867,9 @@ async function main() {
|
|
|
15696
15867
|
await command2({ request, fail }, positionals.slice(1, positionals.length - (argv?.length ?? 0)), argv, values);
|
|
15697
15868
|
return;
|
|
15698
15869
|
}
|
|
15870
|
+
case "insights":
|
|
15871
|
+
await listInsights({ request, fail }, values.json === true);
|
|
15872
|
+
return;
|
|
15699
15873
|
case "webhooks":
|
|
15700
15874
|
await listWebhooks({ request, fail }, values.json);
|
|
15701
15875
|
return;
|
|
@@ -17582,12 +17756,12 @@ async function dataRetention(positionals, asJson) {
|
|
|
17582
17756
|
}
|
|
17583
17757
|
async function ci(positionals, options) {
|
|
17584
17758
|
const [what, repo, ...rest] = positionals;
|
|
17585
|
-
const usage = "ci takes nothing, jobs [<owner/repo>] [--limit <n>], set <owner/repo> [--pool <n> | --pool default] [--template <template> | --template default], or reset <owner/repo>";
|
|
17759
|
+
const usage = "ci takes nothing, jobs [<owner/repo>] [--limit <n>], set <owner/repo> [--size tiny|small|medium|large | --size default] [--pool <n> | --pool default] [--template <template> | --template default], or reset <owner/repo>";
|
|
17586
17760
|
if (rest.length > 0 || what === void 0 && repo !== void 0 || what !== void 0 && what !== "set" && what !== "reset" && what !== "jobs") {
|
|
17587
17761
|
throw new Error(usage);
|
|
17588
17762
|
}
|
|
17589
|
-
if (what !== "set" && (options.pool !== void 0 || options.template !== void 0)) {
|
|
17590
|
-
throw new Error("--pool and --template are for ci set.");
|
|
17763
|
+
if (what !== "set" && (options.pool !== void 0 || options.template !== void 0 || options.size !== void 0)) {
|
|
17764
|
+
throw new Error("--size, --pool and --template are for ci set.");
|
|
17591
17765
|
}
|
|
17592
17766
|
if (what !== "jobs" && options.limit !== void 0) {
|
|
17593
17767
|
throw new Error("--limit is for ci jobs.");
|
|
@@ -17657,21 +17831,28 @@ async function ci(positionals, options) {
|
|
|
17657
17831
|
let poolMax = before?.poolMax ?? null;
|
|
17658
17832
|
if (options.pool !== void 0) {
|
|
17659
17833
|
poolMax = options.pool === "default" ? null : Number(options.pool);
|
|
17660
|
-
if (poolMax !== null && (!Number.isInteger(poolMax) || poolMax < 1 || poolMax >
|
|
17661
|
-
throw new Error("--pool is 1 to
|
|
17834
|
+
if (poolMax !== null && (!Number.isInteger(poolMax) || poolMax < 1 || poolMax > 100)) {
|
|
17835
|
+
throw new Error("--pool is 1 to 100 sandboxes of each size, or default.");
|
|
17836
|
+
}
|
|
17837
|
+
}
|
|
17838
|
+
let size2;
|
|
17839
|
+
if (options.size !== void 0) {
|
|
17840
|
+
size2 = options.size === "default" ? null : options.size;
|
|
17841
|
+
if (size2 !== null && !["tiny", "small", "medium", "large"].includes(size2)) {
|
|
17842
|
+
throw new Error("--size is tiny, small, medium or large, or default.");
|
|
17662
17843
|
}
|
|
17663
17844
|
}
|
|
17664
17845
|
let templateId = before?.templateId ?? null;
|
|
17665
17846
|
if (options.template !== void 0) {
|
|
17666
17847
|
templateId = options.template === "default" ? null : (await templateNamed(options.template)).id;
|
|
17667
17848
|
}
|
|
17668
|
-
const saved = await asked(path6, { method: "PUT", body: JSON.stringify({ poolMax, templateId }) });
|
|
17849
|
+
const saved = await asked(path6, { method: "PUT", body: JSON.stringify({ poolMax, templateId, ...size2 === void 0 ? {} : { size: size2 } }) });
|
|
17669
17850
|
if (options.json) {
|
|
17670
17851
|
process.stdout.write(`${JSON.stringify(saved, null, 2)}
|
|
17671
17852
|
`);
|
|
17672
17853
|
return;
|
|
17673
17854
|
}
|
|
17674
|
-
process.stdout.write(`${repo}: pool ${poolMax ?? "default"}, template ${templateId ?? "runs-on (empty)"}. Sandboxes made from now on take it; a fork's job always gets the empty template.
|
|
17855
|
+
process.stdout.write(`${repo}: runs-on: agental is ${saved.size ?? "medium"}${saved.sizeSet ? "" : " (default)"}, pool ${poolMax ?? "default"}, template ${templateId ?? "runs-on (empty)"}. Sandboxes made from now on take it; a fork's job always gets the empty template.
|
|
17675
17856
|
`);
|
|
17676
17857
|
}
|
|
17677
17858
|
function ciWaitWords(reason2) {
|
|
@@ -18717,7 +18898,7 @@ Usage
|
|
|
18717
18898
|
agental metrics <sandbox-id> [--since <date-time>] [--until <date-time>] [--step <seconds>] [--json]
|
|
18718
18899
|
agental metrics --running [--since <date-time>] [--until <date-time>] [--step <seconds>] [--json]
|
|
18719
18900
|
agental telemetry [set <endpoint> [-H <name>=<value>]... | test | unset] [--json]
|
|
18720
|
-
agental ci [jobs [<owner/repo>] [--limit <n>] | set <owner/repo> [--pool <n> | --pool default] [--template <template> | --template default] | reset <owner/repo>] [--json]
|
|
18901
|
+
agental ci [jobs [<owner/repo>] [--limit <n>] | set <owner/repo> [--size tiny|small|medium|large | --size default] [--pool <n> | --pool default] [--template <template> | --template default] | reset <owner/repo>] [--json]
|
|
18721
18902
|
agental data-retention [1 | 7 | 30 | 90 | never] [--json]
|
|
18722
18903
|
agental jobs [--sandbox <sandbox-id> | --template <template>] [--json]
|
|
18723
18904
|
agental job add [<name>] --sandbox <sandbox-id> [--every 1m|15m|1h|1d | --cron "<m h dom mon dow>" [--tz <zone>] | --at <date-time>] [--timeout <time>]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
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",
|