apex-mochen/dsh-clock-context1

dsh-clock-context

Give the DSH agent a clock: injects the current date/time into the runtime context on every turn. · 给 agent 一块表:每一轮把当前时间注入运行上下文。

包名
dsh-clock-context
版本
0.1.0
许可证
MIT
最近更新
2026年9月12日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:apex-mochen/dsh-clock-context

Configuration

Every option is optional. Set them in your profile's cordis.patch.yml (or in an overlay) under the entry this bundle inserts:

- id: dsh-clock-context
  config:
    timeZone: Asia/Shanghai   # any IANA zone; default: the host's zone
    locale: zh-CN             # default: the host's locale
    label: 当前时间            # default: "Current date/time"
    includeUtc: true          # default: true
    includeEpoch: false       # default: false (unix seconds)
    precision: minute         # 'second' (default) or 'minute'
    hint: true                # default: true (append the "authoritative clock" sentence)
    order: 105                # default: 105 (before SANDBOX_POLICY=110)
    enabled: true             # default: true
OptionTypeDefaultMeaning
timeZonestringhost zoneIANA zone for the rendered local time
localestringhost localePassed to Intl.DateTimeFormat
labelstringCurrent date/timePrefix of the injected line
includeUtcbooleantrueAppend the UTC instant
includeEpochbooleanfalseAppend unix seconds
precision'second' | 'minute''second''minute' renders a snapshot that only changes once a minute
hintbooleantrueAppend the "use this, never guess" sentence
ordernumber105Sort order inside the runtime-context snapshot
enabledbooleantrueTurn the contribution off without uninstalling

The timezone offset is computed per call, so daylight-saving transitions are handled automatically.

On precision. DSH only re-records a runtime-context snapshot when its text changes, so at second precision the snapshot is re-recorded every turn. That is cheap — the snapshot is a tail user-role message, so it does not invalidate the cached prefix — but if you prefer the lowest possible churn, precision: minute makes the text change at most once a minute.

Note on locale. It defaults to the host's locale, so a zh-CN machine renders 2026年09月12日星期六 13:12:21 while the label stays English. Set locale: 'en-US' for Saturday, 09/12/2026, 13:12:21, or set label to match the locale you choose.