@cotal-ai/connector-core 0.166.3 → 0.168.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,531 @@
1
+ import { type AttentionMode, type ChannelMode, type CotalEndpoint, type CotalMessage, type Delivery, type MessageMeta } from "@cotal-ai/core";
2
+ import type { AgentConfig } from "./config.js";
3
+ /** The endpoint and host operations the inbox reads when each call runs. */
4
+ interface AgentInboxDeps {
5
+ endpoint: () => CotalEndpoint;
6
+ config: () => AgentConfig;
7
+ transportConnected: () => boolean;
8
+ emit: (event: "incoming" | "mention-wake", item: InboxItem) => void;
9
+ warning: (error: Error) => void;
10
+ noteDirected: (item: InboxItem) => void;
11
+ inOrder: (write: () => Promise<void>) => Promise<void>;
12
+ requireConnected: () => Promise<void>;
13
+ }
14
+ /** A message that has arrived for us, normalized for the agent to read. */
15
+ export interface InboxItem {
16
+ id: string;
17
+ /** Opaque per-delivery RECEIVE key (#624): the address a host uses to drain/ack THIS buffered
18
+ * delivery. It is the wire `id` for every message that carries one; a message whose `id` is the
19
+ * empty string gets a minted key, because an empty id is never a dedup key and never a
20
+ * selectable one. It is NOT wire identity and NOT dedup authority: nothing coalesces on it, so
21
+ * a redelivered copy of an id-less message mints its own key and surfaces again (at-least-once,
22
+ * the disclosed cost). It exists so the exact-id drains and in-flight protection can select the
23
+ * DELIVERY rather than an id value that two distinct messages share. */
24
+ recvKey: string;
25
+ ts: number;
26
+ fromId: string;
27
+ fromName: string;
28
+ fromRole?: string;
29
+ kind: "channel" | "dm" | "anycast";
30
+ /** Set when kind === "channel". */
31
+ channel?: string;
32
+ /** Set when kind === "anycast" (the role addressed). */
33
+ service?: string;
34
+ /** Lowercased names called out on a channel message (priority hint). */
35
+ mentions?: string[];
36
+ /** True iff this message mentions us by name — computed once, here. Drives high-priority wake. */
37
+ mentionsMe: boolean;
38
+ /** True iff this is backfilled history (a "catching up" block on join), not a live message. */
39
+ historical: boolean;
40
+ text: string;
41
+ replyTo?: string;
42
+ contextId?: string;
43
+ /** How many times the broker has delivered this copy, 1 on the first; absent on a live copy.
44
+ * Broker-derived, never read from the payload: above 1, an earlier delivery of this message went
45
+ * unacked past its ack wait and may have run, here or on another reader. */
46
+ deliveryCount?: number;
47
+ /** Set on a DM from the space's delivery daemon about one of this session's own role requests
48
+ * (`anycast`, SPEC §8.1) or about a channel post whose mention the daemon could not deliver
49
+ * (`mention`, SPEC §8): its sender was checked against the delivery lease holder. A notice asks
50
+ * for no reply and answers no question. */
51
+ notice?: DeliveryNotice;
52
+ }
53
+ /** A bounded, non-consuming view of the currently buffered inbox for presentation-only surfaces. */
54
+ export interface InboxSnapshot {
55
+ /** Total buffered deliveries, including rows beyond {@link items}. */
56
+ unread: number;
57
+ /** Oldest buffered rows, copied without receive/ack handles. */
58
+ items: InboxItem[];
59
+ }
60
+ /** Where a session's focus-mode recall has been read to: a timestamp plus the id that breaks its ties. */
61
+ export interface RecallMark {
62
+ ts: number;
63
+ id: string;
64
+ }
65
+ /** Total order on {@link RecallMark}: by time, then by id, so items sharing a millisecond still queue. */
66
+ export declare function afterRecallMark(a: RecallMark, b: RecallMark): boolean;
67
+ /** How many pending messages one session buffers before the overflow valve in
68
+ * {@link AgentInbox.buffer} evicts. Exported so the overflow smokes read the bound they exercise. */
69
+ export declare const MAX_INBOX = 200;
70
+ export type InboxScope = "all" | "automatic" | "pull-only";
71
+ export interface ExactDrainResult {
72
+ items: InboxItem[];
73
+ missingKeys: string[];
74
+ }
75
+ /** What a delivery daemon's notice is about. */
76
+ export type DeliveryNotice = "anycast" | "mention";
77
+ /** Which delivery daemon notice part a DM carries, anycast (SPEC §8.1) or mention (SPEC §8), if any.
78
+ * Its sender is still to be checked against the delivery lease. */
79
+ export declare function deliveryNoticeOf(m: CotalMessage): DeliveryNotice | undefined;
80
+ /** Session-local inbox, delivery ownership, attention policy and focus recall. */
81
+ export declare class AgentInbox {
82
+ private readonly deps;
83
+ constructor(deps: AgentInboxDeps);
84
+ private get ep();
85
+ private get config();
86
+ private get _transportConnected();
87
+ private emit;
88
+ private handleEndpointWarning;
89
+ private noteDirected;
90
+ private inOrder;
91
+ private requireConnected;
92
+ seedChannelModes(config: AgentConfig): void;
93
+ onTransport(connected: boolean): void;
94
+ stop(): void;
95
+ private inbox;
96
+ /** Role requests delivered on an auth mesh whose take is not recorded for the copy held (SPEC §8.1).
97
+ * They count toward a wake and are never shown: {@link takeChosen} asks the delivery daemon to
98
+ * record the take of each one a host chose to show, and a recorded one moves to {@link inbox}. */
99
+ private gated;
100
+ /** Counts arrivals, to number each entry's {@link Pending.arrival}. */
101
+ private arrivals;
102
+ /** Why the last take could not be decided, when it could not, and when a held request may be
103
+ * asked about again. Reported by `cotal_inbox`. */
104
+ private heldTake?;
105
+ /** Re-announces the held role requests once {@link heldTake} lets them be asked about again. */
106
+ private takeRetry?;
107
+ /** Ids already SURFACED to the model (handled) — bounded, commit-aware dedup ACROSS a drain. The
108
+ * live↔durable transition window can deliver the two copies of one message far enough apart that the
109
+ * first is already drained (removed from {@link inbox}) when the second arrives; the pending-inbox
110
+ * check alone would then re-buffer and double-surface it. Recorded at HANDLE time ({@link drainInbox}),
111
+ * never at receive time — so a later durable duplicate of an already-handled id is safe to ack (the
112
+ * logical message was delivered), which is exactly what the removed endpoint-level `firstSeenChat`
113
+ * got wrong (it acked at receive time, before handling). Two rotating windows bound memory. */
114
+ private handledIds;
115
+ private handledIdsPrev;
116
+ /** Receive-time classes for overflow-evicted, unhandled channel ambient. Capacity exhaustion
117
+ * permanently degrades unknown ambient to pull-only for this session rather than risk a late
118
+ * live/durable copy changing from quiet to automatic. */
119
+ private evictedClassifications;
120
+ /** Surfaced to the host but not yet committed or abandoned, counted per holding frame because
121
+ * frames overlap. See {@link holdInFlight}. */
122
+ private inFlightIds;
123
+ /** Ack-wait renewal timers of held durable deliveries, by receive key. See {@link keepOwned}. */
124
+ private renewals;
125
+ private classificationUnsafe;
126
+ /** Terminal receive-time decisions that must survive the live→durable transition: successfully
127
+ * surfaced pull-only messages and hard drops under muted/focus. Capacity loss degrades the
128
+ * corresponding whole class fail-closed for the rest of the session. */
129
+ private protectedPullOnlyIds;
130
+ private protectedDropIds;
131
+ private dropUnsafe;
132
+ /** Wall-clock time of the latest inbox drain that actually committed at least one delivery.
133
+ * This is measured only after the backing acknowledgements succeed, never inferred from a read
134
+ * attempt or from an empty inbox. */
135
+ private _lastInboxDrainedAt?;
136
+ /** Wall-clock time of the latest drain that committed at least one AUTOMATIC delivery.
137
+ *
138
+ * Deliberately separate from {@link _lastInboxDrainedAt}, and #1233 is why: on a host-mode
139
+ * connector the tool inbox and the connector-managed automatic queue are different queues, and
140
+ * the measured seat was draining the first every few minutes while the second had not moved in
141
+ * 13.8 hours. A progress mark that counts a pull-only drain as progress would have reported that
142
+ * seat as making progress, which is the exact lie this field exists to refuse. */
143
+ private _lastAutomaticDrainedAt?;
144
+ /** The latest commit that took the OLDEST automatic delivery then queued (#1526).
145
+ *
146
+ * Distinct from {@link _lastAutomaticDrainedAt}, and the distinction is the defect: any automatic
147
+ * commit used to count, so a seat that kept committing fresh arrivals over a head it could not
148
+ * deliver reset its own stall clock on every turn and reported `ready` indefinitely, while the
149
+ * entries at the front of its queue aged past two hours. A queue drains when its head moves; a
150
+ * queue that serves only its newest arrivals is not draining, it is skipping. */
151
+ private _lastAutomaticHeadDrainedAt?;
152
+ private _attention;
153
+ private _recallCursor;
154
+ /** Recall items stamped ahead of this session's clock that it has already handed over. They are
155
+ * tracked by id rather than by {@link _recallCursor}, because a sender's clock must not be able to
156
+ * move this session's mark. Bounded by {@link MAX_AHEAD}. */
157
+ private aheadDelivered;
158
+ /** Per-channel attention overrides — the AUTHORITATIVE runtime state (read by {@link ingest} on
159
+ * every message). Seeded from the agent-file default; mutated by {@link setChannelMode}; mirrored
160
+ * to presence for peers. An absent key ⇒ that channel follows the global {@link _attention}. Reset
161
+ * on restart (rebuilt from config; presence sweep clears the mirror). */
162
+ private channelModes;
163
+ /** Chat-stream frontier captured when this agent entered `focus` — recall surfaces ambient
164
+ * published after it ("since you entered focus"). Undefined unless in focus. */
165
+ private focusSince?;
166
+ private enteringFocus;
167
+ /** The receive-key namespace secret (#624): a per-session random value minted at construction,
168
+ * never written to any wire or log. Minted receive keys are `${secret}.${seq}`, so they are
169
+ * DISJOINT from wire ids by construction: an attacker-chosen wire id cannot equal one, so one
170
+ * verdict can never select two entries through a forged collision. Recognition is FUNCTIONAL
171
+ * (the key starts with the secret), so it cannot saturate the way a bounded set would: every
172
+ * minted key stays recognizable for the session's life, with nothing to expire or overflow. */
173
+ private readonly recvKeySecret;
174
+ private recvKeySeq;
175
+ private focusExcludedIds;
176
+ /** #662: id-less channel deliveries settled this focus episode, per content digest. Live ingest has
177
+ * no stream sequence, so content is all an id-less delivery shares with its stream copy, and
178
+ * identical copies may each have had a different disposition. So recall binds each settled copy
179
+ * to a stream sequence and hands back only the copies no settled copy is bound to. Replaced, never
180
+ * cleared, per episode, so a hold from an earlier episode cannot un-count a later one. */
181
+ private focusIdless;
182
+ /** Unbound copies plus bound sequences in {@link focusIdless}, bounded by
183
+ * {@link FOCUS_EXCLUSION_CAP}. */
184
+ private focusIdlessEntries;
185
+ /** Bumped as each channel's recall read starts: a copy settled before a read that the read could
186
+ * not bind is behind the focus frontier or out of retention, and no later read will see it. */
187
+ private idlessEpoch;
188
+ /** Recall runs one at a time, so an older read can never settle over a newer one (#662). */
189
+ private recallLock;
190
+ /** Bumped each time the transport goes down, so a settled copy's frontier read can tell whether
191
+ * the connection stayed up from the copy's arrival to the answer (#662). */
192
+ private transportDrops;
193
+ private focusRecallUnsafeChannels;
194
+ /** The latest successful, non-empty inbox drain in this session. */
195
+ get lastInboxDrainedAt(): number | undefined;
196
+ /** The latest drain that committed at least one AUTOMATIC (connector-managed) delivery. */
197
+ get lastAutomaticDrainedAt(): number | undefined;
198
+ /** The latest drain that committed the automatic delivery that was then at the FRONT of the queue
199
+ * (#1526). This is the fact {@link automaticQueueStalledForMs} measures progress by; the looser
200
+ * {@link lastAutomaticDrainedAt} is still reported beside it, because the two disagreeing is
201
+ * precisely the shape of a wedged head being served around. */
202
+ get lastAutomaticHeadDrainedAt(): number | undefined;
203
+ /** The receive key of the oldest still-queued automatic delivery: the queue's head, and the entry
204
+ * whose commit counts as progress. */
205
+ private oldestAutomaticKey;
206
+ /** Record head progress when this batch takes the current head of the automatic queue. Call
207
+ * BEFORE the batch leaves {@link inbox}, since the head is read from the live queue. */
208
+ private noteAutomaticHeadProgress;
209
+ /**
210
+ * How long a non-empty automatic queue has been making no progress, or `undefined`.
211
+ *
212
+ * PROGRESS AT THE HEAD, not depth and not throughput. The queue is not stalled because it is deep;
213
+ * it is stalled because the entries at the front of it are not coming off. The clock therefore
214
+ * starts at the later of the arrival of the oldest still-queued delivery and the last commit that
215
+ * took the queue's head, so a seat that is steadily draining keeps resetting it however busy it
216
+ * is, and a seat that has not moved its head since that queue formed accrues from the moment it
217
+ * formed.
218
+ *
219
+ * Keyed on the HEAD rather than on any automatic commit (#1526). The reported session held 96
220
+ * deliveries with the oldest over two hours old and reported `ready` throughout: it was committing
221
+ * fresh arrivals, and under a looser measure each of those reset the clock for the backlog behind
222
+ * them. A seat that serves only its newest traffic is skipping its queue, not draining it, and the
223
+ * messages that are actually undelivered are the ones the measure must speak for.
224
+ *
225
+ * Measured from the oldest ARRIVAL rather than from session start so a session that never drained
226
+ * anything is still measurable — that is precisely the shape of a seat whose first soft interrupt
227
+ * timed out.
228
+ */
229
+ automaticQueueStalledForMs(now?: number): number | undefined;
230
+ /** Session-local channel degradation, independent of transport liveness. */
231
+ get channelDeliveryIssue(): string | undefined;
232
+ /** A DM shaped as a delivery daemon's notice is one only when its authenticated sender holds the
233
+ * space's delivery lease. Any other sender's copy is an ordinary DM. */
234
+ ingestNotice(m: CotalMessage, delivery: Delivery, meta: MessageMeta, notice: DeliveryNotice): Promise<void>;
235
+ ingest(m: CotalMessage, delivery: Delivery, meta?: MessageMeta, notice?: DeliveryNotice): void;
236
+ private buffer;
237
+ /** Put one entry in the shown inbox at its arrival place, running the overflow valve. */
238
+ private admit;
239
+ private rememberEvicted;
240
+ private excludeFromFocus;
241
+ /** #662: the tally for one more settled or handed-back copy of an id-less message; the caller adds
242
+ * the copy. At the bound, the channel's recall is reported incomplete rather than risk handing
243
+ * back a copy it no longer counts. */
244
+ private reserveIdless;
245
+ /** #662: add one settled copy, bounded by the chat frontier read after it arrived. If that read
246
+ * fails, or answers only after the transport dropped, nothing bounds the copy, so the channel's
247
+ * recall is reported incomplete instead. */
248
+ private settleIdless;
249
+ /** #662: forget a tally with nothing left in it, so the map is bounded by the entries it counts. */
250
+ private dropEmptyIdless;
251
+ /** #662: one buffered copy of an id-less message left the inbox unhandled. Only that copy is
252
+ * un-counted, or the sequence it was bound to freed: an identical copy may have been muted. A copy
253
+ * no read has bound yet stays in arrival order, marked, so the read binds it to its own stream
254
+ * copy rather than letting an earlier identical copy take that one. */
255
+ private unsettleIdless;
256
+ /** #662: after a complete read of `channel` that started at `epoch`, a copy settled before it that
257
+ * it could not bind will not be in a later read either, so it is dropped. The read is the
258
+ * channel's whole retained window, so a bound sequence it lacks aged out. */
259
+ private settleIdlessRead;
260
+ /** #662: the frontier reads of every copy of `channel` settled so far have answered. */
261
+ private idlessReady;
262
+ /** #662: bind the copies settled before the read that started at `epoch` to its unbound stream
263
+ * copies `free` (ascending). Identical copies share a sender subject, so they arrive in stream
264
+ * order, and a frontier, read after its copy arrived, bounds that copy and every copy before it.
265
+ * Frontier reads can answer out of order, so their sizes say nothing about arrival order. So the
266
+ * copies bind in arrival order, latest first, each to the latest free stream copy at or below the
267
+ * lowest frontier from it on, and a stream copy none of them takes (a reconnect gap) stays free.
268
+ * An evicted copy takes its own stream copy and leaves it free, so recall hands that one back. */
269
+ private bindIdless;
270
+ /** #662: a copy settled after the read that started at `epoch` began may or may not be in it, so it
271
+ * binds nothing there, and an unbound stream copy at `seq` it could be is neither free nor bound. */
272
+ private idlessUnsure;
273
+ private protectDisposition;
274
+ /** Normalize a wire message into an {@link InboxItem}. `kind` is the **authenticated** class
275
+ * from {@link MessageMeta} (subject-derived), never the forgeable payload `to`/`toService`;
276
+ * core has already normalized `channel` and `toService` from the authenticated chat and svc
277
+ * subjects. Shared by live ingest and focus recall ({@link recallAmbient}). */
278
+ private toInboxItem;
279
+ /** Return pending messages in stable receive order. Automatic delivery excludes quiet ambient;
280
+ * pull-only is the explicit cotal_inbox lane.
281
+ *
282
+ * A role request whose take is not yet recorded is never returned (SPEC §8.1): a host shows one
283
+ * only through {@link takeChosen}. */
284
+ peekInbox(scope?: InboxScope): InboxItem[];
285
+ /** Every pending message in scope as {@link peekInbox} will return it once the held role requests
286
+ * that may be asked about now are taken, in that order. It is for choosing what to show, never for
287
+ * showing: hand the choice to {@link takeChosen}. */
288
+ inboxPreview(scope?: InboxScope): InboxItem[];
289
+ /** Choose what to show from {@link inboxPreview}, ask the delivery daemon to record the take of
290
+ * each held role request in the choice, wait up to `waitMs` for the answers, and return the chosen
291
+ * items that may be shown now, in the order chosen. A take is a claim that this session's agent is
292
+ * about to see the request, which ends its sender's chance to cancel it, so call this just before
293
+ * showing and choose only what will be shown. A request whose take is refused or not yet decided
294
+ * is left out. Never throws. */
295
+ takeChosen(scope: InboxScope, choose: (preview: InboxItem[]) => readonly InboxItem[], waitMs?: number): Promise<InboxItem[]>;
296
+ /** How many role requests are held because their take is pending or could not be decided, and why. */
297
+ heldTakes(): {
298
+ count: number;
299
+ detail?: string;
300
+ };
301
+ /** Whether a held role request may be asked about now: the link is up, and no take nobody could
302
+ * decide is being waited out ({@link heldTake}). */
303
+ private mayAskTakes;
304
+ /** Whether a read may be offered a held role request now: the link is up and its take is out
305
+ * already, or a take may be asked ({@link mayAskTakes}). A take that is out when the link drops
306
+ * cannot admit the request until the link is back, so a read then is offered nothing of it. */
307
+ private mayOffer;
308
+ private startTake;
309
+ /** Take one held role request for the copy it holds, and admit it only if it still holds that copy
310
+ * once the take is recorded: the same delivery, its ack wait not run out, the link not dropped. */
311
+ private runTake;
312
+ /** Forget a role request whose take was refused or whose copy ran out. It is never acked: a
313
+ * cancelled one is gone already, and one another holder took must stay with that holder. */
314
+ private dropGated;
315
+ /** Move a taken role request back to the held set when its copy changed before it was shown. */
316
+ private regate;
317
+ /** Drop every taken role request not yet shown whose copy ran out: the broker may have handed it
318
+ * to another holder, whose take of the later copy wins. One the host holds is renewed and kept. */
319
+ private dropLapsedTakes;
320
+ /** Mark a surfaced batch as mid-delivery, so the overflow valve will not evict it out from under
321
+ * the host. Pair with {@link releaseInFlight} on the delivery verdict, whichever way it goes.
322
+ *
323
+ * **Counted, not a set.** Hook frames overlap, so the same id is routinely in two open batches at
324
+ * once; if a hold were a boolean, the first frame's verdict would unprotect ids the second is
325
+ * still delivering, and an arrival between the two verdicts would ack one — the very loss this
326
+ * guard exists to stop, reached through the concurrency the per-frame keying deliberately allows.
327
+ *
328
+ * **All or nothing, and it says which.** At the {@link MAX_IN_FLIGHT} ceiling this refuses the
329
+ * whole batch and returns `false`; the caller must then NOT surface it. Protecting only part of a
330
+ * batch, or protecting none while the caller surfaces anyway, silently reopens exactly the loss
331
+ * this guard exists to close — the unprotected ids sit in the inbox for the whole handoff window
332
+ * with the overflow valve free to ack them. Declining to surface costs a deferral: the messages
333
+ * stay buffered and go out on a later frame, once a verdict releases capacity. */
334
+ holdInFlight(ids: readonly string[]): boolean;
335
+ /** Whether this id is currently protected from the overflow valve — i.e. some frame is mid-delivery
336
+ * holding it. Read-only observability for the property {@link holdInFlight} establishes. A caller
337
+ * that needs a batch to actually BE in flight before it acts must wait on this, never on a sleep:
338
+ * the handoff runs through a real relay process whose latency is not the caller's to predict. */
339
+ isInFlight(id: string): boolean;
340
+ /** One frame's verdict is in (either way). The id is ordinary backlog again only once EVERY frame
341
+ * holding it has reported — a release from one must not speak for another still in flight. */
342
+ releaseInFlight(ids: readonly string[]): void;
343
+ private own;
344
+ /** Keep a held durable delivery with this reader for as long as the hold lasts, by restarting its
345
+ * ack wait at half the wait. Only a HELD delivery is renewed: a queued one keeps the broker's
346
+ * timer, so a reader busy with other work does not sit on a role request another reader could
347
+ * take, and an abandoned one (released) runs out and redelivers. */
348
+ private keepOwned;
349
+ private stopRenewal;
350
+ /** Restart one copy's ack wait, unless this reader can no longer vouch that it still holds that
351
+ * copy. JetStream acks by stream sequence rather than by delivery, so a renewal sent after the
352
+ * wait may have run out (a stalled loop, a link down for longer than the wait) would extend the
353
+ * copy the broker has since handed to another reader. Renewal stops instead and the copy is the
354
+ * broker's to redeliver. Nothing is sent while the link is down, because the client buffers a
355
+ * publish and would replay it after the wait had run out; a handle whose connection was torn
356
+ * down throws, which is the same lost ownership. */
357
+ private renewOwned;
358
+ /** Return scoped pending messages and ack them — call only when they're actually surfaced. */
359
+ drainInbox(limit?: number, scope?: InboxScope): InboxItem[];
360
+ /** Ack exact surfaced deliveries without assuming they still form the physical inbox prefix.
361
+ * Takes RECEIVE keys ({@link InboxItem.recvKey}): the wire id for real messages, a minted key
362
+ * for id-less ones, and selects by them, so a host that surfaced one empty-id item drains THAT
363
+ * delivery, never its neighbors: the sweep the raw id produced (every pending empty-id item
364
+ * acked and marked handled in one call) is closed by construction, not by filtering. Every
365
+ * requested key whose item is present is acked and (for a real id) marked handled, including an
366
+ * item overflow-evicted during the turn. */
367
+ drainInboxDeliveries(keys: readonly string[]): ExactDrainResult;
368
+ private commitPending;
369
+ private inScope;
370
+ /** Record an id as surfaced/handled, for {@link ingest}'s commit-aware cross-path dedup. Bounded via
371
+ * two rotating windows: when the live set fills, it becomes the previous window and a fresh one
372
+ * starts — so memory stays ~2× the cap while the lookup horizon never shrinks below it. */
373
+ private markHandled;
374
+ /** Receive keys of the pending messages in scope, role requests held for their take included,
375
+ * for bookkeeping that shows no body. */
376
+ inboxKeys(scope?: InboxScope): string[];
377
+ /** The pending messages in scope, role requests held for their take included, for a notice that
378
+ * counts them and shows no body. A held request is shown only through {@link takeChosen}. */
379
+ inboxPending(scope?: InboxScope): InboxItem[];
380
+ /** Pending messages in scope, counting role requests still held for their take. */
381
+ inboxCount(scope?: InboxScope): number;
382
+ /**
383
+ * Read a bounded presentation snapshot without draining, acknowledging, committing, holding or
384
+ * changing attention. Each item is a shallow copy: reassigning its fields leaves the live inbox
385
+ * unchanged, but nested values such as `mentions` are shared, so callers must treat items as
386
+ * read-only.
387
+ */
388
+ inboxSnapshot(limit?: number): InboxSnapshot;
389
+ /** Local receive time of the oldest still-buffered automatic delivery, if any. */
390
+ oldestAutomaticReceivedAt(): number | undefined;
391
+ /**
392
+ * How far this session has read the focus-mode channel recall.
393
+ *
394
+ * {@link recallAmbient} re-derives the same items from an unchanged frontier on every call, so a
395
+ * reader that shows only what fits in one response would show the same prefix forever. This mark
396
+ * moves when a response actually delivered recall items, and it belongs to ONE walk over ONE
397
+ * frontier: it says how far this focus episode has read, not what the stream still holds, and
398
+ * {@link setAttention} forgets it whenever the frontier under it changes.
399
+ *
400
+ * WHAT THIS MARK DOES NOT OWN, said here so nothing above it claims otherwise. It orders what
401
+ * {@link recallAmbient} hands over; it does not decide what becomes recallable. A message that only
402
+ * becomes readable after this mark has passed its timestamp, through late persistence, is below the
403
+ * watermark and will not be walked to. That is governed by the frontier `recallAmbient` derives from
404
+ * ({@link chatFrontier} and the focus watermark), not here, and it is the same for any
405
+ * timestamp-ordered reader of that stream.
406
+ *
407
+ * What the mark DOES own is where it can be moved to, and only this session's own traffic may move
408
+ * it: an item stamped ahead of the local clock is walked by {@link recallAhead}, not by this mark,
409
+ * so no sender can push it past the messages it has not read yet.
410
+ */
411
+ get recallCursor(): RecallMark;
412
+ /**
413
+ * Record the last recall item actually handed to the caller.
414
+ *
415
+ * The mark is a PAIR, not a timestamp, because two recall items can share a millisecond: a
416
+ * timestamp alone either filters the twin out for good, if it advances past both, or re-serves the
417
+ * one already delivered, if it stops below them. Ordering by `(ts, id)` gives every item a place of
418
+ * its own, so the next call resumes strictly after the last one delivered.
419
+ */
420
+ noteRecalled(mark: RecallMark): void;
421
+ /**
422
+ * Does this recall item claim a time this session has not reached?
423
+ *
424
+ * `ts` is stamped by the SENDING endpoint, so it is neither trustworthy nor bounded, and a mark
425
+ * that walks it is a mark a peer can move. One message stamped far ahead otherwise parks
426
+ * {@link recallCursor} in the future: every ordinary message after it sorts below the mark, is
427
+ * filtered out of recall for the rest of the session, and the reply says there is no chatter. That
428
+ * is one peer suppressing OTHER peers' recall, which makes it a security property and not only a
429
+ * clock one, and the defence has to hold when the field is chosen rather than merely wrong.
430
+ *
431
+ * So the walk splits. An item at or behind this session's clock is ordered by its timestamp and
432
+ * moves the mark. An item ahead of it is not ordered at all and NEVER moves the mark: it is handed
433
+ * over once and remembered by id ({@link noteRecalledAhead}), so it neither leads the walk nor
434
+ * comes back on the next call.
435
+ *
436
+ * THE LANES SWAP MEMBERSHIP, and the record is what keeps them honest with each other. An item
437
+ * stamped just ahead of the clock crosses into the ordered lane the moment the clock passes it,
438
+ * arriving above a mark that never moved for it, so the reader has to consult
439
+ * {@link recallAheadSeen} there too or hand it over a second time. That crossing is the one part of
440
+ * this mechanism that cannot be staged by choosing timestamps, so its cell waits for real time
441
+ * rather than reasoning about it.
442
+ */
443
+ recallAhead(item: {
444
+ ts: number;
445
+ }): boolean;
446
+ /** Has this future-stamped recall item already been handed over in this session? */
447
+ recallAheadSeen(id: string): boolean;
448
+ /**
449
+ * How many more future-stamped recall items this session will take responsibility for.
450
+ *
451
+ * Exactness costs memory, and that memory is what a flood of forged stamps would grow, so it is
452
+ * bounded. A caller must not hand over what it cannot record, or it will hand it over again on
453
+ * every call forever; past this bound it has to say so instead. Note where the cost lands: an item
454
+ * at or behind the clock never enters this set, so a peer that spends the whole bound spends it on
455
+ * ITS OWN messages and cannot use it to silence anyone else's.
456
+ */
457
+ recallAheadRoom(): number;
458
+ /** Record that a future-stamped recall item was actually handed to the caller. */
459
+ noteRecalledAhead(id: string): void;
460
+ /**
461
+ * Forget how far a recall walk had read, because the thing it was walking is gone.
462
+ *
463
+ * The mark is session-local, which is a longer life than it can honestly carry: it describes a
464
+ * position in ONE walk over ONE frontier, and {@link setAttention} both drops the frontier on the
465
+ * way out of focus and captures a new one on the way in. Measured before this reset, a mark left
466
+ * over from an earlier focus episode filtered a new episode's messages out of recall whenever they
467
+ * were stamped behind it, which a lagging or a chosen clock produces. The focus watermark was
468
+ * already cleared here; the mark that walks it was not.
469
+ */
470
+ private resetRecallWalk;
471
+ /** Buffered receive-time lane for one delivery, addressed by its receive key. Undefined means it
472
+ * is no longer pending. */
473
+ inboxScope(key: string): Exclude<InboxScope, "all"> | undefined;
474
+ /** Count of automatic messages that count as directed for a wake decision: real dm/anycast
475
+ * (authenticated kind) or a live channel @mention. Pull-only history never counts, including
476
+ * mentions retained while focused. The Stop→idle flush uses this in `dnd`/`focus`. */
477
+ directedPendingCount(): number;
478
+ /** The inbox half of {@link pendingWake}: buffered items that should wake the agent, without run
479
+ * turns. A surface that cannot surface a run turn, such as the remote gateway, waits on this, so
480
+ * a turn it can never clear does not end every wait at once. */
481
+ inboxWake(skip?: (item: InboxItem) => boolean): number;
482
+ /** This agent's global attention mode. Authoritative here; mirrored to presence (advisory) so peers
483
+ * can see it. Delivery never reads it back from presence — local state wins. */
484
+ get attention(): AttentionMode;
485
+ /** This agent's per-channel override for `channel` (undefined ⇒ follow the global mode). */
486
+ channelMode(channel?: string): ChannelMode | undefined;
487
+ /** A snapshot of every per-channel override (for the at-a-glance views). */
488
+ channelModeEntries(): Record<string, ChannelMode>;
489
+ /** Set (or clear, with `"normal"`) one channel's attention override. Validates the channel is
490
+ * concrete and within this agent's read ACL (`allowSubscribe` — so a mode can be pre-set for a
491
+ * channel it may read but hasn't joined yet), updates the AUTHORITATIVE in-memory map, then mirrors
492
+ * the whole map to presence (best-effort; advisory). Per-instance + runtime: it NEVER writes the
493
+ * agent file (a shared template) and resets on restart.
494
+ *
495
+ * It does not purge messages already buffered from that channel. Quiet makes its buffered ambient
496
+ * pull-only, and muted makes everything buffered from it pull-only, mentions included, so neither
497
+ * enters another turn and both stay readable with cotal_inbox. `normal` makes nothing automatic
498
+ * again. */
499
+ setChannelMode(channel: string, mode: ChannelMode | "normal"): Promise<void>;
500
+ /** Make the automatic entries buffered from `channel` (a concrete channel or a pattern) pull-only,
501
+ * mentions of this agent too when `mentions` is set, except on a channel `keep` still covers. An
502
+ * entry a host is handing over keeps its lane, since the turn carrying it acks it. */
503
+ lowerBuffered(channel: string, mentions: boolean, keep?: string[]): void;
504
+ /** Set the attention mode. Entering `focus` captures the chat frontier as the focus-watermark
505
+ * (recall surfaces ambient published after it); leaving focus clears it. Requires a live
506
+ * connection only for `focus` (it reads the stream frontier). Ambient already *buffered* when
507
+ * focus is entered is not retroactively ack-dropped. Traffic retained during the asynchronous
508
+ * frontier read is tagged out of recall, so it surfaces once from its receive-time lane whether
509
+ * it landed just before or after the captured frontier. Only ambient arriving after the local
510
+ * switch is ack-dropped. */
511
+ setAttention(mode: AttentionMode): Promise<void>;
512
+ /** Focus recall: the channel ambient + @mentions ack-dropped since this agent entered focus,
513
+ * read back from the chat stream on demand and **replay-gated per channel** (a `replay=off`
514
+ * channel yields nothing, and is named in `droppedChannels` — recall must not become a history
515
+ * bypass, and it must not claim a suppressed channel's window was empty and complete either).
516
+ * Items are marked `historical` (catch-up framing). `droppedChannels` also names channels whose
517
+ * earliest retained message postdates the focus-watermark — older ambient may have aged out of
518
+ * the per-channel window — and wildcard subscriptions (`team.>`), which recall cannot read back
519
+ * per concrete sub-channel (#977: a wildcard join is not itself a channel ingest can consult a
520
+ * replay policy for) and so cannot vouch for either (never-silent throughout). Empty unless in
521
+ * focus. Calls run one at a time (#662). `underway` names recalled items that already went out in
522
+ * part: an exclusion that lands after that does not hide one, since recall would then move past
523
+ * the rest of it (#613). */
524
+ recallAmbient(underway?: ReadonlySet<string>): Promise<{
525
+ items: InboxItem[];
526
+ droppedChannels: string[];
527
+ }>;
528
+ private recallAmbientOnce;
529
+ }
530
+ export {};
531
+ //# sourceMappingURL=agent-inbox.d.ts.map
@@ -0,0 +1 @@
1
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