@animalabs/agent-framework 0.31.0 → 0.33.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 (298) hide show
  1. package/README.md +204 -14
  2. package/dist/src/admission/admit.d.ts +18 -0
  3. package/dist/src/admission/admit.d.ts.map +1 -1
  4. package/dist/src/admission/admit.js +16 -3
  5. package/dist/src/admission/admit.js.map +1 -1
  6. package/dist/src/agent.d.ts +185 -78
  7. package/dist/src/agent.d.ts.map +1 -1
  8. package/dist/src/agent.js +279 -102
  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 +50 -12
  12. package/dist/src/api/mcp-server-core.js.map +1 -1
  13. package/dist/src/api/server.d.ts.map +1 -1
  14. package/dist/src/api/server.js +4 -20
  15. package/dist/src/api/server.js.map +1 -1
  16. package/dist/src/code-execution/isolate/scripts.d.ts +12 -8
  17. package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
  18. package/dist/src/code-execution/isolate/scripts.js +24 -0
  19. package/dist/src/code-execution/isolate/scripts.js.map +1 -1
  20. package/dist/src/config-checks.d.ts +7 -0
  21. package/dist/src/config-checks.d.ts.map +1 -1
  22. package/dist/src/config-checks.js +14 -0
  23. package/dist/src/config-checks.js.map +1 -1
  24. package/dist/src/context-manager-errors.d.ts +25 -0
  25. package/dist/src/context-manager-errors.d.ts.map +1 -0
  26. package/dist/src/context-manager-errors.js +31 -0
  27. package/dist/src/context-manager-errors.js.map +1 -0
  28. package/dist/src/context-options.d.ts +67 -0
  29. package/dist/src/context-options.d.ts.map +1 -0
  30. package/dist/src/context-options.js +85 -0
  31. package/dist/src/context-options.js.map +1 -0
  32. package/dist/src/deferred-import.d.ts +93 -0
  33. package/dist/src/deferred-import.d.ts.map +1 -0
  34. package/dist/src/deferred-import.js +177 -0
  35. package/dist/src/deferred-import.js.map +1 -0
  36. package/dist/src/dendrite/audience.d.ts +223 -0
  37. package/dist/src/dendrite/audience.d.ts.map +1 -0
  38. package/dist/src/dendrite/audience.js +202 -0
  39. package/dist/src/dendrite/audience.js.map +1 -0
  40. package/dist/src/dendrite/index.d.ts +5 -3
  41. package/dist/src/dendrite/index.d.ts.map +1 -1
  42. package/dist/src/dendrite/index.js +2 -1
  43. package/dist/src/dendrite/index.js.map +1 -1
  44. package/dist/src/dendrite/presets.d.ts +10 -5
  45. package/dist/src/dendrite/presets.d.ts.map +1 -1
  46. package/dist/src/dendrite/presets.js +17 -5
  47. package/dist/src/dendrite/presets.js.map +1 -1
  48. package/dist/src/dendrite/registry.d.ts +62 -7
  49. package/dist/src/dendrite/registry.d.ts.map +1 -1
  50. package/dist/src/dendrite/registry.js +179 -10
  51. package/dist/src/dendrite/registry.js.map +1 -1
  52. package/dist/src/dendrite/types.d.ts +91 -8
  53. package/dist/src/dendrite/types.d.ts.map +1 -1
  54. package/dist/src/foreign-rounds.d.ts +69 -0
  55. package/dist/src/foreign-rounds.d.ts.map +1 -0
  56. package/dist/src/foreign-rounds.js +152 -0
  57. package/dist/src/foreign-rounds.js.map +1 -0
  58. package/dist/src/framework.d.ts +1977 -820
  59. package/dist/src/framework.d.ts.map +1 -1
  60. package/dist/src/framework.js +7571 -3457
  61. package/dist/src/framework.js.map +1 -1
  62. package/dist/src/gate/event-gate.d.ts +85 -15
  63. package/dist/src/gate/event-gate.d.ts.map +1 -1
  64. package/dist/src/gate/event-gate.js +421 -47
  65. package/dist/src/gate/event-gate.js.map +1 -1
  66. package/dist/src/gate/index.d.ts +1 -1
  67. package/dist/src/gate/index.d.ts.map +1 -1
  68. package/dist/src/gate/index.js.map +1 -1
  69. package/dist/src/gate/rule-scope.d.ts +30 -0
  70. package/dist/src/gate/rule-scope.d.ts.map +1 -0
  71. package/dist/src/gate/rule-scope.js +41 -0
  72. package/dist/src/gate/rule-scope.js.map +1 -0
  73. package/dist/src/gate/suppress-script-worker.d.ts +2 -0
  74. package/dist/src/gate/suppress-script-worker.d.ts.map +1 -0
  75. package/dist/src/gate/suppress-script-worker.js +103 -0
  76. package/dist/src/gate/suppress-script-worker.js.map +1 -0
  77. package/dist/src/gate/suppress-scripts.d.ts +105 -0
  78. package/dist/src/gate/suppress-scripts.d.ts.map +1 -0
  79. package/dist/src/gate/suppress-scripts.js +403 -0
  80. package/dist/src/gate/suppress-scripts.js.map +1 -0
  81. package/dist/src/gate/suppression-review.d.ts +143 -0
  82. package/dist/src/gate/suppression-review.d.ts.map +1 -0
  83. package/dist/src/gate/suppression-review.js +463 -0
  84. package/dist/src/gate/suppression-review.js.map +1 -0
  85. package/dist/src/gate/suppression-stats.d.ts +125 -0
  86. package/dist/src/gate/suppression-stats.d.ts.map +1 -0
  87. package/dist/src/gate/suppression-stats.js +214 -0
  88. package/dist/src/gate/suppression-stats.js.map +1 -0
  89. package/dist/src/gate/types.d.ts +135 -7
  90. package/dist/src/gate/types.d.ts.map +1 -1
  91. package/dist/src/gate/wake-onboarding.d.ts +119 -0
  92. package/dist/src/gate/wake-onboarding.d.ts.map +1 -0
  93. package/dist/src/gate/wake-onboarding.js +277 -0
  94. package/dist/src/gate/wake-onboarding.js.map +1 -0
  95. package/dist/src/held-writes.d.ts +31 -23
  96. package/dist/src/held-writes.d.ts.map +1 -1
  97. package/dist/src/held-writes.js +44 -59
  98. package/dist/src/held-writes.js.map +1 -1
  99. package/dist/src/index.d.ts +5 -2
  100. package/dist/src/index.d.ts.map +1 -1
  101. package/dist/src/index.js +3 -0
  102. package/dist/src/index.js.map +1 -1
  103. package/dist/src/jsonrpc-envelope.d.ts +69 -0
  104. package/dist/src/jsonrpc-envelope.d.ts.map +1 -0
  105. package/dist/src/jsonrpc-envelope.js +66 -0
  106. package/dist/src/jsonrpc-envelope.js.map +1 -0
  107. package/dist/src/mcpl/channel-registry.d.ts +131 -15
  108. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  109. package/dist/src/mcpl/channel-registry.js +290 -46
  110. package/dist/src/mcpl/channel-registry.js.map +1 -1
  111. package/dist/src/mcpl/checkpoint-manager.d.ts +2 -4
  112. package/dist/src/mcpl/checkpoint-manager.d.ts.map +1 -1
  113. package/dist/src/mcpl/checkpoint-manager.js.map +1 -1
  114. package/dist/src/mcpl/feature-set-manager.d.ts +2 -4
  115. package/dist/src/mcpl/feature-set-manager.d.ts.map +1 -1
  116. package/dist/src/mcpl/feature-set-manager.js.map +1 -1
  117. package/dist/src/mcpl/inbound-source.d.ts +2 -1
  118. package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
  119. package/dist/src/mcpl/inbound-source.js +2 -1
  120. package/dist/src/mcpl/inbound-source.js.map +1 -1
  121. package/dist/src/mcpl/inference-router.d.ts +6 -6
  122. package/dist/src/mcpl/inference-router.d.ts.map +1 -1
  123. package/dist/src/mcpl/inference-router.js.map +1 -1
  124. package/dist/src/mcpl/push-coalescer.d.ts +132 -22
  125. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  126. package/dist/src/mcpl/push-coalescer.js +105 -15
  127. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  128. package/dist/src/mcpl/push-handler.d.ts +9 -7
  129. package/dist/src/mcpl/push-handler.d.ts.map +1 -1
  130. package/dist/src/mcpl/push-handler.js.map +1 -1
  131. package/dist/src/mcpl/server-connection.d.ts +13 -10
  132. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  133. package/dist/src/mcpl/server-connection.js +134 -56
  134. package/dist/src/mcpl/server-connection.js.map +1 -1
  135. package/dist/src/mcpl/tool-classes.d.ts.map +1 -1
  136. package/dist/src/mcpl/tool-classes.js +3 -0
  137. package/dist/src/mcpl/tool-classes.js.map +1 -1
  138. package/dist/src/mcpl/types.d.ts +8 -2
  139. package/dist/src/mcpl/types.d.ts.map +1 -1
  140. package/dist/src/mcpl/types.js.map +1 -1
  141. package/dist/src/module-registry.d.ts +24 -1
  142. package/dist/src/module-registry.d.ts.map +1 -1
  143. package/dist/src/module-registry.js +68 -18
  144. package/dist/src/module-registry.js.map +1 -1
  145. package/dist/src/modules/discord/index.d.ts +45 -8
  146. package/dist/src/modules/discord/index.d.ts.map +1 -1
  147. package/dist/src/modules/discord/index.js +237 -86
  148. package/dist/src/modules/discord/index.js.map +1 -1
  149. package/dist/src/modules/history/index.d.ts +59 -0
  150. package/dist/src/modules/history/index.d.ts.map +1 -1
  151. package/dist/src/modules/history/index.js +432 -67
  152. package/dist/src/modules/history/index.js.map +1 -1
  153. package/dist/src/modules/history/semantic.d.ts +6 -5
  154. package/dist/src/modules/history/semantic.d.ts.map +1 -1
  155. package/dist/src/modules/history/semantic.js +15 -22
  156. package/dist/src/modules/history/semantic.js.map +1 -1
  157. package/dist/src/modules/workspace/disk-agreement.d.ts +1 -1
  158. package/dist/src/modules/workspace/disk-agreement.js +1 -1
  159. package/dist/src/modules/workspace/index.d.ts +28 -7
  160. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  161. package/dist/src/modules/workspace/index.js +76 -22
  162. package/dist/src/modules/workspace/index.js.map +1 -1
  163. package/dist/src/notice-tags.d.ts +10 -1
  164. package/dist/src/notice-tags.d.ts.map +1 -1
  165. package/dist/src/notice-tags.js +10 -1
  166. package/dist/src/notice-tags.js.map +1 -1
  167. package/dist/src/operator-log.d.ts +36 -3
  168. package/dist/src/operator-log.d.ts.map +1 -1
  169. package/dist/src/operator-log.js +2 -2
  170. package/dist/src/operator-log.js.map +1 -1
  171. package/dist/src/presentation.d.ts +746 -0
  172. package/dist/src/presentation.d.ts.map +1 -0
  173. package/dist/src/presentation.js +1435 -0
  174. package/dist/src/presentation.js.map +1 -0
  175. package/dist/src/prose-drafts.d.ts +15 -11
  176. package/dist/src/prose-drafts.d.ts.map +1 -1
  177. package/dist/src/prose-drafts.js +16 -12
  178. package/dist/src/prose-drafts.js.map +1 -1
  179. package/dist/src/read-marks.d.ts +192 -0
  180. package/dist/src/read-marks.d.ts.map +1 -0
  181. package/dist/src/read-marks.js +242 -0
  182. package/dist/src/read-marks.js.map +1 -0
  183. package/dist/src/recovery/offline-branch.d.ts +91 -6
  184. package/dist/src/recovery/offline-branch.d.ts.map +1 -1
  185. package/dist/src/recovery/offline-branch.js +273 -29
  186. package/dist/src/recovery/offline-branch.js.map +1 -1
  187. package/dist/src/recovery/recover-cli.js +22 -3
  188. package/dist/src/recovery/recover-cli.js.map +1 -1
  189. package/dist/src/send-tools.d.ts +5 -9
  190. package/dist/src/send-tools.d.ts.map +1 -1
  191. package/dist/src/send-tools.js +40 -7
  192. package/dist/src/send-tools.js.map +1 -1
  193. package/dist/src/stored-injections.d.ts +2 -2
  194. package/dist/src/stored-injections.js +2 -2
  195. package/dist/src/stored-removal.d.ts +17 -4
  196. package/dist/src/stored-removal.d.ts.map +1 -1
  197. package/dist/src/stored-removal.js +29 -5
  198. package/dist/src/stored-removal.js.map +1 -1
  199. package/dist/src/tool-result-guard.d.ts +12 -1
  200. package/dist/src/tool-result-guard.d.ts.map +1 -1
  201. package/dist/src/tool-result-guard.js +42 -8
  202. package/dist/src/tool-result-guard.js.map +1 -1
  203. package/dist/src/tune-out/coordinator.d.ts +1159 -79
  204. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  205. package/dist/src/tune-out/coordinator.js +3709 -363
  206. package/dist/src/tune-out/coordinator.js.map +1 -1
  207. package/dist/src/tune-out/tools.d.ts +114 -17
  208. package/dist/src/tune-out/tools.d.ts.map +1 -1
  209. package/dist/src/tune-out/tools.js +87 -27
  210. package/dist/src/tune-out/tools.js.map +1 -1
  211. package/dist/src/tune-out/window-anchor.d.ts +143 -0
  212. package/dist/src/tune-out/window-anchor.d.ts.map +1 -0
  213. package/dist/src/tune-out/window-anchor.js +202 -0
  214. package/dist/src/tune-out/window-anchor.js.map +1 -0
  215. package/dist/src/types/agent.d.ts +86 -31
  216. package/dist/src/types/agent.d.ts.map +1 -1
  217. package/dist/src/types/events.d.ts +2 -0
  218. package/dist/src/types/events.d.ts.map +1 -1
  219. package/dist/src/types/framework.d.ts +43 -21
  220. package/dist/src/types/framework.d.ts.map +1 -1
  221. package/dist/src/types/module.d.ts +180 -69
  222. package/dist/src/types/module.d.ts.map +1 -1
  223. package/dist/src/types/trace.d.ts +510 -36
  224. package/dist/src/types/trace.d.ts.map +1 -1
  225. package/package.json +3 -3
  226. package/src/admission/admit.ts +32 -3
  227. package/src/agent.ts +323 -120
  228. package/src/api/mcp-server-core.ts +54 -17
  229. package/src/api/server.ts +4 -23
  230. package/src/code-execution/isolate/scripts.ts +28 -3
  231. package/src/config-checks.ts +14 -0
  232. package/src/context-manager-errors.ts +37 -0
  233. package/src/context-options.ts +96 -0
  234. package/src/deferred-import.ts +239 -0
  235. package/src/dendrite/audience.ts +315 -0
  236. package/src/dendrite/index.ts +14 -2
  237. package/src/dendrite/presets.ts +18 -6
  238. package/src/dendrite/registry.ts +209 -12
  239. package/src/dendrite/types.ts +92 -8
  240. package/src/foreign-rounds.ts +199 -0
  241. package/src/framework.ts +7814 -3585
  242. package/src/gate/event-gate.ts +428 -65
  243. package/src/gate/index.ts +3 -0
  244. package/src/gate/rule-scope.ts +45 -0
  245. package/src/gate/suppress-script-worker.ts +89 -0
  246. package/src/gate/suppress-scripts.ts +414 -0
  247. package/src/gate/suppression-review.ts +517 -0
  248. package/src/gate/suppression-stats.ts +314 -0
  249. package/src/gate/types.ts +141 -7
  250. package/src/gate/wake-onboarding.ts +309 -0
  251. package/src/held-writes.ts +49 -60
  252. package/src/index.ts +9 -2
  253. package/src/jsonrpc-envelope.ts +81 -0
  254. package/src/mcpl/channel-registry.ts +353 -85
  255. package/src/mcpl/checkpoint-manager.ts +3 -2
  256. package/src/mcpl/feature-set-manager.ts +2 -1
  257. package/src/mcpl/inbound-source.ts +2 -1
  258. package/src/mcpl/inference-router.ts +7 -4
  259. package/src/mcpl/push-coalescer.ts +193 -34
  260. package/src/mcpl/push-handler.ts +10 -5
  261. package/src/mcpl/server-connection.ts +141 -60
  262. package/src/mcpl/tool-classes.ts +3 -0
  263. package/src/mcpl/types.ts +8 -2
  264. package/src/module-registry.ts +73 -17
  265. package/src/modules/discord/index.ts +229 -81
  266. package/src/modules/history/index.ts +439 -70
  267. package/src/modules/history/semantic.ts +15 -21
  268. package/src/modules/workspace/disk-agreement.ts +1 -1
  269. package/src/modules/workspace/index.ts +85 -23
  270. package/src/notice-tags.ts +10 -1
  271. package/src/operator-log.ts +36 -3
  272. package/src/presentation.ts +1676 -0
  273. package/src/prose-drafts.ts +16 -12
  274. package/src/read-marks.ts +328 -0
  275. package/src/recovery/offline-branch.ts +346 -32
  276. package/src/recovery/recover-cli.ts +21 -3
  277. package/src/send-tools.ts +40 -7
  278. package/src/stored-injections.ts +2 -2
  279. package/src/stored-removal.ts +31 -7
  280. package/src/tool-result-guard.ts +41 -7
  281. package/src/tune-out/coordinator.ts +4089 -457
  282. package/src/tune-out/tools.ts +160 -43
  283. package/src/tune-out/window-anchor.ts +277 -0
  284. package/src/types/agent.ts +90 -31
  285. package/src/types/events.ts +2 -0
  286. package/src/types/framework.ts +43 -21
  287. package/src/types/module.ts +181 -68
  288. package/src/types/trace.ts +542 -40
  289. package/dist/src/reasoning-loss-notice.d.ts +0 -23
  290. package/dist/src/reasoning-loss-notice.d.ts.map +0 -1
  291. package/dist/src/reasoning-loss-notice.js +0 -52
  292. package/dist/src/reasoning-loss-notice.js.map +0 -1
  293. package/dist/src/reasoning-loss.d.ts +0 -24
  294. package/dist/src/reasoning-loss.d.ts.map +0 -1
  295. package/dist/src/reasoning-loss.js +0 -102
  296. package/dist/src/reasoning-loss.js.map +0 -1
  297. package/src/reasoning-loss-notice.ts +0 -64
  298. package/src/reasoning-loss.ts +0 -120
