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 28 to 29

Compare

+23 −0 in 1 place
Lines 517–545 at 29 (were 517–522 at 28)
517517 return this.url(`/attachments/${id}`, this.issuesServer);
518518 }
519519
520+ /** An attachment's bytes, or with `source` the svg it was drawn from; refused past `max` bytes. */
521+ async attachmentBytes(id: string, source: boolean, max: number): Promise<Uint8Array> {
522+ if (this.issuesServer === undefined)
523+ throw new ApiError(`${this.config.server} has no Issues Worker beside it; ABSO_ISSUES_SERVER names one`);
524+ const url = `${this.attachmentUrl(id)}${source ? "/source" : ""}`;
525+ let res: Response;
526+ try {
527+ res = await fetch(url, {
528+ headers: this.headers(),
529+ signal: AbortSignal.timeout(Math.max(this.timeoutMs, 120_000)),
530+ });
531+ } catch (err) {
532+ const e = err as Error;
533+ throw new ApiError(
534+ `could not reach ${this.issuesServer}: ${(e.cause as Error | undefined)?.message ?? e.message}`,
535+ );
536+ }
537+ if (!res.ok) throw new ApiError(`${url} answered ${res.status}: ${errorSentence(await res.text())}`, res.status);
538+ const bytes = new Uint8Array(await res.arrayBuffer());
539+ if (bytes.length > max) throw new ApiError(`${url} sent ${bytes.length} bytes, more than an attachment may be`);
540+ return bytes;
541+ }
520543 /** An edit (abso issue 3): it tells the issue's watchers, and `also`, unless `notify` is false. null clears a parent or Agent. */
521544 issueEdit(
522545 id: number,
MCP
compare on this site's /mcp
CLI
abso diff 28 29 client/src/api.ts --json
JSON
/christopher/abso-core/compare/28..29?file=client%2Fsrc%2Fapi.ts&format=json