dsh-session-guard 4.2.9 → 4.2.11

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
@@ -377,4 +377,15 @@ weekendMode 升级为休息日语义:法定假日(含落在工作日的)
377
377
 
378
378
  ## License
379
379
 
380
- MIT — 见 [LICENSE](LICENSE)。
380
+ MIT — 见 [LICENSE](LICENSE)。
381
+
382
+ ## TUI 终端面(dsh-tui)
383
+
384
+ dsh-tui 不加载插件的 client 半边(面板/卡片/设置页),也调不到插件自有 RPC;工具调用只显示一行摘要。人可读、人可操作的面只剩宿主斜杠命令。输出约定:单行 ≤100 字符、总行 ≤40、无 ANSI、两空格对齐;写操作默认 dry、加 `--yes` 才执行;`--json` 输出单行 JSON。
385
+
386
+ | 命令 | 作用 |
387
+ |---|---|
388
+ | `/guard status` | 门状态与 live state |
389
+ | `/guard pause|resume|cancel` | 包装既有 `/pause` `/resume` `/cancel`;**`/resume` 在 dsh-tui 下被本地命令遮蔽,必须走 `/guard resume`** |
390
+
391
+ 命令由插件自己在宿主侧注册(`ctx.inject(['commands'], …)`):命令服务缺席的老宿主线上不激活、不报错。
package/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-session-guard",
3
- "version": "4.2.9",
3
+ "version": "4.2.11",
4
4
  "main": "./src/index.js",
5
5
  "description": "高峰自动会话门:step 级门控 + 周末模式 + 高峰自动暂停 + 官方源二维判定 + 会话级冻结 + 后端自动重试。",
6
6
  "engines": {
package/lib/client.js CHANGED
@@ -134,8 +134,9 @@ window.__ModuleLoader__.load({
134
134
  manual: false
135
135
  };
136
136
  const manual = b.paused?.manual === true || b.stepGate?.manual === true || b.state?.stepManual === true;
137
- const paused = b.paused?.step === true || b.state?.pausedStep === true || manual;
138
- const raw = b.stepGate?.since ?? b.state?.stepHeldSince ?? null;
137
+ const requestHeld = b.paused?.request === true || b.requestGate?.held === true || b.state?.requestHeld === true;
138
+ const paused = b.paused?.any === true || b.state?.pausedAny === true || b.paused?.step === true || b.state?.pausedStep === true || requestHeld || manual;
139
+ const raw = b.stepGate?.since ?? b.state?.stepHeldSince ?? b.requestGate?.since ?? b.state?.requestHeldSince ?? null;
139
140
  return {
140
141
  paused,
141
142
  heldSince: typeof raw === "number" && Number.isFinite(raw) ? raw : null,