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 291 to 292

Compare

+23 −0 in 5 places
Lines 157–163 at 292 (were 157–162 at 291)
157157 LandAnswer,
158158 MergedLine,
159159 Modes,
160+ NewsWritten,
160161 NoteAnswer,
161162 NoteBody,
162163 NoteRecord,
Lines 331–337 at 292 (were 330–335 at 291)
330331 */
331332 checkerReady = false;
332333 readonly #now: (() => number) | undefined;
334+ readonly #newsWritten: ((items: readonly NewsWritten[]) => void) | undefined;
333335 readonly #whole: ProjectOptions["whole"];
334336 readonly #shapes: ProjectOptions["shapes"];
335337 readonly #logLine: ProjectOptions["logLine"];
Lines 454–460 at 292 (were 452–457 at 291)
452454 }
453455 this.#hasBlob = options.hasBlob ?? (() => false);
454456 this.#now = options.now;
457+ this.#newsWritten = options.newsWritten;
455458 this.#whole = options.whole;
456459 this.#shapes = options.shapes;
457460 this.#logLine = options.logLine;
Lines 1443–1459 at 292 (were 1440–1445 at 291)
14401443 return hostedOverlapNews(this.#overlapHost, ...args);
14411444 }
14421445
1446+ /** The news waiting for an agent, read only: nothing is taken, heard or written. None for an agent it hasn't got. */
1447+ peekNews(agentName: string): { text: string; at: number | null }[] {
1448+ const agent = typeof agentName === "string" ? this.#agents.get(agentName) : undefined;
1449+ return agent ? agent.news.map((text, i) => ({ text, at: agent.newsAt[i] ?? null })) : [];
1450+ }
1452+ /** Whether the project has this agent. Read only. */
1453+ hasAgent(agentName: string): boolean {
1454+ return typeof agentName === "string" && this.#agents.get(agentName) !== undefined;
1455+ }
14431457 /** Hand over the news waiting for an agent (collisions, definitions, moves, announcements), once. */
14441458 news(agentName: string): { news: string[]; items: { text: string; at: number | null }[] } {
14451459 const entries: Entry[] = [];
Lines 1733–1747 at 292 (were 1719–1724 at 291)
17191733 if (this.#pending.length === 0) return;
17201734 const out = this.#pending;
17211735 this.#store.append(out);
1736+ if (this.#newsWritten) {
1737+ const items: NewsWritten[] = [];
1738+ out.forEach((entry, i) => {
1739+ if (entry.type !== "news") return;
1740+ for (const text of entry.text)
1741+ items.push({ agent: entry.agent, text, at: entry.time ?? null, seq: this.#stored + i });
1742+ });
1743+ if (items.length > 0) this.#newsWritten(items);
1744+ }
17221745 this.#persistMutable();
17231746 // A few more agents' old told lists into their buckets at each write, until every row has moved (writer-agents.ts).
17241747 if (this.#agents instanceof WriterAgents) this.#agents.moveOldTold(OLD_TOLD_PER_WRITE);
MCP
compare on this site's /mcp
CLI
abso diff 291 292 worker/project/project.ts --json
JSON
/christopher/abso-core/compare/291..292?file=worker%2Fproject%2Fproject.ts&format=json