@@ -0,0 +1,202 @@
1
+ import { WriteLandedError, WriteOutcomeUnknownError } from '../context-manager-errors.js';
2
+ import { suppressionRecordOf } from '../gate/suppression-stats.js';
3
+ import { isAnotherAgentsInjection } from '../stored-injections.js';
4
+ /** The metadata key listing who a row is for. */
5
+ export const AUDIENCE_KEY = 'audience';
6
+ /** The metadata key naming whose own row a row is. */
7
+ export const OWN_ROW_KEY = 'ownRowOf';
8
+ /**
9
+ * `metadata` stamped as a row meant for `audience`, and as nobody's own
10
+ * row: a stamp it carried is replaced. A new object; `metadata` is unchanged.
11
+ */
12
+ export function withAudience(metadata, audience) {
13
+ const { [OWN_ROW_KEY]: _replaced, ...rest } = (metadata ?? {});
14
+ return { ...rest, [AUDIENCE_KEY]: [...audience] };
15
+ }
16
+ /**
17
+ * `metadata` stamped as `owner`'s own row, meant for `owner` alone: a stamp
18
+ * it carried is replaced. A new object; `metadata` is unchanged.
19
+ */
20
+ export function asOwnRow(metadata, owner) {
21
+ return { ...(metadata ?? {}), [AUDIENCE_KEY]: [owner], [OWN_ROW_KEY]: owner };
22
+ }
23
+ /**
24
+ * The audience stamp a row's metadata carries, or undefined when it carries
25
+ * none (a row stored before the stamp existed) or carries one that isn't a
26
+ * list of names.
27
+ */
28
+ export function audienceOf(metadata) {
29
+ if (!metadata || typeof metadata !== 'object')
30
+ return undefined;
31
+ const audience = metadata[AUDIENCE_KEY];
32
+ if (!Array.isArray(audience) || !audience.every((name) => typeof name === 'string'))
33
+ return undefined;
34
+ const own = metadata[OWN_ROW_KEY];
35
+ return { audience: [...audience], ...(typeof own === 'string' ? { ownRowOf: own } : {}) };
36
+ }
37
+ /** Whether a row's metadata stamps it as `agent`'s own row. */
38
+ export function isOwnRowOf(metadata, agent) {
39
+ return audienceOf(metadata)?.ownRowOf === agent;
40
+ }
41
+ /**
42
+ * The admission record on a stored message: it was held from the residents
43
+ * by a policy epoch (`metadata.tuneOut = { epochId }`). ONE predicate for
44
+ * "held from the resident", read by the compiled-view filter, the mid-turn
45
+ * injection and the presentation index (#291) alike (#232 H1), so the window
46
+ * and the wire agree. Such a row is stamped for nobody (an empty audience),
47
+ * whatever store it lands in, unless its write names an agent whose own
48
+ * view keeps held traffic, such as the persistent subconscious, which it is
49
+ * for.
50
+ */
51
+ export const heldFromResidents = (metadata) => !!metadata?.tuneOut;
52
+ /**
53
+ * The suppression record on a stored message: a suppress rule took it as it
54
+ * arrived (`metadata.suppressed = { rule, eventType }`, stamped by addMessage
55
+ * from the gate's suppressionFor). ONE predicate for "never rendered", read
56
+ * by every view filter the framework sets (the residents', the
57
+ * subconscious's, and through them every derived view's, context-options.ts)
58
+ * and so by agentSees too: the compile, a tool boundary's injection and the
59
+ * arrival and unread checks agree. The presentation index (#291) presents
60
+ * such a row to nobody (bearingOf, observedRowFor), the reader of held
61
+ * traffic included, and addMessage stamps it for nobody (an empty
62
+ * audience). The stamp never changes, so the view stays deterministic per
63
+ * row, as context-manager's viewFilter requires.
64
+ */
65
+ export const suppressedRow = (metadata) => suppressionRecordOf(metadata) !== undefined;
66
+ /**
67
+ * Whether a row of a slot an agent observes is for that agent (#291,
68
+ * decision 1): what an observe edge shows of the slot it reads. `observer`
69
+ * is the agent the edge is on, and `owners` are the agents whose own slot it
70
+ * reads (the registry's `slotOwners`).
71
+ *
72
+ * - Another agent's stored context injection: no. It is that agent's
73
+ * context, not conversation, as every view of the framework's leaves out.
74
+ * - A row stored under the observer's own name: no. It is the observer's
75
+ * delivery into the slot (the subconscious's summary or note into the
76
+ * residents' slot), which its own round already holds.
77
+ * - A row a suppress rule hid (suppressedRow): no. It renders for no
78
+ * reader, the reader of held traffic included.
79
+ * - A row a tune-out holds: only through an edge that shows held traffic
80
+ * (`includeHeld`, the subconscious's).
81
+ * - A row with no audience stamp (stored before the stamp, or by a host's
82
+ * writer that doesn't stamp): yes, as the merged view showed it.
83
+ * - An owner's own row (its rounds, results, clock rows, notices about its
84
+ * own turn), and a row whose audience names an owner (channel traffic,
85
+ * mail, module rows): yes.
86
+ * - A row whose audience names the observer itself, and that is nobody's
87
+ * own row (an operator's message or a module's write addressed to the
88
+ * subconscious alone, which lands in the residents' slot it watches):
89
+ * yes. The edge is how the observer reads that slot, and the merged view
90
+ * showed the row before the presentation index, so no window would hold
91
+ * it otherwise (#291).
92
+ * - Anything else, such as the own row of an agent that doesn't own the
93
+ * slot (the observer's own included), a row stamped only for an agent
94
+ * that neither owns nor observes the slot, or one for a derived agent on
95
+ * another branch: no.
96
+ */
97
+ export function observedRowFor(edge, row, context) {
98
+ if (isAnotherAgentsInjection(row.metadata, context.observer))
99
+ return false;
100
+ if (row.participant === context.observer)
101
+ return false;
102
+ if (suppressedRow(row.metadata))
103
+ return false;
104
+ if (heldFromResidents(row.metadata))
105
+ return edge.includeHeld === true;
106
+ const stamp = audienceOf(row.metadata);
107
+ if (!stamp)
108
+ return true;
109
+ if (stamp.ownRowOf !== undefined)
110
+ return context.owners.includes(stamp.ownRowOf);
111
+ return stamp.audience.some((name) => name === context.observer || context.owners.includes(name));
112
+ }
113
+ /**
114
+ * Store a row in `agent`'s own context, stamped as its own row (asOwnRow).
115
+ * Every writer that stores into an agent's context directly, past the
116
+ * framework's `addMessage`, stores the agent's own rows through this, but
117
+ * the tool-result guard, which stamps the results it writes itself
118
+ * (asOwnRow, ToolResultGuard.storeResults) and tells its own-row sink of
119
+ * them, so none of them goes unstamped.
120
+ *
121
+ * With `present` (the default), the writer is told of the row once the add
122
+ * has returned (`ownRowsStored`), never from inside it, where a sharded body
123
+ * may still be storing its shards: under the presentation index (#291) that
124
+ * presents the row in the agent's window at once. That is right for a row
125
+ * the agent's stream carries (its round, its results, a notice injected at
126
+ * its boundary), one written before its next compile or after its stream's
127
+ * last request, and one written while the agent has no turn alive. A row
128
+ * written at another moment, where a turn the row isn't part of may be
129
+ * alive, passes `present: false`: it stays stored and out of the window,
130
+ * and the index's own-row sweep at the agent's next presentation point
131
+ * presents it there.
132
+ */
133
+ export function storeOwnRow(agent, participant, content, metadata, options, present = true) {
134
+ const cm = agent.getContextManager();
135
+ let id;
136
+ try {
137
+ id = cm.addMessage(participant, content, asOwnRow(metadata, agent.name), undefined, options);
138
+ }
139
+ catch (error) {
140
+ presentLandedThenRethrow(error, agent.name, present && agent.ownRowsStored ? (ids) => agent.ownRowsStored(ids) : undefined, cm.getMessage ? (row) => cm.getMessage(row) !== null : undefined);
141
+ }
142
+ if (present)
143
+ agent.ownRowsStored?.([id]);
144
+ return id;
145
+ }
146
+ /**
147
+ * The catch of a write of an agent's own row whose add threw (storeOwnRow,
148
+ * and the tool-result guard's two writes of the results row): the rows of
149
+ * the write the store holds are told to `told`, the own-row sink, as the
150
+ * write's id would have been, then the add's error is thrown on. The write
151
+ * is answered by that error, as before the presentation index: what its
152
+ * caller does on it is the caller's. A row of it that is stored is out of
153
+ * the window until presented, like any stored row, and presented here so
154
+ * that an own row written after it can't enter the window ahead of it.
155
+ *
156
+ * - WriteLandedError: its `landed` rows, in store order.
157
+ * - WriteOutcomeUnknownError: its `landed` rows, then those its `unknown`
158
+ * names (the store holds all of these or none) that `holds` reads as
159
+ * stored, as addMessage presents such a write's rows (presentedThoughUnknown
160
+ * in framework.ts, whose afterStore reads the rows too). Where that read
161
+ * throws, every row `unknown` names, as presentedThoughUnknown gives them:
162
+ * the sink keeps a row it can't present and presents it ahead of the next
163
+ * own row, dropping one the store doesn't hold (presentOwn), so a landed
164
+ * row isn't put behind an own row written after it. Without `holds`, its
165
+ * `landed` rows only.
166
+ * - Any other error: none of the write is stored, so nothing is told.
167
+ *
168
+ * Without `told` (a writer that holds its row back, storeOwnRow's
169
+ * `present: false`, or one with no sink) nothing is told. A sink that
170
+ * throws is logged; the add's error is the one thrown.
171
+ */
172
+ export function presentLandedThenRethrow(error, agentName, told, holds) {
173
+ const stored = told ? storedOfThrownWrite(error, holds) : [];
174
+ if (stored.length > 0) {
175
+ try {
176
+ told(stored);
177
+ }
178
+ catch (presentError) {
179
+ console.error(`[store] agent=${agentName}: a write's add threw with ${stored.length === 1 ? `its row ${stored[0]}` : `rows ${stored.join(', ')}`} ` +
180
+ 'stored, and telling its own-row sink of them threw too:', presentError);
181
+ }
182
+ }
183
+ throw error;
184
+ }
185
+ /** The rows of a write whose add threw that the store holds, by its error (presentLandedThenRethrow). */
186
+ function storedOfThrownWrite(error, holds) {
187
+ if (error instanceof WriteLandedError)
188
+ return [...error.landed];
189
+ if (!(error instanceof WriteOutcomeUnknownError))
190
+ return [];
191
+ let unknown = [];
192
+ if (holds && error.unknown.length > 0) {
193
+ try {
194
+ unknown = error.unknown.filter((id) => holds(id));
195
+ }
196
+ catch {
197
+ unknown = [...error.unknown];
198
+ }
199
+ }
200
+ return [...error.landed, ...unknown];
201
+ }
202
+ //# sourceMappingURL=audience.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audience.js","sourceRoot":"","sources":["../../../src/dendrite/audience.ts"],"names":[],"mappings":"AAmEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGnE,iDAAiD;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,sDAAsD;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAUtC;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAAqC,EAAE,QAA8B;IAChG,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAoB,CAAC;IAClF,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAqB,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAqC,EAAE,KAAgB;IAC9E,OAAO,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,KAAK,EAAqB,CAAC;AACnG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,QAAiB;IAC1C,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE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AAC;IAC9B,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;AACvC,CAAC"}
@@ -1,6 +1,8 @@
1
- export { AgentRegistry, AgentSpecError } from './registry.js';
2
- export type { AgentRegistryOptions, RestoreOutcome, ReconcileOutcome } from './registry.js';
1
+ export { AgentRegistry, AgentSpecError, RESIDENTS_SLOT, sameSlot, observedSlot } from './registry.js';
2
+ export type { AgentRegistryOptions, RegisterOptions, RestoreOutcome, ReconcileOutcome } from './registry.js';
3
3
  export { residentSpec, subconsciousSpec, conversationForkSpec, workerSpec, taskForkSpec, DEFAULT_TASK_IDLE_TIMEOUT_MS, } from './presets.js';
