@agentworkforce/sage 1.1.2 → 1.1.3

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/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA0C5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AA8tCF,wBAAgB,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,CA6gB5C"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AA0C5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAwB/C,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,KAAK,MAAM,GAAG;IACZ,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AA8tCF,wBAAgB,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,CAshB5C"}
package/dist/app.js CHANGED
@@ -1322,14 +1322,22 @@ export function createSageApp() {
1322
1322
  if (event.type === "message" && event.threadTs) {
1323
1323
  const isActive = await isActiveThread(c.env.THREADS, event.threadTs);
1324
1324
  if (!isActive) {
1325
- // Mark thread active on arrival — previously this was a catch-22: threads were only
1326
- // marked active after Sage posted a reply, but replies were dropped if thread wasn't active.
1327
- await markActiveThread(c.env.THREADS, event.threadTs, { workspaceId, channel: event.channel });
1325
+ console.log(`[sage] Dropping thread reply on inactive thread: threadTs=${event.threadTs}`);
1326
+ return c.json({ ok: true });
1328
1327
  }
1329
1328
  }
1330
1329
  if (!event.userId || (workspaceSlackBotUserId && event.userId === workspaceSlackBotUserId)) {
1331
1330
  return c.json({ ok: true });
1332
1331
  }
1332
+ if (event.type === "mention") {
1333
+ const mentionThreadTs = event.threadTs ?? event.ts;
1334
+ if (mentionThreadTs) {
1335
+ await markActiveThread(c.env.THREADS, mentionThreadTs, {
1336
+ workspaceId,
1337
+ channel: event.channel,
1338
+ });
1339
+ }
1340
+ }
1333
1341
  const rateLimitResult = await getRateLimiter(c.env).limit({ key: `${workspaceId}:${event.userId}` });
1334
1342
  if (!rateLimitResult.success) {
1335
1343
  const postResult = await slack.postMessageChunked(event.channel, "You're sending messages too quickly. Please wait a moment.", event.threadTs ?? event.ts, MAX_REPLY_CHARS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentworkforce/sage",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/AgentWorkforce/sage.git"