Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 170 to 171

Compare

+7 −13 in 5 places
Lines 15–39 at 171 (were 15–39 at 170)
1515import { type Parsed, str, UsageError } from "./args.ts";
1616import { homeFile, homeWritePath, OLD_STATE_DIR, STATE_DIR } from "./state-dir.ts";
1717
18−/** What the person who approved the code allowed: each project with the highest role its agents get there, and how many agents. */
18+/**
19+ * What the person who approved the code allowed: each project with the highest role its agents get there. A box lets in any
20+ * number of agents (abso 642; Christopher, 2026-10-14, ask 1947); the server still records a max_agents it doesn't enforce.
21+ */
1922export interface Grant {
2023 readonly projects: readonly { readonly project: string; readonly role: string }[];
21− readonly max_agents: number;
2224}
2325
2426/** Requested access is a suggestion for the person approving, never an authorization. */
2527export interface LoginRequest {
2628 readonly projects?: readonly { readonly project: string; readonly role: "reader" | "writer" | "owner" }[];
27− readonly max_agents?: number;
2829 readonly days?: number;
2930}
3031
3132export function loginRequest(args: Parsed): LoginRequest | undefined {
3233 const projects = str(args, "projects");
3334 const role = str(args, "role");
34− const maxAgents = str(args, "max-agents");
3535 const days = str(args, "days");
36− if (projects === undefined && role === undefined && maxAgents === undefined && days === undefined) return undefined;
36+ if (projects === undefined && role === undefined && days === undefined) return undefined;
3737 if (role !== undefined && projects === undefined) throw new UsageError("--role needs --projects");
3838 const requestedRole = role ?? "writer";
3939 if (requestedRole !== "reader" && requestedRole !== "writer" && requestedRole !== "owner")
Lines 50–55 at 171 (were 50–56 at 170)
5050 };
5151 return {
5252 ...(names ? { projects: [...new Set(names)].map((project) => ({ project, role: requestedRole })) } : {}),
53− ...(maxAgents === undefined ? {} : { max_agents: integer(maxAgents, "max-agents", 50) }),
5453 ...(days === undefined ? {} : { days: integer(days, "days", 90) }),
5554 };
5655}
Lines 227–233 at 171 (were 228–235 at 170)
228227 typeof x === "object" &&
229228 x !== null &&
230229 Array.isArray(x.projects) &&
231− x.projects.every((p) => typeof p?.project === "string" && typeof p.role === "string") &&
232− typeof x.max_agents === "number"
230+ x.projects.every((p) => typeof p?.project === "string" && typeof p.role === "string")
233231 );
234232}
235233
Lines 348–353 at 171 (were 350–359 at 170)
350348 return { ...(await mintKey(record, project, agent, fetcher)), agent };
351349 } catch (err) {
352350 if (err instanceof UsageError && /refused \(409\): that agent name/.test(err.message)) continue;
353− if (err instanceof UsageError && /refused \(409\): this box is at its agent limit/.test(err.message))
354− throw new UsageError(
355− `this box is at its agent limit (${record.grant.max_agents}): abso box shows its grant, and an agent can be revoked on the website's Boxes page`,
356− );
357351 throw err;
358352 }
359353 }
Lines 377–383 at 171 (were 383–389 at 170)
383377 const expired = record.expiresAt <= now;
384378 return [
385379 `Signed in to ${record.server} as box ${record.id}${expired ? ", but the sign-in has expired. abso login renews it." : "."}`,
386− `Projects: ${g.projects.map((p) => `${p.project} (${p.role})`).join(", ")}. Up to ${g.max_agents} agents.`,
380+ `Projects: ${g.projects.map((p) => `${p.project} (${p.role})`).join(", ")}.`,
387381 `${expired ? "Expired" : "Expires"} ${day(record.expiresAt)} UTC.`,
388382 ].join("\n");
389383}
MCP
compare on this site's /mcp
CLI
abso diff 170 171 client/src/box.ts --json
JSON
/christopher/abso-core/compare/170..171?file=client%2Fsrc%2Fbox.ts&format=json