Skip to content
dsh.fish
Bundle

dsh-plugin-dida365

滴答清单 (DIDA365 / TickTick) plugin for DeepSeek Harness: workspace-bound list, @-mention tasks in chat, and agent control via the dida365 MCP server

Source
yangkghjh
License
MIT
Updated
Updated 6 days ago

Readme

# dsh-plugin-dida365

滴答清单 (DIDA365 / TickTick) 插件 for DeepSeek Harness (DSH):

- **设置里配置鉴权** — 在「设置 → 插件 → 插件配置」填入滴答清单 **API 口令**(Bearer Token,`dp_` 开头,可在滴答清单网页版「头像 → 设置 → 账户与安全 → API 口令」创建)。Token 声明为 secret,只保存在本机 `~/.dsh/settings.yaml`,任何 wire 层都不会回传。
- **每个工作区绑定一个清单** — 同一设置卡片里,每个工作区一行,从滴答清单清单下拉选择(含 Inbox),可随时解绑。绑定关系持久化在 `$DSH_HOME/plugin-data/dida365/bindings.json`。
- **绑定后 @ 清单内任务** — 绑定工作区的会话里,输入 `@` 即列出该清单的未完成任务(支持标题过滤),点选后 draft 显示 `@任务标题`;提交时序列化为模型可见的 `<dida365-task id="…" title="…">` 引用。
- **agent 用 MCP 操作任务** — 插件直连滴答清单官方 MCP 服务(Streamable HTTP + Bearer 鉴权),把服务器全部工具注册为 `mcp__dida365__*`(创建/完成/更新/移动/评论/搜索/清单管理等 50 个);另有桥接工具 `dida365_bound_list` 让 agent 随时查看当前会话工作区绑定的清单与未完成任务。

## 安装

```sh
dsh plugin --profile web add dsh-plugin-dida365 && dsh web
```

> 这是 DSH(DeepSeek Harness)插件,不要用 `npm i` 直接安装;必须通过 `dsh plugin` 安装才会在 profile 中生效。重启后浏览器刷新页面即可。

### 从本仓库开发安装

```sh
dsh plugin --profile web add /path/to/dsh-plugin-dida365   # pnpm link 模式
# 或先打包再安装:
# npm pack && dsh plugin --profile web add dsh-plugin-dida365-0.1.0.tgz
```

## 使用

1. 打开「设置 → 插件 → 插件配置」,在「鉴权」输入 API 口令并保存,状态显示「已连接滴答清单 MCP」。
2. 为当前工作区选择要绑定的清单(如 Inbox 或任意清单),点保存。
3. 在该工作区的会话输入框输入 `@`:出现「滴答清单任务」候选菜单;输入关键字可过滤。选择任务后继续聊天即可。
4. 让 agent 操作任务,例如:「把这个任务标记为完成」「给 @任务 加一条备注」——agent 会通过 `mcp__dida365__*` 完成操作。

## 架构

| 层 | 文件 | 说明 |
|---|---|---|
| 宿主 | `src/server.js` → `lib/index.js`(esbuild 全量打包,仅 external `node:*`) | settings 命名空间 `dida365`(`apiToken`/`apiBase`)、MCP 连接管理(断线重连、工具注册 `mcp__dida365__*`)、绑定存储、`/dida365/*` 路由(status / workspaces / projects / bind / tasks)、桥接工具 `dida365_bound_list`、系统提示上下文 `dida365` |
| 浏览器 | `src/client-main.js` → `lib/client.js`(ModuleLoader bundle,react external) | `settings.plugin.item` 设置卡片(key `dida365`)、`@` 触发源(`ctx.inputTriggers.registerSource`)、引用 codec(提交时序列化 `<dida365-task …>`) |
| 纯函数 | `src/parse.js` | MCP 服务器「拼接式 JSON」解析器、提及候选裁剪(服务端与测试共用) |

### `/dida365/*` 路由(guarded + same-origin)

- `GET /status` — 配置/连接状态(含 `toolsRegistered`,永不含 token)
- `GET /workspaces` — 工作区列表 + 每工作区绑定
- `GET /projects` — 滴答清单清单列表(未归档优先,含 Inbox)
- `POST /bind` / `DELETE /bind?workspaceId=` — 绑定/解绑
- `POST /tasks` — 提及候选:`{sessionId, query}` → 绑定清单未完成任务(30s 缓存,标题过滤,最多 50 条)

## 测试

```sh
DIDA_TOKEN=<api口令> node tests/server.test.mjs
```

单元测试(解析器/候选裁剪)+ 线上冒烟(工具清单、未完成任务解析、创建→完成→删除闭环,自清理)。

## License

MIT

Install

dsh plugin --profile web add github:yangkghjh/dsh-plugin-dida365

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source