botinabox 2.13.1 → 2.15.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.
package/README.md CHANGED
@@ -160,7 +160,7 @@ Cross-cutting concerns -- **HookBus** (events), **DataStore** (persistence), **S
160
160
 
161
161
  ## Core Concepts
162
162
 
163
- **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
+ **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 Slack additionally emits `slack.message.changed` / `slack.message.deleted` when users edit or delete messages), and your application code listens to whichever events it needs.
164
164
 
165
165
  **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, reward (usefulness-weighted render ordering, opt-in via `rewardTracking`), and migrations. WAL mode is enabled by default for concurrent read access.
166
166
 
@@ -150,6 +150,33 @@ var SlackBoltAdapter = class {
150
150
  boltApp.event("message", async ({ event }) => {
151
151
  if (event.bot_id || event.app_id) return;
152
152
  const subtype = event.subtype;
153
+ if (subtype === "message_changed") {
154
+ const message = event.message;
155
+ const previousMessage = event.previous_message;
156
+ const ts = message?.ts ?? previousMessage?.ts;
157
+ if (!ts) return;
158
+ await hooks.emit("slack.message.changed", {
159
+ channel: event.channel,
160
+ ts,
161
+ newBody: message?.text ?? "",
162
+ previousBody: previousMessage?.text ?? "",
163
+ editorUser: message?.user ?? null,
164
+ raw: event
165
+ });
166
+ return;
167
+ }
168
+ if (subtype === "message_deleted") {
169
+ const previousMessage = event.previous_message;
170
+ const ts = event.deleted_ts ?? previousMessage?.ts;
171
+ if (!ts) return;
172
+ await hooks.emit("slack.message.deleted", {
173
+ channel: event.channel,
174
+ ts,
175
+ previousBody: previousMessage?.text ?? "",
176
+ raw: event
177
+ });
178
+ return;
179
+ }
153
180
  if (subtype && subtype !== "file_share") return;
154
181
  let inbound = parseSlackEvent(event);
155
182
  inbound = { ...inbound, channel: "slack", account: event.channel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botinabox",
3
- "version": "2.13.1",
3
+ "version": "2.15.0",
4
4
  "description": "Bot in a Box — framework for building multi-agent bots",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -60,7 +60,7 @@
60
60
  "@types/uuid": "^10.0.0",
61
61
  "ajv": "^8.17.1",
62
62
  "cron-parser": "^4.9.0",
63
- "latticesql": "^1.11.0",
63
+ "latticesql": "^1.13.0",
64
64
  "uuid": "^13.0.0",
65
65
  "yaml": "^2.7.0"
66
66
  },