beecork 1.3.0 → 1.3.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 (415) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +154 -0
  3. package/dist/capabilities/index.d.ts +0 -1
  4. package/dist/capabilities/index.js +0 -1
  5. package/dist/capabilities/manager.d.ts +0 -1
  6. package/dist/capabilities/manager.js +0 -1
  7. package/dist/capabilities/packs.d.ts +0 -1
  8. package/dist/capabilities/packs.js +7 -8
  9. package/dist/capabilities/types.d.ts +0 -1
  10. package/dist/capabilities/types.js +0 -1
  11. package/dist/channels/command-handler.d.ts +0 -1
  12. package/dist/channels/command-handler.js +0 -1
  13. package/dist/channels/discord.d.ts +0 -1
  14. package/dist/channels/discord.js +30 -47
  15. package/dist/channels/index.d.ts +0 -1
  16. package/dist/channels/index.js +0 -1
  17. package/dist/channels/loader.d.ts +0 -1
  18. package/dist/channels/loader.js +6 -1
  19. package/dist/channels/pipeline.d.ts +50 -0
  20. package/dist/channels/pipeline.js +83 -0
  21. package/dist/channels/registry.d.ts +0 -1
  22. package/dist/channels/registry.js +0 -1
  23. package/dist/channels/telegram.d.ts +0 -1
  24. package/dist/channels/telegram.js +65 -67
  25. package/dist/channels/types.d.ts +0 -1
  26. package/dist/channels/types.js +0 -1
  27. package/dist/channels/webhook.d.ts +0 -1
  28. package/dist/channels/webhook.js +0 -1
  29. package/dist/channels/whatsapp.d.ts +0 -1
  30. package/dist/channels/whatsapp.js +25 -59
  31. package/dist/cli/capabilities.d.ts +0 -1
  32. package/dist/cli/capabilities.js +0 -1
  33. package/dist/cli/channel.d.ts +0 -1
  34. package/dist/cli/channel.js +1 -2
  35. package/dist/cli/commands.d.ts +0 -1
  36. package/dist/cli/commands.js +9 -3
  37. package/dist/cli/doctor.d.ts +0 -1
  38. package/dist/cli/doctor.js +2 -2
  39. package/dist/cli/handoff.d.ts +0 -1
  40. package/dist/cli/handoff.js +0 -1
  41. package/dist/cli/helpers.d.ts +0 -1
  42. package/dist/cli/helpers.js +0 -1
  43. package/dist/cli/mcp.d.ts +0 -1
  44. package/dist/cli/mcp.js +0 -1
  45. package/dist/cli/media.d.ts +0 -1
  46. package/dist/cli/media.js +0 -1
  47. package/dist/cli/setup.d.ts +0 -1
  48. package/dist/cli/setup.js +11 -11
  49. package/dist/cli/store.d.ts +0 -1
  50. package/dist/cli/store.js +0 -1
  51. package/dist/config.d.ts +0 -1
  52. package/dist/config.js +0 -1
  53. package/dist/daemon.d.ts +0 -1
  54. package/dist/daemon.js +1 -2
  55. package/dist/dashboard/html.d.ts +0 -1
  56. package/dist/dashboard/html.js +45 -38
  57. package/dist/dashboard/server.d.ts +0 -1
  58. package/dist/dashboard/server.js +60 -25
  59. package/dist/db/index.d.ts +11 -1
  60. package/dist/db/index.js +12 -1
  61. package/dist/db/migrations.d.ts +0 -1
  62. package/dist/db/migrations.js +5 -1
  63. package/dist/delegation/manager.d.ts +0 -3
  64. package/dist/delegation/manager.js +0 -5
  65. package/dist/index.d.ts +0 -1
  66. package/dist/index.js +21 -6
  67. package/dist/knowledge/index.d.ts +0 -1
  68. package/dist/knowledge/index.js +0 -1
  69. package/dist/knowledge/manager.d.ts +0 -1
  70. package/dist/knowledge/manager.js +19 -10
  71. package/dist/knowledge/types.d.ts +0 -1
  72. package/dist/knowledge/types.js +0 -1
  73. package/dist/machines/index.d.ts +1 -3
  74. package/dist/machines/index.js +1 -3
  75. package/dist/machines/registry.d.ts +0 -7
  76. package/dist/machines/registry.js +0 -25
  77. package/dist/mcp/server.d.ts +0 -1
  78. package/dist/mcp/server.js +28 -52
  79. package/dist/media/factory.d.ts +0 -1
  80. package/dist/media/factory.js +0 -1
  81. package/dist/media/generators/dall-e.d.ts +0 -1
  82. package/dist/media/generators/dall-e.js +0 -1
  83. package/dist/media/generators/elevenlabs-music.d.ts +0 -1
  84. package/dist/media/generators/elevenlabs-music.js +0 -1
  85. package/dist/media/generators/elevenlabs-sfx.d.ts +0 -1
  86. package/dist/media/generators/elevenlabs-sfx.js +0 -1
  87. package/dist/media/generators/kling.d.ts +0 -1
  88. package/dist/media/generators/kling.js +14 -20
  89. package/dist/media/generators/lyria.d.ts +0 -1
  90. package/dist/media/generators/lyria.js +0 -1
  91. package/dist/media/generators/nano-banana.d.ts +0 -1
  92. package/dist/media/generators/nano-banana.js +0 -1
  93. package/dist/media/generators/poll-util.d.ts +12 -0
  94. package/dist/media/generators/poll-util.js +22 -0
  95. package/dist/media/generators/recraft.d.ts +0 -1
  96. package/dist/media/generators/recraft.js +0 -1
  97. package/dist/media/generators/runway.d.ts +0 -1
  98. package/dist/media/generators/runway.js +14 -23
  99. package/dist/media/generators/stable-diffusion.d.ts +0 -1
  100. package/dist/media/generators/stable-diffusion.js +0 -1
  101. package/dist/media/generators/veo.d.ts +0 -1
  102. package/dist/media/generators/veo.js +0 -1
  103. package/dist/media/index.d.ts +0 -2
  104. package/dist/media/index.js +0 -2
  105. package/dist/media/store.d.ts +0 -1
  106. package/dist/media/store.js +0 -1
  107. package/dist/media/types.d.ts +0 -1
  108. package/dist/media/types.js +0 -1
  109. package/dist/memory/extractor.d.ts +0 -1
  110. package/dist/memory/extractor.js +8 -3
  111. package/dist/notifications/index.d.ts +0 -1
  112. package/dist/notifications/index.js +0 -1
  113. package/dist/notifications/ntfy.d.ts +0 -1
  114. package/dist/notifications/ntfy.js +0 -1
  115. package/dist/notifications/pushover.d.ts +0 -1
  116. package/dist/notifications/pushover.js +0 -1
  117. package/dist/notifications/types.d.ts +0 -1
  118. package/dist/notifications/types.js +0 -1
  119. package/dist/notifications/webhook-provider.d.ts +0 -1
  120. package/dist/notifications/webhook-provider.js +0 -1
  121. package/dist/observability/analytics.d.ts +0 -1
  122. package/dist/observability/analytics.js +0 -1
  123. package/dist/pipe/anthropic-client.d.ts +0 -1
  124. package/dist/pipe/anthropic-client.js +5 -3
  125. package/dist/pipe/brain.d.ts +0 -1
  126. package/dist/pipe/brain.js +0 -1
  127. package/dist/pipe/memory-store.d.ts +0 -1
  128. package/dist/pipe/memory-store.js +0 -1
  129. package/dist/pipe/project-scanner.d.ts +5 -3
  130. package/dist/pipe/project-scanner.js +21 -90
  131. package/dist/pipe/types.d.ts +0 -11
  132. package/dist/pipe/types.js +0 -1
  133. package/dist/projects/index.d.ts +0 -1
  134. package/dist/projects/index.js +0 -1
  135. package/dist/projects/manager.d.ts +0 -1
  136. package/dist/projects/manager.js +0 -1
  137. package/dist/projects/router.d.ts +0 -1
  138. package/dist/projects/router.js +1 -2
  139. package/dist/projects/types.d.ts +0 -7
  140. package/dist/projects/types.js +0 -1
  141. package/dist/service/install.d.ts +0 -1
  142. package/dist/service/install.js +0 -1
  143. package/dist/service/templates.d.ts +0 -1
  144. package/dist/service/templates.js +0 -1
  145. package/dist/service/windows.d.ts +0 -3
  146. package/dist/service/windows.js +0 -11
  147. package/dist/session/circuit-breaker.d.ts +0 -1
  148. package/dist/session/circuit-breaker.js +0 -1
  149. package/dist/session/context-monitor.d.ts +0 -1
  150. package/dist/session/context-monitor.js +0 -1
  151. package/dist/session/manager.d.ts +0 -1
  152. package/dist/session/manager.js +3 -4
  153. package/dist/session/subprocess.d.ts +0 -1
  154. package/dist/session/subprocess.js +0 -1
  155. package/dist/session/tool-classifier.d.ts +0 -1
  156. package/dist/session/tool-classifier.js +0 -1
  157. package/dist/tasks/scheduler.d.ts +0 -3
  158. package/dist/tasks/scheduler.js +4 -7
  159. package/dist/tasks/store.d.ts +0 -3
  160. package/dist/tasks/store.js +0 -3
  161. package/dist/timeline/index.d.ts +0 -1
  162. package/dist/timeline/index.js +0 -1
  163. package/dist/timeline/logger.d.ts +0 -1
  164. package/dist/timeline/logger.js +0 -1
  165. package/dist/timeline/query.d.ts +0 -1
  166. package/dist/timeline/query.js +2 -2
  167. package/dist/timeline/types.d.ts +0 -1
  168. package/dist/timeline/types.js +0 -1
  169. package/dist/types.d.ts +1 -7
  170. package/dist/types.js +0 -1
  171. package/dist/users/index.d.ts +1 -2
  172. package/dist/users/index.js +1 -2
  173. package/dist/users/service.d.ts +0 -8
  174. package/dist/users/service.js +0 -19
  175. package/dist/util/logger.d.ts +0 -1
  176. package/dist/util/logger.js +0 -1
  177. package/dist/util/paths.d.ts +0 -1
  178. package/dist/util/paths.js +0 -1
  179. package/dist/util/platform.d.ts +0 -1
  180. package/dist/util/platform.js +0 -1
  181. package/dist/util/progress.d.ts +0 -1
  182. package/dist/util/progress.js +0 -1
  183. package/dist/util/rate-limiter.d.ts +0 -1
  184. package/dist/util/rate-limiter.js +0 -1
  185. package/dist/util/retry.d.ts +0 -1
  186. package/dist/util/retry.js +1 -2
  187. package/dist/util/text.d.ts +0 -1
  188. package/dist/util/text.js +0 -1
  189. package/dist/version.d.ts +0 -1
  190. package/dist/version.js +0 -1
  191. package/dist/voice/index.d.ts +8 -1
  192. package/dist/voice/index.js +23 -1
  193. package/dist/voice/stt.d.ts +0 -1
  194. package/dist/voice/stt.js +0 -1
  195. package/dist/voice/tts.d.ts +0 -1
  196. package/dist/voice/tts.js +0 -1
  197. package/dist/watchers/evaluator.d.ts +0 -1
  198. package/dist/watchers/evaluator.js +25 -10
  199. package/dist/watchers/index.d.ts +0 -1
  200. package/dist/watchers/index.js +0 -1
  201. package/dist/watchers/scheduler.d.ts +0 -1
  202. package/dist/watchers/scheduler.js +3 -4
  203. package/dist/watchers/store.d.ts +0 -1
  204. package/dist/watchers/store.js +0 -1
  205. package/dist/watchers/types.d.ts +0 -1
  206. package/dist/watchers/types.js +0 -1
  207. package/package.json +26 -3
  208. package/dist/capabilities/index.d.ts.map +0 -1
  209. package/dist/capabilities/index.js.map +0 -1
  210. package/dist/capabilities/manager.d.ts.map +0 -1
  211. package/dist/capabilities/manager.js.map +0 -1
  212. package/dist/capabilities/packs.d.ts.map +0 -1
  213. package/dist/capabilities/packs.js.map +0 -1
  214. package/dist/capabilities/types.d.ts.map +0 -1
  215. package/dist/capabilities/types.js.map +0 -1
  216. package/dist/channels/command-handler.d.ts.map +0 -1
  217. package/dist/channels/command-handler.js.map +0 -1
  218. package/dist/channels/discord.d.ts.map +0 -1
  219. package/dist/channels/discord.js.map +0 -1
  220. package/dist/channels/index.d.ts.map +0 -1
  221. package/dist/channels/index.js.map +0 -1
  222. package/dist/channels/loader.d.ts.map +0 -1
  223. package/dist/channels/loader.js.map +0 -1
  224. package/dist/channels/registry.d.ts.map +0 -1
  225. package/dist/channels/registry.js.map +0 -1
  226. package/dist/channels/telegram.d.ts.map +0 -1
  227. package/dist/channels/telegram.js.map +0 -1
  228. package/dist/channels/types.d.ts.map +0 -1
  229. package/dist/channels/types.js.map +0 -1
  230. package/dist/channels/webhook.d.ts.map +0 -1
  231. package/dist/channels/webhook.js.map +0 -1
  232. package/dist/channels/whatsapp.d.ts.map +0 -1
  233. package/dist/channels/whatsapp.js.map +0 -1
  234. package/dist/cli/capabilities.d.ts.map +0 -1
  235. package/dist/cli/capabilities.js.map +0 -1
  236. package/dist/cli/channel.d.ts.map +0 -1
  237. package/dist/cli/channel.js.map +0 -1
  238. package/dist/cli/commands.d.ts.map +0 -1
  239. package/dist/cli/commands.js.map +0 -1
  240. package/dist/cli/doctor.d.ts.map +0 -1
  241. package/dist/cli/doctor.js.map +0 -1
  242. package/dist/cli/handoff.d.ts.map +0 -1
  243. package/dist/cli/handoff.js.map +0 -1
  244. package/dist/cli/helpers.d.ts.map +0 -1
  245. package/dist/cli/helpers.js.map +0 -1
  246. package/dist/cli/mcp.d.ts.map +0 -1
  247. package/dist/cli/mcp.js.map +0 -1
  248. package/dist/cli/media.d.ts.map +0 -1
  249. package/dist/cli/media.js.map +0 -1
  250. package/dist/cli/setup.d.ts.map +0 -1
  251. package/dist/cli/setup.js.map +0 -1
  252. package/dist/cli/store.d.ts.map +0 -1
  253. package/dist/cli/store.js.map +0 -1
  254. package/dist/config.d.ts.map +0 -1
  255. package/dist/config.js.map +0 -1
  256. package/dist/daemon.d.ts.map +0 -1
  257. package/dist/daemon.js.map +0 -1
  258. package/dist/dashboard/html.d.ts.map +0 -1
  259. package/dist/dashboard/html.js.map +0 -1
  260. package/dist/dashboard/server.d.ts.map +0 -1
  261. package/dist/dashboard/server.js.map +0 -1
  262. package/dist/db/index.d.ts.map +0 -1
  263. package/dist/db/index.js.map +0 -1
  264. package/dist/db/migrations.d.ts.map +0 -1
  265. package/dist/db/migrations.js.map +0 -1
  266. package/dist/delegation/manager.d.ts.map +0 -1
  267. package/dist/delegation/manager.js.map +0 -1
  268. package/dist/index.d.ts.map +0 -1
  269. package/dist/index.js.map +0 -1
  270. package/dist/knowledge/index.d.ts.map +0 -1
  271. package/dist/knowledge/index.js.map +0 -1
  272. package/dist/knowledge/manager.d.ts.map +0 -1
  273. package/dist/knowledge/manager.js.map +0 -1
  274. package/dist/knowledge/types.d.ts.map +0 -1
  275. package/dist/knowledge/types.js.map +0 -1
  276. package/dist/machines/forwarder.d.ts +0 -7
  277. package/dist/machines/forwarder.d.ts.map +0 -1
  278. package/dist/machines/forwarder.js +0 -35
  279. package/dist/machines/forwarder.js.map +0 -1
  280. package/dist/machines/index.d.ts.map +0 -1
  281. package/dist/machines/index.js.map +0 -1
  282. package/dist/machines/registry.d.ts.map +0 -1
  283. package/dist/machines/registry.js.map +0 -1
  284. package/dist/mcp/server.d.ts.map +0 -1
  285. package/dist/mcp/server.js.map +0 -1
  286. package/dist/media/factory.d.ts.map +0 -1
  287. package/dist/media/factory.js.map +0 -1
  288. package/dist/media/generators/dall-e.d.ts.map +0 -1
  289. package/dist/media/generators/dall-e.js.map +0 -1
  290. package/dist/media/generators/elevenlabs-music.d.ts.map +0 -1
  291. package/dist/media/generators/elevenlabs-music.js.map +0 -1
  292. package/dist/media/generators/elevenlabs-sfx.d.ts.map +0 -1
  293. package/dist/media/generators/elevenlabs-sfx.js.map +0 -1
  294. package/dist/media/generators/kling.d.ts.map +0 -1
  295. package/dist/media/generators/kling.js.map +0 -1
  296. package/dist/media/generators/lyria.d.ts.map +0 -1
  297. package/dist/media/generators/lyria.js.map +0 -1
  298. package/dist/media/generators/nano-banana.d.ts.map +0 -1
  299. package/dist/media/generators/nano-banana.js.map +0 -1
  300. package/dist/media/generators/recraft.d.ts.map +0 -1
  301. package/dist/media/generators/recraft.js.map +0 -1
  302. package/dist/media/generators/runway.d.ts.map +0 -1
  303. package/dist/media/generators/runway.js.map +0 -1
  304. package/dist/media/generators/stable-diffusion.d.ts.map +0 -1
  305. package/dist/media/generators/stable-diffusion.js.map +0 -1
  306. package/dist/media/generators/veo.d.ts.map +0 -1
  307. package/dist/media/generators/veo.js.map +0 -1
  308. package/dist/media/index.d.ts.map +0 -1
  309. package/dist/media/index.js.map +0 -1
  310. package/dist/media/loader.d.ts +0 -8
  311. package/dist/media/loader.d.ts.map +0 -1
  312. package/dist/media/loader.js +0 -46
  313. package/dist/media/loader.js.map +0 -1
  314. package/dist/media/store.d.ts.map +0 -1
  315. package/dist/media/store.js.map +0 -1
  316. package/dist/media/types.d.ts.map +0 -1
  317. package/dist/media/types.js.map +0 -1
  318. package/dist/memory/extractor.d.ts.map +0 -1
  319. package/dist/memory/extractor.js.map +0 -1
  320. package/dist/notifications/index.d.ts.map +0 -1
  321. package/dist/notifications/index.js.map +0 -1
  322. package/dist/notifications/ntfy.d.ts.map +0 -1
  323. package/dist/notifications/ntfy.js.map +0 -1
  324. package/dist/notifications/pushover.d.ts.map +0 -1
  325. package/dist/notifications/pushover.js.map +0 -1
  326. package/dist/notifications/types.d.ts.map +0 -1
  327. package/dist/notifications/types.js.map +0 -1
  328. package/dist/notifications/webhook-provider.d.ts.map +0 -1
  329. package/dist/notifications/webhook-provider.js.map +0 -1
  330. package/dist/observability/analytics.d.ts.map +0 -1
  331. package/dist/observability/analytics.js.map +0 -1
  332. package/dist/pipe/anthropic-client.d.ts.map +0 -1
  333. package/dist/pipe/anthropic-client.js.map +0 -1
  334. package/dist/pipe/brain.d.ts.map +0 -1
  335. package/dist/pipe/brain.js.map +0 -1
  336. package/dist/pipe/memory-store.d.ts.map +0 -1
  337. package/dist/pipe/memory-store.js.map +0 -1
  338. package/dist/pipe/project-scanner.d.ts.map +0 -1
  339. package/dist/pipe/project-scanner.js.map +0 -1
  340. package/dist/pipe/types.d.ts.map +0 -1
  341. package/dist/pipe/types.js.map +0 -1
  342. package/dist/projects/index.d.ts.map +0 -1
  343. package/dist/projects/index.js.map +0 -1
  344. package/dist/projects/manager.d.ts.map +0 -1
  345. package/dist/projects/manager.js.map +0 -1
  346. package/dist/projects/router.d.ts.map +0 -1
  347. package/dist/projects/router.js.map +0 -1
  348. package/dist/projects/types.d.ts.map +0 -1
  349. package/dist/projects/types.js.map +0 -1
  350. package/dist/service/install.d.ts.map +0 -1
  351. package/dist/service/install.js.map +0 -1
  352. package/dist/service/templates.d.ts.map +0 -1
  353. package/dist/service/templates.js.map +0 -1
  354. package/dist/service/windows.d.ts.map +0 -1
  355. package/dist/service/windows.js.map +0 -1
  356. package/dist/session/circuit-breaker.d.ts.map +0 -1
  357. package/dist/session/circuit-breaker.js.map +0 -1
  358. package/dist/session/context-monitor.d.ts.map +0 -1
  359. package/dist/session/context-monitor.js.map +0 -1
  360. package/dist/session/manager.d.ts.map +0 -1
  361. package/dist/session/manager.js.map +0 -1
  362. package/dist/session/subprocess.d.ts.map +0 -1
  363. package/dist/session/subprocess.js.map +0 -1
  364. package/dist/session/tool-classifier.d.ts.map +0 -1
  365. package/dist/session/tool-classifier.js.map +0 -1
  366. package/dist/tasks/scheduler.d.ts.map +0 -1
  367. package/dist/tasks/scheduler.js.map +0 -1
  368. package/dist/tasks/store.d.ts.map +0 -1
  369. package/dist/tasks/store.js.map +0 -1
  370. package/dist/timeline/index.d.ts.map +0 -1
  371. package/dist/timeline/index.js.map +0 -1
  372. package/dist/timeline/logger.d.ts.map +0 -1
  373. package/dist/timeline/logger.js.map +0 -1
  374. package/dist/timeline/query.d.ts.map +0 -1
  375. package/dist/timeline/query.js.map +0 -1
  376. package/dist/timeline/types.d.ts.map +0 -1
  377. package/dist/timeline/types.js.map +0 -1
  378. package/dist/types.d.ts.map +0 -1
  379. package/dist/types.js.map +0 -1
  380. package/dist/users/index.d.ts.map +0 -1
  381. package/dist/users/index.js.map +0 -1
  382. package/dist/users/service.d.ts.map +0 -1
  383. package/dist/users/service.js.map +0 -1
  384. package/dist/util/logger.d.ts.map +0 -1
  385. package/dist/util/logger.js.map +0 -1
  386. package/dist/util/paths.d.ts.map +0 -1
  387. package/dist/util/paths.js.map +0 -1
  388. package/dist/util/platform.d.ts.map +0 -1
  389. package/dist/util/platform.js.map +0 -1
  390. package/dist/util/progress.d.ts.map +0 -1
  391. package/dist/util/progress.js.map +0 -1
  392. package/dist/util/rate-limiter.d.ts.map +0 -1
  393. package/dist/util/rate-limiter.js.map +0 -1
  394. package/dist/util/retry.d.ts.map +0 -1
  395. package/dist/util/retry.js.map +0 -1
  396. package/dist/util/text.d.ts.map +0 -1
  397. package/dist/util/text.js.map +0 -1
  398. package/dist/version.d.ts.map +0 -1
  399. package/dist/version.js.map +0 -1
  400. package/dist/voice/index.d.ts.map +0 -1
  401. package/dist/voice/index.js.map +0 -1
  402. package/dist/voice/stt.d.ts.map +0 -1
  403. package/dist/voice/stt.js.map +0 -1
  404. package/dist/voice/tts.d.ts.map +0 -1
  405. package/dist/voice/tts.js.map +0 -1
  406. package/dist/watchers/evaluator.d.ts.map +0 -1
  407. package/dist/watchers/evaluator.js.map +0 -1
  408. package/dist/watchers/index.d.ts.map +0 -1
  409. package/dist/watchers/index.js.map +0 -1
  410. package/dist/watchers/scheduler.d.ts.map +0 -1
  411. package/dist/watchers/scheduler.js.map +0 -1
  412. package/dist/watchers/store.d.ts.map +0 -1
  413. package/dist/watchers/store.js.map +0 -1
  414. package/dist/watchers/types.d.ts.map +0 -1
  415. package/dist/watchers/types.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Beecork
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/beecork/beecork/main/logos/horizontal.svg" alt="Beecork" width="400">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <strong>Claude Code, always on. Reachable from anywhere.</strong>
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/beecork"><img src="https://img.shields.io/npm/v/beecork" alt="npm version"></a>
11
+ <a href="https://github.com/beecork/beecork/actions"><img src="https://github.com/beecork/beecork/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
12
+ <a href="LICENSE"><img src="https://img.shields.io/npm/l/beecork" alt="License"></a>
13
+ </p>
14
+
15
+ ---
16
+
17
+ Beecork is infrastructure for Claude Code. It gives Claude Code a phone number, a memory, and an alarm clock.
18
+
19
+ Message Claude Code from Telegram at 2am — it wakes up, does the work, messages you back. Or schedule it to wake itself up every Monday, check something, act on it, and go back to sleep. All without sitting at a terminal.
20
+
21
+ ## What It Does
22
+
23
+ - **Messaging channels** — Telegram, WhatsApp, Discord. Send a message, get a response.
24
+ - **Virtual tabs** — Persistent Claude Code sessions with context that survives restarts.
25
+ - **Task scheduling** — Tell Claude Code to set up recurring tasks via MCP tools — it wakes up, runs the task, reports back.
26
+ - **Memory** — Cross-session memory so Claude Code never loses context.
27
+ - **MCP server** — 38 tools Claude Code can call to manage tabs, memory, cron jobs, watchers, media, projects, and more.
28
+ - **Smart routing** — Pipe brain routes messages to the right tab, tracks goals, learns from your usage.
29
+ - **Background service** — Runs as a launchd (macOS), systemd (Linux), or Task Scheduler (Windows) service. Starts on login, runs silently.
30
+
31
+ ## Quick Start
32
+
33
+ ```bash
34
+ # Install
35
+ npm install -g beecork
36
+
37
+ # Interactive setup (Telegram token, Claude Code path, background service)
38
+ beecork setup
39
+
40
+ # Start
41
+ beecork start
42
+ ```
43
+
44
+ Then message your Telegram bot. Claude Code handles the rest.
45
+
46
+ See [Getting Started](https://github.com/beecork/beecork/blob/main/docs/getting-started.md) for the full walkthrough.
47
+
48
+ ## CLI
49
+
50
+ ```bash
51
+ # Core
52
+ beecork start # Start the daemon
53
+ beecork stop # Stop the daemon
54
+ beecork status # Check if running
55
+ beecork setup # Interactive setup wizard
56
+ beecork setup --full # Full setup with all options
57
+ beecork doctor # Diagnose common issues
58
+ beecork update # Update to latest version
59
+ beecork quickstart # Print getting-started checklist
60
+
61
+ # Tabs & Messages
62
+ beecork tabs # List active tabs
63
+ beecork send <msg> # Send a message to the default tab
64
+ beecork logs # Tail daemon logs
65
+ beecork export <tab> # Export tab for terminal handoff
66
+ beecork attach <tab> # Attach to a running tab
67
+
68
+ # Scheduling & Watchers
69
+ beecork tasks list # List scheduled tasks
70
+ beecork tasks delete <id> # Delete a task
71
+ beecork watches # List active watchers
72
+ beecork watch delete <id> # Delete a watcher
73
+
74
+ # Memory & Knowledge
75
+ beecork memory list # List stored memories
76
+ beecork memory delete <id> # Delete a memory
77
+ beecork knowledge # View stored knowledge
78
+
79
+ # Channels & Integrations
80
+ beecork discord # Set up Discord bot
81
+ beecork whatsapp # Set up WhatsApp
82
+ beecork webhook # Set up webhook endpoint
83
+ beecork enable <cap> # Enable a capability (email, github, calendar, etc.)
84
+ beecork disable <cap> # Disable a capability
85
+ beecork capabilities # List available capabilities
86
+
87
+ # Tools
88
+ beecork dashboard # Open the web dashboard
89
+ beecork mcp list # List MCP server configs
90
+ beecork media setup # Configure media generators
91
+ beecork activity # View activity summary
92
+ beecork history # Show activity timeline
93
+ beecork projects # List discovered projects
94
+ beecork machines # List registered machines
95
+ beecork templates # List tab templates
96
+ beecork store search <q> # Search community extensions
97
+ beecork store install <p> # Install a community package
98
+ ```
99
+
100
+ Tasks, watchers, and memories are created by Claude Code itself via MCP tools — just tell it what you need in natural language. The CLI is for viewing and managing them.
101
+
102
+ Run `beecork --help` for the full list of commands.
103
+
104
+ ## Deploy Anywhere
105
+
106
+ | Setup | Best For |
107
+ |-------|----------|
108
+ | **Local machine** | Tasks that need local files, Xcode projects, local apps |
109
+ | **VPS** | Always-on — web scraping, monitoring, API calls, server management. Requires a full OS environment (Node.js, Claude Code CLI, system service). |
110
+ | **[Beecork Cloud](https://beecork.com/cloud)** | Zero setup — a full cloud computer with everything pre-configured. No terminal, no installation. |
111
+
112
+ Local install is `npm install -g beecork`. VPS requires the same plus a properly configured server environment. Beecork Cloud handles all of that for you.
113
+
114
+ ## Architecture
115
+
116
+ ```
117
+ Telegram/WhatsApp/Discord
118
+ |
119
+ Pipe Brain (intelligent routing)
120
+ |
121
+ Daemon (always-on)
122
+ |
123
+ TabManager
124
+ |
125
+ Claude Code subprocess (persistent sessions)
126
+ |
127
+ MCP Server <-> SQLite (memory, state)
128
+ ```
129
+
130
+ ## Community
131
+
132
+ - [Discord](https://discord.gg/wEM9avTzb) — Chat, ask questions, share what you've built
133
+ - [Twitter/X](https://x.com/BeecorkAI) — Updates, demos, announcements
134
+ - [GitHub Discussions](https://github.com/beecork/beecork/discussions) — Feature ideas, Q&A
135
+
136
+ ## Documentation
137
+
138
+ - [Getting Started](https://github.com/beecork/beecork/blob/main/docs/getting-started.md) — Full setup walkthrough
139
+ - [Use Cases](https://github.com/beecork/beecork/blob/main/docs/use-cases.md) — What you can build with Beecork
140
+ - [Troubleshooting](https://github.com/beecork/beecork/blob/main/docs/troubleshooting.md) — Common issues and fixes
141
+ - [Comparison](https://github.com/beecork/beecork/blob/main/docs/comparison.md) — How Beecork compares to alternatives
142
+ - [Contributing](https://github.com/beecork/beecork/blob/main/CONTRIBUTING.md) — How to contribute
143
+ - [Security](https://github.com/beecork/beecork/blob/main/SECURITY.md) — Reporting vulnerabilities
144
+
145
+ ## Requirements
146
+
147
+ - Node.js 18+
148
+ - Claude Code CLI (`npm install -g @anthropic-ai/claude-code`)
149
+ - Claude Pro or Max subscription
150
+ - Telegram account (for the bot)
151
+
152
+ ## License
153
+
154
+ [MIT](https://github.com/beecork/beecork/blob/main/LICENSE)
@@ -1,4 +1,3 @@
1
1
  export type { CapabilityPack, EnabledCapability } from './types.js';
2
2
  export { CAPABILITY_PACKS } from './packs.js';
3
3
  export { getAvailablePacks, getEnabledCapabilities, isEnabled, enablePack, disablePack, updateMcpConfig } from './manager.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { CAPABILITY_PACKS } from './packs.js';
2
2
  export { getAvailablePacks, getEnabledCapabilities, isEnabled, enablePack, disablePack, updateMcpConfig } from './manager.js';
3
- //# sourceMappingURL=index.js.map
@@ -11,4 +11,3 @@ export declare function enablePack(packId: string, apiKey?: string): void;
11
11
  export declare function disablePack(packId: string): void;
12
12
  /** Regenerate MCP config based on enabled capabilities */
13
13
  export declare function updateMcpConfig(): void;
14
- //# sourceMappingURL=manager.d.ts.map
@@ -109,4 +109,3 @@ export function updateMcpConfig() {
109
109
  }
110
110
  fs.writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2) + '\n', { mode: 0o600 });
111
111
  }
112
- //# sourceMappingURL=manager.js.map
@@ -1,3 +1,2 @@
1
1
  import type { CapabilityPack } from './types.js';
2
2
  export declare const CAPABILITY_PACKS: CapabilityPack[];
3
- //# sourceMappingURL=packs.d.ts.map
@@ -13,7 +13,7 @@ export const CAPABILITY_PACKS = [
13
13
  requiresApiKey: true,
14
14
  apiKeyHint: 'Google OAuth credentials (follow the setup guide)',
15
15
  apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
16
- setupUrl: 'https://support.beecork.com/capabilities/email',
16
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
17
17
  },
18
18
  {
19
19
  id: 'calendar',
@@ -28,7 +28,7 @@ export const CAPABILITY_PACKS = [
28
28
  requiresApiKey: true,
29
29
  apiKeyHint: 'Google OAuth credentials (same as email if already set up)',
30
30
  apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
31
- setupUrl: 'https://support.beecork.com/capabilities/calendar',
31
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
32
32
  },
33
33
  {
34
34
  id: 'notion',
@@ -44,7 +44,7 @@ export const CAPABILITY_PACKS = [
44
44
  requiresApiKey: true,
45
45
  apiKeyHint: 'Notion integration token (from notion.so/my-integrations)',
46
46
  apiKeyEnvVar: 'NOTION_API_KEY',
47
- setupUrl: 'https://support.beecork.com/capabilities/notion',
47
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
48
48
  },
49
49
  {
50
50
  id: 'drive',
@@ -59,7 +59,7 @@ export const CAPABILITY_PACKS = [
59
59
  requiresApiKey: true,
60
60
  apiKeyHint: 'Google OAuth credentials',
61
61
  apiKeyEnvVar: 'GOOGLE_OAUTH_CREDENTIALS',
62
- setupUrl: 'https://support.beecork.com/capabilities/drive',
62
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
63
63
  },
64
64
  // Development
65
65
  {
@@ -76,7 +76,7 @@ export const CAPABILITY_PACKS = [
76
76
  requiresApiKey: true,
77
77
  apiKeyHint: 'GitHub personal access token (from github.com/settings/tokens)',
78
78
  apiKeyEnvVar: 'GITHUB_TOKEN',
79
- setupUrl: 'https://support.beecork.com/capabilities/github',
79
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
80
80
  },
81
81
  // Data
82
82
  {
@@ -92,7 +92,7 @@ export const CAPABILITY_PACKS = [
92
92
  requiresApiKey: true,
93
93
  apiKeyHint: 'PostgreSQL connection string (e.g., postgresql://user:pass@host:5432/db)',
94
94
  apiKeyEnvVar: 'DATABASE_URL',
95
- setupUrl: 'https://support.beecork.com/capabilities/database',
95
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
96
96
  },
97
97
  // Web
98
98
  {
@@ -106,7 +106,6 @@ export const CAPABILITY_PACKS = [
106
106
  args: ['-y', '@anthropic/web-search-mcp'],
107
107
  },
108
108
  requiresApiKey: false,
109
- setupUrl: 'https://support.beecork.com/capabilities/web',
109
+ setupUrl: 'https://github.com/beecork/beecork/blob/main/docs/use-cases.md',
110
110
  },
111
111
  ];
112
- //# sourceMappingURL=packs.js.map
@@ -19,4 +19,3 @@ export interface EnabledCapability {
19
19
  apiKey?: string;
20
20
  enabledAt: string;
21
21
  }
22
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -25,4 +25,3 @@ export declare function handleSharedCommand(ctx: CommandContext, tabManager: Tab
25
25
  * Extracted from the identical blocks in Telegram, WhatsApp, and Discord channels.
26
26
  */
27
27
  export declare function resolveProjectRoute(rawPrompt: string, tabName: string, text: string, userId: string): Promise<RouteResult>;
28
- //# sourceMappingURL=command-handler.d.ts.map
@@ -239,4 +239,3 @@ export async function resolveProjectRoute(rawPrompt, tabName, text, userId) {
239
239
  return { effectiveTabName: tabName };
240
240
  }
241
241
  }
242
- //# sourceMappingURL=command-handler.js.map
@@ -20,4 +20,3 @@ export declare class DiscordChannel implements Channel {
20
20
  setTyping(peerId: string, active: boolean): Promise<void>;
21
21
  private sendResponse;
22
22
  }
23
- //# sourceMappingURL=discord.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import { logger } from '../util/logger.js';
2
- import { chunkText, parseTabMessage, buildMediaPrompt } from '../util/text.js';
2
+ import { chunkText, parseTabMessage } from '../util/text.js';
3
3
  import { retryWithBackoff } from '../util/retry.js';
4
4
  import { inboundLimiter } from '../util/rate-limiter.js';
5
5
  import { saveMedia, isOversized } from '../media/store.js';
6
6
  import { initVoiceProviders } from '../voice/index.js';
7
- import { ProgressTracker } from '../util/progress.js';
7
+ import { processInboundMessage } from './pipeline.js';
8
8
  export class DiscordChannel {
9
9
  id = 'discord';
10
10
  name = 'Discord';
@@ -107,10 +107,8 @@ export class DiscordChannel {
107
107
  try {
108
108
  // Show typing
109
109
  await message.channel.sendTyping().catch(() => { });
110
- // Parse tab name
111
- const { tabName, prompt } = parseTabMessage(text || '');
112
- if (!prompt && media.length === 0)
113
- return;
110
+ // Parse tab name (needed for command handling check)
111
+ const { tabName } = parseTabMessage(text || '');
114
112
  // Shared command handler
115
113
  if (text.startsWith('/')) {
116
114
  const { handleSharedCommand } = await import('./command-handler.js');
@@ -126,61 +124,47 @@ export class DiscordChannel {
126
124
  return;
127
125
  }
128
126
  }
129
- // Build prompt with media
130
- const fullPrompt = buildMediaPrompt(media, prompt || '');
131
- // Use thread name as tab if in a thread (sanitize to valid tab name)
132
- let effectiveTab = tabName;
133
- let projectPath;
127
+ // Discord-specific: use thread name as tab if in a thread
128
+ let overrideTabName;
134
129
  if (message.channel.isThread?.()) {
135
130
  const threadName = (message.channel.name || '')
136
131
  .replace(/[^a-zA-Z0-9-]/g, '-')
137
132
  .replace(/^-+|-+$/g, '')
138
133
  .slice(0, 32);
139
- if (threadName)
140
- effectiveTab = threadName;
141
- }
142
- // Smart project routing (shared across all channels)
143
- const { resolveProjectRoute } = await import('./command-handler.js');
144
- const route = await resolveProjectRoute(prompt || '', effectiveTab, text, message.author.id);
145
- if (route.confirmationMessage) {
146
- await message.reply(route.confirmationMessage);
147
- return;
134
+ if (threadName && tabName === 'default')
135
+ overrideTabName = threadName;
148
136
  }
149
- effectiveTab = route.effectiveTabName;
150
- projectPath = route.projectPath;
151
137
  // Typing indicator refresh
152
138
  const typingInterval = setInterval(() => {
153
139
  message.channel.sendTyping().catch(() => { });
154
140
  }, 8000); // Discord typing lasts 10s
155
141
  try {
156
- // Progress updates for long tasks (every 30 seconds)
157
- const progressTracker = new ProgressTracker(effectiveTab, (msg) => {
158
- message.channel.send(msg).catch(() => { });
159
- });
160
- const result = await this.ctx.tabManager.sendMessage(effectiveTab, fullPrompt, {
161
- onToolUse: (name, input) => progressTracker.record(name, input),
162
- projectPath,
142
+ // Shared message pipeline
143
+ const pipelineResult = await processInboundMessage({
144
+ text: text || '',
145
+ media,
146
+ channelId: 'discord',
147
+ tabManager: this.ctx.tabManager,
148
+ voiceReplyMode: this.ctx.config.voice?.replyMode,
149
+ ttsProvider: this.ttsProvider,
150
+ userId: message.author.id,
151
+ sendProgress: (msg) => {
152
+ message.channel.send(msg).catch(() => { });
153
+ },
154
+ overrideTabName,
163
155
  });
164
- progressTracker.stop();
165
156
  clearInterval(typingInterval);
166
- const responseText = result.error
167
- ? `Error: ${result.text}`
168
- : result.text || '(empty response)';
169
- // Voice reply if configured
170
- const voiceMode = this.ctx.config.voice?.replyMode;
171
- if (this.ttsProvider && (voiceMode === 'voice' || voiceMode === 'both')) {
172
- try {
173
- const audioPath = await this.ttsProvider.synthesize(responseText);
174
- await message.reply({ files: [audioPath] });
175
- if (voiceMode === 'voice')
176
- return;
177
- }
178
- catch (err) {
179
- logger.warn('Discord TTS failed:', err);
180
- }
157
+ // Empty result means no prompt and no media
158
+ if (!pipelineResult.responseText)
159
+ return;
160
+ // Voice reply if TTS generated audio
161
+ if (pipelineResult.audioPath) {
162
+ await message.reply({ files: [pipelineResult.audioPath] });
163
+ if (pipelineResult.voiceOnly)
164
+ return;
181
165
  }
182
166
  // Send text response
183
- await this.sendResponse(message, responseText, effectiveTab);
167
+ await this.sendResponse(message, pipelineResult.responseText, pipelineResult.tabName);
184
168
  }
185
169
  catch (err) {
186
170
  clearInterval(typingInterval);
@@ -263,4 +247,3 @@ export class DiscordChannel {
263
247
  }
264
248
  }
265
249
  }
266
- //# sourceMappingURL=discord.js.map
@@ -5,4 +5,3 @@ export { WebhookChannel } from './webhook.js';
5
5
  export { DiscordChannel } from './discord.js';
6
6
  export { loadCommunityChannels } from './loader.js';
7
7
  export type { Channel, ChannelContext, InboundMessage, InboundMessageHandler, MediaAttachment, SendOptions } from './types.js';
8
- //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,3 @@ export { WhatsAppChannel } from './whatsapp.js';
4
4
  export { WebhookChannel } from './webhook.js';
5
5
  export { DiscordChannel } from './discord.js';
6
6
  export { loadCommunityChannels } from './loader.js';
7
- //# sourceMappingURL=index.js.map
@@ -5,4 +5,3 @@ import type { Channel, ChannelContext } from './types.js';
5
5
  * class implementing the Channel interface.
6
6
  */
7
7
  export declare function loadCommunityChannels(ctx: ChannelContext): Promise<Channel[]>;
8
- //# sourceMappingURL=loader.d.ts.map
@@ -9,6 +9,10 @@ const CHANNEL_PREFIX = 'beecork-channel-';
9
9
  */
10
10
  export async function loadCommunityChannels(ctx) {
11
11
  const channels = [];
12
+ // Require explicit opt-in via config to prevent supply-chain attacks
13
+ const allowlist = ctx.config.communityChannels;
14
+ if (!allowlist || allowlist.length === 0)
15
+ return channels;
12
16
  // Look in global and local node_modules
13
17
  const searchPaths = [
14
18
  path.join(process.cwd(), 'node_modules'),
@@ -31,6 +35,8 @@ export async function loadCommunityChannels(ctx) {
31
35
  for (const dir of dirs) {
32
36
  if (!dir.startsWith(CHANNEL_PREFIX))
33
37
  continue;
38
+ if (!allowlist.includes(dir))
39
+ continue;
34
40
  const channelName = dir.slice(CHANNEL_PREFIX.length);
35
41
  const pkgPath = path.join(searchPath, dir);
36
42
  try {
@@ -70,4 +76,3 @@ export async function loadCommunityChannels(ctx) {
70
76
  }
71
77
  return channels;
72
78
  }
73
- //# sourceMappingURL=loader.js.map
@@ -0,0 +1,50 @@
1
+ import type { MediaAttachment } from './types.js';
2
+ import type { TabManager } from '../session/manager.js';
3
+ import type { TTSProvider } from '../voice/tts.js';
4
+ export interface PipelineOptions {
5
+ /** Raw message text (may include /tab prefix) */
6
+ text: string;
7
+ /** Downloaded media attachments */
8
+ media: MediaAttachment[];
9
+ /** Channel identifier for logging */
10
+ channelId: string;
11
+ /** Tab manager instance */
12
+ tabManager: TabManager;
13
+ /** Voice reply mode from config */
14
+ voiceReplyMode?: 'voice' | 'both' | 'text';
15
+ /** TTS provider (if configured) */
16
+ ttsProvider?: TTSProvider | null;
17
+ /** User ID for project routing */
18
+ userId: string;
19
+ /** Callback to send progress messages to the user */
20
+ sendProgress: (message: string) => void;
21
+ /**
22
+ * Override the tab name (e.g., group tabs in Telegram, thread tabs in Discord).
23
+ * When set, parseTabMessage result is ignored for the tab name.
24
+ */
25
+ overrideTabName?: string;
26
+ /**
27
+ * Callback invoked on each text chunk from Claude (for streaming).
28
+ * Only Telegram uses this currently.
29
+ */
30
+ onTextChunk?: (chunk: string) => void;
31
+ }
32
+ export interface PipelineResult {
33
+ /** The final response text (already includes "Error: " prefix on errors) */
34
+ responseText: string;
35
+ /** The tab name that was actually used */
36
+ tabName: string;
37
+ /** Whether the response was an error */
38
+ isError: boolean;
39
+ /** Path to TTS audio file, if voice reply was generated */
40
+ audioPath?: string;
41
+ /** Whether voice-only mode is active (caller should skip text response) */
42
+ voiceOnly?: boolean;
43
+ }
44
+ /**
45
+ * Process an inbound message through the shared pipeline.
46
+ *
47
+ * Returns the response text and optional audio path. The caller (channel)
48
+ * is responsible for delivering the response using its platform API.
49
+ */
50
+ export declare function processInboundMessage(opts: PipelineOptions): Promise<PipelineResult>;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Shared message-processing pipeline for all channels.
3
+ *
4
+ * Handles the common flow: project routing -> media prompt building ->
5
+ * tab message sending -> progress tracking -> TTS voice reply.
6
+ *
7
+ * Each channel remains responsible for:
8
+ * - Platform-specific message parsing and media download
9
+ * - Typing indicators (passed as a callback)
10
+ * - Sending the final response via its own API
11
+ * - Any channel-specific features (Telegram streaming, Discord threads, etc.)
12
+ */
13
+ import { parseTabMessage, buildMediaPrompt } from '../util/text.js';
14
+ import { ProgressTracker } from '../util/progress.js';
15
+ import { logger } from '../util/logger.js';
16
+ /**
17
+ * Process an inbound message through the shared pipeline.
18
+ *
19
+ * Returns the response text and optional audio path. The caller (channel)
20
+ * is responsible for delivering the response using its platform API.
21
+ */
22
+ export async function processInboundMessage(opts) {
23
+ const { text, media, channelId, tabManager, voiceReplyMode, ttsProvider, userId, sendProgress, overrideTabName, onTextChunk, } = opts;
24
+ // 1. Parse tab name and prompt from the message text
25
+ let { tabName, prompt: rawPrompt } = parseTabMessage(text);
26
+ // Allow channel to override tab name (group tabs, thread tabs, etc.)
27
+ if (overrideTabName) {
28
+ tabName = overrideTabName;
29
+ }
30
+ if (!rawPrompt && media.length === 0) {
31
+ return { responseText: '', tabName, isError: false };
32
+ }
33
+ // 2. Smart project routing
34
+ const { resolveProjectRoute } = await import('./command-handler.js');
35
+ const route = await resolveProjectRoute(rawPrompt, tabName, text, userId);
36
+ if (route.confirmationMessage) {
37
+ return {
38
+ responseText: route.confirmationMessage,
39
+ tabName,
40
+ isError: false,
41
+ };
42
+ }
43
+ const effectiveTabName = route.effectiveTabName;
44
+ const projectPath = route.projectPath;
45
+ // 3. Build prompt with media references
46
+ const prompt = buildMediaPrompt(media, rawPrompt);
47
+ logger.info(`[${channelId}] Pipeline processing for tab "${effectiveTabName}"`);
48
+ // 4. Create progress tracker
49
+ const progressTracker = new ProgressTracker(effectiveTabName, sendProgress);
50
+ // 5. Send message to tab
51
+ const result = await tabManager.sendMessage(effectiveTabName, prompt, {
52
+ onTextChunk,
53
+ onToolUse: (name, input) => progressTracker.record(name, input),
54
+ projectPath,
55
+ });
56
+ progressTracker.stop();
57
+ // 6. Build response text
58
+ const isError = result.error;
59
+ const responseText = isError
60
+ ? `Error: ${result.text}`
61
+ : result.text || '(empty response)';
62
+ // 7. TTS voice reply (shared logic)
63
+ let audioPath;
64
+ let voiceOnly = false;
65
+ if (ttsProvider && (voiceReplyMode === 'voice' || voiceReplyMode === 'both')) {
66
+ try {
67
+ audioPath = await ttsProvider.synthesize(responseText);
68
+ if (voiceReplyMode === 'voice') {
69
+ voiceOnly = true;
70
+ }
71
+ }
72
+ catch (err) {
73
+ logger.warn(`[${channelId}] TTS failed, falling back to text:`, err);
74
+ }
75
+ }
76
+ return {
77
+ responseText,
78
+ tabName: effectiveTabName,
79
+ isError,
80
+ audioPath,
81
+ voiceOnly,
82
+ };
83
+ }
@@ -18,4 +18,3 @@ export declare class ChannelRegistry {
18
18
  /** Broadcast a notification to all channels */
19
19
  broadcastNotify(text: string, urgent?: boolean): Promise<void>;
20
20
  }
21
- //# sourceMappingURL=registry.d.ts.map
@@ -49,4 +49,3 @@ export class ChannelRegistry {
49
49
  await Promise.all(Array.from(this.channels.values()).map(channel => channel.sendNotification(text, urgent).catch(err => logger.warn(`${channel.name} notify failed:`, err))));
50
50
  }
51
51
  }
52
- //# sourceMappingURL=registry.js.map
@@ -38,4 +38,3 @@ export declare class TelegramChannel implements Channel {
38
38
  private isAdmin;
39
39
  private setReaction;
40
40
  }
41
- //# sourceMappingURL=telegram.d.ts.map