4
4
  export type { BoundedJobOptions } from './presets.js';
5
- export type { AgentName, AgentKind, AgentRoles, AgentLifetime, ActivationBounds, ParentEndPolicy, ResultRoute, ObserveEdge, AgentRelationships, ContextInheritance, AgentSpec, AgentEndReason, AgentRef, ActivationRecord, AgentRecord, HeldMail, RegistrySnapshot, EndOutcome, PolicyEpoch, } from './types.js';
5
+ export type { AgentName, AgentKind, AgentRoles, AgentLifetime, ActivationBounds, ParentEndPolicy, ResultRoute, MessageSlotRef, ObserveEdge, AgentRelationships, ContextInheritance, AgentSpec, AgentEndReason, AgentRef, ActivationRecord, AgentRecord, HeldMail, RegistrySnapshot, EndOutcome, PolicyEpoch, } from './types.js';
6
+ export { AUDIENCE_KEY, OWN_ROW_KEY, withAudience, asOwnRow, audienceOf, isOwnRowOf, observedRowFor, storeOwnRow, } from './audience.js';
7
+ export type { AudienceStamp, OwnRowWriter } from './audience.js';
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dendrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dendrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtG,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
@@ -1,3 +1,4 @@
1
- export { AgentRegistry, AgentSpecError } from './registry.js';
1
+ export { AgentRegistry, AgentSpecError, RESIDENTS_SLOT, sameSlot, observedSlot } from './registry.js';
2
2
  export { residentSpec, subconsciousSpec, conversationForkSpec, workerSpec, taskForkSpec, DEFAULT_TASK_IDLE_TIMEOUT_MS, } from './presets.js';
