treg
superdesigndev
OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:kelai141/dsh-github-watchdog
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness (DSH) Agent Preset plugin that watches GitHub repositories and produces security-aware preliminary analysis of pull requests, CI runs, commits, and issues — read-only, with optional issue-comment publication only.
Watchdog behavior is scoped to conversations that select the GitHub Watchdog preset. Unlike a
host-global daemon, it starts one background job per selected conversation, polls on a fixed
interval while that conversation is open, and is cancelled when the conversation is disposed.
Ordinary conversations never mount the plugin and never see its tools.
The scheduler is a real Harness background job (
ctx.jobs) driven by the disposable timer service. When a poll observes a repository change, a bounded plugin notice wakes the conversation via the AgentfollowupAPI; unchanged polls never create model turns.
owner/repository entries in its configuration.POST /repos/{owner}/{repo}/issues/{number}/comments
(disabled by default).github_watchdog_inspect only serves whitelisted repositories.Build and pack the plugin:
npm install && npm run build && npm pack
Install the resulting dsh-github-watchdog-0.0.1.tgz into the DSH profile that your web host uses
(e.g. ~/.dsh/profiles/web). Two equivalent paths:
cd ~/.dsh/profiles/web
npm install /absolute/path/to/dsh-github-watchdog-0.0.1.tgz
or declare a link dependency in the profile package.json and run npm install
{
"dependencies": {
"@dsh-external/dsh-github-watchdog": "link:/absolute/path/to/this/repo"
}
}
The package must be resolvable from the DSH profile so the preset row can load it. Keep it out of the profile
bundleslist to avoid a host-global daemon; the plugin is designed to be mounted only by the preset.
Copy the preset/ directory into your local preset root and give it an id:
cp -r preset ~/.dsh/.agent-presets/github-watchdog
The directory contains agent.cordis.yml and preset.yml. Edit agent.cordis.yml if the plugin
package name or your config path differs.
mkdir -p ~/.dsh/github-watchdog
Create ~/.dsh/github-watchdog/config.json:
{
"repositories": [
{ "repository": "owner/repository", "workspace": "D:/path/to/local/checkout" }
],
"tokenEnv": "GH_TOKEN",
"intervalMs": 120000,
"comments": { "enabled": false, "maxPerHour": 4 }
}
repositories may be an empty array at first — the model will discover candidates from the
conversation workspace and ask you which to track.
The token is read from the environment variable named by tokenEnv (default GH_TOKEN). Set it in
the environment before the DSH host process starts, then restart the host so it inherits it:
export GH_TOKEN=github_pat_xxx # or GITHUB_TOKEN
github_watchdog_status; if no repository is configured it calls
github_watchdog_discover_workspace, lists the candidates it found under your workspace, and asks
which to track. After you confirm, it calls github_watchdog_configure and the first scan runs
immediately.| Key | Type | Default | Meaning |
|---|---|---|---|
repositories |
array | [] |
Explicit { repository, workspace? } whitelist |
tokenEnv |
string | DSH_GITHUB_WATCHDOG_TOKEN |
Env var holding the GitHub token |
intervalMs |
number | 120000 |
Poll interval (60 000–3 600 000 ms) |
comments.enabled |
boolean | false |
Publish automated analysis comments to PRs |
comments.maxPerHour |
number | 4 |
Per-repository hourly comment budget (1–20) |
stateFile |
string | ~/.dsh/github-watchdog/state.json |
Deduplication/snapshot state |
diagnostics.enabled |
boolean | true |
Write the rotating diagnostic log |
diagnostics.logFile |
string | next to config, watchdog.log |
Diagnostic log path |
The configuration is read on every poll, so edits apply without restarting.
| Tool | Kind | Purpose |
|---|---|---|
github_watchdog_status |
read | Current progress/report: job id, poll count, per-repo results, PR/issue titles + authors, next poll |
github_watchdog_discover_workspace |
read-only | List Git repositories under the conversation workspace with a GitHub origin; never writes |
github_watchdog_configure |
write (local) | Add only user-confirmed, workspace-discovered repositories to the whitelist; triggers an immediate scan |
github_watchdog_inspect |
read-only | Fetch full body, comments, or changed files of one PR/issue; whitelisted repos only |
agent/disposed cancels it.starting → scanning (per-repository progress) → observed, with
jobId, pollCount, timestamps, and nextPollAt on every status.watchdog.log, 256 KiB, one backup) records one line per poll,
per-repository outcome, notice keys, and errors — disable with diagnostics.enabled: false.npm run build # dependency-free copy build into lib/
npm test # node --test (route policy, redaction, dedup, lifecycle, discovery, inspect)
Layout:
src/core.js route policy, findings, fingerprinting, redaction
src/github.js bounded GitHub client (reads + optional issue comments)
src/state.js durable snapshot/comment ledger
src/index.js preset plugin: job loop, status, discovery, configure, inspect tools
test/ unit tests
preset/ agent preset to copy into ~/.dsh/.agent-presets/<id>/
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 库。