ZhenMoon / dsh-scheduler

목록에 있음

Autonomous scheduled-task plugin for DeepSeek Harness (DSH): cron or fixed-interval subprocess jobs with recorded results, persisted across restarts

main기타 소스 보기

설치

npx -y @deepseek-ai/dsh plugin --profile web add github:ZhenMoon/dsh-scheduler

이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 db8cc53동기화 2026. 8. 18.

dsh-scheduler

An autonomous scheduled-task plugin for DeepSeek Harness (DSH), built as a dynamic Cordis plugin. It lets the agent schedule subprocess commands on a cron expression or a fixed interval, records each run's exit code and output tail, and persists everything to a JSON state file so schedules survive plugin restarts.

No npm dependencies. Scheduling runs on the DSH host process (timer service), execution uses the subprocess service.

What it does

PieceWhereRole
Host half (host-half.js)DSH host process1-second tick, cron/everyMs next-run computation, subprocess execution, result capture, JSON persistence
State file<data dir>/state.jsonSchedules + last run results, restored on plugin (re)start
schedule_add ──▶ host half ──1s tick──▶ due? ──▶ subprocess spawn ──▶ record exit/output
                                        │
                                        └────────▶ persist state.json

Requirements

  • DeepSeek Harness with the dynamic-Cordis extension
  • The host process must stay running for tasks to fire (results are read later via schedule_list)

Install

  1. Place this repo somewhere on the machine.

  2. In host-half.js, edit the two constants: STATE_PATH (where the JSON state lives) and BASE_CWD (default working directory for scheduled commands, and the writable root the sandbox policy is scoped to).

  3. In your DSH session, define the plugin — paste the entire content of host-half.js into code.host (host-only: no Client half, no approval):

    cordis_define(plugin: { kind: "new", idPrefix: "sched" },
                  name: "dsh-scheduler",
                  purpose: "Autonomous scheduled tasks: cron/everyMs subprocess jobs",
                  code: { host: <host-half.js> })
    cordis_run(pluginId, packageId, mode: "run")
    

Tools

ToolWhat it does
schedule_addAdd a task: kind: "everyMs" (fixed interval ≥ 1000 ms, optional runImmediately) or kind: "cron" (5 fields: minute hour day-of-month month day-of-week; supports *, */n, a-b, a,b; standard dom/dow OR semantics). argv is the command to run (argv[0] may be a bare name or absolute path), cwd optional.
schedule_listAll tasks: spec, enabled, next/last run (ISO), exit code, error, output tail, run count, plus any persistence error.
schedule_setEnable or disable a task.
schedule_removeDelete a task.
schedule_runRun a task now (even when disabled) and wait for the result — handy for testing.

Cron examples: 0 9 * * 1-5 (weekdays at 09:00), */5 * * * * (every 5 minutes), 0 0 1 * * (first day of each month at midnight).

Privacy & safety

  • Local only: commands run on your machine, results stay in the local state file; no telemetry.
  • Scheduled commands run with the same sandbox confinement as the session — check lastError if a command is denied.
  • Persistence writes use an explicit workspace-write policy scoped to BASE_CWD (the dynamic plugin context has no exec, so the sandbox-policy fallback would otherwise default to read-only and silently deny writes).
  • No notification channel exists yet: results accumulate in schedule_list for the agent to read on the next conversation.

Known limitations

  • Tasks survive plugin restarts, but not the harness process being down at fire time (missed fires run at the next tick once back up).
  • One run per task at a time; a still-running task skips its next fire.
  • No HTTP action kind yet — pair with dsh-http or wrap a command (node -e "fetch(...)") for scheduled network checks.

License

MIT

저장소 정보

언어
JavaScript
라이선스
MIT
마지막 업데이트
2026. 8. 16. 오후 5:17

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.