# dsh-plugins-im **Repository Path**: playnb/dsh-plugins-im ## Basic Information - **Project Name**: dsh-plugins-im - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-16 - **Last Updated**: 2026-11-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # `@dsh-plugins/im` IM bridge **core** for DeepSeek Harness. It owns everything that must behave the same for every IM platform, so a channel plugin only implements transport. ## What the core owns | Concern | Behaviour | | --- | --- | | **One sender, one session** | `platform:userId → sessionId`, persisted per profile in `im-sessions.json`; the same person keeps their conversation across restarts, different people never share one | | **One project** | every session runs in `workspace` (the cwd, hence the sandbox root); `/common` is the shared material directory | | **Inbound dispatch** | A channel message becomes a normal Harness user message (`agent.followup`) with `source.kind: 'plugin'` | | **Reply routing** | When that turn settles, the last assistant text goes back through the channel that delivered the question | | **Policy** | `allowed` is a hard boundary: an unlisted sender gets a refusal reply and never reaches a session | ## Install ```sh dsh plugin --profile desktop add git@gitee.com:/dsh-plugins-im.git ``` Configure it in the profile's `cordis.patch.yml`: ```yaml - id: im-core name: '@dsh-plugins/im' config: workspace: D:/UserData/code/im-workspace # the project the agent works in allowed: - feishu:ou_xxxxxxxx # platform:open_id perSessionDir: true # optional, default true commonDir: common # optional, default "common" ackMessage: 收到,正在处理… # optional replyTimeoutMs: 300000 # optional provider: zai-coding-cn # optional: pin the model model: glm-5.3-flash ``` ### Directory layout `workspace` **is the project**: it becomes each session's cwd, so the file sandbox covers the whole project, `common` included. The per-conversation subdirectory is a filing convention for that conversation's own output, not a sandbox boundary. ``` D:/UserData/code/im-workspace/ the project = session cwd common/ shared material, writable session-im-feishu-/ this conversation's own files session-im-feishu-/ ``` - Conversation content itself lives in the session log, not on disk; the subdirectory only collects files a conversation produces. - `common` is created on first contact and named to the agent in its first context message, so it knows where shared material belongs. - Set `perSessionDir: false` to drop the subdirectories and let a conversation write anywhere in the project. ## Channel contract A channel plugin registers itself and feeds inbound messages: ```js ctx.im.registerChannel({ platform: 'feishu', send: async ({ chatId, text, replyTo }) => { /* post the reply */ }, }) await ctx.im.dispatchInbound({ platform, chatId, userId, userName, text, messageId }) ``` `ctx.im.status()` reports the registered channels, the mapped senders, replies in flight, and the last error; the `im_bridge_status` tool exposes the same to an agent. ## Known Limitations and Deferred Work - Only text is bridged. A channel that receives an image or a file must answer with a hint (the Feishu adapter does). - One message per turn: a long answer is posted as one text, not streamed. - No queue: a message that arrives while the profile is shut down is not replayable by the core; the platform's own retry policy decides. - The session mapping is keyed by platform+user and never expires; removing a row is a manual edit of `im-sessions.json`.