Versions 291 to 318
Lines 80–122 at 318 (were 80–85 at 291)
8282
90+
91+/** The stored pipeline runs, newest first, from the server's `pipelines` read; empty for anything else. */
105+
108+ const how = run.state === "planned" ? "was planned, not run," : run.state === "running" ? "is running" : run.state;
109+ return `Pipeline run ${run.id} (${run.file}) ${how} on version ${run.version}. abso pipeline runs ${run.id} shows its jobs.`;
111+
113+ * Whether the built-in check (abso.json's setup, build and check) had nothing of its own to run. With stored runs, that is
114+ * about the built-in check, not the project's CI, so it isn't said as the project's (abso 719).
119+
83120/** A shared version's mark in abso log; "not checked" says nothing, since most versions in a busy hour are covered by a newer one's job. */
Lines 180–199 at 318 (were 143–153 at 291)
145182 if (!/^\d+$/.test(typed)) throw new UsageError(`a version is a number (got ${JSON.stringify(typed)})`);
146− const job = await api.ci(Number(typed));
147− return { text: jobText(job).join("\n"), json: { ...job } };
183+ const [job, raw] = await Promise.all([api.ci(Number(typed)), api.pipelineRuns().catch(() => null)]);
185+ // A version the built-in check never ran, with a pipeline run of its own: the run is its CI (abso 719).
149− const [ci, status] = await Promise.all([api.ci(), api.status()]);
150− const lines = ciText(ci, status.version);
189+ const [ci, status, raw] = await Promise.all([api.ci(), api.status(), api.pipelineRuns().catch(() => null)]);
Lines 94–101 at 318 (were 94–99 at 291)
97+ /** For tests: the command stamped as HOOK_COMMAND, instead of this client's own `abso hook`. */
98100
Lines 134–148 at 318 (were 132–137 at 291)
134136
137+/** Whether the installed abso mod hands a local project's edits to abso hook: it was installed with a HOOK_COMMAND. */
138+export function modHandsLocal(env: Readonly<Record<string, string | undefined>> = process.env): boolean {
140+ return /HOOK_COMMAND[^=\n]*=\s*\[/.test(readFileSync(at(skillsFolder(AVCS_MOD.name, env), STAMP_FILE), "utf8"));
145+
136147 * After the new mod is in, the folder it replaces (skills/avcs, skills/avcs-view) would load beside it, so it
137148 * is moved, not deleted, to ~/.abso/retired-mods/<name>-<stamp>. Returns where it went, or undefined when there was none.
Lines 237–247 at 318 (were 226–233 at 291)
228239
229−/** The files to install, stamped with `version`, in install order. */
230−function filesFor(spec: ModSpec, version: string): Map<string, Buffer> {
240+/** The command that runs this checkout's `abso hook`: what the mod hands a local project's edits to. */
241+export const hookCommand = (): readonly string[] => [process.execPath, join(CLIENT_DIR, "abso.ts"), "hook"];
242+
243+/** The files to install, stamped with `version` (and HOOK_COMMAND, where a stamp.ts has it), in install order. */
244+function filesFor(spec: ModSpec, version: string, hook: readonly string[] = hookCommand()): Map<string, Buffer> {
231245 if (!/^[\w.+-]+$/.test(version)) throw new Error(`can't stamp the version ${JSON.stringify(version)}`);
Lines 253–261 at 318 (were 239–245 at 291)
241255 if (stamped === text) throw new Error(`${rel} has no "STAMP ... = undefined" line to stamp`);
242− data = Buffer.from(stamped);
257+ stamped.replace(/(HOOK_COMMAND[^=\n]*=\s*)undefined/, (_, head: string) => head + JSON.stringify(hook)),
Lines 402–408 at 318 (were 386–392 at 291)
389− const next = filesFor(spec, version);
Lines 28–34 at 318 (were 28–33 at 291)
3334
Lines 37–47 at 318 (were 36–41 at 291)
3637/** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */
3945 // An explicit --server goes to that server's own Issues Worker: ABSO_ISSUES_SERVER doesn't redirect it.
Lines 32–38 at 318 (were 32–38 at 291)
35−import { installerCommand, modInstalled } from "./install.ts";
Lines 154–164 at 318 (were 154–159 at 291)
157+ // Checked before any call: a name like ".." would otherwise go out as part of the request's path.
160+ `project names are letters, digits, dot, dash and underscore (got ${JSON.stringify(project)})`,
157162 if (bool(args, "public") && bool(args, "private")) throw new UsageError("--public or --private, not both");
159164 // A box signed in here, and no other credential asked for: the project is made as the person who approved the box,
Lines 543–556 at 318 (were 538–545 at 291)
539544
541− // The mod sends each edit to the folder's server itself, and a local project has none.
542− if (local) return "abso record sends the edits made here: the abso mod doesn't record local projects yet.";
546+ // A local project has no server: the mod hands its edits to abso hook, when it was installed with one to hand them to.
549+ return "Edits made by Claude Code here are recorded by the abso mod on this machine, through abso hook. Anything else: abso record.";
551+ return `abso record sends the edits made here: the abso mod on this machine is older than local projects. ${installerCommand("install-mod.ts")} updates it, and new chats load it.`;
544555 return "Edits made by Claude Code here are recorded by the abso mod on this machine, signed in as this folder. Anything else: abso record.";
Lines 1–5 at 318 (were 1–3 at 291)
22export declare function handle(request: Request, env: unknown, ctx: unknown, issues: unknown): Promise<Response>;
5+export declare function issuesFetch(request: Request, env: unknown, ctx: unknown, route: unknown): Promise<Response>;
Lines 1–7 at 318 (were 1–6 at 291)
1−// The open server's router and project object, for local projects (local-store.ts). Plain JS, with its types in
2−// local-server.d.mts, so the client's typecheck stops here: server/src is typechecked with the Workers' types
1+// The open server's router, project object and issues, for local projects (local-store.ts). Plain JS, with its types
2+// in local-server.d.mts, so the client's typecheck stops here: server/src is typechecked with the Workers' types
44
Lines 159–166 at 318 (were 159–165 at 291)
159159
162− const c = globalThis.crypto as unknown as { DigestStream?: unknown };
162+ // Through a cast: abso's worker compiles this file too (tool.lock.json), and its types have no globalThis.crypto.
Lines 190–197 at 318 (were 189–194 at 291)
190191 handle: (request: Request, env: unknown, ctx: unknown, issues: unknown) => Promise<Response>;
194+ issuesFetch: (request: Request, env: unknown, ctx: unknown, route: unknown) => Promise<Response>;
194197
Lines 243–255 at 318 (were 240–246 at 291)
240243 `local projects couldn't load the server's code: ${e instanceof Error ? e.message : String(e)}`,
243− return { DatabaseSync: sqlite.DatabaseSync, handle: loaded.handle, ProjectObject: loaded.ProjectObject };
Lines 265–274 at 318 (were 256–261 at 291)
257266 /** PRAGMA data_version when this process last used the project: it changes when another process writes. */
268+ /** The project's issues, asks and news: issues.sqlite beside it, opened when a call first reaches them. */
270+ /** The issues object for the call under way: made again for each call, as another process may have written. */
260273
261274/** Every store file this process has open: closed when its command ends (closeLocalStores). */
Lines 284–293 at 318 (were 271–278 at 291)
273286
274−const PROJECT_PATH = /^\/p\/([^/]+)\//;
275−const NAME = /^[A-Za-z0-9._-]{1,100}$/;
287+/** A project's calls, and its issues, asks and news, which the open server keeps at /issues/p/<project>/. */
289+/** A project's name is also its folder in the store, so it never starts with a dot ("." and ".." would leave it). */
277292
Lines 327–365 at 318 (were 312–321 at 291)
315− // Issues, asks and news aren't in local projects yet: a start note's issue hooks find nothing to call.
316− ISSUES_DO: { idFromName: (n: string) => n, get: () => ({}) },
338+ db.exec("PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 120000; PRAGMA synchronous = NORMAL");
318− return async (input, init = {}) => {
350+ // One call at a time, as a Durable Object takes them: a call holds its project's write transaction across awaits,
351+ // and the connection can't start a second (two calls at once come from Promise.all in ci and waiting --mine).
361+
Lines 373–382 at 318 (were 329–335 at 291)
376+ // Every call, issues ones too, holds the project file's lock, so local writers of the project and of its
334381 const version = (p.db.prepare("PRAGMA data_version").get() as { data_version: number }).data_version;
Lines 384–390 at 318 (were 337–343 at 291)
340− issuesNone,
343390 // The answer is read whole before the write is kept, so a body that fails to arrive keeps nothing either.
Lines 403–407 at 318 (were 356–362 at 291)
359− };
361−
362−const issuesNone = async () => json(404, { error: "issues, asks and news aren't in local projects yet" });
Lines 79–85 at 318 (were 79–84 at 291)
8283
Lines 213–244 at 318 (were 212–224 at 291)
217− "abso login [--no-browser] [--no-ask] [--projects <name,name>] [--role <reader|writer|owner>] [--days <1-90>]",
221+ "abso login [--no-browser] [--no-ask] [--projects <name,name>] [--role <reader|writer|owner>] [--days <1-90>] | abso login --web [--pat-file <file> [--site http://localhost:<port>]]",
219− "Sign this box in once: it opens the approve page in your browser with the code filled in, prints the link and the code too, and waits while a person approves the code on the website, choosing the projects, the highest role and how long. Then abso join in any of those projects gives each agent its own key, with no approval. The box's sign-in is kept in your user folder, never in a project folder, and is never printed. No browser opens with --no-browser or ABSO_NO_BROWSER, over SSH, under CI, or on Linux without a display. In an agent's folder on the same server, it also asks a person in that project to approve it (the person who approved the agent's box, else the project's owners), as an abso ask, so nobody has to relay the code; the box can then be granted that project at no more than the agent's own role. --no-ask shows the code only.",
223+ "Sign this box in once: it opens the approve page in your browser with the code filled in, prints the link and the code too, and waits while a person approves the code on the website, choosing the projects, the highest role and how long. Then abso join in any of those projects gives each agent its own key, with no approval. The box's sign-in is kept in your user folder, never in a project folder, and is never printed. No browser opens with --no-browser or ABSO_NO_BROWSER, over SSH, under CI, or on Linux without a display. In an agent's folder on the same server, it also asks a person in that project to approve it (the person who approved the agent's box, else the project's owners), as an abso ask, so nobody has to relay the code; the box can then be granted that project at no more than the agent's own role. --no-ask shows the code only. --web, on staging only, signs a browser in to the website instead: it prints a link that works once, within a minute, and signs whichever browser opens it in as the person who approved this box, but only to the projects the box was granted and at most as a writer, until the box is revoked or ends (or, with --pat-file, as the test account whose PAT that file holds, at most as a writer). It writes issues, replies, answers, groups and announcements, and changes no members, roles, visibility, keys, boxes or settings. The box's sign-in, the PAT and the session never appear. It goes only to the staging website beside this folder's staging server; any other server, prod included, is refused and nothing is sent. --site, with --pat-file only, points it at a website on this machine (http://localhost or 127.0.0.1).",
236+ throw new UsageError(`this box isn't signed in to ${server}: abso login first, or --pat-file <file>`);
Lines 135–144 at 318 (were 135–142 at 291)
136136 deps.note(`(abso news --follow: couldn't read the news: ${(err as Error).message}; showing the frames)`);
138− if (items.length > 0) for (const line of items) show(line);
139− else for (const line of these) if (!shown.includes(line)) show(line);
139+ // A frame the read didn't cover still shows: on a server that counts a frame as heard, its item never comes back
140+ // from the read. A catch-up frame names several items, so a frame holding a shown item counts as covered.
141+ for (const frame of these) if (!shown.some((line) => frame.includes(line) || line.includes(frame))) show(frame);
new file, 141 lines
1+// abso login --web: a staging website session for the person a box is signed in as, opened in an agent's own browser, with
2+// no secret in the agent's hands. The website's /login/handoff takes this box's sign-in (or a test account's PAT, from a file)
3+// and answers a one-use link that works for a minute; opening it signs that browser in. Only the link is printed: never the
5+
8+
9+/** The website beside each staging server. Prod has none here: agents never sign in to the website on prod. */
11+ "https://abso-staging.chrisazy.workers.dev": "https://abso-website-staging.chrisazy.workers.dev",
12+ "https://avcs-staging.chrisazy.workers.dev": "https://abso-website-staging.chrisazy.workers.dev",
14+
15+/** What the website answers: the link, when it stops working, and who and until when it signs in. */
23+
25+ * The website a handoff's credential goes to (Security condition 6, Code Review): the staging website beside the folder's own
26+ * staging server, from the fixed list above, and never an origin from a flag. A server that isn't on the list is refused,
27+ * prod included. --site is only for a test account's PAT on this machine (http://localhost or 127.0.0.1); a box's sign-in
35+ `abso login --web is for staging: ${origin} has no staging website beside it that abso knows, and agents never sign in to the website on prod. Nothing was sent.`,
39+ throw new UsageError(`--site isn't taken with a box's sign-in, which goes only to ${known}. Nothing was sent.`);
46+ if (url === null || url.protocol !== "http:" || (url.hostname !== "localhost" && url.hostname !== "127.0.0.1"))
48+ "--site, with --pat-file, names this machine only (http://localhost:<port> or http://127.0.0.1:<port>). Nothing was sent.",
52+
54+ * abso login --web: where the credential would go is settled before it is read, so a refusal reads and sends nothing
55+ * (Security). `credential` reads the box's sign-in or the PAT only once the website is one it may go to.
68+
81+
86+
87+/** Asks the website for a handoff link with `credential` (a box sign-in or a PAT) in Authorization. */
88+export async function webHandoff(site: string, credential: string, fetcher: typeof fetch = fetch): Promise<Handoff> {
98+ throw new UsageError(`couldn't reach ${site}: ${scrubbed((err as Error).message, credential)}`);
130+
131+/** What abso login --web says: the one link, how long it works, who it signs in as, and what it reaches (Security). */
135+ ? "only to the projects this box was granted, at most as a writer, until the box is revoked or ends"
138+ `Open this link in your browser within ${seconds} seconds. It signs that browser in to ${site} as ${h.name}, until ${h.sessionEnds}, and works once. It reaches ${reach}:`,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 291 318 client/src --json
- JSON
- /christopher/abso-core/compare/291..318?file=client%2Fsrc&format=json