@animalabs/agent-framework 0.28.0 → 0.30.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 (289) hide show
  1. package/README.md +88 -25
  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 +21 -0
  7. package/dist/src/agent.d.ts.map +1 -1
  8. package/dist/src/agent.js +47 -7
  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 +3 -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 +7 -3
  15. package/dist/src/api/server.js.map +1 -1
  16. package/dist/src/author-presentation.d.ts +50 -0
  17. package/dist/src/author-presentation.d.ts.map +1 -0
  18. package/dist/src/author-presentation.js +58 -0
  19. package/dist/src/author-presentation.js.map +1 -0
  20. package/dist/src/auto-continue.d.ts +2 -0
  21. package/dist/src/auto-continue.d.ts.map +1 -1
  22. package/dist/src/auto-continue.js +5 -2
  23. package/dist/src/auto-continue.js.map +1 -1
  24. package/dist/src/code-execution/isolate/runner.d.ts +7 -5
  25. package/dist/src/code-execution/isolate/runner.d.ts.map +1 -1
  26. package/dist/src/code-execution/isolate/runner.js +7 -5
  27. package/dist/src/code-execution/isolate/runner.js.map +1 -1
  28. package/dist/src/code-execution/isolate/scripts.d.ts.map +1 -1
  29. package/dist/src/code-execution/isolate/scripts.js +3 -2
  30. package/dist/src/code-execution/isolate/scripts.js.map +1 -1
  31. package/dist/src/dendrite/index.d.ts +6 -0
  32. package/dist/src/dendrite/index.d.ts.map +1 -0
  33. package/dist/src/dendrite/index.js +3 -0
  34. package/dist/src/dendrite/index.js.map +1 -0
  35. package/dist/src/dendrite/presets.d.ts +60 -0
  36. package/dist/src/dendrite/presets.d.ts.map +1 -0
  37. package/dist/src/dendrite/presets.js +117 -0
  38. package/dist/src/dendrite/presets.js.map +1 -0
  39. package/dist/src/dendrite/registry.d.ts +260 -0
  40. package/dist/src/dendrite/registry.d.ts.map +1 -0
  41. package/dist/src/dendrite/registry.js +742 -0
  42. package/dist/src/dendrite/registry.js.map +1 -0
  43. package/dist/src/dendrite/types.d.ts +392 -0
  44. package/dist/src/dendrite/types.d.ts.map +1 -0
  45. package/dist/src/dendrite/types.js +24 -0
  46. package/dist/src/dendrite/types.js.map +1 -0
  47. package/dist/src/framework.d.ts +846 -67
  48. package/dist/src/framework.d.ts.map +1 -1
  49. package/dist/src/framework.js +4213 -924
  50. package/dist/src/framework.js.map +1 -1
  51. package/dist/src/gate/event-gate.d.ts +46 -14
  52. package/dist/src/gate/event-gate.d.ts.map +1 -1
  53. package/dist/src/gate/event-gate.js +143 -53
  54. package/dist/src/gate/event-gate.js.map +1 -1
  55. package/dist/src/gate/index.d.ts +1 -1
  56. package/dist/src/gate/index.d.ts.map +1 -1
  57. package/dist/src/gate/index.js +1 -1
  58. package/dist/src/gate/index.js.map +1 -1
  59. package/dist/src/gate/types.d.ts +12 -2
  60. package/dist/src/gate/types.d.ts.map +1 -1
  61. package/dist/src/heartbeat/heartbeat.d.ts +18 -0
  62. package/dist/src/heartbeat/heartbeat.d.ts.map +1 -1
  63. package/dist/src/heartbeat/heartbeat.js +34 -8
  64. package/dist/src/heartbeat/heartbeat.js.map +1 -1
  65. package/dist/src/held-writes.d.ts +3 -3
  66. package/dist/src/held-writes.js +3 -3
  67. package/dist/src/host-presentation.d.ts +174 -0
  68. package/dist/src/host-presentation.d.ts.map +1 -0
  69. package/dist/src/host-presentation.js +565 -0
  70. package/dist/src/host-presentation.js.map +1 -0
  71. package/dist/src/index.d.ts +7 -4
  72. package/dist/src/index.d.ts.map +1 -1
  73. package/dist/src/index.js +7 -2
  74. package/dist/src/index.js.map +1 -1
  75. package/dist/src/line-reader.d.ts +4 -0
  76. package/dist/src/line-reader.d.ts.map +1 -0
  77. package/dist/src/line-reader.js +59 -0
  78. package/dist/src/line-reader.js.map +1 -0
  79. package/dist/src/mcpl/channel-registry.d.ts +118 -15
  80. package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
  81. package/dist/src/mcpl/channel-registry.js +266 -110
  82. package/dist/src/mcpl/channel-registry.js.map +1 -1
  83. package/dist/src/mcpl/conversation-router.d.ts.map +1 -1
  84. package/dist/src/mcpl/conversation-router.js +2 -1
  85. package/dist/src/mcpl/conversation-router.js.map +1 -1
  86. package/dist/src/mcpl/convert-block.d.ts +1 -0
  87. package/dist/src/mcpl/convert-block.d.ts.map +1 -1
  88. package/dist/src/mcpl/convert-block.js +16 -4
  89. package/dist/src/mcpl/convert-block.js.map +1 -1
  90. package/dist/src/mcpl/hook-orchestrator.d.ts.map +1 -1
  91. package/dist/src/mcpl/hook-orchestrator.js +4 -3
  92. package/dist/src/mcpl/hook-orchestrator.js.map +1 -1
  93. package/dist/src/mcpl/inbound-source.d.ts +3 -1
  94. package/dist/src/mcpl/inbound-source.d.ts.map +1 -1
  95. package/dist/src/mcpl/inbound-source.js +3 -1
  96. package/dist/src/mcpl/inbound-source.js.map +1 -1
  97. package/dist/src/mcpl/modern-connection.d.ts.map +1 -1
  98. package/dist/src/mcpl/modern-connection.js +11 -7
  99. package/dist/src/mcpl/modern-connection.js.map +1 -1
  100. package/dist/src/mcpl/protocol-family.d.ts +3 -2
  101. package/dist/src/mcpl/protocol-family.d.ts.map +1 -1
  102. package/dist/src/mcpl/protocol-family.js +25 -3
  103. package/dist/src/mcpl/protocol-family.js.map +1 -1
  104. package/dist/src/mcpl/push-coalescer.d.ts +9 -0
  105. package/dist/src/mcpl/push-coalescer.d.ts.map +1 -1
  106. package/dist/src/mcpl/push-coalescer.js +21 -0
  107. package/dist/src/mcpl/push-coalescer.js.map +1 -1
  108. package/dist/src/mcpl/push-handler.js +2 -2
  109. package/dist/src/mcpl/push-handler.js.map +1 -1
  110. package/dist/src/mcpl/references.d.ts +12 -40
  111. package/dist/src/mcpl/references.d.ts.map +1 -1
  112. package/dist/src/mcpl/references.js +29 -23
  113. package/dist/src/mcpl/references.js.map +1 -1
  114. package/dist/src/mcpl/server-connection.d.ts.map +1 -1
  115. package/dist/src/mcpl/server-connection.js +20 -20
  116. package/dist/src/mcpl/server-connection.js.map +1 -1
  117. package/dist/src/mcpl/skip-reply-wake.d.ts +25 -0
  118. package/dist/src/mcpl/skip-reply-wake.d.ts.map +1 -1
  119. package/dist/src/mcpl/skip-reply-wake.js +25 -0
  120. package/dist/src/mcpl/skip-reply-wake.js.map +1 -1
  121. package/dist/src/mcpl/tool-presence.d.ts.map +1 -1
  122. package/dist/src/mcpl/tool-presence.js +18 -17
  123. package/dist/src/mcpl/tool-presence.js.map +1 -1
  124. package/dist/src/mcpl/tool-signature.d.ts.map +1 -1
  125. package/dist/src/mcpl/tool-signature.js +17 -16
  126. package/dist/src/mcpl/tool-signature.js.map +1 -1
  127. package/dist/src/mcpl/toolset-host.d.ts +8 -26
  128. package/dist/src/mcpl/toolset-host.d.ts.map +1 -1
  129. package/dist/src/mcpl/toolset-host.js +16 -6
  130. package/dist/src/mcpl/toolset-host.js.map +1 -1
  131. package/dist/src/mcpl/toolsets-module.d.ts +14 -25
  132. package/dist/src/mcpl/toolsets-module.d.ts.map +1 -1
  133. package/dist/src/mcpl/toolsets-module.js +187 -50
  134. package/dist/src/mcpl/toolsets-module.js.map +1 -1
  135. package/dist/src/mcpl/transport.d.ts +1 -1
  136. package/dist/src/mcpl/transport.d.ts.map +1 -1
  137. package/dist/src/mcpl/transport.js +16 -16
  138. package/dist/src/mcpl/transport.js.map +1 -1
  139. package/dist/src/mcpl/types.d.ts +28 -12
  140. package/dist/src/mcpl/types.d.ts.map +1 -1
  141. package/dist/src/mcpl/types.js.map +1 -1
  142. package/dist/src/module-registry.d.ts +6 -7
  143. package/dist/src/module-registry.d.ts.map +1 -1
  144. package/dist/src/module-registry.js +6 -7
  145. package/dist/src/module-registry.js.map +1 -1
  146. package/dist/src/modules/api/index.d.ts.map +1 -1
  147. package/dist/src/modules/api/index.js +4 -2
  148. package/dist/src/modules/api/index.js.map +1 -1
  149. package/dist/src/modules/discord/index.d.ts.map +1 -1
  150. package/dist/src/modules/discord/index.js +33 -25
  151. package/dist/src/modules/discord/index.js.map +1 -1
  152. package/dist/src/modules/history/index.js +8 -6
  153. package/dist/src/modules/history/index.js.map +1 -1
  154. package/dist/src/modules/sender-name.d.ts +7 -0
  155. package/dist/src/modules/sender-name.d.ts.map +1 -0
  156. package/dist/src/modules/sender-name.js +10 -0
  157. package/dist/src/modules/sender-name.js.map +1 -0
  158. package/dist/src/modules/workspace/answers.d.ts +5 -1
  159. package/dist/src/modules/workspace/answers.d.ts.map +1 -1
  160. package/dist/src/modules/workspace/answers.js +16 -1
  161. package/dist/src/modules/workspace/answers.js.map +1 -1
  162. package/dist/src/modules/workspace/direct-write.d.ts.map +1 -1
  163. package/dist/src/modules/workspace/direct-write.js +6 -4
  164. package/dist/src/modules/workspace/direct-write.js.map +1 -1
  165. package/dist/src/modules/workspace/effects.d.ts +4 -2
  166. package/dist/src/modules/workspace/effects.d.ts.map +1 -1
  167. package/dist/src/modules/workspace/effects.js +50 -40
  168. package/dist/src/modules/workspace/effects.js.map +1 -1
  169. package/dist/src/modules/workspace/index.d.ts +1 -0
  170. package/dist/src/modules/workspace/index.d.ts.map +1 -1
  171. package/dist/src/modules/workspace/index.js +66 -36
  172. package/dist/src/modules/workspace/index.js.map +1 -1
  173. package/dist/src/modules/workspace/observe.d.ts +51 -20
  174. package/dist/src/modules/workspace/observe.d.ts.map +1 -1
  175. package/dist/src/modules/workspace/observe.js +120 -82
  176. package/dist/src/modules/workspace/observe.js.map +1 -1
  177. package/dist/src/modules/workspace/reconcile.d.ts +7 -1
  178. package/dist/src/modules/workspace/reconcile.d.ts.map +1 -1
  179. package/dist/src/modules/workspace/reconcile.js +133 -37
  180. package/dist/src/modules/workspace/reconcile.js.map +1 -1
  181. package/dist/src/notice-tags.d.ts +81 -0
  182. package/dist/src/notice-tags.d.ts.map +1 -0
  183. package/dist/src/notice-tags.js +85 -0
  184. package/dist/src/notice-tags.js.map +1 -0
  185. package/dist/src/reasoning-loss-notice.d.ts.map +1 -1
  186. package/dist/src/reasoning-loss-notice.js +5 -3
  187. package/dist/src/reasoning-loss-notice.js.map +1 -1
  188. package/dist/src/silent-heartbeat.d.ts +5 -55
  189. package/dist/src/silent-heartbeat.d.ts.map +1 -1
  190. package/dist/src/silent-heartbeat.js +63 -7
  191. package/dist/src/silent-heartbeat.js.map +1 -1
  192. package/dist/src/stored-injections.d.ts +4 -0
  193. package/dist/src/stored-injections.d.ts.map +1 -1
  194. package/dist/src/stored-injections.js +6 -0
  195. package/dist/src/stored-injections.js.map +1 -1
  196. package/dist/src/supplied-text.d.ts +35 -0
  197. package/dist/src/supplied-text.d.ts.map +1 -0
  198. package/dist/src/supplied-text.js +141 -0
  199. package/dist/src/supplied-text.js.map +1 -0
  200. package/dist/src/tool-args.d.ts.map +1 -1
  201. package/dist/src/tool-args.js +9 -8
  202. package/dist/src/tool-args.js.map +1 -1
  203. package/dist/src/tool-image-ledger.d.ts.map +1 -1
  204. package/dist/src/tool-image-ledger.js +2 -1
  205. package/dist/src/tool-image-ledger.js.map +1 -1
  206. package/dist/src/tool-presentation.d.ts.map +1 -1
  207. package/dist/src/tool-presentation.js +5 -4
  208. package/dist/src/tool-presentation.js.map +1 -1
  209. package/dist/src/tune-out/coordinator.d.ts +382 -11
  210. package/dist/src/tune-out/coordinator.d.ts.map +1 -1
  211. package/dist/src/tune-out/coordinator.js +1100 -119
  212. package/dist/src/tune-out/coordinator.js.map +1 -1
  213. package/dist/src/tune-out/tools.d.ts +101 -5
  214. package/dist/src/tune-out/tools.d.ts.map +1 -1
  215. package/dist/src/tune-out/tools.js +55 -18
  216. package/dist/src/tune-out/tools.js.map +1 -1
  217. package/dist/src/types/agent.d.ts +48 -9
  218. package/dist/src/types/agent.d.ts.map +1 -1
  219. package/dist/src/types/framework.d.ts +142 -0
  220. package/dist/src/types/framework.d.ts.map +1 -1
  221. package/dist/src/types/module.d.ts +22 -11
  222. package/dist/src/types/module.d.ts.map +1 -1
  223. package/dist/src/types/trace.d.ts +136 -0
  224. package/dist/src/types/trace.d.ts.map +1 -1
  225. package/package.json +3 -3
  226. package/src/admission/admit.ts +113 -0
  227. package/src/agent.ts +52 -7
  228. package/src/api/mcp-server-core.ts +3 -14
  229. package/src/api/server.ts +7 -3
  230. package/src/author-presentation.ts +81 -0
  231. package/src/auto-continue.ts +8 -2
  232. package/src/code-execution/isolate/runner.ts +7 -5
  233. package/src/code-execution/isolate/scripts.ts +3 -2
  234. package/src/dendrite/index.ts +32 -0
  235. package/src/dendrite/presets.ts +149 -0
  236. package/src/dendrite/registry.ts +808 -0
  237. package/src/dendrite/types.ts +397 -0
  238. package/src/framework.ts +4362 -852
  239. package/src/gate/event-gate.ts +159 -52
  240. package/src/gate/index.ts +1 -1
  241. package/src/gate/types.ts +12 -2
  242. package/src/heartbeat/heartbeat.ts +48 -9
  243. package/src/held-writes.ts +3 -3
  244. package/src/host-presentation.ts +612 -0
  245. package/src/index.ts +17 -4
  246. package/src/line-reader.ts +58 -0
  247. package/src/mcpl/channel-registry.ts +306 -111
  248. package/src/mcpl/conversation-router.ts +2 -1
  249. package/src/mcpl/convert-block.ts +17 -4
  250. package/src/mcpl/hook-orchestrator.ts +4 -3
  251. package/src/mcpl/inbound-source.ts +3 -1
  252. package/src/mcpl/modern-connection.ts +11 -7
  253. package/src/mcpl/protocol-family.ts +24 -3
  254. package/src/mcpl/push-coalescer.ts +19 -0
  255. package/src/mcpl/push-handler.ts +2 -2
  256. package/src/mcpl/references.ts +31 -23
  257. package/src/mcpl/server-connection.ts +20 -18
  258. package/src/mcpl/skip-reply-wake.ts +35 -0
  259. package/src/mcpl/tool-presence.ts +18 -17
  260. package/src/mcpl/tool-signature.ts +17 -16
  261. package/src/mcpl/toolset-host.ts +18 -6
  262. package/src/mcpl/toolsets-module.ts +149 -50
  263. package/src/mcpl/transport.ts +18 -14
  264. package/src/mcpl/types.ts +29 -12
  265. package/src/module-registry.ts +6 -7
  266. package/src/modules/api/index.ts +4 -2
  267. package/src/modules/discord/index.ts +37 -25
  268. package/src/modules/history/index.ts +8 -6
  269. package/src/modules/sender-name.ts +9 -0
  270. package/src/modules/workspace/answers.ts +20 -2
  271. package/src/modules/workspace/direct-write.ts +4 -3
  272. package/src/modules/workspace/effects.ts +50 -40
  273. package/src/modules/workspace/index.ts +58 -34
  274. package/src/modules/workspace/observe.ts +139 -88
  275. package/src/modules/workspace/reconcile.ts +159 -36
  276. package/src/notice-tags.ts +86 -0
  277. package/src/reasoning-loss-notice.ts +5 -3
  278. package/src/silent-heartbeat.ts +11 -7
  279. package/src/stored-injections.ts +7 -0
  280. package/src/supplied-text.ts +154 -0
  281. package/src/tool-args.ts +9 -8
  282. package/src/tool-image-ledger.ts +2 -1
  283. package/src/tool-presentation.ts +5 -4
  284. package/src/tune-out/coordinator.ts +1252 -123
  285. package/src/tune-out/tools.ts +152 -11
  286. package/src/types/agent.ts +51 -9
  287. package/src/types/framework.ts +146 -0
  288. package/src/types/module.ts +23 -11
  289. package/src/types/trace.ts +150 -0
