@animalabs/agent-framework 0.29.0 → 0.31.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.
Files changed (236) hide show
  1. package/README.md +71 -8
  2. package/dist/src/admission/admit.d.ts +90 -0
  3. package/dist/src/admission/admit.d.ts.map +1 -0
  4. package/dist/src/admission/admit.js +43 -0
  5. package/dist/src/admission/admit.js.map +1 -0
  6. package/dist/src/agent.d.ts +50 -9
  7. package/dist/src/agent.d.ts.map +1 -1
  8. package/dist/src/agent.js +125 -23
  9. package/dist/src/agent.js.map +1 -1
  10. package/dist/src/api/mcp-server-core.d.ts.map +1 -1
  11. package/dist/src/api/mcp-server-core.js +10 -3
  12. package/dist/src/api/mcp-server-core.js.map +1 -1
  13. package/dist/src/author-presentation.d.ts +50 -0
  14. package/dist/src/author-presentation.d.ts.map +1 -0
  15. package/dist/src/author-presentation.js +58 -0
  16. package/dist/src/author-presentation.js.map +1 -0
  17. package/dist/src/code-execution/isolate/render.d.ts.map +1 -1
  18. package/dist/src/code-execution/isolate/render.js +7 -6
  19. package/dist/src/code-execution/isolate/render.js.map +1 -1
  20. package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
  21. package/dist/src/code-execution/isolate/scripts.js +5 -4
  22. package/dist/src/code-execution/isolate/scripts.js.map +1 -1
  23. package/dist/src/dendrite/index.d.ts +6 -0
  24. package/dist/src/dendrite/index.d.ts.map +1 -0
  25. package/dist/src/dendrite/index.js +3 -0
  26. package/dist/src/dendrite/index.js.map +1 -0
  27. package/dist/src/dendrite/presets.d.ts +60 -0
  28. package/dist/src/dendrite/presets.d.ts.map +1 -0
  29. package/dist/src/dendrite/presets.js +117 -0
  30. package/dist/src/dendrite/presets.js.map +1 -0
  31. package/dist/src/dendrite/registry.d.ts +260 -0
  32. package/dist/src/dendrite/registry.d.ts.map +1 -0
  33. package/dist/src/dendrite/registry.js +742 -0
  34. package/dist/src/dendrite/registry.js.map +1 -0
  35. package/dist/src/dendrite/types.d.ts +392 -0
  36. package/dist/src/dendrite/types.d.ts.map +1 -0
  37. package/dist/src/dendrite/types.js +24 -0
  38. package/dist/src/dendrite/types.js.map +1 -0
  39. package/dist/src/framework.d.ts +806 -118
  40. package/dist/src/framework.d.ts.map +1 -1
  41. package/dist/src/framework.js +4180 -1121
  42. package/dist/src/framework.js.map +1 -1
  43. package/dist/src/gate/event-gate.d.ts +36 -21
  44. package/dist/src/gate/event-gate.d.ts.map +1 -1
  45. package/dist/src/gate/event-gate.js +223 -149
  46. package/dist/src/gate/event-gate.js.map +1 -1
  47. package/dist/src/gate/recipe-reconcile.d.ts.map +1 -1
  48. package/dist/src/gate/recipe-reconcile.js +6 -5
  49. package/dist/src/gate/recipe-reconcile.js.map +1 -1
  50. package/dist/src/host-presentation.d.ts +4 -0
  51. package/dist/src/host-presentation.d.ts.map +1 -1
  52. package/dist/src/host-presentation.js +12 -10
  53. package/dist/src/host-presentation.js.map +1 -1
  54. package/dist/src/index.d.ts +6 -2
  55. package/dist/src/index.d.ts.map +1 -1
  56. package/dist/src/index.js +7 -1
  57. package/dist/src/index.js.map +1 -1
  58. package/dist/src/inference-bounds.d.ts +37 -0
  59. package/dist/src/inference-bounds.d.ts.map +1 -0
  60. package/dist/src/inference-bounds.js +84 -0
  61. package/dist/src/inference-bounds.js.map +1 -0
  62. package/dist/src/line-reader.d.ts +7 -1
  63. package/dist/src/line-reader.d.ts.map +1 -1
  64. package/dist/src/line-reader.js +17 -6
  65. package/dist/src/line-reader.js.map +1 -1
  66. package/dist/src/mcpl/channel-registry.d.ts +84 -9
  67. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  68. package/dist/src/mcpl/channel-registry.js +136 -58
  69. package/dist/src/mcpl/channel-registry.js.map +1 -1
  70. package/dist/src/mcpl/errors.d.ts +1 -0
  71. package/dist/src/mcpl/errors.d.ts.map +1 -1
  72. package/dist/src/mcpl/errors.js +3 -0
  73. package/dist/src/mcpl/errors.js.map +1 -1
  74. package/dist/src/mcpl/inbound-source.d.ts +2 -2
  75. package/dist/src/mcpl/inbound-source.js +2 -2
  76. package/dist/src/mcpl/inference-router.d.ts +11 -1
  77. package/dist/src/mcpl/inference-router.d.ts.map +1 -1
  78. package/dist/src/mcpl/inference-router.js +65 -9
  79. package/dist/src/mcpl/inference-router.js.map +1 -1
  80. package/dist/src/mcpl/modern-connection.d.ts +10 -7
  81. package/dist/src/mcpl/modern-connection.d.ts.map +1 -1
  82. package/dist/src/mcpl/modern-connection.js +85 -74
  83. package/dist/src/mcpl/modern-connection.js.map +1 -1
  84. package/dist/src/mcpl/protocol-family.d.ts +1 -1
  85. package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
  86. package/dist/src/mcpl/protocol-family.js +45 -3
  87. package/dist/src/mcpl/protocol-family.js.map +1 -1
  88. package/dist/src/mcpl/push-coalescer.d.ts +11 -7
  89. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  90. package/dist/src/mcpl/push-coalescer.js +21 -0
  91. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  92. package/dist/src/mcpl/references.d.ts +1 -2
  93. package/dist/src/mcpl/references.d.ts.map +1 -1
  94. package/dist/src/mcpl/references.js +3 -3
  95. package/dist/src/mcpl/references.js.map +1 -1
  96. package/dist/src/mcpl/server-connection.d.ts +14 -0
  97. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  98. package/dist/src/mcpl/server-connection.js +26 -22
  99. package/dist/src/mcpl/server-connection.js.map +1 -1
  100. package/dist/src/mcpl/tool-signature.d.ts +1 -0
  101. package/dist/src/mcpl/tool-signature.d.ts.map +1 -1
  102. package/dist/src/mcpl/tool-signature.js +16 -11
  103. package/dist/src/mcpl/tool-signature.js.map +1 -1
  104. package/dist/src/mcpl/toolsets-module.d.ts.map +1 -1
  105. package/dist/src/mcpl/toolsets-module.js +7 -0
  106. package/dist/src/mcpl/toolsets-module.js.map +1 -1
  107. package/dist/src/mcpl/transport.d.ts +44 -21
  108. package/dist/src/mcpl/transport.d.ts.map +1 -1
  109. package/dist/src/mcpl/transport.js +283 -64
  110. package/dist/src/mcpl/transport.js.map +1 -1
  111. package/dist/src/mcpl/types.d.ts +17 -1
  112. package/dist/src/mcpl/types.d.ts.map +1 -1
  113. package/dist/src/mcpl/types.js.map +1 -1
  114. package/dist/src/module-registry.d.ts +32 -4
  115. package/dist/src/module-registry.d.ts.map +1 -1
  116. package/dist/src/module-registry.js +189 -25
  117. package/dist/src/module-registry.js.map +1 -1
  118. package/dist/src/modules/discord/discord-js-client.d.ts.map +1 -1
  119. package/dist/src/modules/discord/discord-js-client.js +24 -16
  120. package/dist/src/modules/discord/discord-js-client.js.map +1 -1
  121. package/dist/src/modules/sender-name.d.ts +5 -4
  122. package/dist/src/modules/sender-name.d.ts.map +1 -1
  123. package/dist/src/modules/sender-name.js +7 -5
  124. package/dist/src/modules/sender-name.js.map +1 -1
  125. package/dist/src/modules/workspace/disk-agreement.d.ts +16 -8
  126. package/dist/src/modules/workspace/disk-agreement.d.ts.map +1 -1
  127. package/dist/src/modules/workspace/disk-agreement.js +33 -12
  128. package/dist/src/modules/workspace/disk-agreement.js.map +1 -1
  129. package/dist/src/modules/workspace/index.d.ts +6 -3
  130. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  131. package/dist/src/modules/workspace/index.js +61 -15
  132. package/dist/src/modules/workspace/index.js.map +1 -1
  133. package/dist/src/modules/workspace/observe.d.ts +9 -1
  134. package/dist/src/modules/workspace/observe.d.ts.map +1 -1
  135. package/dist/src/modules/workspace/observe.js +50 -10
  136. package/dist/src/modules/workspace/observe.js.map +1 -1
  137. package/dist/src/modules/workspace/reconcile.d.ts +11 -1
  138. package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
  139. package/dist/src/modules/workspace/reconcile.js +19 -8
  140. package/dist/src/modules/workspace/reconcile.js.map +1 -1
  141. package/dist/src/modules/workspace/types.d.ts +8 -0
  142. package/dist/src/modules/workspace/types.d.ts.map +1 -1
  143. package/dist/src/modules/workspace/types.js.map +1 -1
  144. package/dist/src/modules/workspace/watcher.d.ts +7 -0
  145. package/dist/src/modules/workspace/watcher.d.ts.map +1 -1
  146. package/dist/src/modules/workspace/watcher.js +7 -5
  147. package/dist/src/modules/workspace/watcher.js.map +1 -1
  148. package/dist/src/notice-tags.d.ts +2 -0
  149. package/dist/src/notice-tags.d.ts.map +1 -1
  150. package/dist/src/notice-tags.js +2 -0
  151. package/dist/src/notice-tags.js.map +1 -1
  152. package/dist/src/recovery/discord-awareness-outbox.d.ts.map +1 -1
  153. package/dist/src/recovery/discord-awareness-outbox.js +1 -9
  154. package/dist/src/recovery/discord-awareness-outbox.js.map +1 -1
  155. package/dist/src/silent-heartbeat.d.ts +4 -2
  156. package/dist/src/silent-heartbeat.d.ts.map +1 -1
  157. package/dist/src/silent-heartbeat.js +7 -4
  158. package/dist/src/silent-heartbeat.js.map +1 -1
  159. package/dist/src/stored-injections.d.ts +4 -0
  160. package/dist/src/stored-injections.d.ts.map +1 -1
  161. package/dist/src/stored-injections.js +6 -0
  162. package/dist/src/stored-injections.js.map +1 -1
  163. package/dist/src/supplied-text.d.ts +2 -0
  164. package/dist/src/supplied-text.d.ts.map +1 -1
  165. package/dist/src/supplied-text.js +16 -7
  166. package/dist/src/supplied-text.js.map +1 -1
  167. package/dist/src/tool-result-guard.js +1 -1
  168. package/dist/src/tool-result-guard.js.map +1 -1
  169. package/dist/src/tune-out/coordinator.d.ts +368 -16
  170. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  171. package/dist/src/tune-out/coordinator.js +1224 -136
  172. package/dist/src/tune-out/coordinator.js.map +1 -1
  173. package/dist/src/tune-out/tools.d.ts +115 -7
  174. package/dist/src/tune-out/tools.d.ts.map +1 -1
  175. package/dist/src/tune-out/tools.js +55 -18
  176. package/dist/src/tune-out/tools.js.map +1 -1
  177. package/dist/src/types/agent.d.ts +27 -1
  178. package/dist/src/types/agent.d.ts.map +1 -1
  179. package/dist/src/types/framework.d.ts +153 -15
  180. package/dist/src/types/framework.d.ts.map +1 -1
  181. package/dist/src/types/module.d.ts +42 -3
  182. package/dist/src/types/module.d.ts.map +1 -1
  183. package/dist/src/types/trace.d.ts +140 -3
  184. package/dist/src/types/trace.d.ts.map +1 -1
  185. package/package.json +4 -4
  186. package/src/admission/admit.ts +113 -0
  187. package/src/agent.ts +138 -31
  188. package/src/api/mcp-server-core.ts +10 -3
  189. package/src/author-presentation.ts +81 -0
  190. package/src/code-execution/isolate/render.ts +7 -6
  191. package/src/code-execution/isolate/scripts.ts +5 -4
  192. package/src/dendrite/index.ts +32 -0
  193. package/src/dendrite/presets.ts +149 -0
  194. package/src/dendrite/registry.ts +808 -0
  195. package/src/dendrite/types.ts +397 -0
  196. package/src/framework.ts +4344 -1052
  197. package/src/gate/event-gate.ts +251 -150
  198. package/src/gate/recipe-reconcile.ts +7 -5
  199. package/src/host-presentation.ts +14 -10
  200. package/src/index.ts +16 -2
  201. package/src/inference-bounds.ts +111 -0
  202. package/src/line-reader.ts +22 -5
  203. package/src/mcpl/channel-registry.ts +170 -60
  204. package/src/mcpl/errors.ts +4 -0
  205. package/src/mcpl/inbound-source.ts +2 -2
  206. package/src/mcpl/inference-router.ts +67 -10
  207. package/src/mcpl/modern-connection.ts +83 -68
  208. package/src/mcpl/protocol-family.ts +37 -4
  209. package/src/mcpl/push-coalescer.ts +21 -7
  210. package/src/mcpl/references.ts +3 -4
  211. package/src/mcpl/server-connection.ts +30 -21
  212. package/src/mcpl/tool-signature.ts +18 -11
  213. package/src/mcpl/toolsets-module.ts +7 -0
  214. package/src/mcpl/transport.ts +261 -60
  215. package/src/mcpl/types.ts +18 -1
  216. package/src/module-registry.ts +178 -25
  217. package/src/modules/discord/discord-js-client.ts +33 -29
  218. package/src/modules/sender-name.ts +8 -5
  219. package/src/modules/workspace/disk-agreement.ts +39 -15
  220. package/src/modules/workspace/index.ts +65 -14
  221. package/src/modules/workspace/observe.ts +51 -10
  222. package/src/modules/workspace/reconcile.ts +22 -8
  223. package/src/modules/workspace/types.ts +5 -0
  224. package/src/modules/workspace/watcher.ts +8 -6
  225. package/src/notice-tags.ts +2 -0
  226. package/src/recovery/discord-awareness-outbox.ts +1 -11
  227. package/src/silent-heartbeat.ts +7 -4
  228. package/src/stored-injections.ts +7 -0
  229. package/src/supplied-text.ts +17 -6
  230. package/src/tool-result-guard.ts +1 -1
  231. package/src/tune-out/coordinator.ts +1374 -141
  232. package/src/tune-out/tools.ts +166 -13
  233. package/src/types/agent.ts +30 -1
  234. package/src/types/framework.ts +157 -15
  235. package/src/types/module.ts +42 -3
  236. package/src/types/trace.ts +154 -3
