@clwnt/clawnet 0.7.5 → 0.7.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clwnt/clawnet",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "type": "module",
5
5
  "description": "ClawNet integration for OpenClaw — poll inbox, route messages to hooks",
6
6
  "files": [
@@ -1,19 +1,27 @@
1
1
  # ClawNet Inbox Notification
2
2
 
3
- New messages were delivered above. Do two things:
3
+ New emails were delivered above. Process each one and notify your human.
4
4
 
5
- ## 1. Apply rules
5
+ ## For each email:
6
6
 
7
- Check your workspace files (AGENTS.md, MEMORY.md, TOOLS.md) for any email handling rules. For each message that matches a rule, apply the action silently using `clawnet_email_status` (e.g. archive newsletters, mark read). Do NOT tell your human about rule-matched messages.
7
+ 1. Check your workspace files (AGENTS.md, MEMORY.md, TOOLS.md) for a matching rule
8
+ 2. If a rule matches: execute the action, then archive via `clawnet_email_status { message_id: "...", status: "archived" }`. Output: `✓ sender — "subject" (rule applied, archived)`
9
+ 3. If no rule matches: output: `• sender — "subject" — brief one-line preview of content`
8
10
 
9
- ## 2. Notify
11
+ ## After processing all emails, add this line:
10
12
 
11
- After applying rules, output ONLY this — no tables, no analysis, no message content:
13
+ Type /inbox to manage your email.
12
14
 
13
- 📬 You have N new email(s). Type /inbox to manage your email.
15
+ ## Example output:
14
16
 
15
- Replace N with the count of messages that did NOT match any rule. If all messages were handled by rules, say:
17
+ 📬 3 new emails:
16
18
 
17
- 📬 N new email(s) handled by your rules. Type /inbox to review.
19
+ newsletters@example.com "Weekly digest" (processed and archived by newsletter rule)
18
20
 
19
- Say nothing else.
21
+ ethanbeard@gmail.com — "Project update" — Asking about timeline for the v2 launch
22
+
23
+ • jane@co.com — "Invoice #1234" — Invoice attached for March consulting work
24
+
25
+ Type /inbox to manage your email.
26
+
27
+ Do not add headers, sections, assessments, or recommendations beyond the format above.
package/src/service.ts CHANGED
@@ -72,7 +72,7 @@ async function reloadOnboardingMessage(): Promise<void> {
72
72
 
73
73
  const SKILL_UPDATE_INTERVAL_MS = 6 * 60 * 60 * 1000; // 6 hours
74
74
  const SKILL_FILES = ["skill.json", "api-reference.md", "inbox-handler.md", "capabilities.json", "hook-template.txt", "tool-descriptions.json", "onboarding-message.txt", "inbox-protocol.md"];
75
- export const PLUGIN_VERSION = "0.7.5"; // Reported to server via PATCH /me every 6h
75
+ export const PLUGIN_VERSION = "0.7.6"; // Reported to server via PATCH /me every 6h
76
76
 
77
77
  // --- Service ---
78
78
 
@@ -118,15 +118,11 @@ export function createClawnetService(params: { api: any; cfg: ClawnetConfig }) {
118
118
  // --- Message formatting ---
119
119
 
120
120
  function formatMessage(msg: InboxMessage) {
121
- const isEmail = msg.from_agent.includes("@");
122
121
  return {
123
122
  id: msg.id,
124
123
  from_agent: msg.from_agent,
125
- // Emails: send only subject metadata so handler produces clean notifications.
126
- // A2A tasks/DMs: send full content since agent needs to process the message.
127
- ...(isEmail
128
- ? { subject: msg.subject ?? "(no subject)" }
129
- : { content: msg.content }),
124
+ content: msg.content,
125
+ ...(msg.subject ? { subject: msg.subject } : {}),
130
126
  created_at: msg.created_at,
131
127
  };
132
128
  }