dsh-when
在终端中运行以下命令:
dsh plugin install ZhijiangTang/dsh-when
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 dsh plugin install ZhijiangTang/dsh-when 即可安装该插件,项目源码见 https://github.com/ZhijiangTang/dsh-when
插件介绍
In Chinese-language agent workflows, users naturally say things like "tomorrow 9am", "2 hours later", or "next Monday morning", while downstream schedulers and reminder services demand a precise ISO 8601 timestamp. Manual conversion is tedious and error-prone, especially across time zones and daylight-saving edges. dsh-when fills that gap: it registers a lightweight when tool that turns a Chinese relative-time phrase into a UTC ISO string (with Z), a local ISO string (with ±HH:MM offset), a relative-seconds delta, and the matched pattern name—all in pure ESM with zero dependencies and no build step.
The parser covers five phrase families: day offsets (today / tomorrow / day-after, optionally with a clock time or 上午/下午), durations (N minutes / hours / days / weeks from now), weekday expressions (next week X, auto-rolling forward when this week has passed), bare clock times (HH:MM, rolling to next day if already past), and raw ISO 8601 input. Every input follows a strict fail-fast, never-guess principle: phrases outside the supported table return ok:false with a complete list of accepted forms, so a vague phrase can never silently produce a wrong timestamp and propagate into a scheduler or log. On mount the plugin runs four built-in self-check cases and logs the evidence under the [dsh-when] prefix.
It pairs naturally with dsh-cron-parse (periodic cron expressions) and dsh-scheduler (one-shot triggers): cron handles "every Wednesday at 14:00" while when handles "tomorrow at 09:00", and the ISO output from either flows straight into the same scheduling pipeline. If you are building Chinese-facing agents for reminders, scheduling, or timestamped logging, or you simply want your model to accept natural-language times without manual formatting, dsh-when is a drop-in, zero-dependency choice.
使用场景
- 将用户口语化的中文时间短语直接转为 ISO 时间戳
- 为调度插件提供一次性触发时刻
- 在提醒和日程场景中省去手动格式转换
适合人员
- 构建中文智能体应用的开发者
- 需要自然语言时间解析的调度系统
- 偏好零依赖轻量方案的插件用户