@@ -24,6 +24,96 @@ export declare const TUNE_OUT_DEFAULTS: {
24
24
  readonly backlogCap: 200;
25
25
  readonly maxWakes: 5;
26
26
  };
27
+ /**
28
+ * One backlog line: author, then the message's blocks in order — text as
29
+ * is, anything else named by kind (`[image]`, `[document]`), so a release
30
+ * never drops a block silently (#232 gap 4). The author is named once: a
31
+ * server that renders `Name: body` into the text itself is not doubled.
32
+ * A name the line adds is a value someone supplied, kept to one line with
33
+ * its notice openings marked (authorLine), as main's dump writes it.
34
+ */
35
+ export declare function renderHeldLine(m: Pick<StoredMessage, 'participant' | 'content' | 'metadata'>): string;
36
+ /** One reader invocation under `reader: 'forks'` (see SubconsciousConfig). */
37
+ export interface ReaderInvocation {
38
+ serverId: string;
39
+ channelId: string;
40
+ epochId: string;
41
+ trigger: 'cadence' | 'wake' | 'cancel';
42
+ /** The host-framed notice for this invocation (bracket style). */
43
+ notice: string;
44
+ /** Held messages not yet handed to any reader fork, oldest first. */
45
+ backlog: StoredMessage[];
46
+ /**
47
+ * Held messages not yet handed to any reader fork that are still queued
48
+ * behind the resident's turn (admitted, not yet stored), oldest first.
49
+ * They come after `backlog` in arrival order. A reader is most useful
50
+ * while the resident is busy, which is exactly when its traffic is here
51
+ * rather than in the store.
52
+ */
53
+ queued: QueuedHeldMessage[];
54
+ /** Standing dispositions, as text, or null when there are none. */
55
+ dispositions: string | null;
56
+ }
57
+ /**
58
+ * A held message admitted for the resident but not yet in its store: it was
59
+ * deferred while a turn was alive. `writeId` is the deferred write's durable
60
+ * id, which the stored row carries as `metadata.deferredWriteId` once it
61
+ * lands.
62
+ */
63
+ export type QueuedHeldMessage = Pick<StoredMessage, 'participant' | 'content' | 'metadata'> & {
64
+ writeId: string;
65
+ /** When the framework first held the write, in ms since the epoch. */
66
+ heldAt?: number;
67
+ };
68
+ /**
69
+ * The all-except scope (issue #232 §3.2; focus folded into tune-out): a
70
+ * resident-level policy epoch holding every channel but one, for a bounded
71
+ * time. It covers DMs and channels registered after entry, since the
72
+ * decision is "not the exception" rather than a per-channel state.
73
+ */
74
+ export interface AllExceptParams {
75
+ epochId: string;
76
+ except: {
77
+ serverId: string;
78
+ channelId: string;
79
+ };
80
+ cadenceSeconds: number;
81
+ /** Per held channel, at release. */
82
+ backlogCap: number;
83
+ /** Reader wakes before the reader is paused (the hold itself stays). */
84
+ maxWakes: number;
85
+ startedAtSequence: number;
86
+ startedAtMs: number;
87
+ /** Mandatory: the scope always ends on its own. */
88
+ expiresAtMs: number;
89
+ source: string;
90
+ }
91
+ export interface AllExceptState {
92
+ params: AllExceptParams;
93
+ wakeCount: number;
94
+ }
95
+ /** `check`: what is held right now, without releasing anything. */
96
+ export interface TuneOutCheck {
97
+ allExcept: {
98
+ epochId: string;
99
+ except: {
100
+ serverId: string;
101
+ channelId: string;
102
+ };
103
+ expiresAtMs: number;
104
+ wakeCount: number;
105
+ held: Record<string, number>;
106
+ } | null;
107
+ channels: Array<{
108
+ serverId: string;
109
+ channelId: string;
110
+ epochId: string;
111
+ held: number;
112
+ expiresAtMs?: number;
113
+ }>;
114
+ /** Up to `peekLimit` newest held lines of the peeked channel, oldest first. */
115
+ peek?: string[];
116
+ }
27
117
  /**
28
118
  * tune_out's refusal of a channel already tuned out: its settings, then what
29
119
  * its transport is now where the repeat tried to open it again (`transport`,
@@ -35,8 +125,20 @@ export interface TuneOutFrameworkHooks {
35
125
  addMessage: (participant: string, content: ContentBlock[], metadata?: Record<string, unknown>, forAgent?: string) => string;
36
126
  /** Queue an inference request for an agent. */
