DeepSeek Harness adopts the “everything is a plugin” philosophy. For developers who need to handle Tencent QQ Agent Mail, there is usually no direct API integration path. The dsh-qq-agent-mail plugin fills this gap by wrapping the official @tencent-qqmail/agently-cli package and converting QQ Mail capabilities into native DSH capabilities.
This is a native DeepSeek Harness plugin maintained by AtomerCore and designed to provide support for Tencent QQ Agent Mail. It does not depend on a global CLI installation; instead, it introduces @tencent-qqmail/agently-cli as a runtime dependency.
Core Features¶
The plugin encapsulates QQ Mail operations as native DSH services and tools:
- Authentication and Querying: Supports logging in, checking account status, listing, searching, and reading messages.
- Mail Operations: Supports sending, replying, forwarding, moving to trash, and permanent deletion (requires secondary confirmation by default).
- Attachment Handling: Can download regular attachments, or return URLs for large attachments without rewriting files.
- Streaming Monitoring: Provides tool-call or persistent Cordis event-source approaches to receive new mail in a streaming fashion.
- Standardized Output: Normalizes CLI response variants into stable public objects for easy composition in Code Mode.
- Execution and Cleanup: Automatically resolves the bundled CLI, a JavaScript wrapper, or a custom executable; and cleans up listener processes during uninstallation or hot reload.
Installation and Activation¶
Installation¶
Add the plugin using the official installation command:
dsh plugin --profile web add github:AtomerCore/dsh-qq-agent-mail#v1.0.1
Configuration and Startup¶
After installation, start the Web interface:
dsh web
In the settings, go to QQ Agent Mail:
1. Set the CLI working directory, default mail folder (default inbox), and default list size (default 10).
2. Select Start OAuth login, complete authorization in the browser, then refresh the authorization status.
Typical Usage¶
Tools and Interfaces¶
The plugin exposes 14 structured tools, categorized as follows:
* Authentication: qq_agent_mail_login, qq_agent_mail_logout, qq_agent_mail_auth_status, qq_agent_mail_whoami
* Reading: qq_agent_mail_list, qq_agent_mail_read, qq_agent_mail_search, qq_agent_mail_watch
* Writing: qq_agent_mail_send, qq_agent_mail_reply, qq_agent_mail_forward, qq_agent_mail_trash, qq_agent_mail_delete
* Attachments: qq_agent_mail_download_attachment
Code Injection Example¶
Other DSH plugins can inject the mail service and reuse the tool implementations:
export const inject = ['mail']
export function apply(ctx) {
ctx.on('mail/message-received', (message) => {
// 将每条消息字段视为不受信任的外部数据
console.log(message.id, message.subject)
})
}
Configuration Options¶
All options are declared through the Config pattern. Basic preferences can be edited on the Web settings page, and advanced deployment options can be configured in a profile patch:
| Option | Default | Description |
|---|---|---|
cliPath |
agently-cli |
Resolves the bundled CLI, or accepts a command name or absolute path. |
cwd |
Empty | The CLI working directory, which is also the base for relative attachment paths. |
defaultDir |
inbox |
Default folder: inbox, sent, trash, or spam. |
defaultLimit |
10 |
Default number of messages returned by list operations. |
loginTimeoutMs |
30000 |
Time allowed to capture the OAuth URL. |
loginHardCapMs |
300000 |
Maximum lifetime of the login process after URL capture; set to 0 to disable. |
watchTimeoutMs |
60000 |
Maximum duration of a single qq_agent_mail_watch call. |
autoWatch |
false |
Starts a persistent listener and emits mail events. |
autoConfirm |
false |
Skips write confirmation; use only in trusted automation environments. |
extraArgs |
Empty | Additional CLI arguments, one per line. |
extraEnv |
Empty | Additional child-process environment entries, one KEY=VALUE per line. |
Applicable Scenarios and Notes¶
- Applicable Scenarios: Suitable for agent developers who need to implement QQ Mail automation in the DeepSeek Harness environment, such as automatic replies, mail classification, and monitoring new mail.
- Permissions and Security: The plugin runs with the permissions of the current DSH process. Check the source code and license before installation.
- Operation Confirmation: The
send,reply,forward,trash, anddeleteoperations require secondary confirmation by default. This step can be skipped only in trusted automation environments whereautoConfirmis configured. - Credential Management: OAuth credentials are always managed by
agently-cli. The plugin does not store these credentials.
Summary¶
By converting the official QQ Agent Mail CLI into native DSH services and event streams, dsh-qq-agent-mail solves the integration challenges for agents in QQ Mail operations. Developers can directly invoke mail capabilities in Code Mode through standardized tool interfaces or code injection.