fatatalia/dsh-imessage
fatatalia★ 0JavaScript最后同步: 2026-08-16
dsh iMessage 插件:监听/路由/自动回复/typing/已读回执,随 dsh web 启停
README 摘要
dsh-imessage — iMessage 插件 把 iMessage 收发完整接入 DeepSeek Harness(dsh): RPC 监听入站 → 按 handle 路由工作区 → agent 处理 → 自动回复 。作为 web profile 的 host 插件随 dsh web 启停,零 dsh 框架改动。 架构 - 入站 : imsg rpc 订阅全部会话,流式推送新消息 - 路由 : settings.yaml 的 imessage: 段 → routes (handle → 工作区路径) - 固定会话 :同一 sender 固定同一 session(id 按 handle 哈希稳定);live 复用 / resume / create - 归档迁移 :原会话被 UI 归档后不再 resume,自动新建会话并持久化映射( /.dsh/imessage-gateway-state.json ),新消息延续新会话 - 已读回执 :收到外部消息后立即发 read( imsg status --json 探测 read receipts ,支持才启用) - typing 跟随模型调用 :agent 事件 step/start (模型推理开始)→ typing on, step/end (模型返回)→ typing off;多轮 LLM(工具循环)自然交替;duration 5s + 兜底 stop 防卡死 - 出站 :RPC send ;网关以 root 运行时经 sudo -u 降级执行 - 共存 :与 OpenClaw 各自多读 chat.db,互不互斥(同一消息两边都可能回复) 目录 挂载:web profile( /.dsh/profiles/web/ ) package.json → dependencies["dsh-imessage"] = "link: /dsh-imessage" ,bundles 列表含 dsh-imessage 。 配置 $DSH HOME/settings.yaml 的 imessage: 段(可在 web UI Settings → iMessage 网关 编辑): 运行时状态(勿手改): /.dsh/imessage-gateway-state.json (sender → 当前会话 id)。 运行环境配置(环境变量) 所有个人路径均通过环境变量覆盖,代码不写死: 变量 默认值 说明 IMSG CHAT DB /Library/Messages/chat.db chat.db 路径。网关以 root 运行时 homedir() 指向 /var/root ,必须用此变量指向实际用户的 chat.db IMSG CMD imsg imsg 执行命令;root 运行需降级时配置 sudo -u imsg (或直…
在 GitHub 查看完整 README →