sandbase-harness
sandbaseai
Local-first, self-hosted AI agent runtime and MCP bridge with sandboxed sessions, memory, credentials, audit/replay, and a local Console.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:YangShen-SWE/dsh-plugin-simple-pet
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
最新版:v0.4.0 · Codex 自动预热 · 更新记录 · 安装包
Windows 桌面上的 Q 版 DSH 桌宠:DeepSeek 模式看余额、用量与峰谷价格;Codex 模式看订阅的 5 小时及周额度,用角色动作反馈调用。A small native Windows pet for DeepSeek billing and Codex subscription quotas in DeepSeek Harness (DSH).
兼容 / Compatibility: 面向 DSH
0.2.0-rc.1、0.2.0-rc.2;DeepSeek 功能已在 Windows +0.2.0-rc.2实机验证,rc.1尚待实机回归。Codex 额度需要宿主提供公共进程内连接适配器,并安装、启用支持的订阅插件;不能仅凭 DSH 版本号保证额度接口可用。This is an unofficial community project, not a DeepSeek product.
v0.4.0 新增: Codex 每日本机时间与可靠 5h 重置自动预热,两项独立、默认关闭。首次升级不会自动开启;主动开启会发送真实模型请求并消耗额度。完整重启 DSH 后加载新版后端。
HH:mm 与 可靠观察的 5h 重置后自动预热,独立默认关闭,没有手动按钮;可在任一计费显示模式下设置。| 模式 | 悬浮卡片 | 用量飘字与统计 |
|---|---|---|
| DeepSeek 计费模式 | 当前官方路由的钱包余额、缓存命中率、峰谷价格 | 人民币 / Token 飘字;原有统计保留 |
| Codex 订阅模式 | 5 小时 / 周剩余额度、重置时间、数据状态 | Token / 实测额度百分比飘字;独立 Token 统计,不显示人民币与峰谷价格 |
在右键设置中切换模式。切换只改变桌宠显示,不改变 DSH 的模型、提供商或登录账号。 原有六款皮肤、位置、统计、可拖动设置窗口及右键直达设置继续保留。
deepseek-official、deepseek-account、openai-codex 与 codex 路由;没有通知或自定义价格规则。动作由 WPF 原生动画播放,状态轮询不限制动作帧率。在 Windows 上安装 DSH。使用 DeepSeek 时,在 DSH 内配置官方 API Key 或登录 DeepSeek 账号;使用 Codex 时,在 DSH 中安装并启用支持的订阅插件并登录。凭据由 DSH / 订阅插件管理,无需填入桌宠。
从 v0.4.0 发布页 下载源码 ZIP 并解压到长期保留的目录,或运行:
git clone --branch v0.4.0 https://github.com/YangShen-SWE/dsh-plugin-simple-pet.git
安装完整目录,将路径换成实际解压路径。不要只复制某个脚本;所有运行文件和 assets/ 都需保留。
dsh plugin --profile desktop add "file:C:/path/to/dsh-plugin-simple-pet"
如果以前安装过 @local/dsh-simpledesktoppet 或 @local/dsh-deepseek-pet,先禁用/移除旧插件,避免重复处理事件。升级已有安装时,重新安装新目录或通过市场更新,不能只修改源码副本。
保存当前任务后,完全退出并重新启动 DSH(包含后台/托盘进程),让新版 Node 后端加载。只刷新网页、关闭桌宠、重新打开桌宠或重启旧安装副本都不等于升级后台。
在插件管理中启用 dsh-plugin-simple-pet,桌宠随插件自动启动;停用插件时关闭由插件启动的窗口。右键进入「设置与统计」,切换计费模式、形象、尺寸、飘字单位与睡眠时间。右上角「×」只关闭设置,「退出桌宠」才退出悬浮窗。运行期间不要移动或删除安装目录。
市场条目使用 最新稳定版安装包,不是固定到旧版本的下载地址。市场收录状态取决于维护者审核,收录 PR 未合并前可先使用 GitHub 安装。
默认安装目录通常是 %USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-plugin-simple-pet\。桌宠为单实例,正常使用不需额外运行启动脚本。仅排查窗口时,可在已安装目录运行:
powershell.exe -NoProfile -ExecutionPolicy Bypass -STA -File .\pet.ps1 -DshProfile desktop
右键 → 设置 → 计费模式 → Codex 订阅模式。卡片展示剩余额度与本机时区的重置时间;未知显示 —,过期或失败标为上次额度。
dsh-codex-subscription: 通过其公开状态 / 用量接口跟随激活账号,查询前后核对账号,丢弃切号期间的结果。不默认查询 Codex CLI 账号,也不擅自切换账号。dsh-plugin-subscriptions: 显示其默认 Codex 账号,标为「默认账号 · 可能缓存」。模型池/独立模型实际使用账号没有公开关联,不能保证与默认账号一致;上游没有原始刷新时间,不生成其百分比飘字。右键 → 设置 → Codex 自动预热,在任一计费显示模式下均可设置。没有手动预热按钮;两个开关独立,默认都关闭:
HH:mm,例如 09:30,保存时间并启用每日开关。按运行 DSH 的电脑本地时区执行,不固定为北京时间或哥本哈根时间;约每 5 秒读取设置。只在持续运行、及时观察到指定时刻后,于该分钟内最多尝试一次;启动或恢复运行时已错过时刻不会补发。修改时间、失败、重启不会重试当天已记录的尝试。dsh-codex-subscription 当前活动账号的新鲜 5h 报告,先观察未来截止时间,再在截止后及时核对新报告。每个已观察窗口最多尝试一次;新窗口已有调用时跳过。周额度重置、旧缓存或多提供商插件的默认账号报告不会触发。两个条件同时命中合并为一次调用。desktop 配置执行,其他配置不会因共享设置被自动启用。DSH 与插件必须运行;不会唤醒电脑,不补执行长时间休眠、离线期间错过的任务。夏令时不存在的时间跳过,重复时间不重复执行。关闭设置、退出桌宠窗口或切换显示模式不会停用任务;要停止自动请求,请关闭开关或禁用插件。修改相关设置会取消正在进行的请求,已发送部分可能计入额度。llm.stream,显式指定 openai-codex 与可用目录内模型;优先当前默认的 Codex 模型,否则使用 Codex 目录首项,并选择已报告支持的最低推理档。只发送固定短提示 Reply only OK.,不附带聊天历史、系统提示、会话 ID 或工具,不创建聊天或运行工具;不改动全局模型、账号或订阅插件设置。maxTokens 上限。约 60 秒发出取消信号,认证或清理阶段可能等待更久;未结束时不会并发启动下一次。测试只用模拟服务,不会自动发起真实付费调用。例如本机 09:30 请求,只有在服务器确实从该请求开启新 5h 窗口时,才可能在 14:30 重置;已有窗口不会因此重新锚定。成功、跳过、失败、上次尝试和下一每日时间在设置中显示;服务器额度报告始终是依据。第一次升级需完整重启 DSH 加载新版后端;之后更改设置不需重启。
| 现象 | 检查方法 |
|---|---|
| 更新后仍是旧版/提示「请重启 DSH 更新桌宠」 | 先更新实际安装副本,再完整退出并重启 DSH 后台;只刷新网页或重开桌宠不够。 |
| 「等待 DSH 数据」或「等待 DSH 加载统计」 | 确认 DSH 与桌宠插件运行;升级后完整重启 DSH。 |
| 「未发现支持的订阅接口」 | 确认宿主提供公共连接适配器,订阅插件已安装并启用;仅接入 OAuth 模型不足以提供额度。 |
| 「请在订阅插件登录」 | 在对应订阅插件登录/选择账号,不需把 Codex 凭据交给桌宠。 |
| 「上次额度 · 待更新」/「默认账号 · 可能缓存」 | 数据过期、查询失败或上游缺少刷新时间;等待刷新,不将旧数值视为实时额度。 |
| 今日总量为 0 | 确认所选模式对应支持的路由,新插件加载后至少完成一次模型调用;历史调用可能不在统计内。 |
| DeepSeek 余额无法查询 | 检查 DSH 的 API Key/账号登录及对应余额服务。 |
| 看不到悬浮窗 | 完整重启 DSH,确认插件启用;检查是否已有桌宠进程,必要时在安装目录手动运行脚本查看报错。 |
本机数据位于 %LOCALAPPDATA%\DshSimpleDesktopPet\:state-desktop.json 保存余额、额度与最近事件,stats-desktop.json 保存 DeepSeek 用量,stats-codex-desktop.json 单独保存 Codex Token,settings.json 保存偏好与位置,warmup.json 保存自动预热的尝试键、时间及错过的每日时刻,防止重启后重复;已有日志损坏或无法读取时停止发送,不静默重建。旧目录与数据保留;状态不保存 API Key、Codex 令牌或对话正文。额度查询走订阅插件公共只读接口;启用预热才通过宿主模型接口发送固定极短提示,账号标识仅保存短哈希;完整说明见 隐私说明。
价格表按 DeepSeek 官方价格页 于 2026-09-29 核对,官方改价后需更新代码。源码与文档为 MIT 许可;十二张角色图集及四张生成源图另见 美术授权。保留 AI 来源信息,人工视觉检查不等于绝无相似或法律保证。本项目交互受 dsh-damage-pulse 启发,但未打包其源码或素材,与 DeepSeek 及上游无隶属关系。
运行 npm test 检查计费、路由、额度、统计和 UI;受限沙箱可用 node --test --test-isolation=none。v0.4.0 的源码与解包安装包回归均包括 56 项测试及 1088 项原生断言(设置 601、真实素材 454、额度展示 33)。Codex 接口与切号行为使用公开 DTO 的模拟回归;这些测试不读取真实账号数据,也不等于所有宿主/账号已完成实时额度验收。
powershell.exe -NoProfile -ExecutionPolicy Bypass -STA -File .\pet.ps1 -Preview 可查看独立模拟动效;加 -PreviewSleep 看睡眠、-PreviewSettings 看模拟统计,不修改真实余额。
HH:mm and reliably observed 5-hour-reset switches, with no manual button. Settings shows time zone, status, last attempt/success and next daily time.Use Windows and DSH. Configure official DeepSeek credentials in DSH, or install/enable and sign in to a supported Codex subscription addon. Never give the pet Codex credentials.
Download the source ZIP from v0.4.0, or clone the tagged version to a permanent directory. Install the whole directory:
dsh plugin --profile desktop add "file:C:/path/to/dsh-plugin-simple-pet"
Disable/remove old @local/dsh-simpledesktoppet or @local/dsh-deepseek-pet copies. To upgrade, update the installed copy via the market or reinstall the updated folder.
Save running work, fully quit DSH including its background/tray process, and relaunch it. Refreshing the browser or reopening the pet does not update the loaded Node backend.
Enable dsh-plugin-simple-pet. DSH owns the pet window lifecycle. Right-click for settings; drag the title bar to move settings/statistics. × closes settings; Exit Pet closes the pet. Keep the installed directory in place.
The market submission uses the latest stable release tarball; PR #6267 is subject to maintainer review. The pet is single-instance. Manual startup is only a troubleshooting fallback.
The host must expose the public in-process connection adapter and a supported addon must be enabled. dsh-codex-subscription follows its active account, checked before and after the query. dsh-plugin-subscriptions exposes a default account, not necessarily the pool's selected account; its report is labeled potentially cached and never generates percent animations without an original refresh timestamp.
Unknown quota is —, not 0% or 100%. Reset times use your local time zone. Queries start when the backend loads and repeat about every 60 seconds. Percent feedback measures decreases between fresh reports for the same account/window; it is not a Token conversion or guaranteed per-turn attribution. Resets and account changes are not spending. Missing reliable reports fall back to Token feedback.
“请重启 DSH 更新桌宠” means an old backend snapshot lacks Codex fields: update the installed copy and fully restart DSH, not the subscription login. “等待 DSH 数据” means no initial snapshot yet. Other statuses distinguish signed-out, unsupported, switching and stale data. Codex Token charts count DSH-reported usage only; account quota may also reflect other clients.
Settings has independent, default-off daily local HH:mm and observed 5-hour reset switches, with no manual request button. Only the Windows desktop profile executes the shared local schedule; other profiles do not opt in. The backend checks preferences about every 5 seconds. A target already missed at startup/wake is suppressed, including subsequent ticks and restarts; the computer is never woken. Closing the pet or changing display mode does not disable the backend schedule; turn off the switches or disable the plugin to stop it.
A fresh, forced active-account quota check and durable attempt claim precede a direct openai-codex stream. It uses an available Codex model (current Codex default if available, otherwise the first catalog entry) and the lowest advertised supported reasoning effort. Only Reply only OK. is sent: no session, history, system prompt or tools. Model/account/addon preferences are not changed. A daily date or observed reset deadline is attempted at most once; simultaneous triggers coalesce. Unknown/stale/exhausted quotas or account changes skip dispatch. Reported usage, including failed-call usage, enters the separate Codex ledger.
The public API cannot pin an account during dispatch, impose an enforceable Codex token cap, or forbid every existing transport retry. The pet itself does not retry, but addon WebSocket/middleware behavior may. A 60-second cancellation signal does not guarantee an authentication/cleanup deadline. Reset reports, not success or token counts, determine window timing: 09:30 does not guarantee a 14:30 reset. Tests use mocks only; no live billable verification was performed. This feature is included in v0.4.0 and defaults off on first upgrade. Fully restart DSH once after updating the installed backend.
The DeepSeek card queries the signed-in account wallet at startup and switches wallets according to actual official deepseek-account / deepseek-official calls. It estimates deductions between official balance checks; unknown prices stay unpriced. Token amounts include reported context/cache, not only your last prompt. Today's totals use local dates; old history may be incomplete.
Data and preferences stay under %LOCALAPPDATA%\DshSimpleDesktopPet\, with separate DeepSeek/Codex ledgers. No prompt/response bodies or credentials are stored. Codex quota uses public read-only addon RPC and hashes account identifiers; opt-in warm-up sends only a fixed short prompt through the host LLM service and stores attempt timestamps/keys, not response bodies. See PRIVACY.md, artwork terms, and CHANGELOG.md. There is no telemetry or cloud sync.
Run npm test (or node --test --test-isolation=none in restricted sandboxes). Both the v0.4.0 source and extracted installation package pass 56 tests and 1088 native assertions (601 settings, 454 actual-asset and 33 quota-presentation assertions). Codex/account-switch tests use synthetic public DTOs, not live credentials; passing them is not a claim of live quota verification on every host/account. Isolated preview mode uses synthetic events and does not change live balance data.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: desktop-pet、token-usage。