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

+21 −1 in 2 places
Lines 2–32 at 318 (were 2–12 at 175)
22import { StoredText } from "../../src/engine/stored-text.ts";
33import { eachCodeLine } from "./names.ts";
44
5+/**
6+ * Characters of parsed code kept in memory before the rest goes to scratch (abso Capacity). The visible lines it is
7+ * parsed from are already in memory, so this at most doubles a file's text for the call; at 64 KB, every large file's
8+ * code went row by row into scratch and back, 25,000 rows each for abso's index.ts, a third of a cold collisions call.
9+ */
10+export const DEFINITION_CODE_IN_MEMORY = 4_000_000;
12+let inMemoryLimit = DEFINITION_CODE_IN_MEMORY;
14+/**
15+ * Tests only: the in-memory limit for every later call, so a small file takes the scratch path (abso's kept-reader
16+ * test checks scratch is let go). Answers the limit it replaces, to put back.
17+ */
18+export function setDefinitionCodeInMemory(limit: number): number {
19+ const before = inMemoryLimit;
20+ inMemoryLimit = limit;
21+ return before;
22+}
524/** Parsed code is temporary derived data, discarded with the scratch transaction. */
625export function withDefinitionCode<T>(
726 view: ReadView,
827 visible: readonly VisibleLine[],
928 operation: (code: readonly string[]) => T,
29+ inMemory = inMemoryLimit,
1030): T {
1131 function* source() {
1232 for (const line of visible) yield line.text;
Lines 36–42 at 318 (were 16–22 at 175)
1636 let prefix: string[] = [];
1737 let size = 0;
1838 let pending = iterator.next();
19− while (!pending.done && size + pending.value.length + 1 <= 65536) {
39+ while (!pending.done && size + pending.value.length + 1 <= inMemory) {
2040 prefix.push(pending.value);
2141 size += pending.value.length + 1;
2242 pending = iterator.next();
MCP
compare on this site's /mcp
CLI
abso diff 175 318 worker/project/definition-code.ts --json
JSON
/christopher/abso-core/compare/175..318?file=worker%2Fproject%2Fdefinition-code.ts&format=json