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 142 to 143

Compare

+9 −9 in 8 places
Lines 19–25 at 143 (were 19–25 at 142)
1919// A use means a definition only through an import of it, or in the file
2020// that defines it (project.ts, #definitionCore).
2121
22−import type { LineId, View } from "../../src/engine/index.ts";
22+import type { LineId, ReadView } from "../../src/engine/index.ts";
2323import { codeOfLines, holdsNoCode, isCommonName } from "./names.ts";
2424
2525export interface Definition {
Lines 90–102 at 143 (were 90–102 at 142)
9090const TOP_ASSIGN = new RegExp(`^(${NAME})\\s*(?::[^=]*)?=(?![=>])`);
9191const MAX_HEADER = 30;
9292
93−const cache = new WeakMap<View, Map<string, readonly Definition[]>>();
93+const cache = new WeakMap<ReadView, Map<string, readonly Definition[]>>();
9494
9595/**
9696 * Every definition in the view's code files (or only in `files`), by name.
9797 * Each file's definitions are cached per view.
9898 */
99−export function definitionsIn(view: View, files?: Iterable<string>): Map<string, Definition[]> {
99+export function definitionsIn(view: ReadView, files?: Iterable<string>): Map<string, Definition[]> {
100100 let perFile = cache.get(view);
101101 if (!perFile) {
102102 perFile = new Map();
Lines 118–124 at 143 (were 118–124 at 142)
118118 return out;
119119}
120120
121−function definitionsInFile(view: View, file: string, keepCommon = false): Definition[] {
121+function definitionsInFile(view: ReadView, file: string, keepCommon = false): Definition[] {
122122 if (holdsNoCode(file) || !view.hasFile(file)) return [];
123123 const out: Definition[] = [];
124124 const visible = view.lines(file);
Lines 149–155 at 143 (were 149–155 at 142)
149149 * included (two `parse` functions in a file are a mistake whatever the name).
150150 * Each spans its whole block, body and all, for showing to the agent.
151151 */
152−export function definedTwice(view: View, file: string): Map<string, Definition[]> {
152+export function definedTwice(view: ReadView, file: string): Map<string, Definition[]> {
153153 const out = new Map<string, Definition[]>();
154154 const all = definitionsInFile(view, file, true);
155155 const count = new Map<string, number>();
Lines 306–312 at 143 (were 306–312 at 142)
306306 return i + 1;
307307}
308308
309−const importCache = new WeakMap<View, Map<string, ReadonlyMap<string, string>>>();
309+const importCache = new WeakMap<ReadView, Map<string, ReadonlyMap<string, string>>>();
310310
311311/**
312312 * Names a file imports by name, and the project file each comes from, when
Lines 316–322 at 143 (were 316–322 at 142)
316316 * x.y import a, b`. Lets a use of a name be matched to the definition it
317317 * means instead of every definition with that name.
318318 */
319−export function importsOf(view: View, file: string): ReadonlyMap<string, string> {
319+export function importsOf(view: ReadView, file: string): ReadonlyMap<string, string> {
320320 let perFile = importCache.get(view);
321321 if (!perFile) {
322322 perFile = new Map();
Lines 367–373 at 143 (were 367–373 at 142)
367367 return parts.join("/");
368368}
369369
370−function resolveModule(view: View, from: string, spec: string): string | undefined {
370+function resolveModule(view: ReadView, from: string, spec: string): string | undefined {
371371 if (!spec.startsWith(".")) return undefined;
372372 const base = joinPath(dirOf(from), spec);
373373 const stem = base.replace(/\.(?:js|mjs|cjs|jsx)$/, "");
Lines 385–391 at 143 (were 385–391 at 142)
385385 return undefined;
386386}
387387
388−function resolvePython(view: View, from: string, spec: string): string | undefined {
388+function resolvePython(view: ReadView, from: string, spec: string): string | undefined {
389389 const dots = /^\.*/.exec(spec)![0].length;
390390 const rest = spec.slice(dots).replace(/\./g, "/");
391391 let dir = dots > 0 ? dirOf(from) : "";
MCP
compare on this site's /mcp
CLI
abso diff 142 143 worker/project/definitions.ts --json
JSON
/christopher/abso-core/compare/142..143?file=worker%2Fproject%2Fdefinitions.ts&format=json