@@ -0,0 +1,565 @@
1
+ /**
2
+ * The host's own toolsets (MCPL RFC-014 §8.5 host-made toolsets, §8.1 surface
3
+ * presentation): how tools outside an agent's tool list are presented, for
4
+ * the framework's built-in tools and for MCPL servers alike. It's host
5
+ * presentation, not an MCPL wire change: it works for every server, with or
6
+ * without RFC-014.
7
+ *
8
+ * - **The built-in toolset** (`settings`): the host tools an agent reaches
9
+ * for rarely (its settings, wake rules, observers, MCPL administration,
10
+ * status reads, modules' utilities, and every tool the agent hid from its
11
+ * own list). None of them is in the tool list; `toolsets--open` shows them,
12
+ * `toolsets--act` calls them while it's open.
13
+ * - **MCPL server tabs**: each server is presented to each agent one of three
14
+ * ways. `full`: its tools in the tool list, as before. `tab` (a hidden
15
+ * tab): connected, its events still arrive, but none of its tools is in the
16
+ * tool list; `toolsets--open {server}` shows them and lets `toolsets--act`
17
+ * call them, `toolsets--close {server}` hides them again. `closed-tab`:
18
+ * disconnected until `toolsets--open {server}` reconnects it.
19
+ *
20
+ * The tool list (the request's header) changes only when a server switches
21
+ * between full and a tab, or a tool is hidden or shown: opening, acting in and
22
+ * closing a toolset never change it, so the prompt cache stays.
23
+ *
24
+ * State lives in one JSON file per store (`config/toolsets.json`): per agent,
25
+ * which host toolsets are open and each server's presentation where it
26
+ * differs from the configured default; per server (host-wide, since a
27
+ * connection is the host's), whether it is disconnected as a closed tab.
28
+ */
29
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
30
+ import { dirname } from 'node:path';
31
+ import { checkArgs, firstSentence, renderToolDefinition, signature } from './mcpl/tool-signature.js';
32
+ import { META_TOOL_NAMES } from './mcpl/toolset-host.js';
33
+ /** The built-in toolset's name, as agents address it (`toolsets--open {toolset: "settings"}`). */
34
+ export const BUILTIN_TOOLSET = 'settings';
35
+ export const SERVER_PRESENTATIONS = ['full', 'tab', 'closed-tab'];
36
+ const emptyDoc = () => ({ version: 1, agents: {}, closed: {} });
37
+ const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
38
+ function parseDoc(raw) {
39
+ const parsed = JSON.parse(raw);
40
+ if (!isObj(parsed) || parsed.version !== 1)
41
+ throw new Error('not a version 1 toolsets state');
42
+ const doc = emptyDoc();
43
+ if (isObj(parsed.agents)) {
44
+ for (const [name, value] of Object.entries(parsed.agents)) {
45
+ if (!isObj(value))
46
+ continue;
47
+ const open = Array.isArray(value.open) ? value.open.filter((x) => typeof x === 'string') : [];
48
+ const servers = {};
49
+ if (isObj(value.servers)) {
50
+ for (const [id, mode] of Object.entries(value.servers))
51
+ if (mode === 'full' || mode === 'tab')
52
+ servers[id] = mode;
53
+ }
54
+ doc.agents[name] = { open, servers };
55
+ }
56
+ }
57
+ if (isObj(parsed.closed)) {
58
+ for (const [id, closed] of Object.entries(parsed.closed))
59
+ if (typeof closed === 'boolean')
60
+ doc.closed[id] = closed;
61
+ }
62
+ return doc;
63
+ }
64
+ const tabKey = (serverId) => `server:${serverId}`;
65
+ export class HostPresentation {
66
+ deps;
67
+ statePath;
68
+ doc;
69
+ constructor(deps, statePath) {
70
+ this.deps = deps;
71
+ this.statePath = statePath;
72
+ this.doc = emptyDoc();
73
+ if (statePath && existsSync(statePath)) {
74
+ try {
75
+ this.doc = parseDoc(readFileSync(statePath, 'utf8'));
76
+ }
77
+ catch (error) {
78
+ // Kept, not written over: moved aside, so what an agent chose can be
79
+ // read back by whoever runs the host.
80
+ const aside = `${statePath}.unreadable-${new Date().toISOString().replace(/[:.]/g, '-')}`;
81
+ let moved = false;
82
+ try {
83
+ renameSync(statePath, aside);
84
+ moved = true;
85
+ }
86
+ catch { /* left where it is */ }
87
+ deps.log(`[toolsets] ${statePath} can't be read (${error instanceof Error ? error.message : String(error)}); `
88
+ + (moved ? `moved aside to ${aside}; ` : 'left as it is, and not written to; ')
89
+ + 'starting from the configured presentation');
90
+ if (!moved)
91
+ this.unwritable = true;
92
+ }
93
+ }
94
+ }
95
+ /** An unreadable state file that couldn't be moved aside is never written over. */
96
+ unwritable = false;
97
+ /** Reconnects of closed tabs under way, so two opens make one connect. */
98
+ reconnecting = new Map();
99
+ /** Each server's opens and closes, one at a time: a disconnect's guard holds until it's done. */
100
+ serverOps = new Map();
101
+ serially(serverId, op) {
102
+ const before = this.serverOps.get(serverId) ?? Promise.resolve();
103
+ const run = before.then(op, op);
104
+ const settled = run.catch(() => undefined);
105
+ this.serverOps.set(serverId, settled);
106
+ void settled.then(() => { if (this.serverOps.get(serverId) === settled)
107
+ this.serverOps.delete(serverId); });
108
+ return run;
109
+ }
110
+ save() {
111
+ if (!this.statePath || this.unwritable)
112
+ return;
113
+ // An agent with nothing open and nothing chosen has no state to keep.
114
+ for (const [name, a] of Object.entries(this.doc.agents)) {
115
+ if (a.open.length === 0 && Object.keys(a.servers).length === 0)
116
+ delete this.doc.agents[name];
117
+ }
118
+ try {
119
+ mkdirSync(dirname(this.statePath), { recursive: true });
120
+ const tmp = `${this.statePath}.tmp`;
121
+ writeFileSync(tmp, JSON.stringify(this.doc, null, 2) + '\n');
122
+ renameSync(tmp, this.statePath);
123
+ }
124
+ catch (error) {
125
+ this.deps.log(`[toolsets] couldn't save ${this.statePath}: ${error instanceof Error ? error.message : String(error)}`);
126
+ }
127
+ }
128
+ agent(name) {
129
+ return (this.doc.agents[name] ??= { open: [], servers: {} });
130
+ }
131
+ // ── what's known ──
132
+ /** Whether the host presents anything outside this agent's tool list. */
133
+ active(agentName) {
134
+ return this.deps.canUseMeta(agentName);
135
+ }
136
+ server(id) {
137
+ return this.deps.servers().find((s) => s.id === id);
138
+ }
139
+ /** Whether a server is kept disconnected as a closed tab (host-wide). */
140
+ isClosedTab(serverId) {
141
+ const set = this.doc.closed[serverId];
142
+ if (set !== undefined)
143
+ return set;
144
+ // A configured closed tab is closed until it's connected (by an open, or
145
+ // a runtime connect that didn't ask).
146
+ const server = this.server(serverId);
147
+ return server?.configured === 'closed-tab' && !server.connected;
148
+ }
149
+ /** The agent whose presentation `agentName` is shown (HostPresentationDeps.ownerOf). */
150
+ ownerOf(agentName) {
151
+ return this.deps.ownerOf?.(agentName) ?? agentName;
152
+ }
153
+ /** How a server is presented to an agent now. */
154
+ presentation(agentName, serverId) {
155
+ if (this.isClosedTab(serverId))
156
+ return 'closed-tab';
157
+ const chosen = this.doc.agents[this.ownerOf(agentName)]?.servers[serverId];
158
+ if (chosen)
159
+ return chosen;
160
+ const configured = this.server(serverId)?.configured ?? 'full';
161
+ return configured === 'closed-tab' ? 'tab' : configured;
162
+ }
163
+ /** Servers to leave unconnected at startup: closed tabs, by state or by configured default. */
164
+ startClosed(configs) {
165
+ const out = new Set();
166
+ for (const c of configs) {
167
+ const set = this.doc.closed[c.id];
168
+ if (set === true || (set === undefined && c.presentation === 'closed-tab'))
169
+ out.add(c.id);
170
+ }
171
+ return out;
172
+ }
173
+ isOpen(agentName, key) {
174
+ return this.doc.agents[this.ownerOf(agentName)]?.open.includes(key) ?? false;
175
+ }
176
+ setOpen(agentName, key, open) {
177
+ const a = this.agent(agentName);
178
+ const has = a.open.includes(key);
179
+ if (open && !has)
180
+ a.open.push(key);
181
+ if (!open && has)
182
+ a.open = a.open.filter((k) => k !== key);
183
+ this.save();
184
+ }
185
+ // ── the tool list ──
186
+ /** The tool list an agent is shown: what it may call, less the built-in toolset and its tabs. */
187
+ header(agentName, tools, active = this.active(agentName)) {
188
+ // Without the meta-tools nothing is presented out of the tool list, but a
189
+ // utility still isn't in it: it was never a tool-list tool.
190
+ if (!active)
191
+ return tools.filter((t) => isMetaTool(t.name) || !this.deps.isUtility(t.name));
192
+ return tools.filter((t) => !this.outOfHeader(agentName, t.name));
193
+ }
194
+ outOfHeader(agentName, name) {
195
+ if (isMetaTool(name))
196
+ return false;
197
+ // A utility is never a tool-list tool, presented here or not.
198
+ if (this.deps.isUtility(name))
199
+ return true;
200
+ const server = this.deps.serverOf(name);
201
+ if (server)
202
+ return this.presentation(agentName, server) !== 'full';
203
+ return this.deps.placedInBuiltin(name);
204
+ }
205
+ /** The built-in toolset's tools for an agent: its placed tools, and the host tools it hid. */
206
+ builtinTools(agentName) {
207
+ const hidden = this.deps.hidden(agentName);
208
+ return this.deps.available(agentName).filter((t) => !isMetaTool(t.name) && this.deps.serverOf(t.name) === null && (this.deps.placedInBuiltin(t.name) || hidden.has(t.name)));
209
+ }
210
+ /** A server's tab's tools for an agent: all of them in a tab, its hidden ones while it's full. */
211
+ tabTools(agentName, serverId) {
212
+ const full = this.presentation(agentName, serverId) === 'full';
213
+ const hidden = this.deps.hidden(agentName);
214
+ return this.deps.available(agentName).filter((t) => this.deps.serverOf(t.name) === serverId && (!full || hidden.has(t.name)));
215
+ }
216
+ // ── what an agent is told ──
217
+ announce(label, tools, closeHint) {
218
+ const lines = [`${label} open: call these with ${META_TOOL_NAMES.act} {tool, args}; they aren't in your tool list.`];
219
+ if (!tools.length)
220
+ lines.push(' (none right now)');
221
+ for (const t of tools) {
222
+ const sentence = firstSentence(t.description);
223
+ lines.push(` ${signature(t)}${sentence ? ` — ${sentence}` : ''}`);
224
+ }
225
+ lines.push(`${closeHint} closes it.`);
226
+ return lines.join('\n');
227
+ }
228
+ builtinLabel = `[${BUILTIN_TOOLSET}]`;
229
+ tabLabel = (serverId) => `[tab ${serverId}]`;
230
+ /** The catalog lines `toolsets--look` begins with. */
231
+ catalog(agentName) {
232
+ const builtin = this.builtinTools(agentName);
233
+ const lines = [
234
+ `${this.builtinLabel} the host's settings and controls (${builtin.length} tool${builtin.length === 1 ? '' : 's'}): ` +
235
+ (this.isOpen(agentName, BUILTIN_TOOLSET)
236
+ ? `open — ${META_TOOL_NAMES.look} {toolset:"${BUILTIN_TOOLSET}"} lists them`
237
+ : `closed — ${META_TOOL_NAMES.open} {toolset:"${BUILTIN_TOOLSET}"} opens it`),
238
+ ];
239
+ for (const s of this.deps.servers()) {
240
+ const mode = this.presentation(agentName, s.id);
241
+ const tabTools = this.tabTools(agentName, s.id);
242
+ if (mode === 'full') {
243
+ if (tabTools.length)
244
+ lines.push(`${this.tabLabel(s.id)} in your tool list; ${tabTools.length} hidden tool${tabTools.length === 1 ? '' : 's'} in its tab (${this.isOpen(agentName, tabKey(s.id)) ? 'open' : `closed — ${META_TOOL_NAMES.open} {server:"${s.id}"} opens it`})`);
245
+ else
246
+ lines.push(`${this.tabLabel(s.id)} in your tool list — ${META_TOOL_NAMES.close} {server:"${s.id}"} moves it to a tab`);
247
+ }
248
+ else if (mode === 'tab') {
249
+ lines.push(`${this.tabLabel(s.id)} a tab, connected (${tabTools.length} tool${tabTools.length === 1 ? '' : 's'}): ` +
250
+ (this.isOpen(agentName, tabKey(s.id)) ? 'open' : `hidden — ${META_TOOL_NAMES.open} {server:"${s.id}"} opens it`) +
251
+ `; ${META_TOOL_NAMES.open} {server:"${s.id}", full:true} puts it back in your tool list`);
252
+ }
253
+ else {
254
+ lines.push(`${this.tabLabel(s.id)} a closed tab, disconnected: ${META_TOOL_NAMES.open} {server:"${s.id}"} connects and opens it`);
255
+ }
256
+ }
257
+ return lines;
258
+ }
259
+ /** `toolsets--look {toolset:"settings"}` or `{server}`: one host toolset's tools. */
260
+ lookToolset(agentName, which) {
261
+ if ('builtin' in which) {
262
+ const tools = this.builtinTools(agentName);
263
+ const open = this.isOpen(agentName, BUILTIN_TOOLSET);
264
+ return [
265
+ `${this.builtinLabel} ${open ? 'open' : 'closed'}${open ? '' : ` — ${META_TOOL_NAMES.open} {toolset:"${BUILTIN_TOOLSET}"} opens it`}`,
266
+ ...tools.map((t) => ` ${signature(t)}${firstSentence(t.description) ? ` — ${firstSentence(t.description)}` : ''}`),
267
+ ].join('\n');
268
+ }
269
+ const { serverId } = which;
270
+ const mode = this.presentation(agentName, serverId);
271
+ if (mode === 'closed-tab')
272
+ return `${this.tabLabel(serverId)} a closed tab, disconnected: ${META_TOOL_NAMES.open} {server:"${serverId}"} connects and opens it.`;
273
+ const tools = this.tabTools(agentName, serverId);
274
+ const open = this.isOpen(agentName, tabKey(serverId));
275
+ const head = mode === 'full'
276
+ ? `${this.tabLabel(serverId)} in your tool list${tools.length ? `; its hidden tools (${open ? 'open' : 'closed'}):` : '.'}`
277
+ : `${this.tabLabel(serverId)} a tab, connected, ${open ? 'open' : `hidden — ${META_TOOL_NAMES.open} {server:"${serverId}"} opens it`}:`;
278
+ return [head, ...tools.map((t) => ` ${signature(t)}${firstSentence(t.description) ? ` — ${firstSentence(t.description)}` : ''}`)].join('\n');
279
+ }
280
+ /** `toolsets--look {tool}` for a host toolset's tool, or null when no host toolset has it. */
281
+ lookTool(agentName, tool, serverId) {
282
+ const def = this.listedTool(agentName, tool, serverId);
283
+ if (!def)
284
+ return null;
285
+ return `${renderToolDefinition(def)}\n${this.homeOf(agentName, def.name)}`;
286
+ }
287
+ /**
288
+ * A host toolset's tool as the agent has it listed, by its name, or with
289
+ * its server named by the name the server gave it (as act and look take it).
290
+ */
291
+ listedTool(agentName, tool, server) {
292
+ const inTabs = this.deps.servers().filter((s) => !server || s.id === server).flatMap((s) => this.tabTools(agentName, s.id));
293
+ return (!server ? this.builtinTools(agentName).find((t) => t.name === tool) : undefined)
294
+ ?? inTabs.find((t) => t.name === tool)
295
+ ?? (server ? inTabs.find((t) => t.name.endsWith(`--${tool}`) && this.deps.serverOf(t.name) === server) : undefined);
296
+ }
297
+ homeOf(agentName, name) {
298
+ const server = this.deps.serverOf(name);
299
+ if (server)
300
+ return `in ${this.tabLabel(server)} (${this.isOpen(agentName, tabKey(server)) ? 'open' : 'closed'})`;
301
+ return `in ${this.builtinLabel} (${this.isOpen(agentName, BUILTIN_TOOLSET) ? 'open' : 'closed'})`;
302
+ }
303
+ // ── open and close ──
304
+ /** `toolsets--open {toolset:"settings"}`. */
305
+ openBuiltin(agentName) {
306
+ this.setOpen(agentName, BUILTIN_TOOLSET, true);
307
+ return this.announce(this.builtinLabel, this.builtinTools(agentName), `${META_TOOL_NAMES.close} {toolset:"${BUILTIN_TOOLSET}"}`);
308
+ }
309
+ /** `toolsets--close {toolset:"settings"}`. */
310
+ closeBuiltin(agentName) {
311
+ const was = this.isOpen(agentName, BUILTIN_TOOLSET);
312
+ this.setOpen(agentName, BUILTIN_TOOLSET, false);
313
+ return was ? `${this.builtinLabel} closed.` : `${this.builtinLabel} wasn't open.`;
314
+ }
315
+ /** Whether a server id names a server the host presents (connected, or a closed tab). */
316
+ knows(serverId) {
317
+ return this.server(serverId) !== undefined;
318
+ }
319
+ /** Connect a closed tab again: one connect, whoever else asks meanwhile. */
320
+ async reconnect(serverId) {
321
+ let pending = this.reconnecting.get(serverId);
322
+ if (!pending) {
323
+ pending = (async () => {
324
+ await this.deps.reconnect(serverId);
325
+ this.doc.closed[serverId] = false;
326
+ })().finally(() => this.reconnecting.delete(serverId));
327
+ this.reconnecting.set(serverId, pending);
328
+ }
329
+ await pending;
330
+ }
331
+ /**
332
+ * `toolsets--open {server}`: a closed tab is connected again; a tab's tools
333
+ * are shown and callable through act; with `full`, the server goes back
334
+ * into the tool list (one change of the tool list).
335
+ */
336
+ openServer(agentName, serverId, opts = {}) {
337
+ return this.serially(serverId, () => this.runOpenServer(agentName, serverId, opts));
338
+ }
339
+ async runOpenServer(agentName, serverId, opts) {
340
+ const said = [];
341
+ if (this.isClosedTab(serverId) || this.reconnecting.has(serverId)) {
342
+ await this.reconnect(serverId);
343
+ said.push(`${serverId} connected.`);
344
+ }
345
+ const a = this.agent(agentName);
346
+ try {
347
+ if (opts.full) {
348
+ const was = this.presentation(agentName, serverId);
349
+ a.servers[serverId] = 'full';
350
+ a.open = a.open.filter((k) => k !== tabKey(serverId));
351
+ said.push(was === 'full'
352
+ ? `${serverId} is in your tool list already.`
353
+ : `${serverId}'s tools are back in your tool list from your next request (your tool list changed, so that request writes its prompt cache again).`);
354
+ return said.join('\n');
355
+ }
356
+ if (this.presentation(agentName, serverId) === 'full' && !this.tabTools(agentName, serverId).length) {
357
+ said.push(`${serverId}'s tools are in your tool list: call them by name. ${META_TOOL_NAMES.close} {server:"${serverId}"} moves it to a tab.`);
358
+ return said.join('\n');
359
+ }
360
+ if (!a.open.includes(tabKey(serverId)))
361
+ a.open.push(tabKey(serverId));
362
+ said.push(this.announce(this.tabLabel(serverId), this.tabTools(agentName, serverId), `${META_TOOL_NAMES.close} {server:"${serverId}"}`));
363
+ return said.join('\n');
364
+ }
365
+ finally {
366
+ this.save();
367
+ }
368
+ }
369
+ /**
370
+ * The other resident agents a server's disconnect would take it from. One
371
+ * the host presents things to out of its tool list uses the server while
372
+ * it's in that list or its tab is open; one that can't use the meta-tools
373
+ * has every server in its list and couldn't open a closed tab again, so it
374
+ * always does. A connection is the host's, so one agent's closed tab is
375
+ * every agent's.
376
+ */
377
+ otherUsers(agentName, serverId) {
378
+ return this.deps.residents().filter((other) => other !== agentName
379
+ && (!this.active(other) || this.presentation(other, serverId) === 'full' || this.isOpen(other, tabKey(serverId))));
380
+ }
381
+ /**
382
+ * `toolsets--close {server}`: a server in the tool list moves to a tab (one
383
+ * change of the tool list); an open tab is hidden; with `disconnect`, the
384
+ * server is disconnected as a closed tab until it's opened again, unless
385
+ * another resident agent still uses it. The disconnect comes first: one
386
+ * that fails changes nothing.
387
+ */
388
+ closeServer(agentName, serverId, opts = {}) {
389
+ return this.serially(serverId, () => this.runCloseServer(agentName, serverId, opts));
390
+ }
391
+ async runCloseServer(agentName, serverId, opts) {
392
+ const was = this.presentation(agentName, serverId);
393
+ const wasOpen = this.isOpen(agentName, tabKey(serverId));
394
+ let disconnected = false;
395
+ if (opts.disconnect && !this.isClosedTab(serverId)) {
396
+ const users = this.otherUsers(agentName, serverId);
397
+ if (users.length) {
398
+ return `${serverId} wasn't disconnected: ${users.join(', ')} still ${users.length === 1 ? 'uses' : 'use'} it, ` +
399
+ `and a connection is the host's, every agent's. Nothing was changed. ` +
400
+ `${META_TOOL_NAMES.close} {server:"${serverId}"} without disconnect moves it out of your own tool list.`;
401
+ }
402
+ await this.deps.disconnect(serverId);
403
+ this.doc.closed[serverId] = true;
404
+ disconnected = true;
405
+ }
406
+ const said = [];
407
+ const a = this.agent(agentName);
408
+ try {
409
+ if (was === 'full') {
410
+ a.servers[serverId] = 'tab';
411
+ said.push(`${serverId}'s tools leave your tool list from your next request (your tool list changed, so that request writes its prompt cache again); its tab: ${META_TOOL_NAMES.open} {server:"${serverId}"}.`);
412
+ }
413
+ else if (wasOpen) {
414
+ said.push(disconnected ? `${this.tabLabel(serverId)} hidden.` : `${this.tabLabel(serverId)} hidden; it stays connected.`);
415
+ }
416
+ a.open = a.open.filter((k) => k !== tabKey(serverId));
417
+ if (disconnected)
418
+ said.push(`${serverId} disconnected: none of its events reach you until ${META_TOOL_NAMES.open} {server:"${serverId}"} connects it again.`);
419
+ else if (opts.disconnect)
420
+ said.push(`${serverId} is disconnected already.`);
421
+ }
422
+ finally {
423
+ this.save();
424
+ }
425
+ if (!said.length)
426
+ said.push(`${this.tabLabel(serverId)} is hidden already.`);
427
+ return said.join('\n');
428
+ }
429
+ /** A server connected by other means (an operator's connect, a deploy): no longer a closed tab. */
430
+ noteConnected(serverId, wasClosedTab = false) {
431
+ // Closed by an agent, or by its configured default (the caller says,
432
+ // from the configuration it kept): connected against it now, which is
433
+ // kept across restarts. A server that wasn't a closed tab writes
434
+ // nothing, so a configured closed-tab default still applies at startup.
435
+ if (wasClosedTab || this.doc.closed[serverId] === true) {
436
+ this.doc.closed[serverId] = false;
437
+ this.save();
438
+ }
439
+ }
440
+ /** A server's saved closed state: true closed, false connected against a closed-tab default, undefined neither. */
441
+ closedState(serverId) {
442
+ return this.doc.closed[serverId];
443
+ }
444
+ /** A connect refused before anything changed: its closed tab is put back as it was. */
445
+ restoreClosed(serverId, was) {
446
+ if (was === undefined)
447
+ delete this.doc.closed[serverId];
448
+ else
449
+ this.doc.closed[serverId] = was;
450
+ this.save();
451
+ }
452
+ /** A server removed for good (an operator's disconnect): nothing of its tab is kept. */
453
+ noteRemoved(serverId) {
454
+ let changed = false;
455
+ if (serverId in this.doc.closed) {
456
+ delete this.doc.closed[serverId];
457
+ changed = true;
458
+ }
459
+ for (const a of Object.values(this.doc.agents)) {
460
+ if (serverId in a.servers) {
461
+ delete a.servers[serverId];
462
+ changed = true;
463
+ }
464
+ const open = a.open.filter((k) => k !== tabKey(serverId));
465
+ if (open.length !== a.open.length) {
466
+ a.open = open;
467
+ changed = true;
468
+ }
469
+ }
470
+ if (changed)
471
+ this.save();
472
+ }
473
+ // ── act ──
474
+ /**
475
+ * `toolsets--act` for a host toolset's tool: the call it makes, under the
476
+ * tool's own name; a refusal when its toolset isn't open or its arguments
477
+ * don't fit its definition; null when no host toolset has the tool (an
478
+ * RFC-014 dynamic tool's call goes on to the server's toolsets). A
479
+ * server's tool may be named in full, or bare with `server`.
480
+ */
481
+ resolveAct(agentName, input) {
482
+ if (!this.active(agentName))
483
+ return null;
484
+ const args = isObj(input) ? input : {};
485
+ const tool = typeof args.tool === 'string' ? args.tool.trim() : '';
486
+ if (!tool)
487
+ return null;
488
+ const server = typeof args.server === 'string' && args.server.trim() ? args.server.trim() : undefined;
489
+ const listed = this.listedTool(agentName, tool, server);
490
+ // A host toolset's tool the agent may not call isn't listed to it; its
491
+ // call still goes on, by name, for dispatch to refuse as it would a
492
+ // direct call, rather than reading as no such tool.
493
+ const def = listed
494
+ ?? (!server && this.deps.serverOf(tool) === null && this.deps.placedInBuiltin(tool) ? { name: tool } : undefined);
495
+ if (!def) {
496
+ if (server && this.isClosedTab(server))
497
+ return { kind: 'refused', error: `${server} is a closed tab, disconnected: ${META_TOOL_NAMES.open} {server:"${server}"} connects it. Nothing was sent.` };
498
+ return null;
499
+ }
500
+ if (args.args !== undefined && !isObj(args.args))
501
+ return { kind: 'refused', error: 'args must be an object of the tool\'s arguments; nothing was sent' };
502
+ const home = this.deps.serverOf(def.name);
503
+ const key = home ? tabKey(home) : BUILTIN_TOOLSET;
504
+ if (!this.isOpen(agentName, key)) {
505
+ const opener = home ? `${META_TOOL_NAMES.open} {server:"${home}"}` : `${META_TOOL_NAMES.open} {toolset:"${BUILTIN_TOOLSET}"}`;
506
+ return { kind: 'refused', error: `${def.name} is in ${home ? this.tabLabel(home) : this.builtinLabel}, which isn't open: ${opener} opens it. Nothing was sent.` };
507
+ }
508
+ const callArgs = (args.args ?? {});
509
+ // As a server's dynamic tool is checked before it's sent (RFC §6.1): the
510
+ // arguments against the definition the agent was shown.
511
+ if (def.inputSchema !== undefined) {
512
+ const problem = checkArgs(def.inputSchema, callArgs);
513
+ if (problem) {
514
+ // A key the definition doesn't have is named too, since it's often
515
+ // the cause of a missing one (a misspelling).
516
+ const props = isObj(def.inputSchema) && isObj(def.inputSchema.properties)
517
+ ? Object.keys(def.inputSchema.properties) : null;
518
+ const unknown = props ? Object.keys(callArgs).filter((k) => !props.includes(k)) : [];
519
+ const extra = unknown.length
520
+ ? `; ${unknown.map((k) => JSON.stringify(k)).join(', ')} ${unknown.length === 1 ? "isn't one of its parameters" : "aren't among its parameters"}`
521
+ : '';
522
+ return { kind: 'refused', error: `Invalid arguments for ${def.name}: ${problem}${extra}. Nothing was sent; ${META_TOOL_NAMES.look} {tool:"${def.name}"} shows its definition.` };
523
+ }
524
+ }
525
+ return { kind: 'call', name: def.name, args: callArgs };
526
+ }
527
+ // ── reminders (RFC-014 §8.3) ──
528
+ /**
529
+ * The open host toolsets of an agent: each one's marker (its announcement's
530
+ * first words, which a reminder repeats) and its reminder, worked out only
531
+ * when one is due. `dueWhenAbsent`: such a toolset is due whenever a
532
+ * request doesn't carry its marker, even one never seen since the host
533
+ * started (open across a restart).
534
+ */
535
+ openMarkers(agentName) {
536
+ if (!this.active(agentName))
537
+ return [];
538
+ const out = [];
539
+ for (const key of this.doc.agents[this.ownerOf(agentName)]?.open ?? []) {
540
+ if (key === BUILTIN_TOOLSET) {
541
+ out.push({
542
+ marker: `${this.builtinLabel} open`,
543
+ dueWhenAbsent: true,
544
+ reminder: () => `${this.builtinLabel} open: ${this.builtinTools(agentName).map((t) => t.name).join(', ') || '(none)'} — through ${META_TOOL_NAMES.act}; ${META_TOOL_NAMES.close} {toolset:"${BUILTIN_TOOLSET}"} closes it.`,
545
+ });
546
+ }
547
+ else if (key.startsWith('server:')) {
548
+ const id = key.slice('server:'.length);
549
+ if (!this.knows(id) || this.isClosedTab(id))
550
+ continue;
551
+ out.push({
552
+ marker: `${this.tabLabel(id)} open`,
553
+ dueWhenAbsent: true,
554
+ reminder: () => `${this.tabLabel(id)} open: ${this.tabTools(agentName, id).map((t) => t.name).join(', ') || '(none)'} — through ${META_TOOL_NAMES.act}; ${META_TOOL_NAMES.close} {server:"${id}"} hides it.`,
555
+ });
556
+ }
557
+ }
558
+ return out;
559
+ }
560
+ }
561
+ /** The meta-tools themselves never leave the tool list: they're how anything else is reached. */
562
+ export function isMetaTool(name) {
563
+ return name === META_TOOL_NAMES.open || name === META_TOOL_NAMES.act || name === META_TOOL_NAMES.look || name === META_TOOL_NAMES.close;
564
+ }
565
+ //# sourceMappingURL=host-presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-presentation.js","sourceRoot":"","sources":["../../src/host-presentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAK1C,MAAM,CAAC,MAAM,oBAAoB,GAAkC,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;AAoDjG,MAAM,QAAQ,GAAG,GAAa,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1E,MAAM,KAAK,GAAG,CAAC,CAAU,EAAgC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAErH,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;IAC1C,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC9F,MAAM,GAAG,GAAG,QAAQ,EAAE,CAAC;IACvB,IAAI,KAAK,CAAC,MAAM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OAAO,IAAI,KAAK,eAAe,CAAC,IAAI,IAAI,IAAI,KAAK,eAAe,CAAC,GAAG,IAAI,IAAI,KAAK,eAAe,CAAC,IAAI,IAAI,IAAI,KAAK,eAAe,CAAC,KAAK,CAAC;AAC1I,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export * from './types/index.js';
2
- export { AgentFramework, BudgetPreflightError, DefaultErrorPolicy, ProviderWaitNotSleptError, QuiesceBlockedError, ResumeBlockedError } from './framework.js';
3
- export type { RuntimeSettingsPreview, HostModeStatus } from './framework.js';
2
+ export { AgentFramework, AgentStoppedError, BudgetPreflightError, DefaultErrorPolicy, ProviderWaitNotSleptError, QuiesceBlockedError, ResumeBlockedError } from './framework.js';
3
+ export type { RuntimeSettingsPreview, HostModeStatus, DeriveAgentOptions } from './framework.js';
4
4
  export { Agent } from './agent.js';