3
+ export { AUDIENCE_KEY, OWN_ROW_KEY, withAudience, asOwnRow, audienceOf, isOwnRowOf, observedRowFor, storeOwnRow, } from './audience.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dendrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dendrite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AAwBtB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,eAAe,CAAC"}
@@ -8,18 +8,23 @@ import type { AgentName, AgentSpec, ContextInheritance, ResultRoute } from './ty
8
8
  /** Default idle bound for a bounded job with no explicit deadline (matches the run watchdog). */
9
9
  export declare const DEFAULT_TASK_IDLE_TIMEOUT_MS: number;
10
10
  /**
11
- * A resident: persistent, declared in configuration, reads the residents'
12
- * shared message slot. The first one declared owns default delivery.
11
+ * A resident: persistent, declared in configuration, its own rows stored in
12
+ * the residents' shared message slot. The first one declared owns default
13
+ * delivery. `observes` names the other agents whose own rows its window
14
+ * takes (AgentConfig.observes): an observe edge on each, `{ agent }`, which
15
+ * reads that agent's own slot, the residents' slot it shares, and shows it
16
+ * that agent's own rows there (bearingOf). None by default.
13
17
  */
14
18
  export declare function residentSpec(name: AgentName, options: {
15
19
  primary: boolean;
20
+ observes?: readonly AgentName[];
16
21
  }): AgentSpec;
