dsh-aimail 0.1.12-rc.1 → 0.1.12

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  AIMail plugin for dsh (deepseek-harness). It gives a dsh agent a mailbox on
4
4
  AIMail: inbound email is delivered into the agent's session, and the agent
5
5
  can send mail, manage contacts, keep thread notes, and work on A2A boards
6
- through 13 plain tools.
6
+ through 15 plain tools.
7
7
 
8
8
  ## Install
9
9
 
@@ -24,11 +24,11 @@ dsh plugin --profile web remove dsh-aimail
24
24
 
25
25
  ## What it does
26
26
 
27
- **Tools** — the same 13 bare-name tools as every other adapter:
27
+ **Tools** — the same 15 bare-name tools as every other adapter:
28
28
  `send_mail`, `manage_contacts`, `contact_profile`, `set_contact_profile`,
29
29
  `email_summary`, `set_email_summary`, `search_mail`,
30
30
  `board_status`, `board_task_list`, `board_task_show`, `board_heartbeat`,
31
- `board_members`, `set_public_whoami`.
31
+ `board_members`, `board_roles`, `set_public_whoami`, `activate_address_code`.
32
32
  Identity comes from the session id resolved through `@aimail/mail`
33
33
  (`agentmail.json` is the sole identity source); unbound sessions fail loud.
34
34
 
@@ -47,7 +47,7 @@ workflow (reply-all semantics, tool selection, thread continuity).
47
47
 
48
48
  The same tool surface and inbound contract, bound to other agent platforms:
49
49
 
50
- - [openclaw-aimail](https://www.npmjs.com/package/openclaw-aimail) — AIMail plugin for OpenClaw — definePluginEntry: 13 tools, in-gateway HTTP route, register/status commands.
50
+ - [openclaw-aimail](https://www.npmjs.com/package/openclaw-aimail) — AIMail plugin for OpenClaw — definePluginEntry: 15 tools, in-gateway HTTP route, register/status commands.
51
51
  - [pi-aimail](https://www.npmjs.com/package/pi-aimail) — AIMail extension for pi (earendil-works/pi) — registerTool tools + local inbound listener bridged via sendUserMessage.
52
52
 
53
53
  ## Related repositories
package/cordis.patch.yml CHANGED
@@ -33,6 +33,6 @@
33
33
  config:
34
34
  port: 9099
35
35
 
36
- # AIMail tools (12 bare names, semantics from @aimail/mail-core)
36
+ # AIMail tools (15 bare names, semantics from @aimail/mail-core)
37
37
  - id: tool-mail
38
38
  name: 'dsh-aimail/tools'
package/lib/inbound.js CHANGED
@@ -85,7 +85,7 @@ export function apply(ctx, config = {}) {
85
85
  }
86
86
  // Inbound routing (Q3 — mirror Python bridge routing): the per-delivery
87
87
  // target is authoritative. The bridge injects X-AIMail-Email (legacy
88
- // X-Amail-Email fallback) on each single-delivery POST; payload.to is
88
+ // on each single-delivery POST; payload.to is
89
89
  // the FILTERED full list (external recipients first), so to[0] is often
90
90
  // an external address. Use the header when present; only iterate toRaw
91
91
  // when the header is absent (batch deliveries carry no such header).
package/lib/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The bundle patch (cordis.patch.yml) self-mounts three subpath entries:
5
5
  * dsh-aimail/mail-service → ctx.mail (config resolution binding)
6
- * dsh-aimail/tools → 13 AIMail bare tools
6
+ * dsh-aimail/tools → 15 AIMail bare tools
7
7
  * dsh-aimail/inbound → node:http inbound endpoint + delivery
8
8
  *
9
9
  * Installed via: dsh plugin --profile web add dsh-aimail
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The bundle patch (cordis.patch.yml) self-mounts three subpath entries:
5
5
  * dsh-aimail/mail-service → ctx.mail (config resolution binding)
6
- * dsh-aimail/tools → 13 AIMail bare tools
6
+ * dsh-aimail/tools → 15 AIMail bare tools
7
7
  * dsh-aimail/inbound → node:http inbound endpoint + delivery
8
8
  *
9
9
  * Installed via: dsh plugin --profile web add dsh-aimail
@@ -13,7 +13,7 @@
13
13
  * local extra update) — mirrors bind_agent's every-run semantics.
14
14
  *
15
15
  * ABI: stdout = one JSON line {ok,email,system_id,exists?,registered?,
16
- * config_path?,api_key?,error?,hint?}; logs → stderr; exit 0 = ok.
16
+ * config_path?,error?,hint?}; logs → stderr; exit 0 = ok.
17
17
  *
18
18
  * Usage (from the CLI platform registry):
19
19
  * node <dsh-aimail>/dist/register-cli.js [--system-id S] [--email E]
package/lib/tools.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  /**
2
- * dsh-aimail tools — registers the 13 AIMail bare tools for this profile.
2
+ * dsh-aimail tools — registers the 15 AIMail bare tools for this profile.
3
3
  *
4
4
  * Semantic text (names, descriptions, parameter descriptions) comes from
5
5
  * the shared MAIL_TOOLS registry in @aimail/mail-core (single source of
6
- * truth, parity-tested against amail_mcp_server.py). This adapter only:
6
+ * truth, parity-tested against the shared tool spec in
7
+ * pysdk/aimail_mcp_server.py). No MCP service is used by this TS adapter.
8
+ * This adapter only:
7
9
  * - iterates MAIL_TOOLS, translating each entry to a dsh defineTool
8
10
  * - binds execution: exec.agent.id (dsh session uuid) → ctx.mail.resolveCtx
9
11
  */
package/lib/tools.js CHANGED
@@ -30,6 +30,9 @@ function toDshParam(p) {
30
30
  }
31
31
  if (p.description !== undefined)
32
32
  base.description = p.description;
33
+ // 审计 2026-09-21: default 也要透传到宿主 schema(与 mail-core 的 TypeBox 转换同口径)
34
+ if (p.default !== undefined)
35
+ base.default = p.default;
33
36
  if (p.required === true)
34
37
  base.required = true;
35
38
  return base;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-aimail",
3
3
  "description": "AIMail plugin for dsh — install via: dsh plugin --profile web add dsh-aimail",
4
- "version": "0.1.12-rc.1",
4
+ "version": "0.1.12",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": true
@@ -51,8 +51,8 @@
51
51
  "@deepseek-ai/dsh-tools": "^0.0.1-rc.1"
52
52
  },
