有生物钟、会真实睡觉、有自己的记忆和情绪的 AI 伴侣,主动冲动以独立 turn 投递。
安装
# npm 包(预构建)
dsh plugin --profile web add @m-rui/dsh-mate-companion
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:m-rui001/dsh-mate-companion
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Persisto Mate — the AI companion with a body clock, real sleep, its own memory and feelings — as a DeepSeek Harness (dsh) bundle.
Install
dsh plugin --profile <your-profile> add github:m-rui001/dsh-mate-companion
# or, from npm:
dsh plugin --profile <your-profile> add @m-rui/dsh-mate-companion
Then boot that profile. State lives beside the harness home ($DSH_HOME or ~/.dsh) at
agent/mate/ — separate from the pi-host companion's state, because a different host is a
different body.
What it contributes
- System prompt sections — the cached identity/character/memory block and a volatile state block (clock, mood, drives, session log, reply lean) that re-renders on every assembly.
- The kernel — every inbound user message advances the affective state; offline time integrates in closed form and crosses real sleep windows; memory recalls, rehearses and consolidates; SPARK beliefs crystallise from recurring topics.
- The affect judge — after each user exchange the model reports, via the
mate_feeltool, how the exchange moved each Plutchik feeling on a -2..+2 scale. The report goes through the same literature-anchored math as the pi companion's judge (rung equating, negativity asymmetry), and a due gate keeps it a reading of the new exchange rather than a re-read of an old one. - A waking heartbeat — impulses the kernel decides are worth voicing are delivered as a queued
follow-up message of their own turn, wrapped in a
<system-event type="mate-impulse">envelope so they are never mistaken for the user's words. - Tools —
mate_remember(persistent memory),mate_ponder(private thought),mate_debug(full internal state).
Known scope limits (v0.2)
- The judge reads the exchange through the host model's own self-report rather than a separate side-channel model, which introduces the usual self-assessment bias; the design treats that as acceptable until the harness documents a plugin-facing completion API.
- No live sleep mode, dreams, or alarm tool yet — offline sleep is fully simulated by the kernel's catch-up, and the sleeping-hours impulse suppression still applies.
- To switch the companion's prompt language, write
{"version":1,"lang":"zh"}toagent/mate/lang.jsonunder the harness home.
Requires Node 22.19+/24 per the harness. The harness is a developer preview; its plugin surface may change under us.
Source
MIT, in LICENSE. This repository is a published mirror of the
Persisto-Mate monorepo, and it carries the source of the
bundle rather than only the bundle: packages/ holds the files dist/index.js is built from, at
their monorepo paths, so no import had to be rewritten to put them here — this host
(packages/dsh-mate-extension/src), the MATE kernel (packages/mate/src) and the one shared
affect-appraisal file it imports from the pi host
(packages/coding-agent/src/extensions/mate/appraisal.ts).
Rebuild it to check that claim:
bun install
npm run build # writes dist/index.js from the source in packages/
Send changes upstream in the monorepo — the next publish overwrites what is here.
链接
同类插件
kingcharleslzy-ai/dsh-purge★ 14391
独立维护的 dsh-purge 社区分支,提供宿主策略补丁、提示词与规则设置、诊断、独立的更新检查与安装控制,以及本机备份回滚。
aureth-labs/dsh-aurabot-qq★ 786
通过 SnowLuma(OneBot v11)让 agent 以人设角色住进 QQ:私聊与群聊、语音条、表情包、QQ 空间日记、刷 B 站、翻唱、生图、长期记忆与心情。每项本事都是模块,可关闭、替换或在本地扩展——热重载的扩展模块还能改写群聊回不回、提示词、最终发出的消息和每个聊天用的模型。默认安全(总开关关、试运行开)。
ECNU/EduWork#dsh-oidc★ 452
可配置的 OIDC 登录与令牌授权模型接入,支持 LiteLLM 和显式启用的 oidc-llm 集成,提供独立 DSH Web 后端。
techflag/workdsh#enterprise-connection★ 353
面向 WorkDSH Desktop 2.0.6-alpha.3 及以上版本的企业连接插件,配合 WorkDSH Admin 提供成员登录、@同事分享正文与文件、业务插件认证复用,通过发行包安装。
Yuuyuko-uu/dsh-feiyu-mood★ 278
给 AI 伙伴一个每轮判定、以一小段上下文提示的心情,面板里能看心情值、情绪维度与时间线。
FNOSP/fnos-dsh#dsh-codex-auth-plugin★ 127
为 DeepSeek Harness 提供 ChatGPT 账号登录:走 Codex 浏览器 OAuth,无需 API Key、无需选择工作空间;把登录结果接到 pi-ai 的 Codex provider,可设置新会话默认的 Codex 模型与思考强度,并按账号自己的目录接口刷新模型列表,在输入区展示 5 小时与每周用量窗口。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。