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

Compare

+15 −1 in 5 places
Lines 20–26 at 318 (were 20–25 at 285)
2020 SyncAnswer,
2121} from "./api-answers.ts";
2222import { ApiError, errorSentence, neverSent } from "./api-error.ts";
23+import { UsageError } from "./args.ts";
2324import type { AutosettleAnswer, AutosettleMode } from "./autosettle-commands.ts";
2425import {
2526 boxQuery,
Lines 69–75 at 318 (were 68–73 at 285)
6869 IssueRow,
6970 IssueSearchHit,
7071} from "./issues-wire.ts";
72+import { isLocal, LOCAL_BASE, localFetch, NO_STORE } from "./local-store.ts";
7173import type { Modes } from "./modes.ts";
7274
7375export * from "./api-answers.ts";
Lines 193–205 at 318 (were 191–199 at 285)
191193 caller: string | undefined;
192194
193195 url(path: string, server = this.config.server): string {
194− return `${server.replace(/\/+$/, "")}/p/${encodeURIComponent(this.config.project)}${path}`;
196+ const base = isLocal(server) ? LOCAL_BASE : server;
197+ return `${base.replace(/\/+$/, "")}/p/${encodeURIComponent(this.config.project)}${path}`;
195198 }
196199
200+ /** A local project's calls: answered in this process (local-store.ts). */
201+ private local: ((input: string, init?: RequestInit) => Promise<Response>) | undefined;
197203 agentPath(action: string): string {
198204 return `/a/${encodeURIComponent(this.config.agent)}/${action}`;
199205 }
Lines 220–231 at 318 (were 214–219 at 285)
214220 * and follows no redirect, so nothing it sends goes anywhere it didn't name (headers() adds no sign-in).
215221 */
216222 send(url: string, init: RequestInit = {}): Promise<Response> {
223+ if (isLocal(this.config.server)) {
224+ const dir = this.config.localStore;
225+ if (dir === undefined) return Promise.reject(new UsageError(NO_STORE));
226+ this.local ??= localFetch(dir);
227+ return this.local(url, init);
228+ }
217229 if (!this.config.visitor) return fetch(url, init);
218230 if ((init.method ?? "GET") !== "GET")
219231 return Promise.reject(new ApiError("a folder that reads signed out sends only reads"));
Lines 260–267 at 318 (were 248–253 at 285)
248260 signal: AbortSignal.timeout(timeoutMs),
249261 });
250262 } catch (err) {
263+ // A local project's refusal (no store, a Node without SQLite) says itself.
264+ if (err instanceof UsageError) throw err;
251265 const e = err as Error;
252266 const why =
253267 e.name === "TimeoutError"
MCP
compare on this site's /mcp
CLI
abso diff 285 318 client/src/api.ts --json
JSON
/christopher/abso-core/compare/285..318?file=client%2Fsrc%2Fapi.ts&format=json