5
5
  export { storedInjectionMarkOf, type StoredInjectionMark } from './stored-injections.js';
6
6
  export type { StartStreamResult } from './agent.js';
@@ -11,6 +11,7 @@ export { formatZonedDateTime, formatZonedTime, isValidTimeZone, resolveTimeZone
11
11
  export { CLOCK_ROW_KIND, resolveClockConfig } from './clock-rows.js';
12
12
  export type { ClockConfig, ClockStamp, ResolvedClockConfig } from './clock-rows.js';
13
13
  export { REFUSAL_REACTIONS, REFUSAL_REACTION_FALLBACK, REFUSAL_REACTION_BASELINE } from './refusal-reactions.js';
14
+ export * from './dendrite/index.js';
14
15
  export * from './modules/index.js';
15
16
  export { ApiServer } from './api/server.js';
16
17
  export { McpServer } from './api/mcp-server-core.js';
@@ -18,12 +19,12 @@ export type { ApiServerConfig, ApiMessage, ApiRequest, ApiResponse, ApiEvent, Ap
18
19
  export { UsageTracker } from './usage/index.js';
19
20
  export { buildCodeExecutionToolDefinition, CODE_EXECUTION_TOOL_NAME } from './code-execution/index.js';
20
21
  export type { SessionUsage, AgentUsage, SessionUsageSnapshot, UsageUpdatedEvent } from './usage/index.js';
21
- export { EventGate, wakeLineText, type WakeProvenance, type WritePlacement } from './gate/index.js';
22
+ export { EventGate, MCPL_GATE_EVENT_TYPES, wakeLineText, type EventTypesFrom, type WakeProvenance, type WritePlacement } from './gate/index.js';
22
23
  export type { GateConfig, GateOptions, GatePolicy, GatePolicyMatch, GateBehavior, WakeLine } from './gate/index.js';
23
24
  export { ReplyJudge, DEFAULT_JUDGE_MODEL, DEFAULT_JUDGE_MAX_INPUT_TOKENS, MIN_JUDGE_INPUT_TOKENS } from './gate/index.js';
24
25
  export type { JudgeConfig, JudgeEventSummary, JudgeFn, JudgeRequest, JudgeVerdict, ReplyJudgeOptions, ReplyJudgeDeps, UpcomingWake } from './gate/index.js';
25
26
  export { Heartbeat, DEFAULT_HEARTBEAT, HEARTBEAT_TOOL_PREFIX } from './heartbeat/heartbeat.js';
26
- export type { HeartbeatOptions, HeartbeatSettings, HeartbeatWake, HeartbeatDeliveryMode, Reminder } from './heartbeat/heartbeat.js';
27
+ export type { HeartbeatOptions, HeartbeatSettings, HeartbeatWake, HeartbeatDeliveryMode, HeartbeatScheduledWake, Reminder } from './heartbeat/heartbeat.js';
27
28
  export { ChannelRegistry } from './mcpl/index.js';
28
29
  export type { ChannelRef, PublishRefusalReason } from './mcpl/index.js';
29
30
  export { INBOUND_SOURCE_KEY, readInboundSource, conversationKey, sourceBodyDigest } from './mcpl/index.js';
@@ -53,5 +54,7 @@ export type { OperatorLogEntry, OperatorLogInput, OperatorRequester, SurgeryMark
53
54
  export { createOfflineRecoveryBranch } from './recovery/offline-branch.js';
54
55
  export type { OfflineRecoveryBranchOptions, OfflineRecoveryBranchResult, } from './recovery/offline-branch.js';
55
56
  export * from "./tool-presentation.js";
57
+ export { presentAuthor, authorLine, authorNamed, ANONYMOUS_PARTICIPANT } from './author-presentation.js';
58
+ export { defaultReaderFraming, type SubconsciousConfig, type PersistentReaderConfig, type ForkReaderConfig, type ReaderFramingContext, } from './tune-out/tools.js';
56
59
  export { SILENT_HEARTBEAT_SEPARATOR, silentHeartbeatOf, type RequestOnlyPrompt, type SilentHeartbeatStamp, type SilentHeartbeatTick, } from './silent-heartbeat.js';
57
60
  //# sourceMappingURL=index.d.ts.map