dsh-offhours 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -89,6 +89,15 @@ macOS 暂不支持(引擎用到 `flock`、`/proc`、GNU `readlink -f` 等)
89
89
  - 送审只留 5 类:选型不确定 / 影响演进 / 实施成本 / 条件做不成 / 政策风险。
90
90
  - 卡里必须有可机械核对的判据(命令),否则 worker 不得报 done。
91
91
 
92
+ ## 社区 / Community
93
+
94
+ - **源码**:https://github.com/shuke52tt/dsh-offhours
95
+ - **npm**:https://www.npmjs.com/package/dsh-offhours(`npx dsh-offhours ...`)
96
+ - **dshmarket 索引 PR**:https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/13017
97
+ - **官方 Show Your Plugins**:https://github.com/deepseek-ai/deepseek-harness/discussions/12568
98
+
99
+ 欢迎在官方帖或 issue 里反馈;插件按 MIT 发布。
100
+
92
101
  ## 开发
93
102
 
94
103
  ```bash
package/lib/runtime.js CHANGED
@@ -69,6 +69,10 @@ export function startScheduler(ctx, cfg, log = () => {}) {
69
69
  let stopped = false
70
70
  let inFlight = false
71
71
 
72
+ // 首帧心跳:面板/CLI 在启动后的第一秒就能看到“调度器在跑”,
73
+ // 而不是等第一个 interval/抖动(默认最多 30s)才出现,避免新用户一打开面板就看到假故障。
74
+ try { writeJsonAtomic(heartbeatPath(cfg), { at: Date.now(), startedAt: Date.now(), fired: [], initial: true }) } catch { /* 忽略 */ }
75
+
72
76
  const tick = async () => {
73
77
  if (stopped || inFlight) return
74
78
  inFlight = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-offhours",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "DSH 社区插件:把看板待办在低谷/夜间自动做掉(挑卡 → 独占 worktree → worker → 证据 → 合并回收),只依赖配置里的 git 仓库。",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/panel/index.js CHANGED
@@ -387,7 +387,11 @@ async function buildStatus(boardArg) {
387
387
  }
388
388
  } catch { out.problems.push('systemctl 查询失败(定时器状态未知)') }
389
389
  }
390
- if (configured && CFG.scheduler === 'plugin' && out.timer.active === 'unknown') {
390
+ if (CFG.scheduler === 'plugin' && !CFG.schedule.enabled) {
391
+ out.timer.active = 'disabled'
392
+ out.timer.raw = 'plugin schedule disabled'
393
+ }
394
+ if (configured && CFG.scheduler === 'plugin' && CFG.schedule.enabled && out.timer.active === 'unknown') {
391
395
  out.problems.push('插件内调度器没有心跳(确认 dsh 进程在跑,或 schedule.enabled=false)')
392
396
  }
393
397
 
@@ -536,11 +540,14 @@ async function buildStatus(boardArg) {
536
540
 
537
541
  // 最近日志(只取本板的行;我的日志格式是 `<时间> [<板>] ...`)
538
542
  try {
539
- const lines = readText(LOG).split('\n').filter((l) => l.includes(`[${board.key}]`))
540
- out.recent.log = tailLines(lines.length ? lines.join('\n') : readText(LOG), LOG_TAIL)
541
- } catch {
542
- out.problems.push('读不到 nightshift.log')
543
- }
543
+ const raw = readText(LOG)
544
+ if (raw) {
545
+ const lines = raw.split('\n').filter((l) => l.includes(`[${board.key}]`))
546
+ out.recent.log = tailLines(lines.length ? lines.join('\n') : raw, LOG_TAIL)
547
+ } else {
548
+ out.recent.log = []
549
+ }
550
+ } catch { /* 没有日志=还没跑过,不是故障 */ }
544
551
  try {
545
552
  out.recent.runs = readdirSync(RUNS)
546
553
  .filter((f) => f.endsWith('.out') || f.endsWith('.err'))