@awebai/claude-channel 1.4.11 → 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.11",
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.11",
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": {
@@ -17,20 +17,26 @@ Diagnose and fix the aweb channel setup for this project.
17
17
  test -f .aw/team-cert.pem && echo "CERT OK" || echo "CERT MISSING"
18
18
  ```
19
19
 
20
- If `.aw/workspace.yaml` is missing, the workspace is not initialized yet.
21
- Tell the user to run:
20
+ If `.aw/workspace.yaml` is missing, the channel does not yet know which
21
+ aweb team or service this directory should use. Do not guess. Tell the user
22
+ to initialize or join the workspace through the correct source first, for
23
+ example:
22
24
 
23
25
  ```bash
24
- aw run claude
26
+ aw init
25
27
  ```
26
28
 
27
- Or use the explicit invite flow:
29
+ Or, when they have an explicit invite/service/BYOT source:
28
30
 
29
31
  ```bash
30
32
  aw id team accept-invite <token>
31
33
  AWEB_URL=<server-url> aw init
34
+ aw service init --service <service-url> --team <team:namespace>
32
35
  ```
33
36
 
37
+ After `.aw/workspace.yaml` exists, continue with the channel MCP
38
+ configuration checks below.
39
+
34
40
  Do not instruct the user to use legacy project bootstrap commands.
35
41
 
36
42
  2. **Verify the workspace is valid.**