@openacp/cli 0.6.10 → 2026.326.2

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 (256) hide show
  1. package/dist/{action-detect-P7ZE4NEM.js → action-detect-QPA775HB.js} +2 -2
  2. package/dist/adapter-6ANPBSVU.js +16 -0
  3. package/dist/{discord-OMC52Y54.js → adapter-77ZCVABT.js} +520 -365
  4. package/dist/adapter-77ZCVABT.js.map +1 -0
  5. package/dist/{adapter-ZOANORGM.js → adapter-PQGHVG4K.js} +300 -93
  6. package/dist/adapter-PQGHVG4K.js.map +1 -0
  7. package/dist/{admin-6SYB6XCZ.js → admin-GBPZFFAU.js} +3 -3
  8. package/dist/agent-catalog-YHBFERYO.js +11 -0
  9. package/dist/{agent-dependencies-4OWBMZWZ.js → agent-dependencies-WS7Z2DFW.js} +2 -2
  10. package/dist/agent-registry-5LZT7CUB.js +9 -0
  11. package/dist/agent-store-VSHNY5GT.js +9 -0
  12. package/dist/{agents-QO7DKARJ.js → agents-BWU4MRRD.js} +3 -3
  13. package/dist/{api-client-CFQT5U7D.js → api-client-AQPNKXI2.js} +2 -2
  14. package/dist/api-server-3PYLRBCN.js +8 -0
  15. package/dist/api-server-CHVSUDBX.js +11 -0
  16. package/dist/{autostart-X33OGMX6.js → autostart-6JS565RY.js} +3 -3
  17. package/dist/chunk-2CX4IEEC.js +124 -0
  18. package/dist/chunk-2CX4IEEC.js.map +1 -0
  19. package/dist/{chunk-O7CPGUAI.js → chunk-4KGLKKQK.js} +4 -4
  20. package/dist/chunk-4KGLKKQK.js.map +1 -0
  21. package/dist/{chunk-W3EYKZNQ.js → chunk-4WXALZA3.js} +2 -2
  22. package/dist/chunk-4WXALZA3.js.map +1 -0
  23. package/dist/chunk-5OCGO27U.js +125 -0
  24. package/dist/chunk-5OCGO27U.js.map +1 -0
  25. package/dist/{chunk-OWP7RZ62.js → chunk-5ZOFBTOR.js} +118 -262
  26. package/dist/chunk-5ZOFBTOR.js.map +1 -0
  27. package/dist/chunk-6RXVEXF3.js +23 -0
  28. package/dist/chunk-6RXVEXF3.js.map +1 -0
  29. package/dist/{chunk-34M4OS5P.js → chunk-A6Y4GZM3.js} +3 -3
  30. package/dist/chunk-A6Y4GZM3.js.map +1 -0
  31. package/dist/chunk-AD3X6DGK.js +166 -0
  32. package/dist/chunk-AD3X6DGK.js.map +1 -0
  33. package/dist/{chunk-7QJS2XBD.js → chunk-AFKX424Q.js} +2 -2
  34. package/dist/chunk-AFKX424Q.js.map +1 -0
  35. package/dist/chunk-APS6UEFU.js +259 -0
  36. package/dist/chunk-APS6UEFU.js.map +1 -0
  37. package/dist/chunk-BLQUXO7S.js +113 -0
  38. package/dist/chunk-BLQUXO7S.js.map +1 -0
  39. package/dist/{chunk-WTZDAYZX.js → chunk-BQ6FR32N.js} +3 -3
  40. package/dist/chunk-BQ6FR32N.js.map +1 -0
  41. package/dist/chunk-FNRSWA2K.js +1 -0
  42. package/dist/chunk-FQEBWOZR.js +3557 -0
  43. package/dist/chunk-FQEBWOZR.js.map +1 -0
  44. package/dist/{chunk-4CTX774K.js → chunk-GJOY37U7.js} +4 -4
  45. package/dist/chunk-GJOY37U7.js.map +1 -0
  46. package/dist/{chunk-I7WC6E5S.js → chunk-HVBNCPAY.js} +2 -2
  47. package/dist/chunk-HVBNCPAY.js.map +1 -0
  48. package/dist/{chunk-2HMQOC7N.js → chunk-I3CGU5W7.js} +4 -4
  49. package/dist/chunk-I3CGU5W7.js.map +1 -0
  50. package/dist/{chunk-NVPG6JCL.js → chunk-L7YNNBI5.js} +3 -3
  51. package/dist/chunk-L7YNNBI5.js.map +1 -0
  52. package/dist/chunk-LGFWH3AE.js +26 -0
  53. package/dist/chunk-LGFWH3AE.js.map +1 -0
  54. package/dist/chunk-MLF4W5R6.js +101 -0
  55. package/dist/chunk-MLF4W5R6.js.map +1 -0
  56. package/dist/{chunk-KIRH7TUJ.js → chunk-MTSDOSXS.js} +3 -3
  57. package/dist/chunk-MTSDOSXS.js.map +1 -0
  58. package/dist/{chunk-J4SJTKIK.js → chunk-NAM4ERUW.js} +3 -3
  59. package/dist/chunk-NAM4ERUW.js.map +1 -0
  60. package/dist/{chunk-MKHUZLII.js → chunk-NBFIBGAT.js} +39 -25
  61. package/dist/chunk-NBFIBGAT.js.map +1 -0
  62. package/dist/{chunk-BNLGTZ34.js → chunk-O5RG4YZY.js} +3 -3
  63. package/dist/chunk-O5RG4YZY.js.map +1 -0
  64. package/dist/{chunk-JHYXKVV2.js → chunk-ODUM3D6X.js} +2 -2
  65. package/dist/chunk-ODUM3D6X.js.map +1 -0
  66. package/dist/chunk-OYSAN7UX.js +15 -0
  67. package/dist/chunk-OYSAN7UX.js.map +1 -0
  68. package/dist/chunk-P4SNGQNI.js +158 -0
  69. package/dist/chunk-P4SNGQNI.js.map +1 -0
  70. package/dist/{chunk-2CJ46J3C.js → chunk-PPSMUECX.js} +3 -3
  71. package/dist/chunk-PPSMUECX.js.map +1 -0
  72. package/dist/chunk-Q6ZXJTZB.js +56 -0
  73. package/dist/chunk-Q6ZXJTZB.js.map +1 -0
  74. package/dist/{chunk-XANPHG7W.js → chunk-QSDZDHNS.js} +7 -7
  75. package/dist/chunk-QSDZDHNS.js.map +1 -0
  76. package/dist/{chunk-33RP6K2O.js → chunk-QVMEF6FB.js} +6 -6
  77. package/dist/chunk-QVMEF6FB.js.map +1 -0
  78. package/dist/chunk-QWP76EBW.js +536 -0
  79. package/dist/chunk-QWP76EBW.js.map +1 -0
  80. package/dist/{chunk-V5GZQEIY.js → chunk-RBYBSSGO.js} +4 -4
  81. package/dist/chunk-RBYBSSGO.js.map +1 -0
  82. package/dist/{chunk-CS3KCJ5D.js → chunk-RKB2ZK6S.js} +555 -383
  83. package/dist/chunk-RKB2ZK6S.js.map +1 -0
  84. package/dist/{chunk-UKT3G5IA.js → chunk-SHTGQGAU.js} +7 -7
  85. package/dist/chunk-SHTGQGAU.js.map +1 -0
  86. package/dist/chunk-SNPYTMPR.js +51 -0
  87. package/dist/chunk-SNPYTMPR.js.map +1 -0
  88. package/dist/chunk-UB2QB6DE.js +124 -0
  89. package/dist/chunk-UB2QB6DE.js.map +1 -0
  90. package/dist/chunk-UNJUWWQO.js +1108 -0
  91. package/dist/chunk-UNJUWWQO.js.map +1 -0
  92. package/dist/chunk-V2M243KZ.js +445 -0
  93. package/dist/chunk-V2M243KZ.js.map +1 -0
  94. package/dist/chunk-V5JT5TPD.js +97 -0
  95. package/dist/chunk-V5JT5TPD.js.map +1 -0
  96. package/dist/chunk-W26AUH5B.js +61 -0
  97. package/dist/chunk-W26AUH5B.js.map +1 -0
  98. package/dist/chunk-WAAD23KY.js +222 -0
  99. package/dist/chunk-WAAD23KY.js.map +1 -0
  100. package/dist/chunk-WIIZNPCR.js +150 -0
  101. package/dist/chunk-WIIZNPCR.js.map +1 -0
  102. package/dist/chunk-WQCJTU2C.js +84 -0
  103. package/dist/chunk-WQCJTU2C.js.map +1 -0
  104. package/dist/chunk-WVLDNYOJ.js +150 -0
  105. package/dist/chunk-WVLDNYOJ.js.map +1 -0
  106. package/dist/chunk-WXVT3AOY.js +22 -0
  107. package/dist/chunk-WXVT3AOY.js.map +1 -0
  108. package/dist/{chunk-GAK6PIBW.js → chunk-XMMAGAT4.js} +2 -2
  109. package/dist/chunk-XMMAGAT4.js.map +1 -0
  110. package/dist/chunk-Y64XWMJ4.js +212 -0
  111. package/dist/chunk-Y64XWMJ4.js.map +1 -0
  112. package/dist/chunk-YEULD3SG.js +62 -0
  113. package/dist/chunk-YEULD3SG.js.map +1 -0
  114. package/dist/chunk-ZHGPZBS4.js +49 -0
  115. package/dist/chunk-ZHGPZBS4.js.map +1 -0
  116. package/dist/{chunk-JKBFUAJK.js → chunk-ZSLHHQPQ.js} +2 -2
  117. package/dist/chunk-ZSLHHQPQ.js.map +1 -0
  118. package/dist/cli.js +496 -150
  119. package/dist/cli.js.map +1 -1
  120. package/dist/{config-6S355X75.js → config-I4FMCJGZ.js} +3 -3
  121. package/dist/config-editor-HNEKXRLQ.js +11 -0
  122. package/dist/{config-registry-AHYI4MYL.js → config-registry-CUMNXFGK.js} +2 -2
  123. package/dist/context-XM6E22LM.js +10 -0
  124. package/dist/core-plugins-VEUNFTMB.js +27 -0
  125. package/dist/{daemon-4CS6HMB5.js → daemon-PXO5QPCR.js} +4 -4
  126. package/dist/dev-loader-RDC5E2CW.js +50 -0
  127. package/dist/dev-loader-RDC5E2CW.js.map +1 -0
  128. package/dist/discord-NOJQ5PZO.js +8 -0
  129. package/dist/doctor-H72BZOPA.js +10 -0
  130. package/dist/{doctor-OLYBO3V3.js → doctor-RF6BHMCC.js} +5 -5
  131. package/dist/file-service-EUODJAIT.js +9 -0
  132. package/dist/file-service-EUODJAIT.js.map +1 -0
  133. package/dist/index.d.ts +1293 -188
  134. package/dist/index.js +387 -48
  135. package/dist/index.js.map +1 -1
  136. package/dist/{install-cloudflared-Z7VCGOVG.js → install-cloudflared-AN24L4DP.js} +5 -5
  137. package/dist/install-cloudflared-AN24L4DP.js.map +1 -0
  138. package/dist/install-context-XPWTFT3J.js +78 -0
  139. package/dist/install-context-XPWTFT3J.js.map +1 -0
  140. package/dist/{install-jq-HUYSQWKR.js → install-jq-CRVDJGF3.js} +5 -5
  141. package/dist/install-jq-CRVDJGF3.js.map +1 -0
  142. package/dist/{integrate-PNEHRY2I.js → integrate-5C6KSU6D.js} +2 -2
  143. package/dist/integrate-5C6KSU6D.js.map +1 -0
  144. package/dist/{log-NXABYJTT.js → log-LZ7FTRKG.js} +2 -2
  145. package/dist/log-LZ7FTRKG.js.map +1 -0
  146. package/dist/main-T5WVCCFN.js +715 -0
  147. package/dist/main-T5WVCCFN.js.map +1 -0
  148. package/dist/{menu-YY5MKHEK.js → menu-YDQ2LWAR.js} +2 -2
  149. package/dist/menu-YDQ2LWAR.js.map +1 -0
  150. package/dist/{new-session-FEO4J4VU.js → new-session-AVQCNXRG.js} +5 -5
  151. package/dist/new-session-AVQCNXRG.js.map +1 -0
  152. package/dist/notifications-D5BRDNSU.js +9 -0
  153. package/dist/notifications-D5BRDNSU.js.map +1 -0
  154. package/dist/plugin-create-JVCVUG6V.js +331 -0
  155. package/dist/plugin-create-JVCVUG6V.js.map +1 -0
  156. package/dist/plugin-registry-WB3DR67H.js +8 -0
  157. package/dist/plugin-registry-WB3DR67H.js.map +1 -0
  158. package/dist/{post-upgrade-CJG5I7M2.js → post-upgrade-XLHZ6ZB7.js} +8 -8
  159. package/dist/post-upgrade-XLHZ6ZB7.js.map +1 -0
  160. package/dist/read-text-file-IRZM3QLM.js +8 -0
  161. package/dist/read-text-file-IRZM3QLM.js.map +1 -0
  162. package/dist/security-YNRBW6S7.js +9 -0
  163. package/dist/security-YNRBW6S7.js.map +1 -0
  164. package/dist/{session-IUSI7P5S.js → session-KZFA6Z26.js} +4 -4
  165. package/dist/session-KZFA6Z26.js.map +1 -0
  166. package/dist/{settings-RQPAM4KC.js → settings-MFYM7CZO.js} +4 -4
  167. package/dist/settings-MFYM7CZO.js.map +1 -0
  168. package/dist/settings-manager-MD2U4ZV2.js +8 -0
  169. package/dist/settings-manager-MD2U4ZV2.js.map +1 -0
  170. package/dist/{chunk-LCRLAV4G.js → setup-BAI2F24H.js} +154 -492
  171. package/dist/setup-BAI2F24H.js.map +1 -0
  172. package/dist/slack-KH7E3VBS.js +8 -0
  173. package/dist/slack-KH7E3VBS.js.map +1 -0
  174. package/dist/speech-2GHQNRIO.js +9 -0
  175. package/dist/speech-2GHQNRIO.js.map +1 -0
  176. package/dist/telegram-ZDC3JQF2.js +8 -0
  177. package/dist/telegram-ZDC3JQF2.js.map +1 -0
  178. package/dist/tunnel-M47I7H4B.js +8 -0
  179. package/dist/tunnel-M47I7H4B.js.map +1 -0
  180. package/dist/{tunnel-service-CJLUH6SZ.js → tunnel-service-WADYHREX.js} +17 -17
  181. package/dist/tunnel-service-WADYHREX.js.map +1 -0
  182. package/dist/usage-WYNK6ZC5.js +10 -0
  183. package/dist/usage-WYNK6ZC5.js.map +1 -0
  184. package/dist/validators-6CLEZUBD.js +8 -0
  185. package/dist/validators-6CLEZUBD.js.map +1 -0
  186. package/dist/validators-WSTBNKRW.js +12 -0
  187. package/dist/validators-WSTBNKRW.js.map +1 -0
  188. package/package.json +1 -1
  189. package/dist/adapter-ZOANORGM.js.map +0 -1
  190. package/dist/agent-catalog-FC3HGDEQ.js +0 -11
  191. package/dist/agent-registry-WT4NXPYG.js +0 -9
  192. package/dist/agent-store-VZLFPTZU.js +0 -9
  193. package/dist/chunk-2CJ46J3C.js.map +0 -1
  194. package/dist/chunk-2HMQOC7N.js.map +0 -1
  195. package/dist/chunk-33RP6K2O.js.map +0 -1
  196. package/dist/chunk-34M4OS5P.js.map +0 -1
  197. package/dist/chunk-4CTX774K.js.map +0 -1
  198. package/dist/chunk-7QJS2XBD.js.map +0 -1
  199. package/dist/chunk-BNLGTZ34.js.map +0 -1
  200. package/dist/chunk-CS3KCJ5D.js.map +0 -1
  201. package/dist/chunk-GAK6PIBW.js.map +0 -1
  202. package/dist/chunk-I7WC6E5S.js.map +0 -1
  203. package/dist/chunk-J4SJTKIK.js.map +0 -1
  204. package/dist/chunk-JHYXKVV2.js.map +0 -1
  205. package/dist/chunk-JKBFUAJK.js.map +0 -1
  206. package/dist/chunk-KIRH7TUJ.js.map +0 -1
  207. package/dist/chunk-LBIKITQT.js +0 -22
  208. package/dist/chunk-LBIKITQT.js.map +0 -1
  209. package/dist/chunk-LCRLAV4G.js.map +0 -1
  210. package/dist/chunk-LGP2YGRL.js +0 -4880
  211. package/dist/chunk-LGP2YGRL.js.map +0 -1
  212. package/dist/chunk-MKHUZLII.js.map +0 -1
  213. package/dist/chunk-NAMYZIS5.js +0 -1
  214. package/dist/chunk-NVPG6JCL.js.map +0 -1
  215. package/dist/chunk-O7CPGUAI.js.map +0 -1
  216. package/dist/chunk-OWP7RZ62.js.map +0 -1
  217. package/dist/chunk-UKT3G5IA.js.map +0 -1
  218. package/dist/chunk-V5GZQEIY.js.map +0 -1
  219. package/dist/chunk-VOIJ6OY4.js +0 -63
  220. package/dist/chunk-VOIJ6OY4.js.map +0 -1
  221. package/dist/chunk-W3EYKZNQ.js.map +0 -1
  222. package/dist/chunk-WTZDAYZX.js.map +0 -1
  223. package/dist/chunk-XANPHG7W.js.map +0 -1
  224. package/dist/config-editor-QQTZMWGD.js +0 -13
  225. package/dist/discord-OMC52Y54.js.map +0 -1
  226. package/dist/doctor-HZZ5BSHB.js +0 -10
  227. package/dist/install-cloudflared-Z7VCGOVG.js.map +0 -1
  228. package/dist/install-jq-HUYSQWKR.js.map +0 -1
  229. package/dist/integrate-PNEHRY2I.js.map +0 -1
  230. package/dist/main-XOZCLFUK.js +0 -238
  231. package/dist/main-XOZCLFUK.js.map +0 -1
  232. package/dist/post-upgrade-CJG5I7M2.js.map +0 -1
  233. package/dist/setup-XHS4OMPM.js +0 -37
  234. package/dist/tunnel-service-CJLUH6SZ.js.map +0 -1
  235. /package/dist/{action-detect-P7ZE4NEM.js.map → action-detect-QPA775HB.js.map} +0 -0
  236. /package/dist/{admin-6SYB6XCZ.js.map → adapter-6ANPBSVU.js.map} +0 -0
  237. /package/dist/{agent-catalog-FC3HGDEQ.js.map → admin-GBPZFFAU.js.map} +0 -0
  238. /package/dist/{agent-dependencies-4OWBMZWZ.js.map → agent-catalog-YHBFERYO.js.map} +0 -0
  239. /package/dist/{agent-registry-WT4NXPYG.js.map → agent-dependencies-WS7Z2DFW.js.map} +0 -0
  240. /package/dist/{agent-store-VZLFPTZU.js.map → agent-registry-5LZT7CUB.js.map} +0 -0
  241. /package/dist/{agents-QO7DKARJ.js.map → agent-store-VSHNY5GT.js.map} +0 -0
  242. /package/dist/{api-client-CFQT5U7D.js.map → agents-BWU4MRRD.js.map} +0 -0
  243. /package/dist/{autostart-X33OGMX6.js.map → api-client-AQPNKXI2.js.map} +0 -0
  244. /package/dist/{chunk-NAMYZIS5.js.map → api-server-3PYLRBCN.js.map} +0 -0
  245. /package/dist/{config-6S355X75.js.map → api-server-CHVSUDBX.js.map} +0 -0
  246. /package/dist/{config-editor-QQTZMWGD.js.map → autostart-6JS565RY.js.map} +0 -0
  247. /package/dist/{config-registry-AHYI4MYL.js.map → chunk-FNRSWA2K.js.map} +0 -0
  248. /package/dist/{daemon-4CS6HMB5.js.map → config-I4FMCJGZ.js.map} +0 -0
  249. /package/dist/{doctor-HZZ5BSHB.js.map → config-editor-HNEKXRLQ.js.map} +0 -0
  250. /package/dist/{doctor-OLYBO3V3.js.map → config-registry-CUMNXFGK.js.map} +0 -0
  251. /package/dist/{log-NXABYJTT.js.map → context-XM6E22LM.js.map} +0 -0
  252. /package/dist/{menu-YY5MKHEK.js.map → core-plugins-VEUNFTMB.js.map} +0 -0
  253. /package/dist/{new-session-FEO4J4VU.js.map → daemon-PXO5QPCR.js.map} +0 -0
  254. /package/dist/{session-IUSI7P5S.js.map → discord-NOJQ5PZO.js.map} +0 -0
  255. /package/dist/{settings-RQPAM4KC.js.map → doctor-H72BZOPA.js.map} +0 -0
  256. /package/dist/{setup-XHS4OMPM.js.map → doctor-RF6BHMCC.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import pino from 'pino';
2
- import { z } from 'zod';
2
+ import * as zod from 'zod';
3
+ import { z, ZodSchema } from 'zod';
3
4
  import { EventEmitter } from 'node:events';
4
5
  import { Readable, Writable } from 'node:stream';
5
- import { PromptResponse } from '@agentclientprotocol/sdk';
6
+ import { SetSessionConfigOptionResponse, ListSessionsResponse, LoadSessionResponse, ForkSessionResponse, PromptResponse as PromptResponse$1 } from '@agentclientprotocol/sdk';
6
7
  import * as http from 'node:http';
7
8
 
8
9
  interface Attachment {
@@ -21,7 +22,7 @@ interface IncomingMessage {
21
22
  attachments?: Attachment[];
22
23
  }
23
24
  interface OutgoingMessage {
24
- type: "text" | "thought" | "tool_call" | "tool_update" | "plan" | "usage" | "session_end" | "error" | "attachment" | "system_message";
25
+ type: "text" | "thought" | "tool_call" | "tool_update" | "plan" | "usage" | "session_end" | "error" | "attachment" | "system_message" | "mode_change" | "config_update" | "model_update" | "user_replay" | "resource" | "resource_link";
25
26
  text: string;
26
27
  metadata?: Record<string, unknown>;
27
28
  attachment?: Attachment;
@@ -63,6 +64,7 @@ type AgentEvent = {
63
64
  content?: unknown;
64
65
  locations?: unknown;
65
66
  rawInput?: unknown;
67
+ rawOutput?: unknown;
66
68
  meta?: unknown;
67
69
  } | {
68
70
  type: "tool_update";
@@ -73,6 +75,7 @@ type AgentEvent = {
73
75
  content?: unknown;
74
76
  locations?: unknown;
75
77
  rawInput?: unknown;
78
+ rawOutput?: unknown;
76
79
  meta?: unknown;
77
80
  } | {
78
81
  type: "plan";
@@ -105,6 +108,38 @@ type AgentEvent = {
105
108
  } | {
106
109
  type: "system_message";
107
110
  message: string;
111
+ } | {
112
+ type: "session_info_update";
113
+ title?: string;
114
+ updatedAt?: string;
115
+ _meta?: Record<string, unknown>;
116
+ } | {
117
+ type: "current_mode_update";
118
+ modeId: string;
119
+ } | {
120
+ type: "config_option_update";
121
+ options: ConfigOption[];
122
+ } | {
123
+ type: "model_update";
124
+ modelId: string;
125
+ } | {
126
+ type: "user_message_chunk";
127
+ content: string;
128
+ } | {
129
+ type: "resource_content";
130
+ uri: string;
131
+ name: string;
132
+ text?: string;
133
+ blob?: string;
134
+ mimeType?: string;
135
+ } | {
136
+ type: "resource_link";
137
+ uri: string;
138
+ name: string;
139
+ mimeType?: string;
140
+ title?: string;
141
+ description?: string;
142
+ size?: number;
108
143
  };
109
144
  interface PlanEntry {
110
145
  content: string;
@@ -238,6 +273,160 @@ interface DiscordPlatformData {
238
273
  threadId: string;
239
274
  skillMsgId?: string;
240
275
  }
276
+ interface SessionMode {
277
+ id: string;
278
+ name: string;
279
+ description?: string;
280
+ }
281
+ interface SessionModeState {
282
+ currentModeId: string;
283
+ availableModes: SessionMode[];
284
+ }
285
+ interface ConfigSelectChoice {
286
+ value: string;
287
+ label: string;
288
+ description?: string;
289
+ }
290
+ interface ConfigSelectGroup {
291
+ group: string;
292
+ name: string;
293
+ options: ConfigSelectChoice[];
294
+ }
295
+ type ConfigOption = {
296
+ id: string;
297
+ name: string;
298
+ description?: string;
299
+ category?: string;
300
+ type: "select";
301
+ currentValue: string;
302
+ options: (ConfigSelectChoice | ConfigSelectGroup)[];
303
+ _meta?: Record<string, unknown>;
304
+ } | {
305
+ id: string;
306
+ name: string;
307
+ description?: string;
308
+ category?: string;
309
+ type: "boolean";
310
+ currentValue: boolean;
311
+ _meta?: Record<string, unknown>;
312
+ };
313
+ type SetConfigOptionValue = {
314
+ type: "select";
315
+ value: string;
316
+ } | {
317
+ type: "boolean";
318
+ value: boolean;
319
+ };
320
+ interface ModelInfo {
321
+ id: string;
322
+ name: string;
323
+ description?: string;
324
+ }
325
+ interface SessionModelState {
326
+ currentModelId: string;
327
+ availableModels: ModelInfo[];
328
+ }
329
+ interface AgentCapabilities {
330
+ name: string;
331
+ title?: string;
332
+ version?: string;
333
+ loadSession?: boolean;
334
+ promptCapabilities?: {
335
+ image?: boolean;
336
+ audio?: boolean;
337
+ embeddedContext?: boolean;
338
+ };
339
+ sessionCapabilities?: {
340
+ list?: boolean;
341
+ fork?: boolean;
342
+ close?: boolean;
343
+ };
344
+ mcp?: {
345
+ http?: boolean;
346
+ sse?: boolean;
347
+ };
348
+ authMethods?: AuthMethod[];
349
+ }
350
+ interface NewSessionResponse {
351
+ sessionId: string;
352
+ modes?: SessionModeState;
353
+ configOptions?: ConfigOption[];
354
+ models?: SessionModelState;
355
+ }
356
+ type AuthMethod = {
357
+ type: "agent";
358
+ } | {
359
+ type: "env_var";
360
+ name: string;
361
+ description?: string;
362
+ } | {
363
+ type: "terminal";
364
+ };
365
+ interface AuthenticateRequest {
366
+ methodId: string;
367
+ }
368
+ type StopReason = "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
369
+ interface PromptResponse {
370
+ stopReason: StopReason;
371
+ _meta?: Record<string, unknown>;
372
+ }
373
+ type ContentBlock = {
374
+ type: "text";
375
+ text: string;
376
+ } | {
377
+ type: "image";
378
+ data: string;
379
+ mimeType: string;
380
+ uri?: string;
381
+ } | {
382
+ type: "audio";
383
+ data: string;
384
+ mimeType: string;
385
+ } | {
386
+ type: "resource";
387
+ resource: {
388
+ uri: string;
389
+ text?: string;
390
+ blob?: string;
391
+ mimeType?: string;
392
+ };
393
+ } | {
394
+ type: "resource_link";
395
+ uri: string;
396
+ name: string;
397
+ mimeType?: string;
398
+ title?: string;
399
+ description?: string;
400
+ size?: number;
401
+ };
402
+ interface SessionListItem {
403
+ sessionId: string;
404
+ title?: string;
405
+ createdAt: string;
406
+ updatedAt?: string;
407
+ _meta?: Record<string, unknown>;
408
+ }
409
+ interface SessionListResponse {
410
+ sessions: SessionListItem[];
411
+ nextCursor?: string;
412
+ }
413
+ type McpServerConfig = {
414
+ type?: "stdio";
415
+ name: string;
416
+ command: string;
417
+ args?: string[];
418
+ env?: Record<string, string>;
419
+ } | {
420
+ type: "http";
421
+ name: string;
422
+ url: string;
423
+ headers?: Record<string, string>;
424
+ } | {
425
+ type: "sse";
426
+ name: string;
427
+ url: string;
428
+ headers?: Record<string, string>;
429
+ };
241
430
 
242
431
  declare const PLUGINS_DIR: string;
243
432
  declare const LoggingSchema: z.ZodDefault<z.ZodObject<{
@@ -875,7 +1064,7 @@ declare const ConfigSchema: z.ZodObject<{
875
1064
  }>;
876
1065
  type Config = z.infer<typeof ConfigSchema>;
877
1066
  declare function expandHome(p: string): string;
878
- declare class ConfigManager extends EventEmitter {
1067
+ declare class ConfigManager$1 extends EventEmitter {
879
1068
  private config;
880
1069
  private configPath;
881
1070
  constructor();
@@ -890,7 +1079,7 @@ declare class ConfigManager extends EventEmitter {
890
1079
  private deepMerge;
891
1080
  }
892
1081
 
893
- type Logger = pino.Logger;
1082
+ type Logger$1 = pino.Logger;
894
1083
  declare const log: {
895
1084
  info: (...args: unknown[]) => void;
896
1085
  warn: (...args: unknown[]) => void;
@@ -899,14 +1088,14 @@ declare const log: {
899
1088
  fatal: (...args: unknown[]) => void;
900
1089
  child: (bindings: pino.Bindings) => pino.Logger<never, boolean>;
901
1090
  };
902
- declare function initLogger(config: LoggingConfig): Logger;
1091
+ declare function initLogger(config: LoggingConfig): Logger$1;
903
1092
  /** Change log level at runtime. Pino transport targets respect parent level changes automatically. */
904
1093
  declare function setLogLevel(level: string): void;
905
1094
  declare function createChildLogger(context: {
906
1095
  module: string;
907
1096
  [key: string]: unknown;
908
- }): Logger;
909
- declare function createSessionLogger(sessionId: string, parentLogger: Logger): Logger;
1097
+ }): Logger$1;
1098
+ declare function createSessionLogger(sessionId: string, parentLogger: Logger$1): Logger$1;
910
1099
  declare function shutdownLogger(): Promise<void>;
911
1100
  declare function cleanupOldSessionLogs(retentionDays: number): Promise<void>;
912
1101
 
@@ -914,7 +1103,17 @@ interface ChannelConfig {
914
1103
  enabled: boolean;
915
1104
  [key: string]: unknown;
916
1105
  }
1106
+ interface AdapterCapabilities {
1107
+ streaming: boolean;
1108
+ richFormatting: boolean;
1109
+ threads: boolean;
1110
+ reactions: boolean;
1111
+ fileUpload: boolean;
1112
+ voice: boolean;
1113
+ }
917
1114
  interface IChannelAdapter {
1115
+ readonly name: string;
1116
+ readonly capabilities: AdapterCapabilities;
918
1117
  start(): Promise<void>;
919
1118
  stop(): Promise<void>;
920
1119
  sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
@@ -922,17 +1121,21 @@ interface IChannelAdapter {
922
1121
  sendNotification(notification: NotificationMessage): Promise<void>;
923
1122
  createSessionThread(sessionId: string, name: string): Promise<string>;
924
1123
  renameSessionThread(sessionId: string, newName: string): Promise<void>;
925
- deleteSessionThread(sessionId: string): Promise<void>;
926
- sendSkillCommands(sessionId: string, commands: AgentCommand[]): Promise<void>;
927
- cleanupSkillCommands(sessionId: string): Promise<void>;
1124
+ deleteSessionThread?(sessionId: string): Promise<void>;
1125
+ archiveSessionTopic?(sessionId: string): Promise<void>;
1126
+ sendSkillCommands?(sessionId: string, commands: AgentCommand[]): Promise<void>;
1127
+ cleanupSkillCommands?(sessionId: string): Promise<void>;
928
1128
  }
929
1129
  /**
930
1130
  * Base class providing default no-op implementations for optional methods.
931
1131
  * Adapters can extend this or implement IChannelAdapter directly.
1132
+ * @deprecated Use MessagingAdapter or StreamAdapter instead. Kept for backward compat during migration.
932
1133
  */
933
1134
  declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapter {
934
1135
  readonly core: TCore;
935
1136
  protected config: ChannelConfig;
1137
+ abstract readonly name: string;
1138
+ readonly capabilities: AdapterCapabilities;
936
1139
  constructor(core: TCore, config: ChannelConfig);
937
1140
  abstract start(): Promise<void>;
938
1141
  abstract stop(): Promise<void>;
@@ -947,13 +1150,6 @@ declare abstract class ChannelAdapter<TCore = unknown> implements IChannelAdapte
947
1150
  archiveSessionTopic(_sessionId: string): Promise<void>;
948
1151
  }
949
1152
 
950
- declare class NotificationManager {
951
- private adapters;
952
- constructor(adapters: Map<string, ChannelAdapter>);
953
- notify(channelId: string, notification: NotificationMessage): Promise<void>;
954
- notifyAll(notification: NotificationMessage): Promise<void>;
955
- }
956
-
957
1153
  declare function nodeToWebWritable(nodeStream: Writable): WritableStream<Uint8Array>;
958
1154
  declare function nodeToWebReadable(nodeStream: Readable): ReadableStream<Uint8Array>;
959
1155
 
@@ -1000,6 +1196,37 @@ declare class TypedEmitter<T extends Record<string & keyof T, (...args: any[]) =
1000
1196
  private deliver;
1001
1197
  }
1002
1198
 
1199
+ interface ErrorBudgetConfig {
1200
+ maxErrors: number;
1201
+ windowMs: number;
1202
+ }
1203
+ declare class ErrorTracker {
1204
+ private errors;
1205
+ private disabled;
1206
+ private exempt;
1207
+ private config;
1208
+ onDisabled?: (pluginName: string, reason: string) => void;
1209
+ constructor(config?: Partial<ErrorBudgetConfig>);
1210
+ increment(pluginName: string): void;
1211
+ isDisabled(pluginName: string): boolean;
1212
+ reset(pluginName: string): void;
1213
+ setExempt(pluginName: string): void;
1214
+ }
1215
+
1216
+ declare class MiddlewareChain {
1217
+ private chains;
1218
+ private errorHandler?;
1219
+ private errorTracker?;
1220
+ add(hook: string, pluginName: string, opts: {
1221
+ priority?: number;
1222
+ handler: Function;
1223
+ }): void;
1224
+ execute<T>(hook: string, payload: T, coreHandler: (p: T) => T | Promise<T>): Promise<T | null>;
1225
+ removeAll(pluginName: string): void;
1226
+ setErrorHandler(fn: (pluginName: string, error: Error) => void): void;
1227
+ setErrorTracker(tracker: ErrorTracker): void;
1228
+ }
1229
+
1003
1230
  interface AgentInstanceEvents {
1004
1231
  agent_event: (event: AgentEvent) => void;
1005
1232
  }
@@ -1007,21 +1234,31 @@ declare class AgentInstance extends TypedEmitter<AgentInstanceEvents> {
1007
1234
  private connection;
1008
1235
  private child;
1009
1236
  private stderrCapture;
1010
- private terminals;
1237
+ private terminalManager;
1238
+ private static mcpManager;
1011
1239
  sessionId: string;
1012
1240
  agentName: string;
1013
1241
  promptCapabilities?: {
1014
1242
  image?: boolean;
1015
1243
  audio?: boolean;
1016
1244
  };
1245
+ middlewareChain?: MiddlewareChain;
1017
1246
  onPermissionRequest: (request: PermissionRequest) => Promise<string>;
1018
1247
  private constructor();
1019
1248
  private static spawnSubprocess;
1020
1249
  private setupCrashDetection;
1021
- static spawn(agentDef: AgentDefinition, workingDirectory: string): Promise<AgentInstance>;
1022
- static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string): Promise<AgentInstance>;
1250
+ static spawn(agentDef: AgentDefinition, workingDirectory: string, mcpServers?: McpServerConfig[]): Promise<AgentInstance>;
1251
+ static resume(agentDef: AgentDefinition, workingDirectory: string, agentSessionId: string, mcpServers?: McpServerConfig[]): Promise<AgentInstance>;
1023
1252
  private createClient;
1024
- prompt(text: string, attachments?: Attachment[]): Promise<PromptResponse>;
1253
+ setMode(modeId: string): Promise<void>;
1254
+ setConfigOption(configId: string, value: SetConfigOptionValue): Promise<SetSessionConfigOptionResponse>;
1255
+ setModel(modelId: string): Promise<void>;
1256
+ listSessions(cwd?: string, cursor?: string): Promise<ListSessionsResponse>;
1257
+ loadSession(sessionId: string, cwd: string, mcpServers?: McpServerConfig[]): Promise<LoadSessionResponse>;
1258
+ authenticate(methodId: string): Promise<void>;
1259
+ forkSession(sessionId: string, cwd: string, mcpServers?: McpServerConfig[]): Promise<ForkSessionResponse>;
1260
+ closeSession(sessionId: string): Promise<void>;
1261
+ prompt(text: string, attachments?: Attachment[]): Promise<PromptResponse$1>;
1025
1262
  cancel(): Promise<void>;
1026
1263
  destroy(): Promise<void>;
1027
1264
  }
@@ -1120,11 +1357,11 @@ interface TTSResult {
1120
1357
  audioBuffer: Buffer;
1121
1358
  mimeType: string;
1122
1359
  }
1123
- interface STTProvider {
1360
+ interface STTProvider$1 {
1124
1361
  readonly name: string;
1125
1362
  transcribe(audioBuffer: Buffer, mimeType: string, options?: STTOptions): Promise<STTResult>;
1126
1363
  }
1127
- interface TTSProvider {
1364
+ interface TTSProvider$1 {
1128
1365
  readonly name: string;
1129
1366
  synthesize(text: string, options?: TTSOptions): Promise<TTSResult>;
1130
1367
  }
@@ -1144,21 +1381,30 @@ interface SpeechServiceConfig {
1144
1381
  };
1145
1382
  }
1146
1383
 
1384
+ type ProviderFactory = (config: SpeechServiceConfig) => {
1385
+ stt: Map<string, STTProvider$1>;
1386
+ tts: Map<string, TTSProvider$1>;
1387
+ };
1147
1388
  declare class SpeechService {
1148
1389
  private config;
1149
1390
  private sttProviders;
1150
1391
  private ttsProviders;
1392
+ private providerFactory?;
1151
1393
  constructor(config: SpeechServiceConfig);
1152
- registerSTTProvider(name: string, provider: STTProvider): void;
1153
- registerTTSProvider(name: string, provider: TTSProvider): void;
1394
+ /** Set a factory function that can recreate providers from config (for hot-reload) */
1395
+ setProviderFactory(factory: ProviderFactory): void;
1396
+ registerSTTProvider(name: string, provider: STTProvider$1): void;
1397
+ registerTTSProvider(name: string, provider: TTSProvider$1): void;
1154
1398
  isSTTAvailable(): boolean;
1155
1399
  isTTSAvailable(): boolean;
1156
1400
  transcribe(audioBuffer: Buffer, mimeType: string, options?: STTOptions): Promise<STTResult>;
1157
1401
  synthesize(text: string, options?: TTSOptions): Promise<TTSResult>;
1158
1402
  updateConfig(config: SpeechServiceConfig): void;
1403
+ /** Re-create all providers from current config using the registered factory */
1404
+ refreshProviders(newConfig: SpeechServiceConfig): void;
1159
1405
  }
1160
1406
 
1161
- declare class GroqSTT implements STTProvider {
1407
+ declare class GroqSTT implements STTProvider$1 {
1162
1408
  private apiKey;
1163
1409
  private defaultModel;
1164
1410
  readonly name = "groq";
@@ -1187,9 +1433,16 @@ declare class Session extends TypedEmitter<SessionEvents> {
1187
1433
  createdAt: Date;
1188
1434
  voiceMode: "off" | "next" | "on";
1189
1435
  dangerousMode: boolean;
1436
+ currentMode?: string;
1437
+ availableModes: SessionMode[];
1438
+ configOptions: ConfigOption[];
1439
+ currentModel?: string;
1440
+ availableModels: ModelInfo[];
1441
+ agentCapabilities?: AgentCapabilities;
1190
1442
  archiving: boolean;
1191
1443
  promptCount: number;
1192
- log: Logger;
1444
+ log: Logger$1;
1445
+ middlewareChain?: MiddlewareChain;
1193
1446
  readonly permissionGate: PermissionGate;
1194
1447
  private readonly queue;
1195
1448
  private speechService?;
@@ -1226,6 +1479,17 @@ declare class Session extends TypedEmitter<SessionEvents> {
1226
1479
  /** Fire-and-forget warm-up: primes model cache while user types their first message */
1227
1480
  warmup(): Promise<void>;
1228
1481
  private runWarmup;
1482
+ setInitialAcpState(state: {
1483
+ modes?: SessionModeState | null;
1484
+ configOptions?: ConfigOption[] | null;
1485
+ models?: SessionModelState | null;
1486
+ agentCapabilities?: AgentCapabilities | null;
1487
+ }): void;
1488
+ /** Set session name explicitly and emit 'named' event */
1489
+ setName(name: string): void;
1490
+ updateMode(modeId: string): Promise<void>;
1491
+ updateConfigOptions(options: ConfigOption[]): Promise<void>;
1492
+ updateModel(modelId: string): Promise<void>;
1229
1493
  /** Cancel the current prompt and clear the queue. Stays in active state. */
1230
1494
  abortPrompt(): Promise<void>;
1231
1495
  destroy(): Promise<void>;
@@ -1249,130 +1513,521 @@ declare class PromptQueue {
1249
1513
  get isProcessing(): boolean;
1250
1514
  }
1251
1515
 
1252
- interface TunnelEntry {
1253
- port: number;
1254
- type: 'system' | 'user';
1255
- provider: string;
1256
- label?: string;
1257
- publicUrl?: string;
1258
- sessionId?: string;
1259
- status: 'stopped' | 'starting' | 'active' | 'failed';
1260
- createdAt: string;
1516
+ type PluginPermission = 'events:read' | 'events:emit' | 'services:register' | 'services:use' | 'middleware:register' | 'commands:register' | 'storage:read' | 'storage:write' | 'kernel:access';
1517
+ interface OpenACPPlugin {
1518
+ /** Unique identifier, e.g., '@openacp/security' */
1519
+ name: string;
1520
+ /** Semver version */
1521
+ version: string;
1522
+ /** Human-readable description */
1523
+ description?: string;
1524
+ /** Required plugin dependencies — loaded before this plugin's setup() */
1525
+ pluginDependencies?: Record<string, string>;
1526
+ /** Optional dependencies — used if available, gracefully degrade if not */
1527
+ optionalPluginDependencies?: Record<string, string>;
1528
+ /** Override a built-in plugin (replaces it entirely) */
1529
+ overrides?: string;
1530
+ /** Required permissions — PluginContext enforces these */
1531
+ permissions?: PluginPermission[];
1532
+ /** Called during startup in dependency order */
1533
+ setup(ctx: PluginContext): Promise<void>;
1534
+ /** Called during shutdown in reverse order. 10s timeout. */
1535
+ teardown?(): Promise<void>;
1536
+ install?(ctx: InstallContext): Promise<void>;
1537
+ uninstall?(ctx: InstallContext, opts: {
1538
+ purge: boolean;
1539
+ }): Promise<void>;
1540
+ configure?(ctx: InstallContext): Promise<void>;
1541
+ migrate?(ctx: MigrateContext, oldSettings: unknown, oldVersion: string): Promise<unknown>;
1542
+ settingsSchema?: zod.ZodSchema;
1543
+ essential?: boolean;
1544
+ }
1545
+ interface PluginStorage {
1546
+ get<T>(key: string): Promise<T | undefined>;
1547
+ set<T>(key: string, value: T): Promise<void>;
1548
+ delete(key: string): Promise<void>;
1549
+ list(): Promise<string[]>;
1550
+ getDataDir(): string;
1551
+ }
1552
+ interface SettingsAPI {
1553
+ get<T = unknown>(key: string): Promise<T | undefined>;
1554
+ set<T = unknown>(key: string, value: T): Promise<void>;
1555
+ getAll(): Promise<Record<string, unknown>>;
1556
+ setAll(settings: Record<string, unknown>): Promise<void>;
1557
+ delete(key: string): Promise<void>;
1558
+ clear(): Promise<void>;
1559
+ has(key: string): Promise<boolean>;
1560
+ }
1561
+ interface TerminalIO {
1562
+ text(opts: {
1563
+ message: string;
1564
+ placeholder?: string;
1565
+ defaultValue?: string;
1566
+ validate?: (value: string) => string | undefined;
1567
+ }): Promise<string>;
1568
+ select<T>(opts: {
1569
+ message: string;
1570
+ options: {
1571
+ value: T;
1572
+ label: string;
1573
+ hint?: string;
1574
+ }[];
1575
+ }): Promise<T>;
1576
+ confirm(opts: {
1577
+ message: string;
1578
+ initialValue?: boolean;
1579
+ }): Promise<boolean>;
1580
+ password(opts: {
1581
+ message: string;
1582
+ validate?: (value: string) => string | undefined;
1583
+ }): Promise<string>;
1584
+ multiselect<T>(opts: {
1585
+ message: string;
1586
+ options: {
1587
+ value: T;
1588
+ label: string;
1589
+ hint?: string;
1590
+ }[];
1591
+ required?: boolean;
1592
+ }): Promise<T[]>;
1593
+ log: {
1594
+ info(message: string): void;
1595
+ success(message: string): void;
1596
+ warning(message: string): void;
1597
+ error(message: string): void;
1598
+ step(message: string): void;
1599
+ };
1600
+ spinner(): {
1601
+ start(message: string): void;
1602
+ stop(message?: string): void;
1603
+ fail(message?: string): void;
1604
+ };
1605
+ note(message: string, title?: string): void;
1606
+ cancel(message?: string): void;
1607
+ }
1608
+ interface InstallContext {
1609
+ pluginName: string;
1610
+ terminal: TerminalIO;
1611
+ settings: SettingsAPI;
1612
+ legacyConfig?: Record<string, unknown>;
1613
+ dataDir: string;
1614
+ log: Logger;
1261
1615
  }
1262
-
1263
- interface ViewerEntry {
1264
- id: string;
1265
- type: 'file' | 'diff';
1266
- filePath?: string;
1267
- content: string;
1268
- oldContent?: string;
1269
- language?: string;
1270
- sessionId: string;
1271
- workingDirectory: string;
1272
- createdAt: number;
1273
- expiresAt: number;
1616
+ interface MigrateContext {
1617
+ pluginName: string;
1618
+ settings: SettingsAPI;
1619
+ log: Logger;
1274
1620
  }
1275
- declare class ViewerStore {
1276
- private entries;
1277
- private cleanupTimer;
1278
- private ttlMs;
1279
- constructor(ttlMinutes?: number);
1280
- storeFile(sessionId: string, filePath: string, content: string, workingDirectory: string): string | null;
1281
- storeDiff(sessionId: string, filePath: string, oldContent: string, newContent: string, workingDirectory: string): string | null;
1282
- get(id: string): ViewerEntry | undefined;
1283
- private cleanup;
1284
- private isPathAllowed;
1285
- private detectLanguage;
1286
- destroy(): void;
1621
+ type CommandResponse = {
1622
+ type: 'text';
1623
+ text: string;
1624
+ } | {
1625
+ type: 'menu';
1626
+ title: string;
1627
+ options: MenuOption[];
1628
+ } | {
1629
+ type: 'list';
1630
+ title: string;
1631
+ items: ListItem[];
1632
+ } | {
1633
+ type: 'confirm';
1634
+ question: string;
1635
+ onYes: string;
1636
+ onNo: string;
1637
+ } | {
1638
+ type: 'error';
1639
+ message: string;
1640
+ } | {
1641
+ type: 'silent';
1642
+ };
1643
+ interface MenuOption {
1644
+ label: string;
1645
+ command: string;
1646
+ hint?: string;
1287
1647
  }
1288
-
1289
- declare class TunnelService {
1290
- private registry;
1291
- private store;
1292
- private server;
1293
- private config;
1294
- private systemPort;
1295
- constructor(config: TunnelConfig);
1296
- start(): Promise<string>;
1297
- stop(): Promise<void>;
1298
- addTunnel(port: number, opts?: {
1299
- label?: string;
1300
- sessionId?: string;
1301
- }): Promise<TunnelEntry>;
1302
- stopTunnel(port: number): Promise<void>;
1303
- stopAllUser(): Promise<void>;
1304
- stopBySession(sessionId: string): Promise<TunnelEntry[]>;
1305
- listTunnels(): TunnelEntry[];
1306
- getTunnel(port: number): TunnelEntry | null;
1307
- getPublicUrl(): string;
1308
- getStore(): ViewerStore;
1309
- fileUrl(entryId: string): string;
1310
- diffUrl(entryId: string): string;
1648
+ interface ListItem {
1649
+ label: string;
1650
+ detail?: string;
1651
+ }
1652
+ interface CommandArgs {
1653
+ /** Raw argument string after command name */
1654
+ raw: string;
1655
+ /** Parsed key/value options (e.g., --flag value) */
1656
+ options?: Record<string, string>;
1657
+ /** Session ID where command was invoked (null if from notification/system topic) */
1658
+ sessionId: string | null;
1659
+ /** Channel ID ('telegram', 'discord', 'slack') */
1660
+ channelId: string;
1661
+ /** User ID who invoked the command */
1662
+ userId: string;
1663
+ /** Reply helper — sends message to the topic where command was invoked */
1664
+ reply(content: string | CommandResponse | OutgoingMessage): Promise<void>;
1665
+ /** Direct access to OpenACPCore instance. Available when 'kernel:access' permission is granted. */
1666
+ coreAccess?: CoreAccess;
1311
1667
  }
1312
-
1313
- declare class MessageTransformer {
1314
- private tunnelService?;
1315
- constructor(tunnelService?: TunnelService | undefined);
1316
- transform(event: AgentEvent, sessionContext?: {
1317
- id: string;
1318
- workingDirectory: string;
1319
- }): OutgoingMessage;
1320
- private enrichWithViewerLinks;
1668
+ interface CommandDef {
1669
+ /** Command name without slash, e.g., 'context' for /context */
1670
+ name: string;
1671
+ /** Short description shown in command list */
1672
+ description: string;
1673
+ /** Usage pattern, e.g., '<session-number>' */
1674
+ usage?: string;
1675
+ /** Whether this is a built-in system command or registered by a plugin */
1676
+ category: 'system' | 'plugin';
1677
+ /** Plugin that registered this command (set automatically by plugin manager) */
1678
+ pluginName?: string;
1679
+ /** Handler function */
1680
+ handler(args: CommandArgs): Promise<CommandResponse | void>;
1681
+ }
1682
+ interface SessionManager$1 {
1683
+ [key: string]: unknown;
1321
1684
  }
1322
-
1323
- declare class FileService {
1324
- private baseDir;
1325
- constructor(baseDir: string);
1326
- saveFile(sessionId: string, fileName: string, data: Buffer, mimeType: string): Promise<Attachment>;
1327
- resolveFile(filePath: string): Promise<Attachment | null>;
1328
- /**
1329
- * Convert OGG Opus audio to WAV format.
1330
- * Telegram voice messages use OGG Opus which many AI agents can't read.
1331
- */
1332
- convertOggToWav(oggData: Buffer): Promise<Buffer>;
1333
- static extensionFromMime(mimeType: string): string;
1685
+ interface ConfigManager {
1686
+ [key: string]: unknown;
1334
1687
  }
1335
-
1336
- interface SessionStore {
1337
- save(record: SessionRecord): Promise<void>;
1338
- get(sessionId: string): SessionRecord | undefined;
1339
- findByPlatform(channelId: string, predicate: (platform: Record<string, unknown>) => boolean): SessionRecord | undefined;
1340
- findByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
1341
- list(channelId?: string): SessionRecord[];
1342
- remove(sessionId: string): Promise<void>;
1688
+ interface EventBus$1 {
1689
+ [key: string]: unknown;
1343
1690
  }
1344
-
1345
- interface EventBusEvents {
1346
- "session:created": (data: {
1691
+ /**
1692
+ * Typed view of the OpenACPCore instance exposed to plugins via ctx.core.
1693
+ * Plugins that need kernel:access should cast ctx.core to this interface
1694
+ * instead of using `as any`. Only includes fields plugins actually need.
1695
+ */
1696
+ interface CoreAccess {
1697
+ configManager: ConfigManager;
1698
+ sessionManager: SessionManager$1;
1699
+ adapters: Map<string, IChannelAdapter>;
1700
+ }
1701
+ interface Logger {
1702
+ trace(msg: string, ...args: unknown[]): void;
1703
+ debug(msg: string, ...args: unknown[]): void;
1704
+ info(msg: string, ...args: unknown[]): void;
1705
+ warn(msg: string, ...args: unknown[]): void;
1706
+ error(msg: string, ...args: unknown[]): void;
1707
+ fatal(msg: string, ...args: unknown[]): void;
1708
+ child(bindings: Record<string, unknown>): Logger;
1709
+ }
1710
+ interface PluginContext {
1711
+ pluginName: string;
1712
+ pluginConfig: Record<string, unknown>;
1713
+ /** Subscribe to events. Auto-cleaned on teardown. Requires 'events:read'. */
1714
+ on(event: string, handler: (...args: unknown[]) => void): void;
1715
+ off(event: string, handler: (...args: unknown[]) => void): void;
1716
+ /** Emit custom events. Event names MUST be prefixed with plugin name. Requires 'events:emit'. */
1717
+ emit(event: string, payload: unknown): void;
1718
+ /** Register middleware. Requires 'middleware:register'. */
1719
+ registerMiddleware<H extends MiddlewareHook>(hook: H, opts: MiddlewareOptions<MiddlewarePayloadMap[H]>): void;
1720
+ /** Provide a service. Requires 'services:register'. */
1721
+ registerService<T>(name: string, implementation: T): void;
1722
+ /** Consume a service. Requires 'services:use'. */
1723
+ getService<T>(name: string): T | undefined;
1724
+ /** Register slash command. Requires 'commands:register'. */
1725
+ registerCommand(def: CommandDef): void;
1726
+ /** Plugin-scoped storage. Requires 'storage:read' and/or 'storage:write'. */
1727
+ storage: PluginStorage;
1728
+ /** Plugin-scoped logger. Always available (no permission needed). */
1729
+ log: Logger;
1730
+ /**
1731
+ * Send message to a session. Requires 'services:use'.
1732
+ *
1733
+ * Routing: sessionId → lookup session → find adapter for session's channelId
1734
+ * → [HOOK: message:outgoing] → adapter.sendMessage()
1735
+ */
1736
+ sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
1737
+ sessions: SessionManager$1;
1738
+ config: ConfigManager;
1739
+ eventBus: EventBus$1;
1740
+ /** Direct access to OpenACPCore instance. Requires 'kernel:access'. */
1741
+ core: unknown;
1742
+ }
1743
+ interface MiddlewarePayloadMap {
1744
+ 'message:incoming': {
1745
+ channelId: string;
1746
+ threadId: string;
1747
+ userId: string;
1748
+ text: string;
1749
+ attachments?: Attachment[];
1750
+ };
1751
+ 'message:outgoing': {
1347
1752
  sessionId: string;
1348
- agent: string;
1349
- status: SessionStatus;
1350
- }) => void;
1351
- "session:updated": (data: {
1753
+ message: OutgoingMessage;
1754
+ };
1755
+ 'agent:beforePrompt': {
1352
1756
  sessionId: string;
1353
- status?: SessionStatus;
1354
- name?: string;
1355
- dangerousMode?: boolean;
1356
- }) => void;
1357
- "session:deleted": (data: {
1757
+ text: string;
1758
+ attachments?: Attachment[];
1759
+ };
1760
+ 'agent:beforeEvent': {
1358
1761
  sessionId: string;
1359
- }) => void;
1360
- "agent:event": (data: {
1762
+ event: AgentEvent;
1763
+ };
1764
+ 'agent:afterEvent': {
1361
1765
  sessionId: string;
1362
1766
  event: AgentEvent;
1363
- }) => void;
1364
- "permission:request": (data: {
1767
+ outgoingMessage: OutgoingMessage;
1768
+ };
1769
+ 'turn:start': {
1365
1770
  sessionId: string;
1366
- permission: PermissionRequest;
1367
- }) => void;
1368
- }
1369
- declare class EventBus extends TypedEmitter<EventBusEvents> {
1370
- }
1771
+ promptText: string;
1772
+ promptNumber: number;
1773
+ };
1774
+ 'turn:end': {
1775
+ sessionId: string;
1776
+ stopReason: StopReason;
1777
+ durationMs: number;
1778
+ };
1779
+ 'fs:beforeRead': {
1780
+ sessionId: string;
1781
+ path: string;
1782
+ line?: number;
1783
+ limit?: number;
1784
+ };
1785
+ 'fs:beforeWrite': {
1786
+ sessionId: string;
1787
+ path: string;
1788
+ content: string;
1789
+ };
1790
+ 'terminal:beforeCreate': {
1791
+ sessionId: string;
1792
+ command: string;
1793
+ args?: string[];
1794
+ env?: Record<string, string>;
1795
+ cwd?: string;
1796
+ };
1797
+ 'terminal:afterExit': {
1798
+ sessionId: string;
1799
+ terminalId: string;
1800
+ command: string;
1801
+ exitCode: number;
1802
+ durationMs: number;
1803
+ };
1804
+ 'permission:beforeRequest': {
1805
+ sessionId: string;
1806
+ request: PermissionRequest;
1807
+ autoResolve?: string;
1808
+ };
1809
+ 'permission:afterResolve': {
1810
+ sessionId: string;
1811
+ requestId: string;
1812
+ decision: string;
1813
+ userId: string;
1814
+ durationMs: number;
1815
+ };
1816
+ 'session:beforeCreate': {
1817
+ agentName: string;
1818
+ workingDir: string;
1819
+ userId: string;
1820
+ channelId: string;
1821
+ threadId: string;
1822
+ };
1823
+ 'session:afterDestroy': {
1824
+ sessionId: string;
1825
+ reason: string;
1826
+ durationMs: number;
1827
+ promptCount: number;
1828
+ };
1829
+ 'mode:beforeChange': {
1830
+ sessionId: string;
1831
+ fromMode: string | undefined;
1832
+ toMode: string;
1833
+ };
1834
+ 'config:beforeChange': {
1835
+ sessionId: string;
1836
+ configId: string;
1837
+ oldValue: unknown;
1838
+ newValue: unknown;
1839
+ };
1840
+ 'model:beforeChange': {
1841
+ sessionId: string;
1842
+ fromModel: string | undefined;
1843
+ toModel: string;
1844
+ };
1845
+ 'agent:beforeCancel': {
1846
+ sessionId: string;
1847
+ reason?: string;
1848
+ };
1849
+ }
1850
+ type MiddlewareHook = keyof MiddlewarePayloadMap;
1851
+ type MiddlewareFn<T> = (payload: T, next: () => Promise<T>) => Promise<T | null>;
1852
+ interface MiddlewareOptions<T> {
1853
+ /** Override execution order within same dependency level. Lower = earlier. */
1854
+ priority?: number;
1855
+ /** The middleware handler */
1856
+ handler: MiddlewareFn<T>;
1857
+ }
1858
+ interface SecurityService {
1859
+ checkAccess(userId: string): Promise<{
1860
+ allowed: boolean;
1861
+ reason?: string;
1862
+ }>;
1863
+ checkSessionLimit(userId: string): Promise<{
1864
+ allowed: boolean;
1865
+ reason?: string;
1866
+ }>;
1867
+ getUserRole(userId: string): Promise<'admin' | 'user' | 'blocked'>;
1868
+ }
1869
+ interface FileServiceInterface {
1870
+ saveFile(sessionId: string, fileName: string, data: Buffer, mimeType: string): Promise<Attachment>;
1871
+ resolveFile(filePath: string): Promise<Attachment | null>;
1872
+ readTextFileWithRange(path: string, opts?: {
1873
+ line?: number;
1874
+ limit?: number;
1875
+ }): Promise<string>;
1876
+ extensionFromMime(mimeType: string): string;
1877
+ convertOggToWav(oggData: Buffer): Promise<Buffer>;
1878
+ }
1879
+ interface NotificationService {
1880
+ notify(channelId: string, notification: NotificationMessage): Promise<void>;
1881
+ notifyAll(notification: NotificationMessage): Promise<void>;
1882
+ }
1883
+ interface UsageService {
1884
+ trackUsage(record: UsageRecord): Promise<void>;
1885
+ checkBudget(sessionId: string): Promise<{
1886
+ ok: boolean;
1887
+ percent: number;
1888
+ warning?: string;
1889
+ }>;
1890
+ getSummary(period: string): Promise<UsageSummary>;
1891
+ }
1892
+ interface TTSProvider {
1893
+ synthesize(text: string, opts?: {
1894
+ language?: string;
1895
+ voice?: string;
1896
+ }): Promise<Buffer>;
1897
+ }
1898
+ interface STTProvider {
1899
+ transcribe(audio: Buffer, opts?: {
1900
+ language?: string;
1901
+ }): Promise<string>;
1902
+ }
1903
+ interface SpeechServiceInterface {
1904
+ textToSpeech(text: string, opts?: {
1905
+ language?: string;
1906
+ voice?: string;
1907
+ }): Promise<Buffer>;
1908
+ speechToText(audio: Buffer, opts?: {
1909
+ language?: string;
1910
+ }): Promise<string>;
1911
+ registerTTSProvider(name: string, provider: TTSProvider): void;
1912
+ registerSTTProvider(name: string, provider: STTProvider): void;
1913
+ }
1914
+ interface ContextProvider$1 {
1915
+ provide(sessionId: string, opts?: {
1916
+ maxTokens?: number;
1917
+ }): Promise<string>;
1918
+ }
1919
+ interface ContextService {
1920
+ buildContext(sessionId: string, opts?: {
1921
+ maxTokens?: number;
1922
+ }): Promise<string>;
1923
+ registerProvider(provider: ContextProvider$1): void;
1924
+ }
1925
+ interface ViewerStoreInterface {
1926
+ storeFile(sessionId: string, filePath: string, content: string, workingDirectory: string): string | null;
1927
+ storeDiff(sessionId: string, filePath: string, oldContent: string, newContent: string, workingDirectory: string): string | null;
1928
+ }
1929
+ interface TunnelServiceInterface {
1930
+ getPublicUrl(): string;
1931
+ start(): Promise<string>;
1932
+ stop(): Promise<void>;
1933
+ getStore(): ViewerStoreInterface;
1934
+ fileUrl(entryId: string): string;
1935
+ diffUrl(entryId: string): string;
1936
+ }
1937
+
1938
+ declare class MessageTransformer {
1939
+ private tunnelService?;
1940
+ constructor(tunnelService?: TunnelServiceInterface | undefined);
1941
+ transform(event: AgentEvent, sessionContext?: {
1942
+ id: string;
1943
+ workingDirectory: string;
1944
+ }): OutgoingMessage;
1945
+ private enrichWithViewerLinks;
1946
+ }
1947
+
1948
+ interface SessionStore {
1949
+ save(record: SessionRecord): Promise<void>;
1950
+ get(sessionId: string): SessionRecord | undefined;
1951
+ findByPlatform(channelId: string, predicate: (platform: Record<string, unknown>) => boolean): SessionRecord | undefined;
1952
+ findByAgentSessionId(agentSessionId: string): SessionRecord | undefined;
1953
+ list(channelId?: string): SessionRecord[];
1954
+ remove(sessionId: string): Promise<void>;
1955
+ }
1956
+
1957
+ interface EventBusEvents {
1958
+ "session:created": (data: {
1959
+ sessionId: string;
1960
+ agent: string;
1961
+ status: SessionStatus;
1962
+ }) => void;
1963
+ "session:updated": (data: {
1964
+ sessionId: string;
1965
+ status?: SessionStatus;
1966
+ name?: string;
1967
+ dangerousMode?: boolean;
1968
+ }) => void;
1969
+ "session:deleted": (data: {
1970
+ sessionId: string;
1971
+ }) => void;
1972
+ "agent:event": (data: {
1973
+ sessionId: string;
1974
+ event: AgentEvent;
1975
+ }) => void;
1976
+ "permission:request": (data: {
1977
+ sessionId: string;
1978
+ permission: PermissionRequest;
1979
+ }) => void;
1980
+ "permission:resolved": (data: {
1981
+ sessionId: string;
1982
+ requestId: string;
1983
+ decision: string;
1984
+ }) => void;
1985
+ "kernel:booted": () => void;
1986
+ "system:ready": () => void;
1987
+ "system:shutdown": () => void;
1988
+ "system:commands-ready": (data: {
1989
+ commands: Array<{
1990
+ name: string;
1991
+ description: string;
1992
+ }>;
1993
+ }) => void;
1994
+ "plugin:loaded": (data: {
1995
+ name: string;
1996
+ version: string;
1997
+ }) => void;
1998
+ "plugin:failed": (data: {
1999
+ name: string;
2000
+ error: string;
2001
+ }) => void;
2002
+ "plugin:disabled": (data: {
2003
+ name: string;
2004
+ reason: string;
2005
+ }) => void;
2006
+ "plugin:unloaded": (data: {
2007
+ name: string;
2008
+ }) => void;
2009
+ "session:ended": (data: {
2010
+ sessionId: string;
2011
+ reason: string;
2012
+ }) => void;
2013
+ "session:named": (data: {
2014
+ sessionId: string;
2015
+ name: string;
2016
+ }) => void;
2017
+ "agent:prompt": (data: {
2018
+ sessionId: string;
2019
+ text: string;
2020
+ attachments?: unknown[];
2021
+ }) => void;
2022
+ }
2023
+ declare class EventBus extends TypedEmitter<EventBusEvents> {
2024
+ }
1371
2025
 
1372
2026
  declare class SessionManager {
1373
2027
  private sessions;
1374
2028
  private store;
1375
2029
  private eventBus?;
2030
+ middlewareChain?: MiddlewareChain;
1376
2031
  setEventBus(eventBus: EventBus): void;
1377
2032
  constructor(store?: SessionStore | null);
1378
2033
  createSession(channelId: string, agentName: string, workingDirectory: string, agentManager: AgentManager): Promise<Session>;
@@ -1393,16 +2048,11 @@ declare class SessionManager {
1393
2048
  destroyAll(): Promise<void>;
1394
2049
  }
1395
2050
 
1396
- declare class SecurityGuard {
1397
- private configManager;
1398
- private sessionManager;
1399
- constructor(configManager: ConfigManager, sessionManager: SessionManager);
1400
- checkAccess(message: IncomingMessage): {
1401
- allowed: true;
1402
- } | {
1403
- allowed: false;
1404
- reason: string;
1405
- };
2051
+ declare class NotificationManager {
2052
+ private adapters;
2053
+ constructor(adapters: Map<string, IChannelAdapter>);
2054
+ notify(channelId: string, notification: NotificationMessage): Promise<void>;
2055
+ notifyAll(notification: NotificationMessage): Promise<void>;
1406
2056
  }
1407
2057
 
1408
2058
  interface BridgeDeps {
@@ -1410,7 +2060,8 @@ interface BridgeDeps {
1410
2060
  notificationManager: NotificationManager;
1411
2061
  sessionManager: SessionManager;
1412
2062
  eventBus?: EventBus;
1413
- fileService?: FileService;
2063
+ fileService?: FileServiceInterface;
2064
+ middlewareChain?: MiddlewareChain;
1414
2065
  }
1415
2066
  declare class SessionBridge {
1416
2067
  private session;
@@ -1421,11 +2072,14 @@ declare class SessionBridge {
1421
2072
  private sessionEventHandler?;
1422
2073
  private statusChangeHandler?;
1423
2074
  private namedHandler?;
1424
- constructor(session: Session, adapter: ChannelAdapter, deps: BridgeDeps);
2075
+ constructor(session: Session, adapter: IChannelAdapter, deps: BridgeDeps);
2076
+ /** Send message to adapter, optionally running through message:outgoing middleware */
2077
+ private sendMessage;
1425
2078
  connect(): void;
1426
2079
  disconnect(): void;
1427
2080
  private wireAgentToSession;
1428
2081
  private wireSessionToAdapter;
2082
+ private handleAgentEvent;
1429
2083
  private wirePermissions;
1430
2084
  private wireLifecycle;
1431
2085
  }
@@ -1471,6 +2125,67 @@ declare class UsageBudget {
1471
2125
  };
1472
2126
  }
1473
2127
 
2128
+ interface TunnelEntry {
2129
+ port: number;
2130
+ type: 'system' | 'user';
2131
+ provider: string;
2132
+ label?: string;
2133
+ publicUrl?: string;
2134
+ sessionId?: string;
2135
+ status: 'stopped' | 'starting' | 'active' | 'failed';
2136
+ createdAt: string;
2137
+ }
2138
+
2139
+ interface ViewerEntry {
2140
+ id: string;
2141
+ type: 'file' | 'diff';
2142
+ filePath?: string;
2143
+ content: string;
2144
+ oldContent?: string;
2145
+ language?: string;
2146
+ sessionId: string;
2147
+ workingDirectory: string;
2148
+ createdAt: number;
2149
+ expiresAt: number;
2150
+ }
2151
+ declare class ViewerStore {
2152
+ private entries;
2153
+ private cleanupTimer;
2154
+ private ttlMs;
2155
+ constructor(ttlMinutes?: number);
2156
+ storeFile(sessionId: string, filePath: string, content: string, workingDirectory: string): string | null;
2157
+ storeDiff(sessionId: string, filePath: string, oldContent: string, newContent: string, workingDirectory: string): string | null;
2158
+ get(id: string): ViewerEntry | undefined;
2159
+ private cleanup;
2160
+ private isPathAllowed;
2161
+ private detectLanguage;
2162
+ destroy(): void;
2163
+ }
2164
+
2165
+ declare class TunnelService {
2166
+ private registry;
2167
+ private store;
2168
+ private server;
2169
+ private config;
2170
+ private systemPort;
2171
+ constructor(config: TunnelConfig);
2172
+ start(): Promise<string>;
2173
+ stop(): Promise<void>;
2174
+ addTunnel(port: number, opts?: {
2175
+ label?: string;
2176
+ sessionId?: string;
2177
+ }): Promise<TunnelEntry>;
2178
+ stopTunnel(port: number): Promise<void>;
2179
+ stopAllUser(): Promise<void>;
2180
+ stopBySession(sessionId: string): Promise<TunnelEntry[]>;
2181
+ listTunnels(): TunnelEntry[];
2182
+ getTunnel(port: number): TunnelEntry | null;
2183
+ getPublicUrl(): string;
2184
+ getStore(): ViewerStore;
2185
+ fileUrl(entryId: string): string;
2186
+ diffUrl(entryId: string): string;
2187
+ }
2188
+
1474
2189
  interface SessionCreateParams {
1475
2190
  channelId: string;
1476
2191
  agentName: string;
@@ -1488,13 +2203,124 @@ interface SideEffectDeps {
1488
2203
  declare class SessionFactory {
1489
2204
  private agentManager;
1490
2205
  private sessionManager;
1491
- private speechService;
2206
+ private speechServiceAccessor;
1492
2207
  private eventBus;
1493
- constructor(agentManager: AgentManager, sessionManager: SessionManager, speechService: SpeechService, eventBus: EventBus);
2208
+ middlewareChain?: MiddlewareChain;
2209
+ constructor(agentManager: AgentManager, sessionManager: SessionManager, speechServiceAccessor: SpeechService | (() => SpeechService), eventBus: EventBus);
2210
+ private get speechService();
1494
2211
  create(params: SessionCreateParams): Promise<Session>;
1495
2212
  wireSideEffects(session: Session, deps: SideEffectDeps): void;
1496
2213
  }
1497
2214
 
2215
+ declare class SecurityGuard {
2216
+ private configManager;
2217
+ private sessionManager;
2218
+ constructor(configManager: ConfigManager$1, sessionManager: SessionManager);
2219
+ checkAccess(message: IncomingMessage): {
2220
+ allowed: true;
2221
+ } | {
2222
+ allowed: false;
2223
+ reason: string;
2224
+ };
2225
+ }
2226
+
2227
+ declare class ServiceRegistry {
2228
+ private services;
2229
+ register<T>(name: string, implementation: T, pluginName: string): void;
2230
+ registerOverride<T>(name: string, implementation: T, pluginName: string): void;
2231
+ get<T>(name: string): T | undefined;
2232
+ has(name: string): boolean;
2233
+ list(): Array<{
2234
+ name: string;
2235
+ pluginName: string;
2236
+ }>;
2237
+ unregister(name: string): void;
2238
+ unregisterByPlugin(pluginName: string): void;
2239
+ }
2240
+
2241
+ interface ValidationResult {
2242
+ valid: boolean;
2243
+ errors?: string[];
2244
+ }
2245
+ declare class SettingsManager {
2246
+ private basePath;
2247
+ constructor(basePath: string);
2248
+ getBasePath(): string;
2249
+ createAPI(pluginName: string): SettingsAPI;
2250
+ loadSettings(pluginName: string): Promise<Record<string, unknown>>;
2251
+ validateSettings(_pluginName: string, settings: unknown, schema?: ZodSchema): ValidationResult;
2252
+ getSettingsPath(pluginName: string): string;
2253
+ getPluginSettings(pluginName: string): Promise<Record<string, unknown>>;
2254
+ updatePluginSettings(pluginName: string, updates: Record<string, unknown>): Promise<void>;
2255
+ }
2256
+
2257
+ interface PluginEntry {
2258
+ version: string;
2259
+ installedAt: string;
2260
+ updatedAt: string;
2261
+ source: 'builtin' | 'npm' | 'local';
2262
+ enabled: boolean;
2263
+ settingsPath: string;
2264
+ description?: string;
2265
+ }
2266
+ type RegisterInput = Omit<PluginEntry, 'installedAt' | 'updatedAt'>;
2267
+ declare class PluginRegistry {
2268
+ private registryPath;
2269
+ private data;
2270
+ constructor(registryPath: string);
2271
+ list(): Map<string, PluginEntry>;
2272
+ get(name: string): PluginEntry | undefined;
2273
+ register(name: string, entry: RegisterInput): void;
2274
+ remove(name: string): void;
2275
+ setEnabled(name: string, enabled: boolean): void;
2276
+ updateVersion(name: string, version: string): void;
2277
+ listEnabled(): Map<string, PluginEntry>;
2278
+ listBySource(source: PluginEntry['source']): Map<string, PluginEntry>;
2279
+ load(): Promise<void>;
2280
+ save(): Promise<void>;
2281
+ }
2282
+
2283
+ interface LifecycleManagerOpts {
2284
+ serviceRegistry?: ServiceRegistry;
2285
+ middlewareChain?: MiddlewareChain;
2286
+ errorTracker?: ErrorTracker;
2287
+ eventBus?: EventBus$1 & {
2288
+ on(event: string, handler: (...args: unknown[]) => void): void;
2289
+ off(event: string, handler: (...args: unknown[]) => void): void;
2290
+ emit(event: string, payload: unknown): void;
2291
+ };
2292
+ storagePath?: string;
2293
+ sessions?: unknown;
2294
+ config?: unknown;
2295
+ core?: unknown;
2296
+ log?: Logger;
2297
+ settingsManager?: SettingsManager;
2298
+ pluginRegistry?: PluginRegistry;
2299
+ }
2300
+ declare class LifecycleManager {
2301
+ readonly serviceRegistry: ServiceRegistry;
2302
+ readonly middlewareChain: MiddlewareChain;
2303
+ readonly errorTracker: ErrorTracker;
2304
+ private eventBus;
2305
+ private storagePath;
2306
+ private sessions;
2307
+ private config;
2308
+ private core;
2309
+ private log;
2310
+ private settingsManager;
2311
+ private pluginRegistry;
2312
+ private contexts;
2313
+ private loadOrder;
2314
+ private _loaded;
2315
+ private _failed;
2316
+ get loadedPlugins(): string[];
2317
+ get failedPlugins(): string[];
2318
+ constructor(opts?: LifecycleManagerOpts);
2319
+ boot(plugins: OpenACPPlugin[]): Promise<void>;
2320
+ unloadPlugin(name: string): Promise<void>;
2321
+ shutdown(): Promise<void>;
2322
+ }
2323
+
1498
2324
  interface ContextProvider {
1499
2325
  readonly name: string;
1500
2326
  isAvailable(repoPath: string): Promise<boolean>;
@@ -1551,16 +2377,12 @@ declare class ContextManager {
1551
2377
  }
1552
2378
 
1553
2379
  declare class OpenACPCore {
1554
- configManager: ConfigManager;
2380
+ configManager: ConfigManager$1;
1555
2381
  agentCatalog: AgentCatalog;
1556
2382
  agentManager: AgentManager;
1557
2383
  sessionManager: SessionManager;
1558
- notificationManager: NotificationManager;
1559
2384
  messageTransformer: MessageTransformer;
1560
- fileService: FileService;
1561
- readonly speechService: SpeechService;
1562
- securityGuard: SecurityGuard;
1563
- adapters: Map<string, ChannelAdapter>;
2385
+ adapters: Map<string, IChannelAdapter>;
1564
2386
  /** Set by main.ts — triggers graceful shutdown with restart exit code */
1565
2387
  requestRestart: (() => Promise<void>) | null;
1566
2388
  private _tunnelService?;
@@ -1568,13 +2390,18 @@ declare class OpenACPCore {
1568
2390
  private resumeLocks;
1569
2391
  eventBus: EventBus;
1570
2392
  sessionFactory: SessionFactory;
1571
- readonly usageStore: UsageStore | null;
1572
- readonly usageBudget: UsageBudget | null;
1573
- readonly contextManager: ContextManager;
1574
- constructor(configManager: ConfigManager);
2393
+ readonly lifecycleManager: LifecycleManager;
2394
+ get securityGuard(): SecurityGuard;
2395
+ get notificationManager(): NotificationManager;
2396
+ get fileService(): FileServiceInterface;
2397
+ get speechService(): SpeechService;
2398
+ get contextManager(): ContextManager;
2399
+ get usageStore(): UsageStore | null;
2400
+ get usageBudget(): UsageBudget | null;
2401
+ constructor(configManager: ConfigManager$1);
1575
2402
  get tunnelService(): TunnelService | undefined;
1576
2403
  set tunnelService(service: TunnelService | undefined);
1577
- registerAdapter(name: string, adapter: ChannelAdapter): void;
2404
+ registerAdapter(name: string, adapter: IChannelAdapter): void;
1578
2405
  start(): Promise<void>;
1579
2406
  stop(): Promise<void>;
1580
2407
  summarizeSession(sessionId: string): Promise<{
@@ -1632,17 +2459,26 @@ declare class OpenACPCore {
1632
2459
  getOrResumeSession(channelId: string, threadId: string): Promise<Session | null>;
1633
2460
  private lazyResume;
1634
2461
  /** Create a SessionBridge for the given session and adapter */
1635
- createBridge(session: Session, adapter: ChannelAdapter): SessionBridge;
2462
+ createBridge(session: Session, adapter: IChannelAdapter): SessionBridge;
1636
2463
  }
1637
2464
 
1638
- interface AdapterFactory {
1639
- name: string;
1640
- createAdapter(core: OpenACPCore, config: ChannelConfig): ChannelAdapter;
2465
+ interface ConfigFieldDef {
2466
+ path: string;
2467
+ displayName: string;
2468
+ group: string;
2469
+ type: "toggle" | "select" | "number" | "string";
2470
+ options?: string[] | ((config: Config) => string[]);
2471
+ scope: "safe" | "sensitive";
2472
+ hotReload: boolean;
1641
2473
  }
1642
- declare function installPlugin(packageName: string): void;
1643
- declare function uninstallPlugin(packageName: string): void;
1644
- declare function listPlugins(): Record<string, string>;
1645
- declare function loadAdapterFactory(packageName: string): Promise<AdapterFactory | null>;
2474
+ declare const CONFIG_REGISTRY: ConfigFieldDef[];
2475
+ declare function getFieldDef(path: string): ConfigFieldDef | undefined;
2476
+ declare function getSafeFields(): ConfigFieldDef[];
2477
+ declare function isHotReloadable(path: string): boolean;
2478
+ declare function resolveOptions(def: ConfigFieldDef, config: Config): string[] | undefined;
2479
+ declare function getConfigValue(config: Config, path: string): unknown;
2480
+
2481
+ declare function runConfigEditor(configManager: ConfigManager$1, mode?: 'file' | 'api', apiPort?: number): Promise<void>;
1646
2482
 
1647
2483
  declare function getStatus(pidPath?: string): {
1648
2484
  running: boolean;
@@ -1671,7 +2507,29 @@ declare function uninstallAutoStart(): {
1671
2507
  };
1672
2508
  declare function isAutoStartInstalled(): boolean;
1673
2509
 
1674
- declare function runConfigEditor(configManager: ConfigManager, mode?: 'file' | 'api', apiPort?: number): Promise<void>;
2510
+ declare class FileService {
2511
+ private baseDir;
2512
+ constructor(baseDir: string);
2513
+ saveFile(sessionId: string, fileName: string, data: Buffer, mimeType: string): Promise<Attachment>;
2514
+ resolveFile(filePath: string): Promise<Attachment | null>;
2515
+ /**
2516
+ * Convert OGG Opus audio to WAV format.
2517
+ * Telegram voice messages use OGG Opus which many AI agents can't read.
2518
+ */
2519
+ convertOggToWav(oggData: Buffer): Promise<Buffer>;
2520
+ /** Instance method — delegates to static for FileServiceInterface compliance */
2521
+ readTextFileWithRange(filePath: string, options?: {
2522
+ line?: number;
2523
+ limit?: number;
2524
+ }): Promise<string>;
2525
+ static readTextFileWithRange(filePath: string, options?: {
2526
+ line?: number;
2527
+ limit?: number;
2528
+ }): Promise<string>;
2529
+ /** Instance method — delegates to static for FileServiceInterface compliance */
2530
+ extensionFromMime(mimeType: string): string;
2531
+ static extensionFromMime(mimeType: string): string;
2532
+ }
1675
2533
 
1676
2534
  interface TopicInfo {
1677
2535
  sessionId: string;
@@ -1775,22 +2633,6 @@ declare class StaticServer {
1775
2633
  serve(req: http.IncomingMessage, res: http.ServerResponse): boolean;
1776
2634
  }
1777
2635
 
1778
- interface ConfigFieldDef {
1779
- path: string;
1780
- displayName: string;
1781
- group: string;
1782
- type: "toggle" | "select" | "number" | "string";
1783
- options?: string[] | ((config: Config) => string[]);
1784
- scope: "safe" | "sensitive";
1785
- hotReload: boolean;
1786
- }
1787
- declare const CONFIG_REGISTRY: ConfigFieldDef[];
1788
- declare function getFieldDef(path: string): ConfigFieldDef | undefined;
1789
- declare function getSafeFields(): ConfigFieldDef[];
1790
- declare function isHotReloadable(path: string): boolean;
1791
- declare function resolveOptions(def: ConfigFieldDef, config: Config): string[] | undefined;
1792
- declare function getConfigValue(config: Config, path: string): unknown;
1793
-
1794
2636
  declare class EntireProvider implements ContextProvider {
1795
2637
  readonly name = "entire";
1796
2638
  isAvailable(repoPath: string): Promise<boolean>;
@@ -1801,6 +2643,250 @@ declare class EntireProvider implements ContextProvider {
1801
2643
  private buildTitle;
1802
2644
  }
1803
2645
 
2646
+ type DisplayVerbosity = "low" | "medium" | "high";
2647
+ interface ViewerLinks {
2648
+ file?: string;
2649
+ diff?: string;
2650
+ }
2651
+ interface ToolCallMeta {
2652
+ id: string;
2653
+ name: string;
2654
+ kind?: string;
2655
+ status?: string;
2656
+ content?: unknown;
2657
+ rawInput?: unknown;
2658
+ viewerLinks?: ViewerLinks;
2659
+ viewerFilePath?: string;
2660
+ displaySummary?: string;
2661
+ displayTitle?: string;
2662
+ displayKind?: string;
2663
+ }
2664
+
2665
+ interface RenderedMessage<TComponents = unknown> {
2666
+ body: string;
2667
+ format: 'html' | 'markdown' | 'plain' | 'structured';
2668
+ attachments?: RenderedAttachment[];
2669
+ components?: TComponents;
2670
+ }
2671
+ interface RenderedPermission<TComponents = unknown> extends RenderedMessage<TComponents> {
2672
+ actions: RenderedAction[];
2673
+ }
2674
+ interface RenderedAction {
2675
+ id: string;
2676
+ label: string;
2677
+ isAllow?: boolean;
2678
+ }
2679
+ interface RenderedAttachment {
2680
+ type: 'file' | 'image' | 'audio';
2681
+ data: Buffer | string;
2682
+ mimeType?: string;
2683
+ filename?: string;
2684
+ }
2685
+ interface IRenderer {
2686
+ renderText(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2687
+ renderToolCall(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2688
+ renderToolUpdate(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2689
+ renderPlan(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2690
+ renderUsage(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2691
+ renderPermission(request: PermissionRequest): RenderedPermission;
2692
+ renderError(content: OutgoingMessage): RenderedMessage;
2693
+ renderNotification(notification: NotificationMessage): RenderedMessage;
2694
+ renderThought?(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2695
+ renderAttachment?(content: OutgoingMessage): RenderedMessage;
2696
+ renderSessionEnd?(content: OutgoingMessage): RenderedMessage;
2697
+ renderSystemMessage?(content: OutgoingMessage): RenderedMessage;
2698
+ renderModeChange?(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2699
+ renderConfigUpdate?(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2700
+ renderModelUpdate?(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2701
+ renderResource?(content: OutgoingMessage): RenderedMessage;
2702
+ renderResourceLink?(content: OutgoingMessage): RenderedMessage;
2703
+ }
2704
+ /**
2705
+ * BaseRenderer — plain text defaults. Extend for platform-specific rendering.
2706
+ */
2707
+ declare class BaseRenderer implements IRenderer {
2708
+ renderText(content: OutgoingMessage): RenderedMessage;
2709
+ renderToolCall(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2710
+ renderToolUpdate(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2711
+ renderPlan(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2712
+ renderUsage(content: OutgoingMessage, verbosity: DisplayVerbosity): RenderedMessage;
2713
+ renderPermission(request: PermissionRequest): RenderedPermission;
2714
+ renderError(content: OutgoingMessage): RenderedMessage;
2715
+ renderNotification(notification: NotificationMessage): RenderedMessage;
2716
+ renderSystemMessage(content: OutgoingMessage): RenderedMessage;
2717
+ renderModeChange(content: OutgoingMessage): RenderedMessage;
2718
+ renderConfigUpdate(): RenderedMessage;
2719
+ renderModelUpdate(content: OutgoingMessage): RenderedMessage;
2720
+ renderResource(content: OutgoingMessage): RenderedMessage;
2721
+ renderResourceLink(content: OutgoingMessage): RenderedMessage;
2722
+ }
2723
+
2724
+ interface AdapterContext {
2725
+ configManager: {
2726
+ get(): Record<string, unknown>;
2727
+ };
2728
+ fileService?: unknown;
2729
+ }
2730
+ interface MessagingAdapterConfig extends ChannelConfig {
2731
+ maxMessageLength: number;
2732
+ flushInterval?: number;
2733
+ sendInterval?: number;
2734
+ thinkingRefreshInterval?: number;
2735
+ thinkingDuration?: number;
2736
+ displayVerbosity?: DisplayVerbosity;
2737
+ }
2738
+ declare abstract class MessagingAdapter implements IChannelAdapter {
2739
+ protected context: AdapterContext;
2740
+ protected adapterConfig: MessagingAdapterConfig;
2741
+ abstract readonly name: string;
2742
+ abstract readonly renderer: IRenderer;
2743
+ abstract readonly capabilities: AdapterCapabilities;
2744
+ constructor(context: AdapterContext, adapterConfig: MessagingAdapterConfig);
2745
+ sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
2746
+ protected dispatchMessage(sessionId: string, content: OutgoingMessage, verbosity: DisplayVerbosity): Promise<void>;
2747
+ protected handleText(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2748
+ protected handleThought(_sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2749
+ protected handleToolCall(_sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2750
+ protected handleToolUpdate(_sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2751
+ protected handlePlan(_sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2752
+ protected handleUsage(_sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2753
+ protected handleError(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2754
+ protected handleAttachment(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2755
+ protected handleSystem(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2756
+ protected handleSessionEnd(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2757
+ protected handleModeChange(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2758
+ protected handleConfigUpdate(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2759
+ protected handleModelUpdate(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2760
+ protected handleUserReplay(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2761
+ protected handleResource(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2762
+ protected handleResourceLink(_sessionId: string, _content: OutgoingMessage): Promise<void>;
2763
+ protected getVerbosity(): DisplayVerbosity;
2764
+ protected shouldDisplay(content: OutgoingMessage, verbosity: DisplayVerbosity): boolean;
2765
+ abstract start(): Promise<void>;
2766
+ abstract stop(): Promise<void>;
2767
+ abstract createSessionThread(sessionId: string, name: string): Promise<string>;
2768
+ abstract renameSessionThread(sessionId: string, newName: string): Promise<void>;
2769
+ abstract sendPermissionRequest(sessionId: string, request: PermissionRequest): Promise<void>;
2770
+ abstract sendNotification(notification: NotificationMessage): Promise<void>;
2771
+ }
2772
+
2773
+ interface StreamEvent {
2774
+ type: string;
2775
+ sessionId?: string;
2776
+ payload: unknown;
2777
+ timestamp: number;
2778
+ }
2779
+ declare abstract class StreamAdapter implements IChannelAdapter {
2780
+ abstract readonly name: string;
2781
+ capabilities: AdapterCapabilities;
2782
+ constructor(config?: Partial<AdapterCapabilities>);
2783
+ sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
2784
+ sendPermissionRequest(sessionId: string, request: PermissionRequest): Promise<void>;
2785
+ sendNotification(notification: NotificationMessage): Promise<void>;
2786
+ createSessionThread(_sessionId: string, _name: string): Promise<string>;
2787
+ renameSessionThread(sessionId: string, name: string): Promise<void>;
2788
+ protected abstract emit(sessionId: string, event: StreamEvent): Promise<void>;
2789
+ protected abstract broadcast(event: StreamEvent): Promise<void>;
2790
+ abstract start(): Promise<void>;
2791
+ abstract stop(): Promise<void>;
2792
+ }
2793
+
2794
+ type QueueItemType = 'text' | 'other';
2795
+ interface SendQueueConfig {
2796
+ minInterval: number;
2797
+ categoryIntervals?: Record<string, number>;
2798
+ onRateLimited?: () => void;
2799
+ onError?: (error: Error) => void;
2800
+ }
2801
+ interface EnqueueOptions {
2802
+ type?: QueueItemType;
2803
+ key?: string;
2804
+ category?: string;
2805
+ }
2806
+ declare class SendQueue {
2807
+ private config;
2808
+ private items;
2809
+ private processing;
2810
+ private lastExec;
2811
+ private lastCategoryExec;
2812
+ constructor(config: SendQueueConfig);
2813
+ get pending(): number;
2814
+ enqueue<T>(fn: () => Promise<T>, opts?: EnqueueOptions): Promise<T | undefined>;
2815
+ onRateLimited(): void;
2816
+ clear(): void;
2817
+ private scheduleProcess;
2818
+ private getInterval;
2819
+ private processNext;
2820
+ }
2821
+
2822
+ interface DraftConfig {
2823
+ flushInterval: number;
2824
+ maxLength: number;
2825
+ onFlush: (sessionId: string, text: string, isEdit: boolean) => Promise<string | undefined>;
2826
+ onError?: (sessionId: string, error: Error) => void;
2827
+ }
2828
+ declare class Draft {
2829
+ private sessionId;
2830
+ private config;
2831
+ private buffer;
2832
+ private _messageId?;
2833
+ private firstFlushPending;
2834
+ private flushTimer?;
2835
+ private flushPromise;
2836
+ constructor(sessionId: string, config: DraftConfig);
2837
+ get isEmpty(): boolean;
2838
+ get messageId(): string | undefined;
2839
+ append(text: string): void;
2840
+ finalize(): Promise<string | undefined>;
2841
+ destroy(): void;
2842
+ private scheduleFlush;
2843
+ private flush;
2844
+ }
2845
+ declare class DraftManager {
2846
+ private config;
2847
+ private drafts;
2848
+ constructor(config: DraftConfig);
2849
+ getOrCreate(sessionId: string): Draft;
2850
+ finalize(sessionId: string): Promise<void>;
2851
+ finalizeAll(): Promise<void>;
2852
+ destroy(sessionId: string): void;
2853
+ destroyAll(): void;
2854
+ }
2855
+
2856
+ interface TrackedToolCall extends ToolCallMeta {
2857
+ messageId: string;
2858
+ }
2859
+ declare class ToolCallTracker {
2860
+ private sessions;
2861
+ track(sessionId: string, meta: ToolCallMeta, messageId: string): void;
2862
+ update(sessionId: string, toolId: string, status: string, patch?: Partial<Pick<ToolCallMeta, 'viewerLinks' | 'viewerFilePath' | 'name' | 'kind'>>): TrackedToolCall | null;
2863
+ getActive(sessionId: string): TrackedToolCall[];
2864
+ clear(sessionId: string): void;
2865
+ clearAll(): void;
2866
+ }
2867
+
2868
+ interface ActivityConfig {
2869
+ thinkingRefreshInterval: number;
2870
+ maxThinkingDuration: number;
2871
+ }
2872
+ interface ActivityCallbacks {
2873
+ sendThinkingIndicator(): Promise<void>;
2874
+ updateThinkingIndicator(): Promise<void>;
2875
+ removeThinkingIndicator(): Promise<void>;
2876
+ }
2877
+ declare class ActivityTracker {
2878
+ private config;
2879
+ private sessions;
2880
+ constructor(config: ActivityConfig);
2881
+ onThinkingStart(sessionId: string, callbacks: ActivityCallbacks): void;
2882
+ onTextStart(sessionId: string): void;
2883
+ onSessionEnd(sessionId: string): void;
2884
+ destroy(): void;
2885
+ private cleanup;
2886
+ private startRefresh;
2887
+ private stopRefresh;
2888
+ }
2889
+
1804
2890
  interface TelegramChannelConfig extends ChannelConfig {
1805
2891
  botToken: string;
1806
2892
  chatId: number;
@@ -1808,7 +2894,11 @@ interface TelegramChannelConfig extends ChannelConfig {
1808
2894
  assistantTopicId: number | null;
1809
2895
  }
1810
2896
 
1811
- declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
2897
+ declare class TelegramAdapter extends MessagingAdapter {
2898
+ readonly name = "telegram";
2899
+ readonly renderer: IRenderer;
2900
+ readonly capabilities: AdapterCapabilities;
2901
+ private core;
1812
2902
  private bot;
1813
2903
  private telegramConfig;
1814
2904
  private permissionHandler;
@@ -1817,19 +2907,34 @@ declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
1817
2907
  private notificationTopicId;
1818
2908
  private assistantTopicId;
1819
2909
  private sendQueue;
2910
+ private _sessionThreadIds;
1820
2911
  private toolTracker;
1821
2912
  private draftManager;
1822
2913
  private skillManager;
1823
2914
  private fileService;
1824
2915
  private sessionTrackers;
1825
- private get verbosity();
2916
+ private callbackCache;
2917
+ private callbackCounter;
2918
+ private getThreadId;
1826
2919
  private getOrCreateTracker;
1827
2920
  constructor(core: OpenACPCore, config: TelegramChannelConfig);
1828
2921
  start(): Promise<void>;
1829
2922
  stop(): Promise<void>;
2923
+ private renderCommandResponse;
2924
+ private toCallbackData;
2925
+ private fromCallbackData;
1830
2926
  private setupRoutes;
1831
- private messageHandlers;
1832
2927
  sendMessage(sessionId: string, content: OutgoingMessage): Promise<void>;
2928
+ protected handleThought(sessionId: string, _content: OutgoingMessage, _verbosity: DisplayVerbosity): Promise<void>;
2929
+ protected handleText(sessionId: string, content: OutgoingMessage): Promise<void>;
2930
+ protected handleToolCall(sessionId: string, content: OutgoingMessage, verbosity: DisplayVerbosity): Promise<void>;
2931
+ protected handleToolUpdate(sessionId: string, content: OutgoingMessage, verbosity: DisplayVerbosity): Promise<void>;
2932
+ protected handlePlan(sessionId: string, content: OutgoingMessage, verbosity: DisplayVerbosity): Promise<void>;
2933
+ protected handleUsage(sessionId: string, content: OutgoingMessage, verbosity: DisplayVerbosity): Promise<void>;
2934
+ protected handleAttachment(sessionId: string, content: OutgoingMessage): Promise<void>;
2935
+ protected handleSessionEnd(sessionId: string, _content: OutgoingMessage): Promise<void>;
2936
+ protected handleError(sessionId: string, content: OutgoingMessage): Promise<void>;
2937
+ protected handleSystem(sessionId: string, content: OutgoingMessage): Promise<void>;
1833
2938
  sendPermissionRequest(sessionId: string, request: PermissionRequest): Promise<void>;
1834
2939
  sendNotification(notification: NotificationMessage): Promise<void>;
1835
2940
  createSessionThread(sessionId: string, name: string): Promise<string>;
@@ -1843,4 +2948,4 @@ declare class TelegramAdapter extends ChannelAdapter<OpenACPCore> {
1843
2948
  archiveSessionTopic(sessionId: string): Promise<void>;
1844
2949
  }
1845
2950
 
1846
- export { type AdapterFactory, AgentCatalog, type AgentCommand, type AgentDefinition, type AgentDistribution, type AgentEvent, AgentInstance, type AgentListItem, AgentManager, AgentStore, type ApiConfig, ApiServer, type Attachment, type AvailabilityResult, type BridgeDeps, CONFIG_REGISTRY, ChannelAdapter, type ChannelConfig, type CleanupResult, type Config, type ConfigFieldDef, ConfigManager, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, type DiscordPlatformData, EntireProvider, EventBus, type EventBusEvents, FileService, GroqSTT, type IChannelAdapter, type IncomingMessage, type InstallProgress, type InstallResult, type InstalledAgent, type Logger, type LoggingConfig, MessageTransformer, NotificationManager, type NotificationMessage, OpenACPCore, type OutgoingMessage, PLUGINS_DIR, PermissionGate, type PermissionOption, type PermissionRequest, type PlanEntry, PromptQueue, type RegistryAgent, type RegistryBinaryTarget, type RegistryDistribution, SSEManager, type STTOptions, type STTProvider, type STTResult, SecurityGuard, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListResult, SessionManager, type SessionRecord, type SessionStatus, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, StaticServer, StderrCapture, type TTSOptions, type TTSProvider, type TTSResult, TelegramAdapter, type TelegramPlatformData, type TopicInfo, TopicManager, TypedEmitter, UsageBudget, type UsageConfig, type UsageRecord, UsageStore, type UsageSummary, cleanupOldSessionLogs, createChildLogger, createSessionLogger, expandHome, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, installPlugin, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, listPlugins, loadAdapterFactory, log, nodeToWebReadable, nodeToWebWritable, resolveOptions, runConfigEditor, setLogLevel, shutdownLogger, startDaemon, stopDaemon, uninstallAutoStart, uninstallPlugin };
2951
+ export { ActivityTracker, type AdapterCapabilities, type AgentCapabilities, AgentCatalog, type AgentCommand, type AgentDefinition, type AgentDistribution, type AgentEvent, AgentInstance, type AgentListItem, AgentManager, AgentStore, type ApiConfig, ApiServer, type Attachment, type AuthMethod, type AuthenticateRequest, type AvailabilityResult, BaseRenderer, type BridgeDeps, CONFIG_REGISTRY, ChannelAdapter, type ChannelConfig, type CleanupResult, type CommandArgs, type CommandDef, type CommandResponse, type Config, type ConfigFieldDef, ConfigManager$1 as ConfigManager, type ConfigOption, type ConfigSelectChoice, type ConfigSelectGroup, type ContentBlock, ContextManager, type ContextOptions, type ContextProvider, type ContextQuery, type ContextResult, type ContextService, type SessionInfo as ContextSessionInfo, type DeleteTopicResult, type DiscordPlatformData, DraftManager, EntireProvider, EventBus, type EventBusEvents, FileService, type FileServiceInterface, GroqSTT, type IChannelAdapter, type IncomingMessage, type InstallContext, type InstallProgress, type InstallResult, type InstalledAgent, type ListItem, type Logger$1 as Logger, type LoggingConfig, type McpServerConfig, type MenuOption, MessageTransformer, MessagingAdapter, type MigrateContext, type ModelInfo, type NewSessionResponse, NotificationManager, type NotificationMessage, type NotificationService, OpenACPCore, type OpenACPPlugin, type OutgoingMessage, PLUGINS_DIR, PermissionGate, type PermissionOption, type PermissionRequest, type PlanEntry, type PluginContext, type PluginPermission, type PluginStorage, PromptQueue, type PromptResponse, type RegistryAgent, type RegistryBinaryTarget, type RegistryDistribution, SSEManager, type STTOptions, type STTProvider$1 as STTProvider, type STTResult, SecurityGuard, type SecurityService, SendQueue, Session, SessionBridge, type SessionCreateParams, type SessionEvents, SessionFactory, type SessionListItem, type SessionListResponse, type SessionListResult, SessionManager, type SessionMode, type SessionModeState, type SessionModelState, type SessionRecord, type SessionStatus, type SetConfigOptionValue, type SettingsAPI, type SideEffectDeps, type SpeechProviderConfig, SpeechService, type SpeechServiceConfig, type SpeechServiceInterface, StaticServer, StderrCapture, type StopReason, StreamAdapter, type TTSOptions, type TTSProvider$1 as TTSProvider, type TTSResult, TelegramAdapter, type TelegramPlatformData, type TerminalIO, ToolCallTracker, type TopicInfo, TopicManager, type TunnelServiceInterface, TypedEmitter, UsageBudget, type UsageConfig, type UsageRecord, type UsageService, UsageStore, type UsageSummary, cleanupOldSessionLogs, createChildLogger, createSessionLogger, expandHome, getConfigValue, getFieldDef, getPidPath, getSafeFields, getStatus, initLogger, installAutoStart, isAutoStartInstalled, isAutoStartSupported, isHotReloadable, log, nodeToWebReadable, nodeToWebWritable, resolveOptions, runConfigEditor, setLogLevel, shutdownLogger, startDaemon, stopDaemon, uninstallAutoStart };