UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

27 lines (26 loc) • 2.4 kB
/** * The person's account of a request whose guard trim left the oldest messages out of what the model sees * (`context.messages_omitted`, user). The trim is the context lane's last resort — reached only when compaction declined, * failed or could not bring the request under its guard — and until this seat it told the model (an in-band line) and * the trace (`context.trim`), never the person, whose shell could only say what the compaction outcome said: that the * context was not shrunk. * * ONE account of one event: what compaction did for the request (the in-turn pass's verdict), so what the trim left out, and * what the person can do about it — minted here, whole, so a shell does not join a compaction outcome line and an omission * line that each told half (`detail.compaction` names the verdict the sentence was built from). * * One fact per trimmed STRETCH, not per request: every request of a long conversation over its guard is trimmed again, * and a line per request would be the same news repeated. The seat is told the count of every request view the context * hook hands on (the lane's observation flush — a provisional view the in-turn compaction replaced is dropped with its * buffer, so it says nothing); the first count above zero is said, the ones after it stay silent, and a view that fits * (zero, nothing short) ends the stretch, so the next trim is said again. Two facts are said whenever they are new: the * person's own messages the request leaves out (`yours`), on the request that leaves out more of them than the stretch has * told — a message of theirs never leaves what the model sees silently; and a room — what the fixed prompt leaves of the * guard line — that cannot hold what the request kept ({@link RoomShortfall}), said with its numbers once per stretch; with * nothing left out the stretch hands it on only for a request past the model's window (`trim-stretch.ts`), and a stretch opened * by it still says the first request that leaves messages out. */ import type { RoomShortfall } from "../context-guard.js"; import type { InTurnCompactionVerdict } from "./contracts.js"; import type { NoticeSeatInput } from "./notice-seat-input.js"; export declare function createMessagesOmittedSeat(ids: NoticeSeatInput): (omitted: number, short?: RoomShortfall, yours?: number, compaction?: InTurnCompactionVerdict) => void;