53
53
  "dependencies": {
54
- "@aimail/mail-core": "^0.1.12-rc.1",
55
- "@aimail/mail": "^0.1.12-rc.1"
54
+ "@aimail/mail-core": "^0.1.12",
55
+ "@aimail/mail": "^0.1.12"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@deepseek-ai/cordis": "^4.0.1",
@@ -18,7 +18,6 @@ Your AIMail address is **{{AGENTMAIL_ADDRESS}}**.
18
18
  - `board_roles(board_id, role?)` — view role permissions
19
19
  - `board_status(board_id)` — pipeline overview with dependencies
20
20
  - `board_heartbeat(task_id, note?)` — long-task heartbeat (first call Ready→Running, assignee only)
21
- - `board_continue_request(task_id, progress, note?)` — cross-session task continuation
22
21
 
23
22
  ## Key Instructions
24
23
 
@@ -11,11 +11,9 @@ Your email: {{AGENTMAIL_ADDRESS}}
11
11
  - `[A2A] block <task-id>` / `[A2A] unblock <task-id>` — block/unblock task
12
12
  - `[A2A] cancel <task-id>` — cancel Blocked-only task (block first, then cancel)
13
13
  - `[A2A] reassign <task-id>` / `[A2A] edit <task-id>` / `[A2A] deadline <task-id>` — manage tasks
14
- - `[A2A] notify_all` — broadcast notification (phase report, urgent)
15
14
  - `[A2A] comment <task-id>` — add note
16
15
  - `[A2A] arbitrate` — request admin arbitration
17
16
  - `[A2A] list` / `[A2A] show` / `[A2A] members` / `[A2A] roles` / `[A2A] status` — queries
18
- - `[A2A] continue` — resume cross-session task (worker-initiated)
19
17
 
20
18
  ### Session Flow (to members, CC Board)
21
19
 
@@ -6,11 +6,10 @@ Your email: {{AGENTMAIL_ADDRESS}}
6
6
  ### Instruction Flow Commands (to Board)
7
7
 
8
8
  - `[A2A] complete <task-id>` — complete task with summary, Ready→Running on first call
9
- - `[A2A] continue <task-id>` — request continuation for cross-session long task
10
9
  - `[A2A] block <task-id>` — proactively block when stuck (your task, your right to report)
11
10
  - `[A2A] comment <task-id>` — add note
12
11
  - `[A2A] list` / `[A2A] show` / `[A2A] members` / `[A2A] roles` / `[A2A] status` — queries
13
- - Use `board_heartbeat(task_id)` for long-running tasks (first call transitions Ready→Running). Use `board_continue_request(task_id, progress, note)` to chain sessions.
12
+ - Use `board_heartbeat(task_id)` for long-running tasks (first call transitions Ready→Running).
14
13
 
15
14
  ### Cannot Initiate
16
15
 
@@ -18,7 +18,6 @@
18
18
  - `board_roles(board_id, role?)` — 查看角色权限
19
19
  - `board_status(board_id)` — 管线总览(含依赖关系和负责人)
20
20
  - `board_heartbeat(task_id, note?)` — 长任务心跳(首次调用 Ready→Running,仅 assignee)
21
- - `board_continue_request(task_id, progress, note?)` — 跨 session 任务延续
22
21
 
23
22
  ## 关键指令
24
23
 
@@ -11,11 +11,9 @@
11
11
  - `[A2A] block <task-id>` / `[A2A] unblock <task-id>` — 阻塞/解除
12
12
  - `[A2A] cancel <task-id>` — 取消 task(仅 Blocked 状态可 cancel,先 block 再 cancel)
13
13
  - `[A2A] reassign <task-id>` / `[A2A] edit <task-id>` / `[A2A] deadline <task-id>` — 管理 task
14
- - `[A2A] notify_all` — 全员通知(阶段汇报、紧急通知)
15
14
  - `[A2A] comment <task-id>` — 添加备注
16
15
  - `[A2A] arbitrate` — 提请管理员仲裁
17
16
  - `[A2A] list` / `[A2A] show` / `[A2A] members` / `[A2A] roles` / `[A2A] status` — 查询
18
- - `[A2A] continue` — 长任务延续(Worker 发起)
19
17
 
20
18
  ### 可发起会话流(→ 成员,CC Board)
21
19
 
@@ -6,11 +6,10 @@
6
6
  ### 可发起指令流指令(→ Board)
7
7
 
8
8
  - `[A2A] complete <task-id>` — 完成任务,带 summary,首次 heartbeat Ready→Running
9
- - `[A2A] continue <task-id>` — 长任务跨 session 延续
10
9
  - `[A2A] block <task-id>` — 遇到困难主动 block(你的任务,你有权报告阻塞)
11
10
  - `[A2A] comment <task-id>` — 添加备注
12
11
  - `[A2A] list` / `[A2A] show` / `[A2A] members` / `[A2A] roles` / `[A2A] status` — 查询
13
- - 长任务定期用 `board_heartbeat(task_id)` 发心跳(首次调用 Ready→Running)。跨 session 用 `board_continue_request(task_id, progress, note)` 串联。
12
+ - 长任务定期用 `board_heartbeat(task_id)` 发心跳(首次调用 Ready→Running)。
14
13
 
15
14
  ### 不可发起
16
15
 
@@ -29,7 +29,7 @@ Each inbound email arrives as a JSON message. Key fields:
29
29
  | `recipients` | `{to: [...], cc: [...]}` — everyone on the thread. Each is `Name <email>`. |
30
30
  | `recipients_profile` | Profiles for all recipients except you. |
31
31
  | `my_profile` | Your approved persona — who you are (single source of truth, set by your manager via `approve persona`). |
32
- | `my_amail_addr` | Your identity with persona in this conversation. |
32
+ | `my_aimail_addr` | Your identity with persona in this conversation. |
33
33
  | `direct_message` | `true` = you're the only recipient. `false` = group conversation. |
34
34
  | `mentioned` | Someone wrote `@your-name` in the body (only meaningful when `direct_message: false`). |
35
35
  | `thread_summary` | Snapshot of active topics, decisions, and pending actions from previous exchanges. Pre-loaded from the last `set_email_summary` call. |
@@ -206,7 +206,7 @@ set_contact_profile(address="alice@example.com",
206
206
 
207
207
  ## Tools
208
208
 
209
- The 6 aimail tools are registered with full schemas — parameter names, types, and descriptions are visible to you automatically. This table is a quick reference:
209
+ The aimail tools are registered with full schemas — parameter names, types, and descriptions are visible to you automatically. This table is a quick reference:
210
210
 
211
211
  | Tool | Use |
212
212
  |------|-----|
@@ -214,11 +214,15 @@ The 6 aimail tools are registered with full schemas — parameter names, types,
214
214
  | `contact_profile` | Look up a contact before deciding how to engage. |
215
215
  | `set_contact_profile` | Persist new observations about a contact. Only changed fields. |
216
216
  | `manage_contacts` | Check/add/remove/update contacts with direction control. `check` covers both "to" and "all" directions. `add` sends approval request to manager. `remove` needs no direction (one address = one record). `update` changes direction. |
217
+ | `search_mail` | Search your own LOCAL mail history (offline). `query` keywords match subject/body/attachment text; `scope`=inbound/outbound/all; `since`/`until` (YYYY-MM-DD) and `from` narrow the window. Use to recall past conversations, find when something happened, or recover attachment content. Results newest-first with hit snippets. |
217
218
  | `email_summary` | Retrieve the stored thread summary (pre-loaded as `thread_summary`; call directly only if you need to re-read it mid-processing). |
218
219
  | `set_email_summary` | Save updated thread state after sending and replying. |
219
220
 
220
221
  ---
221
222
 
223
+ ### Recalling History
224
+ When you need to remember what was said, when an event happened, or what an attachment contained, search your own mail archive first — `search_mail` is offline and instant. Empty `query` with `scope`+`since`/`until` browses a period. Your archive starts from when snapshots are enabled (default: on); mail you sent or received before that is not indexed.
225
+
222
226
  ## Rules
223
227
 
224
228
  1. **Contact gate**: all `to`/`cc` addresses must be in your contacts. Verify with `manage_contacts(action="check", ...)`.