@clwnt/clawnet 0.7.3 → 0.7.5

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.3",
3
+ "version": "0.7.5",
4
4
  "type": "module",
5
5
  "description": "ClawNet integration for OpenClaw — poll inbox, route messages to hooks",
6
6
  "files": [
@@ -1,11 +1,19 @@
1
1
  # ClawNet Inbox Notification
2
2
 
3
- New messages were delivered above. Output ONLY the following — no commentary, no tables, no analysis:
3
+ New messages were delivered above. Do two things:
4
4
 
5
- You have N new email(s):
6
- - sender — subject
7
- - sender — subject
5
+ ## 1. Apply rules
8
6
 
9
- Type /inbox to manage your email.
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.
10
8
 
11
- Replace N with the count. Use the `from_agent` and `subject` fields from the messages above. Then mark each as `read` via `clawnet_email_status`. Say nothing else.
9
+ ## 2. Notify
10
+
11
+ After applying rules, output ONLY this — no tables, no analysis, no message content:
12
+
13
+ 📬 You have N new email(s). Type /inbox to manage your email.
14
+
15
+ Replace N with the count of messages that did NOT match any rule. If all messages were handled by rules, say:
16
+
17
+ 📬 N new email(s) handled by your rules. Type /inbox to review.
18
+
19
+ Say nothing else.
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.3"; // Reported to server via PATCH /me every 6h
75
+ export const PLUGIN_VERSION = "0.7.5"; // Reported to server via PATCH /me every 6h
76
76
 
77
77
  // --- Service ---
78
78
 
@@ -579,9 +579,14 @@ export function createClawnetService(params: { api: any; cfg: ClawnetConfig }) {
579
579
  // Update the plugin skill from the downloaded inbox-handler.md
580
580
  try {
581
581
  const { readFile } = await import("node:fs/promises");
582
+ const { fileURLToPath } = await import("node:url");
583
+ const { dirname } = await import("node:path");
582
584
  const handlerContent = await readFile(join(docsDir, "inbox-handler.md"), "utf-8");
583
585
  if (handlerContent) {
584
- const skillDir = join(homedir(), ".openclaw", "plugins", "clawnet", "skills", "clawnet");
586
+ // Write to the plugin's own install directory so OpenClaw finds it
587
+ const thisFile = fileURLToPath(import.meta.url);
588
+ const pluginRoot = dirname(dirname(thisFile)); // src/service.ts -> src -> plugin root
589
+ const skillDir = join(pluginRoot, "skills", "clawnet");
585
590
  await mkdir(skillDir, { recursive: true });
586
591
  await writeFile(join(skillDir, "SKILL.md"), handlerContent, "utf-8");
587
592
  }