37
127
  requestInference: (agentName: string, reason: string, source: string) => void;
38
- /** The subconscious's registry/participant name. */
128
+ /** The persistent subconscious's registry/participant name, or null. */
39
129
  subconsciousName: () => string | null;
130
+ /**
131
+ * `reader: 'forks'`: derive and run one reader fork. Absent in persistent
132
+ * mode. The framework owns the fork's lifecycle; the coordinator owns the
133
+ * epoch.
134
+ */
135
+ invokeReader?: (invocation: ReaderInvocation) => void;
136
+ /**
137
+ * `reader: 'forks'`: deliver a reader fork's own words to the resident
138
+ * as attributed mail (its name, its incarnation). Absent in persistent
139
+ * mode, where the subconscious writes under its own name directly.
140
+ */
141
+ deliverFromReader?: (reader: string, content: ContentBlock[], metadata: Record<string, unknown>) => void;
40
142
  /** The primary resident's registry name. */
41
143
  primaryName: () => string | null;
42
144
  /** Read the primary's stored messages (shared slot, unfiltered). */
@@ -46,7 +148,17 @@ export interface TuneOutFrameworkHooks {
46
148
  * while a turn was alive), oldest first. A cancel reads them too, so a
47
149
  * message held mid-turn is in the backlog it belongs to (#232 gap 7).
48
150
  */
49
- getDeferredMessages?: () => Array<Pick<StoredMessage, 'participant' | 'content' | 'metadata'>>;
151
+ getDeferredMessages?: () => Array<Pick<StoredMessage, 'participant' | 'content' | 'metadata'> & {
152
+ writeId?: string;
153
+ heldAt?: number;
154
+ }>;
155
+ commitDeliveries?: () => boolean;
156
+ /**
157
+ * The history-reading tool the resident actually has (e.g. a server's
158
+ * `fetch_history`), or null. A truncation note names it only when it exists
159
+ * (#232 gap 11).
160
+ */
161
+ historyTool?: () => string | null;
50
162
  /**
51
163
  * The most characters of text every reader of the residents' shared slot
52
164
  * is shown whole in one message: the smallest of their strategies'
@@ -65,6 +177,22 @@ export interface TuneOutFrameworkHooks {
65
177
  isPrivilegedAuthor: (authorId: string | null | undefined) => boolean;
66
178
  /** speak_in_channel master switch (recipe-side, canary-gated). */
67
179
  allowChannelSpeech: () => boolean;
180
+ /**
181
+ * Whether a tune-out may hold a channel with no reader at all — a silent
182
+ * hold (issue #232 §3.3), which the host opts into (`tuneOut.enabled`).
183
+ * Left out, or false, a hold with no reader is refused.
184
+ */
185
+ holdWithoutReader?: () => boolean;
186
+ /**
187
+ * Post a line into a channel under the resident's name. Used for the
188
+ * all-except scope's entry and release announcements in the excepted
189
+ * channel (Linn, 2026-10-12: the room should hear the door shut, not
190
+ * discover it). Absent when `tuneOut.announce` is off.
191
+ */
192
+ announce?: (serverId: string, channelId: string, text: string) => Promise<{
193
+ success: boolean;
194
+ error?: string;
195
+ }>;
68
196
  emitTrace: (event: {
69
197
  type: string;
70
198
  [key: string]: unknown;
@@ -83,10 +211,68 @@ export declare class TuneOutCoordinator {
83
211
  private expiryTimers;
84
212
  /** Channels with a wake invocation pending inside the coalescing window. */
85
213
  private pendingWakes;
86
- /** Diverted-message tallies since the last subconscious invocation, per channel key. */
214
+ /**
215
+ * Held messages the channel's reader hasn't looked at, per channel key:
216
+ * what makes a cadence period worth a look. Counted up as messages are
217
+ * held and back to zero at each look; rebuilt from the held rows where
218
+ * memory can't know it (rebuildTally): after a restart, and when a
219
+ * channel's own tune-out ends while the all-except hold still holds it.
220
+ * A failed reader fork's messages count again (readerFailed).
221
+ */
87
222
  private divertedSinceInvocation;
223
+ /**
224
+ * The persistent subconscious's last look at each held channel, per epoch:
225
+ * the store's sequence when the look was asked for. Durable, so that after
226
+ * a restart its next look counts only what was held since (rebuildTally).
227
+ * Reader forks need none: what they were handed is in memory, and after a
228
+ * restart the first fork of an epoch is handed all it has held.
229
+ */
230
+ private lastLooksCache;
231
+ /**
232
+ * `reader: 'forks'`: the highest sequence of a held message already
233
+ * handed to a reader fork, per epoch and channel (handOffKey). Each held
234
+ * message is delivered to exactly one fork. A channel the all-except hold
235
+ * holds can be taken by a tune-out of its own and given back, and each
236
+ * epoch's readers read that epoch's messages, so what one epoch's readers
237
+ * were handed never moves or clears the other's. In-memory: after a
238
+ * restart the first fork of an epoch is handed everything the epoch has
239
+ * held, which is the right side to err on.
240
+ */
241
+ private readerCursor;
242
+ /**
243
+ * `reader: 'forks'`: the deferred writes handed to a reader fork while
244
+ * still queued, per epoch and channel. Each lands in the store later as a row
245
+ * stamped with the same id (`metadata.deferredWriteId`), past the cursor;
246
+ * that row is not handed again. Cleared with the cursor.
247
+ */
248
+ private readerHandedWrites;
249
+ /**
250
+ * `reader: 'forks'`: held messages a reader fork was handed but never read,
251
+ * per epoch and channel: its derive failed, or its run threw before it reported
252
+ * (readerFailed). The next invocation is handed them again, cursor or no:
253
+ * stored rows by id, and by write id those that were queued when handed
254
+ * (stored or still queued now). Cleared with the cursor.
255
+ */
256
+ private readerReturned;
257
+ /**
258
+ * `reader: 'forks'`: the late forks derived for an ended epoch's messages
259
+ * (readerFailed), so that a late fork's own failure derives no other.
260
+ */
261
+ private lateForks;
262
+ /** The all-except scope's durable record, cached (undefined = not read yet). */
263
+ private scopeCache;
264
+ /** Timer key for the scope's cadence and expiry. */
265
+ private static readonly SCOPE_KEY;
88
266
  constructor(channelRegistry: ChannelRegistry, serverRegistry: McplServerRegistry, hooks: TuneOutFrameworkHooks);
89
267
  private key;
268
+ /** The readers' hand-off bookkeeping's key: one epoch's reading of one channel. */
269
+ private handOffKey;
270
+ /** An ended epoch's hand-off bookkeeping goes with it, every channel's. */
271
+ private dropHandOffs;
272
+ /** A reader exists: the persistent subconscious, or forks on demand. */
273
+ private readerAvailable;
274
+ /** Reader forks are the configured reader. */
275
+ private get forkReader();
90
276
  /** A channel as the resident and the subconscious are shown it
91
277
  * (ChannelRegistry.nameShown): its id, or, where another server registers
92
278
  * the same id, its server-qualified name, which tune_out and
@@ -102,11 +288,24 @@ export declare class TuneOutCoordinator {
102
288
  * host process. */
103
289
  private timerFailed;
104
290
  private listActive;
291
+ /**
292
+ * The options a tune-out call gives, read as numbers before anything
293
+ * changes (F76). A tool's input reaches here as the model wrote it, and
294
+ * the store can't keep a NaN or an Infinity: its append would throw after
295
+ * the registry had marked the channel tuned out. So each option is read
296
+ * as a number first, a numeric string included, as the sleep tool reads
297
+ * its seconds; null counts as left out. A value that gives no finite
298
+ * number is refused, naming the option and, where it can be left out,
299
+ * what leaving it out means; so is a duration whose end time is too far
300
+ * off to store. `now` is the clock the end time was counted from. One
301
+ * rule for a channel's tune-out and the all-except hold.
302
+ */
303
+ private readOptions;
105
304
  enter(serverId: string, channelId: string, opts: {
106
- cadenceSeconds?: number;
107
- backlogCap?: number;
108
- maxWakes?: number;
109
- durationSeconds?: number;
305
+ cadenceSeconds?: unknown;
306
+ backlogCap?: unknown;
307
+ maxWakes?: unknown;
308
+ durationSeconds?: unknown;
110
309
  }, source: string): {
111
310
  ok: true;
112
311
  params: TuneOutParams;
@@ -115,14 +314,13 @@ export declare class TuneOutCoordinator {
115
314
  error: string;
116
315
  alreadyTunedOut?: true;
117
316
  };
118
- /**
119
- * End a tune-out: durable flip, system-framed backlog dump into the
120
- * resident's window (capped), lifecycle notice, one wake for the
121
- * resident. `subconsciousNote` is the subconscious's own text (from its
122
- * cancel_tuneout call) — delivered verbatim under its name, never
123
- * synthesized here.
124
- */
125
- cancel(serverId: string, channelId: string, source: string, reason: string, subconsciousNote?: string): {
317
+ /** Whether a reader (persistent subconscious or reader forks) attends holds. */
318
+ hasReader(): boolean;
319
+ cancel(serverId: string, channelId: string, source: string, reason: string, subconsciousNote?: string,
320
+ /** `reader: 'forks'`: the reader fork whose note this is. */
321
+ noteAuthor?: string,
322
+ /** The lifecycle state the channel returns to (a tool close ends in 'closed'). */
323
+ nextState?: 'open' | 'closed'): {
126
324
  ok: true;
127
325
  } | {
128
326
  ok: false;
@@ -139,6 +337,69 @@ export declare class TuneOutCoordinator {
139
337
  onIncoming(serverId: string, channelId: string, messageId: string, tags: string[] | undefined, authorId?: string, gatePass?: boolean): {
140
338
  epochId: string;
141
339
  } | null;
340
+ /** The epoch holding this channel, or null. Pure: the admission stage's lookup. */
341
+ holdFor(serverId: string, channelId: string): {
342
+ epochId: string;
343
+ } | null;
344
+ /** The channel unprefixed speech lands in while an all-except hold is active, with its server, else null. */
345
+ focusChannel(): ChannelRef | null;
346
+ private get scopeStateId();
347
+ getAllExcept(): AllExceptState | null;
348
+ private writeScope;
349
+ enterAllExcept(except: {
350
+ serverId: string;
351
+ channelId: string;
352
+ }, opts: {
353
+ cadenceSeconds?: unknown;
354
+ backlogCap?: unknown;
355
+ maxWakes?: unknown;
356
+ durationSeconds?: unknown;
357
+ }, source: string): {
358
+ ok: true;
359
+ params: AllExceptParams;
360
+ } | {
361
+ ok: false;
362
+ error: string;
363
+ };
364
+ /** Whether entry and release of the all-except scope are announced in the excepted channel. */
365
+ announces(): boolean;
366
+ /**
367
+ * The excepted channel hears the scope open and close: one bracketed line
368
+ * under the resident's name, posted through the same path as a publish.
369
+ * Fire-and-forget; the outcome is traced, never awaited by the epoch flip.
370
+ */
371
+ private announce;
372
+ /** The scope's end time and cadence, on timers no longer than one holds
373
+ * (deadline-timer), as a channel's tune-out arms its own. */
374
+ private armScopeTimers;
375
+ private clearScopeTimers;
376
+ /** Channels held by the scope (not by their own epoch) with the count held under it. */
377
+ private scopeHeldCounts;
378
+ cancelAllExcept(source: string, reason: string, note?: string, noteAuthor?: string): {
379
+ ok: true;
380
+ } | {
381
+ ok: false;
382
+ error: string;
383
+ };
384
+ /** What is held right now — per-channel epochs and the scope — without releasing. */
385
+ check(opts?: {
386
+ peek?: {
387
+ serverId?: string;
388
+ channelId: string;
389
+ };
390
+ peekLimit?: number;
391
+ }): TuneOutCheck;
392
+ /**
393
+ * Bookkeeping for one held message, after admission decided the hold:
394
+ * the cadence tally, the deterministic acknowledgement of a suppressed
395
+ * mention, and the reader wake when the resident's gate would have woken
396
+ * them (`gatePass` is that verdict, probed without side effects).
397
+ */
398
+ recordHeld(serverId: string, channelId: string, messageId: string, tags: string[] | undefined, authorId?: string, gatePass?: boolean): void;
399
+ /** Reader forks that reported through `deliver_summary` (so their trailing prose is not a second report). */
400
+ private readerReports;
401
+ readerReported(reader: string): boolean;
402
+ forgetReader(reader: string): void;
142
403
  private acknowledgeSuppressed;
143
404
  private startCadence;
144
405
  /** Clear a channel's tune-out timers: its cadence, its end time and a wake
@@ -146,12 +407,82 @@ export declare class TuneOutCoordinator {
146
407
  private clearTimers;
147
408
  private stopCadence;
148
409
  private scheduleWakeInvocation;
410
+ private cancelPastBudget;
411
+ /** One coalesced wake: counted durably against the epoch that holds the channel. */
412
+ private fireWake;
149
413
  /**
150
414
  * One subconscious turn: a system-framed trigger notice (bracket style —
151
415
  * what happened, never what to say) plus standing dispositions, then an
152
416
  * inference request. The merged view supplies the actual traffic.
153
417
  */
154
418
  private invokeSubconscious;
419
+ /**
420
+ * Count again, from the held messages, stored or still queued behind the
421
+ * resident's turn, those the reader of the epoch holding this channel now
422
+ * hasn't looked at: for reader forks, those no fork was handed; for the
423
+ * persistent subconscious, the stored ones held since its last look
424
+ * (lastLooks) and every queued one, which no view of it can show yet.
425
+ * Nothing holding the channel leaves no count.
426
+ */
427
+ private rebuildTally;
428
+ private get lastLooksStateId();
429
+ /**
430
+ * The stored last looks. Where they can't be read, none: every held row
431
+ * counts, and nothing is cached, so the next read tries again. Nor is
432
+ * anything written back over the stored record then (markLook, dropLooks,
433
+ * pruneLooks), which would erase the other epochs' and channels' looks.
434
+ */
435
+ private lastLooks;
436
+ private writeLooks;
437
+ private markLook;
438
+ /** An ended epoch's last looks go with it. */
439
+ private dropLooks;
440
+ /** At boot: the last looks of epochs no longer active go. */
441
+ private pruneLooks;
442
+ /**
443
+ * `reader: 'forks'`: hand the framework one invocation. The backlog is
444
+ * the epoch's held messages not yet handed to any fork — each is
445
+ * delivered to exactly one reader — stored ones first, then those still
446
+ * queued behind the resident's turn, plus the standing dispositions. A
447
+ * cadence look with nothing new is skipped. True when a fork was asked for.
448
+ */
449
+ private invokeReaderFork;
450
+ /**
451
+ * What no reader fork has read yet, of the given held messages: the stored
452
+ * ones past the epoch's cursor for the channel, less those a fork was handed while they
453
+ * were still queued, plus those a failed fork returned, oldest first; then
454
+ * the queued ones no fork was handed, or a failed fork returned.
455
+ */
456
+ private unhandedBacklog;
457
+ /**
458
+ * A reader fork that never read what it was handed: its derive failed, or
459
+ * its run threw before it reported. While the epoch that held the
460
+ * messages is still active, they go back to that epoch's backlog for the
461
+ * channel, and its next invocation for the channel is handed them: the
462
+ * scope's while the scope is active, though the channel's own tune-out
463
+ * has taken the channel meanwhile, and a channel's own tune-out's while it
464
+ * holds the channel. Once the epoch has ended, its cancel's last fork was
465
+ * handed only what no fork had been, so a fork still running then is the
466
+ * only reader its messages had: one late fork is handed them instead
467
+ * (lateFork). Returns how many went back or to the late fork.
468
+ */
469
+ readerFailed(invocation: Pick<ReaderInvocation, 'serverId' | 'channelId' | 'epochId' | 'backlog' | 'queued'>): number;
470
+ /**
471
+ * A fork that failed after its epoch ended: one late fork is handed what it
472
+ * was, with a notice saying a reader handed them failed after the tune-out
473
+ * ended. Those still queued when it was handed that have landed since are
474
+ * handed as stored. A late fork's own failure derives no other, so a
475
+ * reader that keeps failing costs one more fork, not a chain of them.
476
+ * Returns how many the late fork was handed.
477
+ */
478
+ private lateFork;
479
+ /**
480
+ * The held messages still queued behind the resident's turn that `keep`
481
+ * keeps, oldest first, with their write ids. One the host gives no id for
482
+ * is left to reach a reader once it is stored: without the id, its stored
483
+ * row couldn't be told from a message no reader has had.
484
+ */
485
+ private queuedHeld;
155
486
  private dispositionsCache;
156
487
  private get dispositionsStateId();
157
488
  /**
@@ -174,12 +505,27 @@ export declare class TuneOutCoordinator {
174
505
  noteDisposition(key: string, text: string): void;
175
506
  handleSubconsciousTool(name: string, input: Record<string, unknown>,
176
507
  /** The calling turn's own channels, for a call made inside it (the framework's callOwnChannels). */
177
- own?: readonly ChannelRef[]): Promise<{
508
+ own?: readonly ChannelRef[],
509
+ /** The calling agent: the persistent subconscious, or a reader fork. */
510
+ caller?: string,
511
+ /** A reader fork, with the epoch it was derived to read, if any: it ends and posts only through that epoch's
512
+ * hold (forkRefusal). The persistent subconscious, which reads every epoch, passes none. */
513
+ fork?: {
514
+ epochId?: string;
515
+ }): Promise<{
178
516
  success: boolean;
179
517
  data?: unknown;
180
518
  error?: string;
181
519
  isError?: boolean;
182
520
  }>;
521
+ /**
522
+ * Why a reader fork may not act through `hold` (the epoch holding what its
523
+ * call names, or null): a fork ends and posts only through the hold of the
524
+ * epoch it was derived to read, and one derived for none acts through no
525
+ * hold. Undefined where the hold is its own. `why` says, for the fork, how
526
+ * what its call names isn't its own hold; its reports stay open to it.
527
+ */
528
+ private forkRefusal;
183
529
  /**
184
530
  * A cancel of a channel that isn't tuned out, by the name, quoted, the caller gave
185
531
  * or knows it by: which channels are, so the next call can name one, and
@@ -192,6 +538,12 @@ export declare class TuneOutCoordinator {
192
538
  * registered channels too), and the text claims nothing about it.
193
539
  */
194
540
  private notTunedOut;
541
+ /**
542
+ * The reader ended, not the framework: its turns stop (cadence and
543
+ * coalescing wakes), and every hold keeps its end time, which releases it
544
+ * to the resident with no reader.
545
+ */
546
+ stopReader(): void;
195
547
  /** Stop all timers (framework shutdown). */
196
548
  stop(): void;
197
549
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../src/tune-out/coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIrE,yCAAyC;AACzC,eAAO,MAAM,iBAAiB;aAC5B,cAAc,EAAE,IAAI;aACpB,UAAU,EAAE,GAAG;aACf,QAAQ,EAAE,CAAC;CACH,CAAC;AAYX;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAA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