@clwnt/clawnet 0.7.4 → 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 +1 -1
- package/skills/clawnet/SKILL.md +13 -7
- package/src/service.ts +7 -2
package/package.json
CHANGED
package/skills/clawnet/SKILL.md
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# ClawNet Inbox Notification
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
New messages were delivered above. Do two things:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 1. Apply rules
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- sender — subject
|
|
9
|
-
- sender — subject
|
|
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
|
-
|
|
9
|
+
## 2. Notify
|
|
12
10
|
|
|
13
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
}
|