17
22
  /**
18
23
  * The subconscious: a persistent attention tenant of the resident it
19
24
  * serves. It persists across policy epochs (cancelling a tune-out ends a
20
- * channel's cadence, not this agent), observes the residents' slot with
21
- * held traffic included, is never a broadcast recipient, and ends with its
22
- * resident.
25
+ * channel's cadence, not this agent), stores its own rows in a slot of its
26
+ * own and observes the residents' slot with held traffic included, is never
27
+ * a broadcast recipient, and ends with its resident.
23
28
  */
24
29
  export declare function subconsciousSpec(name: AgentName, serves: AgentName): AgentSpec;
25
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/dendrite/presets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YA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CAAC;CACpC;AAwBD,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,iBAAsB,GAAG,SAAS,CAEtF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,iBAAiB,GAAG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAAE,GACxF,SAAS,CAOX"}
@@ -7,8 +7,12 @@
7
7
  /** Default idle bound for a bounded job with no explicit deadline (matches the run watchdog). */
8
8
  export const DEFAULT_TASK_IDLE_TIMEOUT_MS = 15 * 60_000;
9
9
  /**
10
- * A resident: persistent, declared in configuration, reads the residents'
11
- * shared message slot. The first one declared owns default delivery.
10
+ * A resident: persistent, declared in configuration, its own rows stored in
11
+ * the residents' shared message slot. The first one declared owns default
12
+ * delivery. `observes` names the other agents whose own rows its window
13
+ * takes (AgentConfig.observes): an observe edge on each, `{ agent }`, which
14
+ * reads that agent's own slot, the residents' slot it shares, and shows it
15
+ * that agent's own rows there (bearingOf). None by default.
12
16
  */
