dsh-autorestart 0.3.6 → 0.6.0
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 +254 -11
- package/client.js +2500 -147
- package/cordis.patch.yml +24 -0
- package/docs/README.zh.md +160 -15
- package/index.js +1336 -80
- package/lib/checkpoint.js +116 -0
- package/lib/sleep.js +1012 -0
- package/locale/en.json +108 -1
- package/locale/zh.json +108 -1
- package/package.json +1 -1
package/locale/en.json
CHANGED
|
@@ -10,10 +10,117 @@
|
|
|
10
10
|
"withPluginsHint": "About 3 seconds and 117 MB more; a plugin that breaks the boot can be rolled back too.",
|
|
11
11
|
"configOnly": "Configuration only",
|
|
12
12
|
"configOnlyHint": "Instant, about 66 KB; plugin problems cannot be rolled back and need a manual reinstall.",
|
|
13
|
-
"footnote": "You can change this later in Settings →
|
|
13
|
+
"footnote": "You can change this later in Settings → Auto-restart & shut down",
|
|
14
14
|
"pickPrimary": "Use this",
|
|
15
15
|
"pickSecondary": "Configuration only",
|
|
16
16
|
"recommended": "Recommended",
|
|
17
17
|
"dismissAria": "Close this one-time prompt"
|
|
18
|
+
},
|
|
19
|
+
"settings": {
|
|
20
|
+
"nav": "Auto-restart & shut down",
|
|
21
|
+
"seconds": {
|
|
22
|
+
"label": "Countdown seconds",
|
|
23
|
+
"immediate": "No countdown (switch off right away)",
|
|
24
|
+
"value": "{n} seconds",
|
|
25
|
+
"hint": "After the button: wait for every conversation to be done, count down this many seconds and switch off. \"No countdown\" switches off as soon as the conversations are done."
|
|
26
|
+
},
|
|
27
|
+
"grace": {
|
|
28
|
+
"label": "Wait a few more seconds after the work is done",
|
|
29
|
+
"immediate": "Do not wait (restart/switch off right away)",
|
|
30
|
+
"value": "{n} seconds",
|
|
31
|
+
"hint": "After the last conversation finished, wait this long before the host is really restarted or switched off — this plugin only sees the DSH conversations, not the work other plugins queue with a timer. If a conversation starts working again while waiting, the timer starts over."
|
|
32
|
+
},
|
|
33
|
+
"backup": {
|
|
34
|
+
"label": "Backup before a restart",
|
|
35
|
+
"hint": "Take a snapshot of the current configuration before every restart, so a host that cannot boot again is rolled back automatically."
|
|
36
|
+
},
|
|
37
|
+
"backupPlugins": {
|
|
38
|
+
"label": "Include the installed plugins in the backup",
|
|
39
|
+
"hint": "Off: only the state of DSH itself is backed up — the plugin directory of the profile is left out."
|
|
40
|
+
},
|
|
41
|
+
"error": "Could not save the settings: {message}"
|
|
42
|
+
},
|
|
43
|
+
"sleep": {
|
|
44
|
+
"button": {
|
|
45
|
+
"label": "Shut down",
|
|
46
|
+
"cancel": "Cancel the shutdown",
|
|
47
|
+
"aria": "Graceful shutdown: wait for every session to finish, then power off",
|
|
48
|
+
"title": "Waits for every session to finish, counts down {n} seconds, then powers off",
|
|
49
|
+
"titleImmediate": "Waits for every session to finish, then powers off right away (no countdown)",
|
|
50
|
+
"busy": "Getting ready…"
|
|
51
|
+
},
|
|
52
|
+
"error": "Could not reach the sleep service: {message}",
|
|
53
|
+
"dryRun": {
|
|
54
|
+
"title": "Dry run: the machine stays on",
|
|
55
|
+
"body": "The rehearsal is over. This is the command it WOULD have run (nothing was executed):",
|
|
56
|
+
"close": "Got it"
|
|
57
|
+
},
|
|
58
|
+
"countdown": {
|
|
59
|
+
"caption": {
|
|
60
|
+
"20": "The whale is casting her net",
|
|
61
|
+
"19": "Your backup is already packed",
|
|
62
|
+
"18": "One unfinished thought, one more",
|
|
63
|
+
"17": "Everyone is quieting down",
|
|
64
|
+
"16": "One last lap around the room",
|
|
65
|
+
"15": "The sea is going dark",
|
|
66
|
+
"14": "One light at a time goes out",
|
|
67
|
+
"13": "The room has gone quiet",
|
|
68
|
+
"12": "A little bit left",
|
|
69
|
+
"11": "One last look at the screen",
|
|
70
|
+
"10": "The whale counts the last seconds",
|
|
71
|
+
"9": "Half the lights are out",
|
|
72
|
+
"8": "The voices get quieter",
|
|
73
|
+
"7": "The goodbyes are close",
|
|
74
|
+
"6": "One last sip of the sea",
|
|
75
|
+
"5": "The night wind gets lighter",
|
|
76
|
+
"4": "Say good night",
|
|
77
|
+
"3": "Three seconds, really",
|
|
78
|
+
"2": "Time for one last goodbye",
|
|
79
|
+
"1": "Good night 🌙",
|
|
80
|
+
"default": "Good night 🌙"
|
|
81
|
+
},
|
|
82
|
+
"remaining": "{n} seconds left",
|
|
83
|
+
"cancel": "Never mind, keep it on",
|
|
84
|
+
"goodNight": "Good night 🌙",
|
|
85
|
+
"hint": "Powering off in {n} seconds — pick \"Never mind, keep it on\" to stay."
|
|
86
|
+
},
|
|
87
|
+
"waiting": {
|
|
88
|
+
"title": "Waiting for everyone to finish",
|
|
89
|
+
"body": "Once these sessions are done, the machine powers off:",
|
|
90
|
+
"count": "{n} task(s) still working",
|
|
91
|
+
"subagents": "{k} of them are subagents",
|
|
92
|
+
"blocker": "· {title}",
|
|
93
|
+
"none": "(checking who is still busy)",
|
|
94
|
+
"cancel": "Keep it on"
|
|
95
|
+
},
|
|
96
|
+
"shuttingDown": {
|
|
97
|
+
"title": "Good night 🌙",
|
|
98
|
+
"body": "Powering off — the whale turned off the lights.",
|
|
99
|
+
"dryRun": "Dry run: nothing will really be powered off (it would have run {command})",
|
|
100
|
+
"dismiss": "Close this notice"
|
|
101
|
+
},
|
|
102
|
+
"choice": {
|
|
103
|
+
"title": "Keep the graceful shutdown button?",
|
|
104
|
+
"body": "It lives at the very bottom of the left sidebar, next to the Settings button: one click waits for every session to finish, counts down and powers the machine off.",
|
|
105
|
+
"keep": "Keep it (recommended)",
|
|
106
|
+
"keepCta": "Keep it",
|
|
107
|
+
"keepHint": "One moon button at the bottom of the left sidebar: one click to shut down gracefully.",
|
|
108
|
+
"hide": "No button, thanks",
|
|
109
|
+
"hideCta": "No button",
|
|
110
|
+
"hideHint": "The interface stays as it is; turn it on again in the settings whenever you want it.",
|
|
111
|
+
"footnote": "You can change this later in Settings → Auto-restart & shut down",
|
|
112
|
+
"diagramLabel": "The button sits at the bottom of the left sidebar, next to Settings",
|
|
113
|
+
"error": "Could not save the choice: {message}"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"announcement": {
|
|
117
|
+
"title": "New feature: graceful shutdown",
|
|
118
|
+
"line1": "There is a new 🌙 \"Shut down\" button at the very bottom of the left sidebar.",
|
|
119
|
+
"line2": "Click it → once every conversation is done it counts down {n} seconds and powers the machine off.",
|
|
120
|
+
"line2Generic": "Click it → once every conversation is done it counts down a few seconds and powers the machine off.",
|
|
121
|
+
"line3": "To change that, go to \"Settings → Auto-restart & shut down\".",
|
|
122
|
+
"disabled": "The button is currently switched off; you can turn it on in the settings.",
|
|
123
|
+
"button": "Got it",
|
|
124
|
+
"error": "Could not record it: {message}"
|
|
18
125
|
}
|
|
19
126
|
}
|
package/locale/zh.json
CHANGED
|
@@ -10,10 +10,117 @@
|
|
|
10
10
|
"withPluginsHint": "多约 3 秒、约 117 MB;插件把启动搞坏时也能回退。",
|
|
11
11
|
"configOnly": "只备份配置",
|
|
12
12
|
"configOnlyHint": "瞬间完成、约 66 KB;插件问题无法回退,需要手动重装。",
|
|
13
|
-
"footnote": "以后可在 设置 →
|
|
13
|
+
"footnote": "以后可在 设置 → 自动重启与关机 修改",
|
|
14
14
|
"pickPrimary": "用这个",
|
|
15
15
|
"pickSecondary": "只备份配置",
|
|
16
16
|
"recommended": "推荐",
|
|
17
17
|
"dismissAria": "关闭这个一次性提示"
|
|
18
|
+
},
|
|
19
|
+
"settings": {
|
|
20
|
+
"nav": "自动重启与关机",
|
|
21
|
+
"seconds": {
|
|
22
|
+
"label": "倒计时秒数",
|
|
23
|
+
"immediate": "不倒数(立即关机)",
|
|
24
|
+
"value": "{n} 秒",
|
|
25
|
+
"hint": "按下按钮后,等所有会话收工,再倒数这么多秒才关机;「不倒数」表示会话一收工就关机。"
|
|
26
|
+
},
|
|
27
|
+
"grace": {
|
|
28
|
+
"label": "收工后再等几秒(给记忆/总结类插件留时间)",
|
|
29
|
+
"immediate": "不等(立即重启/关机)",
|
|
30
|
+
"value": "{n} 秒",
|
|
31
|
+
"hint": "最后一个会话收工后,再等这么久才真正重启或关机——我们只看得见 DSH 的会话,看不见别的插件用定时器排队的活。等待期间如果又有会话开始干活,会重新计时。"
|
|
32
|
+
},
|
|
33
|
+
"backup": {
|
|
34
|
+
"label": "重启前备份",
|
|
35
|
+
"hint": "每次重启前先快照一次当前配置;万一重启后起不来,能自动回退。"
|
|
36
|
+
},
|
|
37
|
+
"backupPlugins": {
|
|
38
|
+
"label": "备份包含已安装插件",
|
|
39
|
+
"hint": "关闭后只备份 DSH 自身状态,不含 profile 里的插件目录。"
|
|
40
|
+
},
|
|
41
|
+
"error": "没能保存设置:{message}"
|
|
42
|
+
},
|
|
43
|
+
"sleep": {
|
|
44
|
+
"button": {
|
|
45
|
+
"label": "收工关机",
|
|
46
|
+
"cancel": "取消关机",
|
|
47
|
+
"aria": "收工关机:等所有会话收工后关机",
|
|
48
|
+
"title": "等所有会话收工,再倒数 {n} 秒关机",
|
|
49
|
+
"titleImmediate": "等所有会话收工后立即关机(不倒数)",
|
|
50
|
+
"busy": "准备中…"
|
|
51
|
+
},
|
|
52
|
+
"error": "没能联系上关机服务:{message}",
|
|
53
|
+
"dryRun": {
|
|
54
|
+
"title": "试运行:不会真的关机",
|
|
55
|
+
"body": "彩排结束,本来会执行这条命令(真的什么都没执行):",
|
|
56
|
+
"close": "知道了"
|
|
57
|
+
},
|
|
58
|
+
"countdown": {
|
|
59
|
+
"caption": {
|
|
60
|
+
"20": "鲸鱼娘开始收网了",
|
|
61
|
+
"19": "备份已经替你打包好",
|
|
62
|
+
"18": "没说完的话,再讲一句",
|
|
63
|
+
"17": "大家都在慢慢安静下来",
|
|
64
|
+
"16": "最后再巡一圈房间",
|
|
65
|
+
"15": "海面开始变暗了",
|
|
66
|
+
"14": "灯一盏一盏熄了",
|
|
67
|
+
"13": "房间已经安静下来",
|
|
68
|
+
"12": "还有一小会儿",
|
|
69
|
+
"11": "再看一眼屏幕吧",
|
|
70
|
+
"10": "鲸鱼娘在数最后几秒",
|
|
71
|
+
"9": "灯已经关了一半",
|
|
72
|
+
"8": "声音越来越小",
|
|
73
|
+
"7": "马上就到道别的时候了",
|
|
74
|
+
"6": "最后一口海水",
|
|
75
|
+
"5": "晚风越来越轻",
|
|
76
|
+
"4": "说声晚安吧",
|
|
77
|
+
"3": "真的只剩三秒啦",
|
|
78
|
+
"2": "还来得及说声再见",
|
|
79
|
+
"1": "晚安 🌙",
|
|
80
|
+
"default": "晚安 🌙"
|
|
81
|
+
},
|
|
82
|
+
"remaining": "还剩 {n} 秒",
|
|
83
|
+
"cancel": "算了,别关",
|
|
84
|
+
"goodNight": "晚安 🌙",
|
|
85
|
+
"hint": "再过 {n} 秒就关机,点「算了,别关」可以留下。"
|
|
86
|
+
},
|
|
87
|
+
"waiting": {
|
|
88
|
+
"title": "还在等大家收工",
|
|
89
|
+
"body": "等这些会话忙完,就轮到关机啦:",
|
|
90
|
+
"count": "还有 {n} 个任务在干活",
|
|
91
|
+
"subagents": "其中 {k} 个是子智能体",
|
|
92
|
+
"blocker": "· {title}",
|
|
93
|
+
"none": "(正在确认还有谁在忙)",
|
|
94
|
+
"cancel": "不关了"
|
|
95
|
+
},
|
|
96
|
+
"shuttingDown": {
|
|
97
|
+
"title": "晚安 🌙",
|
|
98
|
+
"body": "正在关机,鲸鱼娘把灯关好了。",
|
|
99
|
+
"dryRun": "试运行:不会真的关机(本来会执行 {command})",
|
|
100
|
+
"dismiss": "关掉这个提示"
|
|
101
|
+
},
|
|
102
|
+
"choice": {
|
|
103
|
+
"title": "收工关机按钮要不要留着?",
|
|
104
|
+
"body": "它待在左侧栏最底部、设置按钮旁边:点一下就等所有会话收工,倒数几秒后关机。",
|
|
105
|
+
"keep": "留着(推荐)",
|
|
106
|
+
"keepCta": "留着",
|
|
107
|
+
"keepHint": "左侧栏底部多一个月亮按钮,一键收工关机。",
|
|
108
|
+
"hide": "不要这个按钮",
|
|
109
|
+
"hideCta": "不要",
|
|
110
|
+
"hideHint": "界面保持原样;以后想用,再从设置里打开。",
|
|
111
|
+
"footnote": "以后可在 设置 → 自动重启与关机 修改",
|
|
112
|
+
"diagramLabel": "按钮出现在左侧栏最底部、设置按钮旁边",
|
|
113
|
+
"error": "保存失败:{message}"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"announcement": {
|
|
117
|
+
"title": "新功能:收工关机",
|
|
118
|
+
"line1": "左侧栏最底部多了一个 🌙「收工关机」按钮。",
|
|
119
|
+
"line2": "点一下 → 所有会话收工后倒数 {n} 秒关机。",
|
|
120
|
+
"line2Generic": "点一下 → 所有会话收工后倒数几秒关机。",
|
|
121
|
+
"line3": "想改行为,去「设置 → 自动重启与关机」。",
|
|
122
|
+
"disabled": "按钮目前关闭,可在设置里打开。",
|
|
123
|
+
"button": "知道了",
|
|
124
|
+
"error": "没能记下来:{message}"
|
|
18
125
|
}
|
|
19
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-autorestart",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DeepSeek Harness plugin: restart without losing work. Waits until every conversation is idle, restarts the host, then automatically resumes the interrupted sessions. AI-generated, not human-reviewed: use with caution.",
|
|
6
6
|
"license": "MIT",
|