DeepSeek Harness Plugin

qinvnb/dsh-cn-workday-schedule

Stars ★ 1 Category Workflow & Automation Added 2026-12-01

Host-side Chinese statutory workday and workweek scheduler that auto-advances bound native Automation tasks across State Council holidays and makeup workdays, with Settings UI and the cn_workday_schedule tool. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

# from a prebuilt release tarball

dsh plugin --profile web add -w "https://github.com/qinvnb/dsh-cn-workday-schedule/releases/download/v0.1.0/dsh-cn-workday-schedule-0.1.0.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:qinvnb/dsh-cn-workday-schedule

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

中文 | English

A host-side scheduling plugin for DeepSeek Harness (DSH) that automatically advances native Automation tasks across Chinese statutory holidays and weekend makeup workdays (State Council holiday calendar). All date calculations and task rescheduling run deterministically on the DSH Host without relying on an LLM to edit schedules.

Why This Plugin

DSH native Automation tasks support standard Cron and RFC 5545 RRULE, which cannot directly express China's dynamic holiday adjustments (early holiday cutoffs, weekend makeup workdays, or makeup Sundays rolling into the next workweek).

This plugin works alongside the native DSH scheduler: the native scheduler continues to handle timing, session creation, offline catch-up, and delivery history, while this plugin computes and arms the exact next Chinese statutory trigger date for bound tasks.

Features

  • 4 Chinese Statutory Scheduling Modes:
    • workweek_last_day (Last day of each workweek): adapts automatically to early holiday cutoffs and weekend makeup workdays; a makeup Sunday directly preceding a Monday workday belongs to the next workweek.
    • workweek_first_day (First day of each workweek): Monday by default, or a makeup Sunday that directly precedes a Monday workday.
    • every_workday (Every statutory workday): Monday–Friday excluding statutory holidays, plus weekend makeup workdays.
    • month_last_workday (Last statutory workday of each month): the final Chinese statutory workday of each calendar month.
  • Deterministic Host-Side Auto-Advancing:
    • Watches Host schedule/changed events (200ms debounce) and immediately advances a bound one-shot task to the next matching statutory date right after delivery — even if the agent turn later errors or times out.
    • Also reconciles idempotently on DSH startup, every 6 hours, and on manual sync or holiday refresh.
    • Respects manual pause: tasks paused in Automation tasks are never force-resumed.
  • Bundled + Auto-Updating Holiday Calendars:
    • Bundles official 2026 (39 entries) and 2027 (34 entries) State Council holiday and makeup-workday data.
    • Automatically (or manually from Settings) fetches uncached years from holiday-cn and stores them under $DSH_HOME/plugins/dsh-cn-workday-schedule/holidays/. Falls back cleanly to standard Monday–Friday rules when offline or when a future year has not been announced yet.
  • Settings UI + Shared Agent Tool:
    • Web UI: available in Settings → Chinese workday schedule and the plugin configuration view. Shows today's workday/holiday status, current workweek boundaries, calendar readiness, rule binding controls, live 5-occurrence preview (with holiday cutoff / makeup-day badges), stale-binding cleanup, manual sync, and holiday refresh (Chinese & English UI).
    • Agent tool (cn_workday_schedule): shares the same Host service methods with 6 actions (status, bind, unbind, preview, sync, refresh_holidays), allowing scheduled workflows (such as weekly reports) to query exact Chinese workweek start/end dates directly.

Installation

Requires Node.js >= 22. Pure ESM with zero runtime or build dependencies, installable directly from source.

Option 1: CLI

dsh plugin --profile web add github:qinvnb/dsh-cn-workday-schedule

Option 2: DSH Plugin Manager

Open Settings → Plugins → Add plugin in DeepSeek Harness and enter github:qinvnb/dsh-cn-workday-schedule or a local directory path.

Usage

  1. Create a native task in Automation tasks (with any future time).
  2. Open Settings → Chinese workday schedule, locate the task, and click Configure workday rule.
  3. Pick a scheduling mode and local clock time (default Asia/Shanghai), review the next 5 trigger dates preview, and click Bind & activate.
  4. You can also ask the agent to call cn_workday_schedule directly to inspect status, preview upcoming dates, bind/unbind tasks, or refresh holiday data.

cn_workday_schedule Tool Actions

action Description Key Parameters
status Inspect today's workday/holiday status, active workweek boundaries, cached years, and task bindings date (optional YYYY-MM-DD)
preview Preview the next 1–24 exact trigger dates for a rule mode, time, time_zone, date, count
bind Attach a statutory workday rule to a native task and align its next trigger task_id (required), mode, time, time_zone, enabled
unbind Remove auto-advancing binding from a task task_id (required)
sync Reconcile all bound tasks immediately none
refresh_holidays Fetch official holiday-cn JSON (default: current & next year) and re-align bound tasks year (optional integer)

Behavior Notes & Limitations

  • Native UI shows "Once": bound tasks use a precise one-shot RRULE:FREQ=DAILY;COUNT=1 that the Host advances immediately after each delivery (zero idle wakeups). View the recurring rule and next 5 dates in Settings → Chinese workday schedule.
  • After unbinding or disabling: the native task retains its current one-shot COUNT=1 rule and stops auto-advancing. Edit it in Automation tasks if you want a standard recurring schedule.
  • Storage & security: bindings are persisted as volatile plugin config via DSH's configEditor; fetched holiday caches live in $DSH_HOME/plugins/dsh-cn-workday-schedule/holidays/. All mutating HTTP endpoints enforce same-origin checks.

Testing

node --test tests/*.test.mjs

License

MIT License

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.