DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-attention-router

d

dsh-attention-router

Manifest valid

Attention router for DeepSeek Harness: alert / decide / inform routing so agents stop over-notifying.

hasBundlePatch

dsh-attention-router

npm version License: MIT

Author: jetpan (npm) ↔ jerentpan-lab (GitHub) | npm package | GitHub repo | install from GitHub: dsh plugin --profile web add github:jerentpan-lab/dsh-attention-router

Stop agents from over-notifying. Classify every event into one of three tiers and route it:

tiermeaningaction
alertfault, failure, data loss, rollback triggerdeliver now
deciderequires a human decision (approval, deletion, production change)queue for review
informcompleted work, records, metricslog only (silent)

This is the "attention is the bottleneck" pattern: agents should only interrupt a human for alerts and decisions, not for every completed step.

Install

dsh plugin --profile web add dsh-attention-router

Tools

  • notify_classify — classify text, return { tier, matched, action, notify }
  • notify_policy — show current policy and rule counts

Config (0.2.0)

{
  "rules": { "alert": ["lookup failure"], "decide": ["approve this"] },
  "rulesFile": "~/.dsh/attention-rules.json",
  "rulesFileWatch": true,
  "policy": { "notifyInform": false },
  "fallbackTier": "decide",
  "dedupe": { "cooldownMs": 60000, "stateFile": "~/.dsh/attention-dedupe.json", "maxEntries": 1000 }
}
  • rulesFile: external JSON rules ({alert?: string[], decide?: string[], inform?: string[]}); missing file falls back to defaults with a warning; rulesFileWatch: true hot-reloads on change.
  • dedupe.stateFile: persists cooldown state across restarts (atomic write; corrupt state is quarantined with a warning).
  • Unknown keys, unknown tiers and invalid values throw a readable ConfigError.
  • Example: config.example.json. Run npm run verify for tests + pack-content/size/safety checks.

Demo

node examples/demo.mjs

Bench

node bench/bench.mjs writes bench/RESULTS.md (this host: 1000 classify p50 ≈ 19.8ms, 10000 ≈ 184.9ms).

Troubleshooting (error table)

SymptomCauseFix
ConfigError ... unknown keytypo/unsupported config keyuse keys from config.example.json
ConfigError ... rules.<tier>tier not alert/decide/informfix tier name
ConfigError ... dedupe.cooldownMsnegative/NaN numberuse a finite number >= 0
rulesFile not found warningexternal rules path missingkeep defaults or fix path
rulesFile: invalid JSONmalformed rule filevalidate JSON
dedupe state unreadable warningstate file corruptit is ignored; delete it to reset
rule conflict warningsame literal in multiple tierskeep the pattern in one tier only

Verify

npm run verify   # unit tests + npm pack content/size/safety checks

License

MIT

Comments

Loading…