rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
Smallballoons01/dsh-water-reminder
Hydration reminder plugin for DeepSeek Harness — a randomized 40-60 minute nudge delivered as a native OS notification, an in-conversation agent nudge, and a sidebar countdown panel. Zero runtime dependencies.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Smallballoons01/dsh-water-reminder
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A hydration and posture reminder plugin for DeepSeek Harness.
People forget to drink while they are deep in work — and just as often forget to stand up. While a session is live this plugin runs two independent reminder tracks, and delivers each reminder through three independent channels — missing one still leaves two:
| Track | What it nudges about | Default rhythm |
|---|---|---|
| 💧 Hydration | Today's intake and how much is left | every 40–60 minutes, drawn at random |
| 🚶 Movement | Standing up and stretching, moving around, looking into the distance (eye strain) | every 45–70 minutes, drawn at random |
| Channel | How it lands | Needs |
|---|---|---|
| 🖥️ OS notification | osascript on macOS, a WinRT toast on Windows, notify-send on Linux |
ctx.subprocess (part of dsh-base) |
| 💬 In-conversation nudge | a plugin message injected into every live root session, so the assistant says one line | the agents service |
| 🔔 Browser notification | the sidebar panel watches reminderSeq and the tab raises its own notification |
page open + user permission |
The two tracks keep their own rhythm, their own on/off switch, and their own state — pausing one leaves the other running. Plus a sidebar countdown panel, a settings page, and an embedded hydration-coach skill.
The irregularity is the point. A perfectly regular timer is what teaches people to ignore it — which is why "drink water on the hour" apps get switched off. Redrawing the interval from the band on every reminder keeps the rhythm unpredictable, which is what makes it work.
The movement track works the same way, and it also draws the reminder content: stand up and stretch, move around, or look into the distance. Random, so the nudge does not decay into one repeated sentence.
# from a local checkout (writes the profile's package.json and dsh.profile.bundles)
dsh plugin --profile web add link:/path/to/water_reminder
# or from a packed tarball
pnpm pack && dsh plugin --profile web add ./dsh-plugin-water-reminder-$(node -p "require('./package.json').version").tgz
Then reload the harness. On DeepSeek Harness ≥ 0.2.1-alpha.3 with hot reload enabled, code updates to this plugin apply without a restart; a fresh install (and toggling the load-time switches promptSection / skill) still needs one — restart dsh web. Never keep two water-reminder rows in one profile — each would start its own timer and register the /water/api prefix route, and the duplicate route makes the whole plugin tree fail to boot.
Recreating a profile with
dsh … --from-default-profilereplaces that profile, including its plugins — re-add the plugin afterwards.
| Tool | Purpose |
|---|---|
water_status |
Today's intake, remaining, cups, goal streak, current band, quiet hours, next reminder, 7-day series |
water_log |
Record a cup (defaults to the configured cup size; accepts milliliters and note). Append-only, never deduplicated |
water_snooze |
Defer the next reminder; defaults to 5 minutes |
water_control |
start / stop / set-band / set-goal / remind-now / reset |
| Tool | Purpose |
|---|---|
posture_status |
Breaks taken today, next break reminder, current band, which nudges are enabled, last break |
posture_log |
Record one break (action is stand / move / distance; accepts note) |
posture_control |
start / stop / set-band / remind-now / reset |
water_control and posture_control write runtime overrides into the state file rather than editing the profile config; reset drops those overrides and falls back to configuration.
In the profile's cordis.patch.yml (defaults ship in the plugin's own cordis.patch.yml):
| Field | Type | Default | Meaning |
|---|---|---|---|
enabled |
boolean | true |
Whether the hydration loop runs at start-up |
intervalMinMinutes |
number | 40 |
Lower bound of the hydration interval, in minutes |
intervalMaxMinutes |
number | 60 |
Upper bound of the hydration interval, in minutes |
dailyGoalMl |
number | 2000 |
Daily intake goal |
cupMl |
number | 250 |
Milliliters recorded for one "cup" |
snoozeMinutes |
number | 5 |
Default deferral for water_snooze |
quietHours.enabled |
boolean | false |
Hold reminders inside a local-time window |
quietHours.from / .to |
string | 22:00 / 08:00 |
The window (may wrap past midnight); a draw inside it resumes at the window's end |
posture.enabled |
boolean | true |
Whether the movement loop runs at start-up |
posture.intervalMinMinutes |
number | 45 |
Lower bound of the movement interval, in minutes |
posture.intervalMaxMinutes |
number | 70 |
Upper bound of the movement interval, in minutes |
posture.stand |
boolean | true |
May deliver the "stand up and stretch" nudge |
posture.move |
boolean | true |
May deliver the "move around" nudge |
posture.distance |
boolean | true |
May deliver the "look into the distance" nudge |
notify.os |
boolean | true |
OS notification |
notify.agent |
boolean | true |
In-conversation nudge |
notify.sound |
boolean | true |
Play a sound with the OS notification |
stateFile |
string | $DSH_HOME/water-reminder.json |
Persisted state location |
promptSection |
boolean | true |
Inject the reminder briefing into the system prompt |
skill |
boolean | true |
Register the embedded hydration-coach skill |
The band is clamped to [5, 720] minutes ([10, 360] for the movement track), the goal to [200, 20000] ml, and the cup to [50, 2000] ml. A user patch replaces the whole entry config, so restate every field you want to keep when overriding one.
At least one movement nudge always survives: if all three are switched off, the track falls back to "stand up" rather than becoming a silent timer.
+250ml logging, snooze, remind-now, pause/resume, a "take a break" logger, and a control to grant browser-notification permission.$DSH_HOME/settings.yaml and hot-reload; changing a band or quiet hours rearms the timer immediately.The two switches marked "(restart)" (promptSection, skill) are read at load time and need a Harness reload.
The same instructions ship two ways:
ctx.skills.register(), so the model sees hydration-coach in its skill catalog with no filesystem skill root at all.skills/hydration-coach/SKILL.md, for deployments that prefer a filesystem skill root (~/.dsh/skills, ~/.agents/skills, a project .dsh/skills).skill.js is the single source of truth and npm test asserts the checked-in SKILL.md matches the embedded body byte for byte, so the two delivery paths cannot drift. Run npm run skill after editing the body.
The skill covers which tool to call when, how to react to both reminder kinds ([water-reminder] and [posture-reminder]) — one short line, no health lecture, never derail the current task — logging rules, how to retune each track's rhythm, estimating a personal goal from body weight (30 ml × kg), and tone/safety boundaries (no medical claims).
$DSH_HOME/water-reminder.json, written through a temp file plus rename so a crash cannot truncate it. Both tracks share one file (hydration at the top level, movement under posture), so an existing state file keeps working.nextDueAt draws a fresh interval instead of firing the missed reminders at once.remind-now delivers once without resetting the pending reminder.unref()ed, so neither reminder loop keeps the process alive.powershell -EncodedCommand (UTF-16LE base64) so quoting and CJK text are safe. If PowerShell is restricted by policy the reminder degrades to a log line, while the other two channels still fire.water_status returns a compact one-line text form instead, which keeps the tool's output schema free of nested arrays.posture_log records "you took a break", not how long it lasted or how many rounds. Finer tracking needs its own tool.The plugin has zero runtime dependencies — @deepseek-ai/dsh-tools, dsh-llm, schemastery and
friends are peer dependencies that the Harness supplies at runtime.
The versions this plugin develops against are published to npm, but not under npm's latest
tag: npm's latest for @deepseek-ai/dsh-tools is still the placeholder 0.0.1-rc.1, while this
plugin targets 0.2.2-rc.1 (reached through the next dist-tag). Install the exact versions
from devDependencies rather than letting a resolver follow latest:
pnpm install # resolves the pinned devDependencies
npm test # 91 pass / 0 skip, including the real cordis composition tests
Companion versions.
0.2.2-rc.1is paired with@deepseek-ai/cordis4.1.0and@deepseek-ai/schemastery3.19.0(both real releases on their ownlatestchannel now). Therc.1release has no dedicateddsh-0-2-2-*dist-tag — the exact version strings indevDependenciesare the only source of truth.
Tool executor. Since
0.2.2-alpha.2the tool registry no longer owns the model-facing tool descriptions: assembling the system prompt asks the registry for its executor and throwsTOOL_EXECUTOR_UNAVAILABLEwhen the composition has none. A real deployment gets one from@deepseek-ai/dsh-base; any composition you build by hand has to mount@deepseek-ai/dsh-tool-executor-nativeafter the registry, which is whattest/integration.test.jsdoes.
If you prefer to reuse the packages from an existing local Harness profile (fastest, offline):
mkdir -p node_modules/@deepseek-ai
for p in cordis cosmokit dsh-llm dsh-tools dsh-settings dsh-skill dsh-system-prompt dsh-tool-executor-native schemastery; do
ln -sfn "$HOME/.dsh/profiles/node_modules/@deepseek-ai/$p" "node_modules/@deepseek-ai/$p"
done
npm test
You can also build the Harness from source and link this plugin the way it documents:
git clone https://github.com/deepseek-ai/deepseek-harness
The settings page and config hot reload require a Harness >= 0.1.2-alpha.3 host; on older hosts the
plugin still runs on its boot-time config.
Message source kind. Since dsh
0.2the harness has no shared catch-allkind: 'plugin'message source — each producer declares its own kind. This plugin injects under'water-reminder', declared intypes/dsh-llm.d.ts. A pure-JavaScript plugin cannot use an inlinedeclare module(that is TypeScript syntax, which Node rejects at parse time), so the type-level merge lives in that separate file.
Use the pinned install or the profile symlinks for the full suite
(hydration.js / posture.js / notify.js).
npm test # 91 tests with dependencies; fewer pass + 2 skip without
npm run skill # regenerate SKILL.md from skill.js
npm run skill:check # verify SKILL.md is in sync
| File | Coverage | Needs Harness |
|---|---|---|
test/hydration.test.js |
Pure logic: band normalization, random-draw bounds, quiet hours across midnight, streaks, summary, config completion | no |
test/posture.test.js |
Pure logic: movement-track action set, band clamping, state normalization, break log and counts | no |
test/notify.test.js |
Exact per-platform argv, AppleScript/XML escaping, PowerShell encode round-trip |
no |
test/skill.test.js |
Embedded skill identical to the on-disk SKILL.md byte for byte, spec-compliant name, tool names complete |
no |
test/client-structure.test.js |
Browser half: theme token names, hard-coded fills, locale key parity | no |
test/plugin.test.js |
Tool behavior against a minimal fake context, asserting every result matches its own declared output.schema |
yes |
test/integration.test.js |
Mounted on a real Context with the real tools/skills/systemPrompt services: dependency resolution, skill discoverability, clean disposal, and no disk writes during teardown |
yes |
When the packages are missing, the plugin and integration files skip with a printed reason instead of
turning the suite red.
MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。