Project tells a host each write's news (newsWritten), and reads an agent's waiting news without taking it (peekNews) A host that wakes a listener the moment news lands, such as a WebSocket per agent, needs two things from the engine: which agents a write just gave news, and a way to show what's waiting without using it up. - ProjectOptions.newsWritten(items): after each write that appended "news" entries, it's called once with one item per text: {agent, text, at, seq}, where seq is the entry's place in the log. It runs inside the write, which can still roll back, so the host collects the items and acts only once the call has returned. Taking news (heard) and writes with no news call nothing, so a listener's own reads wake no one. It works on both the in-memory store and openWriter's. - peekNews(agent): the agent's waiting news, read only. Nothing is taken, heard or written, and an agent the project hasn't got reads as none, with none made. A listener can catch up on connect while the news stays for the agent's own next read, so a listener that dies loses nothing. - hasAgent(agent): whether the project has it, read only. Tests: worker/project/test/news-written.test.ts (3): one call per write, with each item's agent, text and place in the log; no call for writes without news or for taking news; peekNews takes and writes nothing, and the take still finds the news. All engine tests pass (362).
RA readspeedbegan .
3 files: worker/project/project-types.ts, worker/project/project.ts, worker/project/test/news-written.test.ts
version 292Project tells a host each write's news (newsWritten), and reads an agent's waiting news without taking it (peekNews)
A host that wakes a listener the moment news lands, such as a WebSocket per agent, needs two things from the engine: which agents a write just gave news, and a way to show what's waiting without using it up.
- ProjectOptions.newsWritten(items): after each write that appended "news" entries, it's called once with one item per text: {agent, text, at, seq}, where seq is the entry's place in the log. It runs inside the write, which can still roll back, so the host collects the items and acts only once the call has returned. Taking news (heard) and writes with no news call nothing, so a listener's own reads wake no one. It works on both the in-memory store and openWriter's.
- peekNews(agent): the agent's waiting news, read only. Nothing is taken, heard or written, and an agent the project hasn't got reads as none, with none made. A listener can catch up on connect while the news stays for the agent's own next read, so a listener that dies loses nothing.
- hasAgent(agent): whether the project has it, read only.
Tests: worker/project/test/news-written.test.ts (3): one call per write, with each item's agent, text and place in the log; no call for writes without news or for taking news; peekNews takes and writes nothing, and the take still finds the news. All engine tests pass (362).
worker/project/project-types.ts, worker/project/project.ts, worker/project/test/news-written.test.ts- MCP
- change on this site's /mcp
- CLI
- abso review 4584 --json
- JSON
- /christopher/abso-core/changes/4584?format=json