@awebai/claude-channel 1.4.12 → 1.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aweb-channel",
3
3
  "description": "aweb agent coordination channel: receive mail, chat, tasks, and control signals from your agent team in real time.",
4
- "version": "1.4.12",
4
+ "version": "1.5.0",
5
5
  "author": {
6
6
  "name": "awebai"
7
7
  },
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 1.5.0
4
+
5
+ - Adds the `app_event` consumer from channel-core 45d414d2: Claude Code sessions can wake on app-emitted events such as `folio/doc.changed` when delivery intent is `wake`.
package/dist/index.js CHANGED
@@ -22501,6 +22501,7 @@ var KNOWN_TYPES = /* @__PURE__ */ new Set([
22501
22501
  "work_available",
22502
22502
  "claim_update",
22503
22503
  "claim_removed",
22504
+ "app_event",
22504
22505
  "error",
22505
22506
  "actionable_mail",
22506
22507
  "actionable_chat"
@@ -26895,10 +26896,42 @@ async function dispatchAgentEvent(options, dispatched, event) {
26895
26896
  }
26896
26897
  });
26897
26898
  break;
26899
+ case "app_event":
26900
+ await dispatchAppEvent(options, dispatched, event);
26901
+ break;
26898
26902
  default:
26899
26903
  break;
26900
26904
  }
26901
26905
  }
26906
+ async function dispatchAppEvent(options, dispatched, event) {
26907
+ if (!event.event_id)
26908
+ return;
26909
+ const key = dispatchKey("app", event.app_event_type || "app_event", event.event_id);
26910
+ if (dispatched.has(key) || options.deliveryStore?.has(key))
26911
+ return;
26912
+ const meta3 = {
26913
+ type: event.app_event_type || "app_event",
26914
+ event_id: event.event_id,
26915
+ app_id: event.app_id || "",
26916
+ app_event_type: event.app_event_type || "",
26917
+ resource_ref: event.resource_ref || "",
26918
+ producer_delivery_intent: event.producer_delivery_intent || ""
26919
+ };
26920
+ const payload = event.payload && typeof event.payload === "object" ? event.payload : void 0;
26921
+ if (payload)
26922
+ meta3.payload = summarizePayload(payload);
26923
+ await options.onAwakening({
26924
+ kind: "app",
26925
+ content: "",
26926
+ deliveryIntent: event.delivery_intent || "ambient",
26927
+ meta: meta3
26928
+ });
26929
+ dispatched.add(key);
26930
+ if (options.deliveryStore) {
26931
+ options.deliveryStore.mark(key);
26932
+ await options.deliveryStore.save();
26933
+ }
26934
+ }
26902
26935
  async function dispatchMailEvent(options, dispatched, event) {
26903
26936
  const messages = await fetchInbox(options.client, true, MAIL_FETCH_LIMIT, event.message_id);
26904
26937
  let pinsDirty = false;
@@ -27092,6 +27125,12 @@ function dispatchKey(channel, conversationID, messageID) {
27092
27125
  const conversation = (conversationID || "").trim();
27093
27126
  return `${channel}:${conversation}:${messageID}`;
27094
27127
  }
27128
+ function summarizePayload(payload) {
27129
+ const json3 = JSON.stringify(payload);
27130
+ if (!json3)
27131
+ return "";
27132
+ return json3.length > 500 ? `${json3.slice(0, 497)}...` : json3;
27133
+ }
27095
27134
  function senderDisplayAddress(alias, address) {
27096
27135
  const qualified = (address || "").trim();
27097
27136
  if (qualified)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/claude-channel",
3
- "version": "1.4.12",
3
+ "version": "1.5.0",
4
4
  "mcpName": "io.github.awebai/channel",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,6 +12,7 @@
12
12
  ".mcp.json",
13
13
  "skills",
14
14
  "README.md",
15
+ "CHANGELOG.md",
15
16
  "package.json"
16
17
  ],
17
18
  "scripts": {