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 175 to 318

Compare

+22 −10 in 4 places
Lines 1–12 at 318 (were 1–11 at 175)
11// Organizations from the CLI: abso orgs and abso org <name>. They read as the
2−// person who approved this box's sign-in (abso login). Changing an org (new,
3−// invite, role, remove, leave, settings) and making a project in one are done on
4−// the website for now: a box sits where agents run, and its sign-in was given
5−// for project work, so the server takes only reads from it.
2+// person who approved this box's sign-in (abso login). abso org new makes one, and
3+// abso init --org makes a project in one, from a box approved for all its
4+// person's projects (abso 663). Changing an org (invite, role, remove, leave,
5+// settings) stays on the website: a box sits where agents run, so the server takes
6+// no other org change from it.
67
7−import { type Parsed, UsageError } from "./args.ts";
8−import { type Answer, boxGet, originOf, readBox } from "./box.ts";
8+import { type Parsed, str, UsageError } from "./args.ts";
9+import { type Answer, boxCreateOrg, boxGet, originOf, readBox } from "./box.ts";
910import type { Output } from "./commands.ts";
1011
1112/** The website for an API server: api.<site> serves <site>; any other server serves its own pages. */
Lines 31–37 at 318 (were 30–36 at 175)
3031];
3132
3233const WEBSITE_ONLY =
33− "Organizations are changed on the website for now; from the CLI they can only be read, as the person who approved this box's sign-in";
34+ "Organizations are changed on the website; from the CLI they can be read, and made with abso org new, as the person who approved this box's sign-in";
3435
3536/** Where the box's sign-in is read from and how the server is reached; tests pass their own. */
3637export interface OrgIo {
Lines 115–132 at 318 (were 114–120 at 175)
114115 const asked = CHANGES.filter((c) => args.flags.has(c.flag));
115116 if (first === "new") {
116117 if (second === undefined || more.length > 0) throw new UsageError('abso org new <name> [--name "<shown name>"]');
117− throw new UsageError(`${WEBSITE_ONLY}. Make ${second} at ${siteOf(server)}/orgs/new.`);
118+ if (asked.length > 0) throw new UsageError("abso org new takes --name only");
119+ const record = io.home === undefined ? readBox(server) : readBox(server, io.home);
120+ if (!record)
121+ throw new UsageError(
122+ `this box isn't signed in to ${originOf(server)}. abso login signs it in; approve all your projects to make organizations from here`,
123+ );
124+ const made = await boxCreateOrg(record, second, str(args, "name"), io.fetch);
125+ const name = typeof made.name === "string" ? made.name : second;
126+ return {
127+ text: `Made the organization ${name}; you own it. Its page: ${siteOf(server)}/${name}. abso init --org ${name} --project <name> makes a project in it.`,
128+ json: { org: made },
129+ };
118130 }
119131 if (first === undefined || second !== undefined)
120132 throw new UsageError("abso org <name> [one change], or abso org new <name>");
Lines 178–186 at 318 (were 166–174 at 175)
166178 return { text: lines.join("\n"), json: { org } };
167179}
168180
169−/** abso init --org: making a project in an org is a website step for now. */
181+/** abso init --org with no box signed in to the server: an org's project is made as the person who approved one (abso 663). */
170182export function initInOrg(org: string, server: string): never {
171183 throw new UsageError(
172− `projects in an organization are made on the website for now: New project at ${siteOf(server)}, with ${org} as its owner.`,
184+ `this box isn't signed in to ${originOf(server)}, and a project in ${org} is made as a signed-in person. abso login, approving all your projects, then abso init --org ${org} again; or New project at ${siteOf(server)}.`,
173185 );
174186}
MCP
compare on this site's /mcp
CLI
abso diff 175 318 client/src/orgs.ts --json
JSON
/christopher/abso-core/compare/175..318?file=client%2Fsrc%2Forgs.ts&format=json