13
17
  export function residentSpec(name, options) {
14
18
  return {
@@ -21,6 +25,11 @@ export function residentSpec(name, options) {
21
25
  ownsProviderScheduling: true,
22
26
  },
23
27
  lifetime: { kind: 'persistent' },
28
+ ...(options.observes?.length ? { observes: options.observes.map((agent) => ({ agent })) } : {}),
29
+ ownSlot: { namespace: null },
30
+ // Deprecated: kept for one release beside ownSlot, which the registry
31
+ // reads first, for a host that reads the flag off a preset's spec or
32
+ // builds its specs from one.
24
33
  readsSharedSlot: true,
25
34
  namespace: `agents/${name}`,
26
35
  };
@@ -28,9 +37,9 @@ export function residentSpec(name, options) {
28
37
  /**
29
38
  * The subconscious: a persistent attention tenant of the resident it
30
39
  * serves. It persists across policy epochs (cancelling a tune-out ends a
31
- * channel's cadence, not this agent), observes the residents' slot with
32
- * held traffic included, is never a broadcast recipient, and ends with its
33
- * resident.
40
+ * channel's cadence, not this agent), stores its own rows in a slot of its
41
+ * own and observes the residents' slot with held traffic included, is never
42
+ * a broadcast recipient, and ends with its resident.
34
43
  */
35
44
  export function subconsciousSpec(name, serves) {
36
45
  return {
@@ -47,6 +56,9 @@ export function subconsciousSpec(name, serves) {
47
56
  onParentEnd: 'end',
48
57
  observes: [{ includeHeld: true }],
49
58
  resultTo: { to: serves, as: 'message' },
59
+ ownSlot: { namespace: `subconscious/${serves}` },
60
+ // Deprecated, as on residentSpec: it reads the residents' slot through
61
+ // its observe edge; its ownSlot places its rows.
50
62
  readsSharedSlot: true,
51
63
  namespace: `subconscious/${serves}`,
52
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../src/dendrite/presets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,iGAAiG;AACjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,MAAM,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe,EAAE,OAA6B;IACzE,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE;YACL,eAAe,EAAE,OAAO,CAAC,OAAO;YAChC,kBAAkB,EAAE,IAAI;YACxB,iBAAiB,EAAE,IAAI;YACvB,sBAAsB,EAAE,IAAI;SAC7B;QACD,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;QAChC,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,UAAU,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAe,EAAE,MAAiB;IACjE,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE;YACL,eAAe,EAAE,KAAK;YACtB,kBAAkB,EAAE,KAAK;YACzB,iBAAiB,EAAE,KAAK;YACxB,sBAAsB,EAAE,IAAI;SAC7B;QACD,Q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,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,YAAY,IAAI,EAAE;QAClD,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,UAAU,CAAC,IAAe,EAAE,OAAO,GAAsB,EAAE;IACzE,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAe,EACf,OAAyF;IAEzF,OAAO;QACL,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnF,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE;QACnE,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtF,CAAC;AACJ,CAAC"}
@@ -8,7 +8,7 @@
8
8
  * side effects. That split keeps every rule here testable without a store
9
9
  * and keeps the framework from re-deriving policy at each call site.
10
10
  */
11
- import type { AgentEndReason, AgentName, AgentRecord, AgentRef, AgentSpec, EndOutcome, HeldMail, RegistrySnapshot } from './types.js';
11
+ import type { AgentEndReason, AgentName, AgentRecord, AgentRef, AgentSpec, EndOutcome, HeldMail, MessageSlotRef, ObserveEdge, RegistrySnapshot } from './types.js';
12
12
  /** Thrown for a spec the registry refuses to load. */
13
13
  export declare class AgentSpecError extends Error {
14
14
  constructor(agent: string, problem: string);
@@ -51,6 +51,25 @@ export interface ReconcileOutcome {
51
51
  /** Persistent agents the previous process ran that this configuration no longer declares. */
52
52
  unconfigured: EndOutcome[];
53
53
  }
54
+ /** AgentRegistry.register's options (see there). */
55
+ export interface RegisterOptions {
56
+ resume?: boolean;
57
+ after?: number;
58
+ declaredWith?: readonly AgentName[];
59
+ }
60
+ /** The residents' shared un-namespaced slot, on the host's current branch. */
61
+ export declare const RESIDENTS_SLOT: Readonly<MessageSlotRef>;
62
+ /** Whether two refs name one slot: the same namespace on the same branch. */
63
+ export declare function sameSlot(a: MessageSlotRef | undefined, b: MessageSlotRef | undefined): boolean;
64
+ /**
65
+ * The slot an observe edge reads. An edge that names a slot reads that
66
+ * namespace on the host's current branch. One that names an agent and no
67
+ * slot reads that agent's own slot, wherever it is (a shared fork's is on its
68
+ * own branch), as `ownSlotOf` looks it up: undefined where the lookup doesn't
69
+ * know the agent, or none is given. The registry's `observedSlotOf` passes its
70
+ * records. An edge that names neither reads the residents' shared slot.
71
+ */
72
+ export declare function observedSlot(edge: ObserveEdge, ownSlotOf?: (agent: AgentName) => MessageSlotRef | undefined): MessageSlotRef | undefined;
54
73
  export declare class AgentRegistry {
55
74
  private readonly live;
56
75
  /** Ended records, oldest first. */
@@ -88,12 +107,15 @@ export declare class AgentRegistry {
88
107
  * spawner's orphan, as if it had been live when the spawner ended.
89
108
  * `after` is the incarnation a resumption continues from: the new one is
90
109
  * past it, since the counter of a name that aged out of memory isn't kept.
110
+ * `declaredWith` names the agents declared with this one, such as a
111
+ * configuration's residents, which register one after another: an observe
112
+ * edge may name one of them before it is registered (two residents may
113
+ * observe each other). The edge reads that agent's slot once it is.
91
114
  */
92
- register(spec: AgentSpec, options?: {
93
- resume?: boolean;
94
- after?: number;
95
- }): AgentRecord;
115
+ register(spec: AgentSpec, options?: RegisterOptions): AgentRecord;
96
116
  private registerUnguarded;
117
+ /** Each live record's deprecated `readsSharedSlot`, derived again from its own slot and edges (readsResidentsSlot). */
118
+ private refreshReadsSharedSlot;
97
119
  private validate;
98
120
  /** A live agent's record. */
99
121
  get(name: AgentName): AgentRecord | undefined;
@@ -122,9 +144,39 @@ export declare class AgentRegistry {
122
144
  /** Recipients of host-wide gate fan-out, in registration order. */
123
145
  gateRecipients(): AgentName[];
124
146
  ownsProviderScheduling(name: AgentName): boolean;
125
- /** Agents reading the residents' shared message slot. */
147
+ /**
148
+ * Agents reading the residents' shared message slot.
149
+ *
150
+ * @deprecated Use `readersOf(RESIDENTS_SLOT)`, or `slotOwners` and
151
+ * `observersOf` where owning and observing differ.
152
+ */
126
153
  sharedSlotReaders(): AgentName[];
154
+ /** @deprecated Use `ownSlotOf` and `observersOf`. */
127
155
  readsSharedSlot(name: AgentName): boolean;
156
+ /** The slot a live agent's own rows are stored in, if it names one. */
157
+ ownSlotOf(name: AgentName): MessageSlotRef | undefined;
158
+ /** Live agents whose own rows are stored in `slot`, in registration order. */
159
+ slotOwners(slot: MessageSlotRef): AgentName[];
160
+ /**
161
+ * The slot an observe edge reads (observedSlot): an edge that names an
162
+ * agent and no slot reads that agent's own slot, as its record names it,
163
+ * the live one, else the one awaiting re-declaration, else its newest
164
+ * ended one, so an edge on an agent that ended still reads the slot it
165
+ * read. Undefined for an agent the registry doesn't know.
166
+ */
167
+ observedSlotOf(edge: ObserveEdge): MessageSlotRef | undefined;
168
+ /**
169
+ * Live agents that read `slot` through an observe edge, in registration
170
+ * order. With `held`, only those whose edge shows held (policy-diverted)
171
+ * traffic.
172
+ */
173
+ observersOf(slot: MessageSlotRef, options?: {
174
+ held?: boolean;
175
+ }): AgentName[];
176
+ /** Every live agent that reads `slot`, as its own or through an observe edge, in registration order. */
177
+ readersOf(slot: MessageSlotRef): AgentName[];
178
+ /** The own slot an agent's record names: live, else awaiting re-declaration, else its newest ended record. */
179
+ private recordedSlotOf;
128
180
  /** The channel an agent is bound to, if it has one. */
129
181
  homeChannel(name: AgentName): AgentRecord['homeChannel'];
130
182
  /** Live agents of one preset label. Discovery only — see {@link AgentKind}. */
@@ -218,10 +270,13 @@ export declare class AgentRegistry {
218
270
  * the newest `endedRetention`. An end whose write fails is reported and
219
271
  * stays pending, so the snapshot still lists it and a later settlement (the
220
272
  * next boot's) writes it; a failed snapshot write is reported too.
273
+ * `unsettled` names jobs the host couldn't tell of yet, or whose notices
274
+ * for the primary it couldn't pass on (by name and incarnation): they stay
275
+ * pending, as such a failed end does.
221
276
  * @internal For the framework's boot, once the interrupted jobs'
222
277
  * recipients are told; not a host API.
223
278
  */
224
- settleInterrupted(): void;
279
+ settleInterrupted(unsettled?: ReadonlyArray<Pick<AgentRecord, 'name' | 'incarnation'>>): void;
225
280
  /**
226
281
  * Call once configuration has declared its agents. A persistent agent the
227
282
  * previous process ran but this configuration omits is ended, with the
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/dendrite/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,sDAAsD;AACtD,qBAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAGzC;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;I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