botinabox 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +190 -190
  3. package/bin/botinabox.mjs +2 -2
  4. package/dist/channels/slack/index.d.ts +1 -1
  5. package/dist/{chat-pipeline-BWrtVqEP.d.ts → chat-pipeline-DuNX5WoL.d.ts} +3 -0
  6. package/dist/cli.js +0 -0
  7. package/dist/index.d.ts +11 -2
  8. package/dist/index.js +64 -27
  9. package/package.json +100 -99
  10. package/dist/channels/discord/adapter.d.ts +0 -32
  11. package/dist/channels/discord/adapter.js +0 -70
  12. package/dist/channels/discord/inbound.d.ts +0 -25
  13. package/dist/channels/discord/inbound.js +0 -24
  14. package/dist/channels/discord/models.d.ts +0 -8
  15. package/dist/channels/discord/models.js +0 -5
  16. package/dist/channels/discord/outbound.d.ts +0 -14
  17. package/dist/channels/discord/outbound.js +0 -38
  18. package/dist/channels/slack/adapter.d.ts +0 -33
  19. package/dist/channels/slack/adapter.js +0 -74
  20. package/dist/channels/slack/inbound.d.ts +0 -59
  21. package/dist/channels/slack/inbound.js +0 -96
  22. package/dist/channels/slack/models.d.ts +0 -9
  23. package/dist/channels/slack/models.js +0 -5
  24. package/dist/channels/slack/outbound.d.ts +0 -12
  25. package/dist/channels/slack/outbound.js +0 -18
  26. package/dist/channels/slack/transcribe.d.ts +0 -41
  27. package/dist/channels/slack/transcribe.js +0 -106
  28. package/dist/channels/webhook/adapter.d.ts +0 -23
  29. package/dist/channels/webhook/adapter.js +0 -86
  30. package/dist/channels/webhook/hmac.d.ts +0 -13
  31. package/dist/channels/webhook/hmac.js +0 -26
  32. package/dist/channels/webhook/models.d.ts +0 -9
  33. package/dist/channels/webhook/models.js +0 -5
  34. package/dist/channels/webhook/server.d.ts +0 -20
  35. package/dist/channels/webhook/server.js +0 -91
  36. package/dist/chat-pipeline-C-XlLGNl.d.ts +0 -648
  37. package/dist/chat-pipeline-CR1KF6eX.d.ts +0 -652
  38. package/dist/chat-pipeline-DisuC8SB.d.ts +0 -643
  39. package/dist/chunk-2LGXQPEA.js +0 -41
  40. package/dist/chunk-3X3YKI4T.js +0 -357
  41. package/dist/chunk-D47AIFOD.js +0 -351
  42. package/dist/chunk-DSNJKNEW.js +0 -328
  43. package/dist/chunk-GS2JFL6I.js +0 -144
  44. package/dist/chunk-J6S6QMUY.js +0 -144
  45. package/dist/chunk-QLA6YOFN.js +0 -22
  46. package/dist/chunk-UACT2WXX.js +0 -381
  47. package/dist/cli/templates/config.yml.d.ts +0 -7
  48. package/dist/cli/templates/config.yml.js +0 -61
  49. package/dist/cli/templates/env.d.ts +0 -1
  50. package/dist/cli/templates/env.js +0 -30
  51. package/dist/cli/templates/index.ts.d.ts +0 -2
  52. package/dist/cli/templates/index.ts.js +0 -30
  53. package/dist/cli/templates/package.json.d.ts +0 -5
  54. package/dist/cli/templates/package.json.js +0 -28
  55. package/dist/connector-DDahQw-2.d.ts +0 -63
  56. package/dist/connectors/google/calendar-connector.d.ts +0 -40
  57. package/dist/connectors/google/calendar-connector.js +0 -243
  58. package/dist/connectors/google/gmail-connector.d.ts +0 -42
  59. package/dist/connectors/google/gmail-connector.js +0 -345
  60. package/dist/connectors/google/oauth.d.ts +0 -48
  61. package/dist/connectors/google/oauth.js +0 -112
  62. package/dist/connectors/google/types.d.ts +0 -78
  63. package/dist/connectors/google/types.js +0 -2
  64. package/dist/core/chat/auto-discovery.d.ts +0 -16
  65. package/dist/core/chat/auto-discovery.js +0 -54
  66. package/dist/core/chat/channel-registry.d.ts +0 -45
  67. package/dist/core/chat/channel-registry.js +0 -96
  68. package/dist/core/chat/chat-pipeline.d.ts +0 -113
  69. package/dist/core/chat/chat-pipeline.js +0 -395
  70. package/dist/core/chat/chat-responder.d.ts +0 -90
  71. package/dist/core/chat/chat-responder.js +0 -185
  72. package/dist/core/chat/formatter.d.ts +0 -11
  73. package/dist/core/chat/formatter.js +0 -60
  74. package/dist/core/chat/index.d.ts +0 -24
  75. package/dist/core/chat/index.js +0 -18
  76. package/dist/core/chat/message-interpreter.d.ts +0 -91
  77. package/dist/core/chat/message-interpreter.js +0 -166
  78. package/dist/core/chat/message-store.d.ts +0 -66
  79. package/dist/core/chat/message-store.js +0 -131
  80. package/dist/core/chat/notification-queue.d.ts +0 -34
  81. package/dist/core/chat/notification-queue.js +0 -111
  82. package/dist/core/chat/pipeline.d.ts +0 -38
  83. package/dist/core/chat/pipeline.js +0 -89
  84. package/dist/core/chat/policies.d.ts +0 -16
  85. package/dist/core/chat/policies.js +0 -25
  86. package/dist/core/chat/routing.d.ts +0 -17
  87. package/dist/core/chat/routing.js +0 -36
  88. package/dist/core/chat/session-key.d.ts +0 -30
  89. package/dist/core/chat/session-key.js +0 -65
  90. package/dist/core/chat/session-manager.d.ts +0 -17
  91. package/dist/core/chat/session-manager.js +0 -23
  92. package/dist/core/chat/text-chunker.d.ts +0 -9
  93. package/dist/core/chat/text-chunker.js +0 -48
  94. package/dist/core/chat/triage-router.d.ts +0 -75
  95. package/dist/core/chat/triage-router.js +0 -142
  96. package/dist/core/chat/types.d.ts +0 -5
  97. package/dist/core/chat/types.js +0 -5
  98. package/dist/core/config/defaults.d.ts +0 -2
  99. package/dist/core/config/defaults.js +0 -38
  100. package/dist/core/config/index.d.ts +0 -6
  101. package/dist/core/config/index.js +0 -4
  102. package/dist/core/config/interpolate.d.ts +0 -5
  103. package/dist/core/config/interpolate.js +0 -27
  104. package/dist/core/config/loader.d.ts +0 -24
  105. package/dist/core/config/loader.js +0 -59
  106. package/dist/core/config/schema.d.ts +0 -5
  107. package/dist/core/config/schema.js +0 -119
  108. package/dist/core/data/core-entity-contexts.d.ts +0 -14
  109. package/dist/core/data/core-entity-contexts.js +0 -197
  110. package/dist/core/data/core-migrations.d.ts +0 -5
  111. package/dist/core/data/core-migrations.js +0 -45
  112. package/dist/core/data/core-schema.d.ts +0 -6
  113. package/dist/core/data/core-schema.js +0 -454
  114. package/dist/core/data/data-store.d.ts +0 -67
  115. package/dist/core/data/data-store.js +0 -218
  116. package/dist/core/data/domain-entity-contexts.d.ts +0 -29
  117. package/dist/core/data/domain-entity-contexts.js +0 -321
  118. package/dist/core/data/domain-schema.d.ts +0 -36
  119. package/dist/core/data/domain-schema.js +0 -323
  120. package/dist/core/data/index.d.ts +0 -7
  121. package/dist/core/data/index.js +0 -7
  122. package/dist/core/data/types.d.ts +0 -111
  123. package/dist/core/data/types.js +0 -1
  124. package/dist/core/hooks/hook-bus.d.ts +0 -18
  125. package/dist/core/hooks/hook-bus.js +0 -120
  126. package/dist/core/hooks/index.d.ts +0 -2
  127. package/dist/core/hooks/index.js +0 -1
  128. package/dist/core/hooks/types.d.ts +0 -19
  129. package/dist/core/hooks/types.js +0 -1
  130. package/dist/core/index.d.ts +0 -4
  131. package/dist/core/index.js +0 -4
  132. package/dist/core/llm/auto-discovery.d.ts +0 -11
  133. package/dist/core/llm/auto-discovery.js +0 -49
  134. package/dist/core/llm/cost-tracker.d.ts +0 -6
  135. package/dist/core/llm/cost-tracker.js +0 -38
  136. package/dist/core/llm/index.d.ts +0 -4
  137. package/dist/core/llm/index.js +0 -3
  138. package/dist/core/llm/model-router.d.ts +0 -25
  139. package/dist/core/llm/model-router.js +0 -49
  140. package/dist/core/llm/provider-registry.d.ts +0 -9
  141. package/dist/core/llm/provider-registry.js +0 -25
  142. package/dist/core/llm/types.d.ts +0 -2
  143. package/dist/core/llm/types.js +0 -2
  144. package/dist/core/orchestrator/adapters/api-adapter.d.ts +0 -34
  145. package/dist/core/orchestrator/adapters/api-adapter.js +0 -88
  146. package/dist/core/orchestrator/adapters/cli-adapter.d.ts +0 -22
  147. package/dist/core/orchestrator/adapters/cli-adapter.js +0 -69
  148. package/dist/core/orchestrator/adapters/deterministic-adapter.d.ts +0 -35
  149. package/dist/core/orchestrator/adapters/deterministic-adapter.js +0 -75
  150. package/dist/core/orchestrator/adapters/env-whitelist.d.ts +0 -4
  151. package/dist/core/orchestrator/adapters/env-whitelist.js +0 -27
  152. package/dist/core/orchestrator/adapters/output-extractor.d.ts +0 -11
  153. package/dist/core/orchestrator/adapters/output-extractor.js +0 -59
  154. package/dist/core/orchestrator/adapters/process-manager.d.ts +0 -15
  155. package/dist/core/orchestrator/adapters/process-manager.js +0 -26
  156. package/dist/core/orchestrator/adapters/tool-loop.d.ts +0 -22
  157. package/dist/core/orchestrator/adapters/tool-loop.js +0 -66
  158. package/dist/core/orchestrator/agent-registry.d.ts +0 -31
  159. package/dist/core/orchestrator/agent-registry.js +0 -135
  160. package/dist/core/orchestrator/budget-controller.d.ts +0 -19
  161. package/dist/core/orchestrator/budget-controller.js +0 -73
  162. package/dist/core/orchestrator/chain-guard.d.ts +0 -14
  163. package/dist/core/orchestrator/chain-guard.js +0 -23
  164. package/dist/core/orchestrator/circuit-breaker.d.ts +0 -65
  165. package/dist/core/orchestrator/circuit-breaker.js +0 -159
  166. package/dist/core/orchestrator/claude-stream-parser.d.ts +0 -31
  167. package/dist/core/orchestrator/claude-stream-parser.js +0 -99
  168. package/dist/core/orchestrator/config-revisions.d.ts +0 -6
  169. package/dist/core/orchestrator/config-revisions.js +0 -17
  170. package/dist/core/orchestrator/dependency-resolver.d.ts +0 -20
  171. package/dist/core/orchestrator/dependency-resolver.js +0 -78
  172. package/dist/core/orchestrator/governance-gate.d.ts +0 -110
  173. package/dist/core/orchestrator/governance-gate.js +0 -170
  174. package/dist/core/orchestrator/learning-pipeline.d.ts +0 -109
  175. package/dist/core/orchestrator/learning-pipeline.js +0 -249
  176. package/dist/core/orchestrator/loop-detector.d.ts +0 -51
  177. package/dist/core/orchestrator/loop-detector.js +0 -133
  178. package/dist/core/orchestrator/ndjson-logger.d.ts +0 -6
  179. package/dist/core/orchestrator/ndjson-logger.js +0 -18
  180. package/dist/core/orchestrator/permission-relay.d.ts +0 -72
  181. package/dist/core/orchestrator/permission-relay.js +0 -164
  182. package/dist/core/orchestrator/run-manager.d.ts +0 -31
  183. package/dist/core/orchestrator/run-manager.js +0 -178
  184. package/dist/core/orchestrator/scheduler.d.ts +0 -70
  185. package/dist/core/orchestrator/scheduler.js +0 -198
  186. package/dist/core/orchestrator/secret-store.d.ts +0 -57
  187. package/dist/core/orchestrator/secret-store.js +0 -171
  188. package/dist/core/orchestrator/session-manager.d.ts +0 -13
  189. package/dist/core/orchestrator/session-manager.js +0 -66
  190. package/dist/core/orchestrator/task-queue.d.ts +0 -34
  191. package/dist/core/orchestrator/task-queue.js +0 -83
  192. package/dist/core/orchestrator/template-interpolate.d.ts +0 -5
  193. package/dist/core/orchestrator/template-interpolate.js +0 -18
  194. package/dist/core/orchestrator/user-registry.d.ts +0 -47
  195. package/dist/core/orchestrator/user-registry.js +0 -76
  196. package/dist/core/orchestrator/wakeup-queue.d.ts +0 -9
  197. package/dist/core/orchestrator/wakeup-queue.js +0 -45
  198. package/dist/core/orchestrator/workflow-engine.d.ts +0 -47
  199. package/dist/core/orchestrator/workflow-engine.js +0 -204
  200. package/dist/core/security/audit.d.ts +0 -20
  201. package/dist/core/security/audit.js +0 -33
  202. package/dist/core/security/column-validator.d.ts +0 -20
  203. package/dist/core/security/column-validator.js +0 -37
  204. package/dist/core/security/index.d.ts +0 -5
  205. package/dist/core/security/index.js +0 -5
  206. package/dist/core/security/process-env.d.ts +0 -13
  207. package/dist/core/security/process-env.js +0 -49
  208. package/dist/core/security/sanitizer.d.ts +0 -11
  209. package/dist/core/security/sanitizer.js +0 -39
  210. package/dist/core/security/types.d.ts +0 -11
  211. package/dist/core/security/types.js +0 -1
  212. package/dist/core/update/auto-update.d.ts +0 -21
  213. package/dist/core/update/auto-update.js +0 -102
  214. package/dist/core/update/backup-manager.d.ts +0 -7
  215. package/dist/core/update/backup-manager.js +0 -24
  216. package/dist/core/update/index.d.ts +0 -8
  217. package/dist/core/update/index.js +0 -6
  218. package/dist/core/update/migration-hooks.d.ts +0 -11
  219. package/dist/core/update/migration-hooks.js +0 -10
  220. package/dist/core/update/types.d.ts +0 -11
  221. package/dist/core/update/types.js +0 -1
  222. package/dist/core/update/update-checker.d.ts +0 -11
  223. package/dist/core/update/update-checker.js +0 -63
  224. package/dist/core/update/update-manager.d.ts +0 -25
  225. package/dist/core/update/update-manager.js +0 -101
  226. package/dist/core/update/version-utils.d.ts +0 -6
  227. package/dist/core/update/version-utils.js +0 -34
  228. package/dist/gmail-connector-2FVYTQJH.js +0 -6
  229. package/dist/gmail-connector-MNUBRNFM.js +0 -6
  230. package/dist/gmail-connector-PS2VLGNE.js +0 -6
  231. package/dist/gmail-connector-ULSMN6X2.js +0 -6
  232. package/dist/gmail-connector-URRFX6A3.js +0 -6
  233. package/dist/inbound-AFBUPSPG.js +0 -10
  234. package/dist/inbound-AFOHYNUY.js +0 -6
  235. package/dist/inbound-CGIXRXGC.js +0 -8
  236. package/dist/inbound-MCOLRH6U.js +0 -10
  237. package/dist/inbound-SNEMBLGA.js +0 -6
  238. package/dist/inbound-ZJHAYVMF.js +0 -10
  239. package/dist/provider-qqJYv9nv.d.ts +0 -75
  240. package/dist/providers/anthropic/models.d.ts +0 -2
  241. package/dist/providers/anthropic/models.js +0 -29
  242. package/dist/providers/anthropic/provider.d.ts +0 -13
  243. package/dist/providers/anthropic/provider.js +0 -119
  244. package/dist/providers/anthropic/tool-converter.d.ts +0 -10
  245. package/dist/providers/anthropic/tool-converter.js +0 -7
  246. package/dist/providers/ollama/provider.d.ts +0 -17
  247. package/dist/providers/ollama/provider.js +0 -185
  248. package/dist/providers/openai/models.d.ts +0 -2
  249. package/dist/providers/openai/models.js +0 -29
  250. package/dist/providers/openai/provider.d.ts +0 -13
  251. package/dist/providers/openai/provider.js +0 -163
  252. package/dist/providers/openai/tool-converter.d.ts +0 -10
  253. package/dist/providers/openai/tool-converter.js +0 -10
  254. package/dist/shared/constants.d.ts +0 -50
  255. package/dist/shared/constants.js +0 -64
  256. package/dist/shared/index.d.ts +0 -14
  257. package/dist/shared/index.js +0 -14
  258. package/dist/shared/types/agent.d.ts +0 -36
  259. package/dist/shared/types/agent.js +0 -2
  260. package/dist/shared/types/channel.d.ts +0 -70
  261. package/dist/shared/types/channel.js +0 -2
  262. package/dist/shared/types/config.d.ts +0 -111
  263. package/dist/shared/types/config.js +0 -2
  264. package/dist/shared/types/connector.d.ts +0 -77
  265. package/dist/shared/types/connector.js +0 -2
  266. package/dist/shared/types/execution.d.ts +0 -29
  267. package/dist/shared/types/execution.js +0 -2
  268. package/dist/shared/types/provider.d.ts +0 -73
  269. package/dist/shared/types/provider.js +0 -2
  270. package/dist/shared/types/task.d.ts +0 -47
  271. package/dist/shared/types/task.js +0 -2
  272. package/dist/shared/types/workflow.d.ts +0 -39
  273. package/dist/shared/types/workflow.js +0 -2
  274. package/dist/shared/utils.d.ts +0 -6
  275. package/dist/shared/utils.js +0 -13
  276. package/dist/update-check.d.ts +0 -5
  277. package/dist/update-check.js +0 -56
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Automated Industries
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Automated Industries
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 CHANGED
@@ -1,190 +1,190 @@
1
- # Bot in a Box
2
-
3
- A modular TypeScript framework for building multi-agent bots with LLM orchestration, multi-channel messaging, and task automation.
4
-
5
- ## Features
6
-
7
- - **Execution engine** -- Generic task executor with 22 built-in tools and a tool loop (up to 5 iterations). Agents can read files, send documents, dispatch tasks, search conversations, and more. Apps register tools declaratively.
8
- - **22 built-in tools** -- File ops (send, read, list, register), task ops (dispatch, cancel, reassign), system status (task, agent, system, active tasks), entity lookup (agents, projects, agent detail), messaging (send message, task comment, read/search conversation), management (create agent, create project). All channel-agnostic.
9
- - **Chat pipeline** -- Configurable 6-layer chat orchestration: dedup, storage, fast ack (<2s via Haiku), async interpretation, task dispatch, and completion response. Apps provide system prompt and routing rules; framework handles everything else.
10
- - **Slack integration** -- `SlackBoltAdapter` handles Bolt Socket Mode, message parsing, response delivery, and file uploads. One import, one `start()` call.
11
- - **Unified config** -- All settings in one `botinabox.config.yml`: models, execution, chat, routing, safety, budget. YAML with env var interpolation. Auto-initializes with sensible defaults.
12
- - **Message store** -- Store-before-respond guarantee. Inbound messages and attachments stored before any bot response. Channel history for conversation context.
13
- - **Message interpretation** -- Async structured extraction from messages into tasks, memories, files, and user context. Pluggable extractors for custom data types. Programmatic task creation (no LLM dependency).
14
- - **Triage routing** -- Content-aware message routing with keyword/regex matching, priority rules, and LLM fallback. Ownership chain logging for every routing decision.
15
- - **Multi-agent orchestration** -- Define agents with different models, roles, and execution adapters. Task queue with priority scheduling, retry policies, and followup chains.
16
- - **Loop detection and circuit breakers** -- Pattern-based loop detection (self-loops, ping-pong, blocked re-entry) plus circuit breakers with automatic human escalation.
17
- - **Learning pipeline** -- Structured feedback capture with auto-promotion: 3+ similar records become a playbook, 3+ agents become a reusable skill.
18
- - **Governance gates** -- Independent QA, quality, and drift gates that validate agent output and report to the human operator.
19
- - **Permission relay** -- Remote approval via messaging platforms (Slack, Discord, Telegram). Dual approval: local + remote, first wins.
20
- - **LLM provider abstraction** -- Swap between Anthropic, OpenAI, and Ollama. Model aliasing, purpose-based routing, fallback chains. Default LLM call wrapper included.
21
- - **Channel adapters** -- Slack (Bolt Socket Mode), Discord, and webhooks. Auto-discovery, session management, notification queuing.
22
- - **Workflow engine** -- Multi-step workflows with dependency resolution, parallel execution, and conditional branching.
23
- - **SQLite data layer** -- 27 core tables, migrations, entity context rendering via [latticesql](https://github.com/automated-industries/lattice). WAL mode.
24
- - **Event-driven hooks** -- Priority-ordered, filter-based event bus for decoupled communication.
25
- - **Budget controls** -- Per-agent and global cost tracking with warning thresholds and hard stops.
26
- - **Scheduling** -- Database-backed cron and one-time schedules.
27
- - **Connectors** -- Google Gmail and Calendar via OAuth2 and service account.
28
- - **Security** -- Input sanitization, field length enforcement, audit logging, HMAC webhook verification.
29
-
30
- ## Install
31
-
32
- ```bash
33
- npm install botinabox
34
- ```
35
-
36
- Install peer dependencies for the providers you need:
37
-
38
- ```bash
39
- # For Anthropic
40
- npm install @anthropic-ai/sdk
41
-
42
- # For OpenAI
43
- npm install openai
44
-
45
- # For Google connectors
46
- npm install googleapis
47
- ```
48
-
49
- ## Quick Start
50
-
51
- ```typescript
52
- import {
53
- HookBus, DataStore, defineCoreTables, initConfig,
54
- TaskQueue, RunManager, WakeupQueue, ChatPipeline,
55
- registerExecutionEngine, createDefaultLLMCall,
56
- sendFileTool, readFileTool, listAgentsTool, getTaskStatusTool,
57
- } from 'botinabox';
58
- import { SlackBoltAdapter } from 'botinabox/slack';
59
- import Anthropic from '@anthropic-ai/sdk';
60
-
61
- // 1. Config (auto-loads botinabox.config.yml or uses defaults)
62
- initConfig({});
63
- const hooks = new HookBus();
64
- const db = new DataStore({ dbPath: './data/bot.db', wal: true, hooks });
65
- defineCoreTables(db);
66
- await db.init();
67
-
68
- // 2. Orchestration
69
- const tasks = new TaskQueue(db, hooks);
70
- const runs = new RunManager(db, hooks);
71
- const wakeups = new WakeupQueue(db);
72
-
73
- // 3. Execution engine with built-in tools
74
- const client = new Anthropic();
75
- await registerExecutionEngine({
76
- db, hooks, runs,
77
- config: {
78
- client,
79
- tools: [sendFileTool, readFileTool, listAgentsTool, getTaskStatusTool],
80
- },
81
- });
82
-
83
- // 4. Chat pipeline (6-layer: dedup → ack → interpret → dispatch → execute → respond)
84
- const llmCall = createDefaultLLMCall(client);
85
- const pipeline = new ChatPipeline(db, hooks, {
86
- llmCall, tasks, wakeups,
87
- systemPrompt: 'You are a helpful AI assistant.',
88
- routingRules: [{ agentSlug: 'assistant', keywords: ['help'] }],
89
- fallbackAgent: 'assistant',
90
- });
91
-
92
- // 5. Slack (one import, one start)
93
- const slack = new SlackBoltAdapter({
94
- botToken: process.env.SLACK_BOT_TOKEN!,
95
- appToken: process.env.SLACK_APP_TOKEN!,
96
- hooks, pipeline,
97
- });
98
- await slack.start();
99
- tasks.startPolling();
100
- ```
101
-
102
- ## Subpath Exports
103
-
104
- | Import path | Description |
105
- |---|---|
106
- | `botinabox` | Core framework -- HookBus, DataStore, ChatPipeline, ExecutionEngine, 22 built-in tools, config (loadConfig/getConfig), AgentRegistry, TaskQueue, RunManager, Scheduler, MessageStore, ChatResponder, MessageInterpreter, TriageRouter, createDefaultLLMCall, buildSystemContext, and all shared types |
107
- | `botinabox/anthropic` | Anthropic Claude provider (`createAnthropicProvider`) |
108
- | `botinabox/openai` | OpenAI GPT provider (`createOpenAIProvider`) |
109
- | `botinabox/ollama` | Ollama local model provider (`createOllamaProvider`) |
110
- | `botinabox/slack` | Slack channel adapter (`SlackAdapter`) |
111
- | `botinabox/discord` | Discord channel adapter (`DiscordAdapter`) |
112
- | `botinabox/webhook` | Webhook channel adapter with HMAC verification (`WebhookAdapter`) |
113
- | `botinabox/google` | Google connectors -- Gmail and Calendar via OAuth2 |
114
-
115
- ## Architecture
116
-
117
- ```
118
- +-------------------------------------+
119
- | Channel Adapters |
120
- | Slack . Discord . Webhook |
121
- +--------------+-----------------------+
122
- | InboundMessage
123
- +--------------v-----------------------+
124
- | Message Pipeline |
125
- | routing . policies . sessions |
126
- +--------------+-----------------------+
127
- | Task
128
- +--------------v-----------------------+
129
- | Task Queue |
130
- | priority . retry . followup chains |
131
- +--------------+-----------------------+
132
- |
133
- +--------------v-----------------------+
134
- | Run Manager |
135
- | locking . retries . cost tracking |
136
- +--------------+-----------------------+
137
- |
138
- +--------------------+--------------------+
139
- v v v
140
- +------------------+ +------------------+ +------------------+
141
- | CLI Adapter | | API Adapter | | Deterministic |
142
- | (subprocess) | | (LLM + tools) | | (no LLM) |
143
- +------------------+ +--------+----------+ +------------------+
144
- |
145
- +--------------v-----------------------+
146
- | LLM Layer |
147
- | ProviderRegistry . ModelRouter |
148
- | BudgetController . Tool Loop |
149
- +--------------+-----------------------+
150
- |
151
- +--------------------+-------------------+
152
- v v v
153
- +---------------+ +---------------+ +---------------+
154
- | Anthropic | | OpenAI | | Ollama |
155
- +---------------+ +---------------+ +---------------+
156
- ```
157
-
158
- Cross-cutting concerns -- **HookBus** (events), **DataStore** (persistence), **Security** (sanitization + audit) -- connect all layers.
159
-
160
- ## Core Concepts
161
-
162
- **HookBus** is the central event bus. Handlers subscribe to named events with optional priority ordering and payload filters. Errors in one handler never block others. Use it to decouple layers -- the task queue emits `task.created`, the run manager emits `run.completed`, channels emit `message.inbound`, and your application code listens to whichever events it needs.
163
-
164
- **DataStore** wraps [latticesql](https://github.com/automated-industries/lattice) to provide schema-driven SQLite persistence. You call `db.define()` to register table schemas, then `db.init()` to create them. It supports insert, update, upsert, get, query, delete, and migrations. WAL mode is enabled by default for concurrent read access.
165
-
166
- **AgentRegistry** manages the lifecycle of agents -- registration, status transitions (idle/running/paused/terminated), configuration revisions, and activity logging. Each agent has a slug, name, adapter type, role, and optional budget. Agents are stored in the database and can be seeded from config on startup.
167
-
168
- **TaskQueue** is a priority-ordered work queue backed by SQLite. Tasks have a title, description, assignee, priority (1-10), and support retry policies and followup chains. Chain depth is enforced to prevent infinite recursion. The queue emits `task.created` on the HookBus and supports polling for stale tasks.
169
-
170
- **RunManager** handles task execution lifecycle. It acquires a per-agent lock, creates a run record, delegates to an execution adapter (API or CLI), and records the result including exit code, cost, and token usage. Failed runs trigger retry logic with exponential backoff.
171
-
172
- **ChannelRegistry** manages channel adapter connections. Register adapters (Slack, Discord, webhook) with their config, then call `start()` to connect them all. Supports hot reconfiguration, health checks, and graceful shutdown.
173
-
174
- **MessagePipeline** routes inbound messages from channels to the task queue. It resolves the sender to a user identity, picks the right agent based on channel bindings, applies policy checks (allowlists, mention gates), and creates a task for the assigned agent.
175
-
176
- **Scheduler** provides database-backed job scheduling with cron expressions. Register recurring or one-time schedules that emit hook events when they fire. The scheduler polls for due jobs and emits the schedule's `action` as a hook event with its configured payload.
177
-
178
- ## Documentation
179
-
180
- - [Getting Started](docs/getting-started.md) -- Installation, project setup, first bot
181
- - [Configuration](docs/configuration.md) -- Full config reference
182
- - [Architecture](docs/architecture.md) -- System design and patterns
183
- - [Providers](docs/providers.md) -- LLM provider setup and custom providers
184
- - [Channels](docs/channels.md) -- Channel adapter setup and custom adapters
185
- - [Orchestration](docs/orchestration.md) -- Agents, tasks, workflows, and budget controls
186
- - [API Reference](docs/api-reference.md) -- Complete API documentation
187
-
188
- ## License
189
-
190
- MIT
1
+ # Bot in a Box
2
+
3
+ A modular TypeScript framework for building multi-agent bots with LLM orchestration, multi-channel messaging, and task automation.
4
+
5
+ ## Features
6
+
7
+ - **Execution engine** -- Generic task executor with 22 built-in tools and a tool loop (up to 5 iterations). Agents can read files, send documents, dispatch tasks, search conversations, and more. Apps register tools declaratively.
8
+ - **22 built-in tools** -- File ops (send, read, list, register), task ops (dispatch, cancel, reassign), system status (task, agent, system, active tasks), entity lookup (agents, projects, agent detail), messaging (send message, task comment, read/search conversation), management (create agent, create project). All channel-agnostic.
9
+ - **Chat pipeline** -- Configurable 6-layer chat orchestration: dedup, storage, fast ack (<2s via Haiku), async interpretation, task dispatch, and completion response. Apps provide system prompt and routing rules; framework handles everything else.
10
+ - **Slack integration** -- `SlackBoltAdapter` handles Bolt Socket Mode, message parsing, response delivery, and file uploads. One import, one `start()` call.
11
+ - **Unified config** -- All settings in one `botinabox.config.yml`: models, execution, chat, routing, safety, budget. YAML with env var interpolation. Auto-initializes with sensible defaults.
12
+ - **Message store** -- Store-before-respond guarantee. Inbound messages and attachments stored before any bot response. Channel history for conversation context.
13
+ - **Message interpretation** -- Async structured extraction from messages into tasks, memories, files, and user context. Pluggable extractors for custom data types. Programmatic task creation (no LLM dependency).
14
+ - **Triage routing** -- Content-aware message routing with keyword/regex matching, priority rules, and LLM fallback. Ownership chain logging for every routing decision.
15
+ - **Multi-agent orchestration** -- Define agents with different models, roles, and execution adapters. Task queue with priority scheduling, retry policies, and followup chains.
16
+ - **Loop detection and circuit breakers** -- Pattern-based loop detection (self-loops, ping-pong, blocked re-entry) plus circuit breakers with automatic human escalation.
17
+ - **Learning pipeline** -- Structured feedback capture with auto-promotion: 3+ similar records become a playbook, 3+ agents become a reusable skill.
18
+ - **Governance gates** -- Independent QA, quality, and drift gates that validate agent output and report to the human operator.
19
+ - **Permission relay** -- Remote approval via messaging platforms (Slack, Discord, Telegram). Dual approval: local + remote, first wins.
20
+ - **LLM provider abstraction** -- Swap between Anthropic, OpenAI, and Ollama. Model aliasing, purpose-based routing, fallback chains. Default LLM call wrapper included.
21
+ - **Channel adapters** -- Slack (Bolt Socket Mode), Discord, and webhooks. Auto-discovery, session management, notification queuing.
22
+ - **Workflow engine** -- Multi-step workflows with dependency resolution, parallel execution, and conditional branching.
23
+ - **SQLite data layer** -- 27 core tables, migrations, entity context rendering via [latticesql](https://github.com/automated-industries/lattice). WAL mode.
24
+ - **Event-driven hooks** -- Priority-ordered, filter-based event bus for decoupled communication.
25
+ - **Budget controls** -- Per-agent and global cost tracking with warning thresholds and hard stops.
26
+ - **Scheduling** -- Database-backed cron and one-time schedules.
27
+ - **Connectors** -- Google Gmail and Calendar via OAuth2 and service account.
28
+ - **Security** -- Input sanitization, field length enforcement, audit logging, HMAC webhook verification.
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ npm install botinabox
34
+ ```
35
+
36
+ Install peer dependencies for the providers you need:
37
+
38
+ ```bash
39
+ # For Anthropic
40
+ npm install @anthropic-ai/sdk
41
+
42
+ # For OpenAI
43
+ npm install openai
44
+
45
+ # For Google connectors
46
+ npm install googleapis
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```typescript
52
+ import {
53
+ HookBus, DataStore, defineCoreTables, initConfig,
54
+ TaskQueue, RunManager, WakeupQueue, ChatPipeline,
55
+ registerExecutionEngine, createDefaultLLMCall,
56
+ sendFileTool, readFileTool, listAgentsTool, getTaskStatusTool,
57
+ } from 'botinabox';
58
+ import { SlackBoltAdapter } from 'botinabox/slack';
59
+ import Anthropic from '@anthropic-ai/sdk';
60
+
61
+ // 1. Config (auto-loads botinabox.config.yml or uses defaults)
62
+ initConfig({});
63
+ const hooks = new HookBus();
64
+ const db = new DataStore({ dbPath: './data/bot.db', wal: true, hooks });
65
+ defineCoreTables(db);
66
+ await db.init();
67
+
68
+ // 2. Orchestration
69
+ const tasks = new TaskQueue(db, hooks);
70
+ const runs = new RunManager(db, hooks);
71
+ const wakeups = new WakeupQueue(db);
72
+
73
+ // 3. Execution engine with built-in tools
74
+ const client = new Anthropic();
75
+ await registerExecutionEngine({
76
+ db, hooks, runs,
77
+ config: {
78
+ client,
79
+ tools: [sendFileTool, readFileTool, listAgentsTool, getTaskStatusTool],
80
+ },
81
+ });
82
+
83
+ // 4. Chat pipeline (6-layer: dedup → ack → interpret → dispatch → execute → respond)
84
+ const llmCall = createDefaultLLMCall(client);
85
+ const pipeline = new ChatPipeline(db, hooks, {
86
+ llmCall, tasks, wakeups,
87
+ systemPrompt: 'You are a helpful AI assistant.',
88
+ routingRules: [{ agentSlug: 'assistant', keywords: ['help'] }],
89
+ fallbackAgent: 'assistant',
90
+ });
91
+
92
+ // 5. Slack (one import, one start)
93
+ const slack = new SlackBoltAdapter({
94
+ botToken: process.env.SLACK_BOT_TOKEN!,
95
+ appToken: process.env.SLACK_APP_TOKEN!,
96
+ hooks, pipeline,
97
+ });
98
+ await slack.start();
99
+ tasks.startPolling();
100
+ ```
101
+
102
+ ## Subpath Exports
103
+
104
+ | Import path | Description |
105
+ |---|---|
106
+ | `botinabox` | Core framework -- HookBus, DataStore, ChatPipeline, ExecutionEngine, 22 built-in tools, config (loadConfig/getConfig), AgentRegistry, TaskQueue, RunManager, Scheduler, MessageStore, ChatResponder, MessageInterpreter, TriageRouter, createDefaultLLMCall, buildSystemContext, and all shared types |
107
+ | `botinabox/anthropic` | Anthropic Claude provider (`createAnthropicProvider`) |
108
+ | `botinabox/openai` | OpenAI GPT provider (`createOpenAIProvider`) |
109
+ | `botinabox/ollama` | Ollama local model provider (`createOllamaProvider`) |
110
+ | `botinabox/slack` | Slack channel adapter (`SlackAdapter`) |
111
+ | `botinabox/discord` | Discord channel adapter (`DiscordAdapter`) |
112
+ | `botinabox/webhook` | Webhook channel adapter with HMAC verification (`WebhookAdapter`) |
113
+ | `botinabox/google` | Google connectors -- Gmail and Calendar via OAuth2 |
114
+
115
+ ## Architecture
116
+
117
+ ```
118
+ +-------------------------------------+
119
+ | Channel Adapters |
120
+ | Slack . Discord . Webhook |
121
+ +--------------+-----------------------+
122
+ | InboundMessage
123
+ +--------------v-----------------------+
124
+ | Message Pipeline |
125
+ | routing . policies . sessions |
126
+ +--------------+-----------------------+
127
+ | Task
128
+ +--------------v-----------------------+
129
+ | Task Queue |
130
+ | priority . retry . followup chains |
131
+ +--------------+-----------------------+
132
+ |
133
+ +--------------v-----------------------+
134
+ | Run Manager |
135
+ | locking . retries . cost tracking |
136
+ +--------------+-----------------------+
137
+ |
138
+ +--------------------+--------------------+
139
+ v v v
140
+ +------------------+ +------------------+ +------------------+
141
+ | CLI Adapter | | API Adapter | | Deterministic |
142
+ | (subprocess) | | (LLM + tools) | | (no LLM) |
143
+ +------------------+ +--------+----------+ +------------------+
144
+ |
145
+ +--------------v-----------------------+
146
+ | LLM Layer |
147
+ | ProviderRegistry . ModelRouter |
148
+ | BudgetController . Tool Loop |
149
+ +--------------+-----------------------+
150
+ |
151
+ +--------------------+-------------------+
152
+ v v v
153
+ +---------------+ +---------------+ +---------------+
154
+ | Anthropic | | OpenAI | | Ollama |
155
+ +---------------+ +---------------+ +---------------+
156
+ ```
157
+
158
+ Cross-cutting concerns -- **HookBus** (events), **DataStore** (persistence), **Security** (sanitization + audit) -- connect all layers.
159
+
160
+ ## Core Concepts
161
+
162
+ **HookBus** is the central event bus. Handlers subscribe to named events with optional priority ordering and payload filters. Errors in one handler never block others. Use it to decouple layers -- the task queue emits `task.created`, the run manager emits `run.completed`, channels emit `message.inbound`, and your application code listens to whichever events it needs.
163
+
164
+ **DataStore** wraps [latticesql](https://github.com/automated-industries/lattice) to provide schema-driven SQLite persistence. You call `db.define()` to register table schemas, then `db.init()` to create them. It supports insert, update, upsert, get, query, delete, and migrations. WAL mode is enabled by default for concurrent read access.
165
+
166
+ **AgentRegistry** manages the lifecycle of agents -- registration, status transitions (idle/running/paused/terminated), configuration revisions, and activity logging. Each agent has a slug, name, adapter type, role, and optional budget. Agents are stored in the database and can be seeded from config on startup.
167
+
168
+ **TaskQueue** is a priority-ordered work queue backed by SQLite. Tasks have a title, description, assignee, priority (1-10), and support retry policies and followup chains. Chain depth is enforced to prevent infinite recursion. The queue emits `task.created` on the HookBus and supports polling for stale tasks.
169
+
170
+ **RunManager** handles task execution lifecycle. It acquires a per-agent lock, creates a run record, delegates to an execution adapter (API or CLI), and records the result including exit code, cost, and token usage. Failed runs trigger retry logic with exponential backoff.
171
+
172
+ **ChannelRegistry** manages channel adapter connections. Register adapters (Slack, Discord, webhook) with their config, then call `start()` to connect them all. Supports hot reconfiguration, health checks, and graceful shutdown.
173
+
174
+ **MessagePipeline** routes inbound messages from channels to the task queue. It resolves the sender to a user identity, picks the right agent based on channel bindings, applies policy checks (allowlists, mention gates), and creates a task for the assigned agent.
175
+
176
+ **Scheduler** provides database-backed job scheduling with cron expressions. Register recurring or one-time schedules that emit hook events when they fire. The scheduler polls for due jobs and emits the schedule's `action` as a hook event with its configured payload.
177
+
178
+ ## Documentation
179
+
180
+ - [Getting Started](docs/getting-started.md) -- Installation, project setup, first bot
181
+ - [Configuration](docs/configuration.md) -- Full config reference
182
+ - [Architecture](docs/architecture.md) -- System design and patterns
183
+ - [Providers](docs/providers.md) -- LLM provider setup and custom providers
184
+ - [Channels](docs/channels.md) -- Channel adapter setup and custom adapters
185
+ - [Orchestration](docs/orchestration.md) -- Agents, tasks, workflows, and budget controls
186
+ - [API Reference](docs/api-reference.md) -- Complete API documentation
187
+
188
+ ## License
189
+
190
+ MIT
package/bin/botinabox.mjs CHANGED
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- import('../dist/cli.js').then(m => m.main(process.argv.slice(2)));
1
+ #!/usr/bin/env node
2
+ import('../dist/cli.js').then(m => m.main(process.argv.slice(2)));
@@ -1,5 +1,5 @@
1
1
  import { C as ChannelAdapter, c as ChannelMeta, a as ChannelCapabilities, I as InboundMessage, b as ChannelConfig, H as HealthStatus, O as OutboundPayload, S as SendResult } from '../../channel-06G0vbIn.js';
2
- import { H as HookBus, c as ChatPipeline } from '../../chat-pipeline-BWrtVqEP.js';
2
+ import { H as HookBus, c as ChatPipeline } from '../../chat-pipeline-DuNX5WoL.js';
3
3
  import 'better-sqlite3';
4
4
  import '../../provider-DLGUfnNx.js';
5
5
 
@@ -584,6 +584,8 @@ interface ChatPipelineConfig {
584
584
  model?: string;
585
585
  /** Enable LLM fallback routing (default: false) */
586
586
  llmRouting?: boolean;
587
+ /** Skip the ack layer — no fast response before task dispatch (default: false) */
588
+ skipAck?: boolean;
587
589
  /** TaskQueue instance — required for task dispatch */
588
590
  tasks: {
589
591
  create(task: Record<string, unknown>): Promise<string>;
@@ -608,6 +610,7 @@ declare class ChatPipeline {
608
610
  private readonly dedupWindowMs;
609
611
  private readonly tasks;
610
612
  private readonly wakeups;
613
+ private readonly skipAck;
611
614
  private readonly threadChannelMap;
612
615
  /** Last dispatch promise — exposed for testing. */
613
616
  lastDispatch: Promise<void>;
package/dist/cli.js CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -4,8 +4,8 @@ import { T as TokenUsage, L as LLMProvider, M as ModelInfo, R as ResolvedModel,
4
4
  export { a as ChatParams, b as ChatResult, c as ContentBlock, d as ToolUse } from './provider-DLGUfnNx.js';
5
5
  import { C as ConnectorConfig } from './connector-B4Mj0P1b.js';
6
6
  export { A as AuthResult, a as Connector, b as ConnectorMeta, P as PushResult, S as SyncOptions, c as SyncResult } from './connector-B4Mj0P1b.js';
7
- import { C as ChatResponderConfig, D as DataStore, H as HookBus, M as MessageStore, a as ChatResponder, b as MessageInterpreter, E as Extractor } from './chat-pipeline-BWrtVqEP.js';
8
- export { c as ChatPipeline, d as ChatPipelineConfig, e as DataStoreError, f as EntityContextDef, g as EntityFileSpec, h as EntitySource, i as ExtractedFile, j as ExtractedMemory, k as ExtractedTask, l as ExtractedUserContext, F as Filter, m as HookHandler, n as HookOptions, o as HookRegistration, I as InterpretationResult, L as LLMCallFn, p as MessageInterpreterConfig, P as PkLookup, Q as QueryOptions, R as RelationDef, q as RoutingDecision, r as RoutingRule, s as Row, S as SeedItem, t as SqliteAdapter, u as StoreResult, v as StoredAttachment, T as TableDefinition, w as TableInfoRow, x as TriageRouter, y as TriageRouterConfig, U as Unsubscribe } from './chat-pipeline-BWrtVqEP.js';
7
+ import { C as ChatResponderConfig, D as DataStore, H as HookBus, M as MessageStore, a as ChatResponder, b as MessageInterpreter, E as Extractor } from './chat-pipeline-DuNX5WoL.js';
8
+ export { c as ChatPipeline, d as ChatPipelineConfig, e as DataStoreError, f as EntityContextDef, g as EntityFileSpec, h as EntitySource, i as ExtractedFile, j as ExtractedMemory, k as ExtractedTask, l as ExtractedUserContext, F as Filter, m as HookHandler, n as HookOptions, o as HookRegistration, I as InterpretationResult, L as LLMCallFn, p as MessageInterpreterConfig, P as PkLookup, Q as QueryOptions, R as RelationDef, q as RoutingDecision, r as RoutingRule, s as Row, S as SeedItem, t as SqliteAdapter, u as StoreResult, v as StoredAttachment, T as TableDefinition, w as TableInfoRow, x as TriageRouter, y as TriageRouterConfig, U as Unsubscribe } from './chat-pipeline-DuNX5WoL.js';
9
9
  import 'better-sqlite3';
10
10
 
11
11
  /** Execution adapter types — Story 1.5 / 3.4 / 3.5 */
@@ -1244,6 +1244,12 @@ interface DomainEntityContextOptions {
1244
1244
  files?: boolean;
1245
1245
  channels?: boolean;
1246
1246
  rules?: boolean;
1247
+ /** Column used as directory name for each entity type. Default: 'id'. */
1248
+ orgSlugColumn?: string;
1249
+ projectSlugColumn?: string;
1250
+ clientSlugColumn?: string;
1251
+ fileSlugColumn?: string;
1252
+ channelSlugColumn?: string;
1247
1253
  }
1248
1254
  /**
1249
1255
  * Define entity context rendering for standard domain tables.
@@ -1785,6 +1791,7 @@ declare class LoopDetector {
1785
1791
 
1786
1792
  interface FeedbackEntry {
1787
1793
  agentId: string;
1794
+ userId?: string;
1788
1795
  taskId?: string;
1789
1796
  issue: string;
1790
1797
  rootCause?: string;
@@ -1799,6 +1806,7 @@ interface PlaybookEntry {
1799
1806
  rule: string;
1800
1807
  feedbackIds: string[];
1801
1808
  projectScoped: boolean;
1809
+ clientId?: string;
1802
1810
  agentIds?: string[];
1803
1811
  }
1804
1812
  interface SkillEntry {
@@ -1833,6 +1841,7 @@ declare class LearningPipeline {
1833
1841
  */
1834
1842
  listFeedback(filter?: {
1835
1843
  agentId?: string;
1844
+ userId?: string;
1836
1845
  severity?: string;
1837
1846
  repeatable?: boolean;
1838
1847
  }): Promise<Array<Record<string, unknown>>>;