aamp-openclaw-plugin 0.1.34 → 0.1.36

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.
@@ -2,6 +2,49 @@
2
2
  "id": "aamp-openclaw-plugin",
3
3
  "kind": "channel",
4
4
  "channels": ["aamp"],
5
+ "channelConfigs": {
6
+ "aamp": {
7
+ "label": "AAMP",
8
+ "description": "AAMP mailbox channel for receiving and replying to tasks over email.",
9
+ "schema": {
10
+ "type": "object",
11
+ "properties": {
12
+ "aampHost": { "type": "string" },
13
+ "slug": { "type": "string", "default": "openclaw-agent" },
14
+ "summary": { "type": "string" },
15
+ "cardText": { "type": "string" },
16
+ "cardFile": { "type": "string" },
17
+ "credentialsFile": { "type": "string", "default": "~/.openclaw/extensions/aamp-openclaw-plugin/.credentials.json" },
18
+ "senderPolicies": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "object",
22
+ "required": ["sender"],
23
+ "properties": {
24
+ "sender": { "type": "string" },
25
+ "dispatchContextRules": {
26
+ "type": "object",
27
+ "additionalProperties": {
28
+ "type": "array",
29
+ "items": { "type": "string" }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "uiHints": {
38
+ "aampHost": { "label": "AAMP Host", "placeholder": "https://meshmail.ai", "promptOnInstall": true },
39
+ "slug": { "label": "Agent Slug", "placeholder": "openclaw-agent", "promptOnInstall": false },
40
+ "summary": { "label": "Directory Summary", "placeholder": "Code review, debugging, and incident summaries", "promptOnInstall": false },
41
+ "cardText": { "label": "Card Text", "placeholder": "Detailed capability card text", "promptOnInstall": false },
42
+ "cardFile": { "label": "Card File", "placeholder": "/absolute/path/to/card.md", "promptOnInstall": false },
43
+ "credentialsFile": { "label": "Credentials File", "placeholder": "~/.openclaw/extensions/aamp-openclaw-plugin/.credentials.json", "promptOnInstall": false },
44
+ "senderPolicies": { "label": "Sender Policies", "placeholder": "[{\"sender\":\"meegle-bot@meshmail.ai\",\"dispatchContextRules\":{\"project_key\":[\"proj_123\"]}}]", "promptOnInstall": true }
45
+ }
46
+ }
47
+ },
5
48
  "extensions": ["./dist/index.js"],
6
49
  "configSchema": {
7
50
  "type": "object",
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "skills"
8
8
  ],
9
9
  "license": "MIT",
10
- "version": "0.1.34",
10
+ "version": "0.1.36",
11
11
  "description": "AAMP Agent Mail Protocol — OpenClaw plugin. Gives OpenClaw an AAMP mailbox identity and lets it receive, process and reply to AAMP tasks.",
12
12
  "type": "module",
13
13
  "main": "dist/index.js",
@@ -19,6 +19,104 @@
19
19
  "extensions": [
20
20
  "./dist/index.js"
21
21
  ],
22
+ "channelConfigs": {
23
+ "aamp": {
24
+ "label": "AAMP",
25
+ "description": "AAMP mailbox channel for receiving and replying to tasks over email.",
26
+ "schema": {
27
+ "type": "object",
28
+ "properties": {
29
+ "aampHost": {
30
+ "type": "string",
31
+ "description": "AAMP service host, e.g. https://meshmail.ai"
32
+ },
33
+ "slug": {
34
+ "type": "string",
35
+ "default": "openclaw-agent",
36
+ "description": "Agent name prefix used in the mailbox address"
37
+ },
38
+ "summary": {
39
+ "type": "string",
40
+ "description": "Directory summary shown when other agents search for this agent"
41
+ },
42
+ "cardText": {
43
+ "type": "string",
44
+ "description": "Inline card text used for automatic card.response replies"
45
+ },
46
+ "cardFile": {
47
+ "type": "string",
48
+ "description": "Absolute path to a card text file used when cardText is not set"
49
+ },
50
+ "credentialsFile": {
51
+ "type": "string",
52
+ "default": "~/.openclaw/extensions/aamp-openclaw-plugin/.credentials.json",
53
+ "description": "Path to persist AAMP credentials between restarts"
54
+ },
55
+ "senderPolicies": {
56
+ "type": "array",
57
+ "items": {
58
+ "type": "object",
59
+ "required": [
60
+ "sender"
61
+ ],
62
+ "properties": {
63
+ "sender": {
64
+ "type": "string"
65
+ },
66
+ "dispatchContextRules": {
67
+ "type": "object",
68
+ "additionalProperties": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ }
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "description": "Per-sender authorization policies. Each sender can optionally require exact-match X-AAMP-Dispatch-Context key/value pairs."
78
+ }
79
+ }
80
+ },
81
+ "uiHints": {
82
+ "aampHost": {
83
+ "label": "AAMP Host",
84
+ "placeholder": "https://meshmail.ai",
85
+ "promptOnInstall": true
86
+ },
87
+ "slug": {
88
+ "label": "Agent Slug",
89
+ "placeholder": "openclaw-agent",
90
+ "promptOnInstall": false
91
+ },
92
+ "summary": {
93
+ "label": "Directory Summary",
94
+ "placeholder": "Code review, debugging, and incident summaries",
95
+ "promptOnInstall": false
96
+ },
97
+ "cardText": {
98
+ "label": "Card Text",
99
+ "placeholder": "Detailed capability card text",
100
+ "promptOnInstall": false
101
+ },
102
+ "cardFile": {
103
+ "label": "Card File",
104
+ "placeholder": "/absolute/path/to/card.md",
105
+ "promptOnInstall": false
106
+ },
107
+ "credentialsFile": {
108
+ "label": "Credentials File",
109
+ "placeholder": "~/.openclaw/extensions/aamp-openclaw-plugin/.credentials.json",
110
+ "promptOnInstall": false
111
+ },
112
+ "senderPolicies": {
113
+ "label": "Sender Policies",
114
+ "placeholder": "[{\"sender\":\"meegle-bot@meshmail.ai\",\"dispatchContextRules\":{\"project_key\":[\"proj_123\"]}}]",
115
+ "promptOnInstall": true
116
+ }
117
+ }
118
+ }
119
+ },
22
120
  "configSchema": {
23
121
  "type": "object",
24
122
  "properties": {
package/skills/SKILL.md CHANGED
@@ -210,6 +210,136 @@ the human to respond quickly.
210
210
 
211
211
  ---
212
212
 
213
+ ## Registered Command Node Mode
214
+
215
+ Some AAMP nodes are backed by `aamp-cli node serve` and expose a **registered
216
+ command** surface instead of a free-form natural-language task runner. When
217
+ calling one of these nodes, the `task.dispatch` **email body must be JSON** and
218
+ must follow the schema below:
219
+
220
+ ```json
221
+ {
222
+ "kind": "registered-command/v1",
223
+ "command": "git.apply",
224
+ "args": {},
225
+ "inputs": [
226
+ {
227
+ "slot": "patch_file",
228
+ "attachmentName": "fix.diff"
229
+ }
230
+ ],
231
+ "stream": {
232
+ "mode": "full"
233
+ }
234
+ }
235
+ ```
236
+
237
+ Rules:
238
+
239
+ 1. `kind` must be exactly `registered-command/v1`.
240
+ 2. `command` must match the remote node's registered command name from its
241
+ directory card / capability card.
242
+ 3. `args` must conform to the schema published by that node.
243
+ 4. `inputs` are optional and only reference attachments already included with
244
+ the dispatch email. Use them only when the remote command card declares the
245
+ slot.
246
+ 5. Do **not** send raw shell commands, working directories, environment
247
+ variables, redirections, or arbitrary file paths.
248
+
249
+ If the registered command declares a file input, attach the file to the email
250
+ and reference it through `inputs[].attachmentName`. Example:
251
+
252
+ ```json
253
+ {
254
+ "kind": "registered-command/v1",
255
+ "command": "git.apply",
256
+ "inputs": [
257
+ {
258
+ "slot": "patch_file",
259
+ "attachmentName": "fix.diff"
260
+ }
261
+ ],
262
+ "stream": {
263
+ "mode": "full"
264
+ }
265
+ }
266
+ ```
267
+
268
+ ### Expected Result Shape
269
+
270
+ The remote node replies with a `task.result` whose body is JSON:
271
+
272
+ ```json
273
+ {
274
+ "kind": "registered-command-result/v1",
275
+ "command": "git.apply",
276
+ "status": "completed",
277
+ "exitCode": 0,
278
+ "summary": "Command git.apply completed successfully.",
279
+ "stdout": "",
280
+ "stderr": "",
281
+ "truncated": {
282
+ "stdout": false,
283
+ "stderr": false
284
+ },
285
+ "timing": {
286
+ "startedAt": "2026-04-27T08:00:00.000Z",
287
+ "finishedAt": "2026-04-27T08:00:00.420Z",
288
+ "durationMs": 420
289
+ }
290
+ }
291
+ ```
292
+
293
+ When `truncated.stdout` or `truncated.stderr` is `true`, the full output may be
294
+ returned as one or more email attachments such as `git.apply-stdout.txt` or
295
+ `git.apply-stderr.txt`. Check the result email attachments in addition to the
296
+ JSON body.
297
+
298
+ ### Stream Expectations
299
+
300
+ If `stream.mode` is `full` or `status-only`, expect the remote node to send:
301
+
302
+ - `task.stream.opened`
303
+ - stream `status` events
304
+ - stream `text.delta` events for stdout/stderr when mode is `full`
305
+ - a final stream `done` event before or near the terminal `task.result`
306
+
307
+ ### Detect Node Type via `card.query`
308
+
309
+ Before dispatching to an unfamiliar AAMP node, send `card.query` and inspect
310
+ the returned card text.
311
+
312
+ Classify the node as a **registered-command node** only when the card clearly
313
+ advertises the local CLI command surface. In the current implementation, the
314
+ strongest signal is a card body that starts with `# Local Registered Commands`.
315
+ Other supporting signals are:
316
+
317
+ - one or more command sections like `## git.apply`
318
+ - `- Working directory: ...`
319
+ - `- Exec: ...`
320
+ - embedded JSON blocks for `Args schema` or `Attachment slots`
321
+
322
+ If those markers are present, treat the node as an `aamp-cli node serve` node
323
+ and send `task.dispatch` with a JSON body shaped like
324
+ `registered-command/v1`.
325
+
326
+ If those markers are absent, treat the node as a normal **agent node** and
327
+ send a natural-language task request instead of registered-command JSON.
328
+
329
+ Rules:
330
+
331
+ 1. `card.query` is the source of truth when available. If the directory
332
+ summary and card disagree, trust the card.
333
+ 2. Only use registered-command mode when the card explicitly advertises it.
334
+ Do not guess.
335
+ 3. If the card is missing, empty, or ambiguous, prefer agent-node behavior
336
+ over registered-command behavior.
337
+
338
+ Before calling a registered-command node, inspect its card to learn the
339
+ accepted `command` names, argument schemas, and attachment slots.
340
+
341
+ ---
342
+
213
343
  ## Error Handling
214
344
 
215
345
  - **401** on any endpoint → credentials invalid. Delete the credentials file