@dreamtree-org/harness-device 0.1.6 → 0.1.7
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/platform/linux.js +13 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.7
|
|
4
|
+
|
|
5
|
+
- **Linux: upgrades and uninstall no longer fail on systemd's `harness.target.wants/` folder.** The installer took the folder for an old unit file and tried to delete it (EISDIR), so from 0.1.4 to 0.1.6 every upgrade after the first install was rolled back. An upgrade runs the new version's installer, so upgrading to 0.1.7 fixes an affected device with no manual steps.
|
|
6
|
+
|
|
3
7
|
## 0.1.6
|
|
4
8
|
|
|
5
9
|
- **Upgrade from a remote session, on any install.** The `upgrade` tool (you approve it) now also works on devices that run from a source folder: it applies the folder's current code. By default it then restarts the device gracefully, so every session, the asking one included, loads the new tools and resumes its conversation. CLI: `harness-device upgrade --apply [--restart] [--detach]`; `upgrade --restart` does the same after an npm upgrade.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamtree-org/harness-device",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Turn a Linux server into a reboot-proof Claude Code harness: Remote Control per project in tmux, a persistent Chromium + Playwright MCP on a virtual display, live viewers (noVNC, ttyd, Playwright UI), self-healing systemd services, plus Docker, Dokploy, ngrok and AI-provider tooling.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Partha Preetham Krishna",
|
package/src/platform/linux.js
CHANGED
|
@@ -49,13 +49,24 @@ export function renderServices(ctx, detect = true) {
|
|
|
49
49
|
const sysd = (args, env, opts = {}) => run('systemctl', ['--user', ...args], { env, ...opts });
|
|
50
50
|
|
|
51
51
|
/** Write units, drop stale ones, enable at boot, start; never restart tmux (live sessions). */
|
|
52
|
+
/**
|
|
53
|
+
* Our unit files in the user unit dir: plain files named harness[.-]…, never
|
|
54
|
+
* the harness.target.wants/ (or .requires/) folders systemd itself creates.
|
|
55
|
+
*/
|
|
56
|
+
export function ownUnitFiles(dir) {
|
|
57
|
+
if (!fs.existsSync(dir)) return [];
|
|
58
|
+
return fs.readdirSync(dir, { withFileTypes: true })
|
|
59
|
+
.filter((e) => /^harness[.-]/.test(e.name) && !e.isDirectory() && !/\.(wants|requires)$/.test(e.name))
|
|
60
|
+
.map((e) => e.name);
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
export function activate(ctx, files, { dryRun, graceful = false }) {
|
|
53
64
|
const env = userEnv(ctx.env);
|
|
54
65
|
const dir = serviceDir(env);
|
|
55
66
|
// Graceful (upgrades): restart only services whose unit file changed; the rest
|
|
56
67
|
// pick up new scripts at their next restart.
|
|
57
68
|
const changed = new Set(Object.keys(files).filter((n) => !fs.existsSync(path.join(dir, n)) || fs.readFileSync(path.join(dir, n), 'utf8') !== files[n]));
|
|
58
|
-
const stale =
|
|
69
|
+
const stale = ownUnitFiles(dir).filter((f) => !(f in files));
|
|
59
70
|
for (const f of stale) {
|
|
60
71
|
sysd(['disable', '--now', f], env, { dryRun, allowFail: true });
|
|
61
72
|
if (!dryRun) fs.rmSync(path.join(dir, f), { force: true });
|
|
@@ -78,7 +89,7 @@ export function deactivate(ctx, { dryRun }) {
|
|
|
78
89
|
const env = userEnv(ctx.env);
|
|
79
90
|
const dir = serviceDir(env);
|
|
80
91
|
sysd(['disable', '--now', 'harness.target', 'harness-ngrok.service', ...ctx.units.map(unitName)], env, { dryRun, allowFail: true });
|
|
81
|
-
|
|
92
|
+
for (const f of ownUnitFiles(dir)) {
|
|
82
93
|
dryRun ? console.log(color.dim(` rm ${f}`)) : fs.rmSync(path.join(dir, f), { force: true });
|
|
83
94
|
}
|
|
84
95
|
sysd(['daemon-reload'], env, { dryRun, allowFail: true });
|