@dreamtree-org/harness-device 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/package.json +1 -1
  3. package/src/cli.js +14 -3
package/README.md CHANGED
@@ -201,6 +201,7 @@ Disk running out? `harness-device cleanup`, or the `disk_cleanup` tool, lists wh
201
201
  - **What the pool may do:** `POOL_SCOPES` in config.env sets it (default `device:read,device:operate`). It's set on the machine only, and the hub can never raise it.
202
202
  - **Shared secrets and settings from the hub:** they never overwrite a secret you set locally, and never names such as `ANTHROPIC_*` or `SERVE_OWNER_PASSWORD`.
203
203
  - **Leaving:** `harness-device leave`, or Disconnect in the dashboard.
204
+ - **As root on a server:** the dashboard's install command creates a dedicated user (`harness`, or `HD_USER=name`), installs the system packages as root, and runs harness-device as that user with no sudo. `harness-device install --system-steps` prints what that system step runs for a user.
204
205
 
205
206
  **As a Dokploy app** (no host install): deploy `docker-compose.dokploy.yml` as a Compose app. Its comments list the environment variables and the domain. It serves a reduced set of tools: `resources`, `docker_summary`, `docker_limit` and `disk_cleanup` (Docker items), for the host's Docker, RAM, CPU and disk. Sessions, processes and the browser need the host install. The image is also built to `ghcr.io/dreamtree-org/harness-device` by `.github/workflows/image.yml`.
206
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamtree-org/harness-device",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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/cli.js CHANGED
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import readline from 'node:readline';
5
5
  import { spawnSync } from 'node:child_process';
6
6
  import { loadConfig, saveConfig, parseProjectSpec, validateConfig, renderProjectsTsv, paths as getPaths, SETTABLE_KEYS, setConfigValue, setSecret } from './config.js';
7
- import { ORDER, CAPABILITIES } from './capabilities.js';
7
+ import { ORDER, CAPABILITIES, systemStepsFor } from './capabilities.js';
8
8
  import { loadContext } from './context.js';
9
9
  import { install, uninstall } from './install.js';
10
10
  import * as doctor from './doctor.js';
@@ -17,7 +17,7 @@ import * as resources from './resources.js';
17
17
  import * as upgrader from './upgrade.js';
18
18
  import * as cleanup from './cleanup.js';
19
19
  import * as limits from './limits.js';
20
- import { PKG, log, color, run, writeFile, capture } from './util.js';
20
+ import { PKG, PKG_ROOT, log, color, run, writeFile, capture, which } from './util.js';
21
21
 
22
22
  const HELP = `${color.bold('harness-device')} ${PKG.version}: a reboot-proof dev device for remote AI agents (Claude Remote Control first)
23
23
 
@@ -25,6 +25,7 @@ ${color.bold('Set up')}
25
25
  init [--device <name>] [--project name:/dir ...] [--with cap,...] [--without cap,...] [--serve-mode conversation|server]
26
26
  [--dokploy-url https://your-dokploy]
27
27
  install [--dry-run] [--skip-system] install or update everything (idempotent; never drops live sessions)
28
+ install --system-steps print, as JSON, the system step a root installer runs for this user (changes nothing)
28
29
  doctor check everything, with fixes
29
30
  uninstall [--purge]
30
31
 
@@ -76,7 +77,7 @@ ${color.bold('Fleet')} (from any machine with ssh access to the devices)
76
77
  Capabilities: ${ORDER.map((id) => (CAPABILITIES[id].required ? `${id}*` : id)).join(', ')} (* always on)
77
78
  `;
78
79
 
79
- const BOOL_FLAGS = ['dryRun', 'skipSystem', 'skipPkg', 'graceful', 'json', 'purge', 'force', 'follow', 'help', 'version', 'check', 'auto', 'detach', 'hook', 'now', 'apply', 'restart', 'enforce', 'quiet'];
80
+ const BOOL_FLAGS = ['dryRun', 'skipSystem', 'skipPkg', 'graceful', 'json', 'purge', 'force', 'follow', 'help', 'version', 'check', 'auto', 'detach', 'hook', 'now', 'apply', 'restart', 'enforce', 'quiet', 'systemSteps'];
80
81
  const VALUE_FLAGS = ['enroll', 'device', 'project', 'with', 'without', 'capabilities', 'serveMode', 'provider', 'dokployUrl', 'port', 'to', 'wait', 'timeout', 'except'];
81
82
 
82
83
  // Commands whose tail is someone else's command line, kept verbatim:
@@ -203,6 +204,16 @@ export async function main(argv) {
203
204
 
204
205
  case 'install': {
205
206
  const ctx = loadContext(env, { dryRun: !!f.dryRun });
207
+ // For a root-run installer (HarnessPro's install command) that sets the
208
+ // device up for another user: what the system step would run, as JSON.
209
+ if (f.systemSteps) {
210
+ return console.log(JSON.stringify({
211
+ steps: systemStepsFor(ctx.caps).join(','),
212
+ setup: path.join(PKG_ROOT, 'sh', 'setup', `${ctx.platform.id}.sh`),
213
+ npx: which('npx', ctx.env) || 'npx',
214
+ user: env.USER || os.userInfo().username,
215
+ }));
216
+ }
206
217
  return install(ctx, { skipSystem: !!f.skipSystem, skipPkg: !!f.skipPkg, graceful: !!f.graceful });
207
218
  }
208
219