@lansenger-pm/openclaw-lansenger-channel 2.0.4 → 2.0.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": "@lansenger-pm/openclaw-lansenger-channel",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lansenger-messaging
3
- version: 2.0.0
3
+ version: 2.0.5
4
4
  category: communication
5
5
  description: How to communicate effectively on Lansenger (蓝信) — message types, formatting rules, media, cards, approvals, and pitfalls
6
6
  trigger: When the current session channel is lansenger, or when you need to send a message, file, image, card, or approval via Lansenger
@@ -123,30 +123,40 @@ openclaw pairing approve lansenger <code>
123
123
 
124
124
  This is the correct model for personal bots — they only receive DMs from approved users.
125
125
 
126
- ## Sending Files to Users
126
+ ## Sending Files to Users (CRITICAL)
127
127
 
128
- When you create a file (via `write` tool, code generation, data export, etc.) that you want the user to receive on Lansenger, **you MUST send it explicitly** — writing to the workspace alone does NOT deliver the file to the user.
128
+ When you create or reference a file that the user should receive on Lansenger, **you MUST send it explicitly via `sendAttachment`** — writing or reading a file alone does NOT deliver it to the user.
129
129
 
130
- Use the `sendAttachment` action:
130
+ ### Use `sendAttachment` action
131
131
 
132
132
  ```
133
133
  Action: sendAttachment
134
134
  Parameters:
135
- to: <Lansenger user ID or chat ID>
136
- filePath: <absolute path to the file on disk>
135
+ to: <Lansenger user ID or chat ID> (required)
136
+ filePath: <absolute path to the file> (required)
137
137
  caption: <optional plain-text caption — NO Markdown>
138
138
  ```
139
139
 
140
- Example flow:
140
+ ### ⚠️ Files MUST be in the workspace directory
141
+
142
+ `sendAttachment` and `MEDIA:` tags only work for files inside `~/.openclaw/workspace/`. Files outside the workspace (e.g. `~/Documents/`, `~/Desktop/`, `/tmp/`) are **silently dropped** — the user will never receive them.
143
+
144
+ **If the source file is outside the workspace**, you MUST copy it first:
145
+ 1. Use the `bash` tool to copy: `cp /path/to/source/file ~/.openclaw/workspace/file`
146
+ 2. Then use `sendAttachment` with the workspace path: `filePath: ~/.openclaw/workspace/file`
147
+
148
+ ### Typical flow
149
+
141
150
  1. `write` tool → creates file in workspace (e.g. `~/.openclaw/workspace/report.md`)
142
- 2. `sendAttachment` action → sends the file to the user on Lansenger
151
+ 2. `sendAttachment` action → delivers file to the user on Lansenger
152
+
153
+ ### Rules
143
154
 
144
- **Rules:**
145
155
  - Always use absolute paths for `filePath`
146
- - Files MUST be in the workspace directory (`~/.openclaw/workspace/`) — if the source file is elsewhere (e.g. `~/Documents/`), copy it to workspace first using the `bash` tool, then `sendAttachment` the workspace copy
147
156
  - `caption` is plain text only (Markdown will NOT render in attachment messages)
148
157
  - If you need both formatted explanation AND a file attachment, send the formatted text first (Markdown works), then `sendAttachment` separately for the file
149
- - `MEDIA:` tags in reply text also work for workspace files, but `sendAttachment` is more reliable for explicit file delivery
158
+ - **NEVER use `MEDIA:` tags for files outside the workspace** they are silently dropped without any error
159
+ - For workspace files, `sendAttachment` is more reliable than `MEDIA:` tags
150
160
  - Supported file types: images (.jpg/.png/.gif/.webp), videos (.mp4/.mov), documents (.pdf/.md/.txt/.zip), etc.
151
161
 
152
162
  ## Critical Pitfalls